/* * GoJS v2.3.12 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.12/license.html. * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE. */ (function() { var t;function ba(a){var b=0;return function(){return b=e}}); ra("Array.prototype.fill",function(a){return a?a:function(a,c,d){var b=this.length||0;0>c&&(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):v("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)} function Ma(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):v("Cannot remove an object from an HTMLCollection or NodeList at "+b)}function Na(){var a=Oa.pop();return void 0===a?[]:a}function Pa(a){a.length=0;Oa.push(a)}function za(a){return null===a?"*":"string"===typeof a?a:"function"===typeof a&&"string"===typeof a.className?a.className:""} function Qa(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(Ga(a)&&a.constructor)return Qa(a.constructor);return typeof a} function Ra(a){var b=a;Ga(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 Sa(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.WA;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1} function Ta(a,b,c){Object.defineProperty(Ua.prototype,a,{get:b,set:c})} function Va(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;Da(a)}a=a.s;var b=a.length,c=++this.fb,d=this.Cf;if(null!==d)for(;cthis.key)return!1;Da(a)}var b=--this.fb;if(0<=b)return this.key=b,this.value=a.s[b],!0;this.je();return!1};hb.prototype.Gd=function(){return this.next()}; hb.prototype.first=function(){var a=this.Hb;this.wa=a.A;var b=a.s;this.fb=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};hb.prototype.any=function(a){var b=this.Hb;b.Tg=null;var c=b.A,d=b.s,e=d.length;this.fb=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.A!==c&&Da(b)}return!1};hb.prototype.all=function(a){var b=this.Hb;b.Tg=null;var c=b.A,d=b.s,e=d.length;this.fb=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.A!==c&&Da(b)}return!0}; hb.prototype.each=function(a){var b=this.Hb;b.Tg=null;var c=b.A,d=b.s,e=d.length;this.fb=e;for(--e;0<=e;e--)a(d[e]),b.A!==c&&Da(b);return this};hb.prototype.map=function(a){var b=this.Hb;b.Tg=null;var c=b.A,d=[],e=b.s,f=e.length;this.fb=f;for(--f;0<=f;f--)d.push(a(e[f])),b.A!==c&&Da(b);a=new I;a.s=d;a.Db();return a.iterator}; hb.prototype.filter=function(a){var b=this.Hb;b.Tg=null;var c=b.A,d=[],e=b.s,f=e.length;this.fb=f;for(--f;0<=f;f--){var g=e[f];a(g)&&d.push(g);b.A!==c&&Da(b)}a=new I;a.s=d;a.Db();return a.iterator};hb.prototype.je=function(){this.key=-1;this.value=null;this.wa=-1;this.Hb.Tg=this};hb.prototype.toString=function(){return"ListIteratorBackwards("+this.fb+"/"+this.Hb.count+")"}; oa.Object.defineProperties(hb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.Hb.s.length}}});hb.prototype.first=hb.prototype.first;hb.prototype.hasNext=hb.prototype.Gd;hb.prototype.next=hb.prototype.next;hb.prototype.reset=hb.prototype.reset;hb.className="ListIteratorBackwards"; function I(a){Ya(this);this._isFrozen=!1;this.s=[];this.A=0;this.Tg=this.Xa=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=I.prototype;t.Db=function(){var a=this.A;a++;999999999a||a>=b.length)&&Ba(a,"0 <= i < length",I,"elt:i");return b[a]};t.get=function(a){return this.P(a)};t.jd=function(a,b){G&&D(a,I,"setElt:i");var c=this.s;(0>a||a>=c.length)&&Ba(a,"0 <= i < length",I,"setElt:i");this._isFrozen&&xa(this,a);c[a]=b};t.set=function(a,b){this.jd(a,b)};t.first=function(){var a=this.s;return 0===a.length?null:a[0]}; t.qc=function(){var a=this.s,b=a.length;return 0a&&Ba(a,">= 0",I,"insertAt:i");this._isFrozen&&xa(this,a);var c=this.s;a>=c.length?c.push(b):c.splice(a,0,b);this.Db()};t.remove=function(a){if(null===a)return!1;this._isFrozen&&xa(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.Db();return!0};t.delete=function(a){return this.remove(a)}; t.sb=function(a){G&&D(a,I,"removeAt:i");var b=this.s;(0>a||a>=b.length)&&Ba(a,"0 <= i < length",I,"removeAt:i");this._isFrozen&&xa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Db()};t.removeRange=function(a,b){G&&(D(a,I,"removeRange:from"),D(b,I,"removeRange:to"));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&&xa(this);for(var e=a,f=b+1;f=f)return this;(0>b||b>=e-1)&&Ba(b,"0 <= from < length",I,"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 eb;var a=this.Xa;return null!==a?(a.reset(),a):new gb(this)}},iteratorBackwards:{configurable:!0, enumerable:!0,get:function(){if(0>=this.s.length)return eb;var a=this.Tg;return null!==a?(a.reset(),a):new hb(this)}}});I.prototype.reverse=I.prototype.reverse;I.prototype.sortRange=I.prototype.Mi;I.prototype.sort=I.prototype.sort;I.prototype.toSet=I.prototype.Xv;I.prototype.toArray=I.prototype.La;I.prototype.removeRange=I.prototype.removeRange;I.prototype.removeAt=I.prototype.sb;I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.insertAt=I.prototype.Mb; I.prototype.pop=I.prototype.pop;I.prototype.last=I.prototype.qc;I.prototype.first=I.prototype.first;I.prototype.set=I.prototype.set;I.prototype.setElt=I.prototype.jd;I.prototype.get=I.prototype.get;I.prototype.elt=I.prototype.P;I.prototype.indexOf=I.prototype.indexOf;I.prototype.has=I.prototype.has;I.prototype.contains=I.prototype.contains;I.prototype.clear=I.prototype.clear;I.prototype.addAll=I.prototype.addAll;I.prototype.push=I.prototype.push;I.prototype.add=I.prototype.add;I.prototype.thaw=I.prototype.qa; I.prototype.freeze=I.prototype.freeze;I.className="List";function lb(a){this.qg=a;a.Xa=null;this.wa=a.A;this.ya=null}lb.prototype.reset=function(){var a=this.qg;a.Xa=null;this.wa=a.A;this.ya=null};lb.prototype.next=function(){var a=this.qg;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ca;if(null!==b)return this.ya=b,this.value=b.value,this.key=b.key,!0;this.je();return!1};lb.prototype.Gd=function(){return this.next()}; lb.prototype.first=function(){var a=this.qg;this.wa=a.A;a=a.ja;if(null!==a){this.ya=a;var b=a.value;this.key=a.key;return this.value=b}return null};lb.prototype.any=function(a){var b=this.qg;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Ca}return!1};lb.prototype.all=function(a){var b=this.qg;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Ca}return!0}; lb.prototype.each=function(a){var b=this.qg;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Ca;return this};lb.prototype.map=function(a){var b=this.qg;b.Xa=null;for(var c=new I,d=b.A,e=b.ja;null!==e;)c.add(a(e.value)),b.A!==d&&Da(b),e=e.Ca;return c.iterator};lb.prototype.filter=function(a){var b=this.qg;b.Xa=null;for(var c=new I,d=b.A,e=b.ja;null!==e;){var f=e.value;a(f)&&c.add(f);b.A!==d&&Da(b);e=e.Ca}return c.iterator}; lb.prototype.je=function(){this.value=this.key=null;this.wa=-1;this.qg.Xa=this};lb.prototype.toString=function(){return null!==this.ya?"SetIterator@"+this.ya.value:"SetIterator"};oa.Object.defineProperties(lb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.qg.Zb}}});lb.prototype.first=lb.prototype.first;lb.prototype.hasNext=lb.prototype.Gd;lb.prototype.next=lb.prototype.next;lb.prototype.reset=lb.prototype.reset; lb.className="SetIterator";function J(a){Ya(this);this._isFrozen=!1;this.$b={};this.Zb=0;this.Xa=null;this.A=0;this.xf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=J.prototype;t.Db=function(){var a=this.A;a++;999999999=this.Zb)return eb;var a=this.Xa;return null!==a?(a.reset(),a):new lb(this)}}});J.prototype.toList=J.prototype.Wv;J.prototype.toArray=J.prototype.La; J.prototype.clear=J.prototype.clear;J.prototype.retainAll=J.prototype.JA;J.prototype.removeAll=J.prototype.vp;J.prototype["delete"]=J.prototype.delete;J.prototype.remove=J.prototype.remove;J.prototype.first=J.prototype.first;J.prototype.containsAny=J.prototype.kz;J.prototype.containsAll=J.prototype.jz;J.prototype.has=J.prototype.has;J.prototype.contains=J.prototype.contains;J.prototype.addAll=J.prototype.addAll;J.prototype.add=J.prototype.add;J.prototype.thaw=J.prototype.qa;J.prototype.freeze=J.prototype.freeze; var ob=1;J.className="Set";J.uniqueHash=Ya;J.hashIdUnique=mb;J.hashId=ib;function pb(a){this.sa=a;this.wa=a.A;this.ya=null}pb.prototype.reset=function(){this.wa=this.sa.A;this.ya=null};pb.prototype.next=function(){var a=this.sa;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ca;if(null!==b)return this.ya=b,this.value=this.key=a=b.key,!0;this.je();return!1};pb.prototype.Gd=function(){return this.next()}; pb.prototype.first=function(){var a=this.sa;this.wa=a.A;a=a.ja;return null!==a?(this.ya=a,this.value=this.key=a=a.key):null};pb.prototype.any=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d.key))return!0;b.A!==c&&Da(b);d=d.Ca}return!1};pb.prototype.all=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d.key))return!1;b.A!==c&&Da(b);d=d.Ca}return!0}; pb.prototype.each=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d.key),b.A!==c&&Da(b),d=d.Ca;return this};pb.prototype.map=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)d.add(a(e.key)),b.A!==c&&Da(b),e=e.Ca;return d.iterator};pb.prototype.filter=function(a){var b=this.sa,c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;){var f=e.key;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Ca}return d.iterator}; pb.prototype.je=function(){this.value=this.key=null;this.wa=-1};pb.prototype.toString=function(){return null!==this.ya?"MapKeySetIterator@"+this.ya.value:"MapKeySetIterator"};oa.Object.defineProperties(pb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.sa.Zb}}});pb.prototype.first=pb.prototype.first;pb.prototype.hasNext=pb.prototype.Gd;pb.prototype.next=pb.prototype.next;pb.prototype.reset=pb.prototype.reset; pb.className="MapKeySetIterator";function qb(a){J.call(this);Ya(this);this._isFrozen=!0;this.sa=a}na(qb,J);t=qb.prototype;t.freeze=function(){return this};t.qa=function(){return this};t.toString=function(){return"MapKeySet("+this.sa.toString()+")"};t.add=function(){v("This Set is read-only: "+this.toString())};t.contains=function(a){return this.sa.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){v("This Set is read-only: "+this.toString())};t.delete=function(a){return this.remove(a)}; t.clear=function(){v("This Set is read-only: "+this.toString())};t.first=function(){var a=this.sa.ja;return null!==a?a.key:null};qb.prototype.any=function(a){for(var b=this.sa.ja;null!==b;){if(a(b.key))return!0;b=b.Ca}return!1};qb.prototype.all=function(a){for(var b=this.sa.ja;null!==b;){if(!a(b.key))return!1;b=b.Ca}return!0};qb.prototype.each=function(a){for(var b=this.sa.ja;null!==b;)a(b.key),b=b.Ca;return this}; qb.prototype.map=function(a){for(var b=new J,c=this.sa.ja;null!==c;)b.add(a(c.key)),c=c.Ca;return b};qb.prototype.filter=function(a){for(var b=new J,c=this.sa.ja;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Ca}return b};qb.prototype.copy=function(){return new qb(this.sa)};qb.prototype.Xv=function(){var a=new J,b=this.sa.$b,c;for(c in b)a.add(b[c].key);return a};qb.prototype.La=function(){var a=this.sa.$b,b=Array(this.sa.Zb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b}; qb.prototype.Wv=function(){var a=new I,b=this.sa.$b,c;for(c in b)a.add(b[c].key);return a};oa.Object.defineProperties(qb.prototype,{count:{configurable:!0,get:function(){return this.sa.Zb}},size:{configurable:!0,get:function(){return this.sa.Zb}},iterator:{configurable:!0,get:function(){return 0>=this.sa.Zb?eb:new pb(this.sa)}}});qb.prototype.toList=qb.prototype.Wv;qb.prototype.toArray=qb.prototype.La;qb.prototype.toSet=qb.prototype.Xv; qb.prototype.first=qb.prototype.first;qb.prototype.clear=qb.prototype.clear;qb.prototype["delete"]=qb.prototype.delete;qb.prototype.remove=qb.prototype.remove;qb.prototype.has=qb.prototype.has;qb.prototype.contains=qb.prototype.contains;qb.prototype.add=qb.prototype.add;qb.prototype.thaw=qb.prototype.qa;qb.prototype.freeze=qb.prototype.freeze;qb.className="MapKeySet";function rb(a){this.sa=a;a.wf=null;this.wa=a.A;this.ya=null} rb.prototype.reset=function(){var a=this.sa;a.wf=null;this.wa=a.A;this.ya=null};rb.prototype.next=function(){var a=this.sa;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ca;if(null!==b)return this.ya=b,this.value=b.value,this.key=b.key,!0;this.je();return!1};rb.prototype.Gd=function(){return this.next()};rb.prototype.first=function(){var a=this.sa;this.wa=a.A;a=a.ja;if(null!==a){this.ya=a;var b=a.value;this.key=a.key;return this.value=b}return null}; rb.prototype.any=function(a){var b=this.sa;b.wf=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d.value))return!0;b.A!==c&&Da(b);d=d.Ca}return!1};rb.prototype.all=function(a){var b=this.sa;b.wf=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d.value))return!1;b.A!==c&&Da(b);d=d.Ca}return!0};rb.prototype.each=function(a){var b=this.sa;b.wf=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d.value),b.A!==c&&Da(b),d=d.Ca;return this}; rb.prototype.map=function(a){var b=this.sa;b.wf=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)d.add(a(e.value)),b.A!==c&&Da(b),e=e.Ca;return d.iterator};rb.prototype.filter=function(a){var b=this.sa;b.wf=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;){var f=e.value;a(f)&&d.add(f);b.A!==c&&Da(b);e=e.Ca}return d.iterator};rb.prototype.je=function(){this.value=this.key=null;this.wa=-1;this.sa.wf=this}; rb.prototype.toString=function(){return null!==this.ya?"MapValueSetIterator@"+this.ya.value:"MapValueSetIterator"};oa.Object.defineProperties(rb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.sa.Zb}}});rb.prototype.first=rb.prototype.first;rb.prototype.hasNext=rb.prototype.Gd;rb.prototype.next=rb.prototype.next;rb.prototype.reset=rb.prototype.reset;rb.className="MapValueSetIterator"; function nb(a,b){this.key=a;this.value=b;this.yl=this.Ca=null}nb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};nb.className="KeyValuePair";function ub(a){this.sa=a;a.Xa=null;this.wa=a.A;this.ya=null}ub.prototype.reset=function(){var a=this.sa;a.Xa=null;this.wa=a.A;this.ya=null}; ub.prototype.next=function(){var a=this.sa;if(a.A!==this.wa){if(null===this.key)return!1;Da(a)}var b=this.ya;b=null===b?a.ja:b.Ca;if(null!==b)return this.ya=b,this.key=b.key,this.value=b.value,!0;this.je();return!1};ub.prototype.Gd=function(){return this.next()};ub.prototype.first=function(){var a=this.sa;this.wa=a.A;a=a.ja;return null!==a?(this.ya=a,this.key=a.key,this.value=a.value,a):null}; ub.prototype.any=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(a(d))return!0;b.A!==c&&Da(b);d=d.Ca}return!1};ub.prototype.all=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;){if(!a(d))return!1;b.A!==c&&Da(b);d=d.Ca}return!0};ub.prototype.each=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=b.ja;null!==d;)a(d),b.A!==c&&Da(b),d=d.Ca;return this}; ub.prototype.map=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)d.add(a(e)),b.A!==c&&Da(b),e=e.Ca;return d.iterator};ub.prototype.filter=function(a){var b=this.sa;b.Xa=null;var c=b.A;this.ya=null;for(var d=new I,e=b.ja;null!==e;)a(e)&&d.add(e),b.A!==c&&Da(b),e=e.Ca;return d.iterator};ub.prototype.je=function(){this.value=this.key=null;this.wa=-1;this.sa.Xa=this};ub.prototype.toString=function(){return null!==this.ya?"MapIterator@"+this.ya:"MapIterator"}; oa.Object.defineProperties(ub.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.sa.Zb}}});ub.prototype.first=ub.prototype.first;ub.prototype.hasNext=ub.prototype.Gd;ub.prototype.next=ub.prototype.next;ub.prototype.reset=ub.prototype.reset;ub.className="MapIterator"; function vb(a){Ya(this);this._isFrozen=!1;this.$b={};this.Zb=0;this.wf=this.Xa=null;this.A=0;this.xf=this.ja=null;(G&&"function"===typeof a||"string"===typeof a)&&v("Error: Since 2.0 List/Map/Set constructors no longer take an argument that enforces type.");void 0!==a&&this.addAll(a)}t=vb.prototype;t.Db=function(){var a=this.A;a++;999999999=this.count)return eb;var a=this.Xa;return null!==a?(a.reset(),a):new ub(this)}},iteratorKeys:{configurable:!0,get:function(){return 0>=this.count?eb:new pb(this)}},iteratorValues:{configurable:!0,get:function(){if(0>=this.count)return eb; var a=this.wf;return null!==a?(a.reset(),a):new rb(this)}}});vb.prototype.toKeySet=vb.prototype.Xf;vb.prototype.toArray=vb.prototype.La;vb.prototype.clear=vb.prototype.clear;vb.prototype["delete"]=vb.prototype.delete;vb.prototype.remove=vb.prototype.remove;vb.prototype.get=vb.prototype.get;vb.prototype.getValue=vb.prototype.L;vb.prototype.has=vb.prototype.has;vb.prototype.contains=vb.prototype.contains;vb.prototype.first=vb.prototype.first;vb.prototype.addAll=vb.prototype.addAll; vb.prototype.set=vb.prototype.set;vb.prototype.add=vb.prototype.add;vb.prototype.thaw=vb.prototype.qa;vb.prototype.freeze=vb.prototype.freeze;vb.className="Map";function K(a,b){void 0===a?this.K=this.J=0:"number"===typeof a&&"number"===typeof b?(this.J=a,this.K=b):v("Invalid arguments to Point constructor: "+a+", "+b);this._isFrozen=!1}var yb,zb,Ab,Bb,Cb;K.prototype.assign=function(a){this.J=a.J;this.K=a.K;return this};K.prototype.h=function(a,b){this.J=a;this.K=b;return this}; K.prototype.Eg=function(a,b){G&&(B(a,"number",K,"setTo:x"),B(b,"number",K,"setTo:y"),this.na());this.J=a;this.K=b;return this};K.prototype.set=function(a){G&&(x(a,K,K,"set:p"),this.na());this.J=a.J;this.K=a.K;return this};K.prototype.copy=function(){var a=new K;a.J=this.J;a.K=this.K;return a};t=K.prototype;t.pa=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this}; t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.na=function(a){if(G&&this._isFrozen){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function Db(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 K(c,e)}return new K} function Eb(a){G&&x(a,K);return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.D=function(a){return a instanceof K?this.J===a.x&&this.K===a.y:!1};t.ui=function(a,b){return this.J===a&&this.K===b};t.cb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)};t.add=function(a){G&&(x(a,K,K,"add:p"),this.na());this.J+=a.x;this.K+=a.y;return this};t.ze=function(a){G&&(x(a,K,K,"subtract:p"),this.na());this.J-=a.x;this.K-=a.y;return this}; t.offset=function(a,b){G&&(D(a,K,"offset:dx"),D(b,K,"offset:dy"),this.na());this.J+=a;this.K+=b;return this};K.prototype.rotate=function(a){G&&(D(a,K,"rotate:angle"),this.na());if(0===a)return this;var b=this.J,c=this.K;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.J=a*b-d*c;this.K=d*b+a*c;return this};t=K.prototype; t.scale=function(a,b){G&&(D(a,K,"scale:sx"),D(b,K,"scale:sy"),this.na());this.J*=a;this.K*=b;return this};t.Nf=function(a){G&&x(a,K,K,"distanceSquaredPoint:p");var b=a.x-this.J;a=a.y-this.K;return b*b+a*a};t.Fd=function(a,b){G&&(D(a,K,"distanceSquared:px"),D(b,K,"distanceSquared:py"));a-=this.J;b-=this.K;return a*a+b*b};t.normalize=function(){G&&this.na();var a=this.J,b=this.K,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.iz=function(a,b){G&&(x(a,K,K,"compareWithLineSegmentPoint:p"),x(b,K,K,"compareWithLineSegmentPoint:q"));return L.Tl(a.x,a.y,b.x,b.y,this.x,this.y)};t.zA=function(a,b,c,d){G&&(D(a,K,"projectOntoLineSegment:px"),D(b,K,"projectOntoLineSegment:py"),D(c,K,"projectOntoLineSegment:qx"),D(d,K,"projectOntoLineSegment:qy"));L.Bh(a,b,c,d,this.J,this.K,this);return this}; t.AA=function(a,b){G&&(x(a,K,K,"projectOntoLineSegmentPoint:p"),x(b,K,K,"projectOntoLineSegmentPoint:q"));L.Bh(a.x,a.y,b.x,b.y,this.J,this.K,this);return this};t.OA=function(a,b,c,d){G&&(D(a,K,"snapToGrid:originx"),D(b,K,"snapToGrid:originy"),D(c,K,"snapToGrid:cellwidth"),D(d,K,"snapToGrid:cellheight"));L.Zo(this.J,this.K,a,b,c,d,this);return this};t.PA=function(a,b){G&&(x(a,K,K,"snapToGridPoint:p"),x(b,Gb,K,"snapToGridPoint:q"));L.Zo(this.J,this.K,a.x,a.y,b.width,b.height,this);return this}; t.Ki=function(a,b){G&&(x(a,M,K,"setRectSpot:r"),x(b,Hb,K,"setRectSpot:spot"),this.na());this.J=a.x+b.x*a.width+b.offsetX;this.K=a.y+b.y*a.height+b.offsetY;return this};t.Li=function(a,b,c,d,e){G&&(D(a,K,"setSpot:x"),D(b,K,"setSpot:y"),D(c,K,"setSpot:w"),D(d,K,"setSpot:h"),(0>c||0>d)&&v("Point.setSpot:Width and height cannot be negative"),x(e,Hb,K,"setSpot:spot"),this.na());this.J=a+e.x*c+e.offsetX;this.K=b+e.y*d+e.offsetY;return this}; t.transform=function(a){G&&x(a,Ib,K,"transform:t");a.Ma(this);return this};function Jb(a,b){G&&x(b,Ib,K,"transformInverted:t");b.Jd(a);return a} function Kb(a,b,c,d,e,f){G&&(D(a,K,"distanceLineSegmentSquared:px"),D(b,K,"distanceLineSegmentSquared:py"),D(c,K,"distanceLineSegmentSquared:ax"),D(d,K,"distanceLineSegmentSquared:ay"),D(e,K,"distanceLineSegmentSquared:bx"),D(f,K,"distanceLineSegmentSquared:by"));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 Lb(a,b,c,d){G&&(D(a,K,"distanceSquared:px"),D(b,K,"distanceSquared:py"),D(c,K,"distanceSquared:qx"),D(d,K,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b}function Mb(a,b,c,d){G&&(D(a,K,"direction:px"),D(b,K,"direction:py"),D(c,K,"direction:qx"),D(d,K,"direction:qy"));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.u=function(){return isFinite(this.x)&&isFinite(this.y)};K.alloc=function(){var a=Nb.pop();return void 0===a?new K:a};K.allocAt=function(a,b){var c=Nb.pop();if(void 0===c)return new K(a,b);c.x=a;c.y=b;return c};K.free=function(a){Nb.push(a)}; oa.Object.defineProperties(K.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(B(a,"number",K,"x"),this.na(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(B(a,"number",K,"y"),this.na(a));this.K=a}}});K.prototype.isReal=K.prototype.u;K.prototype.setSpot=K.prototype.Li;K.prototype.setRectSpot=K.prototype.Ki;K.prototype.snapToGridPoint=K.prototype.PA;K.prototype.snapToGrid=K.prototype.OA; K.prototype.projectOntoLineSegmentPoint=K.prototype.AA;K.prototype.projectOntoLineSegment=K.prototype.zA;K.intersectingLineSegments=function(a,b,c,d,e,f,g,h){G&&(D(a,K,"intersectingLineSegments:a1x"),D(b,K,"intersectingLineSegments:a1y"),D(c,K,"intersectingLineSegments:a2x"),D(d,K,"intersectingLineSegments:a2y"),D(e,K,"intersectingLineSegments:b1x"),D(f,K,"intersectingLineSegments:b1y"),D(g,K,"intersectingLineSegments:b2x"),D(h,K,"intersectingLineSegments:b2y"));return L.em(a,b,c,d,e,f,g,h)}; K.prototype.compareWithLineSegmentPoint=K.prototype.iz;K.compareWithLineSegment=function(a,b,c,d,e,f){G&&(D(a,K,"compareWithLineSegment:a1x"),D(b,K,"compareWithLineSegment:a1y"),D(c,K,"compareWithLineSegment:a2x"),D(d,K,"compareWithLineSegment:a2y"),D(e,K,"compareWithLineSegment:b1x"),D(f,K,"compareWithLineSegment:b1y"));return L.Tl(a,b,c,d,e,f)};K.prototype.direction=K.prototype.direction;K.prototype.directionPoint=K.prototype.gb;K.prototype.normalize=K.prototype.normalize; K.prototype.distanceSquared=K.prototype.Fd;K.prototype.distanceSquaredPoint=K.prototype.Nf;K.prototype.scale=K.prototype.scale;K.prototype.rotate=K.prototype.rotate;K.prototype.offset=K.prototype.offset;K.prototype.subtract=K.prototype.ze;K.prototype.add=K.prototype.add;K.prototype.equalsApprox=K.prototype.cb;K.prototype.equalTo=K.prototype.ui;K.prototype.equals=K.prototype.D;K.prototype.set=K.prototype.set;K.prototype.setTo=K.prototype.Eg;var Nb=[];K.className="Point";K.parse=Db;K.stringify=Eb; K.distanceLineSegmentSquared=Kb;K.distanceSquared=Lb;K.direction=Mb;K.Origin=yb=(new K(0,0)).pa();K.InfiniteTopLeft=zb=(new K(-Infinity,-Infinity)).pa();K.InfiniteBottomRight=Ab=(new K(Infinity,Infinity)).pa();K.SixPoint=Bb=(new K(6,6)).pa();K.NoPoint=Cb=(new K(NaN,NaN)).pa();K.parse=Db;K.stringify=Eb;K.distanceLineSegmentSquared=Kb;K.distanceSquared=Lb;K.direction=Mb; function Gb(a,b){void 0===a?this.ea=this.ga=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.ga=a,this.ea=b):v("Invalid arguments to Size constructor: "+a+", "+b);this._isFrozen=!1}var Ob,Pb,Qb,Rb,Sb,Tb,Ub;Gb.prototype.assign=function(a){this.ga=a.ga;this.ea=a.ea;return this};Gb.prototype.h=function(a,b){this.ga=a;this.ea=b;return this}; Gb.prototype.Eg=function(a,b){G&&(B(a,"number",Gb,"setTo:w"),B(b,"number",Gb,"setTo:h"),0>a&&Ba(a,">= 0",Gb,"setTo:w"),0>b&&Ba(b,">= 0",Gb,"setTo:h"),this.na());this.ga=a;this.ea=b;return this};Gb.prototype.set=function(a){G&&(x(a,Gb,Gb,"set:s"),this.na());this.ga=a.ga;this.ea=a.ea;return this};Gb.prototype.copy=function(){var a=new Gb;a.ga=this.ga;a.ea=this.ea;return a};t=Gb.prototype;t.pa=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.na=function(a){if(G&&this._isFrozen){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function Vb(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 Gb(c,e)}return new Gb}function Zb(a){G&&x(a,Gb);return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.D=function(a){return a instanceof Gb?this.ga===a.width&&this.ea===a.height:!1};t.ui=function(a,b){return this.ga===a&&this.ea===b}; t.cb=function(a){return L.C(this.ga,a.width)&&L.C(this.ea,a.height)};t.Hc=function(a,b){G&&(D(a,Gb,"inflate:w"),D(b,Gb,"inflate:h"));a=this.width+a;this.ga=0<=a?a:0;b=this.height+b;this.ea=0<=b?b:0;return this};t.u=function(){return isFinite(this.width)&&isFinite(this.height)};Gb.alloc=function(){var a=$b.pop();return void 0===a?new Gb:a};Gb.free=function(a){$b.push(a)}; oa.Object.defineProperties(Gb.prototype,{width:{configurable:!0,get:function(){return this.ga},set:function(a){G&&(B(a,"number",Gb,"width"),this.na(a));0>a&&Ba(a,">= 0",Gb,"width");this.ga=a}},height:{configurable:!0,get:function(){return this.ea},set:function(a){G&&(B(a,"number",Gb,"height"),this.na(a));0>a&&Ba(a,">= 0",Gb,"height");this.ea=a}}});Gb.prototype.isReal=Gb.prototype.u;Gb.prototype.inflate=Gb.prototype.Hc;Gb.prototype.equalsApprox=Gb.prototype.cb; Gb.prototype.equalTo=Gb.prototype.ui;Gb.prototype.equals=Gb.prototype.D;Gb.prototype.set=Gb.prototype.set;Gb.prototype.setTo=Gb.prototype.Eg;var $b=[];Gb.className="Size";Gb.parse=Vb;Gb.stringify=Zb;Gb.ZeroSize=Ob=(new Gb(0,0)).pa();Gb.OneSize=Pb=(new Gb(1,1)).pa();Gb.SixSize=Qb=(new Gb(6,6)).pa();Gb.EightSize=Rb=(new Gb(8,8)).pa();Gb.TenSize=Sb=(new Gb(10,10)).pa();Gb.InfiniteSize=Tb=(new Gb(Infinity,Infinity)).pa();Gb.NoSize=Ub=(new Gb(NaN,NaN)).pa();Gb.parse=Vb;Gb.stringify=Zb; function M(a,b,c,d){void 0===a?this.ea=this.ga=this.K=this.J=0:"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.J=a,this.K=b,this.ga=c,this.ea=d):a instanceof K?(c=a.x,a=a.y,b instanceof K?(d=b.x,b=b.y,this.J=Math.min(c,d),this.K=Math.min(a,b),this.ga=Math.abs(c-d),this.ea=Math.abs(a-b)):b instanceof Gb?(this.J=c,this.K=a,this.ga=b.width,this.ea=b.height):v("Incorrect second argument supplied to Rect constructor "+b)):v("Invalid arguments to Rect constructor: "+ a+", "+b+", "+c+", "+d);this._isFrozen=!1}t=M.prototype;t.assign=function(a){this.J=a.J;this.K=a.K;this.ga=a.ga;this.ea=a.ea;return this};t.h=function(a,b,c,d){this.J=a;this.K=b;this.ga=c;this.ea=d;return this};function ac(a,b,c){a.ga=b;a.ea=c}t.Eg=function(a,b,c,d){G&&(B(a,"number",M,"setTo:x"),B(b,"number",M,"setTo:y"),B(c,"number",M,"setTo:w"),B(d,"number",M,"setTo:h"),0>c&&Ba(c,">= 0",M,"setTo:w"),0>d&&Ba(d,">= 0",M,"setTo:h"),this.na());this.J=a;this.K=b;this.ga=c;this.ea=d;return this}; t.set=function(a){G&&(x(a,M,M,"set:r"),this.na());this.J=a.J;this.K=a.K;this.ga=a.ga;this.ea=a.ea;return this};t.kd=function(a){G&&(x(a,K,M,"setPoint:p"),this.na());this.J=a.x;this.K=a.y;return this};t.NA=function(a){G&&(x(a,Gb,M,"setSize:s"),this.na());this.ga=a.width;this.ea=a.height;return this};M.prototype.copy=function(){var a=new M;a.J=this.J;a.K=this.K;a.ga=this.ga;a.ea=this.ea;return a};t=M.prototype;t.pa=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.na=function(a){if(G&&this._isFrozen){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function bc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return new M(c,e,f,g)}return new M}function cc(a){G&&x(a,M);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.D=function(a){return a instanceof M?this.J===a.x&&this.K===a.y&&this.ga===a.width&&this.ea===a.height:!1};t.ui=function(a,b,c,d){return this.J===a&&this.K===b&&this.ga===c&&this.ea===d};t.cb=function(a){return L.C(this.J,a.x)&&L.C(this.K,a.y)&&L.C(this.ga,a.width)&&L.C(this.ea,a.height)};function dc(a,b){return L.ca(a.J,b.x)&&L.ca(a.K,b.y)&&L.ca(a.ga,b.width)&&L.ca(a.ea,b.height)} t.ha=function(a){G&&x(a,K,M,"containsPoint:p");return this.J<=a.x&&this.J+this.ga>=a.x&&this.K<=a.y&&this.K+this.ea>=a.y};t.df=function(a){G&&x(a,M,M,"containsRect:r");return this.J<=a.x&&a.x+a.width<=this.J+this.ga&&this.K<=a.y&&a.y+a.height<=this.K+this.ea}; t.contains=function(a,b,c,d){G?(D(a,M,"contains:x"),D(b,M,"contains:y"),void 0===c?c=0:D(c,M,"contains:w"),void 0===d?d=0:D(d,M,"contains:h"),(0>c||0>d)&&v("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.J<=a&&a+c<=this.J+this.ga&&this.K<=b&&b+d<=this.K+this.ea};t.offset=function(a,b){G&&(D(a,M,"offset:dx"),D(b,M,"offset:dy"),this.na());this.J+=a;this.K+=b;return this}; t.Hc=function(a,b){G&&(D(a,M,"inflate:w"),D(b,M,"inflate:h"));return ec(this,b,a,b,a)};t.Oo=function(a){G&&x(a,fc,M,"addMargin:m");return ec(this,a.top,a.right,a.bottom,a.left)};t.Uv=function(a){G&&x(a,fc,M,"subtractMargin:m");return ec(this,-a.top,-a.right,-a.bottom,-a.left)};t.aA=function(a,b,c,d){G&&(D(a,M,"grow:t"),D(b,M,"grow:r"),D(c,M,"grow:b"),D(d,M,"grow:l"));return ec(this,a,b,c,d)}; function ec(a,b,c,d,e){G&&a.na();var f=a.ga;c+e<=-f?(a.J+=f/2,a.ga=0):(a.J-=e,a.ga+=c+e);c=a.ea;b+d<=-c?(a.K+=c/2,a.ea=0):(a.K-=b,a.ea+=b+d);return a}t.Vx=function(a){G&&x(a,M,M,"intersectRect:r");return gc(this,a.x,a.y,a.width,a.height)};t.jv=function(a,b,c,d){G&&(D(a,M,"intersect:x"),D(b,M,"intersect:y"),D(c,M,"intersect:w"),D(d,M,"intersect:h"),(0>c||0>d)&&v("Rect.intersect:Width and height cannot be negative"));return gc(this,a,b,c,d)}; function gc(a,b,c,d,e){G&&a.na();var f=Math.max(a.J,b),g=Math.max(a.K,c);b=Math.min(a.J+a.ga,b+d);c=Math.min(a.K+a.ea,c+e);a.J=f;a.K=g;a.ga=Math.max(0,b-f);a.ea=Math.max(0,c-g);return a}t.dd=function(a){G&&x(a,M,M,"intersectsRect:r");return this.kv(a.x,a.y,a.width,a.height)}; t.kv=function(a,b,c,d){G&&(D(a,M,"intersects:x"),D(b,M,"intersects:y"),D(a,M,"intersects:w"),D(b,M,"intersects:h"),(0>c||0>d)&&v("Rect.intersects:Width and height cannot be negative"));var e=this.ga,f=this.J;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.ea;c=this.K;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0}; function hc(a,b){var c=a.ga,d=a.J,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.ea;a=a.K;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.lf=function(a){G&&x(a,K,M,"unionPoint:p");return ic(this,a.x,a.y,0,0)};t.ld=function(a){G&&x(a,M,M,"unionRect:r");return ic(this,a.J,a.K,a.ga,a.ea)}; t.Zv=function(a,b,c,d){G?(D(a,M,"union:x"),D(b,M,"union:y"),void 0===c?c=0:D(c,M,"union:w"),void 0===d?d=0:D(d,M,"union:h"),(0>c||0>d)&&v("Rect.union:Width and height cannot be negative"),this.na()):(void 0===c&&(c=0),void 0===d&&(d=0));return ic(this,a,b,c,d)};function ic(a,b,c,d,e){var f=Math.min(a.J,b),g=Math.min(a.K,c);b=Math.max(a.J+a.ga,b+d);c=Math.max(a.K+a.ea,c+e);a.J=f;a.K=g;a.ga=b-f;a.ea=c-g;return a} t.Li=function(a,b,c){G&&(D(a,M,"setSpot:x"),D(b,M,"setSpot:y"),x(c,Hb,M,"setSpot:spot"),this.na());this.J=a-c.offsetX-c.x*this.ga;this.K=b-c.offsetY-c.y*this.ea;return this}; function jc(a,b,c,d,e,f,g,h){G?(D(a,M,"contains:rx"),D(b,M,"contains:ry"),D(c,M,"contains:rw"),D(d,M,"contains:rh"),D(e,M,"contains:x"),D(f,M,"contains:y"),void 0===g?g=0:D(g,M,"contains:w"),void 0===h?h=0:D(h,M,"contains:h"),(0>c||0>d||0>g||0>h)&&v("Rect.contains:Width and height cannot be negative")):(void 0===g&&(g=0),void 0===h&&(h=0));return a<=e&&e+g<=a+c&&b<=f&&f+h<=b+d} function mc(a,b,c,d,e,f,g,h){G&&(D(a,M,"intersects:rx"),D(b,M,"intersects:ry"),D(c,M,"intersects:rw"),D(d,M,"intersects:rh"),D(e,M,"intersects:x"),D(f,M,"intersects:y"),D(g,M,"intersects:w"),D(h,M,"intersects:h"),(0>c||0>d||0>g||0>h)&&v("Rect.intersects:Width and height cannot be negative"));return a>g+e||e>c+a?!1:b>h+f||f>d+b?!1:!0}t.u=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.fA=function(){return 0===this.width&&0===this.height}; M.alloc=function(){var a=nc.pop();return void 0===a?new M:a};M.allocAt=function(a,b,c,d){var e=nc.pop();return void 0===e?new M(a,b,c,d):e.h(a,b,c,d)};M.free=function(a){nc.push(a)}; oa.Object.defineProperties(M.prototype,{x:{configurable:!0,get:function(){return this.J},set:function(a){G&&(B(a,"number",M,"x"),this.na(a));this.J=a}},y:{configurable:!0,get:function(){return this.K},set:function(a){G&&(B(a,"number",M,"y"),this.na(a));this.K=a}},width:{configurable:!0,get:function(){return this.ga},set:function(a){G&&(B(a,"number",M,"width"),this.na(a));0>a&&Ba(a,">= 0",M,"width");this.ga=a}},height:{configurable:!0,get:function(){return this.ea}, set:function(a){G&&(B(a,"number",M,"height"),this.na(a));0>a&&Ba(a,">= 0",M,"height");this.ea=a}},left:{configurable:!0,get:function(){return this.J},set:function(a){G&&(B(a,"number",M,"left"),this.na(a));this.J=a}},top:{configurable:!0,get:function(){return this.K},set:function(a){G&&(B(a,"number",M,"top"),this.na(a));this.K=a}},right:{configurable:!0,get:function(){return this.J+this.ga},set:function(a){G&&(D(a,M,"right"),this.na(a));this.J+=a-(this.J+this.ga)}}, bottom:{configurable:!0,get:function(){return this.K+this.ea},set:function(a){G&&(D(a,M,"top"),this.na(a));this.K+=a-(this.K+this.ea)}},position:{configurable:!0,get:function(){return new K(this.J,this.K)},set:function(a){G&&(x(a,K,M,"position"),this.na(a));this.J=a.x;this.K=a.y}},size:{configurable:!0,get:function(){return new Gb(this.ga,this.ea)},set:function(a){G&&(x(a,Gb,M,"size"),this.na(a));this.ga=a.width;this.ea=a.height}},center:{configurable:!0, enumerable:!0,get:function(){return new K(this.J+this.ga/2,this.K+this.ea/2)},set:function(a){G&&(x(a,K,M,"center"),this.na(a));this.J=a.x-this.ga/2;this.K=a.y-this.ea/2}},centerX:{configurable:!0,get:function(){return this.J+this.ga/2},set:function(a){G&&(D(a,M,"centerX"),this.na(a));this.J=a-this.ga/2}},centerY:{configurable:!0,get:function(){return this.K+this.ea/2},set:function(a){G&&(D(a,M,"centerY"),this.na(a));this.K=a-this.ea/2}}});M.prototype.isEmpty=M.prototype.fA; M.prototype.isReal=M.prototype.u;M.intersectsLineSegment=function(a,b,c,d,e,f,g,h){G&&(D(a,M,"intersectsLineSegment:x"),D(b,M,"intersectsLineSegment:y"),D(c,M,"intersectsLineSegment:w"),D(d,M,"intersectsLineSegment:h"),D(e,M,"intersectsLineSegment:p1x"),D(f,M,"intersectsLineSegment:p1y"),D(g,M,"intersectsLineSegment:p2x"),D(h,M,"intersectsLineSegment:p2y"),(0>c||0>d)&&v("Rect.intersectsLineSegment: width and height cannot be negative"));return L.Wx(a,b,c,d,e,f,g,h)};M.prototype.setSpot=M.prototype.Li; M.prototype.union=M.prototype.Zv;M.prototype.unionRect=M.prototype.ld;M.prototype.unionPoint=M.prototype.lf;M.prototype.intersects=M.prototype.kv;M.prototype.intersectsRect=M.prototype.dd;M.prototype.intersect=M.prototype.jv;M.prototype.intersectRect=M.prototype.Vx;M.prototype.grow=M.prototype.aA;M.prototype.subtractMargin=M.prototype.Uv;M.prototype.addMargin=M.prototype.Oo;M.prototype.inflate=M.prototype.Hc;M.prototype.offset=M.prototype.offset;M.prototype.contains=M.prototype.contains; M.prototype.containsRect=M.prototype.df;M.prototype.containsPoint=M.prototype.ha;M.prototype.equalsApprox=M.prototype.cb;M.prototype.equalTo=M.prototype.ui;M.prototype.equals=M.prototype.D;M.prototype.setSize=M.prototype.NA;M.prototype.setPoint=M.prototype.kd;M.prototype.set=M.prototype.set;M.prototype.setTo=M.prototype.Eg;var oc=null,pc=null,nc=[];M.className="Rect";M.parse=bc;M.stringify=cc;M.contains=jc;M.intersects=mc;M.ZeroRect=oc=(new M(0,0,0,0)).pa();M.NoRect=pc=(new M(NaN,NaN,NaN,NaN)).pa(); M.parse=bc;M.stringify=cc;M.contains=jc;M.intersects=mc;function fc(a,b,c,d){void 0===a?this.Qe=this.Fe=this.$e=this.af=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):v("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this._isFrozen=!1}fc.prototype.assign=function(a){this.af=a.af;this.$e=a.$e;this.Fe=a.Fe;this.Qe=a.Qe;return this}; fc.prototype.Eg=function(a,b,c,d){G&&(B(a,"number",fc,"setTo:t"),B(b,"number",fc,"setTo:r"),B(c,"number",fc,"setTo:b"),B(d,"number",fc,"setTo:l"),this.na());this.af=a;this.$e=b;this.Fe=c;this.Qe=d;return this};fc.prototype.set=function(a){G&&(x(a,fc,fc,"assign:m"),this.na());this.af=a.af;this.$e=a.$e;this.Fe=a.Fe;this.Qe=a.Qe;return this};fc.prototype.copy=function(){var a=new fc;a.af=this.af;a.$e=this.$e;a.Fe=this.Fe;a.Qe=this.Qe;return a};t=fc.prototype; t.pa=function(){this._isFrozen=!0;Object.freeze(this);return this};t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.na=function(a){if(G&&this._isFrozen){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}}; function qc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new fc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new fc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new fc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new fc(c,e):new fc(c,e,f,g)}return new fc} function rc(a){G&&x(a,fc);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.D=function(a){return a instanceof fc?this.af===a.top&&this.$e===a.right&&this.Fe===a.bottom&&this.Qe===a.left:!1};t.ui=function(a,b,c,d){return this.af===a&&this.$e===b&&this.Fe===c&&this.Qe===d}; t.cb=function(a){return L.C(this.af,a.top)&&L.C(this.$e,a.right)&&L.C(this.Fe,a.bottom)&&L.C(this.Qe,a.left)};t.u=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};fc.alloc=function(){var a=sc.pop();return void 0===a?new fc:a};fc.free=function(a){sc.push(a)}; oa.Object.defineProperties(fc.prototype,{top:{configurable:!0,get:function(){return this.af},set:function(a){G&&(D(a,fc,"top"),this.na(a));this.af=a}},right:{configurable:!0,get:function(){return this.$e},set:function(a){G&&(D(a,fc,"right"),this.na(a));this.$e=a}},bottom:{configurable:!0,get:function(){return this.Fe},set:function(a){G&&(D(a,fc,"bottom"),this.na(a));this.Fe=a}},left:{configurable:!0,get:function(){return this.Qe},set:function(a){G&& (D(a,fc,"left"),this.na(a));this.Qe=a}}});fc.prototype.isReal=fc.prototype.u;fc.prototype.equalsApprox=fc.prototype.cb;fc.prototype.equalTo=fc.prototype.ui;fc.prototype.equals=fc.prototype.D;fc.prototype.set=fc.prototype.set;fc.prototype.setTo=fc.prototype.Eg;var tc=null,uc=null,sc=[];fc.className="Margin";fc.parse=qc;fc.stringify=rc;fc.ZeroMargin=tc=(new fc(0,0,0,0)).pa();fc.TwoMargin=uc=(new fc(2,2,2,2)).pa();fc.parse=qc;fc.stringify=rc; function Hb(a,b,c,d){void 0===a?this.te=this.se=this.K=this.J=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 zc,Ac,Bc,Cc,Hc,Ic,Jc,Lc,Mc,Nc,Oc,Pc,Qc,Rc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,$c,ad,bd,cd,gd,hd,id,jd,kd,ld,md,nd,od,rd,sd;Hb.prototype.assign=function(a){this.J=a.J;this.K=a.K;this.se=a.se;this.te=a.te;return this}; Hb.prototype.Eg=function(a,b,c,d){G&&(td(a,"setTo:x"),td(b,"setTo:y"),ud(c,"setTo:offx"),ud(d,"setTo:offy"),this.na());this.J=a;this.K=b;this.se=c;this.te=d;return this};Hb.prototype.set=function(a){G&&(x(a,Hb,Hb,"set:s"),this.na());this.J=a.J;this.K=a.K;this.se=a.se;this.te=a.te;return this};Hb.prototype.copy=function(){var a=new Hb;a.J=this.J;a.K=this.K;a.se=this.se;a.te=this.te;return a};t=Hb.prototype;t.pa=function(){this._isFrozen=!0;Object.freeze(this);return this}; t.M=function(){return this._isFrozen||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this._isFrozen=!0;return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;return this};t.na=function(a){if(G&&this._isFrozen){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function vd(a,b){a.J=NaN;a.K=NaN;a.se=b;return a} function td(a,b){(isNaN(a)||1a)&&Ba(a,"0 <= "+b+" <= 1",Hb,b)}function ud(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&Ba(a,"real number, not NaN or Infinity",Hb,b)} function wd(a){if("string"===typeof a){a=a.trim();if("None"===a)return zc;if("TopLeft"===a)return Ac;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Bc;if("TopRight"===a)return Cc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Hc;if("Center"===a)return Ic;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Jc;if("BottomLeft"===a)return Lc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Mc;if("BottomRight"===a)return Nc;if("TopSide"===a)return Oc;if("LeftSide"=== a)return Pc;if("RightSide"===a)return Qc;if("BottomSide"===a)return Rc;if("TopBottomSides"===a)return Tc;if("LeftRightSides"===a)return Uc;if("TopLeftSides"===a)return Vc;if("TopRightSides"===a)return Wc;if("BottomLeftSides"===a)return Xc;if("BottomRightSides"===a)return Yc;if("NotTopSide"===a)return Zc;if("NotLeftSide"===a)return $c;if("NotRightSide"===a)return ad;if("NotBottomSide"===a)return bd;if("AllSides"===a)return cd;if("Default"===a)return gd;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=Ib.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.Ma=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.Jd=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.Su=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.Dp=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,q=d*f+c*h+l,r=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,q);n=Math.max(n,q);q=Math.min(p,r);p=Math.max(p,r);e=Math.min(e,c);n=Math.max(n,c);q=Math.min(q,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);q=Math.min(q,d);p=Math.max(p,d);a.h(e,q,n-e,p-q);return a};Ib.alloc=function(){var a=zd.pop();return void 0===a?new Ib:a}; Ib.free=function(a){zd.push(a)};Ib.prototype.transformRect=Ib.prototype.Dp;Ib.prototype.transformPoint=Ib.prototype.Ma;Ib.prototype.scale=Ib.prototype.scale;Ib.prototype.translate=Ib.prototype.translate;Ib.prototype.rotate=Ib.prototype.rotate;Ib.prototype.invert=Ib.prototype.gk;Ib.prototype.multiplyInverted=Ib.prototype.qv;Ib.prototype.multiply=Ib.prototype.multiply;Ib.prototype.reset=Ib.prototype.reset;Ib.prototype.isIdentity=Ib.prototype.Ks;Ib.prototype.equals=Ib.prototype.D; Ib.prototype.setTransform=Ib.prototype.setTransform;Ib.prototype.set=Ib.prototype.set;var zd=[];Ib.className="Transform";Ib.xF="54a702f3e53909c447824c6706603faf4c"; var L={UA:"7da71ca0ad381e90",Ig:(Math.sqrt(2)-1)/3*4,iw:null,sqrt:function(a){if(0>=a)return 0;var b=L.iw;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);L.iw=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},C: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},qs:function(a,b,c,d,e,f,g,h,k,l,m,n){if(L.dc(a,b,g,h,n,c,d)&&L.dc(a,b,g,h,n,e,f))return L.dc(a,b,g,h,n,l,m);var p=(a+c)/2,q=(b+d)/2,r=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+r)/2;c=(q+u)/2;r=(r+e)/2;u=(u+f)/2;var y=(d+r)/2,w=(c+u)/2;return L.qs(a, b,p,q,d,c,y,w,k,l,m,n)||L.qs(y,w,r,u,e,f,g,h,k,l,m,n)},tx: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},dz:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Mb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Ql:function(a,b,c,d,e,f,g,h,k,l){if(L.dc(a,b,g,h,k,c,d)&&L.dc(a,b,g,h,k,e,f))ic(l,a,b,0,0),ic(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,q=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+q)/ 2;p=(p+e)/2;q=(q+f)/2;var r=(d+p)/2,u=(c+q)/2;L.Ql(a,b,m,n,d,c,r,u,k,l);L.Ql(r,u,p,q,e,f,g,h,k,l)}return l},cf:function(a,b,c,d,e,f,g,h,k,l){if(L.dc(a,b,g,h,k,c,d)&&L.dc(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,q=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+q)/2;p=(p+e)/2;q=(q+f)/2;var r=(d+p)/2,u=(c+q)/2;L.cf(a,b,m,n,d,c,r,u,k,l);L.cf(r,u,p,q,e,f,g,h,k,l)}return l},yv:function(a,b,c,d,e,f,g,h,k,l){if(L.dc(a,b,e,f,l,c,d))return L.dc(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,q=(n+d)/2;return L.yv(a,b,m,n,p,q,g,h,k,l)||L.yv(p,q,c,d,e,f,g,h,k,l)},dB: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},xv:function(a,b,c,d,e,f,g,h){if(L.dc(a,b,e,f,g,c,d))ic(h,a,b,0,0),ic(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;L.xv(a,b,k,l,m,n,g,h);L.xv(m,n,c,d,e,f,g,h)}return h},rp:function(a,b,c,d,e,f,g,h){if(L.dc(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;L.rp(a,b,k,l,m,n,g,h);L.rp(m,n,c,d,e,f,g,h)}return h},Qo:function(a,b,c,d,e,f,g,h,k,l,m,n,p,q){if(L.dc(a,b,g,h,p,c,d)&&L.dc(a,b,g,h,p,e,f)){if(!L.em(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;q.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 r=(a+c)/2,u=(b+d)/2,y=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(r+y)/2;c=(u+w)/2;y=(y+e)/ 2;w=(w+f)/2;var z=(d+y)/2,A=(c+w)/2,C=Infinity,E=!1,H=0,T=0;L.Qo(a,b,r,u,d,c,z,A,k,l,m,n,p,q)&&(a=(q.x-k)*(q.x-k)+(q.y-l)*(q.y-l),a=m)return q; if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(ba)return q}else if(aa)return q;0p&&q--}else{r=(a+c)/2;u=(b+d)/2;var y=(c+e)/2,w=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(r+y)/2;c=(u+w)/2;y=(y+e)/2;w=(w+f)/2;var z=(d+y)/2,A=(c+w)/2;q+=L.Ro(a,b,r,u,d,c,z,A,k,l,m,n,p);q+=L.Ro(z,A,y,w,e,f,g,h,k,l,m,n,p)}return q},Bh:function(a,b,c,d,e,f,g){if(L.ca(a,c)){bb)return g.h(a,b),!1;g.h(a,f);return!0}if(L.ca(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(L.ca(h,g))return L.Bh(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(L.ca(g,0)){aa)return k.h(a,b),!1;k.h(e,b);return!0}return L.Bh(a,b,c,d,e,g*(e-a)+b,k)},bB:function(a,b,c,d,e){return L.hf(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},aB: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},Rf:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(L.hf(a,b,a, d,e,f,g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);pl},Hs:function(a,b,c){return L.Wx(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},Wx: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):jc(a,b,c,d,e,f)||jc(a,b,c,d,g,h)||L.em(a,b,k,b,e,f,g,h)||L.em(k,b,k,l,e,f,g,h)||L.em(k,l,a,l,e,f,g,h)||L.em(a,l,a,b,e,f,g,h)?!0:!1},em:function(a,b,c,d,e,f,g,h){return a===c&&b===d&&e===g&&f===h?a===e&&b===f:0>=L.Tl(a,b,c,d,e,f)*L.Tl(a,b,c,d,g,h)&&0>=L.Tl(e,f,g,h,a,b)*L.Tl(e,f,g,h,c,d)},Tl: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},pp:function(a){0>a&& (a+=360);360<=a&&(a-=360);return a},zx: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 N.v:var b=new M(this.startX,this.startY,0,0);b.Zv(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 N.G:b=new M(this.startX,this.startY,0,0);b.Zv(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 N.o:b="";c=this.figures.s;for(var d=c.length,e=0;e=C-1?!0:null!==l[u+1].match(E)}function d(){u++;return l[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());y===y.toLowerCase()&&(b=A.x+b,c=A.y+c);a.h(b,c)}function f(){e(A);return A}function g(){e(z);return z}function h(){var a=w.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?A:new K(2*A.x-z.x,2*A.y-z.y)}void 0===b&&(b=!1);"string"!==typeof a&&Aa(a,"string",N,"parse:str");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=C-1);)if(w=y,y=d(),""!==y)switch(y.toUpperCase()){case "X":q=!0;n=m=!1;break;case "M":r=f();null===a.tc||!0===q?(Jd(a,r.x,r.y,m,!n,p),q=!1):a.moveTo(r.x,r.y);for(k.assign(A);!c();)r=f(),a.lineTo(r.x,r.y);break;case "L":for(;!c();)r=f(),a.lineTo(r.x,r.y);break;case "H":for(;!c();)A= new K((y===y.toLowerCase()?A.x:0)+parseFloat(d()),A.y),a.lineTo(A.x,A.y);break;case "V":for(;!c();)A=new K(A.x,(y===y.toLowerCase()?A.y:0)+parseFloat(d())),a.lineTo(A.x,A.y);break;case "C":for(;!c();){r=new K;e(r);var H=g(),T=f();Kd(a,r.x,r.y,H.x,H.y,T.x,T.y)}break;case "S":for(;!c();)r=h(),H=g(),T=f(),Kd(a,r.x,r.y,H.x,H.y,T.x,T.y);break;case "Q":for(;!c();)r=g(),H=f(),Ld(a,r.x,r.y,H.x,H.y);break;case "T":for(;!c();)z=r=h(),H=f(),Ld(a,r.x,r.y,H.x,H.y);break;case "B":for(;!c();){r=parseFloat(d()); H=parseFloat(d());T=parseFloat(d());var aa=parseFloat(d()),Y=parseFloat(d()),R=Y,O=!1;c()||(R=parseFloat(d()),c()||(O=0!==parseFloat(d())));y===y.toLowerCase()&&(T+=A.x,aa+=A.y);a.arcTo(r,H,T,aa,Y,R,O)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),H=Math.abs(parseFloat(d())),T=parseFloat(d()),Y=aa=!1,O=R=0,R=d(),1===R.length?(aa=!!parseFloat(R),Y=!!parseFloat(d()),R=parseFloat(d())):2===R.length?(aa=!!parseFloat(R[0]),Y=!!parseFloat(R[1]),R=parseFloat(d())):(aa=!!parseFloat(R[0]),Y=!!parseFloat(R[1]), R=parseFloat(R.slice(2))),O=parseFloat(d()),y===y.toLowerCase()&&(R=A.x+R,O=A.y+O),A.h(R,O),Md(a,r,H,T,aa,Y,R,O);break;case "Z":Nd(a);A.assign(k);break;case "F":r="";for(H=1;l[u+H];)if("0"===l[u+H])p=!0,H++;else if(null!==l[u+H].match(/[Uu]/))H++;else if(null===l[u+H].match(E))H++;else{r=l[u+H];break}r.match(/[Mm]/)?m=!0:0g&&(g+=360),r.startAngle+=g);0>a&&(r.startAngle=180-r.startAngle,r.sweepAngle=-r.sweepAngle); 0>d&&(r.startAngle=-r.startAngle,r.sweepAngle=-r.sweepAngle);r.radiusX*=Math.sqrt(a*a+c*c);void 0!==r.radiusY&&(r.radiusY*=Math.sqrt(b*b+d*d));break;case Zd:g=r.endX;h=r.endY;r.endX=g*a+h*c+e;r.endY=g*b+h*d+f;if(0===r.radiusX||0===r.radiusY)break;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),r.xAxisRotation+=g);0>a&&(r.xAxisRotation=180-r.xAxisRotation,r.isClockwiseArc=!r.isClockwiseArc);0>d&&(r.xAxisRotation=-r.xAxisRotation,r.isClockwiseArc=!r.isClockwiseArc);r.radiusX*=Math.sqrt(a*a+c*c); r.radiusY*=Math.sqrt(b*b+d*d);break;default:v("Unknown Segment type: "+r.type)}}}}this._isInvalidBounds=!0;return this}; t.ha=function(a,b){void 0===b&&(b=0);var c=this.ud,d=this.vd,e=this.Jc,f=this.Kc;switch(this.type){case N.j:return L.dc(c,d,e,f,b,a.x,a.y);case N.v:var g=M.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.ha(a);M.free(g);return a;case N.G: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 N.o:return be(this,a,b,!0,!1);default:return!1}}; function be(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,q=p.length,r=0;r=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.Nx=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.fv=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.Ox=function(a){if(this.type===N.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=K.alloc();L.Bh(b,c,d,e,f,a,h);a=h.x;f=h.y;K.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===N.v){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=K.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.Ye=a,this.gi=0,G&&D(d,je,"x1"),this.hi=Math.max(d,0),G&&D(e,je,"y1"),this.$g=Math.max(e,0),"boolean"===typeof g?g&&(this.isLargeArc=!0):"number"===typeof g&&g&&(this.isLargeArc=!0),h&&(this.isClockwiseArc= !0)):(G&&D(d,je,"x1"),this.Ye=d,G&&D(e,je,"y1"),this.gi=e,G&&D(f,je,"x2"),a===Td&&(f=Math.max(f,0)),this.hi=f,"number"===typeof g?(a===Td&&(g=Math.max(g,0)),this.$g=g):this.$g=0);this.ge=null}je.prototype.copy=function(){var a=new je;a.ta=this.ta;a.l=this.l&-2;a.Jc=this.Jc;a.Kc=this.Kc;a.Ye=this.Ye;a.gi=this.gi;a.hi=this.hi;a.$g=this.$g;return a};t=je.prototype; t.cb=function(a){if(!(a instanceof je)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case Qd:case Cd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY);case Rd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y)&&L.C(this.point2X,a.point2X)&&L.C(this.point2Y,a.point2Y);case Sd:return L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.point1X,a.point1X)&&L.C(this.point1Y,a.point1Y);case Td:return L.C(this.startAngle, a.startAngle)&&L.C(this.sweepAngle,a.sweepAngle)&&L.C(this.centerX,a.centerX)&&L.C(this.centerY,a.centerY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);case Zd:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&L.C(this.xAxisRotation,a.xAxisRotation)&&L.C(this.endX,a.endX)&&L.C(this.endY,a.endY)&&L.C(this.radiusX,a.radiusX)&&L.C(this.radiusY,a.radiusY);default:return!1}};t.wb=function(a){a.classType===je?this.type=a:Ea(this,a)}; t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Qd:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Cd:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Rd: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 Sd: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 Td: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 Zd: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.qa=function(){this._isFrozen=!1;return this};t.close=function(){this.isClosed=!0;return this}; function $d(a,b){if(null!==a.ge&&!1===b._isInvalidBounds)return a.ge;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.ge=[],a.ge;b=a.Ye;var e=a.gi,f=L.zx(0,0,c=q?g=Math.PI:1<=q&&(g=0);!k&&0g&&(g+=2*Math.PI);k=b>f?1:b/f;q=b>f?f/b:1;b=L.zx(0,0,b>f?b:f,m,m+g,!0);f=Ib.alloc();f.reset();f.translate(c,d);f.rotate(a.Ye,0,0);f.scale(k,q);N.Na(b,f); Ib.free(f);a.ge=b;return a.ge} oa.Object.defineProperties(je.prototype,{_isFrozen:{configurable:!0,get:function(){return 0!==(this.l&1)},set:function(a){this.l=a?this.l|1:this.l&-2}},_isInvalidBounds:{configurable:!0,get:function(){return 0!==(this.l&2)},set:function(a){this.l=a?this.l|2:this.l&-3}},isClosed:{configurable:!0,get:function(){return 0!==(this.l&8)},set:function(a){this.isClosed!==a&&(this.l=a?this.l|8:this.l&-9,this._isInvalidBounds=!0)}},type:{configurable:!0, get:function(){return this.ta},set:function(a){G&&$a(a,je,je,"type");this._isFrozen&&xa(this,a);this.ta=a;this._isInvalidBounds=!0}},endX:{configurable:!0,get:function(){return this.Jc},set:function(a){G&&D(a,je,"endX");this._isFrozen&&xa(this,a);this.Jc=a;this._isInvalidBounds=!0}},endY:{configurable:!0,get:function(){return this.Kc},set:function(a){G&&D(a,je,"endY");this._isFrozen&&xa(this,a);this.Kc=a;this._isInvalidBounds=!0}},point1X:{configurable:!0, get:function(){return this.Ye},set:function(a){G&&D(a,je,"point1X");this._isFrozen&&xa(this,a);this.Ye=a;this._isInvalidBounds=!0}},point1Y:{configurable:!0,get:function(){return this.gi},set:function(a){G&&D(a,je,"point1Y");this._isFrozen&&xa(this,a);this.gi=a;this._isInvalidBounds=!0}},point2X:{configurable:!0,get:function(){return this.hi},set:function(a){G&&D(a,je,"point2X");this._isFrozen&&xa(this,a);this.hi=a;this._isInvalidBounds=!0}},point2Y:{configurable:!0, get:function(){return this.$g},set:function(a){G&&D(a,je,"point2Y");this._isFrozen&&xa(this,a);this.$g=a;this._isInvalidBounds=!0}},centerX:{configurable:!0,get:function(){return this.Ye},set:function(a){G&&D(a,je,"centerX");this._isFrozen&&xa(this,a);this.Ye=a;this._isInvalidBounds=!0}},centerY:{configurable:!0,get:function(){return this.gi},set:function(a){G&&D(a,je,"centerY");this._isFrozen&&xa(this,a);this.gi=a;this._isInvalidBounds=!0}},radiusX:{configurable:!0, get:function(){return this.hi},set:function(a){G&&D(a,je,"radiusX");0>a&&Ba(a,">= zero",je,"radiusX");this._isFrozen&&xa(this,a);this.hi=a;this._isInvalidBounds=!0}},radiusY:{configurable:!0,get:function(){return this.$g},set:function(a){G&&D(a,je,"radiusY");0>a&&Ba(a,">= zero",je,"radiusY");this._isFrozen&&xa(this,a);this.$g=a;this._isInvalidBounds=!0}},startAngle:{configurable:!0,get:function(){return this.Jc},set:function(a){G&&D(a,je,"startAngle");this._isFrozen&&xa(this, a);a%=360;0>a&&(a+=360);this.Jc=a;this._isInvalidBounds=!0}},sweepAngle:{configurable:!0,get:function(){return this.Kc},set:function(a){G&&D(a,je,"sweepAngle");this._isFrozen&&xa(this,a);360a&&(a=-360);this.Kc=a;this._isInvalidBounds=!0}},isClockwiseArc:{configurable:!0,get:function(){return 0!==(this.l&4)},set:function(a){this._isFrozen&&xa(this,a);this.l=a?this.l|4:this.l&-5;this._isInvalidBounds=!0}},isLargeArc:{configurable:!0,get:function(){return 0!== (this.l&16)},set:function(a){this._isFrozen&&xa(this,a);this.l=a?this.l|16:this.l&-17;this._isInvalidBounds=!0}},xAxisRotation:{configurable:!0,get:function(){return this.Ye},set:function(a){G&&D(a,je,"xAxisRotation");this._isFrozen&&xa(this,a);a%=360;0>a&&(a+=360);this.Ye=a;this._isInvalidBounds=!0}}});je.prototype.equalsApprox=je.prototype.cb; var Qd=new F(je,"Move",0),Cd=new F(je,"Line",1),Rd=new F(je,"Bezier",2),Sd=new F(je,"QuadraticBezier",3),Td=new F(je,"Arc",4),Zd=new F(je,"SvgArc",4);je.className="PathSegment";je.Move=Qd;je.Line=Cd;je.Bezier=Rd;je.QuadraticBezier=Sd;je.Arc=Td;je.SvgArc=Zd;function le(){this.H=null;this.Ku=(new K(0,0)).freeze();this.zt=(new K(0,0)).freeze();this.Op=this.dr=0;this.Pp=1;this.Kq="";this.ks=this.gq=!1;this.eq=this.Rp=0;this.Jg=this.Aq=this.Gq=!1;this.mq=null;this.es=0;this.Dd=this.$r=null} le.prototype.copy=function(){var a=new le;return this.clone(a)};le.prototype.clone=function(a){a.H=this.H;a.Ku.assign(this.viewPoint);a.zt.assign(this.documentPoint);a.dr=this.dr;a.Op=this.Op;a.Pp=this.Pp;a.Kq=this.Kq;a.gq=this.gq;a.ks=this.ks;a.Rp=this.Rp;a.eq=this.eq;a.Gq=this.Gq;a.Aq=this.Aq;a.Jg=this.Jg;a.mq=this.mq;a.es=this.es;a.$r=this.$r;a.Dd=this.Dd;return a}; le.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};le.prototype.ep=function(a,b){var c=this.diagram;if(null===c)return b;me(c,a,b);return b}; le.prototype.Vz=function(a,b){var c=this.diagram;if(null===c)return b;me(c,a,b);b.assign(c.bt(b));return b}; oa.Object.defineProperties(le.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},viewPoint:{configurable:!0,get:function(){return this.Ku},set:function(a){x(a,K,le,"viewPoint");this.Ku.assign(a)}},documentPoint:{configurable:!0,get:function(){return this.zt},set:function(a){x(a,K,le,"documentPoint");this.zt.assign(a)}},modifiers:{configurable:!0,get:function(){return this.dr},set:function(a){this.dr= a}},button:{configurable:!0,get:function(){return this.Op},set:function(a){this.Op=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:{configurable:!0,get:function(){return this.Pp},set:function(a){this.Pp=a}},key:{configurable:!0,get:function(){return this.Kq},set:function(a){this.Kq=a}},down:{configurable:!0,get:function(){return this.gq},set:function(a){this.gq=a}},up:{configurable:!0, enumerable:!0,get:function(){return this.ks},set:function(a){this.ks=a}},clickCount:{configurable:!0,get:function(){return this.Rp},set:function(a){this.Rp=a}},delta:{configurable:!0,get:function(){return this.eq},set:function(a){this.eq=a}},isMultiTouch:{configurable:!0,get:function(){return this.Gq},set:function(a){this.Gq=a}},handled:{configurable:!0,get:function(){return this.Aq},set:function(a){this.Aq=a}},bubbles:{configurable:!0, get:function(){return this.Jg},set:function(a){this.Jg=a}},event:{configurable:!0,get:function(){return this.mq},set:function(a){this.mq=a}},isTouchEvent:{configurable:!0,get:function(){var a=this.event;return null===a?!1:"touch"===a.pointerType||"pen"===a.pointerType}},timestamp:{configurable:!0,get:function(){return this.es},set:function(a){this.es=a}},targetDiagram:{configurable:!0,get:function(){return this.$r},set:function(a){this.$r=a}}, targetObject:{configurable:!0,get:function(){return this.Dd},set:function(a){this.Dd=a}},control:{configurable:!0,get:function(){return 0!==(this.modifiers&1)},set:function(a){this.modifiers=a?this.modifiers|1:this.modifiers&-2}},shift:{configurable:!0,get:function(){return 0!==(this.modifiers&4)},set:function(a){this.modifiers=a?this.modifiers|4:this.modifiers&-5}},alt:{configurable:!0,get:function(){return 0!==(this.modifiers&2)},set:function(a){this.modifiers= a?this.modifiers|2:this.modifiers&-3}},meta:{configurable:!0,get:function(){return 0!==(this.modifiers&8)},set:function(a){this.modifiers=a?this.modifiers|8:this.modifiers&-9}},left:{configurable:!0,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:{configurable:!0, 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:{configurable:!0,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}}});le.prototype.getMultiTouchDocumentPoint=le.prototype.Vz;le.prototype.getMultiTouchViewPoint=le.prototype.ep;le.className="InputEvent";function ne(){this.H=null;this.Ea="";this.nr=this.Yr=null}ne.prototype.copy=function(){var a=new ne;a.H=this.H;a.Ea=this.Ea;a.Yr=this.Yr;a.nr=this.nr;return a};ne.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a}; oa.Object.defineProperties(ne.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},name:{configurable:!0,get:function(){return this.Ea},set:function(a){this.Ea=a}},subject:{configurable:!0,get:function(){return this.Yr},set:function(a){this.Yr=a}},parameter:{configurable:!0,get:function(){return this.nr},set:function(a){this.nr=a}}});ne.className="DiagramEvent"; function oe(){this.Sm=pe;this.Df=this.cr="";this.Xn=this.Yn=this.co=this.eo=this.bo=this.H=this.ic=null}oe.prototype.clear=function(){this.Xn=this.Yn=this.co=this.eo=this.bo=this.H=this.ic=null}; oe.prototype.copy=function(){var a=new oe;a.Sm=this.Sm;a.cr=this.cr;a.Df=this.Df;a.ic=this.ic;a.H=this.H;a.bo=this.bo;var b=this.eo;a.eo=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.co;a.co=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Yn;a.Yn=Ga(b)&&"function"===typeof b.M?b.M():b;b=this.Xn;a.Xn=Ga(b)&&"function"===typeof b.M?b.M():b;return a};oe.prototype.wb=function(a){a.classType===oe?this.change=a:Ea(this,a)}; oe.prototype.toString=function(){var a="";a=this.change===qe?a+"* ":this.change===pe?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===qe?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Ra(this.object)),null!==this.oldValue&&(a+=" old: "+Ra(this.oldValue)),null!== this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Ra(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};oe.prototype.L=function(a){return a?this.oldValue:this.newValue};oe.prototype.Xz=function(a){return a?this.oldParam:this.newParam};oe.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1}; oe.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};oe.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};oe.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))}; oa.Object.defineProperties(oe.prototype,{model:{configurable:!0,get:function(){return this.ic},set:function(a){this.ic=a}},diagram:{configurable:!0,get:function(){return this.H},set:function(a){this.H=a}},change:{configurable:!0,get:function(){return this.Sm},set:function(a){G&&$a(a,oe,oe,"change");this.Sm=a}},modelChange:{configurable:!0,get:function(){return this.cr},set:function(a){G&&B(a,"string",oe,"modelChange");this.cr=a}},propertyName:{configurable:!0, enumerable:!0,get:function(){return this.Df},set:function(a){G&&"string"!==typeof a&&B(a,"function",oe,"propertyName");this.Df=a}},isTransactionFinished:{configurable:!0,get:function(){return this.Sm===qe&&("CommittedTransaction"===this.Df||"FinishedUndo"===this.Df||"FinishedRedo"===this.Df)}},object:{configurable:!0,get:function(){return this.bo},set:function(a){this.bo=a}},oldValue:{configurable:!0,get:function(){return this.eo},set:function(a){this.eo= a}},oldParam:{configurable:!0,get:function(){return this.co},set:function(a){this.co=a}},newValue:{configurable:!0,get:function(){return this.Yn},set:function(a){this.Yn=a}},newParam:{configurable:!0,get:function(){return this.Xn},set:function(a){this.Xn=a}}});oe.prototype.redo=oe.prototype.redo;oe.prototype.canRedo=oe.prototype.canRedo;oe.prototype.undo=oe.prototype.undo;oe.prototype.canUndo=oe.prototype.canUndo;oe.prototype.getParam=oe.prototype.Xz; oe.prototype.getValue=oe.prototype.L;oe.prototype.clear=oe.prototype.clear;var qe=new F(oe,"Transaction",-1),pe=new F(oe,"Property",0),re=new F(oe,"Insert",1),se=new F(oe,"Remove",2);oe.className="ChangedEvent";oe.Transaction=qe;oe.Property=pe;oe.Insert=re;oe.Remove=se;function te(){this.o=(new I).freeze();this.Ea="";this.j=!1} te.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0b&&a.jd(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}}; oa.Object.defineProperties(te.prototype,{changes:{configurable:!0,get:function(){return this.o}},name:{configurable:!0,get:function(){return this.Ea},set:function(a){this.Ea=a}},isComplete:{configurable:!0,get:function(){return this.j},set:function(a){this.j=a}}});te.prototype.optimize=te.prototype.lk;te.prototype.redo=te.prototype.redo;te.prototype.canRedo=te.prototype.canRedo;te.prototype.undo=te.prototype.undo;te.prototype.canUndo=te.prototype.canUndo; te.prototype.clear=te.prototype.clear;te.className="Transaction";function ue(){this.bu=new J;this.Pd=!1;this.v=(new I).freeze();this.Me=-1;this.o=999;this.Pe=!1;this.$p=null;this.ni=0;this.j=!1;G&&(this.j=!0);this.Te=(new I).freeze();this.tl=new I;this.Gt=!0;this.Qt=this.Eq=this.Tt=this.St=!1} ue.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&&Fa("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Ub("CommittingTransaction",c,e));var f=0;if(0=d&&(f=b.P(0),null!==f&&f.clear(),b.sb(0),a.Me--)),0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.Me++),b.freeze()),a.isInternalTransaction||a.Ub("CommittedTransaction",c,e);else{a.Pe=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction||a.Ub("RolledBackTransaction",c,e),a.Pe=!1}null!== e&&e.clear()}a.$p=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.P(e),null!==b&&b.undo(),c.qa(),c.sb(e);c.freeze()}return!1}t.Bx=function(){if(!this.isUndoingRedoing&&this.canRedo()){var a=this.history;a.qa();for(var b=a.count-1;b>this.historyIndex;b--){var c=a.P(b);null!==c&&c.clear();a.sb(b);this.Eq=!0}a.freeze()}}; ue.prototype.canUndo=function(){if(!this.isEnabled||0=this.transactionLevel&&!this.Gt&&(a=a.diagram,null!==a&&!1===a.Di||Fa("Change not within a transaction: "+c.toString()))}}; ue.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}; oa.Object.defineProperties(ue.prototype,{models:{configurable:!0,get:function(){return this.bu.iterator}},isEnabled:{configurable:!0,get:function(){return this.Pd},set:function(a){this.Pd=a}},transactionToUndo:{configurable:!0,get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.P(this.historyIndex):null}},transactionToRedo:{configurable:!0,get:function(){return this.historyIndexe||Math.abs(b.y-a.y)>d}; oa.Object.defineProperties(we.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){a instanceof Q&&(this.H=a)}},name:{configurable:!0,get:function(){return this.Ea},set:function(a){B(a,"string",we,"name");this.Ea=a}},isEnabled:{configurable:!0,get:function(){return this.Pd},set:function(a){B(a,"boolean",we,"isEnabled");this.Pd=a}},isActive:{configurable:!0,get:function(){return this.tb},set:function(a){B(a,"boolean", we,"isActive");this.tb=a}},transactionResult:{configurable:!0,get:function(){return this.Jm},set:function(a){null!==a&&B(a,"string",we,"transactionResult");this.Jm=a}}});we.prototype.startTransaction=we.prototype.Ka;we.className="Tool";function Ua(){we.call(this);this.name="ToolManager";this.ob=new I;this.ub=new I;this.Nb=new I;this.G=this.Z=850;this.o=(new Gb(2,2)).pa();this.Na=5E3;this.oa=Ae;this.v=Ce;this.Zp=this.j=null;this.Mj=-1}na(Ua,we);Ua.prototype.initializeStandardTools=function(){}; Ua.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Be&&this.Zp===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}}; Ua.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Ie&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Je){b.bubbles=!0;return}if(this.gestureBehavior===Ie)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}var c=a.undoManager;G&&c.checksTransactionLevel&&0!==c.transactionLevel&&Fa("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");c=this.mouseDownTools.length; for(var 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.Ze;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=Gf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=Gf(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.ey&&d.V("LinkRelinked",c,d.ey),c.toPort!==d.gy&&d.V("LinkRelinked",c,d.gy)):Hf(e,g,f,k,h):Hf(e,null,null,null,null)}}}}Ne.prototype.doDragOver=function(){}; function If(a,b){var c=a.diagram;a.dragsLink&&uf(a,!0);Xe(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;Jf(a,e,f);f=Ff(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==Qe){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!==Qe){a=M.alloc();for(b= c.selection.iterator;b.next();)d=b.value,d instanceof V&&Kf(c,d,a);M.free(a)}}}function Jf(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof Df||(c=a.mouseDrop,null!==c&&c(b))}function Kf(a,b,c){var d=!1;c=b.getAvoidableRect(c);a.viewportBounds.df(c)&&(d=!0);a=a.cv(c,function(a){return a.part},function(a){return a instanceof S},!0,function(a){return a instanceof S},d);if(0!==a.count)for(a=a.iterator;a.next();)c=a.value,!c.Zd(b)&&c.isAvoiding&&c.ib()} Ne.prototype.doDropOnto=function(){};Ne.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()?(pf(this,!1),Te(a,this.copiedParts),rf(this,this.copiedParts,!1),hf(a,this.copiedParts)):this.mayMove()?(kf(this),rf(this,this.draggedParts,!0)):this.mayDragOut()?(pf(this,!1),rf(this,this.copiedParts,!1)):kf(this),tf(this,a.lastInput.documentPoint))}}; Ne.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram,b=a.lastInput;if(!this.simulatedMouseUp(b.event,b.documentPoint,b.targetDiagram)){b=!1;var c=this.mayCopy();c&&null!==this.copiedParts?(kf(this),pf(this,!0),Te(a,this.copiedParts),rf(this,this.copiedParts,!1),hf(a,this.copiedParts),null!==this.copiedParts&&(a.V("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,kf(this),this.mayMove()&&(rf(this,this.draggedParts, !0),tf(this,a.lastInput.documentPoint)));this.ln=!0;If(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Xf():this.draggedParts.Xf();this.copiedParts=null;b&&Lf(this);a.eb();hf(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.V(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.V("ChangedSelection",a.selection)}}}; Ne.prototype.simulatedMouseMove=function(a,b,c){if(null===Qe)return!1;var d=Qe.diagram;c instanceof Q||(c=null);var e=Ue;c!==e&&(null!==e&&e!==d&&(e.Gg(),Qe.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),Ue=c,null!==c&&c!==d&&(nf(),e=c.toolManager.findTool("Dragging"),null!==e&&(Pe.contains(e)||Pe.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;M.free(f); f=a.Sr;g=new vb;h=K.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof S&&l.canCopy()&&(m=c.L(l),null!==m&&(m.points=l.points,qf(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.Vd())));for(b=b.iterator;b.next();)l=b.value,l.ed()&&l.canCopy()&&(k=c.L(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.$a(),g.add(k,a.Vd(h))));K.free(h);a.copiedParts=g;Re(a,g.Xf());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,qf(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/ 2)));a.doUpdateCursor(null)}}}Ne.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.$s=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.Nn=null};Ne.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new K}; oa.Object.defineProperties(Ne.prototype,{isCopyEnabled:{configurable:!0,get:function(){return this.ub},set:function(a){B(a,"boolean",Ne,"isCopyEnabled");this.ub=a}},copiesEffectiveCollection:{configurable:!0,get:function(){return this.v},set:function(a){B(a,"boolean",Ne,"copiesEffectiveCollection");this.v=a}},dragOptions:{configurable:!0,get:function(){return this.oa},set:function(a){x(a,Oe,Ne,"dragOptions");this.oa=a}},isGridSnapEnabled:{configurable:!0, enumerable:!0,get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){B(a,"boolean",Ne,"isGridSnapEnabled");this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{configurable:!0,get:function(){return this.ob},set:function(a){B(a,"boolean",Ne,"isComplexRoutingRealtime");this.ob=a}},isGridSnapRealtime:{configurable:!0,get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){B(a,"boolean",Ne,"isGridSnapRealtime");this.dragOptions.isGridSnapRealtime= a}},gridSnapCellSize:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){x(a,Gb,Ne,"gridSnapCellSize");this.dragOptions.gridSnapCellSize.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){x(a,Hb,Ne,"gridSnapCellSpot");this.dragOptions.gridSnapCellSpot.D(a)||(a=a.M(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{configurable:!0, enumerable:!0,get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){x(a,K,Ne,"gridSnapOrigin");this.dragOptions.gridSnapOrigin.D(a)||(a=a.M(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{configurable:!0,get:function(){return this.dragOptions.dragsLink},set:function(a){B(a,"boolean",Ne,"dragsLink");this.dragOptions.dragsLink=a}},dragsTree:{configurable:!0,get:function(){return this.dragOptions.dragsTree},set:function(a){B(a,"boolean",Ne,"dragsTree"); this.dragOptions.dragsTree=a}},copyCursor:{configurable:!0,get:function(){return this.G},set:function(a){this.G=a}},moveCursor:{configurable:!0,get:function(){return this.Uc},set:function(a){this.Uc=a}},nodropCursor:{configurable:!0,get:function(){return this.Vc},set:function(a){this.Vc=a}},currentPart:{configurable:!0,get:function(){return this.Z},set:function(a){null!==a&&x(a,U,Ne,"currentPart");this.Z=a}},copiedParts:{configurable:!0, get:function(){return this.o},set:function(a){this.o=a}},draggedParts:{configurable:!0,get:function(){return this.Na},set:function(a){this.Na=a}},draggingParts:{configurable:!0,get:function(){return null!==this.copiedParts?this.copiedParts.Xf():null!==this.draggedParts?this.draggedParts.Xf():this.Be}},draggedLink:{configurable:!0,get:function(){return this.diagram.draggedLink},set:function(a){null!==a&&x(a,S,Ne,"draggedLink");this.diagram.draggedLink=a}}, isDragOutStarted:{configurable:!0,get:function(){return this.Nb},set:function(a){this.Nb=a}},startPoint:{configurable:!0,get:function(){return this.Sr},set:function(a){x(a,K,Ne,"startPoint");this.Sr.D(a)||this.Sr.assign(a)}},delay:{configurable:!0,get:function(){return this.Uk},set:function(a){B(a,"number",Ne,"delay");this.Uk=a}}});Ne.prototype.getDraggingSource=Ne.prototype.Uz;var Qe=null,Ue=null;Ne.className="DraggingTool";Pe=new I; Ta("draggingTool",function(){return this.findTool("Dragging")},function(a){this.nb("Dragging",a,this.mouseMoveTools)});Ua.prototype.doCancel=function(){null!==Qe&&Qe.doCancel();we.prototype.doCancel.call(this)}; function Of(){0=d&&(d=.1);var e=this,f=b.Ag(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.la(Ic,K.alloc()),l=c.x-k.x,m=c.y-k.y;K.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.Yo(b).count>=c)return!1}return!0}; Of.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.Yd(b).count>=c)return!1}return!0}; Of.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};Of.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.Yd(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1}; Of.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};Of.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 J;d.add(a);return Qf(this,c,b,d)}; function Qf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Qf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Qf(a,b.labeledLink,c,d))?!0:!1} Of.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!==Rf){if(d===Sf){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!Tf(this,a,b,c,!0)}if(d===Uf){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!Tf(this,a,b,c,!0)}if(d===Vf)return a===b?a=!0:(d=new J,d.add(b),a=Wf(this,d,a,b,c)),!a;if(d===Xf)return!Tf(this,a,b,c,!1);if(d===Yf)return a===b?a=!0:(d=new J,d.add(b),a=Zf(this,d,a,b,c)),!a}return!0};function Tf(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&&Tf(a,g,c,d,e)))return!0}return!1} function Wf(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&&Wf(a,b,g,d,e)))return!0}return!1}function Zf(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&&Zf(a,b,h,d,e))return!0}}return!1} oa.Object.defineProperties(Of.prototype,{portGravity:{configurable:!0,get:function(){return this.Be},set:function(a){B(a,"number",Of,"portGravity");0<=a&&(this.Be=a)}},isUnconnectedLinkValid:{configurable:!0,get:function(){return this.Na},set:function(a){B(a,"boolean",Of,"isUnconnectedLinkValid");this.Na=a}},linkingCursor:{configurable:!0,get:function(){return this.v},set:function(a){this.v=a}},temporaryLink:{configurable:!0,get:function(){return this.Pi}, set:function(a){x(a,S,Of,"temporaryLink");this.Pi=a}},temporaryFromNode:{configurable:!0,get:function(){return this.Oi},set:function(a){x(a,V,Of,"temporaryFromNode");if(this.Oi=a)this.j=a.port}},temporaryFromPort:{configurable:!0,get:function(){return this.j},set:function(a){x(a,P,Of,"temporaryFromPort");if(null!==this.j){var b=this.j.panel;if(null!==b){var c=b.S.indexOf(this.j);b.sb(c);b.Mb(c,a)}}this.j=a}},temporaryToNode:{configurable:!0,get:function(){return this.Qi}, set:function(a){x(a,V,Of,"temporaryToNode");if(this.Qi=a)this.o=a.port}},temporaryToPort:{configurable:!0,get:function(){return this.o},set:function(a){x(a,P,Of,"temporaryToPort");if(null!==this.o){var b=this.o.panel;if(null!==b){var c=b.S.indexOf(this.o);b.sb(c);b.Mb(c,a)}}this.o=a}},originalLink:{configurable:!0,get:function(){return this.Nb},set:function(a){null!==a&&x(a,S,Of,"originalLink");this.Nb=a}},originalFromNode:{configurable:!0,get:function(){return this.ob}, set:function(a){null!==a&&x(a,V,Of,"originalFromNode");this.ob=a}},originalFromPort:{configurable:!0,get:function(){return this.ub},set:function(a){null!==a&&x(a,P,Of,"originalFromPort");this.ub=a}},originalToNode:{configurable:!0,get:function(){return this.Uc},set:function(a){null!==a&&x(a,V,Of,"originalToNode");this.Uc=a}},originalToPort:{configurable:!0,get:function(){return this.Vc},set:function(a){null!==a&&x(a,P,Of,"originalToPort");this.Vc=a}},isForwards:{configurable:!0, enumerable:!0,get:function(){return this.oa},set:function(a){B(a,"boolean",Of,"isForwards");this.oa=a}},validPortsCache:{configurable:!0,get:function(){return this.zy}},targetPort:{configurable:!0,get:function(){return this.ag},set:function(a){null!==a&&x(a,P,Of,"targetPort");this.ag=a}},linkValidation:{configurable:!0,get:function(){return this.tj},set:function(a){null!==a&&B(a,"function",Of,"linkValidation");this.tj=a}},portTargeted:{configurable:!0, get:function(){return this.$f},set:function(a){null!==a&&B(a,"function",Of,"portTargeted");this.$f=a}}});Of.className="LinkingBaseTool";function $f(){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)};tg.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}; tg.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.Ic(),this.Ka(this.name),this.jr.set(this.adornedObject.la(this.handle.alignment.vv())),this.fo.set(this.adornedObject.part.location),this.Sw.set(this.adornedObject.desiredSize),this.Ct=this.computeCellSize(),this.Et= this.computeMinSize(),this.Dt=this.computeMaxSize(),this.isActive=!0))};tg.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.De=this.handle=null;this.isActive=a.isMouseCaptured=!1};tg.prototype.stopTransaction=function(){var a=this.diagram,b=we.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.lk();return b}; tg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()};tg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.Et,c=this.Dt,d=this.Ct,e=this.adornedObject.Ds(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.hd();K.free(e)}}; tg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.Et,c=this.Dt,d=this.Ct,e=this.adornedObject.Ds(a.lastInput.documentPoint,K.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);K.free(e);a.eb();this.transactionResult=this.name;a.V("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()}; tg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.$a();c=c.la(this.handle.alignment.vv());if(a instanceof Df){var d=new I;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new Oe;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().ze(c),!0,e)}else a.location=a.location.copy().ze(c).add(this.oppositePoint);b.hd()}}; tg.prototype.computeResize=function(a,b,c,d,e,f){b.pc()&&(b=Ic);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=K.alloc();L.Zo(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)));K.free(p);return a};tg.prototype.computeReshape=function(){var a=xg;this.adornedObject instanceof Pf&&(a=yg(this.adornedObject));return!(a===zg||this.diagram.lastInput.shift)}; tg.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};tg.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.la(b)};Ag.prototype.doDeactivate=function(){var a=this.diagram;this.stopTransaction();this.De=this.handle=null;this.yr=new K(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Ag.prototype.stopTransaction=function(){var a=this.diagram,b=we.prototype.stopTransaction.call(this);b&&null!==a.undoManager.transactionToUndo&&a.undoManager.transactionToUndo.lk();return b};Ag.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()}; Ag.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))};Ag.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.eb();this.transactionResult=this.name;a.V("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()}; Ag.prototype.rotate=function(a){G&&D(a,Ag,"rotate:newangle");var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.$a();var c=b.locationObject,d=b.rotateObject;if(c===d||c.Dg(d))c=this.fo.copy(),b.location=c.ze(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.hd()}}; Ag.prototype.computeRotate=function(a){a=this.rotationPoint.gb(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.yi());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}; oa.Object.defineProperties(Ag.prototype,{handleArchetype:{configurable:!0,get:function(){return this.o},set:function(a){null!==a&&x(a,P,Ag,"handleArchetype");this.o=a}},handle:{configurable:!0,get:function(){return this.j},set:function(a){if(null!==a&&(x(a,P,Ag,"handle"),!(a.part instanceof Be)))throw Error("new handle is not in an Adornment: "+a);this.j=a}},adornedObject:{configurable:!0,get:function(){return this.De},set:function(a){if(null!==a&&(x(a,P, Ag,"handle"),a.part instanceof Be))throw Error("new handle must not be in an Adornment: "+a);this.De=a}},snapAngleMultiple:{configurable:!0,get:function(){return this.oa},set:function(a){B(a,"number",Ag,"snapAngleMultiple");this.oa=a}},snapAngleEpsilon:{configurable:!0,get:function(){return this.Z},set:function(a){B(a,"number",Ag,"snapAngleEpsilon");this.Z=a}},originalAngle:{configurable:!0,get:function(){return this.Rw}},rotationPoint:{configurable:!0, get:function(){return this.yr},set:function(a){this.yr=a.copy()}},handleAngle:{configurable:!0,get:function(){return this.v},set:function(a){B(a,"number",Ag,"handleAngle");this.v=a}},handleDistance:{configurable:!0,get:function(){return this.G},set:function(a){B(a,"number",Ag,"handleDistance");this.G=a}}});Ag.className="RotatingTool";Ta("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.nb("Rotating",a,this.mouseDownTools)}); function Bg(){we.call(this);0e.right&&(c.x-=d.width+5/b.scale);c.xe.bottom&&(c.y-=d.height+5/b.scale);c.ya.lastInput.clickCount?!1:!0};ah.prototype.doStart=function(){kh=this;null!==this.textBlock&&this.doActivate()}; ah.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.oc(a.lastInput.documentPoint));if(null!==b&&b instanceof bh&&(this.textBlock=b,null!==b.part)){a.animationManager.Ic();this.isActive=!0;this.wa=hh;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.ki=this.textBlock.copy();var d=new M(this.textBlock.la(Ac),this.textBlock.la(Nc));a.Iv(d);c.show(b,a,this);this.currentTextEditor=c}}}};ah.prototype.doCancel=function(){this.stopTool()}; ah.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};ah.prototype.doMouseDown=function(){this.isActive&&this.acceptText(lh)};ah.prototype.acceptText=function(a){switch(a){case lh:if(this.wa===nh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.wa===hh||this.wa===jh||this.wa===ih)this.wa=oh,ph(this);break;case qh:case fh:case gh:if(fh!==a||!0!==this.textBlock.isMultiline)if(this.wa===hh||this.wa===jh||this.wa===ih)this.wa=oh,ph(this)}}; function ph(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.Ka(a.name),a.wa=nh,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.V("TextEdited",b,e),a.stopTransaction(),a.stopTool(),null!==c&&c.doFocus()):(a.wa=jh,a.doError(e,f))}} ah.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)};ah.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};ah.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.wa=dh,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.textBlock=null,this.isActive=!1)};ah.prototype.doStop=function(){kh=null}; ah.prototype.isValidText=function(a,b,c){x(a,bh,ah,"isValidText:textblock");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};ah.prototype.by=function(a){var b=this.ki;b.text=a;b.measure(this.textBlock.Uh,Infinity);return b}; oa.Object.defineProperties(ah.prototype,{textBlock:{configurable:!0,get:function(){return this.oa},set:function(a){null!==a&&x(a,bh,ah,"textBlock");this.oa=a}},currentTextEditor:{configurable:!0,get:function(){return this.o},set:function(a){this.o=a}},defaultTextEditor:{configurable:!0,get:function(){return this.j},set:function(a){!G||a instanceof Le||v("TextEditingTool.defaultTextEditor must be an HTMLInfo.");this.j=a}},starting:{configurable:!0, get:function(){return this.Z},set:function(a){$a(a,ah,ah,"starting");this.Z=a}},textValidation:{configurable:!0,get:function(){return this.Ij},set:function(a){null!==a&&B(a,"function",ah,"textValidation");this.Ij=a}},minimumEditorScale:{configurable:!0,get:function(){return this.v},set:function(a){null!==a&&B(a,"number",ah,"minimumEditorScale");this.v=a}},selectsTextOnActivate:{configurable:!0,get:function(){return this.G},set:function(a){null!==a&&B(a,"boolean", ah,"selectsTextOnActivate");this.G=a}},state:{configurable:!0,get:function(){return this.wa},set:function(a){this.wa!==a&&($a(a,ah,ah,"starting"),this.wa=a)}}});ah.prototype.measureTemporaryTextBlock=ah.prototype.by; var qh=new F(ah,"LostFocus",0),lh=new F(ah,"MouseDown",1),gh=new F(ah,"Tab",2),fh=new F(ah,"Enter",3),rh=new F(ah,"SingleClick",0),ch=new F(ah,"SingleClickSelected",1),mh=new F(ah,"DoubleClick",2),dh=new F(ah,"StateNone",0),hh=new F(ah,"StateActive",1),ih=new F(ah,"StateEditing",2),oh=new F(ah,"StateValidating",3),jh=new F(ah,"StateInvalid",4),nh=new F(ah,"StateValidated",5),kh=null;ah.className="TextEditingTool";ah.LostFocus=qh;ah.MouseDown=lh;ah.Tab=gh;ah.Enter=fh;ah.SingleClick=rh; ah.SingleClickSelected=ch;ah.DoubleClick=mh;ah.StateNone=dh;ah.StateActive=hh;ah.StateEditing=ih;ah.StateValidating=oh;ah.StateInvalid=jh;ah.StateValidated=nh;Ta("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.nb("TextEditing",a,this.mouseUpTools)}); function sh(a){th||(uh(),th=!0);this.H=xe;this.$k=this.Fb=this.Iq=this.hc=!1;this.hx=!0;this.al=vh;this.Qm=!1;this.Sh=this.Pd=!0;this.Pg=600;this.rw=this.ex=!1;this.ee=new J;this.ie=new wh;this.ie.de=this;this.Ri=new J;this.Cu=new J;this.fs=new J;this.Cr=new J;a&&Object.assign(this,a)}sh.prototype.kf=function(a){this.H=a};sh.prototype.canStart=function(){return!0};function xh(a,b){a.Pd&&a.canStart(b)&&(a.ee.add(b),a.defaultAnimation.isAnimating&&a.Ic(),yh(a.H),a.Fb=!0)} function zh(a){if(a.Pd&&a.Fb){var b=a.ie,c=a.H,d=a.ee.contains("Model");d&&(a.$k=!0,a.al===vh?(b.isViewportUnconstrained=!0,b.Bc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.al===Ah&&b.Bc.clear(),a.hx=a.al===Bh&&c.qu.D(c.va)?!0:!1,c.V("InitialAnimationStarting",a));d&&!a.Sh||0===b.Bc.count?(a.ee.clear(),a.Fb=!1,b.Bc.clear(),Ch(b,c),a.$k=!1,c.R()):(a.ee.clear(),c.wg=!1,d=b.Bc.get(c),c.autoScale!==Dh&&null!==d&&(delete d.start.scale,delete d.end.scale), sa.requestAnimationFrame(function(){!1===a.Fb||b.hc||(c.Sf("temporaryPixelRatio")&&Se(c),Eh(c),a.Fb=!1,b.start(),b.hc&&(Fh(a),c.eb(),Gh(b,0),Mf(c,!0),Hh(a),c.V("AnimationStarting",a)))}))}}function Ih(a){return a.ee.contains("Trigger")&&1===a.ee.count}function Jh(a,b,c,d){a.isTicking||Ih(a)||b instanceof S&&(null!==b.fromNode||null!==b.toNode)||a.ie.add(b,"position",c,d,!1)}t=sh.prototype;t.uv=function(a){return this.ie.uv(a)};t.mv=function(a){return this.ie.mv(a)}; function Kh(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 uh(){function a(a,b,e,f,g,h){a.position=new K(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new vb;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){ga&&Ba(a,">= 1",sh,"duration");this.Pg=a}},isAnimating:{configurable:!0, enumerable:!0,get:function(){return this.hc}},isTicking:{configurable:!0,get:function(){return this.Iq}},isInitial:{configurable:!0,get:function(){return this.Sh},set:function(a){B(a,"boolean",sh,"isInitial");this.Sh=a}},defaultAnimation:{configurable:!0,get:function(){return this.ie}},activeAnimations:{configurable:!0,get:function(){return this.Ri}},initialAnimationStyle:{configurable:!0,get:function(){return this.al},set:function(a){G&& $a(a,sh,sh,"initialAnimationStyle");this.al=a}}});sh.prototype.stopAnimation=sh.prototype.Ic;var bi=null,th=!1,vh=new F(sh,"Default",1),Bh=new F(sh,"AnimateLocations",2),Ah=new F(sh,"None",3);sh.className="AnimationManager";sh.defineAnimationEffect=function(a,b){th||(uh(),th=!0);bi.add(a,b)};sh.Default=vh;sh.AnimateLocations=Bh;sh.None=Ah; function wh(a){this.Iu=this.bx=this.de=this.H=null;this.il=this.hc=this.j=!1;this.qn=this.Wd=0;this.Yp=this.Bt=ci;this.hl=this.to=!1;this.pu=1;this.nu=0;this.Nd=this.Pg=NaN;this.vw=0;this.rn=null;this.o=yb;this.Bc=new vb;this.fu=new vb;this.Ll=new J;this.gu=new J;this.sw=di;a&&Object.assign(this,a)}wh.prototype.suspend=function(){this.il=!0};wh.prototype.advanceTo=function(a,b){b&&(this.il=!1);this.to&&a>=this.Nd&&(this.hl=!0,a-=this.Nd);this.vw=a;Lh(this,!0);Fh(this.de);Mf(this.H);Hh(this.de);this.H.redraw()}; function Ch(a,b){a.fu.clear();a.hl=!1;a.nu=0;a.Nd=NaN;0a.qn?a.Nd:d-a.Wd;b&&(e=a.vw,ea.qn&&(a.to&&!a.hl?(a.Wd=+new Date,a.qn=a.Wd+a.Nd,a.hl=!0):a.$l(!1))}}} function Gh(a,b){for(var c=a.Nd,d=a.Bc.iterator,e=a.hl;d.next();){var f=d.key;if(!(f instanceof P&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=bi,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.Yp,b,c,a)}}}t.stop=function(){if(!this.hc)return this;this.$l(!0);return this}; t.$l=function(a){null!==this.Iu&&this.Iu.vo.remove(this.bx);if(this.hc){var b=this.H,c=this.de;this.il=this.hc=c.$k=!1;Fh(c);for(var d=this.Bc,e=this.Ll.iterator;e.next();)b.remove(e.value);for(e=this.gu.iterator;e.next();)e.value.w();e=this.to;d=d.iterator;for(var f=bi;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.$u,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Vu||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]: h.Vu?k[n]:l[n],this.Yp,this.Nd,this.Nd,this)}h.Vu&&void 0!==m.location&&g instanceof U&&(g.location=m.location);h.Cv&&g instanceof U&&g.ec(!1)}b.Ns.clear();lf(b,!1);b.eb();b.R();Mf(b,!0);if(c.defaultAnimation===this){for(n=c.Cr.iterator;n.next();)e=n.value,null!==e.eh&&(e.points=e.eh,e.eh=null);c.Cr.clear()}Mf(b,!0);this.isViewportUnconstrained&&(b.scrollMode=this.sw);Hh(c);this.nu++;!a&&this.pu>this.nu?(this.hl=!1,this.start()):(this.rn&&this.rn(this),Ch(this,null),c.$l(this),b.fc())}}; t.Pj=function(a,b){var c=b.actualBounds,d=null;b instanceof Df&&(d=b.placeholder);null!==d?(c=d.la(Ac),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new K(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof Df)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Pj(d,b)}; t.Nj=function(a,b){if(a.isVisible()){var c=null;b instanceof Df&&(c=b.placeholder);if(null!==c){var d=c.la(Ac);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.Bc;d.contains(a)&&(d.L(a).Cv=!0);if(a instanceof Df)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.Nj(d,b)}};t.Yz=function(a){var b=this.fu.get(a);null===b&&(b={},this.fu.add(a,b));return b}; oa.Object.defineProperties(wh.prototype,{duration:{configurable:!0,get:function(){return this.Pg},set:function(a){B(a,"number",wh,"duration");1>a&&Ba(a,">= 1",wh,"duration");this.Pg=a}},reversible:{configurable:!0,get:function(){return this.to},set:function(a){this.to=a}},runCount:{configurable:!0,get:function(){return this.pu},set:function(a){0a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function ei(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}wh.className="Animation";wh.EaseLinear=function(a,b,c,d){return c*a/d+b};wh.EaseInOutQuad=ci;wh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};wh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};wh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};wh.EaseOutExpo=ei; function ki(a,b,c){this.start=a;this.end=b;this.$u={};this.Vu=c;this.Cv=!1}ki.className="AnimationState";function li(a,b,c){this.Dd=null;this.Df=a;this.Eo=c||mi;this.Gk=null;void 0!==b&&(this.Gk=b,void 0===c&&(this.Eo=ni))}li.prototype.copy=function(){var a=new li(this.Df);a.Eo=this.Eo;var b=this.Gk;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.Gk=c}return a}; function oi(a,b){a=a.Gk;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))} oa.Object.defineProperties(li.prototype,{propertyName:{configurable:!0,get:function(){return this.Df},set:function(a){this.Df=a}},animationSettings:{configurable:!0,get:function(){return this.Gk},set:function(a){this.Gk=a}},startCondition:{configurable:!0,get:function(){return this.Eo},set:function(a){G&&$a(a,li,li,"startCondition");this.Eo=a}}});var mi=new F(li,"Default",1),ni=new F(li,"Immediate",2),pi=new F(li,"Bundled",3);li.className="AnimationTrigger"; li.Default=mi;li.Immediate=ni;li.Bundled=pi;function qi(a){Ya(this);this.H=null;this.Ua=new I;this.Ea="";this.vb=1;this.o=!1;this.j=this.fi=this.v=this.aj=this.$i=this.Zi=this.Yi=this.Wi=this.Xi=this.Vi=this.cj=this.Ui=this.bj=this.Ti=this.Si=!0;this.lr=[];a&&Object.assign(this,a)}t=qi.prototype;t.clear=function(){for(var a=this.Ua,b=0;b=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ua.iterator;h.next();){var k=h.value;k instanceof Df?e++:k instanceof V?d++:k instanceof S?f++:k instanceof Be?g++:c++}h="";0c.ar||h.height*e>c.ar?b.mc(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&&(wi(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(wi(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),wi(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.Ks()||(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.ad(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.jb(pe,a,this,b,c,d,e)};t.Bi=function(a,b,c){var d=this.Ua;b.Ug=this;null===this&&ri(b);if(a>=d.count)a=d.count;else if(d.P(a)===b)return-1;d.Mb(a,b);b.hp(c);d=this.diagram;null!==d&&(c?d.R():d.Bi(b));xi(this,a,b);return a}; t.wc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.wc(a,b,c);var d=this.Ua;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.P(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.ip(c);d.sb(a);d=this.diagram;null!==d&&(c?d.R():d.wc(b));b.Ug=null;ri(b);return a}; function xi(a,b,c){b=yi(a,b,c);if(c instanceof Df&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ua.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.P(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.sb(b);a.Mb(f,c);return f}for(g=NaN;0<=--f&&(g=a.P(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k=d){h--;if(h===b)break;a.sb(b);a.Mb(h,c);return h}for(k=NaN;++h< e&&(k=a.P(h).zOrder,isNaN(k)););}return b} oa.Object.defineProperties(qi.prototype,{parts:{configurable:!0,get:function(){return this.Ua.iterator}},partsBackwards:{configurable:!0,get:function(){return this.Ua.iteratorBackwards}},diagram:{configurable:!0,get:function(){return this.H}},name:{configurable:!0,get:function(){return this.Ea},set:function(a){B(a,"string",qi,"name");var b=this.Ea;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&v("Cannot rename default Layer to: "+a),c= c.layers;c.next();)c.value.name===a&&v("Layer.name is already present in this diagram: "+a);this.Ea=a;this.g("name",b,a);for(a=this.Ua.iterator;a.next();)a.value.layerName=this.Ea}}},opacity:{configurable:!0,get:function(){return this.vb},set:function(a){var b=this.vb;b!==a&&(B(a,"number",qi,"opacity"),(0>a||1=a)return b;for(var c=this.ab.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b}; function Ii(a,b){if($g){void 0!==b&&null!==b||v("Diagram setup requires an argument DIV.");null!==a.Pa&&v("Diagram has already completed setup.");"string"===typeof b?a.Pa=sa.document.getElementById(b):b instanceof HTMLDivElement?a.Pa=b:v("No DIV or DIV id supplied: "+b);null===a.Pa&&v("Invalid DIV id; could not get element with id: "+b);void 0!==a.Pa.H&&v("Invalid div id; div already has a Diagram associated with it.");if(!a.Bl&&sa.ResizeObserver){var c=ua(function(){a.fc()},250);a.Bl=new sa.ResizeObserver(function(){c()}); a.Bl.observe(a.Pa)}"static"===sa.getComputedStyle(a.Pa,null).position&&(a.Pa.style.position="relative");b=5;var d="rgba(2"+b+"5, 255, 255, 0)";b--;a.Pa.style["-webkit-tap-highlight-color"]=d;a.Pa.innerHTML="";a.Pa.H=a;a.Pa.goDiagram=a;a.Pa.go=sa.go;var e=new cj(a);void 0!==e.style&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px","rtl"===sa.getComputedStyle(a.Pa,null).getPropertyValue("direction")&&(a.Fn=!0),e.style.zIndex="2",e.style.userSelect="none",e.style.MozUserSelect="none", e.style.touchAction="none",e.style.letterSpacing="normal !important",e.style.wordSpacing="normal !important");a.Aa=e;a.pb=e.context;d=a.pb;a.Sb=a.computePixelRatio();a.viewSize.u()||(a.Ga=a.Pa.clientWidth||1,a.Fa=a.Pa.clientHeight||1);dj(a,a.Ga,a.Fa);a.Pa.insertBefore(e.Ta,a.Pa.firstChild);e=new cj(null);e.width=1;e.height=1;a.yw=e;a.Gy=e.context;if($g){e=wa("div");var f=wa("div");e.style.position="absolute";e.style.overflow="auto";e.style.width=a.Ga+"px";e.style.height=a.Fa+"px";e.style.zIndex="1"; f.style.position="absolute";f.style.width="1px";f.style.height="1px";a.Pa.appendChild(e);e.appendChild(f);e.onscroll=ej;e.addEventListener("pointerdown",fj);e.H=a;e.Ly=!0;e.My=!0;a.xu=e;a.uu=f}a.tk=ua(function(){a.ji=null;a.R()},300);a.cw=ua(function(){Eh(a)},250);a.preventDefault=function(a){a.preventDefault();return!1};a.kk=function(b){if(a.isEnabled){var c=gj(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.Lq++:a.Lq=1;d.clickCount=a.Lq;a.Iw=b.timeStamp;a.Jw.Eg(b.screenX,b.screenY);a.doMouseDown();1===b.button?b.preventDefault():hj(a,d,b)}};a.pk=function(b){if(a.isEnabled){a.gl=!0;var c=a.Bj;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=ij(a,b,!1,!1,!1,null!==c[1]);var d=sa.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;jj(a,f,c);c.targetObject=null;a.doMouseMove();hj(a,c,b)}}};a.rk=function(b){if(a.isEnabled){a.gl=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.ku;if(c&&a.Du)delete d[b.pointerId],b.preventDefault();else if(d=a.Bj,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=ij(a,b,!1,!0,!0,!1);var e=sa.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&&jj(e.H,b,d);null===e&&(e=b.target);jj(a,b,d);d.clickCount=a.Lq;d.targetDiagram=kj(b,e);d.targetObject=null;a.doMouseUp();hj(a,d,b);c&&(a.Jq=!1)}}};a.qk=function(b){if(a.isEnabled){a.gl=!1;var c=a.ku;c[b.pointerId]&&delete c[b.pointerId]; c=a.Bj;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.nk=function(b){var c=a.Bj;null!==c[0]&&c[0].pointerId===b.pointerId?(c[0]=null,a.Jq=!1):null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null)};a.iq=d.ba["d"+lj[1]+lj[2]+"wI"+mj.slice(1,5)]["b"+nj.slice(1,b)](d.ba,oj,b,b);d.ad(!0);pj(a);"svg"===a.Al&&(b=a.Cj.get("svg"),a.Pa.appendChild(b.Ta), a.pb=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 pj(a){var b=a.Aa.Ta;b instanceof HTMLCanvasElement||(b=a.div);a.addEventListener(b,"pointerdown",a.Hi,!1);a.addEventListener(b,"pointermove",a.pk,!1);a.addEventListener(b,"pointerup",a.rk,!1);a.addEventListener(b,"pointerout",a.qk,!1);a.addEventListener(b,"pointercancel",a.nk,!1);a.addEventListener(b,"pointerenter",a.uz,!1);a.addEventListener(b,"pointerleave",a.vz,!1);a.addEventListener(b,"wheel",a.kk,!1);a.addEventListener(b,"keydown",a.jA,!1);a.addEventListener(b,"keyup",a.kA,!1);a.addEventListener(b, "blur",a.ez,!1);a.addEventListener(b,"focus",a.fz,!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(sa,"resize",a.cw,!1)}function Se(a){30r&&(this.position=y.h(-(b.scrollWidth-this.Ga)+w-this.Ga/e+m,this.position.y))),a.My&&this.allowVerticalScroll&&(hu&&(this.position= y.h(this.position.x,-(b.scrollHeight-this.Fa)+a.scrollTop-this.Fa/e+f))),K.free(y),this.Bd=!0,this.Oe=this.Dr=!1,d=this.documentBounds,e=this.viewportBounds,m=d.right,r=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<=r&&(c.style.width="1px"),q>=l&&h>=d&&f<=u&&(c.style.height="1px"))}};Q.prototype.computeBounds=function(a){void 0===a&&(a=new M);yh(this);return sj(this,a)}; function sj(a,b){if(a.fixedBounds.u())return b.assign(a.fixedBounds),b.Oo(a.Eb),b;for(var c=!0,d=a.ab.s,e=d.length,f=0;fc&&(b=c),ba.maxScale&&(b=a.maxScale),b):b===xj?(b=k>h?(g-a.Jb)/d:(f-a.Jb)/e,b>c&&(b=c),ba.maxScale&&(b=a.maxScale),b):a.scale} Q.prototype.zoomToFit=function(){var a=this.Fj;this.Fj=di;this.scale=uj(this,wj);a!==di&&(tj(this,!1),vj(this,this.documentBounds,this.Ga/this.Ia,this.Fa/this.Ia,this.Lk,!1));this.Fj=a};t=Q.prototype; t.VA=function(a,b){void 0===b&&(b=wj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===wj||b===xj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Ga;var f=this.Fa;e=b===xj?f/d>e/c?(f-(this.Le?this.Jb:0))/d:(e-(this.uf?this.Jb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new K(a.x,a.y)}}; t.$y=function(a,b){this.$a();var c=this.documentBounds,d=this.viewportBounds;this.position=new K(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.Tz=function(a){if(a instanceof P){this.rq=a;var b=K.alloc();this.sq=this.Cp(a.la(Ac,b));K.free(b)}else this.rq=null,this.sq=Cb}; function vj(a,b,c,d,e,f){var g=K.allocAt(a.va.x,a.va.y),h=g.x,k=g.y;if(null!==a.rq){var l=K.alloc();l=a.rq.la(Ac,l);h=l.x-a.sq.x/a.scale;k=l.y-a.sq.y/a.scale;e=zc;K.free(l)}if(f||a.scrollMode===di)e.mb()&&(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.Ej,f=c-b.width,cb.left?h=b.left:hb.top?k=b.top:kb;b++){var c=a.Ne.iterator;if(null===c||0===a.Ne.count)break;a.Ne=new J;a.bw(c,a.Ne);G&&22===b&&Fa("failure to validate parts")}a.nodes.each(function(a){a instanceof Df&&0!==(a.U&65536)!==!1&&(a.U=a.U^65536)})}} t.bw=function(a,b){for(a.reset();a.next();){var c=a.value;!c.ed()||c instanceof Df||(c.Fi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof Df&&c.isVisible()&&Hj(this,c);for(a.reset();a.next();)c=a.value,c instanceof S&&c.isVisible()&&(c.Fi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Be&&c.isVisible()&&(c.Fi()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}; function Hj(a,b){for(var c=Na(),d=Na(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof Df?(Ij(f)||Jj(f)||Kj(f))&&Hj(a,f):f instanceof S?f.fromNode===b||f.toNode===b?d.push(f):c.push(f):(f.measure(Infinity,Infinity),f.arrange()))}a=c.length;for(e=0;eE&&(w=T.left, z=T.right),y.height>H&&(A=T.top,C=T.bottom)):(w=T.left,z=T.right,A=T.top,C=T.bottom);var aa=y.width+w+z,Y=y.height+A+C;T=a.scale;var R=aa>k/T,O=Y>l/T;if(!(f||a.uf||a.Le||R||O))return!0;w=y.x-w;k=m.x;z=y.right+z;l=m.right+g;A=y.y-A;var la=m.y;y=y.bottom+C;m=m.bottom+h;var ha="1px";C="1px";a.scrollMode===di&&(R||O)&&(R&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(R=1,w+1l+1&&(R=Math.max((z-l)*T+a.Ga,R)),E+g+1m+1&&(R=Math.max((y-m)*T+a.Fa,R)),H+h+1l+1&&(g=Math.max((z-l)*T+a.Ga,g)),E+1m+1&&(h=Math.max((y-m)*T+g,h)),H+1l+1&&(b=a.position.x*T));if(a.Fn)switch(a.ou){case "negative":b=-(r.scrollWidth-b-r.clientWidth);break;case "reverse":b=r.scrollWidth-b-r.clientWidth}r.scrollLeft=b;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(H+1< Y?r.scrollTop=(a.position.y-A)*T:A+1m+1&&(r.scrollTop=a.position.y*T));k=a.Ga;l=a.Fa;r.style.width=k+(a.uf?a.Jb:0)+"px";r.style.height=l+(a.Le?a.Jb:0)+"px";return c!==k||d!==l||a.animationManager.Fb?(c=M.allocAt(e,n,p,q),a.onViewportBoundsChanged(c,a.viewportBounds,T,f),M.free(c),!1):!0}t=Q.prototype; t.add=function(a){x(a,U,Q,"add:part");var b=a.diagram;if(b!==this&&(null!==b&&v("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString()),b=this.bk(a.layerName),null===b&&(b=this.bk("")),null===b&&v('Cannot add a Part when unable find a Layer named "'+a.layerName+'" and there is no default Layer'),a.layer!==b)){var c=b.Bi(99999999,a,a.diagram===this);0<=c&&this.jb(re,"parts",b,null,a,null,c);b.isTemporary||this.eb();a.F(1);c=a.layerChanged;null!==c&&c(a,null, b)}};t.Bi=function(a){this.partManager.Bi(a);var b=this;Vj(a,function(a){Wj(b,a)});(a instanceof Be||a instanceof Df&&null!==a.placeholder)&&a.w();null!==a.data&&Vj(a,function(a){Xj(b.partManager,a)});!0!==Jj(a)&&!0!==Kj(a)||this.Ne.add(a);Yj(a,!0,this);Zj(a)?(a.actualBounds.u()&&this.R(Uj(a,a.actualBounds)),this.eb()):a.isVisible()&&a.actualBounds.u()&&this.R(Uj(a,a.actualBounds));this.fc()}; t.wc=function(a){a.Qj();this.partManager.wc(a);var b=this;null!==a.data&&Vj(a,function(a){ak(b.partManager,a,b)});this.Ne.remove(a);Zj(a)?(a.actualBounds.u()&&this.R(Uj(a,a.actualBounds)),this.eb()):a.isVisible()&&a.actualBounds.u()&&this.R(Uj(a,a.actualBounds));this.fc()};t.remove=function(a){x(a,U,Q,"remove:part");bk(this,a,!0)}; function bk(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.F(2),c&&b.Xj(),c=d.wc(-1,b,!1),0<=c&&a.jb(se,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.Vs=function(a,b){void 0===b&&(b=!1);if(Ha(a))for(var c=a.length,d=0;dd&&this.eb();return this}; t.Ty=function(a,b){hk(this,a,b);a.kf(this);var c=this.ab,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ic&&this.jb(se,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;fd&&this.eb();return this}; t.EA=function(a){x(a,qi,Q,"removeLayer:layer");a.diagram!==this&&v("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.ab,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ua.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.ic&&this.jb(se,"layers",this,a,null,c,null);this.R();this.eb()}}};t.bk=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null}; t.px=function(a){B(a,"function",Q,"addModelChangedListener:listener");null===this.Bf&&(this.Bf=new I);this.Bf.add(a);this.model.bf(a);return this};t.GA=function(a){B(a,"function",Q,"removeModelChangedListener:listener");null!==this.Bf&&(this.Bf.remove(a),0===this.Bf.count&&(this.Bf=null));this.model.uk(a)};t.bf=function(a){B(a,"function",Q,"addChangedListener:listener");null===this.Lg&&(this.Lg=new I);this.Lg.add(a);return this}; t.uk=function(a){B(a,"function",Q,"removeChangedListener:listener");null!==this.Lg&&(this.Lg.remove(a),0===this.Lg.count&&(this.Lg=null))};t.rs=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.iv(a);a.change!==qe&&(this.isModified=!0);if(null!==this.Lg)for(var b=this.Lg,c=b.length,d=0;dn.Ua.indexOf(q)&&n.Bi(p,q,r):(q.isSelected=!1,q.isHighlighted=!1,q.cc(),n.wc(r?p:-1,q,r)))}else n instanceof Q?"number"===typeof p&&q instanceof qi&&(b?(q.kf(this),this.ab.Mb(p,q)):this.ab.sb(p)):v("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==qe&&v("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings= c}}};Q.prototype.Ka=function(a){return this.undoManager.Ka(a)};Q.prototype.kb=function(a){return this.undoManager.kb(a)};Q.prototype.Wf=function(){return this.undoManager.Wf()};Q.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ka(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.kb(b):this.undoManager.Wf(),this.skipsUndoManager=c}};Q.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)}; Q.prototype.Fp=function(){this.partManager.Fp()}; function mk(a,b,c){var d=a.animationManager;if(a.Bb||a.rd)a.Ia=c,Si(a),a.R(),a.Oe=!0,a=a.Ia,d.Fb&&(Ih(d)||d.ie.add(d.H,"scale",b,a));else if(null===a.Aa)a.Ia=c,Si(a);else{a.Bb=!0;var e=a.viewportBounds.copy(),f=a.Ga,g=a.Fa,h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.fd()?l.Tf(Pc)?h=0:l.Tf(Qc)&&(h=f-1):h=l.mb()?l.x*(f-1):f/2);isNaN(k)&&(l.fd()?l.Tf(Oc)?k=0:l.Tf(Rc)&&(k=g-1):k=l.mb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating||(c= a.scaleComputation(a,c));ca.maxScale&&(c=a.maxScale);f=K.allocAt(a.va.x+h/b-h/c,a.va.y+k/b-k/c);a.position=f;K.free(f);a.Ia=c;Si(a);a.Bb=!1;a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);tj(a,!1);a=a.Ia;d.Fb&&(Ih(d)||d.ie.add(d.H,"scale",b,a))}} Q.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.D(b)){void 0===d&&(d=!1);d||(this.Oe=!0);this.Bd=!0;var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==Dh||a.width===b.width&&a.height===b.height||e.F();e=this.currentTool;!0===this.gl&&e instanceof Ua&&(this.lastInput.documentPoint=this.bt(this.lastInput.viewPoint),Ke(e,this));this.Bb||this.invalidateViewport(a,b);Ej(this);this.lc.scale=c;this.lc.position.x=a.x;this.lc.position.y=a.y;this.lc.bounds.assign(a);this.lc.canvasSize.width= Math.round(a.width*c);this.lc.canvasSize.height=Math.round(a.height*c);this.lc.newCanvasSize.width=this.Ga;this.lc.newCanvasSize.height=this.Fa;this.lc.isScroll=d;this.V("ViewportBoundsChanged",this.lc,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.dd(b)&&a.ib()})}}; function Ej(a,b){var c=a.le;if(null!==c&&c.visible){for(var d=Gb.alloc(),e=1,f=1,g=c.S.s,h=g.length,k=0;km||(nk(l.figure)?f=f*m/L.Mx(f,m):e=e*m/L.Mx(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=M.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.u()){M.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;M.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=K.alloc();L.Zo(a,g,0,0,d.width, d.height,b);b.offset(-d.width,-d.height);Gb.free(d);c.part.location=b;K.free(b)}}Q.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.V("ChangingSelection",b);for(var c=b.La(),d=c.length,e=0;e=d&&!f.defaultAnimation.isAnimating&&!f.Fb&&(b||xh(f,"Layout"));a.Ih=!1;for(var g=a.mi.iterator;g.next();)vk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),yh(a),e.isValidLayout=!0):a.Ih=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.kb("Layout"),a.undoManager.isInternalTransaction= !1),!b||0!==d&&1!==d||zh(f),a.da=c}}}function vk(a,b,c,d){if(null!==b){for(var e=b.sl.iterator;e.next();)vk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.Ch=!b.location.u(),e.doLayout(b),b.F(32),Hj(a,b),e.isValidLayout=!0):a.Ih=!0)}}t.Sz=function(){for(var a=new I,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.vh()&&a.add(c)}return a.iterator}; function Ki(a){function b(a){var b=a.toLowerCase(),e=new I;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new vb,d=new vb;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.xw=c;a.ww=d} function Rj(a,b){var c=a.ww.L(b);return null!==c?c:a.ww.L(b.toLowerCase())}function wk(a,b){var c=a.xw.L(b);if(null!==c)return c;c=a.xw.L(b.toLowerCase());if(null!==c)return c;v("Unknown DiagramEvent name: "+b)}t.Oj=function(a,b){B(a,"string",Q,"addDiagramListener:name");B(b,"function",Q,"addDiagramListener:listener");a=wk(this,a);null!==a&&a.add(b);return this};t.om=function(a,b){B(a,"string",Q,"removeDiagramListener:name");B(b,"function",Q,"addDiagramListener:listener");a=wk(this,a);null!==a&&a.remove(b)}; t.V=function(a,b,c){G&&B(a,"string",Q,"raiseDiagramEvent:name");var d=wk(this,a),e=new ne;e.diagram=this;a=Rj(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.P(0)(e);else if(0!==b)for(d=d.La(),c=0;c=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=M.allocAt(0,0,d.width*e,d.height*e);var f=K.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.cb(yb)||(b=new K(b.x+f.x/e,b.y+f.y/e)); M.free(d);K.free(f);return b};t=Q.prototype;t.Ps=function(){return null};t.pv=function(){return null};t.ps=function(a,b){this.Cj.add(a,b)};t.Tu=function(a){(this.gx=a)||this.nodes.each(function(a){a instanceof Df&&(a.nq=null)})}; function Hk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].ml){f=!1;break}f||a-l>k?b(c,e,h):sa.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Zg.iterator;g.next();)if(!g.value[0].ml){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;sa.requestAnimationFrame(function(){d()});return null}t.pA=function(a){if(!$g)return null;void 0===a&&(a={});a.returnType="Image";return this.$x(a)}; t.$x=function(a){void 0===a&&(a={});return Hk(this,this.qA,a)}; t.qA=function(a,b,c){var d=Qk(c,a,"canvas",null);if(null===d)return null;c=d.ba.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case mj+"data":e=d.getImageData(0,0,c.width,c.height);break;case mj:d=(a.document||document).createElement("img");d.src=c.toDataURL(a.type,a.details);e=d;break;case "blob":"function"!==typeof b&&v('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 Qk(a,b,c,d){a.animationManager.Ic();a.hd();if(null===a.Aa)return null;"object"!==typeof b&&v("properties argument must be an Object.");var e=!1,f=b.size||null,g=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(g="NaN");var h=b.maxSize;void 0===b.maxSize&&(e=!0,h="SVG"===c?new Gb(Infinity,Infinity):new Gb(2E3,2E3));var k=b.position||null,l=b.parts||null,m=void 0===b.padding?1:b.padding,n=b.background||null,p=b.omitTemporary;void 0===p&&(p=!0);var q=b.document||document,r=b.elementFinished|| null,u=b.showTemporary;void 0===u&&(u=!p);b=b.showGrid;void 0===b&&(b=u);null!==f&&isNaN(f.width)&&isNaN(f.height)&&(f=null);"number"===typeof m?m=new fc(m):m instanceof fc||v("MakeImage padding must be a Margin or a number.");m.left=Math.max(m.left,0);m.right=Math.max(m.right,0);m.top=Math.max(m.top,0);m.bottom=Math.max(m.bottom,0);a.pb.ad(!0);p=new cj(null,q,void 0,!0);var y=p.context;if(!(f||g||l||k)){p.width=a.Ga+Math.ceil(m.left+m.right);p.height=a.Fa+Math.ceil(m.top+m.bottom);if("SVG"===c){if(null=== d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=q;d.vs=r;Pj(a,d.context,m,new Gb(p.width,p.height),a.Ia,a.va,l,n,u,b);return d.context}a.kn=!1;Pj(a,y,m,new Gb(p.width,p.height),a.Ia,a.va,l,n,u,b);a.kn=!0;return p.context}var w=a.bq,z=a.documentBounds.copy();z.Uv(a.Eb);if(u)for(var A=a.ab.s,C=A.length,E=0;Ew?(g=w,f=z.width,z=z.height):(f=h.width,z=h.height)):(f=z.width*g,z=z.height*g):(g=w,f=z.width,z=z.height);null!==m?(f+=k,z+=C):m=new fc(0);null!==h&&(w=h.width,h=h.height,"SVG"!==c&&e&&!Uk&&G&&(f>w|| z>h)&&(Fa("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(f)+"x"+Math.ceil(z)+" vs 2000x2000) Consider increasing the max size."),Uk=!0),isNaN(w)&&(w=2E3),isNaN(h)&&(h=2E3),isFinite(w)&&(f=Math.min(f,w)),isFinite(h)&&(z=Math.min(z,h)));p.width=Math.ceil(f);p.height=Math.ceil(z);if("SVG"===c){if(null===d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=q;d.vs=r;Pj(a,d.context,m,new Gb(Math.ceil(f),Math.ceil(z)),g,A,l,n,u,b); return d.context}a.kn=!1;Pj(a,y,m,new Gb(Math.ceil(f),Math.ceil(z)),g,A,l,n,u,b);a.kn=!0;return p.context} oa.Object.defineProperties(Q.prototype,{renderer:{configurable:!0,get:function(){return this.Al},set:function(a){this instanceof Vk||(""===a&&(a="default"),a=a.toLowerCase(),a!==this.Al&&(this.Al=a,"default"===a||"canvas"===a?(a=this.Cj.get("svg"),null!==a&&a.Ta.remove(),this.Aa&&(this.pb=this.Aa.context)):"svg"===a?(this.Cj.contains("svg")?a=this.Cj.get("svg"):(a=new Tj(this,sa.document),this.ps("svg",a)),null!==this.div&&this.div.appendChild(a.Ta),this.pb=a.context,this.Aa&&(this.Aa.context.setTransform(this.Sb, 0,0,this.Sb,0,0),this.Aa.context.clearRect(0,0,this.Ga,this.Fa))):"debug"!==a||this.Cj.contains("SVG")||(a=new Tj(this,sa.document),this.ps("SVG",a),a.Ta.style.backgroundColor="whitesmoke",null!==this.div&&this.div.after(a.Ta)),this.tk()))}},div:{configurable:!0,get:function(){return this.Pa},set:function(a){null!==a&&x(a,HTMLDivElement,Q,"div");if(this.Pa!==a){var b=this.Pa;null!==b?(b.H=void 0,b.goDiagram=void 0,b.go=void 0,b.innerHTML="",null!==this.Aa&&(b=this.Aa.Ta,this.removeEventListener(b, "pointermove",this.pk,!1),this.removeEventListener(b,"pointerdown",this.Hi,!1),this.removeEventListener(b,"pointerup",this.rk,!1),this.removeEventListener(b,"pointerout",this.qk,!1),this.removeEventListener(b,"pointercancel",this.nk,!1),this.Aa.Cx()),this.Bl&&(this.Bl.disconnect(),this.Bl=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.Aa=null,this.removeEventListener(sa,"resize",this.cw,!1),this.removeEventListener(sa,"wheel",this.kk,!0),xe===this&&(xe=null)):null===this.Hi&&(this.vf=!1);this.Pa=null;if(null!==a){if(b=a.H)b.div=null;Ii(this,a);this.tk()}}}},sx:{configurable:!0,get:function(){return this.er}},Di:{configurable:!0,get:function(){return this.vf}},draggedLink:{configurable:!0,get:function(){return this.At},set:function(a){this.At!==a&&(this.At= a,null!==a&&(this.hu=a.fromPort,this.iu=a.toPort))}},ey:{configurable:!0,get:function(){return this.hu},set:function(a){this.hu=a}},gy:{configurable:!0,get:function(){return this.iu},set:function(a){this.iu=a}},animationManager:{configurable:!0,get:function(){return this.de}},undoManager:{configurable:!0,get:function(){return this.ic.undoManager}},skipsUndoManager:{configurable:!0,get:function(){return this.hh},set:function(a){B(a, "boolean",Q,"skipsUndoManager");this.hh=a;this.ic.skipsUndoManager=a}},delaysLayout:{configurable:!0,get:function(){return this.yt},set:function(a){this.yt=a}},opacity:{configurable:!0,get:function(){return this.vb},set:function(a){var b=this.vb;b!==a&&(B(a,"number",Q,"opacity"),(0>a||1a&&Ba(a,">= 0",Q,"scrollHorizontalLineChange"),this.vu=a,this.g("scrollHorizontalLineChange", b,a))}},scrollVerticalLineChange:{configurable:!0,get:function(){return this.zu},set:function(a){var b=this.zu;b!==a&&(B(a,"number",Q,"scrollVerticalLineChange"),0>a&&Ba(a,">= 0",Q,"scrollVerticalLineChange"),this.zu=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{configurable:!0,get:function(){return this.pj},set:function(a){G&&x(a,le,Q,"lastInput");this.pj=a}},previousInput:{configurable:!0,get:function(){return this.ah},set:function(a){G&&x(a,le, Q,"previousInput");this.ah=a}},firstInput:{configurable:!0,get:function(){return this.pq},set:function(a){G&&x(a,le,Q,"firstInput");this.pq=a}},currentCursor:{configurable:!0,get:function(){return this.vt},set:function(a){""===a&&(a=this.aq);if(this.vt!==a){B(a,"string",Q,"currentCursor");var b=this.Aa,c=this.Pa;if(null!==b&&null!==c){this.vt=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:{configurable:!0,get:function(){return this.aq},set:function(a){""===a&&(a="auto");var b=this.aq;b!==a&&(B(a,"string",Q,"defaultCursor"),this.aq=a,this.g("defaultCursor",b,a))}},click:{configurable:!0,get:function(){return this.Kh},set:function(a){var b=this.Kh;b!==a&&(null!==a&&B(a,"function",Q,"click"),this.Kh=a,this.g("click", b,a))}},doubleClick:{configurable:!0,get:function(){return this.Qh},set:function(a){var b=this.Qh;b!==a&&(null!==a&&B(a,"function",Q,"doubleClick"),this.Qh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return this.Mh},set:function(a){var b=this.Mh;b!==a&&(null!==a&&B(a,"function",Q,"contextClick"),this.Mh=a,this.g("contextClick",b,a))}},mouseOver:{configurable:!0,get:function(){return this.bi},set:function(a){var b=this.bi;b!== a&&(null!==a&&B(a,"function",Q,"mouseOver"),this.bi=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return this.$h},set:function(a){var b=this.$h;b!==a&&(null!==a&&B(a,"function",Q,"mouseHover"),this.$h=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return this.Zh},set:function(a){var b=this.Zh;b!==a&&(null!==a&&B(a,"function",Q,"mouseHold"),this.Zh=a,this.g("mouseHold",b,a))}},mouseDragOver:{configurable:!0, get:function(){return this.cu},set:function(a){var b=this.cu;b!==a&&(null!==a&&B(a,"function",Q,"mouseDragOver"),this.cu=a,this.g("mouseDragOver",b,a))}},mouseDrop:{configurable:!0,get:function(){return this.Xh},set:function(a){var b=this.Xh;b!==a&&(G&&null!==a&&B(a,"function",Q,"mouseDrop"),this.Xh=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{configurable:!0,get:function(){return this.Kt},set:function(a){var b=this.Kt;b!==a&&(B(a,"boolean",Q,"handlesDragDropForTopLevelParts"), this.Kt=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{configurable:!0,get:function(){return this.Yh},set:function(a){var b=this.Yh;b!==a&&(null!==a&&B(a,"function",Q,"mouseEnter"),this.Yh=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return this.ai},set:function(a){var b=this.ai;b!==a&&(null!==a&&B(a,"function",Q,"mouseLeave"),this.ai=a,this.g("mouseLeave",b,a))}},toolTip:{configurable:!0,get:function(){return this.li}, set:function(a){var b=this.li;b!==a&&(!G||null===a||a instanceof Be||a instanceof Le||v("Diagram.toolTip must be an Adornment or HTMLInfo."),this.li=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return this.Nh},set:function(a){var b=this.Nh;b!==a&&(!G||a instanceof Be||a instanceof Le||v("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.Nh=a,this.g("contextMenu",b,a))}},commandHandler:{configurable:!0,get:function(){return this.tb}, set:function(a){this.tb!==a&&(this.tb=a,a.kf(this))}},toolManager:{configurable:!0,get:function(){return this.Be},set:function(a){this.Be!==a&&(x(a,Ua,Q,"toolManager"),this.Be=a,a.diagram=this)}},defaultTool:{configurable:!0,get:function(){return this.ub},set:function(a){var b=this.ub;b!==a&&(x(a,we,Q,"defaultTool"),this.ub=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{configurable:!0,get:function(){return this.ob},set:function(a){var b= this.ob;b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(x(a,we,Q,"currentTool"),this.ob=a,a.diagram=this,a.doStart())}},selection:{configurable:!0,get:function(){return this.Ww}},maxSelectionCount:{configurable:!0,get:function(){return this.$t},set:function(a){var b=this.$t;if(b!==a)if(B(a,"number",Q,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.$t=a,this.g("maxSelectionCount",b,a),!this.undoManager.isUndoingRedoing&& (a=this.selection.count-a,0= 0",Q,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.eu},set:function(a){var b=this.eu;b!==a&&(x(a,Be,Q,"nodeSelectionAdornmentTemplate"),this.eu=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{configurable:!0, enumerable:!0,get:function(){return this.Jt},set:function(a){var b=this.Jt;b!==a&&(x(a,Be,Q,"groupSelectionAdornmentTemplate"),this.Jt=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.Xt},set:function(a){var b=this.Xt;b!==a&&(x(a,Be,Q,"linkSelectionAdornmentTemplate"),this.Xt=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{configurable:!0,get:function(){return this.Cw}},isModified:{configurable:!0, enumerable:!0,get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.Dn&&this.Me!==a.historyIndex:this.Dn},set:function(a){if(this.Dn!==a){B(a,"boolean",Q,"isModified");this.Dn=a;var b=this.undoManager;!a&&b.isEnabled&&(this.Me=b.historyIndex);a||ok(this)}}},model:{configurable:!0,get:function(){return this.ic},set:function(a){var b=this.ic;if(b!==a){x(a,X,Q,"model");this.currentTool.doCancel();b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&& v("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Ic(!0);var c=Qi(this,!0);this.vf=!1;this.sn=!0;this.Me=-2;this.wg=!1;var d=this.Bb;this.Bb=!0;xh(this.animationManager,"Model");b&&(null!==this.Bf&&this.Bf.each(function(a){return b.uk(a)}),b.uk(this.Uc));this.ic=a;this.partManager=pk(this.ic.type);for(var e=0;ethis.scale&&(this.scale=a)):Ba(a,"> 0",Q,"minScale"))}},maxScale:{configurable:!0,get:function(){return this.Zt}, set:function(a){D(a,Q,"maxScale");var b=this.Zt;b!==a&&(0 0",Q,"maxScale"))}},zoomPoint:{configurable:!0,get:function(){return this.Mu},set:function(a){this.Mu.D(a)||(x(a,K,Q,"zoomPoint"),this.Mu=a=a.M())}},contentAlignment:{configurable:!0,get:function(){return this.Lk},set:function(a){var b=this.Lk;b.D(a)||(x(a,Hb,Q,"contentAlignment"),this.Lk=a=a.M(),this.g("contentAlignment",b,a),tj(this,!1))}}, initialContentAlignment:{configurable:!0,get:function(){return this.Cq},set:function(a){var b=this.Cq;b.D(a)||(x(a,Hb,Q,"initialContentAlignment"),this.Cq=a=a.M(),this.g("initialContentAlignment",b,a))}},padding:{configurable:!0,get:function(){return this.Eb},set:function(a){"number"===typeof a?a=new fc(a):x(a,fc,Q,"padding");var b=this.Eb;b.D(a)||(this.Eb=a=a.M(),this.eb(),this.g("padding",b,a))}},partManager:{configurable:!0,get:function(){return this.Vc}, set:function(a){var b=this.Vc;b!==a&&(x(a,Ci,Q,"partManager"),null!==a.diagram&&v("Cannot share PartManagers between Diagrams: "+a.toString()),b&&b.kf(null),this.Vc=a,a.kf(this))}},nodes:{configurable:!0,get:function(){return this.partManager.nodes.iterator}},links:{configurable:!0,get:function(){return this.partManager.links.iterator}},parts:{configurable:!0,get:function(){return this.partManager.parts.iterator}},layout:{configurable:!0,get:function(){return this.Yc}, set:function(a){var b=this.Yc;b!==a&&(x(a,Gi,Q,"layout"),this.Yc=a,a.diagram=this,a.group=null,this.Ih=!0,this.g("layout",b,a),this.fc())}},isTreePathToChildren:{configurable:!0,get:function(){return this.Ut},set:function(a){var b=this.Ut;if(b!==a&&(B(a,"boolean",Q,"isTreePathToChildren"),this.Ut=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=this.nodes;a.next();)Wk(a.value)}},treeCollapsePolicy:{configurable:!0,get:function(){return this.Hu}, set:function(a){var b=this.Hu;b!==a&&(a!==Li&&a!==Xk&&a!==Yk&&v("Unknown Diagram.treeCollapsePolicy: "+a),this.Hu=a,this.g("treeCollapsePolicy",b,a))}},gf:{configurable:!0,get:function(){return this.Ew},set:function(a){this.Ew=a}},avoidanceCellSize:{configurable:!0,get:function(){return this.pw},set:function(a){this.ii=null;this.pw=new Gb(Math.max(1,a.width),Math.max(1,a.height))}},avoidanceLimit:{configurable:!0,get:function(){return this.qw},set:function(a){this.qw= Math.max(1,a)}},autoScrollInterval:{configurable:!0,get:function(){return this.Ip},set:function(a){var b=this.Ip;D(a,Q,"scale");b!==a&&(this.Ip=a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{configurable:!0,get:function(){return this.Kp},set:function(a){"number"===typeof a?a=new fc(a):x(a,fc,Q,"autoScrollRegion");var b=this.Kp;b.D(a)||(this.Kp=a=a.M(),this.eb(),this.g("autoScrollRegion",b,a))}}}); oa.Object.defineProperties(Q,{licenseKey:{configurable:!0,get:function(){return Zk.qc()},set:function(a){Zk.add(a.replace(/\s/g,""))}},version:{configurable:!0,get:function(){return $k}}});Q.prototype.makeImageData=Q.prototype.$x;Q.prototype.makeImage=Q.prototype.pA;Q.prototype.cacheGroupExternalLinks=Q.prototype.Tu;Q.prototype.addRenderer=Q.prototype.ps;Q.prototype.makeSVG=Q.prototype.pv;Q.prototype.makeSvg=Q.prototype.Ps;Q.prototype.stopAutoScroll=Q.prototype.Gg; Q.prototype.doAutoScroll=Q.prototype.us;Q.prototype.isUnoccupied=Q.prototype.ik;Q.prototype.raiseDiagramEvent=Q.prototype.V;Q.prototype.removeDiagramListener=Q.prototype.om;Q.prototype.addDiagramListener=Q.prototype.Oj;Q.prototype.findTreeRoots=Q.prototype.Sz;Q.prototype.layoutDiagram=Q.prototype.nA;Q.prototype.findTopLevelGroups=Q.prototype.Lz;Q.prototype.findTopLevelNodesAndLinks=Q.prototype.Mz;Q.prototype.ensureBounds=Q.prototype.$a;Q.prototype.findLinksByExample=Q.prototype.ys; Q.prototype.findNodesByExample=Q.prototype.zs;Q.prototype.findLinkForData=Q.prototype.Rc;Q.prototype.findNodeForData=Q.prototype.vi;Q.prototype.findPartForData=Q.prototype.Sc;Q.prototype.findLinkForKey=Q.prototype.findLinkForKey;Q.prototype.findNodeForKey=Q.prototype.bc;Q.prototype.findPartForKey=Q.prototype.findPartForKey;Q.prototype.rebuildParts=Q.prototype.be;Q.prototype.transformViewToDoc=Q.prototype.bt;Q.prototype.transformRectDocToView=Q.prototype.TA;Q.prototype.transformDocToView=Q.prototype.Cp; Q.prototype.centerRect=Q.prototype.ss;Q.prototype.scrollToRect=Q.prototype.Iv;Q.prototype.scroll=Q.prototype.scroll;Q.prototype.highlightCollection=Q.prototype.cA;Q.prototype.highlight=Q.prototype.bA;Q.prototype.selectCollection=Q.prototype.LA;Q.prototype.select=Q.prototype.select;Q.prototype.updateAllRelationshipsFromData=Q.prototype.Fp;Q.prototype.updateAllTargetBindings=Q.prototype.updateAllTargetBindings;Q.prototype.commit=Q.prototype.commit;Q.prototype.rollbackTransaction=Q.prototype.Wf; Q.prototype.commitTransaction=Q.prototype.kb;Q.prototype.startTransaction=Q.prototype.Ka;Q.prototype.raiseChanged=Q.prototype.g;Q.prototype.raiseChangedEvent=Q.prototype.jb;Q.prototype.removeChangedListener=Q.prototype.uk;Q.prototype.addChangedListener=Q.prototype.bf;Q.prototype.removeModelChangedListener=Q.prototype.GA;Q.prototype.addModelChangedListener=Q.prototype.px;Q.prototype.findLayer=Q.prototype.bk;Q.prototype.removeLayer=Q.prototype.EA;Q.prototype.addLayerAfter=Q.prototype.Ty; Q.prototype.addLayerBefore=Q.prototype.nx;Q.prototype.addLayer=Q.prototype.Nl;Q.prototype.moveParts=Q.prototype.moveParts;Q.prototype.copyParts=Q.prototype.Wj;Q.prototype.removeParts=Q.prototype.Vs;Q.prototype.remove=Q.prototype.remove;Q.prototype.add=Q.prototype.add;Q.prototype.clearDelayedGeometries=Q.prototype.ux;Q.prototype.setProperties=Q.prototype.Bm;Q.prototype.attach=Q.prototype.Ru;Q.prototype.set=Q.prototype.set;Q.prototype.resetInputOptions=Q.prototype.ly;Q.prototype.setInputOption=Q.prototype.MA; Q.prototype.getInputOption=Q.prototype.dm;Q.prototype.resetRenderingHints=Q.prototype.my;Q.prototype.setRenderingHint=Q.prototype.qy;Q.prototype.getRenderingHint=Q.prototype.Sf;Q.prototype.maybeUpdate=Q.prototype.hd;Q.prototype.requestUpdate=Q.prototype.fc;Q.prototype.delayInitialization=Q.prototype.oz;Q.prototype.isUpdateRequested=Q.prototype.iA;Q.prototype.invalidateDocumentBounds=Q.prototype.eb;Q.prototype.findObjectsNear=Q.prototype.Ag;Q.prototype.findPartsNear=Q.prototype.Hz; Q.prototype.findObjectsIn=Q.prototype.Of;Q.prototype.findPartsIn=Q.prototype.Lx;Q.prototype.findObjectsAt=Q.prototype.wi;Q.prototype.findPartsAt=Q.prototype.Gz;Q.prototype.findObjectAt=Q.prototype.oc;Q.prototype.findPartAt=Q.prototype.bm;Q.prototype.focusObject=Q.prototype.Tz;Q.prototype.alignDocument=Q.prototype.$y;Q.prototype.zoomToRect=Q.prototype.VA;Q.prototype.zoomToFit=Q.prototype.zoomToFit;Q.prototype.diagramScroll=Q.prototype.Ax;Q.prototype.focus=Q.prototype.focus; var Bi=new vb,Ti=null,$g=void 0!==sa.document,Oi=null,Pi="",Dh=new F(Q,"None",0),wj=new F(Q,"Uniform",1),xj=new F(Q,"UniformToFill",2),Rf=new F(Q,"CycleAll",10),Vf=new F(Q,"CycleNotDirected",11),Xf=new F(Q,"CycleNotDirectedFast",12),Yf=new F(Q,"CycleNotUndirected",13),Sf=new F(Q,"CycleDestinationTree",14),Uf=new F(Q,"CycleSourceTree",15),di=new F(Q,"DocumentScroll",1),fi=new F(Q,"InfiniteScroll",2),Li=new F(Q,"TreeParentCollapsed",21),Xk=new F(Q,"AllParentsCollapsed",22),Yk=new F(Q,"AnyParentsCollapsed", 23),Zk=new I,$k="2.3.12",mj="image",Uk=!1,oj=null,zi=!1; function Ai(){if($g){var a=sa.document.createElement("canvas"),b=a.getContext("2d"),c=Va("7ca11abfd022028846");b[c]=Va("398c3597c01238");for(var d=["5da73c80a36455d7038e4972187c3cae51fd22",ta.Dx+"4ae6247590da4bb21c324ba3a84e385776",Ib.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",L.za],e=1;5>e;e++)b[Va("7ca11abfd7330390")](Va(d[e-1]),10,15*e);b[c]=Va("39f046ebb36e4b");for(c=1;5>c;c++)b[Va("7ca11abfd7330390")](Va(d[c-1]),10,15*c);if(4!==d.length||"5"!==d[0][0]||"7"!==d[3][0])Ib.prototype.Jd=Ib.prototype.Su; oj=a}}Q.className="Diagram";Q.fromDiv=function(a){var b=a;"string"===typeof a&&(b=sa.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);B(a,"function",Q,"inherit");B(b,"function",Q,"inherit");c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};Q.useDOM=function(a){$g=a?void 0!==sa.document:!1}; Q.isUsingDOM=function(){return $g};Q.None=Dh;Q.Uniform=wj;Q.UniformToFill=xj;Q.CycleAll=Rf;Q.CycleNotDirected=Vf;Q.CycleNotDirectedFast=Xf;Q.CycleNotUndirected=Yf;Q.CycleDestinationTree=Sf;Q.CycleSourceTree=Uf;Q.DocumentScroll=di;Q.InfiniteScroll=fi;Q.TreeParentCollapsed=Li;Q.AllParentsCollapsed=Xk;Q.AnyParentsCollapsed=Yk;function Hi(){this.Ny=null;this.j="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.Xc=this.j=!0:this.Xc=null} function Oj(a,b){b.pb.setTransform(b.Sb,0,0,b.Sb,0,0);b.pb.Ec();if(null===a.Xc)a:{b="f";var c=sa[Va("76a715b2f73f148a")][Va("72ba13b5")]||"";a.Xc=!0;if($g){var d=Q[Va("76a115b6ed251eaf4692")];if(d)for(var e=Zk.iterator;e.next();){d=e.value;d=Va(d).split(Va("39e9"));if(6>d.length)break;var f=Va(d[1]).split(".");if("7da71ca0"!==d[4])break;var g=Va(ta[Va("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){var h=sa[Va("74a900bae4370f8b51")][Va("6fbb13a1c2311e8a57")].toLowerCase();g=h[Va("73a612b6fb191d")](Va("3aad1ab6e022098b4dc4")); f=Va(d[2]);if(-1g&&f!==Va("7da71ca0ad381e90")&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>g&&(g=b[Va("73a612b6fb191d")](Va("2bfa41fdb3784bca12")));0>g&&(g=c[Va("73a612b6fb191d")](Va("7baa19a6f76c1988428554")));a.Xc=!(0<=g&&gh),!a.Xc))break;if("#"===f[0]){g=sa.document.createElement("div");for(var k=d[0].replace(/[A-Za-z]/g,"");4>k.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[Va("79a417a0f0181a8946")]=d;if(sa.document[Va("78a712aa")]){sa.document[Va("78a712aa")][Va("7bb806b6ed32388c4a875b")](g);k=sa.getComputedStyle(g).getPropertyValue(Va("78a704b7e62456904c9b12701b6532a8"));var l=sa.getComputedStyle(g).getPropertyValue(Va("75b817b0ea2202"));sa.document[Va("78a712aa")][Va("68ad1bbcf533388c4a875b")](g);if(k)if(g=sa[Va("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.Xc=!1;break}else if(g&&g(Va("32ae19a1e0331fc94084537c067a67fa59f1386b89d006")).matches)for(d="."+d,f=0;fd.updateDelay?d.R():d.o||(d.o=!0,setTimeout(function(){return d.redraw()}, d.updateDelay))};c.$f=function(){null!==d.observed&&el(d)};c.autoScale=wj;c.Bb=!1;b&&Object.assign(c,b);return c}na(Vk,Q);Vk.prototype.computePixelRatio=function(){return 1}; Vk.prototype.redraw=function(){if(this.o&&1<=this.updateDelay){this.o=!1;var a=this.Aa,b=this.pb;if(null!==a&&null!==b){Lj(this);if(null===this.Dl){var c=new cj(null);c.width=a.width;c.height=a.height;this.Dl=c}try{this.Aa=this.Dl,this.pb=this.Aa.context,this.pb.ad(!0),this.pb.setTransform(1,0,0,1,0,0),this.pb.clearRect(0,0,this.Aa.width,this.Aa.height),fl(this)}finally{this.Aa=a,this.pb=b}}}Q.prototype.redraw.call(this)}; Vk.prototype.mc=function(){null===this.Pa&&v("No div specified");null===this.Aa&&v("No canvas specified");if(!(this.Aa instanceof Tj)&&(si(this.box),this.Lc)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.Di){Lj(this);var b=this.Aa;a=this.pb;a.ad(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?fl(this):null!==this.Dl&&(a.drawImage(this.Dl.Ta,0,0),b=this.Gb,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.Sb,this.Sb),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy),a.Ec());b=this.ab.s;for(var c=b.length,d=0;da&&(a=0);this.oa!==a&&(this.oa=a)}}});Vk.className="Overview";function dl(){Ne.call(this);this.j=null}na(dl,Ne); dl.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))}; gl.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);D(a,gl,"canDecreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Dh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};gl.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);D(a,gl,"increaseZoom:factor");var b=this.diagram;b.autoScale===Dh&&(a=b.scale*a,ab.maxScale||(b.scale=a))}; gl.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);D(a,gl,"canIncreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Dh)return!1;a=b.scale*a;return ab.maxScale?!1:b.allowZoom};gl.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);D(a,gl,"resetZoom:newscale");var b=this.diagram;ab.maxScale||(b.scale=a)}; gl.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);D(a,gl,"canResetZoom:newscale");var b=this.diagram;return ab.maxScale?!1:b.allowZoom}; gl.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Ic();a.redraw();var c=a.position,d=a.scale;xh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.Nu&&!isNaN(this.Wt)&&a.documentBounds.D(this.Lu)?(a.scale=this.Wt,a.position=this.Hw,this.Nu=NaN,this.Lu=oc):(this.Wt=d,this.Hw=c.copy(),a.zoomToFit(),this.Nu=a.scale,this.Lu=a.documentBounds.copy());zh(b)};gl.prototype.canZoomToFit=function(){return this.diagram.allowZoom}; gl.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&x(a,U,gl,"part");var b=this.diagram;b.$a();if(null===a){try{null!==this.og&&(this.og.next()?a=this.og.value:this.og=null)}catch(k){this.og=null}null===a&&(0a&&(a+=360));return a}; t.Pf=function(){if(0!==(this.l&4096)===!1)return this.Wk;var a=this.Ia;return null!==this.panel?a*this.panel.Pf():a};t.Ds=function(a,b){void 0===b&&(b=new K);b.assign(a);this.we.Jd(b);return b};t.Es=function(a,b,c){return this.dk(a.x,a.y,b.x,b.y,c)}; t.dk=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,L.Rf(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=L.Rf(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c}; P.prototype.measure=function(a,b,c,d){if(!1!==Ij(this)){var e=this.Wg,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.xq();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(yl(this,!0)){case xg:g=e=0;h&&(b=a=Infinity);break;case Ad:isFinite(a)&& a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case kl:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case ll: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.Ib> a.width)))c=!0;this.l=c?this.l|256:this.l&-257;this.Ob.u()||v("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Ob.toString());this.km(f,this.Ob);Al(this,!1);M.free(f)};t=P.prototype;t.ph=function(){}; function Bl(a,b,c,d,e){a.Ob.h(b,c,d,e);if(!a.desiredSize.u()){var f=a.Ac;c=a.Wg;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=yl(a,!0);c===d&&f===e&&(b=xg);switch(b){case xg:if(c>d||f>e)Dj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case Ad:Dj(a,!0);a.measure(d,e,0,0);break;case kl:Dj(a,!0);a.measure(d,f,0,0);break;case ll:Dj(a,!0),a.measure(c,e,0,0)}}} t.km=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||Cl(c,!0),this.R(),dc(a,b)||(c.zh(),this.ao(c)))};t.ao=function(a){null!==this.portId&&(Cl(a,!0),a instanceof V&&Dl(a,this))}; t.mc=function(a,b){if(!El(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.filter&&(e=a.filter,a.filter=this.filter);var f=this instanceof W&&zl(this),g=this.Ob;if(f){var h=this.Ob,k=this.jc,l=this.areaBackground,m=this.Ra;null===l&&null===m||a.Ec();null!==l&&(wi(this,a,l,!0,!0,k,h),l instanceof Fl&&l.type===Gl?(a.beginPath(),a.rect(h.x,h.y,h.width,h.height),a.zg(l)):a.fillRect(h.x,h.y,h.width,h.height));null!==m&&(wi(this, a,m,!0,!1,k,h),m instanceof Fl&&m.type===Gl?(a.beginPath(),a.rect(h.x,h.y,h.width,h.height),a.zg(m)):a.fillRect(h.x,h.y,h.width,h.height));this.sh(a,b)}if(!f&&(f||0!==g.width&&0!==g.height&&!isNaN(g.x)&&!isNaN(g.y))){G&&G.Rl&&G.wz&&G.wz(a,this);f=this.transform;h=this.panel;0!==(this.l&4096)===!0&&Hl(this);l=this.part;k=!1;var n=0;l&&b.Sf("drawShadows")&&(k=l.isShadowed)&&(m=l.shadowOffset,n=Math.max(m.y,m.x)*b.scale*b.Sb);m=this.Kd();var p;if(!(p=b.mj||!m)){var q=this.naturalBounds;p=this.Hh;var r= p.m11,u=p.m21,y=p.dx,w=p.m12,z=p.m22,A=p.dy,C,E=C=0;p=C*r+E*u+y;var H=C*w+E*z+A;C=q.width+n;E=0;var T=C*r+E*u+y;C=C*w+E*z+A;E=Math.min(p,T);var aa=Math.min(H,C);var Y=Math.max(p+0,T)-E;var R=Math.max(H+0,C)-aa;p=E;H=aa;C=q.width+n;E=q.height+n;T=C*r+E*u+y;C=C*w+E*z+A;E=Math.min(p,T);aa=Math.min(H,C);Y=Math.max(p+Y,T)-E;R=Math.max(H+R,C)-aa;p=E;H=aa;C=0;E=q.height+n;T=C*r+E*u+y;C=C*w+E*z+A;E=Math.min(p,T);aa=Math.min(H,C);Y=Math.max(p+Y,T)-E;R=Math.max(H+R,C)-aa;p=E;H=aa;n=b.viewportBounds;q=n.x;r= n.y;p=!(p>n.width+q||q>Y+p||H>n.height+r||r>R+H)}if(p){p=0!==(this.l&256);a.clipInsteadOfFill&&(p=!1);this instanceof bh&&(a.font=this.font);if(p){H=h.Ae()?h.naturalBounds:h.actualBounds;Y=Math.max(g.x,H.x);R=Math.max(g.y,H.y);n=Math.min(g.right,H.right)-Y;q=Math.min(g.bottom,H.bottom)-R;r=this.yb;null!==r&&(Y=r.x,R=r.y,n=r.width,q=r.height);if(Y>g.width+g.x||g.x>H.width+H.x){1!==c&&(a.globalAlpha=d);""!==this.filter&&(a.filter=e);return}a.save();a.beginPath();a.rect(Y,R,n,q);a.clip()}if(m){if(!l.isVisible()){1!== c&&(a.globalAlpha=d);""!==this.filter&&(a.filter=e);return}k&&(H=l.shadowOffset,a.Tv(H.x*b.scale*this.scale*b.Sb,H.y*b.scale*this.scale*b.Sb,l.shadowBlur),Il(a),a.shadowColor=l.shadowColor)}k&&!0===this.shadowVisible?Il(a):k&&!1===this.shadowVisible&&Jl(a);l=this.naturalBounds;null!==this.areaBackground&&(a.Ec(),Kl(this,a,l,g));a.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);k&&Ll(this,h)&&null===this.shadowVisible&&Jl(a);null!==this.Ra&&(a.Ec(),Ml(this,a,l,g));G&&G.Rl&&G.xz&&G.xz(a,this);k&&(null!== this.Ra||null!==this.areaBackground||Ll(this,h))?(Nl(this,!0),null===this.shadowVisible&&Jl(a)):Nl(this,!1);this.sh(a,b);k&&0!==(this.l&512)===!0&&Il(a);m&&k&&Jl(a);p&&(a.restore(),a.ad(this instanceof W));f.Ks()||(b=1/(f.m11*f.m22-f.m12*f.m21),a.transform(f.m22*b,-f.m12*b,-f.m21*b,f.m11*b,b*(f.m21*f.dy-f.m22*f.dx),b*(f.m12*f.dx-f.m11*f.dy)))}}1!==c&&(a.globalAlpha=d);""!==this.filter&&(a.filter=e)}}}; function Ll(a,b){if(null===b)return!1;zl(b)&&(b=b.panel);return 0!==(b.l&512)||(b.type===W.Auto||b.type===W.Spot)&&b.Vb()!==a}t.Sv=function(){};function Kl(a,b,c,d){wi(a,b,a.areaBackground,!0,!0,c,d);a.areaBackground instanceof Fl&&a.areaBackground.type===Gl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.zg(a.areaBackground)):b.fillRect(d.x,d.y,d.width,d.height)} function Ml(a,b,c,d){var e=a.xq(),f=c.x,g=c.y,h=c.width+e,k=c.height+e;wi(a,b,a.Ra,!0,!1,c,d);a.Ra instanceof Fl&&a.Ra.type===Gl?(b.beginPath(),b.rect(f-e/2,g-e/2,h,k),b.zg(a.Ra)):b.fillRect(f-e/2,g-e/2,h,k)} function Ol(a,b,c){for(var d=b.S.s,e=d.length,f=-1,g=0;ge)&&v("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)&&v("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.isRow=!1,a.index= e);e=new bb;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);Qj(a,e)}else Qj(a,b);else v('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function om(a,b){B(a,"string",P,"defineBuilder:name");B(b,"function",P,"defineBuilder:func");var c=a.toLowerCase();G&&(""===a||"none"===c||a===c)&&v("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);km.add(a,b)} function pm(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} oa.Object.defineProperties(P.prototype,{bindingId:{configurable:!0,get:function(){return null!==this.B?this.B.Mp:-1},set:function(a){this.bindingId!==a&&(null===this.B&&(this.B=new sl),this.B.Mp=a)}},localBindings:{configurable:!0,get:function(){return null!==this.B?this.B.Be:null},set:function(a){this.localBindings!==a&&(null===this.B&&(this.B=new sl),this.B.Be=a)}},srcBindings:{configurable:!0,get:function(){return null!==this.B?this.B.Jm:null},set:function(a){this.srcBindings!== a&&(null===this.B&&(this.B=new sl),this.B.Jm=a)}},shadowVisible:{configurable:!0,get:function(){return null!==this.B?this.B.Pi:null},set:function(a){var b=this.shadowVisible;b!==a&&(G&&null!==a&&B(a,"boolean",P,"shadowVisible"),rl(this),this.B.Pi=a,this.$c=!0,this.R(),this.g("shadowVisible",b,a))}},enabledChanged:{configurable:!0,get:function(){return null!==this.B?this.B.Nb:null},set:function(a){var b=this.enabledChanged;b!==a&&(null!==a&&B(a,"function",P,"enabledChanged"), rl(this),this.B.Nb=a,this.g("enabledChanged",b,a))}},segmentOrientation:{configurable:!0,get:function(){return null!==this.Za?this.Za.Er:lg},set:function(a){var b=this.segmentOrientation;b!==a&&(G&&$a(a,S,P,"segmentOrientation"),null===this.Za&&(this.Za=new qm),this.Za.Er=a,this.w(),this.g("segmentOrientation",b,a),a===lg&&(this.angle=0))}},segmentIndex:{configurable:!0,get:function(){return null!==this.Za?this.Za.v:-Infinity},set:function(a){G&&B(a,"number",P,"segmentIndex"); a=Math.round(a);var b=this.segmentIndex;b!==a&&(null===this.Za&&(this.Za=new qm),this.Za.v=a,this.w(),this.g("segmentIndex",b,a))}},segmentFraction:{configurable:!0,get:function(){return null!==this.Za?this.Za.o:0},set:function(a){G&&B(a,"number",P,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1a||1=a&&v("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ia=a,this.w(), this.g("scale",b,a))}},angle:{configurable:!0,get:function(){return this.Qb},set:function(a){var b=this.Qb;b!==a&&(G&&D(a,P,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.Qb=a,gm(this),this.w(),this.g("angle",b,a)))}},desiredSize:{configurable:!0,get:function(){return this.pd},set:function(a){G&&x(a,Gb,P,"desiredSize");var b=a.width,c=a.height,d=this.pd,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.pd=a=a.M(),this.w(),this instanceof Pf&& this.xc(),this.g("desiredSize",d,a),ul(this)&&(a=this.part,null!==a&&(vl(this,a,"width"),vl(this,a,"height"))))}},width:{configurable:!0,get:function(){return this.pd.width},set:function(a){var b=this.pd.width;b===a||isNaN(b)&&isNaN(a)||(G&&B(a,"number",P,"width"),b=this.pd,this.pd=a=(new Gb(a,this.pd.height)).freeze(),this.w(),this instanceof Pf&&this.xc(),this.g("desiredSize",b,a),ul(this)&&(a=this.part,null!==a&&vl(this,a,"width")))}},height:{configurable:!0,get:function(){return this.pd.height}, set:function(a){var b=this.pd.height;b===a||isNaN(b)&&isNaN(a)||(G&&B(a,"number",P,"height"),b=this.pd,this.pd=a=(new Gb(this.pd.width,a)).freeze(),this.w(),this instanceof Pf&&this.xc(),this.g("desiredSize",b,a),ul(this)&&(a=this.part,null!==a&&vl(this,a,"height")))}},minSize:{configurable:!0,get:function(){return null!==this.B?this.B.v:Ob},set:function(a){var b=this.minSize;b.D(a)||(G&&x(a,Gb,P,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(), rl(this),this.B.v=a,this.w(),this.g("minSize",b,a))}},maxSize:{configurable:!0,get:function(){return null!==this.B?this.B.o:Tb},set:function(a){var b=this.maxSize;b.D(a)||(G&&x(a,Gb,P,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),rl(this),this.B.o=a,this.w(),this.g("maxSize",b,a))}},measuredBounds:{configurable:!0,get:function(){return this.Ac}},naturalBounds:{configurable:!0,get:function(){return this.jc}}, margin:{configurable:!0,get:function(){return this.Wg},set:function(a){"number"===typeof a?a=new fc(a):G&&x(a,fc,P,"margin");var b=this.Wg;b.D(a)||(this.Wg=a=a.M(),this.w(),this.g("margin",b,a))}},transform:{configurable:!0,get:function(){0!==(this.l&2048)===!0&&Hl(this);return this.Gb}},we:{configurable:!0,get:function(){0!==(this.l&4096)===!0&&Hl(this);return this.Hh}},animationTriggers:{configurable:!0,get:function(){return null!==this.B? this.B.ob:null},set:function(a){this.animationTriggers!==a&&(rl(this),this.B.ob=a)}},reshapingBehavior:{configurable:!0,get:function(){return null!==this.B?this.B.ag:xg},set:function(a){this.reshapingBehavior!==a&&(rl(this),this.B.ag=a)}},alignment:{configurable:!0,get:function(){return this.Pb},set:function(a){var b=this.Pb;b.D(a)||(G&&x(a,Hb,P,"alignment"),a.pc()&&!a.Wb()&&v("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Pb=a= a.M(),bm(this),this.g("alignment",b,a))}},column:{configurable:!0,get:function(){return this.Mg},set:function(a){G&&D(a,P,"column");a=Math.round(a);var b=this.Mg;b!==a&&(0>a&&Ba(a,">= 0",P,"column"),this.Mg=a,this.w(),this.g("column",b,a),null!==this.svg&&this.svg.remove())}},columnSpan:{configurable:!0,get:function(){return null!==this.B?this.B.ub:1},set:function(a){G&&B(a,"number",P,"columnSpan");a=Math.round(a);var b=this.columnSpan;b!==a&&(1>a&&Ba(a,">= 1",P,"columnSpan"), rl(this),this.B.ub=a,this.w(),this.g("columnSpan",b,a))}},row:{configurable:!0,get:function(){return this.uo},set:function(a){G&&D(a,P,"row");a=Math.round(a);var b=this.uo;b!==a&&(0>a&&Ba(a,">= 0",P,"row"),this.uo=a,this.w(),this.g("row",b,a),null!==this.svg&&this.svg.remove())}},rowSpan:{configurable:!0,get:function(){return null!==this.B?this.B.Oi:1},set:function(a){G&&B(a,"number",P,"rowSpan");a=Math.round(a);var b=this.rowSpan;b!==a&&(1>a&&Ba(a,">= 1",P,"rowSpan"), rl(this),this.B.Oi=a,this.w(),this.g("rowSpan",b,a))}},spanAllocation:{configurable:!0,get:function(){return null!==this.B?this.B.Qi:null},set:function(a){var b=this.spanAllocation;b!==a&&(null!==a&&B(a,"function",P,"spanAllocation"),rl(this),this.B.Qi=a,this.w(),this.g("spanAllocation",b,a))}},alignmentFocus:{configurable:!0,get:function(){return this.Ek},set:function(a){var b=this.Ek;b.D(a)||(G&&x(a,Hb,P,"alignmentFocus"),!G||!a.pc()||a.Wb()||a.kp()&&this instanceof V|| v("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.Ek=a=a.M(),this.w(),this.g("alignmentFocus",b,a))}},portId:{configurable:!0,get:function(){return this.lo},set:function(a){var b=this.lo;if(b!==a){G&&null!==a&&B(a,"string",P,"portId");var c=this.part;null===c||c instanceof V||v("Cannot set portID on a Link: "+a);null!==b&&null!==c&&sm(c,this);this.lo=a;null!==a&&null!==c&&(c.ff=!0,tm(c,this));this.g("portId",b,a)}}},toSpot:{configurable:!0, get:function(){return null!==this.fa?this.fa.Lj:zc},set:function(a){var b=this.toSpot;b.D(a)||(G&&x(a,Hb,P,"toSpot"),a=a.M(),this.cd(),this.fa.Lj=a,this.g("toSpot",b,a),fm(this))}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.Jj:10},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&&B(a,"number",P,"toEndSegmentLength"),0>a&&Ba(a,">= 0",P,"toEndSegmentLength"),this.cd(),this.fa.Jj=a,this.g("toEndSegmentLength",b,a),fm(this))}},toShortLength:{configurable:!0, enumerable:!0,get:function(){return null!==this.fa?this.fa.Kj:0},set:function(a){var b=this.toShortLength;b!==a&&(G&&B(a,"number",P,"toShortLength"),this.cd(),this.fa.Kj=a,this.g("toShortLength",b,a),fm(this))}},toLinkable:{configurable:!0,get:function(){return null!==this.fa?this.fa.gs:null},set:function(a){var b=this.toLinkable;b!==a&&(G&&null!==a&&B(a,"boolean",P,"toLinkable"),this.cd(),this.fa.gs=a,this.g("toLinkable",b,a))}},toMaxLinks:{configurable:!0,get:function(){return null!== this.fa?this.fa.hs:Infinity},set:function(a){var b=this.toMaxLinks;b!==a&&(G&&B(a,"number",P,"toMaxLinks"),0>a&&Ba(a,">= 0",P,"toMaxLinks"),this.cd(),this.fa.hs=a,this.g("toMaxLinks",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.fa?this.fa.jj:zc},set:function(a){var b=this.fromSpot;b.D(a)||(G&&x(a,Hb,P,"fromSpot"),a=a.M(),this.cd(),this.fa.jj=a,this.g("fromSpot",b,a),fm(this))}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.fa? this.fa.hj:10},set:function(a){var b=this.fromEndSegmentLength;b!==a&&(G&&B(a,"number",P,"fromEndSegmentLength"),0>a&&Ba(a,">= 0",P,"fromEndSegmentLength"),this.cd(),this.fa.hj=a,this.g("fromEndSegmentLength",b,a),fm(this))}},fromShortLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.ij:0},set:function(a){var b=this.fromShortLength;b!==a&&(G&&B(a,"number",P,"fromShortLength"),this.cd(),this.fa.ij=a,this.g("fromShortLength",b,a),fm(this))}},fromLinkable:{configurable:!0, enumerable:!0,get:function(){return null!==this.fa?this.fa.uq:null},set:function(a){var b=this.fromLinkable;b!==a&&(G&&null!==a&&B(a,"boolean",P,"fromLinkable"),this.cd(),this.fa.uq=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{configurable:!0,get:function(){return null!==this.fa?this.fa.vq:Infinity},set:function(a){var b=this.fromMaxLinks;b!==a&&(G&&B(a,"number",P,"fromMaxLinks"),0>a&&Ba(a,">= 0",P,"fromMaxLinks"),this.cd(),this.fa.vq=a,this.g("fromMaxLinks",b,a))}},cursor:{configurable:!0, enumerable:!0,get:function(){return null!==this.B?this.B.j:""},set:function(a){var b=this.cursor;b!==a&&(B(a,"string",P,"cursor"),rl(this),this.B.j=a,this.g("cursor",b,a))}},click:{configurable:!0,get:function(){return null!==this.B?this.B.Kh:null},set:function(a){var b=this.click;b!==a&&(null!==a&&B(a,"function",P,"click"),rl(this),this.B.Kh=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return null!==this.B?this.B.Qh:null},set:function(a){var b= this.doubleClick;b!==a&&(null!==a&&B(a,"function",P,"doubleClick"),rl(this),this.B.Qh=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return null!==this.B?this.B.Mh:null},set:function(a){var b=this.contextClick;b!==a&&(null!==a&&B(a,"function",P,"contextClick"),rl(this),this.B.Mh=a,this.g("contextClick",b,a))}},mouseEnter:{configurable:!0,get:function(){return null!==this.B?this.B.Yh:null},set:function(a){var b=this.mouseEnter;b!==a&&(null!== a&&B(a,"function",P,"mouseEnter"),rl(this),this.B.Yh=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return null!==this.B?this.B.ai:null},set:function(a){var b=this.mouseLeave;b!==a&&(null!==a&&B(a,"function",P,"mouseLeave"),rl(this),this.B.ai=a,this.g("mouseLeave",b,a))}},mouseOver:{configurable:!0,get:function(){return null!==this.B?this.B.bi:null},set:function(a){var b=this.mouseOver;b!==a&&(null!==a&&B(a,"function",P,"mouseOver"),rl(this),this.B.bi= a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return null!==this.B?this.B.$h:null},set:function(a){var b=this.mouseHover;b!==a&&(null!==a&&B(a,"function",P,"mouseHover"),rl(this),this.B.$h=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return null!==this.B?this.B.Zh:null},set:function(a){var b=this.mouseHold;b!==a&&(null!==a&&B(a,"function",P,"mouseHold"),rl(this),this.B.Zh=a,this.g("mouseHold",b,a))}},mouseDragEnter:{configurable:!0, enumerable:!0,get:function(){return null!==this.B?this.B.$f:null},set:function(a){var b=this.mouseDragEnter;b!==a&&(null!==a&&B(a,"function",P,"mouseDragEnter"),rl(this),this.B.$f=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{configurable:!0,get:function(){return null!==this.B?this.B.ce:null},set:function(a){var b=this.mouseDragLeave;b!==a&&(null!==a&&B(a,"function",P,"mouseDragLeave"),rl(this),this.B.ce=a,this.g("mouseDragLeave",b,a))}},mouseDrop:{configurable:!0, get:function(){return null!==this.B?this.B.Xh:null},set:function(a){var b=this.mouseDrop;b!==a&&(null!==a&&B(a,"function",P,"mouseDrop"),rl(this),this.B.Xh=a,this.g("mouseDrop",b,a))}},actionDown:{configurable:!0,get:function(){return null!==this.B?this.B.Z:null},set:function(a){var b=this.actionDown;b!==a&&(null!==a&&B(a,"function",P,"actionDown"),rl(this),this.B.Z=a,this.g("actionDown",b,a))}},actionMove:{configurable:!0,get:function(){return null!==this.B?this.B.oa: null},set:function(a){var b=this.actionMove;b!==a&&(null!==a&&B(a,"function",P,"actionMove"),rl(this),this.B.oa=a,this.g("actionMove",b,a))}},actionUp:{configurable:!0,get:function(){return null!==this.B?this.B.Na:null},set:function(a){var b=this.actionUp;b!==a&&(null!==a&&B(a,"function",P,"actionUp"),rl(this),this.B.Na=a,this.g("actionUp",b,a))}},actionCancel:{configurable:!0,get:function(){return null!==this.B?this.B.G:null},set:function(a){var b=this.actionCancel;b!== a&&(null!==a&&B(a,"function",P,"actionCancel"),rl(this),this.B.G=a,this.g("actionCancel",b,a))}},toolTip:{configurable:!0,get:function(){return null!==this.B?this.B.li:null},set:function(a){var b=this.toolTip;b!==a&&(!G||null===a||a instanceof Be||a instanceof Le||v("GraphObject.toolTip must be an Adornment or HTMLInfo."),rl(this),this.B.li=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return null!==this.B?this.B.Nh:null},set:function(a){var b= this.contextMenu;b!==a&&(!G||a instanceof Be||a instanceof Le||v("GraphObject.contextMenu must be an Adornment or HTMLInfo."),rl(this),this.B.Nh=a,this.g("contextMenu",b,a))}}});P.prototype.trigger=P.prototype.Yv;P.prototype.findBindingPanel=P.prototype.th;P.prototype.findTemplateBinder=P.prototype.Kz;P.prototype.setProperties=P.prototype.Bm;P.prototype.apply=P.prototype.apply;P.prototype.attach=P.prototype.Ru;P.prototype.set=P.prototype.set;P.prototype.isEnabledObject=P.prototype.Uf; P.prototype.isVisibleObject=P.prototype.Ld;P.prototype.isContainedBy=P.prototype.Dg;P.prototype.getNearestIntersectionPoint=P.prototype.Es;P.prototype.getLocalPoint=P.prototype.Ds;P.prototype.getDocumentScale=P.prototype.Pf;P.prototype.getDocumentAngle=P.prototype.yi;P.prototype.getDocumentBounds=P.prototype.zi;P.prototype.getDocumentPoint=P.prototype.la;P.prototype.intersectsRect=P.prototype.dd;P.prototype.containedInRect=P.prototype.qh;P.prototype.containsRect=P.prototype.df; P.prototype.containsPoint=P.prototype.ha;P.prototype.raiseChanged=P.prototype.g;P.prototype.raiseChangedEvent=P.prototype.jb;P.prototype.addCopyProperty=P.prototype.mx;var km=null;P.className="GraphObject";km=new vb; om("Button",function(){function a(a,b){return null!==a.diagram.oc(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=jm(W,W.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof W){var c=a.lb("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"},jm(Pf,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new Hb(0,0,2.76142374915397,2.761423749153969),spot2:new Hb(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Uf()&&b instanceof W&&(a=b.lb("ButtonBorder"),a instanceof Pf)){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.Uf()&&b instanceof W&&(a=b.lb("ButtonBorder"),a instanceof Pf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Uf()&&b instanceof W&&null!==b._buttonFillPressed&&0===a.button){var c=b.lb("ButtonBorder");if(c instanceof Pf){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.Uf()&&d instanceof W&&null!==d._buttonFillPressed&&0===b.button){var c=d.lb("ButtonBorder");if(c instanceof Pf){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.Uf()&&d instanceof W&&null!==d._buttonFillPressed){var c=d.lb("ButtonBorder");if(c instanceof Pf){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.Uf()&&d instanceof W&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.lb("ButtonBorder"),b instanceof Pf))){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}); om("TreeExpanderButton",function(){var a=jm("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},jm(Pf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Rb},(new Mi("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).qp()),{visible:!1},(new Mi("visible","isTreeLeaf",function(a){return!a})).qp());a.click=function(a,c){c=c.part;c instanceof Be&&(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}); om("SubGraphExpanderButton",function(){var a=jm("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},jm(Pf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Rb},(new Mi("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).qp()));a.click=function(a,c){c=c.part;c instanceof Be&&(c=c.adornedPart);if(c instanceof Df){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});om("ToolTip",function(){return jm(Be,W.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},jm(Pf,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new Hb(0,0,4,6),spot2:new Hb(1,1,-4,-4)}))}); om("ContextMenu",function(){return jm(Be,W.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new K(0,3),shadowBlur:5},new Mi("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});om("ContextMenuButton",function(){var a=jm("Button");a.stretch=kl;var b=a.lb("ButtonBorder");b instanceof Pf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new Hb(0,0,2,3),b.spot2=new Hb(1,1,-2,-2));return a}); om("PanelExpanderButton",function(a){var b=pm(a,"COLLAPSIBLE"),c=jm("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},jm(Pf,{name:"ButtonIcon",strokeWidth:2},(new Mi("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).qp(b))); a=c.lb("ButtonBorder");a instanceof Pf&&(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.th();null===e&&(e=c.part);null!==e&&(c=e.lb(b),null!==c&&(a.handled=!0,d.Ka("Collapse/Expand Panel"),c.visible=!c.visible,d.kb("Collapse/Expand Panel")))}};return c}); om("CheckBoxButton",function(a){var b=pm(a);a=jm("Button",{desiredSize:new Gb(14,14)},jm(Pf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Ad,geometryStretch:zg,visible:!1},""!==b?(new Mi("visible",b)).ay():[]));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.lb("ButtonIcon");c.Ka("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a, d);c.kb("checkbox")}}};return a}); om("CheckBox",function(a){a=pm(a);a=jm("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new fc(0,1,0,0)});var b=jm(W,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:new fc(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});P.None=xg=new F(P,"None",0);P.Default=ml=new F(P,"Default",0);P.Vertical=ll=new F(P,"Vertical",4);P.Horizontal=kl=new F(P,"Horizontal",5);P.Fill=Ad=new F(P,"Fill",3);P.Uniform=zg=new F(P,"Uniform",1); P.UniformToFill=nl=new F(P,"UniformToFill",2);P.FlipVertical=ol=new F(P,"FlipVertical",1);P.FlipHorizontal=pl=new F(P,"FlipHorizontal",2);P.FlipBoth=ql=new F(P,"FlipBoth",3);P.make=jm;P.getBuilders=function(){var a=new vb,b;for(b in km)if(b!==b.toLowerCase()){var c=km.L(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};P.defineBuilder=om; P.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.ma[1]*a+this.ma[3]*d,f=this.ma[0]*-d+this.ma[2]*a,g=this.ma[1]*-d+this.ma[3]*a;this.ma[0]=this.ma[0]*a+this.ma[2]*d;this.ma[1]=e;this.ma[2]=f;this.ma[3]=g;this.translate(-b,-c)}};um.className="STransform"; function vm(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.wx=[];this.pattern=null}vm.prototype.addColorStop=function(a,b){this.wx.push({offset:a,color:b})};vm.className="SGradient"; function Tj(a,b,c){this.ownerDocument=a=void 0===b?sa.document:b;this.wA="http://www.w3.org/2000/svg";void 0!==a&&(this.Ta=this.$d("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.style.display="block",this.style.letterSpacing="normal",this.style.wordSpacing="normal",this.Ta.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Ta.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.vs=null;this.context=new vi(this, c)}Tj.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.Ta.setAttributeNS(null,"width",c+"px"),this.Ta.setAttributeNS(null,"height",d+"px"),this.Ta.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.Lw.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.Lw.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1}; Tj.prototype.$d=function(a,b,c){a=this.ownerDocument.createElementNS(this.wA,a);if(Ga(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};Tj.prototype.getBoundingClientRect=function(){return this.Ta.getBoundingClientRect()};Tj.prototype.focus=function(){this.Ta.focus()};Tj.prototype.Cx=function(){this.ownerDocument=null}; oa.Object.defineProperties(Tj.prototype,{width:{configurable:!0,get:function(){return this.Ta.width.baseVal.value},set:function(a){this.Ta.setAttribute("width",a+"px")}},height:{configurable:!0,get:function(){return this.Ta.height.baseVal.value},set:function(a){this.Ta.setAttribute("height",a+"px")}},style:{configurable:!0,get:function(){return this.Ta.style}}});Tj.className="SVGSurface"; function vi(a,b){this.Vv=a;this.svg=a.Ta;this.stack=[];this.yh=[];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.Wl=!1;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.gh=this.Or=this.Nr=0;this.Ed=this.gd=null;this.path=[];this.lm={};this.Pt=!1; this.jh=null;this.Hj=0;this.xb=new um;this.j=Sl(this);this.Zj=Sl(this,"gojs-diagram");this.Vl=this.Gi=null;var c=ob++,d=this.$d("clipPath",{id:"mainClip"+c});d.appendChild(this.$d("rect",{x:0,y:0,width:a.width,height:a.height}));this.Lw=d;this.svg.appendChild(this.j);this.j.appendChild(this.Zj);this.svg.appendChild(d);this.j.setAttributeNS(null,"clip-path","url(#mainClip"+c+")");this.yA={};this.isTemporary=!!b;this.filter="";this.mk=null} function Mj(a,b,c,d,e,f,g){void 0===a.Zj?Ql(a,b,c,d,e,f,g):a.Zj.setAttribute("transform","matrix("+b+", "+c+", "+d+", "+e+", "+f+", "+g+")")}t=vi.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,q=b+n,r=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,r,a-m,b-n]),this.path.push(["A",c,c,0,1,r,p,q])):1E-6=Math.PI),r,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[];this.lm={stroke:"none",fill:"none"}};t.ef=function(a){this.addPath(this.path,this.xb,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.lm.clipPath=!0};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new vm("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.yA;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+ob++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.$d("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.$d(mj,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"}; t.createRadialGradient=function(a,b,c,d,e,f){var g=new vm("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g};function Tl(a,b,c,d,e,f,g,h,k){d=h/d;e=k/e;0===f&&0===g||a.xb.translate(f,g);1===d&&1===e||a.xb.scale(d,e);0===b&&0===c||a.xb.translate(-b,-c)} t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width;a=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=a);d=d||0;e=e||0;h=h||0;k=k||0;Tl(this,b,c,d,e,f||0,g||0,h,k);f={x:0,y:0,width:m||d,height:a||e,href:l};L.ca(d,h)&&L.ca(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&& (f.preserveAspectRatio="xMidYMid slice"):f.preserveAspectRatio="none";if(0!==b||0!==c||d!==m||e!==a)d+=b,e+=c,f["clip-path"]="path('M "+b+","+c+" L "+d+" "+c+" L "+d+" "+e+" L "+b+" "+e+" z')";wm(this,mj,f,this.xb);this.addElement(mj,f)};t.fill=function(a){a&&(this.lm["fill-rule"]="evenodd");xm(this,this.lm)};t.zg=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]};wm(this,"fill",a,this.xb);this.addElement("rect",a)};t.Gx=function(a,b,c,d){a={x:a,y:b,width:c,height:d};wm(this,"fill",a,this.xb);xm(this,a);this.svg.prepend(this.$d("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};wm(this,"fill",b,this.xb);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.xb=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;this.mk= a.mk}; 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,mk:this.mk});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.Um?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.Um?this.clip():this.fill(b)};t.vk=function(){this.Um||this.stroke()};t.Tv=function(a,b,c){this.Nr=a;this.Or=b;this.gh=c}; t.ws=function(a,b){var c=this.ba;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.ts=function(){var a=this.ba;void 0!==a.setLineDash&&(a.setLineDash(Bm),a.lineDashOffset=0)};t.ad=function(a){a&&(this.qt="");this.pt=this.rt=""};t.Us=function(){}; oa.Object.defineProperties(Xl.prototype,{fillStyle:{configurable:!0,get:function(){return this.ba.fillStyle},set:function(a){this.pt!==a&&(this.pt=this.ba.fillStyle=a)}},font:{configurable:!0,get:function(){return this.ba.font},set:function(a){this.qt!==a&&(this.qt=this.ba.font=a)}},globalAlpha:{configurable:!0,get:function(){return this.ba.globalAlpha},set:function(a){this.ba.globalAlpha=a}},lineCap:{configurable:!0,get:function(){return this.ba.lineCap}, set:function(a){this.ba.lineCap=a}},lineDashOffset:{configurable:!0,get:function(){return this.ba.lineDashOffset},set:function(a){this.ba.lineDashOffset=a}},lineJoin:{configurable:!0,get:function(){return this.ba.lineJoin},set:function(a){this.ba.lineJoin=a}},lineWidth:{configurable:!0,get:function(){return this.ba.lineWidth},set:function(a){this.ba.lineWidth=a}},miterLimit:{configurable:!0,get:function(){return this.ba.miterLimit},set:function(a){this.ba.miterLimit= a}},shadowBlur:{configurable:!0,get:function(){return this.ba.shadowBlur},set:function(a){this.ba.shadowBlur=a}},shadowColor:{configurable:!0,get:function(){return this.ba.shadowColor},set:function(a){this.ba.shadowColor=a}},shadowOffsetX:{configurable:!0,get:function(){return this.ba.shadowOffsetX},set:function(a){this.ba.shadowOffsetX=a}},shadowOffsetY:{configurable:!0,get:function(){return this.ba.shadowOffsetY},set:function(a){this.ba.shadowOffsetY= a}},strokeStyle:{configurable:!0,get:function(){return this.ba.strokeStyle},set:function(a){this.rt!==a&&(this.rt=this.ba.strokeStyle=a)}},textAlign:{configurable:!0,get:function(){return this.ba.textAlign},set:function(a){this.ba.textAlign=a}},imageSmoothingEnabled:{configurable:!0,get:function(){return this.ba.imageSmoothingEnabled},set:function(a){this.ba.imageSmoothingEnabled=a}},filter:{configurable:!0,get:function(){return this.ba.filter}, set:function(a){this.ba.filter=""===a?"none":a}},clipInsteadOfFill:{configurable:!0,get:function(){return this.Um},set:function(a){this.Um=a}}});var Bm=Object.freeze([]);Xl.className="CanvasSurfaceContext";function Cm(){this.G=this.o=this.v=this.j=0}Cm.className="ColorNumbers"; function Fl(a,b){Dm||(Em(),Dm=!0);Ya(this);this._isFrozen=!1;void 0===a?(this.ta=Wl,this.Jk="black"):"string"===typeof a?(this.ta=Wl,G&&!Fm(a)&&v('Color "'+a+'" is not a valid color string for Brush constructor'),this.Jk=a):(G&&$a(a,Fl,Fl,"constructor:type"),this.ta=a,this.Jk="black");a=this.ta;a===Zl?(this.Wd=Bc,this.Xk=Mc):this.Xk=a===Gl?this.Wd=Ic:this.Wd=zc;this.Tr=0;this.kq=NaN;this.He=this.qr=this.Ge=null;this.st=this.Kk=0;b&&Object.assign(this,b)} Fl.prototype.copy=function(){var a=new Fl;a.ta=this.ta;a.Jk=this.Jk;a.Wd=this.Wd.M();a.Xk=this.Xk.M();a.Tr=this.Tr;a.kq=this.kq;null!==this.Ge&&(a.Ge=this.Ge.copy());a.qr=this.qr;return a};t=Fl.prototype;t.freeze=function(){this._isFrozen=!0;null!==this.Ge&&this.Ge.freeze();return this};t.qa=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this._isFrozen=!1;null!==this.Ge&&this.Ge.qa();return this};t.wb=function(a){a.classType===Fl?this.type=a:Ea(this,a)}; t.toString=function(){var a="Brush(";if(this.type===Wl)a+=this.color;else if(a=this.type===Zl?a+"Linear ":this.type===Gl?a+"Radial ":this.type===Yl?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&&xa(this);("number"!==typeof a||!isFinite(a)||1a)&&Ba(a,"0 <= loc <= 1",Fl,"addColorStop:loc");B(b,"string",Fl,"addColorStop:color");G&&!Fm(b)&&v('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.Ge&&(this.Ge=new vb);this.Ge.add(a,b);this.ta===Wl&&(this.type=Zl);this.He=null;return this}; function Fm(a){if("black"===a)return!0;if(""===a)return!1;G&&B(a,"string",Fl,"isValidColor");Dm||(Em(),Dm=!0);var b=Gm;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} t.oA=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?Hm:b;if(this.type===Wl)gi(this.color),this.color=Im(a,b);else if((this.type===Zl||this.type===Gl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)gi(c.value),this.addColorStop(c.key,Im(a,b));return this};function Jm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Hm:c;gi(a);return Im(b,c)} t.nz=function(a,b){this._isFrozen&&xa(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?Hm:b;if(this.type===Wl)gi(this.color),this.color=Im(-a,b);else if((this.type===Zl||this.type===Gl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)gi(c.value),this.addColorStop(c.key,Im(-a,b));return this};function Km(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Hm:c;gi(a);return Im(-b,c)} function Lm(a,b,c){gi(a);a=Mm.j;var d=Mm.v,e=Mm.o,f=Mm.G;gi(b);void 0===c&&(c=.5);return"rgba("+Math.round((Mm.j-a)*c+a)+", "+Math.round((Mm.v-d)*c+d)+", "+Math.round((Mm.o-e)*c+e)+", "+Math.round((Mm.G-f)*c+f)+")"} t.Xx=function(){if(this.type===Wl)return Nm(this.color);if((this.type===Zl||this.type===Gl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===Gl)return Nm(a.first().value);if(null!==a.get(.5))return Nm(a.get(.5));if(2===a.count)return a=a.La(),Nm(Lm(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 Nm(Lm(a.get(c),a.get(d),1-f/e))}return!1}; function Nm(a){if(!a)return!1;if(a instanceof Fl)return a.Xx();gi(a);return 128>(299*Mm.j+587*Mm.v+114*Mm.o)/1E3} function Im(a,b){switch(b){case Hm:b=100*Om(Mm.j);var c=100*Om(Mm.v),d=100*Om(Mm.o);Pm.j=.4124564*b+.3575761*c+.1804375*d;Pm.v=.2126729*b+.7151522*c+.072175*d;Pm.o=.0193339*b+.119192*c+.9503041*d;Pm.G=Mm.G;b=Qm(Pm.j/Rm[0]);c=Qm(Pm.v/Rm[1]);d=Qm(Pm.o/Rm[2]);Sm.j=116*c-16;Sm.v=500*(b-c);Sm.o=200*(c-d);Sm.G=Pm.G;Sm.j=Math.min(100,Math.max(0,Sm.j+100*a));a=(Sm.j+16)/116;b=a-Sm.o/200;Pm.j=Rm[0]*Tm(Sm.v/500+a);Pm.v=Rm[1]*(Sm.j>Um*Vm?Math.pow(a,3):Sm.j/Um);Pm.o=Rm[2]*Tm(b);Pm.G=Sm.G;a=-.969266*Pm.j+1.8760108* Pm.v+.041556*Pm.o;b=.0556434*Pm.j+-.2040259*Pm.v+1.0572252*Pm.o;Mm.j=255*Wm((3.2404542*Pm.j+-1.5371385*Pm.v+-.4985314*Pm.o)/100);Mm.v=255*Wm(a/100);Mm.o=255*Wm(b/100);Mm.G=Pm.G;Mm.j=Math.round(Mm.j);255Mm.j&&(Mm.j=0);Mm.v=Math.round(Mm.v);255Mm.v&&(Mm.v=0);Mm.o=Math.round(Mm.o);255Mm.o&&(Mm.o=0);return"rgba("+Mm.j+", "+Mm.v+", "+Mm.o+", "+Mm.G+")";case Xm:return hi(),ii.o=Math.min(100,Math.max(0,ii.o+100*a)),"hsla("+ii.j+", "+ii.v+"%, "+ii.o+"%, "+ ii.G+")";default:v("Unknown color space: "+b)}}function gi(a){Dm||(Em(),Dm=!0);var b=Gm;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,Mm.j=a[0],Mm.v=a[1],Mm.o=a[2],Mm.G=a[3]/255):(b.fillStyle="#FFFFFF",c=b.fillStyle,b.fillStyle=a,b.fillStyle===c&&G&&v('Color "'+a+'" is not a valid color string for RGBA color conversion'),Mm.j=0,Mm.v=0,Mm.o=0,Mm.G=1)}} function hi(){var a=Mm.j/255,b=Mm.v/255,c=Mm.o/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))}ii.j=Math.round(g);ii.v=Math.round(100*a);ii.o=Math.round(100*e);ii.G=Mm.G}function Om(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Wm(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055} function Qm(a){return a>Vm?Math.pow(a,1/3):(Um*a+16)/116}function Tm(a){var b=a*a*a;return b>Vm?b:(116*a-16)/Um}function rm(a,b){"string"===typeof a?G&&!Fm(a)&&v('Color "'+a+'" is not a valid color string for '+b):a instanceof Fl||v("Value for "+b+" must be a color string or a Brush, not "+a)}function Em(){Gm=$g?(new cj(null,void 0,{willReadFrequently:!0})).context:null} oa.Object.defineProperties(Fl.prototype,{type:{configurable:!0,get:function(){return this.ta},set:function(a){this._isFrozen&&xa(this,a);$a(a,Fl,Fl,"type");this.ta=a;this.start.pc()&&(a===Zl?this.start=Bc:a===Gl&&(this.start=Ic));this.end.pc()&&(a===Zl?this.end=Mc:a===Gl&&(this.end=Ic));this.He=null}},color:{configurable:!0,get:function(){return this.Jk},set:function(a){this._isFrozen&&xa(this,a);G&&!Fm(a)&&v('Color "'+a+'" is not a valid color string for Brush.color'); this.Jk=a;this.He=null}},start:{configurable:!0,get:function(){return this.Wd},set:function(a){this._isFrozen&&xa(this,a);x(a,Hb,Fl,"start");this.Wd=a.M();this.He=null}},end:{configurable:!0,get:function(){return this.Xk},set:function(a){this._isFrozen&&xa(this,a);x(a,Hb,Fl,"end");this.Xk=a.M();this.He=null}},startRadius:{configurable:!0,get:function(){return this.Tr},set:function(a){this._isFrozen&&xa(this,a);D(a,Fl,"startRadius");0>a&&Ba(a,">= zero",Fl, "startRadius");this.Tr=a;this.He=null}},endRadius:{configurable:!0,get:function(){return this.kq},set:function(a){this._isFrozen&&xa(this,a);D(a,Fl,"endRadius");0>a&&Ba(a,">= zero",Fl,"endRadius");this.kq=a;this.He=null}},colorStops:{configurable:!0,get:function(){return this.Ge},set:function(a){this._isFrozen&&xa(this,a);G&&x(a,vb,Fl,"colorStops");this.Ge=a;this.He=null}},pattern:{configurable:!0,get:function(){return this.qr},set:function(a){this._isFrozen&& xa(this,a);this.qr=a;this.He=null}}});Fl.prototype.isDark=Fl.prototype.Xx;Fl.prototype.darkenBy=Fl.prototype.nz;Fl.prototype.lightenBy=Fl.prototype.oA;Fl.prototype.addColorStop=Fl.prototype.addColorStop;var Vm=216/24389,Um=24389/27,Rm=[95.047,100,108.883],Gm=null,Mm=new Cm,ii=new Cm,Pm=new Cm,Sm=new Cm,Dm=!1;Fl.className="Brush";var Wl;Fl.Solid=Wl=new F(Fl,"Solid",0);var Zl;Fl.Linear=Zl=new F(Fl,"Linear",1);var Gl;Fl.Radial=Gl=new F(Fl,"Radial",2);var Yl;Fl.Pattern=Yl=new F(Fl,"Pattern",4);var Hm; Fl.Lab=Hm=new F(Fl,"Lab",5);var Xm;Fl.HSL=Xm=new F(Fl,"HSL",6); Fl.randomColor=function(a,b){void 0===a&&(a=128);G&&(D(a,Fl,"randomColor:min"),(0>a||255b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+ a};Fl.isValidColor=Fm;Fl.lighten=function(a){return Jm(a)};Fl.lightenBy=Jm;Fl.darken=function(a){return Km(a)};Fl.darkenBy=Km;Fl.mix=Lm;Fl.isDark=Nm;function nm(){this.Ea="Base"}nm.prototype.measure=function(){};nm.prototype.rA=function(a,b,c,d,e){a.measure(b,c,d,e)};nm.prototype.arrange=function(){};nm.prototype.bz=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};nm.prototype.CA=function(a){a.fk()};nm.prototype.mc=function(){}; oa.Object.defineProperties(nm.prototype,{name:{configurable:!0,get:function(){return this.Ea},set:function(a){this.Ea=a}},classType:{configurable:!0,get:function(){return W}}});nm.prototype.remeasureObject=nm.prototype.CA;nm.prototype.arrangeElement=nm.prototype.bz;nm.prototype.measureElement=nm.prototype.rA;nm.className="PanelLayout";function Ym(){this.Ea="Base"}na(Ym,nm); Ym.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Zm(a);for(var k=0;kaa&&(tb=Math.max(aa-wf,0));var Ik=0===O.ua;O.vc=O.vc+tb;O.actual=O.ua+tb;aa=Math.max(aa-(tb+(Ik?wf:0)),0)}if(1===vc.columnSpan&&(Yb===xg||Yb===ll)){O=a.Kb(Xb);var Vi=O.bd();tb=Math.max(ag-O.actual,0);tb+Vi>T&&(tb=Math.max(T-Vi,0));var ko=0===O.ua;O.vc=O.vc+tb;O.actual=O.ua+tb;T=Math.max(T-(tb+(ko?Vi:0)),0)}vf&&vc.fk()}}}}}Pa(z);var ge=0,De=0;f=a.columnCount;for(var Kg=0;Kg=a.rowCount);bf++)O=a.Lb(db.row+bf),tb=0,tb=Yb===Ad||Yb===ll?Math.max(O.minimum,0===Hd[db.row+bf]?O.maximum:Math.min(Hd[db.row+bf],O.maximum)):Math.max(O.minimum,isNaN(O.Oc)?O.maximum:Math.min(O.Oc, O.maximum)),Xd.height+=tb,Gc+=O.minimum;for(var fd=1;fd=a.columnCount);fd++)O=a.Kb(db.column+fd),tb=0,tb=Yb===Ad||Yb===kl?Math.max(O.minimum,0===Sc[db.column+fd]?O.maximum:Math.min(Sc[db.column+fd],O.maximum)):Math.max(O.minimum,isNaN(O.Oc)?O.maximum:Math.min(O.Oc,O.maximum)),Xd.width+=tb,Mk+=O.minimum;xb.width+=Xd.width;xb.height+=Xd.height;var Wh=db.margin,Bf=Wh.right+Wh.left,Xi=Wh.top+Wh.bottom;db.measure(xb.width,xb.height,Mk,Gc);for(var Xh=db.measuredBounds,Yd= Math.max(Xh.width+Bf,0),eg=Math.max(Xh.height+Xi,0),Cf=0,Yh=0;Yh=a.rowCount);Yh++)O=a.Lb(db.row+Yh),Cf+=O.total||0;if(Cf=cf)&&!(db.row+Ge>=a.rowCount);Ge++){O=a.Lb(db.row+Ge);var ef=O.ua||0,ff=df(db,O,ie);G&&"number"!==typeof ff&&v(db+" spanAllocation does not return a number: "+ff);O.actual=Math.min(O.maximum,ef+ff);O.ua!==ef&&(cf-=O.ua-ef)}for(;0Id&&(O.actual=Math.min(O.maximum,Id+cf),O.ua!==Id&&(cf-=O.ua-Id));if(0===O.index)break;O=a.Lb(O.index-1)}}for(var Ng=0,gf=0;gf=a.columnCount);gf++)O=a.Kb(db.column+gf),Ng+=O.total||0;if(Ng=Og)&&!(db.column+fg>=a.columnCount);fg++){O=a.Kb(db.column+fg);var Yi=O.ua||0,Zi=He(db,O,mo);G&&"number"!==typeof Zi&&v(db+" spanAllocation does not return a number: "+ Zi);O.actual=Math.min(O.maximum,Yi+Zi);O.ua!==Yi&&(Og-=O.ua-Yi)}for(;0Nk&&(O.actual=Math.min(O.maximum,Nk+Og),O.ua!==Nk&&(Og-=O.ua-Nk));if(0===O.index)break;O=a.Kb(O.index-1)}}}}Pa(A);Gb.free(Xd);Gb.free(xb);void 0!==Hd&&Pa(Hd);void 0!==Sc&&Pa(Sc);var Pg=0,Qg=0,Ok=a.desiredSize,Vr=a.maxSize;Yb=yl(a,!0);var $i=De=ge=0,aj=0;f=a.columnCount;for(var Pk=0;Pk=a.rowCount);O++){var la=a.Lb(z+O);0!==la.ua&&(w.height+=la.total)}for(O= 1;O=a.columnCount);O++)la=a.Kb(C+O),0!==la.ua&&(w.width+=la.total);var ha=E.ua+w.width,ya=A.ua+w.height;O=h;la=k;var La=ha,sb=ya,wb=h,Wb=k,tb=ha,Ye=ya;h+ha>c.width&&(tb=Math.max(c.width-h,0));k+ya>c.height&&(Ye=Math.max(c.height-k,0));var jb=Y.alignment;if(jb.Wb()){jb=a.defaultAlignment;jb.mb()||(jb=Ic);var Ed=jb.x;var Xb=jb.y;var Ze=jb.offsetX;jb=jb.offsetY;var Kc=E.alignment,dd=A.alignment;Kc.mb()&&(Ed=Kc.x,Ze=Kc.offsetX);dd.mb()&&(Xb=dd.y,jb=dd.offsetY)}else Ed=jb.x,Xb=jb.y, Ze=jb.offsetX,jb=jb.offsetY;if(isNaN(Ed)||isNaN(Xb))Xb=Ed=.5,jb=Ze=0;Kc=R.width;dd=R.height;var Dc=Y.margin,vc=Dc.left+Dc.right,vf=Dc.top+Dc.bottom,Fd=cm(Y,A,E,!1);!isNaN(Y.desiredSize.width)||Fd!==Ad&&Fd!==kl||(Kc=Math.max(ha-vc,0));!isNaN(Y.desiredSize.height)||Fd!==Ad&&Fd!==ll||(dd=Math.max(ya-vf,0));ha=Y.maxSize;ya=Y.minSize;Kc=Math.min(ha.width,Kc);dd=Math.min(ha.height,dd);Kc=Math.max(ya.width,Kc);dd=Math.max(ya.height,dd);ha=dd+vf;O+=La*Ed-(Kc+vc)*Ed+Ze+Dc.left;la+=sb*Xb-ha*Xb+jb+Dc.top;Y.visible&& (jc(wb,Wb,tb,Ye,O,la,R.width,R.height)?Y.arrange(O,la,Kc,dd):Y.arrange(O,la,Kc,dd,new M(wb,Wb,tb,Ye)))}}Gb.free(w);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.ef();for(var q=[],r=a.S.s,u=r.length,y=0;yA)){w=nk(w.figure);for(var C=0;CA&&z.push(E))}}}}r= a.S.s;u=r.length;for(y=0;ye*w*c))){A=H.segmentIndex;if(!isFinite(A)||isNaN(A))A=0;0>A&&(A=w-Math.min(-A,w));A=Math.round(A%w);w=H.opacity;C=1;if(1!==w){if(0===w)continue;C=b.globalAlpha;b.globalAlpha=C*w}E=q[y];var T=!1,aa=H.strokeDashArray;null!==aa&&(T=!0,b.ws(aa,H.strokeDashOffset));if("LineV"===H.figure&&null!==H.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),A=z.measuredBounds,c.ld(A),q.push(A);else{var C=z.segmentIndex,E=z.segmentFraction,H=z.alignmentFocus;H.pc()&&(H=Ic);var T=z.segmentOrientation,aa=z.segmentOffset;if(isNaN(C)){var Y=k.Ba;A=Na();Y.fv(E,A);var R=K.allocAt(A[0],A[1]);R.add(k.i(0));Y.type=== N.j?R.offset(-Y.startX,-Y.startY):(Y=Y.figures.first(),null!==Y&&R.offset(-Y.startX,-Y.startY));Y=A[2];if(T!==lg){var O=k.computeAngle(z,T,Y);z.Qb=O}O=R.x-b.x;var la=R.y-b.y;K.free(R);Pa(A)}else if(C<-n||C>=n)A=K.alloc(),k.Hg(),k.computeMidPoint(A),Y=k.midAngle,T!==lg&&(O=k.computeAngle(z,T,Y),z.Qb=O),O=A.x-b.x,la=A.y-b.y,K.free(A);else{O=0;0<=C?(la=m.P(C),A=Cha+10?0<=C?Y.gb(la):la.gb(Y):ha>R+10?0<=C?A.gb(O):O.gb(A):0<=C?Y.gb(O):O.gb(Y)}else Y=0<=C?la.gb(A):A.gb(la);T!==lg&&(O=k.computeAngle(z,T,Y),z.Qb=O);O=la.x+(A.x-la.x)*E-b.x;la=la.y+(A.y-la.y)*E-b.y}z.measure(Infinity,Infinity,0,0);A=z.measuredBounds;R=z.naturalBounds;var ya=0;z instanceof Pf&&(ya=z.strokeWidth);ha=R.width+ya;var La=R.height+ya;r.reset();r.translate(-A.x,-A.y);r.scale(z.scale,z.scale);r.rotate(T===lg?z.angle:Y,ha/2,La/2);T!==rn&&T!==sn||r.rotate(90, ha/2,La/2);T!==tn&&T!==un||r.rotate(-90,ha/2,La/2);T===vn&&(45Y||225Y)&&r.rotate(-Y,ha/2,La/2);R=new M(0,0,ha,La);u.Ki(R,H);r.Ma(u);H=-u.x+ya/2*z.scale;z=-u.y+ya/2*z.scale;y.assign(aa);ya=isNaN(aa.x);var sb=isNaN(aa.y);if(ya||sb){ha=ha/2+3;La=La/2+3;var wb=45<=Y&&135>=Y,Wb=225<=Y&&315>=Y;T===lg&&(wb||Wb)?(y.x=sb?ha:aa.y,y.y=ya?La:aa.x,wb?0<=C||isNaN(C)&&.5>E||!ya||(y.y=-La):Wb&&((0<=C||isNaN(C)&&.5>E)&&ya&&(y.y=-La),sb&&(y.x=-ha))):(ya&&(y.x=0<=C||isNaN(C)&&.5>E?ha:-ha),sb&&(y.y=-La), y.rotate(Y))}else y.rotate(Y);O+=y.x;la+=y.y;R.set(A);R.h(O+H,la+z,A.width,A.height);q.push(R);c.ld(R)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.vg=c;a.position.h(b.x+c.x,b.y+c.y);ac(e,c.width||0,c.height||0);Ib.free(r);K.free(u);K.free(y)}}}}; pn.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Be||a instanceof S){var d=a,e=null;a instanceof Be&&(e=a,d=e.adornedPart);var f=a instanceof Be?null:d.path,g=a.j;if(0!==g.length){var h=0;if(null!==f&&h=c)r=K.alloc(),q=n,y=r,q.Hg(),q.computeMidPoint(y),q=n.midAngle,l!==lg&&(n=n.computeAngle(g,l,q),g.angle=n),n=r.x,y=r.y, K.free(r);else{u=0;0<=h?(r=b.s[h],y=hz+10?0<=h?q.gb(r):r.gb(q):z>w+10?0<=h?y.gb(u):u.gb(y):0<=h?q.gb(u):u.gb(q)}else q=0<=h?r.gb(y):y.gb(r);l!==lg&&(n=n.computeAngle(g,l,q),g.angle=n);n=r.x+(y.x-r.x)*k;y=r.y+(y.y-r.y)*k}if(p.kp())g.location=new K(n,y);else{p.pc()&&(p=Ic);r=Ib.alloc();r.reset();r.scale(g.scale,g.scale);r.rotate(g.angle, 0,0);var A=g.naturalBounds;u=M.allocAt(0,0,A.width,A.height);w=K.alloc();w.Ki(u,p);r.Ma(w);p=-w.x;z=-w.y;var C=A.width,E=A.height;A=K.alloc();A.assign(m);var H=isNaN(m.x),T=isNaN(m.y);if(H||T){C=C/2+3;E=E/2+3;var aa=45<=q&&135>=q,Y=225<=q&&315>=q;l===lg&&(aa||Y)?(A.x=T?C:m.y,A.y=H?E:m.x,aa?0<=h||isNaN(h)&&.5>k||!H||(A.y=-E):Y&&((0<=h||isNaN(h)&&.5>k)&&H&&(A.y=-E),T&&(A.x=-C))):(H&&(A.x=0<=h||isNaN(h)&&.5>k?C:-C),T&&(A.y=-E),A.rotate(q))}else A.rotate(q);n+=A.x;y+=A.y;r.Dp(u);p+=u.x;z+=u.y;h=K.allocAt(n+ p,y+z);g.move(h);K.free(h);K.free(A);K.free(w);M.free(u);Ib.free(r)}}null!==e?e.hm(!1):d.hm(!1);d=wn(a);a.location.h(a.position.x+d.x,a.position.y+d.y);K.free(d)}}; function qn(a,b,c,d){if(!1!==Ij(d)){var e=d.strokeWidth;0===e&&a instanceof Be&&a.type===W.Link&&a.adornedObject instanceof Pf&&(e=a.adornedObject.strokeWidth);e*=d.Ia;a instanceof S&&null!==a.Ba?(a=a.geometry.bounds,d.Re(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Be&&null!==a.adornedPart.Ba?(a=a.adornedPart.Ba.bounds,d.Re(a.x-e/2,a.y-e/2,a.width+e,a.height+e)):d.Re(-(e/2),-(e/2),b+e,c+e);e=d.desiredSize;e.u()||null===d.Ba?d.jc.h(0,0,e.width,e.height):d.jc.assign(d.Ba.bounds);Dj(d,!1)}} function xn(){this.Ea="Base"}na(xn,nm); xn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.Vb();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 M(-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 q=h.geometry,r=h.strokeWidth,u=q.flattenedSegments,y=q.flattenedLengths,w=q.flattenedTotalLength,z=u.length,A=0,C=0,E=Na(),H=0;Hha&&(ha+=360);aa.push(ha)}A=O;C=la}E.push(aa)}if(null===a.graduatedIntervals){for(var ya=[],La=a.S.s,sb=La.length,wb=0;wbYe))for(var jb=0;jbYe&&tb.push(Xb)}}}}a.graduatedIntervals=ya}var Ze=a.graduatedIntervals;var Kc=a.S.s,dd=Kc.length,Dc=0,vc=0,vf=w;a.graduatedMarks= [];for(var Fd,Ph=0;PhUi*Yb*w/a.graduatedRange&&null===Ec.graduatedSkip)){var Jg=y[0][0],Ud=0,wc=0;vc=w*Ec.graduatedStart-1E-4;vf=w*Ec.graduatedEnd+1E-4;var ag=Ui*Yb,Fc=a.graduatedTickBase;if(Fca.graduatedMin+ag&&(Fc-=Math.floor((Fc-a.graduatedMin)/ag)*ag);for(var Ik=Ze[Ph],Vi=Fc,ko=1E-6*a.graduatedMax, ge=1;Fc<=a.graduatedMax+ko;ge++){a:{for(var De=Ik.length,Kg=0;Kg-Qh){var yf=!1;break a}}yf=!0}if(yf&&(Fc>a.graduatedMax&&(Fc=a.graduatedMax),null===Ec.graduatedSkip||Ec instanceof bh&&!Ec.graduatedSkip(Fc,Ec)||Ec instanceof Pf&&!Ec.graduatedSkip(Fc,Ec))&&(Dc=(Fc-a.graduatedMin)*w/a.graduatedRange,Dc>w&&(Dc=w),vc<=Dc&&Dc<=vf)){for(var he=E[Ud][wc],$e=y[Ud][wc];UdJg&&wc< y[Ud].length-1;)wc++,he=E[Ud][wc],$e=y[Ud][wc],Jg+=$e;if(Dc<=Jg)break;Ud++;wc=0;he=E[Ud][wc];$e=y[Ud][wc];Jg+=$e}var xc=u[Ud],Vd=xc[2*wc],Jk=xc[2*wc+1],Ee=(Dc-(Jg-$e))/$e,Rh=new K(Vd+(xc[2*wc+2]-Vd)*Ee+r/2-q.bounds.x,Jk+(xc[2*wc+3]-Jk)*Ee+r/2-q.bounds.y);Rh.scale(h.scale,h.scale);a:{var Gd=he,bg=E[Ud];if(!(.5005>Ee&&.4995Ee?0Ee||.9995Lg){var Sh=1-Math.abs(.5-Ee);he=(Gd*Sh+Wd*(1-Sh))%360;break a}}}he=Gd}if(Ec instanceof bh){var pd="";null!==Ec.graduatedFunction?(pd=Ec.graduatedFunction(Fc,Ec),pd=null!==pd&&void 0!==pd?pd.toString():""):pd=(+Fc.toFixed(2)).toString();""!==pd&&Fd.push({nm:Rh,angle:he,text:pd})}else Fd.push({nm:Rh,angle:he})}Fc=Vi+ge*ag}}}a.graduatedMarks.push(Fd)}Pa(E); var xb=a.graduatedMarks;if(null!==xb)for(var Wi=d.length,kc=0;kcqd;qd++){switch(qd){case 0:yc.h(Xd,Hd);break;case 1:yc.h(Xd+Th,Hd);break;case 2:yc.h(Xd,Hd+dg);break;case 3:yc.h(Xd+Th,Hd+dg)}yc.rotate(db+kb.angle);yc.offset(Lk,Vh);0===Uh&&0===qd?Sc.h(yc.x,yc.y,0,0):Sc.lf(yc);yc.offset(-Lk,-Vh);yc.rotate(-db-kb.angle)}K.free(yc);null!==Fe.graduatedBounds&&Fe.graduatedBounds.push(Sc);ic(af,Sc.x,Sc.y,Sc.width,Sc.height)}else if(kb instanceof bh){var ed=a,Mk=e;null===ed.temporaryTextBlock&&(ed.temporaryTextBlock=new bh);var Gc=ed.temporaryTextBlock;yn(Gc,kb); var bf=kb.alignmentFocus;bf.pc()&&(bf=Bc);for(var fd=kb.segmentOrientation,Wh=kb.segmentOffset,Bf=new M,Xi=0,Xh=0,Yd=0,eg=0,Cf=0,Yh=lc.length,cf=0;cfYd||225Yd)&&Id.rotate(-Yd,ef/2,ff/2);var Ng=M.allocAt(0,0,ef,ff),gf=K.alloc();gf.Ki(Ng,bf);Id.Ma(gf);var Og=-gf.x,mo=-gf.y,He=K.alloc();He.assign(Wh);isNaN(He.x)&&(He.x=ef/2+3);isNaN(He.y)&&(He.y=-(ff/2+3));He.rotate(Yd);Xi+=He.x+Og;Xh+=He.y+mo;var fg=new M(Xi,Xh,df.width,df.height),Yi=new M(df.x,df.y,df.width,df.height),Zi=new M(Ge.x,Ge.y,Ge.width,Ge.height); ie.lA=eg;ie.lineCount=Gc.lineCount;ie.lines=[Gc.Ib,Gc.Uh,Gc.rf,Gc.We,Gc.Wc,Gc.Xb,Gc.Je];ie.actualBounds=fg;ie.measuredBounds=Yi;ie.naturalBounds=Zi;0===cf?Bf.assign(fg):Bf.ld(fg);K.free(He);K.free(gf);M.free(Ng);Ib.free(Id)}null!==ed.graduatedBounds&&ed.graduatedBounds.push(Bf);ic(Mk,Bf.x,Bf.y,Bf.width,Bf.height)}Dj(kb,!1)}}}; xn.prototype.arrange=function(a,b,c){if(null!==a.graduatedBounds){var d=a.Vb(),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.S.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,y=p.strokeWidth*p.scale,w=p.alignmentFocus;w.pc()&&(w=Bc);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){wi(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.ws(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.Eb;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.ef();n&&b.ts()}}}} function Cn(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=En(a,!0),l=En(a,!1),m=0;mp)){var q=n.bd(),r=n.separatorStrokeWidth;isNaN(r)&&(r=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))r=0;q-= r;r=n.position+r;q+=n.actual;r+q>p&&(q=p-r);0>=q||(p=a.Eb,wi(a,b,n.background,!0,!1,h,g),c?b.fillRect(p.left,r+p.top,g.width-(p.left+p.right),q):b.fillRect(r+p.left,p.top,q,g.height-(p.top+p.bottom)))}}}}function En(a,b){for(var c=b?a.rowCount:a.columnCount,d=0;dd&&e.set(r),K.free(r));K.free(m);f&&e.transform(g);return l}; t.Sj=function(){for(var a=this.S.s,b=a.length,c=0;cc||f>d)this.w(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case Ad:this.w(!0);this.measure(c+h,d+g,0,0);break;case kl:this.w(!0);this.measure(c+h,f+g,0,0);break;case ll:this.w(!0),this.measure(b+h,d+g,0,0)}}this.ta.arrange(this,e,this.vg)}}; t.rh=function(a){var b=this.naturalBounds,c=Zm(this);if(jc(0,0,b.width,b.height,a.x,a.y)){b=this.S.s;for(var d=b.length,e=K.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Jb(e.set(a),f.transform),f.ha(e))return K.free(e),!0}K.free(e);return null===this.Ra&&null===this.areaBackground?!1:!0}return!1};t.xs=function(a){if(this.bindingId===a)return this;for(var b=this.S.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=Ib.alloc();p.set(g); if(null!==m?m.Of(a,b,c,d,e,p):xl(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);Ib.free(p)}}}void 0===f&&Ib.free(g);return d}void 0===f&&Ib.free(g);return!1};function Ln(a,b,c,d){for(var e=a.S.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&&Ln(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}} t.Ag=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.Ae(),k=h?a:Jb(K.allocAt(a.x,a.y),this.transform),l=h?b:Jb(K.allocAt(b.x,b.y),this.transform),m=k.Nf(l),n=0y.width||u.y>y.height||0>u.x+u.width||0>u.y+u.height))if(r.Ae()?(u=r.transform,Jb(k.set(a),u),Jb(l.set(b),u)):(k.set(a),l.set(b)),u=r,r=r instanceof W?r:null,null!==r?r.Ag(k,l,c,d,e,f):u.Kx(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}K.free(k);K.free(l)}return e?n:g}return!1}; function en(a){var b=null;a instanceof Pf&&(b=a.spot1,b===gd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=Ac);return b}function fn(a){var b=null;a instanceof Pf&&(b=a.spot2,b===gd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Nc);return b}t.add=function(a){for(var b=[],c=0;c=e.count&&a>=e.count)return; e.sb(f);d=f}else v("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Mb(a,b);if(0===a||b.isPanelMain)this.lh=null;Ij(this)||this.w();b.w(!1);null!==b.portId?this.ff=!0:b instanceof W&&!0===b.ff&&(this.ff=!0);this.graduatedIntervals=null;this.Uf()||Mn(this,b,!1);c=this.part;null!==c&&(c.ci=null,c.mg=NaN,this.ff&&c instanceof V&&(c.ff=!0),c.ff&&c instanceof V&&(c.Cc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&& c.jb(se,"elements",this,b,null,d,null),c.jb(re,"elements",this,null,b,null,a)))};function Nn(a,b){a.l=b?a.l|16777216:a.l&-16777217}t.remove=function(a){x(a,P,W,"remove:element");for(var b=this.S.s,c=b.length,d=-1,e=0;ea&&Ba(a,">= 0",W,"getRowDefinition:idx");a=Math.round(a);var b=this.rowDefs;if(void 0===b[a]){var c=new jk;c.Ji(this);c.isRow=!0;c.index=a;b[a]=c;this.jb(re,"rowdefs",this,null,c,null,a)}return b[a]}; t.IA=function(a){G&&D(a,W,"removeRowDefinition:idx");0>a&&Ba(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.jb(se,"rowdefs",this,c,null,a,null);this.w()}}};function kk(a,b,c){var d=a.rowDefs;if(!(0>b)){d[b]=c instanceof jk?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} t.Kb=function(a){G&&D(a,W,"getColumnDefinition:idx");0>a&&Ba(a,">= 0",W,"getColumnDefinition:idx");a=Math.round(a);var b=this.colDefs;if(void 0===b[a]){var c=new jk;c.Ji(this);c.isRow=!1;c.index=a;b[a]=c;this.jb(re,"coldefs",this,null,c,null,a)}return b[a]}; t.DA=function(a){G&&D(a,W,"removeColumnDefinition:idx");0>a&&Ba(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.jb(se,"coldefs",this,c,null,a,null);this.w()}}};function lk(a,b,c){var d=a.colDefs;if(!(0>b)){d[b]=c instanceof jk?c:void 0;if(!c)for(b=d.length-1;0<=b&&void 0===d[b--];)d.length--;a.w()}} t.Xy=function(a){var b=null;a.isRow?b=this.Lb(a.index):a.isRow||(b=this.Kb(a.index));b&&mm(b,a);return this};t.Yy=function(a,b){(a=this.Lb(a))&&mm(a,new jk(b));return this};t.Sy=function(a,b){(a=this.Kb(a))&&mm(a,new jk(b));return this};t.Iz=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;e=c.elements.count&&!(c instanceof U)){var d=!1;if(1===c.elements.count&&(d=null!==c.itemArray,!d))for(h=b.iterator;h.next();)if("itemArray"===h.value.targetProperty){d=!0;break}d||(Fa("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),Pn=!0)}}))} t.lz=function(a){void 0===a&&(a=!1);var b=this.copy();Gn(b,function(a){a instanceof W&&(a.allBindings=null,a.zb=null);var b=a.localBindings;null!==b&&(a.localBindings=null,b.each(function(b){a.bind(b.copy())}));b=a.animationTriggers;null!==b&&(a.animationTriggers=null,b.each(function(b){a.Yv(b.value.copy())}))});a&&wg(b);return b}; t.Qa=function(a){var b=this.allBindings;if(null!==b)for(void 0===a&&(a=""),b=b.iterator;b.next();){var c=b.value,d=c.sourceProperty;if(""===a||""===d||d===a)if(d=c.targetProperty,null!==c.converter||""!==d){d=this.data;var e=c.sourceName;if(null!==e)if(""===e)d=this;else if("/"===e)d=this;else if("."===e)d=this;else if(".."===e)d=this;else{if(d=this.lb(e),null===d){G&&Fa("Binding error: missing GraphObject named "+e+" in "+this.toString());continue}}else if(c.isToModel)if(d=this.diagram,null!==d)d= d.model.modelData;else continue;var f=this,g=c.Ni;if(-1!==g){if(f=this.xs(g),null===f)continue}else null!==c.Dd&&(f=c.Dd);"/"===e?d=f.part:"."===e?d=f:".."===e&&(d=f.panel);e=c.Fo;if(0!==e){if(!(f instanceof W))continue;1===e?f=f.Kb(c.Jl):2===e&&(f=f.Lb(c.Jl))}void 0!==f&&c.aw(f,d)}}};t.Jx=function(a){if(void 0===a||null===a||null===this.me)return null;B(a,"object",W,"findItemPanelForData");return this.me.L(a)}; function Qn(a,b){a=a.S.s;for(var c=a.length,d=b.length,e=0,f=null;ea;)this.wc(this.S.length-1,!1);Rn(this,this.itemArray)}; function Rn(a,b){var c=Jn(a);if(null===b||0===b.length)for(;a.S.length>c;)a.wc(a.S.length-1,!1);else if(a.S.length<=c){c=b.length;for(var d=0;dc)){var e=Tn(a,b);e=Un(a,e);if(null!==e){wg(e);e=e.copy();if(0!==(e.l&16777216)){var f=a.th();null!==f&&Nn(f,!0)}"object"===typeof b&&(null===a.me&&(a.me=new vb),a.me.add(b,e));f=c+Jn(a);a.Mb(f,e);d&&(e.zb=b,Vn(a,f,c),e.zb=null);e.data=b}}} function Vn(a,b,c){for(a=a.S;ba&&Ba(a,">= 0",W,"padding"), a=new fc(a)):(x(a,fc,W,"padding"),0>a.left&&Ba(a.left,">= 0",W,"padding:value.left"),0>a.right&&Ba(a.right,">= 0",W,"padding:value.right"),0>a.top&&Ba(a.top,">= 0",W,"padding:value.top"),0>a.bottom&&Ba(a.bottom,">= 0",W,"padding:value.bottom"));var b=this.Eb;b.D(a)||(this.Eb=a=a.M(),this.w(),this.g("padding",b,a))}},defaultAlignment:{configurable:!0,get:function(){return this.fn},set:function(a){var b=this.fn;b.D(a)||(G&&x(a,Hb,W,"defaultAlignment"),this.fn=a=a.M(),this.w(),this.g("defaultAlignment", b,a))}},defaultStretch:{configurable:!0,get:function(){return this.fg},set:function(a){var b=this.fg;b!==a&&($a(a,P,W,"defaultStretch"),this.fg=a,this.w(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{configurable:!0,get:function(){return null!==this.Y?this.Y.cq:tc},set:function(a){"number"===typeof a?a=new fc(a):G&&x(a,fc,W,"defaultSeparatorPadding");var b=this.defaultSeparatorPadding;b.D(a)||(a=a.M(),null===this.Y&&(this.Y=new $n),this.Y.cq=a,this.w(),this.g("defaultSeparatorPadding", b,a))}},defaultRowSeparatorStroke:{configurable:!0,get:function(){return null!==this.Y?this.Y.oa:null},set:function(a){var b=this.defaultRowSeparatorStroke;b!==a&&(null===a||"string"===typeof a||a instanceof Fl)&&(a instanceof Fl&&a.freeze(),null===this.Y&&(this.Y=new $n),this.Y.oa=a,this.R(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{configurable:!0,get:function(){return null!==this.Y?this.Y.Na:1},set:function(a){var b=this.defaultRowSeparatorStrokeWidth; b!==a&&isFinite(a)&&0<=a&&(null===this.Y&&(this.Y=new $n),this.Y.Na=a,this.w(),this.g("defaultRowSeparatorStrokeWidth",b,a))}},defaultRowSeparatorDashArray:{configurable:!0,get:function(){return null!==this.Y?this.Y.Z:null},set:function(a){var b=this.defaultRowSeparatorDashArray;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",W,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;ea)&&v("Panel.topIndex must be greater than zero and a real number, not: "+a),null===this.Y&&(this.Y=new $n),this.Y.Nb=a,this.w(),this.g("topIndex",b,a))}},leftIndex:{configurable:!0,get:function(){return null!==this.Y?this.Y.ob:0},set:function(a){var b= this.leftIndex;b!==a&&((!isFinite(a)||0>a)&&v("Panel.leftIndex must be greater than zero and a real number, not: "+a),null===this.Y&&(this.Y=new $n),this.Y.ob=a,this.w(),this.g("leftIndex",b,a))}},data:{configurable:!0,get:function(){return this.zb},set:function(a){var b=this.zb;if(b!==a){var c=this instanceof U&&!(this instanceof Be);c&&B(a,"object",W,"data");wg(this);this.zb=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof S?(null!==b&&c.pf.remove(b),null!==a&&c.pf.add(a, this)):this instanceof U&&(null!==b&&c.qf.remove(b),null!==a&&c.qf.add(a,this))):(c=this.panel,null!==c&&null!==c.me&&(null!==b&&c.me.remove(b),null!==a&&c.me.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Qa()}}},itemIndex:{configurable:!0,get:function(){return this.Ln},set:function(a){var b=this.Ln;b!==a&&(this.Ln=a,this.g("itemIndex",b,a))}},allBindings:{configurable:!0,get:function(){return null!==this.B?this.B.tb:null},set:function(a){this.localBindings!== a&&(null===this.B&&(this.B=new sl),this.B.tb=a)}},itemArray:{configurable:!0,get:function(){return this.Th},set:function(a){G&&null!==a&&!Array.isArray(a)&&v("Panel.itemArray must be an Array-like object or null, not: "+a);var b=this.Th;if(b!==a||null!==a&&Qn(this,a)){var c=this.diagram;b!==a&&(null!==c&&null!==b&&ak(c.partManager,this,c),this.Th=a,null!==c&&null!==a&&Xj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||Rn(this,a)}}},itemTemplate:{configurable:!0, enumerable:!0,get:function(){return null===this.itemTemplateMap?null:this.itemTemplateMap.L("")},set:function(a){if(null===this.itemTemplateMap){if(null===a)return;this.itemTemplateMap=new vb}var b=this.itemTemplateMap.L("");b!==a&&(x(a,W,W,"itemTemplate"),(a instanceof U||a.isPanelMain)&&v("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.Bv())}},itemTemplateMap:{configurable:!0, enumerable:!0,get:function(){return null!==this.B?this.B.Vc:null},set:function(a){var b=this.itemTemplateMap;if(b!==a){x(a,vb,W,"itemTemplateMap");for(var c=a.iterator;c.next();){var d=c.value;G&&(d instanceof U||d.isPanelMain)&&v("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}rl(this);this.B.Vc=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||this.Bv()}}},itemCategoryProperty:{configurable:!0,get:function(){return null!== this.B?this.B.Uc:"category"},set:function(a){var b=this.itemCategoryProperty;b!==a&&("string"!==typeof a&&"function"!==typeof a&&Aa(a,"string or function",W,"itemCategoryProperty"),rl(this),this.B.Uc=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{configurable:!0,get:function(){return 0!==(this.l&1048576)},set:function(a){var b=0!==(this.l&1048576);b!==a&&(B(a,"boolean",W,"isAtomic"),this.l^=1048576,this.g("isAtomic",b,a))}},isClipping:{configurable:!0,get:function(){return 0!== (this.l&2097152)},set:function(a){var b=0!==(this.l&2097152);b!==a&&(G&&(B(a,"boolean",W,"isClipping"),!a||this.type===W.Spot||this instanceof Df||Fa("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString())),this.l^=2097152,this instanceof Df&&(this.yb=null),this.w(),this.g("isClipping",b,a))}},isOpposite:{configurable:!0,get:function(){return 0!==(this.l&33554432)},set:function(a){var b=0!==(this.l&33554432);b!==a&&(B(a,"boolean",W,"isOpposite"),this.l^=33554432,this.w(), this.g("isOpposite",b,a))}},isEnabled:{configurable:!0,get:function(){return 0!==(this.l&4194304)},set:function(a){var b=0!==(this.l&4194304);if(b!==a){B(a,"boolean",W,"isEnabled");var c=null===this.panel||this.panel.Uf();this.l^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&Mn(this,this,a)}}},alignmentFocusName:{configurable:!0,get:function(){return this.mf},set:function(a){var b=this.mf;b!==a&&(G&&B(a,"string",W,"alignmentFocusName"), this.mf=a,this.w(),this.g("alignmentFocusName",b,a))}}}); oa.Object.defineProperties(W,{Position:{configurable:!0,get:function(){return lm.L("Position")}},Horizontal:{configurable:!0,get:function(){return lm.L("Horizontal")}},Vertical:{configurable:!0,get:function(){return lm.L("Vertical")}},Spot:{configurable:!0,get:function(){return lm.L("Spot")}},Auto:{configurable:!0,get:function(){return lm.L("Auto")}},Table:{configurable:!0,get:function(){return lm.L("Table")}},Viewbox:{configurable:!0, enumerable:!0,get:function(){return lm.L("Viewbox")}},TableRow:{configurable:!0,get:function(){return lm.L("TableRow")}},TableColumn:{configurable:!0,get:function(){return lm.L("TableColumn")}},Link:{configurable:!0,get:function(){return lm.L("Link")}},Grid:{configurable:!0,get:function(){return lm.L("Grid")}},Graduated:{configurable:!0,get:function(){return lm.L("Graduated")}}});W.prototype.rebuildItemElements=W.prototype.Bv; W.prototype.findItemPanelForData=W.prototype.Jx;W.prototype.updateTargetBindings=W.prototype.Qa;W.prototype.copyTemplate=W.prototype.lz;W.prototype.graduatedValueForPoint=W.prototype.$z;W.prototype.graduatedPointForValue=W.prototype.Zz;W.prototype.findColumnForLocalX=W.prototype.Az;W.prototype.findRowForLocalY=W.prototype.Iz;W.prototype.addColumnDefinition=W.prototype.Sy;W.prototype.addRowDefinition=W.prototype.Yy;W.prototype.addRowColumnDefinition=W.prototype.Xy; W.prototype.removeColumnDefinition=W.prototype.DA;W.prototype.getColumnDefinition=W.prototype.Kb;W.prototype.removeRowDefinition=W.prototype.IA;W.prototype.getRowDefinition=W.prototype.Lb;W.prototype.removeAt=W.prototype.sb;W.prototype.remove=W.prototype.remove;W.prototype.insertAt=W.prototype.Mb;W.prototype.elt=W.prototype.P;W.prototype.add=W.prototype.add;W.prototype.findObject=W.prototype.lb;W.prototype.findInVisualTree=W.prototype.am;W.prototype.walkVisualTreeFrom=W.prototype.yk; W.prototype.findMainElement=W.prototype.Vb;var Pn=!1,Xn=!1,Yn=null,lm=new vb;W.className="Panel";W.definePanelLayout=Zn;Zn("Position",new Ym);Zn("Vertical",new an);Zn("Auto",new dn);Zn("Link",new pn);function ao(){this.yq=0;this.G=100;this.oa=10;this.Z=0;this.ki=this.o=this.j=this.v=null}ao.prototype.copy=function(){var a=new ao;a.yq=this.yq;a.G=this.G;a.oa=this.oa;a.Z=this.Z;a.v=this.v;a.j=this.j;a.o=this.o;a.ki=this.ki;return a};ao.className="GradPanelSettings"; function $n(){this.Vc=[];this.Uc=[];this.j=this.ub=bo;this.ob=this.Nb=0;this.cq=tc;this.Na=1;this.Z=this.oa=null;this.G=1;this.tb=this.o=this.v=null} $n.prototype.copy=function(a){for(var b=new $n,c=this.Vc,d=c.length,e=b.Vc,f=0;fa&&Ba(a,">= 0",jk,"height"),this.Oc=a,this.actual=this.ua,null!== this.panel&&this.panel.w(),this.Ub("height",b,a))}},width:{configurable:!0,get:function(){return this.Oc},set:function(a){var b=this.Oc;b!==a&&(G&&B(a,"number",jk,"width"),0>a&&Ba(a,">= 0",jk,"width"),this.Oc=a,this.actual=this.ua,null!==this.panel&&this.panel.w(),this.Ub("width",b,a))}},minimum:{configurable:!0,get:function(){return this.wj},set:function(a){var b=this.wj;b!==a&&(G&&B(a,"number",jk,"minimum"),(0>a||!isFinite(a))&&Ba(a,">= 0",jk,"minimum"),this.wj=a,this.actual= this.ua,null!==this.panel&&this.panel.w(),this.Ub("minimum",b,a))}},maximum:{configurable:!0,get:function(){return this.uj},set:function(a){var b=this.uj;b!==a&&(G&&B(a,"number",jk,"maximum"),0>a&&Ba(a,">= 0",jk,"maximum"),this.uj=a,this.actual=this.ua,null!==this.panel&&this.panel.w(),this.Ub("maximum",b,a))}},alignment:{configurable:!0,get:function(){return this.Pb},set:function(a){var b=this.Pb;b.D(a)||(G&&x(a,Hb,jk,"alignment"),this.Pb=a.M(),null!==this.panel&&this.panel.w(), this.Ub("alignment",b,a))}},stretch:{configurable:!0,get:function(){return this.tg},set:function(a){var b=this.tg;b!==a&&(G&&$a(a,P,jk,"stretch"),this.tg=a,null!==this.panel&&this.panel.w(),this.Ub("stretch",b,a))}},separatorPadding:{configurable:!0,get:function(){return this.pg},set:function(a){"number"===typeof a?a=new fc(a):null!==a&&G&&x(a,fc,jk,"separatorPadding");var b=this.pg;null!==a&&null!==b&&b.D(a)||(null!==a&&(a=a.M()),this.pg=a,null!==this.panel&&this.panel.w(), this.Ub("separatorPadding",b,a))}},separatorStroke:{configurable:!0,get:function(){return this.xo},set:function(a){var b=this.xo;b!==a&&(null!==a&&rm(a,"RowColumnDefinition.separatorStroke"),a instanceof Fl&&a.freeze(),this.xo=a,null!==this.panel&&this.panel.w(),this.Ub("separatorStroke",b,a))}},separatorStrokeWidth:{configurable:!0,get:function(){return this.yo},set:function(a){var b=this.yo;b!==a&&(this.yo=a,null!==this.panel&&this.panel.w(),this.Ub("separatorStrokeWidth", b,a))}},separatorDashArray:{configurable:!0,get:function(){return this.Gj},set:function(a){var b=this.Gj;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",jk,"separatorDashArray:value");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,q,r,u=0,y=Na(),w=2;wn&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;w=0;r=y[w];n=r[0];q=r[1];p=r[2];r=r[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){Pa(y);return}e>r?(z=e-r,e=r):z=0;var A=Math.sqrt(e*e/(1+p*p));0>n&&(A=-A);h+=A;k+=p*A;a.translate(h,k);a.rotate(q);a.translate(-(g/2),-(f/2));0===z&&d.sh(a,b);a.translate(g/2,f/2);a.rotate(-q);a.translate(-h,-k);u-=e;r-=e;if(0!==z){w++;if(w===y.length){Pa(y);return}r=y[w];n=r[0];q=r[1];p=r[2];r=r[3];e=z}}Pa(y)}} t.sh=function(a,b){var c=this.Dc,d=this.gj;if(null!==c||null!==d){var e=this.Ba;if(null!==e){a.Ec();var f=this.actualBounds,g=this.naturalBounds;null!==d&&wi(this,a,d,!0,!1,g,f);var h=this.part,k=this.ug;null===c||0!==k||null===h||!this.isPanelMain&&h.Vb()!==this||(k=h.type===W.Link&&h instanceof Be&&"Selection"===h.category&&h.adornedObject instanceof Pf&&h.adornedPart.Vb()===h.adornedObject?h.adornedObject.strokeWidth:0);0===k&&(c=null);null!==c&&0!==k&&(wi(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.Sf("drawShadows")&&(f=h.isShadowed);!1===a.Wl&&(f=!1);h=!0;null===c||null!==d&&"transparent"!==d||(h=!1);g=!1;k=this.strokeDashArray;null!==k&&(g=!0,a.ws(k,this.strokeDashOffset));if(e.type===N.j)a.beginPath(),a.moveTo(e.startX,e.startY),a.lineTo(e.endX,e.endY),null!==c&&a.vk(),a.ef();else if(e.type===N.v){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.zg(d);null!==c&&(h&&f&&Jl(a),a.vk(),h&&f&&Il(a));a.ef()}else if(e.type===N.G)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+L.Ig*e,k-p,l+e,k-L.Ig*p,l+e,k),a.bezierCurveTo(l+e,k+L.Ig*p,l+L.Ig*e,k+p,l,k+p),a.bezierCurveTo(l-L.Ig*e,k+p,l-e,k+L.Ig*p,l-e,k),a.bezierCurveTo(l-e,k-L.Ig*p,l-L.Ig*e,k-p,l,k-p),a.closePath(),null!==d&&a.zg(d),null!==c&& (h&&f&&Jl(a),a.vk(),h&&f&&Il(a)),a.ef();else if(e.type===N.o)for(e=e.figures,k=e.length,p=0;pu.sweepAngle,null!==q?q.endX:l.startX,null!==q?q.endY:l.startY)}else if(q=$d(u,l),y=q.length,0===y)a.lineTo(u.centerX,u.centerY);else for(var w=0;w(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;M.free(f);return L.dc(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type=== N.v){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.Hc(-d,-d);if(f.ha(a))return M.free(f),!1;f.Hc(d,d)}null!==this.stroke&&f.Hc(e,e);a=f.ha(a);M.free(f);return a}if(c.type===N.G){g=c.startX;e=c.startY;h=c.endX;var k=c.endY;c=Math.min(g,h);b=Math.min(e,k);g=Math.abs(h-g)/2;e=Math.abs(k-e)/2;c=a.x-(c+g);b=a.y-(b+e);if(null===this.fill){g-=d;e-=d;if(0>=g||0>=e||1>=c*c/(g*g)+b*b/(e*e))return M.free(f), !1;g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);M.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===N.o)return M.free(f),null===this.fill?de(c,a.x,a.y,e):be(c,a,e,1=this.strokeWidth)m=L.hf(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=Na();a=new K;L.hf(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new K;L.hf(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new K;L.hf(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new K;L.hf(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 Pa(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(r)?(u*=.5/r,r=.5):0!==u&&.5>Math.abs(u)&&(r*=.5/u,u=.5),w-=r,z-= u;q.contains(w,z);)w-=r,z-=u;e.x=h;e.y=k;for(u=0;uc?a-c:c-a)<(b>d?b-d:d-b)?(a=ba||L.ca(k.y,a))&&(k.yb||L.ca(k.x,b))&&(k.x=a&&d<=b;a=d&&c<=a} t.Kx=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.rh(a,!0))return!0;var e=a.Nf(b),f=e;1.5=e||Lb(b,f,0,-n)>= e||Lb(b,f,0,n)>=e||Lb(b,f,m,0)>=e?!1:!0}else if(b.type===N.o){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&&Kb(a.x,a.y,f,h,k,h)>e&&Kb(a.x,a.y,k,l,f,l)>e&&Kb(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?de(b,a.x,a.y,f):be(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 Rd:var p=Na();L.cf(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.Fd(g,m)>e)return!1;break;case Sd:p=Na();L.rp(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Pa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.Fd(g,m)>e)return!1;break;case Td:case Zd:p=n.type===Td?$d(n,f):ae(n,f,g,m);var q=p.length;if(0===q){g=n.type===Td?n.centerX:n.endX;m=n.type===Td?n.centerY:n.endY;if(a.Fd(g,m)> e)return!1;break}n=null;for(var r=Na(),u=0;ub+1E-5||d.bounds.height>c+1E-5)&&v('Geometry made with figure "'+a.figure+'" has bounds '+d.bounds.toString()+" that are too large for the given size ("+b+","+c+"). See documentation for Shape.defineFigureGenerator."); return d};function to(a){var b=so[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=so[c];if(void 0===b){var d=null,e;for(e in L.Hm)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=N.parse(L.Hm[d],!1),so[d]=a,c!==d&&(so[c]=d),d}}return"string"===typeof b?b:b instanceof N?a:null} oa.Object.defineProperties(Pf.prototype,{geometry:{configurable:!0,get:function(){return null!==this.Ba?this.Ba:this.Xd},set:function(a){var b=this.Ba,c=this.Xd;if(b!==a){null!==a?(G&&x(a,N,Pf,"geometry"),this.Xd=this.Ba=a.freeze()):this.Xd=this.Ba=null;var d=this.part;null!==d&&(d.mg=NaN);this.w();this.g("geometry",b||c,a);ul(this)&&(a=this.part,null!==a&&vl(this,a,"geometryString"))}}},geometryString:{configurable:!0,get:function(){return null===this.geometry?"":this.geometry.toString()}, set:function(a){a=N.parse(a);var b=a.normalize();this.geometry=a;this.position=a=K.allocAt(-b.x,-b.y);K.free(a)}},isGeometryPositioned:{configurable:!0,get:function(){return 0!==(this.l&1048576)},set:function(a){G&&B(a,"boolean",Pf,"isGeometryPositioned");var b=0!==(this.l&1048576);b!==a&&(G&&B(a,"boolean",Pf,"isGeometryPositioned"),this.l^=1048576,this.w(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.gj},set:function(a){var b= this.gj;b!==a&&(null!==a&&rm(a,"Shape.fill"),a instanceof Fl&&a.freeze(),this.gj=a,this.R(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Dc},set:function(a){var b=this.Dc;b!==a&&(null!==a&&rm(a,"Shape.stroke"),a instanceof Fl&&a.freeze(),this.Dc=a,this.R(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.ug},set:function(a){var b=this.ug;if(b!==a)if(G&&D(a,Pf,"strokeWidth"),0<=a){this.ug=a;this.w();var c=this.part; null!==c&&(c.mg=NaN);this.g("strokeWidth",b,a)}else Ba(a,"value >= 0",Pf,"strokeWidth:value")}},strokeCap:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Ur:"butt"},set:function(a){var b=this.strokeCap;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?Ba(a,'"butt", "round", or "square"',Pf,"strokeCap"):(eo(this),this.Sa.Ur=a,this.R(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Vr:"miter"}, set:function(a){var b=this.strokeJoin;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?Ba(a,'"miter", "bevel", or "round"',Pf,"strokeJoin"):(eo(this),this.Sa.Vr=a,this.R(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return null!==this.Sa?this.Sa.Wr:10},set:function(a){var b=this.strokeMiterLimit;if(b!==a)if(G&&D(a,Pf,"strokeMiterLimit"),1<=a){eo(this);this.Sa.Wr=a;this.R();var c=this.part;null!==c&&(c.mg=NaN);this.g("strokeMiterLimit", b,a)}else G&&Ba(a,"value >= 1",Pf,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.jh},set:function(a){var b=this.jh;if(b!==a){null===a||Array.isArray(a)||Aa(a,"Array",Pf,"strokeDashArray:value");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.pb!==a&&(c=!1);b.pb instanceof vi&& (c=!1);!1===b.Sf("textGreeking")&&(c=!1);b=this.spacingAbove;n=this.spacingBelow;switch(this.flip){case pl:a.translate(e,0);a.scale(-1,1);break;case ol:a.translate(0,f);a.scale(1,-1);break;case ql:a.translate(e,f),a.scale(-1,-1)}a.Ec();m=this.Mc;p=(b+g+n)*m;f>p&&(d=this.verticalAlignment,d=d.y*f-d.y*p+d.offsetY);if(1===m&&null!==this.Je)n=this.Ib,n>e&&(n=e),this.$j(this.Je,a,0,d+b,e,g,n,c,h,k,l);else if(null!==this.Wc&&null!==this.Xb)for(p=0;pe&&(q=e);d+=b;this.$j(this.Xb[p], a,0,d,e,g,q,c,h,k,l);d+=g+n}switch(this.flip){case pl:a.scale(-1,1);a.translate(-e,0);break;case ol:a.scale(1,-1);a.translate(0,-f);break;case ql:a.scale(-1,-1),a.translate(-e,-f)}}}; t.$j=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!==Bo?Bo(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!==Co?Co(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.ef();b instanceof vi&&b.gd.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.ef(),b instanceof vi&&b.gd.classList.add("gojs-td"))}}; t.wk=function(a,b,c){if(!P.prototype.wk.call(this,a,b,c))return!1;wi(this,a,this.Dc,!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))){this.l|=16777216; l=this.Xb[k];for(b=Math.max(1,a-b);Fo(l)>b&&1a.maxLines&&(a.l|=16777216)}} function Mo(a,b,c,d){var e=a.formatting===Eo;e&&(b=b.trim());var f=0,g=a.Ke,h=a.spacingAbove+a.spacingBelow;h=Math.max(0,Ao(a)+h);var k=a.overflow===Ho?Io(g):0;if(a.Mc>=a.maxLines)null!==d&&d.h(0,h);else if(g=b,a.wrap===No){a.We=1;var l=Fo(b);if(0===k||l<=c)a.Ib=Math.max(a.Ib,l),Lo(a,b,a.Ib),null!==d&&d.h(l,h);else{f=Oo(a,g);g=g.substr(f.length);b=Oo(a,g);for(l=Fo(f+b);0 c&&1c;){var n=1;l=Fo(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=Fo(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);Lo(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.Mc+k>a.maxLines)break}m=Oo(a,g);for(l=Fo(b+m);0a.maxLines))break}a.We=Math.min(a.maxLines,k);a.Ib=Math.max(a.Ib,f);null!==d&&d.h(a.Ib,h*a.We)}} function Oo(a,b){if(a.wrap===Po)return b.substr(0,1);for(var c=b.length,d=0,e=Qo;d=b.length?b:b.substr(0,d)}function Fo(a){return null===wo?8*a.length:wo.measureText(a).width}function Ao(a){if(null!==a.rf)return a.rf;var b=a.Ke;if(null===wo){var c=16;return a.rf=c}void 0!==So[b]&&5E3>To?c=So[b]:(c=1.3*wo.measureText("M").width,So[b]=c,To++);return a.rf=c} function Io(a){if(null===wo)return 6;if(void 0!==Uo[a]&&5E3>Vo)var b=Uo[a];else b=wo.measureText(Jo).width,Uo[a]=b,Vo++;return b} function Go(a,b){var c=a.kc.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.spacingAbove+a.spacingBelow;d=Math.max(0,Ao(a)+d);if(0===c.length)return a.Ib=0,a.Mc=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.Mc=0,g,h=!1;!h;){g=c.indexOf("\n",f);-1===g&&(g=c.length,h=!0);if(f<=g){f=c.substr(f,g-f);if(a.wrap!==No){a.We=0;var k=Gb.alloc();Mo(a,f,b,k);e+=k.height;Gb.free(k);a.Mc+=a.We}else Mo(a,f,b,null),e+=d,a.Mc++;a.Mc===a.maxLines&&(h=!0)}f=g+1}return a.Yq=e} oa.Object.defineProperties(bh.prototype,{font:{configurable:!0,get:function(){return this.Ke},set:function(a){var b=this.Ke;b!==a&&(G&&(B(a,"string",bh,"font"),zo(a)||v('Not a valid font: "'+a+'"')),this.Ke=a,this.rf=null,this.w(),this.g("font",b,a))}},text:{configurable:!0,get:function(){return this.kc},set:function(a){var b=this.kc;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.kc=a,this.w(),this.g("text",b,a),this.$c=!0)}},textAlign:{configurable:!0, get:function(){return null!==this.ia?this.ia.bs:"start"},set:function(a){var b=this.textAlign;b!==a&&(G&&B(a,"string",bh,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(xo(this),this.ia.bs=a,this.R(),this.g("textAlign",b,a)):G&&Ba(a,'"start", "end", "left", "right", or "center"',bh,"textAlign"))}},flip:{configurable:!0,get:function(){return null!==this.ia?this.ia.ig:xg},set:function(a){var b=this.flip;b!==a&&($a(a,P,bh,"flip"),xo(this),this.ia.ig=a,this.R(), this.g("flip",b,a))}},verticalAlignment:{configurable:!0,get:function(){return null!==this.ia?this.ia.ms:jd},set:function(a){var b=this.verticalAlignment;b.D(a)||(G&&(x(a,Hb,bh,"verticalAlignment"),a.pc()&&v("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a)),a=a.M(),xo(this),this.ia.ms=a,bm(this),this.g("verticalAlignment",b,a))}},naturalBounds:{configurable:!0,get:function(){if(!this.jc.u()){var a=Gb.alloc();Mo(this,this.kc,999999,a);var b=a.width; Gb.free(a);a=Go(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);ac(this.jc,b,a)}return this.jc}},isMultiline:{configurable:!0,get:function(){return 0!==(this.l&2097152)},set:function(a){var b=0!==(this.l&2097152);b!==a&&(G&&B(a,"boolean",bh,"isMultiline"),this.l^=2097152,this.w(),this.g("isMultiline",b,a))}},isUnderline:{configurable:!0,get:function(){return 0!==(this.l&4194304)},set:function(a){var b=0!==(this.l&4194304);b!==a&& (G&&B(a,"boolean",bh,"isUnderline"),this.l^=4194304,this.$c=!0,this.R(),this.g("isUnderline",b,a))}},isStrikethrough:{configurable:!0,get:function(){return 0!==(this.l&8388608)},set:function(a){var b=0!==(this.l&8388608);b!==a&&(G&&B(a,"boolean",bh,"isStrikethrough"),this.l^=8388608,this.$c=!0,this.R(),this.g("isStrikethrough",b,a))}},wrap:{configurable:!0,get:function(){return null!==this.ia?this.ia.os:Wo},set:function(a){var b=this.wrap;b!==a&&(G&&$a(a,bh,bh,"wrap"), xo(this),this.ia.os=a,this.w(),this.g("wrap",b,a))}},overflow:{configurable:!0,get:function(){return null!==this.ia?this.ia.mr:Xo},set:function(a){var b=this.overflow;b!==a&&(G&&$a(a,bh,bh,"overflow"),xo(this),this.ia.mr=a,this.w(),this.g("overflow",b,a))}},isOverflowed:{configurable:!0,get:function(){return 0!==(this.l&16777216)}},stroke:{configurable:!0,get:function(){return this.Dc},set:function(a){var b=this.Dc;b!==a&&(null!==a&&rm(a,"TextBlock.stroke"), a instanceof Fl&&a.freeze(),this.Dc=a,this.R(),this.g("stroke",b,a))}},lineCount:{configurable:!0,get:function(){return this.Mc}},lineHeight:{configurable:!0,get:function(){return Ao(this)}},editable:{configurable:!0,get:function(){return 0!==(this.l&1048576)},set:function(a){var b=0!==(this.l&1048576);b!==a&&(G&&B(a,"boolean",bh,"editable"),this.l^=1048576,this.g("editable",b,a))}},textEditor:{configurable:!0,get:function(){return null!==this.ia? this.ia.ds:null},set:function(a){var b=this.textEditor;b!==a&&(!G||a instanceof Le||v("TextBlock.textEditor must be an HTMLInfo."),xo(this),this.ia.ds=a,this.g("textEditor",b,a))}},errorFunction:{configurable:!0,get:function(){return null!==this.ia?this.ia.Od:null},set:function(a){var b=this.errorFunction;b!==a&&(null!==a&&B(a,"function",bh,"errorFunction"),xo(this),this.ia.Od=a,this.g("errorFunction",b,a))}},interval:{configurable:!0,get:function(){return null!==this.ka? this.ka.el:1},set:function(a){var b=this.interval;G&&D(a,bh,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){null===this.ka&&(this.ka=new uo);this.ka.el=a;this.w();var c=this.panel;null!==c&&(c.graduatedIntervals=null);this.g("interval",b,a)}}},graduatedStart:{configurable:!0,get:function(){return null!==this.ka?this.ka.v:0},set:function(a){var b=this.graduatedStart;G&&D(a,bh,"graduatedStart");b!==a&&(0>a?a=0:1a?a=0:1=a&&Ba(a,"> 0",bh,"maxLines"),xo(this),this.ia.Wq=a,this.w(),this.g("maxLines",b,a))}},metrics:{configurable:!0,get:function(){return{arrSize:null!==this.Wc?this.Wc:[this.Ib],arrText:null!==this.Xb?this.Xb:[this.Je],maxLineWidth:this.Ib,fontHeight:this.rf}}}, choices:{configurable:!0,get:function(){return this.Tm},set:function(a){var b=this.Tm;b!==a&&(G&&null!==a&&!Array.isArray(a)&&Aa(a,"Array",bh,"choices:value"),this.Tm=a,this.g("choices",b,a))}}}); var Bo=null,Co=null,No=new F(bh,"None",0),Ko=new F(bh,"WrapFit",1),Wo=new F(bh,"WrapDesiredSize",2),Po=new F(bh,"WrapBreakAll",3),Xo=new F(bh,"OverflowClip",0),Ho=new F(bh,"OverflowEllipsis",1),Eo=new F(bh,"FormatTrim",0),Ro=new F(bh,"FormatNone",0),Qo=/[ \u200b\u00ad]/,So=new bb,To=0,Uo=new bb,Vo=0,Jo="...",Do="",wo=null,vo=!1;bh.className="TextBlock"; function yo(){this.uc=!1;this.Od=null;this.ig=xg;this.tq=Eo;this.Wq=Infinity;this.mr=Xo;this.Rr=this.Qr=0;this.bs="start";this.Ij=this.ds=this.cs=null;this.ms=jd;this.os=Wo}yo.prototype.copy=function(){var a=new yo;a.Od=this.Od;a.ig=this.ig;a.tq=this.tq;a.Wq=this.Wq;a.mr=this.mr;a.Qr=this.Qr;a.Rr=this.Rr;a.bs=this.bs;a.cs=this.cs;a.ds=this.ds;a.Ij=this.Ij;a.ms=this.ms;a.os=this.os;return a};bh.getEllipsis=function(){return Jo};bh.setEllipsis=function(a){Jo=a;Uo=new bb;Vo=0};bh.getBaseline=function(){return Bo}; bh.setBaseline=function(a){Bo=a};bh.getUnderline=function(){return Co};bh.setUnderline=function(a){Co=a};bh.isValidFont=zo;bh.FormatNone=Ro;bh.FormatTrim=Eo;bh.None=No;bh.OverflowClip=Xo;bh.OverflowEllipsis=Ho;bh.WrapBreakAll=Po;bh.WrapDesiredSize=Wo;bh.WrapFit=Ko;function uo(){this.el=1;this.v=0;this.j=1;this.o=this.G=null}uo.prototype.copy=function(){var a=new uo;a.el=this.el;a.v=this.v;a.j=this.j;a.G=this.G;a.o=this.o;return a};uo.className="GradElementSettings"; function rk(a,b){P.call(this);this.Qg=null;this.Co="";this.ih=pc;this.Zk=Ad;this.kh=this.Od=null;this.Yk=Ic;this.ig=xg;this.Il=null;this.Cn=!1;this.Rh=!0;this.ml=!1;this.ot=this.El=null;"string"===typeof a?this.source=a:a&&Object.assign(this,a);b&&Object.assign(this,b)}var Yo;na(rk,P); rk.prototype.cloneProtected=function(a){P.prototype.cloneProtected.call(this,a);a.Co=this.Co;a.element=this.Qg;a.ih=this.ih.M();a.Zk=this.Zk;a.ig=this.ig;a.Od=this.Od;a.kh=this.kh;a.Yk=this.Yk.M();a.Rh=this.Rh;a.El=this.El};rk.prototype.wb=function(a){a===xg||a===zg||a===nl?this.imageStretch=a:P.prototype.wb.call(this,a)};rk.prototype.toString=function(){return"Picture("+this.source+")#"+ib(this)}; function Ri(a){void 0===a&&(a="");B(a,"string",rk,"clearCache:url");""!==a?Yo[a]&&(delete Yo[a],Zo--):(Yo=new bb,Zo=0)} function $o(a,b){b.Iy||(b.Sq=function(c){b.Fq=!0;b.xn=!1;var d=b.Ng.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;e.R();var f=b.getAttribute("src")||"";var g=e.Zg.L(f);if(null!==g)for(var h=g.length,k=0;k=d.width&&(f=f+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(g=g+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case Ad:n=d.width;p=d.height;break;case zg:case nl:q===zg?(q=Math.min(d.height/p,d.width/n),n*=q,p*=q):q===nl&&(q=Math.max(d.height/p,d.width/n),n*=q,p*=q,n>=d.width&&(f=(f+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(g=(g+r.offsetY+(p*r.y-d.height*r.y)/ p)*h),k*=1/(n/d.width),h*=1/(p/d.height),n=d.width,p=d.height)}q=this.Pf()*b.scale;var u=n*q*p*q,y=k*h/u,w=c.__goCache;q=null;var z=ap;if(!e){if(c.Fq&&void 0!==w&&4z*z)for(null===w.ti&&(bp(w,4,l,m,c),bp(w,16,l,m,c)),e=w.ti,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=L.Yf[d];if(void 0!==e)return e;var f=a*L.Ig;e=(new N).add((new fe(a,0,!0)).add(new je(Cd,b-a,0)).add(new je(Rd,b,a,b-f,0,b,f)).add(new je(Cd,b,c-a)).add(new je(Rd,b-a,c,b,c-f,b-f,c)).add(new je(Cd,a,c)).add(new je(Rd,0,c-a,f,c,0,c-f)).add(new je(Cd,0,a)).add((new je(Rd,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.I^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;e.qa();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.cc();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.fc(),c.skipsUndoManager=d)}}}},isHighlighted:{configurable:!0,get:function(){return 0!==(this.I& 524288)},set:function(a){var b=0!==(this.I&524288);if(b!==a){G&&B(a,"boolean",U,"isHighlighted");this.I^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.qa(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.R();a=this.highlightedChanged;null!==a&&a(this)}}},isShadowed:{configurable:!0,get:function(){return 0!==(this.I&8192)},set:function(a){var b=0!==(this.I&8192);b!==a&&(G&&B(a,"boolean",U,"isShadowed"),this.I^=8192,this.$c=!0,this.g("isShadowed",b, a),this.R())}},isAnimated:{configurable:!0,get:function(){return 0!==(this.I&262144)},set:function(a){var b=0!==(this.I&262144);b!==a&&(G&&B(a,"boolean",U,"isAnimated"),this.I^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{configurable:!0,get:function(){return null!==this.T?this.T.Bq:null},set:function(a){var b=this.highlightedChanged;b!==a&&(null!==a&&B(a,"function",U,"highlightedChanged"),hp(this),this.T.Bq=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{configurable:!0, enumerable:!0,get:function(){return null!==this.T?this.T.Ir:""},set:function(a){var b=this.selectionObjectName;b!==a&&(G&&B(a,"string",U,"selectionObjectName"),hp(this),this.T.Ir=a,this.fh=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{configurable:!0,get:function(){return null!==this.T?this.T.Gr:null},set:function(a){var b=this.selectionAdornmentTemplate;b!==a&&(G&&x(a,Be,U,"selectionAdornmentTemplate"),hp(this),this.T.Gr=a,this.g("selectionAdornmentTemplate", b,a))}},selectionObject:{configurable:!0,get:function(){if(null===this.fh){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.lb(a),null!==a?this.fh=a:this.fh=this):this instanceof S?(a=this.path,null!==a?this.fh=a:this.fh=this):this.fh=this}return this.fh}},selectionChanged:{configurable:!0,get:function(){return null!==this.T?this.T.Hr:null},set:function(a){var b=this.selectionChanged;b!==a&&(null!==a&&B(a,"function",U,"selectionChanged"),hp(this),this.T.Hr=a,this.g("selectionChanged", b,a))}},resizeAdornmentTemplate:{configurable:!0,get:function(){return null!==this.T?this.T.tr:null},set:function(a){var b=this.resizeAdornmentTemplate;b!==a&&(G&&x(a,Be,U,"resizeAdornmentTemplate"),hp(this),this.T.tr=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{configurable:!0,get:function(){return null!==this.T?this.T.vr:""},set:function(a){var b=this.resizeObjectName;b!==a&&(G&&B(a,"string",U,"resizeObjectName"),hp(this),this.T.vr=a,this.g("resizeObjectName", b,a))}},resizeObject:{configurable:!0,get:function(){var a=this.resizeObjectName;return""!==a&&(a=this.lb(a),null!==a)?a:this}},resizeCellSize:{configurable:!0,get:function(){return null!==this.T?this.T.ur:Ub},set:function(a){var b=this.resizeCellSize;b.D(a)||(G&&x(a,Gb,U,"resizeCellSize"),a=a.M(),hp(this),this.T.ur=a,this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{configurable:!0,get:function(){return null!==this.T?this.T.wr:null},set:function(a){var b= this.rotateAdornmentTemplate;b!==a&&(G&&x(a,Be,U,"rotateAdornmentTemplate"),hp(this),this.T.wr=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{configurable:!0,get:function(){return null!==this.T?this.T.xr:""},set:function(a){var b=this.rotateObjectName;b!==a&&(G&&B(a,"string",U,"rotateObjectName"),hp(this),this.T.xr=a,this.g("rotateObjectName",b,a))}},rotateObject:{configurable:!0,get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.lb(a),null!== a)?a:this}},rotationSpot:{configurable:!0,get:function(){return null!==this.T?this.T.zr:gd},set:function(a){var b=this.rotationSpot;b.D(a)||(G&&(x(a,Hb,U,"rotationSpot"),a===gd||a.mb()||v("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+a)),a=a.M(),hp(this),this.T.zr=a,this.g("rotationSpot",b,a))}},text:{configurable:!0,get:function(){return this.kc},set:function(a){var b=this.kc;b!==a&&(G&&B(a,"string",U,"text"),this.kc=a,this.g("text",b,a))}}, containingGroup:{configurable:!0,get:function(){return this.Lh},set:function(a){if(this.ed()){var b=this.Lh;if(b!==a){G&&null!==a&&x(a,Df,U,"containingGroup");null===a||this!==a&&!a.Zd(this)||(this===a&&v("Cannot make a Group a member of itself: "+this.toString()),v("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.F(2);var c=this.diagram;null!==b?vp(b,this):this instanceof Df&&null!==c&&c.mi.remove(this);this.Lh=a;null!==a?up(a, this):this instanceof Df&&null!==c&&c.mi.add(this);this.F(1);if(null!==c&&c.da){var d=this.data,e=c.model;if(null!==d&&e.Ci()){var f=e.Da(null!==a?a.data:null);e.Ap(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.da,c.da=!0),d(this,b,a),null!==c&&(c.da=e));if(this instanceof Df)for(c=new J,hl(c,this,!0,0,!0),c=c.iterator;c.next();)if(d=c.value,d instanceof V)for(d=d.linksConnected;d.next();)Ap(d.value);if(this instanceof V){for(c=this.linksConnected;c.next();)Ap(c.value);c=this.labeledLink; null!==c&&Ap(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&xi(b,-1,a))}}else v("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{configurable:!0,get:function(){return null!==this.T?this.T.Xp:null},set:function(a){var b=this.containingGroupChanged;b!==a&&(null!==a&&B(a,"function",U,"containingGroupChanged"),hp(this),this.T.Xp=a,this.g("containingGroupChanged",b,a))}},isTopLevel:{configurable:!0,get:function(){return null!== this.containingGroup||this instanceof V&&null!==this.labeledLink?!1:!0}},layoutConditions:{configurable:!0,get:function(){return null!==this.T?this.T.Pq:127},set:function(a){var b=this.layoutConditions;b!==a&&(G&&B(a,"number",U,"layoutConditions"),hp(this),this.T.Pq=a,this.g("layoutConditions",b,a))}},dragComputation:{configurable:!0,get:function(){return null!==this.T?this.T.hq:null},set:function(a){var b=this.dragComputation;b!==a&&(null!==a&&B(a,"function",U,"dragComputation"), hp(this),this.T.hq=a,this.g("dragComputation",b,a))}},shadowOffset:{configurable:!0,get:function(){return null!==this.T?this.T.Mr:Bb},set:function(a){var b=this.shadowOffset;b.D(a)||(G&&x(a,K,U,"shadowOffset"),a=a.M(),hp(this),this.T.Mr=a,this.R(),this.g("shadowOffset",b,a))}},shadowColor:{configurable:!0,get:function(){return null!==this.T?this.T.Lr:"gray"},set:function(a){var b=this.shadowColor;b!==a&&(G&&B(a,"string",U,"shadowColor"),hp(this),this.T.Lr=a,this.R(),this.g("shadowColor", b,a))}},shadowBlur:{configurable:!0,get:function(){return null!==this.T?this.T.gh:4},set:function(a){var b=this.shadowBlur;b!==a&&(G&&B(a,"number",U,"shadowBlur"),hp(this),this.T.gh=a,this.R(),this.g("shadowBlur",b,a))}}});U.prototype.invalidateLayout=U.prototype.F;U.prototype.findCommonContainingGroup=U.prototype.Hx;U.prototype.isMemberOf=U.prototype.Zd;U.prototype.findTopLevelPart=U.prototype.Nz;U.prototype.findSubGraphLevel=U.prototype.Jz;U.prototype.ensureBounds=U.prototype.$a; U.prototype.getDocumentBounds=U.prototype.zi;U.prototype.findObject=U.prototype.lb;U.prototype.moveTo=U.prototype.moveTo;U.prototype.invalidateAdornments=U.prototype.cc;U.prototype.clearAdornments=U.prototype.Qj;U.prototype.removeAdornment=U.prototype.Vf;U.prototype.addAdornment=U.prototype.nh;U.prototype.findAdornment=U.prototype.ak;U.prototype.updateTargetBindings=U.prototype.Qa;var sp=!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 Be(a,b){void 0===a||a instanceof nm||"string"===typeof a?U.call(this,a):(U.call(this),a&&(b=a));this.I&=-257;this.Vg="Adornment";this.De=null;this.Pw=0;this.lx=!1;this.j=this.bb=null;b&&Object.assign(this,b)}na(Be,U);Be.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Be.prototype.updateRelationshipsFromData=function(){}; Be.prototype.hm=function(a){var b=this.adornedObject,c=null===b||void 0===b?void 0:b.part;if(c instanceof S&&b instanceof Pf){b=c.path;c.hm(a);a=b.geometry;c=this.S.s;b=c.length;for(var d=0;da&&(a=1);var b=this.diagram;if(null!==b&&!b.gf){b.gf=!0;var c=new J;c.add(this);Np(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Li);b.gf=!1}}; function Np(a,b,c,d,e,f,g){if(1a&&(a=2);var b=this.diagram;if(null!==b&&!b.gf){b.gf=!0;var c=new J;c.add(this);Pp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Li);b.gf=!1}}; function Pp(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Yo():a.Yd(),l={};k.next();){var m=k.value;if(m.isTreeLink&&(h||m.md||m.ib(),m=m.fp(a),null!==m&&m!==a&&!b.contains(m))){b.add(m);if(!h){m.ec(!0);m.zh();var n=c?m.$o():m.ap();l.Kv=a;n.all(function(a){return function(b){return b===a.Kv||!b.isTreeExpanded}}(l))&&e.Pj(m,f)}if(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};oa.Object.defineProperties(vg.prototype,{padding:{configurable:!0,get:function(){return this.Eb},set:function(a){"number"===typeof a?a=new fc(a):x(a,fc,vg,"padding");var b=this.Eb;b.D(a)||(this.Eb=a=a.M(),this.g("padding",b,a),this.w())}}});vg.className="Placeholder"; function S(a){U.call(this,W.Link);this.Va=8;this.sf=null;this.tf="";this.Gf=this.tn=null;this.Hf="";this.Go=null;this.Ck=lg;this.an=0;this.cn=lg;this.dn=NaN;this.Dj=Up;this.Bo=.5;this.Cd=null;this.Tb=(new I).freeze();this.eh=this.Zc=null;this.zl=new M;this.Ba=new N;this.v=this.o=this.dg=this.hg=null;this.Fu=new K;this.qq=this.ax=this.$w=null;this.It=NaN;this.fa=null;this.j=[];a&&Object.assign(this,a)}na(S,U); S.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.Va=this.Va&-113;a.tf=this.tf;a.tn=this.tn;a.Hf=this.Hf;a.Go=this.Go;a.Ck=this.Ck;a.an=this.an;a.cn=this.cn;a.dn=this.dn;a.Dj=this.Dj;a.Bo=this.Bo;null!==this.fa&&(a.fa=this.fa.copy())};t=S.prototype;t.Mf=function(a){U.prototype.Mf.call(this,a);this.tf=a.tf;this.Hf=a.Hf;a.Zc=null;a.ib();a.dg=this.dg;var b=a.fromPort;null!==b&&Gp(b);a=a.toPort;null!==a&&Gp(a)}; t.wb=function(a){a.classType===S?2===(a.value&2)?this.routing=a:a===og||a===kg||a===jg?this.curve=a:a===Vp||a===Wp||a===Xp?this.adjusting=a:a!==Up&&a!==lg&&v("Unknown Link enum value for a Link property: "+a):U.prototype.wb.call(this,a)};t.cd=function(){null===this.fa&&(this.fa=new tl)};t.Fi=function(){var a=this.fromNode;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Jj(a)||Kj(a))return!1}a=this.toNode;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Jj(a)||Kj(a))?!1:!0};t.Ov=function(){return!1}; t.Pv=function(){};t.ed=function(){return!1};S.prototype.computeAngle=function(a,b,c){return S.computeAngle(b,c)};S.computeAngle=function(a,b){switch(a){default:case lg:a=0;break;case zn:a=b;break;case rn:a=b+90;break;case tn:a=b-90;break;case Yp:a=b+180;break;case An:a=L.pp(b);90a&&(a-=180);break;case sn:a=L.pp(b+90);90a&&(a-=180);break;case un:a=L.pp(b-90);90a&&(a-=180);break;case vn:a=L.pp(b);if(45a||225a)return 0;90a&&(a-=180)}return L.pp(a)}; function Ap(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.Hx(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.Lh;if(c!==b){null!==c&&vp(c,a);a.Lh=b;null!==b&&up(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.da,g.da=!0);e(a,c,b);null!==g&&(g.da=f)}!a.md||a.$w!==c&&a.ax!==c||a.ib()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=S.prototype; t.zh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&U.prototype.zh.call(this)};t.fp=function(a){G&&x(a,V,S,"getOtherNode:node");var b=this.fromNode;return a===b?this.toNode:b};t.Wz=function(a){G&&x(a,P,S,"getOtherPort:port");var b=this.fromPort;return a===b?this.toPort:b};function Kp(a,b){null===a.Cd&&(a.Cd=new J);a.Cd.add(b);a.w()} t.hp=function(a){U.prototype.hp.call(this,a);Zp(this)&&this.jp(this.actualBounds);if(!a){a=this.sf;var b=null;null!==a&&(b=this.fromPort,Ip(a,this,b));var c=this.Gf;if(null!==c){var d=this.toPort;c===a&&d===b||Ip(c,this,d)}$p(this)}};t.ip=function(a){U.prototype.ip.call(this,a);Zp(this)&&this.jp(this.actualBounds);if(!a){a=this.sf;var b=null;null!==a&&(b=this.fromPort,Jp(a,this,b));var c=this.Gf;if(null!==c){var d=this.toPort;c===a&&d===b||Jp(c,this,d)}aq(this)}}; t.Xj=function(){this.md=!0;if(null!==this.Cd){var a=this.diagram;if(null!==a)for(var b=this.Cd.copy().iterator;b.next();)a.remove(b.value)}null!==this.data&&(a=this.diagram,null!==a&&a.partManager.removeDataForLink(this))};S.prototype.updateRelationshipsFromData=function(){if(null!==this.data){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)}}; S.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=K.allocAt(c.x+d,c.y+e),U.prototype.move.call(this,a,!1),K.free(a));qf(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)}; S.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};S.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}; S.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(Cb),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()===og))return this.Ba.ev(.5,a),a.add(this.i(0)),c=this.Ba.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===og){if(3===b){c=this.i(0);d=this.i(1);var e=this.i(2);L.tx(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);L.tx(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}; S.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).gb(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===og))return this.Ba.Nx(.5);if(this.computeCurve()===og&&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 L.dz(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.gb(d)};t=S.prototype;t.i=function(a){return this.Tb.s[a]}; t.kd=function(a,b){G&&(x(b,K,S,"setPoint"),b.u()||v("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.jd(a,b)};t.O=function(a,b,c){G&&(D(b,S,"setPointAt:x"),D(c,S,"setPointAt:y"));G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.jd(a,new K(b,c))}; t.dA=function(a,b){G&&(x(b,K,S,"insertPoint"),b.u()||v("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.Mb(a,b)};t.m=function(a,b,c){G&&(D(b,S,"insertPointAt:x"),D(c,S,"insertPointAt:y"));G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.Mb(a,new K(b,c))}; t.ve=function(a){G&&(x(a,K,S,"addPoint"),a.u()||v("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.add(a)};t.Kf=function(a,b){G&&(D(a,S,"insertPointAt:x"),D(b,S,"insertPointAt:y"));G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.add(new K(a,b))}; t.Ev=function(a){G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.sb(a)};t.Rj=function(){G&&null===this.Zc&&v("Call Link.startRoute before modifying the points of the route.");this.Tb.clear()}; function qf(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.md,e=new I,f=a.Tb.iterator;f.next();){var g=f.value;e.add((new K(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Tb;a.Tb=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.Fb?a.w():(a.qe.h(a.qe.x+b,a.qe.y+c),a.va.h(a.va.x+b,a.va.y+c),bm(a));d?bq(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&(a.defaultToPoint= a.i(a.pointsCount-1)));null!==g&&g.animationManager.Fb&&$h(g.animationManager,a,e);a.g("points",f,e)}}t.Fh=function(){null===this.Zc&&(this.Zc=this.Tb,this.Tb=this.Tb.copy())}; t.Lf=function(){if(null!==this.Zc){for(var a=this.Zc,b=this.Tb,c=Infinity,d=Infinity,e=a.s,f=e.length,g=0;gl&&(n=-n),u= (0>k?-1:1)*n+q,y=m*(u-q)+r);q=f.x+2*h/3;r=f.y+2*k/3;var w=q,z=r;L.C(k,0)?z=0k?-1:1)*n+q,z=m*(w-q)+r);this.Rj();this.ve(f);this.Kf(u,y);this.Kf(w,z);this.ve(p);this.kd(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.kd(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,L.C(c,0)?h=0g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.ve(d),this.Kf(f,h),this.ve(e);else{this.ve(d);this.ve(e);h=M.alloc();b.zi(h);k=h.ha(e);p.zi(h);l=h.ha(d);if(k||l)g=b.la(gq(g),new K),this.kd(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.la(gq(c),new K),this.kd(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));M.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Rj();var A=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);q=u=r=0;if(m||!h||l)y=this.computeEndSegmentLength(a,b,g,!0),q= this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(q-=m?90:30,0>A&&(q-=180)),0>q?q+=360:360<=q&&(q-=360),l&&(y+=Math.abs(A)*(m?1:2)),0===q?r=y:90===q?u=y:180===q?r=-y:270===q?u=-y:(r=y*Math.cos(q*Math.PI/180),u=y*Math.sin(q*Math.PI/180)),g.pc()&&l&&(y=b.la(Ic,K.alloc()),w=K.allocAt(y.x+1E3*r,y.y+1E3*u),this.getLinkPointFromPoint(a,b,y,w,!0,n),K.free(y),K.free(w));y=this.getLinkPoint(d,e,c,!1,m,a,b);var C=z=w=0;if(m||!k||l){var E=this.computeEndSegmentLength(d,e, c,!1);C=this.getLinkDirection(d,e,y,c,!1,m,a,b);l&&(k||g.D(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(C+=m?0:30,0>A&&(C+=180));0>C?C+=360:360<=C&&(C-=360);l&&(E+=Math.abs(A)*(m?1:2));0===C?w=E:90===C?z=E:180===C?w=-E:270===C?z=-E:(w=E*Math.cos(C*Math.PI/180),z=E*Math.sin(C*Math.PI/180));c.pc()&&l&&(c=e.la(Ic,K.alloc()),g=K.allocAt(c.x+1E3*w,c.y+1E3*z),this.getLinkPointFromPoint(d,e,c,g,!1,y),K.free(c),K.free(g))}c=n;if(m||!h||l)c=new K(n.x+r,n.y+u);g=y;if(m||!k||l)g=new K(y.x+w,y.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} S.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new K);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.Ae()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.we;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.dk(e,d,g,c,f);null!== a&&f.transform(a);return f};function iq(a,b){var c=b.mo;null===c&&(c=new jq,c.port=b,c.node=b.part,b.mo=c);return kq(c,a)} S.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new K);if(c.mb()&&!fq(c))return b.la(c,h),h;if(c.fd()){var k=iq(this,b);if(null!==k){h.assign(k.mp);if(e&&this.routing===lq){var l=iq(this,g);if(null!==l&&k.Ul=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Tf(Oc)||c.Tf(Rc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);K.free(k);K.free(l)}}return h}}c= b.la(gq(c),K.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=hq(c,g.copy()))):(k=this.computeSpot(!d,g),f=K.alloc(),g=g.la(gq(k),f),e&&(g=hq(c,g)),K.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);K.free(c);return h}; S.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.mb())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?hq(k,h.copy()):c):(c=K.alloc(),h=h.la(Ic,c),K.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;K.free(k);k=c}g&&d.pc()&&g.Zd(a)&&(k+=180,360<=k&&(k-=360));if(fq(d))return k;a=b.yi();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};S.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.fd()&&(a=iq(this,b),null!==a))return a.Zu;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a}; S.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=Ic:(b=this.fromSpot,b.Wb()&&(b=a.fromSpot),a=b===gd?zc:b)):(a=b?b:this.toPort,null===a?a=Ic:(b=this.toSpot,b.Wb()&&(b=a.toSpot),a=b===gd?zc:b));return a};function fq(a){return a===zc||.5===a.x&&.5===a.y}function gq(a){return.5===a.x&&.5===a.y?a:Ic} S.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==lg&&4p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=Ib.alloc();n.set(g); if(m instanceof W)h=m.Of(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Pf)if(h=a,p=d,!1===m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var q=h,r=n;if(m.qh(q,r))h=!0;else{if(void 0===r&&(r=m.transform,q.df(m.actualBounds))){h=!0;break b}h=q.left;p=q.right;var u=q.top;q=q.bottom;var y=K.alloc(),w=K.alloc(),z=K.alloc(),A=Ib.alloc();A.set(r);A.qv(m.transform);A.gk();w.x=p;w.y=u;w.transform(A);y.x=h;y.y=u;y.transform(A);r=!1;qo(m,y,w,z)?r=!0:(y.x=p,y.y=q,y.transform(A),qo(m,y,w,z)?r=!0:(w.x= h,w.y=q,w.transform(A),qo(m,y,w,z)?r=!0:(y.x=h,y.y=u,y.transform(A),qo(m,y,w,z)&&(r=!0))));Ib.free(A);K.free(y);K.free(w);K.free(z);h=r}}else h=m.qh(h,n)}else h=xl(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));Ib.free(n)}}}void 0===f&&Ib.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&Ib.free(g);return!1}; S.prototype.computeCurve=function(){if(null===this.hg){var a=this.fromPort,b=this.isOrthogonal;this.hg=null!==a&&a===this.toPort&&!b}return this.hg?og:this.curve};S.prototype.computeCorner=function(){if(this.curve===og)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a}; S.prototype.findMidLabel=function(){for(var a=this.path,b=this.S.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);L.ca(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.kd(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.O(a,g+b*Math.cos(h),n+b*Math.sin(h)));this.kd(c,d)}}return!0;case Xp:f=this.i(a);n=this.i(c);if(!f.cb(b)||!n.cb(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 q=1;if(0!==k-h){var r=(p-m)/(k-h);q=Math.sqrt(1+1/(r*r))}else r=9E9;this.kd(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.u()&&k.u()){h.Hc(oq,oq);k.Hc(oq,oq);h.lf(a);k.lf(c);var l=K.alloc(),m=K.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.ha(a)||h.ha(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.ha(a)||h.ha(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.ha(a)||h.ha(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.ha(a)||h.ha(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=rq&&(Ck(q),h.Hc(q.To*q.Yx,q.So*q.Zx),pq(q,a,b,n,d,h,!1),k=qq(q, n.x,n.y));if(!q.abort&&kthis.pointsCount)0===b||180===b?(h.x=a.x,h.y=n.y):(h.x=n.x,h.y=a.y),this.O(2,h.x,h.y),this.m(3,h.x,h.y);else if(g=this.i(3),0===b||180===b)L.C(h.x,g.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.O(2,h,a.y),this.O(3,h,g.y)):L.C(h.y,g.y)?(Math.abs(a.y-h.y)<=q.So/2&&(this.O(2,h.x,a.y),this.O(3,g.x,a.y)),this.m(2,h.x,a.y)):this.O(2,a.x,h.y);else if(90===b||270===b)L.C(h.y,g.y)?(h=90===b?Math.max(h.y,a.y): Math.min(h.y,a.y),this.O(2,a.x,h),this.O(3,g.x,h)):L.C(h.x,g.x)?(Math.abs(a.x-h.x)<=q.To/2&&(this.O(2,a.x,h.y),this.O(3,a.x,g.y)),this.m(2,a.x,h.y)):this.O(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.m(2,a.x,g.y):this.m(2,g.x,a.y):0===b||180===b?this.m(2,e.x,c.y):this.m(2,c.x,e.y));null!==r&&(0===d||180===d?this.Kf(f.x,r.y):this.Kf(r.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.ve(l.copy()),this.ve(m.copy()));K.free(l);K.free(m)}}; S.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).fd()||this.computeSpot(!1,this.toPort).fd()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f}; function gk(a){if(null===a.diagram||!a.isAvoiding||!xk(a.diagram))return!1;var b=a.points.s,c=b.length;if(4>c)return!1;a=yk(a.diagram,!0,a.containingGroup,null);for(var d=1;dtq&&qq(b,m,n)!==l-1&&(qq(b,c-h,d)===l-1?(e=180,m=c-h,n=d):qq(b,c+h,d)===l-1?(e=0,m=c+h,n=d):qq(b,c,d-k)===l-1?(e=270,m=c,n=d-k):qq(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>tq&&qq(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>tq)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>tq&&(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),qq(b,g,m)===l-1?sq(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),qq(b,g,m)===l-1&&sq(a,b,g,m,f,!1,f)));a.Kf(c,d)} S.prototype.zz=function(a){G&&x(a,K,S,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Kb(b,a,c.x,c.y,d.x,d.y),f=0,g=1;gthis.pointsCount?this.xk=!0:this.Ba=this.makeGeometry();a=this.path;if(null!==a){a.Ba=this.Ba;for(var b=this.S.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;ky?r>q?(f.x=w-A,f.y=q-A,e.x=w+u,e.y=q+u):(f.x=w-A,f.y=q+A,e.x=w+u,e.y=q-u):r>q?(f.x=w+A,f.y=q-A,e.x=w-u,e.y=q+u):(f.x=w+A,f.y=q+A,e.x=w-u,e.y=q-u));L.ca(y,w)&&L.ca(q,r)&&(q>p?(z>w?(f.x=w-A,f.y=q-A,e.x=w+u):(f.x=w+A,f.y=q-A,e.x=w-u),e.y=q+u):(z>w?(f.x=w-A,f.y=q+A,e.x=w+u):(f.x=w+A,f.y=q+A,e.x=w-u),e.y=q-u));if(L.ca(y,w)&&L.ca(w,z)||L.ca(p,q)&&L.ca(q,r))y=.5*(y+z),p=.5*(p+r),f.x=y,f.y=p,e.x=y,e.y=p;1===n?(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y)):2===n&&L.ca(g.x,this.i(0).x)&& L.ca(g.y,this.i(0).y)&&(c.x=.5*(g.x+l.x),c.y=.5*(g.y+l.y));Kd(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=uq(this,m.copy(),!1,yb));l=.5*(l+m.x);g=.5*(g+m.y);Kd(h,e.x-d,e.y-k,l-d,g-k,m.x-d,m.y-k);K.free(b);K.free(c);K.free(f);K.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=uq(this,g.copy(),!1,yb)),Kd(h,f.x-d,f.y-k,e.x-d, e.y-k,g.x-d,g.y-k);else{f=K.alloc();f.assign(this.i(0));e=K.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=0;n=b-1){if(!f.D(m))0!==this.computeShortLength(!1)&&(m=uq(this,m.copy(),!1,yb)),xq(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;nf.x?C=p.x-r:C=p.x+r;w.y>p.y?z=p.y+A:z=p.y-A;w=K.allocAt(C,E);xq(this,h,n,y,f,w,u);K.free(w);Ld(h,p.x+n,p.y+y,q+n,z+y);f.h(q,z)}else L.C(f.x,p.x)&&L.C(p.y,w.y)?(r=Math.min(g,Math.abs(p.y-e.y)/2),r=A=Math.min(r,Math.abs(w.x-p.x)/2),L.C(A,0)?(xq(this,h,n,y,f,p,u),f.assign(p)):(C=p.x,E=p.y,q=C,z=E,p.y>f.y?E=p.y-r:E=p.y+r,w.x>p.x?q=p.x+A:q=p.x-A,w=K.allocAt(C,E),xq(this,h,n,y,f,w,u),K.free(w),Ld(h,p.x+n,p.y+y,q+n,z+y),f.h(q, z))):(xq(this,h,n,y,f,p,u),f.assign(p));e.assign(m);n=l}K.free(f)}Od=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=uq(this,e,!0,f)),0!==this.computeShortLength(!1)&&(h=uq(this,h,!1,f)),a.type=N.j,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.xk=!0;return a}; function wq(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 L.ca(a,0)?b:L.ca(b,0)?a:Math.sqrt(a*a+b*b)} function uq(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=wq(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=wq(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 vq(a,b,c,d){for(var e=a.pointsCount,f=b;L.ca(b.x,f.x)&&L.ca(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!L.ca(b.x,f.x)&&!L.ca(b.y,f.y))return c-1;for(var g=f;L.ca(b.x,f.x)&&L.ca(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||L.ca(b.y,f.y)&&L.ca(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}S.prototype.computeJumpLength=function(){return 10}; function xq(a,b,c,d,e,f,g){if(!g&&Zp(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=yq(a,e,f,k));if(0n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;q=f.y+d;a.curve===kg?Jd(b,n,q,!1):Kd(b,p,m,n,m,n,q)}else if(L.C(e.x,f.x))if(e.ym-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;q=f.x+c;m+=d;a.curve===kg?Jd(b,q,m,!1):Kd(b,n,p,n,m,q,m)}}b.lineTo(f.x+c,f.y+d)} function yq(a,b,c,d){var e=a.diagram;if(null===e||b.D(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ua.s;for(var g=f.length,h=0;hg.x&&m.x>=l.x||l.xg.y&&m.y>=l.y||l.yr&&Math.min(g,y)n&&!L.C(g,y)){h.x=r;h.y=n;m=!0;break a}}else if(!L.C(n,q)&& L.C(g,y)&&Math.min(n,q)g&&Math.min(r,u)m&&!L.C(r,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}K.free(h)}function Zp(a){a=a.curve;return a===jg||a===kg}function cq(a,b){if(b||Zp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.Ph.contains(a)||0===a.zl.width&&0===a.zl.height||b.Ph.add(a,a.zl.copy())} S.prototype.jp=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.Ua.s;for(var g=e.length,h=0;ha&&Ba(a,">= 0",S,"fromEndSegmentLength"),this.cd(),this.fa.hj=a,this.g("fromEndSegmentLength",b,a),this.ib())}},fromShortLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.ij:NaN},set:function(a){var b=this.fromShortLength;b!==a&&(G&&B(a,"number",S,"fromShortLength"), this.cd(),this.fa.ij=a,this.xc(),this.g("fromShortLength",b,a))}},toSpot:{configurable:!0,get:function(){return null!==this.fa?this.fa.Lj:gd},set:function(a){var b=this.toSpot;b.D(a)||(G&&x(a,Hb,S,"toSpot"),a=a.M(),this.cd(),this.fa.Lj=a,this.g("toSpot",b,a),(b.fd()||a.fd())&&null!==this.toNode&&Gp(this.toPort),this.ib())}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.Jj:NaN},set:function(a){var b=this.toEndSegmentLength;b!==a&&(G&&B(a, "number",S,"toEndSegmentLength"),0>a&&Ba(a,">= 0",S,"toEndSegmentLength"),this.cd(),this.fa.Jj=a,this.g("toEndSegmentLength",b,a),this.ib())}},toShortLength:{configurable:!0,get:function(){return null!==this.fa?this.fa.Kj:NaN},set:function(a){var b=this.toShortLength;b!==a&&(G&&B(a,"number",S,"toShortLength"),this.cd(),this.fa.Kj=a,this.xc(),this.g("toShortLength",b,a))}},isLabeledLink:{configurable:!0,get:function(){return null===this.Cd?!1:0=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);L.Ql(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.lf(f),e=2;ed&&(d=-d)):L.ca(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Nf(e)); a.push(d)}}return this.qq}},flattenedTotalLength:{configurable:!0,get:function(){var a=this.It;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;dthis.pointsCount)return this.xk=!0,this.Ba;this.Ba=this.makeGeometry()}return this.Ba}},firstPickIndex:{configurable:!0,get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!fq(this.computeSpot(!0))?1:0}}, lastPickIndex:{configurable:!0,get:function(){var a=this.pointsCount;return 0===a?0:2>=a?a-1:this.isOrthogonal||!fq(this.computeSpot(!1))?a-2:a-1}},adjusting:{configurable:!0,get:function(){return this.Ck},set:function(a){var b=this.Ck;b!==a&&(G&&a!==lg&&a!==Vp&&a!==Wp&&a!==Xp&&v("Link.adjusting can only be set to Link.None, Link.End, LInk.Scale, or Link.Stretch, not: "+a),this.Ck=a,this.g("adjusting",b,a))}},corner:{configurable:!0,get:function(){return this.an}, set:function(a){var b=this.an;b!==a&&(G&&B(a,"number",S,"corner"),this.an=a,this.xc(),this.g("corner",b,a))}},curve:{configurable:!0,get:function(){return this.cn},set:function(a){var b=this.cn;b!==a&&(G&&a!==lg&&a!==og&&a!==kg&&a!==jg&&v("Link.curve can only be set to Link.None, Link.Bezier, LInk.JumpGap, or Link.JumpOver, not: "+a),this.cn=a,this.ib(),this.xc(),cq(this,b===kg||b===jg||a===kg||a===jg),this.g("curve",b,a))}},curviness:{configurable:!0,get:function(){return this.dn}, set:function(a){var b=this.dn;b!==a&&(G&&B(a,"number",S,"curviness"),this.dn=a,this.ib(),this.xc(),this.g("curviness",b,a))}},routing:{configurable:!0,get:function(){return this.Dj},set:function(a){var b=this.Dj;b!==a&&(G&&a!==Up&&a!==Cq&&a!==Dq&&a!==lq&&v("Link.routing can only be set to Link.Normal, Link.Orthogonal, LInk.AvoidsNodes, not: "+a),this.Dj=a,this.hg=null,this.ib(),cq(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{configurable:!0, get:function(){return this.Bo},set:function(a){var b=this.Bo;b!==a&&(G&&B(a,"number",S,"smoothness"),this.Bo=a,this.xc(),this.g("smoothness",b,a))}},key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a&&a.model.Ei())return a.model.Gc(this.data)}}});S.prototype.invalidateOtherJumpOvers=S.prototype.jp;S.prototype.findClosestSegment=S.prototype.zz;S.prototype.updateRoute=S.prototype.Hg;S.prototype.invalidateRoute=S.prototype.ib;S.prototype.rollbackRoute=S.prototype.Gv; S.prototype.commitRoute=S.prototype.Lf;S.prototype.startRoute=S.prototype.Fh;S.prototype.clearPoints=S.prototype.Rj;S.prototype.removePoint=S.prototype.Ev;S.prototype.addPointAt=S.prototype.Kf;S.prototype.addPoint=S.prototype.ve;S.prototype.insertPointAt=S.prototype.m;S.prototype.insertPoint=S.prototype.dA;S.prototype.setPointAt=S.prototype.O;S.prototype.setPoint=S.prototype.kd;S.prototype.getPoint=S.prototype.i;S.prototype.getOtherPort=S.prototype.Wz;S.prototype.getOtherNode=S.prototype.fp; var dq=null,eq=null,Up=new F(S,"Normal",1),Cq=new F(S,"Orthogonal",2),Dq=new F(S,"AvoidsNodes",6),lq=new F(S,"AvoidsNodesStraight",7),lg=new F(S,"None",0),og=new F(S,"Bezier",9),kg=new F(S,"JumpGap",10),jg=new F(S,"JumpOver",11),Vp=new F(S,"End",17),Wp=new F(S,"Scale",18),Xp=new F(S,"Stretch",19),zn=new F(S,"OrientAlong",21),rn=new F(S,"OrientPlus90",22),tn=new F(S,"OrientMinus90",23),Yp=new F(S,"OrientOpposite",24),An=new F(S,"OrientUpright",25),sn=new F(S,"OrientPlus90Upright",26),un=new F(S,"OrientMinus90Upright", 27),vn=new F(S,"OrientUpright45",28),nq=16,mq=14,oq=8;S.className="Link";S.Normal=Up;S.Orthogonal=Cq;S.AvoidsNodes=Dq;S.AvoidsNodesStraight=lq;S.None=lg;S.Bezier=og;S.JumpGap=kg;S.JumpOver=jg;S.End=Vp;S.Scale=Wp;S.Stretch=Xp;S.OrientAlong=zn;S.OrientPlus90=rn;S.OrientMinus90=tn;S.OrientOpposite=Yp;S.OrientUpright=An;S.OrientPlus90Upright=sn;S.OrientMinus90Upright=un;S.OrientUpright45=vn;S.EndSegmentStep=8;S.CurvinessStart=nq;S.SpacingMin=mq;S.OrthoShortCut=oq; function Bq(a,b,c,d){Ya(this);this.Pe=this.Dq=!1;this.Qs=a;this.hy=b;this.rv=c;this.iy=d;this.links=[]}Bq.prototype.fm=function(){if(!this.Dq){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.Td=Math.floor((a.x-this.yc)/this.yc)*this.yc;this.Ud=Math.floor((b-this.zc)/this.zc)*this.zc;this.Qn=Math.ceil((c+2*this.yc)/this.yc)*this.yc;this.Rn=Math.ceil((d+2*this.zc)/this.zc)*this.zc;a=1+(Math.ceil((this.Qn-this.Td)/this.yc)|0);b=1+(Math.ceil((this.Rn-this.Ud)/this.zc)|0);if(null===this.gc||this.pi=tq&&(c[d]=Eq)} zk.prototype.ik=function(a,b,c,d){if(a>this.Qn||a+cthis.Rn||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.pi)|0;for(c=Math.min(b+e-1,this.ri)|0;a<=d;a++){e=this.gc[a];for(var f=b;f<=c;f++)if(e[f]===Ek)return!1}return!0}; function Fq(a,b,c,d,e,f,g,h,k){if(!(bg||ck)){var l=b|0;var m=c|0;var n=a.gc[l][m];if(n>=tq&&n=a.gc[l][m]);)a.gc[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0l;c+=d)Fq(a,b,c,1,!e,f,g,h,k),Fq(a,b,c,-1,!e,f,g,h,k);else if(0l;b+=d)Fq(a,b,c,1,!e,f,g,h,k),Fq(a,b,c,-1,!e,f,g,h, k)}}function Gq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=Ek,m=tq;for(a.gc[b][c]=m;l===Ek&&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.Td;n/=a.yc;d-=a.Ud;d/=a.zc;b-=a.Td;b/=a.yc;p-=a.Ud;p/=a.zc;f=Math.max(0,Math.min(a.pi,n|0));b=Math.min(a.pi,Math.max(0,b|0));n=Math.max(0,Math.min(a.ri,d|0));p=Math.min(a.ri,Math.max(0,p|0));d=a.gc;h|=0;k|=0;l|=0;m|= 0;var q=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===Ek?(Gq(a,h,k,q,c,f,b,n,p),Gq(a,h,k,1,!c,f,b,n,p),Gq(a,h,k,-1,!c,f,b,n,p)):Gq(a,h,k,q,c,h,k,h,k);d[l][m]===Ek?(Hq(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),Hq(a,l,m,1,!(90===e||270===e),f,b,n,p),Hq(a,l,m,-1,!(90===e||270===e),f,b,n,p)):Hq(a,l,m,q,c,l,m,l,m);c=Na();if(g&&Iq(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=tq;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===Jq)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!==Jq){g.push(k);g.push(l);if(Iq(a,k,l, m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=Jq;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++}}} oa.Object.defineProperties(zk.prototype,{bounds:{configurable:!0,get:function(){return new M(this.Td,this.Ud,this.Qn-this.Td,this.Rn-this.Ud)}},To:{configurable:!0,get:function(){return this.yc},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}jq.prototype.fm=function(){this.xe.length=0}; function kq(a,b){var c=a.xe;if(0===c.length){a:if(!a.op){c=a.op;a.op=!0;var d=null,e=a.node,f=e instanceof Df?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.Ix();else{if(!f.actualBounds.u()){a.op=c;break a}d=f;g=d.av()}f=a.xe.length=0;var h=a.port.la(Ac,K.alloc()),k=a.port.la(Nc,K.alloc());e=M.allocAt(h.x,h.y,0,0);e.lf(k);K.free(h);K.free(k);h=K.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.yi();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.Zd(d),n=l.computeSpot(m,a.port);if(n.fd()&&(m=m?l.toPort:l.fromPort,null!==m)){var p=m.part;if(null!==p){var q=p.findVisibleNode();null!==q&&q!==p&&(p=q,m=p.port);m=l.computeOtherPoint(p,m);p=h.gb(m);p-=k;0>p?p+=360:360<=p&&(p-=360);n=Kq(e,n,p,l.isOrthogonal);0===n?(n=4,180p&&(p+=360));q=a.xe[f];void 0===q?(q=new Lq(l,p,n),a.xe[f]=q):(q.link=l,q.angle=p,q.Tc= n);q.wv.set(m);f++}}}}K.free(h);a.xe.sort(jq.prototype.j);k=a.xe.length;d=-1;for(f=h=0;fMath.abs(u)?(z=Math.abs(u)/p,p=Math.abs(u)):z=1;break;case 2:q>Math.abs(A)?(z=Math.abs(A)/q,q=Math.abs(A)):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(A)?(z=Math.abs(A)/ m,m=Math.abs(A)):z=1}w=0}var H=C.mp;if(d===Rp){C=C.link.computeThickness();C*=z;H.set(E);switch(r){case 8:H.x=E.x+u/2+p/2-w-C/2;break;case 2:H.y=E.y+A/2+q/2-w-C/2;break;case 1:H.x=E.x+u/2-n/2+w+C/2;break;default:case 4:H.y=E.y+A/2-m/2+w+C/2}w+=C}else{var T=.5;d===Cp&&(T=(C.gp+1)/(C.Ul+1));H.x=E.x+u*T;H.y=E.y+A*T}}}K.free(h);K.free(k);K.free(g);K.free(l);E=a.xe;for(f=0;fb.Tc?1:a.angleb.angle?1:0}; jq.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,zc,b.fromPort===this.port),d=a.gp;if(0>d)return c;var e=a.Ul;if(1>=e||!b.isOrthogonal)return c;b=a.wv;var f=a.mp;if(2===a.Tc||8===a.Tc)d=e-1-d;return((a=2===a.Tc||4===a.Tc)?b.y=b-1?(f=0,d=c,e+=g+20,g=0):f++}}; Gi.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 S)&&(Oq(h),this.Ch(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof Df&&(h.Ch=!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++}}};Gi.prototype.Ch=function(a){return!a.location.u()||a instanceof Df&&a.Ch?!0:!1};function Nq(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 Df?null===k.layout?Nq(a,b,k.memberParts,!1,e,f,g,h):(Oq(k),b.add(k)):(Oq(k),b.add(k))):g&&k instanceof S?b.add(k):!h||!k.ed()||k instanceof V||(Oq(k),b.add(k)))}} function Oq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.$a()}Gi.prototype.Ai=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new M),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b}; Gi.prototype.vx=function(a){var b=new J;a instanceof Q?(Nq(this,b,a.nodes,!0,null,!0,!0,!0),Nq(this,b,a.links,!0,null,!0,!0,!0),Nq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof Df?Nq(this,b,a.memberParts,!1,null,!0,!0,!0):Nq(this,b,a.iterator,!1,null,!0,!0,!0);return b}; Gi.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.la(Ac),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a}; oa.Object.defineProperties(Gi.prototype,{diagram:{configurable:!0,get:function(){return this.H},set:function(a){null!==a&&x(a,Q,Gi,"diagram");this.H=a}},group:{configurable:!0,get:function(){return this.o},set:function(a){this.o!==a&&(null!==a&&x(a,Df,Gi,"group"),this.o=a,null!==a&&(this.H=a.diagram))}},isOngoing:{configurable:!0,get:function(){return this.En},set:function(a){this.En!==a&&(B(a,"boolean",Gi,"isOngoing"),this.En=a)}},isInitial:{configurable:!0, enumerable:!0,get:function(){return this.Sh},set:function(a){B(a,"boolean",Gi,"isInitial");this.Sh=a;a||(this.Jn=!0)}},isViewportSized:{configurable:!0,get:function(){return this.Kn},set:function(a){this.Kn!==a&&(B(a,"boolean",Gi,"isViewportSized"),(this.Kn=a)&&this.F())}},isRouting:{configurable:!0,get:function(){return this.Hn},set:function(a){this.Hn!==a&&(B(a,"boolean",Gi,"isRouting"),this.Hn=a)}},isRealtime:{configurable:!0,get:function(){return this.Gn}, set:function(a){this.Gn!==a&&(null!==a&&B(a,"boolean",Gi,"isRealtime"),this.Gn=a)}},isValidLayout:{configurable:!0,get:function(){return this.Jn},set:function(a){this.Jn!==a&&(B(a,"boolean",Gi,"isValidLayout"),this.Jn=a,a||(a=this.diagram,null!==a&&(a.Ih=!0)))}},network:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(null!==a&&x(a,Mq,Gi,"network"),this.j=a,null!==a&&(a.layout=this))}},boundsComputation:{configurable:!0,get:function(){return this.Rm}, set:function(a){this.Rm!==a&&(null!==a&&B(a,"function",Gi,"boundsComputation"),this.Rm=a,this.F())}},arrangementOrigin:{configurable:!0,get:function(){return this.Nm},set:function(a){x(a,K,Gi,"arrangementOrigin");this.Nm.D(a)||(this.Nm.assign(a),this.F())}}});Gi.prototype.collectParts=Gi.prototype.vx;Gi.prototype.getLayoutBounds=Gi.prototype.Ai;Gi.prototype.invalidateLayout=Gi.prototype.F;Gi.className="Layout"; function Mq(a){Ya(this);G&&!a&&v("LayoutNetwork constructor requires non-null Layout argument");this.Yc=a;this.If=new J;this.Ie=new J;this.Rs=new vb;this.Ms=new vb}Mq.prototype.clear=function(){if(this.If)for(var a=this.If.iterator;a.next();)a.value.clear();if(this.Ie)for(a=this.Ie.iterator;a.next();)a.value.clear();this.If=new J;this.Ie=new J;this.Rs=new vb;this.Ms=new vb}; Mq.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.If.count+" edges: "+this.Ie.count;if(1b?1:0):1:null!==b?-1:0} oa.Object.defineProperties(Pq.prototype,{sourceEdgesArrayAccess:{configurable:!0,get:function(){return this.Fg._dataArray}},destinationEdgesArrayAccess:{configurable:!0,get:function(){return this.yg._dataArray}},data:{configurable:!0,get:function(){return this.zb},set:function(a){this.zb=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.o.h(d/2,b/2);this.j.h(a,c,d,b)}}},node:{configurable:!0,get:function(){return this.di}, set:function(a){if(this.di!==a){G&&null!==a&&x(a,V,Pq,"node");this.di=a;a.$a();var b=this.network.layout,c=M.alloc(),d=b.Ai(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);M.free(c);if(!(a instanceof Df)&&(a=a.locationObject.la(Ic),a.u())){this.o.h(a.x-b,a.y-e);return}this.o.h(f/2,d/2)}}},bounds:{configurable:!0,get:function(){return this.j},set:function(a){this.j.D(a)||(G&&x(a,M,Pq,"bounds"),this.j.assign(a))}},focus:{configurable:!0, get:function(){return this.o},set:function(a){this.o.D(a)||(G&&x(a,K,Pq,"focus"),this.o.assign(a))}},centerX:{configurable:!0,get:function(){return this.j.x+this.o.x},set:function(a){var b=this.j;b.x+this.o.x!==a&&(G&&D(a,Pq,"centerX"),b.qa(),b.x=a-this.o.x,b.freeze())}},centerY:{configurable:!0,get:function(){return this.j.y+this.o.y},set:function(a){var b=this.j;b.y+this.o.y!==a&&(G&&D(a,Pq,"centerY"),b.qa(),b.y=a-this.o.y,b.freeze())}},focusX:{configurable:!0, get:function(){return this.o.x},set:function(a){var b=this.o;b.x!==a&&(b.qa(),b.x=a,b.freeze())}},focusY:{configurable:!0,get:function(){return this.o.y},set:function(a){var b=this.o;b.y!==a&&(b.qa(),b.y=a,b.freeze())}},x:{configurable:!0,get:function(){return this.j.x},set:function(a){var b=this.j;b.x!==a&&(b.qa(),b.x=a,b.freeze())}},y:{configurable:!0,get:function(){return this.j.y},set:function(a){var b=this.j;b.y!==a&&(b.qa(),b.y=a,b.freeze())}},width:{configurable:!0, enumerable:!0,get:function(){return this.j.width},set:function(a){var b=this.j;b.width!==a&&(b.qa(),b.width=a,b.freeze())}},height:{configurable:!0,get:function(){return this.j.height},set:function(a){var b=this.j;b.height!==a&&(b.qa(),b.height=a,b.freeze())}},network:{configurable:!0,get:function(){return this.ub},set:function(a){G&&x(a,Mq,Pq,"network");this.ub=a}},sourceVertexes:{configurable:!0,get:function(){for(var a=new J,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex); return a.iterator}},destinationVertexes:{configurable:!0,get:function(){for(var a=new J,b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{configurable:!0,get:function(){for(var a=new J,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:{configurable:!0,get:function(){return this.Fg.iterator}},destinationEdges:{configurable:!0, enumerable:!0,get:function(){return this.yg.iterator}},edges:{configurable:!0,get:function(){for(var a=new I,b=this.sourceEdges;b.next();)a.add(b.value);for(b=this.destinationEdges;b.next();)a.add(b.value);return a.iterator}},edgesCount:{configurable:!0,get:function(){return this.Fg.count+this.yg.count}}});Pq.prototype.deleteDestinationEdge=Pq.prototype.Xl;Pq.prototype.addDestinationEdge=Pq.prototype.Ml;Pq.prototype.deleteSourceEdge=Pq.prototype.Yl; Pq.prototype.addSourceEdge=Pq.prototype.Pl;Pq.className="LayoutVertex";Pq.standardComparer=Wq; Pq.smartComparer=function(a,b){G&&x(a,Pq,Pq,"smartComparer:m");G&&x(b,Pq,Pq,"smartComparer:n");if(null!==a){if(null!==b){a=a.di;var c=b.di;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.Ka("Layout");d=[];switch(this.alignment){case er:var h=b,k=c,l=M.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n= m=0;nf-1|| 0g)d.push(new M(0,u,g+h,w)),y=0,r=q,u+=w,w=0;w=Math.max(w,H);switch(p){case dr:C=-C.width;break;default:C=0}A.moveTo(r+C,u);switch(p){case dr:r-=E;break;default:r+=E}y++}d.push(new M(0,u,g+h,w));M.free(l);break;case Xq:k=g;m=f;n=b;p=c;g=M.alloc();q=Math.max(this.cellSize.width,1);f=u=l=0;h=K.alloc();for(r=0;r=l&&(k-=l);l=A=0;E=Math.max(this.cellSize.height,1);C=f=0;H=!0;y=K.alloc();for(T=0;Tm-1||0k){d.push(new M(0,H?z-f:z,k+n,C+f+p));for(aa=0;aal&&(f.width+=f.x-l,f.x=l);M.free(g)}for(h=f=g=e=0;hb?1:0} oa.Object.defineProperties(cl.prototype,{wrappingWidth:{configurable:!0,get:function(){return this.Lo},set:function(a){this.Lo!==a&&(B(a,"number",cl,"wrappingWidth"),0n)){var u=n+Jn(r);r.wc(u,!0);Vn(r,u,n)}}b.isModified=!0}}finally{b.da=!0}}}}};Ci.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Qa(a);for(b=this.nodes.iterator;b.next();)b.value.Qa(a);for(b=this.links.iterator;b.next();)b.value.Qa(a)}; Ci.prototype.Fp=function(){for(var a=this.H.model,b=new J,c=a.nodeDataArray,d=0;d=d)return"[]";var e=new ab;e.add("[");c&&1d)return;Ma(a.Nc,d)}Rr(a,"nodeDataArray",se,"nodeDataArray",a,b,null,d,null);a.Ep(b)}t.HA=function(a){if(Ha(a))for(var b=a.length,c=0;cb&&(b=a.length);Ka(a,b,c);Rr(this,"",re,"",a,null,c,null,b)}; t.Dv=function(a,b){void 0===b&&(b=-1);G&&(Ia(a,X,"removeArrayItem:arr"),D(b,X,"removeArrayItem:idx"));a===this.Nc&&v("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];Ma(a,b);Rr(this,"",se,"",a,c,null,b,null)};t.cp=function(a){if(null===a)return"";var b=this.yj;if(""===b)return"";b=Wn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForNodeData found a non-string category for "+a+": "+b)}; t.xm=function(a,b){B(b,"string",X,"setCategoryForNodeData:cat");if(null!==a){var c=this.yj;if(""!==c)if(this.hb(a)){var d=Wn(a,c);void 0===d&&(d="");d!==b&&(ik(a,c,b),Rr(this,"nodeCategory",pe,c,a,d,b))}else ik(a,c,b)}};t.zm=function(a,b){this.xm(b,this.cp(a))};t.gm=function(){return!1};t.hk=function(){return!1};t.Ei=function(){return!1};t.Ls=function(){return!1};t.Ci=function(){return!1};function Ei(){return new X} function Mr(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 Mr(a,b.constructor);return typeof b}function Pr(a){return Wr[a]?Wr[a]:void 0!==sa.go&&sa.go[a]?sa.go[a]:null}function Wn(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){G&&Fa("property get error: "+d.toString())}return c} function ik(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){G&&Fa("property set error: "+d.toString())}} oa.Object.defineProperties(X.prototype,{name:{configurable:!0,get:function(){return this.Ea},set:function(a){var b=this.Ea;b!==a&&(B(a,"string",X,"name"),this.Ea=a,this.g("name",b,a))}},dataFormat:{configurable:!0,get:function(){return this.en},set:function(a){var b=this.en;b!==a&&(B(a,"string",X,"dataFormat"),this.en=a,this.g("dataFormat",b,a))}},isReadOnly:{configurable:!0,get:function(){return this.Sg},set:function(a){var b=this.Sg;b!==a&&(B(a,"boolean", X,"isReadOnly"),this.Sg=a,this.g("isReadOnly",b,a))}},modelData:{configurable:!0,get:function(){return this.j},set:function(a){var b=this.j;b!==a&&(B(a,"object",X,"modelData"),this.j=a,this.g("modelData",b,a),this.Qa(a))}},undoManager:{configurable:!0,get:function(){return this.o},set:function(a){var b=this.o;b!==a&&(x(a,ue,X,"undoManager"),null!==b&&b.ky(this),this.o=a,null!==a&&a.ox(this))}},skipsUndoManager:{configurable:!0,get:function(){return this.hh}, set:function(a){B(a,"boolean",X,"skipsUndoManager");this.hh=a}},nodeKeyProperty:{configurable:!0,get:function(){return this.ei},set:function(a){var b=this.ei;b!==a&&(Sr(a,X,"nodeKeyProperty"),""===a&&v("Model.nodeKeyProperty may not be the empty string"),0d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===se){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;Ga(a)&&"number"===typeof c&&(d=this.Gc(a),b?(this.lg.add(a),this.sd[c]!==a&&this.sd.splice(c,0,a),void 0!==d&&this.Cb.add(d,a)):(this.lg.remove(a),this.sd[c]=== a&&this.sd.splice(c,1),void 0!==d&&this.Cb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.Qf(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}}X.prototype.changeState.call(this,a,b)}};t=Yr.prototype;t.im=function(a){if(void 0!==a){var b=this.dj;if(null!==b){var c=this.nc(a);null===c&&(c=this.copyNodeData(b),ik(c,this.nodeKeyProperty,a),this.Jf(c))}return a}}; t.Px=function(a){return sr(this,a,!0)};t.Lv=function(a,b){Ar(this,a,b,!0)};t.Sx=function(a){return sr(this,a,!1)};t.Qv=function(a,b){Ar(this,a,b,!1)};function sr(a,b,c){if(null!==b&&(a=c?a.yf:a.zf,""!==a&&(a=Wn(b,a),void 0!==a))){if(ur(a))return a;v((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}} function Ar(a,b,c,d){null===c&&(c=void 0);void 0===c||ur(c)||Aa(c,"number or string",Yr,d?"setFromKeyForLinkData:key":"setToKeyForLinkData:key");if(null!==b){var e=d?a.yf:a.zf;if(""!==e)if(c=a.im(c),a.Qc(b)){var f=Wn(b,e);f!==c&&(yr(a,f,b),ik(b,e,c),null===a.nc(c)&&zr(a,c,b),Rr(a,d?"linkFromKey":"linkToKey",pe,e,b,f,c),"string"===typeof e&&a.Qa(b,e))}else ik(b,e,c)}}t.Qx=function(a){return rr(this,a,!0)};t.Mv=function(a,b){Br(this,a,b,!0)};t.Tx=function(a){return rr(this,a,!1)}; t.Rv=function(a,b){Br(this,a,b,!1)};function rr(a,b,c){if(null===b)return"";a=c?a.rj:a.sj;if(""===a)return"";b=Wn(b,a);return void 0===b?"":b}function Br(a,b,c,d){B(c,"string",Yr,d?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname");if(null!==b){var e=d?a.rj:a.sj;if(""!==e)if(a.Qc(b)){var f=Wn(b,e);void 0===f&&(f="");f!==c&&(ik(b,e,c),Rr(a,d?"linkFromPortId":"linkToPortId",pe,e,b,f,c),"string"===typeof e&&a.Qa(b,e))}else ik(b,e,c)}} t.Qf=function(a){if(null===a)return as;var b=this.pe;if(""===b)return as;a=Wn(a,b);return void 0===a?as:a};t.Ys=function(a,b){Ia(b,Yr,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.pe;if(""!==c)if(this.Qc(a)){var d=Wn(a,c);void 0===d&&(d=as);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;fe||(d.splice(e,1),this.Qc(a)&&(yr(this,b,a),Rr(this,"linkLabelKeys",se,c,a,b,null,e,null)))}else void 0!==d&&v(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}}; t.Gc=function(a){if(null!==a){var b=this.Vh;if(""!==b&&(b=Wn(a,b),void 0!==b)){if(ur(b))return b;v("Key value for link data "+a+" is not a number or a string: "+b)}}};t.Xs=function(a,b){void 0!==b&&null!==b&&ur(b)||Aa(b,"number or string",Yr,"setKeyForLinkData:key");if(null!==a){var c=this.Vh;if(""!==c)if(this.Qc(a)){var d=Wn(a,c);d!==b&&null===this.uh(b)&&(ik(a,c,b),void 0!==d&&this.Cb.remove(d),this.Cb.add(b,a),Rr(this,"linkKey",pe,c,a,d,b),"string"===typeof c&&this.Qa(a,c))}else ik(a,c,b)}}; t.uh=function(a){null===a&&v("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&ur(a)?this.Cb.L(a):null}; t.Os=function(a){if(null!==a){var b=this.Vh;if(""!==b){var c=this.Gc(a);if(void 0===c||this.Cb.contains(c)){var d=this.ol;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.Cb.contains(c))){ik(a,b,c);return}if("string"===typeof c){for(d=2;this.Cb.contains(c+d);)d++;ik(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.Cb.count-1;this.Cb.contains(c);)c--;ik(a,b,c)}else G&&v("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+c)}}}}; t.Qc=function(a){return null===a?!1:this.lg.contains(a)};t.si=function(a){null!==a&&(mb(a),this.Qc(a)||wr(this,a,!0))};function wr(a,b,c){if(""!==a.linkKeyProperty){var d=a.Gc(b);if(void 0!==d&&a.Cb.L(d)===b)return;a.Os(b);d=a.Gc(b);void 0===d&&v("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");a.Cb.add(d,b)}a.lg.add(b);d=null;c&&(d=a.sd.length,a.sd.splice(d,0,b));Rr(a,"linkDataArray",re,"linkDataArray",a,null,b,null,d);bs(a,b)} t.Vy=function(a){if(Array.isArray(a))for(var b=a.length,c=0;cd)return;a.sd.splice(d,1)}Rr(a,"linkDataArray",se,"linkDataArray",a,b,null,d,null);c=sr(a,b,!0);yr(a,c,b);c=sr(a,b,!1);yr(a,c,b);d=a.Qf(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 I;b.addAll(a.iterator);a=new I;var c=new I;var d=this.sort(b);var e,f,g=this.Wp;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===ss&&k===ts?h=es:h===ss&&k!==ts&&(h=this.arrangement);if((this.direction===ns||this.direction===os)&&this.sorting!==hs){for(k=0;!(k>=d.length);k+=2){a.add(d.P(k));if(k+1>=d.length)break;c.add(d.P(k+1))}this.direction===ns?(this.arrangement===ss&&a.reverse(),d=new I,d.addAll(a), d.addAll(c)):(this.arrangement===ss&&c.reverse(),d=new I,d.addAll(c),d.addAll(a))}k=d.length;for(var q=f=e=0;qp&&(0===q||q===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===ss){isNaN(b)&&(b=6);if(h!==es&&h!==ss){f=-Infinity;for(g=0;gl?(l=e,f=l*m):g=q/(360<=p?k:k-1)}this.zw=h;this.sc=l;this.mn=m;this.Aw=n;this.jq=p;this.fj=b;this.ue=f;this.Wp=g;b=d;d=this.zw;h=this.sc;l=this.Aw;m=this.jq;n=this.fj;p=this.ue;k=this.Wp;if(this.direction!==ns&&this.direction!==os||d!==ss)if(this.direction===ns||this.direction===os){g=0;switch(d){case rs:g=180*ys(this,h,p,l,k)/Math.PI;break;case es:k=b=0;g=a.first();null!==g&&(b=vs(g,Math.PI/2));g=c.first(); null!==g&&(k=vs(g,Math.PI/2));g=180*ys(this,h,p,l,n+(b+k)/2)/Math.PI;break;case qs:g=m/b.length}if(this.direction===ns){switch(d){case rs:zs(this,a,l,ps);break;case es:As(this,a,l,ps);break;case qs:Bs(this,a,m/2,l,ps)}switch(d){case rs:zs(this,c,l+g,gs);break;case es:As(this,c,l+g,gs);break;case qs:Bs(this,c,m/2,l+g,gs)}}else{switch(d){case rs:zs(this,c,l,ps);break;case es:As(this,c,l,ps);break;case qs:Bs(this,c,m/2,l,ps)}switch(d){case rs:zs(this,a,l+g,gs);break;case es:As(this,a,l+g,gs);break;case qs:Bs(this, a,m/2,l+g,gs)}}}else switch(d){case rs:zs(this,b,l,this.direction);break;case es:As(this,b,l,this.direction);break;case qs:Bs(this,b,m,l,this.direction);break;case ss:Cs(this,b,m,l,this.direction)}else Cs(this,b,m,l-m/2,gs)}this.updateParts();this.network=null;this.isValidLayout=!0}; function Bs(a,b,c,d,e){var f=a.jq,g=a.sc;a=a.ue;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;kc){for(f=d+(e===gs?f:-f);0>f;)f+=360;f%=360;180=m.length-1)break;Fs(a,k,l,m,n,e,f)||Gs(a,k,l,m,n,e,f);k=f.x;l=f.y}K.free(f);a.zj++;if(!(23Math.abs(q)?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.zj?a.sc-g/(2*Math.PI):5>m.length&&10=n.length-1)break;Fs(a,k,l,n,p,e,m)||Gs(a,k,l,n,p,e,m);k=m.x;l=m.y}K.free(m);a.zj++;if(!(23a.zj?a.sc-f/(2*Math.PI):a.sc-(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 Gs(a,b,c,d,e,f,g){var h=a.sc,k=a.ue,l=0;a=(d[e].height+d[e+1].height)/2+a.fj;d=!1;if(0<=b!==(f===gs)){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}ds.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()}; ds.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 K(0,0):(c.x=this.arrangementOrigin.x+this.sc,c.y=this.arrangementOrigin.y+this.ue);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.$a(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.ze(c.ze(a)),this.group.move(b),this.nw=b.ze(a))}; ds.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function xs(a,b,c,d,e){var f=a.Ky;if(.001>Math.abs(a.mn-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 ws(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?xs(a,1,c,d,e):xs(a,1,c))}function ys(a,b,c,d,e){if(.001>Math.abs(a.mn-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}} ds.prototype.sort=function(a){switch(this.sorting){case ls:break;case ms:a.reverse();break;case js:a.sort(this.comparer);break;case ks:a.sort(this.comparer);a.reverse();break;case hs:return this.lk(Hs(a));default:v("Invalid sorting type.")}return a}; function Hs(a){for(var b=[],c=0;ce&&(e=h,f=g)}else for(g=0;ge&&(e=h,f=g);c.add(a.P(f));b[f]=-1;f=a.P(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} ds.prototype.lk=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[r]].indexOf(c[r===c.length-1?0:r+1])&&q.push(r===c.length-1?0:r+1);if(0===q.length)for(r=0;rc.indexOf(H)||Ec.indexOf(H)||E=u?E+1:E)),w+=E=u&&E++,A>=u&&A++,E>A&&(C=A,A=E,E=C),A-E<(c.length+2)/2===(Eq||q===m||(r=q>m?q-m:m-q,n+=qg-r?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.Hl=a:this.Hl=360,this.F())}},arrangement:{configurable:!0,get:function(){return this.Yb},set:function(a){this.Yb!==a&&($a(a,ds,ds,"arrangement"),a===ss||a===es||a===rs||a===qs)&&(this.Yb=a,this.F())}},direction:{configurable:!0,get:function(){return this.N},set:function(a){this.N!==a&&($a(a,ds,ds,"direction"), a===gs||a===ps||a===ns||a===os)&&(this.N=a,this.F())}},sorting:{configurable:!0,get:function(){return this.td},set:function(a){this.td!==a&&($a(a,ds,ds,"sorting"),a===ls||a===ms||a===js||ks||a===hs)&&(this.td=a,this.F())}},comparer:{configurable:!0,get:function(){return this.od},set:function(a){this.od!==a&&(B(a,"function",ds,"comparer"),this.od=a,this.F())}},spacing:{configurable:!0,get:function(){return this.Ff},set:function(a){this.Ff!==a&&(B(a,"number", ds,"spacing"),this.Ff=a,this.F())}},nodeDiameterFormula:{configurable:!0,get:function(){return this.Zn},set:function(a){this.Zn!==a&&($a(a,ds,ds,"nodeDiameterFormula"),a===is||a===ts)&&(this.Zn=a,this.F())}},actualXRadius:{configurable:!0,get:function(){return this.sc}},actualYRadius:{configurable:!0,get:function(){return this.ue}},actualSpacing:{configurable:!0,get:function(){return this.fj}},actualCenter:{configurable:!0,get:function(){return this.nw}}}); var es=new F(ds,"ConstantSpacing",0),rs=new F(ds,"ConstantDistance",1),qs=new F(ds,"ConstantAngle",2),ss=new F(ds,"Packed",3),gs=new F(ds,"Clockwise",4),ps=new F(ds,"Counterclockwise",5),ns=new F(ds,"BidirectionalLeft",6),os=new F(ds,"BidirectionalRight",7),ls=new F(ds,"Forwards",8),ms=new F(ds,"Reverse",9),js=new F(ds,"Ascending",10),ks=new F(ds,"Descending",11),hs=new F(ds,"Optimized",12),is=new F(ds,"Pythagorean",13),ts=new F(ds,"Circular",14);ds.className="CircularLayout";ds.ConstantSpacing=es; ds.ConstantDistance=rs;ds.ConstantAngle=qs;ds.Packed=ss;ds.Clockwise=gs;ds.Counterclockwise=ps;ds.BidirectionalLeft=ns;ds.BidirectionalRight=os;ds.Forwards=ls;ds.Reverse=ms;ds.Ascending=js;ds.Descending=ks;ds.Optimized=hs;ds.Pythagorean=is;ds.Circular=ts;function fs(){this.cm=-Infinity;this.Gm=this.zk=null} fs.prototype.compare=function(a,b){if(0this.cm||Math.abs(a)a&&0h?(e=p.x+p.width/2,f=p.y+ p.height/2,l[0]=new K(p.x+p.width+d.width,p.y),l[1]=new K(p.x,p.y+p.height+d.height),h=2):(k=Ns(l,h,e,f,p.width,p.height,d),n=l[k],q=new K(n.x+p.width+d.width,n.y),p=new K(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.dd(c)&&(a++,2a.network.vertexes.count)return!1;a.mh=a.network.vertexes.La();a=a.mh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.ae-a.ae});for(b=a.length-1;0<=b&&1>=a[b].ae;)b--;return 1=g))){for(var l=h=0,m=k.count-g;mq&&(q=1);h=L.sqrt((h+q+l*l*4/(g*g))/q);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new M(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new K(p.x+g,p.y+h)}}a.network=d;return c} function Ss(a,b,c){G&&(x(b,Ls,Ks,"popNetwork:oldnet"),D(c,Ks,"popNetwork:level"));for(c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.jf){var e=d.jf.P(d.Hv);d.ae=e.dt;var f=e.gw,g=e.hw;d.bounds=new M(d.centerX-f,d.centerY-g,e.et,e.ct);d.focus=new K(f,g);d.Hv--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b} function Ts(a,b,c){G&&(x(b,Vs,Ks,"surroundNode:oldnet"),D(c,Ks,"surroundNode:level"));var d=b.Tj;if(null!==d&&0!==d.count){c=b.centerX;var e=b.centerY,f=b.width,g=b.height;null!==b.jf&&0=n.ae?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=c+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}} function Ns(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,L.sqrt(c*c+a*a)):a+cg+h?a>b+f?(c=d-g-h,a=a-b-f,L.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.kg;var l=d=h=0;for(f= 0;fc||l-k>c){if(e)break}else if(m-q>c||q-m>c){if(!e)break}else{var r=Ws(g,p);1>r?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Ys),r=d.random(), h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*r):kq?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):kn?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Ys),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}Ks.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};Ks.prototype.moveFixedVertex=function(){};Ks.prototype.commitLayout=function(){this.Nv();this.commitNodes();this.isRouting&&this.commitLinks()}; Ks.prototype.Nv=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=gd,b.toSpot=gd)}};Ks.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=M.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;M.free(c)}c=M.alloc();for(var d=this.network.vertexes.iterator;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.bounds),c.x+=a,c.y+=b,e.bounds=c;e.commit()}M.free(c)}; Ks.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};Ks.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Tk:a};Ks.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Sk:a};Ks.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Qk:a};Ks.prototype.electricalFieldX=function(){return 0};Ks.prototype.electricalFieldY=function(){return 0}; Ks.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Rk:a};Ks.prototype.gravitationalFieldX=function(){return 0};Ks.prototype.gravitationalFieldY=function(){return 0};Ks.prototype.isFixed=function(a){return a.isFixed}; oa.Object.defineProperties(Ks.prototype,{currentIteration:{configurable:!0,get:function(){return this.Mn}},arrangementSpacing:{configurable:!0,get:function(){return this.fe},set:function(a){x(a,Gb,Ks,"arrangementSpacing");this.fe.D(a)||(this.fe.assign(a),this.F())}},arrangesToOrigin:{configurable:!0,get:function(){return this.Om},set:function(a){this.Om!==a&&(B(a,"boolean",Ks,"arrangesToOrigin"),this.Om=a,this.F())}},setsPortSpots:{configurable:!0, get:function(){return this.Ef},set:function(a){this.Ef!==a&&(B(a,"boolean",Ks,"setsPortSpots"),this.Ef=a,this.F())}},comments:{configurable:!0,get:function(){return this.zd},set:function(a){this.zd!==a&&(B(a,"boolean",Ks,"comments"),this.zd=a,this.F())}},maxIterations:{configurable:!0,get:function(){return this.pl},set:function(a){this.pl!==a&&(B(a,"number",Ks,"maxIterations"),0<=a&&(this.pl=a,this.F()))}},epsilonDistance:{configurable:!0,get:function(){return this.nn}, set:function(a){this.nn!==a&&(B(a,"number",Ks,"epsilonDistance"),0w&&0w&&0a[this.Sd]&&(this.Vq=a[c]-1,this.Sd=c),a[c]u||l===u&&p>r)&&h++;yl||u===l&&r>p)&&h++}}}}}if(0>=c)for(n=d[g].destinationEdgesArrayAccess,k=0;ku||l===u&&q>y)&&h++,rl||u===l&&y>q)&&h++);f[g*e+g]=h;for(h= g+1;h=c)for(n=d[g].destinationEdgesArrayAccess,A=d[h].destinationEdgesArrayAccess,k=0;k=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)}kt(a,b,d);return f} function st(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&&st(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&&st(a,k,c,d,e,f)}} function tt(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)tt(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)tt(a,b.value.fromVertex,c,d,e,f)}} $s.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.Pk){default:case ut: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!==vt(a);){for(e=wt(a);null!==e;)d[c]=e,c--,e.valid=!1,e=wt(a);for(e=xt(a);null!==e;)d[b]=e,b++,e.valid=!1,e=xt(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.um(b),b.rev=!0);break;case at:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.Zl=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Wn=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&& yt(this,b);for(d.reset();d.next();)b=d.value,-1===b.Zl&&yt(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.Zld){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&&st(a,h,0,-1,!0,!1)}for(st(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 q=0;qf)&&!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 ht(a,b,c){return 90===a.N?c&&!b.rev||!c&&b.rev?270:90:180===a.N?c&&!b.rev||!c&&b.rev?0:180:270===a.N?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}function it(a,b,c){for(var d=c[c.length-1].sourceEdges.iterator;d.next();){var e=d.value;if(!e.rev&&e.valid){e=e.fromVertex;c.push(e);if(e===b||it(a,b,c))return!0;c.pop()}}return!1} $s.prototype.initializeIndices=function(){switch(this.bl){default:case Ft:Gt(this);break;case ct:var a=null,b=this.network.vertexes.iterator;if(this._experimental)for(;b.next();){var c=b.value;if(c.near&&(null===a&&(a=new vb),c.layer===c.near.layer)){var d=a.get(c.near)||[];d.push(c);a.set(c.near,d)}}for(c=this.Oa;0<=c;c--)for(b.reset();b.next();)d=b.value,d.layer===c&&-1===d.index&&Ht(this,d,a);break;case It:a=null;b=this.network.vertexes.iterator;if(this._experimental)for(;b.next();)c=b.value,c.near&& (null===a&&(a=new vb),c.layer===c.near.layer&&(d=a.get(c.near)||[],d.push(c),a.set(c.near,d)));for(c=0;c<=this.Oa;c++)for(b.reset();b.next();)d=b.value,d.layer===c&&-1===d.index&&Jt(this,d,a)}}; function Gt(a){var b=null,c=a.network.vertexes.iterator;if(a._experimental){for(;c.next();){var d=c.value;if(d.near&&(null===b&&(b=new vb),d.layer===d.near.layer)){var e=b.get(d.near)||[];e.push(d);b.set(d.near,e)}}c.reset()}for(d={};c.next();)e=c.value,b&&e.near||(d.layer=e.layer,e.index=a.Ab[d.layer],a.Ab[d.layer]++,b&&(e=b.get(e),Array.isArray(e)&&e.forEach(function(b){return function(c){c.index=a.Ab[b.layer];a.Ab[b.layer]++}}(d)))),d={layer:d.layer}} function Ht(a,b,c){if(!c||!b.near){var d=b.layer;b.index=a.Ab[d];a.Ab[d]++;if(c){var e=c.get(b);Array.isArray(e)&&e.forEach(function(b){b.index=a.Ab[d];a.Ab[d]++})}b=b.destinationEdgesArrayAccess;for(e=!0;e;){e=!1;for(var f=0;fh.portFromColOffset&&(e=!0,b[f]=h,b[f+1]=g)}}for(e=0;eh.portToColOffset&&(f=!0,b[e]=h,b[e+1]=g)}for(e=0;e=g;d--)f=Lt(this,d,-1)||f;e=this.countCrossings();e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Lt(this,d,1)||f;e=this.countCrossings();e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Lt(this,d,1)||f;e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f= Lt(this,d,-1)||f;e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Lt(this,d,0)||f;e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Lt(this,d,0)||f;e>=a?nt(this,b):(a=e,b=mt(this))}break;default:case dt:for(c=this.Oa,g=0,h=a+1;(d=this.countCrossings())=g;d--)f=Lt(this,d,-1)||f;e=this.countCrossings();e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Lt(this,d,1)||f;e=this.countCrossings();e>=a?nt(this,b): (a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Lt(this,d,1)||f;e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Lt(this,d,-1)||f;e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Lt(this,d,0)||f;e>=a?nt(this,b):(a=e,b=mt(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Lt(this,d,0)||f;e>=a?nt(this,b):(a=e,b=mt(this))}}nt(this,b)}; function Kt(a,b,c){G&&(D(b,$s,"medianBarycenterCrossingReduction:unfixedLayer"),D(c,$s,"medianBarycenterCrossingReduction:direction"));var d=jt(a,b),e=a.Ab[b],f=rt(a,b,c),g=qt(a,b,c);for(c=0;cf+1&&(p+=4*(z-f),q+=4*(z-(f+1)))}C=d[f].destinationEdges.iterator;for(C.reset();C.next();)if(z=C.value,A=z.toVertex,z.valid&&A.layer===b){for(z=0;zf+1&&(p+=4*(z-(f+1)),q+= 4*(z-f))}C=d[f+1].destinationEdges.iterator;for(C.reset();C.next();)if(z=C.value,A=z.toVertex,z.valid&&A.layer===b){for(z=0;z>1)+8*d;this.Wa*=8}if(0!==(this.ng&2))for(c=!0,d=0;c&&dc)for(d=0;dd-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?q=m-1:q=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var r=p=0,u= 0;if(0>=c)for(var y=e[d].sourceEdges.iterator;y.next();){var w=y.value;var z=w.fromVertex;if(w.valid&&z.layer!==b){var A=lt(w);var C=w.portFromColOffset;w=w.portToColOffset;z=z.column;p+=(Math.abs(m+w-(z+C))+1)*A;r+=(Math.abs(q+w-(z+C))+1)*A;u+=(Math.abs(n+w-(z+C))+1)*A}}if(0<=c)for(y=e[d].destinationEdges.iterator;y.next();)w=y.value,z=w.toVertex,w.valid&&z.layer!==b&&(A=lt(w),C=w.portFromColOffset,w=w.portToColOffset,z=z.column,p+=(Math.abs(m+C-(z+w))+1)*A,r+=(Math.abs(q+C-(z+w))+1)*A,u+=(Math.abs(n+ C-(z+w))+1)*A);w=C=A=0;y=g[e[d].index];z=h[e[d].index];-1!==y&&(A+=Math.abs(y-m),C+=Math.abs(y-q),w+=Math.abs(y-n));-1!==z&&(A+=Math.abs(z-m),C+=Math.abs(z-q),w+=Math.abs(z-n));if(r=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}kt(a,b, d);a.normalize()}function Ut(a,b){G&&(D(b,$s,"packAux:column"),D(1,$s,"packAux:direction"));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 Vt(a,b){G&&(D(b,$s,"tightPackAux:column"),D(1,$s,"tightPackAux:direction"));var c=b+1;var d,e=[],f=[];for(d=0;d<=a.Oa;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.Oa;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 Rt(a,b){G&&D(b,$s,"componentPack:direction");for(var c=0;c<=a.Wa;c++)for(;Ut(a,c););a.normalize();for(c=0;cf?nt(a,e):gb)for(c=a.Wa;0<=c;c--)for(e=mt(a),f=pt(a),d=f+1;ff?nt(a,e):gc)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.re);a.re++;for(d.reset();d.next();)b=d.value,-1===b.component&&(tt(a,b,a.re,-1,!0,!0),a.re++);var f;b=[];for(f=0;fc)for(g=a.Wa;0c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)} function St(a){for(var b=Na(),c=a.rl.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 J;Xt(b,c);var f=null,g=null,h=null,k=null,l=0!==(a.Ee&1),m=0!==(a.Ee&2),n=0!==(a.Ee&4),p=0!==(a.Ee&8);l&&(a.verticalAlignment(b,c,!0),f=Yt(a,b,!0,!1));b.reverse();n&&(a.verticalAlignment(b,c,!1),h=Yt(a,b,!1,!1));d=ca(b);for(e=d.next();!e.done;e=d.next())e.value.reverse();p&&(a.verticalAlignment(b,c,!1),k=Yt(a,b,!1,!0));b.reverse();m&&(a.verticalAlignment(b, c,!0),g=Yt(a,b,!0,!0));Pa(b);a.v(f,g,h,k);a.network.vertexes.each(function(a){var b=Na();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;Pa(b);a.Fc=c})} function Xt(a,b){for(var c=a.length,d=1;dm)&&b.add(n);f++}e= m}}}$s.prototype.verticalAlignment=function(a,b,c){$t(a);a=ca(a);for(var d=a.next();!d.done;d=a.next()){var e=-1;d=ca(d.value);for(var f=d.next();!f.done;f=d.next()){f=f.value;var g=c?Zt(f):au(f),h=g.length;if(0=b[c].length)&&(g=b[c][0],g.yd===g)){Infinity===g.yd.shift&&(g.yd.shift=0);g=c;h=0;do{for(f=b[g][h];f.align!==f.root;)f=f.align,g++,0a&&v("Could not determine previous vertex in layer");return b[c][a-1]} $s.prototype.v=function(a){for(var b=[],c=0;cg;g++)if(b[g]){var h=eu(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)));Pa(d);Pa(e)}; function eu(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.N||270===a.N?c.width:c.height;bg&&(g=b+c)});c[e]=f;d[e]=g;return g-f}$s.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=gt(this,!0),b=gt(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.Uu();this.isRouting&&this.commitLinks()}; function gt(a,b){return 270===a.N?b?ld:od:90===a.N?b?od:ld:180===a.N?b?md:nd:b?nd:md} $s.prototype.commitNodes=function(){this.ne=[];this.Rd=[];this.Qd=[];this.Ya=[];for(var a=0;a<=this.Oa;a++)this.ne[a]=0,this.Rd[a]=0,this.Qd[a]=0,this.Ya[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.ne[c]=Math.max(this.ne[c],this.nodeMinLayerSpace(b,!0));this.Rd[c]=Math.max(this.Rd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.oe;for(var d=0;d<=this.Oa;d++){var e=c;0>=this.ne[d]+this.Rd[d]&&(e=0);0=n.bounds.bottom?(n=n.bounds.y+ n.bounds.height,b.m(u++,C,n+H),b.m(u++,C,n),b.m(u++,C,n-A)):(b.m(u++,C,E+H),b.m(u++,C,E),b.m(u++,C,E-A)):270===this.N?E<=n.bounds.y?(n=n.bounds.y,b.m(u++,C,n-A),b.m(u++,C,n),b.m(u++,C,n+H)):(b.m(u++,C,E-A),b.m(u++,C,E),b.m(u++,C,E+H)):0===this.N&&(C>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.m(u++,n+H,E),b.m(u++,n,E),b.m(u++,n-A,E)):(b.m(u++,C+H,E),b.m(u++,C,E),b.m(u++,C-A,E)));else{b.m(u++,w,z);var T=0;if(180===this.N||0===this.N){if(180===this.N?C>=n.bounds.right:C<=n.bounds.x)T=(0===this.N? -A:H)/2;b.m(u++,w+T,E)}else{if(270===this.N?E>=n.bounds.bottom:E<=n.bounds.y)T=(90===this.N?-A:H)/2;b.m(u++,C,z+T)}b.m(u++,C,E)}}else A=Math.max(10,this.ne[y.layer]),H=Math.max(10,this.Rd[y.layer]),p?180===this.N?(b.m(u++,C-A-r,E),b.m(u++,Math.min(C-A+r/2,C),E),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,Math.max(C+H-r/2,C),E),b.m(u++,C+H+r,E)):90===this.N?(b.m(u++,C,E+H+r),b.m(u++,C,Math.max(E+H-r/2,E)),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,C,Math.min(E-A+r/2,E)),b.m(u++,C,E-A-r)):270===this.N?(b.m(u++,C,E-A- r),b.m(u++,C,Math.min(E-A+r/2,E)),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,C,Math.max(E+H-r/2,E)),b.m(u++,C,E+H+r)):(b.m(u++,C+H+r,E),b.m(u++,Math.max(C+H-r/2,C),E),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,Math.min(C-A+r/2,C),E),b.m(u++,C-A-r,E)):b.m(u++,C,E)}n=y}if(null===h||l!==zc||q)if(w=b.i(u-1).x,z=b.i(u-1).y,C=b.i(u).x,E=b.i(u).y,q)r=this.Rd[m.layer],180===this.N||0===this.N?(q=z,q>=m.bounds.y&&q<=m.bounds.bottom&&(180===this.N?C>=m.bounds.x:C<=m.bounds.right)&&(n=m.centerX+(180===this.N?-r:r),q=m.bounds.x&&q<=m.bounds.right&&(270===this.N?E>=m.bounds.y:E<=m.bounds.bottom)&&(n=m.centerY+(270===this.N?-r:r),q=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.O(u- 2,n,z),b.O(u-1,n+H,z)):90===this.N&&E<=m.bounds.bottom?(n=m.bounds.y,b.O(u-2,w,n),b.O(u-1,w,n-A)):270===this.N&&E>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.O(u-2,w,n),b.O(u-1,w,n+H)):0===this.N&&C<=m.bounds.right&&(n=m.bounds.x,b.O(u-2,n,z),b.O(u-1,n-A,z));else{A=Math.max(10,this.ne[m.layer]);H=Math.max(10,this.Rd[m.layer]);q=0;if(180===this.N||0===this.N){if(180===this.N?C<=m.bounds.x:C>=m.bounds.right)q=(0===this.N?H:-A)/2;b.m(u++,C+q,z)}else{if(270===this.N?E<=m.bounds.y:E>=m.bounds.bottom)q= (90===this.N?H:-A)/2;b.m(u++,w,E+q)}b.m(u++,C,E)}}else{for(;null!==m&&m!==n;){A=y=null;for(m=m.destinationEdges.iterator;m.next()&&(w=m.value,w.link!==c.link||(y=w.toVertex,A=w.fromVertex,null!==A.node&&(A=null),null!==y.node)););if(null===y)break;y!==n&&(w=b.i(u-1).x,z=b.i(u-1).y,C=y.centerX,E=y.centerY,q?180===this.N||0===this.N?(null!==A?A.centerY:z)!==E&&(A=this.Ya[y.layer]+this.cg.x,u===b.firstPickIndex+1&&(A=0===this.N?Math.max(A,w):Math.min(A,w)),b.m(u++,A,z),b.m(u++,A,E)):(null!==A?A.centerX: w)!==C&&(A=this.Ya[y.layer]+this.cg.y,u===b.firstPickIndex+1&&(A=90===this.N?Math.max(A,z):Math.min(A,z)),b.m(u++,w,A),b.m(u++,C,A)):(A=Math.max(10,this.ne[y.layer]),H=Math.max(10,this.Rd[y.layer]),p?180===this.N?(b.m(u++,C+H+r,E),b.m(u++,Math.max(C+H-r/2,C),E),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,Math.min(C-A+r/2,C),E),b.m(u++,C-A-r,E)):90===this.N?(b.m(u++,C,E-A-r),b.m(u++,C,Math.min(E-A+r/2,E)),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,C,Math.max(E+H-r/2,E)),b.m(u++,C,E+H+r)):270===this.N?(b.m(u++,C,E+H+ r),b.m(u++,C,Math.max(E+H-r/2,E)),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,C,Math.min(E-A+r/2,E)),b.m(u++,C,E-A-r)):(b.m(u++,C-A-r,E),b.m(u++,Math.min(C-A+r/2,C),E),b.m(u++,C,E),b.m(u++,C,E),b.m(u++,Math.max(C+H-r/2,C),E),b.m(u++,C+H+r,E)):180===this.N?(b.m(u++,C+H,E),b.m(u++,C-A,E)):90===this.N?(b.m(u++,C,E-A),b.m(u++,C,E+H)):270===this.N?(b.m(u++,C,E+H),b.m(u++,C,E-A)):(b.m(u++,C-A,E),b.m(u++,C+H,E))));m=y}q&&(w=b.i(u-1).x,z=b.i(u-1).y,C=b.i(u).x,E=b.i(u).y,180===this.N||0===this.N?z!==E&&(A=0===this.N? Math.min(Math.max((C+w)/2,this.Ya[n.layer]+this.cg.x),C):Math.max(Math.min((C+w)/2,this.Ya[n.layer]+this.cg.x),C),b.m(u++,A,z),b.m(u++,A,E)):w!==C&&(A=90===this.N?Math.min(Math.max((E+z)/2,this.Ya[n.layer]+this.cg.y),E):Math.max(Math.min((E+z)/2,this.Ya[n.layer]+this.cg.y),E),b.m(u++,w,A),b.m(u++,C,A)))}null!==d&&p&&4<=b.pointsCount&&(null!==g&&(g=l===zc?b.getLinkPointFromPoint(e,g,g.la(Ic),b.i(3),!0):b.i(0),l===zc&&(l=b.i(2),d=b.i(3),90===this.direction||270===this.direction?(b.O(1,(g.x+l.x)/2,l.y), b.O(2,d.x,(l.y+d.y)/2)):(b.O(1,l.x,(g.y+l.y)/2),b.O(2,(l.x+d.x)/2,d.y))),g.u()||g.set(e.actualBounds.center),b.O(0,g.x,g.y)),null!==h&&(e=k===zc?b.getLinkPointFromPoint(f,h,h.la(Ic),b.i(b.pointsCount-4),!1):b.i(b.pointsCount-1),k===zc&&(h=b.i(b.pointsCount-3),k=b.i(b.pointsCount-4),90===this.direction||270===this.direction?(b.O(b.pointsCount-2,(e.x+h.x)/2,h.y),b.O(b.pointsCount-2,k.x,(h.y+k.y)/2)):(b.O(b.pointsCount-2,h.x,(e.y+h.y)/2),b.O(b.pointsCount-3,(h.x+k.x)/2,k.y))),e.u()||e.set(f.actualBounds.center), b.O(b.pointsCount-1,e.x,e.y)));b.Lf();c.commit()}}}this.avoidOrthogonalOverlaps()}; $s.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new I,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.xdb.xd?1:a.Pcb.Pc?1:0:0};t.ny=function(a,b){return a instanceof fu&&b instanceof fu&&a!==b?a.firstb.first||a.jb.j||a.xdb.xd?1:a.Pcb.Pc?1:0:0}; t.Ws=function(a,b){return a instanceof fu&&b instanceof fu&&a!==b?a.qcb.qc||a.jb.j||a.xdb.xd?1:a.Pcb.Pc?1:0:0};t.C=function(a,b){G&&(D(a,$s,"isApprox:a"),D(b,$s,"isApprox:b"));a-=b;return-1a}; t.Mi=function(a,b,c,d){var e=a.length,f=d-c;if(!(1>=f))if((0>c||c>=e-1)&&v("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.Se.length){var d=[];for(var e=0;ea&&(this.ng=a,this.F()))}},packIterations:{configurable:!0,get:function(){return this.xl},set:function(a){this.xl=a}},alignOption:{configurable:!0,get:function(){return this.Ee},set:function(a){this.Ee!==a&&(B(a,"number",$s,"align"),0<=a&&16>a&&(this.Ee=a,this.F()))}},setsPortSpots:{configurable:!0,get:function(){return this.Ef},set:function(a){this.Ef!== a&&(B(a,"boolean",$s,"setsPortSpots"),this.Ef=a,this.F())}},linkSpacing:{configurable:!0,get:function(){return this.On},set:function(a){this.On!==a&&(B(a,"number",$s,"linkSpacing"),0<=a&&(this.On=a,this.F()))}},maxLayer:{configurable:!0,get:function(){return this.Oa}},maxIndex:{configurable:!0,get:function(){return this.Vq}},maxColumn:{configurable:!0,get:function(){return this.Wa}},minIndexLayer:{configurable:!0,get:function(){return this.Tn}}, maxIndexLayer:{configurable:!0,get:function(){return this.Sd}}});var at=new F($s,"CycleDepthFirst",0),ut=new F($s,"CycleGreedy",1),ft=new F($s,"CycleFromLayers",2),bt=new F($s,"LayerOptimalLinkLength",0),zt=new F($s,"LayerLongestPathSink",1),Bt=new F($s,"LayerLongestPathSource",2),ct=new F($s,"InitDepthFirstOut",0),It=new F($s,"InitDepthFirstIn",1),Ft=new F($s,"InitNaive",2),Mt=new F($s,"AggressiveNone",0),dt=new F($s,"AggressiveLess",1),Nt=new F($s,"AggressiveMore",2),Ot=8; $s.className="LayeredDigraphLayout";$s.CycleDepthFirst=at;$s.CycleGreedy=ut;$s.CycleFromLayers=ft;$s.LayerOptimalLinkLength=bt;$s.LayerLongestPathSink=zt;$s.LayerLongestPathSource=Bt;$s.InitDepthFirstOut=ct;$s.InitDepthFirstIn=It;$s.InitNaive=Ft;$s.AggressiveNone=Mt;$s.AggressiveLess=dt;$s.AggressiveMore=Nt;$s.PackNone=0;$s.PackExpand=1;$s.PackStraighten=2;$s.PackMedian=4;$s.PackAll=15;$s.AlignNone=0;$s.AlignUpperLeft=1;$s.AlignUpperRight=2;$s.AlignLowerLeft=4;$s.AlignLowerRight=8;$s.AlignAll=15; function fu(){this.index=this.Pc=this.xd=this.qc=this.first=this.layer=0;this.link=null;this.j=0}fu.className="SegInfo";function et(a){Mq.call(this,a)}na(et,Mq);et.prototype.createVertex=function(){return new gu(this)};et.prototype.createEdge=function(){return new hu(this)};et.className="LayeredDigraphNetwork";function gu(a){Pq.call(this,a);this.no=this.po=this.oo=this.qo=null;this.fb=this.Mg=this.Ug=-1;this.v=NaN;this.G=null;this.valid=!1;this.finish=this.Zl=NaN;this.Qu=0;this.sv=this.tv=null} na(gu,Pq);function iu(a,b){return a.index-b.index}function bu(a,b){if(!a.no){for(var c=[],d=ca(a.destinationEdgesArrayAccess),e=d.next();!e.done;e=d.next())e=e.value,e.valid&&c.push(e);a.no=c}a=ca(a.no);for(c=a.next();!c.done;c=a.next())if(c=c.value,c.toVertex===b)return c;v("Unable to find destination edge to given vertex")} function Zt(a){if(!a.qo){for(var b=[],c=ca(a.sourceEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,!d.valid||d.fromVertex.layer<=d.toVertex.layer||b.push(d.fromVertex);b.sort(iu);a.qo=b}return a.qo}function au(a){if(!a.oo){for(var b=[],c=ca(a.destinationEdgesArrayAccess),d=c.next();!d.done;d=c.next())d=d.value,!d.valid||d.fromVertex.layer<=d.toVertex.layer||b.push(d.toVertex);b.sort(iu);a.oo=b}return a.oo}gu.prototype.Pl=function(a){Pq.prototype.Pl.call(this,a);this.po=this.qo=null}; gu.prototype.Yl=function(a){Pq.prototype.Yl.call(this,a);this.po=this.qo=null};gu.prototype.Ml=function(a){Pq.prototype.Ml.call(this,a);this.no=this.oo=null};gu.prototype.Xl=function(a){Pq.prototype.Xl.call(this,a);this.no=this.oo=null}; oa.Object.defineProperties(gu.prototype,{layer:{configurable:!0,get:function(){return this.Ug},set:function(a){this.Ug!==a&&(B(a,"number",gu,"layer"),this.Ug=a)}},column:{configurable:!0,get:function(){return this.Mg},set:function(a){this.Mg!==a&&(B(a,"number",gu,"column"),this.Mg=a)}},index:{configurable:!0,get:function(){return this.fb},set:function(a){this.fb!==a&&(B(a,"number",gu,"index"),this.fb=a)}},component:{configurable:!0,get:function(){return this.v}, set:function(a){this.v!==a&&(B(a,"number",gu,"component"),this.v=a)}},near:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(G&&null!==a&&x(a,gu,gu,"near"),this.G=a)}}});gu.prototype.deleteDestinationEdge=gu.prototype.Xl;gu.prototype.addDestinationEdge=gu.prototype.Ml;gu.prototype.deleteSourceEdge=gu.prototype.Yl;gu.prototype.addSourceEdge=gu.prototype.Pl;gu.className="LayeredDigraphVertex"; function hu(a){Qq.call(this,a);this.j=this.oa=this.Na=!1;this.Z=this.v=NaN;this.G=this.o=0}na(hu,Qq); oa.Object.defineProperties(hu.prototype,{fromVertex:{configurable:!0,get:function(){return this.qd},set:function(a){this.qd!==a&&(G&&null!==a&&x(a,gu,hu,"fromVertex"),this.qd=a)}},toVertex:{configurable:!0,get:function(){return this.wd},set:function(a){this.wd!==a&&(G&&null!==a&&x(a,gu,hu,"toVertex"),this.wd=a)}},valid:{configurable:!0,get:function(){return this.Na},set:function(a){this.Na!==a&&(B(a,"boolean",hu,"valid"),this.Na=a)}},rev:{configurable:!0, enumerable:!0,get:function(){return this.oa},set:function(a){this.oa!==a&&(B(a,"boolean",hu,"rev"),this.oa=a)}},forest:{configurable:!0,get:function(){return this.j},set:function(a){this.j!==a&&(B(a,"boolean",hu,"forest"),this.j=a)}},portFromPos:{configurable:!0,get:function(){return this.v},set:function(a){this.v!==a&&(B(a,"number",hu,"portFromPos"),this.v=a)}},portToPos:{configurable:!0,get:function(){return this.Z},set:function(a){this.Z!==a&&(B(a,"number", hu,"portToPos"),this.Z=a)}},portFromColOffset:{configurable:!0,get:function(){return this.o},set:function(a){this.o!==a&&(B(a,"number",hu,"portFromColOffset"),this.o=a)}},portToColOffset:{configurable:!0,get:function(){return this.G},set:function(a){this.G!==a&&(B(a,"number",hu,"portToColOffset"),this.G=a)}}});hu.className="LayeredDigraphEdge"; function Z(a){Gi.call(this);this.ac=new J;this.jo=ju;this.Ad=ku;this.Ho=lu;this.Oq=mu;this.ow=[];this.zd=!0;this.Yb=nu;this.fe=(new Gb(10,10)).freeze();var b=new ou(this);this.$=new pu(b);this.aa=new pu(b);this.Eu=[];a&&Object.assign(this,a)}na(Z,Gi);Z.prototype.cloneProtected=function(a){Gi.prototype.cloneProtected.call(this,a);a.jo=this.jo;a.Ho=this.Ho;a.Oq=this.Oq;a.zd=this.zd;a.Yb=this.Yb;a.fe.assign(this.fe);a.$.copyInheritedPropertiesFrom(this.$);a.aa.copyInheritedPropertiesFrom(this.aa)}; Z.prototype.wb=function(a){a.classType===Z?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:v("Unknown enum value: "+a):Gi.prototype.wb.call(this,a)};Z.prototype.createNetwork=function(){return new ou(this)}; Z.prototype.makeNetwork=function(a){function b(a){if(a instanceof V)return!a.isLinkLabel&&"Comment"!==a.category;if(a instanceof S){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.xg(a.nodes,!0,b),c.xg(a.links,!0,b)):a instanceof Df?c.xg(a.memberParts,!1,b):c.xg(a.iterator,!1,b);return c}; Z.prototype.doLayout=function(a){G&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");null===this.network&&(this.network=this.makeNetwork(a));this.arrangement!==qu&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof Q&&(b=a);this.path===ju&&null!==b?this.Ad=b.isTreePathToChildren?ku:ru:this.Ad=this.path===ju?ku:this.path;if(0b.level)return!1;a.removeChild(c.parent,c)}return!0} Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){G&&x(a,pu,Z,"removeChild:p");G&&x(b,pu,Z,"removeChild:c");for(var c=a.children,d=0,e=0;ee?Yu(this,a,g,ha,w,z):Zu(this,a,g,ha,w,z);ha=z.x;w=z.width;z=z.height;break;case Mu:for(C=0;Cn&&(aawb&&(dv(a,-wb,0,la,ya-1),ev(C,-wb,0),ev(E,-wb,0),wb=0)}La.W.h(wb,Y);w=Math.max(w,H);z=Math.max(z,A+(0===R?0:r)+sb.height);aa=H}else{0n&&(Ywb&&(dv(a,0,-wb,la,ya-1),ev(C,0,-wb),ev(E,0,-wb),wb=0);La.W.h(aa,wb);z=Math.max(z,T);w=Math.max(w,A+(0===R?0:r)+sb.width);Y=T}O++}0l&&(l=0),135u&&(u=0),k===Pu&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>w&&(w=jv(k,d-w,0),g=w.x,h=w.y,w=d,l=0):w=hv(a,w,l),0>l&&(g-=l,l=0),135z&&(z=jv(k,0,y-z),g=z.x,h=z.y,z=y,u=0):z=iv(a,z,u),0>u&&(h-=u,u=0),g+=d+c);if(0< R)e=$u(this,4),R=$u(this,4),b?(e[2].h(0,y+c),e[3].h(e[2].x,z),R[2].h(w,e[2].y),R[3].h(R[2].x,e[3].y)):(e[2].h(d+c,0),e[3].h(w,e[2].y),R[2].h(e[2].x,z),R[3].h(e[3].x,R[2].y));else{e=$u(this,C.length+2);R=$u(this,E.length+2);for(k=0;ke[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].ye[0].x?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(l+ d,0),R[1].h(R[0].x,y),R[2].ye[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].xe[0].y?e[3].assign(e[2]):e[2].assign(e[3])),R[0].h(0,u+y),R[1].h(d,R[0].y),R[2].xd?Yu(a,b,e,O,A,C):Zu(a,b,e,O,A,C);O=C.x;A=C.width;C=C.height;break;case Mu:for(p=0;pp&&(Hp&&(Tn&&(n=0),135w&&(w=0));b.ra.h(n,w);b.Ja.h(A,C)}}Z.prototype.customAlignment=function(a,b,c,d,e){return[b,c,d,e]}; function Yu(a,b,c,d,e,f){G&&x(b,pu,Z,"layoutBusChildrenPosDir:v");var g=c.length;if(0===g)return new M(d,0,e,f);if(1===g)return b=c[0],e=b.Ja.width,f=b.Ja.height,new M(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=90===Vu(b),m=0,n=0,p=0,q=0;ql&&(e-=l),f=Math.max(f,Math.max(q,p)+a+g.height),0>c.W.x&&(d=lv(b,c.W.x,!1,d,h))):(c.W.h(e+a,d+h/2-c.focus.y-c.ra.y),e=Math.max(e,Math.max(r,n)+a+g.width),p=d+h/2-c.focus.y-c.ra.y,f=Math.max(f,p+g.height),0>p&&(f-=p),0>c.W.y&&(d=lv(b,c.W.y,!0,d,h))));return new M(d,0,e,f)} function Zu(a,b,c,d,e,f){G&&x(b,pu,Z,"layoutBusChildrenNegDir:v");var g=c.length;if(0===g)return new M(d,0,e,f);if(1===g)return c=c[0],e=c.Ja.width,f=c.Ja.height,new M(d,0,e,f);for(var h=b.nodeSpacing,k=b.rowSpacing,l=270===Vu(b),m=0,n=0,p=0,q=0;qn&&(e-=n),f=Math.max(f,Math.abs(Math.min(q,p))+a+m.height),0>k.W.x&&(d=lv(b,k.W.x,!1,d,h))):(k.W.h(-e-m.width-a,d+h/2-k.focus.y-k.ra.y),e=Math.max(e,Math.abs(Math.min(r,n))+a+m.width),p=d+h/2-k.focus.y-k.ra.y,f=Math.max(f,p+m.height),0>p&&(f-=p),0>k.W.y&&(d=lv(b,k.W.y,!0,d,h))));for(b=0;bb&&(b=c+a.width),0>c&&(b-=c),b;case Wu:return a.width>b?a.width:b;case Xu:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case Lu:case Bu:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case Mu:return a.width-a.focus.x+a.nodeSpacing/2+b;case Pu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}} function iv(a,b,c){G&&x(a,pu,Z,"calculateSubheight:v");switch(a.alignment){case gv:case fv:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Wu:return a.height>b?a.height:b;case Xu:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case Lu:case Bu:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case Mu:return a.height-a.focus.y+a.nodeSpacing/2+b;case Pu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}} function jv(a,b,c){G&&x(a,F,Z,"alignOffset:align");switch(a){case fv:b/=2;c/=2;break;case gv:b/=2;c/=2;break;case Wu:c=b=0;break;case Xu:break;default:v("Unhandled alignment value "+a.toString())}return new K(b,c)}function av(a,b,c,d,e,f){G&&x(a,pu,Z,"shiftRelPosAlign:v");G&&x(b,F,Z,"shiftRelPosAlign:align");b=jv(b,c,d);dv(a,b.x,b.y,e,f)}function dv(a,b,c,d,e){G&&x(a,pu,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].W;f.x+=b;f.y+=c}} function bv(a,b,c,d){G&&(x(b,pu,Z,"recordMidPoints:v"),B(c,"number",Z,"recordMidPoints:x"),B(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.Ad){case ku:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case ru:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:v("Unhandled path value "+a.Ad.toString())}}function ev(a,b,c){for(var d=0;dn.length||null===q||2>q.length))for(e=c= 0;cl&&f.yf.y&&lb.length||null===c||2>c.length)d=null;else{m=$u(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x+e,l.y);c=$u(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=$u(a,n.length+f.length);for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x, k.y);f=$u(a,e);for(c=0;cn.length||null===q||2>q.length))for(e=c=0;ck&&f.xf.x&&kb.length||null===c||2>c.length)d=null;else{m=$u(a,b.length+c.length);for(d=f=k=0;fk;)l=c[f++],m[d++].h(l.x,l.y+e);c=$u(a,d);for(k=0;kn.length||null===f||2>f.length)e=null;else{m=$u(a,n.length+f.length); for(e=l=c=0;cf;)k=n[c++],m[e++].h(k.x,k.y);f=$u(a,e);for(c=0;c=a?0:135>=a?90:225>=a?180:315>=a?270:0}Z.prototype.computeLayerSpacing=function(a){G&&x(a,pu,Z,"computeLayerSpacing:v");var b=Vu(a);b=90===b||270===b;var c=a.layerSpacing;if(0=a&&(this.$.nodeIndentPastParent=a,this.F()))}},nodeSpacing:{configurable:!0,get:function(){return this.$.nodeSpacing},set:function(a){this.$.nodeSpacing!==a&&(B(a,"number",Z,"nodeSpacing"),this.$.nodeSpacing=a,this.F())}},layerSpacing:{configurable:!0,get:function(){return this.$.layerSpacing},set:function(a){this.$.layerSpacing!==a&&(B(a,"number",Z,"layerSpacing"),this.$.layerSpacing=a,this.F())}},layerSpacingParentOverlap:{configurable:!0, enumerable:!0,get:function(){return this.$.layerSpacingParentOverlap},set:function(a){this.$.layerSpacingParentOverlap!==a&&(B(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.$.layerSpacingParentOverlap=a,this.F()))}},compaction:{configurable:!0,get:function(){return this.$.compaction},set:function(a){this.$.compaction!==a&&($a(a,Z,Z,"compaction"),a===Su||a===Uu)&&(this.$.compaction=a,this.F())}},breadthLimit:{configurable:!0,get:function(){return this.$.breadthLimit}, set:function(a){this.$.breadthLimit!==a&&(B(a,"number",Z,"breadthLimit"),0<=a&&(this.$.breadthLimit=a,this.F()))}},rowSpacing:{configurable:!0,get:function(){return this.$.rowSpacing},set:function(a){this.$.rowSpacing!==a&&(B(a,"number",Z,"rowSpacing"),this.$.rowSpacing=a,this.F())}},rowIndent:{configurable:!0,get:function(){return this.$.rowIndent},set:function(a){this.$.rowIndent!==a&&(B(a,"number",Z,"rowIndent"),0<=a&&(this.$.rowIndent=a,this.F()))}},commentSpacing:{configurable:!0, enumerable:!0,get:function(){return this.$.commentSpacing},set:function(a){this.$.commentSpacing!==a&&(B(a,"number",Z,"commentSpacing"),this.$.commentSpacing=a,this.F())}},commentMargin:{configurable:!0,get:function(){return this.$.commentMargin},set:function(a){this.$.commentMargin!==a&&(B(a,"number",Z,"commentMargin"),this.$.commentMargin=a,this.F())}},setsPortSpot:{configurable:!0,get:function(){return this.$.setsPortSpot},set:function(a){this.$.setsPortSpot!==a&&(B(a, "boolean",Z,"setsPortSpot"),this.$.setsPortSpot=a,this.F())}},portSpot:{configurable:!0,get:function(){return this.$.portSpot},set:function(a){x(a,Hb,Z,"portSpot");this.$.portSpot.D(a)||(this.$.portSpot=a,this.F())}},setsChildPortSpot:{configurable:!0,get:function(){return this.$.setsChildPortSpot},set:function(a){this.$.setsChildPortSpot!==a&&(B(a,"boolean",Z,"setsChildPortSpot"),this.$.setsChildPortSpot=a,this.F())}},childPortSpot:{configurable:!0,get:function(){return this.$.childPortSpot}, set:function(a){x(a,Hb,Z,"childPortSpot");this.$.childPortSpot.D(a)||(this.$.childPortSpot=a,this.F())}},alternateSorting:{configurable:!0,get:function(){return this.aa.sorting},set:function(a){this.aa.sorting!==a&&($a(a,Z,Z,"alternateSorting"),a===Gu||a===Hu||a===Iu||Ju)&&(this.aa.sorting=a,this.F())}},alternateComparer:{configurable:!0,get:function(){return this.aa.comparer},set:function(a){this.aa.comparer!==a&&(B(a,"function",Z,"alternateComparer"),this.aa.comparer= a,this.F())}},alternateAngle:{configurable:!0,get:function(){return this.aa.angle},set:function(a){this.aa.angle!==a&&(B(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.aa.angle=a,this.F())}},alternateAlignment:{configurable:!0,get:function(){return this.aa.alignment},set:function(a){this.aa.alignment!==a&&($a(a,Z,Z,"alternateAlignment"),this.aa.alignment=a,this.F())}},alternateNodeIndent:{configurable:!0,get:function(){return this.aa.nodeIndent}, set:function(a){this.aa.nodeIndent!==a&&(B(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.aa.nodeIndent=a,this.F()))}},alternateNodeIndentPastParent:{configurable:!0,get:function(){return this.aa.nodeIndentPastParent},set:function(a){this.aa.nodeIndentPastParent!==a&&(B(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.aa.nodeIndentPastParent=a,this.F()))}},alternateNodeSpacing:{configurable:!0,get:function(){return this.aa.nodeSpacing},set:function(a){this.aa.nodeSpacing!== a&&(B(a,"number",Z,"alternateNodeSpacing"),this.aa.nodeSpacing=a,this.F())}},alternateLayerSpacing:{configurable:!0,get:function(){return this.aa.layerSpacing},set:function(a){this.aa.layerSpacing!==a&&(B(a,"number",Z,"alternateLayerSpacing"),this.aa.layerSpacing=a,this.F())}},alternateLayerSpacingParentOverlap:{configurable:!0,get:function(){return this.aa.layerSpacingParentOverlap},set:function(a){this.aa.layerSpacingParentOverlap!==a&&(B(a,"number",Z,"alternateLayerSpacingParentOverlap"), 0<=a&&1>=a&&(this.aa.layerSpacingParentOverlap=a,this.F()))}},alternateCompaction:{configurable:!0,get:function(){return this.aa.compaction},set:function(a){this.aa.compaction!==a&&($a(a,Z,Z,"alternateCompaction"),a===Su||a===Uu)&&(this.aa.compaction=a,this.F())}},alternateBreadthLimit:{configurable:!0,get:function(){return this.aa.breadthLimit},set:function(a){this.aa.breadthLimit!==a&&(B(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.aa.breadthLimit=a,this.F()))}}, alternateRowSpacing:{configurable:!0,get:function(){return this.aa.rowSpacing},set:function(a){this.aa.rowSpacing!==a&&(B(a,"number",Z,"alternateRowSpacing"),this.aa.rowSpacing=a,this.F())}},alternateRowIndent:{configurable:!0,get:function(){return this.aa.rowIndent},set:function(a){this.aa.rowIndent!==a&&(B(a,"number",Z,"alternateRowIndent"),0<=a&&(this.aa.rowIndent=a,this.F()))}},alternateCommentSpacing:{configurable:!0,get:function(){return this.aa.commentSpacing}, set:function(a){this.aa.commentSpacing!==a&&(B(a,"number",Z,"alternateCommentSpacing"),this.aa.commentSpacing=a,this.F())}},alternateCommentMargin:{configurable:!0,get:function(){return this.aa.commentMargin},set:function(a){this.aa.commentMargin!==a&&(B(a,"number",Z,"alternateCommentMargin"),this.aa.commentMargin=a,this.F())}},alternateSetsPortSpot:{configurable:!0,get:function(){return this.aa.setsPortSpot},set:function(a){this.aa.setsPortSpot!==a&&(B(a,"boolean",Z,"alternateSetsPortSpot"), this.aa.setsPortSpot=a,this.F())}},alternatePortSpot:{configurable:!0,get:function(){return this.aa.portSpot},set:function(a){x(a,Hb,Z,"alternatePortSpot");this.aa.portSpot.D(a)||(this.aa.portSpot=a,this.F())}},alternateSetsChildPortSpot:{configurable:!0,get:function(){return this.aa.setsChildPortSpot},set:function(a){this.aa.setsChildPortSpot!==a&&(B(a,"boolean",Z,"alternateSetsChildPortSpot"),this.aa.setsChildPortSpot=a,this.F())}},alternateChildPortSpot:{configurable:!0, enumerable:!0,get:function(){return this.aa.childPortSpot},set:function(a){x(a,Hb,Z,"alternateChildPortSpot");this.aa.childPortSpot.D(a)||(this.aa.childPortSpot=a,this.F())}}}); var ju=new F(Z,"PathDefault",-1),ku=new F(Z,"PathDestination",0),ru=new F(Z,"PathSource",1),Gu=new F(Z,"SortingForwards",10),Hu=new F(Z,"SortingReverse",11),Iu=new F(Z,"SortingAscending",12),Ju=new F(Z,"SortingDescending",13),fv=new F(Z,"AlignmentCenterSubtrees",20),gv=new F(Z,"AlignmentCenterChildren",21),Wu=new F(Z,"AlignmentStart",22),Xu=new F(Z,"AlignmentEnd",23),Lu=new F(Z,"AlignmentBus",24),Bu=new F(Z,"AlignmentBusBranching",25),Mu=new F(Z,"AlignmentTopLeftBus",26),Pu=new F(Z,"AlignmentBottomRightBus", 27),Su=new F(Z,"CompactionNone",30),Uu=new F(Z,"CompactionBlock",31),lu=new F(Z,"StyleLayered",40),Fu=new F(Z,"StyleLastParents",41),Eu=new F(Z,"StyleAlternating",42),Du=new F(Z,"StyleRootOnly",43),nu=new F(Z,"ArrangementVertical",50),nv=new F(Z,"ArrangementHorizontal",51),qu=new F(Z,"ArrangementFixedRoots",52),mu=new F(Z,"LayerIndividual",60),zu=new F(Z,"LayerSiblings",61),yu=new F(Z,"LayerUniform",62);Z.className="TreeLayout";Z.PathDefault=ju;Z.PathDestination=ku;Z.PathSource=ru; Z.SortingForwards=Gu;Z.SortingReverse=Hu;Z.SortingAscending=Iu;Z.SortingDescending=Ju;Z.AlignmentCenterSubtrees=fv;Z.AlignmentCenterChildren=gv;Z.AlignmentStart=Wu;Z.AlignmentEnd=Xu;Z.AlignmentBus=Lu;Z.AlignmentBusBranching=Bu;Z.AlignmentTopLeftBus=Mu;Z.AlignmentBottomRightBus=Pu;Z.CompactionNone=Su;Z.CompactionBlock=Uu;Z.StyleLayered=lu;Z.StyleLastParents=Fu;Z.StyleAlternating=Eu;Z.StyleRootOnly=Du;Z.ArrangementVertical=nu;Z.ArrangementHorizontal=nv;Z.ArrangementFixedRoots=qu;Z.LayerIndividual=mu; Z.LayerSiblings=zu;Z.LayerUniform=yu;function ou(a){Mq.call(this,a)}na(ou,Mq);ou.prototype.createVertex=function(){return new pu(this)};ou.prototype.createEdge=function(){return new pv(this)};ou.className="TreeNetwork"; function pu(a){Pq.call(this,a);this.Z=!1;this.ob=null;this.v=[];this.tb=this.Na=this.G=this.oa=0;this.zd=null;this.W=new K(0,0);this.Ja=new Gb(0,0);this.ra=new K(0,0);this.wm=this.vm=this.KA=!1;this.yp=this.lp=null;this.td=Gu;this.od=Wq;this.Qb=0;this.Pb=gv;this.hr=this.gr=0;this.ir=20;this.oe=50;this.Nq=0;this.Up=Uu;this.Np=0;this.Br=25;this.Tp=this.Ar=10;this.Sp=20;this.Kr=!0;this.rr=gd;this.Jr=!0;this.Qp=gd}na(pu,Pq); pu.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.td=a.sorting,this.od=a.comparer,this.Qb=a.angle,this.Pb=a.alignment,this.gr=a.nodeIndent,this.hr=a.nodeIndentPastParent,this.ir=a.nodeSpacing,this.oe=a.layerSpacing,this.Nq=a.layerSpacingParentOverlap,this.Up=a.compaction,this.Np=a.breadthLimit,this.Br=a.rowSpacing,this.Ar=a.rowIndent,this.Tp=a.commentSpacing,this.Sp=a.commentMargin,this.Kr=a.setsPortSpot,this.rr=a.portSpot,this.Jr=a.setsChildPortSpot,this.Qp=a.childPortSpot)}; oa.Object.defineProperties(pu.prototype,{initialized:{configurable:!0,get:function(){return this.Z},set:function(a){this.Z!==a&&(B(a,"boolean",pu,"initialized"),this.Z=a)}},parent:{configurable:!0,get:function(){return this.ob},set:function(a){this.ob!==a&&(G&&null!==a&&x(a,pu,pu,"parent"),this.ob=a)}},children:{configurable:!0,get:function(){return this.v},set:function(a){if(this.v!==a){null===a||Array.isArray(a)||Aa(a,"Array",pu,"children:value");if(null!== a)for(var b=a.length,c=0;cq.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===Wu?(f=d.top+e.y,0===e.y&&n.yq.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))):c.alignment===Wu?(f=d.left+e.x,0===e.x&&n.xq.y+c.rowIndent&&(f=Math.min(f,Math.max(n.y,f-b.computeNodeIndent(c))))):c.alignment===Wu?(f=d.top+e.y,0===e.y&&n.yq.x+c.rowIndent&&(f=Math.min(f,Math.max(n.x,f-b.computeNodeIndent(c))))): c.alignment===Wu?(f=d.left+e.x,0===e.x&&n.x