##// END OF EJS Templates
changed base64.urlsafe to base64.standard
amorales -
r357:4a57328e4812
parent child
Show More
This diff has been collapsed as it changes many lines, (2353 lines changed) Show them Hide them
@@ -0,0 +1,2353
1 /*
2 * GoJS v2.1.53 JavaScript Library for HTML Diagrams, https://gojs.net
3 * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation, https://www.nwoods.com.
4 * Copyright (C) 1998-2021 by Northwoods Software Corporation. All Rights Reserved.
5 * THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/2.1.53/license.html.
6 * DO NOT MODIFY THIS FILE. DO NOT DISTRIBUTE A MODIFIED COPY OF THE CONTENTS OF THIS FILE.
7 */
8 (function() { var t;function aa(a){var b=0;return function(){return b<a.length?{done:!1,value:a[b++]}:{done:!0}}}function ba(a){var b="undefined"!=typeof Symbol&&Symbol.iterator&&a[Symbol.iterator];return b?b.call(a):{next:aa(a)}}function da(a){for(var b,c=[];!(b=a.next()).done;)c.push(b.value);return c}var ea="function"==typeof Object.create?Object.create:function(a){function b(){}b.prototype=a;return new b},fa;
9 if("function"==typeof Object.setPrototypeOf)fa=Object.setPrototypeOf;else{var ha;a:{var ia={a:!0},ja={};try{ja.__proto__=ia;ha=ja.a;break a}catch(a){}ha=!1}fa=ha?function(a,b){a.__proto__=b;if(a.__proto__!==b)throw new TypeError(a+" is not extensible");return a}:null}var la=fa;
10 function ma(a,b){a.prototype=ea(b.prototype);a.prototype.constructor=a;if(la)la(a,b);else for(var c in b)if("prototype"!=c)if(Object.defineProperties){var d=Object.getOwnPropertyDescriptor(b,c);d&&Object.defineProperty(a,c,d)}else a[c]=b[c];a.QB=b.prototype}var na="undefined"!=typeof window&&window===self?self:"undefined"!=typeof global&&null!=global?global:self,oa="function"==typeof Object.defineProperties?Object.defineProperty:function(a,b,c){a!=Array.prototype&&a!=Object.prototype&&(a[b]=c.value)};
11 function pa(a){if(a){for(var b=na,c=["Array","prototype","fill"],d=0;d<c.length-1;d++){var e=c[d];e in b||(b[e]={});b=b[e]}c=c[c.length-1];d=b[c];a=a(d);a!=d&&null!=a&&oa(b,c,{configurable:!0,writable:!0,value:a})}}pa(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<d;c++)this[c]=a;return this}});var qa="object"===typeof self&&self.self===self&&self||"object"===typeof global&&global.global===global&&global||"object"===typeof window&&window.window===window&&window||{};void 0===qa.requestAnimationFrame&&(void 0===qa.setImmediate?qa.requestAnimationFrame=function(a){qa.setTimeout(a,0)}:qa.requestAnimationFrame=qa.setImmediate);function ra(){}function sa(a,b){var c=-1;return function(){var d=this,e=arguments;-1!==c&&qa.clearTimeout(c);c=ta(function(){c=-1;a.apply(d,e)},b)}}
12 function ta(a,b){return qa.setTimeout(a,b)}function ua(a){return qa.document.createElement(a)}function v(a){throw Error(a);}function va(a,b){a="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(a+=" to value: "+b);v(a)}function w(a,b,c,d){a instanceof b||(c=wa(c),void 0!==d&&(c+="."+d),ya(a,b,c))}function A(a,b,c,d){typeof a!==b&&(c=wa(c),void 0!==d&&(c+="."+d),ya(a,b,c))}
13 function C(a,b,c){"number"===typeof a&&isFinite(a)||(b=wa(b),void 0!==c&&(b+="."+c),v(b+" must be a real number type, and not NaN or Infinity: "+a))}function ya(a,b,c,d){b=wa(b);c=wa(c);void 0!==d&&(c+="."+d);"string"===typeof a?v(c+" value is not an instance of "+b+': "'+a+'"'):v(c+" value is not an instance of "+b+": "+a)}function za(a,b,c,d){c=wa(c);void 0!==d&&(c+="."+d);v(c+" is not in the range "+b+": "+a)}
14 function Ba(a){v(("string"===typeof a.className?a.className:"")+" constructor cannot take any arguments.")}function Ca(a){v("Collection was modified during iteration: "+a.toString()+"\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.")}function Da(a,b){v("No property to set for this enum value: "+b+" on "+a.toString())}function Ea(a){qa.console&&qa.console.log(a)}
15 function Fa(){qa.console&&qa.console.log("Warning: List/Map/Set constructors no longer take an argument that enforces type.Instead they take an optional collection of Values to add to the collection. See 2.0 changelog for details.")}function Ga(a){return"object"===typeof a&&null!==a}function Ha(a){return Array.isArray(a)||qa.NodeList&&a instanceof qa.NodeList||qa.HTMLCollection&&a instanceof qa.HTMLCollection}function Ia(a,b,c){Ha(a)||ya(a,"Array or NodeList or HTMLCollection",b,c)}
16 function Ja(a){return Array.prototype.slice.call(a)}function Ka(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):v("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)}function La(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 Ma(){var a=Na.pop();return void 0===a?[]:a}function Oa(a){a.length=0;Na.push(a)}
17 function wa(a){return null===a?"*":"string"===typeof a?a:"function"===typeof a&&"string"===typeof a.className?a.className:""}function Pa(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 Pa(a.constructor);return typeof a}
18 function Qa(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 Ra(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.HB;if(c&&c[b])return!0;a=Object.getPrototypeOf(a)}return!1}
19 function Sa(a,b,c){Object.defineProperty(Ta.prototype,a,{get:b,set:c})}
20 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;e<a.length;e+=2)c[d++]=b[a.substr(e,2)];a=c.join("");a=""===a?"0":a;b=[];for(c=0;256>c;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;g<a.length;g++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(g)^b[(b[c]+b[d])%256]);return f}
21 var Wa=void 0!==qa.navigator&&0<qa.navigator.userAgent.indexOf("MSIE 9.0"),Za=void 0!==qa.navigator&&0<qa.navigator.userAgent.indexOf("MSIE 10.0"),$a=void 0!==qa.navigator&&0<qa.navigator.userAgent.indexOf("Trident/7"),ab=void 0!==qa.navigator&&0<qa.navigator.userAgent.indexOf("Edge/"),cb=void 0!==qa.navigator&&void 0!==qa.navigator.platform&&0<=qa.navigator.platform.toUpperCase().indexOf("MAC"),db=void 0!==qa.navigator&&void 0!==qa.navigator.platform&&null!==qa.navigator.platform.match(/(iPhone|iPod|iPad)/i),
22 Na=[];Object.freeze([]);ra.className="Util";ra.Dx="32ab5ff3b26f42dc0ed90f21452913b5";ra.adym="gojs.net";ra.vfo="28e647fdb665";ra.className="Util";function E(a,b,c){eb(this);this.l=a;this.va=b;this.w=c}E.prototype.toString=function(){return"EnumValue."+this.va};function fb(a,b){return void 0===b||null===b||""===b?null:a[b]}function gb(a,b,c,d){a.classType!==b&&(c=wa(c),void 0!==d&&(c+="."+d),ya(a,"function"==="a constant of class "+typeof b.className?b.className:"",c))}
23 na.Object.defineProperties(E.prototype,{classType:{configurable:!0,get:function(){return this.l}},name:{configurable:!0,get:function(){return this.va}},value:{configurable:!0,get:function(){return this.w}}});E.className="EnumValue";function hb(){this.Gx=[]}hb.prototype.toString=function(){return this.Gx.join("")};hb.prototype.add=function(a){""!==a&&this.Gx.push(a)};hb.className="StringBuilder";function ib(){}ib.className="PropertyCollection";
24 var F={Jm:!1,Cy:!1,iA:!1,KB:!1,OB:!1,Sy:!1,By:!1,IB:null,trace:function(a){qa.console&&qa.console.log(a)},JB:function(a,b,c,d){a.strokeStyle="red";a.fillStyle="red";a.font="8px sans-serif";a.beginPath();a.moveTo(-10,0);a.lineTo(10,0);a.moveTo(0,-10);a.lineTo(0,10);a.stroke();a.setTransform(1,0,0,1,0,0);a.scale(c,c);a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy);a.lineWidth=2;a.beginPath();a.moveTo(d.left,d.top+20);a.lineTo(d.left,d.top);a.lineTo(d.left+20,d.top);a.moveTo(d.right,d.bottom-20);a.lineTo(d.right,
25 d.bottom);a.lineTo(d.right-20,d.bottom);a.stroke();a.fillText("DB: "+Math.round(d.x)+", "+Math.round(d.y)+", "+Math.round(d.width)+", "+Math.round(d.height),d.left,d.top-5)},Nz:function(a){var b={},c;for(c in a){b.x=c;if("licenseKey"!==b.x){var d=a[b.x];if(void 0!==d.prototype){b.Xm=Object.getOwnPropertyNames(d.prototype);for(var e={Mk:0};e.Mk<b.Xm.length;e={Mk:e.Mk},e.Mk++){var f=Object.getOwnPropertyDescriptor(d.prototype,b.Xm[e.Mk]);void 0!==f.get&&void 0===f.set&&Object.defineProperty(d.prototype,
26 b.Xm[e.Mk],{set:function(a,b){return function(){throw Error("Property "+a.Xm[b.Mk]+" of "+a.x+" is read-only.");}}(b,e)})}}}b={Xm:b.Xm,x:b.x}}}};function jb(){}jb.prototype.reset=function(){};jb.prototype.next=function(){return!1};jb.prototype.xd=function(){return!1};jb.prototype.first=function(){return null};jb.prototype.any=function(){return!1};jb.prototype.all=function(){return!0};jb.prototype.each=function(){return this};jb.prototype.map=function(){return this};jb.prototype.filter=function(){return this};
27 jb.prototype.Yd=function(){};jb.prototype.toString=function(){return"EmptyIterator"};na.Object.defineProperties(jb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return 0}}});jb.prototype.first=jb.prototype.first;jb.prototype.hasNext=jb.prototype.xd;jb.prototype.next=jb.prototype.next;jb.prototype.reset=jb.prototype.reset;var kb=null;jb.className="EmptyIterator";kb=new jb;function lb(a){this.key=-1;this.value=a}
28 lb.prototype.reset=function(){this.key=-1};lb.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};lb.prototype.xd=function(){return this.next()};lb.prototype.first=function(){this.key=0;return this.value};lb.prototype.any=function(a){this.key=-1;return a(this.value)};lb.prototype.all=function(a){this.key=-1;return a(this.value)};lb.prototype.each=function(a){this.key=-1;a(this.value);return this};lb.prototype.map=function(a){return new lb(a(this.value))};
29 lb.prototype.filter=function(a){return a(this.value)?new lb(this.value):kb};lb.prototype.Yd=function(){this.value=null};lb.prototype.toString=function(){return"SingletonIterator("+this.value+")"};na.Object.defineProperties(lb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return 1}}});lb.prototype.first=lb.prototype.first;lb.prototype.hasNext=lb.prototype.xd;lb.prototype.next=lb.prototype.next;
30 lb.prototype.reset=lb.prototype.reset;lb.className="SingletonIterator";function mb(a){this.zb=a;this.tf=null;a.Ma=null;this.oa=a.v;this.Xa=-1}mb.prototype.reset=function(){var a=this.zb;a.Ma=null;this.oa=a.v;this.Xa=-1};mb.prototype.next=function(){var a=this.zb;if(a.v!==this.oa){if(0>this.key)return!1;Ca(a)}a=a.j;var b=a.length,c=++this.Xa,d=this.tf;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Xa=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Yd()}return!1};
31 mb.prototype.xd=function(){return this.next()};mb.prototype.first=function(){var a=this.zb;this.oa=a.v;this.Xa=0;a=a.j;var b=a.length,c=this.tf;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Xa=d,this.value=e;d++}return null}return 0<b?(a=a[0],this.key=0,this.value=a):null};mb.prototype.any=function(a){var b=this.zb;b.Ma=null;var c=b.v;this.Xa=-1;for(var d=b.j,e=d.length,f=this.tf,g=0;g<e;g++){var h=d[g];if(null===f||f(h)){if(a(h))return!0;b.v!==c&&Ca(b)}}return!1};
32 mb.prototype.all=function(a){var b=this.zb;b.Ma=null;var c=b.v;this.Xa=-1;for(var d=b.j,e=d.length,f=this.tf,g=0;g<e;g++){var h=d[g];if(null===f||f(h)){if(!a(h))return!1;b.v!==c&&Ca(b)}}return!0};mb.prototype.each=function(a){var b=this.zb;b.Ma=null;var c=b.v;this.Xa=-1;for(var d=b.j,e=d.length,f=this.tf,g=0;g<e;g++){var h=d[g];if(null===f||f(h))a(h),b.v!==c&&Ca(b)}return this};
33 mb.prototype.map=function(a){var b=this.zb;b.Ma=null;var c=b.v;this.Xa=-1;for(var d=[],e=b.j,f=e.length,g=this.tf,h=0;h<f;h++){var k=e[h];if(null===g||g(k))d.push(a(k)),b.v!==c&&Ca(b)}a=new H;a.j=d;a.ub();return a.iterator};mb.prototype.filter=function(a){var b=this.zb;b.Ma=null;var c=b.v;this.Xa=-1;for(var d=[],e=b.j,f=e.length,g=this.tf,h=0;h<f;h++){var k=e[h];if(null===g||g(k))a(k)&&d.push(k),b.v!==c&&Ca(b)}a=new H;a.j=d;a.ub();return a.iterator};
34 mb.prototype.Yd=function(){this.key=-1;this.value=null;this.oa=-1;this.tf=null;this.zb.Ma=this};mb.prototype.toString=function(){return"ListIterator@"+this.Xa+"/"+this.zb.count};
35 na.Object.defineProperties(mb.prototype,{iterator:{configurable:!0,get:function(){return this}},predicate:{configurable:!0,get:function(){return this.tf},set:function(a){this.tf=a}},count:{configurable:!0,get:function(){var a=this.tf;if(null!==a){for(var b=0,c=this.zb.j,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.zb.j.length}}});mb.prototype.first=mb.prototype.first;mb.prototype.hasNext=mb.prototype.xd;mb.prototype.next=mb.prototype.next;
36 mb.prototype.reset=mb.prototype.reset;mb.className="ListIterator";function nb(a){this.zb=a;a.sh=null;this.oa=a.v;this.Xa=a.j.length}nb.prototype.reset=function(){var a=this.zb;a.sh=null;this.oa=a.v;this.Xa=a.j.length};nb.prototype.next=function(){var a=this.zb;if(a.v!==this.oa){if(0>this.key)return!1;Ca(a)}var b=--this.Xa;if(0<=b)return this.key=b,this.value=a.j[b],!0;this.Yd();return!1};nb.prototype.xd=function(){return this.next()};
37 nb.prototype.first=function(){var a=this.zb;this.oa=a.v;var b=a.j;this.Xa=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};nb.prototype.any=function(a){var b=this.zb;b.sh=null;var c=b.v,d=b.j,e=d.length;this.Xa=e;for(--e;0<=e;e--){if(a(d[e]))return!0;b.v!==c&&Ca(b)}return!1};nb.prototype.all=function(a){var b=this.zb;b.sh=null;var c=b.v,d=b.j,e=d.length;this.Xa=e;for(--e;0<=e;e--){if(!a(d[e]))return!1;b.v!==c&&Ca(b)}return!0};
38 nb.prototype.each=function(a){var b=this.zb;b.sh=null;var c=b.v,d=b.j,e=d.length;this.Xa=e;for(--e;0<=e;e--)a(d[e]),b.v!==c&&Ca(b);return this};nb.prototype.map=function(a){var b=this.zb;b.sh=null;var c=b.v,d=[],e=b.j,f=e.length;this.Xa=f;for(--f;0<=f;f--)d.push(a(e[f])),b.v!==c&&Ca(b);a=new H;a.j=d;a.ub();return a.iterator};
39 nb.prototype.filter=function(a){var b=this.zb;b.sh=null;var c=b.v,d=[],e=b.j,f=e.length;this.Xa=f;for(--f;0<=f;f--){var g=e[f];a(g)&&d.push(g);b.v!==c&&Ca(b)}a=new H;a.j=d;a.ub();return a.iterator};nb.prototype.Yd=function(){this.key=-1;this.value=null;this.oa=-1;this.zb.sh=this};nb.prototype.toString=function(){return"ListIteratorBackwards("+this.Xa+"/"+this.zb.count+")"};
40 na.Object.defineProperties(nb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.zb.j.length}}});nb.prototype.first=nb.prototype.first;nb.prototype.hasNext=nb.prototype.xd;nb.prototype.next=nb.prototype.next;nb.prototype.reset=nb.prototype.reset;nb.className="ListIteratorBackwards";
41 function H(a){eb(this);this.s=!1;this.j=[];this.v=0;this.sh=this.Ma=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Fa():this.addAll(a))}t=H.prototype;t.ub=function(){var a=this.v;a++;999999999<a&&(a=0);this.v=a};t.freeze=function(){this.s=!0;return this};t.ka=function(){this.s=!1;return this};t.toString=function(){return"List()#"+ob(this)};t.add=function(a){if(null===a)return this;this.s&&va(this,a);this.j.push(a);this.ub();return this};t.push=function(a){this.add(a)};
42 t.addAll=function(a){if(null===a)return this;this.s&&va(this);var b=this.j;if(Ha(a))for(var c=a.length,d=0;d<c;d++)b.push(a[d]);else for(a=a.iterator;a.next();)b.push(a.value);this.ub();return this};t.clear=function(){this.s&&va(this);this.j.length=0;this.ub()};t.contains=function(a){return null===a?!1:-1!==this.j.indexOf(a)};t.has=function(a){return this.contains(a)};t.indexOf=function(a){return null===a?-1:this.j.indexOf(a)};
43 t.M=function(a){F&&C(a,H,"elt:i");var b=this.j;(0>a||a>=b.length)&&za(a,"0 <= i < length",H,"elt:i");return b[a]};t.get=function(a){return this.M(a)};t.Vc=function(a,b){F&&C(a,H,"setElt:i");var c=this.j;(0>a||a>=c.length)&&za(a,"0 <= i < length",H,"setElt:i");this.s&&va(this,a);c[a]=b};t.set=function(a,b){this.Vc(a,b)};t.first=function(){var a=this.j;return 0===a.length?null:a[0]};t.cc=function(){var a=this.j,b=a.length;return 0<b?a[b-1]:null};
44 t.pop=function(){this.s&&va(this);var a=this.j;return 0<a.length?a.pop():null};H.prototype.any=function(a){for(var b=this.j,c=this.v,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.v!==c&&Ca(this)}return!1};H.prototype.all=function(a){for(var b=this.j,c=this.v,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.v!==c&&Ca(this)}return!0};H.prototype.each=function(a){for(var b=this.j,c=this.v,d=b.length,e=0;e<d;e++)a(b[e]),this.v!==c&&Ca(this);return this};
45 H.prototype.map=function(a){for(var b=new H,c=[],d=this.j,e=this.v,f=d.length,g=0;g<f;g++)c.push(a(d[g])),this.v!==e&&Ca(this);b.j=c;b.ub();return b};H.prototype.filter=function(a){for(var b=new H,c=[],d=this.j,e=this.v,f=d.length,g=0;g<f;g++){var h=d[g];a(h)&&c.push(h);this.v!==e&&Ca(this)}b.j=c;b.ub();return b};t=H.prototype;t.Bb=function(a,b){F&&C(a,H,"insertAt:i");0>a&&za(a,">= 0",H,"insertAt:i");this.s&&va(this,a);var c=this.j;a>=c.length?c.push(b):c.splice(a,0,b);this.ub()};
46 t.remove=function(a){if(null===a)return!1;this.s&&va(this,a);var b=this.j;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.ub();return!0};t.delete=function(a){return this.remove(a)};t.jb=function(a){F&&C(a,H,"removeAt:i");var b=this.j;(0>a||a>=b.length)&&za(a,"0 <= i < length",H,"removeAt:i");this.s&&va(this,a);a===b.length-1?b.pop():b.splice(a,1);this.ub()};
47 t.removeRange=function(a,b){F&&(C(a,H,"removeRange:from"),C(b,H,"removeRange:to"));var c=this.j,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.s&&va(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.ub();return this};H.prototype.copy=function(){var a=new H,b=this.j;0<b.length&&(a.j=Array.prototype.slice.call(b));return a};t=H.prototype;t.ta=function(){for(var a=this.j,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};
48 t.Zw=function(){for(var a=new I,b=this.j,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};t.sort=function(a){F&&A(a,"function",H,"sort:sortfunc");this.s&&va(this);this.j.sort(a);this.ub();return this};
49 t.Gj=function(a,b,c){var d=this.j,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);F&&(A(a,"function",H,"sortRange:sortfunc"),C(b,H,"sortRange:from"),C(c,H,"sortRange:to"));this.s&&va(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&za(b,"0 <= from < length",H,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.ub()),this;if(0===b)if(c>=e)d.sort(a);else for(b=d.slice(0,c),b.sort(a),a=0;a<c;a++)d[a]=b[a];else if(c>=e)for(c=d.slice(b),c.sort(a),a=b;a<e;a++)d[a]=c[a-b];
50 else for(e=d.slice(b,c),e.sort(a),a=b;a<c;a++)d[a]=e[a-b];this.ub();return this};t.reverse=function(){this.s&&va(this);this.j.reverse();this.ub();return this};
51 na.Object.defineProperties(H.prototype,{_dataArray:{configurable:!0,get:function(){return this.j}},count:{configurable:!0,get:function(){return this.j.length}},size:{configurable:!0,get:function(){return this.j.length}},length:{configurable:!0,get:function(){return this.j.length}},iterator:{configurable:!0,get:function(){if(0>=this.j.length)return kb;var a=this.Ma;return null!==a?(a.reset(),a):new mb(this)}},iteratorBackwards:{configurable:!0,
52 enumerable:!0,get:function(){if(0>=this.j.length)return kb;var a=this.sh;return null!==a?(a.reset(),a):new nb(this)}}});H.prototype.reverse=H.prototype.reverse;H.prototype.sortRange=H.prototype.Gj;H.prototype.sort=H.prototype.sort;H.prototype.toSet=H.prototype.Zw;H.prototype.toArray=H.prototype.ta;H.prototype.removeRange=H.prototype.removeRange;H.prototype.removeAt=H.prototype.jb;H.prototype["delete"]=H.prototype.delete;H.prototype.remove=H.prototype.remove;H.prototype.insertAt=H.prototype.Bb;
53 H.prototype.pop=H.prototype.pop;H.prototype.last=H.prototype.cc;H.prototype.first=H.prototype.first;H.prototype.set=H.prototype.set;H.prototype.setElt=H.prototype.Vc;H.prototype.get=H.prototype.get;H.prototype.elt=H.prototype.M;H.prototype.indexOf=H.prototype.indexOf;H.prototype.has=H.prototype.has;H.prototype.contains=H.prototype.contains;H.prototype.clear=H.prototype.clear;H.prototype.addAll=H.prototype.addAll;H.prototype.push=H.prototype.push;H.prototype.add=H.prototype.add;H.prototype.thaw=H.prototype.ka;
54 H.prototype.freeze=H.prototype.freeze;H.className="List";function pb(a){this.Fg=a;a.Ma=null;this.oa=a.v;this.qa=null}pb.prototype.reset=function(){var a=this.Fg;a.Ma=null;this.oa=a.v;this.qa=null};pb.prototype.next=function(){var a=this.Fg;if(a.v!==this.oa){if(null===this.key)return!1;Ca(a)}var b=this.qa;b=null===b?a.ga:b.wa;if(null!==b)return this.qa=b,this.value=b.value,this.key=b.key,!0;this.Yd();return!1};pb.prototype.xd=function(){return this.next()};
55 pb.prototype.first=function(){var a=this.Fg;this.oa=a.v;a=a.ga;if(null!==a){this.qa=a;var b=a.value;this.key=a.key;return this.value=b}return null};pb.prototype.any=function(a){var b=this.Fg;b.Ma=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(a(d.value))return!0;b.v!==c&&Ca(b);d=d.wa}return!1};pb.prototype.all=function(a){var b=this.Fg;b.Ma=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(!a(d.value))return!1;b.v!==c&&Ca(b);d=d.wa}return!0};
56 pb.prototype.each=function(a){var b=this.Fg;b.Ma=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;)a(d.value),b.v!==c&&Ca(b),d=d.wa;return this};pb.prototype.map=function(a){var b=this.Fg;b.Ma=null;for(var c=new H,d=b.v,e=b.ga;null!==e;)c.add(a(e.value)),b.v!==d&&Ca(b),e=e.wa;return c.iterator};pb.prototype.filter=function(a){var b=this.Fg;b.Ma=null;for(var c=new H,d=b.v,e=b.ga;null!==e;){var f=e.value;a(f)&&c.add(f);b.v!==d&&Ca(b);e=e.wa}return c.iterator};
57 pb.prototype.Yd=function(){this.value=this.key=null;this.oa=-1;this.Fg.Ma=this};pb.prototype.toString=function(){return null!==this.qa?"SetIterator@"+this.qa.value:"SetIterator"};na.Object.defineProperties(pb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.Fg.Lb}}});pb.prototype.first=pb.prototype.first;pb.prototype.hasNext=pb.prototype.xd;pb.prototype.next=pb.prototype.next;pb.prototype.reset=pb.prototype.reset;
58 pb.className="SetIterator";function I(a){eb(this);this.s=!1;this.Nb={};this.Lb=0;this.Ma=null;this.v=0;this.mf=this.ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Fa():this.addAll(a))}t=I.prototype;t.ub=function(){var a=this.v;a++;999999999<a&&(a=0);this.v=a};t.freeze=function(){this.s=!0;return this};t.ka=function(){this.s=!1;return this};t.toString=function(){return"Set()#"+ob(this)};
59 t.add=function(a){if(null===a)return this;this.s&&va(this,a);var b=a;Ga(a)&&(b=rb(a));void 0===this.Nb[b]&&(this.Lb++,a=new sb(a,a),this.Nb[b]=a,b=this.mf,null===b?this.ga=a:(a.jm=b,b.wa=a),this.mf=a,this.ub());return this};t.addAll=function(a){if(null===a)return this;this.s&&va(this);if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.add(a[c]);else for(a=a.iterator;a.next();)this.add(a.value);return this};
60 t.contains=function(a){if(null===a)return!1;var b=a;return Ga(a)&&(b=ob(a),void 0===b)?!1:void 0!==this.Nb[b]};t.has=function(a){return this.contains(a)};t.Vz=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(!this.contains(a.value))return!1;return!0};t.Wz=function(a){if(null===a)return!0;for(a=a.iterator;a.next();)if(this.contains(a.value))return!0;return!1};t.first=function(){var a=this.ga;return null===a?null:a.value};
61 I.prototype.any=function(a){for(var b=this.v,c=this.ga;null!==c;){if(a(c.value))return!0;this.v!==b&&Ca(this);c=c.wa}return!1};I.prototype.all=function(a){for(var b=this.v,c=this.ga;null!==c;){if(!a(c.value))return!1;this.v!==b&&Ca(this);c=c.wa}return!0};I.prototype.each=function(a){for(var b=this.v,c=this.ga;null!==c;)a(c.value),this.v!==b&&Ca(this),c=c.wa;return this};I.prototype.map=function(a){for(var b=new I,c=this.v,d=this.ga;null!==d;)b.add(a(d.value)),this.v!==c&&Ca(this),d=d.wa;return b};
62 I.prototype.filter=function(a){for(var b=new I,c=this.v,d=this.ga;null!==d;){var e=d.value;a(e)&&b.add(e);this.v!==c&&Ca(this);d=d.wa}return b};t=I.prototype;t.remove=function(a){if(null===a)return!1;this.s&&va(this,a);var b=a;if(Ga(a)&&(b=ob(a),void 0===b))return!1;a=this.Nb[b];if(void 0===a)return!1;var c=a.wa,d=a.jm;null!==c&&(c.jm=d);null!==d&&(d.wa=c);this.ga===a&&(this.ga=c);this.mf===a&&(this.mf=d);delete this.Nb[b];this.Lb--;this.ub();return!0};t.delete=function(a){return this.remove(a)};
63 t.mr=function(a){if(null===a)return this;this.s&&va(this);if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.remove(a[c]);else for(a=a.iterator;a.next();)this.remove(a.value);return this};t.rB=function(a){if(null===a||0===this.count)return this;this.s&&va(this);var b=new I;b.addAll(a);a=[];for(var c=this.iterator;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.mr(a);return this};t.clear=function(){this.s&&va(this);this.Nb={};this.Lb=0;null!==this.Ma&&this.Ma.reset();this.mf=this.ga=null;this.ub()};
64 I.prototype.copy=function(){var a=new I,b=this.Nb,c;for(c in b)a.add(b[c].value);return a};I.prototype.ta=function(){var a=Array(this.Lb),b=this.Nb,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};I.prototype.Yw=function(){var a=new H,b=this.Nb,c;for(c in b)a.add(b[c].value);return a};function eb(a){a.__gohashid=wb++}function rb(a){var b=a.__gohashid;void 0===b&&(b=wb++,a.__gohashid=b);return b}function ob(a){return a.__gohashid}
65 na.Object.defineProperties(I.prototype,{count:{configurable:!0,get:function(){return this.Lb}},size:{configurable:!0,get:function(){return this.Lb}},iterator:{configurable:!0,get:function(){if(0>=this.Lb)return kb;var a=this.Ma;return null!==a?(a.reset(),a):new pb(this)}}});I.prototype.toList=I.prototype.Yw;I.prototype.toArray=I.prototype.ta;I.prototype.clear=I.prototype.clear;I.prototype.retainAll=I.prototype.rB;I.prototype.removeAll=I.prototype.mr;
66 I.prototype["delete"]=I.prototype.delete;I.prototype.remove=I.prototype.remove;I.prototype.first=I.prototype.first;I.prototype.containsAny=I.prototype.Wz;I.prototype.containsAll=I.prototype.Vz;I.prototype.has=I.prototype.has;I.prototype.contains=I.prototype.contains;I.prototype.addAll=I.prototype.addAll;I.prototype.add=I.prototype.add;I.prototype.thaw=I.prototype.ka;I.prototype.freeze=I.prototype.freeze;var wb=1;I.className="Set";I.uniqueHash=eb;I.hashIdUnique=rb;I.hashId=ob;
67 function xb(a){this.ma=a;this.oa=a.v;this.qa=null}xb.prototype.reset=function(){this.oa=this.ma.v;this.qa=null};xb.prototype.next=function(){var a=this.ma;if(a.v!==this.oa){if(null===this.key)return!1;Ca(a)}var b=this.qa;b=null===b?a.ga:b.wa;if(null!==b)return this.qa=b,this.value=this.key=a=b.key,!0;this.Yd();return!1};xb.prototype.xd=function(){return this.next()};xb.prototype.first=function(){var a=this.ma;this.oa=a.v;a=a.ga;return null!==a?(this.qa=a,this.value=this.key=a=a.key):null};
68 xb.prototype.any=function(a){var b=this.ma,c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(a(d.key))return!0;b.v!==c&&Ca(b);d=d.wa}return!1};xb.prototype.all=function(a){var b=this.ma,c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(!a(d.key))return!1;b.v!==c&&Ca(b);d=d.wa}return!0};xb.prototype.each=function(a){var b=this.ma,c=b.v;this.qa=null;for(var d=b.ga;null!==d;)a(d.key),b.v!==c&&Ca(b),d=d.wa;return this};
69 xb.prototype.map=function(a){var b=this.ma,c=b.v;this.qa=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e.key)),b.v!==c&&Ca(b),e=e.wa;return d.iterator};xb.prototype.filter=function(a){var b=this.ma,c=b.v;this.qa=null;for(var d=new H,e=b.ga;null!==e;){var f=e.key;a(f)&&d.add(f);b.v!==c&&Ca(b);e=e.wa}return d.iterator};xb.prototype.Yd=function(){this.value=this.key=null;this.oa=-1};xb.prototype.toString=function(){return null!==this.qa?"MapKeySetIterator@"+this.qa.value:"MapKeySetIterator"};
70 na.Object.defineProperties(xb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ma.Lb}}});xb.prototype.first=xb.prototype.first;xb.prototype.hasNext=xb.prototype.xd;xb.prototype.next=xb.prototype.next;xb.prototype.reset=xb.prototype.reset;xb.className="MapKeySetIterator";function yb(a){I.call(this);eb(this);this.s=!0;this.ma=a}ma(yb,I);t=yb.prototype;t.freeze=function(){return this};t.ka=function(){return this};
71 t.toString=function(){return"MapKeySet("+this.ma.toString()+")"};t.add=function(){v("This Set is read-only: "+this.toString());return this};t.contains=function(a){return this.ma.contains(a)};t.has=function(a){return this.contains(a)};t.remove=function(){v("This Set is read-only: "+this.toString());return!1};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.ma.ga;return null!==a?a.key:null};
72 yb.prototype.any=function(a){for(var b=this.ma.ga;null!==b;){if(a(b.key))return!0;b=b.wa}return!1};yb.prototype.all=function(a){for(var b=this.ma.ga;null!==b;){if(!a(b.key))return!1;b=b.wa}return!0};yb.prototype.each=function(a){for(var b=this.ma.ga;null!==b;)a(b.key),b=b.wa;return this};yb.prototype.map=function(a){for(var b=new I,c=this.ma.ga;null!==c;)b.add(a(c.key)),c=c.wa;return b};yb.prototype.filter=function(a){for(var b=new I,c=this.ma.ga;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.wa}return b};
73 yb.prototype.copy=function(){return new yb(this.ma)};yb.prototype.Zw=function(){var a=new I,b=this.ma.Nb,c;for(c in b)a.add(b[c].key);return a};yb.prototype.ta=function(){var a=this.ma.Nb,b=Array(this.ma.Lb),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};yb.prototype.Yw=function(){var a=new H,b=this.ma.Nb,c;for(c in b)a.add(b[c].key);return a};
74 na.Object.defineProperties(yb.prototype,{count:{configurable:!0,get:function(){return this.ma.Lb}},size:{configurable:!0,get:function(){return this.ma.Lb}},iterator:{configurable:!0,get:function(){return 0>=this.ma.Lb?kb:new xb(this.ma)}}});yb.prototype.toList=yb.prototype.Yw;yb.prototype.toArray=yb.prototype.ta;yb.prototype.toSet=yb.prototype.Zw;yb.prototype.first=yb.prototype.first;yb.prototype.clear=yb.prototype.clear;yb.prototype["delete"]=yb.prototype.delete;
75 yb.prototype.remove=yb.prototype.remove;yb.prototype.has=yb.prototype.has;yb.prototype.contains=yb.prototype.contains;yb.prototype.add=yb.prototype.add;yb.prototype.thaw=yb.prototype.ka;yb.prototype.freeze=yb.prototype.freeze;yb.className="MapKeySet";function zb(a){this.ma=a;a.lf=null;this.oa=a.v;this.qa=null}zb.prototype.reset=function(){var a=this.ma;a.lf=null;this.oa=a.v;this.qa=null};
76 zb.prototype.next=function(){var a=this.ma;if(a.v!==this.oa){if(null===this.key)return!1;Ca(a)}var b=this.qa;b=null===b?a.ga:b.wa;if(null!==b)return this.qa=b,this.value=b.value,this.key=b.key,!0;this.Yd();return!1};zb.prototype.xd=function(){return this.next()};zb.prototype.first=function(){var a=this.ma;this.oa=a.v;a=a.ga;if(null!==a){this.qa=a;var b=a.value;this.key=a.key;return this.value=b}return null};
77 zb.prototype.any=function(a){var b=this.ma;b.lf=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(a(d.value))return!0;b.v!==c&&Ca(b);d=d.wa}return!1};zb.prototype.all=function(a){var b=this.ma;b.lf=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(!a(d.value))return!1;b.v!==c&&Ca(b);d=d.wa}return!0};zb.prototype.each=function(a){var b=this.ma;b.lf=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;)a(d.value),b.v!==c&&Ca(b),d=d.wa;return this};
78 zb.prototype.map=function(a){var b=this.ma;b.lf=null;var c=b.v;this.qa=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e.value)),b.v!==c&&Ca(b),e=e.wa;return d.iterator};zb.prototype.filter=function(a){var b=this.ma;b.lf=null;var c=b.v;this.qa=null;for(var d=new H,e=b.ga;null!==e;){var f=e.value;a(f)&&d.add(f);b.v!==c&&Ca(b);e=e.wa}return d.iterator};zb.prototype.Yd=function(){this.value=this.key=null;this.oa=-1;this.ma.lf=this};
79 zb.prototype.toString=function(){return null!==this.qa?"MapValueSetIterator@"+this.qa.value:"MapValueSetIterator"};na.Object.defineProperties(zb.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ma.Lb}}});zb.prototype.first=zb.prototype.first;zb.prototype.hasNext=zb.prototype.xd;zb.prototype.next=zb.prototype.next;zb.prototype.reset=zb.prototype.reset;zb.className="MapValueSetIterator";
80 function sb(a,b){this.key=a;this.value=b;this.jm=this.wa=null}sb.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};sb.className="KeyValuePair";function Ab(a){this.ma=a;a.Ma=null;this.oa=a.v;this.qa=null}Ab.prototype.reset=function(){var a=this.ma;a.Ma=null;this.oa=a.v;this.qa=null};
81 Ab.prototype.next=function(){var a=this.ma;if(a.v!==this.oa){if(null===this.key)return!1;Ca(a)}var b=this.qa;b=null===b?a.ga:b.wa;if(null!==b)return this.qa=b,this.key=b.key,this.value=b.value,!0;this.Yd();return!1};Ab.prototype.xd=function(){return this.next()};Ab.prototype.first=function(){var a=this.ma;this.oa=a.v;a=a.ga;return null!==a?(this.qa=a,this.key=a.key,this.value=a.value,a):null};
82 Ab.prototype.any=function(a){var b=this.ma;b.Ma=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(a(d))return!0;b.v!==c&&Ca(b);d=d.wa}return!1};Ab.prototype.all=function(a){var b=this.ma;b.Ma=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;){if(!a(d))return!1;b.v!==c&&Ca(b);d=d.wa}return!0};Ab.prototype.each=function(a){var b=this.ma;b.Ma=null;var c=b.v;this.qa=null;for(var d=b.ga;null!==d;)a(d),b.v!==c&&Ca(b),d=d.wa;return this};
83 Ab.prototype.map=function(a){var b=this.ma;b.Ma=null;var c=b.v;this.qa=null;for(var d=new H,e=b.ga;null!==e;)d.add(a(e)),b.v!==c&&Ca(b),e=e.wa;return d.iterator};Ab.prototype.filter=function(a){var b=this.ma;b.Ma=null;var c=b.v;this.qa=null;for(var d=new H,e=b.ga;null!==e;)a(e)&&d.add(e),b.v!==c&&Ca(b),e=e.wa;return d.iterator};Ab.prototype.Yd=function(){this.value=this.key=null;this.oa=-1;this.ma.Ma=this};Ab.prototype.toString=function(){return null!==this.qa?"MapIterator@"+this.qa:"MapIterator"};
84 na.Object.defineProperties(Ab.prototype,{iterator:{configurable:!0,get:function(){return this}},count:{configurable:!0,get:function(){return this.ma.Lb}}});Ab.prototype.first=Ab.prototype.first;Ab.prototype.hasNext=Ab.prototype.xd;Ab.prototype.next=Ab.prototype.next;Ab.prototype.reset=Ab.prototype.reset;Ab.className="MapIterator";
85 function Bb(a){eb(this);this.s=!1;this.Nb={};this.Lb=0;this.lf=this.Ma=null;this.v=0;this.mf=this.ga=null;void 0!==a&&("function"===typeof a||"string"===typeof a?Fa():this.addAll(a))}t=Bb.prototype;t.ub=function(){var a=this.v;a++;999999999<a&&(a=0);this.v=a};t.freeze=function(){this.s=!0;return this};t.ka=function(){this.s=!1;return this};t.toString=function(){return"Map()#"+ob(this)};
86 t.add=function(a,b){this.s&&va(this,a);var c=a;Ga(a)&&(c=rb(a));var d=this.Nb[c];void 0===d?(this.Lb++,a=new sb(a,b),this.Nb[c]=a,c=this.mf,null===c?this.ga=a:(a.jm=c,c.wa=a),this.mf=a,this.ub()):d.value=b;return this};t.set=function(a,b){return this.add(a,b)};
87 t.addAll=function(a){if(null===a)return this;if(Ha(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];this.add(d.key,d.value)}else if(a instanceof Bb)for(a=a.iterator;a.next();)this.add(a.key,a.value);else for(a=a.iterator;a.next();)b=a.value,this.add(b.key,b.value);return this};t.first=function(){return this.ga};Bb.prototype.any=function(a){for(var b=this.v,c=this.ga;null!==c;){if(a(c))return!0;this.v!==b&&Ca(this);c=c.wa}return!1};
88 Bb.prototype.all=function(a){for(var b=this.v,c=this.ga;null!==c;){if(!a(c))return!1;this.v!==b&&Ca(this);c=c.wa}return!0};Bb.prototype.each=function(a){for(var b=this.v,c=this.ga;null!==c;)a(c),this.v!==b&&Ca(this),c=c.wa;return this};Bb.prototype.map=function(a){for(var b=new Bb,c=this.v,d=this.ga;null!==d;)b.add(d.key,a(d)),this.v!==c&&Ca(this),d=d.wa;return b};Bb.prototype.filter=function(a){for(var b=new Bb,c=this.v,d=this.ga;null!==d;)a(d)&&b.add(d.key,d.value),this.v!==c&&Ca(this),d=d.wa;return b};
89 t=Bb.prototype;t.contains=function(a){var b=a;return Ga(a)&&(b=ob(a),void 0===b)?!1:void 0!==this.Nb[b]};t.has=function(a){return this.contains(a)};t.J=function(a){var b=a;if(Ga(a)&&(b=ob(a),void 0===b))return null;a=this.Nb[b];return void 0===a?null:a.value};t.get=function(a){return this.J(a)};
90 t.remove=function(a){if(null===a)return!1;this.s&&va(this,a);var b=a;if(Ga(a)&&(b=ob(a),void 0===b))return!1;a=this.Nb[b];if(void 0===a)return!1;var c=a.wa,d=a.jm;null!==c&&(c.jm=d);null!==d&&(d.wa=c);this.ga===a&&(this.ga=c);this.mf===a&&(this.mf=d);delete this.Nb[b];this.Lb--;this.ub();return!0};t.delete=function(a){return this.remove(a)};t.clear=function(){this.s&&va(this);this.Nb={};this.Lb=0;null!==this.Ma&&this.Ma.reset();null!==this.lf&&this.lf.reset();this.mf=this.ga=null;this.ub()};
91 Bb.prototype.copy=function(){var a=new Bb,b=this.Nb,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};Bb.prototype.ta=function(){var a=this.Nb,b=Array(this.Lb),c=0,d;for(d in a){var e=a[d];b[c]=new sb(e.key,e.value);c++}return b};Bb.prototype.Wf=function(){return new yb(this)};
92 na.Object.defineProperties(Bb.prototype,{count:{configurable:!0,get:function(){return this.Lb}},size:{configurable:!0,get:function(){return this.Lb}},iterator:{configurable:!0,get:function(){if(0>=this.count)return kb;var a=this.Ma;return null!==a?(a.reset(),a):new Ab(this)}},iteratorKeys:{configurable:!0,get:function(){return 0>=this.count?kb:new xb(this)}},iteratorValues:{configurable:!0,get:function(){if(0>=this.count)return kb;
93 var a=this.lf;return null!==a?(a.reset(),a):new zb(this)}}});Bb.prototype.toKeySet=Bb.prototype.Wf;Bb.prototype.toArray=Bb.prototype.ta;Bb.prototype.clear=Bb.prototype.clear;Bb.prototype["delete"]=Bb.prototype.delete;Bb.prototype.remove=Bb.prototype.remove;Bb.prototype.get=Bb.prototype.get;Bb.prototype.getValue=Bb.prototype.J;Bb.prototype.has=Bb.prototype.has;Bb.prototype.contains=Bb.prototype.contains;Bb.prototype.first=Bb.prototype.first;Bb.prototype.addAll=Bb.prototype.addAll;
94 Bb.prototype.set=Bb.prototype.set;Bb.prototype.add=Bb.prototype.add;Bb.prototype.thaw=Bb.prototype.ka;Bb.prototype.freeze=Bb.prototype.freeze;Bb.className="Map";function J(a,b){void 0===a?this.H=this.G=0:"number"===typeof a&&"number"===typeof b?(this.G=a,this.H=b):v("Invalid arguments to Point constructor: "+a+", "+b);this.s=!1}J.prototype.assign=function(a){this.G=a.G;this.H=a.H;return this};J.prototype.h=function(a,b){this.G=a;this.H=b;return this};
95 J.prototype.Ug=function(a,b){F&&(A(a,"number",J,"setTo:x"),A(b,"number",J,"setTo:y"),this.ha());this.G=a;this.H=b;return this};J.prototype.set=function(a){F&&(w(a,J,J,"set:p"),this.ha());this.G=a.G;this.H=a.H;return this};J.prototype.copy=function(){var a=new J;a.G=this.G;a.H=this.H;return a};t=J.prototype;t.ia=function(){this.s=!0;Object.freeze(this);return this};t.K=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};
96 t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function Cb(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 J(c,e)}return new J}
97 function Db(a){F&&w(a,J);return a.x.toString()+" "+a.y.toString()}t.toString=function(){return"Point("+this.x+","+this.y+")"};t.A=function(a){return a instanceof J?this.G===a.x&&this.H===a.y:!1};t.qj=function(a,b){return this.G===a&&this.H===b};t.Wa=function(a){return K.B(this.G,a.x)&&K.B(this.H,a.y)};t.add=function(a){F&&(w(a,J,J,"add:p"),this.ha());this.G+=a.x;this.H+=a.y;return this};t.oe=function(a){F&&(w(a,J,J,"subtract:p"),this.ha());this.G-=a.x;this.H-=a.y;return this};
98 t.offset=function(a,b){F&&(C(a,J,"offset:dx"),C(b,J,"offset:dy"),this.ha());this.G+=a;this.H+=b;return this};J.prototype.rotate=function(a){F&&(C(a,J,"rotate:angle"),this.ha());if(0===a)return this;var b=this.G,c=this.H;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.G=a*b-d*c;this.H=d*b+a*c;return this};t=J.prototype;
99 t.scale=function(a,b){F&&(C(a,J,"scale:sx"),C(b,J,"scale:sy"),this.ha());this.G*=a;this.H*=b;return this};t.Ve=function(a){F&&w(a,J,J,"distanceSquaredPoint:p");var b=a.x-this.G;a=a.y-this.H;return b*b+a*a};t.wd=function(a,b){F&&(C(a,J,"distanceSquared:px"),C(b,J,"distanceSquared:py"));a-=this.G;b-=this.H;return a*a+b*b};t.normalize=function(){F&&this.ha();var a=this.G,b=this.H,c=Math.sqrt(a*a+b*b);0<c&&(this.G=a/c,this.H=b/c);return this};
100 t.Va=function(a){F&&w(a,J,J,"directionPoint:p");return Eb(a.x-this.G,a.y-this.H)};t.direction=function(a,b){F&&(C(a,J,"direction:px"),C(b,J,"direction:py"));return Eb(a-this.G,b-this.H)};function Eb(a,b){if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;var c=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?c=0>b?c+180:180-c:0>b&&(c=360-c);return c}
101 t.hB=function(a,b,c,d){F&&(C(a,J,"projectOntoLineSegment:px"),C(b,J,"projectOntoLineSegment:py"),C(c,J,"projectOntoLineSegment:qx"),C(d,J,"projectOntoLineSegment:qy"));K.ai(a,b,c,d,this.G,this.H,this);return this};t.iB=function(a,b){F&&(w(a,J,J,"projectOntoLineSegmentPoint:p"),w(b,J,J,"projectOntoLineSegmentPoint:q"));K.ai(a.x,a.y,b.x,b.y,this.G,this.H,this);return this};
102 t.wB=function(a,b,c,d){F&&(C(a,J,"snapToGrid:originx"),C(b,J,"snapToGrid:originy"),C(c,J,"snapToGrid:cellwidth"),C(d,J,"snapToGrid:cellheight"));K.Tq(this.G,this.H,a,b,c,d,this);return this};t.xB=function(a,b){F&&(w(a,J,J,"snapToGridPoint:p"),w(b,Fb,J,"snapToGridPoint:q"));K.Tq(this.G,this.H,a.x,a.y,b.width,b.height,this);return this};t.Fj=function(a,b){F&&(w(a,L,J,"setRectSpot:r"),w(b,N,J,"setRectSpot:spot"),this.ha());this.G=a.x+b.x*a.width+b.offsetX;this.H=a.y+b.y*a.height+b.offsetY;return this};
103 t.el=function(a,b,c,d,e){F&&(C(a,J,"setSpot:x"),C(b,J,"setSpot:y"),C(c,J,"setSpot:w"),C(d,J,"setSpot:h"),(0>c||0>d)&&v("Point.setSpot:Width and height cannot be negative"),w(e,N,J,"setSpot:spot"),this.ha());this.G=a+e.x*c+e.offsetX;this.H=b+e.y*d+e.offsetY;return this};t.transform=function(a){F&&w(a,Gb,J,"transform:t");a.Aa(this);return this};function Hb(a,b){F&&w(b,Gb,J,"transformInverted:t");b.Pd(a);return a}
104 function Ib(a,b,c,d,e,f){F&&(C(a,J,"distanceLineSegmentSquared:px"),C(b,J,"distanceLineSegmentSquared:py"),C(c,J,"distanceLineSegmentSquared:ax"),C(d,J,"distanceLineSegmentSquared:ay"),C(e,J,"distanceLineSegmentSquared:bx"),C(f,J,"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}
105 function Jb(a,b,c,d){F&&(C(a,J,"distanceSquared:px"),C(b,J,"distanceSquared:py"),C(c,J,"distanceSquared:qx"),C(d,J,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b}function Kb(a,b,c,d){F&&(C(a,J,"direction:px"),C(b,J,"direction:py"),C(c,J,"direction:qx"),C(d,J,"direction:qy"));a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d}
106 t.o=function(){return isFinite(this.x)&&isFinite(this.y)};J.alloc=function(){var a=Lb.pop();return void 0===a?new J:a};J.allocAt=function(a,b){var c=Lb.pop();if(void 0===c)return new J(a,b);c.x=a;c.y=b;return c};J.free=function(a){Lb.push(a)};
107 na.Object.defineProperties(J.prototype,{x:{configurable:!0,get:function(){return this.G},set:function(a){F&&(A(a,"number",J,"x"),this.ha(a));this.G=a}},y:{configurable:!0,get:function(){return this.H},set:function(a){F&&(A(a,"number",J,"y"),this.ha(a));this.H=a}}});J.prototype.isReal=J.prototype.o;J.prototype.setSpot=J.prototype.el;J.prototype.setRectSpot=J.prototype.Fj;J.prototype.snapToGridPoint=J.prototype.xB;J.prototype.snapToGrid=J.prototype.wB;
108 J.prototype.projectOntoLineSegmentPoint=J.prototype.iB;J.prototype.projectOntoLineSegment=J.prototype.hB;J.intersectingLineSegments=function(a,b,c,d,e,f,g,h){F&&(C(a,L,"intersectingLineSegments:a1x"),C(b,L,"intersectingLineSegments:a1y"),C(c,L,"intersectingLineSegments:a2x"),C(d,L,"intersectingLineSegments:a2y"),C(e,L,"intersectingLineSegments:b1x"),C(f,L,"intersectingLineSegments:b1y"),C(g,L,"intersectingLineSegments:b2x"),C(h,L,"intersectingLineSegments:b2y"));return K.Qm(a,b,c,d,e,f,g,h)};
109 J.prototype.direction=J.prototype.direction;J.prototype.directionPoint=J.prototype.Va;J.prototype.normalize=J.prototype.normalize;J.prototype.distanceSquared=J.prototype.wd;J.prototype.distanceSquaredPoint=J.prototype.Ve;J.prototype.scale=J.prototype.scale;J.prototype.rotate=J.prototype.rotate;J.prototype.offset=J.prototype.offset;J.prototype.subtract=J.prototype.oe;J.prototype.add=J.prototype.add;J.prototype.equalsApprox=J.prototype.Wa;J.prototype.equalTo=J.prototype.qj;J.prototype.equals=J.prototype.A;
110 J.prototype.set=J.prototype.set;J.prototype.setTo=J.prototype.Ug;var Mb=null,Nb=null,Ob=null,Pb=null,Qb=null,Lb=[];J.className="Point";J.parse=Cb;J.stringify=Db;J.distanceLineSegmentSquared=Ib;J.distanceSquared=Jb;J.direction=Kb;J.Origin=Mb=(new J(0,0)).ia();J.InfiniteTopLeft=Nb=(new J(-Infinity,-Infinity)).ia();J.InfiniteBottomRight=Ob=(new J(Infinity,Infinity)).ia();J.SixPoint=Pb=(new J(6,6)).ia();J.NoPoint=Qb=(new J(NaN,NaN)).ia();J.parse=Cb;J.stringify=Db;J.distanceLineSegmentSquared=Ib;
111 J.distanceSquared=Jb;J.direction=Kb;function Fb(a,b){void 0===a?this.ea=this.fa=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.fa=a,this.ea=b):v("Invalid arguments to Size constructor: "+a+", "+b);this.s=!1}var Rb,Sb,Tb,Ub,Vb,Wb,Zb;Fb.prototype.assign=function(a){this.fa=a.fa;this.ea=a.ea;return this};Fb.prototype.h=function(a,b){this.fa=a;this.ea=b;return this};
112 Fb.prototype.Ug=function(a,b){F&&(A(a,"number",Fb,"setTo:w"),A(b,"number",Fb,"setTo:h"),0>a&&za(a,">= 0",Fb,"setTo:w"),0>b&&za(b,">= 0",Fb,"setTo:h"),this.ha());this.fa=a;this.ea=b;return this};Fb.prototype.set=function(a){F&&(w(a,Fb,Fb,"set:s"),this.ha());this.fa=a.fa;this.ea=a.ea;return this};Fb.prototype.copy=function(){var a=new Fb;a.fa=this.fa;a.ea=this.ea;return a};t=Fb.prototype;t.ia=function(){this.s=!0;Object.freeze(this);return this};
113 t.K=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};
114 function $b(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 Fb(c,e)}return new Fb}function ac(a){F&&w(a,Fb);return a.width.toString()+" "+a.height.toString()}t.toString=function(){return"Size("+this.width+","+this.height+")"};t.A=function(a){return a instanceof Fb?this.fa===a.width&&this.ea===a.height:!1};t.qj=function(a,b){return this.fa===a&&this.ea===b};
115 t.Wa=function(a){return K.B(this.fa,a.width)&&K.B(this.ea,a.height)};t.o=function(){return isFinite(this.width)&&isFinite(this.height)};Fb.alloc=function(){var a=bc.pop();return void 0===a?new Fb:a};Fb.free=function(a){bc.push(a)};
116 na.Object.defineProperties(Fb.prototype,{width:{configurable:!0,get:function(){return this.fa},set:function(a){F&&(A(a,"number",Fb,"width"),this.ha(a));0>a&&za(a,">= 0",Fb,"width");this.fa=a}},height:{configurable:!0,get:function(){return this.ea},set:function(a){F&&(A(a,"number",Fb,"height"),this.ha(a));0>a&&za(a,">= 0",Fb,"height");this.ea=a}}});Fb.prototype.isReal=Fb.prototype.o;Fb.prototype.equalsApprox=Fb.prototype.Wa;Fb.prototype.equalTo=Fb.prototype.qj;
117 Fb.prototype.equals=Fb.prototype.A;Fb.prototype.set=Fb.prototype.set;Fb.prototype.setTo=Fb.prototype.Ug;var bc=[];Fb.className="Size";Fb.parse=$b;Fb.stringify=ac;Fb.ZeroSize=Rb=(new Fb(0,0)).ia();Fb.OneSize=Sb=(new Fb(1,1)).ia();Fb.SixSize=Tb=(new Fb(6,6)).ia();Fb.EightSize=Ub=(new Fb(8,8)).ia();Fb.TenSize=Vb=(new Fb(10,10)).ia();Fb.InfiniteSize=Wb=(new Fb(Infinity,Infinity)).ia();Fb.NoSize=Zb=(new Fb(NaN,NaN)).ia();Fb.parse=$b;Fb.stringify=ac;
118 function L(a,b,c,d){void 0===a?this.ea=this.fa=this.H=this.G=0:a instanceof J?(c=a.x,a=a.y,b instanceof J?(d=b.x,b=b.y,this.G=Math.min(c,d),this.H=Math.min(a,b),this.fa=Math.abs(c-d),this.ea=Math.abs(a-b)):b instanceof Fb?(this.G=c,this.H=a,this.fa=b.width,this.ea=b.height):v("Incorrect arguments supplied to Rect constructor")):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.G=a,this.H=b,this.fa=c,this.ea=d):v("Invalid arguments to Rect constructor: "+
119 a+", "+b+", "+c+", "+d);this.s=!1}t=L.prototype;t.assign=function(a){this.G=a.G;this.H=a.H;this.fa=a.fa;this.ea=a.ea;return this};t.h=function(a,b,c,d){this.G=a;this.H=b;this.fa=c;this.ea=d;return this};function cc(a,b,c){a.fa=b;a.ea=c}t.Ug=function(a,b,c,d){F&&(A(a,"number",L,"setTo:x"),A(b,"number",L,"setTo:y"),A(c,"number",L,"setTo:w"),A(d,"number",L,"setTo:h"),0>c&&za(c,">= 0",L,"setTo:w"),0>d&&za(d,">= 0",L,"setTo:h"),this.ha());this.G=a;this.H=b;this.fa=c;this.ea=d;return this};
120 t.set=function(a){F&&(w(a,L,L,"set:r"),this.ha());this.G=a.G;this.H=a.H;this.fa=a.fa;this.ea=a.ea;return this};t.Wc=function(a){F&&(w(a,J,L,"setPoint:p"),this.ha());this.G=a.x;this.H=a.y;return this};t.vB=function(a){F&&(w(a,Fb,L,"setSize:s"),this.ha());this.fa=a.width;this.ea=a.height;return this};L.prototype.copy=function(){var a=new L;a.G=this.G;a.H=this.H;a.fa=this.fa;a.ea=this.ea;return a};t=L.prototype;t.ia=function(){this.s=!0;Object.freeze(this);return this};
121 t.K=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};
122 function dc(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 L(c,e,f,g)}return new L}function ec(a){F&&w(a,L);return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()}
123 t.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};t.A=function(a){return a instanceof L?this.G===a.x&&this.H===a.y&&this.fa===a.width&&this.ea===a.height:!1};t.qj=function(a,b,c,d){return this.G===a&&this.H===b&&this.fa===c&&this.ea===d};t.Wa=function(a){return K.B(this.G,a.x)&&K.B(this.H,a.y)&&K.B(this.fa,a.width)&&K.B(this.ea,a.height)};function fc(a,b){return K.da(a.G,b.x)&&K.da(a.H,b.y)&&K.da(a.fa,b.width)&&K.da(a.ea,b.height)}
124 t.ca=function(a){F&&w(a,J,L,"containsPoint:p");return this.G<=a.x&&this.G+this.fa>=a.x&&this.H<=a.y&&this.H+this.ea>=a.y};t.Te=function(a){F&&w(a,L,L,"containsRect:r");return this.G<=a.x&&a.x+a.width<=this.G+this.fa&&this.H<=a.y&&a.y+a.height<=this.H+this.ea};
125 t.contains=function(a,b,c,d){F?(C(a,L,"contains:x"),C(b,L,"contains:y"),void 0===c?c=0:C(c,L,"contains:w"),void 0===d?d=0:C(d,L,"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.G<=a&&a+c<=this.G+this.fa&&this.H<=b&&b+d<=this.H+this.ea};t.offset=function(a,b){F&&(C(a,L,"offset:dx"),C(b,L,"offset:dy"),this.ha());this.G+=a;this.H+=b;return this};
126 t.Pc=function(a,b){F&&(C(a,L,"inflate:w"),C(b,L,"inflate:h"));return gc(this,b,a,b,a)};t.Hq=function(a){F&&w(a,hc,L,"addMargin:m");return gc(this,a.top,a.right,a.bottom,a.left)};t.Xw=function(a){F&&w(a,hc,L,"subtractMargin:m");return gc(this,-a.top,-a.right,-a.bottom,-a.left)};t.MA=function(a,b,c,d){F&&(C(a,L,"grow:t"),C(b,L,"grow:r"),C(c,L,"grow:b"),C(d,L,"grow:l"));return gc(this,a,b,c,d)};
127 function gc(a,b,c,d,e){F&&a.ha();var f=a.fa;c+e<=-f?(a.G+=f/2,a.fa=0):(a.G-=e,a.fa+=c+e);c=a.ea;b+d<=-c?(a.H+=c/2,a.ea=0):(a.H-=b,a.ea+=b+d);return a}t.Ty=function(a){F&&w(a,L,L,"intersectRect:r");return ic(this,a.x,a.y,a.width,a.height)};t.qw=function(a,b,c,d){F&&(C(a,L,"intersect:x"),C(b,L,"intersect:y"),C(c,L,"intersect:w"),C(d,L,"intersect:h"),(0>c||0>d)&&v("Rect.intersect:Width and height cannot be negative"));return ic(this,a,b,c,d)};
128 function ic(a,b,c,d,e){F&&a.ha();var f=Math.max(a.G,b),g=Math.max(a.H,c);b=Math.min(a.G+a.fa,b+d);c=Math.min(a.H+a.ea,c+e);a.G=f;a.H=g;a.fa=Math.max(0,b-f);a.ea=Math.max(0,c-g);return a}t.Sc=function(a){F&&w(a,L,L,"intersectsRect:r");return this.rw(a.x,a.y,a.width,a.height)};
129 t.rw=function(a,b,c,d){F&&(C(a,L,"intersects:x"),C(b,L,"intersects:y"),C(a,L,"intersects:w"),C(b,L,"intersects:h"),(0>c||0>d)&&v("Rect.intersects:Width and height cannot be negative"));var e=this.fa,f=this.G;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.ea;c=this.H;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};
130 function jc(a,b){var c=a.fa,d=a.G,e=b.x-10;if(d>b.width+10+10+e||e>c+d)return!1;c=a.ea;a=a.H;d=b.y-10;return a>b.height+10+10+d||d>c+a?!1:!0}t.af=function(a){F&&w(a,J,L,"unionPoint:p");return kc(this,a.x,a.y,0,0)};t.Xc=function(a){F&&w(a,L,L,"unionRect:r");return kc(this,a.G,a.H,a.fa,a.ea)};
131 t.hx=function(a,b,c,d){F?(C(a,L,"union:x"),C(b,L,"union:y"),void 0===c?c=0:C(c,L,"union:w"),void 0===d?d=0:C(d,L,"union:h"),(0>c||0>d)&&v("Rect.union:Width and height cannot be negative"),this.ha()):(void 0===c&&(c=0),void 0===d&&(d=0));return kc(this,a,b,c,d)};function kc(a,b,c,d,e){var f=Math.min(a.G,b),g=Math.min(a.H,c);b=Math.max(a.G+a.fa,b+d);c=Math.max(a.H+a.ea,c+e);a.G=f;a.H=g;a.fa=b-f;a.ea=c-g;return a}
132 t.el=function(a,b,c){F&&(C(a,L,"setSpot:x"),C(b,L,"setSpot:y"),w(c,N,L,"setSpot:spot"),this.ha());this.G=a-c.offsetX-c.x*this.fa;this.H=b-c.offsetY-c.y*this.ea;return this};
133 function lc(a,b,c,d,e,f,g,h){F?(C(a,L,"contains:rx"),C(b,L,"contains:ry"),C(c,L,"contains:rw"),C(d,L,"contains:rh"),C(e,L,"contains:x"),C(f,L,"contains:y"),void 0===g?g=0:C(g,L,"contains:w"),void 0===h?h=0:C(h,L,"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}
134 function pc(a,b,c,d,e,f,g,h){F&&(C(a,L,"intersects:rx"),C(b,L,"intersects:ry"),C(c,L,"intersects:rw"),C(d,L,"intersects:rh"),C(e,L,"intersects:x"),C(f,L,"intersects:y"),C(g,L,"intersects:w"),C(h,L,"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.o=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};t.SA=function(){return 0===this.width&&0===this.height};
135 L.alloc=function(){var a=qc.pop();return void 0===a?new L:a};L.allocAt=function(a,b,c,d){var e=qc.pop();return void 0===e?new L(a,b,c,d):e.h(a,b,c,d)};L.free=function(a){qc.push(a)};
136 na.Object.defineProperties(L.prototype,{x:{configurable:!0,get:function(){return this.G},set:function(a){F&&(A(a,"number",L,"x"),this.ha(a));this.G=a}},y:{configurable:!0,get:function(){return this.H},set:function(a){F&&(A(a,"number",L,"y"),this.ha(a));this.H=a}},width:{configurable:!0,get:function(){return this.fa},set:function(a){F&&(A(a,"number",L,"width"),this.ha(a));0>a&&za(a,">= 0",L,"width");this.fa=a}},height:{configurable:!0,get:function(){return this.ea},
137 set:function(a){F&&(A(a,"number",L,"height"),this.ha(a));0>a&&za(a,">= 0",L,"height");this.ea=a}},left:{configurable:!0,get:function(){return this.G},set:function(a){F&&(A(a,"number",L,"left"),this.ha(a));this.G=a}},top:{configurable:!0,get:function(){return this.H},set:function(a){F&&(A(a,"number",L,"top"),this.ha(a));this.H=a}},right:{configurable:!0,get:function(){return this.G+this.fa},set:function(a){F&&(C(a,L,"right"),this.ha(a));this.G+=a-(this.G+this.fa)}},
138 bottom:{configurable:!0,get:function(){return this.H+this.ea},set:function(a){F&&(C(a,L,"top"),this.ha(a));this.H+=a-(this.H+this.ea)}},position:{configurable:!0,get:function(){return new J(this.G,this.H)},set:function(a){F&&(w(a,J,L,"position"),this.ha(a));this.G=a.x;this.H=a.y}},size:{configurable:!0,get:function(){return new Fb(this.fa,this.ea)},set:function(a){F&&(w(a,Fb,L,"size"),this.ha(a));this.fa=a.width;this.ea=a.height}},center:{configurable:!0,
139 enumerable:!0,get:function(){return new J(this.G+this.fa/2,this.H+this.ea/2)},set:function(a){F&&(w(a,J,L,"center"),this.ha(a));this.G=a.x-this.fa/2;this.H=a.y-this.ea/2}},centerX:{configurable:!0,get:function(){return this.G+this.fa/2},set:function(a){F&&(C(a,L,"centerX"),this.ha(a));this.G=a-this.fa/2}},centerY:{configurable:!0,get:function(){return this.H+this.ea/2},set:function(a){F&&(C(a,L,"centerY"),this.ha(a));this.H=a-this.ea/2}}});L.prototype.isEmpty=L.prototype.SA;
140 L.prototype.isReal=L.prototype.o;L.intersectsLineSegment=function(a,b,c,d,e,f,g,h){F&&(C(a,L,"intersectsLineSegment:x"),C(b,L,"intersectsLineSegment:y"),C(c,L,"intersectsLineSegment:w"),C(d,L,"intersectsLineSegment:h"),C(e,L,"intersectsLineSegment:p1x"),C(f,L,"intersectsLineSegment:p1y"),C(g,L,"intersectsLineSegment:p2x"),C(h,L,"intersectsLineSegment:p2y"),(0>c||0>d)&&v("Rect.intersectsLineSegment: width and height cannot be negative"));return K.Uy(a,b,c,d,e,f,g,h)};L.prototype.setSpot=L.prototype.el;
141 L.prototype.union=L.prototype.hx;L.prototype.unionRect=L.prototype.Xc;L.prototype.unionPoint=L.prototype.af;L.prototype.intersects=L.prototype.rw;L.prototype.intersectsRect=L.prototype.Sc;L.prototype.intersect=L.prototype.qw;L.prototype.intersectRect=L.prototype.Ty;L.prototype.grow=L.prototype.MA;L.prototype.subtractMargin=L.prototype.Xw;L.prototype.addMargin=L.prototype.Hq;L.prototype.inflate=L.prototype.Pc;L.prototype.offset=L.prototype.offset;L.prototype.contains=L.prototype.contains;
142 L.prototype.containsRect=L.prototype.Te;L.prototype.containsPoint=L.prototype.ca;L.prototype.equalsApprox=L.prototype.Wa;L.prototype.equalTo=L.prototype.qj;L.prototype.equals=L.prototype.A;L.prototype.setSize=L.prototype.vB;L.prototype.setPoint=L.prototype.Wc;L.prototype.set=L.prototype.set;L.prototype.setTo=L.prototype.Ug;var rc=null,vc=null,qc=[];L.className="Rect";L.parse=dc;L.stringify=ec;L.contains=lc;L.intersects=pc;L.ZeroRect=rc=(new L(0,0,0,0)).ia();L.NoRect=vc=(new L(NaN,NaN,NaN,NaN)).ia();
143 L.parse=dc;L.stringify=ec;L.contains=lc;L.intersects=pc;function hc(a,b,c,d){void 0===a?this.Fe=this.se=this.Oe=this.Qe=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.s=!1}hc.prototype.assign=function(a){this.Qe=a.Qe;this.Oe=a.Oe;this.se=a.se;this.Fe=a.Fe;return this};
144 hc.prototype.Ug=function(a,b,c,d){F&&(A(a,"number",hc,"setTo:t"),A(b,"number",hc,"setTo:r"),A(c,"number",hc,"setTo:b"),A(d,"number",hc,"setTo:l"),this.ha());this.Qe=a;this.Oe=b;this.se=c;this.Fe=d;return this};hc.prototype.set=function(a){F&&(w(a,hc,hc,"assign:m"),this.ha());this.Qe=a.Qe;this.Oe=a.Oe;this.se=a.se;this.Fe=a.Fe;return this};hc.prototype.copy=function(){var a=new hc;a.Qe=this.Qe;a.Oe=this.Oe;a.se=this.se;a.Fe=this.Fe;return a};t=hc.prototype;
145 t.ia=function(){this.s=!0;Object.freeze(this);return this};t.K=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};
146 function wc(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new hc;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new hc(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new hc(c,e);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));return isNaN(g)?new hc(c,e):new hc(c,e,f,g)}return new hc}
147 function xc(a){F&&w(a,hc);return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()}t.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};t.A=function(a){return a instanceof hc?this.Qe===a.top&&this.Oe===a.right&&this.se===a.bottom&&this.Fe===a.left:!1};t.qj=function(a,b,c,d){return this.Qe===a&&this.Oe===b&&this.se===c&&this.Fe===d};
148 t.Wa=function(a){return K.B(this.Qe,a.top)&&K.B(this.Oe,a.right)&&K.B(this.se,a.bottom)&&K.B(this.Fe,a.left)};t.o=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};hc.alloc=function(){var a=yc.pop();return void 0===a?new hc:a};hc.free=function(a){yc.push(a)};
149 na.Object.defineProperties(hc.prototype,{top:{configurable:!0,get:function(){return this.Qe},set:function(a){F&&(C(a,hc,"top"),this.ha(a));this.Qe=a}},right:{configurable:!0,get:function(){return this.Oe},set:function(a){F&&(C(a,hc,"right"),this.ha(a));this.Oe=a}},bottom:{configurable:!0,get:function(){return this.se},set:function(a){F&&(C(a,hc,"bottom"),this.ha(a));this.se=a}},left:{configurable:!0,get:function(){return this.Fe},set:function(a){F&&
150 (C(a,hc,"left"),this.ha(a));this.Fe=a}}});hc.prototype.isReal=hc.prototype.o;hc.prototype.equalsApprox=hc.prototype.Wa;hc.prototype.equalTo=hc.prototype.qj;hc.prototype.equals=hc.prototype.A;hc.prototype.set=hc.prototype.set;hc.prototype.setTo=hc.prototype.Ug;var zc=null,Ac=null,yc=[];hc.className="Margin";hc.parse=wc;hc.stringify=xc;hc.ZeroMargin=zc=(new hc(0,0,0,0)).ia();hc.TwoMargin=Ac=(new hc(2,2,2,2)).ia();hc.parse=wc;hc.stringify=xc;
151 function N(a,b,c,d){void 0===a?this.ie=this.he=this.H=this.G=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.s=!1}var Bc,Ec,Fc,Gc,Hc,Kc,Lc,Mc,Nc,Oc,Pc,Rc,Sc,Tc,Uc,Vc,Wc,Xc,Yc,Zc,ad,bd,cd,dd,ed,fd,gd,hd,kd,ld,md,nd,od,pd,qd,rd;N.prototype.assign=function(a){this.G=a.G;this.H=a.H;this.he=a.he;this.ie=a.ie;return this};
152 N.prototype.Ug=function(a,b,c,d){F&&(sd(a,"setTo:x"),sd(b,"setTo:y"),td(c,"setTo:offx"),td(d,"setTo:offy"),this.ha());this.G=a;this.H=b;this.he=c;this.ie=d;return this};N.prototype.set=function(a){F&&(w(a,N,N,"set:s"),this.ha());this.G=a.G;this.H=a.H;this.he=a.he;this.ie=a.ie;return this};N.prototype.copy=function(){var a=new N;a.G=this.G;a.H=this.H;a.he=this.he;a.ie=this.ie;return a};t=N.prototype;t.ia=function(){this.s=!0;Object.freeze(this);return this};
153 t.K=function(){return this.s||Object.isFrozen(this)?this:this.copy().freeze()};t.freeze=function(){this.s=!0;return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;return this};t.ha=function(a){if(F&&this.s){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+=" to value: "+a);v(b)}};function ud(a,b){a.G=NaN;a.H=NaN;a.he=b;return a}function sd(a,b){(isNaN(a)||1<a||0>a)&&za(a,"0 <= "+b+" <= 1",N,b)}
154 function td(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&za(a,"real number, not NaN or Infinity",N,b)}
155 function vd(a){if("string"===typeof a){a=a.trim();if("None"===a)return Bc;if("TopLeft"===a)return Ec;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Fc;if("TopRight"===a)return Gc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Hc;if("Center"===a)return Kc;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Lc;if("BottomLeft"===a)return Mc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Nc;if("BottomRight"===a)return Oc;if("TopSide"===a)return Pc;if("LeftSide"===
156 a)return Rc;if("RightSide"===a)return Sc;if("BottomSide"===a)return Tc;if("TopBottomSides"===a)return Uc;if("LeftRightSides"===a)return Vc;if("TopLeftSides"===a)return Wc;if("TopRightSides"===a)return Xc;if("BottomLeftSides"===a)return Yc;if("BottomRightSides"===a)return Zc;if("NotTopSide"===a)return ad;if("NotLeftSide"===a)return bd;if("NotRightSide"===a)return cd;if("NotBottomSide"===a)return dd;if("AllSides"===a)return ed;if("Default"===a)return fd;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;
157 var d=a[b++];void 0!==d&&0<d.length&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(f=parseFloat(d));for(var g=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(g=parseFloat(d));return new N(c,e,f,g)}return new N}function wd(a){F&&w(a,N);return a.eb()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()}
158 t.toString=function(){return this.eb()?0===this.he&&0===this.ie?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.A(Bc)?"None":this.A(Ec)?"TopLeft":this.A(Fc)?"Top":this.A(Gc)?"TopRight":this.A(Hc)?"Left":this.A(Kc)?"Center":this.A(Lc)?"Right":this.A(Mc)?"BottomLeft":this.A(Nc)?"Bottom":this.A(Oc)?"BottomRight":this.A(Pc)?"TopSide":this.A(Rc)?"LeftSide":this.A(Sc)?"RightSide":this.A(Tc)?"BottomSide":this.A(Uc)?"TopBottomSides":this.A(Vc)?"LeftRightSides":
159 this.A(Wc)?"TopLeftSides":this.A(Xc)?"TopRightSides":this.A(Yc)?"BottomLeftSides":this.A(Zc)?"BottomRightSides":this.A(ad)?"NotTopSide":this.A(bd)?"NotLeftSide":this.A(cd)?"NotRightSide":this.A(dd)?"NotBottomSide":this.A(ed)?"AllSides":this.A(fd)?"Default":"None"};t.A=function(a){return a instanceof N?(this.G===a.x||isNaN(this.G)&&isNaN(a.x))&&(this.H===a.y||isNaN(this.H)&&isNaN(a.y))&&this.he===a.offsetX&&this.ie===a.offsetY:!1};
160 t.Aw=function(){return new N(.5-(this.G-.5),.5-(this.H-.5),-this.he,-this.ie)};t.Qf=function(a){if(!this.Uc())return!1;if(!a.Uc())if(a.A(gd))a=Rc;else if(a.A(hd))a=Sc;else if(a.A(kd))a=Pc;else if(a.A(ld))a=Tc;else return!1;a=a.offsetY;return(this.ie&a)===a};t.eb=function(){return!isNaN(this.x)&&!isNaN(this.y)};t.Sb=function(){return isNaN(this.x)||isNaN(this.y)};t.Uc=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY};
161 t.br=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY};t.Ib=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};N.alloc=function(){var a=xd.pop();return void 0===a?new N:a};N.free=function(a){xd.push(a)};
162 na.Object.defineProperties(N.prototype,{x:{configurable:!0,get:function(){return this.G},set:function(a){F&&(sd(a,"x"),this.ha(a));this.G=a}},y:{configurable:!0,get:function(){return this.H},set:function(a){F&&(sd(a,"y"),this.ha(a));this.H=a}},offsetX:{configurable:!0,get:function(){return this.he},set:function(a){F&&(td(a,"offsetX"),this.ha(a));this.he=a}},offsetY:{configurable:!0,get:function(){return this.ie},set:function(a){F&&(td(a,"offsetY"),
163 this.ha(a));this.ie=a}}});N.prototype.isDefault=N.prototype.Ib;N.prototype.isNone=N.prototype.br;N.prototype.isSide=N.prototype.Uc;N.prototype.isNoSpot=N.prototype.Sb;N.prototype.isSpot=N.prototype.eb;N.prototype.includesSide=N.prototype.Qf;N.prototype.opposite=N.prototype.Aw;N.prototype.equals=N.prototype.A;N.prototype.set=N.prototype.set;N.prototype.setTo=N.prototype.Ug;var xd=[];N.className="Spot";N.parse=vd;N.stringify=wd;N.None=Bc=ud(new N(0,0,0,0),0).ia();N.Default=fd=ud(new N(0,0,-1,0),-1).ia();
164 N.TopLeft=Ec=(new N(0,0,0,0)).ia();N.TopCenter=Fc=(new N(.5,0,0,0)).ia();N.TopRight=Gc=(new N(1,0,0,0)).ia();N.LeftCenter=Hc=(new N(0,.5,0,0)).ia();N.Center=Kc=(new N(.5,.5,0,0)).ia();N.RightCenter=Lc=(new N(1,.5,0,0)).ia();N.BottomLeft=Mc=(new N(0,1,0,0)).ia();N.BottomCenter=Nc=(new N(.5,1,0,0)).ia();N.BottomRight=Oc=(new N(1,1,0,0)).ia();N.MiddleTop=md=Fc;N.MiddleLeft=nd=Hc;N.MiddleRight=od=Lc;N.MiddleBottom=pd=Nc;N.Top=kd=Fc;N.Left=gd=Hc;N.Right=hd=Lc;N.Bottom=ld=Nc;
165 N.TopSide=Pc=ud(new N(0,0,1,1),1).ia();N.LeftSide=Rc=ud(new N(0,0,1,2),1).ia();N.RightSide=Sc=ud(new N(0,0,1,4),1).ia();N.BottomSide=Tc=ud(new N(0,0,1,8),1).ia();N.TopBottomSides=Uc=ud(new N(0,0,1,9),1).ia();N.LeftRightSides=Vc=ud(new N(0,0,1,6),1).ia();N.TopLeftSides=Wc=ud(new N(0,0,1,3),1).ia();N.TopRightSides=Xc=ud(new N(0,0,1,5),1).ia();N.BottomLeftSides=Yc=ud(new N(0,0,1,10),1).ia();N.BottomRightSides=Zc=ud(new N(0,0,1,12),1).ia();N.NotTopSide=ad=ud(new N(0,0,1,14),1).ia();
166 N.NotLeftSide=bd=ud(new N(0,0,1,13),1).ia();N.NotRightSide=cd=ud(new N(0,0,1,11),1).ia();N.NotBottomSide=dd=ud(new N(0,0,1,7),1).ia();N.AllSides=ed=ud(new N(0,0,1,15),1).ia();qd=(new N(.156,.156)).ia();rd=(new N(.844,.844)).ia();N.parse=vd;N.stringify=wd;function Gb(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}Gb.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};
167 Gb.prototype.copy=function(){var a=new Gb;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};Gb.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};Gb.prototype.A=function(a){return this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy};
168 Gb.prototype.gu=function(){return 0===this.dx&&0===this.dy&&1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22};Gb.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this};
169 Gb.prototype.multiply=function(a){var b=this.m11*a.m11+this.m21*a.m12,c=this.m12*a.m11+this.m22*a.m12,d=this.m11*a.m21+this.m21*a.m22,e=this.m12*a.m21+this.m22*a.m22;this.dx=this.m11*a.dx+this.m21*a.dy+this.dx;this.dy=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=b;this.m12=c;this.m21=d;this.m22=e;return this};
170 Gb.prototype.xw=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,g=b*(a.m21*a.dy-a.m22*a.dx);a=b*(a.m12*a.dx-a.m11*a.dy);b=this.m11*c+this.m21*d;c=this.m12*c+this.m22*d;d=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;this.dx=this.m11*g+this.m21*a+this.dx;this.dy=this.m12*g+this.m22*a+this.dy;this.m11=b;this.m12=c;this.m21=d;this.m22=e;return this};
171 Gb.prototype.eu=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};
172 Gb.prototype.rotate=function(a,b,c){F&&(C(a,Gb,"rotate:angle"),C(b,Gb,"rotate:rx"),C(c,Gb,"rotate:ry"));360<=a?a-=360:0>a&&(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=Gb.prototype;
173 t.translate=function(a,b){F&&(C(a,Gb,"translate:x"),C(b,Gb,"translate:y"));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);F&&(C(a,Gb,"translate:sx"),C(b,Gb,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};t.Aa=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)};
174 t.Pd=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.py=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))};
175 t.ex=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,g=this.m12,h=this.m21,k=this.m22,l=this.dx,m=this.dy,n=b*f+c*h+l,p=b*g+c*k+m,r=d*f+c*h+l,q=d*g+c*k+m;c=b*f+e*h+l;b=b*g+e*k+m;f=d*f+e*h+l;d=d*g+e*k+m;e=Math.min(n,r);n=Math.max(n,r);r=Math.min(p,q);p=Math.max(p,q);e=Math.min(e,c);n=Math.max(n,c);r=Math.min(r,b);p=Math.max(p,b);e=Math.min(e,f);n=Math.max(n,f);r=Math.min(r,d);p=Math.max(p,d);a.h(e,r,n-e,p-r);return a};Gb.alloc=function(){var a=yd.pop();return void 0===a?new Gb:a};
176 Gb.free=function(a){yd.push(a)};Gb.prototype.transformRect=Gb.prototype.ex;Gb.prototype.transformPoint=Gb.prototype.Aa;Gb.prototype.scale=Gb.prototype.scale;Gb.prototype.translate=Gb.prototype.translate;Gb.prototype.rotate=Gb.prototype.rotate;Gb.prototype.invert=Gb.prototype.eu;Gb.prototype.multiplyInverted=Gb.prototype.xw;Gb.prototype.multiply=Gb.prototype.multiply;Gb.prototype.reset=Gb.prototype.reset;Gb.prototype.isIdentity=Gb.prototype.gu;Gb.prototype.equals=Gb.prototype.A;Gb.prototype.set=Gb.prototype.set;
177 var yd=[];Gb.className="Transform";Gb.xF="54a702f3e53909c447824c6706603faf4c";
178 var K={FB:"7da71ca0ad381e90",Wg:(Math.sqrt(2)-1)/3*4,yx:null,sqrt:function(a){if(0>=a)return 0;var b=K.yx;if(null===b){b=[];for(var c=0;2E3>=c;c++)b[c]=Math.sqrt(c);K.yx=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)},B:function(a,b){a-=b;return.5>a&&-.5<a},da:function(a,b){a-=b;return 5E-8>a&&-5E-8<a},Tb:function(a,b,c,d,e,f,g){0>=e&&(e=1E-6);if(a<c){var h=a;var k=c}else h=c,k=a;if(b<d){var l=b;var m=d}else l=d,m=b;if(a===c)return l<=g&&g<=m&&a-e<=f&&f<=a+e;if(b===d)return h<=
179 f&&f<=k&&b-e<=g&&g<=b+e;k+=e;h-=e;if(h<=f&&f<=k&&(m+=e,l-=e,l<=g&&g<=m))if(k-h>m-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},Lt:function(a,b,c,d,e,f,g,h,k,l,m,n){if(K.Tb(a,b,g,h,n,c,d)&&K.Tb(a,b,g,h,n,e,f))return K.Tb(a,b,g,h,n,l,m);var p=(a+c)/2,r=(b+d)/2,q=(c+e)/2,u=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(p+q)/2;c=(r+u)/2;q=(q+e)/2;u=(u+f)/2;var y=(d+q)/2,x=(c+u)/2;return K.Lt(a,
180 b,p,r,d,c,y,x,k,l,m,n)||K.Lt(y,x,q,u,e,f,g,h,k,l,m,n)},Pz: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},Oz:function(a,b,c,d,e,f,g,h){var k=(c+e)/2,l=(d+f)/2;return Kb(((a+c)/2+k)/2,((b+d)/2+l)/2,(k+(e+g)/2)/2,(l+(f+h)/2)/2)},Im:function(a,b,c,d,e,f,g,h,k,l){if(K.Tb(a,b,g,h,k,c,d)&&K.Tb(a,b,g,h,k,e,f))kc(l,a,b,0,0),kc(l,g,h,0,0);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/
181 2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;K.Im(a,b,m,n,d,c,q,u,k,l);K.Im(q,u,p,r,e,f,g,h,k,l)}return l},Se:function(a,b,c,d,e,f,g,h,k,l){if(K.Tb(a,b,g,h,k,c,d)&&K.Tb(a,b,g,h,k,e,f))0===l.length&&(l.push(a),l.push(b)),l.push(g),l.push(h);else{var m=(a+c)/2,n=(b+d)/2,p=(c+e)/2,r=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(m+p)/2;c=(n+r)/2;p=(p+e)/2;r=(r+f)/2;var q=(d+p)/2,u=(c+r)/2;K.Se(a,b,m,n,d,c,q,u,k,l);K.Se(q,u,p,r,e,f,g,h,k,l)}return l},Ew:function(a,b,c,d,e,f,g,h,k,l){if(K.Tb(a,b,e,f,l,c,d))return K.Tb(a,
182 b,e,f,l,h,k);var m=(a+c)/2,n=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var p=(m+c)/2,r=(n+d)/2;return K.Ew(a,b,m,n,p,r,g,h,k,l)||K.Ew(p,r,c,d,e,f,g,h,k,l)},PB: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},Dw:function(a,b,c,d,e,f,g,h){if(K.Tb(a,b,e,f,g,c,d))kc(h,a,b,0,0),kc(h,e,f,0,0);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.Dw(a,b,k,l,m,n,g,h);K.Dw(m,n,c,d,e,f,g,h)}return h},ir:function(a,b,c,d,e,f,g,h){if(K.Tb(a,b,e,f,g,c,d))0===h.length&&(h.push(a),
183 h.push(b)),h.push(e),h.push(f);else{var k=(a+c)/2,l=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var m=(k+c)/2,n=(l+d)/2;K.ir(a,b,k,l,m,n,g,h);K.ir(m,n,c,d,e,f,g,h)}return h},Jq:function(a,b,c,d,e,f,g,h,k,l,m,n,p,r){if(K.Tb(a,b,g,h,p,c,d)&&K.Tb(a,b,g,h,p,e,f)){if(!K.Qm(a,b,g,h,k,l,m,n))return!1;p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return!1;r.h(((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p);return!0}var q=(a+c)/2,u=(b+d)/2,y=(c+e)/2,x=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+y)/2;c=(u+x)/2;y=(y+e)/
184 2;x=(x+f)/2;var z=(d+y)/2,B=(c+x)/2,D=Infinity,G=!1,M=0,Y=0;K.Jq(a,b,q,u,d,c,z,B,k,l,m,n,p,r)&&(a=(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l),a<D&&(D=a,G=!0,M=r.x,Y=r.y));K.Jq(z,B,y,x,e,f,g,h,k,l,m,n,p,r)&&(r.x-k)*(r.x-k)+(r.y-l)*(r.y-l)<D&&(G=!0,M=r.x,Y=r.y);G&&(r.x=M,r.y=Y);return G},Kq:function(a,b,c,d,e,f,g,h,k,l,m,n,p){var r=0;if(K.Tb(a,b,g,h,p,c,d)&&K.Tb(a,b,g,h,p,e,f)){p=(a-g)*(l-n)-(b-h)*(k-m);if(0===p)return r;var q=((a*h-b*g)*(k-m)-(a-g)*(k*n-l*m))/p,u=((a*h-b*g)*(l-n)-(b-h)*(k*n-l*m))/p;if(q>=m)return r;
185 if((k>m?k-m:m-k)<(l>n?l-n:n-l)){if(b<h?(a=b,b=h):a=h,u<a||u>b)return r}else if(a<g?(b=a,a=g):b=g,q<b||q>a)return r;0<p?r++:0>p&&r--}else{q=(a+c)/2;u=(b+d)/2;var y=(c+e)/2,x=(d+f)/2;e=(e+g)/2;f=(f+h)/2;d=(q+y)/2;c=(u+x)/2;y=(y+e)/2;x=(x+f)/2;var z=(d+y)/2,B=(c+x)/2;r+=K.Kq(a,b,q,u,d,c,z,B,k,l,m,n,p);r+=K.Kq(z,B,y,x,e,f,g,h,k,l,m,n,p)}return r},ai:function(a,b,c,d,e,f,g){if(K.da(a,c)){b<d?(c=b,b=d):c=d;if(f<c)return g.h(a,c),!1;if(f>b)return g.h(a,b),!1;g.h(a,f);return!0}if(K.da(b,d)){a<c?(d=a,a=c):
186 d=c;if(e<d)return g.h(d,b),!1;if(e>a)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.000005<e)return g.h(c,d),!1;g.h(a+e*(c-a),b+e*(d-b));return!0},Ze:function(a,b,c,d,e,f,g,h,k){if(K.B(a,c)&&K.B(b,d))return k.h(a,b),!1;if(K.da(e,g))return K.da(a,c)?(K.ai(a,b,c,d,e,f,k),!1):K.ai(a,b,c,d,e,(d-b)/(c-a)*(e-a)+b,k);h=(h-f)/(g-e);if(K.da(a,c)){c=h*(a-e)+f;b<d?(e=b,b=d):e=d;if(c<e)return k.h(a,e),!1;if(c>b)return k.h(a,b),!1;
187 k.h(a,c);return!0}g=(d-b)/(c-a);if(K.da(h,g))return K.ai(a,b,c,d,e,f,k),!1;e=(g*a-h*e+f-b)/(g-h);if(K.da(g,0)){a<c?(d=a,a=c):d=c;if(e<d)return k.h(d,b),!1;if(e>a)return k.h(a,b),!1;k.h(e,b);return!0}return K.ai(a,b,c,d,e,g*(e-a)+b,k)},NB:function(a,b,c,d,e){return K.Ze(c.x,c.y,d.x,d.y,a.x,a.y,b.x,b.y,e)},MB: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<n&&(n=e,k.h(c,d))}var n=Infinity;m(k.x,k.y);var p=0,r=0,q=0,u=0;e<g?(p=e,r=g):(p=g,r=e);f<h?(q=e,u=g):(q=g,u=e);p=
188 (r-p)/2+l;l=(u-q)/2+l;e=(e+g)/2;f=(f+h)/2;if(0===p||0===l)return k;if(.5>(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},Of:function(a,b,c,d,e,f,g,h,k){var l=1E21,m=a,n=b;if(K.Ze(a,b,a,d,e,f,
189 g,h,k)){var p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f);p<l&&(l=p,m=k.x,n=k.y)}K.Ze(c,b,c,d,e,f,g,h,k)&&(p=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),p<l&&(l=p,m=k.x,n=k.y));K.Ze(a,b,c,b,e,f,g,h,k)&&(b=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),b<l&&(l=b,m=k.x,n=k.y));K.Ze(a,d,c,d,e,f,g,h,k)&&(a=(k.x-e)*(k.x-e)+(k.y-f)*(k.y-f),a<l&&(l=a,m=k.x,n=k.y));k.h(m,n);return 1E21>l},LB:function(a,b,c,d,e,f,g,h,k){c=a-c;g=e-g;0===c||0===g?0===c?(b=(f-h)/g,h=a,e=b*h+(f-b*e)):(f=(b-d)/c,h=e,e=f*h+(b-f*a)):(d=(b-d)/c,h=(f-h)/g,a=b-d*a,h=(f-
190 h*e-a)/(d-h),e=d*h+a);k.h(h,e);return k},cu:function(a,b,c){return K.Uy(a.x,a.y,a.width,a.height,b.x,b.y,c.x,c.y)},Uy:function(a,b,c,d,e,f,g,h){var k=a+c,l=b+d;return e===g?(f<h?(g=f,f=h):g=h,a<=e&&e<=k&&g<=l&&f>=b):f===h?(e<g?(h=e,e=g):h=g,b<=f&&f<=l&&h<=k&&e>=a):lc(a,b,c,d,e,f)||lc(a,b,c,d,g,h)||K.Qm(a,b,k,b,e,f,g,h)||K.Qm(k,b,k,l,e,f,g,h)||K.Qm(k,l,a,l,e,f,g,h)||K.Qm(a,l,a,b,e,f,g,h)?!0:!1},Qm:function(a,b,c,d,e,f,g,h){return 0>=K.Ot(a,b,c,d,e,f)*K.Ot(a,b,c,d,g,h)&&0>=K.Ot(e,f,g,h,a,b)*K.Ot(e,
191 f,g,h,c,d)},Ot: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,0<f&&(f=(a-c)*c+(b-d)*d,0>f&&(f=0)));return 0>f?-1:0<f?1:0},gr:function(a){0>a&&(a+=360);360<=a&&(a-=360);return a},wy: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-5<d;)e=l+
192 h*Math.min(d,k),f.push(K.Yz(c,l,e,a,b)),d-=Math.abs(e-l),l=e;return f},Yz:function(a,b,c,d,e){var f=(c-b)/2,g=a*Math.cos(f),h=a*Math.sin(f),k=-h,l=g*g+k*k,m=l+g*g+k*h;l=4/3*(Math.sqrt(2*l*m)-m)/(g*h-k*g);h=g-l*k;g=k+l*g;k=-g;l=f+b;f=Math.cos(l);l=Math.sin(l);return[d+a*Math.cos(b),e+a*Math.sin(b),d+h*f-g*l,e+h*l+g*f,d+h*f-k*l,e+h*l+k*f,d+a*Math.cos(c),e+a*Math.sin(c)]},Tq:function(a,b,c,d,e,f,g){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/f)*f+d;var h=c;c+e-a<e/2&&(h=c+e);a=d;d+f-b<f/2&&(a=d+f);
193 g.h(h,a);return g},Jy:function(a,b){var c=Math.max(a,b);a=Math.min(a,b);var d;do b=c%a,c=d=a,a=b;while(0<b);return d},cA:function(a,b,c,d){var e=0>c,f=0>d;if(a<b){var g=1;var h=0}else g=0,h=1;var k=0===g?a:b;var l=0===g?c:d;if(0===g?e:f)l=-l;g=h;c=0===g?c:d;if(0===g?e:f)c=-c;return K.dA(k,0===g?a:b,l,c,0,0)},dA:function(a,b,c,d,e,f){if(0<d)if(0<c){e=a*a;f=b*b;a*=c;var g=b*d,h=-f+g,k=-f+Math.sqrt(a*a+g*g);b=h;for(var l=0;9999999999>l;++l){b=.5*(h+k);if(b===h||b===k)break;var m=a/(b+e),n=g/(b+f);m=
194 m*m+n*n-1;if(0<m)h=b;else if(0>m)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,f<d?(d=f/d,f=b*Math.sqrt(Math.abs(1-d*d)),c=a*d-c,c=Math.sqrt(c*c+f*f)):c=Math.abs(c-a);return c},qe:new ib,rn:new ib,ei:new ib,fi:0};K.za=K.FB;
195 function zd(a){F&&1<arguments.length&&v("Geometry constructor can take at most one optional argument, the Geometry type.");eb(this);this.s=!1;void 0===a?a=Ad:F&&gb(a,zd,zd,"constructor:type");this.sa=a;this.tc=this.nc=this.kd=this.jd=0;this.Vj=new H;this.ms=this.Vj.v;this.Tr=(new L).freeze();this.xa=!0;this.yn=this.ml=null;this.zn=NaN;this.Bf=Ec;this.Cf=Oc;this.Pl=this.Ql=NaN;this.dg=Bd}
196 zd.prototype.copy=function(){var a=new zd;a.sa=this.sa;a.jd=this.jd;a.kd=this.kd;a.nc=this.nc;a.tc=this.tc;for(var b=this.Vj.j,c=b.length,d=a.Vj,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.ms=this.ms;a.Tr.assign(this.Tr);a.xa=this.xa;a.ml=this.ml;a.yn=this.yn;a.zn=this.zn;a.Bf=this.Bf.K();a.Cf=this.Cf.K();a.Ql=this.Ql;a.Pl=this.Pl;a.dg=this.dg;return a};t=zd.prototype;t.ia=function(){this.freeze();Object.freeze(this);return this};
197 t.freeze=function(){this.s=!0;var a=this.figures;a.freeze();a=a.j;for(var b=a.length,c=0;c<b;c++)a[c].freeze();return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;var a=this.figures;a.ka();a=a.j;for(var b=a.length,c=0;c<b;c++)a[c].ka();return this};
198 t.Wa=function(a){if(!(a instanceof zd))return!1;if(this.type!==a.type)return this.type===Gd&&a.type===Ad?Hd(this,a):a.type===Gd&&this.type===Ad?Hd(a,this):!1;if(this.type===Ad){var b=this.figures.j;a=a.figures.j;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Wa(a[d]))return!1;return!0}return K.B(this.startX,a.startX)&&K.B(this.startY,a.startY)&&K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)};
199 function Hd(a,b){return a.type!==Gd||b.type!==Ad?!1:1===b.figures.count&&(b=b.figures.M(0),1===b.segments.count&&K.B(a.startX,b.startX)&&K.B(a.startY,b.startY)&&(b=b.segments.M(0),b.type===Id&&K.B(a.endX,b.endX)&&K.B(a.endY,b.endY)))?!0:!1}function Jd(a){return a.toString()}t.pb=function(a){a.classType===zd?this.type=a:Da(this,a)};
200 t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Gd:return 0>a?"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 Kd:var b=new L(this.startX,this.startY,0,0);b.hx(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)+
201 " "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+"V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Ld:b=new L(this.startX,this.startY,0,0);b.hx(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/
202 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 Ad:b="";c=this.figures.j;for(var d=c.length,e=0;e<d;e++){var f=c[e];0<e&&(b+=" x ");f.isFilled&&(b+="F ");b+=f.toString(a)}return b;default:return this.type.toString()}};
203 function Md(a,b){function c(){return u>=D-1?!0:null!==n[u+1].match(G)}function d(){u++;return n[u]}function e(a){var b=parseFloat(d()),c=parseFloat(d());y===y.toLowerCase()&&(b=B.x+b,c=B.y+c);a.h(b,c)}function f(){e(B);return B}function g(){e(z);return z}function h(){var a=x.toLowerCase();return"c"!==a&&"s"!==a&&"q"!==a&&"t"!==a?B:new J(2*B.x-z.x,2*B.y-z.y)}void 0===b&&(b=!1);"string"!==typeof a&&ya(a,"string",zd,"parse:str");var k=new RegExp("(["+Nd+"])(["+Nd+"])","gm"),l=new RegExp("(["+Nd+"])([^s])",
204 "gm"),m=new RegExp("([^s])(["+Nd+"])","gm");a=a.replace(/,/gm," ");a=a.replace(k,"$1 $2");a=a.replace(k,"$1 $2");a=a.replace(l,"$1 $2");a=a.replace(m,"$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 n=a.split(" ");for(a=0;a<n.length;a++)if(l=n[a],null!==l.match(/(\.[0-9]*)(\.)/gm)){k=Ma();m="";for(var p=!1,r=0;r<l.length;r++){var q=l[r];"."!==q||p?"."===q?(k.push(m),m="."):m+=q:(p=!0,m+=q)}k.push(m);n.splice(a,1);for(l=0;l<k.length;l++)n.splice(a+
205 l,0,k[l]);a+=k.length-1;Oa(k)}var u=-1,y="",x="";k=new J(0,0);var z=new J(0,0),B=new J(0,0),D=n.length;a=Od(null);m=l=!1;p=!0;r=null;for(var G=new RegExp("["+Nd+"]");!(u>=D-1);)if(x=y,y=d(),""!==y)switch(y.toUpperCase()){case "X":p=!0;m=l=!1;break;case "M":r=f();null===a.oc||!0===p?(Pd(a,r.x,r.y,l,!m),p=!1):a.moveTo(r.x,r.y);for(k.assign(B);!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();)B=new J((y===y.toLowerCase()?B.x:0)+parseFloat(d()),
206 B.y),a.lineTo(B.x,B.y);break;case "V":for(;!c();)B=new J(B.x,(y===y.toLowerCase()?B.y:0)+parseFloat(d())),a.lineTo(B.x,B.y);break;case "C":for(;!c();){r=new J;e(r);q=g();var M=f();Td(a,r.x,r.y,q.x,q.y,M.x,M.y)}break;case "S":for(;!c();)r=h(),q=g(),M=f(),Td(a,r.x,r.y,q.x,q.y,M.x,M.y);break;case "Q":for(;!c();)r=g(),q=f(),Ud(a,r.x,r.y,q.x,q.y);break;case "T":for(;!c();)z=r=h(),q=f(),Ud(a,r.x,r.y,q.x,q.y);break;case "B":for(;!c();){r=parseFloat(d());q=parseFloat(d());M=parseFloat(d());var Y=parseFloat(d()),
207 Q=parseFloat(d()),ca=Q,T=!1;c()||(ca=parseFloat(d()),c()||(T=0!==parseFloat(d())));y===y.toLowerCase()&&(M+=B.x,Y+=B.y);a.arcTo(r,q,M,Y,Q,ca,T)}break;case "A":for(;!c();)r=Math.abs(parseFloat(d())),q=Math.abs(parseFloat(d())),M=parseFloat(d()),Q=Y=!1,T=ca=0,ca=d(),1===ca.length?(Y=!!parseFloat(ca),Q=!!parseFloat(d()),ca=parseFloat(d())):2===ca.length?(Y=!!parseFloat(ca[0]),Q=!!parseFloat(ca[1]),ca=parseFloat(d())):(Y=!!parseFloat(ca[0]),Q=!!parseFloat(ca[1]),ca=parseFloat(ca.slice(2))),T=parseFloat(d()),
208 y===y.toLowerCase()&&(ca=B.x+ca,T=B.y+T),B.h(ca,T),Vd(a,r,q,M,Y,Q,ca,T);break;case "Z":Wd(a);B.assign(k);break;case "F":r="";for(q=1;n[u+q];)if(null!==n[u+q].match(/[Uu]/))q++;else if(null===n[u+q].match(G))q++;else{r=n[u+q];break}r.match(/[Mm]/)?l=!0:0<a.oc.segments.length&&(a.oc.isFilled=!0);break;case "U":r="";for(q=1;n[u+q];)if(null!==n[u+q].match(/[Ff]/))q++;else if(null===n[u+q].match(G))q++;else{r=n[u+q];break}r.match(/[Mm]/)?m=!0:a.mn(!1)}k=a.Xt;Xd=a;if(b)for(b=k.figures.iterator;b.next();)b.value.isFilled=
209 !0;return k}function Yd(a,b){for(var c=a.length,d=J.alloc(),e=0;e<c;e++){var f=a[e];d.x=f[0];d.y=f[1];b.Aa(d);f[0]=d.x;f[1]=d.y;d.x=f[2];d.y=f[3];b.Aa(d);f[2]=d.x;f[3]=d.y;d.x=f[4];d.y=f[5];b.Aa(d);f[4]=d.x;f[5]=d.y;d.x=f[6];d.y=f[7];b.Aa(d);f[6]=d.x;f[7]=d.y}J.free(d)}t.uw=function(){if(this.xa||this.ms!==this.figures.v)return!0;for(var a=this.figures.j,b=a.length,c=0;c<b;c++)if(a[c].uw())return!0;return!1};
210 zd.prototype.computeBounds=function(){this.xa=!1;this.yn=this.ml=null;this.zn=NaN;this.ms=this.figures.v;for(var a=this.figures.j,b=a.length,c=0;c<b;c++){var d=a[c];d.xa=!1;var e=d.segments;d.ot=e.v;d=e.j;e=d.length;for(var f=0;f<e;f++){var g=d[f];g.xa=!1;g.Wd=null}}a=this.Tr;a.ka();isNaN(this.Ql)||isNaN(this.Pl)?a.h(0,0,0,0):a.h(0,0,this.Ql,this.Pl);je(this,a,!1);kc(a,0,0,0,0);a.freeze()};zd.prototype.uy=function(){var a=new L;je(this,a,!0);return a};
211 function je(a,b,c){switch(a.type){case Gd:case Kd:case Ld:c?b.h(a.jd,a.kd,0,0):kc(b,a.jd,a.kd,0,0);kc(b,a.nc,a.tc,0,0);break;case Ad:var d=a.figures;a=d.j;d=d.length;for(var e=0;e<d;e++){var f=a[e];c&&0===e?b.h(f.startX,f.startY,0,0):kc(b,f.startX,f.startY,0,0);for(var g=f.segments.j,h=g.length,k=f.startX,l=f.startY,m=0;m<h;m++){var n=g[m];switch(n.type){case Id:case ke:k=n.endX;l=n.endY;kc(b,k,l,0,0);break;case le:K.Im(k,l,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.5,b);k=n.endX;l=n.endY;
212 break;case me:K.Dw(k,l,n.point1X,n.point1Y,n.endX,n.endY,.5,b);k=n.endX;l=n.endY;break;case ne:case oe:var p=n.type===ne?pe(n,f):qe(n,f,k,l),r=p.length;if(0===r){k=n.type===ne?n.centerX:n.endX;l=n.type===ne?n.centerY:n.endY;kc(b,k,l,0,0);break}n=null;for(var q=0;q<r;q++)n=p[q],K.Im(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.5,b);null!==n&&(k=n[6],l=n[7]);break;default:v("Unknown Segment type: "+n.type)}}}break;default:v("Unknown Geometry type: "+a.type)}}
213 zd.prototype.normalize=function(){this.s&&va(this);var a=this.uy();this.offset(-a.x,-a.y);return new J(-a.x,-a.y)};zd.prototype.offset=function(a,b){this.s&&va(this);F&&(C(a,zd,"offset"),C(b,zd,"offset"));this.transform(1,0,0,1,a,b);return this};zd.prototype.scale=function(a,b){this.s&&va(this);F&&(C(a,zd,"scale:x"),C(b,zd,"scale:y"),0===a&&za(a,"scale must be non-zero",zd,"scale:x"),0===b&&za(b,"scale must be non-zero",zd,"scale:y"));this.transform(a,0,0,b,0,0);return this};
214 zd.prototype.rotate=function(a,b,c){this.s&&va(this);void 0===b&&(b=0);void 0===c&&(c=0);F&&(C(a,zd,"rotate:angle"),C(b,zd,"rotate:x"),C(c,zd,"rotate:y"));var d=Gb.alloc();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);Gb.free(d);return this};t=zd.prototype;
215 t.transform=function(a,b,c,d,e,f){switch(this.type){case Gd:case Kd:case Ld:var g=this.jd;var h=this.kd;this.jd=g*a+h*c+e;this.kd=g*b+h*d+f;g=this.nc;h=this.tc;this.nc=g*a+h*c+e;this.tc=g*b+h*d+f;break;case Ad:for(var k=this.figures.j,l=k.length,m=0;m<l;m++){var n=k[m];g=n.startX;h=n.startY;n.startX=g*a+h*c+e;n.startY=g*b+h*d+f;n=n.segments.j;for(var p=n.length,r=0;r<p;r++){var q=n[r];switch(q.type){case Id:case ke:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case le:g=q.point1X;h=q.point1Y;
216 q.point1X=g*a+h*c+e;q.point1Y=g*b+h*d+f;g=q.point2X;h=q.point2Y;q.point2X=g*a+h*c+e;q.point2Y=g*b+h*d+f;g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case me:g=q.point1X;h=q.point1Y;q.point1X=g*a+h*c+e;q.point1Y=g*b+h*d+f;g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;break;case ne:g=q.centerX;h=q.centerY;q.centerX=g*a+h*c+e;q.centerY=g*b+h*d+f;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.startAngle+=g);0>a&&(q.startAngle=180-q.startAngle,q.sweepAngle=-q.sweepAngle);0>d&&
217 (q.startAngle=-q.startAngle,q.sweepAngle=-q.sweepAngle);q.radiusX*=Math.sqrt(a*a+c*c);void 0!==q.radiusY&&(q.radiusY*=Math.sqrt(b*b+d*d));break;case oe:g=q.endX;h=q.endY;q.endX=g*a+h*c+e;q.endY=g*b+h*d+f;if(0===q.radiusX||0===q.radiusY)break;0!==b&&(g=180*Math.atan2(b,a)/Math.PI,0>g&&(g+=360),q.xAxisRotation+=g);0>a&&(q.xAxisRotation=180-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);0>d&&(q.xAxisRotation=-q.xAxisRotation,q.isClockwiseArc=!q.isClockwiseArc);q.radiusX*=Math.sqrt(a*a+c*c);q.radiusY*=
218 Math.sqrt(b*b+d*d);break;default:v("Unknown Segment type: "+q.type)}}}}this.xa=!0;return this};
219 t.ca=function(a,b){void 0===b&&(b=0);var c=this.jd,d=this.kd,e=this.nc,f=this.tc;switch(this.type){case Gd:return K.Tb(c,d,e,f,b,a.x,a.y);case Kd:var g=L.allocAt(Math.min(c,e)-b,Math.min(d,f)-b,Math.abs(e-c)+2*b,Math.abs(f-d)+2*b);a=g.ca(a);L.free(g);return a;case Ld: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 Ad:return re(this,a,b,!0,!1);default:return!1}};
220 function re(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.j,r=p.length,q=0;q<r;q++){var u=p[q];if(u.isFilled){if(d&&u.ca(f,b,c))return!0;var y=u.segments;k=u.startX;l=u.startY;for(var x=k,z=l,B=y.j,D=0;D<=y.length;D++){var G=void 0;if(D!==y.length){G=B[D];var M=G.type;a=G.endX;n=G.endY}else M=Id,a=x,n=z;switch(M){case ke:x=se(f,b,g,b,k,l,x,z);if(isNaN(x))return!0;h+=x;x=a;z=n;break;case Id:k=se(f,b,g,b,k,l,a,n);if(isNaN(k))return!0;h+=k;break;case le:m=K.Kq(k,l,G.point1X,
221 G.point1Y,G.point2X,G.point2Y,a,n,g,b,f,b,.5);h+=m;break;case me:m=K.Kq(k,l,(k+2*G.point1X)/3,(l+2*G.point1Y)/3,(2*G.point1X+a)/3,(2*G.point1Y+n)/3,a,n,g,b,f,b,.5);h+=m;break;case ne:case oe:M=G.type===ne?pe(G,u):qe(G,u,k,l);var Y=M.length;if(0===Y){k=se(f,b,g,b,k,l,G.type===ne?G.centerX:G.endX,G.type===ne?G.centerY:G.endY);if(isNaN(k))return!0;h+=k;break}G=null;for(var Q=0;Q<Y;Q++){G=M[Q];if(0===Q){m=se(f,b,g,b,k,l,G[0],G[1]);if(isNaN(m))return!0;h+=m}m=K.Kq(G[0],G[1],G[2],G[3],G[4],G[5],G[6],G[7],
222 g,b,f,b,.5);h+=m}null!==G&&(a=G[6],n=G[7]);break;default:v("Unknown Segment type: "+G.type)}k=a;l=n}if(0!==h)return!0;h=0}else if(u.ca(f,b,e?c:c+2))return!0}return 0!==h}
223 function se(a,b,c,d,e,f,g,h){if(K.Tb(e,f,g,h,.05,a,b))return NaN;var k=(a-c)*(f-h);if(0===k)return 0;var l=((a*d-b*c)*(e-g)-(a-c)*(e*h-f*g))/k;b=(a*d-b*c)*(f-h)/k;if(l>=a)return 0;if((e>g?e-g:g-e)<(f>h?f-h:h-f))if(f<h){if(b<f||b>h)return 0}else{if(b<h||b>f)return 0}else if(e<g){if(l<e||l>g)return 0}else if(l<g||l>e)return 0;return 0<k?1:-1}function te(a,b,c,d){a=a.figures.j;for(var e=a.length,f=0;f<e;f++)if(a[f].ca(b,c,d))return!0;return!1}
224 t.lw=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=new J);if(this.type===Gd)return b.h(this.startX+a*(this.endX-this.startX),this.startY+a*(this.endY-this.startY)),b;for(var c=this.flattenedSegments,d=this.flattenedLengths,e=c.length,f=this.flattenedTotalLength*a,g=0,h=0;h<e;h++){var k=d[h],l=k.length;for(a=0;a<l;a++){var m=k[a];if(g+m>=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};
225 t.Ky=function(a){0>a?a=0:1<a&&(a=1);if(this.type===Gd)return 180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI;for(var b=this.flattenedSegments,c=this.flattenedLengths,d=b.length,e=this.flattenedTotalLength*a,f=0,g=0;g<d;g++){var h=c[g],k=h.length;for(a=0;a<k;a++){var l=h[a];if(f+l>=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};
226 t.mw=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=[]);b.length=3;if(this.type===Gd)return b[0]=this.startX+a*(this.endX-this.startX),b[1]=this.startY+a*(this.endY-this.startY),b[2]=180*Math.atan2(this.endY-this.startY,this.endX-this.startX)/Math.PI,b;for(var c=this.flattenedSegments,d=this.flattenedLengths,e=c.length,f=this.flattenedTotalLength*a,g=0,h=0;h<e;h++){var k=d[h],l=k.length;for(a=0;a<l;a++){var m=k[a];if(g+m>=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+
227 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};
228 t.Ly=function(a){if(this.type===Gd){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<e){var g=c;d=e}else g=e,d=c;return a<=g?g===c?0:1:a>=d?d===c?0:1:Math.abs(a-c)/(d-g)}if(c===e)return b<d?g=b:(g=d,d=b),f<=g?g===b?0:1:f>=d?d===b?0:1:Math.abs(f-b)/(d-g);g=(d-b)*(d-b)+(e-c)*(e-c);var h=J.alloc();K.ai(b,c,d,e,f,a,h);a=h.x;f=h.y;J.free(h);return Math.sqrt(((a-b)*(a-b)+(f-c)*(f-c))/g)}}else if(this.type===Kd){g=this.startX;h=this.startY;var k=this.endX;
229 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=J.alloc();e=Infinity;h=g=0;k=b.length;for(var m=l=0,n=0;n<k;n++)for(var p=b[n],r=c[n],q=p.length,u=0;u<q;u+=2){var y=
230 p[u],x=p[u+1];if(0!==u){K.ai(l,m,y,x,a.x,a.y,d);var z=(d.x-a.x)*(d.x-a.x)+(d.y-a.y)*(d.y-a.y);z<e&&(e=z,g=h,g+=Math.sqrt((d.x-l)*(d.x-l)+(d.y-m)*(d.y-m)));h+=r[(u-2)/2]}l=y;m=x}J.free(d);a=g/f;return 0>a?0:1<a?1:a}return 0};
231 function ue(a){if(null===a.ml){var b=a.ml=[],c=a.yn=[],d=[],e=[];if(a.type===Gd)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.endY),b.push(d),e.push(Math.sqrt((a.startX-a.endX)*(a.startX-a.endX)+(a.startY-a.endY)*(a.startY-a.endY))),c.push(e);else if(a.type===Kd)d.push(a.startX),d.push(a.startY),d.push(a.endX),d.push(a.startY),d.push(a.endX),d.push(a.endY),d.push(a.startX),d.push(a.endY),d.push(a.startX),d.push(a.startY),b.push(d),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY-
232 a.endY)),e.push(Math.abs(a.startX-a.endX)),e.push(Math.abs(a.startY-a.endY)),c.push(e);else if(a.type===Ld){var f=new ve;f.startX=a.endX;f.startY=(a.startY+a.endY)/2;var g=new we(ne);g.startAngle=0;g.sweepAngle=360;g.centerX=(a.startX+a.endX)/2;g.centerY=(a.startY+a.endY)/2;g.radiusX=Math.abs(a.startX-a.endX)/2;g.radiusY=Math.abs(a.startY-a.endY)/2;f.add(g);a=pe(g,f);e=a.length;if(0===e)d.push(g.centerX),d.push(g.centerY);else{g=f.startX;f=f.startY;for(var h=0;h<e;h++){var k=a[h];K.Se(g,f,k[2],k[3],
233 k[4],k[5],k[6],k[7],.5,d);g=k[6];f=k[7]}}b.push(d);c.push(xe(d))}else for(a=a.figures.iterator;a.next();){e=a.value;d=[];d.push(e.startX);d.push(e.startY);g=e.startX;f=e.startY;h=g;k=f;for(var l=e.segments.j,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.type){case ke:4<=d.length&&(b.push(d),c.push(xe(d)));d=[];d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;h=g;k=f;break;case Id:d.push(p.endX);d.push(p.endY);g=p.endX;f=p.endY;break;case le:K.Se(g,f,p.point1X,p.point1Y,p.point2X,p.point2Y,p.endX,p.endY,
234 .5,d);g=p.endX;f=p.endY;break;case me:K.ir(g,f,p.point1X,p.point1Y,p.endX,p.endY,.5,d);g=p.endX;f=p.endY;break;case ne:var r=pe(p,e),q=r.length;if(0===q){d.push(p.centerX);d.push(p.centerY);g=p.centerX;f=p.centerY;break}for(var u=0;u<q;u++){var y=r[u];K.Se(g,f,y[2],y[3],y[4],y[5],y[6],y[7],.5,d);g=y[6];f=y[7]}break;case oe:r=qe(p,e,g,f);q=r.length;u=p.endX;y=p.endY;if(0===q){d.push(u);d.push(y);g=u;f=y;break}for(u=0;u<q;u++)y=r[u],K.Se(g,f,y[2],y[3],y[4],y[5],y[6],y[7],.5,d),g=y[6],f=y[7];break;default:v("Segment not of valid type: "+
235 p.type)}p.isClosed&&(d.push(h),d.push(k))}4<=d.length&&(b.push(d),c.push(xe(d)))}}}function xe(a){for(var b=[],c=0,d=0,e=a.length,f=0;f<e;f+=2){var g=a[f],h=a[f+1];0!==f&&(c=Math.sqrt(Jb(c,d,g,h)),b.push(c));c=g;d=h}return b}t.add=function(a){this.Vj.add(a);return this};t.nn=function(a,b,c,d,e,f,g,h){this.s&&va(this);this.Bf=(new N(a,b,e,f)).freeze();this.Cf=(new N(c,d,g,h)).freeze();return this};
236 na.Object.defineProperties(zd.prototype,{flattenedSegments:{configurable:!0,get:function(){ue(this);return this.ml}},flattenedLengths:{configurable:!0,get:function(){ue(this);return this.yn}},flattenedTotalLength:{configurable:!0,get:function(){var a=this.zn;if(isNaN(a)){if(this.type===Gd){a=Math.abs(this.endX-this.startX);var b=Math.abs(this.endY-this.startY);a=Math.sqrt(a*a+b*b)}else if(this.type===Kd)a=2*Math.abs(this.endX-this.startX)+2*Math.abs(this.endY-
237 this.startY);else{b=this.flattenedLengths;for(var c=b.length,d=a=0;d<c;d++)for(var e=b[d],f=e.length,g=0;g<f;g++)a+=e[g]}this.zn=a}return a}},type:{configurable:!0,get:function(){return this.sa},set:function(a){this.sa!==a&&(F&&gb(a,zd,zd,"type"),this.s&&va(this,a),this.sa=a,this.xa=!0)}},startX:{configurable:!0,get:function(){return this.jd},set:function(a){this.jd!==a&&(F&&C(a,zd,"startX"),this.s&&va(this,a),this.jd=a,this.xa=!0)}},startY:{configurable:!0,
238 get:function(){return this.kd},set:function(a){this.kd!==a&&(F&&C(a,zd,"startY"),this.s&&va(this,a),this.kd=a,this.xa=!0)}},endX:{configurable:!0,get:function(){return this.nc},set:function(a){this.nc!==a&&(F&&C(a,zd,"endX"),this.s&&va(this,a),this.nc=a,this.xa=!0)}},endY:{configurable:!0,get:function(){return this.tc},set:function(a){this.tc!==a&&(F&&C(a,zd,"endY"),this.s&&va(this,a),this.tc=a,this.xa=!0)}},figures:{configurable:!0,get:function(){return this.Vj},
239 set:function(a){this.Vj!==a&&(F&&w(a,H,zd,"figures"),this.s&&va(this,a),this.Vj=a,this.xa=!0)}},spot1:{configurable:!0,get:function(){return this.Bf},set:function(a){F&&w(a,N,zd,"spot1");this.s&&va(this,a);this.Bf=a.K()}},spot2:{configurable:!0,get:function(){return this.Cf},set:function(a){F&&w(a,N,zd,"spot2");this.s&&va(this,a);this.Cf=a.K()}},defaultStretch:{configurable:!0,get:function(){return this.dg},set:function(a){F&&gb(a,O,zd,"stretch");this.s&&
240 va(this,a);this.dg=a}},bounds:{configurable:!0,get:function(){this.uw()&&this.computeBounds();return this.Tr}}});zd.prototype.setSpots=zd.prototype.nn;zd.prototype.add=zd.prototype.add;zd.prototype.getFractionForPoint=zd.prototype.Ly;zd.prototype.getPointAndAngleAlongPath=zd.prototype.mw;zd.prototype.getAngleAlongPath=zd.prototype.Ky;zd.prototype.getPointAlongPath=zd.prototype.lw;zd.prototype.containsPoint=zd.prototype.ca;zd.prototype.transform=zd.prototype.transform;
241 zd.prototype.rotate=zd.prototype.rotate;zd.prototype.scale=zd.prototype.scale;zd.prototype.offset=zd.prototype.offset;zd.prototype.normalize=zd.prototype.normalize;zd.prototype.computeBoundsWithoutOrigin=zd.prototype.uy;zd.prototype.equalsApprox=zd.prototype.Wa;var Gd=new E(zd,"Line",0),Kd=new E(zd,"Rectangle",1),Ld=new E(zd,"Ellipse",2),Ad=new E(zd,"Path",3),Nd="UuBbMmZzLlHhVvCcSsQqTtAaFfXx";zd.className="Geometry";zd.stringify=Jd;
242 zd.fillPath=function(a){"string"!==typeof a&&ya(a,"string",zd,"fillPath:str");a=a.split(/[Xx]/);for(var b=a.length,c="",d=0;d<b;d++){var e=a[d];c=null!==e.match(/[Ff]/)?0===d?c+e:c+("X"+(" "===e[0]?"":" ")+e):c+((0===d?"":"X ")+"F"+(" "===e[0]?"":" ")+e)}return c};zd.parse=Md;zd.Line=Gd;zd.Rectangle=Kd;zd.Ellipse=Ld;zd.Path=Ad;
243 function ve(a,b,c,d){eb(this);this.Hx=null;this.s=!1;void 0===c&&(c=!0);this.ws=c;void 0===d&&(d=!0);this.Bs=d;void 0!==a?(F&&C(a,ve,"sx"),this.jd=a):this.jd=0;void 0!==b?(F&&C(b,ve,"sy"),this.kd=b):this.kd=0;this.qm=new H;this.ot=this.qm.v;this.xa=!0}ve.prototype.copy=function(){var a=new ve;a.ws=this.ws;a.Bs=this.Bs;a.jd=this.jd;a.kd=this.kd;for(var b=this.qm.j,c=b.length,d=a.qm,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.ot=this.ot;a.xa=this.xa;a.Hx=this.Hx;return a};t=ve.prototype;
244 t.Wa=function(a){if(!(a instanceof ve&&K.B(this.startX,a.startX)&&K.B(this.startY,a.startY)))return!1;var b=this.segments.j;a=a.segments.j;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Wa(a[d]))return!1;return!0};t.toString=function(a){void 0===a&&(a=-1);var b=0>a?"M"+this.startX.toString()+" "+this.startY.toString():"M"+this.startX.toFixed(a)+" "+this.startY.toFixed(a);for(var c=this.segments.j,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};
245 t.freeze=function(){this.s=!0;var a=this.segments;a.freeze();var b=a.j;a=a.length;for(var c=0;c<a;c++)b[c].freeze();return this};t.ka=function(){this.s=!1;var a=this.segments;a.ka();a=a.j;for(var b=a.length,c=0;c<b;c++)a[c].ka();return this};t.uw=function(){if(this.xa)return!0;var a=this.segments;if(this.ot!==a.v)return!0;a=a.j;for(var b=a.length,c=0;c<b;c++)if(a[c].xa)return!0;return!1};t.add=function(a){this.qm.add(a);return this};
246 t.ca=function(a,b,c){for(var d=this.startX,e=this.startY,f=d,g=e,h=this.segments.j,k=h.length,l=0;l<k;l++){var m=h[l];switch(m.type){case ke:f=m.endX;g=m.endY;d=m.endX;e=m.endY;break;case Id:if(K.Tb(d,e,m.endX,m.endY,c,a,b))return!0;d=m.endX;e=m.endY;break;case le:if(K.Lt(d,e,m.point1X,m.point1Y,m.point2X,m.point2Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case me:if(K.Ew(d,e,m.point1X,m.point1Y,m.endX,m.endY,.5,a,b,c))return!0;d=m.endX;e=m.endY;break;case ne:case oe:var n=m.type===
247 ne?pe(m,this):qe(m,this,d,e),p=n.length,r=m.type===ne?m.centerX:m.endX,q=m.type===ne?m.centerY:m.endY;if(0===p){if(K.Tb(d,e,r,q,c,a,b))return!0;d=r;e=q;break}r=null;for(q=0;q<p;q++)if(r=n[q],0===q&&K.Tb(d,e,r[0],r[1],c,a,b)||K.Lt(r[0],r[1],r[2],r[3],r[4],r[5],r[6],r[7],.5,a,b,c))return!0;null!==r&&(d=r[6],e=r[7]);break;default:v("Unknown Segment type: "+m.type)}if(m.isClosed&&(d!==f||e!==g)&&K.Tb(d,e,f,g,c,a,b))return!0}return!1};
248 na.Object.defineProperties(ve.prototype,{isFilled:{configurable:!0,get:function(){return this.ws},set:function(a){F&&A(a,"boolean",ve,"isFilled");this.s&&va(this,a);this.ws=a}},isShadowed:{configurable:!0,get:function(){return this.Bs},set:function(a){F&&A(a,"boolean",ve,"isShadowed");this.s&&va(this,a);this.Bs=a}},startX:{configurable:!0,get:function(){return this.jd},set:function(a){F&&C(a,ve,"startX");this.s&&va(this,a);this.jd=a;this.xa=!0}},startY:{configurable:!0,
249 enumerable:!0,get:function(){return this.kd},set:function(a){F&&C(a,ve,"startY");this.s&&va(this,a);this.kd=a;this.xa=!0}},segments:{configurable:!0,get:function(){return this.qm},set:function(a){F&&w(a,H,ve,"segments");this.s&&va(this,a);this.qm=a;this.xa=!0}}});ve.prototype.add=ve.prototype.add;ve.prototype.equalsApprox=ve.prototype.Wa;ve.className="PathFigure";
250 function we(a,b,c,d,e,f,g,h){eb(this);this.s=!1;void 0===a?a=Id:F&&gb(a,we,we,"constructor:type");this.sa=a;void 0!==b?(F&&C(b,we,"ex"),this.nc=b):this.nc=0;void 0!==c?(F&&C(c,we,"ey"),this.tc=c):this.tc=0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===f&&(f=0);void 0===g&&(g=0);a===oe?(a=f%360,0>a&&(a+=360),this.Ne=a,this.aj=0,F&&C(d,we,"x1"),this.bj=Math.max(d,0),F&&C(e,we,"y1"),this.Bh=Math.max(e,0),this.Yl="boolean"===typeof g?g:"number"===typeof g?!!g:!1,this.ql=!!h):(F&&C(d,we,"x1"),this.Ne=d,
251 F&&C(e,we,"y1"),this.aj=e,F&&C(f,we,"x2"),a===ne&&(f=Math.max(f,0)),this.bj=f,"number"===typeof g?(a===ne&&(g=Math.max(g,0)),this.Bh=g):this.Bh=0,this.ql=this.Yl=!1);this.$j=!1;this.xa=!0;this.Wd=null}we.prototype.copy=function(){var a=new we;a.sa=this.sa;a.nc=this.nc;a.tc=this.tc;a.Ne=this.Ne;a.aj=this.aj;a.bj=this.bj;a.Bh=this.Bh;a.Yl=this.Yl;a.ql=this.ql;a.$j=this.$j;a.xa=this.xa;return a};t=we.prototype;
252 t.Wa=function(a){if(!(a instanceof we)||this.type!==a.type||this.isClosed!==a.isClosed)return!1;switch(this.type){case ke:case Id:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY);case le:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y)&&K.B(this.point2X,a.point2X)&&K.B(this.point2Y,a.point2Y);case me:return K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.point1X,a.point1X)&&K.B(this.point1Y,a.point1Y);case ne:return K.B(this.startAngle,
253 a.startAngle)&&K.B(this.sweepAngle,a.sweepAngle)&&K.B(this.centerX,a.centerX)&&K.B(this.centerY,a.centerY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);case oe:return this.isClockwiseArc===a.isClockwiseArc&&this.isLargeArc===a.isLargeArc&&K.B(this.xAxisRotation,a.xAxisRotation)&&K.B(this.endX,a.endX)&&K.B(this.endY,a.endY)&&K.B(this.radiusX,a.radiusX)&&K.B(this.radiusY,a.radiusY);default:return!1}};t.pb=function(a){a.classType===we?this.type=a:Da(this,a)};
254 t.toString=function(a){void 0===a&&(a=-1);switch(this.type){case ke:a=0>a?"M"+this.endX.toString()+" "+this.endY.toString():"M"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case Id:a=0>a?"L"+this.endX.toString()+" "+this.endY.toString():"L"+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case le: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)+
255 " "+this.point1Y.toFixed(a)+" "+this.point2X.toFixed(a)+" "+this.point2Y.toFixed(a)+" "+this.endX.toFixed(a)+" "+this.endY.toFixed(a);break;case me: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 ne:a=0>a?"B"+this.startAngle.toString()+" "+this.sweepAngle.toString()+" "+this.centerX.toString()+" "+this.centerY.toString()+
256 " "+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 oe: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)+
257 " "+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.$j?"z":"")};t.freeze=function(){this.s=!0;return this};t.ka=function(){this.s=!1;return this};t.close=function(){this.$j=!0;return this};
258 function pe(a,b){if(null!==a.Wd&&!1===b.xa)return a.Wd;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.Wd=[],a.Wd;b=a.Ne;var e=a.aj,f=K.wy(0,0,c<d?c:d,a.startAngle,a.startAngle+a.sweepAngle,!1);if(c!==d){var g=Gb.alloc();g.reset();c<d?g.scale(1,d/c):g.scale(c/d,1);Yd(f,g);Gb.free(g)}c=f.length;for(d=0;d<c;d++)g=f[d],g[0]+=b,g[1]+=e,g[2]+=b,g[3]+=e,g[4]+=b,g[5]+=e,g[6]+=b,g[7]+=e;a.Wd=f;return a.Wd}
259 function qe(a,b,c,d){function e(a,b,c,d){return(a*d<b*c?-1:1)*Math.acos((a*c+b*d)/(Math.sqrt(a*a+b*b)*Math.sqrt(c*c+d*d)))}if(null!==a.Wd&&!1===b.xa)return a.Wd;if(0===a.radiusX||0===a.radiusY)return a.Wd=[],a.Wd;b=a.bj;var f=a.Bh;0===b&&(b=1E-4);0===f&&(f=1E-4);var g=Math.PI/180*a.Ne,h=a.Yl,k=a.ql,l=a.nc,m=a.tc,n=Math.cos(g),p=Math.sin(g),r=n*(c-l)/2+p*(d-m)/2;g=-p*(c-l)/2+n*(d-m)/2;var q=r*r/(b*b)+g*g/(f*f);1<q&&(b*=Math.sqrt(q),f*=Math.sqrt(q));q=(h===k?-1:1)*Math.sqrt((b*b*f*f-b*b*g*g-f*f*r*r)/
260 (b*b*g*g+f*f*r*r));isNaN(q)&&(q=0);h=q*b*g/f;q=q*-f*r/b;isNaN(h)&&(h=0);isNaN(q)&&(q=0);c=(c+l)/2+n*h-p*q;d=(d+m)/2+p*h+n*q;m=e(1,0,(r-h)/b,(g-q)/f);n=(r-h)/b;l=(g-q)/f;r=(-r-h)/b;h=(-g-q)/f;g=e(n,l,r,h);r=(n*r+l*h)/(Math.sqrt(n*n+l*l)*Math.sqrt(r*r+h*h));-1>=r?g=Math.PI:1<=r&&(g=0);!k&&0<g&&(g-=2*Math.PI);k&&0>g&&(g+=2*Math.PI);k=b>f?1:b/f;r=b>f?f/b:1;b=K.wy(0,0,b>f?b:f,m,m+g,!0);f=Gb.alloc();f.reset();f.translate(c,d);f.rotate(a.Ne,0,0);f.scale(k,r);Yd(b,f);Gb.free(f);a.Wd=b;return a.Wd}
261 na.Object.defineProperties(we.prototype,{isClosed:{configurable:!0,get:function(){return this.$j},set:function(a){this.$j!==a&&(this.$j=a,this.xa=!0)}},type:{configurable:!0,get:function(){return this.sa},set:function(a){F&&gb(a,we,we,"type");this.s&&va(this,a);this.sa=a;this.xa=!0}},endX:{configurable:!0,get:function(){return this.nc},set:function(a){F&&C(a,we,"endX");this.s&&va(this,a);this.nc=a;this.xa=!0}},endY:{configurable:!0,get:function(){return this.tc},
262 set:function(a){F&&C(a,we,"endY");this.s&&va(this,a);this.tc=a;this.xa=!0}},point1X:{configurable:!0,get:function(){return this.Ne},set:function(a){F&&C(a,we,"point1X");this.s&&va(this,a);this.Ne=a;this.xa=!0}},point1Y:{configurable:!0,get:function(){return this.aj},set:function(a){F&&C(a,we,"point1Y");this.s&&va(this,a);this.aj=a;this.xa=!0}},point2X:{configurable:!0,get:function(){return this.bj},set:function(a){F&&C(a,we,"point2X");this.s&&va(this,a);this.bj=
263 a;this.xa=!0}},point2Y:{configurable:!0,get:function(){return this.Bh},set:function(a){F&&C(a,we,"point2Y");this.s&&va(this,a);this.Bh=a;this.xa=!0}},centerX:{configurable:!0,get:function(){return this.Ne},set:function(a){F&&C(a,we,"centerX");this.s&&va(this,a);this.Ne=a;this.xa=!0}},centerY:{configurable:!0,get:function(){return this.aj},set:function(a){F&&C(a,we,"centerY");this.s&&va(this,a);this.aj=a;this.xa=!0}},radiusX:{configurable:!0,
264 get:function(){return this.bj},set:function(a){F&&C(a,we,"radiusX");0>a&&za(a,">= zero",we,"radiusX");this.s&&va(this,a);this.bj=a;this.xa=!0}},radiusY:{configurable:!0,get:function(){return this.Bh},set:function(a){F&&C(a,we,"radiusY");0>a&&za(a,">= zero",we,"radiusY");this.s&&va(this,a);this.Bh=a;this.xa=!0}},startAngle:{configurable:!0,get:function(){return this.nc},set:function(a){this.nc!==a&&(this.s&&va(this,a),F&&C(a,we,"startAngle"),a%=360,0>a&&(a+=360),this.nc=
265 a,this.xa=!0)}},sweepAngle:{configurable:!0,get:function(){return this.tc},set:function(a){F&&C(a,we,"sweepAngle");this.s&&va(this,a);360<a&&(a=360);-360>a&&(a=-360);this.tc=a;this.xa=!0}},isClockwiseArc:{configurable:!0,get:function(){return this.ql},set:function(a){this.s&&va(this,a);this.ql=a;this.xa=!0}},isLargeArc:{configurable:!0,get:function(){return this.Yl},set:function(a){this.s&&va(this,a);this.Yl=a;this.xa=!0}},xAxisRotation:{configurable:!0,
266 get:function(){return this.Ne},set:function(a){F&&C(a,we,"xAxisRotation");a%=360;0>a&&(a+=360);this.s&&va(this,a);this.Ne=a;this.xa=!0}}});we.prototype.equalsApprox=we.prototype.Wa;var ke=new E(we,"Move",0),Id=new E(we,"Line",1),le=new E(we,"Bezier",2),me=new E(we,"QuadraticBezier",3),ne=new E(we,"Arc",4),oe=new E(we,"SvgArc",4);we.className="PathSegment";we.Move=ke;we.Line=Id;we.Bezier=le;we.QuadraticBezier=me;we.Arc=ne;we.SvgArc=oe;
267 function ye(){this.C=null;this.Lv=(new J(0,0)).freeze();this.Vu=(new J(0,0)).freeze();this.Lr=this.Ms=0;this.Mr=1;this.Oi="";this.Ft=this.fs=!1;this.cs=this.Or=0;this.ah=this.ps=this.zs=!1;this.ls=null;this.At=0;this.vd=this.zt=null}ye.prototype.copy=function(){var a=new ye;return this.clone(a)};
268 ye.prototype.clone=function(a){a.C=this.C;a.Lv.assign(this.viewPoint);a.Vu.assign(this.documentPoint);a.Ms=this.Ms;a.Lr=this.Lr;a.Mr=this.Mr;a.Oi=this.Oi;a.fs=this.fs;a.Ft=this.Ft;a.Or=this.Or;a.cs=this.cs;a.zs=this.zs;a.ps=this.ps;a.ah=this.ah;a.ls=this.ls;a.At=this.At;a.zt=this.zt;a.vd=this.vd;return a};
269 ye.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};ye.prototype.Wq=function(a,b){var c=this.diagram;if(null===c)return b;ze(c,this.event,a,b);return b};
270 ye.prototype.GA=function(a,b){var c=this.diagram;if(null===c)return b;ze(c,this.event,a,b);b.assign(c.Bu(b));return b};
271 na.Object.defineProperties(ye.prototype,{diagram:{configurable:!0,get:function(){return this.C},set:function(a){this.C=a}},viewPoint:{configurable:!0,get:function(){return this.Lv},set:function(a){w(a,J,ye,"viewPoint");this.Lv.assign(a)}},documentPoint:{configurable:!0,get:function(){return this.Vu},set:function(a){w(a,J,ye,"documentPoint");this.Vu.assign(a)}},modifiers:{configurable:!0,get:function(){return this.Ms},set:function(a){this.Ms=
272 a}},button:{configurable:!0,get:function(){return this.Lr},set:function(a){this.Lr=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.Mr},set:function(a){this.Mr=a}},key:{configurable:!0,get:function(){return this.Oi},set:function(a){this.Oi=a}},down:{configurable:!0,get:function(){return this.fs},set:function(a){this.fs=a}},up:{configurable:!0,
273 enumerable:!0,get:function(){return this.Ft},set:function(a){this.Ft=a}},clickCount:{configurable:!0,get:function(){return this.Or},set:function(a){this.Or=a}},delta:{configurable:!0,get:function(){return this.cs},set:function(a){this.cs=a}},isMultiTouch:{configurable:!0,get:function(){return this.zs},set:function(a){this.zs=a}},handled:{configurable:!0,get:function(){return this.ps},set:function(a){this.ps=a}},bubbles:{configurable:!0,
274 get:function(){return this.ah},set:function(a){this.ah=a}},event:{configurable:!0,get:function(){return this.ls},set:function(a){this.ls=a}},isTouchEvent:{configurable:!0,get:function(){var a=qa.TouchEvent,b=this.event;return a&&b instanceof a?!0:(a=qa.PointerEvent)&&b instanceof a&&("touch"===b.pointerType||"pen"===b.pointerType)}},timestamp:{configurable:!0,get:function(){return this.At},set:function(a){this.At=a}},targetDiagram:{configurable:!0,
275 get:function(){return this.zt},set:function(a){this.zt=a}},targetObject:{configurable:!0,get:function(){return this.vd},set:function(a){this.vd=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,
276 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=
277 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&
278 4):1===this.button},set:function(a){this.buttons=a?this.buttons|4:this.buttons&-5}}});ye.prototype.getMultiTouchDocumentPoint=ye.prototype.GA;ye.prototype.getMultiTouchViewPoint=ye.prototype.Wq;ye.className="InputEvent";function Ae(){this.C=null;this.va="";this.Ws=this.xt=null}Ae.prototype.copy=function(){var a=new Ae;a.C=this.C;a.va=this.va;a.xt=this.xt;a.Ws=this.Ws;return a};
279 Ae.prototype.toString=function(){var a="*"+this.name;null!==this.subject&&(a+=":"+this.subject.toString());null!==this.parameter&&(a+="("+this.parameter.toString()+")");return a};
280 na.Object.defineProperties(Ae.prototype,{diagram:{configurable:!0,get:function(){return this.C},set:function(a){this.C=a}},name:{configurable:!0,get:function(){return this.va},set:function(a){this.va=a}},subject:{configurable:!0,get:function(){return this.xt},set:function(a){this.xt=a}},parameter:{configurable:!0,get:function(){return this.Ws},set:function(a){this.Ws=a}}});Ae.className="DiagramEvent";
281 function Be(){this.Jn=Ce;this.uf=this.Ls="";this.vp=this.wp=this.Cp=this.Dp=this.Bp=this.C=this.ic=null}Be.prototype.clear=function(){this.vp=this.wp=this.Cp=this.Dp=this.Bp=this.C=this.ic=null};
282 Be.prototype.copy=function(){var a=new Be;a.Jn=this.Jn;a.Ls=this.Ls;a.uf=this.uf;a.ic=this.ic;a.C=this.C;a.Bp=this.Bp;var b=this.Dp;a.Dp=Ga(b)&&"function"===typeof b.K?b.K():b;b=this.Cp;a.Cp=Ga(b)&&"function"===typeof b.K?b.K():b;b=this.wp;a.wp=Ga(b)&&"function"===typeof b.K?b.K():b;b=this.vp;a.vp=Ga(b)&&"function"===typeof b.K?b.K():b;return a};Be.prototype.pb=function(a){a.classType===Be?this.change=a:Da(this,a)};
283 Be.prototype.toString=function(){var a="";a=this.change===De?a+"* ":this.change===Ce?a+(null!==this.model?"!m":"!d"):a+((null!==this.model?"!m":"!d")+this.change);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.modelChange&&this.modelChange!==this.propertyName&&(a+=" "+this.modelChange);a+=": ";this.change===De?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Qa(this.object)),null!==this.oldValue&&(a+=" old: "+Qa(this.oldValue)),null!==
284 this.oldParam&&(a+=" "+this.oldParam),null!==this.newValue&&(a+=" new: "+Qa(this.newValue)),null!==this.newParam&&(a+=" "+this.newParam));return a};Be.prototype.J=function(a){return a?this.oldValue:this.newValue};Be.prototype.IA=function(a){return a?this.oldParam:this.newParam};Be.prototype.canUndo=function(){return null!==this.model||null!==this.diagram?!0:!1};
285 Be.prototype.undo=function(){this.canUndo()&&(null!==this.model?this.model.changeState(this,!0):null!==this.diagram&&this.diagram.changeState(this,!0))};Be.prototype.canRedo=function(){return null!==this.model||null!==this.diagram?!0:!1};Be.prototype.redo=function(){this.canRedo()&&(null!==this.model?this.model.changeState(this,!1):null!==this.diagram&&this.diagram.changeState(this,!1))};
286 na.Object.defineProperties(Be.prototype,{model:{configurable:!0,get:function(){return this.ic},set:function(a){this.ic=a}},diagram:{configurable:!0,get:function(){return this.C},set:function(a){this.C=a}},change:{configurable:!0,get:function(){return this.Jn},set:function(a){F&&gb(a,Be,Be,"change");this.Jn=a}},modelChange:{configurable:!0,get:function(){return this.Ls},set:function(a){F&&A(a,"string",Be,"modelChange");this.Ls=a}},propertyName:{configurable:!0,
287 enumerable:!0,get:function(){return this.uf},set:function(a){F&&"string"!==typeof a&&A(a,"function",Be,"propertyName");this.uf=a}},isTransactionFinished:{configurable:!0,get:function(){return this.Jn===De&&("CommittedTransaction"===this.uf||"FinishedUndo"===this.uf||"FinishedRedo"===this.uf)}},object:{configurable:!0,get:function(){return this.Bp},set:function(a){this.Bp=a}},oldValue:{configurable:!0,get:function(){return this.Dp},set:function(a){this.Dp=
288 a}},oldParam:{configurable:!0,get:function(){return this.Cp},set:function(a){this.Cp=a}},newValue:{configurable:!0,get:function(){return this.wp},set:function(a){this.wp=a}},newParam:{configurable:!0,get:function(){return this.vp},set:function(a){this.vp=a}}});Be.prototype.redo=Be.prototype.redo;Be.prototype.canRedo=Be.prototype.canRedo;Be.prototype.undo=Be.prototype.undo;Be.prototype.canUndo=Be.prototype.canUndo;Be.prototype.getParam=Be.prototype.IA;
289 Be.prototype.getValue=Be.prototype.J;Be.prototype.clear=Be.prototype.clear;var De=new E(Be,"Transaction",-1),Ce=new E(Be,"Property",0),Le=new E(Be,"Insert",1),Me=new E(Be,"Remove",2);Be.className="ChangedEvent";Be.Transaction=De;Be.Property=Ce;Be.Insert=Le;Be.Remove=Me;function Ne(){this.w=(new H).freeze();this.va="";this.l=!1}
290 Ne.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.changes.count.toString()+(this.isComplete?"":", incomplete");if(void 0!==a&&0<a){a=this.changes.count;for(var c=0;c<a;c++){var d=this.changes.M(c);null!==d&&(b+="\n "+d.toString())}}return b};Ne.prototype.clear=function(){var a=this.changes;a.ka();for(var b=a.count-1;0<=b;b--){var c=a.M(b);null!==c&&c.clear()}a.clear();a.freeze()};Ne.prototype.canUndo=function(){return this.isComplete};
291 Ne.prototype.undo=function(){if(this.canUndo())for(var a=this.changes.count-1;0<=a;a--){var b=this.changes.M(a);null!==b&&b.undo()}};Ne.prototype.canRedo=function(){return this.isComplete};Ne.prototype.redo=function(){if(this.canRedo())for(var a=this.changes.count,b=0;b<a;b++){var c=this.changes.M(b);null!==c&&c.redo()}};
292 Ne.prototype.Bw=function(){if(this.isComplete){var a=this.changes;a.ka();for(var b=new Bb,c=0;c<a.count;c++){var d=a.M(c);if(null!==d&&d.change===Ce&&d.object){var e=b.get(d.object);e||(e=new Bb,b.set(d.object,e));var f=e.get(d.propertyName);null===f?e.set(d.propertyName,-1):(0<f&&a.Vc(f,null),e.set(d.propertyName,c))}}for(c=b=0;c<a.count;c++)d=a.M(c),null!==d&&(c>b&&a.Vc(b,d),b++);for(;a.length>b;)a.pop();a.freeze()}};
293 na.Object.defineProperties(Ne.prototype,{changes:{configurable:!0,get:function(){return this.w}},name:{configurable:!0,get:function(){return this.va},set:function(a){this.va=a}},isComplete:{configurable:!0,get:function(){return this.l},set:function(a){this.l=a}}});Ne.prototype.optimize=Ne.prototype.Bw;Ne.prototype.redo=Ne.prototype.redo;Ne.prototype.canRedo=Ne.prototype.canRedo;Ne.prototype.undo=Ne.prototype.undo;Ne.prototype.canUndo=Ne.prototype.canUndo;
294 Ne.prototype.clear=Ne.prototype.clear;Ne.className="Transaction";function Oe(){this.tv=new I;this.sd=!1;this.L=(new H).freeze();this.ce=-1;this.w=999;this.Ce=!1;this.Zr=null;this.ij=0;this.l=!1;F&&(this.l=!0);this.Je=(new H).freeze();this.fm=new H;this.cv=!0;this.iv=this.xs=this.mv=this.lv=!1}
295 Oe.prototype.toString=function(a){var b="UndoManager "+this.historyIndex+"<"+this.history.count+"<="+this.maxHistoryLength;b+="[";for(var c=this.nestedTransactionNames.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.nestedTransactionNames.M(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.M(d).toString(a-1);return b};
296 Oe.prototype.clear=function(){var a=this.history;a.ka();for(var b=a.count-1;0<=b;b--){var c=a.M(b);null!==c&&c.clear()}a.clear();this.ce=-1;a.freeze();this.Ce=!1;this.Zr=null;this.ij=0;this.Je.ka();this.Je.clear();this.Je.freeze();this.fm.clear();this.iv=this.xs=this.mv=this.lv=!1};Oe.prototype.copyProperties=function(a){this.isEnabled=a.isEnabled;this.maxHistoryLength=a.maxHistoryLength;this.checksTransactionLevel=a.checksTransactionLevel};t=Oe.prototype;t.ly=function(a){this.tv.add(a)};t.ez=function(a){this.tv.remove(a)};
297 t.Ca=function(a){void 0===a&&(a="");null===a&&(a="");if(this.isUndoingRedoing)return!1;!0===this.cv&&(this.cv=!1,this.ij++,this.isInternalTransaction||this.Gb("StartingFirstTransaction",a,this.currentTransaction),0<this.ij&&this.ij--);this.isEnabled&&(this.Je.ka(),this.Je.add(a),this.Je.freeze(),null===this.currentTransaction?this.fm.add(0):this.fm.add(this.currentTransaction.changes.count));this.ij++;var b=1===this.transactionLevel;b&&(this.isInternalTransaction||this.Gb("StartedTransaction",a,this.currentTransaction));
298 return b};t.cb=function(a){void 0===a&&(a="");return Pe(this,!0,a)};t.Uf=function(){return Pe(this,!1,"")};
299 function Pe(a,b,c){if(a.isUndoingRedoing)return!1;a.checksTransactionLevel&&1>a.transactionLevel&&Ea("Ending transaction without having started a transaction: "+c);var d=1===a.transactionLevel,e=a.currentTransaction;d&&b&&(a.isInternalTransaction||a.Gb("CommittingTransaction",c,e));var f=0;if(0<a.transactionLevel&&(a.ij--,a.isEnabled)){var g=a.Je.count;0<g&&(""===c&&(c=a.Je.M(0)),a.Je.ka(),a.Je.jb(g-1),a.Je.freeze());g=a.fm.count;0<g&&(f=a.fm.M(g-1),a.fm.jb(g-1))}if(d){if(b){a.xs=!1;null===e&&""!==
300 c&&(e=a.currentTransaction);if(a.isEnabled&&null!==e){e.isComplete||(e.isComplete=!0,e.name=c);b=a.history;b.ka();for(d=b.count-1;d>a.historyIndex;d--)f=b.M(d),null!==f&&f.clear(),b.jb(d),a.xs=!0;d=a.maxHistoryLength;0<=d&&(0===d?b.clear():b.count>=d&&(f=b.M(0),null!==f&&f.clear(),b.jb(0),a.ce--));0===d||0!==b.count&&b.get(b.count-1)===e||(b.add(e),a.ce++);b.freeze()}a.isInternalTransaction||a.Gb("CommittedTransaction",c,e)}else{a.Ce=!0;try{a.isEnabled&&null!==e&&(e.isComplete=!0,e.undo())}finally{a.isInternalTransaction||
301 a.Gb("RolledBackTransaction",c,e),a.Ce=!1}null!==e&&e.clear()}a.Zr=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.M(e),null!==b&&b.undo(),c.ka(),c.jb(e);c.freeze()}return!1}Oe.prototype.canUndo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToUndo;return null!==a&&a.canUndo()?!0:!1};
302 Oe.prototype.undo=function(){if(this.canUndo()){var a=this.transactionToUndo;try{this.Ce=!0,this.Gb("StartingUndo","Undo",a),this.ce--,a.undo()}catch(b){Ea("undo error: "+b.toString())}finally{this.Gb("FinishedUndo","Undo",a),this.Ce=!1}}};Oe.prototype.canRedo=function(){if(!this.isEnabled||0<this.transactionLevel)return!1;var a=this.transactionToRedo;return null!==a&&a.canRedo()?!0:!1};
303 Oe.prototype.redo=function(){if(this.canRedo()){var a=this.transactionToRedo;try{this.Ce=!0,this.Gb("StartingRedo","Redo",a),this.ce++,a.redo()}catch(b){Ea("redo error: "+b.toString())}finally{this.Gb("FinishedRedo","Redo",a),this.Ce=!1}}};Oe.prototype.Gb=function(a,b,c){void 0===c&&(c=null);var d=new Be;d.change=De;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.models;a.next();)b=a.value,d.model=b,b.Mt(d)};
304 Oe.prototype.pw=function(a){if(this.isEnabled&&!this.isUndoingRedoing&&!this.skipsEvent(a)){var b=this.currentTransaction;null===b&&(this.Zr=b=new Ne);var c=a.copy();b=b.changes;b.ka();b.add(c);b.freeze();this.checksTransactionLevel&&0>=this.transactionLevel&&!this.cv&&(a=a.diagram,null!==a&&!1===a.Bj||Ea("Change not within a transaction: "+c.toString()))}};
305 Oe.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};
306 na.Object.defineProperties(Oe.prototype,{models:{configurable:!0,get:function(){return this.tv.iterator}},isEnabled:{configurable:!0,get:function(){return this.sd},set:function(a){this.sd=a}},transactionToUndo:{configurable:!0,get:function(){return 0<=this.historyIndex&&this.historyIndex<=this.history.count-1?this.history.M(this.historyIndex):null}},transactionToRedo:{configurable:!0,get:function(){return this.historyIndex<this.history.count-
307 1?this.history.M(this.historyIndex+1):null}},isUndoingRedoing:{configurable:!0,get:function(){return this.Ce}},history:{configurable:!0,get:function(){return this.L}},maxHistoryLength:{configurable:!0,get:function(){return this.w},set:function(a){this.w=a}},historyIndex:{configurable:!0,get:function(){return this.ce}},currentTransaction:{configurable:!0,get:function(){return this.Zr}},transactionLevel:{configurable:!0,
308 get:function(){return this.ij}},isInTransaction:{configurable:!0,get:function(){return 0<this.ij}},checksTransactionLevel:{configurable:!0,get:function(){return this.l},set:function(a){this.l=a}},nestedTransactionNames:{configurable:!0,get:function(){return this.Je}},isPendingClear:{configurable:!0,get:function(){return this.lv},set:function(a){this.lv=a}},isPendingUnmodified:{configurable:!0,get:function(){return this.mv},set:function(a){this.mv=
309 a}},isInternalTransaction:{configurable:!0,get:function(){return this.iv},set:function(a){this.iv=a}},isJustDiscarded:{configurable:!0,get:function(){return this.xs}}});Oe.prototype.handleChanged=Oe.prototype.pw;Oe.prototype.redo=Oe.prototype.redo;Oe.prototype.undo=Oe.prototype.undo;Oe.prototype.canUndo=Oe.prototype.canUndo;Oe.prototype.rollbackTransaction=Oe.prototype.Uf;Oe.prototype.commitTransaction=Oe.prototype.cb;Oe.prototype.startTransaction=Oe.prototype.Ca;
310 Oe.prototype.removeModel=Oe.prototype.ez;Oe.prototype.addModel=Oe.prototype.ly;Oe.prototype.clear=Oe.prototype.clear;Oe.className="UndoManager";function Qe(){0<arguments.length&&Ba(Qe);eb(this);this.C=Re;this.va="";this.sd=!0;this.Yc=!1;this.xx=null;this.Cz=new ye;this.It=-1}Qe.prototype.toString=function(){return""!==this.name?this.name+" Tool":Pa(this.constructor)};Qe.prototype.updateAdornments=function(){};Qe.prototype.canStart=function(){return this.isEnabled};Qe.prototype.doStart=function(){};
311 Qe.prototype.doActivate=function(){this.isActive=!0};Qe.prototype.doDeactivate=function(){this.isActive=!1};Qe.prototype.doStop=function(){};Qe.prototype.doCancel=function(){this.transactionResult=null;this.stopTool()};Qe.prototype.stopTool=function(){var a=this.diagram;a.currentTool===this&&(a.currentTool=null,a.currentCursor="")};Qe.prototype.doMouseDown=function(){!this.isActive&&this.canStart()&&this.doActivate()};Qe.prototype.doMouseMove=function(){};Qe.prototype.doMouseUp=function(){this.stopTool()};
312 Qe.prototype.doMouseWheel=function(){};Qe.prototype.canStartMultiTouch=function(){return!0};Qe.prototype.standardPinchZoomStart=function(){var a=this.diagram,b=a.lastInput,c=b.Wq(0,J.allocAt(NaN,NaN)),d=b.Wq(1,J.allocAt(NaN,NaN));if(c.o()&&d.o()&&(this.doCancel(),a.Pm("hasGestureZoom"))){a.hm=a.scale;var e=d.x-c.x,f=d.y-c.y;a.Fv=Math.sqrt(e*e+f*f);b.bubbles=!1}J.free(c);J.free(d)};
313 Qe.prototype.standardPinchZoomMove=function(){var a=this.diagram,b=a.lastInput,c=b.Wq(0,J.allocAt(NaN,NaN)),d=b.Wq(1,J.allocAt(NaN,NaN));if(c.o()&&d.o()&&(this.doCancel(),a.Pm("hasGestureZoom"))){var e=d.x-c.x,f=d.y-c.y;f=Math.sqrt(e*e+f*f)/a.Fv;e=new J((Math.min(d.x,c.x)+Math.max(d.x,c.x))/2,(Math.min(d.y,c.y)+Math.max(d.y,c.y))/2);f*=a.hm;var g=a.commandHandler;if(f!==a.scale&&g.canResetZoom(f)){var h=a.zoomPoint;a.zoomPoint=e;g.resetZoom(f);a.zoomPoint=h}b.bubbles=!1}J.free(c);J.free(d)};
314 Qe.prototype.doKeyDown=function(){"Esc"===this.diagram.lastInput.key&&this.doCancel()};Qe.prototype.doKeyUp=function(){};Qe.prototype.Ca=function(a){void 0===a&&(a=this.name);this.transactionResult=null;return this.diagram.Ca(a)};Qe.prototype.Vg=function(){var a=this.diagram;return null===this.transactionResult?a.Uf():a.cb(this.transactionResult)};
315 Qe.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var b=a.lastInput,c=a.Nm(b.documentPoint,!1);if(null!==c)if(cb?b.meta:b.control){a.U("ChangingSelection",a.selection);for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&(b.isSelected=!b.isSelected);a.U("ChangedSelection",a.selection)}else if(b.shift){if(!c.isSelected){a.U("ChangingSelection",a.selection);for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&(b.isSelected=!0);a.U("ChangedSelection",
316 a.selection)}}else{if(!c.isSelected){for(b=c;null!==b&&!b.canSelect();)b=b.containingGroup;null!==b&&a.select(b)}}else!b.left||(cb?b.meta:b.control)||b.shift||a.clearSelection()}};Qe.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.isTemporary});var c=this.diagram,d=c.lastInput;a=c.ac(d.documentPoint,a,b);d.targetObject=a;Se(a,d,c);return d.handled};
317 function Se(a,b,c){b.handled=!1;if(null===a||a.Tg()){var d=0;b.left?d=1===b.clickCount?1:2===b.clickCount?2:1:b.right&&1===b.clickCount&&(d=3);var e="ObjectSingleClicked";if(null!==a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!==d&&c.U(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.U(e)}if(null!==a)for(;null!==a;){c=null;switch(d){case 1:c=
318 a.click;break;case 2:c=a.doubleClick?a.doubleClick:a.click;break;case 3:c=a.contextClick}if(null!==c&&(c(b,a),b.handled))break;a=a.panel}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.doubleClick?c.doubleClick:c.click;break;case 3:a=c.contextClick}null!==a&&a(b)}}}
319 Qe.prototype.standardMouseOver=function(){var a=this.diagram,b=a.lastInput;if(!0!==a.animationManager.yc){var c=a.skipsUndoManager;a.skipsUndoManager=!0;var d=a.viewportBounds.ca(b.documentPoint)?a.ac(b.documentPoint,null,null):null;b.targetObject=d;var e=!1;if(d!==a.Qj){var f=a.Qj,g=f;a.Qj=d;this.doCurrentObjectChanged(f,d);for(b.handled=!1;null!==f;){var h=f.mouseLeave;if(null!==h){if(d===f)break;if(null!==d&&d.Sg(f))break;h(b,f,d);e=!0;if(b.handled)break}f=f.panel}f=g;for(b.handled=!1;null!==d;){g=
320 d.mouseEnter;if(null!==g){if(f===d)break;if(null!==f&&f.Sg(d))break;g(b,d,f);e=!0;if(b.handled)break}d=d.panel}d=a.Qj}if(null!==d){f=d;for(g="";null!==f;){g=f.cursor;if(""!==g)break;f=f.panel}a.currentCursor=g;b.handled=!1;for(f=d;null!==f;){d=f.mouseOver;if(null!==d&&(d(b,f),e=!0,b.handled))break;f=f.panel}}else a.currentCursor="",d=a.mouseOver,null!==d&&(d(b),e=!0);e&&a.Jb();a.skipsUndoManager=c}};Qe.prototype.doCurrentObjectChanged=function(){};
321 Qe.prototype.standardMouseWheel=function(){var a=this.diagram,b=a.lastInput,c=b.delta;if(0!==c&&a.documentBounds.o()){var d=a.commandHandler,e=a.toolManager.mouseWheelBehavior;if(null!==d&&(e===Te&&!b.shift||e===Ue&&b.control)){if(0<c?d.canIncreaseZoom():d.canDecreaseZoom())e=a.zoomPoint,a.zoomPoint=b.viewPoint,0<c?d.increaseZoom():d.decreaseZoom(),a.zoomPoint=e;b.bubbles=!1}else if(e===Te&&b.shift||e===Ue&&!b.control){d=a.position.copy();var f=0<c?c:-c,g=b.event,h=g.deltaMode;e=g.deltaX;g=g.deltaY;
322 if(Za||$a||ab)h=1,0<e&&(e=3),0>e&&(e=-3),0<g&&(g=3),0>g&&(g=-3);if(void 0===h||void 0===e||void 0===g||0===e&&0===g||b.shift)!b.shift&&a.allowVerticalScroll?(f=3*f*a.scrollVerticalLineChange,0<c?a.scroll("pixel","up",f):a.scroll("pixel","down",f)):b.shift&&a.allowHorizontalScroll&&(f=3*f*a.scrollHorizontalLineChange,0<c?a.scroll("pixel","left",f):a.scroll("pixel","right",f));else{switch(h){case 0:c="pixel";break;case 1:c="line";break;case 2:c="page";break;default:c="pixel"}0!==e&&a.allowHorizontalScroll&&
323 (e*=a.scrollHorizontalLineChange/16,0<e?a.scroll(c,"left",-e):a.scroll(c,"right",e));0!==g&&a.allowVerticalScroll&&(g*=a.scrollVerticalLineChange/16,0<g?a.scroll(c,"up",-g):a.scroll(c,"down",g))}a.position.A(d)||(b.bubbles=!1)}}};Qe.prototype.standardWaitAfter=function(a,b){F&&A(a,"number",Qe,"standardWaitAfter:delay");void 0===b&&(b=this.diagram.lastInput);this.cancelWaitAfter();var c=this,d=b.clone(this.Cz);this.It=ta(function(){c.doWaitAfter(d)},a)};
324 Qe.prototype.cancelWaitAfter=function(){-1!==this.It&&qa.clearTimeout(this.It);this.It=-1};Qe.prototype.doWaitAfter=function(){};Qe.prototype.findToolHandleAt=function(a,b){a=this.diagram.ac(a,function(a){for(;null!==a&&!(a.panel instanceof Ve);)a=a.panel;return a});return null===a?null:a.part.category===b?a:null};
325 Qe.prototype.isBeyondDragSize=function(a,b){var c=this.diagram;void 0===a&&(a=c.firstInput.viewPoint);void 0===b&&(b=c.lastInput.viewPoint);var d=c.toolManager.dragSize,e=d.width;d=d.height;c.firstInput.isTouchEvent&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};
326 na.Object.defineProperties(Qe.prototype,{diagram:{configurable:!0,get:function(){return this.C},set:function(a){a instanceof R&&(this.C=a)}},name:{configurable:!0,get:function(){return this.va},set:function(a){A(a,"string",Qe,"name");this.va=a}},isEnabled:{configurable:!0,get:function(){return this.sd},set:function(a){A(a,"boolean",Qe,"isEnabled");this.sd=a}},isActive:{configurable:!0,get:function(){return this.Yc},set:function(a){A(a,"boolean",
327 Qe,"isActive");this.Yc=a}},transactionResult:{configurable:!0,get:function(){return this.xx},set:function(a){null!==a&&A(a,"string",Qe,"transactionResult");this.xx=a}}});Qe.prototype.stopTransaction=Qe.prototype.Vg;Qe.prototype.startTransaction=Qe.prototype.Ca;Qe.className="Tool";function Ta(){Qe.call(this);this.name="ToolManager";this.Ic=new H;this.Zc=new H;this.Ud=new H;this.W=this.Pa=850;this.w=(new Fb(2,2)).ia();this.kb=5E3;this.Qa=Ue;this.L=We;this.Yr=this.l=null;this.vk=-1}
328 ma(Ta,Qe);Ta.prototype.initializeStandardTools=function(){};Ta.prototype.updateAdornments=function(a){var b=this.currentToolTip;if(b instanceof Ve&&this.Yr===a){var c=b.adornedObject;(null!==a?c.part===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}};
329 Ta.prototype.doMouseDown=function(){var a=this.diagram,b=a.lastInput;b.isTouchEvent&&this.gestureBehavior===Xe&&(b.bubbles=!1);if(b.isMultiTouch){this.cancelWaitAfter();if(this.gestureBehavior===Ye){b.bubbles=!0;return}if(this.gestureBehavior===Xe)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomStart();return}}var c=a.undoManager;F&&c.checksTransactionLevel&&0!==c.transactionLevel&&Ea("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");c=this.mouseDownTools.length;
330 for(var d=0;d<c;d++){var e=this.mouseDownTools.M(d);e.diagram=this.diagram;if(e.canStart()){a.doFocus();a.currentTool=e;a.currentTool===e&&(e.isActive||e.doActivate(),e.doMouseDown());return}}1===a.lastInput.button&&(this.mouseWheelBehavior===Ue?this.mouseWheelBehavior=Te:this.mouseWheelBehavior===Te&&(this.mouseWheelBehavior=Ue));this.doActivate();this.standardWaitAfter(this.holdDelay,b)};
331 Ta.prototype.doMouseMove=function(){var a=this.diagram,b=a.lastInput;if(b.isMultiTouch){if(this.gestureBehavior===Ye){b.bubbles=!0;return}if(this.gestureBehavior===Xe)return;if(a.currentTool.canStartMultiTouch()){a.currentTool.standardPinchZoomMove();return}}if(this.isActive)for(var c=this.mouseMoveTools.length,d=0;d<c;d++){var e=this.mouseMoveTools.M(d);e.diagram=this.diagram;if(e.canStart()){a.doFocus();a.currentTool=e;a.currentTool===e&&(e.isActive||e.doActivate(),e.doMouseMove());return}}Ze(this,
332 a);a=b.event;null===a||"mousemove"!==a.type&&"pointermove"!==a.type&&a.cancelable||(b.bubbles=!0)};function Ze(a,b){a.standardMouseOver();a.isBeyondDragSize()&&a.standardWaitAfter(a.isActive?a.holdDelay:a.hoverDelay,b.lastInput)}Ta.prototype.doCurrentObjectChanged=function(a,b){a=this.currentToolTip;null===a||null!==b&&a instanceof Ve&&(b===a||b.Sg(a))||this.hideToolTip()};
333 Ta.prototype.doWaitAfter=function(a){var b=this.diagram;b.Da&&(this.doMouseHover(),this.isActive||this.doToolTip(),a.isTouchEvent&&!b.lastInput.handled&&(a=a.copy(),a.button=2,a.buttons=2,b.lastInput=a,b.uk=!0,b.doMouseUp()))};
334 Ta.prototype.doMouseHover=function(){var a=this.diagram,b=a.lastInput;null===b.targetObject&&(b.targetObject=a.ac(b.documentPoint,null,null));var c=b.targetObject;if(null!==c)for(b.handled=!1;null!==c;){a=this.isActive?c.mouseHold:c.mouseHover;if(null!==a&&(a(b,c),b.handled))break;c=c.panel}else c=this.isActive?a.mouseHold:a.mouseHover,null!==c&&c(b)};
335 Ta.prototype.doToolTip=function(){var a=this.diagram,b=a.lastInput;null===b.targetObject&&(b.targetObject=a.ac(b.documentPoint,null,null));b=b.targetObject;if(null!==b){if(a=this.currentToolTip,!(a instanceof Ve)||b!==a&&!b.Sg(a)){for(;null!==b;){a=b.toolTip;if(null!==a){this.showToolTip(a,b);return}b=b.panel}this.hideToolTip()}}else b=a.toolTip,null!==b?this.showToolTip(b,null):this.hideToolTip()};
336 Ta.prototype.showToolTip=function(a,b){!F||a instanceof Ve||a instanceof ef||v("showToolTip:tooltip must be an Adornment or HTMLInfo.");null!==b&&w(b,O,Ta,"showToolTip:obj");var c=this.diagram;a!==this.currentToolTip&&this.hideToolTip();if(a instanceof Ve){a.layerName="Tool";a.selectable=!1;a.scale=1/c.scale;a.category="ToolTip";null!==a.placeholder&&(a.placeholder.scale=c.scale);var d=a.diagram;null!==d&&d!==c&&d.remove(a);c.add(a);null!==b?a.adornedObject=b:a.data=c.model;a.Ya();this.positionToolTip(a,
337 b)}else a instanceof ef&&a!==this.currentToolTip&&a.show(b,c,this);this.currentToolTip=a;-1!==this.vk&&(qa.clearTimeout(this.vk),this.vk=-1);a=this.toolTipDuration;if(0<a&&Infinity!==a){var e=this;this.vk=ta(function(){e.hideToolTip()},a)}};
338 Ta.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.diagram,c=b.lastInput.documentPoint.copy(),d=a.measuredBounds,e=b.viewportBounds;b.lastInput.isTouchEvent&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5/b.scale);c.x<e.x&&(c.x=e.x);c.y=c.y+20/b.scale+d.height>e.bottom?c.y-(d.height+5/b.scale):c.y+20/b.scale;c.y<e.y&&(c.y=e.y);a.position=c}};
339 Ta.prototype.hideToolTip=function(){-1!==this.vk&&(qa.clearTimeout(this.vk),this.vk=-1);var a=this.diagram,b=this.currentToolTip;null!==b&&(b instanceof Ve?(a.remove(b),null!==this.Yr&&this.Yr.Tf(b.category),b.data=null,b.adornedObject=null):b instanceof ef&&null!==b.hide&&b.hide(a,this),this.currentToolTip=null)};
340 Ta.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.diagram;if(this.isActive)for(var b=this.mouseUpTools.length,c=0;c<b;c++){var d=this.mouseUpTools.M(c);d.diagram=this.diagram;if(d.canStart()){a.doFocus();a.currentTool=d;a.currentTool===d&&(d.isActive||d.doActivate(),d.doMouseUp());return}}a.doFocus();this.doDeactivate()};Ta.prototype.doMouseWheel=function(){this.standardMouseWheel()};Ta.prototype.doKeyDown=function(){var a=this.diagram;null!==a.commandHandler&&a.commandHandler.doKeyDown()};
341 Ta.prototype.doKeyUp=function(){var a=this.diagram;null!==a.commandHandler&&a.commandHandler.doKeyUp()};Ta.prototype.findTool=function(a){A(a,"string",Ta,"findTool:name");for(var b=this.mouseDownTools.length,c=0;c<b;c++){var d=this.mouseDownTools.M(c);if(d.name===a)return d}b=this.mouseMoveTools.length;for(c=0;c<b;c++)if(d=this.mouseMoveTools.M(c),d.name===a)return d;b=this.mouseUpTools.length;for(c=0;c<b;c++)if(d=this.mouseUpTools.M(c),d.name===a)return d;return null};
342 Ta.prototype.replaceTool=function(a,b){A(a,"string",Ta,"replaceTool:name");null!==b&&(w(b,Qe,Ta,"replaceTool:newtool"),b.diagram=this.diagram);for(var c=this.mouseDownTools.length,d=0;d<c;d++){var e=this.mouseDownTools.M(d);if(e.name===a)return null!==b?this.mouseDownTools.Vc(d,b):this.mouseDownTools.jb(d),e}c=this.mouseMoveTools.length;for(d=0;d<c;d++)if(e=this.mouseMoveTools.M(d),e.name===a)return null!==b?this.mouseMoveTools.Vc(d,b):this.mouseMoveTools.jb(d),e;c=this.mouseUpTools.length;for(d=
343 0;d<c;d++)if(e=this.mouseUpTools.M(d),e.name===a)return null!==b?this.mouseUpTools.Vc(d,b):this.mouseUpTools.jb(d),e;return null};Ta.prototype.fb=function(a,b,c){A(a,"string",Ta,"replaceStandardTool:name");w(c,H,Ta,"replaceStandardTool:list");null!==b&&(w(b,Qe,Ta,"replaceStandardTool:newtool"),b.name=a,b.diagram=this.diagram);this.findTool(a)?this.replaceTool(a,b):null!==b&&c.add(b)};
344 na.Object.defineProperties(Ta.prototype,{mouseWheelBehavior:{configurable:!0,get:function(){return this.Qa},set:function(a){gb(a,Ta,Ta,"mouseWheelBehavior");this.Qa=a}},gestureBehavior:{configurable:!0,get:function(){return this.L},set:function(a){gb(a,Ta,Ta,"gestureBehavior");this.L=a}},currentToolTip:{configurable:!0,get:function(){return this.l},set:function(a){!F||null===a||a instanceof Ve||a instanceof ef||v("ToolManager.currentToolTip must be an Adornment or HTMLInfo.");
345 this.l=a;this.Yr=null!==a&&a instanceof Ve?a.adornedPart:null}},mouseDownTools:{configurable:!0,get:function(){return this.Ic}},mouseMoveTools:{configurable:!0,get:function(){return this.Zc}},mouseUpTools:{configurable:!0,get:function(){return this.Ud}},hoverDelay:{configurable:!0,get:function(){return this.Pa},set:function(a){A(a,"number",Ta,"hoverDelay");this.Pa=a}},holdDelay:{configurable:!0,get:function(){return this.W},set:function(a){A(a,
346 "number",Ta,"holdDelay");this.W=a}},dragSize:{configurable:!0,get:function(){return this.w},set:function(a){w(a,Fb,Ta,"dragSize");this.w=a.K()}},toolTipDuration:{configurable:!0,get:function(){return this.kb},set:function(a){A(a,"number",Ta,"toolTipDuration");this.kb=a}}});Ta.prototype.replaceStandardTool=Ta.prototype.fb;
347 var Ue=new E(Ta,"WheelScroll",0),Te=new E(Ta,"WheelZoom",1),ff=new E(Ta,"WheelNone",2),We=new E(Ta,"GestureZoom",3),Xe=new E(Ta,"GestureCancel",4),Ye=new E(Ta,"GestureNone",5);Ta.className="ToolManager";Ta.WheelScroll=Ue;Ta.WheelZoom=Te;Ta.WheelNone=ff;Ta.GestureZoom=We;Ta.GestureCancel=Xe;Ta.GestureNone=Ye;
348 function gf(){Qe.call(this);0<arguments.length&&Ba(gf);this.name="Dragging";this.L=this.Zc=!0;this.w=this.kb=this.Pa=this.Cg=null;this.ho=this.Ud=!1;this.wm=new J(NaN,NaN);this.vt=new J;this.Ic=!0;this.Bl=100;this.jh=[];this.Ar=(new I).freeze();this.Qa=new hf;this.So=null;this.W="copy";this.gi="";this.hi="no-drop"}ma(gf,Qe);
349 gf.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly&&!a.allowDragOut||!a.allowMove&&!a.allowCopy&&!a.allowDragOut||!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.isTouchEvent&&b.timestamp-a.firstInput.timestamp<this.Bl)?!1:null!==this.findDraggablePart()};
350 gf.prototype.findDraggablePart=function(){var a=this.diagram;a=a.Nm(a.firstInput.documentPoint,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.containingGroup;return null!==a&&(a.canMove()||a.canCopy())?a:null};
351 gf.prototype.standardMouseSelect=function(){var a=this.diagram;if(a.allowSelect){var b=a.Nm(a.firstInput.documentPoint,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.containingGroup;this.currentPart=b;null===this.currentPart||this.currentPart.isSelected||(a.U("ChangingSelection",a.selection),b=a.lastInput,(cb?b.meta:b.control)||b.shift||a.clearSelection(!0),this.currentPart.isSelected=!0,a.U("ChangedSelection",a.selection))}}};
352 gf.prototype.doActivate=function(){var a=this.diagram;this.So=null;null===this.currentPart&&this.standardMouseSelect();var b=this.currentPart;null!==b&&(b.canMove()||b.canCopy())&&(jf=null,this.isActive=!0,this.wm.set(a.position),kf(this,a.selection),this.jh.length=0,a.animationManager.Hc(),this.draggedParts=this.computeEffectiveCollection(a.selection,this.dragOptions),a.zu=!0,!0===a.Xe("temporaryPixelRatio")&&30<a.oy&&lf(a),mf(a,this.draggedParts),this.Ca("Drag"),this.startPoint=a.firstInput.documentPoint,
353 a.isMouseCaptured=!0,a.allowDragOut&&(this.isDragOutStarted=!0,this.ho=!1,jf=this,nf=this.diagram,this.doSimulatedDragOut()))};function kf(a,b){if(a.dragsLink){var c=a.diagram;c.allowRelink&&(c.model.Ok()&&1===b.count&&b.first()instanceof S?(a.draggedLink=b.first(),a.draggedLink.canRelinkFrom()&&a.draggedLink.canRelinkTo()&&a.draggedLink.Ak(),a.Cg=c.toolManager.findTool("Relinking"),null===a.Cg&&(a.Cg=new of,a.Cg.diagram=c)):(a.draggedLink=null,a.Cg=null))}}
354 gf.prototype.computeEffectiveCollection=function(a,b){return this.diagram.commandHandler.computeEffectiveCollection(a,b)};gf.prototype.Jd=function(a){return void 0===a?new pf(Mb):this.isGridSnapEnabled?new pf(new J(Math.round(1E3*a.x)/1E3,Math.round(1E3*a.y)/1E3)):new pf(a.copy())};
355 gf.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.Vf();qf(this);rf(a,this.draggedParts);this.draggedParts=this.currentPart=this.So=null;this.ho=this.isDragOutStarted=!1;if(0<sf.count){for(var b=sf,c=b.length,d=0;d<c;d++){var e=b.M(d);tf(e);uf(e);qf(e);e.diagram.Vf()}b.clear()}tf(this);this.wm.h(NaN,NaN);jf=nf=null;uf(this);a.isMouseCaptured=!1;a.currentCursor="";a.zu=!1;this.Vg();vf(a,!0)};
356 function qf(a){var b=a.diagram,c=b.skipsUndoManager;b.skipsUndoManager=!0;wf(a,b.lastInput,null);b.skipsUndoManager=c;a.jh.length=0}function Af(){var a=jf;uf(a);Bf(a);var b=a.diagram;a.wm.o()&&(b.position=a.wm);b.Vf()}gf.prototype.doCancel=function(){uf(this);Bf(this);var a=this.diagram;this.wm.o()&&(a.position=this.wm);this.stopTool()};gf.prototype.doKeyDown=function(){var a=this.diagram,b=a.lastInput;this.isActive&&("Esc"===b.key?this.doCancel():b.key!==a.previousInput.key&&this.doMouseMove())};
357 gf.prototype.doKeyUp=function(){this.isActive&&this.doMouseMove()};
358 function Cf(a,b){if(null===a.copiedParts){var c=a.diagram;if((!b||!c.isReadOnly&&!c.isModelReadOnly)&&null!==a.draggedParts){var d=c.undoManager;d.isEnabled&&d.isInTransaction?null!==d.currentTransaction&&0<d.currentTransaction.changes.count&&(c.undoManager.Uf(),c.Ca("Drag")):Bf(a);c.skipsUndoManager=!b;c.partManager.addsToTemporaryLayer=!b;a.startPoint=c.firstInput.documentPoint;b=a.copiesEffectiveCollection?a.draggedParts.Wf():c.selection;b=c.Fk(b,c,!0);c=new Bb;for(d=a.draggedParts.iterator;d.next();){var e=
359 d.key;if(e.Tc()&&e.canCopy()){var f=b.J(e);null!==f&&(f.location=e.location,f.Ya(),c.add(f,a.Jd(f.location)))}}for(b=b.iterator;b.next();)d=b.value,d instanceof S&&d.canCopy()&&c.add(d,a.Jd());a.copiedParts=c;kf(a,c.Wf());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,Df(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/2)))}}}
360 function uf(a){var b=a.diagram;if(null!==a.copiedParts&&(b.tu(a.copiedParts.Wf(),!1),a.copiedParts=null,null!==a.draggedParts))for(var c=a.draggedParts.iterator;c.next();)c.key instanceof S&&(c.value.point=new J(0,0));b.skipsUndoManager=!1;b.partManager.addsToTemporaryLayer=!1;a.startPoint=b.firstInput.documentPoint}
361 function tf(a){if(null!==a.draggedLink){if(a.dragsLink&&null!==a.Cg){var b=a.Cg;b.diagram.remove(b.temporaryFromNode);b.diagram.remove(b.temporaryToNode)}a.draggedLink=null;a.Cg=null}}function Ef(a,b,c){var d=a.diagram,e=a.startPoint,f=J.alloc();f.assign(d.lastInput.documentPoint);a.moveParts(b,f.oe(e),c);J.free(f);!0===d.Xe("temporaryPixelRatio")&&null===d.Jh&&30<d.oy&&(lf(d),d.lr())}
362 gf.prototype.moveParts=function(a,b,c){void 0===c&&(c=!1);var d=this.diagram;null!==d&&Ff(d,a,b,this.dragOptions,c)};function Bf(a){if(null!==a.draggedParts){for(var b=a.diagram,c=a.draggedParts.iterator;c.next();){var d=c.key;d.Tc()&&(d.location=c.value.point)}for(c=a.draggedParts.iterator;c.next();)if(d=c.key,d instanceof S&&d.suspendsRouting){var e=c.value.point;a.draggedParts.add(d,a.Jd());Df(d,-e.x,-e.y)}b.od()}}
363 function Gf(a,b){var c=a.diagram;a.dragsLink&&(null!==a.draggedLink&&(a.draggedLink.fromNode=null,a.draggedLink.toNode=null),Hf(a,!1));var d=a.findDragOverObject(b),e=c.lastInput;e.targetObject=d;a.doUpdateCursor(d);var f=c.skipsUndoManager,g=!1;try{c.skipsUndoManager=!0;g=wf(a,e,d);if(!a.isActive&&null===jf)return;var h=null!==d?d.part:null;if(null===h||c.handlesDragDropForTopLevelParts&&h.isTopLevel&&!(h instanceof If)){var k=c.mouseDragOver;null!==k&&(k(e),g=!0)}if(!a.isActive&&null===jf)return;
364 a.doDragOver(b,d);if(!a.isActive&&null===jf)return}finally{c.skipsUndoManager=f,g&&c.od()}a.So=d;c.isReadOnly||!c.allowMove&&!c.allowCopy||!c.allowHorizontalScroll&&!c.allowVerticalScroll||c.Rt(e.viewPoint)}gf.prototype.findDragOverObject=function(a){var b=this;return Jf(this.diagram,a,null,function(a){null===a?a=!0:(a=a.part,a=null===a||a instanceof Ve||a.layer.isTemporary||b.draggedParts&&b.draggedParts.contains(a)||b.copiedParts&&b.copiedParts.contains(a)?!0:!1);return!a})};
365 gf.prototype.doUpdateCursor=function(a){var b=this.diagram;this.So!==a&&(!this.diagram.currentTool.isActive||this.mayCopy()?b.currentCursor=this.copyCursor:this.mayMove()?b.currentCursor=this.moveCursor:this.mayDragOut()&&(b.currentCursor=this.nodropCursor))};
366 function wf(a,b,c){var d=!1,e=a.jh.length,f=0<e?a.jh[0]:null;if(c===f)return!1;b.handled=!1;for(var g=0;g<e;g++){var h=a.jh[g],k=h.mouseDragLeave;if(null!==k&&(k(b,h,c),d=!0,b.handled))break}a.jh.length=0;if(!a.isActive&&null===jf||null===c)return d;b.handled=!1;for(e=c;null!==e;)a.jh.push(e),e=Kf(e);e=a.jh.length;for(c=0;c<e&&(g=a.jh[c],h=g.mouseDragEnter,null===h||(h(b,g,f),d=!0,!b.handled));c++);return d}
367 function Kf(a){var b=a.panel;return null!==b?b:a instanceof U&&!(a instanceof If)&&(a=a.containingGroup,null!==a&&a.handlesDragDropForMembers)?a:null}function Lf(a,b,c){var d=a.Cg;if(null===d)return null;var e=a.diagram.Qg(b,d.portGravity,function(a){return d.findValidLinkablePort(a,c)});a=J.alloc();var f=Infinity,g=null;for(e=e.iterator;e.next();){var h=e.value;if(null!==h.part){var k=h.ja(Kc,a);k=b.Ve(k);k<f&&(g=h,f=k)}}J.free(a);return g}
368 function Hf(a,b){var c=a.draggedLink;if(null!==c&&!(2>c.pointsCount)){var d=a.diagram;if(!d.isReadOnly){var e=a.Cg;if(null!==e){var f=null,g=null;null===c.fromNode&&(f=Lf(a,c.i(0),!1),null!==f&&(g=f.part));var h=null,k=null;null===c.toNode&&(h=Lf(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!==
369 d.$y&&d.U("LinkRelinked",c,d.$y),c.toPort!==d.az&&d.U("LinkRelinked",c,d.az)):Mf(e,g,f,k,h):Mf(e,null,null,null,null)}}}}gf.prototype.doDragOver=function(){};
370 function Nf(a,b){var c=a.diagram;a.dragsLink&&Hf(a,!0);qf(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;Of(a,e,f);f=Kf(f)}}else f=c.mouseDrop,null!==f&&f(e);if(a.isActive||null!==jf){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!==jf){a=L.alloc();for(b=
371 c.selection.iterator;b.next();)d=b.value,d instanceof V&&Pf(c,d,a);L.free(a)}}}function Of(a,b,c){a=a.diagram;c=c.part;!a.handlesDragDropForTopLevelParts||!c.isTopLevel||c instanceof If||(c=a.mouseDrop,null!==c&&c(b))}function Pf(a,b,c){var d=!1;b.getAvoidableRect(c);a.viewportBounds.Te(c)&&(d=!0);a=a.jw(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.Qd(b)&&c.isAvoiding&&c.Za()}
372 gf.prototype.doDropOnto=function(){};gf.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()?(Cf(this,!1),mf(a,this.copiedParts),Ef(this,this.copiedParts,!1),rf(a,this.copiedParts)):this.mayMove()?(uf(this),Ef(this,this.draggedParts,!0)):this.mayDragOut()?(Cf(this,!1),Ef(this,this.copiedParts,!1)):uf(this),Gf(this,a.lastInput.documentPoint))}};
373 gf.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?(uf(this),Cf(this,!0),mf(a,this.copiedParts),Ef(this,this.copiedParts,!1),rf(a,this.copiedParts),null!==this.copiedParts&&(a.U("ChangingSelection",a.selection),a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}))):(b=!0,uf(this),this.mayMove()&&(Ef(this,this.draggedParts,
374 !0),Gf(this,a.lastInput.documentPoint)));this.ho=!0;Nf(this,a.lastInput.documentPoint);if(this.isActive){var d=c?this.copiedParts.Wf():this.draggedParts.Wf();this.copiedParts=null;b&&Qf(this);a.Ta();rf(a,this.draggedParts);this.transactionResult=c?"Copy":"Move";a.U(c?"SelectionCopied":"SelectionMoved",d)}this.stopTool();c&&a.U("ChangedSelection",a.selection)}}};
375 gf.prototype.simulatedMouseMove=function(a,b,c){if(null===jf)return!1;var d=jf.diagram;c instanceof R||(c=null);var e=nf;c!==e&&(null!==e&&e!==d&&(e.Vf(),jf.isDragOutStarted=!1,e=e.toolManager.findTool("Dragging"),null!==e&&e.doSimulatedDragLeave()),nf=c,null!==c&&c!==d&&(Af(),e=c.toolManager.findTool("Dragging"),null!==e&&(sf.contains(e)||sf.add(e),e.doSimulatedDragEnter())));if(null===c||c===d||!c.allowDrop||c.isReadOnly||!c.allowInsert)return!1;d=c.toolManager.findTool("Dragging");null!==d&&(null!==
376 a&&(void 0!==a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&(a=a.changedTouches[0])),b=c.getMouse(a)),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.vr(b),c.lastInput.down=!1,c.lastInput.up=!1,d.doSimulatedDragOver());return!0};
377 gf.prototype.simulatedMouseUp=function(a,b,c){if(null===jf)return!1;var d=nf,e=jf.diagram;if(null===c)return jf.doCancel(),!0;if(c!==d){var f=d.toolManager.findTool("Dragging");if(null!==d&&d!==e&&null!==f)return d.Vf(),jf.isDragOutStarted=!1,f.doSimulatedDragLeave(),!1;nf=c;d=c.toolManager.findTool("Dragging");null!==d&&(Af(),sf.contains(d)||sf.add(d),d.doSimulatedDragEnter())}return c!==this.diagram?(null!==a?(void 0!==a.targetTouches&&(0<a.targetTouches.length?a=a.targetTouches[0]:0<a.changedTouches.length&&
378 (a=a.changedTouches[0])),b=c.getMouse(a)):null===b&&(b=new J),c.lastInput.documentPoint=b,c.lastInput.viewPoint=c.vr(b),c.lastInput.down=!1,c.lastInput.up=!0,a=c.toolManager.findTool("Dragging"),null!==a&&a.doSimulatedDrop(),a=jf,null!==a&&(c=a.mayCopy(),a.transactionResult=c?"Copy":"Move",a.stopTool()),!0):!1};
379 function Qf(a){if(null!==a.draggedParts)for(var b=a.draggedParts.iterator;b.next();){var c=b.key;c instanceof V&&(c=c.containingGroup,null===c||null===c.placeholder||a.draggedParts.contains(c)||c.placeholder.u())}}
380 gf.prototype.mayCopy=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowCopy||(cb?!a.lastInput.alt:!a.lastInput.control))return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1};
381 gf.prototype.mayDragOut=function(){if(!this.isCopyEnabled)return!1;var a=this.diagram;if(!a.allowDragOut||!a.allowCopy||a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canCopy())return!0;return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canCopy()?!0:!1};
382 gf.prototype.mayMove=function(){var a=this.diagram;if(a.isReadOnly||!a.allowMove)return!1;for(a=a.selection.iterator;a.next();)if(a.value.canMove())return!0;return null!==this.draggedLink&&this.dragsLink&&this.draggedLink.canMove()?!0:!1};gf.prototype.computeBorder=function(a,b,c){return this.ho||null===this.draggedParts||this.draggedParts.contains(a)?null:c.assign(b)};gf.prototype.FA=function(){return jf};
383 gf.prototype.mayDragIn=function(){var a=this.diagram;if(!a.allowDrop||a.isReadOnly||a.isModelReadOnly||!a.allowInsert)return!1;var b=jf;return null===b||b.diagram.model.dataFormat!==a.model.dataFormat?!1:!0};gf.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.diagram;a.animationManager.Hc();Rf(a);a.animationManager.Hc();var b=jf;null!==b&&(b.diagram.zu=!1);this.doUpdateCursor(a.grid)}};
384 gf.prototype.doSimulatedDragLeave=function(){var a=jf;null!==a&&a.doSimulatedDragOut();this.doCancel()};gf.prototype.doSimulatedDragOver=function(){var a=this.diagram;a.animationManager.Gn=!0;var b=jf;if(null!==b&&null!==b.draggedParts){if(!this.mayDragIn())return;Sf(this,b.draggedParts.Wf(),!1,a.firstInput);Ef(this,this.copiedParts,!1);Gf(this,a.lastInput.documentPoint)}a.animationManager.Gn=!1};
385 gf.prototype.doSimulatedDrop=function(){var a=this.diagram,b=jf;if(null!==b){var c=b.diagram;b.ho=!0;uf(this);if(!this.mayDragIn())return;a.animationManager.Gn=!0;a.U("ChangingSelection",a.selection);this.Ca("Drop");Sf(this,b.draggedParts.Wf(),!0,a.lastInput);Ef(this,this.copiedParts,!1);null!==this.copiedParts&&(a.clearSelection(!0),this.copiedParts.iteratorKeys.each(function(a){a.isSelected=!0}));Nf(this,a.lastInput.documentPoint);a.Ta();b=a.selection;null!==this.copiedParts?this.transactionResult=
386 "ExternalCopy":b=new I;this.copiedParts=null;a.doFocus();a.U("ExternalObjectsDropped",b,c);this.Vg();a.U("ChangedSelection",a.selection)}a.animationManager.Gn=!1};
387 function Sf(a,b,c,d){if(null===a.copiedParts){var e=a.diagram;if(!e.isReadOnly&&!e.isModelReadOnly){e.skipsUndoManager=!c;e.partManager.addsToTemporaryLayer=!c;a.startPoint=d.documentPoint;c=e.Fk(b,e,!0);var f=L.alloc();e=d=Infinity;for(var g=-Infinity,h=-Infinity,k=b.iterator;k.next();){var l=k.value;if(l.isVisible()){var m=l.location;l=m.x;m=m.y;isNaN(l)||isNaN(m)||(l<d&&(d=l),m<e&&(e=m),l>g&&(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;L.free(f);
388 f=a.vt;g=new Bb;h=J.alloc();for(k=b.iterator;k.next();)l=k.value,l instanceof S&&l.canCopy()&&(m=c.J(l),null!==m&&(m.points=l.points,Df(m,f.x-d,f.y-e),m.suspendsRouting=!0,g.add(m,a.Jd())));for(b=b.iterator;b.next();)l=b.value,l.Tc()&&l.canCopy()&&(k=c.J(l),null!==k&&(l=l.location,h.h(f.x-(d-l.x),f.y-(e-l.y)),k.location=h,k.Ya(),g.add(k,a.Jd(h))));J.free(h);a.copiedParts=g;kf(a,g.Wf());null!==a.draggedLink&&(c=a.draggedLink,b=c.routeBounds,Df(c,a.startPoint.x-(b.x+b.width/2),a.startPoint.y-(b.y+b.height/
389 2)))}}}gf.prototype.doSimulatedDragOut=function(){var a=this.diagram;a.zu=!1;this.mayCopy()||this.mayMove()?a.currentCursor="":a.currentCursor=this.nodropCursor;this.So=null};gf.prototype.computeMove=function(a,b,c,d){c=this.diagram;return null!==c?c.computeMove(a,b,this.dragOptions,d):new J};
390 na.Object.defineProperties(gf.prototype,{isCopyEnabled:{configurable:!0,get:function(){return this.Zc},set:function(a){A(a,"boolean",gf,"isCopyEnabled");this.Zc=a}},copiesEffectiveCollection:{configurable:!0,get:function(){return this.L},set:function(a){A(a,"boolean",gf,"copiesEffectiveCollection");this.L=a}},dragOptions:{configurable:!0,get:function(){return this.Qa},set:function(a){w(a,hf,gf,"dragOptions");this.Qa=a}},isGridSnapEnabled:{configurable:!0,
391 enumerable:!0,get:function(){return this.dragOptions.isGridSnapEnabled},set:function(a){A(a,"boolean",gf,"isGridSnapEnabled");this.dragOptions.isGridSnapEnabled=a}},isComplexRoutingRealtime:{configurable:!0,get:function(){return this.Ic},set:function(a){A(a,"boolean",gf,"isComplexRoutingRealtime");this.Ic=a}},isGridSnapRealtime:{configurable:!0,get:function(){return this.dragOptions.isGridSnapRealtime},set:function(a){A(a,"boolean",gf,"isGridSnapRealtime");this.dragOptions.isGridSnapRealtime=
392 a}},gridSnapCellSize:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSize},set:function(a){w(a,Fb,gf,"gridSnapCellSize");this.dragOptions.gridSnapCellSize.A(a)||(a=a.K(),this.dragOptions.gridSnapCellSize=a)}},gridSnapCellSpot:{configurable:!0,get:function(){return this.dragOptions.gridSnapCellSpot},set:function(a){w(a,N,gf,"gridSnapCellSpot");this.dragOptions.gridSnapCellSpot.A(a)||(a=a.K(),this.dragOptions.gridSnapCellSpot=a)}},gridSnapOrigin:{configurable:!0,
393 enumerable:!0,get:function(){return this.dragOptions.gridSnapOrigin},set:function(a){w(a,J,gf,"gridSnapOrigin");this.dragOptions.gridSnapOrigin.A(a)||(a=a.K(),this.dragOptions.gridSnapOrigin=a)}},dragsLink:{configurable:!0,get:function(){return this.dragOptions.dragsLink},set:function(a){A(a,"boolean",gf,"dragsLink");this.dragOptions.dragsLink=a}},dragsTree:{configurable:!0,get:function(){return this.dragOptions.dragsTree},set:function(a){A(a,"boolean",gf,"dragsTree");
394 this.dragOptions.dragsTree=a}},copyCursor:{configurable:!0,get:function(){return this.W},set:function(a){this.W=a}},moveCursor:{configurable:!0,get:function(){return this.gi},set:function(a){this.gi=a}},nodropCursor:{configurable:!0,get:function(){return this.hi},set:function(a){this.hi=a}},currentPart:{configurable:!0,get:function(){return this.Pa},set:function(a){null!==a&&w(a,U,gf,"currentPart");this.Pa=a}},copiedParts:{configurable:!0,
395 get:function(){return this.w},set:function(a){this.w=a}},draggedParts:{configurable:!0,get:function(){return this.kb},set:function(a){this.kb=a}},draggingParts:{configurable:!0,get:function(){return null!==this.copiedParts?this.copiedParts.Wf():null!==this.draggedParts?this.draggedParts.Wf():this.Ar}},draggedLink:{configurable:!0,get:function(){return this.diagram.draggedLink},set:function(a){null!==a&&w(a,S,gf,"draggedLink");this.diagram.draggedLink=a}},
396 isDragOutStarted:{configurable:!0,get:function(){return this.Ud},set:function(a){this.Ud=a}},startPoint:{configurable:!0,get:function(){return this.vt},set:function(a){w(a,J,gf,"startPoint");this.vt.A(a)||this.vt.assign(a)}},delay:{configurable:!0,get:function(){return this.Bl},set:function(a){A(a,"number",gf,"delay");this.Bl=a}}});gf.prototype.getDraggingSource=gf.prototype.FA;var sf=null,jf=null,nf=null;gf.className="DraggingTool";sf=new H;
397 Sa("draggingTool",function(){return this.findTool("Dragging")},function(a){this.fb("Dragging",a,this.mouseMoveTools)});Ta.prototype.doCancel=function(){null!==jf&&jf.doCancel();Qe.prototype.doCancel.call(this)};
398 function Tf(){0<arguments.length&&Ba(Tf);Qe.call(this);this.hi=100;this.Qa=!1;this.Ai="pointer";var a=new S,b=new Uf;b.isPanelMain=!0;b.stroke="blue";a.add(b);b=new Uf;b.toArrow="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.layerName="Tool";this.vx=a;a=new V;b=new Uf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke="magenta";b.strokeWidth=2;b.desiredSize=Sb;a.add(b);a.selectable=!1;a.layerName="Tool";this.ux=a;this.l=b;a=new V;b=new Uf;b.portId="";b.figure="Rectangle";b.fill=null;b.stroke=
399 "magenta";b.strokeWidth=2;b.desiredSize=Sb;a.add(b);a.selectable=!1;a.layerName="Tool";this.wx=a;this.w=b;this.gi=this.Ud=this.Ic=this.kb=this.Zc=null;this.Pa=!0;this.sz=new Bb;this.Ar=this.Ti=this.tx=null}ma(Tf,Qe);Tf.prototype.doStop=function(){this.diagram.Vf();this.originalToPort=this.originalToNode=this.originalFromPort=this.originalFromNode=this.originalLink=null;this.validPortsCache.clear();this.targetPort=null};
400 Tf.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){var f=b.Mf(),g=Fb.alloc();g.width=b.naturalBounds.width*f;g.height=b.naturalBounds.height*f;d.desiredSize=g;Fb.free(g);e?(d.toSpot=b.toSpot,d.toEndSegmentLength=b.toEndSegmentLength):(d.fromSpot=b.fromSpot,d.fromEndSegmentLength=b.fromEndSegmentLength);c.locationSpot=Kc;f=J.alloc();c.location=b.ja(Kc,f);J.free(f);d.angle=b.wj();null!==this.portTargeted&&this.portTargeted(a,b,c,d,e)}};
401 Tf.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.desiredSize=Sb,b.fromSpot=Bc,b.toSpot=Bc);null!==a&&(a.location=this.diagram.lastInput.documentPoint);null!==this.portTargeted&&this.portTargeted(null,null,a,b,c)};Tf.prototype.doMouseDown=function(){this.isActive&&this.doMouseMove()};
402 Tf.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort&&this.targetPort.part instanceof V){var b=this.targetPort.part;this.isForwards?this.copyPortProperties(b,this.targetPort,this.temporaryToNode,this.temporaryToPort,!0):this.copyPortProperties(b,this.targetPort,this.temporaryFromNode,this.temporaryFromPort,!1)}else this.isForwards?this.setNoTargetPortProperties(this.temporaryToNode,this.temporaryToPort,
403 !0):this.setNoTargetPortProperties(this.temporaryFromNode,this.temporaryFromPort,!1);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.Rt(a.lastInput.viewPoint)}};Tf.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.part;if(!(c instanceof V))return null;for(;null!==a;){var d=b?a.toLinkable:a.fromLinkable;if(!0===d&&(null!==a.portId||a instanceof V)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.panel}return null};
404 Tf.prototype.findTargetPort=function(a){var b=this.diagram,c=b.lastInput.documentPoint,d=this.portGravity;0>=d&&(d=.1);var e=this,f=b.Qg(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0);d=Infinity;b=null;for(f=f.iterator;f.next();){var g=f.value,h=g.part;if(h instanceof V){var k=g.ja(Kc,J.alloc()),l=c.x-k.x,m=c.y-k.y;J.free(k);k=l*l+m*m;k<d&&(l=this.validPortsCache.J(g),null!==l?l&&(b=g,d=k):a&&this.isValidLink(this.originalFromNode,this.originalFromPort,h,g)||!a&&this.isValidLink(h,
405 g,this.originalToNode,this.originalToPort)?(this.validPortsCache.add(g,!0),b=g,d=k):this.validPortsCache.add(g,!1))}}return null!==b&&(c=b.part,c instanceof V&&(null===c.layer||c.layer.allowLink))?b:null};
406 Tf.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.isUnconnectedLinkValid;if(this.diagram.currentTool===this&&(null!==a.layer&&!a.layer.allowLink||!0!==b.fromLinkable))return!1;var c=b.fromMaxLinks;if(Infinity>c){if(null!==this.originalLink&&a===this.originalFromNode&&b===this.originalFromPort)return!0;b=b.portId;null===b&&(b="");if(a.Sq(b).count>=c)return!1}return!0};
407 Tf.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.Od(b).count>=c)return!1}return!0};
408 Tf.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};Tf.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.Od(b);b.next();)if(d=b.value,d.fromNode===c&&d.fromPortId===a)return!0;return!1};
409 Tf.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,
410 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};Tf.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 I;d.add(a);return Yf(this,c,b,d)};
411 function Yf(a,b,c,d){if(b===c)return!0;var e=b.fromNode;if(null!==e&&e.isLinkLabel&&(d.add(e),Yf(a,e.labeledLink,c,d)))return!0;b=b.toNode;return null!==b&&b.isLinkLabel&&(d.add(b),Yf(a,b.labeledLink,c,d))?!0:!1}
412 Tf.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!==Zf){if(d===$f){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!ag(this,a,b,c,!0)}if(d===bg){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===
413 a)return!1;return!ag(this,a,b,c,!0)}if(d===cg)return a===b?a=!0:(d=new I,d.add(b),a=dg(this,d,a,b,c)),!a;if(d===eg)return!ag(this,a,b,c,!1);if(d===fg)return a===b?a=!0:(d=new I,d.add(b),a=gg(this,d,a,b,c)),!a}return!0};function ag(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&&ag(a,g,c,d,e)))return!0}return!1}
414 function dg(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&&dg(a,b,g,d,e)))return!0}return!1}function gg(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&&gg(a,b,h,d,e))return!0}}return!1}
415 na.Object.defineProperties(Tf.prototype,{portGravity:{configurable:!0,get:function(){return this.hi},set:function(a){A(a,"number",Tf,"portGravity");0<=a&&(this.hi=a)}},isUnconnectedLinkValid:{configurable:!0,get:function(){return this.Qa},set:function(a){A(a,"boolean",Tf,"isUnconnectedLinkValid");this.Qa=a}},linkingCursor:{configurable:!0,get:function(){return this.Ai},set:function(a){this.Ai=a}},temporaryLink:{configurable:!0,get:function(){return this.vx},
416 set:function(a){w(a,S,Tf,"temporaryLink");this.vx=a}},temporaryFromNode:{configurable:!0,get:function(){return this.ux},set:function(a){w(a,V,Tf,"temporaryFromNode");if(this.ux=a)this.l=a.port}},temporaryFromPort:{configurable:!0,get:function(){return this.l},set:function(a){w(a,O,Tf,"temporaryFromPort");if(null!==this.l){var b=this.l.panel;if(null!==b){var c=b.$.indexOf(this.l);b.jb(c);b.Bb(c,a)}}this.l=a}},temporaryToNode:{configurable:!0,get:function(){return this.wx},
417 set:function(a){w(a,V,Tf,"temporaryToNode");if(this.wx=a)this.w=a.port}},temporaryToPort:{configurable:!0,get:function(){return this.w},set:function(a){w(a,O,Tf,"temporaryToPort");if(null!==this.w){var b=this.w.panel;if(null!==b){var c=b.$.indexOf(this.w);b.jb(c);b.Bb(c,a)}}this.w=a}},originalLink:{configurable:!0,get:function(){return this.Zc},set:function(a){null!==a&&w(a,S,Tf,"originalLink");this.Zc=a}},originalFromNode:{configurable:!0,get:function(){return this.kb},
418 set:function(a){null!==a&&w(a,V,Tf,"originalFromNode");this.kb=a}},originalFromPort:{configurable:!0,get:function(){return this.Ic},set:function(a){null!==a&&w(a,O,Tf,"originalFromPort");this.Ic=a}},originalToNode:{configurable:!0,get:function(){return this.Ud},set:function(a){null!==a&&w(a,V,Tf,"originalToNode");this.Ud=a}},originalToPort:{configurable:!0,get:function(){return this.gi},set:function(a){null!==a&&w(a,O,Tf,"originalToPort");this.gi=a}},isForwards:{configurable:!0,
419 enumerable:!0,get:function(){return this.Pa},set:function(a){A(a,"boolean",Tf,"isForwards");this.Pa=a}},validPortsCache:{configurable:!0,get:function(){return this.sz}},targetPort:{configurable:!0,get:function(){return this.tx},set:function(a){null!==a&&w(a,O,Tf,"targetPort");this.tx=a}},linkValidation:{configurable:!0,get:function(){return this.Ti},set:function(a){null!==a&&A(a,"function",Tf,"linkValidation");this.Ti=a}},portTargeted:{configurable:!0,
420 get:function(){return this.Ar},set:function(a){null!==a&&A(a,"function",Tf,"portTargeted");this.Ar=a}}});Tf.className="LinkingBaseTool";function hg(){0<arguments.length&&Ba(hg);Tf.call(this);this.name="Linking";this.W={};this.L=null;this.N=ig;this.sn=null}ma(hg,Tf);hg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowLink||!a.model.hu()||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:null!==this.findLinkablePort()};
421 hg.prototype.findLinkablePort=function(){var a=this.diagram,b=this.startObject;null===b&&(b=a.ac(a.firstInput.documentPoint,null,null));if(null===b)return null;a=b.part;if(!(a instanceof V))return null;var c=this.direction;if(c===ig||c===jg){var d=this.findValidLinkablePort(b,!1);if(null!==d||this.startObject===a&&(d=a.port,this.findValidLinkablePort(d,!1)))return this.isForwards=!0,d}if(c===ig||c===kg)if(b=this.findValidLinkablePort(b,!0),null!==b||this.startObject===a&&(b=a.port,this.findValidLinkablePort(b,
422 !0)))return this.isForwards=!1,b;return null};
423 hg.prototype.doActivate=function(){var a=this.diagram,b=this.findLinkablePort();null===b?this.stopTool():(this.Ca(this.name),a.isMouseCaptured=!0,a.currentCursor=this.linkingCursor,this.isForwards?(null===this.temporaryToNode||this.temporaryToNode.location.o()||(this.temporaryToNode.location=a.lastInput.documentPoint),this.originalFromPort=b,b=this.originalFromPort.part,b instanceof V&&(this.originalFromNode=b),this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,
424 this.temporaryFromPort,!1)):(null===this.temporaryFromNode||this.temporaryFromNode.location.o()||(this.temporaryFromNode.location=a.lastInput.documentPoint),this.originalToPort=b,b=this.originalToPort.part,b instanceof V&&(this.originalToNode=b),this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0)),a.add(this.temporaryFromNode),a.add(this.temporaryToNode),null!==this.temporaryLink&&(null!==this.temporaryFromNode&&(this.temporaryLink.fromNode=
425 this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.temporaryLink.isTreeLink=this.isNewTreeLink(),this.temporaryLink.Za(),a.add(this.temporaryLink)),this.isActive=!0)};hg.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.Vg()};
426 hg.prototype.doStop=function(){Tf.prototype.doStop.call(this);this.startObject=null};
427 hg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.transactionResult=null,c=null,d=null,e=null,f=null;try{var g=this.targetPort=this.findTargetPort(this.isForwards);if(null!==g){var h=g.part;h instanceof V&&(this.isForwards?(null!==this.originalFromNode&&(b=this.originalFromNode,c=this.originalFromPort),d=h,e=g):(b=h,c=g,null!==this.originalToNode&&(d=this.originalToNode,e=this.originalToPort)))}else this.isForwards?null!==this.originalFromNode&&this.isUnconnectedLinkValid&&
428 (b=this.originalFromNode,c=this.originalFromPort):null!==this.originalToNode&&this.isUnconnectedLinkValid&&(d=this.originalToNode,e=this.originalToPort);null!==b||null!==d?(f=this.insertLink(b,c,d,e),null!==f?(null===g&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint.copy():f.defaultFromPoint=a.lastInput.documentPoint.copy()),a.allowSelect&&(a.U("ChangingSelection",a.selection),a.clearSelection(!0),f.isSelected=!0),this.transactionResult=this.name,a.U("LinkDrawn",f)):this.doNoLink(b,c,
429 d,e)):this.isForwards?this.doNoLink(this.originalFromNode,this.originalFromPort,null,null):this.doNoLink(null,null,this.originalToNode,this.originalToPort)}finally{this.stopTool(),f&&a.allowSelect&&a.U("ChangedSelection",a.selection)}}};
430 hg.prototype.isNewTreeLink=function(){var a=this.archetypeLinkData;if(null===a)return!0;if(a instanceof S)return a.isTreeLink;var b=this.diagram;if(null===b)return!0;a=b.partManager.getLinkCategoryForData(a);b=b.partManager.findLinkTemplateForCategory(a);return null!==b?b.isTreeLink:!0};hg.prototype.insertLink=function(a,b,c,d){return this.diagram.partManager.insertLink(a,b,c,d)};hg.prototype.doNoLink=function(){};
431 na.Object.defineProperties(hg.prototype,{archetypeLinkData:{configurable:!0,get:function(){return this.W},set:function(a){null!==a&&A(a,"object",hg,"archetypeLinkData");a instanceof O&&w(a,S,hg,"archetypeLinkData");this.W=a}},archetypeLabelNodeData:{configurable:!0,get:function(){return this.L},set:function(a){null!==a&&A(a,"object",hg,"archetypeLabelNodeData");a instanceof O&&w(a,V,hg,"archetypeLabelNodeData");this.L=a}},direction:{configurable:!0,get:function(){return this.N},
432 set:function(a){gb(a,hg,hg,"direction");this.N=a}},startObject:{configurable:!0,get:function(){return this.sn},set:function(a){null!==a&&w(a,O,hg,"startObject");this.sn=a}}});var ig=new E(hg,"Either",0),jg=new E(hg,"ForwardsOnly",0),kg=new E(hg,"BackwardsOnly",0);hg.className="LinkingTool";hg.Either=ig;hg.ForwardsOnly=jg;hg.BackwardsOnly=kg;
433 function of(){0<arguments.length&&Ba(of);Tf.call(this);this.name="Relinking";var a=new Uf;a.figure="Diamond";a.desiredSize=Ub;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=0;this.W=a;a=new Uf;a.figure="Diamond";a.desiredSize=Ub;a.fill="lightblue";a.stroke="dodgerblue";a.cursor=this.linkingCursor;a.segmentIndex=-1;this.sn=a;this.L=null;this.Vx=new L}ma(of,Tf);
434 of.prototype.updateAdornments=function(a){if(null!==a&&a instanceof S){var b="RelinkFrom",c=null;if(a.isSelected&&!this.diagram.isReadOnly){var d=a.selectionObject;null!==d&&a.canRelinkFrom()&&a.actualBounds.o()&&a.isVisible()&&d.actualBounds.o()&&d.Sf()&&(c=a.Ik(b),null===c&&(c=this.makeAdornment(d,!1),a.Rh(b,c)))}null===c&&a.Tf(b);b="RelinkTo";c=null;a.isSelected&&!this.diagram.isReadOnly&&(d=a.selectionObject,null!==d&&a.canRelinkTo()&&a.actualBounds.o()&&a.isVisible()&&d.actualBounds.o()&&d.Sf()&&
435 (c=a.Ik(b),null===c?(c=this.makeAdornment(d,!0),a.Rh(b,c)):c.u()));null===c&&a.Tf(b)}};of.prototype.makeAdornment=function(a,b){var c=new Ve;c.type=W.Link;b=b?this.toHandleArchetype:this.fromHandleArchetype;null!==b&&c.add(b.copy());c.adornedObject=a;return c};
436 of.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowRelink||!a.model.hu()||!a.lastInput.left)return!1;var b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo"));return null!==b};
437 of.prototype.doActivate=function(){var a=this.diagram;if(null===this.originalLink){var b=this.handle;null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkFrom"),null===b&&(b=this.findToolHandleAt(a.firstInput.documentPoint,"RelinkTo")));if(null===b)return;var c=b.part;if(!(c instanceof Ve&&c.adornedPart instanceof S))return;this.handle=b;this.isForwards=null===c||"RelinkTo"===c.category;this.originalLink=c.adornedPart}this.Ca(this.name);a.isMouseCaptured=!0;a.currentCursor=this.linkingCursor;
438 this.originalFromPort=this.originalLink.fromPort;this.originalFromNode=this.originalLink.fromNode;this.originalToPort=this.originalLink.toPort;this.originalToNode=this.originalLink.toNode;this.Vx.set(this.originalLink.actualBounds);null!==this.originalLink&&0<this.originalLink.pointsCount&&(null===this.originalLink.fromNode&&(null!==this.temporaryFromPort&&(this.temporaryFromPort.desiredSize=Rb),null!==this.temporaryFromNode&&(this.temporaryFromNode.location=this.originalLink.i(0))),null===this.originalLink.toNode&&
439 (null!==this.temporaryToPort&&(this.temporaryToPort.desiredSize=Rb),null!==this.temporaryToNode&&(this.temporaryToNode.location=this.originalLink.i(this.originalLink.pointsCount-1))));this.copyPortProperties(this.originalFromNode,this.originalFromPort,this.temporaryFromNode,this.temporaryFromPort,!1);this.copyPortProperties(this.originalToNode,this.originalToPort,this.temporaryToNode,this.temporaryToPort,!0);a.add(this.temporaryFromNode);a.add(this.temporaryToNode);null!==this.temporaryLink&&(null!==
440 this.temporaryFromNode&&(this.temporaryLink.fromNode=this.temporaryFromNode),null!==this.temporaryToNode&&(this.temporaryLink.toNode=this.temporaryToNode),this.copyLinkProperties(this.originalLink,this.temporaryLink),this.temporaryLink.Za(),a.add(this.temporaryLink));this.isActive=!0};
441 of.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.adjusting=a.adjusting;b.corner=a.corner;var c=a.curve;if(c===lg||c===mg)c=ng;b.curve=c;b.curviness=a.curviness;b.isTreeLink=a.isTreeLink;b.points=a.points;b.routing=a.routing;b.smoothness=a.smoothness;b.fromSpot=a.fromSpot;b.fromEndSegmentLength=a.fromEndSegmentLength;b.fromShortLength=a.fromShortLength;b.toSpot=a.toSpot;b.toEndSegmentLength=a.toEndSegmentLength;b.toShortLength=a.toShortLength}};
442 of.prototype.doDeactivate=function(){this.isActive=!1;var a=this.diagram;a.remove(this.temporaryLink);a.remove(this.temporaryFromNode);a.remove(this.temporaryToNode);a.isMouseCaptured=!1;a.currentCursor="";this.Vg()};of.prototype.doStop=function(){Tf.prototype.doStop.call(this);this.handle=null};
443 of.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;this.transactionResult=null;var b=this.originalFromNode,c=this.originalFromPort,d=this.originalToNode,e=this.originalToPort,f=this.originalLink;this.targetPort=this.findTargetPort(this.isForwards);if(null!==this.targetPort){var g=this.targetPort.part;g instanceof V&&(this.isForwards?(d=g,e=this.targetPort):(b=g,c=this.targetPort))}else this.isUnconnectedLinkValid?this.isForwards?e=d=null:c=b=null:f=null;null!==f?(this.reconnectLink(f,
444 this.isForwards?d:b,this.isForwards?e:c,this.isForwards),null===this.targetPort&&(this.isForwards?f.defaultToPoint=a.lastInput.documentPoint.copy():f.defaultFromPoint=a.lastInput.documentPoint.copy(),f.Za()),a.allowSelect&&(f.isSelected=!0),this.transactionResult=this.name,a.U("LinkRelinked",f,this.isForwards?this.originalToPort:this.originalFromPort)):this.doNoRelink(this.originalLink,this.isForwards);this.originalLink.ar(this.Vx)}this.stopTool()};
445 of.prototype.reconnectLink=function(a,b,c,d){c=null!==c&&null!==c.portId?c.portId:"";d?(a.toNode=b,a.toPortId=c):(a.fromNode=b,a.fromPortId=c);return!0};of.prototype.doNoRelink=function(){};
446 function Mf(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.temporaryFromNode,a.temporaryFromPort,!1),a.diagram.add(a.temporaryFromNode)):a.diagram.remove(a.temporaryFromNode);null!==d?(a.copyPortProperties(d,e,a.temporaryToNode,a.temporaryToPort,!0),a.diagram.add(a.temporaryToNode)):a.diagram.remove(a.temporaryToNode)}
447 na.Object.defineProperties(of.prototype,{fromHandleArchetype:{configurable:!0,get:function(){return this.W},set:function(a){null!==a&&w(a,O,of,"fromHandleArchetype");this.W=a}},toHandleArchetype:{configurable:!0,get:function(){return this.sn},set:function(a){null!==a&&w(a,O,of,"toHandleArchetype");this.sn=a}},handle:{configurable:!0,get:function(){return this.L},set:function(a){if(null!==a&&(w(a,O,of,"handle"),!(a.part instanceof Ve)))throw Error("new handle is not in an Adornment: "+
448 a);this.L=a}}});of.className="RelinkingTool";Sa("linkingTool",function(){return this.findTool("Linking")},function(a){this.fb("Linking",a,this.mouseMoveTools)});Sa("relinkingTool",function(){return this.findTool("Relinking")},function(a){this.fb("Relinking",a,this.mouseDownTools)});
449 function og(){0<arguments.length&&Ba(og);Qe.call(this);this.name="LinkReshaping";var a=new Uf;a.figure="Rectangle";a.desiredSize=Tb;a.fill="lightblue";a.stroke="dodgerblue";this.w=a;a=new Uf;a.figure="Diamond";a.desiredSize=Ub;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="move";this.L=a;this.W=3;this.Ju=this.l=null;this.Wx=new J;this.Vs=new H}ma(og,Qe);og.prototype.nw=function(a){return a&&a.at&&0!==a.at.value?a.at:pg};
450 og.prototype.ln=function(a,b){w(a,O,og,"setReshapingBehavior:obj");gb(b,og,og,"setReshapingBehavior:behavior");a.at=b};
451 og.prototype.updateAdornments=function(a){if(null!==a&&a instanceof S){var b=null;if(a.isSelected&&!this.diagram.isReadOnly){var c=a.path;null!==c&&a.canReshape()&&a.actualBounds.o()&&a.isVisible()&&c.actualBounds.o()&&c.Sf()&&(b=a.Ik(this.name),null===b||b.Sx!==a.pointsCount||b.iy!==a.resegmentable)&&(b=this.makeAdornment(c),null!==b&&(b.Sx=a.pointsCount,b.iy=a.resegmentable,a.Rh(this.name,b)))}null===b&&a.Tf(this.name)}};
452 og.prototype.makeAdornment=function(a){var b=a.part,c=b.pointsCount,d=b.isOrthogonal,e=null;if(null!==b.points&&1<c){e=new Ve;e.type=W.Link;c=b.firstPickIndex;var f=b.lastPickIndex,g=d?1:0;if(b.resegmentable&&b.computeCurve()!==qg)for(var h=c+g;h<f-g;h++){var k=this.makeResegmentHandle(a,h);null!==k&&(k.segmentIndex=h,k.segmentFraction=.5,k.fromMaxLinks=999,e.add(k))}for(g=c+1;g<f;g++)if(h=this.makeHandle(a,g),null!==h){h.segmentIndex=g;if(g!==c)if(g===c+1&&d){k=b.i(c);var l=b.i(c+1);K.B(k.x,l.x)&&
453 K.B(k.y,l.y)&&(l=b.i(c-1));K.B(k.x,l.x)?(this.ln(h,rg),h.cursor="n-resize"):K.B(k.y,l.y)&&(this.ln(h,sg),h.cursor="w-resize")}else g===f-1&&d?(k=b.i(f-1),l=b.i(f),K.B(k.x,l.x)&&K.B(k.y,l.y)&&(k=b.i(f+1)),K.B(k.x,l.x)?(this.ln(h,rg),h.cursor="n-resize"):K.B(k.y,l.y)&&(this.ln(h,sg),h.cursor="w-resize")):g!==f&&(this.ln(h,tg),h.cursor="move");e.add(h)}e.adornedObject=a}return e};og.prototype.makeHandle=function(){var a=this.handleArchetype;return null===a?null:a.copy()};
454 og.prototype.makeResegmentHandle=function(){var a=this.midHandleArchetype;return null===a?null:a.copy()};og.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowReshape&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1};
455 og.prototype.doActivate=function(){var a=this.diagram;null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));if(null!==this.handle){var b=this.handle.part.adornedPart;if(b instanceof S){this.Ju=b;a.isMouseCaptured=!0;this.Ca(this.name);if(b.resegmentable&&999===this.handle.fromMaxLinks){var c=b.points.copy(),d=this.getResegmentingPoint();c.Bb(this.handle.segmentIndex+1,d);b.isOrthogonal&&c.Bb(this.handle.segmentIndex+1,d);b.points=c;b.Rb();b.updateAdornments();
456 this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name);if(null===this.handle){this.doDeactivate();return}}this.Wx=b.i(this.handle.segmentIndex);this.Vs=b.points.copy();this.isActive=!0}}};og.prototype.doDeactivate=function(){this.Vg();this.Ju=this.handle=null;this.isActive=this.diagram.isMouseCaptured=!1};og.prototype.doCancel=function(){var a=this.adornedLink;null!==a&&(a.points=this.Vs);this.stopTool()};og.prototype.getResegmentingPoint=function(){return this.handle.ja(Kc)};
457 og.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeReshape(a.lastInput.documentPoint),this.reshape(a))};
458 og.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.computeReshape(a.lastInput.documentPoint);this.reshape(b);b=this.adornedLink;if(null!==b&&b.resegmentable){var c=this.handle.segmentIndex,d=b.i(c-1),e=b.i(c),f=b.i(c+1);if(b.isOrthogonal){if(c>b.firstPickIndex+1&&c<b.lastPickIndex-1){var g=b.i(c-2);if(Math.abs(d.x-e.x)<this.resegmentingDistance&&Math.abs(d.y-e.y)<this.resegmentingDistance&&(ug(this,g,d,e,f,!0)||ug(this,g,d,e,f,!1))){var h=b.points.copy();ug(this,g,d,
459 e,f,!0)?(h.Vc(c-2,new J(g.x,(f.y+g.y)/2)),h.Vc(c+1,new J(f.x,(f.y+g.y)/2))):(h.Vc(c-2,new J((f.x+g.x)/2,g.y)),h.Vc(c+1,new J((f.x+g.x)/2,f.y)));h.jb(c);h.jb(c-1);b.points=h;b.Rb()}else g=b.i(c+2),Math.abs(e.x-f.x)<this.resegmentingDistance&&Math.abs(e.y-f.y)<this.resegmentingDistance&&(ug(this,d,e,f,g,!0)||ug(this,d,e,f,g,!1))&&(h=b.points.copy(),ug(this,d,e,f,g,!0)?(h.Vc(c-1,new J(d.x,(d.y+g.y)/2)),h.Vc(c+2,new J(g.x,(d.y+g.y)/2))):(h.Vc(c-1,new J((d.x+g.x)/2,d.y)),h.Vc(c+2,new J((d.x+g.x)/2,g.y))),
460 h.jb(c+1),h.jb(c),b.points=h,b.Rb())}}else g=J.alloc(),K.ai(d.x,d.y,f.x,f.y,e.x,e.y,g)&&g.Ve(e)<this.resegmentingDistance*this.resegmentingDistance&&(d=b.points.copy(),d.jb(c),b.points=d,b.Rb()),J.free(g)}a.Ta();this.transactionResult=this.name;a.U("LinkReshaped",this.adornedLink,this.Vs)}this.stopTool()};
461 function ug(a,b,c,d,e,f){return f?Math.abs(b.y-c.y)<a.resegmentingDistance&&Math.abs(c.y-d.y)<a.resegmentingDistance&&Math.abs(d.y-e.y)<a.resegmentingDistance:Math.abs(b.x-c.x)<a.resegmentingDistance&&Math.abs(c.x-d.x)<a.resegmentingDistance&&Math.abs(d.x-e.x)<a.resegmentingDistance}
462 og.prototype.reshape=function(a){var b=this.adornedLink;b.di();var c=this.handle.segmentIndex,d=this.nw(this.handle);if(b.isOrthogonal)if(c===b.firstPickIndex+1)c=b.firstPickIndex+1,d===rg?(b.O(c,b.i(c-1).x,a.y),b.O(c+1,b.i(c+2).x,a.y)):d===sg&&(b.O(c,a.x,b.i(c-1).y),b.O(c+1,a.x,b.i(c+2).y));else if(c===b.lastPickIndex-1)c=b.lastPickIndex-1,d===rg?(b.O(c-1,b.i(c-2).x,a.y),b.O(c,b.i(c+1).x,a.y)):d===sg&&(b.O(c-1,a.x,b.i(c-2).y),b.O(c,a.x,b.i(c+1).y));else{d=c;var e=b.i(d),f=b.i(d-1),g=b.i(d+1);K.B(f.x,
463 e.x)&&K.B(e.y,g.y)?(K.B(f.x,b.i(d-2).x)&&!K.B(f.y,b.i(d-2).y)?(b.m(d,a.x,f.y),c++,d++):b.O(d-1,a.x,f.y),K.B(g.y,b.i(d+2).y)&&!K.B(g.x,b.i(d+2).x)?b.m(d+1,g.x,a.y):b.O(d+1,g.x,a.y)):K.B(f.y,e.y)&&K.B(e.x,g.x)?(K.B(f.y,b.i(d-2).y)&&!K.B(f.x,b.i(d-2).x)?(b.m(d,f.x,a.y),c++,d++):b.O(d-1,f.x,a.y),K.B(g.x,b.i(d+2).x)&&!K.B(g.y,b.i(d+2).y)?b.m(d+1,a.x,g.y):b.O(d+1,a.x,g.y)):K.B(f.x,e.x)&&K.B(e.x,g.x)?(K.B(f.x,b.i(d-2).x)&&!K.B(f.y,b.i(d-2).y)?(b.m(d,a.x,f.y),c++,d++):b.O(d-1,a.x,f.y),K.B(g.x,b.i(d+2).x)&&
464 !K.B(g.y,b.i(d+2).y)?b.m(d+1,a.x,g.y):b.O(d+1,a.x,g.y)):K.B(f.y,e.y)&&K.B(e.y,g.y)&&(K.B(f.y,b.i(d-2).y)&&!K.B(f.x,b.i(d-2).x)?(b.m(d,f.x,a.y),c++,d++):b.O(d-1,f.x,a.y),K.B(g.y,b.i(d+2).y)&&!K.B(g.x,b.i(d+2).x)?b.m(d+1,g.x,a.y):b.O(d+1,g.x,a.y));b.O(c,a.x,a.y)}else b.O(c,a.x,a.y),d=b.fromNode,e=b.fromPort,null!==d&&(f=d.findVisibleNode(),null!==f&&f!==d&&(d=f,e=d.port)),1===c&&b.computeSpot(!0,e).Sb()&&(f=e.ja(Kc,J.alloc()),d=b.getLinkPointFromPoint(d,e,f,a,!0,J.alloc()),b.O(0,d.x,d.y),J.free(f),
465 J.free(d)),d=b.toNode,e=b.toPort,null!==d&&(f=d.findVisibleNode(),null!==f&&f!==d&&(d=f,e=d.port)),c===b.pointsCount-2&&b.computeSpot(!1,e).Sb()&&(c=e.ja(Kc,J.alloc()),a=b.getLinkPointFromPoint(d,e,c,a,!1,J.alloc()),b.O(b.pointsCount-1,a.x,a.y),J.free(c),J.free(a));b.Jf()};og.prototype.computeReshape=function(a){var b=this.adornedLink,c=this.handle.segmentIndex;switch(this.nw(this.handle)){case tg:return a;case rg:return new J(b.i(c).x,a.y);case sg:return new J(a.x,b.i(c).y);default:case pg:return b.i(c)}};
466 na.Object.defineProperties(og.prototype,{handleArchetype:{configurable:!0,get:function(){return this.w},set:function(a){null!==a&&w(a,O,og,"handleArchetype");this.w=a}},midHandleArchetype:{configurable:!0,get:function(){return this.L},set:function(a){null!==a&&w(a,O,og,"midHandleArchetype");this.L=a}},handle:{configurable:!0,get:function(){return this.l},set:function(a){if(null!==a&&(w(a,O,og,"handle"),!(a.part instanceof Ve)))throw Error("new handle is not in an Adornment: "+
467 a);this.l=a}},adornedLink:{configurable:!0,get:function(){return this.Ju}},resegmentingDistance:{configurable:!0,get:function(){return this.W},set:function(a){A(a,"number",og,"resegmentingDistance");this.W=a}},originalPoint:{configurable:!0,get:function(){return this.Wx}},originalPoints:{configurable:!0,get:function(){return this.Vs}}});og.prototype.setReshapingBehavior=og.prototype.ln;og.prototype.getReshapingBehavior=og.prototype.nw;
468 var pg=new E(og,"None",0),sg=new E(og,"Horizontal",1),rg=new E(og,"Vertical",2),tg=new E(og,"All",3);og.className="LinkReshapingTool";og.None=pg;og.Horizontal=sg;og.Vertical=rg;og.All=tg;Sa("linkReshapingTool",function(){return this.findTool("LinkReshaping")},function(a){this.fb("LinkReshaping",a,this.mouseDownTools)});
469 function vg(){0<arguments.length&&Ba(vg);Qe.call(this);this.name="Resizing";this.rg=(new Fb(1,1)).freeze();this.qg=(new Fb(9999,9999)).freeze();this.bh=(new Fb(NaN,NaN)).freeze();this.L=!1;this.W=!0;this.re=null;var a=new Uf;a.alignmentFocus=Kc;a.figure="Rectangle";a.desiredSize=Tb;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.w=a;this.l=null;this.Us=new J;this.Ux=new Fb;this.Ep=new J;this.$u=new Fb(0,0);this.Zu=new Fb(Infinity,Infinity);this.Yu=new Fb(1,1)}
470 ma(vg,Qe);vg.prototype.updateAdornments=function(a){if(!(null===a||a instanceof S)){if(a.isSelected&&!this.diagram.isReadOnly){var b=a.resizeObject,c=a.Ik(this.name);if(null!==b&&a.canResize()&&a.actualBounds.o()&&a.isVisible()&&b.actualBounds.o()&&b.Sf()){if(null===c||c.adornedObject!==b)c=this.makeAdornment(b);if(null!==c){b=b.wj();wg(a)&&this.updateResizeHandles(c,b);a.Rh(this.name,c);return}}}a.Tf(this.name)}};
471 vg.prototype.makeAdornment=function(a){var b=a.part.resizeAdornmentTemplate;if(null===b){b=new Ve;b.type=W.Spot;b.locationSpot=Kc;var c=new xg;c.isPanelMain=!0;b.add(c);b.add(this.makeHandle(a,Ec));b.add(this.makeHandle(a,Gc));b.add(this.makeHandle(a,Oc));b.add(this.makeHandle(a,Mc));b.add(this.makeHandle(a,md));b.add(this.makeHandle(a,od));b.add(this.makeHandle(a,pd));b.add(this.makeHandle(a,nd))}else if(yg(b),b=b.copy(),null===b)return null;b.adornedObject=a;return b};
472 vg.prototype.makeHandle=function(a,b){a=this.handleArchetype;if(null===a)return null;a=a.copy();a.alignment=b;return a};
473 vg.prototype.updateResizeHandles=function(a,b){if(null!==a)if(!a.alignment.Ib()&&("pointer"===a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.Sb()&&(c=Kc);if(0>=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":
474 "e-resize"}else if(a instanceof W)for(a=a.elements;a.next();)this.updateResizeHandles(a.value,b)};vg.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};
475 vg.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.Hc(),this.Ca(this.name),this.Us.set(this.adornedObject.ja(this.handle.alignment.Aw())),this.Ep.set(this.adornedObject.part.location),this.Ux.set(this.adornedObject.desiredSize),this.Yu=this.computeCellSize(),this.$u=
476 this.computeMinSize(),this.Zu=this.computeMaxSize(),this.isActive=!0))};vg.prototype.doDeactivate=function(){var a=this.diagram;this.Vg();this.re=this.handle=null;this.isActive=a.isMouseCaptured=!1};vg.prototype.doCancel=function(){null!==this.adornedObject&&(this.adornedObject.desiredSize=this.originalDesiredSize,this.adornedObject.part.location=this.originalLocation);this.stopTool()};
477 vg.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive){var b=this.$u,c=this.Zu,d=this.Yu,e=this.adornedObject.Zt(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.od();J.free(e)}};
478 vg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){var b=this.$u,c=this.Zu,d=this.Yu,e=this.adornedObject.Zt(a.lastInput.documentPoint,J.alloc()),f=this.computeReshape();b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);J.free(e);a.Ta();this.transactionResult=this.name;a.U("PartResized",this.adornedObject,this.originalDesiredSize)}this.stopTool()};
479 vg.prototype.resize=function(a){var b=this.diagram,c=this.adornedObject;if(null!==c){c.desiredSize=a.size;a=c.part;a.Ya();c=c.ja(this.handle.alignment.Aw());if(a instanceof If){var d=new H;d.add(a);if(!this.dragsMembers&&null===a.placeholder){var e=new hf;e.dragsMembers=!1}b.moveParts(d,this.oppositePoint.copy().oe(c),!0,e)}else a.location=a.location.copy().oe(c).add(this.oppositePoint);b.od()}};
480 vg.prototype.computeResize=function(a,b,c,d,e,f){b.Sb()&&(b=Kc);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=J.alloc();K.Tq(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*
481 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=
482 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),
483 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),
484 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)));J.free(p);return a};vg.prototype.computeReshape=function(){var a=zg;this.adornedObject instanceof Uf&&(a=Ng(this.adornedObject));return!(a===Og||this.diagram.lastInput.shift)};
485 vg.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};vg.prototype.computeMaxSize=function(){var a=this.adornedObject.maxSize.copy(),b=this.maxSize;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
486 vg.prototype.computeCellSize=function(){var a=new Fb(NaN,NaN),b=this.adornedObject.part;null!==b&&(b=b.resizeCellSize,!isNaN(b.width)&&0<b.width&&(a.width=b.width),!isNaN(b.height)&&0<b.height&&(a.height=b.height));b=this.cellSize;isNaN(a.width)&&!isNaN(b.width)&&0<b.width&&(a.width=b.width);isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height);b=this.diagram;(isNaN(a.width)||isNaN(a.height))&&b&&(b=b.grid,null!==b&&b.visible&&this.isGridSnapEnabled&&(b=b.gridCellSize,isNaN(a.width)&&
487 !isNaN(b.width)&&0<b.width&&(a.width=b.width),isNaN(a.height)&&!isNaN(b.height)&&0<b.height&&(a.height=b.height)));if(isNaN(a.width)||0===a.width||Infinity===a.width)a.width=1;if(isNaN(a.height)||0===a.height||Infinity===a.height)a.height=1;return a};
488 na.Object.defineProperties(vg.prototype,{handleArchetype:{configurable:!0,get:function(){return this.w},set:function(a){null!==a&&w(a,O,vg,"handleArchetype");this.w=a}},handle:{configurable:!0,get:function(){return this.l},set:function(a){if(null!==a&&(w(a,O,vg,"handle"),!(a.part instanceof Ve)))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{configurable:!0,get:function(){return this.re},set:function(a){if(null!==a&&(w(a,O,
489 vg,"handle"),a.part instanceof Ve))throw Error("new handle must not be in an Adornment: "+a);this.re=a}},minSize:{configurable:!0,get:function(){return this.rg},set:function(a){w(a,Fb,vg,"minSize");if(!this.rg.A(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.rg.h(b,a)}}},maxSize:{configurable:!0,get:function(){return this.qg},set:function(a){w(a,Fb,vg,"maxSize");if(!this.qg.A(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);
490 this.qg.h(b,a)}}},cellSize:{configurable:!0,get:function(){return this.bh},set:function(a){w(a,Fb,vg,"cellSize");this.bh.A(a)||this.bh.assign(a)}},isGridSnapEnabled:{configurable:!0,get:function(){return this.L},set:function(a){A(a,"boolean",vg,"isGridSnapEnabled");this.L=a}},dragsMembers:{configurable:!0,get:function(){return this.W},set:function(a){A(a,"boolean",vg,"dragsMembers");this.W=a}},oppositePoint:{configurable:!0,get:function(){return this.Us},
491 set:function(a){w(a,J,vg,"oppositePoint");this.Us.A(a)||this.Us.assign(a)}},originalDesiredSize:{configurable:!0,get:function(){return this.Ux}},originalLocation:{configurable:!0,get:function(){return this.Ep}}});vg.className="ResizingTool";Sa("resizingTool",function(){return this.findTool("Resizing")},function(a){this.fb("Resizing",a,this.mouseDownTools)});
492 function Pg(){0<arguments.length&&Ba(Pg);Qe.call(this);this.name="Rotating";this.Qa=45;this.Pa=2;this.Ep=new J;this.re=null;var a=new Uf;a.figure="Ellipse";a.desiredSize=Ub;a.fill="lightblue";a.stroke="dodgerblue";a.strokeWidth=1;a.cursor="pointer";this.w=a;this.l=null;this.Tx=0;this.bt=new J(NaN,NaN);this.L=0;this.W=50}ma(Pg,Qe);
493 Pg.prototype.updateAdornments=function(a){if(null!==a){if(a.$h()){var b=a.rotateObject;if(b===a||b===a.path||b.isPanelMain)return}if(a.isSelected&&!this.diagram.isReadOnly&&(b=a.rotateObject,null!==b&&a.canRotate()&&a.actualBounds.o()&&a.isVisible()&&b.actualBounds.o()&&b.Sf())){var c=a.Ik(this.name);if(null===c||c.adornedObject!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.wj();null===c.placeholder&&(c.location=this.computeAdornmentLocation(b));a.Rh(this.name,c);return}}a.Tf(this.name)}};
494 Pg.prototype.makeAdornment=function(a){var b=a.part.rotateAdornmentTemplate;if(null===b){b=new Ve;b.type=W.Position;b.locationSpot=Kc;var c=this.handleArchetype;null!==c&&b.add(c.copy())}else if(yg(b),b=b.copy(),null===b)return null;b.adornedObject=a;return b};Pg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.isReadOnly&&a.allowRotate&&a.lastInput.left?null!==this.findToolHandleAt(a.firstInput.documentPoint,this.name):!1};
495 Pg.prototype.doActivate=function(){var a=this.diagram;if(null===this.adornedObject){null===this.handle&&(this.handle=this.findToolHandleAt(a.firstInput.documentPoint,this.name));if(null===this.handle)return;this.adornedObject=this.handle.part.adornedObject}null!==this.adornedObject&&(a.isMouseCaptured=!0,a.delaysLayout=!0,this.Ca(this.name),this.Tx=this.adornedObject.angle,this.bt=this.computeRotationPoint(this.adornedObject),this.Ep=this.adornedObject.part.location.copy(),this.isActive=!0)};
496 Pg.prototype.computeRotationPoint=function(a){var b=a.part,c=b.locationObject;return b.rotationSpot.eb()?a.ja(b.rotationSpot):a===b||a===c?c.ja(b.locationSpot):a.ja(Kc)};
497 Pg.prototype.computeAdornmentLocation=function(a){var b=this.rotationPoint;b.o()||(b=this.computeRotationPoint(a));b=a.Zt(b);var c=this.handleAngle;0>c?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+
498 d,b.y=-d);return a.ja(b)};Pg.prototype.doDeactivate=function(){var a=this.diagram;this.Vg();this.re=this.handle=null;this.bt=new J(NaN,NaN);this.isActive=a.isMouseCaptured=!1};Pg.prototype.doCancel=function(){this.diagram.delaysLayout=!1;this.rotate(this.originalAngle);this.stopTool()};Pg.prototype.doMouseMove=function(){var a=this.diagram;this.isActive&&(a=this.computeRotate(a.lastInput.documentPoint),this.rotate(a))};
499 Pg.prototype.doMouseUp=function(){var a=this.diagram;if(this.isActive){a.delaysLayout=!1;var b=this.computeRotate(a.lastInput.documentPoint);this.rotate(b);a.Ta();this.transactionResult=this.name;a.U("PartRotated",this.adornedObject,this.originalAngle)}this.stopTool()};
500 Pg.prototype.rotate=function(a){F&&C(a,Pg,"rotate:newangle");var b=this.adornedObject;if(null!==b){b.angle=a;b=b.part;b.Ya();var c=b.locationObject,d=b.rotateObject;if(c===d||c.Sg(d))c=this.Ep.copy(),b.location=c.oe(this.rotationPoint).rotate(a-this.originalAngle).add(this.rotationPoint);this.diagram.od()}};
501 Pg.prototype.computeRotate=function(a){a=this.rotationPoint.Va(a)-this.handleAngle;var b=this.adornedObject.panel;null!==b&&(a-=b.wj());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&&0<b&&0<c&&(a%b<c?a=Math.floor(a/b)*b:a%b>b-c&&(a=(Math.floor(a/b)+1)*b));360<=a?a-=360:0>a&&(a+=360);return a};
502 na.Object.defineProperties(Pg.prototype,{handleArchetype:{configurable:!0,get:function(){return this.w},set:function(a){null!==a&&w(a,O,Pg,"handleArchetype");this.w=a}},handle:{configurable:!0,get:function(){return this.l},set:function(a){if(null!==a&&(w(a,O,Pg,"handle"),!(a.part instanceof Ve)))throw Error("new handle is not in an Adornment: "+a);this.l=a}},adornedObject:{configurable:!0,get:function(){return this.re},set:function(a){if(null!==a&&(w(a,O,
503 Pg,"handle"),a.part instanceof Ve))throw Error("new handle must not be in an Adornment: "+a);this.re=a}},snapAngleMultiple:{configurable:!0,get:function(){return this.Qa},set:function(a){A(a,"number",Pg,"snapAngleMultiple");this.Qa=a}},snapAngleEpsilon:{configurable:!0,get:function(){return this.Pa},set:function(a){A(a,"number",Pg,"snapAngleEpsilon");this.Pa=a}},originalAngle:{configurable:!0,get:function(){return this.Tx}},rotationPoint:{configurable:!0,
504 enumerable:!0,get:function(){return this.bt},set:function(a){this.bt=a.copy()}},handleAngle:{configurable:!0,get:function(){return this.L},set:function(a){A(a,"number",Pg,"handleAngle");this.L=a}},handleDistance:{configurable:!0,get:function(){return this.W},set:function(a){A(a,"number",Pg,"handleDistance");this.W=a}}});Pg.className="RotatingTool";Sa("rotatingTool",function(){return this.findTool("Rotating")},function(a){this.fb("Rotating",a,this.mouseDownTools)});
505 function Qg(){Qe.call(this);0<arguments.length&&Ba(Qg);this.name="ClickSelecting"}ma(Qg,Qe);Qg.prototype.canStart=function(){return!this.isEnabled||this.isBeyondDragSize()?!1:!0};Qg.prototype.doMouseUp=function(){this.isActive&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.diagram.lastInput.isTouchEvent&&this.diagram.toolManager.doToolTip());this.stopTool()};Qg.className="ClickSelectingTool";function Rg(){Qe.call(this);0<arguments.length&&Ba(Rg);this.name="Action";this.il=null}
506 ma(Rg,Qe);Rg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram,b=a.lastInput,c=a.ac(b.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a});if(null!==c){if(!c.isActionable)return!1;this.il=c;a.Qj=a.ac(b.documentPoint,null,null);return!0}return!1};Rg.prototype.doMouseDown=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.il;null!==b&&(a.targetObject=b,null!==b.actionDown&&b.actionDown(a,b))}else this.canStart()&&this.doActivate()};
507 Rg.prototype.doMouseMove=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.il;null!==b&&(a.targetObject=b,null!==b.actionMove&&b.actionMove(a,b))}};Rg.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram.lastInput,b=this.il;if(null===b)return;a.targetObject=b;null!==b.actionUp&&b.actionUp(a,b);this.standardMouseClick(function(a){for(;null!==a.panel&&(!a.isActionable||a!==b);)a=a.panel;return a},function(a){return a===b})}this.stopTool()};
508 Rg.prototype.doCancel=function(){var a=this.diagram.lastInput,b=this.il;null!==b&&(a.targetObject=b,null!==b.actionCancel&&b.actionCancel(a,b),this.stopTool())};Rg.prototype.doStop=function(){this.il=null};Rg.className="ActionTool";function Sg(){Qe.call(this);0<arguments.length&&Ba(Sg);this.name="ClickCreating";this.Mj=null;this.w=!0;this.l=!1;this.Mx=new J(0,0)}ma(Sg,Qe);
509 Sg.prototype.canStart=function(){if(!this.isEnabled||null===this.archetypeNodeData)return!1;var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.lastInput.left||this.isBeyondDragSize())return!1;if(this.isDoubleClick){if(1===a.lastInput.clickCount&&(this.Mx=a.lastInput.viewPoint.copy()),2!==a.lastInput.clickCount||this.isBeyondDragSize(this.Mx))return!1}else if(1!==a.lastInput.clickCount)return!1;return a.currentTool!==this&&null!==a.Nm(a.lastInput.documentPoint,!0)?!1:!0};
510 Sg.prototype.doMouseUp=function(){var a=this.diagram;this.isActive&&this.insertPart(a.lastInput.documentPoint);this.stopTool()};
511 Sg.prototype.insertPart=function(a){var b=this.diagram,c=this.archetypeNodeData;if(null===c)return null;var d=null;try{b.U("ChangingSelection",b.selection);this.Ca(this.name);if(c instanceof U)c.Tc()&&(yg(c),d=c.copy(),null!==d&&b.add(d));else if(null!==c){var e=b.model.copyNodeData(c);Ga(e)&&(b.model.Gf(e),d=b.Fc(e))}if(null!==d){var f=J.allocAt(a.x,a.y);this.isGridSnapEnabled&&Tg(this.diagram,d,a,f);d.location=f;b.allowSelect&&(b.clearSelection(!0),d.isSelected=!0);J.free(f)}b.Ta();this.transactionResult=
512 this.name;b.U("PartCreated",d)}finally{this.Vg(),b.U("ChangedSelection",b.selection)}return d};
513 na.Object.defineProperties(Sg.prototype,{archetypeNodeData:{configurable:!0,get:function(){return this.Mj},set:function(a){null!==a&&A(a,"object",Sg,"archetypeNodeData");this.Mj=a}},isDoubleClick:{configurable:!0,get:function(){return this.w},set:function(a){A(a,"boolean",Sg,"isDoubleClick");this.w=a}},isGridSnapEnabled:{configurable:!0,get:function(){return this.l},set:function(a){A(a,"boolean",Sg,"isGridSnapEnabled");this.l=a}}});Sg.className="ClickCreatingTool";
514 function Ug(){Qe.call(this);0<arguments.length&&Ba(Ug);this.name="DragSelecting";this.Bl=175;this.w=!1;var a=new U;a.layerName="Tool";a.selectable=!1;var b=new Uf;b.name="SHAPE";b.figure="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.l=a}ma(Ug,Qe);
515 Ug.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(!a.allowSelect)return!1;var b=a.lastInput;return!b.left||a.currentTool!==this&&(!this.isBeyondDragSize()||b.timestamp-a.firstInput.timestamp<this.delay||null!==a.Nm(b.documentPoint,!0))?!1:!0};Ug.prototype.doActivate=function(){var a=this.diagram;this.isActive=!0;a.isMouseCaptured=!0;a.skipsUndoManager=!0;a.add(this.box);this.doMouseMove()};
516 Ug.prototype.doDeactivate=function(){var a=this.diagram;a.Vf();a.remove(this.box);a.skipsUndoManager=!1;this.isActive=a.isMouseCaptured=!1};Ug.prototype.doMouseMove=function(){var a=this.diagram;if(this.isActive&&null!==this.box){var b=this.computeBoxBounds(),c=this.box.ib("SHAPE");null===c&&(c=this.box.yb());var d=Fb.alloc().h(b.width,b.height);b=J.allocAt(b.x,b.y);c.desiredSize=d;this.box.position=b;Fb.free(d);J.free(b);(a.allowHorizontalScroll||a.allowVerticalScroll)&&a.Rt(a.lastInput.viewPoint)}};
517 Ug.prototype.doMouseUp=function(){if(this.isActive){var a=this.diagram;a.remove(this.box);try{a.currentCursor="wait",a.U("ChangingSelection",a.selection),this.selectInRect(this.computeBoxBounds()),a.U("ChangedSelection",a.selection)}finally{a.currentCursor=""}}this.stopTool()};Ug.prototype.computeBoxBounds=function(){var a=this.diagram;return new L(a.firstInput.documentPoint,a.lastInput.documentPoint)};
518 Ug.prototype.selectInRect=function(a){var b=this.diagram,c=b.lastInput;a=b.Iy(a,this.isPartialInclusion);if(cb?c.meta:c.control)if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected&&(b.isSelected=!1);else for(a=a.iterator;a.next();)b=a.value,b.isSelected=!b.isSelected;else if(c.shift)for(a=a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0);else{c=new H;for(b=b.selection.iterator;b.next();){var d=b.value;a.contains(d)||c.add(d)}for(b=c.iterator;b.next();)b.value.isSelected=!1;for(a=
519 a.iterator;a.next();)b=a.value,b.isSelected||(b.isSelected=!0)}};na.Object.defineProperties(Ug.prototype,{delay:{configurable:!0,get:function(){return this.Bl},set:function(a){A(a,"number",Ug,"delay");this.Bl=a}},isPartialInclusion:{configurable:!0,get:function(){return this.w},set:function(a){A(a,"boolean",Ug,"isPartialInclusion");this.w=a}},box:{configurable:!0,get:function(){return this.l},set:function(a){null!==a&&w(a,U,Ug,"box");this.l=a}}});
520 Ug.className="DragSelectingTool";function Vg(){Qe.call(this);0<arguments.length&&Ba(Vg);this.name="Panning";this.xv=new J;this.Bz=new J;this.ah=!1;var a=this;this.Zx=function(){var b=a.diagram;null!==b&&b.removeEventListener(qa.document,"scroll",a.Zx,!1);a.stopTool()}}ma(Vg,Qe);Vg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return!a.allowHorizontalScroll&&!a.allowVerticalScroll||!a.lastInput.left||a.currentTool!==this&&!this.isBeyondDragSize()?!1:!0};
521 Vg.prototype.doActivate=function(){var a=this.diagram;this.ah?(a.lastInput.bubbles=!0,a.addEventListener(qa.document,"scroll",this.Zx,!1)):(a.currentCursor="move",a.isMouseCaptured=!0,this.xv.assign(a.position));this.isActive=!0};Vg.prototype.doDeactivate=function(){var a=this.diagram;a.currentCursor="";this.isActive=a.isMouseCaptured=!1};Vg.prototype.doCancel=function(){var a=this.diagram;a.position=this.xv;a.isMouseCaptured=!1;this.stopTool()};Vg.prototype.doMouseMove=function(){this.move()};
522 Vg.prototype.doMouseUp=function(){this.move();this.stopTool()};Vg.prototype.move=function(){var a=this.diagram;if(this.isActive&&a)if(this.ah)a.lastInput.bubbles=!0;else{var b=a.position,c=a.firstInput.documentPoint,d=a.lastInput.documentPoint,e=b.x+c.x-d.x;c=b.y+c.y-d.y;a.allowHorizontalScroll||(e=b.x);a.allowVerticalScroll||(c=b.y);a.position=this.Bz.h(e,c)}};
523 na.Object.defineProperties(Vg.prototype,{bubbles:{configurable:!0,get:function(){return this.ah},set:function(a){A(a,"boolean",Vg,"bubbles");this.ah=a}},originalPosition:{configurable:!0,get:function(){return this.xv}}});Vg.className="PanningTool";Sa("clickCreatingTool",function(){return this.findTool("ClickCreating")},function(a){this.fb("ClickCreating",a,this.mouseUpTools)});
524 Sa("clickSelectingTool",function(){return this.findTool("ClickSelecting")},function(a){this.fb("ClickSelecting",a,this.mouseUpTools)});Sa("panningTool",function(){return this.findTool("Panning")},function(a){this.fb("Panning",a,this.mouseMoveTools)});Sa("dragSelectingTool",function(){return this.findTool("DragSelecting")},function(a){this.fb("DragSelecting",a,this.mouseMoveTools)});Sa("actionTool",function(){return this.findTool("Action")},function(a){this.fb("Action",a,this.mouseDownTools)});
525 function ef(){this.W=this.L=this.l=this.w=null}
526 na.Object.defineProperties(ef.prototype,{mainElement:{configurable:!0,get:function(){return this.L},set:function(a){null!==a&&w(a,HTMLElement,ef,"mainElement");this.L=a}},show:{configurable:!0,get:function(){return this.w},set:function(a){this.w!==a&&(null!==a&&A(a,"function",ef,"show"),this.w=a)}},hide:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(null!==a&&A(a,"function",ef,"hide"),this.l=a)}},valueFunction:{configurable:!0,
527 enumerable:!0,get:function(){return this.W},set:function(a){this.W=a}}});ef.className="HTMLInfo";function Wg(a,b,c){this.text=a;this.ty=b;this.visible=c}Wg.className="ContextMenuButtonInfo";function Xg(){Qe.call(this);0<arguments.length&&Ba(Xg);this.name="ContextMenu";this.w=this.Pu=this.l=null;this.Rx=new J;this.Qu=null;this.kv=!1;var a=this;this.Jv=function(){a.stopTool()}}ma(Xg,Qe);
528 function Yg(a){var b=new ef;b.show=function(a,b,c){c.showDefaultContextMenu()};b.hide=function(a,b){b.hideDefaultContextMenu()};Zg=b;a.Jv=function(){a.stopTool()};b=ua("div");var c=ua("div");b.style.cssText="top: 0px;z-index:10002;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";c.style.cssText="z-index:10001;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";
529 var d=ua("style");qa.document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".goCXul { list-style: none; }",0);d.sheet.insertRule(".goCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".goCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);d=a.diagram;null!==d&&(d.addEventListener(b,"contextmenu",$g,!1),d.addEventListener(b,"selectstart",
530 $g,!1),d.addEventListener(c,"contextmenu",$g,!1));b.className="goCXforeground";c.className="goCXbackground";qa.document.body&&(qa.document.body.appendChild(b),qa.document.body.appendChild(c));ah=b;bh=c;ch=!0}function $g(a){a.preventDefault();return!1}
531 Xg.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;return this.isBeyondDragSize()||!a.lastInput.right||1<a.lastInput.clickCount?!1:a.lastInput.isTouchEvent&&null!==this.defaultTouchContextMenu||null!==this.findObjectWithContextMenu()?!0:!1};Xg.prototype.doStart=function(){this.Rx.set(this.diagram.firstInput.documentPoint)};Xg.prototype.doStop=function(){this.hideContextMenu();this.currentObject=null};
532 Xg.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.diagram,c=b.lastInput,d=null;a instanceof R||(a instanceof O?d=a:d=b.ac(c.documentPoint,null,function(a){return!a.layer.isTemporary}));if(null!==d){for(a=d;null!==a;){if(null!==a.contextMenu)return a;a=a.panel}if(b.lastInput.isTouchEvent&&this.defaultTouchContextMenu)return d.part}else if(null!==b.contextMenu)return b;return null};Xg.prototype.doActivate=function(){};
533 Xg.prototype.doMouseDown=function(){Qe.prototype.doMouseDown.call(this);if(this.isActive&&this.currentContextMenu instanceof Ve){var a=this.diagram.toolManager.findTool("Action");null!==a&&a.canStart()&&(a.doActivate(),a.doMouseDown(),a.doDeactivate())}this.diagram.toolManager.mouseDownTools.contains(this)&&dh(this)};
534 Xg.prototype.doMouseUp=function(){if(this.isActive&&this.currentContextMenu instanceof Ve){var a=this.diagram.toolManager.findTool("Action");null!==a&&a.canStart()&&(a.doActivate(),a.doCancel(),a.doDeactivate())}dh(this)};
535 function dh(a){var b=a.diagram;if(a.isActive){var c=a.currentContextMenu;if(null!==c){if(!(c instanceof ef)){var d=b.ac(b.lastInput.documentPoint,null,null);null!==d&&d.Sg(c)&&a.standardMouseClick(null,null)}a.stopTool();a.canStart()&&(b.currentTool=a,a.doMouseUp())}}else a.canStart()&&(eh(a,!0),a.isActive||a.stopTool())}
536 function eh(a,b,c){void 0===c&&(c=null);if(!a.kv&&(a.kv=!0,b&&a.standardMouseSelect(),b=a.standardMouseClick(),a.kv=!1,!b)){a.isActive=!0;b=Zg;null===c&&(c=a.findObjectWithContextMenu());if(null!==c){var d=c.contextMenu;null!==d?(a.currentObject=c instanceof O?c:null,a.showContextMenu(d,a.currentObject)):null!==b&&a.showContextMenu(b,a.currentObject)}else null!==b&&a.showContextMenu(b,null);a.currentContextMenu instanceof Ve&&!a.currentContextMenu.visible&&a.stopTool()}}
537 Xg.prototype.doMouseMove=function(){var a=this.diagram.toolManager.findTool("Action");null!==a&&a.doMouseMove();this.isActive&&this.diagram.toolManager.doMouseMove()};
538 Xg.prototype.showContextMenu=function(a,b){!F||a instanceof Ve||a instanceof ef||v("showContextMenu:contextMenu must be an Adornment or HTMLInfo.");null!==b&&w(b,O,Xg,"showContextMenu:obj");var c=this.diagram;a!==this.currentContextMenu&&this.hideContextMenu();if(a instanceof Ve){a.layerName="Tool";a.selectable=!1;a.scale=1/c.scale;a.category=this.name;null!==a.placeholder&&(a.placeholder.scale=c.scale);var d=a.diagram;null!==d&&d!==c&&d.remove(a);c.add(a);null!==b?a.adornedObject=b:a.data=c.model;
539 a.Ya();this.positionContextMenu(a,b)}else a instanceof ef&&a.show(b,c,this);this.currentContextMenu=a};Xg.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.diagram,c=b.lastInput.documentPoint.copy(),d=a.measuredBounds,e=b.viewportBounds;b.lastInput.isTouchEvent&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5/b.scale);c.x<e.x&&(c.x=e.x);c.y+d.height>e.bottom&&(c.y-=d.height+5/b.scale);c.y<e.y&&(c.y=e.y);a.position=c}};
540 Xg.prototype.hideContextMenu=function(){var a=this.diagram,b=this.currentContextMenu;null!==b&&(b instanceof Ve?(a.remove(b),null!==this.Pu&&this.Pu.Tf(b.category),b.data=null,b.adornedObject=null):b instanceof ef&&(null!==b.hide?b.hide(a,this):null!==b.mainElement&&(b.mainElement.style.display="none")),this.currentContextMenu=null,this.standardMouseOver())};
541 function fh(a){var b=new H;b.add(new Wg("Copy",function(a){a.commandHandler.copySelection()},function(a){return a.commandHandler.canCopySelection()}));b.add(new Wg("Cut",function(a){a.commandHandler.cutSelection()},function(a){return a.commandHandler.canCutSelection()}));b.add(new Wg("Delete",function(a){a.commandHandler.deleteSelection()},function(a){return a.commandHandler.canDeleteSelection()}));b.add(new Wg("Paste",function(b){b.commandHandler.pasteSelection(a.mouseDownPoint)},function(b){return b.commandHandler.canPasteSelection(a.mouseDownPoint)}));
542 b.add(new Wg("Select All",function(a){a.commandHandler.selectAll()},function(a){return a.commandHandler.canSelectAll()}));b.add(new Wg("Undo",function(a){a.commandHandler.undo()},function(a){return a.commandHandler.canUndo()}));b.add(new Wg("Redo",function(a){a.commandHandler.redo()},function(a){return a.commandHandler.canRedo()}));b.add(new Wg("Scroll To Part",function(a){a.commandHandler.scrollToPart()},function(a){return a.commandHandler.canScrollToPart()}));b.add(new Wg("Zoom To Fit",function(a){a.commandHandler.zoomToFit()},
543 function(a){return a.commandHandler.canZoomToFit()}));b.add(new Wg("Reset Zoom",function(a){a.commandHandler.resetZoom()},function(a){return a.commandHandler.canResetZoom()}));b.add(new Wg("Group Selection",function(a){a.commandHandler.groupSelection()},function(a){return a.commandHandler.canGroupSelection()}));b.add(new Wg("Ungroup Selection",function(a){a.commandHandler.ungroupSelection()},function(a){return a.commandHandler.canUngroupSelection()}));b.add(new Wg("Edit Text",function(a){a.commandHandler.editTextBlock()},
544 function(a){return a.commandHandler.canEditTextBlock()}));return b}
545 Xg.prototype.showDefaultContextMenu=function(){var a=this.diagram;null===this.Qu&&(this.Qu=fh(this));ah.innerHTML="";bh.addEventListener("click",this.Jv,!1);var b=this,c=ua("ul");c.className="goCXul";ah.appendChild(c);c.innerHTML="";for(var d=this.Qu.iterator;d.next();){var e=d.value,f=e.visible;if("function"===typeof e.ty&&("function"!==typeof f||f(a))){f=ua("li");f.className="goCXli";var g=ua("a");g.className="goCXa";g.href="#";g.uz=e.ty;g.addEventListener("click",function(c){this.uz(a);b.stopTool();
546 c.preventDefault();return!1},!1);g.textContent=e.text;f.appendChild(g);c.appendChild(f)}}ah.style.display="block";bh.style.display="block"};Xg.prototype.hideDefaultContextMenu=function(){if(null!==this.currentContextMenu&&this.currentContextMenu===Zg){ah.style.display="none";bh.style.display="none";var a=this.diagram;null!==a&&a.removeEventListener(bh,"click",this.Jv,!1);this.currentContextMenu=null}};
547 na.Object.defineProperties(Xg.prototype,{currentContextMenu:{configurable:!0,get:function(){return this.l},set:function(a){!F||null===a||a instanceof Ve||a instanceof ef||v("ContextMenuTool.currentContextMenu must be an Adornment or HTMLInfo.");this.l=a;this.Pu=a instanceof Ve?a.adornedPart:null}},defaultTouchContextMenu:{configurable:!0,get:function(){!1===ch&&null===Zg&&gh&&Yg(this);return Zg},set:function(a){!F||null===a||a instanceof Ve||a instanceof ef||v("ContextMenuTool.defaultTouchContextMenu must be an Adornment or HTMLInfo.");
548 null===a&&(ch=!0);Zg=a}},currentObject:{configurable:!0,get:function(){return this.w},set:function(a){null!==a&&w(a,O,Xg,"currentObject");this.w=a}},mouseDownPoint:{configurable:!0,get:function(){return this.Rx}}});var Zg=null,ch=!1,bh=null,ah=null;Xg.className="ContextMenuTool";Sa("contextMenuTool",function(){return this.findTool("ContextMenu")},function(a){this.fb("ContextMenu",a,this.mouseUpTools)});
549 function hh(){0<arguments.length&&Ba(hh);Qe.call(this);this.name="TextEditing";this.Kh=new ih;this.Qa=null;this.Pa=jh;this.gj=null;this.oa=kh;this.L=1;this.W=!0;this.w=null;this.l=new ef;this.Uu=null;lh(this,this.l)}ma(hh,Qe);
550 function lh(a,b){if(gh){var c=ua("textarea");a.Uu=c;c.addEventListener("input",function(){if(null!==a.textBlock){var b=a.Zy(this.value);this.style.width=20+b.measuredBounds.width*this.yB+"px";this.rows=b.lineCount}},!1);c.addEventListener("keydown",function(b){if(null!==a.textBlock){var c=b.key;"Enter"===c?(!1===a.textBlock.isMultiline&&b.preventDefault(),a.acceptText(mh)):"Tab"===c?(a.acceptText(nh),b.preventDefault()):"Escape"===c&&(a.doCancel(),null!==a.diagram&&a.diagram.doFocus())}},!1);c.addEventListener("focus",
551 function(){if(null!==a.currentTextEditor&&a.state!==kh){var b=a.Uu;a.oa===oh&&(a.oa=ph);"function"===typeof b.select&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1);c.addEventListener("blur",function(){if(null!==a.currentTextEditor&&a.state!==kh){var b=a.Uu;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.selectsTextOnActivate&&(b.select(),b.setSelectionRange(0,9999))}},!1);b.valueFunction=function(){return c.value};b.mainElement=c;b.show=function(a,
552 b,f){if(a instanceof ih&&f instanceof hh)if(f.state===qh)c.style.border="3px solid red",c.focus();else{var d=a.ja(Kc),e=b.position,k=b.scale,l=a.Mf()*k;l<f.minimumEditorScale&&(l=f.minimumEditorScale);var m=a.naturalBounds.width*l+6,n=a.naturalBounds.height*l+2,p=(d.x-e.x)*k;d=(d.y-e.y)*k;c.value=a.text;b.div.style.font=a.font;c.style.position="absolute";c.style.zIndex="100";c.style.font="inherit";c.style.fontSize=100*l+"%";c.style.lineHeight="normal";c.style.width=m+"px";c.style.left=(p-m/2|0)-1+
553 "px";c.style.top=(d-n/2|0)-1+"px";c.style.textAlign=a.textAlign;c.style.margin="0";c.style.padding="1px";c.style.border="0";c.style.outline="none";c.style.whiteSpace="pre-wrap";c.style.overflow="hidden";c.rows=a.lineCount;c.yB=l;c.className="goTXarea";b.div.appendChild(c);c.focus();f.selectsTextOnActivate&&(c.select(),c.setSelectionRange(0,9999))}};b.hide=function(a){a.div.removeChild(c)}}}
554 hh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.diagram;if(null===a||a.isReadOnly||rh&&rh!==this&&(rh.acceptText(sh),rh&&rh!==this)||!a.lastInput.left||this.isBeyondDragSize())return!1;var b=a.ac(a.lastInput.documentPoint);if(!(null!==b&&b instanceof ih&&b.editable&&b.part.canEdit()))return!1;b=b.part;return null===b||this.starting===jh&&!b.isSelected||this.starting===th&&2>a.lastInput.clickCount?!1:!0};hh.prototype.doStart=function(){rh=this;null!==this.textBlock&&this.doActivate()};
555 hh.prototype.doActivate=function(){if(!this.isActive){var a=this.diagram;if(null!==a){var b=this.textBlock;null===b&&(b=a.ac(a.lastInput.documentPoint));if(null!==b&&b instanceof ih&&(this.textBlock=b,null!==b.part)){this.isActive=!0;this.oa=oh;var c=this.defaultTextEditor;null!==b.textEditor&&(c=b.textEditor);this.Kh=this.textBlock.copy();var d=new L(this.textBlock.ja(Ec),this.textBlock.ja(Oc));a.Ow(d);c.show(b,a,this);this.currentTextEditor=c}}}};hh.prototype.doCancel=function(){this.stopTool()};
556 hh.prototype.doMouseUp=function(){this.canStart()&&this.doActivate()};hh.prototype.doMouseDown=function(){this.isActive&&this.acceptText(sh)};hh.prototype.acceptText=function(a){switch(a){case sh:if(this.oa===uh)this.currentTextEditor instanceof HTMLElement&&this.currentTextEditor.focus();else if(this.oa===oh||this.oa===qh||this.oa===ph)this.oa=vh,wh(this);break;case xh:case mh:case nh:if(mh!==a||!0!==this.textBlock.isMultiline)if(this.oa===oh||this.oa===qh||this.oa===ph)this.oa=vh,wh(this)}};
557 function wh(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.Ca(a.name),a.oa=uh,a.transactionResult=a.name,b.text=f,a.doSuccess(e,f),null!==c&&c.U("TextEdited",b,e),a.Vg(),a.stopTool(),null!==c&&c.doFocus()):(a.oa=qh,a.doError(e,f))}}
558 hh.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)};hh.prototype.doSuccess=function(a,b){var c=this.textBlock;null!==c.textEdited&&c.textEdited(c,a,b)};hh.prototype.doDeactivate=function(){var a=this.diagram;null!==a&&(this.oa=kh,this.textBlock=null,null!==this.currentTextEditor&&this.currentTextEditor.hide(a,this),this.isActive=!1)};hh.prototype.doStop=function(){rh=null};
559 hh.prototype.isValidText=function(a,b,c){w(a,ih,hh,"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};hh.prototype.Zy=function(a){var b=this.Kh;b.text=a;b.measure(this.textBlock.Pi,Infinity);return b};
560 na.Object.defineProperties(hh.prototype,{textBlock:{configurable:!0,get:function(){return this.Qa},set:function(a){null!==a&&w(a,ih,hh,"textBlock");this.Qa=a}},currentTextEditor:{configurable:!0,get:function(){return this.w},set:function(a){this.w=a}},defaultTextEditor:{configurable:!0,get:function(){return this.l},set:function(a){!F||a instanceof ef||v("TextEditingTool.defaultTextEditor must be an HTMLInfo.");this.l=a}},starting:{configurable:!0,
561 get:function(){return this.Pa},set:function(a){gb(a,hh,hh,"starting");this.Pa=a}},textValidation:{configurable:!0,get:function(){return this.gj},set:function(a){null!==a&&A(a,"function",hh,"textValidation");this.gj=a}},minimumEditorScale:{configurable:!0,get:function(){return this.L},set:function(a){null!==a&&A(a,"number",hh,"minimumEditorScale");this.L=a}},selectsTextOnActivate:{configurable:!0,get:function(){return this.W},set:function(a){null!==a&&A(a,
562 "boolean",hh,"selectsTextOnActivate");this.W=a}},state:{configurable:!0,get:function(){return this.oa},set:function(a){this.oa!==a&&(gb(a,hh,hh,"starting"),this.oa=a)}}});hh.prototype.measureTemporaryTextBlock=hh.prototype.Zy;
563 var xh=new E(hh,"LostFocus",0),sh=new E(hh,"MouseDown",1),nh=new E(hh,"Tab",2),mh=new E(hh,"Enter",3),yh=new E(hh,"SingleClick",0),jh=new E(hh,"SingleClickSelected",1),th=new E(hh,"DoubleClick",2),kh=new E(hh,"StateNone",0),oh=new E(hh,"StateActive",1),ph=new E(hh,"StateEditing",2),vh=new E(hh,"StateValidating",3),qh=new E(hh,"StateInvalid",4),uh=new E(hh,"StateValidated",5),rh=null;hh.className="TextEditingTool";hh.LostFocus=xh;hh.MouseDown=sh;hh.Tab=nh;hh.Enter=mh;hh.SingleClick=yh;
564 hh.SingleClickSelected=jh;hh.DoubleClick=th;hh.StateNone=kh;hh.StateActive=oh;hh.StateEditing=ph;hh.StateValidating=vh;hh.StateInvalid=qh;hh.StateValidated=uh;Sa("textEditingTool",function(){return this.findTool("TextEditing")},function(a){this.fb("TextEditing",a,this.mouseUpTools)});
565 function zh(){Ah||(Bh(),Ah=!0);this.C=Re;this.Ml=this.sf=this.yc=this.Cs=this.pc=!1;this.gy=!0;this.Nl=Ch;this.Gn=!1;this.Ki=this.sd=!0;this.kh=600;this.Ex=this.ey=!1;this.cf=new I;this.Xd=new Dh;this.Xd.$c=this;this.Kj=new I;this.Gv=new I;this.Bt=new I;this.mm=new I}zh.prototype.me=function(a){this.C=a};zh.prototype.canStart=function(){return!0};function Eh(a,b){Fh(a,b)&&(a.sf=!0)}
566 function Fh(a,b){if(!a.sd||!a.canStart(b))return!1;a.cf.add(b);a.defaultAnimation.isAnimating&&a.Hc();return a.yc=!0}
567 function Gh(a){if(a.sd&&a.yc){var b=a.Xd,c=a.C,d=a.cf.contains("Model");d&&(a.Ml=!0,a.Nl===Ch?(b.isViewportUnconstrained=!0,b.rc.clear(),b.add(c,"position",c.position.copy().offset(0,-200),c.position),b.add(c,"opacity",0,1)):a.Nl===Hh&&b.rc.clear(),a.gy=a.Nl===Ih&&c.ft.A(c.ra)?!0:!1,c.U("InitialAnimationStarting",a));d&&!a.Ki||0===b.rc.count?(a.cf.clear(),a.yc=!1,a.sf=!1,b.rc.clear(),Jh(b,c),a.Ml=!1,c.P()):(a.cf.clear(),c.Re=!1,d=b.rc.get(c),c.autoScale!==Kh&&null!==d&&(delete d.start.scale,delete d.end.scale),
568 qa.requestAnimationFrame(function(){!1===a.yc||b.pc||(c.Xe("temporaryPixelRatio")&&lf(c),Lh(c),a.yc=!1,a.sf=!1,b.start(),Mh(a),c.Ta(),Nh(b,0),Rf(c,!0),Oh(a),c.U("AnimationStarting",a))}))}}function ai(a,b,c,d){a.isTicking||b instanceof S&&(null!==b.fromNode||null!==b.toNode)||a.Xd.add(b,"position",c,d,!1)}t=zh.prototype;t.pu=function(a){return this.Xd.pu(a)};t.tw=function(a){return this.Xd.tw(a)};
569 function bi(a,b){function c(){0<e.Bt.count&&(d.addAll(e.Bt),e.Bt.clear(),e.pc=!0);if(!1!==e.pc&&0!==d.count){e.Gv.addAll(d);for(var a=e.Gv.iterator;a.next();){var b=a.value;if(!1!==b.pc){a:if(0<b.Dm.count)var h=!0;else{for(h=b.rc.iterator;h.next();){var k=h.key;if(k instanceof O&&null!==k.diagram||k instanceof R){h=!0;break a}}h=!1}h?ci(b,!1):b.Vl=!0}}e.Gv.clear();Mh(e);Rf(e.C);Oh(e);qa.requestAnimationFrame(c)}}var d=a.Kj,e=a;a.pc?a.Bt.add(b):(a.pc=!0,d.add(b),qa.requestAnimationFrame(function(){c()}))}
570 function di(a){for(a=a.Kj.iterator;a.next();)a.value.Vl=!1}function Mh(a){if(!a.Cs){var b=a.C;a.ey=b.skipsUndoManager;a.Ex=b.skipsModelSourceBindings;b.skipsUndoManager=!0;b.skipsModelSourceBindings=!0;a.Cs=!0}}function Oh(a){var b=a.C;b.skipsUndoManager=a.ey;b.skipsModelSourceBindings=a.Ex;a.Cs=!1}
571 t.Hc=function(a){var b=this.Xd;!0===this.yc&&(this.Ml=this.sf=this.yc=!1,this.cf.clear(),0<b.rc.count&&this.C.Jb());if(this.pc){if(b.Lm(!0),b.rc.clear(),Jh(b,null),!0===a)for(a=this.Kj.ta(),b=0;b<a.length;b++)a[b].Lm(!0)}else b.rc.clear(),Jh(b,this.C)};t.Lm=function(a){a===this.defaultAnimation&&this.defaultAnimation.rc.clear();this.Kj.remove(a);0===this.Kj.count&&(this.pc=!1,this.C.Jb());a===this.defaultAnimation&&(this.defaultAnimation.rc.clear(),this.C.U("AnimationFinished",this))};
572 t.yk=function(a,b){this.sf&&(this.cf.contains("Expand Tree")||this.cf.contains("Expand SubGraph"))&&(this.Xd.yk(a,b),ei(this,a))};t.wk=function(a,b){this.sf&&(this.cf.contains("Collapse Tree")||this.cf.contains("Collapse SubGraph"))&&(this.Xd.wk(a,b),fi(this.Xd,b,"position",b.position,b.position),ei(this,a))};function gi(a,b,c){a.sf&&!b.A(c)&&(a.C.Bj||(b=c.copy()),fi(a.Xd,a.C,"position",b,c))}
573 function ei(a,b){for(b=b.findLinksConnected();b.next();){var c=b.value;c.wf=c.points.copy();a.mm.add(c)}}function hi(a,b,c,d,e){null===a&&(a=[0,0,0,0]);null===b&&(b=[0,0,0,0]);var f=a[0],g=a[1],h=a[2];a=a[3];var k=b[0],l=b[1],m=b[2];b=b[3];if(0===h||100===h)f=k,g=l;else if(0===m||100===m)k=f,l=g;180<Math.abs(k-f)&&(k>f?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+")"}
574 function Bh(){function a(a,b,e,f,g,h){a.position=new J(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))}var b=new Bb;b.add("position:diagram",a);b.add("position",a);b.add("position:part",function(a,b,e,f,g,h){g<h?a.tr(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h),!1):a.position=new J(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))});b.add("location",function(a,b,e,f,g,h){g<h?a.tr(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h),!0):a.location=new J(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))});b.add("position:placeholder",function(a,b,e,f,
575 g,h){g<h?a.tr(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h),!1):a.position=new J(f(g,b.x,e.x-b.x,h),f(g,b.y,e.y-b.y,h))});b.add("position:nodeCollapse",function(a,b,e,f,g,h){var c=a.actualBounds,d=e.actualBounds;e=d.x+d.width/2-c.width/2;c=d.y+d.height/2-c.height/2;g<h?a.tr(f(g,b.x,e-b.x,h),f(g,b.y,c-b.y,h),!1):a.position=new J(f(g,b.x,e-b.x,h),f(g,b.y,c-b.y,h))});b.add("desiredSize",function(a,b,e,f,g,h){a.desiredSize=new L(f(g,b.width,e.width-b.width,h),f(g,b.height,e.height-b.height,h))});b.add("width",
576 function(a,b,e,f,g,h){a.width=f(g,b,e-b,h)});b.add("height",function(a,b,e,f,g,h){a.height=f(g,b,e-b,h)});b.add("fill",function(a,b,e,f,g,h){a.fill=hi(b,e,g,h,f)});b.add("stroke",function(a,b,e,f,g,h){a.stroke=hi(b,e,g,h,f)});b.add("strokeWidth",function(a,b,e,f,g,h){a.strokeWidth=f(g,b,e-b,h)});b.add("strokeDashOffset",function(a,b,e,f,g,h){a.strokeDashOffset=f(g,b,e-b,h)});b.add("background",function(a,b,e,f,g,h){a.background=hi(b,e,g,h,f)});b.add("areaBackground",function(a,b,e,f,g,h){a.areaBackground=
577 hi(b,e,g,h,f)});b.add("opacity",function(a,b,e,f,g,h){a.opacity=f(g,b,e-b,h)});b.add("scale",function(a,b,e,f,g,h){a.scale=f(g,b,e-b,h)});b.add("angle",function(a,b,e,f,g,h){a.angle=f(g,b,e-b,h)});ii=b}
578 na.Object.defineProperties(zh.prototype,{animationReasons:{configurable:!0,get:function(){return this.cf}},isEnabled:{configurable:!0,get:function(){return this.sd},set:function(a){A(a,"boolean",zh,"isEnabled");(this.sd=a)&&this.Kj.each(function(a){a.isAnimating||Infinity!==a.runCount||a.start()})}},duration:{configurable:!0,get:function(){return this.kh},set:function(a){A(a,"number",zh,"duration");1>a&&za(a,">= 1",zh,"duration");this.kh=a}},isAnimating:{configurable:!0,
579 enumerable:!0,get:function(){return this.pc}},isTicking:{configurable:!0,get:function(){return this.Cs}},isInitial:{configurable:!0,get:function(){return this.Ki},set:function(a){A(a,"boolean",zh,"isInitial");this.Ki=a}},defaultAnimation:{configurable:!0,get:function(){return this.Xd}},activeAnimations:{configurable:!0,get:function(){return this.Kj}},initialAnimationStyle:{configurable:!0,get:function(){return this.Nl},set:function(a){F&&
580 gb(a,zh,zh,"initialAnimationStyle");this.Nl=a}}});zh.prototype.stopAnimation=zh.prototype.Hc;var ii=null,Ah=!1,Ch=new E(zh,"Default",1),Ih=new E(zh,"AnimateLocations",2),Hh=new E(zh,"None",3);zh.className="AnimationManager";zh.defineAnimationEffect=function(a,b){Ah||(Bh(),Ah=!0);ii.add(a,b)};zh.Default=Ch;zh.AnimateLocations=Ih;zh.None=Hh;
581 function Dh(){this.Kv=this.by=this.$c=this.C=null;this.Vl=this.pc=this.l=!1;this.no=this.Kd=0;this.Wr=this.Xu=ji;this.Ul=this.Sp=!1;this.Av=1;this.zv=0;this.Bd=this.kh=NaN;this.Ix=0;this.oo=null;this.w=Mb;this.rc=new Bb;this.vv=new Bb;this.Dm=new I;this.wv=new I;this.Fx=ki}Dh.prototype.suspend=function(){this.Vl=!0};Dh.prototype.advanceTo=function(a,b){b&&(this.Vl=!1);this.Sp&&a>=this.Bd&&(this.Ul=!0,a-=this.Bd);this.Ix=a;ci(this,!0);Mh(this.$c);Rf(this.C);Oh(this.$c);this.C.redraw()};
582 function Jh(a,b){a.vv.clear();a.Ul=!1;a.zv=0;a.Bd=NaN;0<a.Dm.count&&a.Dm.clear();0<a.wv.count&&a.wv.clear();if(null!==b)for(a=b.links;a.next();)a.value.wf=null}t=Dh.prototype;
583 t.start=function(){if(0!==this.rc.count&&!this.pc){for(var a=this.C,b=this.rc.iterator;b.next();){var c=b.value.end,d=b.key;if(c["position:placeholder"]){var e=d.findVisibleNode();if(e instanceof If&&null!==e.placeholder){var f=e.placeholder;e=f.ja(Ec);f=f.padding;e.x+=f.left;e.y+=f.top;c["position:placeholder"]=e}}null===a&&(d instanceof R?a=d:d instanceof O&&(a=d.diagram))}null!==a&&(this.C=a,b=this.$c=a.animationManager,!1!==b.isEnabled&&(this.Bd=isNaN(this.kh)?b.duration:this.kh,this.Wr=this.Xu,
584 b.Ml&&b.Nl===Ch&&this===b.defaultAnimation&&(this.Wr=li,this.Bd=isNaN(this.kh)?600===b.duration?900:b.duration:this.kh),this.Fx=a.scrollMode,this.isViewportUnconstrained&&(a.dj=mi),Mh(b),this.Dm.each(function(b){b.data=null;a.add(b)}),Oh(b),this.pc=!0,this.Kd=+new Date,this.no=this.Kd+this.Bd,bi(b,this)))}};
585 t.Jz=function(a,b){a.Tc()&&(F&&(void 0===b&&v("addTemporaryPart: Required Diagram argument missing"),a.diagram===b&&v("addTemporaryPart: Part already in Diagram, did you mean to pass in a copy?"),null!==this.C&&this.C!==b&&v("addTemporaryPart: A different Diagram is already associated with this Animation: "+this.C.toString())),this.Dm.add(a),this.C=b)};
586 t.add=function(a,b,c,d,e){if("position"!==b||!c.A(d)){null===this.C&&(a instanceof R?this.C=a:a instanceof O&&null!==a.diagram&&(this.C=a.diagram));if(a instanceof U){if(!a.isAnimated)return;"position"===b&&(b="position:part")}fi(this,a,b,c,d,e)}};
587 function fi(a,b,c,d,e,f){var g=a.rc;b instanceof R&&"position"===c&&(c="position:diagram");if("fill"===c||"stroke"===c||"background"===c||"areaBackground"===c)ni(d),oi(),d=[pi.l,pi.L,pi.w,pi.W],ni(e),oi(),e=[pi.l,pi.L,pi.w,pi.W];if(g.contains(b)){var h=g.J(b);var k=h.start;var l=h.end;void 0===k[c]&&(k[c]=qi(d));l[c]=qi(e)}else k={},l={},k[c]=qi(d),l[c]=qi(e),h=k.position,b instanceof O&&h instanceof J&&!h.o()&&b.diagram.animationManager.cf.contains("Expand SubGraph")&&h.assign(l.position),h=new ri(k,
588 l,f),g.add(b,h);g=k[c];g instanceof J&&!g.o()&&g.assign(a.w);f&&0===c.indexOf("position:")&&b instanceof U?h.ew.location=qi(b.location):f&&(h.ew[c]=qi(d))}function qi(a){return a instanceof J?a.copy():a instanceof Fb?a.copy():a}t.pu=function(a){if(!this.pc)return!1;a=this.rc.J(a);return null!==a&&a.Gw};t.tw=function(a){if(!this.pc)return!1;a=this.rc.J(a);return null!==a&&(a.start.position||a.start.location)};
589 function ci(a,b){if(!a.Vl||b){var c=a.$c;if(!1!==a.pc){var d=+new Date,e=d>a.no?a.Bd:d-a.Kd;b&&(e=a.Ix,e<a.Bd?(a.Kd=+new Date-e,a.no=a.Kd+a.Bd):e=a.Bd);Mh(c);Nh(a,e);Rf(a.C,!0);Oh(c);d>a.no&&(a.Sp&&!a.Ul?(a.Kd=+new Date,a.no=a.Kd+a.Bd,a.Ul=!0):a.Lm(!1))}}}
590 function Nh(a,b){for(var c=a.Bd,d=a.rc.iterator,e=a.Ul;d.next();){var f=d.key;if(!(f instanceof O&&null===f.diagram)){var g=d.value,h=e?g.end:g.start;g=e?g.start:g.end;var k=ii,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.Wr,b,c,a)}}}t.stop=function(){this.pc&&this.Lm(!0)};
591 t.Lm=function(a){null!==this.Kv&&this.Kv.Zp.remove(this.by);if(this.pc){var b=this.C,c=this.$c;this.Vl=this.pc=c.Ml=!1;Mh(c);for(var d=this.rc,e=this.Dm.iterator;e.next();)b.remove(e.value);for(e=this.wv.iterator;e.next();)e.value.u();e=this.Sp;d=d.iterator;for(var f=ii;d.next();){var g=d.key,h=d.value,k=e?h.end:h.start,l=e?h.start:h.end,m=h.ew,n;for(n in l)if(null!==f.get(n)){var p=n;!h.Xv||"position:nodeCollapse"!==p&&"position:placeholder"!==p||(p="position");f.get(p)(g,k[n],void 0!==m[n]?m[n]:
592 h.Xv?k[n]:l[n],this.Wr,this.Bd,this.Bd,this)}h.Xv&&void 0!==m.location&&g instanceof U&&(g.location=m.location);h.Gw&&g instanceof U&&g.Ub(!1)}b.ku.clear();vf(b,!1);b.Ta();b.P();Rf(b,!0);if(c.defaultAnimation===this){for(n=c.mm.iterator;n.next();)e=n.value,null!==e.wf&&(e.points=e.wf,e.wf=null);c.mm.clear()}this.isViewportUnconstrained&&(b.scrollMode=this.Fx);Oh(c);this.zv++;!a&&this.Av>this.zv?(this.Ul=!1,this.start()):(this.oo&&this.oo(this),Jh(this,null),c.Lm(this),b.Jb())}};
593 t.yk=function(a,b){var c=b.actualBounds,d=null;b instanceof If&&(d=b.placeholder);null!==d?(c=d.ja(Ec),d=d.padding,c.x+=d.left,c.y+=d.top,this.add(a,"position",c,a.position,!1)):this.add(a,"position",new J(c.x+c.width/2,c.y+c.height/2),a.position,!1);this.add(a,"scale",.01,a.scale,!1);if(a instanceof If)for(a=a.memberParts;a.next();)d=a.value,d instanceof V&&this.yk(d,b)};
594 t.wk=function(a,b){if(a.isVisible()){var c=null;b instanceof If&&(c=b.placeholder);null!==c?this.add(a,"position:placeholder",a.position,c,!0):this.add(a,"position:nodeCollapse",a.position,b,!0);this.add(a,"scale",a.scale,.01,!0);c=this.rc;c.contains(a)&&(c.J(a).Gw=!0);if(a instanceof If)for(a=a.memberParts;a.next();)c=a.value,c instanceof V&&this.wk(c,b)}};t.JA=function(a){var b=this.vv.get(a);null===b&&(b={},this.vv.add(a,b));return b};
595 na.Object.defineProperties(Dh.prototype,{duration:{configurable:!0,get:function(){return this.kh},set:function(a){A(a,"number",Dh,"duration");1>a&&za(a,">= 1",Dh,"duration");this.kh=a}},reversible:{configurable:!0,get:function(){return this.Sp},set:function(a){this.Sp=a}},runCount:{configurable:!0,get:function(){return this.Av},set:function(a){0<a?this.Av=a:v("Animation.runCount value must be a positive integer.")}},finished:{configurable:!0,
596 get:function(){return this.oo},set:function(a){this.oo!==a&&(null!==a&&A(a,"function",R,"click"),this.oo=a)}},easing:{configurable:!0,get:function(){return this.Xu},set:function(a){this.Xu=a}},isViewportUnconstrained:{configurable:!0,get:function(){return this.l},set:function(a){this.l=a}},isAnimating:{configurable:!0,get:function(){return this.pc}}});Dh.prototype.getTemporaryState=Dh.prototype.JA;Dh.prototype.stop=Dh.prototype.stop;Dh.prototype.add=Dh.prototype.add;
597 Dh.prototype.addTemporaryPart=Dh.prototype.Jz;function ji(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}function li(a,b,c,d){return a===d?b+c:c*(-Math.pow(2,-10*a/d)+1)+b}Dh.className="Animation";Dh.EaseLinear=function(a,b,c,d){return c*a/d+b};Dh.EaseInOutQuad=ji;Dh.EaseInQuad=function(a,b,c,d){return c*(a/=d)*a+b};Dh.EaseOutQuad=function(a,b,c,d){return-c*(a/=d)*(a-2)+b};Dh.EaseInExpo=function(a,b,c,d){return 0===a?b:c*Math.pow(2,10*(a/d-1))+b};Dh.EaseOutExpo=li;
598 function ri(a,b,c){this.start=a;this.end=b;this.ew={};this.Xv=c;this.Gw=!1}ri.className="AnimationState";function si(a,b,c){this.vd=null;this.uf=a;this.qq=c||ti;this.nl=null;void 0!==b&&(this.nl=b,void 0===c&&(this.qq=ui))}si.prototype.copy=function(){var a=new si(this.uf);a.qq=this.qq;var b=this.nl;if(null!==b){var c={};void 0!==b.duration&&(c.Dy=b.duration);void 0!==b.finished&&(c.Dy=b.finished);void 0!==b.easing&&(c.Dy=b.easing);a.nl=c}return a};
599 function vi(a,b){a=a.nl;null!==a&&(a.duration&&(b.duration=a.duration),a.finished&&(b.finished=a.finished),a.easing&&(b.easing=a.easing))}
600 na.Object.defineProperties(si.prototype,{propertyName:{configurable:!0,get:function(){return this.uf},set:function(a){this.uf=a}},animationSettings:{configurable:!0,get:function(){return this.nl},set:function(a){this.nl=a}},startCondition:{configurable:!0,get:function(){return this.qq},set:function(a){F&&gb(a,si,si,"startCondition");this.qq=a}}});var ti=new E(si,"Default",1),ui=new E(si,"Immediate",2),wi=new E(si,"Bundled",3);si.className="AnimationTrigger";
601 si.Default=ti;si.Immediate=ui;si.Bundled=wi;function xi(){0<arguments.length&&Ba(xi);eb(this);this.C=null;this.Ja=new H;this.va="";this.nb=1;this.w=!1;this.l=this.$i=this.L=this.ui=this.ti=this.si=this.ri=this.oi=this.pi=this.ni=this.wi=this.mi=this.vi=this.li=this.ki=!0;this.Fp=[]}t=xi.prototype;t.clear=function(){this.Ja.clear();this.Fp.length=0};t.me=function(a){this.C=a};
602 t.toString=function(a){void 0===a&&(a=0);var b='Layer "'+this.name+'"';if(0>=a)return b;for(var c=0,d=0,e=0,f=0,g=0,h=this.Ja.iterator;h.next();){var k=h.value;k instanceof If?e++:k instanceof V?d++:k instanceof S?f++:k instanceof Ve?g++:c++}h="";0<c&&(h+=c+" Parts ");0<d&&(h+=d+" Nodes ");0<e&&(h+=e+" Groups ");0<f&&(h+=f+" Links ");0<g&&(h+=g+" Adornments ");if(1<a)for(a=this.Ja.iterator;a.next();)c=a.value,h+="\n "+c.toString(),d=c.data,null!==d&&ob(d)&&(h+=" #"+ob(d)),c instanceof V?h+=" "+
603 Qa(d):c instanceof S&&(h+=" "+Qa(c.fromNode)+" "+Qa(c.toNode));return b+" "+this.Ja.count+": "+h};
604 t.ac=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.$i)return null;F&&!a.o()&&v("findObjectAt: Point must have a real value, not: "+a.toString());var d=!1;null!==this.diagram&&this.diagram.viewportBounds.ca(a)&&(d=!0);for(var e=J.alloc(),f=this.Ja.j,g=f.length;g--;){var h=f[g];if((!0!==d||!1!==wg(h))&&h.isVisible()&&(e.assign(a),Hb(e,h.Md),h=h.ac(e,b,c),null!==h&&(null!==b&&(h=b(h)),null!==h&&(null===c||c(h)))))return J.free(e),h}J.free(e);return null};
605 t.sj=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof I||(d=new I);if(!1===this.$i)return d;F&&!a.o()&&v("findObjectsAt: Point must have a real value, not: "+a.toString());var e=!1;null!==this.diagram&&this.diagram.viewportBounds.ca(a)&&(e=!0);for(var f=J.alloc(),g=this.Ja.j,h=g.length;h--;){var k=g[h];if((!0!==e||!1!==wg(k))&&k.isVisible()){f.assign(a);Hb(f,k.Md);var l=k;k.sj(f,b,c,d)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||d.add(l))}}J.free(f);return d};
606 t.Lf=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof I||(e=new I);if(!1===this.$i)return e;F&&!a.o()&&v("findObjectsIn: Rect must have a real value, not: "+a.toString());var f=!1;null!==this.diagram&&this.diagram.viewportBounds.Te(a)&&(f=!0);for(var g=this.Ja.j,h=g.length;h--;){var k=g[h];if((!0!==f||!1!==wg(k))&&k.isVisible()){var l=k;k.Lf(a,b,c,d,e)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||e.add(l))}}return e};
607 t.jw=function(a,b,c,d,e,f,g){if(!1===this.$i)return e;for(var h=this.Ja.j,k=h.length;k--;){var l=h[k];if((!0!==g||!1!==wg(l))&&f(l)&&l.isVisible()){var m=l;l.Lf(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||e.add(m))}}return e};
608 t.Qg=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof I)f=e;e=!0}f instanceof H||f instanceof I||(f=new I);if(!1===this.$i)return f;F&&!a.o()&&v("findObjectsNear: Point must have a real value, not: "+a.toString());var g=!1;null!==this.diagram&&this.diagram.viewportBounds.ca(a)&&(g=!0);for(var h=J.alloc(),k=J.alloc(),l=this.Ja.j,m=l.length;m--;){var n=l[m];if((!0!==g||!1!==wg(n))&&n.isVisible()){h.assign(a);Hb(h,n.Md);
609 k.h(a.x+b,a.y);Hb(k,n.Md);var p=n;n.Qg(h,k,c,d,e,f)&&(null!==c&&(p=c(p)),null===p||null!==d&&!d(p)||f.add(p))}}J.free(h);J.free(k);return f};
610 t.Td=function(a,b){if(this.visible){var c=this.Ja.j,d=c.length;if(0!==d){a=Ma();for(var e=Ma(),f=0;f<d;f++){var g=c[f];g.Ox=f;if(g instanceof S){if(!1===g.Ad)continue}else if(g instanceof Ve&&null!==g.adornedPart)continue;jc(g.actualBounds,b)?(g.Td(!0),a.push(g)):(g.Td(!1),null!==g.adornments&&0<g.adornments.count&&e.push(g))}for(b=0;b<a.length;b++)for(c=a[b],yi(c),c=c.adornments;c.next();)d=c.value,d.measure(Infinity,Infinity),d.arrange(),d.Td(!0);for(b=0;b<e.length;b++)yi(e[b]);Oa(a);Oa(e)}}};
611 function zi(a,b){var c=1;1!==a.nb&&(c=b.globalAlpha,b.globalAlpha=c*a.nb);return c}t.sc=function(a,b,c){if(this.visible&&0!==this.nb&&(void 0===c&&(c=!0),c||!this.isTemporary)){c=this.Ja.j;var d=c.length;if(0!==d){var e=zi(this,a),f=this.Fp;f.length=0;for(var g=b.scale,h=L.alloc(),k=0;k<d;k++)this.oj(a,c[k],b,f,g,h,!0);L.free(h);a.globalAlpha=e}}};
612 t.oj=function(a,b,c,d,e,f,g){if(!g||wg(b)){if(null!==d&&b instanceof S&&(b.isOrthogonal&&d.push(b),!1===b.Ad))return;g=!1;for(d=b.containingGroup;null!==d;)g?null!==d.gb&&f.Ty(d.gb):null!==d.gb&&(g=!0,f.assign(d.gb)),d=d.containingGroup;var h=b.actualBounds;d=!1;if(g&&b.isVisible()){if(!f.Sc(h))return;d=!f.Te(h)}d&&(a.save(),a.beginPath(),a.rect(f.x,f.y,f.width,f.height),a.clip());h.width*e>c.kp||h.height*e>c.kp?b.sc(a,c):(e=b.actualBounds,f=b.naturalBounds,0===e.width||0===e.height||isNaN(e.x)||
613 isNaN(e.y)||!b.isVisible()||(c=b.transform,null!==b.areaBackground&&(Ai(b,a,b.areaBackground,!0,!0,f,e),a.fillRect(e.x,e.y,e.width,e.height)),null===b.areaBackground&&null===b.background&&(Ai(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),Ai(b,a,b.background,!0,!1,f,e),a.fillRect(0,0,f.width/2,f.height/2),c.gu()||(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*
614 c.dx),b*(c.m12*c.dx-c.m11*c.dy))))));d&&(a.restore(),a.Ac(!0))}};t.g=function(a,b,c,d,e){var f=this.diagram;null!==f&&f.ab(Ce,a,this,b,c,d,e)};t.zj=function(a,b,c){var d=this.Ja;b.Qi=this;if(a>=d.count)a=d.count;else if(d.M(a)===b)return-1;d.Bb(a,b);b.Zq(c);d=this.diagram;null!==d&&(c?d.P():d.zj(b));Bi(this,a,b);return a};
615 t.Rc=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.Rc(a,b,c);var d=this.Ja;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.M(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.$q(c);d.jb(a);d=this.diagram;null!==d&&(c?d.P():d.Rc(b));b.Qi=null;return a};
616 function Bi(a,b,c){b=Ci(a,b,c);if(c instanceof If&&null!==c&&isNaN(c.zOrder)){if(0!==c.memberParts.count){for(var d=-1,e=a.Ja.j,f=e.length,g=0;g<f;g++){var h=e[g];if(h===c&&(b=g,0<=d))break;if(0>d&&h.containingGroup===c&&(d=g,0<=b))break}!(0>d)&&d<b&&(e=a.Ja,e.jb(b),e.Bb(d,c))}c=c.containingGroup;null!==c&&Bi(a,-1,c)}}
617 function Ci(a,b,c){var d=c.zOrder;if(isNaN(d))return b;a=a.Ja;var e=a.count;if(1>=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.M(f).zOrder;if(!isNaN(g))break;f--}for(var h=b+1,k=NaN;h<e;){k=a.M(h).zOrder;if(!isNaN(k))break;h++}if(!isNaN(g)&&g>d)for(;;){if(-1===f||g<=d){f++;if(f===b)break;a.jb(b);a.Bb(f,c);return f}for(g=NaN;0<=--f&&(g=a.M(f).zOrder,isNaN(g)););}else if(!isNaN(k)&&k<d)for(;;){if(h===e||k>=d){h--;if(h===b)break;a.jb(b);a.Bb(h,c);return h}for(k=NaN;++h<
618 e&&(k=a.M(h).zOrder,isNaN(k)););}return b}
619 na.Object.defineProperties(xi.prototype,{parts:{configurable:!0,get:function(){return this.Ja.iterator}},partsBackwards:{configurable:!0,get:function(){return this.Ja.iteratorBackwards}},diagram:{configurable:!0,get:function(){return this.C}},name:{configurable:!0,get:function(){return this.va},set:function(a){A(a,"string",xi,"name");var b=this.va;if(b!==a){var c=this.diagram;if(null!==c)for(""===b&&v("Cannot rename default Layer to: "+a),c=
620 c.layers;c.next();)c.value.name===a&&v("Layer.name is already present in this diagram: "+a);this.va=a;this.g("name",b,a);for(a=this.Ja.iterator;a.next();)a.value.layerName=this.va}}},opacity:{configurable:!0,get:function(){return this.nb},set:function(a){var b=this.nb;b!==a&&(A(a,"number",xi,"opacity"),(0>a||1<a)&&za(a,"0 <= value <= 1",xi,"opacity"),this.nb=a,this.g("opacity",b,a),a=this.diagram,null!==a&&a.P())}},isTemporary:{configurable:!0,get:function(){return this.w},
621 set:function(a){var b=this.w;b!==a&&(A(a,"boolean",xi,"isTemporary"),this.w=a,this.isInDocumentBounds=!1,this.g("isTemporary",b,a))}},visible:{configurable:!0,get:function(){return this.L},set:function(a){var b=this.L;if(b!==a){A(a,"boolean",xi,"visible");this.L=a;this.g("visible",b,a);for(b=this.Ja.iterator;b.next();)b.value.Ub(a);a=this.diagram;null!==a&&a.P()}}},pickable:{configurable:!0,get:function(){return this.$i},set:function(a){var b=this.$i;b!==a&&(A(a,"boolean",
622 xi,"pickable"),this.$i=a,this.g("pickable",b,a))}},isInDocumentBounds:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(this.l=a,null!==this.diagram&&this.diagram.Ta())}},allowCopy:{configurable:!0,get:function(){return this.ki},set:function(a){var b=this.ki;b!==a&&(A(a,"boolean",xi,"allowCopy"),this.ki=a,this.g("allowCopy",b,a))}},allowDelete:{configurable:!0,get:function(){return this.li},set:function(a){var b=this.li;b!==a&&(A(a,
623 "boolean",xi,"allowDelete"),this.li=a,this.g("allowDelete",b,a))}},allowTextEdit:{configurable:!0,get:function(){return this.vi},set:function(a){var b=this.vi;b!==a&&(A(a,"boolean",xi,"allowTextEdit"),this.vi=a,this.g("allowTextEdit",b,a))}},allowGroup:{configurable:!0,get:function(){return this.mi},set:function(a){var b=this.mi;b!==a&&(A(a,"boolean",xi,"allowGroup"),this.mi=a,this.g("allowGroup",b,a))}},allowUngroup:{configurable:!0,get:function(){return this.wi},
624 set:function(a){var b=this.wi;b!==a&&(A(a,"boolean",xi,"allowUngroup"),this.wi=a,this.g("allowUngroup",b,a))}},allowLink:{configurable:!0,get:function(){return this.ni},set:function(a){var b=this.ni;b!==a&&(A(a,"boolean",xi,"allowLink"),this.ni=a,this.g("allowLink",b,a))}},allowRelink:{configurable:!0,get:function(){return this.pi},set:function(a){var b=this.pi;b!==a&&(A(a,"boolean",xi,"allowRelink"),this.pi=a,this.g("allowRelink",b,a))}},allowMove:{configurable:!0,
625 get:function(){return this.oi},set:function(a){var b=this.oi;b!==a&&(A(a,"boolean",xi,"allowMove"),this.oi=a,this.g("allowMove",b,a))}},allowReshape:{configurable:!0,get:function(){return this.ri},set:function(a){var b=this.ri;b!==a&&(A(a,"boolean",xi,"allowReshape"),this.ri=a,this.g("allowReshape",b,a))}},allowResize:{configurable:!0,get:function(){return this.si},set:function(a){var b=this.si;b!==a&&(A(a,"boolean",xi,"allowResize"),this.si=a,this.g("allowResize",b,a))}},
626 allowRotate:{configurable:!0,get:function(){return this.ti},set:function(a){var b=this.ti;b!==a&&(A(a,"boolean",xi,"allowRotate"),this.ti=a,this.g("allowRotate",b,a))}},allowSelect:{configurable:!0,get:function(){return this.ui},set:function(a){var b=this.ui;b!==a&&(A(a,"boolean",xi,"allowSelect"),this.ui=a,this.g("allowSelect",b,a))}}});xi.prototype.findObjectsNear=xi.prototype.Qg;xi.prototype.findObjectsIn=xi.prototype.Lf;xi.prototype.findObjectsAt=xi.prototype.sj;
627 xi.prototype.findObjectAt=xi.prototype.ac;xi.className="Layer";
628 function R(a){1<arguments.length&&v("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");Di||(Ei(),Di=!0);eb(this);Re=this;this.Yb=!0;this.$c=new zh;this.$c.me(this);this.wb=17;this.Tl=this.Cv=!1;this.et="default";this.Ka=null;if(gh){var b=this,c=function(){b.removeEventListener(qa.document,"DOMContentLoaded",c,!1);b.setRTL()};null!==qa.document.body?this.setRTL():b.addEventListener(qa.document,"DOMContentLoaded",c,!1)}this.Ra=new H;this.Ea=this.Fa=0;this.lm=
629 this.Da=null;this.Yx=new Bb;this.vf=this.Mb=null;this.Lw();this.Zj=null;this.Kw();this.nb=1;this.ra=(new J(NaN,NaN)).freeze();this.ft=new J(NaN,NaN);this.co=this.Ga=1;this.ss=(new J(NaN,NaN)).freeze();this.ts=NaN;this.Ks=1E-4;this.Is=100;this.xb=new Gb;this.Kt=(new J(NaN,NaN)).freeze();this.ns=(new L(NaN,NaN,NaN,NaN)).freeze();this.cj=(new hc(0,0,0,0)).freeze();this.dj=ki;this.nt=!1;this.gt=this.$s=null;this.$g=Kh;this.Pj=fd;this.jg=Kh;this.Go=fd;this.us=this.rs=Ec;this.Jc=!0;this.Rl=!1;this.Cd=new I;
630 this.hh=new Bb;this.Dl=!0;this.Dn=250;this.Nj=-1;this.Fn=(new hc(16,16,16,16)).freeze();this.Tj=this.Re=!1;this.Wj=!0;this.hg=new ye;this.hg.diagram=this;this.ud=new ye;this.ud.diagram=this;this.th=new ye;this.th.diagram=this;this.He=this.$f=null;this.uk=!1;this.ds=this.es=null;this.Lj=qa.PointerEvent&&(Za||$a||ab)&&qa.navigator&&!1!==qa.navigator.msPointerEnabled;Fi(this);this.Oh=new I;this.Ds=!0;this.Et=Gi;this.gv=!1;this.Gt=Zf;this.Qa=null;Hi.add("Model",Ii);this.Xr=this.$r=this.Ct=null;this.bo=
631 this.Vr="auto";this.sg=this.Ns=this.ug=this.vg=this.xg=this.bg=this.fg=this.ag=null;this.qs=!1;this.cg=this.Ig=this.wg=this.tg=null;this.Os=!1;this.Ys={};this.nk=[null,null];this.Pr=null;this.bs=this.tt=this.Ev=this.Hg=!1;this.nv=!0;this.Ji=this.gc=!1;this.ic=null;var d=this;this.Ic=function(a){var b=d.partManager;if(a.model===b.diagram.model&&b.diagram.ba){b.diagram.ba=!1;try{var c=a.change;""===a.modelChange&&c===Ce&&b.updateDataBindings(a.object,a.propertyName)}finally{b.diagram.ba=!0}}};this.Zc=
632 function(a){d.partManager.doModelChanged(a)};this.Mv=!0;this.ce=-2;this.Bg=new Bb;this.im=new H;this.lg=!1;this.li=this.ki=this.Cr=this.sd=!0;this.Dr=!1;this.Jr=this.Hr=this.ui=this.ti=this.si=this.ri=this.oi=this.pi=this.ni=this.Gr=this.wi=this.mi=this.vi=this.Er=!0;this.kg=this.jv=!1;this.Ir=this.Fr=this.Jl=this.Il=!0;this.mt=this.it=16;this.ht=this.aq=!1;this.bq=this.kt=null;this.jt=this.lt=0;this.ob=(new hc(5)).freeze();this.Dv=(new I).freeze();this.Js=999999999;this.ev=(new I).freeze();this.Ii=
633 this.Hi=this.Gi=!0;this.kf=this.ze=!1;this.qc=null;this.Zg=!0;this.Ae=!1;this.Px=new I;this.fv=new I;this.Mc=null;this.hm=1;this.Fv=0;this.Oc={scale:1,position:new J,bounds:new L,Tv:new Fb,yw:new Fb,vw:!1};this.hy=(new L(NaN,NaN,NaN,NaN)).freeze();this.Fm=(new Fb(NaN,NaN)).freeze();this.eo=(new L(NaN,NaN,NaN,NaN)).freeze();this.Es=!1;this.Yo=this.Do=this.yp=this.Su=this.Ru=this.Tu=this.ng=this.rh=this.rf=this.hs=null;Ji(this);this.Ob=null;this.Co=!1;this.Qj=null;this.partManager=new Ii;this.toolManager=
634 new Ta;this.toolManager.initializeStandardTools();this.currentTool=this.defaultTool=this.toolManager;this.gs=null;this.wl=new hf;this.Ts=this.Ss=null;this.sq=!1;this.commandHandler=Ki();this.model=Li();this.Hg=!0;Mi(this);this.layout=new Ni;this.Hg=!1;this.Jx=this.Wu=null;this.Zb=1;this.Jh=null;this.kp=1;this.qp=0;this.uv=[0,0,0,0,0];this.rp=0;this.Dd=1;this.dk=0;this.To=new J;this.Dt=500;this.En=new J;this.Be=!1;this.al=this.bl=this.$k=this.Zk=this.Uk=this.Wk=this.Vk=this.Sk=this.Tk=this.mx=this.$w=
635 this.ax=this.bx=null;this.lr=function(){};this.preventDefault=null;this.Jo=!1;this.Fi=new Oi;this.tq=!1;void 0!==a&&Pi(this,a);this.po=null;this.qo=Qb;this.Yb=!1}R.prototype.clear=function(){this.animationManager.Hc();this.model.clear();Qi=null;Ri="";Si(this,!1);this.im.clear();Ti();this.Bg.clear();this.Ta();this.Ya();this.P()};
636 function Si(a,b){a.animationManager.Hc(!0);a.Dv=(new I).freeze();a.ev=(new I).freeze();var c=a.skipsUndoManager;null!==a.model&&(a.skipsUndoManager=!0);var d=null;null!==a.Ob&&(d=a.Ob.part,null!==d&&a.remove(d));var e=[],f=a.Ra.length;if(b){for(b=0;b<f;b++)for(var g=a.Ra.j[b].parts;g.next();){var h=g.value;h!==d&&null===h.data&&e.push(h)}for(b=0;b<e.length;b++)a.remove(e[b])}for(b=0;b<f;b++)a.Ra.j[b].clear();a.partManager.clear();a.Cd.clear();a.hh.clear();a.Oh.clear();a.Qj=null;a.im.clear();Ti();
637 a.Bg.clear();Na=[];null!==d&&(a.add(d),a.partManager.parts.remove(d));null!==a.model&&(a.skipsUndoManager=c);return e}function Ki(){return null}
638 R.prototype.reset=function(){this.clear();this.Yb=!0;this.$c=new zh;this.$c.me(this);this.wb=17;this.Tl=this.Cv=!1;this.et="default";this.Ra=new H;this.Yx=new Bb;this.vf=null;this.Lw();this.Zj=null;this.Kw();this.nb=1;this.ra=(new J(NaN,NaN)).freeze();this.ft=new J(NaN,NaN);this.co=this.Ga=1;this.ss=(new J(NaN,NaN)).freeze();this.ts=NaN;this.Ks=1E-4;this.Is=100;this.xb=new Gb;this.Kt=(new J(NaN,NaN)).freeze();this.ns=(new L(NaN,NaN,NaN,NaN)).freeze();this.cj=(new hc(0,0,0,0)).freeze();this.dj=ki;
639 this.nt=!1;this.gt=this.$s=null;this.$g=Kh;this.Pj=fd;this.jg=Kh;this.Go=fd;this.us=this.rs=Ec;this.Jc=!0;this.Rl=!1;this.Cd=new I;this.hh=new Bb;this.Dl=!0;this.Dn=250;this.Nj=-1;this.Fn=(new hc(16,16,16,16)).freeze();this.Tj=this.Re=!1;this.Wj=!0;this.hg=new ye;this.hg.diagram=this;this.ud=new ye;this.ud.diagram=this;this.th=new ye;this.th.diagram=this;this.He=this.$f=null;this.uk=!1;this.ds=this.es=null;this.Lj=qa.PointerEvent&&(Za||$a||ab)&&qa.navigator&&!1!==qa.navigator.msPointerEnabled;Fi(this);
640 this.Oh=new I;this.Ds=!0;this.Et=Gi;this.gv=!1;this.Gt=Zf;this.Xr=this.$r=this.Ct=null;this.bo=this.Vr="auto";this.sg=this.Ns=this.ug=this.vg=this.xg=this.bg=this.fg=this.ag=null;this.qs=!1;this.cg=this.Ig=this.wg=this.tg=null;this.Os=!1;this.Ys={};this.nk=[null,null];this.Pr=null;this.bs=this.tt=this.Ev=this.Hg=!1;this.nv=!0;this.Ji=this.gc=!1;this.Mv=!0;this.ce=-2;this.Bg=new Bb;this.im=new H;this.lg=!1;this.li=this.ki=this.Cr=this.sd=!0;this.Dr=!1;this.Jr=this.Hr=this.ui=this.ti=this.si=this.ri=
641 this.oi=this.pi=this.ni=this.Gr=this.wi=this.mi=this.vi=this.Er=!0;this.kg=this.jv=!1;this.Ir=this.Fr=this.Jl=this.Il=!0;this.mt=this.it=16;this.ht=this.aq=!1;this.jt=this.lt=0;this.ob=(new hc(5)).freeze();this.Dv=(new I).freeze();this.Js=999999999;this.ev=(new I).freeze();this.Ii=this.Hi=this.Gi=!0;this.kf=this.ze=!1;this.qc=null;this.Zg=!0;this.Ae=!1;this.Px=new I;this.fv=new I;this.Mc=null;this.hm=1;this.Fv=0;this.Oc={scale:1,position:new J,bounds:new L,Tv:new Fb,yw:new Fb,vw:!1};this.hy=(new L(NaN,
642 NaN,NaN,NaN)).freeze();this.Fm=(new Fb(NaN,NaN)).freeze();this.eo=(new L(NaN,NaN,NaN,NaN)).freeze();this.Es=!1;this.Yo=this.Do=this.yp=this.Su=this.Ru=this.Tu=this.ng=this.rh=this.rf=null;Ji(this);this.Ob=null;this.Co=!1;this.Qj=null;this.partManager=new Ii;this.toolManager=new Ta;this.toolManager.initializeStandardTools();this.currentTool=this.defaultTool=this.toolManager;this.gs=null;this.wl=new hf;this.Ts=this.Ss=null;this.sq=!1;this.commandHandler=Ki();this.Hg=!0;Mi(this);this.layout=new Ni;this.Hg=
643 !1;this.model=Li();this.model.undoManager=new Oe;this.Ae=!1;this.Wj=!0;this.Re=!1;this.Zb=1;this.Jh=null;this.kp=1;this.qp=0;this.uv=[0,0,0,0,0];this.rp=0;this.Dd=1;this.dk=0;this.To=new J;this.Dt=500;this.En=new J;this.tq=this.Jo=this.Be=!1;this.po=null;this.qo=Qb;this.Yb=!1;this.P()};
644 function Ji(a){a.rf=new Bb;var b=new V,c=new ih;c.bind(new Ui("text","",Qa));b.add(c);a.Tu=b;a.rf.add("",b);b=new V;c=new ih;c.stroke="brown";c.bind(new Ui("text","",Qa));b.add(c);a.rf.add("Comment",b);b=new V;b.selectable=!1;b.avoidable=!1;c=new Uf;c.figure="Ellipse";c.fill="black";c.stroke=null;c.desiredSize=(new Fb(3,3)).ia();b.add(c);a.rf.add("LinkLabel",b);a.rh=new Bb;b=new If;b.selectionObjectName="GROUPPANEL";b.type=W.Vertical;c=new ih;c.font="bold 12pt sans-serif";c.bind(new Ui("text","",
645 Qa));b.add(c);c=new W(W.Auto);c.name="GROUPPANEL";var d=new Uf;d.figure="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new xg;d.padding=(new hc(5,5,5,5)).ia();c.add(d);b.add(c);a.Ru=b;a.rh.add("",b);a.ng=new Bb;b=new S;c=new Uf;c.isPanelMain=!0;b.add(c);c=new Uf;c.toArrow="Standard";c.fill="black";c.stroke=null;c.strokeWidth=0;b.add(c);a.Su=b;a.ng.add("",b);b=new S;c=new Uf;c.isPanelMain=!0;c.stroke="brown";b.add(c);a.ng.add("Comment",b);b=new Ve;b.type=W.Auto;c=new Uf;c.fill=
646 null;c.stroke="dodgerblue";c.strokeWidth=3;b.add(c);c=new xg;c.margin=(new hc(1.5,1.5,1.5,1.5)).ia();b.add(c);a.yp=b;a.Do=b;b=new Ve;b.type=W.Link;c=new Uf;c.isPanelMain=!0;c.fill=null;c.stroke="dodgerblue";c.strokeWidth=3;b.add(c);a.Yo=b}
647 R.prototype.setRTL=function(a){a=void 0===a?this.div:a;null===a&&(a=qa.document.body);var b=ua("div");b.dir="rtl";b.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";b.textContent="A";a.appendChild(b);var c="reverse";0<b.scrollLeft?c="default":(b.scrollLeft=1,0===b.scrollLeft&&(c="negative"));a.removeChild(b);this.et=c};
648 R.prototype.setScrollWidth=function(a){a=void 0===a?this.div:a;null===a&&(a=qa.document.body);var b=0;if(gh){var c=Vi;b=Wi;null===c&&(c=Vi=ua("p"),c.style.width="100%",c.style.height="200px",c.style.boxSizing="content-box",b=Wi=ua("div"),b.style.position="absolute",b.style.visibility="hidden",b.style.width="200px",b.style.height="150px",b.style.boxSizing="content-box",b.appendChild(c));b.style.overflow="hidden";a.appendChild(b);var d=c.offsetWidth;b.style.overflow="scroll";c=c.offsetWidth;d===c&&
649 (c=b.clientWidth);a.removeChild(b);b=d-c;0!==b||db||(b=11)}this.wb=b;this.Cv=!0};R.prototype.pb=function(a){a.classType===R?this.autoScale=a:Da(this,a)};R.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.div&&this.div.id&&(b=this.div.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.Ra.iterator;c.next();)b+="\n "+c.value.toString(a-1);return b};R.prototype.addEventListener=function(a,b,c,d){a.addEventListener(b,c,{capture:d,passive:!1})};
650 R.prototype.removeEventListener=function(a,b,c,d){a.removeEventListener(b,c,{capture:d})};
651 function Xi(a){var b=a.Da.Oa;b instanceof HTMLCanvasElement&&(a.Lj?(a.addEventListener(b,"pointerdown",a.Zk,!1),a.addEventListener(b,"pointermove",a.$k,!1),a.addEventListener(b,"pointerup",a.bl,!1),a.addEventListener(b,"pointerout",a.al,!1)):(a.addEventListener(b,"touchstart",a.bx,!1),a.addEventListener(b,"touchmove",a.ax,!1),a.addEventListener(b,"touchend",a.$w,!1),a.addEventListener(b,"mousemove",a.Tk,!1),a.addEventListener(b,"mousedown",a.Sk,!1),a.addEventListener(b,"mouseup",a.Vk,!1),a.addEventListener(b,
652 "mouseout",a.Uk,!1)),a.addEventListener(b,"mouseenter",a.eA,!1),a.addEventListener(b,"mouseleave",a.fA,!1),a.addEventListener(b,"wheel",a.Wk,!1),a.addEventListener(b,"keydown",a.VA,!1),a.addEventListener(b,"keyup",a.WA,!1),a.addEventListener(b,"blur",a.Rz,!1),a.addEventListener(b,"focus",a.Sz,!1),a.addEventListener(b,"selectstart",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"contextmenu",function(a){a.preventDefault();return!1},!1),a.addEventListener(b,"gesturestart",function(b){a.toolManager.gestureBehavior!==
653 Ye&&(a.toolManager.gestureBehavior===Xe?b.preventDefault():a.Be&&a.lastInput.handled||(b.preventDefault(),a.hm=a.scale,a.currentTool.doCancel()))},!1),a.addEventListener(b,"gesturechange",function(b){if(a.toolManager.gestureBehavior!==Ye)if(a.toolManager.gestureBehavior===Xe)b.preventDefault();else if(!a.Be||!a.lastInput.handled){b.preventDefault();var c=b.scale;if(null!==a.hm){var e=a.Da.getBoundingClientRect();b=new J(b.pageX-qa.scrollX-a.Fa/e.width*e.left,b.pageY-qa.scrollY-a.Ea/e.height*e.top);
654 c=a.hm*c;e=a.commandHandler;if(c!==a.scale&&e.canResetZoom(c)){var f=a.zoomPoint;a.zoomPoint=b;e.resetZoom(c);a.zoomPoint=f}}}},!1),a.addEventListener(qa,"resize",a.mx,!1))}function lf(a){30<a.qp&&(a.Jh=1)}function vf(a,b){null!==a.Jh&&(a.Jh=null,b&&a.lr(),F&&F.By||(a.qp=0,a.uv=[0,0,0,0,0],a.rp=0))}R.prototype.computePixelRatio=function(){return null!==this.Jh?this.Jh:qa.devicePixelRatio||1};R.prototype.doMouseMove=function(){this.currentTool.doMouseMove()};R.prototype.doMouseDown=function(){this.currentTool.doMouseDown()};
655 R.prototype.doMouseUp=function(){this.currentTool.doMouseUp()};R.prototype.doMouseWheel=function(){this.currentTool.doMouseWheel()};R.prototype.doKeyDown=function(){this.currentTool.doKeyDown()};R.prototype.doKeyUp=function(){this.currentTool.doKeyUp()};R.prototype.doFocus=function(){this.focus()};R.prototype.focus=function(){if(this.Da)if(this.scrollsPageOnFocus)this.Da.focus();else{var a=qa.scrollX||qa.pageXOffset,b=qa.scrollY||qa.pageYOffset;this.Da.focus();qa.scrollTo(a,b)}};R.prototype.Sz=function(){this.C.U("GainedFocus")};
656 R.prototype.Rz=function(){this.C.U("LostFocus")};function Lh(a){if(null!==a.Da){var b=a.Ka;if(0!==b.clientWidth&&0!==b.clientHeight){a.Cv||a.setScrollWidth();var c=a.kf?a.wb:0,d=a.ze?a.wb:0,e=a.Zb;a.Zb=a.computePixelRatio();a.Zb!==e&&(a.Rl=!0,a.Jb());if(b.clientWidth!==a.Fa+c||b.clientHeight!==a.Ea+d)a.Hi=!0,a.Jc=!0,b=a.layout,null!==b&&b.isViewportSized&&a.autoScale===Kh&&(a.Tj=!0,b.D()),a.gc||a.Jb()}}}
657 function Mi(a){var b=new xi;b.name="Background";a.Hm(b);b=new xi;b.name="";a.Hm(b);b=new xi;b.name="Foreground";a.Hm(b);b=new xi;b.name="Adornment";b.isTemporary=!0;b.isInDocumentBounds=!1;a.Hm(b);b=new xi;b.name="Tool";b.isTemporary=!0;b.isInDocumentBounds=!0;a.Hm(b);b=new xi;b.name="Grid";b.allowSelect=!1;b.pickable=!1;b.isTemporary=!0;b.isInDocumentBounds=!1;a.ky(b,a.Jk("Background"))}
658 function Yi(a){a.Ob=new W(W.Grid);a.Ob.name="GRID";var b=new Uf;b.figure="LineH";b.stroke="lightgray";b.strokeWidth=.5;b.interval=1;a.Ob.add(b);b=new Uf;b.figure="LineH";b.stroke="gray";b.strokeWidth=.5;b.interval=5;a.Ob.add(b);b=new Uf;b.figure="LineH";b.stroke="gray";b.strokeWidth=1;b.interval=10;a.Ob.add(b);b=new Uf;b.figure="LineV";b.stroke="lightgray";b.strokeWidth=.5;b.interval=1;a.Ob.add(b);b=new Uf;b.figure="LineV";b.stroke="gray";b.strokeWidth=.5;b.interval=5;a.Ob.add(b);b=new Uf;b.figure=
659 "LineV";b.stroke="gray";b.strokeWidth=1;b.interval=10;a.Ob.add(b);b=new U;b.add(a.Ob);b.layerName="Grid";b.zOrder=0;b.isInDocumentBounds=!1;b.isAnimated=!1;b.pickable=!1;b.locationObjectName="GRID";a.add(b);a.partManager.parts.remove(b);a.Ob.visible=!1}function Zi(){this.C.ht?this.C.ht=!1:this.C.isEnabled?this.C.xy(this):$i(this.C)}function hj(a){this.C.isEnabled?(this.C.lt=a.target.scrollTop,this.C.jt=a.target.scrollLeft):$i(this.C)}
660 R.prototype.xy=function(a){if(null!==this.Da){this.aq=!0;var b=this.documentBounds,c=this.viewportBounds,d=this.cj,e=b.x-d.left,f=b.y-d.top,g=b.width+d.left+d.right,h=b.height+d.top+d.bottom,k=b.right+d.right;d=b.bottom+d.bottom;var l=c.x;b=c.y;var m=c.width,n=c.height,p=c.right,r=c.bottom;c=this.scale;var q=a.scrollLeft;if(this.Tl)switch(this.et){case "negative":q=q+a.scrollWidth-a.clientWidth;break;case "reverse":q=a.scrollWidth-q-a.clientWidth}var u=q;m<g||n<h?(q=J.allocAt(this.position.x,this.position.y),
661 this.allowHorizontalScroll&&this.jt!==u&&(q.x=u/c+e,this.jt=u),this.allowVerticalScroll&&this.lt!==a.scrollTop&&(q.y=a.scrollTop/c+f,this.lt=a.scrollTop),this.position=q,J.free(q),this.Hi=this.aq=!1):(q=J.alloc(),a.yz&&this.allowHorizontalScroll&&(e<l&&(this.position=q.h(u+e,this.position.y)),k>p&&(this.position=q.h(-(this.kt.scrollWidth-this.Fa)+u-this.Fa/c+k,this.position.y))),a.zz&&this.allowVerticalScroll&&(f<b&&(this.position=q.h(this.position.x,a.scrollTop+f)),d>r&&(this.position=q.h(this.position.x,
662 -(this.kt.scrollHeight-this.Ea)+a.scrollTop-this.Ea/c+d))),J.free(q),ij(this),this.Hi=this.aq=!1,b=this.documentBounds,c=this.viewportBounds,k=b.right,p=c.right,d=b.bottom,r=c.bottom,e=b.x,l=c.x,f=b.y,b=c.y,m>=g&&e>=l&&k<=p&&(this.bq.style.width="1px"),n>=h&&f>=b&&d<=r&&(this.bq.style.height="1px"))}};R.prototype.computeBounds=function(){0<this.Cd.count&&jj(this);return kj(this)};
663 function kj(a){if(a.fixedBounds.o()){var b=a.fixedBounds.copy();b.Hq(a.ob);return b}for(var c=!0,d=a.Ra.j,e=d.length,f=0;f<e;f++){var g=d[f];if(g.visible&&g.isInDocumentBounds){g=g.Ja.j;for(var h=g.length,k=0;k<h;k++){var l=g[k];l.isInDocumentBounds&&l.isVisible()&&(l=l.actualBounds,l.o()&&(c?(c=!1,b=l.copy()):b.Xc(l)))}}}c&&(b=new L(0,0,0,0));b.Hq(a.ob);return b}
664 R.prototype.computePartsBounds=function(a,b){void 0===b&&(b=!1);var c=null;if(Ha(a))for(var d=0;d<a.length;d++){var e=a[d];!b&&e instanceof S||(e.Ya(),null===c?c=e.actualBounds.copy():c.Xc(e.actualBounds))}else for(a=a.iterator;a.next();)d=a.value,!b&&d instanceof S||(d.Ya(),null===c?c=d.actualBounds.copy():c.Xc(d.actualBounds));return null===c?new L(NaN,NaN,0,0):c};
665 function lj(a,b){if((b||a.Ae)&&!a.Yb&&null!==a.Da&&a.documentBounds.o()){if(b){var c=a.initialPosition;if(c.o()){a.position=c;return}c=J.alloc();c.Fj(a.documentBounds,a.initialDocumentSpot);var d=a.viewportBounds;d=L.allocAt(0,0,d.width,d.height);var e=J.alloc();e.Fj(d,a.initialViewportSpot);e.h(c.x-e.x,c.y-e.y);a.position=e;L.free(d);J.free(e);J.free(c)}a.Yb=!0;c=a.$g;b&&a.jg!==Kh&&(c=a.jg);d=c!==Kh?mj(a,c):a.scale;c=a.viewportBounds.copy();e=a.Fa/d;var f=a.Ea/d,g=a.Pj,h=a.Go;b&&!g.eb()&&(h.eb()||
666 h.Ib())&&(g=h.Ib()?Kc:h);nj(a,a.documentBounds,e,f,g,b);b=a.scale;a.scale=d;a.Yb=!1;d=a.viewportBounds;if(!d.Wa(c))a.onViewportBoundsChanged(c,d,b,!1);oj(a);pj(a,!0,!1)}}
667 function mj(a,b){var c=a.co;if(null===a.Da)return c;a.Ya();var d=a.documentBounds;if(!d.o())return c;var e=d.width;d=d.height;var f=a.Fa+(a.kf?a.wb:0),g=a.Ea+(a.ze?a.wb:0),h=f/e,k=g/d;return b===qj?(b=Math.min(k,h),b>c&&(b=c),b<a.minScale&&(b=a.minScale),b>a.maxScale&&(b=a.maxScale),b):b===rj?(b=k>h?(g-a.wb)/d:(f-a.wb)/e,b>c&&(b=c),b<a.minScale&&(b=a.minScale),b>a.maxScale&&(b=a.maxScale),b):a.scale}
668 R.prototype.zoomToFit=function(){var a=this.dj;this.dj=ki;this.scale=mj(this,qj);a!==ki&&(lj(this,!1),nj(this,this.documentBounds,this.Fa/this.Ga,this.Ea/this.Ga,this.Pj,!1));this.dj=a};t=R.prototype;
669 t.GB=function(a,b){void 0===b&&(b=qj);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===qj||b===rj)if(isNaN(c))e=this.viewportBounds.height*this.scale/d;else if(isNaN(d))e=this.viewportBounds.width*this.scale/c;else{e=this.Fa;var f=this.Ea;e=b===rj?f/d>e/c?(f-(this.ze?this.wb:0))/d:(e-(this.kf?this.wb:0))/c:Math.min(f/d,e/c)}this.scale=e;this.position=new J(a.x,a.y)}};
670 t.Kz=function(a,b){this.Ya();var c=this.documentBounds,d=this.viewportBounds;this.position=new J(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.EA=function(a){if(a instanceof O){this.po=a;var b=J.alloc();this.qo=this.vr(a.ja(Ec,b));J.free(b)}else this.po=null,this.qo=Qb};
671 function nj(a,b,c,d,e,f){var g=J.allocAt(a.ra.x,a.ra.y),h=g.x,k=g.y;if(null!==a.po){var l=J.alloc();l=a.po.ja(Ec,l);h=l.x-a.qo.x/a.scale;k=l.y-a.qo.y/a.scale;e=Bc;J.free(l)}if(f||a.scrollMode===ki)e.eb()&&(c>b.width&&(h=b.x+(e.x*b.width+e.offsetX)-(e.x*c-e.offsetX)),d>b.height&&(k=b.y+(e.y*b.height+e.offsetY)-(e.y*d-e.offsetY))),e=a.cj,f=c-b.width,c<b.width+e.left+e.right?(h=Math.min(h+c/2,b.right+Math.max(f,e.right)-c/2),h=Math.max(h,b.left-Math.max(f,e.left)+c/2),h-=c/2):h>b.left?h=b.left:h<b.right-
672 c&&(h=b.right-c),c=d-b.height,d<b.height+e.top+e.bottom?(k=Math.min(k+d/2,b.bottom+Math.max(c,e.bottom)-d/2),k=Math.max(k,b.top-Math.max(c,e.top)+d/2),k-=d/2):k>b.top?k=b.top:k<b.bottom-d&&(k=b.bottom-d);g.x=isFinite(h)?h:-a.ob.left;g.y=isFinite(k)?k:-a.ob.top;null!==a.positionComputation&&(b=a.positionComputation(a,g),g.x=b.x,g.y=b.y);a.$c.yc&&gi(a.$c,a.ra,g);a.ra.h(g.x,g.y);J.free(g)}
673 t.Nm=function(a,b){void 0===b&&(b=!0);if(b){if(a=Jf(this,a,function(a){return a.part},function(a){return a.canSelect()}),a instanceof U)return a}else if(a=Jf(this,a,function(a){return a.part}),a instanceof U)return a;return null};t.ac=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);jj(this);for(var d=this.Ra.iteratorBackwards;d.next();){var e=d.value;if(e.visible&&(e=e.ac(a,b,c),null!==e))return e}return null};
674 function Jf(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);jj(a);for(a=a.Ra.iteratorBackwards;a.next();){var e=a.value;if(e.visible&&!e.isTemporary&&(e=e.ac(b,c,d),null!==e))return e}return null}t.sA=function(a,b,c){void 0===b&&(b=!0);return sj(this,a,function(a){return a.part},b?function(a){return a instanceof U&&a.canSelect()}:null,c)};
675 function sj(a,b,c,d,e){void 0===c&&(c=null);void 0===d&&(d=null);e instanceof H||e instanceof I||(e=new I);jj(a);for(a=a.Ra.iteratorBackwards;a.next();){var f=a.value;f.visible&&!f.isTemporary&&f.sj(b,c,d,e)}return e}t.sj=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof I||(d=new I);jj(this);for(var e=this.Ra.iteratorBackwards;e.next();){var f=e.value;f.visible&&f.sj(a,b,c,d)}return d};
676 t.Iy=function(a,b,c,d){void 0===b&&(b=!1);void 0===c&&(c=!0);return tj(this,a,function(a){return a instanceof U&&(!c||a.canSelect())},b,d)};t.Lf=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof I||(e=new I);jj(this);for(var f=this.Ra.iteratorBackwards;f.next();){var g=f.value;g.visible&&g.Lf(a,b,c,d,e)}return e};
677 t.jw=function(a,b,c,d,e,f){var g=new I;jj(this);for(var h=this.Ra.iteratorBackwards;h.next();){var k=h.value;k.visible&&k.jw(a,b,c,d,g,e,f)}return g};function tj(a,b,c,d,e){var f=null;void 0===f&&(f=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof H||e instanceof I||(e=new I);jj(a);for(a=a.Ra.iteratorBackwards;a.next();){var g=a.value;g.visible&&!g.isTemporary&&g.Lf(b,f,c,d,e)}return e}
678 t.tA=function(a,b,c,d,e){void 0===c&&(c=!0);void 0===d&&(d=!0);return uj(this,a,b,function(a){return a instanceof U&&(!d||a.canSelect())},c,e)};t.Qg=function(a,b,c,d,e,f){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof I)f=e;e=!0}f instanceof H||f instanceof I||(f=new I);jj(this);for(var g=this.Ra.iteratorBackwards;g.next();){var h=g.value;h.visible&&h.Qg(a,b,c,d,e,f)}return f};
679 function uj(a,b,c,d,e,f){var g=null;void 0===g&&(g=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof H||e instanceof I)f=e;e=!0}f instanceof H||f instanceof I||(f=new I);jj(a);for(a=a.Ra.iteratorBackwards;a.next();){var h=a.value;h.visible&&!h.isTemporary&&h.Qg(b,c,g,d,e,f)}return f}R.prototype.acceptEvent=function(a){return vj(this,a,a instanceof MouseEvent)};
680 function vj(a,b,c){var d=a.ud;a.ud=a.th;a.th=d;d.diagram=a;d.event=b;c?wj(a,b,d):(d.viewPoint=a.ud.viewPoint,d.documentPoint=a.ud.documentPoint);a=0;b.ctrlKey&&(a+=1);b.altKey&&(a+=2);b.shiftKey&&(a+=4);b.metaKey&&(a+=8);d.modifiers=a;d.button=b.button;void 0===b.buttons||Wa||(d.buttons=b.buttons);cb&&0===b.button&&b.ctrlKey&&(d.button=2);d.down=!1;d.up=!1;d.clickCount=1;d.delta=0;d.handled=!1;d.bubbles=!1;d.timestamp=b.timeStamp;d.isMultiTouch=!1;d.targetDiagram=xj(b);d.targetObject=null;return d}
681 function xj(a){var b=a.target.C;if(!b){var c=a.path;c||"function"!==typeof a.composedPath||(c=a.composedPath());c&&c[0]&&(b=c[0].C)}return b?b:null}function yj(a,b,c,d){var e=zj(a,b,!0,!1,!0,d);wj(a,c,e);e.targetDiagram=xj(b);e.targetObject=null;d||e.clone(a.hg);return e}
682 function Aj(a,b,c,d){d=zj(a,b,!1,!1,!1,d);if(null!==c){var e=qa.document.elementFromPoint(c.clientX,c.clientY);null!==e&&void 0!==e.shadowRoot&&null!==e.shadowRoot&&(e=e.shadowRoot.elementFromPoint(c.clientX,c.clientY));e&&e.C?(b=c,c=e.C):(b=void 0!==b.targetTouches?b.targetTouches[0]:b,c=a);d.targetDiagram=c;wj(a,b,d)}else null!==a.ud?(d.documentPoint=a.ud.documentPoint,d.viewPoint=a.ud.viewPoint,d.targetDiagram=a.ud.targetDiagram):null!==a.hg&&(d.documentPoint=a.hg.documentPoint,d.viewPoint=a.hg.viewPoint,
683 d.targetDiagram=a.hg.targetDiagram);d.targetObject=null;return d}
684 function zj(a,b,c,d,e,f){var g=a.ud;a.ud=a.th;a.th=g;g.diagram=a;g.clickCount=1;var h=g.delta=0;b.ctrlKey&&(h+=1);b.altKey&&(h+=2);b.shiftKey&&(h+=4);b.metaKey&&(h+=8);g.modifiers=h;g.button=0;g.buttons=1;g.event=b;g.timestamp=b.timeStamp;a.Lj&&b instanceof qa.PointerEvent&&"touch"!==b.pointerType&&(g.button=b.button,void 0===b.buttons||Wa||(g.buttons=b.buttons),cb&&0===b.button&&b.ctrlKey&&(g.button=2));g.down=c;g.up=d;g.handled=!1;g.bubbles=e;g.isMultiTouch=f;return g}
685 function Bj(a,b,c){if(b.bubbles)return F&&F.Sy&&Ea("NOT handled "+c.type+" "+b.toString()),!0;F&&F.Sy&&Ea("handled "+c.type+" "+a.currentTool.name+" "+b.toString());void 0!==c.stopPropagation&&c.stopPropagation();!1!==c.cancelable&&c.preventDefault();c.cancelBubble=!0;return!1}
686 R.prototype.VA=function(a){var b=this.C;if(!this.C.isEnabled)return!1;var c=vj(b,a,!1);c.key=String.fromCharCode(a.which);c.down=!0;switch(a.which){case 8:c.key="Backspace";break;case 33:c.key="PageUp";break;case 34:c.key="PageDown";break;case 35:c.key="End";break;case 36:c.key="Home";break;case 37:c.key="Left";break;case 38:c.key="Up";break;case 39:c.key="Right";break;case 40:c.key="Down";break;case 45:c.key="Insert";break;case 46:c.key="Del";break;case 48:c.key="0";break;case 187:case 61:case 107:c.key=
687 "Add";break;case 189:case 173:case 109:c.key="Subtract";break;case 27:c.key="Esc"}b.doKeyDown();return Bj(b,c,a)};
688 R.prototype.WA=function(a){var b=this.C;if(!b.isEnabled)return!1;var c=vj(b,a,!1);c.key=String.fromCharCode(a.which);c.up=!0;switch(a.which){case 8:c.key="Backspace";break;case 33:c.key="PageUp";break;case 34:c.key="PageDown";break;case 35:c.key="End";break;case 36:c.key="Home";break;case 37:c.key="Left";break;case 38:c.key="Up";break;case 39:c.key="Right";break;case 40:c.key="Down";break;case 45:c.key="Insert";break;case 46:c.key="Del"}b.doKeyUp();return Bj(b,c,a)};
689 R.prototype.eA=function(a){var b=this.C;if(!b.isEnabled)return!1;var c=vj(b,a,!0);null!==b.mouseEnter&&b.mouseEnter(c);return Bj(b,c,a)};R.prototype.fA=function(a){var b=this.C;if(!b.isEnabled)return!1;var c=vj(b,a,!0);null!==b.mouseLeave&&b.mouseLeave(c);return Bj(b,c,a)};
690 R.prototype.getMouse=function(a){var b=this.Da;if(null===b)return new J(0,0);var c=b.getBoundingClientRect();b=a.clientX-this.Fa/c.width*c.left;a=a.clientY-this.Ea/c.height*c.top;return null!==this.xb?Hb(new J(b,a),this.xb):new J(b,a)};
691 function wj(a,b,c){var d=a.Da,e=a.Fa,f=a.Ea,g=0,h=0;null!==d&&(d=d.getBoundingClientRect(),g=b.clientX-e/d.width*d.left,h=b.clientY-f/d.height*d.top);c.viewPoint.h(g,h);null!==a.xb?(b=J.allocAt(g,h),a.xb.Pd(b),c.documentPoint.assign(b),J.free(b)):c.documentPoint.h(g,h)}
692 function ze(a,b,c,d){if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;b=b.targetTouches[c]}else if(null!==a.nk[0])b=a.nk[c];else return;c=a.Da;null!==c&&(c=c.getBoundingClientRect(),d.h(b.clientX-a.Fa/c.width*c.left,b.clientY-a.Ea/c.height*c.top))}R.prototype.Ta=function(){this.Gi||(this.Gi=!0,this.Jb(!0))};function Cj(a){a.gc||jj(a);a.Ya()}R.prototype.redraw=function(){this.Yb||this.gc||(this.P(),oj(this),ij(this),this.Ta(),this.od())};t=R.prototype;t.UA=function(){return this.Re};
693 t.$z=function(a){void 0===a&&(a=null);var b=this.animationManager,c=b.isEnabled;b.Hc();b.isEnabled=!1;Rf(this);this.Ae=!1;this.ft=new J(NaN,NaN);b.isEnabled=c;this.gc=!0;var d=this;null!==a&&ta(function(){d.gc=!1;Eh(b,"Model");a(d)},1)};t.Jb=function(a){void 0===a&&(a=!1);if(!0!==this.Re&&!(this.Yb||!1===a&&this.gc)){this.Re=!0;var b=this;qa.requestAnimationFrame(function(){b.Re&&b.od()})}};t.od=function(){if(!this.Wj||this.Re)this.Wj&&(this.Wj=!1),Rf(this)};
694 function pj(a,b,c){a.animationManager.defaultAnimation.isAnimating||a.Yb||!a.Hi||$i(a)||(b&&jj(a),c&&lj(a,!1))}
695 function Rf(a,b){if(!a.gc&&(a.Re=!1,null!==a.Ka||a.Fm.o())){a.gc=!0;var c=a.animationManager,d=a.im;if(!c.isAnimating&&0!==d.length){for(var e=d.j,f=e.length,g=0;g<f;g++){var h=e[g];Dj(h,!1);h.u()}d.clear()}d=a.fv;0<d.count&&(d.each(function(a){a.lx()}),d.clear());e=d=!1;c.defaultAnimation.isAnimating&&(e=!0,d=a.skipsUndoManager,a.skipsUndoManager=!0);c.yc||Lh(a);pj(a,!1,!0);null!==a.Ob&&(a.Ob.visible&&!a.Co&&(Ej(a),a.Co=!0),!a.Ob.visible&&a.Co&&(a.Co=!1));jj(a);f=!1;if(!a.Ae||a.Zg)a.Ae?Fj(a,!a.Tj):
696 (a.Ca("Initial Layout"),!1===c.isEnabled&&c.Hc(),Fj(a,!1)),f=!0;a.Tj=!1;jj(a);a.tt||Cj(a);pj(a,!0,!1);g=!1;f?(c=L.alloc(),c.assign(a.viewportBounds),a.Ae||(g=a.Ae=!0,a.skipsUndoManager||(a.undoManager.isPendingClear=!0),a.undoManager.isPendingUnmodified=!0,Gj(a)),a.U("LayoutCompleted"),c.A(a.viewportBounds)||pj(a,!0,!1),L.free(c)):c.Ml&&c.gy&&(a.jg!==Kh?a.scale=mj(a,a.jg):a.$g!==Kh?a.scale=mj(a,a.$g):(c=a.initialScale,isFinite(c)&&0<c&&(a.scale=c)),lj(a,!0));jj(a);f&&g&&a.cb("Initial Layout");a.Uv();
697 b||a.sc(a.Mb);e&&(a.skipsUndoManager=d);a.gc=!1}}function Gj(a){var b=a.Ga;if(a.jg!==Kh)a.scale=mj(a,a.jg);else if(a.$g!==Kh)a.scale=mj(a,a.$g);else{var c=a.initialScale;isFinite(c)&&0<c&&(a.scale=c)}a.Ga!==b&&(oj(a),pj(a,!0,!1));lj(a,!0);b=a.Ra.j;a.Td(b,b.length,a);a.U("InitialLayoutCompleted");a.ft.assign(a.ra);Ej(a)}
698 function jj(a){if((a.gc||!a.animationManager.isTicking)&&0!==a.Cd.count){for(var b=0;23>b;b++){var c=a.Cd.iterator;if(null===c||0===a.Cd.count)break;a.Cd=new I;a.lx(c,a.Cd);F&&22===b&&Ea("failure to validate parts")}a.nodes.each(function(a){a instanceof If&&0!==(a.T&65536)!==!1&&(a.T=a.T^65536)})}}
699 t.lx=function(a,b){for(a.reset();a.next();){var c=a.value;!c.Tc()||c instanceof If||(c.Dj()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof If&&c.isVisible()&&Hj(this,c);for(a.reset();a.next();)c=a.value,c instanceof S&&c.isVisible()&&(c.Dj()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof Ve&&c.isVisible()&&(c.Dj()?(c.measure(Infinity,Infinity),c.arrange()):b.add(c))};
700 function Hj(a,b){for(var c=Ma(),d=Ma(),e=b.memberParts;e.next();){var f=e.value;f.isVisible()&&(f instanceof If?(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;e<a;e++)f=c[e],f.measure(Infinity,Infinity),f.arrange();Oa(c);b.measure(Infinity,Infinity);b.arrange();a=d.length;for(b=0;b<a;b++)c=d[b],c.measure(Infinity,Infinity),c.arrange();Oa(d)}
701 t.Td=function(a,b,c,d){if(this.Ii||this.animationManager.isAnimating){void 0===d&&(d=c.viewportBounds);for(var e=0;e<b;e++)a[e].Td(c,d)}};
702 t.sc=function(a,b){void 0===b&&(b=null);if(null!==this.Ka){null===this.Da&&v("No canvas specified");var c=this.animationManager;if(!c.yc&&(!c.isAnimating||c.isTicking)){var d=new Date;Lj(this);if("0"!==this.Ka.style.opacity){var e=a!==this.Mb,f=this.Ra.j,g=f.length,h=this;this.Td(f,g,h);if(e)a.Ac(!0),ij(this);else if(!this.Jc&&null===b&&!c.isAnimating)return;g=this.ra;var k=this.Ga,l=Math.round(g.x*k)/k,m=Math.round(g.y*k)/k;c=this.xb;c.reset();1!==k&&c.scale(k);0===g.x&&0===g.y||c.translate(-l,-m);
703 k=this.Zb;a.setTransform(1,0,0,1,0,0);a.scale(k,k);a.clearRect(0,0,this.Fa,this.Ea);1!==this.nb&&(a.globalAlpha=this.nb);F&&F.Jm&&F.bw&&(a.setTransform(1,0,0,1,0,0),a.scale(k,k),a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),F.bw(this,a));Mj(this,a);l=null!==b?function(c){var d=b;if(c.visible&&0!==c.nb){var e=c.Ja.j,f=e.length;if(0!==f){var g=zi(c,a),k=c.Fp;k.length=0;for(var l=h.scale,m=L.alloc(),n=0;n<f;n++){var D=e[n];d.contains(D)||c.oj(a,D,h,k,l,m,!0)}L.free(m);a.globalAlpha=g}}}:function(b){b.sc(a,
704 h)};g=f.length;for(m=0;m<g;m++)a.setTransform(1,0,0,1,0,0),a.scale(k,k),a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy),l(f[m]);f=!1;this.Fi?Nj(this.Fi,this)&&(f=this.hs()):f=!0;f&&(Gb.prototype.Pd=Gb.prototype.py);F&&(F.Cy||F.Jm)&&F.cw&&F.cw(a,this,c);e?(this.Mb.Ac(!0),ij(this)):this.Jc=this.Ii=!1;f=+new Date-+d;e=F&&F.By;d=this.uv;if(e||null===this.Jh){d[this.rp]=f;this.rp=(this.rp+1)%d.length;for(c=f=0;c<d.length;c++)f+=d[c];this.qp=f/d.length}1!==this.nb&&(a.globalAlpha=1);if(e)for(a.setTransform(1,
705 0,0,1,0,0),e=0;e<d.length;e++)a.fillText(d[e].toString(),20,150+ +(20*e))}}}};
706 function Oj(a,b,c,d,e,f,g,h,k,l){if(null!==a.Ka){null===a.Da&&v("No canvas specified");void 0===g&&(g=null);void 0===h&&(h=null);void 0===k&&(k=!1);void 0===l&&(l=!1);Lj(a);a.Mb.Ac(!0);ij(a);a.Ji=!0;var m=a.Ga;a.Ga=e;var n=a.Ra.j,p=n.length;try{var r=new L(f.x,f.y,d.width/e,d.height/e),q=r.copy();q.Hq(c);Ej(a,q);jj(a);a.Td(n,p,a,r);b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,d.width,d.height);null!==h&&""!==h&&(b.fillStyle=h,b.fillRect(0,0,d.width,d.height));var u=a.Zb;b.scale(u,u);var y=Gb.alloc();
707 y.reset();y.translate(c.left,c.top);y.scale(e);0===f.x&&0===f.y||y.translate(-f.x,-f.y);b.setTransform(y.m11,y.m12,y.m21,y.m22,y.dx,y.dy);Gb.free(y);Mj(a,b);b.globalAlpha=a.nb;var x=a.Jk("Grid");if(g){var z=new I,B=g.iterator;for(B.reset();B.next();){var D=B.value;D instanceof U&&(l||D.layer!==x)&&z.add(D)}for(l=0;l<p;l++){var G=n[l];x=b;var M=a;if(G.visible&&0!==G.nb&&(k||!G.isTemporary)){var Y=G.Ja.j,Q=Y.length;if(0!==Q){var ca=zi(G,x),T=G.Fp;T.length=0;var P=M.scale,xa=L.alloc();for(c=0;c<Q;c++){var ka=
708 Y[c];z.contains(ka)&&G.oj(x,ka,M,T,P,xa,!1)}L.free(xa);x.globalAlpha=ca}}}}else for(z=0;z<p;z++)M=n[z],M===x?l&&M.sc(b,a,!0):M.sc(b,a,k);a.Ji=!1;a.Fi&&Nj(a.Fi,a)&&a.hs()}finally{a.Ga=m,a.Mb.Ac(!0),ij(a),a.Td(n,p,a),Ej(a)}}}t.Xe=function(a){return this.vf[a]};t.iz=function(a,b){"minDrawingLength"===a&&(this.kp=b);this.vf[a]=b;this.redraw()};
709 t.Lw=function(){this.vf=new ib;this.vf.drawShadows=!0;this.vf.textGreeking=!0;this.vf.viewportOptimizations=db||Za||$a?!1:!0;this.vf.temporaryPixelRatio=!0;this.vf.pictureRatioOptimization=!0;this.kp=this.vf.minDrawingLength=1};function Mj(a,b){a=a.vf;null!==a&&(void 0!==a.imageSmoothingEnabled&&b.hz(!!a.imageSmoothingEnabled),a=a.defaultFont,void 0!==a&&null!==a&&(b.font=a))}t.Pm=function(a){return this.Zj[a]};t.uB=function(a,b){this.Zj[a]=b};
710 t.Kw=function(){this.Zj=new ib;this.Zj.extraTouchArea=10;this.Zj.extraTouchThreshold=10;this.Zj.hasGestureZoom=!0};t.Tw=function(a){Pj(this,a)};
711 function Pj(a,b){var c=a instanceof W,d=a instanceof R,e;for(e in b){""===e&&v("Setting properties requires non-empty property names");var f=a,g=e;if(c||d){var h=e.indexOf(".");if(0<h){var k=e.substring(0,h);if(c)f=a.ib(k);else if(f=a[k],void 0===f||null===f)f=a.toolManager[k];Ga(f)?g=e.substr(h+1):v("Unable to find object named: "+k+" in "+a.toString()+" when trying to set property: "+e)}}if("_"!==g[0]&&!Ra(f,g))if(d&&"ModelChanged"===g){a.my(b[g]);continue}else if(d&&"Changed"===g){a.Sh(b[g]);continue}else if(d&&
712 Ra(a.toolManager,g))f=a.toolManager;else if(d&&Qj(a,g)){a.xk(g,b[g]);continue}else if(a instanceof X&&"Changed"===g){a.Sh(b[g]);continue}else v('Trying to set undefined property "'+g+'" on object: '+f.toString());f[g]=b[e];"_"===g[0]&&f instanceof O&&f.jy(g)}}t.Uv=function(){if(0===this.undoManager.transactionLevel&&0!==this.hh.count){for(;0<this.hh.count;){var a=this.hh;this.hh=new Bb;for(a=a.iterator;a.next();){var b=a.key;b.ar(a.value);b.jc()}}this.P()}};
713 t.P=function(a){void 0===a&&(a=null);if(null===a)this.Jc=!0,this.Jb();else{var b=this.viewportBounds;null!==a&&a.o()&&b.Sc(a)&&(this.Jc=!0,this.Jb())}this.U("InvalidateDraw")};
714 R.prototype.invalidateViewport=function(a,b){if(!0!==this.Jc){this.Jc=!0;var c=!0===this.Xe("temporaryPixelRatio");if(!0===this.Xe("viewportOptimizations")&&this.scrollMode!==mi&&this.cj.qj(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=Math.max(a.x,b.x),f=Math.max(a.y,b.y);d=L.allocAt(e,f,Math.max(0,Math.min(a.x+a.width,b.x+b.width)-e)*d,Math.max(0,Math.min(a.y+a.height,b.y+b.height)-f)*d);if(!this.tq&&0<d.width&&0<d.height){if(!(this.gc||(this.Re=!1,null===this.Ka||(this.gc=
715 !0,this.Uv(),this.documentBounds.o()||Rj(this,this.computeBounds()),e=this.Da,null===e||e instanceof Sj)))){var g=this.Zb;f=this.Fa*g;var h=this.Ea*g,k=this.scale*g,l=Math.round(Math.round(b.x*k)-Math.round(a.x*k));b=Math.round(Math.round(b.y*k)-Math.round(a.y*k));k=this.Wu;a=this.Jx;k.width!==f&&(k.width=f);k.height!==h&&(k.height=h);a.clearRect(0,0,f,h);k=190*g;var m=70*g,n=Math.max(l,0),p=Math.max(b,0),r=Math.floor(f-n),q=Math.floor(h-p);a.drawImage(e.Oa,n,p,r,q,0,0,r,q);Nj(this.Fi,this)&&a.clearRect(0,
716 0,k,m);e=Ma();a=Ma();q=Math.abs(l);r=Math.abs(b);var u=0===n?0:f-q;n=J.allocAt(u,0);q=J.allocAt(q+u,h);a.push(new L(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));var y=this.xb;y.reset();y.scale(g,g);1!==this.Ga&&y.scale(this.Ga);g=this.ra;(0!==g.x||0!==g.y)&&isFinite(g.x)&&isFinite(g.y)&&y.translate(-g.x,-g.y);Hb(n,y);Hb(q,y);e.push(new L(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));u=0===p?0:h-r;n.h(0,u);q.h(f,r+u);a.push(new L(Math.min(n.x,
717 q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));Hb(n,y);Hb(q,y);e.push(new L(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y)));Nj(this.Fi,this)&&(f=0<l?0:-l,h=0<b?0:-b,n.h(f,h),q.h(k+f,m+h),a.push(new L(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y))),Hb(n,y),Hb(q,y),e.push(new L(Math.min(n.x,q.x),Math.min(n.y,q.y),Math.abs(n.x-q.x),Math.abs(n.y-q.y))));J.free(n);J.free(q);pj(this,!1,!0);null===this.Ka&&v("No div specified");null===this.Da&&
718 v("No canvas specified");if(!this.animationManager.yc&&(f=this.Mb,this.Jc)){Lj(this);h=this.Zb;f.setTransform(1,0,0,1,0,0);f.clearRect(0,0,this.Fa*h,this.Ea*h);f.drawImage(this.Wu.Oa,0<l?0:Math.round(-l),0<b?0:Math.round(-b));b=this.ra;g=this.Ga;k=Math.round(b.x*g)/g;m=Math.round(b.y*g)/g;l=this.xb;l.reset();1!==g&&l.scale(g);0===b.x&&0===b.y||l.translate(-k,-m);f.save();f.beginPath();b=a.length;for(g=0;g<b;g++)k=a[g],0!==k.width&&0!==k.height&&f.rect(Math.floor(k.x),Math.floor(k.y),Math.ceil(k.width),
719 Math.ceil(k.height));f.clip();f.setTransform(1,0,0,1,0,0);f.scale(h,h);f.transform(l.m11,l.m12,l.m21,l.m22,l.dx,l.dy);F&&F.Jm&&F.bw&&F.bw(this,f);h=this.Ra.j;b=h.length;this.Td(h,b,this);Mj(this,f);f.globalAlpha=this.nb;for(g=0;g<b;g++)if(k=h[g],m=e,k.visible&&0!==k.nb){p=zi(k,f);n=k.Fp;n.length=0;r=this.scale;q=L.alloc();y=k.Ja.j;u=y.length;for(var x=m.length,z=0;z<u;z++){var B=y[z];a:{var D=Tj(B,B.actualBounds);for(var G=m,M=x,Y=2/r,Q=4/r,ca=0;ca<M;ca++){var T=G[ca];if(0!==T.width&&0!==T.height&&
720 D.rw(T.x-Y,T.y-Y,T.width+Q,T.height+Q)){D=!0;break a}}D=!1}D&&k.oj(f,B,this,n,r,q,!0)}L.free(q);f.globalAlpha=p}f.restore();f.Ac(!0);F&&(F.Cy||F.Jm)&&F.cw&&F.cw(f,this,l);this.Fi&&Nj(this.Fi,this)&&this.hs();this.Jc=this.Ii=!1;this.lr()}Oa(e);Oa(a);this.gc=!1}}else this.od();L.free(d);c&&(lf(this),this.od(),vf(this,!0))}else c?(lf(this),this.od(),vf(this,!0)):this.od()}};function oj(a){!1===a.Hi&&(a.Hi=!0)}function ij(a){!1===a.Ii&&(a.Ii=!0)}function Lj(a){!1!==a.Rl&&(a.Rl=!1,Uj(a,a.Fa,a.Ea))}
721 function Uj(a,b,c){var d=a.Zb;a.Da.resize(b*d,c*d,b,c)&&(a.Jc=!0,a.Mb.Ac(!0))}
722 function $i(a){var b=a.Da;if(null===b||a.Fm.o())return!0;var c=a.Ka,d=a.Fa,e=a.Ea,f=a.viewportBounds.copy();if(!f.o())return!0;var g=!1,h=a.kf?a.wb:0,k=a.ze?a.wb:0,l=c.clientWidth||d+h,m=c.clientHeight||e+k;if(l!==d+h||m!==e+k)a.kf=!1,a.ze=!1,k=h=0,a.Fa=l,a.Ea=m,g=a.Rl=!0;if(!(g||a.kf||a.ze||a.Il||a.Jl))return!0;a.Hi=!1;var n=a.viewportBounds,p=a.documentBounds,r=0,q=0,u=0,y=0;c=n.width;var x=n.height,z=a.cj;a.contentAlignment.eb()?(p.width>c&&(r=z.left,q=z.right),p.height>x&&(u=z.top,y=z.bottom)):
723 (r=z.left,q=z.right,u=z.top,y=z.bottom);z=p.width+r+q;var B=p.height+u+y;r=p.x-r;var D=n.x;q=p.right+q;var G=n.right+h;u=p.y-u;var M=n.y;p=p.bottom+y;n=n.bottom+k;var Y="1px",Q="1px";y=a.scale;l=z>l/y;m=B>m/y;a.scrollMode===ki&&(l||m)&&(l&&a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(l=1,r+1<D&&(l=Math.max((D-r)*y+a.Fa,l)),q>G+1&&(l=Math.max((q-G)*y+a.Fa,l)),c+h+1<z&&(l=Math.max((z-c)*y+a.Fa,l)),Y=l.toString()+"px"),m&&a.hasVerticalScrollbar&&a.allowVerticalScroll&&(l=1,u+1<M&&(l=Math.max((M-
724 u)*y+a.Ea,l)),p>n+1&&(l=Math.max((p-n)*y+a.Ea,l)),x+k+1<B&&(l=Math.max((B-x)*y+a.Ea,l)),Q=l.toString()+"px"));l="1px"!==Y;m="1px"!==Q;l&&m||!l&&!m||(m&&(G-=a.wb),l&&(n-=a.wb),z<c+h||!a.hasHorizontalScrollbar||!a.allowHorizontalScroll||(h=1,r+1<D&&(h=Math.max((D-r)*y+a.Fa,h)),q>G+1&&(h=Math.max((q-G)*y+a.Fa,h)),c+1<z&&(h=Math.max((z-c)*y+a.Fa,h)),Y=h.toString()+"px"),l="1px"!==Y,h=a.Ea,l!==a.ze&&(h=l?a.Ea-a.wb:a.Ea+a.wb),B<x+k||!a.hasVerticalScrollbar||!a.allowVerticalScroll||(k=1,u+1<M&&(k=Math.max((M-
725 u)*y+h,k)),p>n+1&&(k=Math.max((p-n)*y+h,k)),x+1<B&&(k=Math.max((B-x)*y+h,k)),Q=k.toString()+"px"),m="1px"!==Q);if(a.aq&&l===a.ze&&m===a.kf)return d===a.Fa&&e===a.Ea||a.od(),!1;l!==a.ze&&("1px"===Y?a.Ea=a.Ea+a.wb:a.Ea=Math.max(a.Ea-a.wb,1),g=!0);a.ze=l;a.bq.style.width=Y;m!==a.kf&&("1px"===Q?a.Fa=a.Fa+a.wb:a.Fa=Math.max(a.Fa-a.wb,1),g=!0,a.Tl&&(k=J.alloc(),m?(b.style.left=a.wb+"px",a.position=k.h(a.ra.x+a.wb/a.scale,a.ra.y)):(b.style.left="0px",a.position=k.h(a.ra.x-a.wb/a.scale,a.ra.y)),J.free(k)));
726 a.kf=m;a.bq.style.height=Q;a.ht=!0;g&&(a.Rl=!0);b=a.kt;k=b.scrollLeft;a.hasHorizontalScrollbar&&a.allowHorizontalScroll&&(c+1<z?k=(a.position.x-r)*y:r+1<D?k=b.scrollWidth-b.clientWidth:q>G+1&&(k=a.position.x*y));if(a.Tl)switch(a.et){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.hasVerticalScrollbar&&a.allowVerticalScroll&&(x+1<B?b.scrollTop=(a.position.y-u)*y:u+1<M?b.scrollTop=b.scrollHeight-b.clientHeight:p>n+1&&(b.scrollTop=
727 a.position.y*y));l=a.Fa;m=a.Ea;b.style.width=l+(a.kf?a.wb:0)+"px";b.style.height=m+(a.ze?a.wb:0)+"px";return d!==l||e!==m||a.animationManager.yc?(a.onViewportBoundsChanged(f,a.viewportBounds,y,g),!1):!0}t=R.prototype;
728 t.add=function(a){w(a,U,R,"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.Jk(a.layerName),null===b&&(b=this.Jk("")),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.zj(99999999,a,a.diagram===this);0<=c&&this.ab(Le,"parts",b,null,a,null,c);b.isTemporary||this.Ta();a.D(1);c=a.layerChanged;null!==c&&c(a,null,
729 b)}};t.zj=function(a){this.partManager.zj(a);var b=this;Vj(a,function(a){Wj(b,a)});(a instanceof Ve||a instanceof If&&null!==a.placeholder)&&a.u();null!==a.data&&Vj(a,function(a){Xj(b.partManager,a)});!0!==Jj(a)&&!0!==Kj(a)||this.Cd.add(a);Yj(a,!0,this);Zj(a)?(a.actualBounds.o()&&this.P(Tj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.o()&&this.P(Tj(a,a.actualBounds));this.Jb()};
730 t.Rc=function(a){a.Ak();this.partManager.Rc(a);var b=this;null!==a.data&&Vj(a,function(a){ak(b.partManager,a,b)});this.Cd.remove(a);Zj(a)?(a.actualBounds.o()&&this.P(Tj(a,a.actualBounds)),this.Ta()):a.isVisible()&&a.actualBounds.o()&&this.P(Tj(a,a.actualBounds));this.Jb()};t.remove=function(a){w(a,U,R,"remove:part");bk(this,a,!0)};
731 function bk(a,b,c){var d=b.layer;null!==d&&d.diagram===a&&(b.isSelected=!1,b.isHighlighted=!1,b.D(2),c&&b.Gk(),c=d.Rc(-1,b,!1),0<=c&&a.ab(Me,"parts",d,b,null,c,null),a=b.layerChanged,null!==a&&a(b,d,null))}t.tu=function(a,b){void 0===b&&(b=!1);if(Ha(a))for(var c=a.length,d=0;d<c;d++){var e=a[d];b&&!e.canDelete()||this.remove(e)}else for(c=new I,c.addAll(a),a=c.iterator;a.next();)c=a.value,b&&!c.canDelete()||this.remove(c)};t.Fk=function(a,b,c){void 0===c&&(c=!1);return this.partManager.Fk(a,b,c)};
732 R.prototype.moveParts=function(a,b,c,d){void 0===c&&(c=!1);void 0===d&&(d=ck(this));w(b,J,R,"moveParts:offset");if(null!==this.toolManager){var e=new Bb;if(null!==a)if(Ha(a))for(var f=0;f<a.length;f++)dk(this,e,a[f],c,d);else for(a=a.iterator;a.next();)dk(this,e,a.value,c,d);else{for(a=this.parts;a.next();)dk(this,e,a.value,c,d);for(a=this.nodes;a.next();)dk(this,e,a.value,c,d);for(a=this.links;a.next();)dk(this,e,a.value,c,d)}Ff(this,e,b,d,c)}};
733 function dk(a,b,c,d,e,f){if(!b.contains(c)&&(void 0===f&&(f=!1),!d||f||c.canMove()||c.canCopy()))if(void 0===e&&(e=ck(a)),c instanceof V){b.add(c,a.Jd(e,c,c.location));if(c instanceof If&&(null!==c.placeholder||e.dragsMembers))for(f=c.memberParts;f.next();)dk(a,b,f.value,d,e,e.groupsAlwaysMove);for(f=c.linksConnected;f.next();){var g=f.value;if(!b.contains(g)){var h=g.fromNode,k=g.toNode;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&dk(a,b,g,d,e)}}if(e.dragsTree)for(c=c.kw();c.next();)dk(a,b,
734 c.value,d,e)}else if(c instanceof S)for(b.add(c,a.Jd(e,c)),c=c.labelNodes;c.next();)dk(a,b,c.value,d,e);else c instanceof Ve||b.add(c,a.Jd(e,c,c.location))}
735 function Ff(a,b,c,d,e){if(null!==b&&(w(b,Bb,R,"moveParts:parts"),0!==b.count)){var f=J.alloc(),g=J.alloc();g.assign(c);isNaN(g.x)&&(g.x=0);isNaN(g.y)&&(g.y=0);(c=a.sq)||mf(a,b);for(var h=Ma(),k=Ma(),l=b.iterator,m=J.alloc();l.next();){var n=l.key,p=l.value;if(n.Tc()){var r=ek(a,n,b);if(null!==r)h.push(new fk(n,p,r));else if(!e||n.canMove())r=p.point,f.assign(r),a.computeMove(n,f.add(g),d,m),n.location=m,void 0===p.shifted&&(p.shifted=new J),p.shifted.assign(m.oe(r))}else l.key instanceof S&&k.push(l.qa)}J.free(m);
736 e=h.length;for(l=0;l<e;l++)n=h[l],f.assign(n.info.point),void 0===n.ow.shifted&&(n.ow.shifted=new J),n.node.location=f.add(n.ow.shifted);e=J.alloc();l=J.alloc();n=k.length;for(p=0;p<n;p++){var q=k[p];r=q.key;if(r instanceof S)if(r.suspendsRouting){r.wf=null;m=r.fromNode;var u=r.toNode;if(null!==a.draggedLink&&d.dragsLink)if(u=q.value.point,null===r.dragComputation)b.add(r,a.Jd(d,r,g)),Df(r,g.x-u.x,g.y-u.y);else{q=J.allocAt(0,0);(m=r.i(0))&&m.o()&&q.assign(m);var y=m=J.alloc().assign(q).add(g);d.isGridSnapEnabled&&
737 (d.isGridSnapRealtime||a.lastInput.up)&&(y=J.alloc(),Tg(a,r,m,y,d));m.assign(r.dragComputation(r,m,y)).oe(q);b.add(r,a.Jd(d,r,m));Df(r,m.x-u.x,m.y-u.y);J.free(q);J.free(m);y!==m&&J.free(y)}else null!==m&&(e.assign(m.location),y=b.J(m),null!==y&&e.oe(y.point)),null!==u&&(l.assign(u.location),y=b.J(u),null!==y&&l.oe(y.point)),null!==m&&null!==u?e.Wa(l)?(m=q.value.point,u=f,u.assign(e),u.oe(m),b.add(r,a.Jd(d,r,e)),Df(r,u.x,u.y)):(r.suspendsRouting=!1,r.Za()):(q=q.value.point,m=null!==m?e:null!==u?l:
738 g,b.add(r,a.Jd(d,r,m)),Df(r,m.x-q.x,m.y-q.y))}else if(null===r.fromNode||null===r.toNode)m=q.value.point,b.add(r,a.Jd(d,r,g)),Df(r,g.x-m.x,g.y-m.y)}J.free(f);J.free(g);J.free(e);J.free(l);Oa(h);Oa(k);c||(jj(a),rf(a,b))}}
739 R.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new J);d.assign(b);if(null===a)return d;var e=b,f=c.isGridSnapEnabled;f&&(c.isGridSnapRealtime||this.lastInput.up)&&(e=J.alloc(),Tg(this,a,b,e,c));c=null!==a.dragComputation?a.dragComputation(a,b,e):e;var g=a.minLocation,h=g.x;isNaN(h)&&(h=f?Math.round(1E3*a.location.x)/1E3:a.location.x);g=g.y;isNaN(g)&&(g=f?Math.round(1E3*a.location.y)/1E3:a.location.y);var k=a.maxLocation,l=k.x;isNaN(l)&&(l=f?Math.round(1E3*a.location.x)/1E3:a.location.x);
740 k=k.y;isNaN(k)&&(k=f?Math.round(1E3*a.location.y)/1E3:a.location.y);d.h(Math.max(h,Math.min(c.x,l)),Math.max(g,Math.min(c.y,k)));e!==b&&J.free(e);return d};function ck(a){var b=a.toolManager.findTool("Dragging");return null!==b?b.dragOptions:a.wl}
741 function Tg(a,b,c,d,e){void 0===e&&(e=ck(a));d.assign(c);if(null!==b){var f=a.grid;b=e.gridSnapCellSize;a=b.width;b=b.height;var g=e.gridSnapOrigin,h=g.x;g=g.y;e=e.gridSnapCellSpot;if(null!==f){var k=f.gridCellSize;isNaN(a)&&(a=k.width);isNaN(b)&&(b=k.height);f=f.gridOrigin;isNaN(h)&&(h=f.x);isNaN(g)&&(g=f.y)}f=J.allocAt(0,0);f.el(0,0,a,b,e);K.Tq(c.x,c.y,h+f.x,g+f.y,a,b,d);J.free(f)}}function mf(a,b){if(null!==b)for(a.sq=!0,a=b.iterator;a.next();)b=a.key,b instanceof S&&(b.suspendsRouting=!0)}
742 function rf(a,b){if(null!==b){for(b=b.iterator;b.next();){var c=b.key;c instanceof S&&(c.suspendsRouting=!1,gk(c)&&c.Za())}a.sq=!1}}function ek(a,b,c){b=b.containingGroup;if(null!==b){a=ek(a,b,c);if(null!==a)return a;a=c.J(b);if(null!==a)return a}return null}t=R.prototype;t.Jd=function(a,b,c){if(void 0===c)return new pf(Mb);var d=a.isGridSnapEnabled;a.groupsSnapMembers||null===b.containingGroup||(d=!1);return d?new pf(new J(Math.round(1E3*c.x)/1E3,Math.round(1E3*c.y)/1E3)):new pf(c.copy())};
743 function hk(a,b,c){w(b,xi,R,"addLayer:layer");null!==b.diagram&&b.diagram!==a&&v("Cannot share a Layer with another Diagram: "+b+" of "+b.diagram);null===c?null!==b.diagram&&v("Cannot add an existing Layer to this Diagram again: "+b):(w(c,xi,R,"addLayer:existingLayer"),c.diagram!==a&&v("Existing Layer must be in this Diagram: "+c+" not in "+c.diagram),b===c&&v("Cannot move a Layer before or after itself: "+b));if(b.diagram!==a){b=b.name;a=a.Ra;c=a.count;for(var d=0;d<c;d++)a.M(d).name===b&&v("Cannot add Layer with the name '"+
744 b+"'; a Layer with the same name is already present in this Diagram.")}}t.Hm=function(a){hk(this,a,null);a.me(this);var b=this.Ra,c=b.count-1;if(!a.isTemporary)for(;0<=c&&b.M(c).isTemporary;)c--;b.Bb(c+1,a);null!==this.ic&&this.ab(Le,"layers",this,null,a,null,c+1);this.P();this.Ta()};
745 t.ky=function(a,b){hk(this,a,b);a.me(this);var c=this.Ra,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ic&&this.ab(Me,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;f<e;f++)if(c.M(f)===b){c.Bb(f,a);break}null!==this.ic&&this.ab(Le,"layers",this,null,a,null,f);this.P();0>d&&this.Ta()};
746 t.Ez=function(a,b){hk(this,a,b);a.me(this);var c=this.Ra,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ic&&this.ab(Me,"layers",this,a,null,d,null));var e=c.count,f;for(f=0;f<e;f++)if(c.M(f)===b){c.Bb(f+1,a);break}null!==this.ic&&this.ab(Le,"layers",this,null,a,null,f+1);this.P();0>d&&this.Ta()};
747 t.mB=function(a){w(a,xi,R,"removeLayer:layer");a.diagram!==this&&v("Cannot remove a Layer from another Diagram: "+a+" of "+a.diagram);if(""!==a.name){var b=this.Ra,c=b.indexOf(a);if(b.remove(a)){for(b=a.Ja.copy().iterator;b.next();){var d=b.value,e=d.layerName;e!==a.name?d.layerName=e:d.layerName=""}null!==this.ic&&this.ab(Me,"layers",this,a,null,c,null);this.P();this.Ta()}}};t.Jk=function(a){for(var b=this.layers;b.next();){var c=b.value;if(c.name===a)return c}return null};
748 t.my=function(a){A(a,"function",R,"addModelChangedListener:listener");null===this.He&&(this.He=new H);this.He.add(a);this.model.Sh(a)};t.oB=function(a){A(a,"function",R,"removeModelChangedListener:listener");null!==this.He&&(this.He.remove(a),0===this.He.count&&(this.He=null));this.model.dl(a)};t.Sh=function(a){A(a,"function",R,"addChangedListener:listener");null===this.$f&&(this.$f=new H);this.$f.add(a)};
749 t.dl=function(a){A(a,"function",R,"removeChangedListener:listener");null!==this.$f&&(this.$f.remove(a),0===this.$f.count&&(this.$f=null))};t.Mt=function(a){this.skipsUndoManager||this.model.skipsUndoManager||this.model.undoManager.pw(a);a.change!==De&&(this.isModified=!0);if(null!==this.$f)for(var b=this.$f,c=b.length,d=0;d<c;d++)b.M(d)(a)};
750 t.ab=function(a,b,c,d,e,f,g){void 0===f&&(f=null);void 0===g&&(g=null);var h=new Be;h.diagram=this;h.change=a;h.propertyName=b;h.object=c;h.oldValue=d;h.oldParam=f;h.newValue=e;h.newParam=g;this.Mt(h)};t.g=function(a,b,c,d,e){this.ab(Ce,a,this,b,c,d,e)};
751 R.prototype.changeState=function(a,b){if(null!==a&&a.diagram===this){var c=this.skipsModelSourceBindings;try{this.skipsModelSourceBindings=!0;var d=a.change;if(d===Ce){var e=a.object;ik(e,a.propertyName,a.J(b));if(e instanceof O){var f=e.part;null!==f&&f.Rb()}this.isModified=!0}else if(d===Le){var g=a.object,h=a.newParam,k=a.newValue;if(g instanceof W)if("number"===typeof h&&k instanceof O){b?g.Rc(h):g.Bb(h,k);var l=g.part;null!==l&&l.Rb()}else"number"===typeof h&&k instanceof jk&&(k.isRow?kk(g,h,
752 b?void 0:k):lk(g,h,b?void 0:k));else if(g instanceof xi){var m=!0===a.oldParam;"number"===typeof h&&k instanceof U&&(b?(k.isSelected=!1,k.isHighlighted=!1,k.Rb(),g.Rc(m?h:-1,k,m)):g.zj(h,k,m))}else g instanceof R?"number"===typeof h&&k instanceof xi&&(b?this.Ra.jb(h):(k.me(this),this.Ra.Bb(h,k))):v("unknown ChangedEvent.Insert object: "+a.toString());this.isModified=!0}else if(d===Me){var n=a.object,p=a.oldParam,r=a.oldValue;if(n instanceof W)"number"===typeof p&&r instanceof O?b?n.Bb(p,r):n.Rc(p):
753 "number"===typeof p&&r instanceof jk&&(r.isRow?kk(n,p,b?r:void 0):lk(n,p,b?r:void 0));else if(n instanceof xi){var q=!0===a.newParam;"number"===typeof p&&r instanceof U&&(b?0>n.Ja.indexOf(r)&&n.zj(p,r,q):(r.isSelected=!1,r.isHighlighted=!1,r.Rb(),n.Rc(q?p:-1,r,q)))}else n instanceof R?"number"===typeof p&&r instanceof xi&&(b?(r.me(this),this.Ra.Bb(p,r)):this.Ra.jb(p)):v("unknown ChangedEvent.Remove object: "+a.toString());this.isModified=!0}else d!==De&&v("unknown ChangedEvent: "+a.toString())}finally{this.skipsModelSourceBindings=
754 c}}};R.prototype.Ca=function(a){return this.undoManager.Ca(a)};R.prototype.cb=function(a){return this.undoManager.cb(a)};R.prototype.Uf=function(){return this.undoManager.Uf()};R.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ca(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.cb(b):this.undoManager.Uf(),this.skipsUndoManager=c}};R.prototype.updateAllTargetBindings=function(a){this.partManager.updateAllTargetBindings(a)};
755 R.prototype.xr=function(){this.partManager.xr()};
756 function mk(a,b,c){var d=a.animationManager;if(a.Yb||a.gc)a.Ga=c,d.sf&&d.Xd.add(d.C,"scale",b,a.Ga);else if(null===a.Da)a.Ga=c;else{a.Yb=!0;var e=a.viewportBounds.copy(),f=a.Fa,g=a.Ea;e.width=a.Fa/b;e.height=a.Ea/b;var h=a.zoomPoint.x,k=a.zoomPoint.y,l=a.contentAlignment;isNaN(h)&&(l.Uc()?l.Qf(Rc)?h=0:l.Qf(Sc)&&(h=f-1):h=l.eb()?l.x*(f-1):f/2);isNaN(k)&&(l.Uc()?l.Qf(Pc)?k=0:l.Qf(Tc)&&(k=g-1):k=l.eb()?l.y*(g-1):g/2);null===a.scaleComputation||a.animationManager.defaultAnimation.isAnimating||(c=a.scaleComputation(a,
757 c));c<a.minScale&&(c=a.minScale);c>a.maxScale&&(c=a.maxScale);f=J.allocAt(a.ra.x+h/b-h/c,a.ra.y+k/b-k/c);a.position=f;J.free(f);a.Ga=c;a.onViewportBoundsChanged(e,a.viewportBounds,b,!1);a.Yb=!1;lj(a,!1);d.sf&&d.Xd.add(d.C,"scale",b,a.Ga);a.P();oj(a)}}
758 R.prototype.onViewportBoundsChanged=function(a,b,c,d){if(!a.A(b)){void 0===d&&(d=!1);d||oj(this);ij(this);var e=this.layout;null===e||!e.isViewportSized||this.autoScale!==Kh||d||a.width===b.width&&a.height===b.height||e.D();e=this.currentTool;!0===this.kg&&e instanceof Ta&&(this.lastInput.documentPoint=this.Bu(this.lastInput.viewPoint),Ze(e,this));this.Yb||this.invalidateViewport(a,b);Ej(this);this.Oc.scale=c;this.Oc.position.x=a.x;this.Oc.position.y=a.y;this.Oc.bounds.assign(a);this.Oc.Tv.width=
759 Math.round(a.width*c);this.Oc.Tv.height=Math.round(a.height*c);this.Oc.yw.width=this.Fa;this.Oc.yw.height=this.Ea;this.Oc.vw=d;this.U("ViewportBoundsChanged",this.Oc,a);this.isVirtualized&&this.links.each(function(a){a.isAvoiding&&a.actualBounds.Sc(b)&&a.Za()})}};
760 function Ej(a,b){void 0===b&&(b=null);var c=a.Ob;if(null!==c&&c.visible){for(var d=Fb.alloc(),e=1,f=1,g=c.$.j,h=g.length,k=0;k<h;k++){var l=g[k],m=Math.abs(l.interval);2>m||(nk(l.figure)?f=f*m/K.Jy(f,m):e=e*m/K.Jy(e,m))}g=c.gridCellSize;d.h(f*g.width,e*g.height);if(null!==b)e=b.width,f=b.height,a=b.x,g=b.y;else{b=L.alloc();a=a.viewportBounds;b.h(a.x,a.y,a.width,a.height);if(!b.o()){L.free(b);return}e=b.width;f=b.height;a=b.x;g=b.y;L.free(b)}c.width=e+2*d.width;c.height=f+2*d.height;b=J.alloc();K.Tq(a,
761 g,0,0,d.width,d.height,b);b.offset(-d.width,-d.height);Fb.free(d);c.part.location=b;J.free(b)}}R.prototype.clearSelection=function(a){void 0===a&&(a=!1);var b=this.selection;if(0!==b.count){a||this.U("ChangingSelection",b);for(var c=b.ta(),d=c.length,e=0;e<d;e++)c[e].isSelected=!1;b.ka();b.clear();b.freeze();a||this.U("ChangedSelection",b)}};
762 R.prototype.select=function(a){null!==a&&(w(a,U,R,"select:part"),a.layer.diagram===this&&(!a.isSelected||1<this.selection.count)&&(this.U("ChangingSelection",this.selection),this.clearSelection(!0),a.isSelected=!0,this.U("ChangedSelection",this.selection)))};
763 R.prototype.tB=function(a){this.U("ChangingSelection",this.selection);this.clearSelection(!0);if(Ha(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof U||v("Diagram.selectCollection given something that is not a Part: "+d);d.isSelected=!0}else for(a=a.iterator;a.next();)b=a.value,b instanceof U||v("Diagram.selectCollection given something that is not a Part: "+b),b.isSelected=!0;this.U("ChangedSelection",this.selection)};
764 R.prototype.clearHighlighteds=function(){var a=this.highlighteds;if(0<a.count){for(var b=a.ta(),c=b.length,d=0;d<c;d++)b[d].isHighlighted=!1;a.ka();a.clear();a.freeze()}};t=R.prototype;t.OA=function(a){null!==a&&a.layer.diagram===this&&(w(a,U,R,"highlight:part"),!a.isHighlighted||1<this.highlighteds.count)&&(this.clearHighlighteds(),a.isHighlighted=!0)};
765 t.PA=function(a){a=(new I).addAll(a);for(var b=this.highlighteds.copy().mr(a).iterator;b.next();)b.value.isHighlighted=!1;for(a=a.iterator;a.next();)b=a.value,b instanceof U||v("Diagram.highlightCollection given something that is not a Part: "+b),b.isHighlighted=!0};
766 t.scroll=function(a,b,c){void 0===c&&(c=1);var d="up"===b||"down"===b,e=0;if("pixel"===a)e=c;else if("line"===a)e=c*(d?this.scrollVerticalLineChange:this.scrollHorizontalLineChange);else if("page"===a)a=d?this.viewportBounds.height:this.viewportBounds.width,a*=this.scale,0!==a&&(e=c*Math.max(a-(d?this.scrollVerticalLineChange:this.scrollHorizontalLineChange),0));else{if("document"===a){e=this.documentBounds;c=this.viewportBounds;d=J.alloc();"up"===b?this.position=d.h(c.x,e.y):"left"===b?this.position=
767 d.h(e.x,c.y):"down"===b?this.position=d.h(c.x,e.bottom-c.height):"right"===b&&(this.position=d.h(e.right-c.width,c.y));J.free(d);return}v("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: "+a)}e/=this.scale;c=this.position.copy();"up"===b?c.y=this.position.y-e:"down"===b?c.y=this.position.y+e:"left"===b?c.x=this.position.x-e:"right"===b?c.x=this.position.x+e:v("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+b);this.position=c};
768 t.Ow=function(a){var b=this.viewportBounds;b.Te(a)||(a=a.center,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};t.Nt=function(a){var b=this.viewportBounds;a=a.center;a.x-=b.width/2;a.y-=b.height/2;this.position=a};t.vr=function(a){var b=this.xb;b.reset();1!==this.Ga&&b.scale(this.Ga);var c=this.ra;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.xb)};
769 t.CB=function(a){var b=this.xb,c=a.x,d=a.y,e=c+a.width,f=d+a.height,g=b.m11,h=b.m12,k=b.m21,l=b.m22,m=b.dx,n=b.dy,p=c*g+d*k+m;b=c*h+d*l+n;var r=e*g+d*k+m;a=e*h+d*l+n;d=c*g+f*k+m;c=c*h+f*l+n;g=e*g+f*k+m;e=e*h+f*l+n;f=Math.min(p,r);p=Math.max(p,r);r=Math.min(b,a);b=Math.max(b,a);f=Math.min(f,d);p=Math.max(p,d);r=Math.min(r,c);b=Math.max(b,c);f=Math.min(f,g);p=Math.max(p,g);r=Math.min(r,e);b=Math.max(b,e);return new L(f,r,p-f,b-r)};
770 t.Bu=function(a){var b=this.xb;b.reset();1!==this.Ga&&b.scale(this.Ga);var c=this.ra;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return Hb(a.copy(),this.xb)};function ok(a){var b=a.isModified;a.Mv!==b&&(a.Mv=b,a.U("Modified"))}function pk(a){a=Hi.get(a);return null!==a?new a:new Ii}
771 R.prototype.doModelChanged=function(a){var b=this;if(a.model===this.model){var c=a.change,d=a.propertyName;if(c===De&&"S"===d[0])if("StartingFirstTransaction"===d){var e=this;a=this.toolManager;a.mouseDownTools.each(function(a){a.diagram=e});a.mouseMoveTools.each(function(a){a.diagram=e});a.mouseUpTools.each(function(a){a.diagram=e});this.gc||this.Ae||(this.Tj=!0,this.Wj&&(this.Re=!0))}else"StartingUndo"===d||"StartingRedo"===d?(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&
772 a.Hc(),this.U("ChangingSelection",this.selection)):"StartedTransaction"===d&&(a=this.animationManager,a.defaultAnimation.isAnimating&&!this.skipsUndoManager&&a.Hc());else if(this.ba){this.ba=!1;try{if(""===a.modelChange&&c===De){if("FinishedUndo"===d||"FinishedRedo"===d)this.U("ChangedSelection",this.selection),jj(this);var f=this.animationManager;"RolledBackTransaction"===d&&f.Hc();this.Tj=!0;this.od();0!==this.undoManager.transactionLevel&&1!==this.undoManager.transactionLevel||Gh(f);"CommittedTransaction"===
773 d&&this.undoManager.isJustDiscarded&&(this.ce=Math.min(this.ce,this.undoManager.historyIndex-1));"CommittedTransaction"!==d&&"RolledBackTransaction"!==d||!this.undoManager.isPendingUnmodified||setTimeout(function(){b.isModified=!1},1);var g=a.isTransactionFinished;g&&(ok(this),this.ku.clear(),di(this.animationManager));if(!this.Os&&g&&this.lastInput.targetDiagram){this.Os=!0;var h=this;ta(function(){h.currentTool.standardMouseOver();h.Os=!1},10)}}}finally{this.ba=!0}}}};
774 function Wj(a,b){b=b.$.j;for(var c=b.length,d=0;d<c;d++)qk(a,b[d])}function qk(a,b){if(b instanceof rk){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){c.ih instanceof I&&c.ih.add(a);var d=b.lh;null!==d&&!0===d.ys&&null!==b.diagram&&b.diagram.im.add(b);if(c.vo)if(c=c.getAttribute("src"),d=a.Bg.J(c),null===d)d=[],d.push(b),a.Bg.add(c,d);else{for(a=0;a<d.length;a++)if(d[a]===b)return;d.push(b)}}}}
775 function sk(a,b){if(b instanceof rk){var c=b.element;if(null!==c&&c instanceof HTMLImageElement&&(c.ih instanceof I&&c.ih.remove(a),tk(c),c.vo)){c=c.getAttribute("src");var d=a.Bg.J(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&(a.Bg.remove(c),Ti(c));break}}}}R.prototype.Sd=function(){this.partManager.Sd()};R.prototype.wk=function(a,b){this.$c.wk(a,b)};R.prototype.yk=function(a,b){this.$c.yk(a,b)};R.prototype.findPartForKey=function(a){return this.partManager.findPartForKey(a)};
776 R.prototype.Hb=function(a){return this.partManager.Hb(a)};R.prototype.findLinkForKey=function(a){return this.partManager.findLinkForKey(a)};t=R.prototype;t.Fc=function(a){return this.partManager.Fc(a)};t.rj=function(a){return this.partManager.rj(a)};t.Ec=function(a){return this.partManager.Ec(a)};t.Vt=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];return this.partManager.Vt.apply(this.partManager,b instanceof Array?b:da(ba(b)))};
777 t.Ut=function(a){for(var b=[],c=0;c<arguments.length;++c)b[c]=arguments[c];return this.partManager.Ut.apply(this.partManager,b instanceof Array?b:da(ba(b)))};function Rj(a,b){a.Gi=!1;var c=a.eo;c.A(b)||(b=b.K(),a.eo=b,lj(a,!1),a.U("DocumentBoundsChanged",null,c.copy()),oj(a))}t.Ya=function(){this.Gi&&Rj(this,this.computeBounds())};t.xA=function(){for(var a=new I,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&a.add(c)}for(b=this.links;b.next();)c=b.value,c.isTopLevel&&a.add(c);return a.iterator};
778 t.wA=function(){return this.Oh.iterator};t.YA=function(a){jj(this);a&&uk(this,!0);this.gc?Fj(this,!1):(this.Tj=!0,Rf(this))};function uk(a,b){for(var c=a.Oh.iterator;c.next();)vk(a,c.value,b);null!==a.layout&&(b?a.layout.isValidLayout=!1:a.layout.D())}function vk(a,b,c){if(null!==b){for(var d=b.em.iterator;d.next();)vk(a,d.value,c);null!==b.layout&&(c?b.layout.isValidLayout=!1:b.layout.D())}}
779 function Fj(a,b){if(a.Zg&&!a.bs){var c=a.ba;a.ba=!0;var d=a.undoManager.transactionLevel,e=a.layout,f=a.animationManager;try{0===d&&(a.undoManager.isInternalTransaction=!0,a.Ca("Layout"));1>=d&&!f.defaultAnimation.isAnimating&&!f.yc&&(b||Eh(f,"Layout"));a.Zg=!1;for(var g=a.Oh.iterator;g.next();)wk(a,g.value,b,d);e.isValidLayout||(!b||e.isRealtime||null===e.isRealtime||0===d?(e.doLayout(a),jj(a),e.isValidLayout=!0):a.Zg=!0)}finally{b=a.undoManager.isInternalTransaction,0===d&&(a.cb("Layout"),a.undoManager.isInternalTransaction=
780 !1),!b||0!==d&&1!==d||Gh(f),a.ba=c}}}function wk(a,b,c,d){if(null!==b){for(var e=b.em.iterator;e.next();)wk(a,e.value,c,d);e=b.layout;null===e||e.isValidLayout||(!c||e.isRealtime||0===d?(b.bi=!b.location.o(),e.doLayout(b),b.D(32),Hj(a,b),e.isValidLayout=!0):a.Zg=!0)}}t.DA=function(){for(var a=new H,b=this.nodes;b.next();){var c=b.value;c.isTopLevel&&null===c.uj()&&a.add(c)}return a.iterator};
781 function Fi(a){function b(a){var b=a.toLowerCase(),e=new H;c.add(a,e);c.add(b,e);d.add(a,a);d.add(b,a)}var c=new Bb,d=new Bb;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");
782 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.es=c;a.ds=d}
783 function Qj(a,b){var c=a.ds.J(b);return null!==c?c:a.ds.J(b.toLowerCase())}function xk(a,b){var c=a.es.J(b);if(null!==c)return c;c=a.es.J(b.toLowerCase());if(null!==c)return c;v("Unknown DiagramEvent name: "+b)}t.xk=function(a,b){A(a,"string",R,"addDiagramListener:name");A(b,"function",R,"addDiagramListener:listener");a=xk(this,a);null!==a&&a.add(b)};t.Zm=function(a,b){A(a,"string",R,"removeDiagramListener:name");A(b,"function",R,"addDiagramListener:listener");a=xk(this,a);null!==a&&a.remove(b)};
784 t.U=function(a,b,c){F&&A(a,"string",R,"raiseDiagramEvent:name");var d=xk(this,a),e=new Ae;e.diagram=this;a=Qj(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.M(0)(e);else if(0!==b)for(d=d.ta(),c=0;c<b;c++)(0,d[c])(e)};function yk(a){if(a.animationManager.isTicking)return!1;var b=a.currentTool;return b===a.toolManager.findTool("Dragging")?!a.sq||b.isComplexRoutingRealtime:!0}
785 t.Pk=function(a,b){void 0===b&&(b=null);return zk(this,!1,null,b).Pk(a.x,a.y,a.width,a.height)};R.prototype.computeOccupiedArea=function(){return this.isVirtualized?this.viewportBounds.copy():this.Gi?kj(this):this.documentBounds.copy()};
786 function zk(a,b,c,d){null===a.Mc&&(a.Mc=new Hk);if(a.Mc.du||a.Mc.group!==c||a.Mc.kz!==d){null!==c&&(c=Lk(a,c));if(null===c){b=a.computeOccupiedArea();b.Pc(100,100);a.Mc.initialize(b);b=L.alloc();for(var e=a.nodes;e.next();){var f=e.value,g=f.layer;null!==g&&g.visible&&!g.isTemporary&&Mk(a,f,d,b)}L.free(b)}else{0<c.memberParts.count&&(b=a.computePartsBounds(c.memberParts,!1),b.Pc(20,20),a.Mc.initialize(b));b=L.alloc();for(e=c.memberParts;e.next();)f=e.value,f instanceof V&&Mk(a,f,d,b);L.free(b)}a.Mc.group=
787 c;a.Mc.kz=d;a.Mc.du=!1}else b&&Nk(a.Mc);return a.Mc}function Lk(a,b){return b.avoidable&&!b.isLinkLabel?b:null!==b.containingGroup?Lk(a,b.containingGroup):null}
788 function Mk(a,b,c,d){if(b!==c&&b.isVisible())if(b.avoidable&&!b.isLinkLabel){b=b.getAvoidableRect(d);a=a.Mc;var e=b.x,f=b.y;if(Ok(a,e,f))for(c=(f-a.Hd)/a.mc|0,d=Math.min((e+b.width-a.Gd)/a.lc|0,a.jj),b=Math.min((f+b.height-a.Hd)/a.mc|0,a.kj),e=(e-a.Gd)/a.lc|0;e<=d;e++)if(f=a.Xb[e],f.fill)f.fill(Pk,c,b+1);else for(var g=c;g<=b;g++)f[g]=Pk}else if(b instanceof If)for(b=b.memberParts;b.next();)e=b.value,e instanceof V&&Mk(a,e,c,d)}
789 function Qk(a,b){null!==a.Mc&&!a.Mc.du&&(void 0===b&&(b=null),null===b||b.avoidable&&!b.isLinkLabel)&&(a.Mc.du=!0)}R.prototype.Rt=function(a){this.En.assign(a);this.computeAutoScrollPosition(this.En).Wa(this.position)?this.Vf():Rk(this)};
790 function Rk(a){-1===a.Nj&&(a.Nj=ta(function(){if(-1!==a.Nj&&(a.Vf(),null!==a.lastInput.event)){var b=a.computeAutoScrollPosition(a.En);b.Wa(a.position)||(a.position=b,a.lastInput.documentPoint=a.Bu(a.En),a.doMouseMove(),a.Gi=!0,Rj(a,a.documentBounds.copy().Xc(a.computeBounds())),a.Jc=!0,a.od(),Rk(a))}},a.Dn))}R.prototype.Vf=function(){-1!==this.Nj&&(qa.clearTimeout(this.Nj),this.Nj=-1)};
791 R.prototype.computeAutoScrollPosition=function(a){var b=this.position,c=this.Fn;if(0>=c.top&&0>=c.left&&0>=c.right&&0>=c.bottom)return b;var d=this.viewportBounds,e=this.scale;d=L.allocAt(0,0,d.width*e,d.height*e);var f=J.allocAt(0,0);if(a.x>=d.x&&a.x<d.x+c.left&&this.allowHorizontalScroll){var g=Math.max(this.scrollHorizontalLineChange,1);g|=0;f.x-=g;a.x<d.x+c.left/2&&(f.x-=g);a.x<d.x+c.left/4&&(f.x-=4*g)}else a.x<=d.x+d.width&&a.x>d.x+d.width-c.right&&this.allowHorizontalScroll&&(g=Math.max(this.scrollHorizontalLineChange,
792 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.y<d.y+c.top&&this.allowVerticalScroll?(g=Math.max(this.scrollVerticalLineChange,1),g|=0,f.y-=g,a.y<d.y+c.top/2&&(f.y-=g),a.y<d.y+c.top/4&&(f.y-=4*g)):a.y<=d.y+d.height&&a.y>d.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.Wa(Mb)||(b=new J(b.x+f.x/e,b.y+f.y/e));
793 L.free(d);J.free(f);return b};t=R.prototype;t.mu=function(){return null};t.ww=function(){return null};t.Iz=function(a,b){this.Yx.add(a,b)};
794 function Sk(a,b,c){function d(){var a=+new Date;f=!0;for(g.reset();g.next();)if(!g.value[0].am){f=!1;break}f||a-l>k?b(c,e,h):qa.requestAnimationFrame(d)}for(var e=c.callback,f=!0,g=a.Bg.iterator;g.next();)if(!g.value[0].am){f=!1;break}if("function"!==typeof e||f)return b(c,e,a);var h=a,k=c.callbackTimeout||300,l=+new Date;qa.requestAnimationFrame(function(){d()});return null}t.$A=function(a){if(!gh)return null;void 0===a&&(a=new ib);a.returnType="Image";return this.Xy(a)};
795 t.Xy=function(a){void 0===a&&(a=new ib);return Sk(this,this.aB,a)};
796 t.aB=function(a,b,c){var d=Tk(c,a,"canvas",null);if(null===d)return null;c=d.aa.canvas;var e=null;if(null!==c)switch(e=a.returnType,void 0===e?e="string":e=e.toLowerCase(),e){case Uk+"data":e=d.getImageData(0,0,c.width,c.height);break;case Uk: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"===
797 typeof c.toBlob)return c.toBlob(b,a.type,a.details),"toBlob";if("function"===typeof c.msToBlob)return b(c.msToBlob()),"msToBlob";b(null);return null;default:e=c.toDataURL(a.type,a.details)}return"function"===typeof b?(b(e),null):e};
798 function Tk(a,b,c,d){a.animationManager.Hc();a.od();if(null===a.Da)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 Fb(Infinity,Infinity):new Fb(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 r=b.document||document,q=b.elementFinished||
799 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 hc(m):m instanceof hc||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.Mb.Ac(!0);p=new Vk(null,r);var y=p.context;if(!(f||g||l||k)){p.width=a.Fa+Math.ceil(m.left+m.right);p.height=a.Ea+Math.ceil(m.top+m.bottom);if("SVG"===c){if(null===
800 d)return null;d.resize(p.width,p.height,p.width,p.height);d.ownerDocument=r;d.Qq=q;Oj(a,d.context,m,new Fb(p.width,p.height),a.Ga,a.ra,l,n,u,b);return d.context}a.Dl=!1;Oj(a,y,m,new Fb(p.width,p.height),a.Ga,a.ra,l,n,u,b);a.Dl=!0;return p.context}var x=a.co,z=a.documentBounds.copy();z.Xw(a.ob);if(u)for(var B=a.Ra.j,D=B.length,G=0;G<D;G++){var M=B[G];if(M.visible&&M.isTemporary){M=M.Ja.j;for(var Y=M.length,Q=0;Q<Y;Q++){var ca=M[Q];ca.isInDocumentBounds&&ca.isVisible()&&(ca=ca.actualBounds,ca.o()&&
801 z.Xc(ca))}}}B=new J(z.x,z.y);if(null!==l){D=!0;G=l.iterator;for(G.reset();G.next();)if(M=G.value,M instanceof U&&(Y=M.layer,(null===Y||Y.visible)&&(null===Y||u||!Y.isTemporary)&&M.isVisible()&&(M=M.actualBounds,M.o())))if(D){D=!1;var T=M.copy()}else T.Xc(M);D&&(T=new L(0,0,0,0));z.width=T.width;z.height=T.height;B.x=T.x;B.y=T.y}null!==k&&k.o()&&(B=k,g||(g=x));T=k=0;null!==m&&(k=m.left+m.right,T=m.top+m.bottom);D=G=0;null!==f&&(G=f.width,D=f.height,isFinite(G)&&(G=Math.max(0,G-k)),isFinite(D)&&(D=
802 Math.max(0,D-T)));null!==f&&null!==g?("NaN"===g&&(g=x),f.o()?(f=G,z=D):isNaN(D)?(f=G,z=z.height*g):(f=z.width*g,z=D)):null!==f?f.o()?(g=Math.min(G/z.width,D/z.height),f=G,z=D):isNaN(D)?(g=G/z.width,f=G,z=z.height*g):(g=D/z.height,f=z.width*g,z=D):null!==g?"NaN"===g&&h.o()?(g=Math.min((h.width-k)/z.width,(h.height-T)/z.height),g>x?(g=x,f=z.width,z=z.height):(f=h.width,z=h.height)):(f=z.width*g,z=z.height*g):(g=x,f=z.width,z=z.height);null!==m?(f+=k,z+=T):m=new hc(0);null!==h&&(x=h.width,h=h.height,
803 "SVG"!==c&&e&&!Wk&&F&&(f>x||z>h)&&(Ea("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."),Wk=!0),isNaN(x)&&(x=2E3),isNaN(h)&&(h=2E3),isFinite(x)&&(f=Math.min(f,x)),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=r;d.Qq=q;Oj(a,d.context,m,new Fb(Math.ceil(f),
804 Math.ceil(z)),g,B,l,n,u,b);return d.context}a.Dl=!1;Oj(a,y,m,new Fb(Math.ceil(f),Math.ceil(z)),g,B,l,n,u,b);a.Dl=!0;return p.context}
805 na.Object.defineProperties(R.prototype,{div:{configurable:!0,get:function(){return this.Ka},set:function(a){null!==a&&w(a,HTMLDivElement,R,"div");if(this.Ka!==a){var b=this.Ka;null!==b?(b.C=void 0,b.goDiagram=void 0,b.innerHTML="",null!==this.Da&&(b=this.Da.Oa,this.Lj?(this.removeEventListener(b,"pointermove",this.$k,!1),this.removeEventListener(b,"pointerdown",this.Zk,!1),this.removeEventListener(b,"pointerup",this.bl,!1),this.removeEventListener(b,"pointerout",this.al,!1)):(this.removeEventListener(b,
806 "touchstart",this.bx,!1),this.removeEventListener(b,"touchmove",this.ax,!1),this.removeEventListener(b,"touchend",this.$w,!1)),this.Da.zy()),this.lm&&(this.lm.disconnect(),this.lm=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.Mb=this.Da=null,this.removeEventListener(qa,"resize",this.mx,!1),
807 this.Lj||(this.removeEventListener(qa,"mousemove",this.Tk,!0),this.removeEventListener(qa,"mousedown",this.Sk,!0),this.removeEventListener(qa,"mouseup",this.Vk,!0),this.removeEventListener(qa,"mouseout",this.Uk,!0)),this.removeEventListener(qa,"wheel",this.Wk,!0),Re===this&&(Re=null)):this.Ae=!1;this.Ka=null;if(null!==a){if(b=a.C)b.div=null;Pi(this,a);this.redraw()}}}},oy:{configurable:!0,get:function(){return this.qp}},Bj:{configurable:!0,get:function(){return this.Ae}},
808 draggedLink:{configurable:!0,get:function(){return this.gs},set:function(a){this.gs!==a&&(this.gs=a,null!==a&&(this.Ss=a.fromPort,this.Ts=a.toPort))}},$y:{configurable:!0,get:function(){return this.Ss},set:function(a){this.Ss=a}},az:{configurable:!0,get:function(){return this.Ts},set:function(a){this.Ts=a}},animationManager:{configurable:!0,get:function(){return this.$c}},undoManager:{configurable:!0,get:function(){return this.ic.undoManager}},
809 skipsUndoManager:{configurable:!0,get:function(){return this.Hg},set:function(a){A(a,"boolean",R,"skipsUndoManager");this.Hg=a;this.ic.skipsUndoManager=a}},delaysLayout:{configurable:!0,get:function(){return this.bs},set:function(a){this.bs=a}},opacity:{configurable:!0,get:function(){return this.nb},set:function(a){var b=this.nb;b!==a&&(A(a,"number",R,"opacity"),(0>a||1<a)&&za(a,"0 <= value <= 1",R,"opacity"),this.nb=a,this.g("opacity",b,a),this.P())}},validCycle:{configurable:!0,
810 enumerable:!0,get:function(){return this.Gt},set:function(a){var b=this.Gt;b!==a&&(gb(a,R,R,"validCycle"),this.Gt=a,this.g("validCycle",b,a))}},layers:{configurable:!0,get:function(){return this.Ra.iterator}},isModelReadOnly:{configurable:!0,get:function(){var a=this.ic;return null===a?!1:a.isReadOnly},set:function(a){var b=this.ic;null!==b&&(b.isReadOnly=a)}},isReadOnly:{configurable:!0,get:function(){return this.lg},set:function(a){var b=this.lg;b!==a&&
811 (A(a,"boolean",R,"isReadOnly"),this.lg=a,this.g("isReadOnly",b,a))}},isEnabled:{configurable:!0,get:function(){return this.sd},set:function(a){var b=this.sd;b!==a&&(A(a,"boolean",R,"isEnabled"),this.sd=a,this.g("isEnabled",b,a))}},allowClipboard:{configurable:!0,get:function(){return this.Cr},set:function(a){var b=this.Cr;b!==a&&(A(a,"boolean",R,"allowClipboard"),this.Cr=a,this.g("allowClipboard",b,a))}},allowCopy:{configurable:!0,get:function(){return this.ki},
812 set:function(a){var b=this.ki;b!==a&&(A(a,"boolean",R,"allowCopy"),this.ki=a,this.g("allowCopy",b,a))}},allowDelete:{configurable:!0,get:function(){return this.li},set:function(a){var b=this.li;b!==a&&(A(a,"boolean",R,"allowDelete"),this.li=a,this.g("allowDelete",b,a))}},allowDragOut:{configurable:!0,get:function(){return this.Dr},set:function(a){var b=this.Dr;b!==a&&(A(a,"boolean",R,"allowDragOut"),this.Dr=a,this.g("allowDragOut",b,a))}},allowDrop:{configurable:!0,
813 get:function(){return this.Er},set:function(a){var b=this.Er;b!==a&&(A(a,"boolean",R,"allowDrop"),this.Er=a,this.g("allowDrop",b,a))}},allowTextEdit:{configurable:!0,get:function(){return this.vi},set:function(a){var b=this.vi;b!==a&&(A(a,"boolean",R,"allowTextEdit"),this.vi=a,this.g("allowTextEdit",b,a))}},allowGroup:{configurable:!0,get:function(){return this.mi},set:function(a){var b=this.mi;b!==a&&(A(a,"boolean",R,"allowGroup"),this.mi=a,this.g("allowGroup",b,a))}},
814 allowUngroup:{configurable:!0,get:function(){return this.wi},set:function(a){var b=this.wi;b!==a&&(A(a,"boolean",R,"allowUngroup"),this.wi=a,this.g("allowUngroup",b,a))}},allowInsert:{configurable:!0,get:function(){return this.Gr},set:function(a){var b=this.Gr;b!==a&&(A(a,"boolean",R,"allowInsert"),this.Gr=a,this.g("allowInsert",b,a))}},allowLink:{configurable:!0,get:function(){return this.ni},set:function(a){var b=this.ni;b!==a&&(A(a,"boolean",R,"allowLink"),
815 this.ni=a,this.g("allowLink",b,a))}},allowRelink:{configurable:!0,get:function(){return this.pi},set:function(a){var b=this.pi;b!==a&&(A(a,"boolean",R,"allowRelink"),this.pi=a,this.g("allowRelink",b,a))}},allowMove:{configurable:!0,get:function(){return this.oi},set:function(a){var b=this.oi;b!==a&&(A(a,"boolean",R,"allowMove"),this.oi=a,this.g("allowMove",b,a))}},allowReshape:{configurable:!0,get:function(){return this.ri},set:function(a){var b=this.ri;b!==
816 a&&(A(a,"boolean",R,"allowReshape"),this.ri=a,this.g("allowReshape",b,a))}},allowResize:{configurable:!0,get:function(){return this.si},set:function(a){var b=this.si;b!==a&&(A(a,"boolean",R,"allowResize"),this.si=a,this.g("allowResize",b,a))}},allowRotate:{configurable:!0,get:function(){return this.ti},set:function(a){var b=this.ti;b!==a&&(A(a,"boolean",R,"allowRotate"),this.ti=a,this.g("allowRotate",b,a))}},allowSelect:{configurable:!0,get:function(){return this.ui},
817 set:function(a){var b=this.ui;b!==a&&(A(a,"boolean",R,"allowSelect"),this.ui=a,this.g("allowSelect",b,a))}},allowUndo:{configurable:!0,get:function(){return this.Hr},set:function(a){var b=this.Hr;b!==a&&(A(a,"boolean",R,"allowUndo"),this.Hr=a,this.g("allowUndo",b,a))}},allowZoom:{configurable:!0,get:function(){return this.Jr},set:function(a){var b=this.Jr;b!==a&&(A(a,"boolean",R,"allowZoom"),this.Jr=a,this.g("allowZoom",b,a))}},hasVerticalScrollbar:{configurable:!0,
818 get:function(){return this.Jl},set:function(a){var b=this.Jl;b!==a&&(A(a,"boolean",R,"hasVerticalScrollbar"),this.Jl=a,oj(this),this.P(),this.g("hasVerticalScrollbar",b,a),lj(this,!1))}},hasHorizontalScrollbar:{configurable:!0,get:function(){return this.Il},set:function(a){var b=this.Il;b!==a&&(A(a,"boolean",R,"hasHorizontalScrollbar"),this.Il=a,oj(this),this.P(),this.g("hasHorizontalScrollbar",b,a),lj(this,!1))}},allowHorizontalScroll:{configurable:!0,get:function(){return this.Fr},
819 set:function(a){var b=this.Fr;b!==a&&(A(a,"boolean",R,"allowHorizontalScroll"),this.Fr=a,this.g("allowHorizontalScroll",b,a),lj(this,!1))}},allowVerticalScroll:{configurable:!0,get:function(){return this.Ir},set:function(a){var b=this.Ir;b!==a&&(A(a,"boolean",R,"allowVerticalScroll"),this.Ir=a,this.g("allowVerticalScroll",b,a),lj(this,!1))}},scrollHorizontalLineChange:{configurable:!0,get:function(){return this.it},set:function(a){var b=this.it;b!==a&&(A(a,"number",R,"scrollHorizontalLineChange"),
820 0>a&&za(a,">= 0",R,"scrollHorizontalLineChange"),this.it=a,this.g("scrollHorizontalLineChange",b,a))}},scrollVerticalLineChange:{configurable:!0,get:function(){return this.mt},set:function(a){var b=this.mt;b!==a&&(A(a,"number",R,"scrollVerticalLineChange"),0>a&&za(a,">= 0",R,"scrollVerticalLineChange"),this.mt=a,this.g("scrollVerticalLineChange",b,a))}},lastInput:{configurable:!0,get:function(){return this.th},set:function(a){F&&w(a,ye,R,"lastInput");this.th=a}},previousInput:{configurable:!0,
821 enumerable:!0,get:function(){return this.ud},set:function(a){F&&w(a,ye,R,"previousInput");this.ud=a}},firstInput:{configurable:!0,get:function(){return this.hg},set:function(a){F&&w(a,ye,R,"firstInput");this.hg=a}},currentCursor:{configurable:!0,get:function(){return this.Vr},set:function(a){""===a&&(a=this.bo);if(this.Vr!==a){A(a,"string",R,"currentCursor");var b=this.Da,c=this.Ka;if(null!==b){this.Vr=a;var d=b.style.cursor;b.style.cursor=a;c.style.cursor=a;b.style.cursor===
822 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.bo},set:function(a){""===a&&(a="auto");var b=this.bo;b!==a&&(A(a,"string",R,"defaultCursor"),this.bo=a,this.g("defaultCursor",b,a))}},click:{configurable:!0,get:function(){return this.ag},set:function(a){var b=this.ag;b!==
823 a&&(null!==a&&A(a,"function",R,"click"),this.ag=a,this.g("click",b,a))}},doubleClick:{configurable:!0,get:function(){return this.fg},set:function(a){var b=this.fg;b!==a&&(null!==a&&A(a,"function",R,"doubleClick"),this.fg=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return this.bg},set:function(a){var b=this.bg;b!==a&&(null!==a&&A(a,"function",R,"contextClick"),this.bg=a,this.g("contextClick",b,a))}},mouseOver:{configurable:!0,
824 get:function(){return this.xg},set:function(a){var b=this.xg;b!==a&&(null!==a&&A(a,"function",R,"mouseOver"),this.xg=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return this.vg},set:function(a){var b=this.vg;b!==a&&(null!==a&&A(a,"function",R,"mouseHover"),this.vg=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return this.ug},set:function(a){var b=this.ug;b!==a&&(null!==a&&A(a,"function",R,"mouseHold"),this.ug=a,this.g("mouseHold",
825 b,a))}},mouseDragOver:{configurable:!0,get:function(){return this.Ns},set:function(a){var b=this.Ns;b!==a&&(null!==a&&A(a,"function",R,"mouseDragOver"),this.Ns=a,this.g("mouseDragOver",b,a))}},mouseDrop:{configurable:!0,get:function(){return this.sg},set:function(a){var b=this.sg;b!==a&&(F&&null!==a&&A(a,"function",R,"mouseDrop"),this.sg=a,this.g("mouseDrop",b,a))}},handlesDragDropForTopLevelParts:{configurable:!0,get:function(){return this.qs},set:function(a){var b=
826 this.qs;b!==a&&(A(a,"boolean",R,"handlesDragDropForTopLevelParts"),this.qs=a,this.g("handlesDragDropForTopLevelParts",b,a))}},mouseEnter:{configurable:!0,get:function(){return this.tg},set:function(a){var b=this.tg;b!==a&&(null!==a&&A(a,"function",R,"mouseEnter"),this.tg=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return this.wg},set:function(a){var b=this.wg;b!==a&&(null!==a&&A(a,"function",R,"mouseLeave"),this.wg=a,this.g("mouseLeave",b,a))}},
827 toolTip:{configurable:!0,get:function(){return this.Ig},set:function(a){var b=this.Ig;b!==a&&(!F||null===a||a instanceof Ve||a instanceof ef||v("Diagram.toolTip must be an Adornment or HTMLInfo."),this.Ig=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return this.cg},set:function(a){var b=this.cg;b!==a&&(!F||a instanceof Ve||a instanceof ef||v("Diagram.contextMenu must be an Adornment or HTMLInfo."),this.cg=a,this.g("contextMenu",b,a))}},commandHandler:{configurable:!0,
828 enumerable:!0,get:function(){return this.Pr},set:function(a){this.Pr!==a&&(this.Pr=a,a.me(this))}},toolManager:{configurable:!0,get:function(){return this.Ct},set:function(a){this.Ct!==a&&(w(a,Ta,R,"toolManager"),this.Ct=a,a.diagram=this)}},defaultTool:{configurable:!0,get:function(){return this.$r},set:function(a){var b=this.$r;b!==a&&(w(a,Qe,R,"defaultTool"),this.$r=a,a.diagram=this,this.currentTool===b&&(this.currentTool=a))}},currentTool:{configurable:!0,
829 get:function(){return this.Xr},set:function(a){var b=this.Xr;null!==b&&(b.isActive&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.defaultTool);null!==a&&(w(a,Qe,R,"currentTool"),this.Xr=a,a.diagram=this,a.doStart())}},selection:{configurable:!0,get:function(){return this.Dv}},maxSelectionCount:{configurable:!0,get:function(){return this.Js},set:function(a){var b=this.Js;if(b!==a)if(A(a,"number",R,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Js=a,this.g("maxSelectionCount",
830 b,a),!this.undoManager.isUndoingRedoing&&(a=this.selection.count-a,0<a)){this.U("ChangingSelection",this.selection);b=this.selection.ta();for(var c=0;c<a;c++)b[c].isSelected=!1;this.U("ChangedSelection",this.selection)}}else za(a,">= 0",R,"maxSelectionCount")}},nodeSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.yp},set:function(a){var b=this.yp;b!==a&&(w(a,Ve,R,"nodeSelectionAdornmentTemplate"),this.yp=a,this.g("nodeSelectionAdornmentTemplate",b,a))}},groupSelectionAdornmentTemplate:{configurable:!0,
831 enumerable:!0,get:function(){return this.Do},set:function(a){var b=this.Do;b!==a&&(w(a,Ve,R,"groupSelectionAdornmentTemplate"),this.Do=a,this.g("groupSelectionAdornmentTemplate",b,a))}},linkSelectionAdornmentTemplate:{configurable:!0,get:function(){return this.Yo},set:function(a){var b=this.Yo;b!==a&&(w(a,Ve,R,"linkSelectionAdornmentTemplate"),this.Yo=a,this.g("linkSelectionAdornmentTemplate",b,a))}},highlighteds:{configurable:!0,get:function(){return this.ev}},isModified:{configurable:!0,
832 enumerable:!0,get:function(){var a=this.undoManager;return a.isEnabled?null!==a.currentTransaction?!0:this.Jo&&this.ce!==a.historyIndex:this.Jo},set:function(a){if(this.Jo!==a){A(a,"boolean",R,"isModified");this.Jo=a;var b=this.undoManager;!a&&b.isEnabled&&(this.ce=b.historyIndex);a||ok(this)}}},model:{configurable:!0,get:function(){return this.ic},set:function(a){var b=this.ic;if(b!==a){w(a,X,R,"model");this.currentTool.doCancel();null!==b&&b.undoManager!==a.undoManager&&b.undoManager.isInTransaction&&
833 v("Do not replace a Diagram.model while a transaction is in progress.");this.animationManager.Hc(!0);var c=Si(this,!0);this.Ae=!1;this.Wj=!0;this.ce=-2;this.Re=!1;var d=this.gc;this.gc=!0;Eh(this.animationManager,"Model");null!==b&&(null!==this.He&&this.He.each(function(a){b.dl(a)}),b.dl(this.Zc));this.ic=a;this.partManager=pk(this.ic.type);for(var e=0;e<c.length;e++)this.add(c[e]);a.Sh(this.Ic);this.partManager.addAllModeledParts();a.dl(this.Ic);a.Sh(this.Zc);null!==this.He&&this.He.each(function(b){a.Sh(b)});
834 this.gc=d;this.Ta();this.Yb||this.P();null!==b&&a.undoManager.copyProperties(b.undoManager)}}},ba:{configurable:!0,get:function(){return this.nv},set:function(a){this.nv=a}},ku:{configurable:!0,get:function(){return this.Px}},skipsModelSourceBindings:{configurable:!0,get:function(){return this.Ev},set:function(a){this.Ev=a}},zu:{configurable:!0,get:function(){return this.tt},set:function(a){this.tt=a}},nodeTemplate:{configurable:!0,
835 get:function(){return this.rf.J("")},set:function(a){var b=this.rf.J("");b!==a&&(w(a,U,R,"nodeTemplate"),this.rf.add("",a),this.g("nodeTemplate",b,a),this.undoManager.isUndoingRedoing||this.Sd())}},nodeTemplateMap:{configurable:!0,get:function(){return this.rf},set:function(a){var b=this.rf;b!==a&&(w(a,Bb,R,"nodeTemplateMap"),this.rf=a,this.g("nodeTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.Sd())}},groupTemplate:{configurable:!0,get:function(){return this.rh.J("")},
836 set:function(a){var b=this.rh.J("");b!==a&&(w(a,If,R,"groupTemplate"),this.rh.add("",a),this.g("groupTemplate",b,a),this.undoManager.isUndoingRedoing||this.Sd())}},groupTemplateMap:{configurable:!0,get:function(){return this.rh},set:function(a){var b=this.rh;b!==a&&(w(a,Bb,R,"groupTemplateMap"),this.rh=a,this.g("groupTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.Sd())}},linkTemplate:{configurable:!0,get:function(){return this.ng.J("")},set:function(a){var b=
837 this.ng.J("");b!==a&&(w(a,S,R,"linkTemplate"),this.ng.add("",a),this.g("linkTemplate",b,a),this.undoManager.isUndoingRedoing||this.Sd())}},linkTemplateMap:{configurable:!0,get:function(){return this.ng},set:function(a){var b=this.ng;b!==a&&(w(a,Bb,R,"linkTemplateMap"),this.ng=a,this.g("linkTemplateMap",b,a),this.undoManager.isUndoingRedoing||this.Sd())}},isMouseCaptured:{configurable:!0,get:function(){return this.jv},set:function(a){var b=this.Da;null!==b&&(b=b.Oa,b instanceof
838 SVGElement||(a?(this.lastInput.bubbles=!1,this.Lj?(this.removeEventListener(b,"pointermove",this.$k,!1),this.removeEventListener(b,"pointerdown",this.Zk,!1),this.removeEventListener(b,"pointerup",this.bl,!1),this.removeEventListener(b,"pointerout",this.al,!1),this.addEventListener(qa,"pointermove",this.$k,!0),this.addEventListener(qa,"pointerdown",this.Zk,!0),this.addEventListener(qa,"pointerup",this.bl,!0),this.addEventListener(qa,"pointerout",this.al,!0)):(this.removeEventListener(b,"mousemove",
839 this.Tk,!1),this.removeEventListener(b,"mousedown",this.Sk,!1),this.removeEventListener(b,"mouseup",this.Vk,!1),this.removeEventListener(b,"mouseout",this.Uk,!1),this.addEventListener(qa,"mousemove",this.Tk,!0),this.addEventListener(qa,"mousedown",this.Sk,!0),this.addEventListener(qa,"mouseup",this.Vk,!0),this.addEventListener(qa,"mouseout",this.Uk,!0)),this.removeEventListener(b,"wheel",this.Wk,!1),this.addEventListener(qa,"wheel",this.Wk,!0),this.addEventListener(qa,"selectstart",this.preventDefault,
840 !1)):(this.Lj?(this.removeEventListener(qa,"pointermove",this.$k,!0),this.removeEventListener(qa,"pointerdown",this.Zk,!0),this.removeEventListener(qa,"pointerup",this.bl,!0),this.removeEventListener(qa,"pointerout",this.al,!0),this.addEventListener(b,"pointermove",this.$k,!1),this.addEventListener(b,"pointerdown",this.Zk,!1),this.addEventListener(b,"pointerup",this.bl,!1),this.addEventListener(b,"pointerout",this.al,!1)):(this.removeEventListener(qa,"mousemove",this.Tk,!0),this.removeEventListener(qa,
841 "mousedown",this.Sk,!0),this.removeEventListener(qa,"mouseup",this.Vk,!0),this.removeEventListener(qa,"mouseout",this.Uk,!0),this.addEventListener(b,"mousemove",this.Tk,!1),this.addEventListener(b,"mousedown",this.Sk,!1),this.addEventListener(b,"mouseup",this.Vk,!1),this.addEventListener(b,"mouseout",this.Uk,!1)),this.removeEventListener(qa,"wheel",this.Wk,!0),this.removeEventListener(qa,"selectstart",this.preventDefault,!1),this.addEventListener(b,"wheel",this.Wk,!1)),this.jv=a))}},position:{configurable:!0,
842 enumerable:!0,get:function(){return this.ra},set:function(a){var b=J.alloc().assign(this.ra);if(!b.A(a)){w(a,J,R,"position");var c=this.viewportBounds.copy();this.ra.assign(a);gi(this.animationManager,b,this.ra);this.Yb||null===this.Da&&!this.Fm.o()||(this.Yb=!0,a=this.scale,nj(this,this.eo,this.Fa/a,this.Ea/a,this.Pj,!1),this.Yb=!1);if(!this.Yb)this.onViewportBoundsChanged(c,this.viewportBounds,this.Ga,!1)}J.free(b)}},initialPosition:{configurable:!0,get:function(){return this.ss},
843 set:function(a){this.ss.A(a)||(w(a,J,R,"initialPosition"),this.ss=a.K())}},initialScale:{configurable:!0,get:function(){return this.ts},set:function(a){this.ts!==a&&(A(a,"number",R,"initialScale"),this.ts=a)}},grid:{configurable:!0,get:function(){null===this.Ob&&Yi(this);return this.Ob},set:function(a){var b=this.Ob;if(b!==a){null===b&&(Yi(this),b=this.Ob);w(a,W,R,"grid");a.type!==W.Grid&&v("Diagram.grid must be a Panel of type Panel.Grid");var c=b.panel;null!==c&&c.remove(b);
844 this.Ob=a;a.name="GRID";null!==c&&c.add(a);Ej(this);this.P();this.g("grid",b,a)}}},viewportBounds:{configurable:!0,get:function(){var a=this.hy,b=this.ra,c=this.Ga;a.h(b.x,b.y,Math.max(this.Fa,0)/c,Math.max(this.Ea,0)/c);return a}},viewSize:{configurable:!0,get:function(){return this.Fm},set:function(a){var b=this.viewSize;b.A(a)||(w(a,Fb,R,"viewSize"),this.Fm=a=a.K(),this.Fa=a.width,this.Ea=a.height,this.Ta(),this.g("viewSize",b,a))}},fixedBounds:{configurable:!0,
845 get:function(){return this.ns},set:function(a){var b=this.ns;b.A(a)||(w(a,L,R,"fixedBounds"),(F&&Infinity===a.width||-Infinity===a.width||Infinity===a.height||-Infinity===a.height)&&v("fixedBounds width/height must not be Infinity"),this.ns=a=a.K(),this.Ta(),this.g("fixedBounds",b,a))}},scrollMargin:{configurable:!0,get:function(){return this.cj},set:function(a){"number"===typeof a?a=new hc(a):w(a,hc,R,"scrollMargin");var b=this.cj;b.A(a)||(this.cj=a=a.K(),this.g("scrollMargin",b,a),
846 this.lr())}},scrollMode:{configurable:!0,get:function(){return this.dj},set:function(a){var b=this.dj;b!==a&&(gb(a,R,R,"scrollMode"),this.dj=a,a===ki&&lj(this,!1),this.g("scrollMode",b,a),this.P())}},scrollsPageOnFocus:{configurable:!0,get:function(){return this.nt},set:function(a){var b=this.nt;b!==a&&(A(a,"boolean",R,"scrollsPageOnFocus"),this.nt=a,this.g("scrollsPageOnFocus",b,a))}},positionComputation:{configurable:!0,get:function(){return this.$s},set:function(a){var b=
847 this.$s;b!==a&&(null!==a&&A(a,"function",R,"positionComputation"),this.$s=a,lj(this,!1),this.g("positionComputation",b,a))}},scaleComputation:{configurable:!0,get:function(){return this.gt},set:function(a){var b=this.gt;b!==a&&(null!==a&&A(a,"function",R,"scaleComputation"),this.gt=a,mk(this,this.scale,this.scale),this.g("scaleComputation",b,a))}},documentBounds:{configurable:!0,get:function(){return this.eo}},isVirtualized:{configurable:!0,get:function(){return this.Es},
848 set:function(a){var b=this.Es;b!==a&&(A(a,"boolean",R,"isVirtualized"),this.Es=a,this.g("isVirtualized",b,a))}},scale:{configurable:!0,get:function(){return this.Ga},set:function(a){var b=this.Ga;C(a,R,"scale");b!==a&&mk(this,b,a)}},defaultScale:{configurable:!0,get:function(){return this.co},set:function(a){F&&C(a,R,"defaultScale");!F||0<a||v("defaultScale must be larger than zero, not: "+a);this.co=a}},autoScale:{configurable:!0,get:function(){return this.$g},
849 set:function(a){var b=this.$g;b!==a&&(gb(a,R,R,"autoScale"),this.$g=a,this.g("autoScale",b,a),a!==Kh&&lj(this,!1))}},initialAutoScale:{configurable:!0,get:function(){return this.jg},set:function(a){var b=this.jg;b!==a&&(gb(a,R,R,"initialAutoScale"),this.jg=a,this.g("initialAutoScale",b,a))}},initialViewportSpot:{configurable:!0,get:function(){return this.us},set:function(a){var b=this.us;b!==a&&(w(a,N,R,"initialViewportSpot"),a.eb()||v("initialViewportSpot must be a specific Spot: "+
850 a),this.us=a,this.g("initialViewportSpot",b,a))}},initialDocumentSpot:{configurable:!0,get:function(){return this.rs},set:function(a){var b=this.rs;b!==a&&(w(a,N,R,"initialDocumentSpot"),a.eb()||v("initialViewportSpot must be a specific Spot: "+a),this.rs=a,this.g("initialDocumentSpot",b,a))}},minScale:{configurable:!0,get:function(){return this.Ks},set:function(a){C(a,R,"minScale");var b=this.Ks;b!==a&&(0<a?(this.Ks=a,this.g("minScale",b,a),a>this.scale&&(this.scale=a)):
851 za(a,"> 0",R,"minScale"))}},maxScale:{configurable:!0,get:function(){return this.Is},set:function(a){C(a,R,"maxScale");var b=this.Is;b!==a&&(0<a?(this.Is=a,this.g("maxScale",b,a),a<this.scale&&(this.scale=a)):za(a,"> 0",R,"maxScale"))}},zoomPoint:{configurable:!0,get:function(){return this.Kt},set:function(a){this.Kt.A(a)||(w(a,J,R,"zoomPoint"),this.Kt=a=a.K())}},contentAlignment:{configurable:!0,get:function(){return this.Pj},set:function(a){var b=this.Pj;
852 b.A(a)||(w(a,N,R,"contentAlignment"),this.Pj=a=a.K(),this.g("contentAlignment",b,a),lj(this,!1))}},initialContentAlignment:{configurable:!0,get:function(){return this.Go},set:function(a){var b=this.Go;b.A(a)||(w(a,N,R,"initialContentAlignment"),this.Go=a=a.K(),this.g("initialContentAlignment",b,a))}},padding:{configurable:!0,get:function(){return this.ob},set:function(a){"number"===typeof a?a=new hc(a):w(a,hc,R,"padding");var b=this.ob;b.A(a)||(this.ob=a=a.K(),this.Ta(),
853 this.g("padding",b,a))}},partManager:{configurable:!0,get:function(){return this.Qa},set:function(a){var b=this.Qa;b!==a&&(w(a,Ii,R,"partManager"),null!==a.diagram&&v("Cannot share PartManagers between Diagrams: "+a.toString()),null!==b&&b.me(null),this.Qa=a,a.me(this))}},nodes:{configurable:!0,get:function(){return this.partManager.nodes.iterator}},links:{configurable:!0,get:function(){return this.partManager.links.iterator}},parts:{configurable:!0,
854 get:function(){return this.partManager.parts.iterator}},layout:{configurable:!0,get:function(){return this.qc},set:function(a){var b=this.qc;b!==a&&(w(a,Ni,R,"layout"),this.qc=a,a.diagram=this,a.group=null,this.Zg=!0,this.g("layout",b,a),this.Jb())}},isTreePathToChildren:{configurable:!0,get:function(){return this.Ds},set:function(a){var b=this.Ds;if(b!==a&&(A(a,"boolean",R,"isTreePathToChildren"),this.Ds=a,this.g("isTreePathToChildren",b,a),!this.undoManager.isUndoingRedoing))for(a=
855 this.nodes;a.next();)Xk(a.value)}},treeCollapsePolicy:{configurable:!0,get:function(){return this.Et},set:function(a){var b=this.Et;b!==a&&(a!==Gi&&a!==Yk&&a!==Zk&&v("Unknown Diagram.treeCollapsePolicy: "+a),this.Et=a,this.g("treeCollapsePolicy",b,a))}},Ye:{configurable:!0,get:function(){return this.gv},set:function(a){this.gv=a}},autoScrollInterval:{configurable:!0,get:function(){return this.Dn},set:function(a){var b=this.Dn;C(a,R,"scale");b!==a&&(this.Dn=
856 a,this.g("autoScrollInterval",b,a))}},autoScrollRegion:{configurable:!0,get:function(){return this.Fn},set:function(a){"number"===typeof a?a=new hc(a):w(a,hc,R,"autoScrollRegion");var b=this.Fn;b.A(a)||(this.Fn=a=a.K(),this.Ta(),this.g("autoScrollRegion",b,a))}}});na.Object.defineProperties(R,{licenseKey:{configurable:!0,get:function(){return $k.cc()},set:function(a){$k.add(a)}},version:{configurable:!0,get:function(){return al}}});
857 R.prototype.makeImageData=R.prototype.Xy;R.prototype.makeImage=R.prototype.$A;R.prototype.addRenderer=R.prototype.Iz;R.prototype.makeSVG=R.prototype.ww;R.prototype.makeSvg=R.prototype.mu;R.prototype.stopAutoScroll=R.prototype.Vf;R.prototype.doAutoScroll=R.prototype.Rt;R.prototype.isUnoccupied=R.prototype.Pk;R.prototype.raiseDiagramEvent=R.prototype.U;R.prototype.removeDiagramListener=R.prototype.Zm;R.prototype.addDiagramListener=R.prototype.xk;R.prototype.findTreeRoots=R.prototype.DA;
858 R.prototype.layoutDiagram=R.prototype.YA;R.prototype.findTopLevelGroups=R.prototype.wA;R.prototype.findTopLevelNodesAndLinks=R.prototype.xA;R.prototype.ensureBounds=R.prototype.Ya;R.prototype.findLinksByExample=R.prototype.Ut;R.prototype.findNodesByExample=R.prototype.Vt;R.prototype.findLinkForData=R.prototype.Ec;R.prototype.findNodeForData=R.prototype.rj;R.prototype.findPartForData=R.prototype.Fc;R.prototype.findLinkForKey=R.prototype.findLinkForKey;R.prototype.findNodeForKey=R.prototype.Hb;
859 R.prototype.findPartForKey=R.prototype.findPartForKey;R.prototype.rebuildParts=R.prototype.Sd;R.prototype.transformViewToDoc=R.prototype.Bu;R.prototype.transformRectDocToView=R.prototype.CB;R.prototype.transformDocToView=R.prototype.vr;R.prototype.centerRect=R.prototype.Nt;R.prototype.scrollToRect=R.prototype.Ow;R.prototype.scroll=R.prototype.scroll;R.prototype.highlightCollection=R.prototype.PA;R.prototype.highlight=R.prototype.OA;R.prototype.selectCollection=R.prototype.tB;R.prototype.select=R.prototype.select;
860 R.prototype.updateAllRelationshipsFromData=R.prototype.xr;R.prototype.updateAllTargetBindings=R.prototype.updateAllTargetBindings;R.prototype.commit=R.prototype.commit;R.prototype.rollbackTransaction=R.prototype.Uf;R.prototype.commitTransaction=R.prototype.cb;R.prototype.startTransaction=R.prototype.Ca;R.prototype.raiseChanged=R.prototype.g;R.prototype.raiseChangedEvent=R.prototype.ab;R.prototype.removeChangedListener=R.prototype.dl;R.prototype.addChangedListener=R.prototype.Sh;
861 R.prototype.removeModelChangedListener=R.prototype.oB;R.prototype.addModelChangedListener=R.prototype.my;R.prototype.findLayer=R.prototype.Jk;R.prototype.removeLayer=R.prototype.mB;R.prototype.addLayerAfter=R.prototype.Ez;R.prototype.addLayerBefore=R.prototype.ky;R.prototype.addLayer=R.prototype.Hm;R.prototype.moveParts=R.prototype.moveParts;R.prototype.copyParts=R.prototype.Fk;R.prototype.removeParts=R.prototype.tu;R.prototype.remove=R.prototype.remove;R.prototype.add=R.prototype.add;
862 R.prototype.clearDelayedGeometries=R.prototype.Uv;R.prototype.setProperties=R.prototype.Tw;R.prototype.resetInputOptions=R.prototype.Kw;R.prototype.setInputOption=R.prototype.uB;R.prototype.getInputOption=R.prototype.Pm;R.prototype.resetRenderingHints=R.prototype.Lw;R.prototype.setRenderingHint=R.prototype.iz;R.prototype.getRenderingHint=R.prototype.Xe;R.prototype.maybeUpdate=R.prototype.od;R.prototype.requestUpdate=R.prototype.Jb;R.prototype.delayInitialization=R.prototype.$z;
863 R.prototype.isUpdateRequested=R.prototype.UA;R.prototype.invalidateDocumentBounds=R.prototype.Ta;R.prototype.findObjectsNear=R.prototype.Qg;R.prototype.findPartsNear=R.prototype.tA;R.prototype.findObjectsIn=R.prototype.Lf;R.prototype.findPartsIn=R.prototype.Iy;R.prototype.findObjectsAt=R.prototype.sj;R.prototype.findPartsAt=R.prototype.sA;R.prototype.findObjectAt=R.prototype.ac;R.prototype.findPartAt=R.prototype.Nm;R.prototype.focusObject=R.prototype.EA;R.prototype.alignDocument=R.prototype.Kz;
864 R.prototype.zoomToRect=R.prototype.GB;R.prototype.zoomToFit=R.prototype.zoomToFit;R.prototype.diagramScroll=R.prototype.xy;R.prototype.focus=R.prototype.focus;R.useDOM=function(a){gh=a?void 0!==qa.document:!1};R.isUsingDOM=function(){return gh};
865 var Re=null,Hi=new Bb,Wi=null,Vi=null,gh=void 0!==qa.document,Qi=null,Ri="",Kh=new E(R,"None",0),qj=new E(R,"Uniform",1),rj=new E(R,"UniformToFill",2),Zf=new E(R,"CycleAll",10),cg=new E(R,"CycleNotDirected",11),eg=new E(R,"CycleNotDirectedFast",12),fg=new E(R,"CycleNotUndirected",13),$f=new E(R,"CycleDestinationTree",14),bg=new E(R,"CycleSourceTree",15),ki=new E(R,"DocumentScroll",1),mi=new E(R,"InfiniteScroll",2),Gi=new E(R,"TreeParentCollapsed",21),Yk=new E(R,"AllParentsCollapsed",22),Zk=new E(R,
866 "AnyParentsCollapsed",23),$k=new H,al="2.1.53",Uk="image",Wk=!1,bl=null,Di=!1;
867 function Ei(){if(gh){var a=qa.document.createElement("canvas"),b=a.getContext("2d"),c=Va("7ca11abfd022028846");b[c]=Va("398c3597c01238");for(var d=["5da73c80a36455d5038e4972187c3cae51fd22",ra.Dx+"4ae6247590da4bb21c324ba3a84e385776",Gb.xF+"fb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387",K.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])Gb.prototype.Pd=Gb.prototype.py;
868 bl=a}}R.className="Diagram";R.fromDiv=function(a){var b=a;"string"===typeof a&&(b=qa.document.getElementById(a));return b instanceof HTMLDivElement&&b.C instanceof R?b.C:null};R.inherit=function(a,b){function c(){}if(Object.getPrototypeOf(a).prototype)throw Error("Used go.Diagram.inherit defining already defined class \n"+a);A(a,"function",R,"inherit");A(b,"function",R,"inherit");c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a};R.None=Kh;R.Uniform=qj;R.UniformToFill=rj;
869 R.CycleAll=Zf;R.CycleNotDirected=cg;R.CycleNotDirectedFast=eg;R.CycleNotUndirected=fg;R.CycleDestinationTree=$f;R.CycleSourceTree=bg;R.DocumentScroll=ki;R.InfiniteScroll=mi;R.TreeParentCollapsed=Gi;R.AllParentsCollapsed=Yk;R.AnyParentsCollapsed=Zk;function Oi(){this.Az=null;this.l="zz@orderNum";"63ad05bbe23a1786468a4c741b6d2"===this._tk?this.gf=this.l=!0:this.gf=null}
870 function Nj(a,b){b.Mb.setTransform(b.Zb,0,0,b.Zb,0,0);if(null===a.gf)a:{b="f";var c=qa[Va("76a715b2f73f148a")][Va("72ba13b5")];a.gf=!0;if(gh){var d=R[Va("76a115b6ed251eaf4692")];if(d)for(var e=$k.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(ra[Va("6cae19")]).split(".");if(f[0]>g[0]||f[0]===g[0]&&f[1]>=g[1]){f=c[Va("76ad18b4f73e")];for(g=c[Va("73a612b6fb191d")](Va("35e7"))+2;g<f;g++)b+=c[g];f=b[Va("73a612b6fb191d")](Va(d[2]));
871 0>f&&Va(d[2])!==Va("7da71ca0ad381e90")&&(f=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>f&&(f=b[Va("73a612b6fb191d")](Va("76a715b2ef3e149757")));0>f&&(f=c[Va("73a612b6fb191d")](Va("7baa19a6f76c1988428554")));a.gf=!(0<=f&&f<b[Va("73a612b6fb191d")](Va("35"))||-1===b[Va("73a612b6fb191d")](Va("35")));if(!a.gf)break;f=Va(d[2]);if("#"===f[0]){g=qa.document.createElement("div");for(var h=d[0].replace(/[A-Za-z]/g,"");4>h.length;)h+="9";h=h.substr(h.length-4);d="";d+=["gsh","gsf"][parseInt(h.substr(0,
872 1),10)%2];d+=["Header","Background","Display","Feedback"][parseInt(h.substr(0,1),10)%4];g[Va("79a417a0f0181a8946")]=d;if(qa.document[Va("78a712aa")]){if(qa.document[Va("78a712aa")][Va("7bb806b6ed32388c4a875b")](g),h=qa.getComputedStyle(g).getPropertyValue(Va("78a704b7e62456904c9b12701b6532a8")),qa.document[Va("78a712aa")][Va("68ad1bbcf533388c4a875b")](g),h)if(-1!==h.indexOf(parseInt(f[1]+f[2],16))&&-1!==h.indexOf(parseInt(f[3]+f[4],16))){a.gf=!1;break}else if(Wa||Za||$a||ab)for(d="."+d,f=0;f<document.styleSheets.length;f++){g=
873 document.styleSheets[f].rules||document.styleSheets[f].cssRules;for(var k in g)if(d===g[k].selectorText){a.gf=!1;break a}}}else a.gf=null,a.gf=!1}}}else{k=c[Va("76ad18b4f73e")];for(e=c[Va("73a612b6fb191d")](Va("35e7"))+2;e<k;e++)b+=c[e];c=b[Va("73a612b6fb191d")](Va("7da71ca0ad381e90"));a.gf=!(0<=c&&c<b[Va("73a612b6fb191d")](Va("35")))}}}return 0<a.gf&&a!==a.Az?!0:!1}
874 function Pi(a,b){if(gh){void 0!==b&&null!==b||v("Diagram setup requires an argument DIV.");null!==a.Ka&&v("Diagram has already completed setup.");"string"===typeof b?a.Ka=qa.document.getElementById(b):b instanceof HTMLDivElement?a.Ka=b:v("No DIV or DIV id supplied: "+b);null===a.Ka&&v("Invalid DIV id; could not get element with id: "+b);void 0!==a.Ka.C&&v("Invalid div id; div already has a Diagram associated with it.");if(!a.lm&&qa.ResizeObserver){var c=sa(function(){a.Jb()},250);a.lm=new qa.ResizeObserver(function(){c()});
875 a.lm.observe(a.Ka)}"static"===qa.getComputedStyle(a.Ka,null).position&&(a.Ka.style.position="relative");b=5;var d="rgba(2"+b+"5, 255, 255, 0)";b--;a.Ka.style["-webkit-tap-highlight-color"]=d;a.Ka.style["-ms-touch-action"]="none";a.Ka.innerHTML="";a.Ka.C=a;a.Ka.goDiagram=a;a.Ka.go=qa.go;var e=a.tq?new Sj(a):new Vk(a);void 0!==e.style&&(e.style.position="absolute",e.style.top="0px",e.style.left="0px","rtl"===qa.getComputedStyle(a.Ka,null).getPropertyValue("direction")&&(a.Tl=!0),e.style.zIndex="2",
876 e.style.userSelect="none",e.style.MozUserSelect="none");a.Da=e;a.Mb=e.context;d=a.Mb;a.Zb=a.computePixelRatio();a.viewSize.o()||(a.Fa=a.Ka.clientWidth||1,a.Ea=a.Ka.clientHeight||1);Uj(a,a.Fa,a.Ea);a.Ka.insertBefore(e.Oa,a.Ka.firstChild);e=new Vk(null);e.width=1;e.height=1;a.Wu=e;a.Jx=e.context;if(gh){e=ua("div");var f=ua("div");e.style.position="absolute";e.style.overflow="auto";e.style.width=a.Fa+"px";e.style.height=a.Ea+"px";e.style.zIndex="1";f.style.position="absolute";f.style.width="1px";f.style.height=
877 "1px";a.Ka.appendChild(e);e.appendChild(f);e.onscroll=Zi;e.addEventListener("mousedown",hj);e.addEventListener("touchstart",hj,{passive:!0});e.C=a;e.yz=!0;e.zz=!0;a.kt=e;a.bq=f}a.lr=sa(function(){a.Jh=null;a.P()},300);a.mx=sa(function(){Lh(a)},250);a.preventDefault=function(a){a.preventDefault();return!1};a.Tk=function(b){if(a.isEnabled){a.kg=!0;var c=vj(a,b,!0);a.doMouseMove();a.currentTool.isBeyondDragSize()&&(a.Dd=0);Bj(a,c,b)}};a.Sk=function(b){if(a.isEnabled)if(a.kg=!0,a.Be)b.preventDefault();
878 else{var c=vj(a,b,!0);c.down=!0;c.clickCount=b.detail;if(Za||$a)b.timeStamp-a.dk<a.Dt&&!a.currentTool.isBeyondDragSize()?a.Dd++:a.Dd=1,a.dk=b.timeStamp,c.clickCount=a.Dd;c.clone(a.firstInput);a.doMouseDown();1===b.button?b.preventDefault():Bj(a,c,b)}};a.Vk=function(b){if(a.isEnabled)if(a.Be&&2===b.button)b.preventDefault();else if(a.Be&&0===b.button&&(a.Be=!1),a.uk)b.preventDefault();else{a.kg=!0;var c=vj(a,b,!0);c.up=!0;c.clickCount=b.detail;if(Za||$a)c.clickCount=a.Dd;c.bubbles=b.bubbles;c.targetDiagram=
879 xj(b);a.doMouseUp();a.Vf();Bj(a,c,b)}};a.Wk=function(b){if(a.isEnabled){var c=vj(a,b,!0);c.bubbles=!0;var d=0,e=0;c.delta=0;void 0!==b.deltaX?(0!==b.deltaX&&(d=0<b.deltaX?1:-1),0!==b.deltaY&&(e=0<b.deltaY?1:-1),c.delta=Math.abs(b.deltaX)>Math.abs(b.deltaY)?-d:-e):void 0!==b.wheelDeltaX?(0!==b.wheelDeltaX&&(d=0<b.wheelDeltaX?-1:1),0!==b.wheelDeltaY&&(e=0<b.wheelDeltaY?-1:1),c.delta=Math.abs(b.wheelDeltaX)>Math.abs(b.wheelDeltaY)?-d:-e):void 0!==b.wheelDelta&&0!==b.wheelDelta&&(c.delta=0<b.wheelDelta?
880 1:-1);a.doMouseWheel();Bj(a,c,b)}};a.Uk=function(b){a.isEnabled&&(a.kg=!1,vj(a,b,!0),b=a.currentTool,b.cancelWaitAfter(),b.standardMouseOver())};a.bx=function(b){if(a.isEnabled){a.uk=!1;a.Be=!0;var c=yj(a,b,b.targetTouches[0],1<b.touches.length),d=null;0<b.targetTouches.length?d=b.targetTouches[0]:0<b.changedTouches.length&&(d=b.changedTouches[0]);if(null!==d){var e=d.screenX;d=d.screenY;var f=a.To;b.timeStamp-a.dk<a.Dt&&!(25<Math.abs(f.x-e)||25<Math.abs(f.y-d))?a.Dd++:a.Dd=1;c.clickCount=a.Dd;a.dk=
881 b.timeStamp;a.To.h(e,d)}a.doMouseDown();Bj(a,c,b)}};a.ax=function(b){if(a.isEnabled){var c=null;0<b.targetTouches.length?c=b.targetTouches[0]:0<b.changedTouches.length&&(c=b.changedTouches[0]);c=Aj(a,b,c,1<b.touches.length);a.doMouseMove();Bj(a,c,b)}};a.$w=function(b){if(a.isEnabled)if(a.uk)b.preventDefault();else if(!(1<b.touches.length)){var c=null,d=null;0<b.targetTouches.length?d=b.targetTouches[0]:0<b.changedTouches.length&&(d=b.changedTouches[0]);var e=zj(a,b,!1,!0,!1,!1);null!==d&&(c=qa.document.elementFromPoint(d.clientX,
882 d.clientY),null!==c&&void 0!==c.shadowRoot&&null!==c&&null!==c.shadowRoot&&(c=c.shadowRoot.elementFromPoint(d.clientX,d.clientY)),null!==c&&c.C instanceof R&&c.C!==a&&wj(c.C,d,e),wj(a,d,e),e.clickCount=a.Dd);null===c?e.targetDiagram=xj(b):c.C?e.targetDiagram=c.C:e.targetDiagram=null;e.targetObject=null;a.doMouseUp();Bj(a,e,b);a.Be=!1}};a.Zk=function(b){if(a.isEnabled){a.kg=!0;var c=a.Ys;void 0===c[b.pointerId]&&(c[b.pointerId]=b);c=a.nk;var d=!1;if(null!==c[0]&&c[0].pointerId===b.pointerId)c[0]=b;
883 else if(null!==c[1]&&c[1].pointerId===b.pointerId)c[1]=b,d=!0;else if(null===c[0])c[0]=b;else if(null===c[1])c[1]=b,d=!0;else{b.preventDefault();return}if("touch"===b.pointerType||"pen"===b.pointerType)a.uk=!1,a.Be=!0;c=yj(a,b,b,d);d=a.To;var e="touch"===b.pointerType||"pen"===b.pointerType?25:10;b.timeStamp-a.dk<a.Dt&&!(Math.abs(d.x-b.screenX)>e||Math.abs(d.y-b.screenY)>e)?a.Dd++:a.Dd=1;c.clickCount=a.Dd;a.dk=b.timeStamp;a.To.Ug(b.screenX,b.screenY);a.doMouseDown();1===b.button?b.preventDefault():
884 Bj(a,c,b)}};a.$k=function(b){if(a.isEnabled){a.kg=!0;var c=a.nk;if(null!==c[0]&&c[0].pointerId===b.pointerId)c[0]=b;else{if(null!==c[1]&&c[1].pointerId===b.pointerId){c[1]=b;return}if(null===c[0])c[0]=b;else return}c[0].pointerId===b.pointerId&&(c=Aj(a,b,b,null!==c[1]),c.targetDiagram=xj(b),a.doMouseMove(),Bj(a,c,b))}};a.bl=function(b){if(a.isEnabled){a.kg=!0;var c="touch"===b.pointerType||"pen"===b.pointerType,d=a.Ys;if(c&&a.uk)delete d[b.pointerId],b.preventDefault();else if(d=a.nk,null!==d[0]&&
885 d[0].pointerId===b.pointerId){d[0]=null;d=zj(a,b,!1,!0,!0,!1);var e=qa.document.elementFromPoint(b.clientX,b.clientY);null!==e&&e.C instanceof R&&e.C!==a&&wj(e.C,b,d);wj(a,b,d);d.clickCount=a.Dd;null===e?d.targetDiagram=xj(b):e.C?d.targetDiagram=e.C:d.targetDiagram=null;d.targetObject=null;a.doMouseUp();Bj(a,d,b);c&&(a.Be=!1)}else null!==d[1]&&d[1].pointerId===b.pointerId&&(d[1]=null)}};a.al=function(b){if(a.isEnabled){a.kg=!1;var c=a.Ys;c[b.pointerId]&&delete c[b.pointerId];c=a.nk;null!==c[0]&&c[0].pointerId===
886 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.hs=d.aa["d"+cl[1]+cl[2]+"wI"+Uk.slice(1,5)]["b"+dl.slice(1,b)](d.aa,bl,b,b);d.Ac(!0);Xi(a)}}Oi.className="DiagramHelper";function pf(a){this.l=void 0===a?new J:a;this.w=new J}
887 na.Object.defineProperties(pf.prototype,{point:{configurable:!0,get:function(){return this.l},set:function(a){this.l=a}},shifted:{configurable:!0,get:function(){return this.w},set:function(a){this.w=a}}});var cl="DraggingInfo";pf.className="DraggingInfo";function fk(a,b,c){this.node=a;this.info=b;this.ow=c}fk.className="DraggingNodeInfoPair";function hf(){this.reset()}
888 hf.prototype.reset=function(){this.isGridSnapEnabled=!1;this.isGridSnapRealtime=!0;this.gridSnapCellSize=(new Fb(NaN,NaN)).freeze();this.gridSnapCellSpot=Ec;this.gridSnapOrigin=(new J(NaN,NaN)).freeze();this.groupsSnapMembers=this.dragsTree=this.dragsLink=!1;this.dragsMembers=this.groupsAlwaysMove=!0};hf.className="DraggingOptions";function el(a){1<arguments.length&&v("Palette constructor can only take one optional argument, the DIV HTML element or its id.");R.call(this,a);fl(this)}ma(el,R);
889 function fl(a){a.allowDragOut=!0;a.allowMove=!1;a.isReadOnly=!0;a.contentAlignment=Fc;a.layout=new gl}el.prototype.reset=function(){R.prototype.reset.call(this);fl(this)};el.className="Palette";
890 function hl(a){1<arguments.length&&v("Overview constructor can only take one optional argument, the DIV HTML element or its id.");R.call(this,a);var b=this;this.animationManager.isEnabled=!1;this.Yb=!0;this.Pa=null;this.Jl=this.Il=!1;this.L=this.W=!0;this.kb=0;this.w=!1;this.sm=null;this.iz("drawShadows",!1);var c=new U,d=new Uf;d.stroke="magenta";d.strokeWidth=2;d.fill="transparent";d.name="BOXSHAPE";c.selectable=!0;c.selectionAdorned=!1;c.selectionObjectName="BOXSHAPE";c.locationObjectName="BOXSHAPE";
891 c.resizeObjectName="BOXSHAPE";c.cursor="move";c.add(d);this.l=c;this.allowDelete=this.allowCopy=!1;this.allowSelect=!0;this.autoScrollRegion=new hc(0,0,0,0);this.ra.h(0,0);this.toolManager.fb("Dragging",new il,this.toolManager.mouseMoveTools);this.click=function(){var a=b.observed;if(null!==a){var c=a.viewportBounds,d=b.lastInput.documentPoint;a.position=new J(d.x-c.width/2,d.y-c.height/2)}};this.hi=function(){b.Ta();jl(b)};this.gi=function(){null!==b.observed&&(b.Ta(),b.P())};this.Yc=function(){1>
892 b.updateDelay?b.P():b.w||(b.w=!0,setTimeout(function(){return b.redraw()},b.updateDelay))};this.Ud=function(){null!==b.observed&&jl(b)};this.autoScale=qj;this.Yb=!1}ma(hl,R);hl.prototype.computePixelRatio=function(){return 1};
893 hl.prototype.redraw=function(){if(this.w&&1<=this.updateDelay){this.w=!1;var a=this.Da,b=this.Mb;if(null!==a&&null!==b){Lj(this);if(null===this.sm){var c=new Vk(null);c.width=a.width;c.height=a.height;this.sm=c}try{this.Da=this.sm,this.Mb=this.Da.context,this.Mb.Ac(!0),this.Mb.setTransform(1,0,0,1,0,0),this.Mb.clearRect(0,0,this.Da.width,this.Da.height),kl(this)}finally{this.Da=a,this.Mb=b}}}R.prototype.redraw.call(this)};
894 hl.prototype.sc=function(){null===this.Ka&&v("No div specified");null===this.Da&&v("No canvas specified");if(!(this.Da instanceof Sj)&&(yi(this.box),this.Jc)){var a=this.observed;if(null!==a&&!a.animationManager.defaultAnimation.isAnimating&&a.Bj){Lj(this);var b=this.Da;a=this.Mb;a.Ac(!0);a.setTransform(1,0,0,1,0,0);a.clearRect(0,0,b.width,b.height);1>this.updateDelay?kl(this):null!==this.sm&&(a.drawImage(this.sm.Oa,0,0),b=this.xb,b.reset(),1!==this.scale&&b.scale(this.scale),0===this.position.x&&
895 0===this.position.y||b.translate(-this.position.x,-this.position.y),a.scale(this.Zb,this.Zb),a.transform(b.m11,b.m12,b.m21,b.m22,b.dx,b.dy));b=this.Ra.j;for(var c=b.length,d=0;d<c;d++)b[d].sc(a,this);this.Jc=this.Ii=!1}}};
896 function kl(a){var b=a.observed;if(null!==b){var c=a.drawsTemporaryLayers,d=a.drawsGrid&&c,e=b.grid;d&&null!==e&&e.visible&&!isNaN(e.width)&&!isNaN(e.height)&&(e=L.alloc().assign(a.viewportBounds).Xc(b.viewportBounds),Ej(b,e),L.free(e),jj(b));var f=a.xb;f.reset();1!==a.scale&&f.scale(a.scale);0===a.position.x&&0===a.position.y||f.translate(-a.position.x,-a.position.y);e=a.Mb;e.scale(a.Zb,a.Zb);e.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);b=b.Ra.j;f=b.length;for(var g=0;g<f;g++){var h=b[g],k=a;if(h.visible&&
897 0!==h.opacity){var l=h.diagram.grid.part;if(!c&&h.isTemporary)d&&l.layer===h&&(h=zi(h,e),l.sc(e,k),e.globalAlpha=h);else{for(var m=zi(h,e),n=k.scale,p=L.alloc(),r=h.Ja.j,q=r.length,u=0;u<q;u++){var y=r[u];(d||y!==l)&&h.oj(e,y,k,null,n,p,!1)}L.free(p);e.globalAlpha=m}}}}}
898 function jl(a){var b=a.box;if(null!==b){var c=a.observed;if(null!==c){a.Jc=!0;c=c.viewportBounds;var d=b.selectionObject,e=Fb.alloc();e.h(c.width,c.height);d.desiredSize=e;Fb.free(e);a=2/a.scale;d instanceof Uf&&(d.strokeWidth=a);b.location=new J(c.x-a/2,c.y-a/2);b.isSelected=!0}}}hl.prototype.computeBounds=function(){var a=this.observed;if(null===a)return rc;var b=a.documentBounds.copy();b.Xc(a.viewportBounds);return b};hl.prototype.invalidateViewport=function(){!0!==this.Jc&&(this.Jc=!0,this.Jb())};
899 hl.prototype.onViewportBoundsChanged=function(a,b,c,d){this.Yb||(ij(this),this.P(),oj(this),this.Ta(),jl(this),this.Oc.scale=c,this.Oc.position.x=a.x,this.Oc.position.y=a.y,this.Oc.bounds.assign(a),this.Oc.vw=d,this.U("ViewportBoundsChanged",this.Oc,a))};
900 na.Object.defineProperties(hl.prototype,{observed:{configurable:!0,get:function(){return this.Pa},set:function(a){var b=this.Pa;null!==a&&w(a,R,hl,"observed");a instanceof hl&&v("Overview.observed Diagram may not be an Overview itself: "+a);if(b!==a){null!==b&&(this.remove(this.box),b.Zm("ViewportBoundsChanged",this.hi),b.Zm("DocumentBoundsChanged",this.gi),b.Zm("InvalidateDraw",this.Yc),b.Zm("AnimationFinished",this.Ud));this.Pa=a;null!==a&&(a.xk("ViewportBoundsChanged",this.hi),a.xk("DocumentBoundsChanged",
901 this.gi),a.xk("InvalidateDraw",this.Yc),a.xk("AnimationFinished",this.Ud),this.add(this.box));this.Ta();if(null===a){this.sm=null;var c=this.Da,d=this.Mb;c&&d&&(d.setTransform(1,0,0,1,0,0),d.clearRect(0,0,c.width,c.height))}else this.Yc(null),jl(this),this.P();this.g("observed",b,a)}}},box:{configurable:!0,get:function(){return this.l},set:function(a){var b=this.l;b!==a&&(this.l=a,this.remove(b),this.add(this.l),jl(this),this.g("box",b,a))}},drawsTemporaryLayers:{configurable:!0,
902 get:function(){return this.W},set:function(a){this.W!==a&&(this.W=a,this.redraw())}},drawsGrid:{configurable:!0,get:function(){return this.L},set:function(a){this.L!==a&&(this.L=a,this.redraw())}},updateDelay:{configurable:!0,get:function(){return this.kb},set:function(a){0>a&&(a=0);this.kb!==a&&(this.kb=a)}}});hl.className="Overview";function il(){gf.call(this);this.l=null}ma(il,gf);
903 il.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.timestamp<this.delay))return!1;null===this.findDraggablePart()&&(c=b.viewportBounds,this.l=new J(c.width/2,c.height/2),a=a.firstInput.documentPoint,b.position=new J(a.x-this.l.x,a.y-this.l.y));return!0};
904 il.prototype.doActivate=function(){this.l=null;gf.prototype.doActivate.call(this)};il.prototype.doUpdateCursor=function(){var a=this.diagram,b=a.box;null!==b&&b.cursor&&(a.currentCursor=b.cursor)};il.prototype.moveParts=function(){var a=this.diagram,b=a.observed;if(null!==b){var c=a.box;if(null!==c){if(null===this.l){var d=a.firstInput.documentPoint;c=c.location;this.l=new J(d.x-c.x,d.y-c.y)}a=a.lastInput.documentPoint;b.position=new J(a.x-this.l.x,a.y-this.l.y)}}};il.className="OverviewDraggingTool";
905 function ll(){0<arguments.length&&Ba(ll);eb(this);this.C=Re;this.kb=this.L=this.w=!0;this.W=this.Pa=this.Yc=this.Qa=!1;this.Vi=this.l=null;this.Ud=1.05;this.ov=NaN;this.Nx=null;this.Ov=NaN;this.Nv=rc;this.Ic=!0;this.Dg=null;this.Zc=200}ll.prototype.toString=function(){return"CommandHandler"};ll.prototype.me=function(a){this.C=a};
906 ll.prototype.doKeyDown=function(){var a=this.diagram,b=a.lastInput,c=cb?b.meta:b.control,d=b.shift,e=b.alt,f=b.key;!c||"C"!==f&&"Insert"!==f?c&&"X"===f||d&&"Del"===f?this.canCutSelection()&&this.cutSelection():c&&"V"===f||d&&"Insert"===f?this.canPasteSelection()&&this.pasteSelection():c&&"Y"===f||e&&d&&"Backspace"===f?this.canRedo()&&this.redo():c&&"Z"===f||e&&"Backspace"===f?this.canUndo()&&this.undo():"Del"===f||"Backspace"===f?this.canDeleteSelection()&&this.deleteSelection():c&&"A"===f?this.canSelectAll()&&
907 this.selectAll():"Esc"===f?this.canStopCommand()&&this.stopCommand():"Up"===f?a.allowVerticalScroll&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===f?a.allowVerticalScroll&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===f?a.allowHorizontalScroll&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===f?a.allowHorizontalScroll&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===f?d&&a.allowHorizontalScroll?a.scroll("page","left"):a.allowVerticalScroll&&
908 a.scroll("page","up"):"PageDown"===f?d&&a.allowHorizontalScroll?a.scroll("page","right"):a.allowVerticalScroll&&a.scroll("page","down"):"Home"===f?c&&a.allowVerticalScroll?a.scroll("document","up"):!c&&a.allowHorizontalScroll&&a.scroll("document","left"):"End"===f?c&&a.allowVerticalScroll?a.scroll("document","down"):!c&&a.allowHorizontalScroll&&a.scroll("document","right"):" "===f?this.canScrollToPart()&&this.scrollToPart():"Subtract"===f?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===f?this.canIncreaseZoom()&&
909 this.increaseZoom():c&&"0"===f?this.canResetZoom()&&this.resetZoom():d&&"Z"===f?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"===f?this.canGroupSelection()&&this.groupSelection():c&&d&&"G"===f?this.canUngroupSelection()&&this.ungroupSelection():"F2"===f||b.event&&"F2"===b.event.key?this.canEditTextBlock()&&this.editTextBlock():"ContextMenu"===f||b.event&&"ContextMenu"===b.event.key?this.canShowContextMenu()&&this.showContextMenu():b.bubbles=!0:this.canCopySelection()&&this.copySelection()};
910 ll.prototype.doKeyUp=function(){this.diagram.lastInput.bubbles=!0};ll.prototype.stopCommand=function(){var a=this.diagram,b=a.currentTool;b instanceof Ta&&a.allowSelect&&a.clearSelection();null!==b&&b.doCancel()};ll.prototype.canStopCommand=function(){return!0};
911 ll.prototype.selectAll=function(){var a=this.diagram;a.P();try{a.currentCursor="wait";a.U("ChangingSelection",a.selection);for(var b=a.parts;b.next();)b.value.isSelected=!0;for(var c=a.nodes;c.next();)c.value.isSelected=!0;for(var d=a.links;d.next();)d.value.isSelected=!0}finally{a.U("ChangedSelection",a.selection),a.currentCursor=""}};ll.prototype.canSelectAll=function(){return this.diagram.allowSelect};
912 ll.prototype.deleteSelection=function(){var a=this.diagram;try{a.currentCursor="wait";a.U("ChangingSelection",a.selection);a.Ca("Delete");a.U("SelectionDeleting",a.selection);for(var b=new I,c=a.selection.iterator;c.next();)ml(b,c.value,!0,this.deletesTree?Infinity:0,this.deletesConnectedLinks?null:!1,function(a){return a.canDelete()});a.tu(b,!0);a.U("SelectionDeleted",b)}finally{a.cb("Delete"),a.U("ChangedSelection",a.selection),a.currentCursor=""}};
913 ll.prototype.canDeleteSelection=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowDelete||0===a.selection.count?!1:!0};ll.prototype.copySelection=function(){var a=this.diagram,b=new I;for(a=a.selection.iterator;a.next();)ml(b,a.value,!0,this.copiesTree?Infinity:0,this.copiesConnectedLinks,function(a){return a.canCopy()});this.copyToClipboard(b)};ll.prototype.canCopySelection=function(){var a=this.diagram;return a.allowCopy&&a.allowClipboard&&0!==a.selection.count?!0:!1};
914 ll.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};ll.prototype.canCutSelection=function(){var a=this.diagram;return!a.isReadOnly&&!a.isModelReadOnly&&a.allowCopy&&a.allowDelete&&a.allowClipboard&&0!==a.selection.count?!0:!1};
915 ll.prototype.copyToClipboard=function(a){var b=this.diagram,c=null;if(null===a)Qi=null,Ri="";else{c=b.model;var d=!1,e=!1,f=null;try{c.Sm()&&(d=c.Ek,c.Ek=this.copiesParentKey),c.Ok()&&(e=c.Dk,c.Dk=this.copiesGroupKey),f=b.Fk(a,null,!0)}finally{c.Sm()&&(c.Ek=d),c.Ok()&&(c.Dk=e),c=new H,c.addAll(f),Qi=c,Ri=b.model.dataFormat}}b.U("ClipboardChanged",c)};
916 ll.prototype.pasteFromClipboard=function(){var a=new I,b=Qi;if(null===b)return a;var c=this.diagram;if(Ri!==c.model.dataFormat)return a;var d=c.model,e=!1,f=!1,g=null;try{d.Sm()&&(e=d.Ek,d.Ek=this.copiesParentKey),d.Ok()&&(f=d.Dk,d.Dk=this.copiesGroupKey),g=c.Fk(b,c,!1)}finally{for(d.Sm()&&(d.Ek=e),d.Ok()&&(d.Dk=f),b=g.iterator;b.next();)c=b.value,d=b.key,c.location.o()||(d.location.o()?c.location=d.location:!c.position.o()&&d.position.o()&&(c.position=d.position)),a.add(c)}return a};
917 ll.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.currentCursor="wait";b.U("ChangingSelection",b.selection);b.Ca("Paste");var c=this.pasteFromClipboard();0<c.count&&b.clearSelection(!0);for(var d=c.iterator;d.next();)d.value.isSelected=!0;if(null!==a){var e=b.computePartsBounds(b.selection);if(e.o()){var f=this.computeEffectiveCollection(b.selection,b.wl);Ff(b,f,new J(a.x-e.centerX,a.y-e.centerY),b.wl,!1)}}b.U("ClipboardPasted",c)}finally{b.cb("Paste"),b.U("ChangedSelection",
918 b.selection),b.currentCursor=""}};ll.prototype.canPasteSelection=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowClipboard||null===Qi||0===Qi.count||Ri!==a.model.dataFormat?!1:!0};ll.prototype.undo=function(){this.diagram.undoManager.undo()};ll.prototype.canUndo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canUndo()};ll.prototype.redo=function(){this.diagram.undoManager.redo()};
919 ll.prototype.canRedo=function(){var a=this.diagram;return a.isReadOnly||a.isModelReadOnly?!1:a.allowUndo&&a.undoManager.canRedo()};ll.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);C(a,ll,"decreaseZoom:factor");var b=this.diagram;b.autoScale===Kh&&(a=b.scale*a,a<b.minScale||a>b.maxScale||(b.scale=a))};
920 ll.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.zoomFactor);C(a,ll,"canDecreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Kh)return!1;a=b.scale*a;return a<b.minScale||a>b.maxScale?!1:b.allowZoom};ll.prototype.increaseZoom=function(a){void 0===a&&(a=this.zoomFactor);C(a,ll,"increaseZoom:factor");var b=this.diagram;b.autoScale===Kh&&(a=b.scale*a,a<b.minScale||a>b.maxScale||(b.scale=a))};
921 ll.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.zoomFactor);C(a,ll,"canIncreaseZoom:factor");var b=this.diagram;if(b.autoScale!==Kh)return!1;a=b.scale*a;return a<b.minScale||a>b.maxScale?!1:b.allowZoom};ll.prototype.resetZoom=function(a){void 0===a&&(a=this.defaultScale);C(a,ll,"resetZoom:newscale");var b=this.diagram;a<b.minScale||a>b.maxScale||(b.scale=a)};
922 ll.prototype.canResetZoom=function(a){void 0===a&&(a=this.defaultScale);C(a,ll,"canResetZoom:newscale");var b=this.diagram;return a<b.minScale||a>b.maxScale?!1:b.allowZoom};
923 ll.prototype.zoomToFit=function(){var a=this.diagram,b=a.animationManager;b.Hc();a.redraw();var c=a.position,d=a.scale;Eh(b,"Zoom To Fit");this.isZoomToFitRestoreEnabled&&d===this.Ov&&!isNaN(this.ov)&&a.documentBounds.A(this.Nv)?(a.scale=this.ov,a.position=this.Nx,this.Ov=NaN,this.Nv=rc):(this.ov=d,this.Nx=c.copy(),a.zoomToFit(),this.Ov=a.scale,this.Nv=a.documentBounds.copy());Gh(b)};ll.prototype.canZoomToFit=function(){return this.diagram.allowZoom};
924 ll.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w(a,U,ll,"part");var b=this.diagram;b.Ya();if(null===a){try{null!==this.Dg&&(this.Dg.next()?a=this.Dg.value:this.Dg=null)}catch(k){this.Dg=null}null===a&&(0<b.highlighteds.count?this.Dg=b.highlighteds.iterator:0<b.selection.count&&(this.Dg=b.selection.iterator),null!==this.Dg&&this.Dg.next()&&(a=this.Dg.value))}if(null!==a){var c=b.animationManager;Eh(c,"Scroll To Part");var d=this.scrollToPartPause;if(0<d){var e=nl(this,a,[a]);
925 if(1===e.length)b.Ca(),b.Nt(a.actualBounds),b.cb("Scroll To Part");else{var f=function(){b.Ca();for(var a=e.pop();0<e.length&&a instanceof V&&a.isTreeExpanded&&(!(a instanceof If)||a.isSubGraphExpanded);)a=e.pop();0<e.length?(a instanceof U&&b.Ow(a.actualBounds),a instanceof V&&!a.isTreeExpanded&&(a.isTreeExpanded=!0),a instanceof If&&!a.isSubGraphExpanded&&(a.isSubGraphExpanded=!0)):(a instanceof U&&b.Nt(a.actualBounds),b.Zm("LayoutCompleted",g));b.cb("Scroll To Part")},g=function(){ta(f,(c.isEnabled?
926 c.duration:0)+d)};b.xk("LayoutCompleted",g);f()}}else{var h=b.position.copy();b.Nt(a.actualBounds);h.Wa(b.position)&&c.Hc()}}};
927 function nl(a,b,c){if(b.isVisible())return c;if(b instanceof Ve)nl(a,b.adornedPart,c);else if(b instanceof S){var d=b.fromNode;null!==d&&nl(a,d,c);b=b.toNode;null!==b&&nl(a,b,c)}else b instanceof V&&(d=b.labeledLink,null!==d&&nl(a,d,c),d=b.Rg(),null!==d&&(d.isTreeExpanded||d.wasTreeExpanded||c.push(d),nl(a,d,c))),b=b.containingGroup,null!==b&&(b.isSubGraphExpanded||b.wasSubGraphExpanded||c.push(b),nl(a,b,c));return c}
928 ll.prototype.canScrollToPart=function(a){void 0===a&&(a=null);if(null!==a&&!(a instanceof U))return!1;a=this.diagram;return 0===a.selection.count&&0===a.highlighteds.count?!1:a.allowHorizontalScroll&&a.allowVerticalScroll};
929 ll.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ca("Collapse Tree");Eh(b.animationManager,"Collapse Tree");var c=new H;if(null!==a&&a.isTreeExpanded)a.collapseTree(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof V&&e.isTreeExpanded&&(e.collapseTree(),c.add(e))}b.U("TreeCollapsed",c)}finally{b.cb("Collapse Tree")}};
930 ll.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a){if(!(a instanceof V&&a.isTreeExpanded))return!1;if(0<a.Uq().count)return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof V&&b.isTreeExpanded&&0<b.Uq().count)return!0;return!1};
931 ll.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ca("Expand Tree");Eh(b.animationManager,"Expand Tree");var c=new H;if(null!==a&&!a.isTreeExpanded)a.expandTree(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof V&&!e.isTreeExpanded&&(e.expandTree(),c.add(e))}b.U("TreeExpanded",c)}finally{b.cb("Expand Tree")}};
932 ll.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a){if(!(a instanceof V)||a.isTreeExpanded)return!1;if(0<a.Uq().count)return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof V&&!b.isTreeExpanded&&0<b.Uq().count)return!0;return!1};
933 ll.prototype.groupSelection=function(){var a=this.diagram,b=a.model;if(b.Aj()){var c=this.archetypeGroupData;if(null!==c){var d=null;try{a.currentCursor="wait";a.U("ChangingSelection",a.selection);a.Ca("Group");for(var e=new H,f=a.selection.iterator;f.next();){var g=f.value;g.Tc()&&g.canGroup()&&e.add(g)}for(var h=new H,k=e.iterator;k.next();){var l=k.value;f=!1;for(var m=e.iterator;m.next();)if(l.Qd(m.value)){f=!0;break}f||h.add(l)}if(0<h.count){var n=h.first().containingGroup;if(null!==n)for(;null!==
934 n;){e=!1;for(var p=h.iterator;p.next();)if(!p.value.Qd(n)){e=!0;break}if(e)n=n.containingGroup;else break}if(c instanceof If)yg(c),d=c.copy(),null!==d&&a.add(d);else if(b.fu(c)){var r=b.copyNodeData(c);Ga(r)&&(b.Gf(r),d=a.rj(r))}if(null!==d){null!==n&&this.isValidMember(n,d)&&(d.containingGroup=n);for(var q=h.iterator;q.next();){var u=q.value;this.isValidMember(d,u)&&(u.containingGroup=d)}a.clearSelection(!0);d.isSelected=!0}}a.U("SelectionGrouped",d)}finally{a.cb("Group"),a.U("ChangedSelection",
935 a.selection),a.currentCursor=""}}}};ll.prototype.canGroupSelection=function(){var a=this.diagram;if(a.isReadOnly||a.isModelReadOnly||!a.allowInsert||!a.allowGroup||!a.model.Aj()||null===this.archetypeGroupData)return!1;for(a=a.selection.iterator;a.next();){var b=a.value;if(b.Tc()&&b.canGroup())return!0}return!1};
936 function ol(a){var b=Ma();for(a=a.iterator;a.next();){var c=a.value;c instanceof S||b.push(c)}a=new I;c=b.length;for(var d=0;d<c;d++){for(var e=b[d],f=!0,g=0;g<c;g++)if(e.Qd(b[g])){f=!1;break}f&&a.add(e)}Oa(b);return a}
937 ll.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof S)return!1;if(null!==a){if(a===b||a.Qd(b))return!1;var c=a.memberValidation;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.memberValidation;return null!==c?c(a,b):!0};
938 ll.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.diagram,c=b.model;if(c.Aj())try{b.currentCursor="wait";b.U("ChangingSelection",b.selection);b.Ca("Ungroup");var d=new H;if(null!==a)d.add(a);else for(var e=b.selection.iterator;e.next();){var f=e.value;f instanceof If&&f.canUngroup()&&d.add(f)}var g=new H;if(0<d.count){b.clearSelection(!0);for(var h=d.iterator;h.next();){var k=h.value;k.expandSubGraph();var l=k.containingGroup,m=null!==l&&null!==l.data?c.pa(l.data):void 0;g.addAll(k.memberParts);
939 for(var n=g.iterator;n.next();){var p=n.value;p.isSelected=!0;if(!(p instanceof S)){var r=p.data;null!==r?c.sr(r,m):p.containingGroup=l}}b.remove(k)}}b.U("SelectionUngrouped",d,g)}finally{b.cb("Ungroup"),b.U("ChangedSelection",b.selection),b.currentCursor=""}};
940 ll.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly||b.isModelReadOnly||!b.allowDelete||!b.allowUngroup||!b.model.Aj())return!1;if(null!==a){if(!(a instanceof If))return!1;if(a.canUngroup())return!0}else for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof If&&b.canUngroup())return!0;return!1};
941 ll.prototype.addTopLevelParts=function(a,b){var c=!0;for(a=ol(a).iterator;a.next();){var d=a.value;null!==d.containingGroup&&(!b||this.isValidMember(null,d)?d.containingGroup=null:c=!1)}return c};
942 ll.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ca("Collapse SubGraph");Eh(b.animationManager,"Collapse SubGraph");var c=new H;if(null!==a&&a.isSubGraphExpanded)a.collapseSubGraph(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof If&&e.isSubGraphExpanded&&(e.collapseSubGraph(),c.add(e))}b.U("SubGraphCollapsed",c)}finally{b.cb("Collapse SubGraph")}};
943 ll.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a)return a instanceof If&&a.isSubGraphExpanded?!0:!1;for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof If&&b.isSubGraphExpanded)return!0;return!1};
944 ll.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;try{b.Ca("Expand SubGraph");Eh(b.animationManager,"Expand SubGraph");var c=new H;if(null!==a&&!a.isSubGraphExpanded)a.expandSubGraph(),c.add(a);else if(null===a)for(var d=b.selection.iterator;d.next();){var e=d.value;e instanceof If&&!e.isSubGraphExpanded&&(e.expandSubGraph(),c.add(e))}b.U("SubGraphExpanded",c)}finally{b.cb("Expand SubGraph")}};
945 ll.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly)return!1;if(null!==a)return a instanceof If&&!a.isSubGraphExpanded?!0:!1;for(a=b.selection.iterator;a.next();)if(b=a.value,b instanceof If&&!b.isSubGraphExpanded)return!0;return!1};
946 ll.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&w(a,ih,ll,"editTextBlock");var b=this.diagram,c=b.toolManager.findTool("TextEditing");if(null!==c){if(null===a){a=null;for(var d=b.selection.iterator;d.next();){var e=d.value;if(e.canEdit()){a=e;break}}if(null===a)return;a=a.Mm(function(a){return a instanceof ih&&a.editable})}null!==a&&(b.currentTool=null,c.textBlock=a,b.currentTool=c)}};
947 ll.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);var b=this.diagram;if(b.isReadOnly||b.isModelReadOnly||!b.allowTextEdit||null===b.toolManager.findTool("TextEditing"))return!1;if(null!==a){if(!(a instanceof ih))return!1;a=a.part;if(null!==a&&a.canEdit())return!0}else for(b=b.selection.iterator;b.next();)if(a=b.value,a.canEdit()&&(a=a.Mm(function(a){return a instanceof ih&&a.editable}),null!==a))return!0;return!1};
948 ll.prototype.showContextMenu=function(a){var b=this.diagram,c=b.toolManager.findTool("ContextMenu");if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=b.lastInput,e=null;a instanceof O?e=a.ja(Kc):b.viewportBounds.ca(d.documentPoint)||(e=b.viewportBounds,e=new J(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.viewPoint=b.vr(e),d.documentPoint=e,d.left=!1,d.right=!0,d.up=!0);b.currentTool=c;eh(c,!1,a)}};
949 ll.prototype.canShowContextMenu=function(a){var b=this.diagram,c=b.toolManager.findTool("ContextMenu");if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0};
950 ll.prototype.computeEffectiveCollection=function(a,b){var c=this.diagram,d=c.toolManager.findTool("Dragging"),e=c.currentTool===d;void 0===b&&(b=e?d.dragOptions:c.wl);d=new Bb;if(null===a)return d;for(var f=a.iterator;f.next();)dk(c,d,f.value,e,b);if(null!==c.draggedLink&&b.dragsLink)return d;for(f=a.iterator;f.next();)a=f.value,a instanceof S&&(b=a.fromNode,null===b||d.contains(b)?(b=a.toNode,null===b||d.contains(b)||d.remove(a)):d.remove(a));return d};
951 na.Object.defineProperties(ll.prototype,{diagram:{configurable:!0,get:function(){return this.C}},copiesClipboardData:{configurable:!0,get:function(){return this.w},set:function(a){A(a,"boolean",ll,"copiesClipboardData");this.w=a}},copiesConnectedLinks:{configurable:!0,get:function(){return this.L},set:function(a){A(a,"boolean",ll,"copiesConnectedLinks");this.L=a}},deletesConnectedLinks:{configurable:!0,get:function(){return this.kb},set:function(a){A(a,
952 "boolean",ll,"deletesConnectedLinks");this.kb=a}},copiesTree:{configurable:!0,get:function(){return this.Qa},set:function(a){A(a,"boolean",ll,"copiesTree");this.Qa=a}},deletesTree:{configurable:!0,get:function(){return this.Yc},set:function(a){A(a,"boolean",ll,"deletesTree");this.Yc=a}},copiesParentKey:{configurable:!0,get:function(){return this.Pa},set:function(a){A(a,"boolean",ll,"copiesParentKey");this.Pa=a}},copiesGroupKey:{configurable:!0,
953 get:function(){return this.W},set:function(a){A(a,"boolean",ll,"copiesGroupKey");this.W=a}},archetypeGroupData:{configurable:!0,get:function(){return this.l},set:function(a){null!==a&&A(a,"object",ll,"archetypeGroupData");var b=this.diagram;F&&(b=b.model,!b.Aj()||a instanceof If||b.fu(a)||v("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a));this.l=a}},memberValidation:{configurable:!0,get:function(){return this.Vi},
954 set:function(a){null!==a&&A(a,"function",ll,"memberValidation");this.Vi=a}},defaultScale:{configurable:!0,get:function(){return this.diagram.defaultScale},set:function(a){this.diagram.defaultScale=a}},zoomFactor:{configurable:!0,get:function(){return this.Ud},set:function(a){C(a,ll,"zoomFactor");1<a||v("zoomFactor must be larger than 1.0, not: "+a);this.Ud=a}},isZoomToFitRestoreEnabled:{configurable:!0,get:function(){return this.Ic},set:function(a){A(a,"boolean",
955 ll,"isZoomToFitRestoreEnabled");this.Ic=a}},scrollToPartPause:{configurable:!0,get:function(){return this.Zc},set:function(a){C(a,ll,"scrollToPartPause");this.Zc=a}}});ll.className="CommandHandler";Ki=function(){return new ll};
956 function O(){eb(this);this.I=4225027;this.nb=1;this.Ag=null;this.va="";this.kc=this.rb=null;this.ra=(new J(NaN,NaN)).freeze();this.cd=Zb;this.rg=Rb;this.qg=Wb;this.xb=new Gb;this.ji=new Gb;this.og=new Gb;this.Ga=this.Cl=1;this.dc=0;this.Pe=pl;this.vh=zc;this.vc=(new L(NaN,NaN,NaN,NaN)).freeze();this.Cb=(new L(NaN,NaN,NaN,NaN)).freeze();this.wc=(new L(0,0,NaN,NaN)).freeze();this.S=this.Kp=this.Lp=null;this.ll=this.Db=fd;this.Wp=0;this.Xp=1;this.dh=0;this.Mn=1;this.oq=null;this.cq=-Infinity;this.nm=
957 0;this.om=Mb;this.pm=ng;this.Ai="";this.lb=this.R=null;this.pl=-1;this.rm=this.gb=this.zi=this.vm=null;this.at=zg;this.Zp=this.Yg=this.mk=null}var Bd,zg,Og,pl,ql,rl,sl,tl,ul,vl;
958 O.prototype.cloneProtected=function(a){a.I=this.I|6144;a.nb=this.nb;a.va=this.va;a.rb=this.rb;a.kc=this.kc;a.Yg=this.Yg;a.ra.assign(this.ra);a.cd=this.cd.K();a.rg=this.rg.K();a.qg=this.qg.K();a.og=this.og.copy();a.Ga=this.Ga;a.dc=this.dc;a.Pe=this.Pe;a.vh=this.vh.K();a.vc.assign(this.vc);a.Cb.assign(this.Cb);a.wc.assign(this.wc);a.Kp=this.Kp;null!==this.S&&(a.S=this.S.copy());a.Db=this.Db.K();a.ll=this.ll.K();a.Wp=this.Wp;a.Xp=this.Xp;a.dh=this.dh;a.Mn=this.Mn;a.oq=this.oq;a.cq=this.cq;a.nm=this.nm;
959 a.om=this.om.K();a.pm=this.pm;a.Ai=this.Ai;null!==this.R&&(a.R=this.R.copy());a.lb=this.lb;a.pl=this.pl;null!==this.zi&&(a.zi=Ja(this.zi));null!==this.gb&&(a.gb=this.gb.copy());a.rm=this.rm};O.prototype.jy=function(a){var b=this.zi;if(Ha(b))for(var c=0;c<b.length;c++){if(b[c]===a)return}else this.zi=b=[];b.push(a)};O.prototype.Kf=function(a){a.Lp=null;a.mk=null;a.u()};
960 O.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!==this.zi)for(var b=0;b<this.zi.length;b++){var c=this.zi[b];a[c]=this[c]}return a};O.prototype.copy=function(){return this.clone()};t=O.prototype;t.pb=function(a){a.classType===S?0===a.name.indexOf("Orient")?this.segmentOrientation=a:v("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.classType===O?this.stretch=a:Da(this,a)};t.toString=function(){return Pa(this.constructor)+"#"+ob(this)};
961 function wl(a){null===a.R&&(a.R=new xl)}t.Qc=function(){if(null===this.S){var a=new yl;a.oh=Bc;a.Nh=Bc;a.mh=10;a.Lh=10;a.nh=0;a.Mh=0;this.S=a}};
962 t.ab=function(a,b,c,d,e,f,g){var h=this.part;if(null!==h&&(h.cl(a,b,c,d,e,f,g),c===this&&a===Ce&&zl(this)&&Al(this,h,b),f=this.diagram,null===this.Yg||null===f||!f.Bj||f.undoManager.isUndoingRedoing||f.currentTool!==f.toolManager||f.animationManager.Gn||(a=this.Yg.get(b),null!==a&&f.animationManager.isEnabled&&!f.animationManager.isTicking&&(null===this.Zp&&(this.Zp=new Bb),g=0===f.undoManager.transactionLevel,a.startCondition===ui?g=!0:a.startCondition===wi&&(g=!1),g?(f=new Dh,vi(a,f),g=this.Zp.get(a),
963 null!==g&&g.stop(),this.Zp.add(a,f),f.Kv=this,f.by=a,f.add(this,b,d,e),f.start()):(Fh(f.animationManager,"Trigger"),f.animationManager.defaultAnimation.add(this,b,d,e)))),this instanceof W&&c===h&&0!==(h.I&16777216)&&null!==h.data))for(c=this.$.j,d=c.length,e=0;e<d;e++)h=c[e],h instanceof W&&Vj(h,function(a){null!==a.data&&0!==(a.I&16777216)&&a.Ia(b)})};
964 function Al(a,b,c){var d=a.tj();if(null!==d)for(var e=a.lb.iterator;e.next();){var f=e.value,g=null;if(null!==f.sourceName){g=Bl(f,d,a);if(null===g)continue;f.yr(a,g,c,null)}else if(f.isToModel){var h=b.diagram;null===h||h.skipsModelSourceBindings||f.yr(a,h.model.modelData,c,d)}else{h=d.data;if(null===h)continue;var k=b.diagram;null===k||k.skipsModelSourceBindings||f.yr(a,h,c,d)}g===a&&(h=d.Tt(f.Ij),null!==h&&f.jx(h,g,c))}}t.Tt=function(a){return this.pl===a?this:null};
965 t.g=function(a,b,c){this.ab(Ce,a,this,b,c)};function Cl(a,b,c,d,e){var f=a.vc,g=a.og;g.reset();Dl(a,g,b,c,d,e);a.og=g;f.h(b,c,d,e);g.gu()||g.ex(f)}function El(a,b,c,d){if(!1===a.pickable)return!1;d.multiply(a.transform);return c?a.Sc(b,d):a.Uh(b,d)}
966 t.Hy=function(a,b,c){if(!1===this.pickable)return!1;var d=this.naturalBounds;b=a.Ve(b);return c?Ib(a.x,a.y,0,0,0,d.height)<=b||Ib(a.x,a.y,0,d.height,d.width,d.height)<=b||Ib(a.x,a.y,d.width,d.height,d.width,0)<=b||Ib(a.x,a.y,d.width,0,0,0)<=b:a.wd(0,0)<=b&&a.wd(0,d.height)<=b&&a.wd(d.width,0)<=b&&a.wd(d.width,d.height)<=b};t.pe=function(){return!0};
967 t.ca=function(a){F&&w(a,J,O,"containsPoint:p");var b=J.alloc();b.assign(a);this.transform.Aa(b);var c=this.actualBounds;if(!c.o())return J.free(b),!1;var d=this.diagram;if(null!==d&&d.Be){var e=d.Pm("extraTouchThreshold"),f=d.Pm("extraTouchArea"),g=f/2,h=this.naturalBounds;d=this.Mf()*d.scale;var k=1/d;if(h.width*d<e&&h.height*d<e)return a=lc(c.x-g*k,c.y-g*k,c.width+f*k,c.height+f*k,b.x,b.y),J.free(b),a}e=!1;if(this instanceof Ve||this instanceof Uf?lc(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):
968 c.ca(b))this.gb&&!this.gb.ca(b)?e=!1:null!==this.kc&&c.ca(b)?e=!0:null!==this.rb&&this.wc.ca(a)?e=!0:e=this.Vh(a);J.free(b);return e};t.Vh=function(a){var b=this.naturalBounds;return lc(0,0,b.width,b.height,a.x,a.y)};
969 t.Te=function(a){F&&w(a,L,O,"containsRect:r");if(0===this.angle)return this.actualBounds.Te(a);var b=this.naturalBounds;b=L.allocAt(0,0,b.width,b.height);var c=this.transform,d=!1,e=J.allocAt(a.x,a.y);b.ca(c.Pd(e))&&(e.h(a.x,a.bottom),b.ca(c.Pd(e))&&(e.h(a.right,a.bottom),b.ca(c.Pd(e))&&(e.h(a.right,a.y),b.ca(c.Pd(e))&&(d=!0))));J.free(e);L.free(b);return d};
970 t.Uh=function(a,b){F&&w(a,L,O,"containedInRect:r");if(void 0===b)return a.Te(this.actualBounds);var c=this.naturalBounds,d=!1,e=J.allocAt(0,0);a.ca(b.Aa(e))&&(e.h(0,c.height),a.ca(b.Aa(e))&&(e.h(c.width,c.height),a.ca(b.Aa(e))&&(e.h(c.width,0),a.ca(b.Aa(e))&&(d=!0))));J.free(e);return d};
971 t.Sc=function(a,b){F&&w(a,L,O,"intersectsRect:r");if(void 0===b&&(b=this.transform,0===this.angle))return a.Sc(this.actualBounds);var c=this.naturalBounds,d=J.allocAt(0,0),e=J.allocAt(0,c.height),f=J.allocAt(c.width,c.height),g=J.allocAt(c.width,0),h=!1;if(a.ca(b.Aa(d))||a.ca(b.Aa(e))||a.ca(b.Aa(f))||a.ca(b.Aa(g)))h=!0;else{c=L.allocAt(0,0,c.width,c.height);var k=J.allocAt(a.x,a.y);c.ca(b.Pd(k))?h=!0:(k.h(a.x,a.bottom),c.ca(b.Pd(k))?h=!0:(k.h(a.right,a.bottom),c.ca(b.Pd(k))?h=!0:(k.h(a.right,a.y),
972 c.ca(b.Pd(k))&&(h=!0))));J.free(k);L.free(c);!h&&(K.cu(a,d,e)||K.cu(a,e,f)||K.cu(a,f,g)||K.cu(a,g,d))&&(h=!0)}J.free(d);J.free(e);J.free(f);J.free(g);return h};t.ja=function(a,b){void 0===b&&(b=new J);if(a instanceof N){F&&a.Sb()&&v("getDocumentPoint:s Spot must be specific: "+a.toString());var c=this.naturalBounds;b.h(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY)}else b.set(a);this.Md.Aa(b);return b};
973 t.xj=function(a){void 0===a&&(a=new L);var b=this.naturalBounds,c=this.Md,d=J.allocAt(0,0).transform(c);a.h(d.x,d.y,0,0);d.h(b.width,0).transform(c);kc(a,d.x,d.y,0,0);d.h(b.width,b.height).transform(c);kc(a,d.x,d.y,0,0);d.h(0,b.height).transform(c);kc(a,d.x,d.y,0,0);J.free(d);return a};t.wj=function(){var a=this.Md;1===a.m11&&0===a.m12?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360));return a};
974 t.Mf=function(){if(0!==(this.I&4096)===!1)return this.Cl;var a=this.Ga;return null!==this.panel?a*this.panel.Mf():a};t.Zt=function(a,b){void 0===b&&(b=new J);b.assign(a);this.Md.Pd(b);return b};t.$t=function(a,b,c){return this.Lk(a.x,a.y,b.x,b.y,c)};
975 t.Lk=function(a,b,c,d,e){var f=this.transform,g=1/(f.m11*f.m22-f.m12*f.m21),h=f.m22*g,k=-f.m12*g,l=-f.m21*g,m=f.m11*g,n=g*(f.m21*f.dy-f.m22*f.dx),p=g*(f.m12*f.dx-f.m11*f.dy);if(null!==this.areaBackground)return f=this.actualBounds,K.Of(f.left,f.top,f.right,f.bottom,a,b,c,d,e);g=a*h+b*l+n;a=a*k+b*m+p;b=c*h+d*l+n;c=c*k+d*m+p;e.h(0,0);d=this.naturalBounds;c=K.Of(0,0,d.width,d.height,g,a,b,c,e);e.transform(f);return c};
976 O.prototype.measure=function(a,b,c,d){if(!1!==Ij(this)){var e=this.vh,f=e.right+e.left;e=e.top+e.bottom;a=Math.max(a-f,0);b=Math.max(b-e,0);c=Math.max((c||0)-f,0);d=Math.max((d||0)-e,0);f=this.angle;e=this.desiredSize;var g=0;this instanceof Uf&&(g=this.strokeWidth);90===f||270===f?(a=isFinite(e.height)?e.height+g:a,b=isFinite(e.width)?e.width+g:b):(a=isFinite(e.width)?e.width+g:a,b=isFinite(e.height)?e.height+g:b);e=c||0;g=d||0;var h=this instanceof W;switch(Fl(this,!0)){case zg:g=e=0;h&&(b=a=Infinity);
977 break;case Bd:isFinite(a)&&a>c&&(e=a);isFinite(b)&&b>d&&(g=b);break;case ql:isFinite(a)&&a>c&&(e=a);g=0;h&&(b=Infinity);break;case rl:isFinite(b)&&b>d&&(g=b),e=0,h&&(a=Infinity)}h=this.maxSize;var k=this.minSize;e>h.width&&k.width<h.width&&(e=h.width);g>h.height&&k.height<h.height&&(g=h.height);c=Math.max(e/this.scale,k.width);d=Math.max(g/this.scale,k.height);h.width<c&&(c=Math.min(k.width,c));h.height<d&&(d=Math.min(k.height,d));a=Math.min(h.width,a);b=Math.min(h.height,b);a=Math.max(c,a);b=Math.max(d,
978 b);if(90===f||270===f)f=a,a=b,b=f,f=c,c=d,d=f;this.vc.ka();this.Vm(a,b,c,d);this.vc.freeze();this.vc.o()||v("Non-real measuredBounds has been set. Object "+this+", measuredBounds: "+this.vc.toString());Dj(this,!1)}};O.prototype.Vm=function(){};O.prototype.Rf=function(){return!1};
979 O.prototype.arrange=function(a,b,c,d,e){this.Sl();var f=L.alloc();f.assign(this.Cb);this.Cb.ka();!1===Jj(this)?this.Cb.h(a,b,c,d):this.Th(a,b,c,d);this.Cb.freeze();void 0===e?this.gb=null:this.gb=e;c=!1;if(void 0!==e)c=!0;else if(e=this.panel,null===e||e.type!==W.TableRow&&e.type!==W.TableColumn||(e=e.panel),null!==e&&(e=e.wc,d=this.measuredBounds,null!==this.areaBackground&&(d=this.Cb),c=b+d.height,d=a+d.width,c=!(0<=a+.05&&d<=e.width+.05&&0<=b+.05&&c<=e.height+.05),this instanceof ih&&(a=this.naturalBounds,
980 this.Hs>a.height||this.Ab>a.width)))c=!0;this.I=c?this.I|256:this.I&-257;this.Cb.o()||v("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Cb.toString());this.Wm(f,this.Cb);Gl(this,!1);L.free(f)};t=O.prototype;t.Th=function(){};
981 function Hl(a,b,c,d,e){a.Cb.h(b,c,d,e);if(!a.desiredSize.o()){var f=a.vc;c=a.vh;b=c.right+c.left;var g=c.top+c.bottom;c=f.width+b;f=f.height+g;d+=b;e+=g;b=Fl(a,!0);c===d&&f===e&&(b=zg);switch(b){case zg:if(c>d||f>e)Dj(a,!0),a.measure(c>d?d:c,f>e?e:f,0,0);break;case Bd:Dj(a,!0);a.measure(d,e,0,0);break;case ql:Dj(a,!0);a.measure(d,f,0,0);break;case rl:Dj(a,!0),a.measure(c,e,0,0)}}}
982 t.Wm=function(a,b){var c=this.part;null!==c&&null!==c.diagram&&(c.selectionObject!==this&&c.resizeObject!==this&&c.rotateObject!==this||Il(c,!0),this.P(),fc(a,b)||(c.Zh(),this.Ap(c)))};t.Ap=function(a){null!==this.portId&&(Il(a,!0),a instanceof V&&Jl(a,this))};
983 t.sc=function(a,b){if(this.visible){var c=this instanceof W&&(this.type===W.TableRow||this.type===W.TableColumn),d=this.Cb;if(c||0!==d.width&&0!==d.height&&!isNaN(d.x)&&!isNaN(d.y)){var e=this.opacity;if(0!==e){var f=1;1!==e&&(f=a.globalAlpha,a.globalAlpha=f*e);if(!this.Ay(a,b))if(c)Kl(this,a,b);else{this instanceof S&&this.Rk(!1);F&&F.Jm&&F.gA&&F.gA(a,this);c=this.transform;var g=this.panel;0!==(this.I&4096)===!0&&Ll(this);var h=this.part,k=!1,l=0;if(h&&b.Xe("drawShadows")&&(k=h.isShadowed)){var m=
984 h.shadowOffset;l=Math.max(m.y,m.x)*b.scale*b.Zb}if(!(m=b.Ji||!this.Rf())){var n=this.naturalBounds;m=this.ji;var p=m.m11,r=m.m21,q=m.dx,u=m.m12,y=m.m22,x=m.dy,z,B=z=0;m=z*p+B*r+q;var D=z*u+B*y+x;z=n.width+l;B=0;var G=z*p+B*r+q;z=z*u+B*y+x;B=Math.min(m,G);var M=Math.min(D,z);var Y=Math.max(m+0,G)-B;var Q=Math.max(D+0,z)-M;m=B;D=M;z=n.width+l;B=n.height+l;G=z*p+B*r+q;z=z*u+B*y+x;B=Math.min(m,G);M=Math.min(D,z);Y=Math.max(m+Y,G)-B;Q=Math.max(D+Q,z)-M;m=B;D=M;z=0;B=n.height+l;G=z*p+B*r+q;z=z*u+B*y+x;
985 B=Math.min(m,G);M=Math.min(D,z);Y=Math.max(m+Y,G)-B;Q=Math.max(D+Q,z)-M;m=B;D=M;l=b.viewportBounds;n=l.x;p=l.y;m=!(m>l.width+n||n>Y+m||D>l.height+p||p>Q+D)}if(m){m=0!==(this.I&256);a.clipInsteadOfFill&&(m=!1);this instanceof ih&&(a.font=this.font);if(m){F&&F.iA&&Ea("clip"+this.toString());D=g.pe()?g.naturalBounds:g.actualBounds;null!==this.gb?(n=this.gb,Y=n.x,Q=n.y,l=n.width,n=n.height):(Y=Math.max(d.x,D.x),Q=Math.max(d.y,D.y),l=Math.min(d.right,D.right)-Y,n=Math.min(d.bottom,D.bottom)-Q);if(Y>d.width+
986 d.x||d.x>D.width+D.x){1!==e&&(a.globalAlpha=f);return}a.save();a.beginPath();a.rect(Y,Q,l,n);a.clip()}if(this.Rf()){if(!h.isVisible()){1!==e&&(a.globalAlpha=f);return}k&&(D=h.shadowOffset,a.Ww(D.x*b.scale*b.Zb,D.y*b.scale*b.Zb,h.shadowBlur),Ml(a),a.shadowColor=h.shadowColor)}k&&!0===this.shadowVisible?Ml(a):k&&!1===this.shadowVisible&&Nl(a);h=this.naturalBounds;null!==this.kc&&(Ai(this,a,this.kc,!0,!0,h,d),this.kc instanceof Ol&&this.kc.type===Pl?(a.beginPath(),a.rect(d.x,d.y,d.width,d.height),a.We(this.kc)):
987 a.fillRect(d.x,d.y,d.width,d.height));a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);k&&(null!==g&&0!==(g.I&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.yb()!==this)&&null===this.shadowVisible&&Nl(a);null!==this.rb&&(l=this.naturalBounds,Y=D=0,Q=l.width,l=l.height,n=0,this instanceof Uf&&(l=this.ua.bounds,D=l.x,Y=l.y,Q=l.width,l=l.height,n=this.strokeWidth),Ai(this,a,this.rb,!0,!1,h,d),this.rb instanceof Ol&&this.rb.type===Pl?(a.beginPath(),a.rect(D-n/2,Y-n/2,Q+n,l+n),a.We(this.rb)):a.fillRect(D-
988 n/2,Y-n/2,Q+n,l+n));F&&F.Jm&&F.hA&&F.hA(a,this);k&&(null!==this.rb||null!==this.kc||null!==g&&0!==(g.I&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.yb()!==this)?(Ql(this,!0),null===this.shadowVisible&&Nl(a)):Ql(this,!1);this.pj(a,b);k&&0!==(this.I&512)===!0&&Ml(a);this.Rf()&&k&&Nl(a);m?(a.restore(),this instanceof W?a.Ac(!0):a.Ac(!1)):c.gu()||(b=1/(c.m11*c.m22-c.m12*c.m21),a.transform(c.m22*b,-c.m12*b,-c.m21*b,c.m11*b,b*(c.m21*c.dy-c.m22*c.dx),b*(c.m12*c.dx-c.m11*c.dy)))}}1!==e&&(a.globalAlpha=
989 f)}}}};t.Ay=function(){return!1};function Kl(a,b,c){var d=a.Cb,e=a.wc;null!==a.kc&&(Ai(a,b,a.kc,!0,!0,e,d),a.kc instanceof Ol&&a.kc.type===Pl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.We(a.kc)):b.fillRect(d.x,d.y,d.width,d.height));null!==a.rb&&(Ai(a,b,a.rb,!0,!1,e,d),a.rb instanceof Ol&&a.rb.type===Pl?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.We(a.rb)):b.fillRect(d.x,d.y,d.width,d.height));a.pj(b,c)}t.pj=function(){};
990 function Ai(a,b,c,d,e,f,g){if(null!==c){var h=1,k=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===Rl)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var l=0;a instanceof Uf&&(l=a.strokeWidth);h=f.width;k=f.height;e?(h=g.width,k=g.height):d||(h+=l,k+=l);if((f=b instanceof Sl)&&c.ue&&(c.type===Tl||c.sl===h&&c.Nu===k))var m=c.ue;else{var n=0,p=0,r=0,q=0,u=0,y=0;y=u=0;e?(u=g.x,y=g.y):d||(u-=l/2,y-=l/2);n=c.start.x*h+c.start.offsetX;p=c.start.y*k+c.start.offsetY;r=c.end.x*h+
991 c.end.offsetX;q=c.end.y*k+c.end.offsetY;n+=u;r+=u;p+=y;q+=y;if(c.type===Ul)m=b.createLinearGradient(n,p,r,q);else if(c.type===Pl)y=isNaN(c.endRadius)?Math.max(h,k)/2:c.endRadius,isNaN(c.startRadius)?(u=0,y=Math.max(h,k)/2):u=c.startRadius,m=b.createRadialGradient(n,p,u,r,q,y);else if(c.type===Tl)try{m=b.createPattern(c.pattern,"repeat")}catch(z){m=null}else ya(c.type,"Brush type");if(c.type!==Tl&&(e=c.colorStops,null!==e))for(e=e.iterator;e.next();)m.addColorStop(e.key,e.value);if(f&&(c.ue=m,null!==
992 m&&(c.sl=h,c.Nu=k),null===m&&c.type===Tl&&-1!==c.sl)){c.sl=-1;var x=a.diagram;null!==x&&-1===c.sl&&ta(function(){x.redraw()},600)}}d?b.fillStyle=m:b.strokeStyle=m}}}t.Sg=function(a){if(a instanceof W)a:{if(this!==a&&null!==a)for(var b=this.panel;null!==b;){if(b===a){a=!0;break a}b=b.panel}a=!1}else a=!1;return a};t.Sf=function(){if(!this.visible)return!1;var a=this.panel;return null!==a?a.Sf():!0};
993 t.Tg=function(){for(var a=this instanceof W?this:this.panel;null!==a&&a.isEnabled;)a=a.panel;return null===a};
994 function Ll(a){if(0!==(a.I&2048)===!0){var b=a.xb;b.reset();if(!a.Cb.o()||!a.vc.o()){Vl(a,!1);return}b.translate(a.Cb.x-a.vc.x,a.Cb.y-a.vc.y);if(1!==a.scale||0!==a.angle){var c=a.naturalBounds;Dl(a,b,c.x,c.y,c.width,c.height)}Vl(a,!1);Wl(a,!0)}0!==(a.I&4096)===!0&&(b=a.panel,null===b?(a.ji.set(a.xb),a.Cl=a.scale,Wl(a,!1)):null!==b.Md&&(c=a.ji,c.reset(),b.pe()?c.multiply(b.ji):null!==b.panel&&c.multiply(b.panel.ji),c.multiply(a.xb),a.Cl=a.scale*b.Cl,Wl(a,!1)))}
995 function Dl(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.dc){var g=Kc;a.Rf()&&a.locationSpot.eb()&&(g=a.locationSpot);var h=J.alloc();if(a instanceof U&&a.locationObject!==a)for(c=a.locationObject,d=c.naturalBounds,h.el(d.x,d.y,d.width,d.height,g),c.og.Aa(h),h.offset(-c.measuredBounds.x,-c.measuredBounds.y),g=c.panel;null!==g&&g!==a;)g.og.Aa(h),h.offset(-g.measuredBounds.x,-g.measuredBounds.y),g=g.panel;else h.el(c,d,e,f,g);b.rotate(a.dc,h.x,h.y);J.free(h)}}
996 t.u=function(a){if(!Ij(this)){void 0===a&&(a=!1);Dj(this,!0);Gl(this,!0);var b=this.panel;null===b||a||b.u()}};t.Nk=function(){Ij(this)||(Dj(this,!0),Gl(this,!0))};function Xl(a){if(!Jj(a)){var b=a.panel;null!==b?b.u():a.Rf()&&(b=a.diagram,null!==b&&(b.Cd.add(a),a instanceof V&&a.yd(),b.Jb()));Gl(a,!0)}}t.Sl=function(){0!==(this.I&2048)===!1&&(Vl(this,!0),Wl(this,!0))};t.sw=function(){Wl(this,!0)};t.P=function(){var a=this.part;null!==a&&a.P()};
997 function Fl(a,b){var c=a.stretch,d=a.panel;if(null!==d&&d.type===W.Table)return Yl(a,d.getRowDefinition(a.row),d.getColumnDefinition(a.column),b);if(null!==d&&d.type===W.Auto&&d.yb()===a)return Zl(a,Bd,b);if(c===pl){if(null!==d){if(d.type===W.Spot&&d.yb()===a)return Zl(a,Bd,b);c=d.defaultStretch;return c===pl?Zl(a,zg,b):Zl(a,c,b)}return Zl(a,zg,b)}return Zl(a,c,b)}
998 function Yl(a,b,c,d){var e=a.stretch;if(e!==pl)return Zl(a,e,d);var f=e=null;switch(b.stretch){case rl:f=!0;break;case Bd:f=!0}switch(c.stretch){case ql:e=!0;break;case Bd:e=!0}b=a.panel.defaultStretch;null===e&&(e=b===ql||b===Bd);null===f&&(f=b===rl||b===Bd);return!0===e&&!0===f?Zl(a,Bd,d):!0===e?Zl(a,ql,d):!0===f?Zl(a,rl,d):Zl(a,zg,d)}
999 function Zl(a,b,c){if(c)return b;if(b===zg)return zg;c=a.desiredSize;if(c.o())return zg;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===ql)return zg;if(b===Bd)return rl}else{if(b===rl)return zg;if(b===Bd)return ql}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===rl)return zg;if(b===Bd)return ql}else{if(b===ql)return zg;if(b===Bd)return rl}return b}function Ql(a,b){a.I=b?a.I|512:a.I&-513}function zl(a){return 0!==(a.I&1024)}function $l(a,b){a.I=b?a.I|1024:a.I&-1025}
1000 function Vl(a,b){a.I=b?a.I|2048:a.I&-2049}function Wl(a,b){a.I=b?a.I|4096:a.I&-4097}function Ij(a){return 0!==(a.I&8192)}function Dj(a,b){a.I=b?a.I|8192:a.I&-8193}function Jj(a){return 0!==(a.I&16384)}function Gl(a,b){a.I=b?a.I|16384:a.I&-16385}t.Ej=function(a){this.Ag=a};t.yu=function(){};t.Sw=function(a){this.ra.assign(a);Xl(this);return!0};t.tr=function(a,b){if(this.ra.x!==a||this.ra.y!==b)this.ra.h(a,b),this.Sl()};
1001 function am(a){var b=a.part;if(b instanceof V&&(null!==a.portId||a===b.port)){var c=b.diagram;null===c||c.undoManager.isUndoingRedoing||Jl(b,a)}}function bm(a){var b=a.diagram;null===b||b.undoManager.isUndoingRedoing||(a instanceof W?a instanceof V?a.yd():a.fl(a,function(a){am(a)}):am(a))}t.bind=function(a){a.vd=this;var b=this.tj();null!==b&&cm(b)&&v("Cannot add a Binding to a template that has already been copied: "+a);null===this.lb&&(this.lb=new H);this.lb.add(a)};
1002 t.tj=function(){for(var a=this instanceof W?this:this.panel;null!==a;){if(null!==a.xi)return a;a=a.panel}return null};t.Tw=function(a){Pj(this,a)};t.gx=function(a){a.vd=this;null===this.Yg&&(this.Yg=new Bb);this.Yg.add(a.propertyName,a)};
1003 function dm(a,b){for(var c=1;c<arguments.length;++c);c=arguments;var d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var f=em.J(a);"function"===typeof f?(c=Ja(arguments),d=f(c),Ga(d)||v('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=qa.go[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||v("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);e=1;if(d instanceof R&&1<c.length){f=
1004 d;var g=c[1];if("string"===typeof g||g instanceof HTMLDivElement)Pi(f,g),e++}for(;e<c.length;e++)f=c[e],void 0===f?v("Undefined value at argument "+e+" for object being constructed by GraphObject.make: "+d):fm(d,f);return d}
1005 function fm(a,b){if("string"===typeof b)if(a instanceof ih)a.text=b;else if(a instanceof Uf)a.figure=b;else if(a instanceof rk)a.source=b;else if(a instanceof W){var c=gm.J(b);null!==c?a.type=c:F&&v("Unknown Panel type as an argument to GraphObject.make: "+b+". If building from source, you may need to call Panel.definePanelLayout.")}else a instanceof Ol?(c=fb(Ol,b),null!==c?a.type=c:v("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof zd?(c=fb(zd,b),null!==c?a.type=c:F&&v("Unknown Geometry type as an argument to GraphObject.make: "+
1006 b)):a instanceof we?(c=fb(we,b),null!==c?a.type=c:F&&v("Unknown PathSegment type as an argument to GraphObject.make: "+b)):F&&v("Unable to use a string as an argument to GraphObject.make: "+b);else if(b instanceof O)a instanceof W||v("A GraphObject can only be added to a Panel, not to: "+a),a.add(b);else if(b instanceof jk){var d;b.isRow&&"function"===typeof a.getRowDefinition?d=a.getRowDefinition(b.index):b.isRow||"function"!==typeof a.getColumnDefinition||(d=a.getColumnDefinition(b.index));d instanceof
1007 jk?d.vy(b):v("A RowColumnDefinition can only be added to an object that implements getRowDefinition/getColumnDefinition, not to: "+a)}else if(b instanceof E)"function"===typeof a.pb?a.pb(b):Da(a,b);else if(b instanceof hm)a.type=b;else if(b instanceof Ui)a instanceof O?a.bind(b):a instanceof jk?a.bind(b):v("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof si)a instanceof O?a.gx(b):v("An AnimationTrigger can only be applied to a GraphObject, not to: "+
1008 a);else if(b instanceof ve)a instanceof zd?a.figures.add(b):v("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof we)a instanceof ve?a.segments.add(b):v("A PathSegment can only be added to a PathFigure, not to: "+a);else if(b instanceof Ni)a instanceof R?a.layout=b:a instanceof If?a.layout=b:v("A Layout can only be assigned to a Diagram or a Group, not to: "+a);else if(Array.isArray(b))for(c=0;c<b.length;c++)fm(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof
1009 Ol){c=new ib;for(var e in b)d=parseFloat(e),isNaN(d)?c[e]=b[e]:a.addColorStop(d,b[e]);Pj(a,c)}else if(a instanceof jk){void 0!==b.row?(e=b.row,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&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 ib;for(c in b)"row"!==
1010 c&&"column"!==c&&(e[c]=b[c]);Pj(a,e)}else Pj(a,b);else v('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}function im(a,b){A(a,"string",O,"defineBuilder:name");A(b,"function",O,"defineBuilder:func");var c=a.toLowerCase();F&&(""===a||"none"===c||a===c)&&v("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);em.add(a,b)}
1011 function jm(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}
1012 na.Object.defineProperties(O.prototype,{shadowVisible:{configurable:!0,get:function(){return this.rm},set:function(a){var b=this.rm;b!==a&&(F&&null!==a&&A(a,"boolean",O,"shadowVisible"),this.rm=a,this.P(),this.g("shadowVisible",b,a))}},enabledChanged:{configurable:!0,get:function(){return null!==this.R?this.R.ko:null},set:function(a){wl(this);var b=this.R.ko;b!==a&&(null!==a&&A(a,"function",O,"enabledChanged"),this.R.ko=a,this.g("enabledChanged",b,a))}},segmentOrientation:{configurable:!0,
1013 enumerable:!0,get:function(){return this.pm},set:function(a){var b=this.pm;b!==a&&(F&&gb(a,S,O,"segmentOrientation"),this.pm=a,this.u(),this.g("segmentOrientation",b,a),a===ng&&(this.angle=0))}},segmentIndex:{configurable:!0,get:function(){return this.cq},set:function(a){F&&A(a,"number",O,"segmentIndex");a=Math.round(a);var b=this.cq;b!==a&&(this.cq=a,this.u(),this.g("segmentIndex",b,a))}},segmentFraction:{configurable:!0,get:function(){return this.nm},set:function(a){F&&
1014 A(a,"number",O,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.nm;b!==a&&(this.nm=a,this.u(),this.g("segmentFraction",b,a))}},segmentOffset:{configurable:!0,get:function(){return this.om},set:function(a){var b=this.om;b.A(a)||(F&&w(a,J,O,"segmentOffset"),this.om=a=a.K(),this.u(),this.g("segmentOffset",b,a))}},stretch:{configurable:!0,get:function(){return this.Pe},set:function(a){var b=this.Pe;b!==a&&(F&&gb(a,O,O,"stretch"),this.Pe=a,this.u(),this.g("stretch",
1015 b,a))}},name:{configurable:!0,get:function(){return this.va},set:function(a){var b=this.va;b!==a&&(F&&A(a,"string",O,"name"),this.va=a,null!==this.part&&(this.part.ik=null),this.g("name",b,a))}},opacity:{configurable:!0,get:function(){return this.nb},set:function(a){var b=this.nb;b!==a&&(A(a,"number",O,"opacity"),(0>a||1<a)&&za(a,"0 <= value <= 1",O,"opacity"),this.nb=a,this.g("opacity",b,a),a=this.diagram,b=this.part,null!==a&&null!==b&&a.P(Tj(b,b.actualBounds)))}},visible:{configurable:!0,
1016 enumerable:!0,get:function(){return 0!==(this.I&1)},set:function(a){var b=0!==(this.I&1);b!==a&&(F&&A(a,"boolean",O,"visible"),this.I^=1,this.g("visible",b,a),b=this.panel,null!==b?b.u():this.Rf()&&this.Ub(a),this.P(),bm(this))}},pickable:{configurable:!0,get:function(){return 0!==(this.I&2)},set:function(a){var b=0!==(this.I&2);b!==a&&(F&&A(a,"boolean",O,"pickable"),this.I^=2,this.g("pickable",b,a))}},fromLinkableDuplicates:{configurable:!0,get:function(){return 0!==(this.I&
1017 4)},set:function(a){var b=0!==(this.I&4);b!==a&&(F&&A(a,"boolean",O,"fromLinkableDuplicates"),this.I^=4,this.g("fromLinkableDuplicates",b,a))}},fromLinkableSelfNode:{configurable:!0,get:function(){return 0!==(this.I&8)},set:function(a){var b=0!==(this.I&8);b!==a&&(F&&A(a,"boolean",O,"fromLinkableSelfNode"),this.I^=8,this.g("fromLinkableSelfNode",b,a))}},toLinkableDuplicates:{configurable:!0,get:function(){return 0!==(this.I&16)},set:function(a){var b=0!==(this.I&16);b!==
1018 a&&(F&&A(a,"boolean",O,"toLinkableDuplicates"),this.I^=16,this.g("toLinkableDuplicates",b,a))}},toLinkableSelfNode:{configurable:!0,get:function(){return 0!==(this.I&32)},set:function(a){var b=0!==(this.I&32);b!==a&&(F&&A(a,"boolean",O,"toLinkableSelfNode"),this.I^=32,this.g("toLinkableSelfNode",b,a))}},isPanelMain:{configurable:!0,get:function(){return 0!==(this.I&64)},set:function(a){var b=0!==(this.I&64);b!==a&&(F&&A(a,"boolean",O,"isPanelMain"),this.I^=64,this.u(),
1019 this.g("isPanelMain",b,a))}},isActionable:{configurable:!0,get:function(){return 0!==(this.I&128)},set:function(a){var b=0!==(this.I&128);b!==a&&(F&&A(a,"boolean",O,"isActionable"),this.I^=128,this.g("isActionable",b,a))}},areaBackground:{configurable:!0,get:function(){return this.kc},set:function(a){var b=this.kc;b!==a&&(null!==a&&km(a,"GraphObject.areaBackground"),a instanceof Ol&&a.freeze(),this.kc=a,this.P(),this.g("areaBackground",b,a))}},background:{configurable:!0,
1020 enumerable:!0,get:function(){return this.rb},set:function(a){var b=this.rb;b!==a&&(null!==a&&km(a,"GraphObject.background"),a instanceof Ol&&a.freeze(),this.rb=a,this.P(),this.g("background",b,a))}},part:{configurable:!0,get:function(){if(this.Rf())return this;if(null!==this.mk)return this.mk;var a;for(a=this.panel;a;){if(a instanceof U)return this.mk=a;a=a.panel}return null}},svg:{configurable:!0,get:function(){return this.tq},set:function(a){this.tq=a}},panel:{configurable:!0,
1021 enumerable:!0,get:function(){return this.Ag}},layer:{configurable:!0,get:function(){var a=this.part;return null!==a?a.layer:null}},diagram:{configurable:!0,get:function(){var a=this.part;return null!==a?a.diagram:null}},position:{configurable:!0,get:function(){return this.ra},set:function(a){F&&w(a,J,O,"position");var b=a.x,c=a.y,d=this.ra,e=d.x,f=d.y;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))?this.yu():(a=a.copy(),this.Sw(a,d)&&this.g("position",
1022 d.copy(),a.copy()))}},actualBounds:{configurable:!0,get:function(){return this.Cb}},scale:{configurable:!0,get:function(){return this.Ga},set:function(a){var b=this.Ga;b!==a&&(F&&C(a,O,"scale"),0>=a&&v("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.Ga=a,this.u(),this.g("scale",b,a))}},angle:{configurable:!0,get:function(){return this.dc},set:function(a){var b=this.dc;b!==a&&(F&&C(a,O,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.dc=
1023 a,bm(this),this.u(),this.g("angle",b,a)))}},desiredSize:{configurable:!0,get:function(){return this.cd},set:function(a){F&&w(a,Fb,O,"desiredSize");var b=a.width,c=a.height,d=this.cd,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.cd=a=a.K(),this.u(),this instanceof Uf&&this.jc(),this.g("desiredSize",d,a),zl(this)&&(a=this.part,null!==a&&(Al(this,a,"width"),Al(this,a,"height"))))}},width:{configurable:!0,get:function(){return this.cd.width},
1024 set:function(a){var b=this.cd.width;b===a||isNaN(b)&&isNaN(a)||(F&&A(a,"number",O,"width"),b=this.cd,this.cd=a=(new Fb(a,this.cd.height)).freeze(),this.u(),this instanceof Uf&&this.jc(),this.g("desiredSize",b,a),zl(this)&&(a=this.part,null!==a&&Al(this,a,"width")))}},height:{configurable:!0,get:function(){return this.cd.height},set:function(a){var b=this.cd.height;b===a||isNaN(b)&&isNaN(a)||(F&&A(a,"number",O,"height"),b=this.cd,this.cd=a=(new Fb(this.cd.width,a)).freeze(),this.u(),
1025 this instanceof Uf&&this.jc(),this.g("desiredSize",b,a),zl(this)&&(a=this.part,null!==a&&Al(this,a,"height")))}},minSize:{configurable:!0,get:function(){return this.rg},set:function(a){var b=this.rg;b.A(a)||(F&&w(a,Fb,O,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.rg=a,this.u(),this.g("minSize",b,a))}},maxSize:{configurable:!0,get:function(){return this.qg},set:function(a){var b=this.qg;b.A(a)||(F&&w(a,Fb,O,"maxSize"),
1026 a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.qg=a,this.u(),this.g("maxSize",b,a))}},measuredBounds:{configurable:!0,get:function(){return this.vc}},naturalBounds:{configurable:!0,get:function(){return this.wc}},margin:{configurable:!0,get:function(){return this.vh},set:function(a){"number"===typeof a?a=new hc(a):F&&w(a,hc,O,"margin");var b=this.vh;b.A(a)||(this.vh=a=a.K(),this.u(),this.g("margin",b,a))}},
1027 transform:{configurable:!0,get:function(){0!==(this.I&2048)===!0&&Ll(this);return this.xb}},Md:{configurable:!0,get:function(){0!==(this.I&4096)===!0&&Ll(this);return this.ji}},alignment:{configurable:!0,get:function(){return this.Db},set:function(a){var b=this.Db;b.A(a)||(F&&w(a,N,O,"alignment"),a.Sb()&&!a.Ib()&&v("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Db=a=a.K(),Xl(this),this.g("alignment",b,a))}},column:{configurable:!0,
1028 enumerable:!0,get:function(){return this.dh},set:function(a){F&&C(a,O,"column");a=Math.round(a);var b=this.dh;b!==a&&(0>a&&za(a,">= 0",O,"column"),this.dh=a,this.u(),this.g("column",b,a))}},columnSpan:{configurable:!0,get:function(){return this.Mn},set:function(a){F&&A(a,"number",O,"columnSpan");a=Math.round(a);var b=this.Mn;b!==a&&(1>a&&za(a,">= 1",O,"columnSpan"),this.Mn=a,this.u(),this.g("columnSpan",b,a))}},row:{configurable:!0,get:function(){return this.Wp},set:function(a){F&&
1029 C(a,O,"row");a=Math.round(a);var b=this.Wp;b!==a&&(0>a&&za(a,">= 0",O,"row"),this.Wp=a,this.u(),this.g("row",b,a))}},rowSpan:{configurable:!0,get:function(){return this.Xp},set:function(a){F&&A(a,"number",O,"rowSpan");a=Math.round(a);var b=this.Xp;b!==a&&(1>a&&za(a,">= 1",O,"rowSpan"),this.Xp=a,this.u(),this.g("rowSpan",b,a))}},spanAllocation:{configurable:!0,get:function(){return this.oq},set:function(a){var b=this.oq;b!==a&&(null!==a&&A(a,"function",O,"spanAllocation"),
1030 this.oq=a,this.u(),this.g("spanAllocation",b,a))}},alignmentFocus:{configurable:!0,get:function(){return this.ll},set:function(a){var b=this.ll;b.A(a)||(F&&w(a,N,O,"alignmentFocus"),!F||!a.Sb()||a.Ib()||a.br()&&this instanceof V||v("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.ll=a=a.K(),this.u(),this.g("alignmentFocus",b,a))}},portId:{configurable:!0,get:function(){return this.Kp},set:function(a){var b=this.Kp;if(b!==a){F&&null!==a&&A(a,
1031 "string",O,"portId");var c=this.part;null===c||c instanceof V||(v("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&lm(c,this);this.Kp=a;null!==a&&null!==c&&(c.Yh=!0,mm(c,this));this.g("portId",b,a)}}},toSpot:{configurable:!0,get:function(){return null!==this.S?this.S.Nh:Bc},set:function(a){this.Qc();var b=this.S.Nh;b.A(a)||(F&&w(a,N,O,"toSpot"),a=a.K(),this.S.Nh=a,this.g("toSpot",b,a),am(this))}},toEndSegmentLength:{configurable:!0,get:function(){return null!==
1032 this.S?this.S.Lh:10},set:function(a){this.Qc();var b=this.S.Lh;b!==a&&(F&&A(a,"number",O,"toEndSegmentLength"),0>a&&za(a,">= 0",O,"toEndSegmentLength"),this.S.Lh=a,this.g("toEndSegmentLength",b,a),am(this))}},toShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.Mh:0},set:function(a){this.Qc();var b=this.S.Mh;b!==a&&(F&&A(a,"number",O,"toShortLength"),this.S.Mh=a,this.g("toShortLength",b,a),am(this))}},toLinkable:{configurable:!0,get:function(){return null!==
1033 this.S?this.S.xq:null},set:function(a){this.Qc();var b=this.S.xq;b!==a&&(F&&null!==a&&A(a,"boolean",O,"toLinkable"),this.S.xq=a,this.g("toLinkable",b,a))}},toMaxLinks:{configurable:!0,get:function(){return null!==this.S?this.S.yq:Infinity},set:function(a){this.Qc();var b=this.S.yq;b!==a&&(F&&A(a,"number",O,"toMaxLinks"),0>a&&za(a,">= 0",O,"toMaxLinks"),this.S.yq=a,this.g("toMaxLinks",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.S?this.S.oh:Bc},set:function(a){this.Qc();
1034 var b=this.S.oh;b.A(a)||(F&&w(a,N,O,"fromSpot"),a=a.K(),this.S.oh=a,this.g("fromSpot",b,a),am(this))}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.S?this.S.mh:10},set:function(a){this.Qc();var b=this.S.mh;b!==a&&(F&&A(a,"number",O,"fromEndSegmentLength"),0>a&&za(a,">= 0",O,"fromEndSegmentLength"),this.S.mh=a,this.g("fromEndSegmentLength",b,a),am(this))}},fromShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.nh:0},set:function(a){this.Qc();
1035 var b=this.S.nh;b!==a&&(F&&A(a,"number",O,"fromShortLength"),this.S.nh=a,this.g("fromShortLength",b,a),am(this))}},fromLinkable:{configurable:!0,get:function(){return null!==this.S?this.S.ro:null},set:function(a){this.Qc();var b=this.S.ro;b!==a&&(F&&null!==a&&A(a,"boolean",O,"fromLinkable"),this.S.ro=a,this.g("fromLinkable",b,a))}},fromMaxLinks:{configurable:!0,get:function(){return null!==this.S?this.S.so:Infinity},set:function(a){this.Qc();var b=this.S.so;b!==a&&(F&&
1036 A(a,"number",O,"fromMaxLinks"),0>a&&za(a,">= 0",O,"fromMaxLinks"),this.S.so=a,this.g("fromMaxLinks",b,a))}},cursor:{configurable:!0,get:function(){return this.Ai},set:function(a){var b=this.Ai;b!==a&&(A(a,"string",O,"cursor"),this.Ai=a,this.g("cursor",b,a))}},click:{configurable:!0,get:function(){return null!==this.R?this.R.ag:null},set:function(a){wl(this);var b=this.R.ag;b!==a&&(null!==a&&A(a,"function",O,"click"),this.R.ag=a,this.g("click",b,a))}},doubleClick:{configurable:!0,
1037 enumerable:!0,get:function(){return null!==this.R?this.R.fg:null},set:function(a){wl(this);var b=this.R.fg;b!==a&&(null!==a&&A(a,"function",O,"doubleClick"),this.R.fg=a,this.g("doubleClick",b,a))}},contextClick:{configurable:!0,get:function(){return null!==this.R?this.R.bg:null},set:function(a){wl(this);var b=this.R.bg;b!==a&&(null!==a&&A(a,"function",O,"contextClick"),this.R.bg=a,this.g("contextClick",b,a))}},mouseEnter:{configurable:!0,get:function(){return null!==this.R?
1038 this.R.tg:null},set:function(a){wl(this);var b=this.R.tg;b!==a&&(null!==a&&A(a,"function",O,"mouseEnter"),this.R.tg=a,this.g("mouseEnter",b,a))}},mouseLeave:{configurable:!0,get:function(){return null!==this.R?this.R.wg:null},set:function(a){wl(this);var b=this.R.wg;b!==a&&(null!==a&&A(a,"function",O,"mouseLeave"),this.R.wg=a,this.g("mouseLeave",b,a))}},mouseOver:{configurable:!0,get:function(){return null!==this.R?this.R.xg:null},set:function(a){wl(this);var b=this.R.xg;
1039 b!==a&&(null!==a&&A(a,"function",O,"mouseOver"),this.R.xg=a,this.g("mouseOver",b,a))}},mouseHover:{configurable:!0,get:function(){return null!==this.R?this.R.vg:null},set:function(a){wl(this);var b=this.R.vg;b!==a&&(null!==a&&A(a,"function",O,"mouseHover"),this.R.vg=a,this.g("mouseHover",b,a))}},mouseHold:{configurable:!0,get:function(){return null!==this.R?this.R.ug:null},set:function(a){wl(this);var b=this.R.ug;b!==a&&(null!==a&&A(a,"function",O,"mouseHold"),this.R.ug=
1040 a,this.g("mouseHold",b,a))}},mouseDragEnter:{configurable:!0,get:function(){return null!==this.R?this.R.np:null},set:function(a){wl(this);var b=this.R.np;b!==a&&(null!==a&&A(a,"function",O,"mouseDragEnter"),this.R.np=a,this.g("mouseDragEnter",b,a))}},mouseDragLeave:{configurable:!0,get:function(){return null!==this.R?this.R.op:null},set:function(a){wl(this);var b=this.R.op;b!==a&&(null!==a&&A(a,"function",O,"mouseDragLeave"),this.R.op=a,this.g("mouseDragLeave",b,a))}},
1041 mouseDrop:{configurable:!0,get:function(){return null!==this.R?this.R.sg:null},set:function(a){wl(this);var b=this.R.sg;b!==a&&(null!==a&&A(a,"function",O,"mouseDrop"),this.R.sg=a,this.g("mouseDrop",b,a))}},actionDown:{configurable:!0,get:function(){return null!==this.R?this.R.un:null},set:function(a){wl(this);var b=this.R.un;b!==a&&(null!==a&&A(a,"function",O,"actionDown"),this.R.un=a,this.g("actionDown",b,a))}},actionMove:{configurable:!0,get:function(){return null!==
1042 this.R?this.R.vn:null},set:function(a){wl(this);var b=this.R.vn;b!==a&&(null!==a&&A(a,"function",O,"actionMove"),this.R.vn=a,this.g("actionMove",b,a))}},actionUp:{configurable:!0,get:function(){return null!==this.R?this.R.wn:null},set:function(a){wl(this);var b=this.R.wn;b!==a&&(null!==a&&A(a,"function",O,"actionUp"),this.R.wn=a,this.g("actionUp",b,a))}},actionCancel:{configurable:!0,get:function(){return null!==this.R?this.R.tn:null},set:function(a){wl(this);var b=this.R.tn;
1043 b!==a&&(null!==a&&A(a,"function",O,"actionCancel"),this.R.tn=a,this.g("actionCancel",b,a))}},toolTip:{configurable:!0,get:function(){return null!==this.R?this.R.Ig:null},set:function(a){wl(this);var b=this.R.Ig;b!==a&&(!F||null===a||a instanceof Ve||a instanceof ef||v("GraphObject.toolTip must be an Adornment or HTMLInfo."),this.R.Ig=a,this.g("toolTip",b,a))}},contextMenu:{configurable:!0,get:function(){return null!==this.R?this.R.cg:null},set:function(a){wl(this);var b=
1044 this.R.cg;b!==a&&(!F||a instanceof Ve||a instanceof ef||v("GraphObject.contextMenu must be an Adornment or HTMLInfo."),this.R.cg=a,this.g("contextMenu",b,a))}}});O.prototype.trigger=O.prototype.gx;O.prototype.setProperties=O.prototype.Tw;O.prototype.findTemplateBinder=O.prototype.tj;O.prototype.bind=O.prototype.bind;O.prototype.isEnabledObject=O.prototype.Tg;O.prototype.isVisibleObject=O.prototype.Sf;O.prototype.isContainedBy=O.prototype.Sg;O.prototype.getNearestIntersectionPoint=O.prototype.$t;
1045 O.prototype.getLocalPoint=O.prototype.Zt;O.prototype.getDocumentScale=O.prototype.Mf;O.prototype.getDocumentAngle=O.prototype.wj;O.prototype.getDocumentBounds=O.prototype.xj;O.prototype.getDocumentPoint=O.prototype.ja;O.prototype.intersectsRect=O.prototype.Sc;O.prototype.containedInRect=O.prototype.Uh;O.prototype.containsRect=O.prototype.Te;O.prototype.containsPoint=O.prototype.ca;O.prototype.raiseChanged=O.prototype.g;O.prototype.raiseChangedEvent=O.prototype.ab;O.prototype.addCopyProperty=O.prototype.jy;
1046 var em=null;O.className="GraphObject";em=new Bb;
1047 im("Button",function(){function a(a,b){return null!==a.diagram.ac(a.documentPoint,function(a){for(;null!==a.panel&&!a.isActionable;)a=a.panel;return a},function(a){return a===b})}var b=dm(W,W.Auto,{isActionable:!0,enabledChanged:function(a,b){if(a instanceof W){var c=a.ib("ButtonBorder");null!==c&&(c.fill=b?a._buttonFillNormal:a._buttonFillDisabled)}},cursor:"pointer",_buttonFillNormal:"#F5F5F5",_buttonStrokeNormal:"#BDBDBD",_buttonFillOver:"#E0E0E0",_buttonStrokeOver:"#9E9E9E",_buttonFillPressed:"#BDBDBD",
1048 _buttonStrokePressed:"#9E9E9E",_buttonFillDisabled:"#E5E5E5"},dm(Uf,{name:"ButtonBorder",figure:"RoundedRectangle",spot1:new N(0,0,2.76142374915397,2.761423749153969),spot2:new N(1,1,-2.76142374915397,-2.761423749153969),parameter1:2,parameter2:2,fill:"#F5F5F5",stroke:"#BDBDBD"}));b.mouseEnter=function(a,b){if(b.Tg()&&b instanceof W&&(a=b.ib("ButtonBorder"),a instanceof Uf)){var c=b._buttonFillOver;b._buttonFillNormal=a.fill;a.fill=c;c=b._buttonStrokeOver;b._buttonStrokeNormal=a.stroke;a.stroke=c}};
1049 b.mouseLeave=function(a,b){b.Tg()&&b instanceof W&&(a=b.ib("ButtonBorder"),a instanceof Uf&&(a.fill=b._buttonFillNormal,a.stroke=b._buttonStrokeNormal))};b.actionDown=function(a,b){if(b.Tg()&&b instanceof W&&null!==b._buttonFillPressed&&0===a.button){var c=b.ib("ButtonBorder");if(c instanceof Uf){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=
1050 d}}};b.actionUp=function(b,d){if(d.Tg()&&d instanceof W&&null!==d._buttonFillPressed&&0===b.button){var c=d.ib("ButtonBorder");if(c instanceof Uf){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.Tg()&&d instanceof W&&null!==d._buttonFillPressed){var c=d.ib("ButtonBorder");if(c instanceof Uf){var f=b.diagram,
1051 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.Tg()&&d instanceof W&&null!==d._buttonFillPressed){var c=b.diagram;if(0===c.firstInput.button&&(c.currentTool.standardMouseOver(),a(b,d)&&(b=d.ib("ButtonBorder"),b instanceof Uf))){var f=c.skipsUndoManager;c.skipsUndoManager=!0;var g=d._buttonFillPressed;b.fill!==g&&(b.fill=g);g=
1052 d._buttonStrokePressed;b.stroke!==g&&(b.stroke=g);c.skipsUndoManager=f}}};return b});
1053 im("TreeExpanderButton",function(){var a=dm("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},dm(Uf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ub},(new Ui("figure","isTreeExpanded",function(a,c){c=c.panel;return a?c._treeExpandedFigure:c._treeCollapsedFigure})).hr()),{visible:!1},(new Ui("visible","isTreeLeaf",function(a){return!a})).hr());a.click=function(a,c){c=c.part;c instanceof Ve&&(c=c.adornedPart);if(c instanceof V){var b=c.diagram;
1054 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});
1055 im("SubGraphExpanderButton",function(){var a=dm("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},dm(Uf,{name:"ButtonIcon",figure:"MinusLine",stroke:"#424242",strokeWidth:2,desiredSize:Ub},(new Ui("figure","isSubGraphExpanded",function(a,c){c=c.panel;return a?c._subGraphExpandedFigure:c._subGraphCollapsedFigure})).hr()));a.click=function(a,c){c=c.part;c instanceof Ve&&(c=c.adornedPart);if(c instanceof If){var b=c.diagram;if(null!==b){b=b.commandHandler;if(c.isSubGraphExpanded){if(!b.canCollapseSubGraph(c))return}else if(!b.canExpandSubGraph(c))return;
1056 a.handled=!0;c.isSubGraphExpanded?b.collapseSubGraph(c):b.expandSubGraph(c)}}};return a});im("ToolTip",function(){return dm(Ve,W.Auto,{isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},dm(Uf,{name:"Border",figure:"RoundedRectangle",parameter1:1,parameter2:1,fill:"#F5F5F5",stroke:"#F0F0F0",spot1:new N(0,0,4,6),spot2:new N(1,1,-4,-4)}))});
1057 im("ContextMenu",function(){return dm(Ve,W.Vertical,{background:"#F5F5F5",isShadowed:!0,shadowColor:"rgba(0, 0, 0, .4)",shadowOffset:new J(0,3),shadowBlur:5},new Ui("background","",function(a){return null!==a.adornedPart&&null!==a.placeholder?null:"#F5F5F5"}))});im("ContextMenuButton",function(){var a=dm("Button");a.stretch=ql;var b=a.ib("ButtonBorder");b instanceof Uf&&(b.figure="Rectangle",b.strokeWidth=0,b.spot1=new N(0,0,2,3),b.spot2=new N(1,1,-2,-2));return a});
1058 im("PanelExpanderButton",function(a){var b=jm(a,"COLLAPSIBLE"),c=dm("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},dm(Uf,{name:"ButtonIcon",strokeWidth:2},(new Ui("geometryString","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).hr(b)));
1059 a=c.ib("ButtonBorder");a instanceof Uf&&(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.tj();null===e&&(e=c.part);null!==e&&(c=e.ib(b),null!==c&&(a.handled=!0,d.Ca("Collapse/Expand Panel"),c.visible=!c.visible,d.cb("Collapse/Expand Panel")))}};return c});
1060 im("CheckBoxButton",function(a){var b=jm(a);a=dm("Button",{desiredSize:new Fb(14,14)},dm(Uf,{name:"ButtonIcon",geometryString:"M0 0 M0 8.85 L4.9 13.75 16.2 2.45 M16.2 16.2",strokeWidth:2,stretch:Bd,geometryStretch:Og,visible:!1},""!==b?(new Ui("visible",b)).Yy():[]));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.ib("ButtonIcon");c.Ca("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a,
1061 d);c.cb("checkbox")}}};return a});
1062 im("CheckBox",function(a){a=jm(a);a=dm("CheckBoxButton",a,{name:"Button",isActionable:!1,margin:new hc(0,1,0,0)});var b=dm(W,"Horizontal",a,{isActionable:!0,cursor:a.cursor,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillPressed:a._buttonFillPressed,_buttonStrokePressed:a._buttonStrokePressed,_buttonFillDisabled:a._buttonFillDisabled,mouseEnter:a.mouseEnter,mouseLeave:a.mouseLeave,
1063 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});O.None=zg=new E(O,"None",0);O.Default=pl=new E(O,"Default",0);O.Vertical=rl=new E(O,"Vertical",4);O.Horizontal=ql=new E(O,"Horizontal",5);O.Fill=Bd=new E(O,"Fill",3);O.Uniform=Og=new E(O,"Uniform",1);
1064 O.UniformToFill=sl=new E(O,"UniformToFill",2);O.FlipVertical=tl=new E(O,"FlipVertical",1);O.FlipHorizontal=ul=new E(O,"FlipHorizontal",2);O.FlipBoth=vl=new E(O,"FlipBoth",3);O.make=dm;O.getBuilders=function(){var a=new Bb,b;for(b in em)if(b!==b.toLowerCase()){var c=em.J(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};O.defineBuilder=im;O.takeBuilderArgument=jm;
1065 function xl(){this.ko=this.cg=this.Ig=this.tn=this.wn=this.vn=this.un=this.sg=this.op=this.np=this.ug=this.vg=this.xg=this.wg=this.tg=this.bg=this.fg=this.ag=null}xl.prototype.copy=function(){var a=new xl;a.ag=this.ag;a.fg=this.fg;a.bg=this.bg;a.tg=this.tg;a.wg=this.wg;a.xg=this.xg;a.vg=this.vg;a.ug=this.ug;a.np=this.np;a.op=this.op;a.sg=this.sg;a.un=this.un;a.vn=this.vn;a.wn=this.wn;a.tn=this.tn;a.Ig=this.Ig;a.cg=this.cg;a.ko=this.ko;return a};xl.className="GraphObjectEventHandlers";
1066 function nm(){this.Ua=[1,0,0,1,0,0]}nm.prototype.copy=function(){var a=new nm;a.Ua[0]=this.Ua[0];a.Ua[1]=this.Ua[1];a.Ua[2]=this.Ua[2];a.Ua[3]=this.Ua[3];a.Ua[4]=this.Ua[4];a.Ua[5]=this.Ua[5];return a};nm.prototype.translate=function(a,b){this.Ua[4]+=this.Ua[0]*a+this.Ua[2]*b;this.Ua[5]+=this.Ua[1]*a+this.Ua[3]*b};nm.prototype.scale=function(a,b){this.Ua[0]*=a;this.Ua[1]*=a;this.Ua[2]*=b;this.Ua[3]*=b};nm.className="STransform";
1067 function om(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.sy=[];this.pattern=null}om.prototype.addColorStop=function(a,b){this.sy.push({offset:a,color:b})};om.className="SGradient";
1068 function Sj(a,b){this.ownerDocument=a=void 0===b?qa.document:b;this.eB="http://www.w3.org/2000/svg";void 0!==a&&(this.Oa=this.Vb("svg",{width:"1px",height:"1px",viewBox:"0 0 1 1"}),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg"),this.Oa.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink"));this.Qq=null;this.context=new pm(this)}
1069 Sj.prototype.resize=function(a,b,c,d){return this.width!==a||this.height!==b?(this.style.width=c+"px",this.style.height=d+"px",this.Oa.setAttributeNS(null,"width",c+"px"),this.Oa.setAttributeNS(null,"height",d+"px"),this.Oa.setAttributeNS(null,"viewBox","0 0 "+c+" "+d),this.context.Qx.firstElementChild.setAttributeNS(null,"width",c+"px"),this.context.Qx.firstElementChild.setAttributeNS(null,"height",d+"px"),!0):!1};
1070 Sj.prototype.Vb=function(a,b,c){a=this.ownerDocument.createElementNS(this.eB,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};Sj.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()};Sj.prototype.focus=function(){this.Oa.focus()};Sj.prototype.zy=function(){this.ownerDocument=null};
1071 na.Object.defineProperties(Sj.prototype,{width:{configurable:!0,get:function(){return this.Oa.width.baseVal.value},set:function(a){this.Oa.width=a}},height:{configurable:!0,get:function(){return this.Oa.height.baseVal.value},set:function(a){this.Oa.height=a}},style:{configurable:!0,get:function(){return this.Oa.style}}});Sj.className="SVGSurface";
1072 function pm(a){this.Au=a;this.svg=a.Oa;this.stack=[];this.nd=[];this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.lineDashOffset=0;this.lineJoin="miter";this.lineWidth=1;this.miterLimit=10;this.shadowBlur=0;this.shadowColor="rgba(0, 0, 0, 0)";this.shadowOffsetY=this.shadowOffsetX=0;this.strokeStyle="#000000";this.textAlign="start";this.clipInsteadOfFill=!1;this.Gg=this.st=this.rt=0;this.iu=null;this.path=[];this.hv=!1;this.Fh=null;this.Gh=0;this.Ue=new nm;
1073 qm(this,1,0,0,1,0,0);var b=wb++,c=this.Vb("clipPath",{id:"mainClip"+b});c.appendChild(this.Vb("rect",{x:0,y:0,width:a.width,height:a.height}));this.Qx=c;this.Au.Oa.appendChild(c);this.nd[0].setAttributeNS(null,"clip-path","url(#mainClip"+b+")");this.gB={}}t=pm.prototype;
1074 t.arc=function(a,b,c,d,e,f,g,h){var k=2*Math.PI,l=k-1E-6,m=c*Math.cos(d),n=c*Math.sin(d),p=a+m,r=b+n,q=f?0:1;d=f?d-e:e-d;(1E-6<Math.abs(g-p)||1E-6<Math.abs(h-r))&&this.path.push(["L",p,+r]);0>d&&(d=d%k+k);d>l?(this.path.push(["A",c,c,0,1,q,a-m,b-n]),this.path.push(["A",c,c,0,1,q,p,r])):1E-6<d&&this.path.push(["A",c,c,0,+(d>=Math.PI),q,a+c*Math.cos(e),b+c*Math.sin(e)])};t.beginPath=function(){this.path=[]};t.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};t.clearRect=function(){};
1075 t.clip=function(){this.addPath("clipPath",this.path,this.Ue)};t.closePath=function(){this.path.push(["z"])};t.createLinearGradient=function(a,b,c,d){var e=new om("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};
1076 t.createPattern=function(a){var b="";a instanceof HTMLCanvasElement&&(b=a.toDataURL());a instanceof HTMLImageElement&&(b=a.getAttribute("src"));var c=this.gB;if(c[b])return"url(#"+c[b]+")";var d="PATTERN"+wb++,e={x:0,y:0,width:a.width,height:a.height,href:b};a=this.Vb("pattern",{width:a.width,height:a.height,id:d,patternUnits:"userSpaceOnUse"});a.appendChild(this.Vb(Uk,e));this.svg.appendChild(a);c[b]=d;return"url(#"+d+")"};
1077 t.createRadialGradient=function(a,b,c,d,e,f){var g=new om("radial");g.x1=a;g.y1=b;g.r1=c;g.x2=d;g.y2=e;g.r2=f;return g};
1078 t.drawImage=function(a,b,c,d,e,f,g,h,k){var l="";a instanceof HTMLCanvasElement&&(l=a.toDataURL());a instanceof HTMLImageElement&&(l=a.getAttribute("src"));var m=a instanceof HTMLImageElement?a.naturalWidth:a.width,n=a instanceof HTMLImageElement?a.naturalHeight:a.height;void 0===d&&(f=b,g=c,h=d=m,k=e=n);d=d||0;e=e||0;f=f||0;g=g||0;h=h||0;k=k||0;a={x:0,y:0,width:m||d,height:n||e,href:l};K.da(d,h)&&K.da(e,k)?-1===l.toLowerCase().indexOf(".svg")&&-1===l.toLowerCase().indexOf("data:image/svg")&&(a.preserveAspectRatio=
1079 "xMidYMid slice"):a.preserveAspectRatio="none";l="";h/=d;k/=e;if(0!==f||0!==g)l+=" translate("+f+", "+g+")";if(1!==h||1!==k)l+=" scale("+h+", "+k+")";if(0!==b||0!==c)l+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==m||e!==n)f="CLIP"+wb++,g=this.Vb("clipPath",{id:f}),g.appendChild(this.Vb("rect",{x:b,y:c,width:d,height:e})),this.svg.appendChild(g),a["clip-path"]="url(#"+f+")";rm(this,Uk,a,this.Ue,l);this.addElement(Uk,a)};t.fill=function(){this.addPath("fill",this.path,this.Ue)};
1080 t.We=function(){this.clipInsteadOfFill?this.clip():this.fill()};t.fillRect=function(a,b,c,d){a=[a,b,c,d];a={x:a[0],y:a[1],width:a[2],height:a[3]};rm(this,"fill",a,this.Ue);this.addElement("rect",a)};t.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};rm(this,"fill",b,this.Ue);this.addElement("text",b,a[0])};t.lineTo=function(a,b){this.path.push(["L",a,b])};
1081 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"])};
1082 t.restore=function(){this.Ue=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};
1083 t.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,lineDashOffset:this.lineDashOffset,lineJoin:this.lineJoin,lineWidth:this.lineWidth,miterLimit:this.miterLimit,shadowBlur:this.shadowBlur,shadowColor:this.shadowColor,shadowOffsetX:this.shadowOffsetX,shadowOffsetY:this.shadowOffsetY,strokeStyle:this.strokeStyle,textAlign:this.textAlign});for(var a=[],b=0;b<this.path.length;b++)a.push(this.path[b]);this.stack.push(a);this.stack.push(this.Ue.copy())};
1084 t.setTransform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||qm(this,a,b,c,d,e,f)};t.scale=function(a,b){this.Ue.scale(a,b)};t.translate=function(a,b){this.Ue.translate(a,b)};t.transform=function(){};t.stroke=function(){this.addPath("stroke",this.path,this.Ue)};t.Hj=function(){this.clipInsteadOfFill||this.stroke()};t.Vb=function(a,b,c){return this.Au.Vb(a,b,c)};
1085 t.addElement=function(a,b,c){a=this.Vb(a,b,c);0<this.nd.length?this.nd[this.nd.length-1].appendChild(a):this.svg.appendChild(a);return this.iu=a};
1086 function rm(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"===b?(a.fillStyle instanceof om?c.fill=sm(a,a.fillStyle):/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),c.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",c["fill-opacity"]=a[4]):c.fill=a.fillStyle,c.stroke="none"):"stroke"===b&&(c.fill="none",a.strokeStyle instanceof om?c.stroke=sm(a,a.strokeStyle):/^rgba\(/.test(a.strokeStyle)?(b=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
1087 c.stroke="rgb("+b[1]+","+b[2]+","+b[3]+")",c["stroke-opacity"]=b[4]):c.stroke=a.strokeStyle,c["stroke-width"]=a.lineWidth,c["stroke-linecap"]=a.lineCap,c["stroke-linejoin"]=a.lineJoin,c["stroke-miterlimit"]=a.miterLimit);d=d.Ua;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d}
1088 function sm(a,b){var c="GRAD"+wb++;if("linear"===b.type)var d=a.Vb("linearGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"});else if("radial"===b.type)d=a.Vb("radialGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c});else throw Error("invalid gradient");var e=b.sy;b=e.length;for(var f=[],g=0;g<b;g++){var h=e[g],k=h.color;h={offset:h.offset,"stop-color":k};/^rgba\(/.test(k)&&(k=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(k),
1089 h["stop-color"]="rgb("+k[1]+","+k[2]+","+k[3]+")",h["stop-opacity"]=k[4]);f.push(h)}f.sort(function(a,b){return a.offset>b.offset?1:-1});for(e=0;e<b;e++)d.appendChild(a.Vb("stop",f[e]));a.svg.appendChild(d);return"url(#"+c+")"}
1090 t.addPath=function(a,b,c){for(var d=[],e=0;e<b.length;e++){var f=Ja(b[e]),g=[f.shift()];if("A"===g[0])g.push(f.shift()+","+f.shift(),f.shift(),f.shift()+","+f.shift(),f.shift()+","+f.shift());else for(;f.length;)g.push(f.shift()+","+f.shift());d.push(g.join(" "))}b={d:d.join(" ")};"stroke"===a&&this.hv&&(b["stroke-dasharray"]=this.Fh.toString(),b["stroke-dashoffset"]=this.Gh);rm(this,a,b,c);"clipPath"===a?(a="CLIP"+wb++,c=this.Vb("clipPath",{id:a}),c.appendChild(this.Vb("path",b)),this.svg.appendChild(c),
1091 0<this.nd.length&&this.nd[this.nd.length-1].setAttributeNS(null,"clip-path","url(#"+a+")")):this.addElement("path",b)};function qm(a,b,c,d,e,f,g){var h=new nm;h.Ua=[b,c,d,e,f,g];b={};rm(a,"g",b,h);h=a.addElement("g",b);a.nd.push(h)}
1092 t.mn=function(a){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var b="SHADOW"+wb++,c=this.addElement("filter",{id:b,x:"-100%",y:"-100%",width:"300%",height:"300%"},null);var d=a.computePixelRatio();a=this.Vb("feGaussianBlur",{"in":"SourceAlpha",result:"blur",stdDeviation:this.shadowBlur/2/d});var e=this.Vb("feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});var f=this.Vb("feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});d=this.Vb("feOffset",
1093 {"in":"comp",result:"offsetBlur",dx:this.shadowOffsetX/d,dy:this.shadowOffsetY/d});var g=this.Vb("feMerge",{});g.appendChild(this.Vb("feMergeNode",{"in":"offsetBlur"}));g.appendChild(this.Vb("feMergeNode",{"in":"SourceGraphic"}));c.appendChild(a);c.appendChild(e);c.appendChild(f);c.appendChild(d);c.appendChild(g);0<this.nd.length&&this.nd[this.nd.length-1].setAttributeNS(null,"filter","url(#"+b+")")}};t.Ww=function(a,b,c){this.rt=a;this.st=b;this.Gg=c};
1094 function Nl(a){a.shadowOffsetX=0;a.shadowOffsetY=0;a.shadowBlur=0}function Ml(a){a.shadowOffsetX=a.rt;a.shadowOffsetY=a.st;a.shadowBlur=a.Gg}t.St=function(a,b){this.hv=!0;this.Fh=a;this.Gh=b};t.Qt=function(){this.hv=!1};t.Ac=function(){};t.hz=function(){};pm.prototype.rotate=function(){};pm.prototype.getImageData=function(){return null};pm.prototype.measureText=function(){return null};pm.className="SVGContext";
1095 R.prototype.mu=function(a){var b=new Sj(this,qa.document);void 0===a&&(a=new ib);var c=this;return Sk(this,function(a,e){a=Tk(c,a,"SVG",b);a=null!==a?a.svg:null;return"function"===typeof e?(e(a),null):a},a)};R.prototype.makeSvg=R.prototype.mu;R.prototype.ww=function(a){return this.mu(a)};R.prototype.makeSVG=R.prototype.ww;
1096 O.prototype.Ay=function(a,b){if(!(a instanceof pm))return!1;if(!this.visible)return!0;var c=null,d=a.iu;if(this instanceof W&&(this.type===W.TableRow||this.type===W.TableColumn))return Kl(this,a,b),!0;var e=this.Cb;if(0===e.width||0===e.height||isNaN(e.x)||isNaN(e.y))return!0;var f=this.transform,g=this.panel;0!==(this.I&4096)===!0&&Ll(this);var h=0!==(this.I&256);a.clipInsteadOfFill&&(h=!1);var k=!1;this instanceof ih&&(a.font=this.font);if(h){k=g.pe()?g.naturalBounds:g.actualBounds;if(null!==this.gb){var l=
1097 this.gb;var m=l.x;var n=l.y;var p=l.width;l=l.height}else m=Math.max(e.x,k.x),n=Math.max(e.y,k.y),p=Math.min(e.right,k.right)-m,l=Math.min(e.bottom,k.bottom)-n;if(m>e.width+e.x||e.x>k.width+k.x||n>e.height+e.y||e.y>k.height+k.y)return!0;k=!0;qm(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(m,n,p,l);a.clip()}if(this.Rf()&&!this.isVisible())return!0;a.Ue.Ua=[1,0,0,1,0,0];(this instanceof ih&&1<this.lineCount||this instanceof Uf&&1<this.geometry.figures.length)&&qm(a,1,0,0,1,0,0);m=!1;this.Rf()&&this.isShadowed&&
1098 b.Xe("drawShadows")&&(n=this.shadowOffset,a.Ww(n.x*b.scale*b.Zb,n.y*b.scale*b.Zb,this.shadowBlur),Ml(a),a.shadowColor=this.shadowColor);n=!1;this.part&&b.Xe("drawShadows")&&(n=this.part.isShadowed);a.clipInsteadOfFill&&(n=!1);!0===this.shadowVisible?(Ml(a),!1===m&&n&&(qm(a,1,0,0,1,0,0),a.mn(b),m=!0)):!1===this.shadowVisible&&Nl(a);p=this.naturalBounds;null!==this.areaBackground&&(Ai(this,a,this.areaBackground,!0,!0,p,e),!1===m&&n&&(qm(a,1,0,0,1,0,0),a.mn(b),m=!0),this.areaBackground instanceof Ol&&
1099 this.areaBackground.type===Pl?(a.beginPath(),a.rect(e.x,e.y,e.width,e.height),a.We(this.areaBackground)):a.fillRect(e.x,e.y,e.width,e.height));this instanceof W?qm(a,f.m11,f.m12,f.m21,f.m22,f.dx,f.dy):(a.Ue.Ua=[f.m11,f.m12,f.m21,f.m22,f.dx,f.dy],!1===m&&n&&(qm(a,1,0,0,1,0,0),a.mn(b),m=!0));if(null!==this.background){!1===m&&n&&(qm(a,1,0,0,1,0,0),a.mn(b),m=!0);var r=this.naturalBounds;l=f=0;var q=r.width;r=r.height;var u=0;this instanceof Uf&&(r=this.geometry.bounds,f=r.x,l=r.y,q=r.width,r=r.height,
1100 u=this.strokeWidth);Ai(this,a,this.background,!0,!1,p,e);this.background instanceof Ol&&this.background.type===Pl?(a.beginPath(),a.rect(f-u/2,l-u/2,q+u,r+u),a.We(this.background)):a.fillRect(f-u/2,l-u/2,q+u,r+u)}n&&(null!==this.background||null!==this.areaBackground||null!==g&&0!==(g.I&512)||null!==g&&(g.type===W.Auto||g.type===W.Spot)&&g.yb()!==this)?(Ql(this,!0),null===this.shadowVisible&&Nl(a)):Ql(this,!1);this.pj(a,b);n&&0!==(this.I&512)===!0&&Ml(a);this.Rf()&&n&&Nl(a);h&&(a.restore(),k&&a.nd.pop());
1101 this instanceof W&&(c=a.nd.pop());!0===m&&a.nd.pop();if(this instanceof ih&&1<this.lineCount||this instanceof Uf&&1<this.geometry.figures.length)c=a.nd.pop();null!==a.Au.Qq&&(null===c&&(d===a.iu?(qm(a,1,0,0,1,0,0),c=a.nd.pop()):c=a.iu),a.Au.Qq(this,c));this.svg=c;return!0};
1102 function Vk(a,b){this.ownerDocument=b=void 0===b?qa.document:b;this.Qq=null;b=b.createElement("canvas");b.tabIndex=0;this.Oa=b;this.Oa.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.";this.context=new Sl(b);b.C=a}Vk.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",!0):!1};Vk.prototype.toDataURL=function(a,b){return this.Oa.toDataURL(a,b)};
1103 Vk.prototype.getBoundingClientRect=function(){return this.Oa.getBoundingClientRect()};Vk.prototype.focus=function(){this.Oa.focus()};Vk.prototype.zy=function(){this.ownerDocument=this.Oa.C=null};na.Object.defineProperties(Vk.prototype,{width:{configurable:!0,get:function(){return this.Oa.width},set:function(a){this.Oa.width=a}},height:{configurable:!0,get:function(){return this.Oa.height},set:function(a){this.Oa.height=a}},style:{configurable:!0,get:function(){return this.Oa.style}}});
1104 Vk.className="CanvasSurface";function Sl(a){a.getContext&&a.getContext("2d")||v("Browser does not support HTML Canvas Element");this.aa=a.getContext("2d");this.Ku=this.Mu=this.Lu="";this.Ln=!1;this.Gg=this.st=this.rt=0}t=Sl.prototype;t.hz=function(a){this.aa.imageSmoothingEnabled=a};t.arc=function(a,b,c,d,e,f){this.aa.arc(a,b,c,d,e,f)};t.beginPath=function(){this.aa.beginPath()};t.bezierCurveTo=function(a,b,c,d,e,f){this.aa.bezierCurveTo(a,b,c,d,e,f)};
1105 t.clearRect=function(a,b,c,d){this.aa.clearRect(a,b,c,d)};t.clip=function(){this.aa.clip()};t.closePath=function(){this.aa.closePath()};t.createLinearGradient=function(a,b,c,d){return this.aa.createLinearGradient(a,b,c,d)};t.createPattern=function(a,b){return this.aa.createPattern(a,b)};t.createRadialGradient=function(a,b,c,d,e,f){return this.aa.createRadialGradient(a,b,c,d,e,f)};t.drawImage=function(a,b,c,d,e,f,g,h,k){void 0===d?this.aa.drawImage(a,b,c):this.aa.drawImage(a,b,c,d,e,f,g,h,k)};
1106 t.fill=function(){this.aa.fill()};t.fillRect=function(a,b,c,d){this.aa.fillRect(a,b,c,d)};t.fillText=function(a,b,c){this.aa.fillText(a,b,c)};t.getImageData=function(a,b,c,d){return this.aa.getImageData(a,b,c,d)};t.lineTo=function(a,b){this.aa.lineTo(a,b)};t.measureText=function(a){return this.aa.measureText(a)};t.moveTo=function(a,b){this.aa.moveTo(a,b)};t.quadraticCurveTo=function(a,b,c,d){this.aa.quadraticCurveTo(a,b,c,d)};t.rect=function(a,b,c,d){this.aa.rect(a,b,c,d)};t.restore=function(){this.aa.restore()};
1107 Sl.prototype.rotate=function(a){this.aa.rotate(a)};t=Sl.prototype;t.save=function(){this.aa.save()};t.setTransform=function(a,b,c,d,e,f){this.aa.setTransform(a,b,c,d,e,f)};t.scale=function(a,b){this.aa.scale(a,b)};t.stroke=function(){this.aa.stroke()};t.transform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||this.aa.transform(a,b,c,d,e,f)};t.translate=function(a,b){this.aa.translate(a,b)};
1108 t.We=function(a){if(a instanceof Ol&&a.type===Pl){var b=a.sl;a=a.Nu;a>b?(this.scale(b/a,1),this.translate((a-b)/2,0)):b>a&&(this.scale(1,a/b),this.translate(0,(b-a)/2));this.Ln?this.clip():this.fill();a>b?(this.translate(-(a-b)/2,0),this.scale(1/(b/a),1)):b>a&&(this.translate(0,-(b-a)/2),this.scale(1,1/(a/b)))}else this.Ln?this.clip():this.fill()};t.Hj=function(){this.Ln||this.stroke()};t.Ww=function(a,b,c){this.rt=a;this.st=b;this.Gg=c};
1109 t.St=function(a,b){var c=this.aa;void 0!==c.setLineDash&&(c.setLineDash(a),c.lineDashOffset=b)};t.Qt=function(){var a=this.aa;void 0!==a.setLineDash&&(a.setLineDash(tm),a.lineDashOffset=0)};t.Ac=function(a){a&&(this.Lu="");this.Ku=this.Mu=""};
1110 na.Object.defineProperties(Sl.prototype,{fillStyle:{configurable:!0,get:function(){return this.aa.fillStyle},set:function(a){this.Ku!==a&&(this.Ku=this.aa.fillStyle=a)}},font:{configurable:!0,get:function(){return this.aa.font},set:function(a){this.Lu!==a&&(this.Lu=this.aa.font=a)}},globalAlpha:{configurable:!0,get:function(){return this.aa.globalAlpha},set:function(a){this.aa.globalAlpha=a}},lineCap:{configurable:!0,get:function(){return this.aa.lineCap},
1111 set:function(a){this.aa.lineCap=a}},lineDashOffset:{configurable:!0,get:function(){return this.aa.lineDashOffset},set:function(a){this.aa.lineDashOffset=a}},lineJoin:{configurable:!0,get:function(){return this.aa.lineJoin},set:function(a){this.aa.lineJoin=a}},lineWidth:{configurable:!0,get:function(){return this.aa.lineWidth},set:function(a){this.aa.lineWidth=a}},miterLimit:{configurable:!0,get:function(){return this.aa.miterLimit},set:function(a){this.aa.miterLimit=
1112 a}},shadowBlur:{configurable:!0,get:function(){return this.aa.shadowBlur},set:function(a){this.aa.shadowBlur=a}},shadowColor:{configurable:!0,get:function(){return this.aa.shadowColor},set:function(a){this.aa.shadowColor=a}},shadowOffsetX:{configurable:!0,get:function(){return this.aa.shadowOffsetX},set:function(a){this.aa.shadowOffsetX=a}},shadowOffsetY:{configurable:!0,get:function(){return this.aa.shadowOffsetY},set:function(a){this.aa.shadowOffsetY=
1113 a}},strokeStyle:{configurable:!0,get:function(){return this.aa.strokeStyle},set:function(a){this.Mu!==a&&(this.Mu=this.aa.strokeStyle=a)}},textAlign:{configurable:!0,get:function(){return this.aa.textAlign},set:function(a){this.aa.textAlign=a}},imageSmoothingEnabled:{configurable:!0,get:function(){return this.aa.imageSmoothingEnabled},set:function(a){this.aa.imageSmoothingEnabled=a}},clipInsteadOfFill:{configurable:!0,get:function(){return this.Ln},
1114 set:function(a){this.Ln=a}}});var tm=Object.freeze([]);Sl.className="CanvasSurfaceContext";function um(){this.W=this.w=this.L=this.l=0}um.className="ColorNumbers";
1115 function Ol(a){F&&1<arguments.length&&v("Brush constructor can take at most one optional argument, the Brush type.");vm||(wm(),vm=!0);eb(this);this.s=!1;void 0===a?(this.sa=Rl,this.rl="black"):"string"===typeof a?(this.sa=Rl,F&&!xm(a)&&v('Color "'+a+'" is not a valid color string for Brush constructor'),this.rl=a):(F&&gb(a,Ol,Ol,"constructor:type"),this.sa=a,this.rl="black");var b=this.sa;b===Ul?(this.Kd=Fc,this.El=Nc):this.El=b===Pl?this.Kd=Kc:this.Kd=Bc;this.wt=0;this.ks=NaN;this.ue=this.Xs=this.te=
1116 null;this.Nu=this.sl=0}Ol.prototype.copy=function(){var a=new Ol;a.sa=this.sa;a.rl=this.rl;a.Kd=this.Kd.K();a.El=this.El.K();a.wt=this.wt;a.ks=this.ks;null!==this.te&&(a.te=this.te.copy());a.Xs=this.Xs;return a};t=Ol.prototype;t.freeze=function(){this.s=!0;null!==this.te&&this.te.freeze();return this};t.ka=function(){Object.isFrozen(this)&&v("cannot thaw constant: "+this);this.s=!1;null!==this.te&&this.te.ka();return this};t.pb=function(a){a.classType===Ol?this.type=a:Da(this,a)};
1117 t.toString=function(){var a="Brush(";if(this.type===Rl)a+=this.color;else if(a=this.type===Ul?a+"Linear ":this.type===Pl?a+"Radial ":this.type===Tl?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+")"};
1118 t.addColorStop=function(a,b){this.s&&va(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&za(a,"0 <= loc <= 1",Ol,"addColorStop:loc");A(b,"string",Ol,"addColorStop:color");F&&!xm(b)&&v('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.te&&(this.te=new Bb);this.te.add(a,b);this.sa===Rl&&(this.type=Ul);this.ue=null;return this};
1119 function xm(a){if("black"===a)return!0;if(""===a)return!1;F&&A(a,"string",Ol,"isValidColor");vm||(wm(),vm=!0);var b=ym;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}
1120 t.ZA=function(a,b){this.s&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?zm:b;if(this.type===Rl)ni(this.color),this.color=Am(a,b);else if((this.type===Ul||this.type===Pl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)ni(c.value),this.addColorStop(c.key,Am(a,b));return this};function Bm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?zm:c;ni(a);return Am(b,c)}
1121 t.Zz=function(a,b){this.s&&va(this);a=void 0===a||"number"!==typeof a?.2:a;b=void 0===b?zm:b;if(this.type===Rl)ni(this.color),this.color=Am(-a,b);else if((this.type===Ul||this.type===Pl)&&null!==this.colorStops)for(var c=this.colorStops.iterator;c.next();)ni(c.value),this.addColorStop(c.key,Am(-a,b));return this};function Cm(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?zm:c;ni(a);return Am(-b,c)}
1122 function Dm(a,b,c){ni(a);a=Em.l;var d=Em.L,e=Em.w,f=Em.W;ni(b);void 0===c&&(c=.5);return"rgba("+Math.round((Em.l-a)*c+a)+", "+Math.round((Em.L-d)*c+d)+", "+Math.round((Em.w-e)*c+e)+", "+Math.round((Em.W-f)*c+f)+")"}
1123 t.Vy=function(){if(this.type===Rl)return Fm(this.color);if((this.type===Ul||this.type===Pl)&&null!==this.colorStops){var a=this.colorStops;if(this.type===Pl)return Fm(a.first().value);if(null!==a.get(.5))return Fm(a.get(.5));if(2===a.count)return a=a.ta(),Fm(Dm(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?(c=g,e=h):f>=e&&h<f&&(d=g,f=h)}c>d&&(f=c,c=d,d=f,f=e);e=d-c;return Fm(Dm(a.get(c),a.get(d),1-f/e))}return!1};
1124 function Fm(a){if(!a)return!1;if(a instanceof Ol)return a.Vy();ni(a);return 128>(299*Em.l+587*Em.L+114*Em.w)/1E3}
1125 function Am(a,b){switch(b){case zm:b=100*Gm(Em.l);var c=100*Gm(Em.L),d=100*Gm(Em.w);Hm.l=.4124564*b+.3575761*c+.1804375*d;Hm.L=.2126729*b+.7151522*c+.072175*d;Hm.w=.0193339*b+.119192*c+.9503041*d;Hm.W=Em.W;b=Im(Hm.l/Jm[0]);c=Im(Hm.L/Jm[1]);d=Im(Hm.w/Jm[2]);Km.l=116*c-16;Km.L=500*(b-c);Km.w=200*(c-d);Km.W=Hm.W;Km.l=Math.min(100,Math.max(0,Km.l+100*a));a=(Km.l+16)/116;b=a-Km.w/200;Hm.l=Jm[0]*Lm(Km.L/500+a);Hm.L=Jm[1]*(Km.l>Mm*Nm?Math.pow(a,3):Km.l/Mm);Hm.w=Jm[2]*Lm(b);Hm.W=Km.W;a=-.969266*Hm.l+1.8760108*
1126 Hm.L+.041556*Hm.w;b=.0556434*Hm.l+-.2040259*Hm.L+1.0572252*Hm.w;Em.l=255*Om((3.2404542*Hm.l+-1.5371385*Hm.L+-.4985314*Hm.w)/100);Em.L=255*Om(a/100);Em.w=255*Om(b/100);Em.W=Hm.W;Em.l=Math.round(Em.l);255<Em.l?Em.l=255:0>Em.l&&(Em.l=0);Em.L=Math.round(Em.L);255<Em.L?Em.L=255:0>Em.L&&(Em.L=0);Em.w=Math.round(Em.w);255<Em.w?Em.w=255:0>Em.w&&(Em.w=0);return"rgba("+Em.l+", "+Em.L+", "+Em.w+", "+Em.W+")";case Pm:return oi(),pi.w=Math.min(100,Math.max(0,pi.w+100*a)),"hsla("+pi.l+", "+pi.L+"%, "+pi.w+"%, "+
1127 pi.W+")";default:return v("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}function ni(a){vm||(wm(),vm=!0);var b=ym;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,Em.l=a[0],Em.L=a[1],Em.w=a[2],Em.W=a[3]/255):(b.fillStyle="#FFFFFF",c=b.fillStyle,b.fillStyle=a,b.fillStyle===c&&F&&v('Color "'+a+'" is not a valid color string for RGBA color conversion'),Em.l=0,Em.L=0,Em.w=0,Em.W=1)}}
1128 function oi(){var a=Em.l/255,b=Em.L/255,c=Em.w/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))}pi.l=Math.round(g);pi.L=Math.round(100*a);pi.w=Math.round(100*e);pi.W=Em.W}function Gm(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function Om(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}
1129 function Im(a){return a>Nm?Math.pow(a,1/3):(Mm*a+16)/116}function Lm(a){var b=a*a*a;return b>Nm?b:(116*a-16)/Mm}function km(a,b){"string"===typeof a?F&&!xm(a)&&v('Color "'+a+'" is not a valid color string for '+b):a instanceof Ol||v("Value for "+b+" must be a color string or a Brush, not "+a)}function wm(){ym=gh?(new Vk(null)).context:null}
1130 na.Object.defineProperties(Ol.prototype,{type:{configurable:!0,get:function(){return this.sa},set:function(a){this.s&&va(this,a);gb(a,Ol,Ol,"type");this.sa=a;this.start.Sb()&&(a===Ul?this.start=Fc:a===Pl&&(this.start=Kc));this.end.Sb()&&(a===Ul?this.end=Nc:a===Pl&&(this.end=Kc));this.ue=null}},color:{configurable:!0,get:function(){return this.rl},set:function(a){this.s&&va(this,a);F&&!xm(a)&&v('Color "'+a+'" is not a valid color string for Brush.color');this.rl=a;this.ue=
1131 null}},start:{configurable:!0,get:function(){return this.Kd},set:function(a){this.s&&va(this,a);w(a,N,Ol,"start");this.Kd=a.K();this.ue=null}},end:{configurable:!0,get:function(){return this.El},set:function(a){this.s&&va(this,a);w(a,N,Ol,"end");this.El=a.K();this.ue=null}},startRadius:{configurable:!0,get:function(){return this.wt},set:function(a){this.s&&va(this,a);C(a,Ol,"startRadius");0>a&&za(a,">= zero",Ol,"startRadius");this.wt=a;this.ue=null}},endRadius:{configurable:!0,
1132 enumerable:!0,get:function(){return this.ks},set:function(a){this.s&&va(this,a);C(a,Ol,"endRadius");0>a&&za(a,">= zero",Ol,"endRadius");this.ks=a;this.ue=null}},colorStops:{configurable:!0,get:function(){return this.te},set:function(a){this.s&&va(this,a);F&&w(a,Bb,Ol,"colorStops");this.te=a;this.ue=null}},pattern:{configurable:!0,get:function(){return this.Xs},set:function(a){this.s&&va(this,a);this.Xs=a;this.ue=null}}});Ol.prototype.isDark=Ol.prototype.Vy;
1133 Ol.prototype.darkenBy=Ol.prototype.Zz;Ol.prototype.lightenBy=Ol.prototype.ZA;Ol.prototype.addColorStop=Ol.prototype.addColorStop;var Nm=216/24389,Mm=24389/27,Jm=[95.047,100,108.883],ym=null,Em=new um,pi=new um,Hm=new um,Km=new um,vm=!1;Ol.className="Brush";var Rl;Ol.Solid=Rl=new E(Ol,"Solid",0);var Ul;Ol.Linear=Ul=new E(Ol,"Linear",1);var Pl;Ol.Radial=Pl=new E(Ol,"Radial",2);var Tl;Ol.Pattern=Tl=new E(Ol,"Pattern",4);var zm;Ol.Lab=zm=new E(Ol,"Lab",5);var Pm;Ol.HSL=Pm=new E(Ol,"HSL",6);
1134 Ol.randomColor=function(a,b){void 0===a&&(a=128);F&&(C(a,Ol,"randomColor:min"),(0>a||255<a)&&za(a,"0 <= min <= 255",Ol,"randomColor:min"));void 0===b&&(b=Math.max(a,255));F&&(C(b,Ol,"randomColor:max"),(b<a||255<b)&&za(b,"min <= max <= 255",Ol,"randomColor:max"));var c=Math.abs(b-a);b=Math.floor(a+Math.random()*c).toString(16);var d=Math.floor(a+Math.random()*c).toString(16);a=Math.floor(a+Math.random()*c).toString(16);2>b.length&&(b="0"+b);2>d.length&&(d="0"+d);2>a.length&&(a="0"+a);return"#"+b+d+
1135 a};Ol.isValidColor=xm;Ol.lighten=function(a){return Bm(a)};Ol.lightenBy=Bm;Ol.darken=function(a){return Cm(a)};Ol.darkenBy=Cm;Ol.mix=Dm;Ol.isDark=Fm;function hm(){this.va="Base"}hm.prototype.measure=function(){};hm.prototype.bB=function(a,b,c,d,e){a.measure(b,c,d,e)};hm.prototype.arrange=function(){};hm.prototype.Mz=function(a,b,c,d,e,f){a.arrange(b,c,d,e,f)};hm.prototype.kB=function(a){a.Nk()};hm.prototype.sc=function(){};
1136 na.Object.defineProperties(hm.prototype,{name:{configurable:!0,get:function(){return this.va},set:function(a){this.va=a}},classType:{configurable:!0,get:function(){return W}}});hm.prototype.remeasureObject=hm.prototype.kB;hm.prototype.arrangeElement=hm.prototype.Mz;hm.prototype.measureElement=hm.prototype.bB;hm.className="PanelLayout";function Qm(){this.va="Base"}ma(Qm,hm);
1137 Qm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;a=Rm(a);for(var k=0;k<h;k++){var l=d[k];if(l.visible||l===a){var m=l.margin,n=m.right+m.left;m=m.top+m.bottom;l.measure(b,c,f,g);var p=l.measuredBounds;n=Math.max(p.width+n,0);m=Math.max(p.height+m,0);p=l.position.x;var r=l.position.y;isFinite(p)||(p=0);isFinite(r)||(r=0);l instanceof Uf&&l.isGeometryPositioned&&(l=l.strokeWidth/2,p-=l,r-=l);kc(e,p,r,n,m)}}};
1138 Qm.prototype.arrange=function(a,b,c){var d=b.length,e=a.padding;a=c.x-e.left;c=c.y-e.top;for(e=0;e<d;e++){var f=b[e],g=f.measuredBounds,h=f.margin,k=f.position.x,l=f.position.y;k=isNaN(k)?-a:k-a;l=isNaN(l)?-c:l-c;if(f instanceof Uf&&f.isGeometryPositioned){var m=f.strokeWidth/2;k-=m;l-=m}f.visible&&f.arrange(k+h.left,l+h.top,g.width,g.height)}};function Sm(){this.va="Base"}ma(Sm,hm);
1139 Sm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length;b=Ma();f=Rm(a);for(var k=0;k<h;k++){var l=d[k];if(l.visible||l===f){var m=Fl(l,!1);if(m!==zg&&m!==ql)b.push(l);else{l.measure(Infinity,c,0,g);m=l.margin;l=l.measuredBounds;var n=Math.max(l.height+m.top+m.bottom,0);e.width+=Math.max(l.width+m.right+m.left,0);e.height=Math.max(e.height,n)}}}d=b.length;a.desiredSize.height?c=Math.min(a.desiredSize.height,a.maxSize.height):0!==e.height&&(c=Math.min(e.height,a.maxSize.height));for(a=0;a<d;a++)if(k=
1140 b[a],k.visible||k===f)m=k.margin,h=m.right+m.left,m=m.top+m.bottom,k.measure(Infinity,c,0,g),k=k.measuredBounds,m=Math.max(k.height+m,0),e.width+=Math.max(k.width+h,0),e.height=Math.max(e.height,m);Oa(b)};
1141 Sm.prototype.arrange=function(a,b,c){for(var d=b.length,e=a.padding,f=e.top,g=a.isOpposite,h=g?c.width:e.left,k=0;k<d;k++){var l=f,m=b[k];if(m.visible){var n=m.measuredBounds,p=m.margin,r=p.top+p.bottom,q=f+e.bottom,u=n.height,y=Fl(m,!1);if(isNaN(m.desiredSize.height)&&y===Bd||y===rl)u=Math.max(c.height-r-q,0);r=u+r+q;q=m.alignment;q.Ib()&&(q=a.defaultAlignment);q.eb()||(q=Kc);g&&(h-=n.width+p.left+p.right);m.arrange(h+q.offsetX+p.left,l+q.offsetY+p.top+(c.height*q.y-r*q.y),n.width,u);g||(h+=n.width+
1142 p.left+p.right)}}};function Tm(){this.va="Base"}ma(Tm,hm);
1143 Tm.prototype.measure=function(a,b,c,d,e,f){var g=d.length;c=Ma();for(var h=Rm(a),k=0;k<g;k++){var l=d[k];if(l.visible||l===h){var m=Fl(l,!1);if(m!==zg&&m!==rl)c.push(l);else{var n=l.margin;m=n.right+n.left;n=n.top+n.bottom;l.measure(b,Infinity,f,0);l=l.measuredBounds;cc(e,Math.max(e.width,Math.max(l.width+m,0)),e.height+Math.max(l.height+n,0))}}}d=c.length;if(0!==d){a.desiredSize.width?b=Math.min(a.desiredSize.width,a.maxSize.width):0!==e.width&&(b=Math.min(e.width,a.maxSize.width));for(a=0;a<d;a++)if(k=
1144 c[a],k.visible||k===h)l=k.margin,g=l.right+l.left,l=l.top+l.bottom,k.measure(b,Infinity,f,0),k=k.measuredBounds,l=Math.max(k.height+l,0),e.width=Math.max(e.width,Math.max(k.width+g,0)),e.height+=l;Oa(c)}};
1145 Tm.prototype.arrange=function(a,b,c){for(var d=b.length,e=a.padding,f=e.left,g=a.isOpposite,h=g?c.height:e.top,k=0;k<d;k++){var l=f,m=b[k];if(m.visible){var n=m.measuredBounds,p=m.margin,r=p.left+p.right,q=f+e.right,u=n.width,y=Fl(m,!1);if(isNaN(m.desiredSize.width)&&y===Bd||y===ql)u=Math.max(c.width-r-q,0);r=u+r+q;q=m.alignment;q.Ib()&&(q=a.defaultAlignment);q.eb()||(q=Kc);g&&(h-=n.height+p.bottom+p.top);m.arrange(l+q.offsetX+p.left+(c.width*q.x-r*q.x),h+q.offsetY+p.top,u,n.height);g||(h+=n.height+
1146 p.bottom+p.top)}}};function Um(){this.va="Base"}ma(Um,hm);
1147 Um.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length,k=a.yb(),l=k.margin,m=l.right+l.left,n=l.top+l.bottom;k.measure(b,c,f,g);var p=k.measuredBounds;f=p.width;g=p.height;var r=Math.max(f+m,0);var q=Math.max(g+n,0);for(var u=a.isClipping,y=L.allocAt(-l.left,-l.top,r,q),x=!0,z=Rm(a),B=0;B<h;B++){var D=d[B];if(D!==k&&(D.visible||D===z)){l=D.margin;r=l.right+l.left;q=l.top+l.bottom;p=Fl(D,!1);switch(p){case Bd:b=f;c=g;break;case ql:b=f;break;case rl:c=g}D.measure(b,c,0,0);p=D.measuredBounds;r=
1148 Math.max(p.width+r,0);q=Math.max(p.height+q,0);var G=D.alignment;G.Ib()&&(G=a.defaultAlignment);G.eb()||(G=Kc);var M=D.alignmentFocus;M.Ib()&&(M=Kc);var Y=null;D instanceof W&&""!==D.Xg&&(D.arrange(0,0,p.width,p.height),Y=D.ib(D.Xg),Y===D&&(Y=null));if(null!==Y){l=Y.naturalBounds;p=Y.margin;for(l=J.allocAt(M.x*l.width-M.offsetX-p.left,M.y*l.height-M.offsetY-p.top);Y!==D;)Y.transform.Aa(l),Y=Y.panel;D=G.x*f+G.offsetX-l.x;p=G.y*g+G.offsetY-l.y;J.free(l)}else D=G.x*f+G.offsetX-(M.x*p.width+M.offsetX)-
1149 l.left,p=G.y*g+G.offsetY-(M.y*p.height+M.offsetY)-l.top;x?(x=!1,e.h(D,p,r,q)):kc(e,D,p,r,q)}}x?e.assign(y):u?e.qw(y.x,y.y,y.width,y.height):kc(e,y.x,y.y,y.width,y.height);L.free(y);p=k.stretch;p===pl&&(p=Fl(k,!1));switch(p){case zg:return;case Bd:if(!isFinite(b)&&!isFinite(c))return;break;case ql:if(!isFinite(b))return;break;case rl:if(!isFinite(c))return}p=k.measuredBounds;f=p.width;g=p.height;r=Math.max(f+m,0);q=Math.max(g+n,0);l=k.margin;y=L.allocAt(-l.left,-l.top,r,q);for(b=0;b<h;b++)c=d[b],c===
1150 k||!c.visible&&c!==z||(l=c.margin,r=l.right+l.left,q=l.top+l.bottom,p=c.measuredBounds,r=Math.max(p.width+r,0),q=Math.max(p.height+q,0),m=c.alignment,m.Ib()&&(m=a.defaultAlignment),m.eb()||(m=Kc),c=c.alignmentFocus,c.Ib()&&(c=Kc),x?(x=!1,e.h(m.x*f+m.offsetX-(c.x*p.width+c.offsetX)-l.left,m.y*g+m.offsetY-(c.y*p.height+c.offsetY)-l.top,r,q)):kc(e,m.x*f+m.offsetX-(c.x*p.width+c.offsetX)-l.left,m.y*g+m.offsetY-(c.y*p.height+c.offsetY)-l.top,r,q));x?e.assign(y):u?e.qw(y.x,y.y,y.width,y.height):kc(e,y.x,
1151 y.y,y.width,y.height);L.free(y)};
1152 Um.prototype.arrange=function(a,b,c){var d=b.length,e=a.yb(),f=e.measuredBounds,g=f.width;f=f.height;var h=a.padding,k=h.left;h=h.top;var l=k-c.x,m=h-c.y;e.arrange(l,m,g,f);for(var n=0;n<d;n++){var p=b[n];if(p!==e){var r=p.measuredBounds,q=r.width;r=r.height;m=p.alignment;m.Ib()&&(m=a.defaultAlignment);m.eb()||(m=Kc);var u=p.alignmentFocus;u.Ib()&&(u=Kc);l=null;p instanceof W&&""!==p.Xg&&(l=p.ib(p.Xg),l===p&&(l=null));if(null!==l){var y=l.naturalBounds;for(u=J.allocAt(u.x*y.width-u.offsetX,u.y*y.height-
1153 u.offsetY);l!==p;)l.transform.Aa(u),l=l.panel;l=m.x*g+m.offsetX-u.x;m=m.y*f+m.offsetY-u.y;J.free(u)}else l=m.x*g+m.offsetX-(u.x*q+u.offsetX),m=m.y*f+m.offsetY-(u.y*r+u.offsetY);l-=c.x;m-=c.y;p.visible&&p.arrange(k+l,h+m,q,r)}}};function Vm(){this.va="Base"}ma(Vm,hm);
1154 Vm.prototype.measure=function(a,b,c,d,e,f,g){var h=d.length,k=a.yb(),l=k.margin,m=b,n=c,p=l.right+l.left,r=l.top+l.bottom;k.measure(b,c,f,g);l=k.measuredBounds;var q=0,u=null;k instanceof Uf&&(u=k,q=u.strokeWidth*u.scale);var y=Math.max(l.width+p,0);l=Math.max(l.height+r,0);var x=Wm(k),z=x.x*y+x.offsetX;x=x.y*l+x.offsetY;var B=Xm(k),D=B.x*y+B.offsetX;B=B.y*l+B.offsetY;isFinite(b)&&(m=Math.max(Math.abs(z-D)-q,0));isFinite(c)&&(n=Math.max(Math.abs(x-B)-q,0));q=Fb.alloc();q.h(0,0);a=Rm(a);for(B=0;B<
1155 h;B++)x=d[B],x===k||!x.visible&&x!==a||(l=x.margin,y=l.right+l.left,z=l.top+l.bottom,x.measure(m,n,0,0),l=x.measuredBounds,y=Math.max(l.width+y,0),l=Math.max(l.height+z,0),q.h(Math.max(y,q.width),Math.max(l,q.height)));if(1===h)e.width=y,e.height=l,Fb.free(q);else{x=Wm(k);B=Xm(k);h=d=0;B.x!==x.x&&B.y!==x.y&&(d=q.width/Math.abs(B.x-x.x),h=q.height/Math.abs(B.y-x.y));Fb.free(q);q=0;null!==u&&(q=u.strokeWidth*u.scale,Ng(u)===Og&&(d=h=Math.max(d,h)));d+=Math.abs(x.offsetX)+Math.abs(B.offsetX)+q;h+=Math.abs(x.offsetY)+
1156 Math.abs(B.offsetY)+q;u=k.stretch;u===pl&&(u=Fl(k,!1));switch(u){case zg:g=f=0;break;case Bd:isFinite(b)&&(d=b);isFinite(c)&&(h=c);break;case ql:isFinite(b)&&(d=b);g=0;break;case rl:f=0,isFinite(c)&&(h=c)}k.Nk();k.measure(d,h,f,g);e.width=k.measuredBounds.width+p;e.height=k.measuredBounds.height+r}};
1157 Vm.prototype.arrange=function(a,b){var c=b.length,d=a.yb(),e=d.measuredBounds,f=L.alloc();f.h(0,0,1,1);var g=d.margin,h=g.left;g=g.top;var k=a.padding,l=k.left;k=k.top;d.arrange(l+h,k+g,e.width,e.height);var m=Wm(d),n=Xm(d),p=m.y*e.height+m.offsetY,r=n.x*e.width+n.offsetX;n=n.y*e.height+n.offsetY;f.x=m.x*e.width+m.offsetX;f.y=p;kc(f,r,n,0,0);f.x+=h+l;f.y+=g+k;for(e=0;e<c;e++)h=b[e],h!==d&&(l=h.measuredBounds,g=h.margin,k=Math.max(l.width+g.right+g.left,0),m=Math.max(l.height+g.top+g.bottom,0),p=h.alignment,
1158 p.Ib()&&(p=a.defaultAlignment),p.eb()||(p=Kc),k=f.width*p.x+p.offsetX-k*p.x+g.left+f.x,g=f.height*p.y+p.offsetY-m*p.y+g.top+f.y,h.visible&&(lc(f.x,f.y,f.width,f.height,k,g,l.width,l.height)?h.arrange(k,g,l.width,l.height):h.arrange(k,g,l.width,l.height,new L(f.x,f.y,f.width,f.height))));L.free(f)};function Ym(){this.va="Base";this.name="Table"}ma(Ym,hm);
1159 Ym.prototype.measure=function(a,b,c,d,e){for(var f=d.length,g=Ma(),h=Ma(),k=0;k<f;k++){var l=d[k],m=l instanceof W?l:null;if(null===m||m.type!==W.TableRow&&m.type!==W.TableColumn||!l.visible)g.push(l);else{F&&(m.desiredSize.o()&&v(m.toString()+" TableRow/TableColumn Panels cannot set a desiredSize: "+m.desiredSize.toString()),m.minSize.A(Rb)||v(m.toString()+" TableRow/TableColumn Panels cannot set a minSize: "+m.minSize.toString()),m.maxSize.A(Wb)||v(m.toString()+" TableRow/TableColumn Panels cannot set a maxSize: "+
1160 m.maxSize.toString()));h.push(m);for(var n=m.$.j,p=n.length,r=0;r<p;r++){var q=n[r];m.type===W.TableRow?q.row=l.row:m.type===W.TableColumn&&(q.column=l.column);g.push(q)}}}f=g.length;0===f&&(a.getRowDefinition(0),a.getColumnDefinition(0));for(var u=[],y=0;y<f;y++){var x=g[y];Dj(x,!0);Gl(x,!0);u[x.row]||(u[x.row]=[]);u[x.row][x.column]||(u[x.row][x.column]=[]);u[x.row][x.column].push(x)}Oa(g);var z=Ma(),B=Ma(),D=Ma(),G={count:0},M={count:0},Y=b,Q=c,ca=a.vb;f=ca.length;for(var T=0;T<f;T++){var P=ca[T];
1161 void 0!==P&&(P.actual=0)}ca=a.sb;f=ca.length;for(var xa=0;xa<f;xa++)P=ca[xa],void 0!==P&&(P.actual=0);for(var ka=u.length,Aa=0,Ua=0;Ua<ka;Ua++)u[Ua]&&(Aa=Math.max(Aa,u[Ua].length));var tb=Math.min(a.topIndex,ka-1),Xa=Math.min(a.leftIndex,Aa-1),Ya=0;ka=u.length;for(var Qd=Rm(a),mc=0;mc<ka;mc++)if(u[mc]){Aa=u[mc].length;var nc=a.getRowDefinition(mc);nc.actual=0;for(var ub=nc.hc=0;ub<Aa;ub++)if(u[mc][ub]){var Rd=a.getColumnDefinition(ub);void 0===z[ub]&&(Rd.actual=0,Rd.hc=0,z[ub]=!0);for(var Ag=u[mc][ub],
1162 Bg=Ag.length,$e=0;$e<Bg;$e++){var Xb=Ag[$e];if(Xb.visible||Xb===Qd){var Ph=1<Xb.rowSpan||1<Xb.columnSpan;Ph&&(mc<tb||ub<Xa||B.push(Xb));var Cg=Xb.margin,Qh=Cg.right+Cg.left,Rh=Cg.top+Cg.bottom;var qb=Yl(Xb,nc,Rd,!1);var aj=Xb.desiredSize,Ak=!isNaN(aj.height),Dg=!isNaN(aj.width)&&Ak;Ph||qb===zg||Dg||mc<tb||ub<Xa||(void 0!==G[ub]||qb!==Bd&&qb!==ql||(G[ub]=-1,G.count++),void 0!==M[mc]||qb!==Bd&&qb!==rl||(M[mc]=-1,M.count++),D.push(Xb));Xb.measure(Infinity,Infinity,0,0);if(!(mc<tb||ub<Xa)){var Cd=Xb.measuredBounds,
1163 Cc=Math.max(Cd.width+Qh,0),Vf=Math.max(Cd.height+Rh,0);if(1===Xb.rowSpan&&(qb===zg||qb===ql)){P=a.getRowDefinition(mc);var Ic=P.Cc();Ya=Math.max(Vf-P.actual,0);Ya+Ic>Q&&(Ya=Math.max(Q-Ic,0));var Eg=0===P.na;P.hc=P.hc+Ya;P.actual=P.na+Ya;Q=Math.max(Q-(Ya+(Eg?Ic:0)),0)}if(1===Xb.columnSpan&&(qb===zg||qb===rl)){P=a.getColumnDefinition(ub);var Sh=P.Cc();Ya=Math.max(Cc-P.actual,0);Ya+Sh>Y&&(Ya=Math.max(Y-Sh,0));var Wn=0===P.na;P.hc=P.hc+Ya;P.actual=P.na+Ya;Y=Math.max(Y-(Ya+(Wn?Sh:0)),0)}Ph&&Xb.Nk()}}}}}Oa(z);
1164 var Zd=0,Ee=0;f=a.columnCount;for(var Fg=0;Fg<f;Fg++){var Gg=a.sb[Fg];void 0!==Gg&&(Zd+=Gg.hc,0!==Gg.hc&&(Zd+=Gg.Cc()))}f=a.rowCount;for(var id=0;id<f;id++){var Fe=a.vb[id];void 0!==Fe&&(Ee+=Fe.hc,0!==Fe.hc&&(Ee+=Fe.Cc()))}Y=Math.max(b-Zd,0);var sc=Q=Math.max(c-Ee,0),Th=Y;f=D.length;for(var Uh=0;Uh<f;Uh++){var jd=D[Uh],bj=a.getRowDefinition(jd.row),Ge=a.getColumnDefinition(jd.column),xf=jd.measuredBounds,Sd=jd.margin,Bk=Sd.right+Sd.left,Xn=Sd.top+Sd.bottom;G[jd.column]=0===Ge.hc&&void 0!==G[jd.column]?
1165 Math.max(xf.width+Bk,G[jd.column]):null;M[jd.row]=0===bj.hc&&void 0!==M[jd.row]?Math.max(xf.height+Xn,M[jd.row]):null}var Wf=0,Yb=0,$d;for($d in M)"count"!==$d&&(Wf+=M[$d]);for($d in G)"count"!==$d&&(Yb+=G[$d]);for(var vb=Fb.alloc(),cj=0;cj<f;cj++){var oc=D[cj];if(oc.visible||oc===Qd){var Jc=a.getRowDefinition(oc.row),Dc=a.getColumnDefinition(oc.column),ae=0;isFinite(Dc.width)?ae=Dc.width:(isFinite(Y)&&null!==G[oc.column]?0===Yb?ae=Dc.actual+Y:ae=G[oc.column]/Yb*Th:null!==G[oc.column]?ae=Y:ae=Dc.actual||
1166 Y,ae=Math.max(0,ae-Dc.Cc()));var be=0;isFinite(Jc.height)?be=Jc.height:(isFinite(Q)&&null!==M[oc.row]?0===Wf?be=Jc.actual+Q:be=M[oc.row]/Wf*sc:null!==M[oc.row]?be=Q:be=Jc.actual||Q,be=Math.max(0,be-Jc.Cc()));vb.h(Math.max(Dc.minimum,Math.min(ae,Dc.maximum)),Math.max(Jc.minimum,Math.min(be,Jc.maximum)));qb=Yl(oc,Jc,Dc,!1);switch(qb){case ql:vb.height=Math.max(vb.height,Jc.actual+Q);break;case rl:vb.width=Math.max(vb.width,Dc.actual+Y)}var Hg=oc.margin,Qc=Hg.right+Hg.left,Vh=Hg.top+Hg.bottom;oc.Nk();
1167 oc.measure(vb.width,vb.height,Dc.minimum,Jc.minimum);var Ig=oc.measuredBounds,ce=Math.max(Ig.width+Qc,0),Wh=Math.max(Ig.height+Vh,0);isFinite(Y)&&(ce=Math.min(ce,vb.width));isFinite(Q)&&(Wh=Math.min(Wh,vb.height));var yf=0;yf=Jc.actual;Jc.actual=Math.max(Jc.actual,Wh);Jc.hc=Math.max(Jc.hc,Wh);Ya=Jc.actual-yf;Q=Math.max(Q-Ya,0);null===M[oc.row]&&(sc=Math.max(sc-Ya,0));yf=Dc.actual;Dc.actual=Math.max(Dc.actual,ce);Dc.hc=Math.max(Dc.hc,ce);Ya=Dc.actual-yf;Y=Math.max(Y-Ya,0);null===G[oc.column]&&(Th=
1168 Math.max(Th-Ya,0))}}Oa(D);var de=Fb.alloc(),ee=Ma(),fe=Ma();f=B.length;if(0!==f)for(var af=0;af<ka;af++)if(u[af]){Aa=u[af].length;var Xh=a.getRowDefinition(af);ee[af]=Xh.actual;for(var He=0;He<Aa;He++)if(u[af][He]){var Yn=a.getColumnDefinition(He);fe[He]=Yn.actual}}for(var tc=0;tc<f;tc++){var bb=B[tc];if(bb.visible||bb===Qd){var uc=a.getRowDefinition(bb.row),ge=a.getColumnDefinition(bb.column);vb.h(Math.max(ge.minimum,Math.min(b,ge.maximum)),Math.max(uc.minimum,Math.min(c,uc.maximum)));qb=Yl(bb,uc,
1169 ge,!1);switch(qb){case Bd:0!==fe[ge.index]&&(vb.width=Math.min(vb.width,fe[ge.index]));0!==ee[uc.index]&&(vb.height=Math.min(vb.height,ee[uc.index]));break;case ql:0!==fe[ge.index]&&(vb.width=Math.min(vb.width,fe[ge.index]));break;case rl:0!==ee[uc.index]&&(vb.height=Math.min(vb.height,ee[uc.index]))}isFinite(ge.width)&&(vb.width=ge.width);isFinite(uc.height)&&(vb.height=uc.height);de.h(0,0);for(var bf=ge.minimum,Yh=uc.minimum,cf=1;cf<bb.rowSpan&&!(bb.row+cf>=a.rowCount);cf++)P=a.getRowDefinition(bb.row+
1170 cf),Ya=0,Ya=qb===Bd||qb===rl?Math.max(P.minimum,0===ee[bb.row+cf]?P.maximum:Math.min(ee[bb.row+cf],P.maximum)):Math.max(P.minimum,isNaN(P.gd)?P.maximum:Math.min(P.gd,P.maximum)),de.height+=Ya,Yh+=P.minimum;for(var $c=1;$c<bb.columnSpan&&!(bb.column+$c>=a.columnCount);$c++)P=a.getColumnDefinition(bb.column+$c),Ya=0,Ya=qb===Bd||qb===ql?Math.max(P.minimum,0===fe[bb.column+$c]?P.maximum:Math.min(fe[bb.column+$c],P.maximum)):Math.max(P.minimum,isNaN(P.gd)?P.maximum:Math.min(P.gd,P.maximum)),de.width+=
1171 Ya,bf+=P.minimum;vb.width+=de.width;vb.height+=de.height;var zf=bb.margin,Zh=zf.right+zf.left,Zn=zf.top+zf.bottom;bb.measure(vb.width,vb.height,bf,Yh);for(var Jg=bb.measuredBounds,Dd=Math.max(Jg.width+Zh,0),he=Math.max(Jg.height+Zn,0),Ie=0,Je=0;Je<bb.rowSpan&&!(bb.row+Je>=a.rowCount);Je++)P=a.getRowDefinition(bb.row+Je),Ie+=P.total||0;if(Ie<he){var ie=he-Ie,Ke=he-Ie;if(null!==bb.spanAllocation)for(var Ck=bb.spanAllocation,df=0;df<bb.rowSpan&&!(0>=ie)&&!(bb.row+df>=a.rowCount);df++){P=a.getRowDefinition(bb.row+
1172 df);var dj=P.na||0,ej=Ck(bb,P,Ke);F&&"number"!==typeof ej&&v(bb+" spanAllocation does not return a number: "+ej);P.actual=Math.min(P.maximum,dj+ej);P.na!==dj&&(ie-=P.na-dj)}for(;0<ie;){var Ed=P.na||0;isNaN(P.height)&&P.maximum>Ed&&(P.actual=Math.min(P.maximum,Ed+ie),P.na!==Ed&&(ie-=P.na-Ed));if(0===P.index)break;P=a.getRowDefinition(P.index-1)}}for(var Xf=0,$h=0;$h<bb.columnSpan&&!(bb.column+$h>=a.columnCount);$h++)P=a.getColumnDefinition(bb.column+$h),Xf+=P.total||0;if(Xf<Dd){var Kg=Dd-Xf,Bu=Dd-
1173 Xf;if(null!==bb.spanAllocation)for(var Cu=bb.spanAllocation,Dk=0;Dk<bb.columnSpan&&!(0>=Kg)&&!(bb.column+Dk>=a.columnCount);Dk++){P=a.getColumnDefinition(bb.column+Dk);var $n=P.na||0,ao=Cu(bb,P,Bu);F&&"number"!==typeof ao&&v(bb+" spanAllocation does not return a number: "+ao);P.actual=Math.min(P.maximum,$n+ao);P.na!==$n&&(Kg-=P.na-$n)}for(;0<Kg;){var Ek=P.na||0;isNaN(P.width)&&P.maximum>Ek&&(P.actual=Math.min(P.maximum,Ek+Kg),P.na!==Ek&&(Kg-=P.na-Ek));if(0===P.index)break;P=a.getColumnDefinition(P.index-
1174 1)}}}}Oa(B);Fb.free(de);Fb.free(vb);void 0!==ee&&Oa(ee);void 0!==fe&&Oa(fe);var Lg=0,Mg=0,Fk=a.desiredSize,Jr=a.maxSize;qb=Fl(a,!0);var fj=Ee=Zd=0,gj=0;f=a.columnCount;for(var Gk=0;Gk<f;Gk++)void 0!==a.sb[Gk]&&(P=a.getColumnDefinition(Gk),isFinite(P.width)?(fj+=P.width,fj+=P.Cc()):Zm(P)===$m?(fj+=P.na,fj+=P.Cc()):0!==P.na&&(Zd+=P.na,Zd+=P.Cc()));isFinite(Fk.width)?Lg=Math.min(Fk.width,Jr.width):Lg=qb!==zg&&isFinite(b)?b:Zd;Lg=Math.max(Lg,a.minSize.width);Lg=Math.max(Lg-fj,0);for(var Du=0===Zd?1:Math.max(Lg/
1175 Zd,1),Ik=0;Ik<f;Ik++)void 0!==a.sb[Ik]&&(P=a.getColumnDefinition(Ik),isFinite(P.width)||Zm(P)===$m||(P.actual=P.na*Du),P.position=e.width,0!==P.na&&(e.width+=P.na,e.width+=P.Cc()));f=a.rowCount;for(var Jk=0;Jk<f;Jk++)void 0!==a.vb[Jk]&&(P=a.getRowDefinition(Jk),isFinite(P.height)?(gj+=P.height,gj+=P.Cc()):Zm(P)===$m?(gj+=P.na,gj+=P.Cc()):0!==P.na&&(Ee+=P.na,0!==P.na&&(Ee+=P.Cc())));isFinite(Fk.height)?Mg=Math.min(Fk.height,Jr.height):Mg=qb!==zg&&isFinite(c)?c:Ee;Mg=Math.max(Mg,a.minSize.height);Mg=
1176 Math.max(Mg-gj,0);for(var Eu=0===Ee?1:Math.max(Mg/Ee,1),Kk=0;Kk<f;Kk++)void 0!==a.vb[Kk]&&(P=a.getRowDefinition(Kk),isFinite(P.height)||Zm(P)===$m||(P.actual=P.na*Eu),P.position=e.height,0!==P.na&&(e.height+=P.na,0!==P.na&&(e.height+=P.Cc())));f=h.length;for(var bo=0;bo<f;bo++){var Fd=h[bo],co=0,eo=0;Fd.type===W.TableRow?(co=e.width,P=a.getRowDefinition(Fd.row),eo=P.actual):(P=a.getColumnDefinition(Fd.column),co=P.actual,eo=e.height);Fd.measuredBounds.h(0,0,co,eo);Dj(Fd,!1);u[Fd.row]||(u[Fd.row]=
1177 []);u[Fd.row][Fd.column]||(u[Fd.row][Fd.column]=[]);u[Fd.row][Fd.column].push(Fd)}Oa(h);a.Yp=u};
1178 Ym.prototype.arrange=function(a,b,c){var d=b.length,e=a.padding,f=e.left;e=e.top;for(var g=a.Yp,h,k,l=g.length,m=0,n=0;n<l;n++)g[n]&&(m=Math.max(m,g[n].length));for(n=Math.min(a.topIndex,l-1);n!==l&&(void 0===a.vb[n]||0===a.vb[n].na);)n++;n=Math.min(n,l-1);n=-a.vb[n].position;for(h=Math.min(a.leftIndex,m-1);h!==m&&(void 0===a.sb[h]||0===a.sb[h].na);)h++;h=Math.min(h,m-1);for(var p=-a.sb[h].position,r=Fb.alloc(),q=0;q<l;q++)if(g[q]){m=g[q].length;var u=a.getRowDefinition(q);k=u.position+n+e;0!==u.na&&
1179 (k+=u.Wv());for(var y=0;y<m;y++)if(g[q][y]){var x=a.getColumnDefinition(y);h=x.position+p+f;0!==x.na&&(h+=x.Wv());for(var z=g[q][y],B=z.length,D=0;D<B;D++){var G=z[D],M=G.measuredBounds,Y=G instanceof W?G:null;if(null===Y||Y.type!==W.TableRow&&Y.type!==W.TableColumn){r.h(0,0);for(var Q=1;Q<G.rowSpan&&!(q+Q>=a.rowCount);Q++)Y=a.getRowDefinition(q+Q),r.height+=Y.total;for(Q=1;Q<G.columnSpan&&!(y+Q>=a.columnCount);Q++)Y=a.getColumnDefinition(y+Q),r.width+=Y.total;var ca=x.na+r.width,T=u.na+r.height;
1180 Q=h;Y=k;var P=ca,xa=T,ka=h,Aa=k,Ua=ca,tb=T;h+ca>c.width&&(Ua=Math.max(c.width-h,0));k+T>c.height&&(tb=Math.max(c.height-k,0));var Xa=G.alignment;if(Xa.Ib()){Xa=a.defaultAlignment;Xa.eb()||(Xa=Kc);var Ya=Xa.x;var Qd=Xa.y;var mc=Xa.offsetX;Xa=Xa.offsetY;var nc=x.alignment,ub=u.alignment;nc.eb()&&(Ya=nc.x,mc=nc.offsetX);ub.eb()&&(Qd=ub.y,Xa=ub.offsetY)}else Ya=Xa.x,Qd=Xa.y,mc=Xa.offsetX,Xa=Xa.offsetY;if(isNaN(Ya)||isNaN(Qd))Qd=Ya=.5,Xa=mc=0;nc=M.width;ub=M.height;var Rd=G.margin,Ag=Rd.left+Rd.right,
1181 Bg=Rd.top+Rd.bottom,$e=Yl(G,u,x,!1);!isNaN(G.desiredSize.width)||$e!==Bd&&$e!==ql||(nc=Math.max(ca-Ag,0));!isNaN(G.desiredSize.height)||$e!==Bd&&$e!==rl||(ub=Math.max(T-Bg,0));ca=G.maxSize;T=G.minSize;nc=Math.min(ca.width,nc);ub=Math.min(ca.height,ub);nc=Math.max(T.width,nc);ub=Math.max(T.height,ub);ca=ub+Bg;Q+=P*Ya-(nc+Ag)*Ya+mc+Rd.left;Y+=xa*Qd-ca*Qd+Xa+Rd.top;G.visible&&(lc(ka,Aa,Ua,tb,Q,Y,M.width,M.height)?G.arrange(Q,Y,nc,ub):G.arrange(Q,Y,nc,ub,new L(ka,Aa,Ua,tb)))}else G.Sl(),G.actualBounds.ka(),
1182 P=G.actualBounds,Q=L.allocAt(P.x,P.y,P.width,P.height),P.x=Y.type===W.TableRow?f:h,P.y=Y.type===W.TableColumn?e:k,P.width=M.width,P.height=M.height,G.actualBounds.freeze(),Gl(G,!1),fc(Q,P)||(M=G.part,null!==M&&(M.Zh(),G.Ap(M))),L.free(Q)}}}Fb.free(r);for(a=0;a<d;a++)c=b[a],f=c instanceof W?c:null,null===f||f.type!==W.TableRow&&f.type!==W.TableColumn||(f=c.actualBounds,c.naturalBounds.ka(),c.naturalBounds.h(0,0,f.width,f.height),c.naturalBounds.freeze())};function an(){this.va="Base"}ma(an,hm);
1183 an.prototype.measure=function(){};an.prototype.arrange=function(){};function bn(){this.va="Base"}ma(bn,hm);bn.prototype.measure=function(){};bn.prototype.arrange=function(){};function cn(){this.va="Base"}ma(cn,hm);
1184 cn.prototype.measure=function(a,b,c,d,e,f,g){1<d.length&&v("Viewbox Panel cannot contain more than one GraphObject.");d=d[0];d.Ga=1;d.Nk();d.measure(Infinity,Infinity,f,g);var h=d.measuredBounds,k=d.margin,l=k.right+k.left;k=k.top+k.bottom;if(isFinite(b)||isFinite(c)){var m=d.scale,n=h.width;h=h.height;var p=Math.max(b-l,0),r=Math.max(c-k,0),q=1;a.viewboxStretch===Og?0!==n&&0!==h&&(q=Math.min(p/n,r/h)):0!==n&&0!==h&&(q=Math.max(p/n,r/h));0===q&&(q=1E-4);d.Ga*=q;m!==d.scale&&(Dj(d,!0),d.measure(Infinity,
1185 Infinity,f,g))}h=d.measuredBounds;e.width=isFinite(b)?b:Math.max(h.width+l,0);e.height=isFinite(c)?c:Math.max(h.height+k,0)};cn.prototype.arrange=function(a,b,c){b=b[0];var d=b.measuredBounds,e=b.margin,f=Math.max(d.width+(e.right+e.left),0);e=Math.max(d.height+(e.top+e.bottom),0);var g=b.alignment;g.Ib()&&(g=a.defaultAlignment);g.eb()||(g=Kc);b.arrange(c.width*g.x-f*g.x+g.offsetX,c.height*g.y-e*g.y+g.offsetY,d.width,d.height)};function dn(){this.va="Base"}ma(dn,hm);dn.prototype.measure=function(){};
1186 dn.prototype.arrange=function(){};
1187 dn.prototype.sc=function(a,b,c){c=a.Mf()*c.scale;0>=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();for(var r=[],q=a.$.j,u=q.length,y=0;y<u;y++){var x=q[y],z=[];r.push(z);if(x.visible){var B=x.interval;if(!(0>B)){x=nk(x.figure);for(var D=0;D<u;D++)if(D!==y){var G=q[D];G.visible&&nk(G.figure)===x&&(G=G.interval,G>B&&z.push(G))}}}}q=
1188 a.$.j;u=q.length;for(y=0;y<u;y++){var M=q[y];if(M.visible&&(z=M.interval||1,x=Math.abs(z),!(2>e*x*c))){B=M.segmentIndex;if(!isFinite(B)||isNaN(B))B=0;0>B&&(B=x-Math.min(-B,x));B=Math.round(B%x);x=M.opacity;D=1;if(1!==x){if(0===x)continue;D=b.globalAlpha;b.globalAlpha=D*x}G=r[y];var Y=!1,Q=M.strokeDashArray;null!==Q&&(Y=!0,b.St(Q,M.strokeDashOffset));if("LineV"===M.figure&&null!==M.stroke&&0<M.strokeWidth){b.lineWidth=M.strokeWidth;Ai(a,b,M.stroke,!1,!1,f,g);b.beginPath();for(Q=M=Math.floor((p-e)/
1189 e);Q<=M+l;Q++){var ca=Q*e+p;0<=ca&&ca<=h&&en(Q,z,B,G)&&(b.moveTo(ca,0),b.lineTo(ca,k))}b.stroke()}else if("LineH"===M.figure&&null!==M.stroke&&0<M.strokeWidth){b.lineWidth=M.strokeWidth;Ai(a,b,M.stroke,!1,!1,f,g);b.beginPath();for(Q=M=Math.floor((n-d)/d);Q<=M+m;Q++)ca=Q*d+n,0<=ca&&ca<=k&&en(Q,z,B,G)&&(b.moveTo(0,ca),b.lineTo(h,ca));b.stroke()}else if("BarV"===M.figure&&null!==M.fill)for(Ai(a,b,M.fill,!0,!1,f,g),M=M.width,isNaN(M)&&(M=e),ca=Q=Math.floor((p-e)/e);ca<=Q+l;ca++){var T=ca*e+p;0<=T+M&&
1190 T<=h&&en(ca,z,B,G)&&b.fillRect(T,0,M,k)}else if("BarH"===M.figure&&null!==M.fill)for(Ai(a,b,M.fill,!0,!1,f,g),M=M.height,isNaN(M)&&(M=d),ca=Q=Math.floor((n-d)/d);ca<=Q+m;ca++)T=ca*d+n,0<=T+M&&T<=k&&en(ca,z,B,G)&&b.fillRect(0,T,h,M);Y&&b.Qt();1!==x&&(b.globalAlpha=D)}}b.restore();b.Ac(!1)};function en(a,b,c,d){if(0>b)return a%b===c;if(a%b!==c)return!1;b=d.length;for(var e=0;e<b;e++)if(a%d[e]===c)return!1;return!0}function fn(){this.va="Base"}ma(fn,hm);
1191 fn.prototype.measure=function(a,b,c,d,e){c=d.length;if(a instanceof Ve||a instanceof S){var f=null,g=null,h=null;a instanceof S&&(g=f=a);a instanceof Ve&&(h=a,f=h.adornedPart);if(f instanceof S){var k=f;if(0===c)cc(a.naturalBounds,0,0),a.measuredBounds.h(0,0,0,0);else{var l=a instanceof Ve?null:f.path,m=f.routeBounds;b=a.Jg;b.h(0,0,m.width,m.height);var n=k.points;f=f.pointsCount;null!==h?h.Rk(!1):null!==g&&g.Rk(!1);var p=m.width,r=m.height;a.location.h(m.x,m.y);a.l.length=0;null!==l&&(gn(a,p,r,l),
1192 h=l.measuredBounds,b.Xc(h),a.l.push(h));h=Gb.alloc();for(var q=J.alloc(),u=J.alloc(),y=0;y<c;y++){var x=d[y];if(x!==l)if(x.isPanelMain&&x instanceof Uf){gn(a,p,r,x);var z=x.measuredBounds;b.Xc(z);a.l.push(z)}else if(2>f)x.measure(Infinity,Infinity,0,0),z=x.measuredBounds,b.Xc(z),a.l.push(z);else{var B=x.segmentIndex,D=x.segmentFraction,G=x.alignmentFocus;G.Sb()&&(G=Kc);var M=x.segmentOrientation,Y=x.segmentOffset;if(isNaN(B)){var Q=k.ua;z=Ma();Q.mw(D,z);var ca=J.allocAt(z[0],z[1]);ca.add(k.i(0));
1193 Q.type===Gd?ca.offset(-Q.startX,-Q.startY):(Q=Q.figures.first(),ca.offset(-Q.startX,-Q.startY));Q=z[2];if(M!==ng){var T=k.computeAngle(x,M,Q);x.dc=T}T=ca.x-m.x;var P=ca.y-m.y;J.free(ca);Oa(z)}else if(B<-f||B>=f)P=k.midPoint,Q=k.midAngle,M!==ng&&(T=k.computeAngle(x,M,Q),x.dc=T),T=P.x-m.x,P=P.y-m.y;else{T=0;0<=B?(P=n.M(B),z=B<f-1?n.M(B+1):P):(T=f+B,P=n.M(T),z=0<T?n.M(T-1):P);if(P.Wa(z)){0<=B?(Q=0<B?n.M(B-1):P,T=B<f-2?n.M(B+2):z):(Q=T<f-1?n.M(T+1):P,T=1<T?n.M(T-2):z);ca=Q.Ve(P);var xa=z.Ve(T);Q=ca>xa+
1194 10?0<=B?Q.Va(P):P.Va(Q):xa>ca+10?0<=B?z.Va(T):T.Va(z):0<=B?Q.Va(T):T.Va(Q)}else Q=0<=B?P.Va(z):z.Va(P);M!==ng&&(T=k.computeAngle(x,M,Q),x.dc=T);T=P.x+(z.x-P.x)*D-m.x;P=P.y+(z.y-P.y)*D-m.y}x.measure(Infinity,Infinity,0,0);z=x.measuredBounds;ca=x.naturalBounds;var ka=0;x instanceof Uf&&(ka=x.strokeWidth);xa=ca.width+ka;var Aa=ca.height+ka;h.reset();h.translate(-z.x,-z.y);h.scale(x.scale,x.scale);h.rotate(M===ng?x.angle:Q,xa/2,Aa/2);M!==hn&&M!==jn||h.rotate(90,xa/2,Aa/2);M!==kn&&M!==ln||h.rotate(-90,
1195 xa/2,Aa/2);M===mn&&(45<Q&&135>Q||225<Q&&315>Q)&&h.rotate(-Q,xa/2,Aa/2);ca=new L(0,0,xa,Aa);q.Fj(ca,G);h.Aa(q);G=-q.x+ka/2*x.scale;x=-q.y+ka/2*x.scale;u.assign(Y);ka=isNaN(Y.x);var Ua=isNaN(Y.y);if(ka||Ua){xa=xa/2+3;Aa=Aa/2+3;var tb=45<=Q&&135>=Q,Xa=225<=Q&&315>=Q;M===ng&&(tb||Xa)?(u.x=Ua?xa:Y.y,u.y=ka?Aa:Y.x,tb?0<=B||isNaN(B)&&.5>D||!ka||(u.y=-Aa):Xa&&((0<=B||isNaN(B)&&.5>D)&&ka&&(u.y=-Aa),Ua&&(u.x=-xa))):(ka&&(u.x=0<=B||isNaN(B)&&.5>D?xa:-xa),Ua&&(u.y=-Aa),u.rotate(Q))}else u.rotate(Q);T+=u.x;P+=
1196 u.y;ca.set(z);ca.h(T+G,P+x,z.width,z.height);a.l.push(ca);b.Xc(ca)}}if(null!==g)for(d=g.labelNodes;d.next();)d.value.measure(Infinity,Infinity);a.Jg=b;a=a.location;a.h(a.x+b.x,a.y+b.y);cc(e,b.width||0,b.height||0);Gb.free(h);J.free(q);J.free(u)}}}};
1197 fn.prototype.arrange=function(a,b){var c=b.length;if(a instanceof Ve||a instanceof S){var d=null,e=null,f=null;a instanceof S&&(e=d=a);a instanceof Ve&&(f=a,d=f.adornedPart);var g=a instanceof Ve?null:d.path;if(0!==a.l.length){var h=a.l,k=0;if(null!==g&&k<a.l.length){var l=h[k];k++;g.arrange(l.x-a.Jg.x,l.y-a.Jg.y,l.width,l.height)}for(l=0;l<c;l++){var m=b[l];if(m!==g&&k<a.l.length){var n=h[k];k++;m.arrange(n.x-a.Jg.x,n.y-a.Jg.y,n.width,n.height)}}}b=d.points;c=b.count;if(2<=c&&a instanceof S)for(d=
1198 a.labelNodes;d.next();){var p=a;g=d.value;h=g.segmentIndex;k=g.segmentFraction;var r=g.alignmentFocus;l=g.segmentOrientation;m=g.segmentOffset;if(isNaN(h)){n=p.ua;var q=Ma();n.mw(k,q);var u=J.allocAt(q[0],q[1]);u.add(p.i(0));n.type===Gd?u.offset(-n.startX,-n.startY):(n=n.figures.first(),u.offset(-n.startX,-n.startY));n=q[2];l!==ng&&(p=p.computeAngle(g,l,n),g.angle=p);p=u.x;var y=u.y;J.free(u);Oa(q)}else if(h<-c||h>=c)y=p.midPoint,n=p.midAngle,l!==ng&&(p=p.computeAngle(g,l,n),g.angle=p),p=y.x,y=y.y;
1199 else{u=0;0<=h?(q=b.j[h],y=h<c-1?b.j[h+1]:q):(u=c+h,q=b.j[u],y=0<u?b.j[u-1]:q);if(q.Wa(y)){0<=h?(n=0<h?b.j[h-1]:q,u=h<c-2?b.j[h+2]:y):(n=u<c-1?b.j[u+1]:q,u=1<u?b.j[u-2]:y);var x=n.Ve(q),z=y.Ve(u);n=x>z+10?0<=h?n.Va(q):q.Va(n):z>x+10?0<=h?y.Va(u):u.Va(y):0<=h?n.Va(u):u.Va(n)}else n=0<=h?q.Va(y):y.Va(q);l!==ng&&(p=p.computeAngle(g,l,n),g.angle=p);p=q.x+(y.x-q.x)*k;y=q.y+(y.y-q.y)*k}if(r.br())g.location=new J(p,y);else{r.Sb()&&(r=Kc);q=Gb.alloc();q.reset();q.scale(g.scale,g.scale);q.rotate(g.angle,0,
1200 0);var B=g.naturalBounds;u=L.allocAt(0,0,B.width,B.height);x=J.alloc();x.Fj(u,r);q.Aa(x);r=-x.x;z=-x.y;var D=B.width,G=B.height;B=J.alloc();B.assign(m);var M=isNaN(m.x),Y=isNaN(m.y);if(M||Y){D=D/2+3;G=G/2+3;var Q=45<=n&&135>=n,ca=225<=n&&315>=n;l===ng&&(Q||ca)?(B.x=Y?D:m.y,B.y=M?G:m.x,Q?0<=h||isNaN(h)&&.5>k||!M||(B.y=-G):ca&&((0<=h||isNaN(h)&&.5>k)&&M&&(B.y=-G),Y&&(B.x=-D))):(M&&(B.x=0<=h||isNaN(h)&&.5>k?D:-D),Y&&(B.y=-G),B.rotate(n))}else B.rotate(n);p+=B.x;y+=B.y;q.ex(u);r+=u.x;z+=u.y;h=J.allocAt(p+
1201 r,y+z);g.move(h);J.free(h);J.free(B);J.free(x);L.free(u);Gb.free(q)}}null!==f?f.Rk(!1):null!==e&&e.Rk(!1)}};
1202 function gn(a,b,c,d){if(!1!==Ij(d)){var e=d.strokeWidth;0===e&&a instanceof Ve&&a.type===W.Link&&a.adornedObject instanceof Uf&&(e=a.adornedObject.strokeWidth);e*=d.Ga;a instanceof S&&null!==a.ua?(a=a.ua.bounds,Cl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):a instanceof Ve&&null!==a.adornedPart.ua?(a=a.adornedPart.ua.bounds,Cl(d,a.x-e/2,a.y-e/2,a.width+e,a.height+e)):Cl(d,-(e/2),-(e/2),b+e,c+e);Dj(d,!1)}}function nn(){this.va="Base"}ma(nn,hm);
1203 nn.prototype.measure=function(a,b,c,d,e,f,g){var h=a.yb();a.ph=[];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 L(-k.left,-k.top,Math.max(n.width+l,0),Math.max(n.height+m,0));a.ph.push(p);e.assign(p);for(var r=h.geometry,q=h.strokeWidth,u=r.flattenedSegments,y=r.flattenedLengths,x=r.flattenedTotalLength,z=u.length,B=0,D=0,G=Ma(),M=0;M<z;M++){var Y=u[M],Q=[];D=B=0;for(var ca=Y.length,T=0;T<ca;T+=2){var P=Y[T],xa=Y[T+1];if(0!==T){var ka=180*Math.atan2(xa-
1204 D,P-B)/Math.PI;0>ka&&(ka+=360);Q.push(ka)}B=P;D=xa}G.push(Q)}if(null===a.qh){for(var Aa=[],Ua=a.$.j,tb=Ua.length,Xa=0;Xa<tb;Xa++){var Ya=Ua[Xa],Qd=[];Aa.push(Qd);if(Ya.visible){var mc=Ya.interval;if(!(0>mc))for(var nc=0;nc<tb;nc++)if(nc!==Xa){var ub=Ua[nc];if(ub.visible&&Ya.constructor===ub.constructor){var Rd=ub.interval;Rd>mc&&Qd.push(Rd)}}}}a.qh=Aa}var Ag=a.qh;var Bg=a.$.j,$e=Bg.length,Xb=0,Ph=0,Cg=x;a.Yj=[];for(var Qh,Rh=0;Rh<$e;Rh++){var qb=Bg[Rh];Qh=[];if(qb.visible&&qb!==h){var aj=Math.abs(qb.interval),
1205 Ak=a.graduatedTickUnit;if(!(2>Ak*aj*x/a.graduatedRange)){var Dg=y[0][0],Cd=0,Cc=0;Ph=x*qb.graduatedStart-1E-4;Cg=x*qb.graduatedEnd+1E-4;var Vf=Ak*aj,Ic=a.graduatedTickBase;if(Ic<a.graduatedMin){var Eg=(a.graduatedMin-Ic)/Vf;Eg=0===Eg%1?Eg:Math.floor(Eg+1);Ic+=Eg*Vf}else Ic>a.graduatedMin+Vf&&(Ic-=Math.floor((Ic-a.graduatedMin)/Vf)*Vf);for(var Sh=Ag[Rh],Wn=Ic,Zd=1;Ic<a.graduatedMax+5E-8;Zd++){a:{for(var Ee=Sh.length,Fg=0;Fg<Ee;Fg++)if(K.da((Ic-a.graduatedTickBase)%(Sh[Fg]*a.graduatedTickUnit),0)){var Gg=
1206 !1;break a}Gg=!0}if(Gg&&(null===qb.graduatedSkip||!qb.graduatedSkip(Ic))&&(Xb=(Ic-a.graduatedMin)*x/a.graduatedRange,Xb>x&&(Xb=x),Ph<=Xb&&Xb<=Cg)){for(var id=G[Cd][Cc],Fe=y[Cd][Cc];Cd<y.length;){for(;Xb>Dg&&Cc<y[Cd].length-1;)Cc++,id=G[Cd][Cc],Fe=y[Cd][Cc],Dg+=Fe;if(Xb<=Dg)break;Cd++;Cc=0;id=G[Cd][Cc];Fe=y[Cd][Cc];Dg+=Fe}var sc=u[Cd],Th=sc[2*Cc],Uh=sc[2*Cc+1],jd=(Xb-(Dg-Fe))/Fe,bj=new J(Th+(sc[2*Cc+2]-Th)*jd+q/2-r.bounds.x,Uh+(sc[2*Cc+3]-Uh)*jd+q/2-r.bounds.y);bj.scale(h.scale,h.scale);var Ge=id,
1207 xf=G[Cd];1E-4>jd?0<Cc?Ge=xf[Cc-1]:K.da(sc[0],sc[sc.length-2])&&K.da(sc[1],sc[sc.length-1])&&(Ge=xf[xf.length-1]):.9999<jd&&(Cc+1<xf.length?Ge=xf[Cc+1]:K.da(sc[0],sc[sc.length-2])&&K.da(sc[1],sc[sc.length-1])&&(Ge=xf[0]));id!==Ge&&(180<Math.abs(id-Ge)&&(id<Ge?id+=360:Ge+=360),id=(id+Ge)/2%360);if(qb instanceof ih){var Sd="";null!==qb.graduatedFunction?(Sd=qb.graduatedFunction(Ic),Sd=null!==Sd&&void 0!==Sd?Sd.toString():""):Sd=(+Ic.toFixed(2)).toString();""!==Sd&&Qh.push({Ym:bj,angle:id,text:Sd})}else Qh.push({Ym:bj,
1208 angle:id})}Ic=Wn+Zd*Vf}}}a.Yj.push(Qh)}Oa(G);var Bk=a.Yj;if(null!==Bk)for(var Xn=d.length,Wf=0;Wf<Xn;Wf++){var Yb=d[Wf],$d=Bk[Wf];if(Yb.visible&&Yb!==h&&0!==$d.length){if(Yb instanceof Uf){var vb=a,cj=e,oc=Yb.alignmentFocus;oc.Sb()&&(oc=Fc);var Jc=Yb.angle;Yb.dc=0;Yb.measure(Infinity,Infinity,0,0);Yb.dc=Jc;var Dc=Yb.measuredBounds,ae=Dc.width,be=Dc.height,Hg=L.allocAt(0,0,ae,be),Qc=J.alloc();Qc.Fj(Hg,oc);L.free(Hg);for(var Vh=-Qc.x,Ig=-Qc.y,ce=new L,Wh=$d.length,yf=0;yf<Wh;yf++)for(var de=$d[yf],
1209 ee=de.Ym.x,fe=de.Ym.y,af=de.angle,Xh=0;4>Xh;Xh++){switch(Xh){case 0:Qc.h(Vh,Ig);break;case 1:Qc.h(Vh+ae,Ig);break;case 2:Qc.h(Vh,Ig+be);break;case 3:Qc.h(Vh+ae,Ig+be)}Qc.rotate(af+Yb.angle);Qc.offset(ee,fe);0===yf&&0===Xh?ce.h(Qc.x,Qc.y,0,0):ce.af(Qc);Qc.offset(-ee,-fe);Qc.rotate(-af-Yb.angle)}J.free(Qc);null!==vb.ph&&vb.ph.push(ce);kc(cj,ce.x,ce.y,ce.width,ce.height)}else if(Yb instanceof ih){var He=a,Yn=e;null===He.Kh&&(He.Kh=new ih);var tc=He.Kh;on(tc,Yb);var bb=Yb.alignmentFocus;bb.Sb()&&(bb=
1210 Fc);for(var uc=Yb.segmentOrientation,ge=Yb.segmentOffset,bf=new L,Yh=0,cf=0,$c=0,zf=0,Zh=0,Zn=$d.length,Jg=0;Jg<Zn;Jg++){var Dd=$d[Jg];Yh=Dd.Ym.x;cf=Dd.Ym.y;$c=Dd.angle;Zh=zf=Yb.angle;uc!==ng&&(Zh=uc===pn||uc===qn?$c+Yb.angle:$c,zf=S.computeAngle(uc,Zh));tc.dc=zf;tc.text=Dd.text||"";tc.measure(Infinity,Infinity,0,0);var he=tc.measuredBounds,Ie=tc.naturalBounds,Je=Ie.width,ie=Ie.height,Ke=Gb.alloc();Ke.reset();Ke.translate(-he.x,-he.y);Ke.scale(tc.scale,tc.scale);Ke.rotate(Zh,Je/2,ie/2);uc!==hn&&uc!==
1211 jn||Ke.rotate(90,Je/2,ie/2);uc!==kn&&uc!==ln||Ke.rotate(-90,Je/2,ie/2);uc===mn&&(45<$c&&135>$c||225<$c&&315>$c)&&Ke.rotate(-$c,Je/2,ie/2);var Ck=L.allocAt(0,0,Je,ie),df=J.alloc();df.Fj(Ck,bb);Ke.Aa(df);var dj=-df.x,ej=-df.y,Ed=J.alloc();Ed.assign(ge);isNaN(Ed.x)&&(Ed.x=Je/2+3);isNaN(Ed.y)&&(Ed.y=-(ie/2+3));Ed.rotate($c);Yh+=Ed.x+dj;cf+=Ed.y+ej;var Xf=new L(Yh,cf,he.width,he.height),$h=new L(he.x,he.y,he.width,he.height),Kg=new L(Ie.x,Ie.y,Ie.width,Ie.height);Dd.XA=zf;Dd.lineCount=tc.lineCount;Dd.lines=
1212 [tc.Ab,tc.Pi,tc.ye,tc.Me,tc.Wb,tc.qb,tc.we];Dd.actualBounds=Xf;Dd.measuredBounds=$h;Dd.naturalBounds=Kg;0===Jg?bf.assign(Xf):bf.Xc(Xf);J.free(Ed);J.free(df);L.free(Ck);Gb.free(Ke)}null!==He.ph&&He.ph.push(bf);kc(Yn,bf.x,bf.y,bf.width,bf.height)}Dj(Yb,!1)}}};
1213 nn.prototype.arrange=function(a,b,c){if(null!==a.ph){var d=a.yb(),e=a.Yj;if(null!==e){var f=a.ph,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<k;l++){var m=b[l];h=e[l];m.visible&&m!==d&&0!==h.length&&(h=f[g],g++,m.arrange(h.x-c.x,h.y-c.y,h.width,h.height))}a.ph=null}}};
1214 nn.prototype.sc=function(a,b,c){var d=c.Ji;c.Ji=!0;var e=a.naturalBounds,f=e.width;e=e.height;b.save();b.beginPath();b.rect(-1,-1,f+1,e+1);b.clip();f=a.yb();f.sc(b,c);e=a.Mf()*c.scale;0>=e&&(e=1);for(var g=f.actualBounds,h=a.$.j,k=a.Yj,l=h.length,m=0;m<l;m++){var n=h[m],p=k[m],r=p.length;if(n.visible&&n!==f&&0!==p.length)if(n instanceof Uf){if(!(2>a.graduatedTickUnit*n.interval*f.geometry.flattenedTotalLength/a.graduatedRange*e)){var q=n.measuredBounds,u=n.strokeWidth*n.scale,y=n.alignmentFocus;y.Sb()&&
1215 (y=Fc);for(var x=0;x<r;x++){var z=p[x].Ym,B=p[x].angle,D=y,G=n.xb;G.reset();G.translate(z.x+g.x,z.y+g.y);G.rotate(B+n.angle,0,0);G.translate(-q.width*D.x+D.offsetX+u/2,-q.height*D.y+D.offsetY+u/2);G.scale(n.scale,n.scale);Vl(n,!1);n.ji.set(n.xb);n.Cl=n.scale;Wl(n,!1);n.sc(b,c);n.xb.reset()}}}else if(n instanceof ih)for(null===a.Kh&&(a.Kh=new ih),q=a.Kh,on(q,n),n=0;n<r;n++)u=p[n],u.actualBounds&&u.measuredBounds&&u.naturalBounds&&(q.$b=u.text||"",q.dc=u.XA||0,q.ed=u.lineCount||0,y=u.lines,void 0!==
1216 y&&(q.Ab=y[0],q.Pi=y[1],q.ye=y[2],q.Me=y[3],q.Wb=y[4],q.qb=y[5],q.we=y[6]),u.naturalBounds&&(q.wc=u.naturalBounds),u.actualBounds&&(y=u.actualBounds,q.arrange(y.x,y.y,y.width,y.height)),y=u.actualBounds,q.arrange(y.x,y.y,y.width,y.height),x=u.measuredBounds,u=u.naturalBounds,z=q.xb,z.reset(),z.translate(y.x+g.x,y.y+g.y),z.translate(-x.x,-x.y),Dl(q,z,u.x,u.y,u.width,u.height),Vl(q,!1),q.ji.set(q.xb),q.Cl=q.scale,Wl(q,!1),q.sc(b,c))}c.Ji=d;b.restore();b.Ac(!0)};
1217 function W(a){O.call(this);void 0===a?this.sa=W.Position:(w(a,hm,W,"type"),this.sa=a);null===this.sa&&v("Panel type not specified or PanelLayout not loaded: "+a);this.$=new H;this.ob=zc;this.sa===W.Grid&&(this.isAtomic=!0);this.Zn=fd;this.dg=pl;this.sa===W.Table&&rn(this);this.Cq=Og;this.Ao=Vb;this.Bo=Mb;this.xo=0;this.wo=100;this.zo=10;this.yo=0;this.xi=this.tb=this.qh=this.ph=this.Yj=null;this.Qo=NaN;this.De=this.Ni=null;this.Wl="category";this.ee=null;this.Jg=new L(NaN,NaN,NaN,NaN);this.Kh=this.Yp=
1218 this.ej=null;this.Xg=""}ma(W,O);function rn(a){a.Rj=zc;a.gh=1;a.Di=null;a.Ci=null;a.fh=1;a.eh=null;a.Bi=null;a.vb=[];a.sb=[];a.qk=sn;a.Oj=sn;a.hj=0;a.Ri=0}
1219 W.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.sa=this.sa;a.ob=this.ob.K();a.Zn=this.Zn.K();a.dg=this.dg;if(a.sa===W.Table){a.Rj=this.Rj.K();a.gh=this.gh;a.Di=this.Di;a.Ci=this.Ci;a.fh=this.fh;a.eh=this.eh;a.Bi=this.Bi;var b=[];if(0<this.vb.length)for(var c=this.vb,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var f=c[e].copy();f.Ej(a);b[e]=f}a.vb=b;b=[];if(0<this.sb.length)for(c=this.sb,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(f=c[e].copy(),f.Ej(a),b[e]=f);a.sb=b;a.qk=
1220 this.qk;a.Oj=this.Oj;a.hj=this.hj;a.Ri=this.Ri}a.Cq=this.Cq;a.Ao=this.Ao.K();a.Bo=this.Bo.K();a.xo=this.xo;a.wo=this.wo;a.zo=this.zo;a.yo=this.yo;a.Yj=this.Yj;a.qh=this.qh;a.tb=this.tb;a.xi=this.xi;a.Qo=this.Qo;a.Ni=this.Ni;a.De=this.De;a.Wl=this.Wl;a.Jg.assign(this.Jg);a.Xg=this.Xg;null!==this.Yp&&(a.Yp=this.Yp)};W.prototype.Kf=function(a){O.prototype.Kf.call(this,a);a.$=this.$;for(var b=a.$.j,c=b.length,d=0;d<c;d++)b[d].Ag=a;a.ej=null};
1221 W.prototype.copy=function(){var a=O.prototype.copy.call(this);if(null!==a){for(var b=this.$.j,c=b.length,d=0;d<c;d++){var e=b[d].copy();e.Ej(a);e.mk=null;var f=a.$,g=f.count;f.Bb(g,e);f=a.part;if(null!==f){f.ik=null;null!==e.portId&&f instanceof V&&(f.Yh=!0);var h=a.diagram;null!==h&&h.undoManager.isUndoingRedoing||f.ab(Le,"elements",a,null,e,null,g)}}return a}return null};t=W.prototype;t.toString=function(){return"Panel("+this.type.name+")#"+ob(this)};
1222 t.Ap=function(a){O.prototype.Ap.call(this,a);for(var b=this.$.j,c=b.length,d=0;d<c;d++)b[d].Ap(a)};
1223 t.pj=function(a,b){if(this.sa===W.Grid)this.sa.sc(this,a,b);else if(this.sa===W.Graduated)this.sa.sc(this,a,b);else{this.sa===W.Table&&(a.lineCap="butt",tn(this,a,!0,this.vb,!0),tn(this,a,!1,this.sb,!0),un(this,a,!0,this.vb),un(this,a,!1,this.sb),tn(this,a,!0,this.vb,!1),tn(this,a,!1,this.sb,!1));var c=this.isClipping&&this.sa===W.Spot;c&&a.save();for(var d=this.yb(),e=this.$.j,f=e.length,g=0;g<f;g++){var h=e[g];c&&h===d&&(a.clipInsteadOfFill=!0);h.sc(a,b);c&&h===d&&(a.clipInsteadOfFill=!1)}c&&(a.restore(),
1224 a.Ac(!0))}};
1225 function un(a,b,c,d){for(var e=d.length,f=a.actualBounds,g=a.naturalBounds,h=!0,k=0;k<e;k++){var l=d[k];if(void 0!==l)if(h)h=!1;else if(0!==l.actual){if(c){if(l.position>f.height)continue}else if(l.position>f.width)continue;var m=l.separatorStrokeWidth;isNaN(m)&&(m=c?a.gh:a.fh);var n=l.separatorStroke;null===n&&(n=c?a.Di:a.eh);if(0!==m&&null!==n){Ai(a,b,n,!1,!1,g,f);n=!1;var p=l.separatorDashArray;null===p&&(p=c?a.Ci:a.Bi);null!==p&&(n=!0,b.St(p,0));b.beginPath();p=l.position+m;c?p>f.height&&(m-=
1226 p-f.height):p>f.width&&(m-=p-f.width);l=l.position+m/2;b.lineWidth=m;m=a.ob;c?(l+=m.top,p=f.width-m.right,b.moveTo(m.left,l),b.lineTo(p,l)):(l+=m.left,p=f.height-m.bottom,b.moveTo(l,m.top),b.lineTo(l,p));b.stroke();n&&b.Qt()}}}}
1227 function tn(a,b,c,d,e){for(var f=d.length,g=a.actualBounds,h=a.naturalBounds,k=0;k<f;k++){var l=d[k];if(void 0!==l&&null!==l.background&&l.coversSeparators!==e&&0!==l.actual){var m=c?g.height:g.width;if(!(l.position>m)){var n=l.Cc(),p=l.separatorStrokeWidth;isNaN(p)&&(p=c?a.gh:a.fh);var r=l.separatorStroke;null===r&&(r=c?a.Di:a.eh);null===r&&(p=0);n-=p;p=l.position+p;n+=l.actual;p+n>m&&(n=m-p);0>=n||(m=a.ob,Ai(a,b,l.background,!0,!1,h,g),c?b.fillRect(m.left,p+m.top,g.width-(m.left+m.right),n):b.fillRect(p+
1228 m.left,m.top,n,g.height-(m.top+m.bottom)))}}}}function nk(a){return"LineV"===a||"BarV"===a}
1229 t.Lk=function(a,b,c,d,e){var f=this.pe(),g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),r=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.areaBackground)return g=this.actualBounds,K.Of(g.left,g.top,g.right,g.bottom,a,b,c,d,e);if(null!==this.background)return f=a*k+b*m+p,h=a*l+b*n+r,a=c*k+d*m+p,k=c*l+d*n+r,e.h(0,0),c=this.naturalBounds,f=K.Of(0,0,c.width,c.height,f,h,a,k,e),e.transform(g),f;f||(k=1,m=l=0,n=1,r=p=0);h=a*k+b*m+p;a=a*l+b*
1230 n+r;k=c*k+d*m+p;c=c*l+d*n+r;e.h(k,c);d=(k-h)*(k-h)+(c-a)*(c-a);l=!1;n=this.$.j;r=n.length;m=J.alloc();p=null;b=Infinity;var q=null,u=this.isClipping&&this.sa===W.Spot;u&&(q=J.alloc(),p=this.yb(),(l=p.Lk(h,a,k,c,q))&&(b=(h-q.x)*(h-q.x)+(a-q.y)*(a-q.y)));for(var y=0;y<r;y++){var x=n[y];x.visible&&x!==p&&x.Lk(h,a,k,c,m)&&(l=!0,x=(h-m.x)*(h-m.x)+(a-m.y)*(a-m.y),x<d&&(d=x,e.set(m)))}u&&(b>d&&e.set(q),J.free(q));J.free(m);f&&e.transform(g);return l};
1231 t.u=function(a){if(!Ij(this)){O.prototype.u.call(this,a);a=null;if(this.sa===W.Auto||this.sa===W.Link)a=this.yb();for(var b=this.$.j,c=b.length,d=0;d<c;d++){var e=b[d];(e===a||e.isPanelMain)&&e.u(!0);if(!e.desiredSize.o()){var f=Fl(e,!1);(e instanceof xg||e instanceof W||e instanceof ih||f!==zg)&&e.u(!0)}}}};t.Nk=function(){if(!Ij(this)){Dj(this,!0);Gl(this,!0);for(var a=this.$.j,b=a.length,c=0;c<b;c++)a[c].Nk()}};
1232 t.Sl=function(){if(0!==(this.I&2048)===!1){Vl(this,!0);Wl(this,!0);for(var a=this.$.j,b=a.length,c=0;c<b;c++)a[c].sw()}};t.sw=function(){Wl(this,!0);for(var a=this.$.j,b=a.length,c=0;c<b;c++)a[c].sw()};
1233 t.Vm=function(a,b,c,d){var e=this.Jg;e.h(0,0,0,0);var f=this.desiredSize,g=this.minSize;void 0===c&&(c=g.width,d=g.height);c=Math.max(c,g.width);d=Math.max(d,g.height);var h=this.maxSize;isNaN(f.width)||(a=Math.min(f.width,h.width));isNaN(f.height)||(b=Math.min(f.height,h.height));a=Math.max(c,a);b=Math.max(d,b);var k=this.ob;a=Math.max(a-k.left-k.right,0);b=Math.max(b-k.top-k.bottom,0);var l=this.$.j;0!==l.length&&this.sa.measure(this,a,b,l,e,c,d);a=e.width+k.left+k.right;k=e.height+k.top+k.bottom;
1234 isFinite(f.width)&&(a=f.width);isFinite(f.height)&&(k=f.height);a=Math.min(h.width,a);k=Math.min(h.height,k);a=Math.max(g.width,a);k=Math.max(g.height,k);a=Math.max(c,a);k=Math.max(d,k);cc(e,a,k);cc(this.naturalBounds,a,k);Cl(this,0,0,a,k)};t.yb=function(){if(null===this.ej){var a=this.$.j,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.isPanelMain)return this.ej=d}this.ej=a[0]}return this.ej};function Rm(a){return null!==a.part?a.part.locationObject:null}
1235 t.Th=function(a,b,c,d){var e=this.$.j;this.actualBounds.h(a,b,c,d);if(0!==e.length){if(!this.desiredSize.o()){a=Fl(this,!0);var f=this.measuredBounds;b=f.width;f=f.height;var g=this.vh,h=g.left+g.right;g=g.top+g.bottom;b===c&&f===d&&(a=zg);switch(a){case zg:if(b>c||f>d)this.u(),this.measure(b>c?c:b,f>d?d:f,0,0);break;case Bd:this.u(!0);this.measure(c+h,d+g,0,0);break;case ql:this.u(!0);this.measure(c+h,f+g,0,0);break;case rl:this.u(!0),this.measure(b+h,d+g,0,0)}}this.sa.arrange(this,e,this.Jg)}};
1236 t.Vh=function(a){var b=this.naturalBounds,c=Rm(this);if(lc(0,0,b.width,b.height,a.x,a.y)){b=this.$.j;for(var d=b.length,e=J.allocAt(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Hb(e.set(a),f.transform),f.ca(e))return J.free(e),!0}J.free(e);return null===this.rb&&null===this.kc?!1:!0}return!1};t.Tt=function(a){if(this.pl===a)return this;for(var b=this.$.j,c=b.length,d=0;d<c;d++){var e=b[d].Tt(a);if(null!==e)return e}return null};
1237 t.fl=function(a,b){b(this,a);if(a instanceof W){a=a.$.j;for(var c=a.length,d=0;d<c;d++)this.fl(a[d],b)}};function Vj(a,b){vn(a,a,b)}function vn(a,b,c){c(b);b=b.$.j;for(var d=b.length,e=0;e<d;e++){var f=b[e];f instanceof W&&vn(a,f,c)}}function wn(a,b){xn(a,a,b)}function xn(a,b,c){c(b);if(b instanceof W){b=b.$.j;for(var d=b.length,e=0;e<d;e++)xn(a,b[e],c)}}t.Mm=function(a){return yn(this,this,a)};
1238 function yn(a,b,c){if(c(b))return b;if(b instanceof W){b=b.$.j;for(var d=b.length,e=0;e<d;e++){var f=yn(a,b[e],c);if(null!==f)return f}}return null}t.ib=function(a){if(this.name===a)return this;var b=this.$.j,c=b.length;null===this.Ni&&null===this.De||(c=zn(this));for(var d=0;d<c;d++){var e=b[d];if(e instanceof W){var f=e.ib(a);if(null!==f)return f}if(e.name===a)return e}return null};
1239 function An(a){a=a.$.j;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];e instanceof W?c=Math.max(c,An(e)):e instanceof Uf&&(c=Math.max(c,e.Hh/2*e.tk*e.Mf()))}return c}t.pe=function(){return!(this.type===W.TableRow||this.type===W.TableColumn)};
1240 t.ac=function(a,b,c){if(!1===this.pickable)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Jj(this))return null;var d=this.naturalBounds,e=1/this.Mf(),f=this.pe(),g=f?a:Hb(J.allocAt(a.x,a.y),this.transform),h=this.diagram,k=10,l=5;null!==h&&(k=h.Pm("extraTouchArea"),l=k/2);if(lc(-(l*e),-(l*e),d.width+k*e,d.height+k*e,g.x,g.y)){if(!this.isAtomic){e=this.$.j;var m=e.length;h=J.alloc();l=(k=this.isClipping&&this.sa===W.Spot)?this.yb():null;if(k&&(l.pe()?Hb(h.set(a),l.transform):h.set(a),!l.ca(h)))return J.free(h),
1241 f||J.free(g),null;for(var n=Rm(this);m--;){var p=e[m];if(p.visible||p===n)if(p.pe()?Hb(h.set(a),p.transform):h.set(a),!k||p!==l){var r=null;p instanceof W?r=p.ac(h,b,c):!0===p.pickable&&p.ca(h)&&(r=p);if(null!==r&&(null!==b&&(r=b(r)),null!==r&&(null===c||c(r))))return J.free(h),f||J.free(g),r}}J.free(h)}if(null===this.background&&null===this.areaBackground)return f||J.free(g),null;a=lc(0,0,d.width,d.height,g.x,g.y)?this:null;f||J.free(g);return a}f||J.free(g);return null};
1242 t.sj=function(a,b,c,d){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var e=this.naturalBounds,f=this.pe(),g=f?a:Hb(J.allocAt(a.x,a.y),this.transform),h=this.type===W.TableRow||this.type===W.TableColumn;e=lc(0,0,e.width,e.height,g.x,g.y);if(h||e){if(!this.isAtomic){h=this.$.j;for(var k=h.length,l=J.alloc(),m=Rm(this);k--;){var n=h[k];if(n.visible||n===m){n.pe()?Hb(l.set(a),n.transform):l.set(a);var p=n;n=n instanceof W?n:null;(null!==n?n.sj(l,b,c,d):p.ca(l))&&!1!==p.pickable&&
1243 (null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||d.add(p))}}J.free(l)}f||J.free(g);return e&&(null!==this.background||null!==this.areaBackground)}f||J.free(g);return!1};
1244 t.Lf=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var g=f;void 0===f&&(g=Gb.alloc(),g.reset());g.multiply(this.transform);if(this.Uh(a,g))return Bn(this,b,c,e),void 0===f&&Gb.free(g),!0;if(this.Sc(a,g)){if(!this.isAtomic)for(var h=Rm(this),k=this.$.j,l=k.length;l--;){var m=k[l];if(m.visible||m===h){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof W?m:null;p=Gb.alloc();p.set(g);
1245 if(null!==m?m.Lf(a,b,c,d,e,p):El(n,a,d,p))null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);Gb.free(p)}}}void 0===f&&Gb.free(g);return d}void 0===f&&Gb.free(g);return!1};function Bn(a,b,c,d){for(var e=a.$.j,f=e.length;f--;){var g=e[f];if(g.visible){var h=g.actualBounds,k=a.naturalBounds;h.x>k.width||h.y>k.height||0>h.x+h.width||0>h.y+h.height||(g instanceof W&&Bn(g,b,c,d),null!==b&&(g=b(g)),null===g||null!==c&&!c(g)||d.add(g))}}}
1246 t.Qg=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.pe(),k=h?a:Hb(J.allocAt(a.x,a.y),this.transform),l=h?b:Hb(J.allocAt(b.x,b.y),this.transform),m=k.Ve(l),n=0<k.x&&k.x<g.width&&0<k.y&&k.y<g.height||Ib(k.x,k.y,0,0,0,g.height)<=m||Ib(k.x,k.y,0,g.height,g.width,g.height)<=m||Ib(k.x,k.y,g.width,g.height,g.width,0)<=m||Ib(k.x,k.y,g.width,0,0,0)<=m;g=k.wd(0,0)<=m&&k.wd(0,g.height)<=m&&k.wd(g.width,0)<=m&&k.wd(g.width,g.height)<=
1247 m;h||(J.free(k),J.free(l));if(n){if(!this.isAtomic){k=J.alloc();l=J.alloc();m=Rm(this);for(var p=this.$.j,r=p.length;r--;){var q=p[r];if(q.visible||q===m){var u=q.actualBounds,y=this.naturalBounds;if(!h||!(u.x>y.width||u.y>y.height||0>u.x+u.width||0>u.y+u.height))if(q.pe()?(u=q.transform,Hb(k.set(a),u),Hb(l.set(b),u)):(k.set(a),l.set(b)),u=q,q=q instanceof W?q:null,null!==q?q.Qg(k,l,c,d,e,f):u.Hy(k,l,e))null!==c&&(u=c(u)),null===u||null!==d&&!d(u)||f.add(u)}}J.free(k);J.free(l)}return e?n:g}return!1};
1248 function Wm(a){var b=null;a instanceof Uf&&(b=a.spot1,b===fd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot1));null===b&&(b=Ec);return b}function Xm(a){var b=null;a instanceof Uf&&(b=a.spot2,b===fd&&(b=null),a=a.geometry,null!==a&&null===b&&(b=a.spot2));null===b&&(b=Oc);return b}t.add=function(a){w(a,O,W,"add:element");this.Bb(this.$.count,a)};t.M=function(a){return this.$.M(a)};
1249 t.Bb=function(a,b){b instanceof U&&v("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.Sg(b))this===b&&v("Cannot make a Panel contain itself: "+this.toString()),v("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.panel;null!==c&&c!==this&&v("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+this.toString());
1250 this.sa!==W.Grid||b instanceof Uf||v("Can only add Shapes to a Grid Panel, not: "+b);this.sa!==W.Graduated||b instanceof Uf||b instanceof ih||v("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.Ej(this);b.mk=null;if(null!==this.itemArray){var d=b.data;null!==d&&"object"===typeof d&&(null===this.ee&&(this.ee=new Bb),this.ee.add(d,b))}var e=this.$;d=-1;if(c===this){for(var f=-1,g=this.$.j,h=g.length,k=0;k<h;k++)if(g[k]===b){f=k;break}if(-1!==f){if(f===a||f+1>=e.count&&a>=e.count)return;
1251 e.jb(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.Bb(a,b);if(0===a||b.isPanelMain)this.ej=null;Ij(this)||this.u();b.u(!1);null!==b.portId?this.Yh=!0:b instanceof W&&!0===b.Yh&&(this.Yh=!0);this.qh=null;c=this.part;null!==c&&(c.ik=null,c.wh=NaN,this.Yh&&c instanceof V&&(c.Yh=!0),c.Yh&&c instanceof V&&(c.zc=null),e=this.diagram,null!==e&&e.undoManager.isUndoingRedoing||(-1!==d&&c.ab(Me,"elements",this,b,null,d,null),c.ab(Le,
1252 "elements",this,null,b,null,a),this.Tg()||Cn(this,b,!1)))};function Dn(a,b){a.I=b?a.I|16777216:a.I&-16777217}t.remove=function(a){w(a,O,W,"remove:element");for(var b=this.$.j,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.Rc(d,!0)};t.jb=function(a){F&&C(a,W,"removeAt:idx");0<=a&&this.Rc(a,!0)};
1253 t.Rc=function(a,b){var c=this.$,d=c.M(a);d.mk=null;d.Ej(null);if(null!==this.ee){var e=d.data;"object"===typeof e&&this.ee.remove(e)}c.jb(a);Dj(this,!1);this.u();this.ej===d&&(this.ej=null);this.qh=null;var f=this.part;null!==f&&(f.ik=null,f.wh=NaN,f.Rb(),f instanceof V&&(d instanceof W?d.fl(d,function(a,c){lm(f,c,b)}):lm(f,d,b)),c=this.diagram,null!==c&&c.undoManager.isUndoingRedoing||f.ab(Me,"elements",this,d,null,a,null))};
1254 W.prototype.getRowDefinition=function(a){F&&C(a,W,"getRowDefinition:idx");0>a&&za(a,">= 0",W,"getRowDefinition:idx");a=Math.round(a);var b=this.vb;if(void 0===b)return null;if(void 0===b[a]){var c=new jk;c.Ej(this);c.isRow=!0;c.index=a;b[a]=c;this.ab(Le,"rowdefs",this,null,c,null,a)}return b[a]};
1255 W.prototype.qB=function(a){F&&C(a,W,"removeRowDefinition:idx");0>a&&za(a,">= 0",W,"removeRowDefinition:idx");a=Math.round(a);var b=this.vb;if(void 0!==b){var c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.ab(Me,"rowdefs",this,c,null,a,null);this.u()}}};function kk(a,b,c){var d=a.vb;if(d&&!(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.u()}}
1256 W.prototype.getColumnDefinition=function(a){F&&C(a,W,"getColumnDefinition:idx");0>a&&za(a,">= 0",W,"getColumnDefinition:idx");a=Math.round(a);var b=this.sb;if(void 0===b)return null;if(void 0===b[a]){var c=new jk;c.Ej(this);c.isRow=!1;c.index=a;b[a]=c;this.ab(Le,"coldefs",this,null,c,null,a)}return b[a]};t=W.prototype;
1257 t.lB=function(a){F&&C(a,W,"removeColumnDefinition:idx");0>a&&za(a,">= 0",W,"removeColumnDefinition:idx");a=Math.round(a);var b=this.sb;if(void 0!==b){var c=b[a];if(c){b[a]=void 0;for(var d=b.length-1;0<=d&&void 0===b[d--];)b.length--;this.ab(Me,"coldefs",this,c,null,a,null);this.u()}}};function lk(a,b,c){var d=a.sb;if(d&&!(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.u()}}
1258 t.uA=function(a){if(0>a||this.type!==W.Table)return-1;for(var b=0,c=this.vb,d=c.length,e=this.hj;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))break}return e};t.mA=function(a){if(0>a||this.type!==W.Table)return-1;for(var b=0,c=this.sb,d=c.length,e=this.Ri;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))break}return e};
1259 t.KA=function(a,b){void 0===b&&(b=new J(NaN,NaN));if(this.type!==W.Graduated)return b.h(NaN,NaN),b;a=Math.min(Math.max(a,this.graduatedMin),this.graduatedMax);var c=this.yb();c.geometry.lw((a-this.graduatedMin)/this.graduatedRange,b);return c.transform.Aa(b)};t.LA=function(a){if(this.type!==W.Graduated)return NaN;var b=this.yb();b.transform.Pd(a);return b.geometry.Ly(a)*this.graduatedRange+this.graduatedMin};function cm(a){a=a.xi;return null!==a&&a.s}
1260 function yg(a){var b=a.xi;if(null===b)null!==a.data&&v("Template cannot have .data be non-null: "+a),a.xi=b=new H;else if(b.s)return;var c=new H;Dn(a,!1);a.fl(a,function(a,d){var e=d.lb;if(null!==e)for($l(d,!1),e=e.iterator;e.next();){var f=e.value;f.mode===En&&$l(d,!0);var g=f.sourceName;null!==g&&("/"===g&&Dn(a,!0),g=Bl(f,a,d),null!==g&&(c.add(g),null===g.vm&&(g.vm=new H),g.vm.add(f)));b.add(f)}if(d instanceof W&&d.type===W.Table){if(0<d.vb.length)for(a=d.vb,e=a.length,f=0;f<e;f++)if(g=a[f],void 0!==
1261 g&&null!==g.lb)for(var h=g.lb.iterator;h.next();){var k=h.value;k.vd=g;k.uq=2;k.Bm=g.index;b.add(k)}if(0<d.sb.length)for(d=d.sb,a=d.length,e=0;e<a;e++)if(f=d[e],void 0!==f&&null!==f.lb)for(g=f.lb.iterator;g.next();)h=g.value,h.vd=f,h.uq=1,h.Bm=f.index,b.add(h)}});for(var d=c.iterator;d.next();){var e=d.value;if(null!==e.vm){$l(e,!0);for(var f=e.vm.iterator;f.next();){var g=f.value;null===e.lb&&(e.lb=new H);e.lb.add(g)}}e.vm=null}for(var h=b.iterator;h.next();)if(d=h.value,e=d.vd,null!==e){d.vd=null;
1262 g=d.targetProperty;var k=g.indexOf(".");0<k&&e instanceof W&&(f=g.substring(0,k),g=g.substr(k+1),k=e.ib(f),null!==k?(e=k,d.targetProperty=g):Ea('Warning: unable to find GraphObject named "'+f+'" for Binding: '+d.toString()));e instanceof jk?(f=ob(e.panel),d.Ij=void 0===f?-1:f,e.panel.pl=d.Ij):e instanceof O?(f=ob(e),d.Ij=void 0===f?-1:f,e.pl=d.Ij):v("Unknown type of binding target: "+e)}b.freeze();a instanceof U&&(a.Tc()&&a.Ya(),F&&!Fn&&a.fl(a,function(a,c){if(c instanceof W&&(c.type===W.Auto||c.type===
1263 W.Spot||c.type===W.Graduated)&&1>=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||(Ea("Auto, Spot, or Graduated Panel should not have zero or one elements: "+c.toString()+" in "+a.toString()),Fn=!0)}}))}
1264 t.Xz=function(a){void 0===a&&(a=!1);var b=this.copy();wn(b,function(a){a instanceof W&&(a.xi=null,a.tb=null);var b=a.lb;null!==b&&(a.lb=null,b.each(function(b){a.bind(b.copy())}));b=a.Yg;null!==b&&(a.Yg=null,b.each(function(b){a.gx(b.value.copy())}))});a&&yg(b);return b};
1265 t.Ia=function(a){var b=this.xi;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.ib(e),null===d){F&&Ea("Binding error: missing GraphObject named "+e+" in "+this.toString());continue}}else if(c.isToModel)if(d=this.diagram,null!==d)d=d.model.modelData;
1266 else continue;var f=this,g=c.Ij;if(-1!==g){if(f=this.Tt(g),null===f)continue}else null!==c.vd&&(f=c.vd);"/"===e?d=f.part:"."===e?d=f:".."===e&&(d=f.panel);e=c.uq;if(0!==e){if(!(f instanceof W))continue;1===e?f=f.getColumnDefinition(c.Bm):2===e&&(f=f.getRowDefinition(c.Bm))}void 0!==f&&c.jx(f,d)}}};
1267 function Gn(a,b){a=a.$.j;for(var c=a.length,d=b.length,e=0,f=null;e<c&&!(f=a[e],f instanceof W&&null!==f.data);)e++,f=a[e];if(c-e!==d)return!0;if(null===f)return 0<d;for(var g=0;e<c&&g<d;){f=a[e];if(!(f instanceof W)||f.data!==b[g])return!0;e++;g++}return!1}
1268 function zn(a){if(a.type===W.Spot||a.type===W.Auto)return Math.min(a.$.length,1);if(a.type===W.Link){a=a.$;for(var b=a.length,c=0;c<b;c++){var d=a.M(c);if(!(d instanceof Uf&&d.isPanelMain))break}return c}return a.type===W.Table&&0<a.$.length&&(a=a.$.M(0),a.isPanelMain&&a instanceof W&&(a.type===W.TableRow||a.type===W.TableColumn))?1:0}t.ru=function(){for(var a=zn(this);this.$.length>a;)this.Rc(this.$.length-1,!1);a=this.itemArray;if(null!==a)for(var b=a.length,c=0;c<b;c++)Hn(this,a[c],c)};
1269 t.Gy=function(a){if(void 0===a||null===a||null===this.ee)return null;A(a,"object",W,"findItemPanelForData");return this.ee.J(a)};
1270 function Hn(a,b,c){if(!(void 0===b||null===b||0>c)){var d=In(a,b),e=a.itemTemplateMap,f=null;null!==e&&(f=e.J(d));null===f&&(null!==e&&(f=e.J("")),null===f&&(Jn||(Jn=!0,Ea('No item template Panel found for category "'+d+'" on '+a),Ea(" Using default item template."),d=new W,e=new ih,e.bind(new Ui("text","",Qa)),d.add(e),Kn=d),f=Kn));d=f;null!==d&&(yg(d),d=d.copy(),0!==(d.I&16777216)&&(e=a.tj(),null!==e&&Dn(e,!0)),"object"===typeof b&&(null===a.ee&&(a.ee=new Bb),a.ee.add(b,d)),e=c+zn(a),a.Bb(e,d),
1271 d.tb=b,Ln(a,e,c),d.tb=null,d.data=b)}}function Ln(a,b,c){for(a=a.$;b<a.length;){var d=a.M(b);if(d instanceof W){var e=b,f=c;d.type===W.TableRow?d.row=e:d.type===W.TableColumn&&(d.column=e);d.itemIndex=f}b++;c++}}
1272 function In(a,b){if(null===b)return"";a=a.Wl;if("function"===typeof a)a=a(b);else if("string"===typeof a&&"object"===typeof b){if(""===a)return"";a=Mn(b,a)}else return"";if(void 0===a)return"";if("string"===typeof a)return a;v("Panel.getCategoryForItemData found a non-string category for "+b+": "+a);return""}function Cn(a,b,c){var d=b.enabledChanged;null!==d&&d(b,c);if(b instanceof W){b=b.$.j;d=b.length;for(var e=0;e<d;e++){var f=b[e];c&&f instanceof W&&!f.isEnabled||Cn(a,f,c)}}}
1273 function Nn(a,b){b.name=a;gm.add(a,b)}
1274 na.Object.defineProperties(W.prototype,{type:{configurable:!0,get:function(){return this.sa},set:function(a){var b=this.sa;b!==a&&(this.sa=a,this.sa===W.Grid?this.isAtomic=!0:this.sa===W.Table&&rn(this),this.u(),this.g("type",b,a))}},elements:{configurable:!0,get:function(){return this.$.iterator}},naturalBounds:{configurable:!0,get:function(){return this.wc}},padding:{configurable:!0,get:function(){return this.ob},set:function(a){"number"===
1275 typeof a?(0>a&&za(a,">= 0",W,"padding"),a=new hc(a)):(w(a,hc,W,"padding"),0>a.left&&za(a.left,">= 0",W,"padding:value.left"),0>a.right&&za(a.right,">= 0",W,"padding:value.right"),0>a.top&&za(a.top,">= 0",W,"padding:value.top"),0>a.bottom&&za(a.bottom,">= 0",W,"padding:value.bottom"));var b=this.ob;b.A(a)||(this.ob=a=a.K(),this.u(),this.g("padding",b,a))}},defaultAlignment:{configurable:!0,get:function(){return this.Zn},set:function(a){var b=this.Zn;b.A(a)||(F&&w(a,N,W,"defaultAlignment"),
1276 this.Zn=a=a.K(),this.u(),this.g("defaultAlignment",b,a))}},defaultStretch:{configurable:!0,get:function(){return this.dg},set:function(a){var b=this.dg;b!==a&&(gb(a,O,W,"defaultStretch"),this.dg=a,this.u(),this.g("defaultStretch",b,a))}},defaultSeparatorPadding:{configurable:!0,get:function(){return void 0===this.Rj?zc:this.Rj},set:function(a){if(void 0!==this.Rj){"number"===typeof a?a=new hc(a):F&&w(a,hc,W,"defaultSeparatorPadding");var b=this.Rj;b.A(a)||(this.Rj=a=a.K(),
1277 this.u(),this.g("defaultSeparatorPadding",b,a))}}},defaultRowSeparatorStroke:{configurable:!0,get:function(){return void 0===this.Di?null:this.Di},set:function(a){var b=this.Di;b!==a&&(null===a||"string"===typeof a||a instanceof Ol)&&(a instanceof Ol&&a.freeze(),this.Di=a,this.P(),this.g("defaultRowSeparatorStroke",b,a))}},defaultRowSeparatorStrokeWidth:{configurable:!0,get:function(){return void 0===this.gh?1:this.gh},set:function(a){if(void 0!==this.gh){var b=this.gh;
1278 b!==a&&isFinite(a)&&0<=a&&(this.gh=a,this.u(),this.g("defaultRowSeparatorStrokeWidth",b,a))}}},defaultRowSeparatorDashArray:{configurable:!0,get:function(){return void 0===this.Ci?null:this.Ci},set:function(a){if(void 0!==this.Ci){var b=this.Ci;if(b!==a){null===a||Array.isArray(a)||ya(a,"Array",W,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||v("defaultRowSeparatorDashArray value "+f+" at index "+
1279 e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Ci=a;this.P();this.g("defaultRowSeparatorDashArray",b,a)}}}},defaultColumnSeparatorStroke:{configurable:!0,get:function(){return void 0===this.eh?null:this.eh},set:function(a){if(void 0!==this.eh){var b=this.eh;b!==a&&(null===a||"string"===typeof a||a instanceof Ol)&&(a instanceof Ol&&a.freeze(),this.eh=a,this.P(),this.g("defaultColumnSeparatorStroke",b,a))}}},defaultColumnSeparatorStrokeWidth:{configurable:!0,
1280 enumerable:!0,get:function(){return void 0===this.fh?1:this.fh},set:function(a){if(void 0!==this.fh){var b=this.fh;b!==a&&isFinite(a)&&0<=a&&(this.fh=a,this.u(),this.g("defaultColumnSeparatorStrokeWidth",b,a))}}},defaultColumnSeparatorDashArray:{configurable:!0,get:function(){return void 0===this.Bi?null:this.Bi},set:function(a){if(void 0!==this.Bi){var b=this.Bi;if(b!==a){null===a||Array.isArray(a)||ya(a,"Array",W,"defaultColumnSeparatorDashArray:value");if(null!==a){for(var c=a.length,
1281 d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||v("defaultColumnSeparatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Bi=a;this.P();this.g("defaultColumnSeparatorDashArray",b,a)}}}},viewboxStretch:{configurable:!0,get:function(){return this.Cq},set:function(a){var b=this.Cq;b!==a&&(gb(a,O,W,"viewboxStretch"),this.Cq=a,this.u(),this.g("viewboxStretch",b,a))}},gridCellSize:{configurable:!0,
1282 enumerable:!0,get:function(){return this.Ao},set:function(a){var b=this.Ao;if(!b.A(a)){w(a,Fb,W,"gridCellSize");a.o()&&0!==a.width&&0!==a.height||v("Invalid Panel.gridCellSize: "+a);this.Ao=a.K();var c=this.diagram;null!==c&&this===c.grid&&Ej(c);this.P();this.g("gridCellSize",b,a)}}},gridOrigin:{configurable:!0,get:function(){return this.Bo},set:function(a){var b=this.Bo;if(!b.A(a)){w(a,J,W,"gridOrigin");a.o()||v("Invalid Panel.gridOrigin: "+a);this.Bo=a.K();var c=this.diagram;null!==
1283 c&&this===c.grid&&Ej(c);this.P();this.g("gridOrigin",b,a)}}},graduatedMin:{configurable:!0,get:function(){return this.xo},set:function(a){C(a,W,"graduatedMin");var b=this.xo;b!==a&&(this.xo=a,this.u(),this.g("graduatedMin",b,a),zl(this)&&(a=this.part,null!==a&&Al(this,a,"graduatedRange")))}},graduatedMax:{configurable:!0,get:function(){return this.wo},set:function(a){C(a,W,"graduatedMax");var b=this.wo;b!==a&&(this.wo=a,this.u(),this.g("graduatedMax",b,a),zl(this)&&(a=
1284 this.part,null!==a&&Al(this,a,"graduatedRange")))}},graduatedRange:{configurable:!0,get:function(){return this.graduatedMax-this.graduatedMin}},graduatedTickUnit:{configurable:!0,get:function(){return this.zo},set:function(a){C(a,W,"graduatedTickUnit");var b=this.zo;b!==a&&0<a&&(this.zo=a,this.u(),this.g("graduatedTickUnit",b,a))}},graduatedTickBase:{configurable:!0,get:function(){return this.yo},set:function(a){C(a,W,"graduatedTickBase");var b=this.yo;b!==
1285 a&&(this.yo=a,this.u(),this.g("graduatedTickBase",b,a))}},Yh:{configurable:!0,get:function(){return 0!==(this.I&8388608)},set:function(a){0!==(this.I&8388608)!==a&&(this.I^=8388608)}},rowCount:{configurable:!0,get:function(){return void 0===this.vb?0:this.vb.length}},columnCount:{configurable:!0,get:function(){return void 0===this.sb?0:this.sb.length}},rowSizing:{configurable:!0,get:function(){return void 0===this.qk?sn:this.qk},set:function(a){if(void 0!==
1286 this.qk){var b=this.qk;b!==a&&(F&&a!==sn&&a!==$m&&v("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.qk=a,this.u(),this.g("rowSizing",b,a))}}},columnSizing:{configurable:!0,get:function(){return void 0===this.Oj?sn:this.Oj},set:function(a){if(void 0!==this.Oj){var b=this.Oj;b!==a&&(F&&a!==sn&&a!==$m&&v("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Oj=a,this.u(),this.g("columnSizing",
1287 b,a))}}},topIndex:{configurable:!0,get:function(){return void 0===this.hj?0:this.hj},set:function(a){if(void 0!==this.hj){var b=this.hj;b!==a&&((!isFinite(a)||0>a)&&v("Panel.topIndex must be greater than zero and a real number, not: "+a),this.hj=a,this.u(),this.g("topIndex",b,a))}}},leftIndex:{configurable:!0,get:function(){return void 0===this.Ri?0:this.Ri},set:function(a){if(void 0!==this.Ri){var b=this.Ri;b!==a&&((!isFinite(a)||0>a)&&v("Panel.leftIndex must be greater than zero and a real number, not: "+
1288 a),this.Ri=a,this.u(),this.g("leftIndex",b,a))}}},data:{configurable:!0,get:function(){return this.tb},set:function(a){var b=this.tb;if(b!==a){var c=this instanceof U&&!(this instanceof Ve);c&&A(a,"object",W,"data");yg(this);this.tb=a;var d=this.diagram;null!==d&&(c?(c=d.partManager,this instanceof S?(null!==b&&c.ef.remove(b),null!==a&&c.ef.add(a,this)):this instanceof U&&(null!==b&&c.ff.remove(b),null!==a&&c.ff.add(a,this))):(c=this.panel,null!==c&&null!==c.ee&&(null!==b&&c.ee.remove(b),
1289 null!==a&&c.ee.add(a,this))));this.g("data",b,a);null!==d&&d.undoManager.isUndoingRedoing||null!==a&&this.Ia()}}},itemIndex:{configurable:!0,get:function(){return this.Qo},set:function(a){var b=this.Qo;b!==a&&(this.Qo=a,this.g("itemIndex",b,a))}},itemArray:{configurable:!0,get:function(){return this.Ni},set:function(a){var b=this.Ni;if(b!==a||null!==a&&Gn(this,a)){F&&null!==a&&!Ha(a)&&v("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.diagram;
1290 b!==a&&(null!==c&&null!==b&&ak(c.partManager,this,c),this.Ni=a,null!==c&&null!==a&&Xj(c.partManager,this));this.g("itemArray",b,a);null!==c&&c.undoManager.isUndoingRedoing||this.ru()}}},itemTemplate:{configurable:!0,get:function(){return null===this.De?null:this.De.J("")},set:function(a){if(null===this.De){if(null===a)return;this.De=new Bb}var b=this.De.J("");b!==a&&(w(a,W,W,"itemTemplate"),(a instanceof U||a.isPanelMain)&&v("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+
1291 a),this.De.add("",a),this.g("itemTemplate",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.ru())}},itemTemplateMap:{configurable:!0,get:function(){return this.De},set:function(a){var b=this.De;if(b!==a){w(a,Bb,W,"itemTemplateMap");for(var c=a.iterator;c.next();){var d=c.value;F&&(d instanceof U||d.isPanelMain)&&v("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.De=a;this.g("itemTemplateMap",b,a);a=this.diagram;null!==a&&a.undoManager.isUndoingRedoing||
1292 this.ru()}}},itemCategoryProperty:{configurable:!0,get:function(){return this.Wl},set:function(a){var b=this.Wl;b!==a&&("string"!==typeof a&&"function"!==typeof a&&ya(a,"string or function",W,"itemCategoryProperty"),this.Wl=a,this.g("itemCategoryProperty",b,a))}},isAtomic:{configurable:!0,get:function(){return 0!==(this.I&1048576)},set:function(a){var b=0!==(this.I&1048576);b!==a&&(A(a,"boolean",W,"isAtomic"),this.I^=1048576,this.g("isAtomic",b,a))}},isClipping:{configurable:!0,
1293 enumerable:!0,get:function(){return 0!==(this.I&2097152)},set:function(a){var b=0!==(this.I&2097152);b!==a&&(A(a,"boolean",W,"isClipping"),!a||this.type===W.Spot||this instanceof If||Ea("Warning: Panel.isClipping set on non-Spot Panel: "+this.toString()),this.I^=2097152,this instanceof If&&(this.gb=null),this.u(),this.g("isClipping",b,a))}},isOpposite:{configurable:!0,get:function(){return 0!==(this.I&33554432)},set:function(a){var b=0!==(this.I&33554432);b!==a&&(A(a,"boolean",W,"isOpposite"),
1294 this.I^=33554432,this.u(),this.g("isOpposite",b,a))}},isEnabled:{configurable:!0,get:function(){return 0!==(this.I&4194304)},set:function(a){var b=0!==(this.I&4194304);if(b!==a){A(a,"boolean",W,"isEnabled");var c=null===this.panel||this.panel.Tg();this.I^=4194304;this.g("isEnabled",b,a);b=this.diagram;null!==b&&b.undoManager.isUndoingRedoing||c&&Cn(this,this,a)}}},alignmentFocusName:{configurable:!0,get:function(){return this.Xg},set:function(a){var b=this.Xg;b!==a&&(F&&
1295 A(a,"string",W,"alignmentFocusName"),this.Xg=a,this.u(),this.g("alignmentFocusName",b,a))}}});
1296 na.Object.defineProperties(W,{Position:{configurable:!0,get:function(){return gm.J("Position")}},Horizontal:{configurable:!0,get:function(){return gm.J("Horizontal")}},Vertical:{configurable:!0,get:function(){return gm.J("Vertical")}},Spot:{configurable:!0,get:function(){return gm.J("Spot")}},Auto:{configurable:!0,get:function(){return gm.J("Auto")}},Table:{configurable:!0,get:function(){return gm.J("Table")}},Viewbox:{configurable:!0,
1297 enumerable:!0,get:function(){return gm.J("Viewbox")}},TableRow:{configurable:!0,get:function(){return gm.J("TableRow")}},TableColumn:{configurable:!0,get:function(){return gm.J("TableColumn")}},Link:{configurable:!0,get:function(){return gm.J("Link")}},Grid:{configurable:!0,get:function(){return gm.J("Grid")}},Graduated:{configurable:!0,get:function(){return gm.J("Graduated")}}});W.prototype.findItemPanelForData=W.prototype.Gy;
1298 W.prototype.rebuildItemElements=W.prototype.ru;W.prototype.updateTargetBindings=W.prototype.Ia;W.prototype.copyTemplate=W.prototype.Xz;W.prototype.graduatedValueForPoint=W.prototype.LA;W.prototype.graduatedPointForValue=W.prototype.KA;W.prototype.findColumnForLocalX=W.prototype.mA;W.prototype.findRowForLocalY=W.prototype.uA;W.prototype.removeColumnDefinition=W.prototype.lB;W.prototype.removeRowDefinition=W.prototype.qB;W.prototype.removeAt=W.prototype.jb;W.prototype.remove=W.prototype.remove;
1299 W.prototype.insertAt=W.prototype.Bb;W.prototype.elt=W.prototype.M;W.prototype.add=W.prototype.add;W.prototype.findObject=W.prototype.ib;W.prototype.findInVisualTree=W.prototype.Mm;W.prototype.walkVisualTreeFrom=W.prototype.fl;W.prototype.findMainElement=W.prototype.yb;var Fn=!1,Jn=!1,Kn=null,gm=new Bb;W.className="Panel";W.definePanelLayout=Nn;Nn("Position",new Qm);Nn("Vertical",new Tm);Nn("Auto",new Vm);Nn("Link",new fn);
1300 function jk(){eb(this);this.Ag=null;this.As=!0;this.Xa=0;this.gd=NaN;this.zh=0;this.xh=Infinity;this.Db=fd;this.ra=this.hc=this.na=0;this.lb=null;this.lq=On;this.Pe=pl;this.hq=this.Eg=null;this.iq=NaN;this.rb=this.sk=null;this.Vn=!1}
1301 jk.prototype.copy=function(){var a=new jk;a.As=this.As;a.Xa=this.Xa;a.gd=this.gd;a.zh=this.zh;a.xh=this.xh;a.Db=this.Db;a.na=this.na;a.hc=this.hc;a.ra=this.ra;a.Pe=this.Pe;a.lq=this.lq;null===this.Eg?a.Eg=null:a.Eg=this.Eg.K();a.hq=this.hq;a.iq=this.iq;a.sk=null;null!==this.sk&&(a.separatorDashArray=Ja(this.separatorDashArray));a.rb=this.rb;a.Vn=this.Vn;a.lb=this.lb;return a};t=jk.prototype;
1302 t.vy=function(a){w(a,jk,jk,"copyFrom:pd");a.isRow?this.height=a.height:this.width=a.width;this.minimum=a.minimum;this.maximum=a.maximum;this.alignment=a.alignment;this.stretch=a.stretch;this.sizing=a.sizing;this.Eg=null===a.separatorPadding?null:a.separatorPadding.K();this.separatorStroke=a.separatorStroke;this.separatorStrokeWidth=a.separatorStrokeWidth;this.sk=null;a.separatorDashArray&&(this.sk=Ja(a.separatorDashArray));this.background=a.background;this.coversSeparators=a.coversSeparators;this.lb=
1303 a.lb};t.pb=function(a){a.classType===jk?this.sizing=a:Da(this,a)};t.toString=function(){return"RowColumnDefinition "+(this.isRow?"(Row ":"(Column ")+this.index+") #"+ob(this)};t.Ej=function(a){this.Ag=a};
1304 t.Wv=function(){var a=0,b=0,c=this.Ag,d=this.isRow;if(null!==c&&c.type===W.Table)for(var e=d?c.vb.length:c.sb.length,f=0;f<e;f++){var g=d?c.vb[f]:c.sb[f];if(void 0!==g){b=g.index;break}}this.index!==b&&(b=this.separatorStroke,null===b&&null!==c&&(b=this.isRow?c.defaultRowSeparatorStroke:c.defaultColumnSeparatorStroke),null!==b&&(a=this.separatorStrokeWidth,isNaN(a)&&(null!==c?a=this.isRow?c.defaultRowSeparatorStrokeWidth:c.defaultColumnSeparatorStrokeWidth:a=0)));b=this.Eg;if(null===b)if(null!==c)b=
1305 c.defaultSeparatorPadding;else return a;return a+(this.isRow?b.top:b.left)};
1306 t.Cc=function(){var a=0,b=this.Ag,c=0,d=this.isRow;if(null!==b&&b.type===W.Table)for(var e=d?b.vb.length:b.sb.length,f=0;f<e;f++){var g=d?b.vb[f]:b.sb[f];if(void 0!==g){c=g.index;break}}this.index!==c&&(c=this.separatorStroke,null===c&&null!==b&&(c=d?b.defaultRowSeparatorStroke:b.defaultColumnSeparatorStroke),null!==c&&(a=this.separatorStrokeWidth,isNaN(a)&&(null!==b?a=d?b.defaultRowSeparatorStrokeWidth:b.defaultColumnSeparatorStrokeWidth:a=0)));d=this.Eg;if(null===d)if(null!==b)d=b.defaultSeparatorPadding;
1307 else return a;return a+(this.isRow?d.top+d.bottom:d.left+d.right)};t.Gb=function(a,b,c){var d=this.Ag;if(null!==d&&(d.ab(Ce,a,this,b,c,void 0,void 0),null!==this.lb&&(b=d.diagram,null!==b&&!b.skipsModelSourceBindings&&(d=d.tj(),null!==d&&(b=d.data,null!==b)))))for(c=this.lb.iterator;c.next();)c.value.yr(this,b,a,d)};function Zm(a){if(a.sizing===On){var b=a.Ag;return a.isRow?b.rowSizing:b.columnSizing}return a.sizing}
1308 t.bind=function(a){a.vd=this;var b=this.panel;if(null!==b){var c=b.tj();null!==c&&cm(c)&&v("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a+" on "+b)}null===this.lb&&(this.lb=new H);this.lb.add(a)};
1309 na.Object.defineProperties(jk.prototype,{panel:{configurable:!0,get:function(){return this.Ag}},isRow:{configurable:!0,get:function(){return this.As},set:function(a){this.As=a}},index:{configurable:!0,get:function(){return this.Xa},set:function(a){this.Xa=a}},height:{configurable:!0,get:function(){return this.gd},set:function(a){var b=this.gd;b!==a&&(F&&A(a,"number",jk,"height"),0>a&&za(a,">= 0",jk,"height"),this.gd=a,this.actual=this.na,null!==
1310 this.panel&&this.panel.u(),this.Gb("height",b,a))}},width:{configurable:!0,get:function(){return this.gd},set:function(a){var b=this.gd;b!==a&&(F&&A(a,"number",jk,"width"),0>a&&za(a,">= 0",jk,"width"),this.gd=a,this.actual=this.na,null!==this.panel&&this.panel.u(),this.Gb("width",b,a))}},minimum:{configurable:!0,get:function(){return this.zh},set:function(a){var b=this.zh;b!==a&&(F&&A(a,"number",jk,"minimum"),(0>a||!isFinite(a))&&za(a,">= 0",jk,"minimum"),this.zh=a,this.actual=
1311 this.na,null!==this.panel&&this.panel.u(),this.Gb("minimum",b,a))}},maximum:{configurable:!0,get:function(){return this.xh},set:function(a){var b=this.xh;b!==a&&(F&&A(a,"number",jk,"maximum"),0>a&&za(a,">= 0",jk,"maximum"),this.xh=a,this.actual=this.na,null!==this.panel&&this.panel.u(),this.Gb("maximum",b,a))}},alignment:{configurable:!0,get:function(){return this.Db},set:function(a){var b=this.Db;b.A(a)||(F&&w(a,N,jk,"alignment"),this.Db=a.K(),null!==this.panel&&this.panel.u(),
1312 this.Gb("alignment",b,a))}},stretch:{configurable:!0,get:function(){return this.Pe},set:function(a){var b=this.Pe;b!==a&&(F&&gb(a,O,jk,"stretch"),this.Pe=a,null!==this.panel&&this.panel.u(),this.Gb("stretch",b,a))}},separatorPadding:{configurable:!0,get:function(){return this.Eg},set:function(a){"number"===typeof a?a=new hc(a):null!==a&&F&&w(a,hc,jk,"separatorPadding");var b=this.Eg;null!==a&&null!==b&&b.A(a)||(null!==a&&(a=a.K()),this.Eg=a,null!==this.panel&&this.panel.u(),
1313 this.Gb("separatorPadding",b,a))}},separatorStroke:{configurable:!0,get:function(){return this.hq},set:function(a){var b=this.hq;b!==a&&(null!==a&&km(a,"RowColumnDefinition.separatorStroke"),a instanceof Ol&&a.freeze(),this.hq=a,null!==this.panel&&this.panel.u(),this.Gb("separatorStroke",b,a))}},separatorStrokeWidth:{configurable:!0,get:function(){return this.iq},set:function(a){var b=this.iq;b!==a&&(this.iq=a,null!==this.panel&&this.panel.u(),this.Gb("separatorStrokeWidth",
1314 b,a))}},separatorDashArray:{configurable:!0,get:function(){return this.sk},set:function(a){var b=this.sk;if(b!==a){null===a||Array.isArray(a)||ya(a,"Array",jk,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];"number"===typeof f&&0<=f&&isFinite(f)||v("separatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.sk=a;null!==this.panel&&this.panel.P();this.Gb("separatorDashArray",
1315 b,a)}}},background:{configurable:!0,get:function(){return this.rb},set:function(a){var b=this.rb;b!==a&&(null!==a&&km(a,"RowColumnDefinition.background"),a instanceof Ol&&a.freeze(),this.rb=a,null!==this.panel&&this.panel.P(),this.Gb("background",b,a))}},coversSeparators:{configurable:!0,get:function(){return this.Vn},set:function(a){var b=this.Vn;b!==a&&(A(a,"boolean",jk,"coversSeparators"),this.Vn=a,null!==this.panel&&this.panel.P(),this.Gb("coversSeparators",b,a))}},
1316 sizing:{configurable:!0,get:function(){return this.lq},set:function(a){var b=this.lq;b!==a&&(F&&gb(a,jk,jk,"sizing"),this.lq=a,null!==this.panel&&this.panel.u(),this.Gb("sizing",b,a))}},actual:{configurable:!0,get:function(){return this.na},set:function(a){this.na=isNaN(this.gd)?Math.max(Math.min(this.xh,a),this.zh):Math.max(Math.min(this.xh,this.gd),this.zh)}},measured:{configurable:!0,get:function(){return this.hc},set:function(a){this.hc=a}},total:{configurable:!0,
1317 enumerable:!0,get:function(){return this.na+this.Cc()},set:function(a){this.na=isNaN(this.gd)?Math.max(Math.min(this.xh,a),this.zh):Math.max(Math.min(this.xh,this.gd),this.zh);this.na=Math.max(0,this.na-this.Cc())}},position:{configurable:!0,get:function(){return this.ra},set:function(a){this.ra=a}}});jk.prototype.bind=jk.prototype.bind;jk.prototype.computeEffectiveSpacing=jk.prototype.Cc;jk.prototype.computeEffectiveSpacingTop=jk.prototype.Wv;
1318 var On=new E(jk,"Default",0),$m=new E(jk,"None",1),sn=new E(jk,"ProportionalExtra",2);jk.className="RowColumnDefinition";jk.Default=On;jk.None=$m;jk.ProportionalExtra=sn;function Uf(){O.call(this);this.Ld=this.ua=null;this.mo="None";this.uo=pl;this.Nc=this.Fl="black";this.Hh=1;this.xm="butt";this.ym="miter";this.tk=10;this.Fh=null;this.Gh=0;this.Cf=this.Bf=fd;this.Hp=this.Gp=NaN;this.Io=!1;this.Jp=null;this.Hl=this.Em="None";this.de=1;this.be=0;this.$d=1;this.ae=null}ma(Uf,O);
1319 Uf.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.ua=this.ua;a.mo=this.mo;a.uo=this.uo;a.Ld=this.Ld;a.Fl=this.Fl;a.Nc=this.Nc;a.Hh=this.Hh;a.xm=this.xm;a.ym=this.ym;a.tk=this.tk;null!==this.Fh&&(a.Fh=Ja(this.Fh));a.Gh=this.Gh;a.Bf=this.Bf.K();a.Cf=this.Cf.K();a.Gp=this.Gp;a.Hp=this.Hp;a.Io=this.Io;a.Jp=this.Jp;a.Em=this.Em;a.Hl=this.Hl;a.de=this.de;a.be=this.be;a.$d=this.$d;a.ae=this.ae};t=Uf.prototype;
1320 t.pb=function(a){a===zg||a===Og||a===sl||a===pl?this.geometryStretch=a:O.prototype.pb.call(this,a)};t.toString=function(){return"Shape("+("None"!==this.figure?this.figure:"None"!==this.toArrow?this.toArrow:this.fromArrow)+")#"+ob(this)};
1321 function Pn(a,b,c,d){var e=c.length;if(!(4>e)){var f=d.measuredBounds,g=Math.max(1,f.width);f=f.height;for(var h=c[0],k=c[1],l,m,n,p,r,q,u=0,y=Ma(),x=2;x<e;x+=2)l=c[x],m=c[x+1],n=l-h,h=m-k,0===n&&(n=.001),p=h/n,r=Math.atan2(h,n),q=Math.sqrt(n*n+h*h),y.push([n,r,p,q]),u+=q,h=l,k=m;h=c[0];k=c[1];n=d.measuredBounds.width;d instanceof Uf&&(n-=d.strokeWidth);1>n&&(n=1);e=c=n;l=g/2;m=0===l?!1:!0;x=0;q=y[x];n=q[0];r=q[1];p=q[2];q=q[3];for(var z=0;.1<=u;){0===z&&(m?(e=c,e-=l,u-=l,m=!1):e=c,0===e&&(e=1));
1322 if(e>u){Oa(y);return}e>q?(z=e-q,e=q):z=0;var B=Math.sqrt(e*e/(1+p*p));0>n&&(B=-B);h+=B;k+=p*B;a.translate(h,k);a.rotate(r);a.translate(-(g/2),-(f/2));0===z&&d.pj(a,b);a.translate(g/2,f/2);a.rotate(-r);a.translate(-h,-k);u-=e;q-=e;if(0!==z){x++;if(x===y.length){Oa(y);return}q=y[x];n=q[0];r=q[1];p=q[2];q=q[3];e=z}}Oa(y)}}
1323 t.pj=function(a,b){var c=this.Nc,d=this.Fl;if(null!==c||null!==d){var e=this.actualBounds,f=this.naturalBounds;null!==d&&Ai(this,a,d,!0,!1,f,e);var g=this.part,h=this.Hh;null===c||0!==h||null===g||!this.isPanelMain&&g.yb()!==this||(h=g.type===W.Link&&g instanceof Ve&&"Selection"===g.category&&g.adornedObject instanceof Uf&&g.adornedPart.yb()===g.adornedObject?g.adornedObject.strokeWidth:0);0===h&&(c=null);null!==c&&0!==h&&(Ai(this,a,c,!1,!1,f,e),a.lineWidth=h,a.lineJoin=this.ym,a.lineCap=this.xm,
1324 a.miterLimit=this.tk);e=!1;g&&b.Xe("drawShadows")&&(e=g.isShadowed);g=!0;null===c||null!==d&&"transparent"!==d||(g=!1);f=!1;h=this.strokeDashArray;null!==h&&(f=!0,a.St(h,this.Gh));var k=this.ua;if(null!==k){if(k.type===Gd)a.beginPath(),a.moveTo(k.startX,k.startY),a.lineTo(k.endX,k.endY),null!==c&&a.Hj();else if(k.type===Kd){var l=k.startX;h=k.startY;var m=k.endX,n=k.endY;k=Math.min(l,m);var p=Math.min(h,n);l=Math.abs(m-l);h=Math.abs(n-h);a.beginPath();a.rect(k,p,l,h);null!==d&&a.We(d);if(null!==c){g&&
1325 e&&Nl(a);if(0===l||0===h)a.beginPath(),a.rect(k,p,Math.max(l,.1),Math.max(h,.1));a.Hj();g&&e&&Ml(a)}}else if(k.type===Ld)l=k.startX,h=k.startY,m=k.endX,n=k.endY,k=Math.abs(m-l)/2,p=Math.abs(n-h)/2,l=Math.min(l,m)+k,h=Math.min(h,n)+p,a.beginPath(),a.moveTo(l,h-p),a.bezierCurveTo(l+K.Wg*k,h-p,l+k,h-K.Wg*p,l+k,h),a.bezierCurveTo(l+k,h+K.Wg*p,l+K.Wg*k,h+p,l,h+p),a.bezierCurveTo(l-K.Wg*k,h+p,l-k,h+K.Wg*p,l-k,h),a.bezierCurveTo(l-k,h-K.Wg*p,l-K.Wg*k,h-p,l,h-p),a.closePath(),null!==d&&a.We(d),null!==c&&
1326 (g&&e?(Nl(a),a.Hj(),Ml(a)):a.Hj());else if(k.type===Ad)for(h=k.figures,k=h.length,p=0;p<k;p++){l=h.j[p];a.beginPath();a.moveTo(l.startX,l.startY);m=l.segments.j;n=m.length;for(var r=null,q=0;q<n;q++){var u=m[q];switch(u.type){case ke:a.moveTo(u.endX,u.endY);break;case Id:a.lineTo(u.endX,u.endY);break;case le:a.bezierCurveTo(u.point1X,u.point1Y,u.point2X,u.point2Y,u.endX,u.endY);break;case me:a.quadraticCurveTo(u.point1X,u.point1Y,u.endX,u.endY);break;case ne:if(u.radiusX===u.radiusY){var y=Math.PI/
1327 180;a.arc(u.point1X,u.point1Y,u.radiusX,u.startAngle*y,(u.startAngle+u.sweepAngle)*y,0>u.sweepAngle,null!==r?r.endX:l.startX,null!==r?r.endY:l.startY)}else if(r=pe(u,l),y=r.length,0===y)a.lineTo(u.centerX,u.centerY);else for(var x=0;x<y;x++){var z=r[x];0===x&&a.lineTo(z[0],z[1]);a.bezierCurveTo(z[2],z[3],z[4],z[5],z[6],z[7])}break;case oe:x=y=0;if(null!==r&&r.type===ne){r=pe(r,l);z=r.length;if(0===z){a.lineTo(u.endX,u.endY);break}r=r[z-1]||null;null!==r&&(y=r[6],x=r[7])}else y=null!==r?r.endX:l.startX,
1328 x=null!==r?r.endY:l.startY;r=qe(u,l,y,x);y=r.length;if(0===y){a.lineTo(u.endX,u.endY);break}for(x=0;x<y;x++)z=r[x],a.bezierCurveTo(z[2],z[3],z[4],z[5],z[6],z[7]);break;default:v("Segment not of valid type: "+u.type)}u.isClosed&&a.closePath();r=u}m=l.isFilled;e?l.isShadowed?(!0===m&&"transparent"!==d&&null!==d&&a.We(d),null!==c&&(m&&g&&Nl(a),a.Hj(),m&&g&&Ml(a))):(Nl(a),m&&"transparent"!==d&&null!==d&&a.We(d),null!==c&&a.Hj(),Ml(a)):(m&&null!==d&&a.We(d),null!==c&&a.Hj())}f&&a.Qt();if(null!==this.pathPattern){c=
1329 this.pathPattern;c.measure(Infinity,Infinity);d=c.measuredBounds;c.arrange(0,0,d.width,d.height);e=this.geometry;a.save();a.beginPath();d=Ma();if(e.type===Gd)d.push(e.startX),d.push(e.startY),d.push(e.endX),d.push(e.endY),Pn(a,b,d,c);else if(e.type===Ad)for(e=e.figures.iterator;e.next();){g=e.value;d.length=0;d.push(g.startX);d.push(g.startY);f=g.startX;h=g.startY;k=f;p=h;l=g.segments.j;m=l.length;for(n=0;n<m;n++){q=l[n];switch(q.type){case ke:Pn(a,b,d,c);d.length=0;d.push(q.endX);d.push(q.endY);
1330 f=q.endX;h=q.endY;k=f;p=h;break;case Id:d.push(q.endX);d.push(q.endY);f=q.endX;h=q.endY;break;case le:K.Se(f,h,q.point1X,q.point1Y,q.point2X,q.point2Y,q.endX,q.endY,.5,d);f=q.endX;h=q.endY;break;case me:K.ir(f,h,q.point1X,q.point1Y,q.endX,q.endY,.5,d);f=q.endX;h=q.endY;break;case ne:u=pe(q,g);r=u.length;if(0===r){d.push(q.centerX);d.push(q.centerY);f=q.centerX;h=q.centerY;break}for(y=0;y<r;y++)x=u[y],K.Se(f,h,x[2],x[3],x[4],x[5],x[6],x[7],.5,d),f=x[6],h=x[7];break;case oe:u=qe(q,g,f,h);r=u.length;
1331 if(0===r){d.push(q.endX);d.push(q.endY);f=q.endX;h=q.endY;break}for(y=0;y<r;y++)x=u[y],K.Se(f,h,x[2],x[3],x[4],x[5],x[6],x[7],.5,d),f=x[6],h=x[7];break;default:v("Segment not of valid type: "+q.type)}q.isClosed&&(d.push(k),d.push(p),Pn(a,b,d,c))}Pn(a,b,d,c)}else if(e.type===Kd)d.push(e.startX),d.push(e.startY),d.push(e.endX),d.push(e.startY),d.push(e.endX),d.push(e.endY),d.push(e.startX),d.push(e.endY),d.push(e.startX),d.push(e.startY),Pn(a,b,d,c);else if(e.type===Ld){h=new ve;h.startX=e.endX;h.startY=
1332 (e.startY+e.endY)/2;f=new we(ne);f.startAngle=0;f.sweepAngle=360;f.centerX=(e.startX+e.endX)/2;f.centerY=(e.startY+e.endY)/2;f.radiusX=Math.abs(e.startX-e.endX)/2;f.radiusY=Math.abs(e.startY-e.endY)/2;h.add(f);e=pe(f,h);g=e.length;if(0===g)d.push(f.centerX),d.push(f.centerY);else for(f=h.startX,h=h.startY,k=0;k<g;k++)p=e[k],K.Se(f,h,p[2],p[3],p[4],p[5],p[6],p[7],.5,d),f=p[6],h=p[7];Pn(a,b,d,c)}Oa(d);a.restore();a.Ac(!1)}}}};
1333 t.ja=function(a,b){void 0===b&&(b=new J);if(a instanceof N){a.Sb()&&v("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.naturalBounds,d=this.strokeWidth;b.h(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.Md.Aa(b);return b};
1334 t.xj=function(a){void 0===a&&(a=new L);var b=this.naturalBounds,c=this.Md;b=L.allocAt(b.x,b.y,b.width,b.height);var d=this.strokeWidth;b.Pc(d/2,d/2);d=J.allocAt(b.x,b.y).transform(c);a.h(d.x,d.y,0,0);d.h(b.right,b.y).transform(c);kc(a,d.x,d.y,0,0);d.h(b.right,b.bottom).transform(c);kc(a,d.x,d.y,0,0);d.h(b.x,b.bottom).transform(c);kc(a,d.x,d.y,0,0);L.free(b);J.free(d);return a};
1335 t.Vh=function(a,b){var c=this.geometry;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.bounds,e=this.strokeWidth/2;c.type!==Gd||b||(e+=2);var f=L.alloc();f.assign(d);f.Pc(e+2,e+2);if(!f.ca(a))return L.free(f),!1;d=e+1E-4;if(c.type===Gd){if(null===this.stroke)return!1;d=(c.endX-c.startX)*(a.x-c.startX)+(c.endY-c.startY)*(a.y-c.startY);if(0>(c.startX-c.endX)*(a.x-c.endX)+(c.startY-c.endY)*(a.y-c.endY)||0>d)return!1;L.free(f);return K.Tb(c.startX,c.startY,c.endX,c.endY,e,a.x,a.y)}if(c.type===
1336 Kd){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.Pc(-d,-d);if(f.ca(a))return L.free(f),!1;f.Pc(d,d)}null!==this.stroke&&f.Pc(e,e);a=f.ca(a);L.free(f);return a}if(c.type===Ld){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 L.free(f),!1;
1337 g+=d;e+=d}null!==this.stroke&&(g+=d,e+=d);L.free(f);return 0>=g||0>=e?!1:1>=c*c/(g*g)+b*b/(e*e)}if(c.type===Ad)return L.free(f),null===this.fill?te(c,a.x,a.y,e):re(c,a,e,1<this.strokeWidth,b);v("Unknown Geometry type: "+c.type);return!1};
1338 t.Vm=function(a,b,c,d){var e=this.desiredSize,f=this.Hh;a=Math.max(a,0);b=Math.max(b,0);if(null!==this.Ld)var g=this.geometry.bounds;else{var h=this.figure,k=Qn[h];if(void 0===k){var l=K.qe[h];"string"===typeof l&&(l=K.qe[l]);"function"===typeof l?(k=l(null,100,100),Qn[h]=k):v("Unsupported Figure: "+h)}g=k.bounds}h=g.width;k=g.height;l=g.width;var m=g.height;switch(Fl(this,!0)){case zg:d=c=0;break;case Bd:l=Math.max(a-f,0);m=Math.max(b-f,0);break;case ql:l=Math.max(a-f,0);d=0;break;case rl:c=0,m=
1339 Math.max(b-f,0)}isFinite(e.width)&&(l=e.width);isFinite(e.height)&&(m=e.height);e=this.maxSize;g=this.minSize;c=Math.max(c-f,g.width);d=Math.max(d-f,g.height);l=Math.min(e.width,l);m=Math.min(e.height,m);l=isFinite(l)?Math.max(c,l):Math.max(h,c);m=isFinite(m)?Math.max(d,m):Math.max(k,d);c=Ng(this);switch(c){case zg:break;case Bd:h=l;k=m;break;case Og:c=Math.min(l/h,m/k);isFinite(c)||(c=1);h*=c;k*=c;break;default:v(c+" is not a valid geometryStretch.")}null!==this.Ld?(0===h&&(h=.001),0===k&&(k=.001),
1340 c=null!==this.Ld?this.Ld:this.ua,e=c.bounds,d=h/e.width,e=k/e.height,isFinite(d)||(d=1),isFinite(e)||(e=1),c=1===d&&1===e?c:c.copy().scale(d,e),F&&c.freeze(),this.ua=c):null!==this.ua&&K.da(this.ua.Ql,a-f)&&K.da(this.ua.Pl,b-f)||(this.ua=Uf.makeGeometry(this,h,k));g=this.ua.bounds;Infinity===a||Infinity===b?Cl(this,g.x-f/2,g.y-f/2,0===a&&0===h?0:g.width+f,0===b&&0===k?0:g.height+f):Cl(this,-(f/2),-(f/2),l+f,m+f)};
1341 function Ng(a){var b=a.geometryStretch;return null!==a.Ld?b===pl?Bd:b:b===pl?Qn[a.figure].defaultStretch:b}t.Th=function(a,b,c,d){Hl(this,a,b,c,d)};t.$t=function(a,b,c){return this.Lk(a.x,a.y,b.x,b.y,c)};
1342 t.Lk=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);f=a*h+b*l+n;g=a*k+b*m+p;h=c*h+d*l+n;k=c*k+d*m+p;n=this.Hh/2;l=this.ua;null===l&&(this.measure(Infinity,Infinity),l=this.ua);var r=l.bounds;m=!1;if(l.type===Gd)if(1.5>=this.strokeWidth)m=K.Ze(l.startX,l.startY,l.endX,l.endY,f,g,h,k,e);else{l.startX===l.endX?(d=n,m=0):(b=(l.endY-l.startY)/(l.endX-l.startX),m=n/Math.sqrt(1+b*b),
1343 d=m*b);b=Ma();a=new J;K.Ze(l.startX+d,l.startY+m,l.endX+d,l.endY+m,f,g,h,k,a)&&b.push(a);a=new J;K.Ze(l.startX-d,l.startY-m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Ze(l.startX+d,l.startY+m,l.startX-d,l.startY-m,f,g,h,k,a)&&b.push(a);a=new J;K.Ze(l.endX+d,l.endY+m,l.endX-d,l.endY-m,f,g,h,k,a)&&b.push(a);h=b.length;if(0===h)return Oa(b),!1;m=!0;k=Infinity;for(d=0;d<h;d++)a=b[d],c=(a.x-f)*(a.x-f)+(a.y-g)*(a.y-g),c<k&&(k=c,e.x=a.x,e.y=a.y);Oa(b)}else if(l.type===Kd)m=K.Of(r.x-n,r.y-n,r.x+r.width+
1344 n,r.y+r.height+n,f,g,h,k,e);else if(l.type===Ld){b=L.allocAt(r.x,r.y,r.width,r.height).Pc(n,n);a:if(0===b.width)m=K.Ze(b.x,b.y,b.x,b.y+b.height,f,g,h,k,e);else if(0===b.height)m=K.Ze(b.x,b.y,b.x+b.width,b.y,f,g,h,k,e);else{a=b.width/2;l=b.height/2;d=b.x+a;m=b.y+l;c=9999;f!==h&&(c=(g-k)/(f-h));if(9999>Math.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*
1345 (a-d)+k+m;Math.abs((f-h)*(f-h))+Math.abs((g-l)*(g-l))<Math.abs((f-a)*(f-a))+Math.abs((g-k)*(g-k))?(e.x=h,e.y=l):(e.x=a,e.y=k)}else{h=l*l;k=f-d;h-=h/(a*a)*k*k;if(0>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(k-g)?(e.x=f,e.y=h):(e.x=f,e.y=k)}m=!0}L.free(b)}else if(l.type===Ad){p=J.alloc();var q=h-f;var u=k-g,y=q*q+u*u,x=f,z=g;if(0<y&&r.contains(x,z)&&(p.x=x,p.y=z,this.ca(p)))for(0!==q&&.5>Math.abs(q)?(u*=.5/q,q=.5):0!==u&&.5>Math.abs(u)&&(q*=.5/u,u=.5),x-=q,z-=
1346 u;r.contains(x,z);)x-=q,z-=u;e.x=h;e.y=k;for(u=0;u<l.figures.count;u++){var B=l.figures.j[u],D=B.isFilled?x:f,G=B.isFilled?z:g,M=B.segments;r=B.startX;q=B.startY;for(var Y=r,Q=q,ca=0;ca<M.count;ca++){var T=M.j[ca],P=T.type;var xa=T.endX;var ka=T.endY;var Aa=!1;switch(P){case ke:Y=xa;Q=ka;break;case Id:Aa=Rn(r,q,xa,ka,D,G,h,k,p);break;case le:Aa=K.Jq(r,q,T.point1X,T.point1Y,T.point2X,T.point2Y,xa,ka,D,G,h,k,.6,p);break;case me:Aa=K.Jq(r,q,r+2/3*(T.point1X-r),q+2/3*(T.point1Y-q),xa+2/3*(T.point1X-xa),
1347 ka+2/3*(T.point1Y-ka),xa,ka,D,G,h,k,.6,p);break;case ne:case oe:P=T.type===ne?pe(T,B):qe(T,B,r,q);var Ua=P.length;if(0===Ua){Aa=Rn(r,q,T.type===ne?T.centerX:T.endX,T.type===ne?T.centerY:T.endY,D,G,h,k,p);break}ka=null;for(xa=0;xa<Ua;xa++){ka=P[xa];if(0===xa&&Rn(r,q,ka[0],ka[1],D,G,h,k,p)){var tb=Sn(D,G,p,y,e);tb<y&&(y=tb,m=!0)}K.Jq(ka[0],ka[1],ka[2],ka[3],ka[4],ka[5],ka[6],ka[7],D,G,h,k,.6,p)&&(tb=Sn(D,G,p,y,e),tb<y&&(y=tb,m=!0))}xa=ka[6];ka=ka[7];break;default:v("Unknown Segment type: "+P)}r=xa;
1348 q=ka;Aa&&(Aa=Sn(D,G,p,y,e),Aa<y&&(y=Aa,m=!0));T.isClosed&&(xa=Y,ka=Q,Rn(r,q,xa,ka,D,G,h,k,p)&&(T=Sn(D,G,p,y,e),T<y&&(y=T,m=!0)))}}f=c-a;g=d-b;h=Math.sqrt(f*f+g*g);0!==h&&(f/=h,g/=h);e.x-=f*n;e.y-=g*n;J.free(p)}else v("Unknown Geometry type: "+l.type);if(!m)return!1;this.transform.Aa(e);return!0};function Sn(a,b,c,d,e){a=c.x-a;b=c.y-b;b=a*a+b*b;return b<d?(e.x=c.x,e.y=c.y,b):d}
1349 function Rn(a,b,c,d,e,f,g,h,k){var l=!1,m=(e-g)*(b-d)-(f-h)*(a-c);if(0===m)return!1;k.x=((e*h-f*g)*(a-c)-(e-g)*(a*d-b*c))/m;k.y=((e*h-f*g)*(b-d)-(f-h)*(a*d-b*c))/m;(a>c?a-c:c-a)<(b>d?b-d:d-b)?(a=b<d?b:d,b=b<d?d:b,(k.y>a||K.da(k.y,a))&&(k.y<b||K.da(k.y,b))&&(l=!0)):(b=a<c?a:c,a=a<c?c:a,(k.x>b||K.da(k.x,b))&&(k.x<a||K.da(k.x,a))&&(l=!0));return l}
1350 t.Uh=function(a,b){if(void 0===b)return a.Te(this.actualBounds);var c=this.ua;null===c&&(this.measure(Infinity,Infinity),c=this.ua);c=c.bounds;var d=this.strokeWidth/2,e=!1,f=J.alloc();f.h(c.x-d,c.y-d);a.ca(b.Aa(f))&&(f.h(c.x-d,c.bottom+d),a.ca(b.Aa(f))&&(f.h(c.right+d,c.bottom+d),a.ca(b.Aa(f))&&(f.h(c.right+d,c.y-d),a.ca(b.Aa(f))&&(e=!0))));J.free(f);return e};
1351 t.Sc=function(a,b){if(this.Uh(a,b)||void 0===b&&(b=this.transform,a.Te(this.actualBounds)))return!0;var c=Gb.alloc();c.set(b);c.eu();var d=a.left,e=a.right,f=a.top;a=a.bottom;var g=J.alloc();g.h(d,f);c.Aa(g);if(this.Vh(g,!0))return J.free(g),!0;g.h(e,f);c.Aa(g);if(this.Vh(g,!0))return J.free(g),!0;g.h(d,a);c.Aa(g);if(this.Vh(g,!0))return J.free(g),!0;g.h(e,a);c.Aa(g);if(this.Vh(g,!0))return J.free(g),!0;var h=J.alloc(),k=J.alloc();c.set(b);c.xw(this.transform);c.eu();h.x=e;h.y=f;h.transform(c);g.x=
1352 d;g.y=f;g.transform(c);b=!1;Tn(this,g,h,k)?b=!0:(g.x=e,g.y=a,g.transform(c),Tn(this,g,h,k)?b=!0:(h.x=d,h.y=a,h.transform(c),Tn(this,g,h,k)?b=!0:(g.x=d,g.y=f,g.transform(c),Tn(this,g,h,k)&&(b=!0))));J.free(g);Gb.free(c);J.free(h);J.free(k);return b};function Tn(a,b,c,d){if(!a.$t(b,c,d))return!1;a=b.x;b=b.y;var e=c.x,f=c.y;c=d.x;d=d.y;if(a===e)return b<f?(a=b,b=f):a=f,d>=a&&d<=b;a<e?(d=a,a=e):d=e;return c>=d&&c<=a}
1353 t.Hy=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.wd(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.Vh(a,!0))return!0;var e=a.Ve(b),f=e;1.5<this.strokeWidth&&(e=this.strokeWidth/2+Math.sqrt(e),e*=e);b=this.ua;if(null===b&&(this.measure(Infinity,Infinity),b=this.ua,null===b))return!1;if(!c){var g=b.bounds,h=g.x,k=g.y,l=g.x+g.width;g=g.y+g.height;if(Jb(a.x,a.y,h,k)<=e&&Jb(a.x,a.y,l,k)<=e&&Jb(a.x,a.y,h,g)<=e&&Jb(a.x,a.y,l,g)<=e)return!0}h=b.startX;k=b.startY;l=
1354 b.endX;g=b.endY;if(b.type===Gd){if(c=Ib(a.x,a.y,h,k,l,g),b=(h-l)*(a.x-l)+(k-g)*(a.y-g),c<=(0<=(l-h)*(a.x-h)+(g-k)*(a.y-k)&&0<=b?e:f))return!0}else{if(b.type===Kd)return b=!1,c&&(b=Ib(a.x,a.y,h,k,h,g)<=e||Ib(a.x,a.y,h,k,l,k)<=e||Ib(a.x,a.y,l,k,l,g)<=e||Ib(a.x,a.y,h,g,l,g)<=e),b;if(b.type===Ld){b=a.x-(h+l)/2;f=a.y-(k+g)/2;var m=Math.abs(l-h)/2,n=Math.abs(g-k)/2;if(0===m||0===n)return Ib(a.x,a.y,h,k,l,g)<=e?!0:!1;if(c){if(a=K.cA(m,n,b,f),a*a<=e)return!0}else return Jb(b,f,-m,0)>=e||Jb(b,f,0,-n)>=e||
1355 Jb(b,f,0,n)>=e||Jb(b,f,m,0)>=e?!1:!0}else if(b.type===Ad){l=b.bounds;f=l.x;h=l.y;k=l.x+l.width;l=l.y+l.height;if(a.x>k&&a.x<f&&a.y>l&&a.y<h&&Ib(a.x,a.y,f,h,f,l)>e&&Ib(a.x,a.y,f,h,k,h)>e&&Ib(a.x,a.y,k,l,f,l)>e&&Ib(a.x,a.y,k,l,k,h)>e)return!1;f=Math.sqrt(e);if(c){if(null===this.fill?te(b,a.x,a.y,f):re(b,a,f,!0,!1))return!0}else{c=b.figures;for(b=0;b<c.count;b++){f=c.j[b];g=f.startX;m=f.startY;if(a.wd(g,m)>e)return!1;h=f.segments.j;k=h.length;for(l=0;l<k;l++)switch(n=h[l],n.type){case ke:case Id:g=n.endX;
1356 m=n.endY;if(a.wd(g,m)>e)return!1;break;case le:var p=Ma();K.Se(g,m,n.point1X,n.point1Y,n.point2X,n.point2Y,n.endX,n.endY,.8,p);g=d(p,a);Oa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.wd(g,m)>e)return!1;break;case me:p=Ma();K.ir(g,m,n.point1X,n.point1Y,n.endX,n.endY,.8,p);g=d(p,a);Oa(p);if(g)return!1;g=n.endX;m=n.endY;if(a.wd(g,m)>e)return!1;break;case ne:case oe:p=n.type===ne?pe(n,f):qe(n,f,g,m);var r=p.length;if(0===r){g=n.type===ne?n.centerX:n.endX;m=n.type===ne?n.centerY:n.endY;if(a.wd(g,m)>e)return!1;
1357 break}n=null;for(var q=Ma(),u=0;u<r;u++)if(n=p[u],q.length=0,K.Se(n[0],n[1],n[2],n[3],n[4],n[5],n[6],n[7],.8,q),d(q,a))return Oa(q),!1;Oa(q);null!==n&&(g=n[6],m=n[7]);break;default:v("Unknown Segment type: "+n.type)}}return!0}}}return!1};t.jc=function(){this.ua=null};function Un(a){var b=a.diagram;null!==b&&b.undoManager.isUndoingRedoing||(a.segmentOrientation=pn,"None"!==a.Em?(a.segmentIndex=-1,a.alignmentFocus=od):"None"!==a.Hl&&(a.segmentIndex=0,a.alignmentFocus=new N(1-od.x,od.y)))}
1358 Uf.makeGeometry=function(a,b,c){if("None"!==a.toArrow)var d=Vn[a.toArrow];else"None"!==a.fromArrow?d=Vn[a.fromArrow]:(d=K.qe[a.figure],"string"===typeof d&&(d=K.qe[d]),void 0===d&&v("Unknown Shape.figure: "+a.figure),d=d(a,b,c),d.Ql=b,d.Pl=c);if(null===d){var e=K.qe.Rectangle;"function"===typeof e&&(d=e(a,b,c))}F&&(d.bounds.width>b+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.");
1359 return d};function fo(a){var b=Vn[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Vn[c];if(void 0===b){var d=null,e;for(e in K.rn)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=Md(K.rn[d],!1),Vn[d]=a,c!==d&&(Vn[c]=d),d}}return"string"===typeof b?b:b instanceof zd?a:null}
1360 na.Object.defineProperties(Uf.prototype,{geometry:{configurable:!0,get:function(){return null!==this.ua?this.ua:this.Ld},set:function(a){var b=this.ua,c=this.Ld;if(b!==a){null!==a?(F&&w(a,zd,Uf,"geometry"),this.Ld=this.ua=a.freeze()):this.Ld=this.ua=null;var d=this.part;null!==d&&(d.wh=NaN);this.u();this.g("geometry",b||c,a);zl(this)&&(a=this.part,null!==a&&Al(this,a,"geometryString"))}}},geometryString:{configurable:!0,get:function(){return null===this.geometry?"":this.geometry.toString()},
1361 set:function(a){a=Md(a);var b=a.normalize();this.geometry=a;this.position=a=J.allocAt(-b.x,-b.y);J.free(a)}},isGeometryPositioned:{configurable:!0,get:function(){return this.Io},set:function(a){F&&A(a,"boolean",Uf,"isGeometryPositioned");var b=this.Io;b!==a&&(this.Io=a,this.u(),this.g("isGeometryPositioned",b,a))}},fill:{configurable:!0,get:function(){return this.Fl},set:function(a){var b=this.Fl;b!==a&&(null!==a&&km(a,"Shape.fill"),a instanceof Ol&&a.freeze(),this.Fl=
1362 a,this.P(),this.g("fill",b,a))}},stroke:{configurable:!0,get:function(){return this.Nc},set:function(a){var b=this.Nc;b!==a&&(null!==a&&km(a,"Shape.stroke"),a instanceof Ol&&a.freeze(),this.Nc=a,this.P(),this.g("stroke",b,a))}},strokeWidth:{configurable:!0,get:function(){return this.Hh},set:function(a){var b=this.Hh;if(b!==a)if(F&&C(a,Uf,"strokeWidth"),0<=a){this.Hh=a;this.u();var c=this.part;null!==c&&(c.wh=NaN);this.g("strokeWidth",b,a)}else za(a,"value >= 0",Uf,"strokeWidth:value")}},
1363 strokeCap:{configurable:!0,get:function(){return this.xm},set:function(a){var b=this.xm;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?za(a,'"butt", "round", or "square"',Uf,"strokeCap"):(this.xm=a,this.P(),this.g("strokeCap",b,a)))}},strokeJoin:{configurable:!0,get:function(){return this.ym},set:function(a){var b=this.ym;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?za(a,'"miter", "bevel", or "round"',Uf,"strokeJoin"):(this.ym=
1364 a,this.P(),this.g("strokeJoin",b,a)))}},strokeMiterLimit:{configurable:!0,get:function(){return this.tk},set:function(a){var b=this.tk;if(b!==a)if(F&&C(a,Uf,"strokeMiterLimit"),1<=a){this.tk=a;this.P();var c=this.part;null!==c&&(c.wh=NaN);this.g("strokeMiterLimit",b,a)}else F&&za(a,"value >= 1",Uf,"strokeWidth:value")}},strokeDashArray:{configurable:!0,get:function(){return this.Fh},set:function(a){var b=this.Fh;if(b!==a){null===a||Array.isArray(a)||ya(a,"Array",Uf,"strokeDashArray:value");
1365 if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var f=a[e];(!F||"number"===typeof f)&&0<=f&&isFinite(f)||v("strokeDashArray:value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Fh=a;this.P();this.g("strokeDashArray",b,a)}}},strokeDashOffset:{configurable:!0,get:function(){return this.Gh},set:function(a){var b=this.Gh;b!==a&&(F&&C(a,Uf,"strokeDashOffset"),0<=a&&(this.Gh=a,this.P(),this.g("strokeDashOffset",b,a)))}},figure:{configurable:!0,
1366 enumerable:!0,get:function(){return this.mo},set:function(a){var b=this.mo;if(b!==a){F&&A(a,"string",Uf,"figure");var c=K.qe[a];"function"===typeof c?c=a:(c=K.qe[a.toLowerCase()])||v("Unknown Shape.figure: "+a);b!==c&&(a=this.part,null!==a&&(a.wh=NaN),this.mo=c,this.Ld=null,this.jc(),this.u(),this.g("figure",b,c))}}},toArrow:{configurable:!0,get:function(){return this.Em},set:function(a){var b=this.Em;!0===a?a="Standard":!1===a&&(a="");if(b!==a){F&&A(a,"string",Uf,"toArrow");var c=fo(a);
1367 null===c?v("Unknown Shape.toArrow: "+a):b!==c&&(this.Em=c,this.Ld=null,this.jc(),this.u(),Un(this),this.g("toArrow",b,c))}}},fromArrow:{configurable:!0,get:function(){return this.Hl},set:function(a){var b=this.Hl;!0===a?a="Standard":!1===a&&(a="");if(b!==a){F&&A(a,"string",Uf,"fromArrow");var c=fo(a);null===c?v("Unknown Shape.fromArrow: "+a):b!==c&&(this.Hl=c,this.Ld=null,this.jc(),this.u(),Un(this),this.g("fromArrow",b,c))}}},spot1:{configurable:!0,get:function(){return this.Bf},
1368 set:function(a){w(a,N,Uf,"spot1");var b=this.Bf;b.A(a)||(this.Bf=a=a.K(),this.u(),this.g("spot1",b,a))}},spot2:{configurable:!0,get:function(){return this.Cf},set:function(a){w(a,N,Uf,"spot2");var b=this.Cf;b.A(a)||(this.Cf=a=a.K(),this.u(),this.g("spot2",b,a))}},parameter1:{configurable:!0,get:function(){return this.Gp},set:function(a){var b=this.Gp;b!==a&&(this.Gp=a,this.jc(),this.u(),this.g("parameter1",b,a))}},parameter2:{configurable:!0,get:function(){return this.Hp},
1369 set:function(a){var b=this.Hp;b!==a&&(this.Hp=a,this.jc(),this.u(),this.g("parameter2",b,a))}},naturalBounds:{configurable:!0,get:function(){var a=this.desiredSize;return a.o()||null===this.ua?new L(0,0,a.width,a.height):(this.wc.assign(this.ua.bounds),this.wc)}},pathPattern:{configurable:!0,get:function(){return this.Jp},set:function(a){var b=this.Jp;b!==a&&(F&&null!==a&&w(a,O,Uf,"pathPattern"),this.Jp=a,this.P(),this.g("pathPattern",b,a))}},geometryStretch:{configurable:!0,
1370 enumerable:!0,get:function(){return this.uo},set:function(a){var b=this.uo;b!==a&&(gb(a,O,Uf,"geometryStretch"),this.uo=a,this.u(),this.g("geometryStretch",b,a))}},interval:{configurable:!0,get:function(){return this.de},set:function(a){var b=this.de;F&&C(a,Uf,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){this.de=a;var c=this.diagram;null!==c&&this.panel===c.grid&&Ej(c);this.u();c=this.panel;null!==c&&(c.qh=null);this.g("interval",b,a)}}},graduatedStart:{configurable:!0,
1371 enumerable:!0,get:function(){return this.be},set:function(a){var b=this.be;F&&C(a,Uf,"graduatedStart");b!==a&&(0>a?a=0:1<a&&(a=1),this.be=a,this.u(),this.g("graduatedStart",b,a))}},graduatedEnd:{configurable:!0,get:function(){return this.$d},set:function(a){var b=this.$d;F&&C(a,Uf,"graduatedEnd");b!==a&&(0>a?a=0:1<a&&(a=1),this.$d=a,this.u(),this.g("graduatedEnd",b,a))}},graduatedSkip:{configurable:!0,get:function(){return this.ae},set:function(a){var b=this.ae;b!==a&&
1372 (null!==a&&A(a,"function",Uf,"graduatedSkip"),this.ae=a,this.u(),this.g("graduatedSkip",b,a))}}});Uf.prototype.intersectsRect=Uf.prototype.Sc;Uf.prototype.containedInRect=Uf.prototype.Uh;Uf.prototype.getNearestIntersectionPoint=Uf.prototype.$t;Uf.prototype.getDocumentBounds=Uf.prototype.xj;Uf.prototype.getDocumentPoint=Uf.prototype.ja;var Vn=new ib,Qn=new ib;Uf.className="Shape";Uf.getFigureGenerators=function(){var a=new Bb,b;for(b in K.qe)b!==b.toLowerCase()&&a.add(b,K.qe[b]);a.freeze();return a};
1373 Uf.defineFigureGenerator=function(a,b){A(a,"string",Uf,"defineFigureGenerator:name");"string"===typeof b?!F||""!==b&&K.qe[b]||v("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):A(b,"function",Uf,"defineFigureGenerator:func");var c=a.toLowerCase();!F||""!==a&&a!==c||v("Shape.defineFigureGenerator name must not be empty or all-lower-case: "+a);var d=K.qe;d[a]=b;d[c]=a};
1374 Uf.getArrowheadGeometries=function(){var a=new Bb;for(d in K.rn)if(void 0===Vn[d]){var b=Md(K.rn[d],!1);Vn[d]=b;b=d.toLowerCase();b!==d&&(Vn[b]=d)}for(var c in Vn)if(c!==c.toLowerCase()){var d=Vn[c];d instanceof zd&&a.add(c,d)}a.freeze();return a};
1375 Uf.defineArrowheadGeometry=function(a,b){A(a,"string",Uf,"defineArrowheadGeometry:name");"string"===typeof b?(A(b,"string",Uf,"defineArrowheadGeometry:pathstr"),b=Md(b,!1)):w(b,zd,Uf,"defineArrowheadGeometry:pathstr");var c=a.toLowerCase();(F&&""===a||"none"===c||a===c)&&v("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);var d=Vn;d[a]=b;d[c]=a};
1376 function ih(){O.call(this);go||(ho=gh?(new Vk(null)).context:null,go=!0);this.Xx=this.$b="";this.Nc="black";this.xe="13px sans-serif";this.fj="start";this.Zd=zg;this.lj=kd;this.ak=!0;this.Li=this.Mi=!1;this.yg=io;this.Lg=jo;this.Hs=this.Ab=this.ed=0;this.rv=this.sv=null;this.jo=!1;this.rd=this.Kn=this.vq=this.gj=this.wq=null;this.Af=this.zf=0;this.Ei=ko;this.Ge=Infinity;this.Pi=0;this.ye=null;this.Me=0;this.we=this.qb=this.Wb=null;this.de=1;this.be=0;this.$d=1;this.ae=this.Xj=null}ma(ih,O);
1377 ih.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.$b=this.$b;a.Xx=this.Xx;a.Nc=this.Nc;a.xe=this.xe;a.fj=this.fj;a.Zd=this.Zd;a.lj=this.lj;a.ak=this.ak;a.Mi=this.Mi;a.Li=this.Li;a.yg=this.yg;a.Lg=this.Lg;a.ed=this.ed;a.Hs=this.Hs;a.Ab=this.Ab;a.sv=this.sv;a.rv=this.rv;a.jo=this.jo;a.wq=this.wq;a.gj=this.gj;a.vq=this.vq;a.Kn=this.Kn;a.rd=this.rd;a.zf=this.zf;a.Af=this.Af;a.Ei=this.Ei;a.Ge=this.Ge;a.ye=this.ye;a.Me=this.Me;a.Wb=this.Wb;a.qb=this.qb;a.we=this.we;a.Pi=
1378 this.Pi;a.de=this.de;a.be=this.be;a.$d=this.$d;a.Xj=this.Xj;a.ae=this.ae};
1379 function on(a,b){a.I=b.I|6144;a.nb=b.opacity;a.rb=b.background;a.kc=b.areaBackground;a.cd=b.desiredSize.K();a.rg=b.minSize.K();a.qg=b.maxSize.K();a.og=b.og.copy();a.Ga=b.scale;a.dc=b.angle;a.Pe=b.stretch;a.vh=b.margin.K();a.Db=b.alignment.K();a.ll=b.alignmentFocus.K();a.nm=b.segmentFraction;a.om=b.segmentOffset.K();a.pm=b.segmentOrientation;null!==b.gb&&(a.gb=b.gb.copy());a.rm=b.shadowVisible;b instanceof ih&&(a.$b=b.$b,a.Nc=b.Nc,a.xe=b.xe,a.fj=b.fj,a.Zd=b.Zd,a.lj=b.lj,a.ak=b.ak,a.Mi=b.Mi,a.Li=b.Li,
1380 a.yg=b.yg,a.Lg=b.Lg,a.ye=null,a.zf=b.zf,a.Af=b.Af,a.Ge=b.Ge,a.Pi=b.Pi,a.de=b.de,a.be=b.be,a.$d=b.$d,a.Xj=b.Xj,a.ae=b.ae)}t=ih.prototype;t.pb=function(a){a.classType===ih?this.wrap=a:O.prototype.pb.call(this,a)};t.toString=function(){return 22<this.$b.length?'TextBlock("'+this.$b.substring(0,20)+'"...)':'TextBlock("'+this.$b+'")'};t.u=function(){O.prototype.u.call(this);this.rv=this.sv=null};
1381 function lo(a){go||(ho=gh?(new Vk(null)).context:null,go=!0);if(null===ho)return!0;var b=ho.font;if(a===b||"10px sans-serif"===a)return!0;ho.font="10px sans-serif";ho.font=a;var c=ho.font;if("10px sans-serif"!==c)return ho.font=b,!0;ho.font="19px serif";var d=ho.font;ho.font=a;c=ho.font;ho.font=b;return c!==d}
1382 t.pj=function(a,b){if(null!==this.Nc&&0!==this.$b.length&&null!==this.xe){var c=this.naturalBounds,d=this.actualBounds,e=c.width,f=c.height,g=mo(this),h=a.textAlign=this.fj,k=b.Tl;"start"===h?h=k?"right":"left":"end"===h&&(h=k?"left":"right");k=this.Mi;var l=this.Li;Ai(this,a,this.Nc,!0,!1,c,d);(k||l)&&Ai(this,a,this.Nc,!1,!1,c,d);d=0;c=!1;var m=J.allocAt(0,0);this.Md.Aa(m);var n=J.allocAt(0,g);this.Md.Aa(n);var p=m.Ve(n);J.free(m);J.free(n);m=b.scale;8>p*m*m&&(c=!0);b.Mb!==a&&(c=!1);!1===b.Xe("textGreeking")&&
1383 (c=!1);b=this.zf;p=this.Af;switch(this.flip){case ul:a.translate(e,0);a.scale(-1,1);break;case tl:a.translate(0,f);a.scale(1,-1);break;case vl:a.translate(e,f),a.scale(-1,-1)}m=this.ed;n=(b+g+p)*m;f>n&&(d=this.lj,d=d.y*f-d.y*n+d.offsetY);if(1===m&&null!==this.we)p=this.Ab,p>e&&(p=e),this.oj(this.we,a,0,d+b,e,g,p,c,h,k,l);else if(null!==this.Wb&&null!==this.qb)for(n=0;n<m;n++){var r=this.Wb[n];r>e&&(r=e);d+=b;this.oj(this.qb[n],a,0,d,e,g,r,c,h,k,l);d+=g+p}switch(this.flip){case ul:a.scale(-1,1);a.translate(-e,
1384 0);break;case tl:a.scale(1,-1);a.translate(0,-f);break;case vl:a.scale(-1,-1),a.translate(-e,-f)}}};
1385 t.oj=function(a,b,c,d,e,f,g,h,k,l,m){var n=0;h?("left"===k?n=0:"right"===k?n=e-g:"center"===k&&(n=(e-g)/2),b.fillRect(c+n,d+.25*f,g,1)):("left"===k?n=0:"right"===k?n=e:"center"===k&&(n=e/2),e=null!==no?no(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),l&&(k=null!==oo?oo(this,f):.8*f,b.beginPath(),b.lineWidth=a,b.moveTo(c+n,d+k),b.lineTo(c+n+g,d+k),b.stroke()),m&&(b.beginPath(),b.lineWidth=a,d=d+f-f/2.2|0,0!==a%2&&(d+=.5),b.moveTo(c+n,d),b.lineTo(c+
1386 n+g,d),b.stroke()))};
1387 t.Vm=function(a,b,c,d){this.Pi=a;var e=this.xe;null!==ho&&po!==e&&(po=ho.font=e);this.Ab=this.Me=0;this.we=this.qb=this.Wb=this.ye=null;var f;if(isNaN(this.desiredSize.width)){e=this.$b.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===e.length)e=0;else if(this.isMultiline){for(var g=f=0,h=!1;!h;){var k=e.indexOf("\n",g);-1===k&&(k=e.length,h=!0);g=e.substr(g,k-g);this.Ei===ko&&(g=g.trim());f=Math.max(f,qo(g));g=k+1}e=f}else f=e.indexOf("\n",0),0<=f&&(e=e.substr(0,f)),e=qo(e);e=Math.min(e,a/this.scale);
1388 e=Math.max(8,e)}else e=this.desiredSize.width;null!==this.panel&&(e=Math.min(e,this.panel.maxSize.width));f=ro(this,e);isNaN(this.desiredSize.height)?f=Math.min(f,b/this.scale):f=this.desiredSize.height;h=f;if(0!==this.Ab&&null!==this.Wb&&null!==this.qb&&this.yg===so&&(b=this.xe,b=this.yg===so?to(b):0,k=this.zf+this.Af,k=Math.max(0,mo(this)+k),h=Math.min(this.maxLines-1,Math.max(Math.floor(h/k+.01)-1,0)),!(h+1>=this.qb.length))){k=this.qb[h];for(b=Math.max(1,a-b);qo(k)>b&&1<k.length;)k=k.substr(0,
1389 k.length-1);k+=uo;b=qo(k);this.qb[h]=k;this.qb=this.qb.slice(0,h+1);this.Wb[h]=b;this.Wb=this.Wb.slice(0,h+1);this.Me=this.qb.length;this.Ab=Math.max(this.Ab,b);this.ed=this.Me;1===this.ed&&(this.we=this.qb[0])}if(this.wrap===vo||isNaN(this.desiredSize.width))e=isNaN(a)?this.Ab:Math.min(a,this.Ab),isNaN(this.desiredSize.width)&&(e=Math.max(8,e));e=Math.max(c,e);f=Math.max(d,f);cc(this.wc,e,f);Cl(this,0,0,e,f)};t.Th=function(a,b,c,d){Hl(this,a,b,c,d)};
1390 function wo(a,b,c){if(null===a.we)a.we=b,a.Ab=c;else{if(null===a.qb||null===a.Wb)a.qb=[],a.Wb=[],a.qb.push(a.we),a.Wb.push(a.Ab);a.qb.push(b);a.Wb.push(c)}}
1391 function xo(a,b,c,d){var e=a.Ei===ko;e&&(b=b.trim());var f=0,g=a.xe,h=a.zf+a.Af;h=Math.max(0,mo(a)+h);var k=a.yg===so?to(g):0;if(a.ed>=a.Ge)null!==d&&d.h(0,h);else if(g=b,a.Lg===yo){a.Me=1;var l=qo(b);if(0===k||l<=c)a.Ab=Math.max(a.Ab,l),wo(a,b,a.Ab),null!==d&&d.h(l,h);else{f=zo(a,g);g=g.substr(f.length);b=zo(a,g);for(l=qo(f+b);0<b.length&&l<=c;)f+=b,g=g.substr(b.length),b=zo(a,g),l=f+b,e&&(l=l.trim()),l=qo(l);e&&(b=b.trim());f+=b;for(c=Math.max(1,c-k);qo(f)>c&&1<f.length;)f=f.substr(0,f.length-1);
1392 f+=uo;var m=qo(f);a.Ab=m;wo(a,f,m);null!==d&&d.h(m,h)}}else{k=0;0===g.length&&(k=1,wo(a,g,0));for(;0<g.length;){b=zo(a,g);for(g=g.substr(b.length);qo(b)>c;){var n=1;l=qo(b.substr(0,n));for(m=0;l<=c;)n++,m=l,l=qo(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);wo(a,b.substr(0,n),p);k++;b=b.substr(n);if(a.ed+k>a.Ge)break}m=zo(a,g);for(l=qo(b+m);0<m.length&&l<=c;)b+=m,g=g.substr(m.length),m=zo(a,g),l=b+m,e&&(l=l.trim()),l=qo(l);e&&(b=b.trim());if(""!==b&&("\u00ad"===
1393 b[b.length-1]&&(b=b.substring(0,b.length-1)+"\u2010"),0===m.length?(n=l,f=Math.max(f,l)):(n=m=qo(b),f=Math.max(f,m)),wo(a,b,n),k++,a.ed+k>a.Ge))break}a.Me=Math.min(a.Ge,k);a.Ab=Math.max(a.Ab,f);null!==d&&d.h(a.Ab,h*a.Me)}}function zo(a,b){if(a.Lg===Ao)return b.substr(0,1);for(var c=b.length,d=0,e=Bo;d<c&&!e.test(b.charAt(d));)d++;for(a.Ei===Co&&(c=Math.min(c,d+1));d<c&&e.test(b.charAt(d));)d++;return d>=b.length?b:b.substr(0,d)}function qo(a){return null===ho?8*a.length:ho.measureText(a).width}
1394 function mo(a){if(null!==a.ye)return a.ye;var b=a.xe;if(null===ho){var c=16;return a.ye=c}void 0!==Do[b]&&5E3>Eo?c=Do[b]:(c=1.3*ho.measureText("M").width,Do[b]=c,Eo++);return a.ye=c}function to(a){if(null===ho)return 6;if(void 0!==Fo[a]&&5E3>Go)var b=Fo[a];else b=ho.measureText(uo).width,Fo[a]=b,Go++;return b}
1395 function ro(a,b){var c=a.$b.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),d=a.zf+a.Af;d=Math.max(0,mo(a)+d);if(0===c.length)return a.Ab=0,a.ed=1,d;if(!a.isMultiline){var e=c.indexOf("\n",0);0<=e&&(c=c.substr(0,e))}e=0;for(var f=a.ed=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.Lg!==yo){a.Me=0;var k=Fb.alloc();xo(a,f,b,k);e+=k.height;Fb.free(k);a.ed+=a.Me}else xo(a,f,b,null),e+=d,a.ed++;a.ed===a.Ge&&(h=!0)}f=g+1}return a.Hs=e}
1396 na.Object.defineProperties(ih.prototype,{font:{configurable:!0,get:function(){return this.xe},set:function(a){var b=this.xe;b!==a&&(F&&(A(a,"string",ih,"font"),lo(a)||v('Not a valid font: "'+a+'"')),this.xe=a,this.ye=null,this.u(),this.g("font",b,a))}},text:{configurable:!0,get:function(){return this.$b},set:function(a){var b=this.$b;null!==a&&void 0!==a?a=a.toString():a="";b!==a&&(this.$b=a,this.u(),this.g("text",b,a))}},textAlign:{configurable:!0,get:function(){return this.fj},
1397 set:function(a){var b=this.fj;b!==a&&(F&&A(a,"string",ih,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.fj=a,this.P(),this.g("textAlign",b,a)):F&&za(a,'"start", "end", "left", "right", or "center"',ih,"textAlign"))}},flip:{configurable:!0,get:function(){return this.Zd},set:function(a){var b=this.Zd;b!==a&&(gb(a,O,ih,"flip"),this.Zd=a,this.P(),this.g("flip",b,a))}},verticalAlignment:{configurable:!0,get:function(){return this.lj},set:function(a){var b=
1398 this.lj;b.A(a)||(F&&(w(a,N,ih,"verticalAlignment"),a.Sb()&&v("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a)),this.lj=a=a.K(),Xl(this),this.g("verticalAlignment",b,a))}},naturalBounds:{configurable:!0,get:function(){if(!this.wc.o()){var a=Fb.alloc();xo(this,this.$b,999999,a);var b=a.width;Fb.free(a);a=ro(this,b);var c=this.desiredSize;isNaN(c.width)||(b=c.width);isNaN(c.height)||(a=c.height);cc(this.wc,b,a)}return this.wc}},isMultiline:{configurable:!0,
1399 get:function(){return this.ak},set:function(a){var b=this.ak;b!==a&&(F&&A(a,"boolean",ih,"isMultiline"),this.ak=a,this.u(),this.g("isMultiline",b,a))}},isUnderline:{configurable:!0,get:function(){return this.Mi},set:function(a){var b=this.Mi;b!==a&&(F&&A(a,"boolean",ih,"isUnderline"),this.Mi=a,this.P(),this.g("isUnderline",b,a))}},isStrikethrough:{configurable:!0,get:function(){return this.Li},set:function(a){var b=this.Li;b!==a&&(F&&A(a,"boolean",ih,"isStrikethrough"),
1400 this.Li=a,this.P(),this.g("isStrikethrough",b,a))}},wrap:{configurable:!0,get:function(){return this.Lg},set:function(a){var b=this.Lg;b!==a&&(F&&gb(a,ih,ih,"wrap"),this.Lg=a,this.u(),this.g("wrap",b,a))}},overflow:{configurable:!0,get:function(){return this.yg},set:function(a){var b=this.yg;b!==a&&(F&&gb(a,ih,ih,"overflow"),this.yg=a,this.u(),this.g("overflow",b,a))}},stroke:{configurable:!0,get:function(){return this.Nc},set:function(a){var b=this.Nc;b!==
1401 a&&(null!==a&&km(a,"TextBlock.stroke"),a instanceof Ol&&a.freeze(),this.Nc=a,this.P(),this.g("stroke",b,a))}},lineCount:{configurable:!0,get:function(){return this.ed}},editable:{configurable:!0,get:function(){return this.jo},set:function(a){var b=this.jo;b!==a&&(F&&A(a,"boolean",ih,"editable"),this.jo=a,this.g("editable",b,a))}},textEditor:{configurable:!0,get:function(){return this.wq},set:function(a){var b=this.wq;b!==a&&(!F||a instanceof ef||v("TextBlock.textEditor must be an HTMLInfo."),
1402 this.wq=a,this.g("textEditor",b,a))}},errorFunction:{configurable:!0,get:function(){return this.rd},set:function(a){var b=this.rd;b!==a&&(null!==a&&A(a,"function",ih,"errorFunction"),this.rd=a,this.g("errorFunction",b,a))}},interval:{configurable:!0,get:function(){return this.de},set:function(a){var b=this.de;F&&C(a,ih,"interval");a=Math.round(a);if(b!==a&&0!==a&&isFinite(a)){this.de=a;this.u();var c=this.panel;null!==c&&(c.qh=null);this.g("interval",b,a)}}},graduatedStart:{configurable:!0,
1403 enumerable:!0,get:function(){return this.be},set:function(a){var b=this.be;F&&C(a,ih,"graduatedStart");b!==a&&(0>a?a=0:1<a&&(a=1),this.be=a,this.u(),this.g("graduatedStart",b,a))}},graduatedEnd:{configurable:!0,get:function(){return this.$d},set:function(a){var b=this.$d;F&&C(a,ih,"graduatedEnd");b!==a&&(0>a?a=0:1<a&&(a=1),this.$d=a,this.u(),this.g("graduatedEnd",b,a))}},graduatedFunction:{configurable:!0,get:function(){return this.Xj},set:function(a){var b=this.Xj;b!==
1404 a&&(null!==a&&A(a,"function",ih,"graduatedFunction"),this.Xj=a,this.u(),this.g("graduatedFunction",b,a))}},graduatedSkip:{configurable:!0,get:function(){return this.ae},set:function(a){var b=this.ae;b!==a&&(null!==a&&A(a,"function",ih,"graduatedSkip"),this.ae=a,this.u(),this.g("graduatedSkip",b,a))}},textValidation:{configurable:!0,get:function(){return this.gj},set:function(a){var b=this.gj;b!==a&&(null!==a&&A(a,"function",ih,"textValidation"),this.gj=a,this.g("textValidation",
1405 b,a))}},textEdited:{configurable:!0,get:function(){return this.vq},set:function(a){var b=this.vq;b!==a&&(null!==a&&A(a,"function",ih,"textEdited"),this.vq=a,this.g("textEdited",b,a))}},spacingAbove:{configurable:!0,get:function(){return this.zf},set:function(a){var b=this.zf;b!==a&&(F&&A(a,"number",ih,"spacingAbove"),this.zf=a,this.u(),this.g("spacingAbove",b,a))}},spacingBelow:{configurable:!0,get:function(){return this.Af},set:function(a){var b=this.Af;
1406 b!==a&&(F&&A(a,"number",ih,"spacingBelow"),this.Af=a,this.u(),this.g("spacingBelow",b,a))}},formatting:{configurable:!0,get:function(){return this.Ei},set:function(a){var b=this.Ei;b!==a&&(gb(a,ih,ih,"flip"),this.Ei=a,this.u(),this.g("formatting",b,a))}},maxLines:{configurable:!0,get:function(){return this.Ge},set:function(a){var b=this.Ge;b!==a&&(F&&A(a,"number",ih,"maxLines"),a=Math.floor(a),0>=a&&za(a,"> 0",ih,"maxLines"),this.Ge=a,this.u(),this.g("maxLines",b,a))}},
1407 metrics:{configurable:!0,get:function(){return{arrSize:null!==this.Wb?this.Wb:[this.Ab],arrText:null!==this.qb?this.qb:[this.we],maxLineWidth:this.Ab,fontHeight:this.ye}}},choices:{configurable:!0,get:function(){return this.Kn},set:function(a){var b=this.Kn;b!==a&&(F&&null!==a&&!Array.isArray(a)&&ya(a,"Array",ih,"choices:value"),this.Kn=a,this.g("choices",b,a))}}});
1408 var no=null,oo=null,yo=new E(ih,"None",0),vo=new E(ih,"WrapFit",1),jo=new E(ih,"WrapDesiredSize",2),Ao=new E(ih,"WrapBreakAll",3),io=new E(ih,"OverflowClip",0),so=new E(ih,"OverflowEllipsis",1),ko=new E(ih,"FormatTrim",0),Co=new E(ih,"FormatNone",0),Bo=/[ \u200b\u00ad]/,Do=new ib,Eo=0,Fo=new ib,Go=0,uo="...",po="",ho=null,go=!1;ih.className="TextBlock";ih.getEllipsis=function(){return uo};ih.setEllipsis=function(a){uo=a;Fo=new ib;Go=0};ih.getBaseline=function(){return no};
1409 ih.setBaseline=function(a){no=a};ih.getUnderline=function(){return oo};ih.setUnderline=function(a){oo=a};ih.isValidFont=lo;ih.None=yo;ih.WrapFit=vo;ih.WrapDesiredSize=jo;ih.WrapBreakAll=Ao;ih.OverflowClip=io;ih.OverflowEllipsis=so;function Ho(){this.Wb=[];this.qb=[]}Ho.prototype.reset=function(){this.Wb=[];this.qb=[]};Ho.prototype.vy=function(a){this.Wb=Ja(a.Wb);this.qb=Ja(a.qb)};Ho.className="TextBlockMetrics";
1410 function rk(){O.call(this);this.lh=null;this.nq="";this.Eh=vc;this.Ll=Bd;this.Ih=this.rd=null;this.Kl=Kc;this.Zd=zg;this.Am=null;this.Ho=!1;this.Gl=!0;this.am=!1;this.tm=null}ma(rk,O);rk.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.lh;a.nq=this.nq;a.Eh=this.Eh.K();a.Ll=this.Ll;a.Zd=this.Zd;a.rd=this.rd;a.Ih=this.Ih;a.Kl=this.Kl.K();a.Gl=this.Gl;a.tm=this.tm};
1411 rk.prototype.pb=function(a){a===zg||a===Og||a===sl?this.imageStretch=a:O.prototype.pb.call(this,a)};rk.prototype.toString=function(){return"Picture("+this.source+")#"+ob(this)};function Ti(a){void 0===a&&(a="");A(a,"string",rk,"clearCache:url");""!==a?Io[a]&&(delete Io[a],Jo--):(Io=new ib,Jo=0)}
1412 function Ko(a,b){b.wz||(b.qv=function(c){b.ys=!0;b.Eo=!1;var d=b.ih.copy();if(null!==d&&void 0!==d){for(d=d.iterator;d.next();){var e=d.value;var f=b.getAttribute("src");var g=e.Bg.J(f);if(null!==g)for(var h=g.length,k=0;k<h;k++)f=g[k],e.im.add(f),e.Jb(),b.vo&&(void 0===b.Bv&&(b.Bv=c),null!==f.Ih&&f.Ih(f,c))}b.ih=null}a.desiredSize.o()||(Dj(a,!1),a.u())},b.bv=function(a){b.Eo=a;var c=b.ih.copy();if(null!==c&&void 0!==c){for(c=c.iterator;c.next();){var e=c.value,f=b.getAttribute("src");var g=e.Bg.J(f);
1413 if(null!==g){e=g.length;f=Ma();for(var h=0;h<e;h++)f.push(g[h]);if(b.vo)for(h=0;h<e;h++)g=f[h],null!==g.rd&&g.rd(g,a);Oa(f)}}b.ih=null}},b.addEventListener("load",b.qv),b.addEventListener("error",b.bv),b.wz=!0)}function tk(a){a.removeEventListener("load",a.qv);a.removeEventListener("error",a.bv);delete a.qv;delete a.bv}rk.prototype.jB=function(){if(""!==this.source){Ti(this.source);var a=this.source;this.source="";this.source=a}};rk.prototype.redraw=function(){this.P()};
1414 rk.prototype.pj=function(a,b){var c=this.lh;if(null!==c){var d=c.getAttribute("src");if(!(c instanceof HTMLImageElement&&(null===d||""===d)||c.Eo instanceof Event&&a instanceof Sl)){d=this.naturalBounds;var e=0,f=0,g=this.Ho,h=g?+c.width:c.naturalWidth;g=g?+c.height:c.naturalHeight;void 0===h&&c.videoWidth&&(h=c.videoWidth);void 0===g&&c.videoHeight&&(g=c.videoHeight);h=h||d.width;g=g||d.height;if(0!==h&&0!==g){var k=h,l=g;this.sourceRect.o()&&(e=this.Eh.x,f=this.Eh.y,h=this.Eh.width,g=this.Eh.height);
1415 var m=h,n=g,p=this.Ll,r=this.Kl;switch(p){case zg:if(this.sourceRect.o())break;m>=d.width&&(e=e+r.offsetX+(m*r.x-d.width*r.x));n>=d.height&&(f=f+r.offsetY+(n*r.y-d.height*r.y));h=Math.min(d.width,m);g=Math.min(d.height,n);break;case Bd:m=d.width;n=d.height;break;case Og:case sl:p===Og?(p=Math.min(d.height/n,d.width/m),m*=p,n*=p):p===sl&&(p=Math.max(d.height/n,d.width/m),m*=p,n*=p,m>=d.width&&(e=(e+r.offsetX+(m*r.x-d.width*r.x)/m)*h),n>=d.height&&(f=(f+r.offsetY+(n*r.y-d.height*r.y)/n)*g),h*=1/(m/
1416 d.width),g*=1/(n/d.height),m=d.width,n=d.height)}p=this.Mf()*b.scale;var q=m*p*n*p,u=h*g/q,y=c.__goCache;p=null;var x=Lo;if(c.ys&&void 0!==y&&4<q&&u>x*x)for(null===y.nj&&(Mo(y,4,k,l,c),Mo(y,16,k,l,c)),k=y.nj,l=k.length,q=0;q<l;q++)if(k[q].ratio*k[q].ratio<u)p=k[q];else break;if(!b.Dl){if(null===this.Am)if(null===this.lh)this.Am=!1;else{k=(new Vk(null)).context;k.drawImage(this.lh,0,0);try{k.getImageData(0,0,1,1).data[3]&&(this.Am=!1),this.Am=!1}catch(z){this.Am=!0}}if(this.Am)return}k=0;m<d.width&&
1417 (k=r.offsetX+(d.width*r.x-m*r.x));l=0;n<d.height&&(l=r.offsetY+(d.height*r.y-n*r.y));switch(this.flip){case ul:a.translate(Math.min(d.width,m),0);a.scale(-1,1);break;case tl:a.translate(0,Math.min(d.height,n));a.scale(1,-1);break;case vl:a.translate(Math.min(d.width,m),Math.min(d.height,n)),a.scale(-1,-1)}if(b.Xe("pictureRatioOptimization")&&!b.Ji&&void 0!==y&&null!==p&&1!==p.ratio){a.save();b=p.ratio;try{a.drawImage(p.source,e/b,f/b,Math.min(p.source.width,h/b),Math.min(p.source.height,g/b),k,l,
1418 Math.min(d.width,m),Math.min(d.height,n))}catch(z){F&&this.Gl&&Ea(z.toString()),this.Gl=!1}a.restore()}else try{a.drawImage(c,e,f,h,g,k,l,Math.min(d.width,m),Math.min(d.height,n))}catch(z){F&&this.Gl&&Ea(z.toString()),this.Gl=!1}switch(this.flip){case ul:a.scale(-1,1);a.translate(-Math.min(d.width,m),0);break;case tl:a.scale(1,-1);a.translate(0,-Math.min(d.height,n));break;case vl:a.scale(-1,-1),a.translate(-Math.min(d.width,m),-Math.min(d.height,n))}}}}};
1419 rk.prototype.Vm=function(a,b,c,d){var e=this.desiredSize,f=Fl(this,!0),g=this.lh,h=this.Ho;if(h||!this.am&&g&&g.complete)this.am=!0;null===g&&(isFinite(e.width)||(a=0),isFinite(e.height)||(b=0));isFinite(e.width)||f===Bd||f===ql?(isFinite(a)||(a=this.sourceRect.o()?this.sourceRect.width:h?+g.width:g.naturalWidth),c=0):null!==g&&!1!==this.am&&(a=this.sourceRect.o()?this.sourceRect.width:h?+g.width:g.naturalWidth);isFinite(e.height)||f===Bd||f===rl?(isFinite(b)||(b=this.sourceRect.o()?this.sourceRect.height:
1420 h?+g.height:g.naturalHeight),d=0):null!==g&&!1!==this.am&&(b=this.sourceRect.o()?this.sourceRect.height:h?+g.height:g.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.maxSize;f=this.minSize;c=Math.max(c,f.width);d=Math.max(d,f.height);a=Math.min(e.width,a);b=Math.min(e.height,b);a=Math.max(c,a);b=Math.max(d,b);null===g||g.complete||(isFinite(a)||(a=0),isFinite(b)||(b=0));cc(this.wc,a,b);Cl(this,0,0,a,b)};rk.prototype.Th=function(a,b,c,d){Hl(this,a,b,c,d)};
1421 na.Object.defineProperties(rk.prototype,{element:{configurable:!0,get:function(){return this.lh},set:function(a){var b=this.lh;if(b!==a){this.Ho=a instanceof HTMLCanvasElement;var c=a instanceof HTMLImageElement;b instanceof HTMLImageElement&&tk(b);null===a||c||a instanceof HTMLVideoElement||this.Ho||v("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);var d=this.diagram;null!==d&&sk(d,this);this.lh=a;null!==a&&c&&void 0===a.ih&&(a.ih=new I);null!==d&&c&&qk(d,
1422 this);null!==a&&(this.Ho||!0===a.complete?(a.vo&&(a.Eo instanceof Event&&null!==this.rd?this.rd(this,a.Eo):!0===a.ys&&!a.Eo&&null!==this.Ih&&a.Bv&&this.Ih(this,a.Bv)),a.ys=!0,this.desiredSize.o()||(Dj(this,!1),this.u())):c&&Ko(this,a));this.g("element",b,a);this.P()}}},source:{configurable:!0,get:function(){return this.nq},set:function(a){var b=this.nq;if(b!==a){A(a,"string",rk,"source");this.nq=a;var c=Io;if(gh){var d=null;if(void 0!==c[a])d=c[a];else if(""!==a){30<Jo&&(Ti(),c=Io);
1423 d=ua("img");d.vo=!0;Ko(this,d);var e=this.tm;null!==e&&(d.crossOrigin=e(this));d.src=a;c[a]=d;Jo++}this.element=d;null!==d&&void 0===d.__goCache&&(d.__goCache=new No);this.u();this.P()}this.g("source",b,a)}}},sourceCrossOrigin:{configurable:!0,get:function(){return this.tm},set:function(a){if(this.tm!==a&&(null!==a&&A(a,"function",rk,"sourceCrossOrigin"),this.tm=a,null!==this.element)){var b=this.element.getAttribute("src");null===a&&"string"===typeof b?this.element.crossOrigin=null:
1424 null!==a&&(this.element.crossOrigin=a(this));this.element.src=b}}},sourceRect:{configurable:!0,get:function(){return this.Eh},set:function(a){var b=this.Eh;b.A(a)||(w(a,L,rk,"sourceRect"),this.Eh=a=a.K(),this.P(),this.g("sourceRect",b,a))}},imageStretch:{configurable:!0,get:function(){return this.Ll},set:function(a){var b=this.Ll;b!==a&&(gb(a,O,rk,"imageStretch"),this.Ll=a,this.P(),this.g("imageStretch",b,a))}},flip:{configurable:!0,get:function(){return this.Zd},
1425 set:function(a){var b=this.Zd;b!==a&&(gb(a,O,rk,"flip"),this.Zd=a,this.P(),this.g("flip",b,a))}},imageAlignment:{configurable:!0,get:function(){return this.Kl},set:function(a){w(a,N,rk,"imageAlignment");var b=this.Kl;b.A(a)||(this.Kl=a=a.K(),this.P(),this.g("imageAlignment",b,a))}},errorFunction:{configurable:!0,get:function(){return this.rd},set:function(a){var b=this.rd;b!==a&&(null!==a&&A(a,"function",rk,"errorFunction"),this.rd=a,this.g("errorFunction",b,a))}},successFunction:{configurable:!0,
1426 enumerable:!0,get:function(){return this.Ih},set:function(a){var b=this.Ih;b!==a&&(null!==a&&A(a,"function",rk,"successFunction"),this.Ih=a,this.g("successFunction",b,a))}},naturalBounds:{configurable:!0,get:function(){return this.wc}}});rk.prototype.redraw=rk.prototype.redraw;rk.prototype.reloadSource=rk.prototype.jB;var Io=null,Jo=0,Lo=4;rk.className="Picture";Io=new ib;rk.clearCache=Ti;function No(){this.nj=null}
1427 function Mo(a,b,c,d,e){null===a.nj&&(a.nj=[]);var f=new Vk(null),g=f.context,h=1/b;f.width=c/b;f.height=d/b;0!==f.width&&0!==f.height&&(b=new Oo(f.Oa,b),c=1,0<a.nj.length&&(c=a.nj[a.nj.length-1],e=c.source,c=c.ratio),g.setTransform(h*c,0,0,h*c,0,0),g.drawImage(e,0,0),a.nj.push(b))}No.className="PictureCacheArray";function Oo(a,b){this.source=a;this.ratio=b}Oo.className="PictureCacheInstance";function Po(){this.Xt=new zd;this.oc=null}
1428 Po.prototype.reset=function(a){null!==a?(a.ka(),this.Xt=a,a.figures.clear()):this.Xt=new zd;this.oc=null};function Pd(a,b,c,d,e){a.oc=new ve;a.oc.startX=b;a.oc.startY=c;a.oc.isFilled=d;a.Xt.figures.add(a.oc);void 0!==e&&(a.oc.isShadowed=e)}function Wd(a){var b=a.oc.segments.length;0<b&&a.oc.segments.M(b-1).close()}Po.prototype.mn=function(a){this.oc.isShadowed=a};Po.prototype.moveTo=function(a,b,c){void 0===c&&(c=!1);var d=new we(ke);d.endX=a;d.endY=b;c&&d.close();this.oc.segments.add(d)};
1429 Po.prototype.lineTo=function(a,b,c){void 0===c&&(c=!1);var d=new we(Id);d.endX=a;d.endY=b;c&&d.close();this.oc.segments.add(d)};function Td(a,b,c,d,e,f,g){var h;void 0===h&&(h=!1);var k=new we(le);k.point1X=b;k.point1Y=c;k.point2X=d;k.point2Y=e;k.endX=f;k.endY=g;h&&k.close();a.oc.segments.add(k)}function Ud(a,b,c,d,e){var f;void 0===f&&(f=!1);var g=new we(me);g.point1X=b;g.point1Y=c;g.endX=d;g.endY=e;f&&g.close();a.oc.segments.add(g)}
1430 Po.prototype.arcTo=function(a,b,c,d,e,f,g){void 0===f&&(f=0);void 0===g&&(g=!1);var h=new we(ne);h.startAngle=a;h.sweepAngle=b;h.centerX=c;h.centerY=d;h.radiusX=e;h.radiusY=0!==f?f:e;g&&h.close();this.oc.segments.add(h)};function Vd(a,b,c,d,e,f,g,h){var k;void 0===k&&(k=!1);b=new we(oe,g,h,b,c,d,e,f);k&&b.close();a.oc.segments.add(b)}function Od(a){var b=Xd;if(null!==b)return Xd=null,b.reset(a),b;b=new Po;b.reset(a);return b}var Xd=null;Po.className="StreamGeometryContext";
1431 function Qo(a,b){var c=a.toLowerCase(),d=K.qe;d[a]=b;d[c]=a}Qo("Rectangle",function(a,b,c){a="r"+b+","+c;var d=K.ei[a];if(void 0!==d)return d;d=new zd(Kd);d.endX=b;d.endY=c;50>K.fi&&(K.ei[a]=d,K.fi++);return d});Qo("Square",function(a,b,c){a="s"+b+","+c;var d=K.ei[a];if(void 0!==d)return d;d=new zd(Kd);d.endX=b;d.endY=c;d.defaultStretch=Og;50>K.fi&&(K.ei[a]=d,K.fi++);return d});
1432 Qo("RoundedRectangle",function(a,b,c){var d=a?a.parameter1:NaN;if(isNaN(d)||0>d)d=5;d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*K.Wg;b=(new zd).add((new ve(d,0,!0)).add(new we(Id,b-d,0)).add(new we(le,b,d,b-a,0,b,a)).add(new we(Id,b,c-d)).add(new we(le,b-d,c,b,c-a,b-a,c)).add(new we(Id,d,c)).add(new we(le,0,c-d,a,c,0,c-a)).add(new we(Id,0,d)).add((new we(le,d,0,0,a,a,0)).close()));1<a&&(b.spot1=new N(0,0,a,a),b.spot2=new N(1,1,-a,-a));return b});Qo("Border","RoundedRectangle");
1433 Qo("Ellipse",function(a,b,c){a="e"+b+","+c;var d=K.ei[a];if(void 0!==d)return d;d=new zd(Ld);d.endX=b;d.endY=c;d.spot1=qd;d.spot2=rd;50>K.fi&&(K.ei[a]=d,K.fi++);return d});Qo("Circle",function(a,b,c){a="c"+b+","+c;var d=K.ei[a];if(void 0!==d)return d;d=new zd(Ld);d.endX=b;d.endY=c;d.spot1=qd;d.spot2=rd;d.defaultStretch=Og;50>K.fi&&(K.ei[a]=d,K.fi++);return d});Qo("TriangleRight",function(a,b,c){return(new zd).add((new ve(0,0)).add(new we(Id,b,.5*c)).add((new we(Id,0,c)).close())).nn(0,.25,.5,.75)});
1434 Qo("TriangleDown",function(a,b,c){return(new zd).add((new ve(0,0)).add(new we(Id,b,0)).add((new we(Id,.5*b,c)).close())).nn(.25,0,.75,.5)});Qo("TriangleLeft",function(a,b,c){return(new zd).add((new ve(b,c)).add(new we(Id,0,.5*c)).add((new we(Id,b,0)).close())).nn(.5,.25,1,.75)});Qo("TriangleUp",function(a,b,c){return(new zd).add((new ve(b,c)).add(new we(Id,0,c)).add((new we(Id,.5*b,0)).close())).nn(.25,.5,.75,1)});Qo("Triangle","TriangleUp");
1435 Qo("Diamond",function(a,b,c){return(new zd).add((new ve(.5*b,0)).add(new we(Id,0,.5*c)).add(new we(Id,.5*b,c)).add((new we(Id,b,.5*c)).close())).nn(.25,.25,.75,.75)});Qo("LineH",function(a,b,c){a=new zd(Gd);a.startX=0;a.startY=c/2;a.endX=b;a.endY=c/2;return a});Qo("LineV",function(a,b,c){a=new zd(Gd);a.startX=b/2;a.startY=0;a.endX=b/2;a.endY=c;return a});Qo("None","Rectangle");Qo("BarH","Rectangle");Qo("BarV","Rectangle");Qo("MinusLine","LineH");
1436 Qo("PlusLine",function(a,b,c){return(new zd).add((new ve(0,c/2,!1)).add(new we(Id,b,c/2)).add(new we(ke,b/2,0)).add(new we(Id,b/2,c)))});Qo("XLine",function(a,b,c){return(new zd).add((new ve(0,c,!1)).add(new we(Id,b,0)).add(new we(ke,0,0)).add(new we(Id,b,c)))});
1437 K.rn={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
1438 BackwardOpenTriangleLine:"m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",
1439 BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
1440 TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
1441 BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
1442 DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
1443 TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",
1444 OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
1445 OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};
1446 function U(a){W.call(this,a);this.F=2408959;this.uh=this.Zf="";this.Tp=this.Pp=this.eq=this.Uo=null;this.gq="";this.Xf=this.Fo=this.fq=this.Dh=null;this.Rp="";this.Qp=Zb;this.$b=this.Up="";this.Qi=this.Nn=this.yi=null;this.pg=(new J(NaN,NaN)).freeze();this.ap="";this.qf=null;this.bp=Ec;this.Vp=fd;this.lp=Nb;this.cp=Ob;this.fo=null;this.Vo=127;this.kq=Pb;this.jq="gray";this.Gg=4;this.Ox=-1;this.Gq=NaN;this.vz=new L;this.ik=null;this.wh=NaN}ma(U,W);
1447 U.prototype.cloneProtected=function(a){W.prototype.cloneProtected.call(this,a);a.F=this.F&-4097|49152;a.Zf=this.Zf;a.uh=this.uh;a.Uo=this.Uo;a.eq=this.eq;a.Pp=this.Pp;a.Tp=this.Tp;a.gq=this.gq;a.fq=this.fq;a.Fo=this.Fo;a.Xf=null;a.Rp=this.Rp;a.Qp=this.Qp.K();a.Up=this.Up;a.Vp=this.Vp.K();a.$b=this.$b;a.Nn=this.Nn;a.pg.assign(this.pg);a.ap=this.ap;a.bp=this.bp.K();a.lp=this.lp.K();a.cp=this.cp.K();a.fo=this.fo;a.Vo=this.Vo;a.kq=this.kq.K();a.jq=this.jq;a.Gg=this.Gg;a.Gq=this.Gq};
1448 U.prototype.Kf=function(a){W.prototype.Kf.call(this,a);a.Zh();a.Dh=null;a.qf=null;a.ik=null};U.prototype.toString=function(){var a=Pa(this.constructor)+"#"+ob(this);null!==this.data&&(a+="("+Qa(this.data)+")");return a};U.prototype.cl=function(a,b,c,d,e,f,g){var h=this.diagram;null!==h&&(a===Le&&"elements"===b?e instanceof W?Vj(e,function(a){Xj(h.partManager,a);Wj(h,a)}):qk(h,e):a===Me&&"elements"===b&&(e instanceof W?Vj(e,function(a){ak(h.partManager,a,h)}):sk(h,e)),h.ab(a,b,c,d,e,f,g))};
1449 U.prototype.Ia=function(a){W.prototype.Ia.call(this,a);if(null!==this.data){for(var b=this.$.j,c=b.length,d=0;d<c;d++){var e=b[d];e instanceof W&&Vj(e,function(a){null!==a.data&&a.Ia()})}for(b=this.adornments;b.next();)b.value.Ia(a)}};U.prototype.updateRelationshipsFromData=function(){null!==this.data&&this.diagram.partManager.updateRelationshipsFromData(this)};U.prototype.Ik=function(a){F&&A(a,"string",U,"findAdornment:category");var b=this.Xf;return null===b?null:b.J(a)};
1450 U.prototype.Rh=function(a,b){if(null!==b){F&&(A(a,"string",U,"addAdornment:category"),w(b,Ve,U,"addAdornment:ad"));var c=null,d=this.Xf;null!==d&&(c=d.J(a));if(c!==b){if(null!==c){var e=c.diagram;null!==e&&e.remove(c)}null===d&&(this.Xf=d=new Bb);b.Zf!==a&&(b.category=a);d.add(a,b);a=this.diagram;null!==a&&(a.add(b),a=b.adornedObject,null!==a&&(a=a.tj(),null!==a&&(b.data=a.data)))}}};
1451 U.prototype.Tf=function(a){F&&A(a,"string",U,"removeAdornment:category");var b=this.Xf;if(null!==b){var c=b.J(a);if(null!==c){var d=c.diagram;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.Xf=null)}};U.prototype.Ak=function(){var a=this.Xf;if(null!==a){var b=Ma();for(a=a.iterator;a.next();)b.push(a.key);a=b.length;for(var c=0;c<a;c++)this.Tf(b[c]);Oa(b)}};
1452 U.prototype.updateAdornments=function(){var a=this.diagram;if(null!==a){for(var b=this.adornments;b.next();){var c=b.value;c.u();c.placeholder&&c.placeholder.u()}a:{if(this.isSelected&&this.selectionAdorned&&(b=this.selectionObject,null!==b&&this.actualBounds.o()&&this.isVisible()&&b.Sf()&&b.actualBounds.o())){c=this.Ik("Selection");if(null===c){c=this.selectionAdornmentTemplate;null===c&&(c=this.$h()?a.linkSelectionAdornmentTemplate:this instanceof If?a.groupSelectionAdornmentTemplate:a.nodeSelectionAdornmentTemplate);
1453 if(!(c instanceof Ve))break a;yg(c);c=c.copy();null!==c&&(this.$h()&&this.selectionObject===this.path&&(c.type=W.Link),c.adornedObject=b)}if(null!==c){c.type===W.Link&&c.u();this.Rh("Selection",c);break a}}this.Tf("Selection")}Ro(this,a);for(b=this.adornments;b.next();)b.value.Ia()}};U.prototype.Rb=function(){var a=this.diagram;null!==a&&(ij(a),0!==(this.F&16384)!==!0&&(this.F|=16384,a.Jb()))};function yi(a){0!==(a.F&16384)!==!1&&(a.updateAdornments(),a.F&=-16385)}
1454 function Ro(a,b){b.toolManager.mouseDownTools.each(function(b){b.isEnabled&&b.updateAdornments(a)});b.toolManager.updateAdornments(a)}function So(a){if(!1===Kj(a)){To(a,!0);a.Sl();var b=a.diagram;null!==b&&(b.Cd.add(a),b.Jb())}}function Uo(a){a.F|=2097152;if(!1!==Kj(a)){var b=a.position,c=a.location;c.o()&&b.o()||Vo(a,b,c);c=a.Cb;var d=L.alloc().assign(c);c.ka();c.x=b.x;c.y=b.y;c.freeze();a.Wm(d,c);L.free(d);To(a,!1)}}U.prototype.move=function(a,b){!0===b?this.location=a:this.position=a};
1455 U.prototype.moveTo=function(a,b,c){a=J.allocAt(a,b);this.move(a,c);J.free(a)};U.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a){if(!a.visible)return!1;a=a.diagram;if(null!==a&&a.animationManager.pu(this))return!0}a=this.containingGroup;return null===a||a.isSubGraphExpanded&&a.isVisible()?!0:!1};t=U.prototype;t.Ub=function(a){var b=this.diagram;a?(this.D(4),this.Rb(),null!==b&&b.Cd.add(this)):(this.D(8),this.Ak());this.Zh();null!==b&&(b.Ta(),b.P())};
1456 t.ib=function(a){if(this.name===a)return this;var b=this.ik;null===b&&(this.ik=b=new Bb);if(null!==b.J(a))return b.J(a);var c=W.prototype.ib.call(this,a);if(null!==c)return b.set(a,c),c;b.set(a,null);return null};t.Pf=function(a,b,c){void 0===c&&(c=new J);b=b.Sb()?Kc:b;var d=a.naturalBounds;c.h(d.width*b.x+b.offsetX,d.height*b.y+b.offsetY);if(null===a||a===this)return c;a.transform.Aa(c);for(a=a.panel;null!==a&&a!==this;)a.transform.Aa(c),a=a.panel;this.og.Aa(c);c.offset(-this.vc.x,-this.vc.y);return c};
1457 t.xj=function(a){void 0===a&&(a=new L);return a.assign(this.actualBounds)};t.Ya=function(){!0===Ij(this)&&this.measure(Infinity,Infinity);this.arrange()};function Tj(a,b){var c=a.vz;isNaN(a.wh)&&(a.wh=An(a));var d=a.wh;var e=2*d;if(!a.isShadowed)return c.h(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;e=b.y;var f=b.width;b=b.height;var g=a.shadowBlur;a=a.shadowOffset;f+=g;b+=g;d-=g/2;e-=g/2;0<a.x?f+=a.x:(d+=a.x,f-=a.x);0<a.y?b+=a.y:(e+=a.y,b-=a.y);c.h(d-1,e-1,f+2,b+2);return c}
1458 U.prototype.arrange=function(){if(!1===Jj(this))Uo(this);else{Gl(this,!1);var a=this.Cb,b=L.alloc();b.assign(a);var c=wg(this);this.Th(0,0,this.vc.width,this.vc.height);var d=this.position;Vo(this,d,this.location);a.ka();a.x=d.x;a.y=d.y;a.freeze();this.Wm(b,a);b.A(a)?this.Td(c):!this.Tc()||K.B(b.width,a.width)&&K.B(b.height,a.height)||0<=this.Ox&&this.D(16);L.free(b);To(this,!1)}};t=U.prototype;
1459 t.Wm=function(a,b){var c=this.diagram;if(null!==c){var d=!1;if(!1===c.Gi&&a.o()){var e=L.alloc();e.assign(c.documentBounds);e.Xw(c.padding);a.x>e.x&&a.y>e.y&&a.right<e.right&&a.bottom<e.bottom&&b.x>e.x&&b.y>e.y&&b.right<e.right&&b.bottom<e.bottom&&(d=!0);L.free(e)}0!==(this.F&65536)!==!0&&a.A(b)||Yj(this,d,c);c.P();!a.o()&&!b.o()||fc(a,b)||(this instanceof V&&!c.undoManager.isUndoingRedoing&&this.yd(),this.Zh())}};
1460 t.Sw=function(a,b){if(this.$h()||!a.o())return!1;var c=this.diagram;null!==c&&Wo(this,c,a,b);this.ra=a;this.F&=-2097153;var d=this.pg;!d.o()||null!==c&&!c.animationManager.isTicking&&c.undoManager.isUndoingRedoing||(c=d.copy(),d.h(d.x+(a.x-b.x),d.y+(a.y-b.y)),this.g("location",c,d.copy()));!1===Kj(this)&&!1===Jj(this)&&(So(this),Uo(this));return!0};function Wo(a,b,c,d){null===b||a instanceof Ve||(b=b.animationManager,b.sf&&ai(b,a,d.copy(),c.copy()))}
1461 t.tr=function(a,b,c){var d=this.pg,e=this.ra;if(c){if(d.x===a&&d.y===b)return;Kj(this)||Jj(this)?e.h(NaN,NaN):e.h(e.x+a-d.x,e.y+b-d.y);d.h(a,b)}else{if(e.x===a&&e.y===b)return;Kj(this)||Jj(this)?this.yu():d.h(d.x+a-e.x,d.y+b-e.y);e.h(a,b)}So(this)};t.yu=function(){this.F&=-2097153;So(this)};
1462 function Vo(a,b,c){var d=J.alloc(),e=a.locationSpot,f=a.locationObject;e.Sb()&&v("determineOffset: Part's locationSpot must be real: "+e.toString());var g=f.naturalBounds,h=f instanceof Uf?f.strokeWidth:0;d.el(0,0,g.width+h,g.height+h,e);if(f!==a)for(d.offset(-h/2,-h/2),f.transform.Aa(d),e=f.panel;null!==e&&e!==a;)e.transform.Aa(d),e=e.panel;a.og.Aa(d);d.offset(-a.vc.x,-a.vc.y);e=a.diagram;f=c.o();g=b.o();f&&g?0!==(a.F&2097152)?Xo(a,b,c,e,d):Yo(a,b,c,e,d):f?Xo(a,b,c,e,d):g&&Yo(a,b,c,e,d);a.F|=2097152;
1463 J.free(d);a.Sl()}function Xo(a,b,c,d,e){var f=b.x,g=b.y;b.h(c.x-e.x,c.y-e.y);null!==d&&(c=d.animationManager,(d=c.defaultAnimation.isAnimating)||!c.sf||a instanceof Ve||ai(c,a,new J(f,g),b),d||b.x===f&&b.y===g||a.g("position",new J(f,g),b.copy()))}function Yo(a,b,c,d,e){var f=c.copy();c.h(b.x+e.x,b.y+e.y);c.A(f)||null===d||a.g("location",f,c.copy())}
1464 function Yj(a,b,c){Il(a,!1);a instanceof V&&Qk(c,a);a.layer.isTemporary||b||c.Ta();b=a.Cb;var d=c.viewportBounds;d.o()?wg(a)?(jc(b,d)||a.Td(!1),a.updateAdornments()):b.Sc(d)?(a.Td(!0),a.updateAdornments()):a.Rb():c.Ii=!0}t.Dj=function(){return!0};t.Tc=function(){return!0};t.$h=function(){return!1};t.Rf=function(){return!0};
1465 function Zo(a,b,c,d){b.constructor===a.constructor||$o||($o=!0,Ea('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),Ea(" Old class: "+Pa(a.constructor)+", new class: "+Pa(b.constructor)+", part: "+a.toString()));a.Ak();var e=a.data;c=a.layerName;var f=a.isSelected,g=a.isHighlighted,h=!0,k=!0,l=!1;a instanceof V&&(h=a.isTreeLeaf,k=a.isTreeExpanded,l=a.wasTreeExpanded);b.Kf(a);b.cloneProtected(a);a.Zf=d;a.u();a.P();b=a.diagram;d=!0;null!==b&&(d=b.skipsUndoManager,
1466 b.skipsUndoManager=!0);a.tb=e;a.F=f?a.F|4096:a.F&-4097;a.F=g?a.F|524288:a.F&-524289;a instanceof V&&(a.T=h?a.T|4:a.T&-5,a.T=k?a.T|1:a.T&-2,a.T=l?a.T|2:a.T&-3);null!==e&&a.Ia();e=a.layerName;e!==c&&(a.uh=c,a.layerName=e);null!==b&&(b.skipsUndoManager=d);a.Tc()&&a.D(64)}U.prototype.canCopy=function(){if(!this.copyable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowCopy)return!1;a=a.diagram;return null===a?!0:a.allowCopy?!0:!1};
1467 U.prototype.canDelete=function(){if(!this.deletable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowDelete)return!1;a=a.diagram;return null===a?!0:a.allowDelete?!0:!1};U.prototype.canEdit=function(){if(!this.textEditable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowTextEdit)return!1;a=a.diagram;return null===a?!0:a.allowTextEdit?!0:!1};
1468 U.prototype.canGroup=function(){if(!this.groupable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowGroup)return!1;a=a.diagram;return null===a?!0:a.allowGroup?!0:!1};U.prototype.canMove=function(){if(!this.movable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowMove)return!1;a=a.diagram;return null===a?!0:a.allowMove?!0:!1};
1469 U.prototype.canReshape=function(){if(!this.reshapable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowReshape)return!1;a=a.diagram;return null===a?!0:a.allowReshape?!0:!1};U.prototype.canResize=function(){if(!this.resizable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowResize)return!1;a=a.diagram;return null===a?!0:a.allowResize?!0:!1};
1470 U.prototype.canRotate=function(){if(!this.rotatable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowRotate)return!1;a=a.diagram;return null===a?!0:a.allowRotate?!0:!1};U.prototype.canSelect=function(){if(!this.selectable)return!1;var a=this.layer;if(null===a)return!0;if(!a.allowSelect)return!1;a=a.diagram;return null===a?!0:a.allowSelect?!0:!1};function Kj(a){return 0!==(a.F&32768)}function To(a,b){a.F=b?a.F|32768:a.F&-32769}function Il(a,b){a.F=b?a.F|65536:a.F&-65537}
1471 function wg(a){return 0!==(a.F&131072)}t=U.prototype;t.Td=function(a){this.F=a?this.F|131072:this.F&-131073};function ap(a,b){a.F=b?a.F|1048576:a.F&-1048577}t.Zh=function(){var a=this.containingGroup;null!==a&&(a.u(),null!==a.placeholder&&a.placeholder.u(),a.yd())};t.P=function(){var a=this.diagram;null!==a&&!Jj(this)&&!Kj(this)&&this.isVisible()&&this.Cb.o()&&a.P(Tj(this,this.Cb))};
1472 t.u=function(){W.prototype.u.call(this);var a=this.diagram;null!==a&&(a.Cd.add(this),this instanceof V&&null!==this.labeledLink&&Xl(this.labeledLink),a.Jb(!0))};t.Zq=function(a){a||(a=this.yi,null!==a&&bp(a,this))};t.$q=function(a){a||(a=this.yi,null!==a&&cp(a,this))};t.Gk=function(){var a=this.data;if(null!==a){var b=this.diagram;null!==b&&(b=b.model,null!==b&&b.an(a))}};t.vA=function(){return dp(this,this)};
1473 function dp(a,b){var c=b.containingGroup;return null!==c?1+dp(a,c):b instanceof V&&(b=b.labeledLink,null!==b)?dp(a,b):0}t.yA=function(){return ep(this,this)};function ep(a,b){var c=b.containingGroup;return null!==c||b instanceof V&&(c=b.labeledLink,null!==c)?ep(a,c):b}t.Qd=function(a){return a instanceof If?fp(this,this,a):!1};function fp(a,b,c){if(b===c||null===c)return!1;var d=b.containingGroup;return null===d||d!==c&&!fp(a,d,c)?b instanceof V&&(b=b.labeledLink,null!==b)?fp(a,b,c):!1:!0}
1474 t.Ey=function(a){if(null===a)return null;F&&w(a,U,U,"findCommonContainingGroup:other");if(this===a)return this.containingGroup;for(var b=this;null!==b;){b instanceof If&&ap(b,!0);if(b instanceof V){var c=b.labeledLink;null!==c&&(b=c)}b=b.containingGroup}c=null;for(b=a;null!==b;){if(0!==(b.F&1048576)){c=b;break}b instanceof V&&(a=b.labeledLink,null!==a&&(b=a));b=b.containingGroup}for(b=this;null!==b;)b instanceof If&&ap(b,!1),b instanceof V&&(a=b.labeledLink,null!==a&&(b=a)),b=b.containingGroup;return c};
1475 U.prototype.canLayout=function(){if(!this.isLayoutPositioned||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.isTemporary||this instanceof V&&this.isLinkLabel?!1:!0};
1476 U.prototype.D=function(a){void 0===a&&(a=16777215);if(this.isLayoutPositioned&&0!==(a&this.layoutConditions)){var b=this.layer;null!==b&&b.isTemporary||this instanceof V&&this.isLinkLabel?b=!1:(b=this.diagram,b=null!==b&&b.undoManager.isUndoingRedoing?!1:!0)}else b=!1;if(b)if(b=this.yi,null!==b){var c=b.layout;null!==c?c.D():b.D(a)}else a=this.diagram,null!==a&&(a=a.layout,null!==a&&a.D())};function Zj(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.isTemporary?!1:!0}
1477 function ml(a,b,c,d,e,f){void 0===f&&(f=null);if(!(a.contains(b)||null!==f&&!f(b)||b instanceof Ve))if(a.add(b),b instanceof V){if(c&&b instanceof If)for(var g=b.memberParts;g.next();)ml(a,g.value,c,d,e,f);if(!1!==e)for(g=b.linksConnected;g.next();){var h=g.value;if(!a.contains(h)){var k=h.fromNode,l=h.toNode;k=null===k||a.contains(k);l=null===l||a.contains(l);(e?k&&l:k||l)&&ml(a,h,c,d,e,f)}}if(1<d)for(b=b.kw();b.next();)ml(a,b.value,c,d-1,e,f)}else if(b instanceof S)for(b=b.labelNodes;b.next();)ml(a,
1478 b.value,c,d,e,f)}
1479 na.Object.defineProperties(U.prototype,{key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a)return a.model.pa(this.data)}},adornments:{configurable:!0,get:function(){return null===this.Xf?kb:this.Xf.iteratorValues}},layer:{configurable:!0,get:function(){return this.Qi}},diagram:{configurable:!0,get:function(){var a=this.Qi;return null!==a?a.diagram:null}},layerName:{configurable:!0,get:function(){return this.uh},set:function(a){var b=
1480 this.uh;if(b!==a){A(a,"string",U,"layerName");var c=this.diagram;if(null===c||null!==c.Jk(a)&&!c.partManager.addsToTemporaryLayer)if(this.uh=a,null!==c&&c.Ta(),this.g("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.diagram,null!==c&&(a=c.Jk(a),null!==a&&a!==b))){var d=b.Rc(-1,this,!0);0<=d&&c.ab(Me,"parts",b,this,null,d,!0);d=a.zj(99999999,this,!0);b.visible!==a.visible&&this.Ub(a.visible);0<=d&&c.ab(Le,"parts",a,null,this,!0,d);d=this.layerChanged;if(null!==d){var e=c.ba;c.ba=!0;d(this,
1481 b,a);c.ba=e}}}}},layerChanged:{configurable:!0,get:function(){return this.Uo},set:function(a){var b=this.Uo;b!==a&&(null!==a&&A(a,"function",U,"layerChanged"),this.Uo=a,this.g("layerChanged",b,a))}},zOrder:{configurable:!0,get:function(){return this.Gq},set:function(a){var b=this.Gq;if(b!==a){A(a,"number",U,"zOrder");this.Gq=a;var c=this.layer;null!==c&&Bi(c,-1,this);this.g("zOrder",b,a);a=this.diagram;null!==a&&a.P()}}},locationObject:{configurable:!0,get:function(){if(null===
1482 this.qf){var a=this.locationObjectName;""!==a?(a=this.ib(a),null!==a?this.qf=a:this.qf=this):this instanceof Ve?this.type!==W.Link&&null!==this.placeholder?this.qf=this.placeholder:this.qf=this:this.qf=this}return this.qf.visible?this.qf:this}},minLocation:{configurable:!0,get:function(){return this.lp},set:function(a){var b=this.lp;b.A(a)||(F&&w(a,J,U,"minLocation"),this.lp=a=a.K(),this.g("minLocation",b,a))}},maxLocation:{configurable:!0,get:function(){return this.cp},
1483 set:function(a){var b=this.cp;b.A(a)||(F&&w(a,J,U,"maxLocation"),this.cp=a=a.K(),this.g("maxLocation",b,a))}},locationObjectName:{configurable:!0,get:function(){return this.ap},set:function(a){var b=this.ap;b!==a&&(F&&A(a,"string",U,"locationObjectName"),this.ap=a,this.qf=null,this.u(),this.g("locationObjectName",b,a))}},locationSpot:{configurable:!0,get:function(){return this.bp},set:function(a){var b=this.bp;b.A(a)||(F&&(w(a,N,U,"locationSpot"),a.eb()||v("Part.locationSpot must be a specific Spot value, not: "+
1484 a)),this.bp=a=a.K(),this.u(),this.g("locationSpot",b,a))}},location:{configurable:!0,get:function(){return this.pg},set:function(a){F&&w(a,J,U,"location");var b=a.x,c=a.y,d=this.pg,e=d.x,f=d.y;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(a=a.copy(),b=a,this.$h()?b=!1:(this.pg=b,this.F|=2097152,!1===Jj(this)&&(So(this),c=this.ra,c.o()&&(e=this.diagram,null===e||e.animationManager.isTicking||!e.undoManager.isUndoingRedoing))&&(f=c.copy(),c.h(c.x+(b.x-d.x),c.y+(b.y-d.y)),
1485 Wo(this,e,c,f),this.g("position",f,c.copy())),b=!0),b&&this.g("location",d.copy(),a.copy()))}},category:{configurable:!0,get:function(){return this.Zf},set:function(a){var b=this.Zf;if(b!==a){A(a,"string",U,"category");var c=this.diagram,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof Ve)){var f=c.model.undoManager;f.isEnabled&&!f.isUndoingRedoing&&(e=this.clone(),e.$.addAll(this.$))}this.Zf=a;this.g("category",b,a);null===c||null===d||this instanceof Ve?this instanceof Ve&&
1486 (e=this.adornedPart,null!==e&&(a=e.Xf,null!==a&&a.remove(b),e.Rh(this.category,this))):(f=c.model,f.undoManager.isUndoingRedoing||(this.$h()?(c.partManager.setLinkCategoryForData(d,a),c=c.partManager.findLinkTemplateForCategory(a),null!==c&&(yg(c),c=c.copy(),null!==c&&Zo(this,c,b,a))):(null!==f&&f.hn(d,a),c=gp(c.partManager,d,a),null!==c&&(yg(c),c=c.copy(),null===c||c instanceof S||(d=this.location.copy(),Zo(this,c,b,a),this.location.o()||(this.location=d)))),null!==e&&(b=this.clone(),b.$.addAll(this.$),
1487 this.g("self",e,b))))}}},self:{configurable:!0,get:function(){return this},set:function(a){Zo(this,a,this.category,a.category)}},copyable:{configurable:!0,get:function(){return 0!==(this.F&1)},set:function(a){var b=0!==(this.F&1);b!==a&&(F&&A(a,"boolean",U,"copyable"),this.F^=1,this.g("copyable",b,a))}},deletable:{configurable:!0,get:function(){return 0!==(this.F&2)},set:function(a){var b=0!==(this.F&2);b!==a&&(F&&A(a,"boolean",U,"deletable"),this.F^=2,this.g("deletable",
1488 b,a))}},textEditable:{configurable:!0,get:function(){return 0!==(this.F&4)},set:function(a){var b=0!==(this.F&4);b!==a&&(F&&A(a,"boolean",U,"textEditable"),this.F^=4,this.g("textEditable",b,a),this.Rb())}},groupable:{configurable:!0,get:function(){return 0!==(this.F&8)},set:function(a){var b=0!==(this.F&8);b!==a&&(F&&A(a,"boolean",U,"groupable"),this.F^=8,this.g("groupable",b,a))}},movable:{configurable:!0,get:function(){return 0!==(this.F&16)},set:function(a){var b=
1489 0!==(this.F&16);b!==a&&(F&&A(a,"boolean",U,"movable"),this.F^=16,this.g("movable",b,a))}},selectionAdorned:{configurable:!0,get:function(){return 0!==(this.F&32)},set:function(a){var b=0!==(this.F&32);b!==a&&(F&&A(a,"boolean",U,"selectionAdorned"),this.F^=32,this.g("selectionAdorned",b,a),this.Rb())}},isInDocumentBounds:{configurable:!0,get:function(){return 0!==(this.F&64)},set:function(a){var b=0!==(this.F&64);if(b!==a){F&&A(a,"boolean",U,"isInDocumentBounds");this.F^=
1490 64;var c=this.diagram;null!==c&&c.Ta();this.g("isInDocumentBounds",b,a)}}},isLayoutPositioned:{configurable:!0,get:function(){return 0!==(this.F&128)},set:function(a){var b=0!==(this.F&128);b!==a&&(F&&A(a,"boolean",U,"isLayoutPositioned"),this.F^=128,this.g("isLayoutPositioned",b,a),this.D(a?4:8))}},selectable:{configurable:!0,get:function(){return 0!==(this.F&256)},set:function(a){var b=0!==(this.F&256);b!==a&&(F&&A(a,"boolean",U,"selectable"),this.F^=256,this.g("selectable",
1491 b,a),this.Rb())}},reshapable:{configurable:!0,get:function(){return 0!==(this.F&512)},set:function(a){var b=0!==(this.F&512);b!==a&&(F&&A(a,"boolean",U,"reshapable"),this.F^=512,this.g("reshapable",b,a),this.Rb())}},resizable:{configurable:!0,get:function(){return 0!==(this.F&1024)},set:function(a){var b=0!==(this.F&1024);b!==a&&(F&&A(a,"boolean",U,"resizable"),this.F^=1024,this.g("resizable",b,a),this.Rb())}},rotatable:{configurable:!0,get:function(){return 0!==
1492 (this.F&2048)},set:function(a){var b=0!==(this.F&2048);b!==a&&(F&&A(a,"boolean",U,"rotatable"),this.F^=2048,this.g("rotatable",b,a),this.Rb())}},isSelected:{configurable:!0,get:function(){return 0!==(this.F&4096)},set:function(a){var b=0!==(this.F&4096);if(b!==a){F&&A(a,"boolean",U,"isSelected");var c=this.diagram;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.maxSelectionCount)){this.F^=4096;var d=!1;if(null!==c){d=c.skipsUndoManager;c.skipsUndoManager=!0;var e=c.selection;
1493 e.ka();a?e.add(this):e.remove(this);e.freeze()}this.g("isSelected",b,a);this.Rb();a=this.selectionChanged;null!==a&&a(this);null!==c&&(c.Jb(),c.skipsUndoManager=d)}}}},isHighlighted:{configurable:!0,get:function(){return 0!==(this.F&524288)},set:function(a){var b=0!==(this.F&524288);if(b!==a){F&&A(a,"boolean",U,"isHighlighted");this.F^=524288;var c=this.diagram;null!==c&&(c=c.highlighteds,c.ka(),a?c.add(this):c.remove(this),c.freeze());this.g("isHighlighted",b,a);this.P();a=this.highlightedChanged;
1494 null!==a&&a(this)}}},isShadowed:{configurable:!0,get:function(){return 0!==(this.F&8192)},set:function(a){var b=0!==(this.F&8192);b!==a&&(F&&A(a,"boolean",U,"isShadowed"),this.F^=8192,this.g("isShadowed",b,a),this.P())}},isAnimated:{configurable:!0,get:function(){return 0!==(this.F&262144)},set:function(a){var b=0!==(this.F&262144);b!==a&&(F&&A(a,"boolean",U,"isAnimated"),this.F^=262144,this.g("isAnimated",b,a))}},highlightedChanged:{configurable:!0,get:function(){return this.Fo},
1495 set:function(a){var b=this.Fo;b!==a&&(null!==a&&A(a,"function",U,"highlightedChanged"),this.Fo=a,this.g("highlightedChanged",b,a))}},selectionObjectName:{configurable:!0,get:function(){return this.gq},set:function(a){var b=this.gq;b!==a&&(F&&A(a,"string",U,"selectionObjectName"),this.gq=a,this.Dh=null,this.g("selectionObjectName",b,a))}},selectionAdornmentTemplate:{configurable:!0,get:function(){return this.eq},set:function(a){var b=this.eq;b!==a&&(F&&w(a,Ve,U,"selectionAdornmentTemplate"),
1496 this.eq=a,this.g("selectionAdornmentTemplate",b,a))}},selectionObject:{configurable:!0,get:function(){if(null===this.Dh){var a=this.selectionObjectName;null!==a&&""!==a?(a=this.ib(a),null!==a?this.Dh=a:this.Dh=this):this instanceof S?(a=this.path,null!==a?this.Dh=a:this.Dh=this):this.Dh=this}return this.Dh}},selectionChanged:{configurable:!0,get:function(){return this.fq},set:function(a){var b=this.fq;b!==a&&(null!==a&&A(a,"function",U,"selectionChanged"),this.fq=a,this.g("selectionChanged",
1497 b,a))}},resizeAdornmentTemplate:{configurable:!0,get:function(){return this.Pp},set:function(a){var b=this.Pp;b!==a&&(F&&w(a,Ve,U,"resizeAdornmentTemplate"),this.Pp=a,this.g("resizeAdornmentTemplate",b,a))}},resizeObjectName:{configurable:!0,get:function(){return this.Rp},set:function(a){var b=this.Rp;b!==a&&(F&&A(a,"string",U,"resizeObjectName"),this.Rp=a,this.g("resizeObjectName",b,a))}},resizeObject:{configurable:!0,get:function(){var a=this.resizeObjectName;
1498 return""!==a&&(a=this.ib(a),null!==a)?a:this}},resizeCellSize:{configurable:!0,get:function(){return this.Qp},set:function(a){var b=this.Qp;b.A(a)||(F&&w(a,Fb,U,"resizeCellSize"),this.Qp=a=a.K(),this.g("resizeCellSize",b,a))}},rotateAdornmentTemplate:{configurable:!0,get:function(){return this.Tp},set:function(a){var b=this.Tp;b!==a&&(F&&w(a,Ve,U,"rotateAdornmentTemplate"),this.Tp=a,this.g("rotateAdornmentTemplate",b,a))}},rotateObjectName:{configurable:!0,
1499 get:function(){return this.Up},set:function(a){var b=this.Up;b!==a&&(F&&A(a,"string",U,"rotateObjectName"),this.Up=a,this.g("rotateObjectName",b,a))}},rotateObject:{configurable:!0,get:function(){var a=this.rotateObjectName;return""!==a&&(a=this.ib(a),null!==a)?a:this}},rotationSpot:{configurable:!0,get:function(){return this.Vp},set:function(a){var b=this.Vp;b.A(a)||(F&&(w(a,N,U,"rotationSpot"),a===fd||a.eb()||v("Part.rotationSpot must be a specific Spot value or Spot.Default, not: "+
1500 a)),this.Vp=a=a.K(),this.g("rotationSpot",b,a))}},text:{configurable:!0,get:function(){return this.$b},set:function(a){var b=this.$b;b!==a&&(F&&A(a,"string",U,"text"),this.$b=a,this.g("text",b,a))}},containingGroup:{configurable:!0,get:function(){return this.yi},set:function(a){if(this.Tc()){var b=this.yi;if(b!==a){F&&null!==a&&w(a,If,U,"containingGroup");null===a||this!==a&&!a.Qd(this)||(this===a&&v("Cannot make a Group a member of itself: "+this.toString()),v("Cannot make a Group indirectly contain itself: "+
1501 this.toString()+" already contains "+a.toString()));this.D(2);var c=this.diagram;null!==b?cp(b,this):this instanceof If&&null!==c&&c.Oh.remove(this);this.yi=a;null!==a?bp(a,this):this instanceof If&&null!==c&&c.Oh.add(this);this.D(1);if(null!==c&&c.ba){var d=this.data,e=c.model;if(null!==d&&e.Aj()){var f=e.pa(null!==a?a.data:null);e.sr(d,f)}}d=this.containingGroupChanged;null!==d&&(e=!0,null!==c&&(e=c.ba,c.ba=!0),d(this,b,a),null!==c&&(c.ba=e));if(this instanceof If)for(c=new I,ml(c,this,!0,0,!0),
1502 c=c.iterator;c.next();)if(d=c.value,d instanceof V)for(d=d.linksConnected;d.next();)hp(d.value);if(this instanceof V){for(c=this.linksConnected;c.next();)hp(c.value);c=this.labeledLink;null!==c&&hp(c)}this.g("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&Bi(b,-1,a))}}else v("cannot set the Part.containingGroup of a Link or Adornment")}},containingGroupChanged:{configurable:!0,get:function(){return this.Nn},set:function(a){var b=this.Nn;b!==a&&(null!==a&&A(a,"function",U,"containingGroupChanged"),
1503 this.Nn=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 this.Vo},set:function(a){var b=this.Vo;b!==a&&(F&&A(a,"number",U,"layoutConditions"),this.Vo=a,this.g("layoutConditions",b,a))}},dragComputation:{configurable:!0,get:function(){return this.fo},set:function(a){var b=this.fo;
1504 b!==a&&(null!==a&&A(a,"function",U,"dragComputation"),this.fo=a,this.g("dragComputation",b,a))}},shadowOffset:{configurable:!0,get:function(){return this.kq},set:function(a){var b=this.kq;b.A(a)||(F&&w(a,J,U,"shadowOffset"),this.kq=a=a.K(),this.P(),this.g("shadowOffset",b,a))}},shadowColor:{configurable:!0,get:function(){return this.jq},set:function(a){var b=this.jq;b!==a&&(F&&A(a,"string",U,"shadowColor"),this.jq=a,this.P(),this.g("shadowColor",b,a))}},shadowBlur:{configurable:!0,
1505 enumerable:!0,get:function(){return this.Gg},set:function(a){var b=this.Gg;b!==a&&(F&&A(a,"number",U,"shadowBlur"),this.Gg=a,this.P(),this.g("shadowBlur",b,a))}}});U.prototype.invalidateLayout=U.prototype.D;U.prototype.findCommonContainingGroup=U.prototype.Ey;U.prototype.isMemberOf=U.prototype.Qd;U.prototype.findTopLevelPart=U.prototype.yA;U.prototype.findSubGraphLevel=U.prototype.vA;U.prototype.ensureBounds=U.prototype.Ya;U.prototype.getDocumentBounds=U.prototype.xj;
1506 U.prototype.getRelativePoint=U.prototype.Pf;U.prototype.findObject=U.prototype.ib;U.prototype.moveTo=U.prototype.moveTo;U.prototype.invalidateAdornments=U.prototype.Rb;U.prototype.clearAdornments=U.prototype.Ak;U.prototype.removeAdornment=U.prototype.Tf;U.prototype.addAdornment=U.prototype.Rh;U.prototype.findAdornment=U.prototype.Ik;U.prototype.updateTargetBindings=U.prototype.Ia;var $o=!1;U.className="Part";U.LayoutNone=0;U.LayoutAdded=1;U.LayoutRemoved=2;U.LayoutShown=4;U.LayoutHidden=8;
1507 U.LayoutNodeSized=16;U.LayoutGroupLayout=32;U.LayoutNodeReplaced=64;U.LayoutStandard=127;U.LayoutAll=16777215;function Ve(a){U.call(this,a);this.F&=-257;this.uh="Adornment";this.re=null;this.Sx=0;this.iy=!1;this.l=a instanceof fn?[]:ip;this.Sa=null}ma(Ve,U);Ve.prototype.toString=function(){var a=this.adornedPart;return"Adornment("+this.category+")"+(null!==a?a.toString():"")};Ve.prototype.updateRelationshipsFromData=function(){};
1508 Ve.prototype.Rk=function(a){var b=this.adornedObject.part;if(b instanceof S&&this.adornedObject instanceof Uf){var c=b.path;b.Rk(a);a=c.geometry;b=this.$.j;c=b.length;for(var d=0;d<c;d++){var e=b[d];e.isPanelMain&&e instanceof Uf&&(e.ua=a)}}};Ve.prototype.Dj=function(){var a=this.re;if(null===a)return!0;a=a.part;return null===a||!Jj(a)};Ve.prototype.Tc=function(){return!1};
1509 Ve.prototype.cl=function(a,b,c,d,e,f,g){if(a===Le&&"elements"===b)if(e instanceof xg)null===this.Sa?this.Sa=e:F&&this.Sa!==e&&v("Cannot insert a second Placeholder into the visual tree of an Adornment.");else{if(e instanceof W){var h=e.Mm(function(a){return a instanceof xg});h instanceof xg&&(null===this.Sa?this.Sa=h:F&&this.Sa!==h&&v("Cannot insert a second Placeholder into the visual tree of an Adornment."))}}else a===Me&&"elements"===b&&null!==this.Sa&&(d===this.Sa?this.Sa=null:d instanceof W&&
1510 this.Sa.Sg(d)&&(this.Sa=null));U.prototype.cl.call(this,a,b,c,d,e,f,g)};Ve.prototype.updateAdornments=function(){};Ve.prototype.Gk=function(){};
1511 na.Object.defineProperties(Ve.prototype,{placeholder:{configurable:!0,get:function(){return this.Sa}},adornedObject:{configurable:!0,get:function(){return this.re},set:function(a){F&&null!==a&&w(a,O,U,"adornedObject:value");var b=this.adornedPart,c=null;null!==a&&(c=a.part);null===b||null!==a&&b===c||b.Tf(this.category);this.re=a;null!==c&&c.Rh(this.category,this)}},adornedPart:{configurable:!0,get:function(){var a=this.re;return null!==a?a.part:null}},containingGroup:{configurable:!0,
1512 enumerable:!0,get:function(){return null}}});var ip=[];Ve.className="Adornment";function V(a){U.call(this,a);this.T=13;this.hb=new H;this.Aq=this.Xl=this.Ti=this.Xo=this.Wo=null;this.ol=Ac;this.zc=this.df=null;this.Mp=jp;this.Ph=!1}ma(V,U);V.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.T=this.T;a.T=this.T&-17;a.Wo=this.Wo;a.Xo=this.Xo;a.Ti=this.Ti;a.Aq=this.Aq;a.ol=this.ol.K();a.Mp=this.Mp};t=V.prototype;
1513 t.Kf=function(a){U.prototype.Kf.call(this,a);a.yd();a.df=this.df;a.zc=null};function kp(a,b){null!==b&&(null===a.df&&(a.df=new I),a.df.add(b))}function lp(a,b,c,d){if(null===b||null===a.df)return null;for(var e=a.df.iterator;e.next();){var f=e.value;if(f.nu===a&&f.zw===b&&f.bz===c&&f.cz===d||f.nu===b&&f.zw===a&&f.bz===d&&f.cz===c)return f}return null}t.RA=function(a,b,c){if(void 0===b||null===b)b="";if(void 0===c||null===c)c="";a=lp(this,a,b,c);null!==a&&a.Rm()};
1514 t.cl=function(a,b,c,d,e,f,g){a===Le&&"elements"===b?this.zc=null:a===Me&&"elements"===b&&(this.zc=null);U.prototype.cl.call(this,a,b,c,d,e,f,g)};t.yd=function(a){void 0===a&&(a=null);for(var b=this.linksConnected;b.next();){var c=b.value;null!==a&&a.contains(c)||(mp(c.fromPort),mp(c.toPort),c.Za())}};function Jl(a,b){for(a=a.linksConnected;a.next();){var c=a.value;if(c.fromPort===b||c.toPort===b)mp(c.fromPort),mp(c.toPort),c.Za()}}
1515 function mp(a){if(null!==a){var b=a.Lp;null!==b&&b.Rm();a=a.part;b=a.containingGroup;null===b||a.isVisible()||mp(b.port)}}t.Dj=function(){return!0};V.prototype.getAvoidableRect=function(a){a.set(this.actualBounds);a.Hq(this.ol);return a};V.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.isVisible();)a=a.containingGroup;return a};
1516 V.prototype.isVisible=function(){if(!U.prototype.isVisible.call(this))return!1;var a=!0,b=Gi,c=this.diagram;if(null!==c){if(c.animationManager.pu(this))return!0;a=c.isTreePathToChildren;b=c.treeCollapsePolicy}if(b===Gi){if(a=this.Rg(),null!==a&&!a.isTreeExpanded)return!1}else if(b===Yk){if(a=a?this.hw():this.iw(),0<a.count&&a.all(function(a){return!a.isTreeExpanded}))return!1}else if(b===Zk&&(a=a?this.hw():this.iw(),0<a.count&&a.any(function(a){return!a.isTreeExpanded})))return!1;a=this.labeledLink;
1517 return null!==a?a.isVisible():!0};V.prototype.Ub=function(a){U.prototype.Ub.call(this,a);for(var b=this.linksConnected;b.next();){var c=b.value;if(a&&null!==this.containingGroup){var d=c.Xq(this);null===d||d.Qd(this.containingGroup)||c.Za()}c.Ub(a)}};V.prototype.Fy=function(){var a=new I,b=new I;np(this,this,a,b);return b.iterator};
1518 function np(a,b,c,d){if(null!==b&&!c.has(b)){c.add(b);var e=!0,f=a.diagram;null!==f&&(e=f.isTreePathToChildren);b.linksConnected.each(function(f){f.isTreeLink?(e?f.fromNode===b:f.toNode===b)&&np(a,e?f.toNode:f.fromNode,c,d):d.add(f)})}}
1519 V.prototype.findLinksConnected=function(a){void 0===a&&(a=null);if(null===a)return this.hb.iterator;F&&A(a,"string",V,"findLinksConnected:pid");var b=new mb(this.hb),c=this;b.predicate=function(b){return b.fromNode===c&&b.fromPortId===a||b.toNode===c&&b.toPortId===a};return b};t=V.prototype;t.Sq=function(a){void 0===a&&(a=null);F&&null!==a&&A(a,"string",V,"findLinksOutOf:pid");var b=new mb(this.hb),c=this;b.predicate=function(b){return b.fromNode!==c?!1:null===a?!0:b.fromPortId===a};return b};
1520 t.Od=function(a){void 0===a&&(a=null);F&&null!==a&&A(a,"string",V,"findLinksInto:pid");var b=new mb(this.hb),c=this;b.predicate=function(b){return b.toNode!==c?!1:null===a?!0:b.toPortId===a};return b};
1521 t.gw=function(a){void 0===a&&(a=null);F&&null!==a&&A(a,"string",V,"findNodesConnected:pid");for(var b=null,c=null,d=this.hb.iterator;d.next();){var e=d.value;if(e.fromNode===this){if(null===a||e.fromPortId===a)e=e.toNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e}else e.toNode!==this||null!==a&&e.toPortId!==a||(e=e.fromNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e)}return null!==b?b.iterator:null!==c?new lb(c):kb};
1522 t.iw=function(a){void 0===a&&(a=null);F&&null!==a&&A(a,"string",V,"findNodesOutOf:pid");for(var b=null,c=null,d=this.hb.iterator;d.next();){var e=d.value;e.fromNode!==this||null!==a&&e.fromPortId!==a||(e=e.toNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e)}return null!==b?b.iterator:null!==c?new lb(c):kb};
1523 t.hw=function(a){void 0===a&&(a=null);F&&null!==a&&A(a,"string",V,"findNodesInto:pid");for(var b=null,c=null,d=this.hb.iterator;d.next();){var e=d.value;e.toNode!==this||null!==a&&e.toPortId!==a||(e=e.fromNode,null!==b?b.add(e):null!==c&&c!==e?(b=new I,b.add(c),b.add(e)):c=e)}return null!==b?b.iterator:null!==c?new lb(c):kb};
1524 t.qA=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);F&&(w(a,V,V,"findLinksBetween:othernode"),null!==b&&A(b,"string",V,"findLinksBetween:pid"),null!==c&&A(c,"string",V,"findLinksBetween:otherpid"));var d=new mb(this.hb),e=this;d.predicate=function(d){return(d.fromNode!==e||d.toNode!==a||null!==b&&d.fromPortId!==b||null!==c&&d.toPortId!==c)&&(d.fromNode!==a||d.toNode!==e||null!==c&&d.fromPortId!==c||null!==b&&d.toPortId!==b)?!1:!0};return d};
1525 t.rA=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);F&&(w(a,V,V,"findLinksTo:othernode"),null!==b&&A(b,"string",V,"findLinksTo:pid"),null!==c&&A(c,"string",V,"findLinksTo:otherpid"));var d=new mb(this.hb),e=this;d.predicate=function(d){return d.fromNode!==e||d.toNode!==a||null!==b&&d.fromPortId!==b||null!==c&&d.toPortId!==c?!1:!0};return d};
1526 function op(a,b,c){mp(c);var d=a.hb.contains(b);d||a.hb.add(b);if(!d||b.fromNode===b.toNode){var e=a.linkConnected;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.ba,g.ba=!0);e(a,b,c);null!==g&&(g.ba=f)}}!d&&b.isTreeLink&&(c=b.fromNode,b=b.toNode,null!==c&&null!==b&&c!==b&&(d=!0,a=a.diagram,null!==a&&(d=a.isTreePathToChildren),e=d?b:c,f=d?c:b,e.Ph||(e.Ph=f),!f.isTreeLeaf||null!==a&&a.undoManager.isUndoingRedoing||(d?c===f&&(f.isTreeLeaf=!1):b===f&&(f.isTreeLeaf=!1))))}
1527 function pp(a,b,c){mp(c);var d=a.hb.remove(b),e=null;if(d||b.toNode===b.fromNode){var f=a.linkDisconnected;e=a.diagram;if(null!==f){var g=!0;null!==e&&(g=e.ba,e.ba=!0);f(a,b,c);null!==e&&(e.ba=g)}}d&&b.isTreeLink&&(c=!0,null!==e&&(c=e.isTreePathToChildren),a=c?b.toNode:b.fromNode,b=c?b.fromNode:b.toNode,null!==a&&(a.Ph=!1),null===b||b.isTreeLeaf||(0===b.hb.count?(b.Ph=null,null!==e&&e.undoManager.isUndoingRedoing||(b.isTreeLeaf=!0)):Xk(b)))}
1528 function Xk(a){a.Ph=!1;if(0!==a.hb.count){var b=!0,c=a.diagram;if(null===c||!c.undoManager.isUndoingRedoing){null!==c&&(b=c.isTreePathToChildren);for(c=a.hb.iterator;c.next();){var d=c.value;if(d.isTreeLink)if(b){if(d.fromNode===a){a.isTreeLeaf=!1;return}}else if(d.toNode===a){a.isTreeLeaf=!1;return}}a.isTreeLeaf=!0}}}V.prototype.updateRelationshipsFromData=function(){var a=this.diagram;null!==a&&a.partManager.updateRelationshipsFromData(this)};t=V.prototype;
1529 t.Zq=function(a){U.prototype.Zq.call(this,a);a||(Xk(this),a=this.Xl,null!==a&&qp(a,this))};t.$q=function(a){U.prototype.$q.call(this,a);a||(a=this.Xl,null!==a&&null!==a.td&&(a.td.remove(this),a.u()))};
1530 t.Gk=function(){if(0<this.hb.count){var a=this.diagram;if(null!==a)for(var b=null!==a.commandHandler?a.commandHandler.deletesConnectedLinks:!0,c=this.hb.copy().iterator;c.next();){var d=c.value;b?a.remove(d):(d.fromNode===this&&(d.fromNode=null),d.toNode===this&&(d.toNode=null))}}this.labeledLink=null;U.prototype.Gk.call(this)};
1531 t.Wt=function(a){F&&A(a,"string",V,"findPort:pid");if(null===this.zc){if(""===a&&!1===this.Yh)return this;rp(this)}var b=this.zc.J(a);return null!==b||""!==a&&(b=this.zc.J(""),null!==b)?b:this};function rp(a){null===a.zc?a.zc=new Bb:a.zc.clear();a.fl(a,function(a,c){mm(a,c)});0===a.zc.count&&a.zc.add("",a)}function mm(a,b){var c=b.portId;null!==c&&null!==a.zc&&a.zc.add(c,b)}
1532 function lm(a,b,c){var d=b.portId;if(null!==d&&(null!==a.zc&&a.zc.remove(d),b=a.diagram,null!==b&&c)){c=null;for(a=a.findLinksConnected(d);a.next();)d=a.value,null===c&&(c=Ma()),c.push(d);if(null!==c){for(a=0;a<c.length;a++)b.remove(c[a]);Oa(c)}}}
1533 t.TA=function(a){if(null===a||a===this)return!1;var b=!0,c=this.diagram;null!==c&&(b=c.isTreePathToChildren);c=this;if(b)for(;c!==a;){b=null;for(var d=c.hb.iterator;d.next();){var e=d.value;if(e.isTreeLink&&(b=e.fromNode,b!==c&&b!==this))break}if(b===this||null===b||b===c)return!1;c=b}else for(;c!==a;){b=null;for(d=c.hb.iterator;d.next()&&(e=d.value,!e.isTreeLink||(b=e.toNode,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
1534 t.CA=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);b=this;if(a)for(;;){a=null;for(var c=b.hb.iterator;c.next();){var d=c.value;if(d.isTreeLink&&(a=d.fromNode,a!==b&&a!==this))break}if(a===this)return this;if(null===a||a===b)return b;b=a}else for(;;){a=null;for(c=b.hb.iterator;c.next()&&(d=c.value,!d.isTreeLink||(a=d.toNode,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
1535 t.nA=function(a){if(null===a)return null;F&&w(a,V,V,"findCommonTreeParent:other");if(this===a)return this;for(var b=this;null!==b;)ap(b,!0),b=b.Rg();var c=null;for(b=a;null!==b;){if(0!==(b.F&1048576)){c=b;break}b=b.Rg()}for(b=this;null!==b;)ap(b,!1),b=b.Rg();return c};
1536 t.uj=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);b=this.hb.iterator;if(a)for(;b.next();){if(a=b.value,a.isTreeLink&&a.fromNode!==this)return a}else for(;b.next();)if(a=b.value,a.isTreeLink&&a.toNode!==this)return a;return null};
1537 t.Rg=function(){var a=this.Ph;if(null===a)return null;if(a instanceof V)return a;var b=!0;a=this.diagram;null!==a&&(b=a.isTreePathToChildren);a=this.hb.iterator;if(b)for(;a.next();){if(b=a.value,b.isTreeLink&&(b=b.fromNode,b!==this))return this.Ph=b}else for(;a.next();)if(b=a.value,b.isTreeLink&&(b=b.toNode,b!==this))return this.Ph=b;return this.Ph=null};t.AA=function(){function a(b,d){if(null!==b){d.add(b);var c=b.uj();null!==c&&(d.add(c),a(b.Rg(),d))}}var b=new I;a(this,b);return b};
1538 t.zA=function(){return sp(this,this)};function sp(a,b){b=b.Rg();return null===b?0:1+sp(a,b)}t.Uq=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);b=new mb(this.hb);var c=this;b.predicate=a?function(a){return a.isTreeLink&&a.fromNode===c?!0:!1}:function(a){return a.isTreeLink&&a.toNode===c?!0:!1};return b};
1539 t.kw=function(){var a=!0,b=this.diagram;null!==b&&(a=b.isTreePathToChildren);var c=b=null,d=this.hb.iterator;if(a)for(;d.next();)a=d.value,a.isTreeLink&&a.fromNode===this&&(a=a.toNode,null!==b?b.add(a):null!==c&&c!==a?(b=new H,b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.isTreeLink&&a.toNode===this&&(a=a.fromNode,null!==b?b.add(a):null!==c&&c!==a?(b=new H,b.add(c),b.add(a)):c=a);return null!==b?b.iterator:null!==c?new lb(c):kb};
1540 t.BA=function(a){void 0===a&&(a=Infinity);A(a,"number",V,"findTreeParts:level");var b=new I;ml(b,this,!1,a,!0);return b};V.prototype.collapseTree=function(a){void 0===a&&(a=1);C(a,V,"collapseTree:level");1>a&&(a=1);var b=this.diagram;if(null!==b&&!b.Ye){b.Ye=!0;var c=new I;c.add(this);tp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Gi);b.Ye=!1}};
1541 function tp(a,b,c,d,e,f,g){if(1<d)for(var h=c?a.Sq():a.Od();h.next();){var k=h.value;k.isTreeLink&&(k=k.Xq(a),null===k||k===a||b.contains(k)||(b.add(k),tp(k,b,c,d-1,e,f,g)))}else up(a,b,c,e,f,g)}
1542 function up(a,b,c,d,e,f){for(var g=e===a?!0:a.isTreeExpanded,h=c?a.Sq():a.Od();h.next();){var k=h.value;if(k.isTreeLink&&(k=k.Xq(a),null!==k&&k!==a)){var l=b.contains(k);l||b.add(k);g&&(f&&d.wk(k,e),k.Zh(),k.Ub(!1));k.isTreeExpanded&&(k.wasTreeExpanded=k.isTreeExpanded,l||up(k,b,c,d,e,f))}}a.isTreeExpanded=!1}
1543 V.prototype.expandTree=function(a){void 0===a&&(a=2);C(a,V,"expandTree:level");2>a&&(a=2);var b=this.diagram;if(null!==b&&!b.Ye){b.Ye=!0;var c=new I;c.add(this);vp(this,c,b.isTreePathToChildren,a,b,this,b.treeCollapsePolicy===Gi);b.Ye=!1}};
1544 function vp(a,b,c,d,e,f,g){for(var h=f===a?!1:a.isTreeExpanded,k=c?a.Sq():a.Od();k.next();){var l=k.value;l.isTreeLink&&(h||l.Ad||l.Za(),l=l.Xq(a),null!==l&&l!==a&&!b.contains(l)&&(b.add(l),h||(l.Ub(!0),l.Zh(),g&&e.yk(l,f)),2<d||l.wasTreeExpanded))&&(l.wasTreeExpanded=!1,vp(l,b,c,d-1,e,f,g))}a.isTreeExpanded=!0}
1545 na.Object.defineProperties(V.prototype,{portSpreading:{configurable:!0,get:function(){return this.Mp},set:function(a){var b=this.Mp;b!==a&&(F&&a!==wp&&a!==jp&&a!==xp&&v("Node.portSpreading can only be set to Node.SpreadingNone, Node.SpreadingEvenly, or Node.SpreadingPacked, not: "+a),this.Mp=a,this.g("portSpreading",b,a),a=this.diagram,null!==a&&a.undoManager.isUndoingRedoing||this.yd())}},avoidable:{configurable:!0,get:function(){return 0!==(this.T&8)},set:function(a){var b=
1546 0!==(this.T&8);if(b!==a){F&&A(a,"boolean",V,"avoidable");this.T^=8;var c=this.diagram;null!==c&&Qk(c,this);this.g("avoidable",b,a)}}},avoidableMargin:{configurable:!0,get:function(){return this.ol},set:function(a){"number"===typeof a?a=new hc(a):w(a,hc,V,"avoidableMargin");var b=this.ol;if(!b.A(a)){this.ol=a=a.K();var c=this.diagram;null!==c&&Qk(c,this);this.g("avoidableMargin",b,a)}}},linksConnected:{configurable:!0,get:function(){return this.hb.iterator}},linkConnected:{configurable:!0,
1547 enumerable:!0,get:function(){return this.Wo},set:function(a){var b=this.Wo;b!==a&&(null!==a&&A(a,"function",V,"linkConnected"),this.Wo=a,this.g("linkConnected",b,a))}},linkDisconnected:{configurable:!0,get:function(){return this.Xo},set:function(a){var b=this.Xo;b!==a&&(null!==a&&A(a,"function",V,"linkDisconnected"),this.Xo=a,this.g("linkDisconnected",b,a))}},linkValidation:{configurable:!0,get:function(){return this.Ti},set:function(a){var b=this.Ti;b!==a&&(null!==a&&
1548 A(a,"function",V,"linkValidation"),this.Ti=a,this.g("linkValidation",b,a))}},isLinkLabel:{configurable:!0,get:function(){return null!==this.Xl}},labeledLink:{configurable:!0,get:function(){return this.Xl},set:function(a){var b=this.Xl;if(b!==a){F&&null!==a&&w(a,S,V,"labeledLink");var c=this.diagram,d=this.data;if(null!==b){null!==b.td&&(b.td.remove(this),b.u());if(null!==c&&null!==d&&!c.undoManager.isUndoingRedoing){var e=b.data,f=c.model;if(null!==e&&f.Cj()){var g=f.pa(d);
1549 void 0!==g&&f.dz(e,g)}}this.containingGroup=null}this.Xl=a;null!==a&&(qp(a,this),null===c||null===d||c.undoManager.isUndoingRedoing||(e=a.data,c=c.model,null!==e&&c.Cj()&&(d=c.pa(d),void 0!==d&&c.Qv(e,d))),this.containingGroup=a.containingGroup);Xl(this);this.g("labeledLink",b,a)}}},port:{configurable:!0,get:function(){return this.Wt("")}},ports:{configurable:!0,get:function(){null===this.zc&&rp(this);return this.zc.iteratorValues}},isTreeExpanded:{configurable:!0,
1550 get:function(){return 0!==(this.T&1)},set:function(a){var b=0!==(this.T&1);if(b!==a){F&&A(a,"boolean",V,"isTreeExpanded");this.T^=1;var c=this.diagram;this.g("isTreeExpanded",b,a);b=this.treeExpandedChanged;if(null!==b){var d=!0;null!==c&&(d=c.ba,c.ba=!0);b(this);null!==c&&(c.ba=d)}null!==c&&c.undoManager.isUndoingRedoing?this.Ub(a):a?this.expandTree():this.collapseTree()}}},wasTreeExpanded:{configurable:!0,get:function(){return 0!==(this.T&2)},set:function(a){var b=0!==(this.T&2);b!==
1551 a&&(F&&A(a,"boolean",V,"wasTreeExpanded"),this.T^=2,this.g("wasTreeExpanded",b,a))}},treeExpandedChanged:{configurable:!0,get:function(){return this.Aq},set:function(a){var b=this.Aq;b!==a&&(null!==a&&A(a,"function",V,"treeExpandedChanged"),this.Aq=a,this.g("treeExpandedChanged",b,a))}},isTreeLeaf:{configurable:!0,get:function(){return 0!==(this.T&4)},set:function(a){var b=0!==(this.T&4);b!==a&&(F&&A(a,"boolean",V,"isTreeLeaf"),this.T^=4,this.g("isTreeLeaf",b,a))}}});
1552 V.prototype.expandTree=V.prototype.expandTree;V.prototype.collapseTree=V.prototype.collapseTree;V.prototype.findTreeParts=V.prototype.BA;V.prototype.findTreeChildrenNodes=V.prototype.kw;V.prototype.findTreeChildrenLinks=V.prototype.Uq;V.prototype.findTreeLevel=V.prototype.zA;V.prototype.findTreeParentChain=V.prototype.AA;V.prototype.findTreeParentNode=V.prototype.Rg;V.prototype.findTreeParentLink=V.prototype.uj;V.prototype.findCommonTreeParent=V.prototype.nA;V.prototype.findTreeRoot=V.prototype.CA;
1553 V.prototype.isInTreeOf=V.prototype.TA;V.prototype.findPort=V.prototype.Wt;V.prototype.findLinksTo=V.prototype.rA;V.prototype.findLinksBetween=V.prototype.qA;V.prototype.findNodesInto=V.prototype.hw;V.prototype.findNodesOutOf=V.prototype.iw;V.prototype.findNodesConnected=V.prototype.gw;V.prototype.findLinksInto=V.prototype.Od;V.prototype.findLinksOutOf=V.prototype.Sq;V.prototype.findExternalTreeLinksConnected=V.prototype.Fy;V.prototype.invalidateConnectedLinks=V.prototype.yd;
1554 V.prototype.invalidateLinkBundle=V.prototype.RA;var wp=new E(V,"SpreadingNone",10),jp=new E(V,"SpreadingEvenly",11),xp=new E(V,"SpreadingPacked",12);V.className="Node";V.SpreadingNone=wp;V.SpreadingEvenly=jp;V.SpreadingPacked=xp;function If(a){V.call(this,a);this.T|=4608;this.ip=new I;this.em=new I;this.Sa=this.rq=this.Vi=this.jp=this.hp=this.gb=null;this.qc=new Ni;this.qc.group=this}ma(If,V);
1555 If.prototype.cloneProtected=function(a){V.prototype.cloneProtected.call(this,a);this.T=this.T&-32769;null!==this.gb&&(a.gb=this.gb.copy());a.hp=this.hp;a.jp=this.jp;a.Vi=this.Vi;a.rq=this.rq;var b=a.Mm(function(a){return a instanceof xg});b instanceof xg?a.Sa=b:a.Sa=null;null!==this.qc?(a.qc=this.qc.copy(),a.qc.group=a):(null!==a.qc&&(a.qc.group=null),a.qc=null)};t=If.prototype;
1556 t.Kf=function(a){V.prototype.Kf.call(this,a);var b=a.Kk();for(a=a.memberParts;a.next();){var c=a.value;c.u();c.D(8);c.Ak();if(c instanceof V)c.yd(b);else if(c instanceof S)for(c=c.labelNodes;c.next();)c.value.yd(b)}};
1557 t.cl=function(a,b,c,d,e,f,g){if(a===Le&&"elements"===b)if(e instanceof xg)null===this.Sa?this.Sa=e:this.Sa!==e&&v("Cannot insert a second Placeholder into the visual tree of a Group.");else{if(e instanceof W){var h=e.Mm(function(a){return a instanceof xg});h instanceof xg&&(null===this.Sa?this.Sa=h:this.Sa!==h&&v("Cannot insert a second Placeholder into the visual tree of a Group."))}}else a===Me&&"elements"===b&&null!==this.Sa&&(d===this.Sa?this.Sa=null:d instanceof W&&this.Sa.Sg(d)&&(this.Sa=null));
1558 V.prototype.cl.call(this,a,b,c,d,e,f,g)};t.Wm=function(a,b){V.prototype.Wm.call(this,a,b);this.isClipping&&this.type!==W.Spot&&(a=this.resizeObject,a instanceof W&&(a=a.yb()),null===this.gb&&(this.gb=new L),a.xj(this.gb),a instanceof Uf&&this.gb.Pc(-a.strokeWidth,-a.strokeWidth))};t.Th=function(a,b,c,d){this.qf=this.Sa;V.prototype.Th.call(this,a,b,c,d)};t.Ya=function(){var a=this;a.isSubGraphExpanded&&this.memberParts.each(function(b){!a.computesBoundsIncludingLinks&&b instanceof S||b.Ya()});V.prototype.Ya.call(this)};
1559 t.Dj=function(){if(!V.prototype.Dj.call(this))return!1;for(var a=this.memberParts;a.next();){var b=a.value;if(b instanceof V){if(b.isVisible()&&Jj(b))return!1}else if(b instanceof S&&b.isVisible()&&Jj(b)&&b.fromNode!==this&&b.toNode!==this)return!1}return!0};
1560 function bp(a,b){if(a.ip.add(b)){b instanceof If&&a.em.add(b);var c=a.memberAdded;if(null!==c){var d=!0,e=a.diagram;null!==e&&(d=e.ba,e.ba=!0);c(a,b);null!==e&&(e.ba=d)}a.isVisible()&&a.isSubGraphExpanded||b.Ub(!1)}b instanceof S&&!a.computesBoundsIncludingLinks||(b=a.Sa,null===b&&(b=a),b.u())}
1561 function cp(a,b){if(a.ip.remove(b)){b instanceof If&&a.em.remove(b);var c=a.memberRemoved;if(null!==c){var d=!0,e=a.diagram;null!==e&&(d=e.ba,e.ba=!0);c(a,b);null!==e&&(e.ba=d)}a.isVisible()&&a.isSubGraphExpanded||b.Ub(!0)}b instanceof S&&!a.computesBoundsIncludingLinks||(b=a.Sa,null===b&&(b=a),b.u())}t.Gk=function(){if(0<this.ip.count){var a=this.diagram;if(null!==a)for(var b=this.ip.copy().iterator;b.next();)a.remove(b.value)}V.prototype.Gk.call(this)};
1562 If.prototype.canAddMembers=function(a){var b=this.diagram;if(null===b)return!1;b=b.commandHandler;for(a=ol(a).iterator;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};If.prototype.addMembers=function(a,b){var c=this.diagram;if(null===c)return!1;c=c.commandHandler;var d=!0;for(a=ol(a).iterator;a.next();){var e=a.value;!b||c.isValidMember(this,e)?e.containingGroup=this:d=!1}return d};
1563 If.prototype.canUngroup=function(){if(!this.ungroupable)return!1;var a=this.layer;if(null!==a&&!a.allowUngroup)return!1;a=a.diagram;return null===a||a.allowUngroup?!0:!1};t=If.prototype;
1564 t.yd=function(a){void 0===a&&(a=null);var b=0!==(this.T&65536);V.prototype.yd.call(this,a);if(!b)for(0!==(this.T&65536)!==!0&&(this.T=this.T^65536),b=this.fw();b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.fromNode;null!==d&&d!==this&&d.Qd(this)&&!d.isVisible()?(mp(c.fromPort),mp(c.toPort),c.Za()):(d=c.toNode,null!==d&&d!==this&&d.Qd(this)&&!d.isVisible()&&(mp(c.fromPort),mp(c.toPort),c.Za()))}}};
1565 t.fw=function(){var a=this.Kk();a.add(this);for(var b=new I,c=a.iterator;c.next();){var d=c.value;if(d instanceof V)for(d=d.linksConnected;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.iterator};t.pA=function(){var a=this.Kk();a.add(this);for(var b=new I,c=a.iterator;c.next();){var d=c.value;if(d instanceof V)for(d=d.linksConnected;d.next();){var e=d.value,f=e.fromNode;null===f||a.contains(f)&&f!==this||b.add(f);e=e.toNode;null===e||a.contains(e)&&e!==this||b.add(e)}}return b.iterator};
1566 t.oA=function(){function a(b,d){null!==b&&(d.add(b),a(b.containingGroup,d))}var b=new I;a(this,b);return b};t.Kk=function(){var a=new I;ml(a,this,!0,0,!0);a.remove(this);return a};t.Ub=function(a){V.prototype.Ub.call(this,a);for(var b=this.memberParts;b.next();)b.value.Ub(a)};If.prototype.collapseSubGraph=function(){var a=this.diagram;if(null!==a&&!a.Ye){a.Ye=!0;var b=this.Kk();yp(this,b,a,this);a.Ye=!1}};
1567 function yp(a,b,c,d){for(var e=a.memberParts;e.next();){var f=e.value;f.Ub(!1);f instanceof If&&f.isSubGraphExpanded&&(f.wasSubGraphExpanded=f.isSubGraphExpanded,yp(f,b,c,d));if(f instanceof V)f.yd(b),c.wk(f,d);else if(f instanceof S)for(f=f.labelNodes;f.next();)f.value.yd(b)}a.isSubGraphExpanded=!1}If.prototype.expandSubGraph=function(){var a=this.diagram;if(null!==a&&!a.Ye){a.Ye=!0;var b=this.Kk();zp(this,b,a,this);a.Ye=!1}};
1568 function zp(a,b,c,d){for(var e=a.memberParts;e.next();){var f=e.value;f.Ub(!0);f instanceof If&&f.wasSubGraphExpanded&&(f.wasSubGraphExpanded=!1,zp(f,b,c,d));if(f instanceof V)f.yd(b),c.yk(f,d);else if(f instanceof S)for(f=f.labelNodes;f.next();)f.value.yd(b)}a.isSubGraphExpanded=!0}
1569 If.prototype.move=function(a,b){void 0===b&&(b=!1);var c=b?this.location:this.position,d=c.x;c=c.y;var e=a.x,f=a.y;if(!(d===e||isNaN(d)&&isNaN(e))||!(c===f||isNaN(c)&&isNaN(f))){d=e-(isNaN(d)?0:d);c=f-(isNaN(c)?0:c);f=J.alloc();V.prototype.move.call(this,a,b);a=new I;for(b=this.Kk().iterator;b.next();)if(e=b.value,e instanceof S&&(e.suspendsRouting&&a.add(e),e.Ad||e.fromNode!==this&&e.toNode!==this))e.suspendsRouting=!0;for(b.reset();b.next();)if(e=b.value,!(e.$h()||e instanceof V&&e.isLinkLabel)){var g=
1570 e.position,h=e.location;g.o()?(f.x=g.x+d,f.y=g.y+c,e.position=f):h.o()&&(f.x=h.x+d,f.y=h.y+c,e.location=f)}for(b.reset();b.next();)if(e=b.value,e instanceof S&&(e.suspendsRouting=a.contains(e),e.Ad||e.fromNode!==this&&e.toNode!==this))g=e.position,f.x=g.x+d,f.y=g.y+c,f.o()?e.move(f):e.Za(),gk(e)&&e.Za();J.free(f)}};
1571 na.Object.defineProperties(If.prototype,{placeholder:{configurable:!0,get:function(){return this.Sa}},computesBoundsAfterDrag:{configurable:!0,get:function(){return 0!==(this.T&2048)},set:function(a){var b=0!==(this.T&2048);b!==a&&(A(a,"boolean",If,"computesBoundsAfterDrag"),this.T^=2048,this.g("computesBoundsAfterDrag",b,a))}},computesBoundsIncludingLinks:{configurable:!0,get:function(){return 0!==(this.T&4096)},set:function(a){A(a,"boolean",If,"computesBoundsIncludingLinks");
1572 var b=0!==(this.T&4096);b!==a&&(this.T^=4096,this.g("computesBoundsIncludingLinks",b,a))}},computesBoundsIncludingLocation:{configurable:!0,get:function(){return 0!==(this.T&8192)},set:function(a){A(a,"boolean",If,"computesBoundsIncludingLocation");var b=0!==(this.T&8192);b!==a&&(this.T^=8192,this.g("computesBoundsIncludingLocation",b,a))}},handlesDragDropForMembers:{configurable:!0,get:function(){return 0!==(this.T&16384)},set:function(a){A(a,"boolean",If,"handlesDragDropForMembers");
1573 var b=0!==(this.T&16384);b!==a&&(this.T^=16384,this.g("handlesDragDropForMembers",b,a))}},memberParts:{configurable:!0,get:function(){return this.ip.iterator}},layout:{configurable:!0,get:function(){return this.qc},set:function(a){var b=this.qc;if(b!==a){null!==a&&w(a,Ni,If,"layout");null!==b&&(b.diagram=null,b.group=null);this.qc=a;var c=this.diagram;null!==a&&(a.diagram=c,a.group=this);null!==c&&(c.Zg=!0);this.g("layout",b,a);null!==c&&c.Jb()}}},memberAdded:{configurable:!0,
1574 enumerable:!0,get:function(){return this.hp},set:function(a){var b=this.hp;b!==a&&(null!==a&&A(a,"function",If,"memberAdded"),this.hp=a,this.g("memberAdded",b,a))}},memberRemoved:{configurable:!0,get:function(){return this.jp},set:function(a){var b=this.jp;b!==a&&(null!==a&&A(a,"function",If,"memberRemoved"),this.jp=a,this.g("memberRemoved",b,a))}},memberValidation:{configurable:!0,get:function(){return this.Vi},set:function(a){var b=this.Vi;b!==a&&(null!==a&&A(a,"function",
1575 If,"memberValidation"),this.Vi=a,this.g("memberValidation",b,a))}},ungroupable:{configurable:!0,get:function(){return 0!==(this.T&256)},set:function(a){var b=0!==(this.T&256);b!==a&&(A(a,"boolean",If,"ungroupable"),this.T^=256,this.g("ungroupable",b,a))}},isSubGraphExpanded:{configurable:!0,get:function(){return 0!==(this.T&512)},set:function(a){var b=0!==(this.T&512);if(b!==a){A(a,"boolean",If,"isSubGraphExpanded");this.T^=512;var c=this.diagram;this.g("isSubGraphExpanded",
1576 b,a);b=this.subGraphExpandedChanged;if(null!==b){var d=!0;null!==c&&(d=c.ba,c.ba=!0);b(this);null!==c&&(c.ba=d)}null!==c&&c.undoManager.isUndoingRedoing?(null!==this.Sa&&this.Sa.u(),this.memberParts.each(function(a){a.updateAdornments()})):a?this.expandSubGraph():this.collapseSubGraph()}}},wasSubGraphExpanded:{configurable:!0,get:function(){return 0!==(this.T&1024)},set:function(a){var b=0!==(this.T&1024);b!==a&&(A(a,"boolean",If,"wasSubGraphExpanded"),this.T^=1024,this.g("wasSubGraphExpanded",
1577 b,a))}},subGraphExpandedChanged:{configurable:!0,get:function(){return this.rq},set:function(a){var b=this.rq;b!==a&&(null!==a&&A(a,"function",If,"subGraphExpandedChanged"),this.rq=a,this.g("subGraphExpandedChanged",b,a))}},bi:{configurable:!0,get:function(){return 0!==(this.T&32768)},set:function(a){0!==(this.T&32768)!==a&&(this.T^=32768)}}});If.prototype.expandSubGraph=If.prototype.expandSubGraph;If.prototype.collapseSubGraph=If.prototype.collapseSubGraph;
1578 If.prototype.findSubGraphParts=If.prototype.Kk;If.prototype.findContainingGroupChain=If.prototype.oA;If.prototype.findExternalNodesConnected=If.prototype.pA;If.prototype.findExternalLinksConnected=If.prototype.fw;If.prototype.ensureBounds=If.prototype.Ya;If.className="Group";function xg(){O.call(this);this.ob=zc;this.$p=new L(NaN,NaN,NaN,NaN)}ma(xg,O);xg.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.ob=this.ob.K();a.$p=this.$p.copy()};
1579 xg.prototype.Vh=function(a){if(null===this.background&&null===this.areaBackground)return!1;var b=this.naturalBounds;return lc(0,0,b.width,b.height,a.x,a.y)};
1580 xg.prototype.Vm=function(){var a=this.part;null!==a&&(a instanceof If||a instanceof Ve)||v("Placeholder is not inside a Group or Adornment.");if(a instanceof If){var b=this.computeBorder(this.$p),c=this.minSize,d=this.wc;cc(d,(isFinite(c.width)?Math.max(c.width,b.width):b.width)||0,(isFinite(c.height)?Math.max(c.height,b.height):b.height)||0);Cl(this,0,0,d.width,d.height);d=a.memberParts;for(c=!1;d.next();)if(d.value.isVisible()){c=!0;break}d=a.diagram;!c||null===d||d.animationManager.tw(a)||isNaN(b.x)||
1581 isNaN(b.y)||(c=J.alloc(),c.Fj(b,a.locationSpot),c.A(a.location)||(a.location=new J(c.x,c.y)),J.free(c))}else{b=this.wc;c=this.ob;d=c.left+c.right;var e=c.top+c.bottom,f=a.adornedObject;a.angle=f.wj();var g=0;f instanceof Uf&&(g=f.strokeWidth);var h=f.Mf(),k=f.naturalBounds,l=(k.width+g)*h;g=(k.height+g)*h;a.type!==W.Link&&(f=f.ja("Selection"===a.category?Ec:a.locationSpot,J.alloc()),a.location=f,J.free(f));isNaN(l)||isNaN(g)?(a=a.adornedObject,l=a.ja(Ec,J.alloc()),f=L.allocAt(l.x,l.y,0,0),f.af(a.ja(Oc,
1582 l)),f.af(a.ja(Gc,l)),f.af(a.ja(Mc,l)),cc(b,f.width+d||0,f.height+e||0),Cl(this,-c.left,-c.top,b.width,b.height),J.free(l),L.free(f)):(cc(b,l+d||0,g+e||0),Cl(this,-c.left,-c.top,b.width,b.height))}};xg.prototype.Th=function(a,b,c,d){this.actualBounds.h(a,b,c,d)};
1583 xg.prototype.computeBorder=function(a){var b=this.part,c=b.diagram;if(null!==c&&b instanceof If&&!b.layer.isTemporary&&b.computesBoundsAfterDrag&&this.$p.o()){var d=c.toolManager.findTool("Dragging");if(d===c.currentTool&&(c=d.computeBorder(b,this.$p,a),null!==c))return c}c=L.alloc();d=this.computeMemberBounds(c);var e=this.ob;b instanceof If&&!b.isSubGraphExpanded?a.h(d.x-e.left,d.y-e.top,0,0):a.h(d.x-e.left,d.y-e.top,Math.max(d.width+e.left+e.right,0),Math.max(d.height+e.top+e.bottom,0));L.free(c);
1584 b instanceof If&&b.computesBoundsIncludingLocation&&b.location.o()&&a.af(b.location);return a};
1585 xg.prototype.computeMemberBounds=function(a){if(!(this.part instanceof If))return a.h(0,0,0,0),a;for(var b=this.part,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,g=b.memberParts;g.next();){var h=g.value;if(h.isVisible()){if(h instanceof S){if(!b.computesBoundsIncludingLinks)continue;if(Ij(h))continue;if(h.fromNode===b||h.toNode===b)continue}h=h.actualBounds;h.left<c&&(c=h.left);h.top<d&&(d=h.top);h.right>e&&(e=h.right);h.bottom>f&&(f=h.bottom)}}isFinite(c)&&isFinite(d)?a.h(c,d,e-c,f-d):(b=b.location,
1586 a.h(b.x,b.y,0,0));return a};na.Object.defineProperties(xg.prototype,{padding:{configurable:!0,get:function(){return this.ob},set:function(a){"number"===typeof a?a=new hc(a):w(a,hc,xg,"padding");var b=this.ob;b.A(a)||(this.ob=a=a.K(),this.g("padding",b,a),this.u())}}});xg.className="Placeholder";
1587 function S(){U.call(this,W.Link);this.La=8;this.hf=null;this.jf="";this.Df=this.to=null;this.Ef="";this.zq=null;this.jl=ng;this.Un=0;this.Wn=ng;this.Xn=NaN;this.pk=Ap;this.mq=.5;this.td=null;this.Fb=(new H).freeze();this.wf=this.Lc=null;this.km=new L;this.ua=new zd;this.L=this.w=this.Yf=this.gg=null;this.l=[];this.Iv=new J;this.os=this.ay=this.$x=null;this.dv=NaN;this.S=null}ma(S,U);
1588 S.prototype.cloneProtected=function(a){U.prototype.cloneProtected.call(this,a);a.La=this.La&-113;a.jf=this.jf;a.to=this.to;a.Ef=this.Ef;a.zq=this.zq;a.jl=this.jl;a.Un=this.Un;a.Wn=this.Wn;a.Xn=this.Xn;a.pk=this.pk;a.mq=this.mq;null!==this.S&&(a.S=this.S.copy())};t=S.prototype;t.Kf=function(a){U.prototype.Kf.call(this,a);this.jf=a.jf;this.Ef=a.Ef;a.Lc=null;a.Za();a.Yf=this.Yf;var b=a.fromPort;null!==b&&mp(b);a=a.toPort;null!==a&&mp(a)};
1589 t.pb=function(a){a.classType===S?2===(a.value&2)?this.routing=a:a===qg||a===mg||a===lg?this.curve=a:a===Bp||a===Cp||a===Dp?this.adjusting=a:a!==Ap&&a!==ng&&v("Unknown Link enum value for a Link property: "+a):U.prototype.pb.call(this,a)};t.Qc=function(){null===this.S&&(this.S=new yl)};t.Dj=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.Sw=function(){return!1};
1590 t.yu=function(){};t.Tc=function(){return!1};S.prototype.computeAngle=function(a,b,c){return S.computeAngle(b,c)};S.computeAngle=function(a,b){switch(a){default:case ng:a=0;break;case pn:a=b;break;case hn:a=b+90;break;case kn:a=b-90;break;case Ep:a=b+180;break;case qn:a=K.gr(b);90<a&&270>a&&(a-=180);break;case jn:a=K.gr(b+90);90<a&&270>a&&(a-=180);break;case ln:a=K.gr(b-90);90<a&&270>a&&(a-=180);break;case mn:a=K.gr(b);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return K.gr(a)};
1591 function hp(a){var b=a.fromNode,c=a.toNode,d=null;null!==b?d=null!==c?b.Ey(c):b.containingGroup:null!==c?d=c.containingGroup:d=null;b=d;c=a.yi;if(c!==b){null!==c&&cp(c,a);a.yi=b;null!==b&&bp(b,a);var e=a.containingGroupChanged;if(null!==e){var f=!0,g=a.diagram;null!==g&&(f=g.ba,g.ba=!0);e(a,c,b);null!==g&&(g.ba=f)}!a.Ad||a.$x!==c&&a.ay!==c||a.Za()}if(a.isLabeledLink)for(a=a.labelNodes;a.next();)a.value.containingGroup=d}t=S.prototype;
1592 t.Zh=function(){var a=this.containingGroup;null!==a&&this.fromNode!==a&&this.toNode!==a&&a.computesBoundsIncludingLinks&&U.prototype.Zh.call(this)};t.Xq=function(a){F&&w(a,V,S,"getOtherNode:node");var b=this.fromNode;return a===b?this.toNode:b};t.HA=function(a){F&&w(a,O,S,"getOtherPort:port");var b=this.fromPort;return a===b?this.toPort:b};function qp(a,b){null===a.td&&(a.td=new I);a.td.add(b);a.u()}
1593 t.Zq=function(a){U.prototype.Zq.call(this,a);Fp(this)&&this.ar(this.actualBounds);if(!a){a=this.hf;var b=null;null!==a&&(b=this.fromPort,op(a,this,b));var c=this.Df;if(null!==c){var d=this.toPort;c===a&&d===b||op(c,this,d)}Gp(this)}};t.$q=function(a){U.prototype.$q.call(this,a);Fp(this)&&this.ar(this.actualBounds);if(!a){a=this.hf;var b=null;null!==a&&(b=this.fromPort,pp(a,this,b));var c=this.Df;if(null!==c){var d=this.toPort;c===a&&d===b||pp(c,this,d)}Hp(this)}};
1594 t.Gk=function(){this.Ad=!0;if(null!==this.td){var a=this.diagram;if(null!==a)for(var b=this.td.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)}};
1595 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=J.allocAt(c.x+d,c.y+e),U.prototype.move.call(this,a,!1),J.free(a));Df(this,d,e);for(a=this.labelNodes;a.next();)b=a.value,c=b.position,b.moveTo(c.x+d,c.y+e)};
1596 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};
1597 S.prototype.computeMidPoint=function(a){var b=this.pointsCount;if(0===b)return a.assign(Qb),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()===qg))return this.ua.lw(.5,a),a.add(this.i(0)),c=this.ua.figures.first(),a.offset(-c.startX,-c.startY),a;if(this.computeCurve()===qg){if(3===b)return this.i(1);d=(b-1)/3|0;c=3*(d/2|0);if(1===d%2){d=this.i(c);var e=this.i(c+1),
1598 f=this.i(c+2);c=this.i(c+3);K.Pz(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;d<c/2&&f<b;){e=g[f];if(d+e>c/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};
1599 S.prototype.computeMidAngle=function(){var a=this.pointsCount;if(2>a)return NaN;if(2===a)return this.i(0).Va(this.i(1));if(this.isOrthogonal&&(15<=this.computeCorner()||this.computeCurve()===qg))return this.ua.Ky(.5);if(this.computeCurve()===qg&&4<=a){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){c=Math.floor(c);a=this.i(c);b=this.i(c+1);var d=this.i(c+2);c=this.i(c+3);return K.Oz(a.x,a.y,b.x,b.y,d.x,d.y,c.x,c.y)}if(0<c&&c+1<a)return this.i(c-1).Va(this.i(c+1))}b=this.flattenedLengths;d=this.flattenedTotalLength;
1600 var e=0;c=0;for(var f;e<d/2&&c<a;){f=b[c];if(e+f>d/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(0<c&&c+2<a)return this.i(c-1).Va(this.i(c+2))}else{if(1>Math.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.Va(d)};t=S.prototype;t.i=function(a){return this.Fb.j[a]};
1601 t.Wc=function(a,b){F&&(w(b,J,S,"setPoint"),b.o()||v("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.Vc(a,b)};t.O=function(a,b,c){F&&(C(b,S,"setPointAt:x"),C(c,S,"setPointAt:y"));F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.Vc(a,new J(b,c))};
1602 t.QA=function(a,b){F&&(w(b,J,S,"insertPoint"),b.o()||v("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.Bb(a,b)};t.m=function(a,b,c){F&&(C(b,S,"insertPointAt:x"),C(c,S,"insertPointAt:y"));F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.Bb(a,new J(b,c))};
1603 t.ke=function(a){F&&(w(a,J,S,"addPoint"),a.o()||v("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.add(a)};t.Hf=function(a,b){F&&(C(a,S,"insertPointAt:x"),C(b,S,"insertPointAt:y"));F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.add(new J(a,b))};
1604 t.Iw=function(a){F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.jb(a)};t.Bk=function(){F&&null===this.Lc&&v("Call Link.startRoute before modifying the points of the route.");this.Fb.clear()};
1605 function Df(a,b,c){if(0!==b||0!==c)if(0===a.pointsCount)a.defaultFromPoint&&a.defaultFromPoint.copy().offset(b,c),a.defaultToPoint&&a.defaultToPoint.copy().offset(b,c);else{for(var d=a.Ad,e=new H,f=a.Fb.iterator;f.next();){var g=f.value;e.add((new J(g.x+b,g.y+c)).freeze())}e.freeze();f=a.Fb;a.Fb=e;g=a.diagram;isNaN(b)||isNaN(c)||null!==g&&g.animationManager.yc?a.u():(a.pg.h(a.pg.x+b,a.pg.y+c),a.ra.h(a.ra.x+b,a.ra.y+c),Xl(a));d?Ip(a):(a.defaultFromPoint&&(a.defaultFromPoint=a.i(0)),a.defaultToPoint&&
1606 (a.defaultToPoint=a.i(a.pointsCount-1)));null!==g&&g.animationManager.yc&&(b=g.animationManager,a.wf=e,b.mm.add(a));a.g("points",f,e)}}t.di=function(){null===this.Lc&&(this.Lc=this.Fb,this.Fb=this.Fb.copy())};
1607 t.Jf=function(){if(null!==this.Lc){for(var a=this.Lc,b=this.Fb,c=Infinity,d=Infinity,e=a.j,f=e.length,g=0;g<f;g++){var h=e[g];c=Math.min(h.x,c);d=Math.min(h.y,d)}h=g=Infinity;for(var k=b.j,l=k.length,m=0;m<l;m++){var n=k[m];g=Math.min(n.x,g);h=Math.min(n.y,h);n.freeze()}b.freeze();if(l===f)for(f=0;f<l;f++){if(m=e[f],n=k[f],m.x-c!==n.x-g||m.y-d!==n.y-h){this.jc();break}}else this.jc();this.Lc=null;c=this.diagram;null!==c&&c.animationManager.yc&&(c=c.animationManager,this.wf=b,c.mm.add(this));Ip(this);
1608 this.g("points",a,b)}};t.Mw=function(){null!==this.Lc&&(this.Fb=this.Lc,this.Lc=null)};function Ip(a){0===a.Fb.count?a.Ad=!1:(a.Ad=!0,a.os=null,a.dv=NaN,a.defaultFromPoint=a.i(0),a.defaultToPoint=a.i(a.pointsCount-1),Jp(a,!1))}
1609 t.Za=function(){if(!this.suspendsRouting){var a=this.diagram;if(a){if(a.ku.contains(this)||a.undoManager.isUndoingRedoing)return;a=a.animationManager;if(a.isTicking&&!a.isAnimating)return;null!==this.wf&&!a.isTicking&&a.isAnimating&&(this.wf=null)}a=this.path;null!==a&&(this.Ad=!1,this.u(),a.u())}};t.Jj=function(){if(!this.Ad&&!this.Pt){var a=!0;try{this.Pt=!0,this.di(),a=this.computePoints()}catch(b){this.Pt=!1,this.Mw()}finally{this.Pt=!1,a?this.Jf():this.Mw()}}};
1610 S.prototype.computePoints=function(){if(null===this.diagram)return!1;var a=this.fromNode,b=null;null===a?(Kp||(Kp=new V,Kp.desiredSize=Rb,Kp.Ya()),this.defaultFromPoint&&(Kp.location=this.defaultFromPoint,Kp.Ya(),b=a=Kp)):b=this.fromPort;if(null!==b&&!a.isVisible()){var c=a.findVisibleNode();null!==c&&c!==a?(a=c,b=c.port):a=c}this.$x=a;if(null===a||!a.location.o())return!1;for(;!(null===b||b.actualBounds.o()&&b.Sf());)b=b.panel;if(null===b)return!1;var d=this.toNode,e=null;null===d?(Lp||(Lp=new V,
1611 Lp.desiredSize=Rb,Lp.Ya()),this.defaultToPoint&&(Lp.location=this.defaultToPoint,Lp.Ya(),e=d=Lp)):e=this.toPort;null===e||d.isVisible()||(c=d.findVisibleNode(),null!==c&&c!==d?(d=c,e=c.port):d=c);this.ay=d;if(null===d||!d.location.o())return!1;for(;!(null===e||e.actualBounds.o()&&e.Sf());)e=e.panel;if(null===e)return!1;var f=this.pointsCount,g=this.computeSpot(!0,b);c=this.computeSpot(!1,e);var h=Mp(g),k=Mp(c),l=b===e&&null!==b,m=this.isOrthogonal,n=this.curve===qg;this.gg=l&&!m?n=!0:!1;var p=this.computeAdjusting()===
1612 ng||l;if(!m&&!l&&h&&k){if(h=!1,!p&&3<=f&&(p=this.getLinkPoint(a,b,g,!0,!1,d,e),k=this.getLinkPoint(d,e,c,!1,!1,a,b),h=this.adjustPoints(0,p,f-1,k))&&(p=this.getLinkPoint(a,b,g,!0,!1,d,e),k=this.getLinkPoint(d,e,c,!1,!1,a,b),this.adjustPoints(0,p,f-1,k)),!h)if(this.Bk(),n){f=this.getLinkPoint(a,b,g,!0,!1,d,e);p=this.getLinkPoint(d,e,c,!1,!1,a,b);h=p.x-f.x;k=p.y-f.y;l=this.computeCurviness();n=m=0;var r=f.x+h/3,q=f.y+k/3,u=r,y=q;K.B(k,0)?y=0<h?y-l:y+l:(m=-h/k,n=Math.sqrt(l*l/(m*m+1)),0>l&&(n=-n),u=
1613 (0>k?-1:1)*n+r,y=m*(u-r)+q);r=f.x+2*h/3;q=f.y+2*k/3;var x=r,z=q;K.B(k,0)?z=0<h?z-l:z+l:(x=(0>k?-1:1)*n+r,z=m*(x-r)+q);this.Bk();this.ke(f);this.Hf(u,y);this.Hf(x,z);this.ke(p);this.Wc(0,this.getLinkPoint(a,b,g,!0,!1,d,e));this.Wc(3,this.getLinkPoint(d,e,c,!1,!1,a,b))}else if(f=d,p=e,d=this.getLinkPoint(a,b,g,!0,!1,f,p),e=this.getLinkPoint(f,p,c,!1,!1,a,b),this.hasCurviness())p=e.x-d.x,c=e.y-d.y,g=this.computeCurviness(),a=d.x+p/2,b=d.y+c/2,f=a,h=b,K.B(c,0)?h=0<p?h-g:h+g:(p=-p/c,f=Math.sqrt(g*g/(p*
1614 p+1)),0>g&&(f=-f),f=(0>c?-1:1)*f+a,h=p*(f-a)+b),this.ke(d),this.Hf(f,h),this.ke(e);else{this.ke(d);this.ke(e);h=L.alloc();b.xj(h);k=h.ca(e);p.xj(h);l=h.ca(d);if(k||l)g=b.ja(Np(g),new J),this.Wc(0,this.getLinkPointFromPoint(a,b,g,e,!0,g)),c=p.ja(Np(c),new J),this.Wc(1,this.getLinkPointFromPoint(f,p,c,d,!1,c));L.free(h)}}else{n=this.isAvoiding;p&&(m&&n||l)&&this.Bk();var B=l?this.computeCurviness():0;n=this.getLinkPoint(a,b,g,!0,m,d,e);r=u=q=0;if(m||!h||l)y=this.computeEndSegmentLength(a,b,g,!0),r=
1615 this.getLinkDirection(a,b,n,g,!0,m,d,e),l&&(h||g.A(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(r-=m?90:30,0>B&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),l&&(y+=Math.abs(B)*(m?1:2)),0===r?q=y:90===r?u=y:180===r?q=-y:270===r?u=-y:(q=y*Math.cos(r*Math.PI/180),u=y*Math.sin(r*Math.PI/180)),g.Sb()&&l&&(y=b.ja(Kc,J.alloc()),x=J.allocAt(y.x+1E3*q,y.y+1E3*u),this.getLinkPointFromPoint(a,b,y,x,!0,n),J.free(y),J.free(x));y=this.getLinkPoint(d,e,c,!1,m,a,b);var D=z=x=0;if(m||!k||l){var G=this.computeEndSegmentLength(d,e,
1616 c,!1);D=this.getLinkDirection(d,e,y,c,!1,m,a,b);l&&(k||g.A(c)||!m&&1===g.x+c.x&&1===g.y+c.y)&&(D+=m?0:30,0>B&&(D+=180));0>D?D+=360:360<=D&&(D-=360);l&&(G+=Math.abs(B)*(m?1:2));0===D?x=G:90===D?z=G:180===D?x=-G:270===D?z=-G:(x=G*Math.cos(D*Math.PI/180),z=G*Math.sin(D*Math.PI/180));c.Sb()&&l&&(c=e.ja(Kc,J.alloc()),g=J.allocAt(c.x+1E3*x,c.y+1E3*z),this.getLinkPointFromPoint(d,e,c,g,!1,y),J.free(c),J.free(g))}c=n;if(m||!h||l)c=new J(n.x+q,n.y+u);g=y;if(m||!k||l)g=new J(y.x+x,y.y+z);!p&&!m&&h&&3<f&&this.adjustPoints(0,
1617 n,f-2,g)?this.Wc(f-1,y):!p&&!m&&k&&3<f&&this.adjustPoints(1,c,f-1,y)?this.Wc(0,n):!p&&(m?6<=f:4<f)&&this.adjustPoints(1,c,f-2,g)?(this.Wc(0,n),this.Wc(f-1,y)):(this.Bk(),this.ke(n),(m||!h||l)&&this.ke(c),m&&this.addOrthoPoints(c,r,g,D,a,d),(m||!k||l)&&this.ke(g),this.ke(y))}return!0};function Op(a,b){Math.abs(b.x-a.x)>Math.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}
1618 S.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new J);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.pe()||(e=e.panel);if(null===e){e=d.x;d=d.y;var g=c.x;c=c.y}else{a=e.Md;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.Lk(e,d,g,c,f);null!==
1619 a&&f.transform(a);return f};function Pp(a,b){var c=b.Lp;null===c&&(c=new Qp,c.port=b,c.node=b.part,b.Lp=c);return Rp(c,a)}
1620 S.prototype.getLinkPoint=function(a,b,c,d,e,f,g,h){void 0===h&&(h=new J);if(c.eb()&&!Mp(c))return b.ja(c,h),h;if(c.Uc()){var k=Pp(this,b);if(null!==k){h.assign(k.dr);if(e&&this.routing===Sp){var l=Pp(this,g);if(null!==l&&k.Km<l.Km){k=J.alloc();l=J.alloc();var m=new L(b.ja(Ec,k),b.ja(Oc,l)),n=this.computeSpot(!d,g);a=this.getLinkPoint(f,g,n,!d,e,a,b,l);(c.Qf(Rc)||c.Qf(Sc))&&a.y>=m.y&&a.y<=m.y+m.height?h.y=a.y:(c.Qf(Pc)||c.Qf(Tc))&&a.x>=m.x&&a.x<=m.x+m.width&&(h.x=a.x);J.free(k);J.free(l)}}return h}}c=
1621 b.ja(Np(c),J.alloc());this.pointsCount>(e?6:2)?(g=d?this.i(1):this.i(this.pointsCount-2),e&&(g=Op(c,g.copy()))):(k=this.computeSpot(!d,g),f=J.alloc(),g=g.ja(Np(k),f),e&&(g=Op(c,g)),J.free(f));this.getLinkPointFromPoint(a,b,c,g,d,h);J.free(c);return h};
1622 S.prototype.getLinkDirection=function(a,b,c,d,e,f,g,h){a:if(d.eb())var k=d.x>d.y?d.x>1-d.y?0:d.x<1-d.y?270:315:d.x<d.y?d.x>1-d.y?90:d.x<1-d.y?180:135:.5>d.x?225:.5<d.x?45:0;else{if(d.Uc()&&(k=Pp(this,b),null!==k))switch(k.Gc){case 1:k=270;break a;case 2:k=180;break a;default:case 4:k=0;break a;case 8:k=90;break a}k=b.ja(Kc,J.alloc());this.pointsCount>(f?6:2)?(h=e?this.i(1):this.i(this.pointsCount-2),h=f?Op(k,h.copy()):c):(c=J.alloc(),h=h.ja(Kc,c),J.free(c));c=Math.abs(h.x-k.x)>Math.abs(h.y-k.y)?h.x>=
1623 k.x?0:180:h.y>=k.y?90:270;J.free(k);k=c}d.Sb()&&g.Qd(a)&&(k+=180,360<=k&&(k-=360));if(Mp(d))return k;a=b.wj();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.Uc()&&(a=Pp(this,b),null!==a))return a.dw;a=d?this.fromEndSegmentLength:this.toEndSegmentLength;null!==b&&isNaN(a)&&(a=d?b.fromEndSegmentLength:b.toEndSegmentLength);isNaN(a)&&(a=10);return a};
1624 S.prototype.computeSpot=function(a,b){void 0===b&&(b=null);a?(a=b?b:this.fromPort,null===a?a=Kc:(b=this.fromSpot,b.Ib()&&(b=a.fromSpot),a=b===fd?Bc:b)):(a=b?b:this.toPort,null===a?a=Kc:(b=this.toSpot,b.Ib()&&(b=a.toSpot),a=b===fd?Bc:b));return a};function Mp(a){return a===Bc||.5===a.x&&.5===a.y}function Np(a){return.5===a.x&&.5===a.y?a:Kc}
1625 S.prototype.computeOtherPoint=function(a,b){if(this.computeAdjusting()!==ng&&4<this.pointsCount)return this.computeMidPoint(new J);a=b.Lp;a=null!==a?Rp(a,this):null;return null!==a?a.dr:b.ja(Kc)};S.prototype.computeShortLength=function(a){if(a){a=this.fromShortLength;if(isNaN(a)){var b=this.fromPort;null!==b&&(a=b.fromShortLength)}return isNaN(a)?0:a}a=this.toShortLength;isNaN(a)&&(b=this.toPort,null!==b&&(a=b.toShortLength));return isNaN(a)?0:a};
1626 S.prototype.Lf=function(a,b,c,d,e,f){if(!1===this.pickable)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var g=f;void 0===f&&(g=Gb.alloc(),g.reset());g.multiply(this.transform);if(this.Uh(a,g))return Bn(this,b,c,e),void 0===f&&Gb.free(g),!0;if(this.Sc(a,g)){var h=!1;if(!this.isAtomic)for(var k=this.$.j,l=k.length;l--;){var m=k[l];if(m.visible||m===this.locationObject){var n=m.actualBounds,p=this.naturalBounds;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=Gb.alloc();n.set(g);
1627 if(m instanceof W)h=m.Lf(a,b,c,d,e,n);else if(this.path===m){if(m instanceof Uf)if(h=a,p=d,!1===m.pickable)h=!1;else if(n.multiply(m.transform),p)b:{var r=h,q=n;if(m.Uh(r,q))h=!0;else{if(void 0===q&&(q=m.transform,r.Te(m.actualBounds))){h=!0;break b}h=r.left;p=r.right;var u=r.top;r=r.bottom;var y=J.alloc(),x=J.alloc(),z=J.alloc(),B=Gb.alloc();B.set(q);B.xw(m.transform);B.eu();x.x=p;x.y=u;x.transform(B);y.x=h;y.y=u;y.transform(B);q=!1;Tn(m,y,x,z)?q=!0:(y.x=p,y.y=r,y.transform(B),Tn(m,y,x,z)?q=!0:(x.x=
1628 h,x.y=r,x.transform(B),Tn(m,y,x,z)?q=!0:(y.x=h,y.y=u,y.transform(B),Tn(m,y,x,z)&&(q=!0))));Gb.free(B);J.free(y);J.free(x);J.free(z);h=q}}else h=m.Uh(h,n)}else h=El(m,a,d,n);h&&(p=m,null!==b&&(p=b(m)),p&&(null===c||c(p))&&e.add(p));Gb.free(n)}}}void 0===f&&Gb.free(g);return h||null!==this.background||null!==this.areaBackground}void 0===f&&Gb.free(g);return!1};
1629 S.prototype.computeCurve=function(){if(null===this.gg){var a=this.fromPort,b=this.isOrthogonal;this.gg=null!==a&&a===this.toPort&&!b}return this.gg?qg:this.curve};S.prototype.computeCorner=function(){if(this.curve===qg)return 0;var a=this.corner;if(isNaN(a)||0>a)a=10;return a};
1630 S.prototype.findMidLabel=function(){for(var a=this.path,b=this.$.j,c=b.length,d=0;d<c;d++){var e=b[d];if(e!==a&&!e.isPanelMain&&(-Infinity===e.segmentIndex||isNaN(e.segmentIndex)))return e}for(a=this.labelNodes;a.next();)if(b=a.value,-Infinity===b.segmentIndex||isNaN(b.segmentIndex))return b;return null};
1631 S.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a=Tp;a=Math.max(a,this.computeThickness());var b=this.fromPort,c=this.toPort;if(null!==b&&null!==c){var d=this.findMidLabel();if(null!==d){var e=d.naturalBounds,f=d.margin,g=isNaN(e.width)?30:e.width*d.scale+f.left+f.right;e=isNaN(e.height)?14:e.height*d.scale+f.top+f.bottom;d=d.segmentOrientation;d===pn||d===qn||d===Ep?a=Math.max(a,e):d===kn||d===ln||d===hn||d===jn?a=Math.max(a,g):(b=b.ja(Kc).Va(c.ja(Kc))/180*Math.PI,a=Math.max(a,
1632 Math.abs(Math.sin(b)*g)+Math.abs(Math.cos(b)*e)+1));this.curve===qg&&(a*=1.333)}}return a};S.prototype.arrangeBundledLinks=function(a,b){if(b)for(b=0;b<a.length;b++){var c=a[b];c.computeAdjusting()===ng&&c.Za()}};
1633 S.prototype.computeCurviness=function(){var a=this.curviness;if(isNaN(a)){a=Up;var b=this.Yf;if(null!==b){for(var c=Ma(),d=0,e=b.links,f=0;f<e.length;f++){var g=e[f].computeSpacing();c.push(g);d+=g}d=-d/2;for(f=0;f<e.length;f++){if(e[f]===this){a=d+c[f]/2;break}d+=c[f]}b.nu===this.fromNode&&(a=-a);Oa(c)}}return a};S.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return null!==a?Math.max(a.strokeWidth,1):1};
1634 S.prototype.hasCurviness=function(){return!isNaN(this.curviness)||null!==this.Yf};
1635 S.prototype.adjustPoints=function(a,b,c,d){var e=this.computeAdjusting();if(this.isOrthogonal){if(e===Cp)return!1;e===Dp&&(e=Bp)}switch(e){case Cp:var f=this.i(a),g=this.i(c);if(!f.Wa(b)||!g.Wa(d)){e=f.x;f=f.y;var h=g.x-e,k=g.y-f,l=Math.sqrt(h*h+k*k);if(!K.da(l,0)){if(K.da(h,0))var m=0>k?-Math.PI/2:Math.PI/2;else m=Math.atan(k/Math.abs(h)),0>h&&(m=Math.PI-m);g=b.x;var n=b.y;h=d.x-g;var p=d.y-n;k=Math.sqrt(h*h+p*p);K.da(h,0)?p=0>p?-Math.PI/2:Math.PI/2:(p=Math.atan(p/Math.abs(h)),0>h&&(p=Math.PI-p));
1636 l=k/l;m=p-m;this.Wc(a,b);for(a+=1;a<c;a++)b=this.i(a),h=b.x-e,k=b.y-f,b=Math.sqrt(h*h+k*k),K.da(b,0)||(K.da(h,0)?k=0>k?-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.Wc(c,d)}}return!0;case Dp:f=this.i(a);n=this.i(c);if(!f.Wa(b)||!n.Wa(d)){e=f.x;f=f.y;g=n.x;n=n.y;l=(g-e)*(g-e)+(n-f)*(n-f);h=b.x;m=b.y;k=d.x;p=d.y;var r=1;if(0!==k-h){var q=(p-m)/(k-h);r=Math.sqrt(1+1/(q*q))}else q=9E9;this.Wc(a,b);for(a+=1;a<c;a++){b=this.i(a);
1637 var u=b.x,y=b.y,x=.5;0!==l&&(x=((e-u)*(e-g)+(f-y)*(f-n))/l);var z=e+x*(g-e),B=f+x*(n-f);b=Math.sqrt((u-z)*(u-z)+(y-B)*(y-B));y<q*(u-z)+B&&(b=-b);0<q&&(b=-b);u=h+x*(k-h);x=m+x*(p-m);0!==q?(b=u+b/r,this.O(a,b,x-(b-u)/q)):this.O(a,u,x+b)}this.Wc(c,d)}return!0;case Bp:a:{if(this.isOrthogonal&&(e=this.i(a),f=this.i(a+1),g=this.i(a+2),h=f.x,m=f.y,n=h,l=m,K.B(e.y,f.y)?K.B(f.x,g.x)?m=b.y:K.B(f.y,g.y)&&(h=b.x):K.B(e.x,f.x)&&(K.B(f.y,g.y)?h=b.x:K.B(f.x,g.x)&&(m=b.y)),this.O(a+1,h,m),e=this.i(c),f=this.i(c-
1638 1),g=this.i(c-2),h=f.x,m=f.y,k=h,p=m,K.B(e.y,f.y)?K.B(f.x,g.x)?m=d.y:K.B(f.y,g.y)&&(h=d.x):K.B(e.x,f.x)&&(K.B(f.y,g.y)?h=d.x:K.B(f.x,g.x)&&(m=d.y)),this.O(c-1,h,m),gk(this))){this.O(a+1,n,l);this.O(c-1,k,p);c=!1;break a}this.Wc(a,b);this.Wc(c,d);c=!0}return c;default:return!1}};
1639 S.prototype.addOrthoPoints=function(a,b,c,d,e,f){0>b?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.o()&&k.o()){h.Pc(Vp,Vp);k.Pc(Vp,Vp);h.af(a);k.af(c);if(0===b)if(c.x>a.x||270===d&&c.y<a.y&&k.right>a.x||90===d&&c.y>a.y&&k.right>a.x){var l=new J(c.x,a.y);var m=new J(c.x,(a.y+c.y)/2);180===d?(l.x=this.computeMidOrthoPosition(a.x,
1640 a.y,c.x,c.y,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x<k.left?this.computeMidOrthoPosition(a.x,a.y,k.left,c.y,!1):a.x<k.right&&(270===d&&a.y<k.top||90===d&&a.y>k.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.x<k.left&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y)}else{l=new J(a.x,c.y);m=new J((a.x+c.x)/2,c.y);if(180===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)180===d&&(k.ca(a)||
1641 h.ca(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.y<a.y&&(180===d||90===d)?l.y=this.computeMidOrthoPosition(a.x,h.top,c.x,Math.max(c.y,k.bottom),!0):c.y>a.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.bottom)if(c.x>=h.left&&c.x<=a.x||a.x<=k.right&&a.x>=c.x){if(90===d||270===d)l=new J(Math.max((a.x+c.x)/2,a.x),a.y),m=new J(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,0===d?h.top:
1642 Math.min(h.top,k.top)):Math.max(c.y,0===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(180===b)if(c.x<a.x||270===d&&c.y<a.y&&k.left<a.x||90===d&&c.y>a.y&&k.left<a.x)l=new J(c.x,a.y),m=new J(c.x,(a.y+c.y)/2),0===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.y<a.y||90===d&&c.y>a.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.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,a.y,c.x,
1643 c.y,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.y<k.bottom&&(l.x=a.x,l.y=a.y<c.y?Math.min(c.y,k.top):Math.max(c.y,k.bottom),m.y=l.y);else{l=new J(a.x,c.y);m=new J((a.x+c.x)/2,c.y);if(0===d||90===d&&c.y<h.top||270===d&&c.y>h.bottom)0===d&&(k.ca(a)||h.ca(c))?l.y=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!0):c.y<a.y&&(0===d||90===d)?l.y=this.computeMidOrthoPosition(a.x,h.top,c.x,Math.max(c.y,k.bottom),!0):c.y>a.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(a.x,h.bottom,
1644 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.bottom)if(c.x<=h.right&&c.x>=a.x||a.x>=k.left&&a.x<=c.x){if(90===d||270===d)l=new J(Math.min((a.x+c.x)/2,a.x),a.y),m=new J(l.x,c.y)}else l.y=270===d||(0===d||180===d)&&c.y<a.y?Math.min(c.y,180===d?h.top:Math.min(h.top,k.top)):Math.max(c.y,180===d?h.bottom:Math.max(h.bottom,k.bottom)),m.x=c.x,m.y=l.y}else if(90===b)if(c.y>a.y||180===d&&c.x<a.x&&k.bottom>a.y||0===d&&c.x>a.x&&k.bottom>a.y)l=new J(a.x,c.y),m=new J((a.x+c.x)/2,c.y),270===
1645 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.x<a.x||0===d&&c.x>a.x?(l.y=a.y<k.top?this.computeMidOrthoPosition(a.x,a.y,c.x,k.top,!0):a.y<k.bottom&&(180===d&&a.x<k.left||0===d&&a.x>k.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.y<k.top&&a.x>k.left&&a.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new J(c.x,a.y);m=new J(c.x,(a.y+c.y)/2);if(270===d||0===d&&c.x<h.left||180===
1646 d&&c.x>h.right)270===d&&(k.ca(a)||h.ca(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.x<a.x&&(270===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,a.y,Math.max(c.x,k.right),c.y,!1):c.x>a.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.right)if(c.y>=h.top&&c.y<=a.y||a.y<=k.bottom&&a.y>=c.y){if(0===d||180===d)l=new J(a.x,Math.max((a.y+c.y)/2,a.y)),m=new J(c.x,l.y)}else l.x=180===d||(90===d||270===
1647 d)&&c.x<a.x?Math.min(c.x,90===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,90===d?h.right:Math.max(h.right,k.right)),m.x=l.x,m.y=c.y}else if(c.y<a.y||180===d&&c.x<a.x&&k.top<a.y||0===d&&c.x>a.x&&k.top<a.y)l=new J(a.x,c.y),m=new J((a.x+c.x)/2,c.y),90===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.x<a.x||0===d&&c.x>=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.x<k.left||0===d&&a.x>k.right)?this.computeMidOrthoPosition(a.x,
1648 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.x<k.right&&(l.x=a.x<c.x?Math.min(c.x,k.left):Math.max(c.x,k.right),l.y=a.y,m.x=l.x);else{l=new J(c.x,a.y);m=new J(c.x,(a.y+c.y)/2);if(90===d||0===d&&c.x<h.left||180===d&&c.x>h.right)90===d&&(k.ca(a)||h.ca(c))?l.x=this.computeMidOrthoPosition(a.x,a.y,c.x,c.y,!1):c.x<a.x&&(90===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,a.y,Math.max(c.x,k.right),c.y,!1):c.x>a.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,
1649 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.right)if(c.y<=h.bottom&&c.y>=a.y||a.y>=k.top&&a.y<=c.y){if(0===d||180===d)l=new J(a.x,Math.min((a.y+c.y)/2,a.y)),m=new J(c.x,l.y)}else l.x=180===d||(90===d||270===d)&&c.x<a.x?Math.min(c.x,270===d?h.left:Math.min(h.left,k.left)):Math.max(c.x,270===d?h.right:Math.max(h.right,k.right)),m.x=l.x,m.y=c.y}var n=l,p=m,r=c;if(this.isAvoiding){var q=this.diagram;if(null===q||e===f||this.layer.isTemporary||!yk(q)||h.ca(r)&&!f.Qd(e)||k.ca(a)&&
1650 !e.Qd(f))b=!1;else{var u=zk(q,!0,this.containingGroup,null);if(17!==this.segmentIndex&&u.Pk(Math.min(a.x,n.x),Math.min(a.y,n.y),Math.abs(a.x-n.x),Math.abs(a.y-n.y))&&u.Pk(Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y))&&u.Pk(Math.min(p.x,r.x),Math.min(p.y,r.y),Math.abs(p.x-r.x),Math.abs(p.y-r.y)))b=!1;else{e=a;f=r;var y=c=null;if(q.isVirtualized){q=u.bounds.copy();q.Pc(-u.Mq,-u.Lq);var x=J.alloc();Ok(u,a.x,a.y)||(K.Of(q.x,q.y,q.x+q.width,q.y+q.height,a.x,a.y,n.x,n.y,x)?(c=
1651 a=x.copy(),b=x.Va(n)):K.Of(q.x,q.y,q.x+q.width,q.y+q.height,n.x,n.y,p.x,p.y,x)?(c=a=x.copy(),b=x.Va(p)):K.Of(q.x,q.y,q.x+q.width,q.y+q.height,p.x,p.y,r.x,r.y,x)&&(c=a=x.copy(),b=x.Va(r)));Ok(u,r.x,r.y)||(K.Of(q.x,q.y,q.x+q.width,q.y+q.height,r.x,r.y,p.x,p.y,x)?(y=r=x.copy(),d=p.Va(x)):K.Of(q.x,q.y,q.x+q.width,q.y+q.height,p.x,p.y,n.x,n.y,x)?(y=r=x.copy(),d=n.Va(x)):K.Of(q.x,q.y,q.x+q.width,q.y+q.height,n.x,n.y,a.x,a.y,x)&&(y=r=x.copy(),d=a.Va(x)));J.free(x)}h=h.copy().Xc(k);h.Pc(u.Mq*u.lz,u.Lq*u.lz);
1652 Wp(u,a,b,r,d,h,!0);k=Xp(u,r.x,r.y);!u.abort&&k>=Yp&&(Nk(u),h.Pc(u.Mq*u.Wy,u.Lq*u.Wy),Wp(u,a,b,r,d,h,!1),k=Xp(u,r.x,r.y));if(!u.abort&&k<Yp&&Xp(u,r.x,r.y)!==Pk){Zp(this,u,r.x,r.y,d,!0,g);h=this.i(2);if(4>this.pointsCount)0===b||180===b?(h.x=a.x,h.y=r.y):(h.x=r.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)K.B(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)):K.B(h.y,g.y)?(Math.abs(a.y-h.y)<=u.Lq/2&&(this.O(2,h.x,a.y),this.O(3,
1653 g.x,a.y)),this.m(2,h.x,a.y)):this.O(2,a.x,h.y);else if(90===b||270===b)K.B(h.y,g.y)?(h=90===b?Math.max(h.y,a.y):Math.min(h.y,a.y),this.O(2,a.x,h),this.O(3,g.x,h)):K.B(h.x,g.x)?(Math.abs(a.x-h.x)<=u.Mq/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!==y&&(0===d||180===d?this.Hf(f.x,y.y):this.Hf(y.x,f.y));b=
1654 !0}else b=!1}}}else b=!1;b||(this.ke(l),this.ke(m))}};S.prototype.computeMidOrthoPosition=function(a,b,c,d,e){var f=0;!this.hasCurviness()||this.computeSpot(!0,this.fromPort).Uc()||this.computeSpot(!1,this.toPort).Uc()||(f=this.computeCurviness());return e?(b+d)/2+f:(a+c)/2+f};
1655 function gk(a){if(null===a.diagram||!a.isAvoiding||!yk(a.diagram))return!1;var b=a.points.j,c=b.length;if(4>c)return!1;a=zk(a.diagram,!0,a.containingGroup,null);for(var d=1;d<c-2;d++){var e=b[d],f=b[d+1];if(!a.Pk(Math.min(e.x,f.x),Math.min(e.y,f.y),Math.abs(e.x-f.x),Math.abs(e.y-f.y)))return!0}return!1}
1656 function Zp(a,b,c,d,e,f,g){var h=b.Mq,k=b.Lq,l=Xp(b,c,d),m=c,n=d;0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;e!==g&&l>$p&&Xp(b,m,n)!==l-1&&(Xp(b,c-h,d)===l-1?(e=180,m=c-h,n=d):Xp(b,c+h,d)===l-1?(e=0,m=c+h,n=d):Xp(b,c,d-k)===l-1?(e=270,m=c,n=d-k):Xp(b,c,d+k)===l-1&&(e=90,m=c,n=d+k));for(;l>$p&&Xp(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>$p)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/
1657 k)*k+k/2;l>$p&&(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),Xp(b,g,m)===l-1?Zp(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),Xp(b,g,m)===l-1&&Zp(a,b,g,m,f,!1,f)));a.Hf(c,d)}
1658 S.prototype.lA=function(a){F&&w(a,J,S,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.i(0),d=this.i(1),e=Ib(b,a,c.x,c.y,d.x,d.y),f=0,g=1;g<this.pointsCount-1;g++){c=this.i(g+1);var h=Ib(b,a,d.x,d.y,c.x,c.y);d=c;h<e&&(f=g,e=h)}return f};S.prototype.jc=function(){this.on=!1;this.u()};
1659 S.prototype.Rk=function(a){if(!a){if(!1===this.Ad)return;a=this.yb();if(this.on&&(null===a||null!==a.geometry))return}this.ua=this.makeGeometry();a=this.path;if(null!==a){a.ua=this.ua;for(var b=this.$.j,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.isPanelMain&&e instanceof Uf&&(e.ua=this.ua)}}};
1660 S.prototype.makeGeometry=function(){var a=this.ua,b=this.pointsCount;if(2>b)return a.type=Gd,this.on=!0,a;var c=!1,d=this.diagram;null!==d&&Fp(this)&&d.hh.contains(this)&&(0!==this.km.width||0!==this.km.height)&&(c=!0);var e=this.i(0).copy(),f=e.copy();d=this.Fb.j;var g=this.computeCurve();if(g===qg&&3<=b&&!K.da(this.smoothness,0))if(3===b){var h=this.i(1);d=Math.min(e.x,h.x);var k=Math.min(e.y,h.y);h=this.i(2);d=Math.min(d,h.x);k=Math.min(k,h.y)}else{if(this.isOrthogonal)for(k=0;k<b;k++)h=d[k],f.x=
1661 Math.min(h.x,f.x),f.y=Math.min(h.y,f.y);else for(d=3;d<b;d+=3)d+3>=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;k<b;k++)h=d[k],f.x=Math.min(h.x,f.x),f.y=Math.min(h.y,f.y);d=f.x;k=f.y}d-=this.Iv.x;k-=this.Iv.y;e.x-=d;e.y-=k;if(2!==b||Fp(this)){a.type=Ad;h=Od(a);0!==this.computeShortLength(!0)&&(e=aq(this,e,!0,f));Pd(h,e.x,e.y,!1);if(g===qg&&3<=b&&!K.da(this.smoothness,0))if(3===b)c=this.i(1),b=c.x-d,c=c.y-k,e=this.i(2).copy(),e.x-=d,e.y-=k,0!==this.computeShortLength(!1)&&
1662 (e=aq(this,e,!1,f)),Td(h,b,c,b,c,e.x,e.y);else if(this.isOrthogonal){f=new J(d,k);e=this.i(1).copy();g=new J(d,k);b=new J(d,k);c=this.i(0);for(var l,m=this.smoothness/3,n=1;n<this.pointsCount-1;n++){l=this.i(n);var p=c,r=l,q=this.i(bq(this,l,n,!1));if(!K.da(p.x,r.x)||!K.da(r.x,q.x))if(!K.da(p.y,r.y)||!K.da(r.y,q.y)){var u=m;isNaN(u)&&(u=this.smoothness/3);var y=p.x;p=p.y;var x=r.x;r=r.y;var z=q.x;q=q.y;var B=u*cq(y,p,x,r);u*=cq(x,r,z,q);K.da(p,r)&&K.da(x,z)&&(x>y?q>r?(g.x=x-B,g.y=r-B,b.x=x+u,b.y=
1663 r+u):(g.x=x-B,g.y=r+B,b.x=x+u,b.y=r-u):q>r?(g.x=x+B,g.y=r-B,b.x=x-u,b.y=r+u):(g.x=x+B,g.y=r+B,b.x=x-u,b.y=r-u));K.da(y,x)&&K.da(r,q)&&(r>p?(z>x?(g.x=x-B,g.y=r-B,b.x=x+u):(g.x=x+B,g.y=r-B,b.x=x-u),b.y=r+u):(z>x?(g.x=x-B,g.y=r+B,b.x=x+u):(g.x=x+B,g.y=r+B,b.x=x-u),b.y=r-u));if(K.da(y,x)&&K.da(x,z)||K.da(p,r)&&K.da(r,q))y=.5*(y+z),p=.5*(p+q),g.x=y,g.y=p,b.x=y,b.y=p;1===n?(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y)):2===n&&K.da(c.x,this.i(0).x)&&K.da(c.y,this.i(0).y)&&(e.x=.5*(c.x+l.x),e.y=.5*(c.y+l.y));Td(h,e.x-
1664 d,e.y-k,g.x-d,g.y-k,l.x-d,l.y-k);f.set(g);e.set(b);c=l}}f=c.x;c=c.y;e=this.i(this.pointsCount-1);0!==this.computeShortLength(!1)&&(e=aq(this,e.copy(),!1,Mb));f=.5*(f+e.x);c=.5*(c+e.y);Td(h,b.x-d,b.y-k,f-d,c-k,e.x-d,e.y-k)}else for(c=3;c<b;c+=3)f=this.i(c-2),c+3>=b&&(c=b-1),e=this.i(c-1),g=this.i(c),c===b-1&&0!==this.computeShortLength(!1)&&(g=aq(this,g.copy(),!1,Mb)),Td(h,f.x-d,f.y-k,e.x-d,e.y-k,g.x-d,g.y-k);else{f=J.alloc();f.assign(this.i(0));e=J.alloc();e.assign(f);g=this.computeCorner();n=1;for(l=
1665 0;n<b;){n=bq(this,f,n,1<n);m=this.i(n);if(n>=b-1){if(!f.A(m))0!==this.computeShortLength(!1)&&(m=aq(this,m.copy(),!1,Mb)),dq(this,h,-d,-k,f,m,c);else if(0===l)for(n=1;n<b;)e.assign(f),m=this.i(n++),dq(this,h,-d,-k,f,m,c),f.assign(m);break}l=bq(this,m,n+1,n<b-3);n=-d;y=-k;p=m;u=this.i(l);x=c;if(K.B(f.y,p.y)&&K.B(p.x,u.x))if(r=Math.min(g,Math.abs(p.x-e.x)/2),r=z=Math.min(r,Math.abs(u.y-p.y)/2),K.B(r,0))dq(this,h,n,y,f,p,x),f.assign(p);else{q=p.x;B=p.y;var D=q,G=B;p.x>f.x?q=p.x-r:q=p.x+r;u.y>p.y?G=p.y+
1666 z:G=p.y-z;dq(this,h,n,y,f,new J(q,B),x);Ud(h,p.x+n,p.y+y,D+n,G+y);f.h(D,G)}else K.B(f.x,p.x)&&K.B(p.y,u.y)?(r=Math.min(g,Math.abs(p.y-e.y)/2),r=z=Math.min(r,Math.abs(u.x-p.x)/2),K.B(z,0)?(dq(this,h,n,y,f,p,x),f.assign(p)):(q=p.x,B=p.y,D=q,G=B,p.y>f.y?B=p.y-r:B=p.y+r,u.x>p.x?D=p.x+z:D=p.x-z,dq(this,h,n,y,f,new J(q,B),x),Ud(h,p.x+n,p.y+y,D+n,G+y),f.h(D,G))):(dq(this,h,n,y,f,p,x),f.assign(p));e.assign(m);n=l}J.free(f)}Xd=h}else h=this.i(1).copy(),h.x-=d,h.y-=k,0!==this.computeShortLength(!0)&&(e=aq(this,
1667 e,!0,f)),0!==this.computeShortLength(!1)&&(h=aq(this,h,!1,f)),a.type=Gd,a.startX=e.x,a.startY=e.y,a.endX=h.x,a.endY=h.y;this.on=!0;return a};function cq(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return K.da(a,0)?b:K.da(b,0)?a:Math.sqrt(a*a+b*b)}
1668 function aq(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=cq(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=cq(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}
1669 function bq(a,b,c,d){for(var e=a.pointsCount,f=b;K.da(b.x,f.x)&&K.da(b.y,f.y);){if(c>=e)return e-1;f=a.i(c++)}if(!K.da(b.x,f.x)&&!K.da(b.y,f.y))return c-1;for(var g=f;K.da(b.x,f.x)&&K.da(f.x,g.x)&&(!d||(b.y>=f.y?f.y>=g.y:f.y<=g.y))||K.da(b.y,f.y)&&K.da(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};
1670 function dq(a,b,c,d,e,f,g){if(!g&&Fp(a)){g=a.computeJumpLength();var h=g/2,k=[],l=0;a.isVisible()&&(l=eq(a,e,f,k));if(0<l)if(K.B(e.y,f.y))if(e.x<f.x)for(var m=0;m<l;){var n=Math.max(e.x,Math.min(k[m++]-h,f.x-g));b.lineTo(n+c,f.y+d);var p=n+c;for(var r=Math.min(n+g,f.x);m<l;)if(n=k[m],n<r+g)m++,r=Math.min(n+h,f.x);else break;n=f.y-g+d;r+=c;var q=f.y+d;a.curve===mg?Pd(b,r,q,!1):Td(b,p,n,r,n,r,q)}else for(--l;0<=l;){m=Math.min(e.x,Math.max(k[l--]+h,f.x+g));b.lineTo(m+c,f.y+d);p=m+c;for(n=Math.max(m-
1671 g,f.x);0<=l;)if(m=k[l],m>n-g)l--,n=Math.max(m-h,f.x);else break;m=f.y-g+d;n+=c;r=f.y+d;a.curve===mg?Pd(b,n,r,!1):Td(b,p,m,n,m,n,r)}else if(K.B(e.x,f.x))if(e.y<f.y)for(m=0;m<l;){n=Math.max(e.y,Math.min(k[m++]-h,f.y-g));b.lineTo(f.x+c,n+d);p=n+d;for(n=Math.min(n+g,f.y);m<l;)if(r=k[m],r<n+g)m++,n=Math.min(r+h,f.y);else break;r=f.x-g+c;q=f.x+c;n+=d;a.curve===mg?Pd(b,q,n,!1):Td(b,r,p,r,n,q,n)}else for(--l;0<=l;){m=Math.min(e.y,Math.max(k[l--]+h,f.y+g));b.lineTo(f.x+c,m+d);p=m+d;for(m=Math.max(m-g,f.y);0<=
1672 l;)if(n=k[l],n>m-g)l--,m=Math.max(n-h,f.y);else break;n=f.x-g+c;r=f.x+c;m+=d;a.curve===mg?Pd(b,r,m,!1):Td(b,n,p,n,m,r,m)}}b.lineTo(f.x+c,f.y+d)}
1673 function eq(a,b,c,d){var e=a.diagram;if(null===e||b.A(c))return 0;for(e=e.layers;e.next();){var f=e.value;if(null!==f&&f.visible){f=f.Ja.j;for(var g=f.length,h=0;h<g;h++){var k=f[h];if(k instanceof S){if(k===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(k.isVisible()&&Fp(k)){var l=k.routeBounds;l.o()&&a.routeBounds.Sc(l)&&!a.usesSamePort(k)&&(l=k.path,null!==l&&l.Sf()&&fq(b,c,d,k))}}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
1674 function fq(a,b,c,d){for(var e=K.B(a.y,b.y),f=d.pointsCount,g=d.i(0),h=J.alloc(),k=1;k<f;k++){var l=d.i(k);if(k<f-1){var m=d.i(k+1);if(g.y===l.y&&l.y===m.y){if(l.x>g.x&&m.x>=l.x||l.x<g.x&&m.x<=l.x)continue}else if(g.x===l.x&&l.x===m.x&&(l.y>g.y&&m.y>=l.y||l.y<g.y&&m.y<=l.y))continue}a:{m=a.x;var n=a.y,p=b.x,r=b.y,q=g.x;g=g.y;var u=l.x,y=l.y;if(!K.B(m,p)){if(K.B(n,r)&&K.B(q,u)&&Math.min(m,p)<q&&Math.max(m,p)>q&&Math.min(g,y)<n&&Math.max(g,y)>n&&!K.B(g,y)){h.x=q;h.y=n;m=!0;break a}}else if(!K.B(n,r)&&
1675 K.B(g,y)&&Math.min(n,r)<g&&Math.max(n,r)>g&&Math.min(q,u)<m&&Math.max(q,u)>m&&!K.B(q,u)){h.x=m;h.y=g;m=!0;break a}h.x=0;h.y=0;m=!1}m&&(e?c.push(h.x):c.push(h.y));g=l}J.free(h)}function Fp(a){a=a.curve;return a===lg||a===mg}function Jp(a,b){if(b||Fp(a))b=a.diagram,null===b||b.animationManager.isTicking||b.hh.contains(a)||0===a.km.width&&0===a.km.height||b.hh.add(a,a.km.copy())}
1676 S.prototype.ar=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.Ja.j;for(var g=e.length,h=0;h<g;h++){var k=e[h];k instanceof S&&(k===this?f=!0:f&&gq(this,k,a))}}else if(d)for(f=e.Ja.j,e=f.length,g=0;g<e;g++)h=f[g],h instanceof S&&gq(this,h,a)}}}};
1677 function gq(a,b,c){if(null!==b&&b.on&&b.Ad&&Fp(b)){var d=b.routeBounds;d.o()&&(a.routeBounds.Sc(d)||c.Sc(d))&&(a.usesSamePort(b)||b.jc())}}S.prototype.usesSamePort=function(a){var b=this.pointsCount,c=a.pointsCount;if(0<b&&0<c){var d=this.i(0),e=a.i(0);if(d.Wa(e))return!0;b=this.i(b-1);a=a.i(c-1);if(b.Wa(a)||d.Wa(a)||b.Wa(e))return!0}else if(this.fromNode===a.fromNode||this.toNode===a.toNode||this.fromNode===a.toNode||this.toNode===a.fromNode)return!0;return!1};
1678 S.prototype.isVisible=function(){if(!U.prototype.isVisible.call(this))return!1;var a=this.containingGroup,b=!0,c=this.diagram;null!==c&&(b=c.isTreePathToChildren);c=this.fromNode;if(null!==c){if(this.isTreeLink&&b&&!c.isTreeExpanded)return!1;if(c===a)return!0;for(var d=c;null!==d;){if(d.labeledLink===this)return!0;d=d.containingGroup}c=c.findVisibleNode();if(null===c||c===a)return!1}c=this.toNode;if(null!==c){if(this.isTreeLink&&!b&&!c.isTreeExpanded)return!1;if(c===a)return!0;for(b=c;null!==b;){if(b.labeledLink===
1679 this)return!0;b=b.containingGroup}b=c.findVisibleNode();if(null===b||b===a)return!1}return!0};S.prototype.Ub=function(a){U.prototype.Ub.call(this,a);null!==this.Yf&&this.Yf.Rm();if(null!==this.td)for(var b=this.td.iterator;b.next();)b.value.Ub(a)};S.prototype.computeAdjusting=function(){return this.isAvoiding&&null!==this.diagram&&this.diagram.animationManager.defaultAnimation.isAnimating?Bp:this.jl};
1680 function Gp(a){var b=a.hf;if(null!==b){var c=a.Df;if(null!==c&&isNaN(a.curviness)){for(var d=a.jf,e=a.Ef,f=a=null,g=b.hb.j,h=g.length,k=0;k<h;k++){var l=g[k];if(l.hf===b&&l.jf===d&&l.Df===c&&l.Ef===e||l.hf===c&&l.jf===e&&l.Df===b&&l.Ef===d)null===f?f=l:(null===a&&(a=[],a.push(f)),a.push(l))}if(null!==a){f=lp(b,c,d,e);null===f&&(f=new hq(b,d,c,e),kp(b,f),kp(c,f));f.links=a;for(b=0;b<a.length;b++)a[b].Yf=f;f.Rm()}}}}
1681 function Hp(a){var b=a.Yf;null!==b&&isNaN(a.curviness)&&(a.Yf=null,a=b.links.indexOf(a),0<=a&&(La(b.links,a),b.Rm()))}S.prototype.$h=function(){return!0};
1682 na.Object.defineProperties(S.prototype,{fromNode:{configurable:!0,get:function(){return this.hf},set:function(a){var b=this.hf;if(b!==a){F&&null!==a&&w(a,V,S,"fromNode");var c=this.fromPort;null!==b&&(this.Df!==b&&pp(b,this,c),Hp(this),this.D(2));this.hf=a;null!==a&&this.Ub(a.isVisible());this.gg=null;this.Za();var d=this.diagram;null!==d&&d.ba&&d.partManager.setFromNodeForLink(this,a,b);var e=this.fromPort,f=this.fromPortChanged;if(null!==f){var g=!0;null!==d&&(g=d.ba,d.ba=!0);f(this,
1683 c,e);null!==d&&(d.ba=g)}null!==a&&(this.Df!==a&&op(a,this,e),Gp(this),this.D(1));this.g("fromNode",b,a);hp(this)}}},fromPortId:{configurable:!0,get:function(){return this.jf},set:function(a){var b=this.jf;if(b!==a){F&&A(a,"string",S,"fromPortId");var c=this.fromPort;null!==c&&mp(c);Hp(this);this.jf=a;var d=this.fromPort;null!==d&&mp(d);var e=this.diagram;if(null!==e){var f=this.data,g=e.model;null!==f&&g.Cj()&&g.Qw(f,a)}c!==d&&(this.gg=null,this.Za(),f=this.fromPortChanged,null!==f&&
1684 (g=!0,null!==e&&(g=e.ba,e.ba=!0),f(this,c,d),null!==e&&(e.ba=g)));Gp(this);this.g("fromPortId",b,a)}}},fromPort:{configurable:!0,get:function(){var a=this.hf;return null===a?null:a.Wt(this.jf)}},fromPortChanged:{configurable:!0,get:function(){return this.to},set:function(a){var b=this.to;b!==a&&(null!==a&&A(a,"function",S,"fromPortChanged"),this.to=a,this.g("fromPortChanged",b,a))}},toNode:{configurable:!0,get:function(){return this.Df},set:function(a){var b=
1685 this.Df;if(b!==a){F&&null!==a&&w(a,V,S,"toNode");var c=this.toPort;null!==b&&(this.hf!==b&&pp(b,this,c),Hp(this),this.D(2));this.Df=a;null!==a&&this.Ub(a.isVisible());this.gg=null;this.Za();var d=this.diagram;null!==d&&d.ba&&d.partManager.setToNodeForLink(this,a,b);var e=this.toPort,f=this.toPortChanged;if(null!==f){var g=!0;null!==d&&(g=d.ba,d.ba=!0);f(this,c,e);null!==d&&(d.ba=g)}null!==a&&(this.hf!==a&&op(a,this,e),Gp(this),this.D(1));this.g("toNode",b,a);hp(this)}}},toPortId:{configurable:!0,
1686 enumerable:!0,get:function(){return this.Ef},set:function(a){var b=this.Ef;if(b!==a){F&&A(a,"string",S,"toPortId");var c=this.toPort;null!==c&&mp(c);Hp(this);this.Ef=a;var d=this.toPort;null!==d&&mp(d);var e=this.diagram;if(null!==e){var f=this.data,g=e.model;null!==f&&g.Cj()&&g.Vw(f,a)}c!==d&&(this.gg=null,this.Za(),f=this.toPortChanged,null!==f&&(g=!0,null!==e&&(g=e.ba,e.ba=!0),f(this,c,d),null!==e&&(e.ba=g)));Gp(this);this.g("toPortId",b,a)}}},toPort:{configurable:!0,get:function(){var a=
1687 this.Df;return null===a?null:a.Wt(this.Ef)}},toPortChanged:{configurable:!0,get:function(){return this.zq},set:function(a){var b=this.zq;b!==a&&(null!==a&&A(a,"function",S,"toPortChanged"),this.zq=a,this.g("toPortChanged",b,a))}},fromSpot:{configurable:!0,get:function(){return null!==this.S?this.S.oh:fd},set:function(a){this.Qc();var b=this.S.oh;b.A(a)||(F&&w(a,N,S,"fromSpot"),a=a.K(),this.S.oh=a,this.g("fromSpot",b,a),(b.Uc()||a.Uc())&&null!==this.fromNode&&mp(this.fromPort),
1688 this.Za())}},fromEndSegmentLength:{configurable:!0,get:function(){return null!==this.S?this.S.mh:NaN},set:function(a){this.Qc();var b=this.S.mh;b!==a&&(F&&A(a,"number",S,"fromEndSegmentLength"),0>a&&za(a,">= 0",S,"fromEndSegmentLength"),this.S.mh=a,this.g("fromEndSegmentLength",b,a),this.Za())}},fromShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.nh:NaN},set:function(a){this.Qc();var b=this.S.nh;b!==a&&(F&&A(a,"number",S,"fromShortLength"),this.S.nh=
1689 a,this.jc(),this.g("fromShortLength",b,a))}},toSpot:{configurable:!0,get:function(){return null!==this.S?this.S.Nh:fd},set:function(a){this.Qc();var b=this.S.Nh;b.A(a)||(F&&w(a,N,S,"toSpot"),a=a.K(),this.S.Nh=a,this.g("toSpot",b,a),(b.Uc()||a.Uc())&&null!==this.toNode&&mp(this.toPort),this.Za())}},toEndSegmentLength:{configurable:!0,get:function(){return null!==this.S?this.S.Lh:NaN},set:function(a){this.Qc();var b=this.S.Lh;b!==a&&(F&&A(a,"number",S,"toEndSegmentLength"),
1690 0>a&&za(a,">= 0",S,"toEndSegmentLength"),this.S.Lh=a,this.g("toEndSegmentLength",b,a),this.Za())}},toShortLength:{configurable:!0,get:function(){return null!==this.S?this.S.Mh:NaN},set:function(a){this.Qc();var b=this.S.Mh;b!==a&&(F&&A(a,"number",S,"toShortLength"),this.S.Mh=a,this.jc(),this.g("toShortLength",b,a))}},isLabeledLink:{configurable:!0,get:function(){return null===this.td?!1:0<this.td.count}},labelNodes:{configurable:!0,get:function(){return null===
1691 this.td?kb:this.td.iterator}},relinkableFrom:{configurable:!0,get:function(){return 0!==(this.La&1)},set:function(a){var b=0!==(this.La&1);b!==a&&(F&&A(a,"boolean",S,"relinkableFrom"),this.La^=1,this.g("relinkableFrom",b,a),this.Rb())}},relinkableTo:{configurable:!0,get:function(){return 0!==(this.La&2)},set:function(a){var b=0!==(this.La&2);b!==a&&(F&&A(a,"boolean",S,"relinkableTo"),this.La^=2,this.g("relinkableTo",b,a),this.Rb())}},resegmentable:{configurable:!0,
1692 get:function(){return 0!==(this.La&4)},set:function(a){var b=0!==(this.La&4);b!==a&&(F&&A(a,"boolean",S,"resegmentable"),this.La^=4,this.g("resegmentable",b,a),this.Rb())}},isTreeLink:{configurable:!0,get:function(){return 0!==(this.La&8)},set:function(a){var b=0!==(this.La&8);b!==a&&(F&&A(a,"boolean",S,"isTreeLink"),this.La^=8,this.g("isTreeLink",b,a),null!==this.fromNode&&Xk(this.fromNode),null!==this.toNode&&Xk(this.toNode))}},path:{configurable:!0,get:function(){var a=
1693 this.yb();return a instanceof Uf?a:null}},routeBounds:{configurable:!0,get:function(){this.Jj();var a=this.km,b=Infinity,c=Infinity,d=this.pointsCount;if(0===d)a.h(NaN,NaN,0,0);else{if(1===d)d=this.i(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.h(d.x,d.y,0,0);else if(2===d){d=this.i(0);var e=this.i(1);b=Math.min(d.x,e.x);c=Math.min(d.y,e.y);a.h(d.x,d.y,0,0);a.af(e)}else if(this.computeCurve()===qg&&3<=d&&!this.isOrthogonal)if(e=this.i(0),b=e.x,c=e.y,a.h(b,c,0,0),3===d){d=this.i(1);b=Math.min(d.x,
1694 b);c=Math.min(d.y,c);var f=this.i(2);b=Math.min(f.x,b);c=Math.min(f.y,c);K.Im(e.x,e.y,d.x,d.y,d.x,d.y,f.x,f.y,.5,a)}else for(f=3;f<d;f+=3){var g=this.i(f-2);f+3>=d&&(f=d-1);var h=this.i(f-1),k=this.i(f);K.Im(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.af(f),e=2;e<d;e++)f=this.i(e),b=Math.min(f.x,b),c=Math.min(f.y,c),a.af(f);this.Iv.h(b-a.x,c-a.y)}return a}},midPoint:{configurable:!0,
1695 enumerable:!0,get:function(){this.Jj();return this.computeMidPoint(new J)}},midAngle:{configurable:!0,get:function(){this.Jj();return this.computeMidAngle()}},flattenedLengths:{configurable:!0,get:function(){if(null===this.os){this.Ad||Ip(this);for(var a=this.os=[],b=this.pointsCount,c=0;c<b-1;c++){var d=this.i(c);var e=this.i(c+1);K.da(d.x,e.x)?(d=e.y-d.y,0>d&&(d=-d)):K.da(d.y,e.y)?(d=e.x-d.x,0>d&&(d=-d)):d=Math.sqrt(d.Ve(e));a.push(d)}}return this.os}},flattenedTotalLength:{configurable:!0,
1696 enumerable:!0,get:function(){var a=this.dv;if(isNaN(a)){for(var b=this.flattenedLengths,c=b.length,d=a=0;d<c;d++)a+=b[d];this.dv=a}return a}},points:{configurable:!0,get:function(){return this.Fb},set:function(a){var b=this.Fb;if(b!==a){var c=null;if(Array.isArray(a)){var d=0===a.length%2;if(d)for(var e=0;e<a.length;e++)if("number"!==typeof a[e]||isNaN(a[e])){d=!1;break}if(d)for(c=new H,d=0;d<a.length/2;d++)e=(new J(a[2*d],a[2*d+1])).freeze(),c.add(e);else{d=!0;for(e=0;e<a.length;e++){var f=
1697 a[e];if(!Ga(f)||"number"!==typeof f.x||isNaN(f.x)||"number"!==typeof f.y||isNaN(f.y)){d=!1;break}}if(d)for(c=new H,d=0;d<a.length;d++)e=a[d],c.add((new J(e.x,e.y)).freeze());else F&&v("Link.points array must contain only an even number of numbers or objects with x and y properties, not: "+a)}}else if(a instanceof H)for(c=a.copy(),a=c.iterator;a.next();)a.value.freeze();else v("Link.points value is not an instance of List or Array: "+a);c.freeze();this.Fb=c;this.jc();Ip(this);a=this.diagram;null!==
1698 a&&(a.Bj||a.undoManager.isUndoingRedoing||a.ku.add(this),a.animationManager.yc&&(a=a.animationManager,this.wf=c,a.mm.add(this)));this.g("points",b,c)}}},pointsCount:{configurable:!0,get:function(){return this.Fb.count}},Ad:{configurable:!0,get:function(){return 0!==(this.La&16)},set:function(a){0!==(this.La&16)!==a&&(this.La^=16)}},suspendsRouting:{configurable:!0,get:function(){return 0!==(this.La&32)},set:function(a){0!==(this.La&32)!==a&&(this.La^=32)}},
1699 Pt:{configurable:!0,get:function(){return 0!==(this.La&64)},set:function(a){0!==(this.La&64)!==a&&(this.La^=64)}},defaultFromPoint:{configurable:!0,get:function(){return this.w},set:function(a){this.w=a.copy()}},defaultToPoint:{configurable:!0,get:function(){return this.L},set:function(a){this.L=a.copy()}},isOrthogonal:{configurable:!0,get:function(){return 2===(this.pk.value&2)}},isAvoiding:{configurable:!0,get:function(){return 4===
1700 (this.pk.value&4)}},on:{configurable:!0,get:function(){return 0!==(this.La&128)},set:function(a){0!==(this.La&128)!==a&&(this.La^=128)}},geometry:{configurable:!0,get:function(){this.on||(this.Jj(),this.ua=this.makeGeometry());return this.ua}},firstPickIndex:{configurable:!0,get:function(){return 2>=this.pointsCount?0:this.isOrthogonal||!Mp(this.computeSpot(!0))?1:0}},lastPickIndex:{configurable:!0,get:function(){var a=this.pointsCount;return 0===
1701 a?0:2>=a?a-1:this.isOrthogonal||!Mp(this.computeSpot(!1))?a-2:a-1}},adjusting:{configurable:!0,get:function(){return this.jl},set:function(a){var b=this.jl;b!==a&&(F&&a!==ng&&a!==Bp&&a!==Cp&&a!==Dp&&v("Link.adjusting can only be set to Link.None, Link.End, LInk.Scale, or Link.Stretch, not: "+a),this.jl=a,this.g("adjusting",b,a))}},corner:{configurable:!0,get:function(){return this.Un},set:function(a){var b=this.Un;b!==a&&(F&&A(a,"number",S,"corner"),this.Un=a,this.jc(),
1702 this.g("corner",b,a))}},curve:{configurable:!0,get:function(){return this.Wn},set:function(a){var b=this.Wn;b!==a&&(F&&a!==ng&&a!==qg&&a!==mg&&a!==lg&&v("Link.curve can only be set to Link.None, Link.Bezier, LInk.JumpGap, or Link.JumpOver, not: "+a),this.Wn=a,this.Za(),this.jc(),Jp(this,b===mg||b===lg||a===mg||a===lg),this.g("curve",b,a))}},curviness:{configurable:!0,get:function(){return this.Xn},set:function(a){var b=this.Xn;b!==a&&(F&&A(a,"number",S,"curviness"),this.Xn=
1703 a,this.Za(),this.jc(),this.g("curviness",b,a))}},routing:{configurable:!0,get:function(){return this.pk},set:function(a){var b=this.pk;b!==a&&(F&&a!==Ap&&a!==iq&&a!==jq&&a!==Sp&&v("Link.routing can only be set to Link.Normal, Link.Orthogonal, LInk.AvoidsNodes, not: "+a),this.pk=a,this.gg=null,this.Za(),Jp(this,2===(b.value&2)||2===(a.value&2)),this.g("routing",b,a))}},smoothness:{configurable:!0,get:function(){return this.mq},set:function(a){var b=this.mq;b!==a&&(F&&A(a,
1704 "number",S,"smoothness"),this.mq=a,this.jc(),this.g("smoothness",b,a))}},key:{configurable:!0,get:function(){var a=this.diagram;if(null!==a&&a.model.Cj())return a.model.bc(this.data)}}});S.prototype.invalidateOtherJumpOvers=S.prototype.ar;S.prototype.findClosestSegment=S.prototype.lA;S.prototype.updateRoute=S.prototype.Jj;S.prototype.invalidateRoute=S.prototype.Za;S.prototype.rollbackRoute=S.prototype.Mw;S.prototype.commitRoute=S.prototype.Jf;S.prototype.startRoute=S.prototype.di;
1705 S.prototype.clearPoints=S.prototype.Bk;S.prototype.removePoint=S.prototype.Iw;S.prototype.addPointAt=S.prototype.Hf;S.prototype.addPoint=S.prototype.ke;S.prototype.insertPointAt=S.prototype.m;S.prototype.insertPoint=S.prototype.QA;S.prototype.setPointAt=S.prototype.O;S.prototype.setPoint=S.prototype.Wc;S.prototype.getPoint=S.prototype.i;S.prototype.getOtherPort=S.prototype.HA;S.prototype.getOtherNode=S.prototype.Xq;
1706 var Kp=null,Lp=null,Ap=new E(S,"Normal",1),iq=new E(S,"Orthogonal",2),jq=new E(S,"AvoidsNodes",6),Sp=new E(S,"AvoidsNodesStraight",7),ng=new E(S,"None",0),qg=new E(S,"Bezier",9),mg=new E(S,"JumpGap",10),lg=new E(S,"JumpOver",11),Bp=new E(S,"End",17),Cp=new E(S,"Scale",18),Dp=new E(S,"Stretch",19),pn=new E(S,"OrientAlong",21),hn=new E(S,"OrientPlus90",22),kn=new E(S,"OrientMinus90",23),Ep=new E(S,"OrientOpposite",24),qn=new E(S,"OrientUpright",25),jn=new E(S,"OrientPlus90Upright",26),ln=new E(S,"OrientMinus90Upright",
1707 27),mn=new E(S,"OrientUpright45",28),Up=16,Tp=14,Vp=8;S.className="Link";S.Normal=Ap;S.Orthogonal=iq;S.AvoidsNodes=jq;S.AvoidsNodesStraight=Sp;S.None=ng;S.Bezier=qg;S.JumpGap=mg;S.JumpOver=lg;S.End=Bp;S.Scale=Cp;S.Stretch=Dp;S.OrientAlong=pn;S.OrientPlus90=hn;S.OrientMinus90=kn;S.OrientOpposite=Ep;S.OrientUpright=qn;S.OrientPlus90Upright=jn;S.OrientMinus90Upright=ln;S.OrientUpright45=mn;S.EndSegmentStep=8;S.CurvinessStart=Up;S.SpacingMin=Tp;S.OrthoShortCut=Vp;S.AvoidanceCell=8;S.AvoidanceLimit=999;
1708 function hq(a,b,c,d){eb(this);this.Ce=this.vs=!1;this.nu=a;this.bz=b;this.zw=c;this.cz=d;this.links=[]}hq.prototype.Rm=function(){if(!this.vs){var a=this.links;0<a.length&&(a=a[0].diagram,null!==a&&(a.fv.add(this),this.Ce=a.undoManager.isUndoingRedoing))}this.vs=!0};
1709 hq.prototype.lx=function(){if(this.vs){this.vs=!1;var a=this.links;if(0<a.length){var b=a[0],c=b.diagram;c=null===c||c.Bj&&!this.Ce;this.Ce=!1;b.arrangeBundledLinks(a,c);1===a.length&&(b.Yf=null,a.length=0)}0===a.length&&(a=this.nu,null!==this&&null!==a.df&&a.df.remove(this),a=this.zw,null!==this&&null!==a.df&&a.df.remove(this))}};hq.className="LinkBundle";
1710 function Hk(){eb(this);this.kz=this.group=null;this.du=!0;this.abort=!1;this.Hd=this.Gd=1;this.fp=this.ep=-1;this.mc=this.lc=8;this.Xb=null;this.kj=this.jj=0;this.lz=11;this.Wy=124}
1711 Hk.prototype.initialize=function(a){if(!(0>=a.width||0>=a.height)){var b=a.y,c=a.x+a.width,d=a.y+a.height;this.Gd=Math.floor((a.x-this.lc)/this.lc)*this.lc;this.Hd=Math.floor((b-this.mc)/this.mc)*this.mc;this.ep=Math.ceil((c+2*this.lc)/this.lc)*this.lc;this.fp=Math.ceil((d+2*this.mc)/this.mc)*this.mc;a=1+(Math.ceil((this.ep-this.Gd)/this.lc)|0);b=1+(Math.ceil((this.fp-this.Hd)/this.mc)|0);if(null===this.Xb||this.jj<a-1||this.kj<b-1){c=[];for(d=0;d<=a;d++)c[d]=new Uint32Array(b);this.Xb=c;this.jj=
1712 a-1;this.kj=b-1}a=kq;if(null!==this.Xb)for(b=0;b<=this.jj;b++)if(c=this.Xb[b],c.fill)c.fill(a);else for(d=0;d<=this.kj;d++)c[d]=a}};function Ok(a,b,c){return a.Gd<=b&&b<=a.ep&&a.Hd<=c&&c<=a.fp}function Xp(a,b,c){if(!Ok(a,b,c))return kq;b-=a.Gd;b/=a.lc;c-=a.Hd;c/=a.mc;return a.Xb[b|0][c|0]}function Nk(a){if(null!==a.Xb)for(var b=0;b<=a.jj;b++)for(var c=a.Xb[b],d=0;d<=a.kj;d++)c[d]>=$p&&(c[d]=kq)}
1713 Hk.prototype.Pk=function(a,b,c,d){if(a>this.ep||a+c<this.Gd||b>this.fp||b+d<this.Hd)return!0;a=(a-this.Gd)/this.lc|0;b=(b-this.Hd)/this.mc|0;c=Math.max(0,c)/this.lc+1|0;var e=Math.max(0,d)/this.mc+1|0;0>a&&(c+=a,a=0);0>b&&(e+=b,b=0);if(0>c||0>e)return!0;d=Math.min(a+c-1,this.jj)|0;for(c=Math.min(b+e-1,this.kj)|0;a<=d;a++){e=this.Xb[a];for(var f=b;f<=c;f++)if(e[f]===Pk)return!1}return!0};
1714 function lq(a,b,c,d,e,f,g,h,k){if(!(b<f||b>g||c<h||c>k)){var l=b|0;var m=c|0;var n=a.Xb[l][m];if(n>=$p&&n<Yp)for(e?m+=d:l+=d,n+=1;f<=l&&l<=g&&h<=m&&m<=k&&!(n>=a.Xb[l][m]);)a.Xb[l][m]=n,n+=1,e?m+=d:l+=d;l=e?m:l;if(e)if(0<d)for(c+=d;c<l;c+=d)lq(a,b,c,1,!e,f,g,h,k),lq(a,b,c,-1,!e,f,g,h,k);else for(c+=d;c>l;c+=d)lq(a,b,c,1,!e,f,g,h,k),lq(a,b,c,-1,!e,f,g,h,k);else if(0<d)for(b+=d;b<l;b+=d)lq(a,b,c,1,!e,f,g,h,k),lq(a,b,c,-1,!e,f,g,h,k);else for(b+=d;b>l;b+=d)lq(a,b,c,1,!e,f,g,h,k),lq(a,b,c,-1,!e,f,g,h,
1715 k)}}function mq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=Pk,m=$p;for(a.Xb[b][c]=m;l===Pk&&b>f&&b<g&&c>h&&c<k;)m+=1,a.Xb[b][c]=m,e?c+=d:b+=d,l=a.Xb[b][c]}function nq(a,b,c,d,e,f,g,h,k){b|=0;c|=0;var l=Pk,m=Yp;for(a.Xb[b][c]=m;l===Pk&&b>f&&b<g&&c>h&&c<k;)a.Xb[b][c]=m,e?c+=d:b+=d,l=a.Xb[b][c]}
1716 function Wp(a,b,c,d,e,f,g){if(null!==a.Xb){a.abort=!1;var h=b.x,k=b.y;if(Ok(a,h,k)){h-=a.Gd;h/=a.lc;k-=a.Hd;k/=a.mc;var l=d.x,m=d.y;if(Ok(a,l,m))if(l-=a.Gd,l/=a.lc,m-=a.Hd,m/=a.mc,1>=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.Gd;n/=a.lc;d-=a.Hd;d/=a.mc;b-=a.Gd;b/=a.lc;p-=a.Hd;p/=a.mc;f=Math.max(0,Math.min(a.jj,n|0));b=Math.min(a.jj,Math.max(0,b|0));n=Math.max(0,Math.min(a.kj,d|0));p=Math.min(a.kj,Math.max(0,p|0));d=a.Xb;h|=0;k|=0;l|=0;m|=
1717 0;var r=0===c||90===c?1:-1;c=90===c||270===c;d[h][k]===Pk?(mq(a,h,k,r,c,f,b,n,p),mq(a,h,k,1,!c,f,b,n,p),mq(a,h,k,-1,!c,f,b,n,p)):mq(a,h,k,r,c,h,k,h,k);d[l][m]===Pk?(nq(a,l,m,0===e||90===e?1:-1,90===e||270===e,f,b,n,p),nq(a,l,m,1,!(90===e||270===e),f,b,n,p),nq(a,l,m,-1,!(90===e||270===e),f,b,n,p)):nq(a,l,m,r,c,l,m,l,m);c=Ma();if(g&&oq(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=$p;e=c[c.length-2];g=c[c.length-1];d[e][g]=
1718 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++:b<e?e--:l>g?g++:l<g&&g--,d[e][g]=a++,e!==b||g!==l;);}else lq(a,h,k,1,!1,f,b,n,p),lq(a,h,k,-1,!1,f,b,n,p),lq(a,h,k,1,!0,f,b,n,p),lq(a,h,k,-1,!0,f,b,n,p);Oa(c)}}}}
1719 function oq(a,b,c,d,e,f,g){for(var h=a.Xb,k=b,l=c;;){if(k===e&&l===f)return!0;var m=k,n=l;if(0===d)if(m<e)m++;else break;else if(90===d)if(n<f)n++;else break;else if(180===d)if(m>e)m--;else break;else if(n>f)n--;else break;var p=h[m][n];if(0===p||p===pq)break;k=m;l=n}for(;;){m=d;n=k;p=l;0===d?p<f?(m=90,p++):p>f&&(m=270,p--):90===d?n<e?(m=0,n++):n>e&&(m=180,n--):180===d?p<f?(m=90,p++):p>f&&(m=270,p--):n<e?(m=0,n++):n>e&&(m=180,n--);n=h[n][p];if(m!==d&&0!==n&&n!==pq){g.push(k);g.push(l);if(oq(a,k,l,
1720 m,e,f,g))return!0;g.pop();g.pop()}h[k][l]=pq;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++}}}
1721 na.Object.defineProperties(Hk.prototype,{bounds:{configurable:!0,get:function(){return new L(this.Gd,this.Hd,this.ep-this.Gd,this.fp-this.Hd)}},Mq:{configurable:!0,get:function(){return this.lc},set:function(a){0<a&&a!==this.lc&&(this.lc=a,this.initialize(this.bounds))}},Lq:{configurable:!0,get:function(){return this.mc},set:function(a){0<a&&a!==this.mc&&(this.mc=a,this.initialize(this.bounds))}}});var Pk=0,$p=1,Yp=999999,kq=Yp+1,pq=Yp+2;Hk.className="PositionArray";
1722 function Qp(){eb(this);this.port=this.node=null;this.le=[];this.fr=!1}Qp.prototype.toString=function(){for(var a=this.le,b=this.node.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!==d&&(b+="\n "+d.toString())}return b};
1723 function qq(a,b,c,d){b=b.offsetY;switch(b){case 8:return 90;case 2:return 180;case 1:return 270;case 4:return 0}switch(b){case 9:return 180<c?270:90;case 6:return 90<c&&270>=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 90<c&&c<=180+a?180:c>180+a&&c<=360-a?270:0;case 13:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case 14:return c>
1724 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}Qp.prototype.Rm=function(){this.le.length=0};
1725 function Rp(a,b){var c=a.le;if(0===c.length){a:if(!a.fr){c=a.fr;a.fr=!0;var d=null,e=a.node,f=e instanceof If?e:null;if(null===f||f.isSubGraphExpanded)var g=e.isTreeExpanded?e.findLinksConnected(a.port.portId):e.Fy();else{if(!f.actualBounds.o()){a.fr=c;break a}d=f;g=d.fw()}f=a.le.length=0;var h=a.port.ja(Ec,J.alloc()),k=a.port.ja(Oc,J.alloc());e=L.allocAt(h.x,h.y,0,0);e.af(k);J.free(h);J.free(k);h=J.allocAt(e.x+e.width/2,e.y+e.height/2);k=a.port.wj();for(g=g.iterator;g.next();){var l=g.value;if(l.isVisible()&&
1726 l.fromPort!==l.toPort){var m=l.fromPort===a.port||null!==l.fromNode&&l.fromNode.Qd(d),n=l.computeSpot(m,a.port);if(n.Uc()){var p=m?l.toPort:l.fromPort;if(null!==p&&(m=p.part,null!==m)){var r=m.findVisibleNode();null!==r&&r!==m&&(m=r,p=m.port);m=l.computeOtherPoint(m,p);p=h.Va(p.ja(Kc));r=h.Va(m);p+=(r-p)/360;p-=k;0>p?p+=360:360<=p&&(p-=360);n=qq(e,n,p,l.isOrthogonal);0===n?(n=4,180<p&&(p-=360)):90===n?(n=8,270<p&&(p-=360)):180===n?n=2:(n=1,90>p&&(p+=360));r=a.le[f];void 0===r?(r=new rq(l,p,n),a.le[f]=
1727 r):(r.link=l,r.angle=p,r.Gc=n);r.Cw.set(m);f++}}}}J.free(h);a.le.sort(Qp.prototype.l);k=a.le.length;d=-1;for(f=h=0;f<k;f++)g=a.le[f],void 0!==g&&(g.Gc!==d&&(d=g.Gc,h=0),g.Yq=h,h++);d=-1;h=0;for(f=k-1;0<=f;f--)k=a.le[f],void 0!==k&&(k.Gc!==d&&(d=k.Gc,h=k.Yq+1),k.Km=h);f=a.le;n=a.port;d=a.node.portSpreading;h=J.alloc();k=J.alloc();g=J.alloc();l=J.alloc();n.ja(Ec,h);n.ja(Gc,k);n.ja(Oc,g);n.ja(Mc,l);r=p=m=n=0;if(d===xp)for(var q=0;q<f.length;q++){var u=f[q];if(null!==u){var y=u.link.computeThickness();
1728 switch(u.Gc){case 8:p+=y;break;case 2:r+=y;break;case 1:n+=y;break;default:case 4:m+=y}}}var x=q=0,z=1,B=u=0;for(y=0;y<f.length;y++){var D=f[y];if(null!==D){if(q!==D.Gc){q=D.Gc;switch(q){case 8:var G=g;x=l;break;case 2:G=l;x=h;break;case 1:G=h;x=k;break;default:case 4:G=k,x=g}u=x.x-G.x;B=x.y-G.y;switch(q){case 8:p>Math.abs(u)?(z=Math.abs(u)/p,p=Math.abs(u)):z=1;break;case 2:r>Math.abs(B)?(z=Math.abs(B)/r,r=Math.abs(B)):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>
1729 Math.abs(B)?(z=Math.abs(B)/m,m=Math.abs(B)):z=1}x=0}var M=D.dr;if(d===xp){D=D.link.computeThickness();D*=z;M.set(G);switch(q){case 8:M.x=G.x+u/2+p/2-x-D/2;break;case 2:M.y=G.y+B/2+r/2-x-D/2;break;case 1:M.x=G.x+u/2-n/2+x+D/2;break;default:case 4:M.y=G.y+B/2-m/2+x+D/2}x+=D}else{var Y=.5;d===jp&&(Y=(D.Yq+1)/(D.Km+1));M.x=G.x+u*Y;M.y=G.y+B*Y}}}J.free(h);J.free(k);J.free(g);J.free(l);G=a.le;for(f=0;f<G.length;f++)d=G[f],null!==d&&(d.dw=a.computeEndSegmentLength(d));a.fr=c;L.free(e)}c=a.le}for(a=0;a<c.length;a++)if(e=
1730 c[a],null!==e&&e.link===b)return e;return null}Qp.prototype.l=function(a,b){return a===b?0:null===a?-1:null===b?1:a.Gc<b.Gc?-1:a.Gc>b.Gc?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
1731 Qp.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.node,this.port,Bc,b.fromPort===this.port),d=a.Yq;if(0>d)return c;var e=a.Km;if(1>=e||!b.isOrthogonal)return c;b=a.Cw;var f=a.dr;if(2===a.Gc||8===a.Gc)d=e-1-d;return((a=2===a.Gc||4===a.Gc)?b.y<f.y:b.x<f.x)?c+8*d:(a?b.y===f.y:b.x===f.x)?c:c+8*(e-1-d)};Qp.className="Knot";function rq(a,b,c){this.link=a;this.angle=b;this.Gc=c;this.Cw=new J;this.Km=this.Yq=0;this.dr=new J;this.dw=0}
1732 rq.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.Gc.toString()+":"+this.Yq.toString()+"/"+this.Km.toString()+" "+this.dr.toString()+" "+this.dw.toString()+" "+this.Cw.toString()};rq.className="LinkInfo";function yl(){this.Nh=this.oh=fd;this.Mh=this.nh=this.Lh=this.mh=NaN;this.xq=this.ro=null;this.yq=this.so=Infinity}
1733 yl.prototype.copy=function(){var a=new yl;a.oh=this.oh.K();a.Nh=this.Nh.K();a.mh=this.mh;a.Lh=this.Lh;a.nh=this.nh;a.Mh=this.Mh;a.ro=this.ro;a.xq=this.xq;a.so=this.so;a.yq=this.yq;return a};yl.className="LinkSettings";function Ni(){0<arguments.length&&Ba(Ni);eb(this);this.w=this.C=null;this.Ki=this.Ko=!0;this.Po=!1;this.An=(new J(0,0)).freeze();this.Mo=!0;this.In=this.Lo=null;this.Oo=!1;this.l=null;this.L=0;this.gp=this.Dq=null;this.Jt=!1;this.Kg=this.rk=null;this.yt=!1}
1734 Ni.prototype.cloneProtected=function(a){a.Ko=this.Ko;a.Ki=this.Ki;a.Po=this.Po;a.An.assign(this.An);a.Mo=this.Mo;a.Lo=this.Lo;a.In=this.In;a.Oo=!0;a.gp=this.gp;a.Dq=this.Dq};Ni.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};Ni.prototype.serializeLayoutProperties=function(a){a.arrangementOrigin={x:this.arrangementOrigin.x,y:this.arrangementOrigin.y};a.isRouting=this.isRouting};
1735 Ni.prototype.deserializeLayoutProperties=function(a){null!==a&&(this.arrangementOrigin=new J(a.arrangementOrigin.x,a.arrangementOrigin.y),this.isRouting=a.isRouting)};Ni.prototype.pb=function(a){Da(this,a)};Ni.prototype.toString=function(){var a=Pa(this.constructor);a+="(";null!==this.group&&(a+=" in "+this.group);null!==this.diagram&&(a+=" for "+this.diagram);return a+")"};
1736 Ni.prototype.D=function(){if(this.isValidLayout){var a=this.diagram;if(null!==a&&!a.undoManager.isUndoingRedoing){var b=a.animationManager;!b.isTicking&&(b.defaultAnimation.isAnimating&&b.Hc(),this.isOngoing&&a.Bj||this.isInitial&&!a.Bj)&&(this.isValidLayout=!1,a.Jb())}}};Ni.prototype.createNetwork=function(){return new sq(this)};Ni.prototype.makeNetwork=function(a){var b=this.createNetwork();a instanceof R?(b.Mg(a.nodes,!0),b.Mg(a.links,!0)):a instanceof If?b.Mg(a.memberParts):b.Mg(a.iterator);return b};
1737 Ni.prototype.updateParts=function(){this.isValidLayout=!0;if(!this.workerLayout()){var a=this.diagram;if(null===a&&null!==this.network)for(var b=this.network.vertexes.iterator;b.next();){var c=b.value.node;if(null!==c&&(a=c.diagram,null!==a))break}try{null!==a&&a.Ca("Layout"),this.commitLayout()}finally{null!==a&&a.cb("Layout")}}};Ni.prototype.commitLayout=function(){if(null!==this.network){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();if(this.isRouting)for(a=this.network.edges.iterator;a.next();)a.value.commit()}};
1738 Ni.prototype.doLayout=function(a){F&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new I;a instanceof R?(tq(this,b,a.nodes,!0,this.bi,!0,!1,!0),tq(this,b,a.parts,!0,this.bi,!0,!1,!0)):a instanceof If?tq(this,b,a.memberParts,!1,this.bi,!0,!1,!0):b.addAll(a.iterator);0<b.count&&(a=this.diagram,null!==a&&a.Ca("Layout"),this.doMinimalNoNetworkLayout(b),null!==a&&a.cb("Layout"));this.isValidLayout=!0};
1739 Ni.prototype.doMinimalNoNetworkLayout=function(a){var b=Math.ceil(Math.sqrt(a.count));this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var c=this.arrangementOrigin.x,d=c,e=this.arrangementOrigin.y,f=0,g=0;for(a=a.iterator;a.next();){var h=a.value;uq(h);var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(d,e);h instanceof If&&(h.bi=!1);d+=Math.max(l,50)+20;g=Math.max(g,Math.max(k,50));f>=b-1?(f=0,d=c,e+=g+20,g=0):f++}};
1740 Ni.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)&&(uq(h),this.bi(h))){var k=h.measuredBounds,l=k.width;k=k.height;h.moveTo(c,d);h instanceof If&&(h.bi=!1);c+=Math.max(l,50)+20;f=Math.max(f,Math.max(k,50));e>=a-1?(e=
1741 0,c=b,d+=f+20,f=0):e++}}};Ni.prototype.bi=function(a){return!a.location.o()||a instanceof If&&a.bi?!0:!1};function tq(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 If?null===k.layout?tq(a,b,k.memberParts,!1,e,f,g,h):(uq(k),b.add(k)):(uq(k),b.add(k))):g&&k instanceof S?b.add(k):!h||!k.Tc()||k instanceof V||(uq(k),b.add(k)))}}
1742 function uq(a){var b=a.actualBounds;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Ya()}Ni.prototype.yj=function(a,b){var c=this.boundsComputation;if(null!==c)return b||(b=new L),c(a,this,b);if(!b)return a.actualBounds;b.set(a.actualBounds);return b};
1743 Ni.prototype.qy=function(a){var b=new I;a instanceof R?(tq(this,b,a.nodes,!0,null,!0,!0,!0),tq(this,b,a.links,!0,null,!0,!0,!0),tq(this,b,a.parts,!0,null,!0,!0,!0)):a instanceof If?tq(this,b,a.memberParts,!1,null,!0,!0,!0):tq(this,b,a.iterator,!1,null,!0,!0,!0);return b};
1744 Ni.prototype.initialOrigin=function(a){var b=this.group;if(null!==b){var c=b.position.copy();(isNaN(c.x)||isNaN(c.y))&&c.set(a);b=b.placeholder;null!==b&&(c=b.ja(Ec),(isNaN(c.x)||isNaN(c.y))&&c.set(a),a=b.padding,c.x+=a.left,c.y+=a.top);return c}return a};Ni.prototype.mayUseWorker=function(){return this.mayUseWorkerFunction?this.mayUseWorkerFunction(this):!1};Ni.prototype.workerLayout=function(){return!1};
1745 function vq(a,b){if(null!==a.workerStateChanged){var c={key:a.group?a.group.key:null};void 0!==b&&(c.time=b);null!==a.rk&&(c.running=wq(a.rk));null!==a.Kg&&(c.waiting=wq(a.Kg));a.workerStateChanged(c,a)}}function wq(a){return{vertexes:a.vertexes.count,edges:a.edges.count}}Ni.prototype.Qz=function(){var a=xq(this.constructor);a&&(null!==a.bf&&a.bf.terminate(),a.bf=null,a.Tm.iteratorValues.each(function(a){a.Jt=!1;a.rk=null;a.Kg=null;a.yt=!1;vq(a)}),a.Tm.clear())};
1746 function yq(a,b){var c=xq(a);if(c){if(b)for(var d in b)c[d]=b[d]}else throw Error("Unknown Layout class: "+a);}function xq(a){var b=null;if("function"===typeof a){if(b=zq.get(a),!b){var c=Pa(a);b=zq.get(c);b||(b=new Aq,b.Yv=a,b.name=c,b.l=a.name,b.Ry=Bq,zq.set(c,b),zq.set(a,b),zq.set(a.name,b))}}else"string"===typeof a&&(b=zq.get(a));return b}
1747 Ni.prototype.kx=function(){if("undefined"===typeof Worker||!Cq||"undefined"===typeof self||"undefined"!==typeof self.DedicatedWorkerGlobalScope)return!1;if(!this.mayUseWorker())return this.Jt&&(this.yt=!0,this.Kg=this.rk=null,vq(this)),!1;var a=xq(this.constructor);if(null===a)return!1;null===a.bf&&(a.bf=new Worker(Cq),a.bf.onerror=function(a){a.preventDefault();Ea("Worker Error at: "+a.filename+" "+a.lineno+" "+a.colno+"\n "+a.message)},a.bf.l=function(a){Ea("Worker serialization error: "+a)},a.bf.onmessage=
1748 function(b){var c=b.data;if("_GoJS"===c._GoJS)if(c.version&&R.version&&c.version!==R.version)Ea("Failure: GoJS v"+R.version+" Worker v"+c.version);else if(b=a.Tm.get(c.id)){a.Tm.remove(c.id);b.Jt=!1;b.rk=null;if(b.yt)b.yt=!1,b.Kg=null;else{var d=Dq(b,c,!1);b.network=d;b.updateParts();b.network=null;b.isValidLayout=!0}vq(b,c.time);c=b.Kg;if(null!==c)b.Kg=null;else for(d=a.Tm.iteratorValues;d.next();){var e=d.value;c=e.Kg;if(null!==c){e.Kg=null;break}}null!==c&&Eq(b,c)}},a.bf.postMessage({_GoJS:"_GoJS",
1749 url:a.Ry}),Array.isArray(a.scripts)&&a.scripts.forEach(function(b){a.bf.postMessage({_GoJS:"_GoJS",url:b})}),a.bf.postMessage({_GoJS:"_GoJS",version:-1}));null!==this.rk?this.Kg=this.network:Eq(this,this.network);vq(this);this.doMinimalNetworkLayout();this.network=null;return this.isValidLayout=!0};function Eq(a,b){a.Jt=!0;var c=xq(a.constructor),d=Fq(a,b,!0);d._GoJS="_GoJS";c.bf.postMessage(d);c.Tm.set(ob(a),a);a.rk=b}
1750 function Fq(a,b,c){a.onNetworkSerialization(1,c,b,null);var d={};a.serializeLayoutProperties(d,c);var e=[];b.vertexes.each(function(a){var b={};a.serializeVertexProperties(b,c);e.push(b)});var f=[];b.edges.each(function(a){var b={};a.serializeEdgeProperties(b,c);f.push(b)});d={id:c?ob(a):a.id,layout:Pa(a.constructor),p:d,DB:e,jA:f};a.onNetworkSerialization(2,c,b,d);return d}
1751 function Dq(a,b,c){c&&(a.id=b.id);var d=a.diagram,e=a.createNetwork();a.onNetworkSerialization(3,c,e,b);var f=b.DB,g=new Bb;f&&f.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.Hb(a.key));null!==b?b=e.zk(b):(b=e.createVertex(),e.Ng(b));c&&null!==a.key&&(b.data={Oi:a.key});g.set(a.id,b)});var h=b.jA,k=new Bb;h&&h.forEach(function(a){var b=null;null===a.key||null===d||c||(b=d.findLinkForKey(a.key));var f=e.createEdge();e.Gm(f);f.link=b;c&&null!==a.key&&(f.data={Oi:a.key});k.set(a.id,
1752 f)});f&&f.forEach(function(a){var b=g.get(a.id);b&&b.Pq(a,g,k,c)});h&&h.forEach(function(a){var b=k.get(a.id);b&&b.deserializeEdgeProperties(a,g,k,c)});a.deserializeLayoutProperties(b.p,g,k,c,e);a.onNetworkSerialization(4,c,e,b);return e}Ni.prototype.onNetworkSerialization=function(){};
1753 na.Object.defineProperties(Ni.prototype,{diagram:{configurable:!0,get:function(){return this.C},set:function(a){null!==a&&w(a,R,Ni,"diagram");this.C=a}},group:{configurable:!0,get:function(){return this.w},set:function(a){this.w!==a&&(null!==a&&w(a,If,Ni,"group"),this.w=a,null!==a&&(this.C=a.diagram))}},isOngoing:{configurable:!0,get:function(){return this.Ko},set:function(a){this.Ko!==a&&(A(a,"boolean",Ni,"isOngoing"),this.Ko=a)}},isInitial:{configurable:!0,
1754 enumerable:!0,get:function(){return this.Ki},set:function(a){A(a,"boolean",Ni,"isInitial");this.Ki=a;a||(this.Oo=!0)}},isViewportSized:{configurable:!0,get:function(){return this.Po},set:function(a){this.Po!==a&&(A(a,"boolean",Ni,"isViewportSized"),(this.Po=a)&&this.D())}},isRouting:{configurable:!0,get:function(){return this.Mo},set:function(a){this.Mo!==a&&(A(a,"boolean",Ni,"isRouting"),this.Mo=a)}},isRealtime:{configurable:!0,get:function(){return this.Lo},
1755 set:function(a){this.Lo!==a&&(null!==a&&A(a,"boolean",Ni,"isRealtime"),this.Lo=a)}},isValidLayout:{configurable:!0,get:function(){return this.Oo},set:function(a){this.Oo!==a&&(A(a,"boolean",Ni,"isValidLayout"),this.Oo=a,a||(a=this.diagram,null!==a&&(a.Zg=!0)))}},network:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(null!==a&&w(a,sq,Ni,"network"),this.l=a,null!==a&&(a.layout=this))}},boundsComputation:{configurable:!0,get:function(){return this.In},
1756 set:function(a){this.In!==a&&(null!==a&&A(a,"function",Ni,"boundsComputation"),this.In=a,this.D())}},arrangementOrigin:{configurable:!0,get:function(){return this.An},set:function(a){w(a,J,Ni,"arrangementOrigin");this.An.A(a)||(this.An.assign(a),this.D())}},id:{configurable:!0,get:function(){return this.L},set:function(a){this.L=a}},mayUseWorkerFunction:{configurable:!0,get:function(){return this.gp},set:function(a){this.gp!==a&&(null!==a&&A(a,"function",
1757 Ni,"mayUseWorkerFunction"),this.gp=a)}},workerStateChanged:{configurable:!0,get:function(){return this.Dq},set:function(a){this.Dq!==a&&(null!==a&&A(a,"function",Ni,"workerStateChanged"),this.Dq=a)}}});Ni.prototype.useWorker=Ni.prototype.kx;Ni.declareWorkerLayout=yq;Ni.prototype.cancelWorker=Ni.prototype.Qz;Ni.prototype.collectParts=Ni.prototype.qy;Ni.prototype.getLayoutBounds=Ni.prototype.yj;Ni.prototype.invalidateLayout=Ni.prototype.D;
1758 var zq=new Bb,Bq="object"===typeof qa.document&&qa.document.currentScript?qa.document.currentScript.src:"",Cq="undefined"!==typeof URL&&"function"===typeof URL.createObjectURL&&"function"===typeof Blob?URL.createObjectURL(new Blob(["self.onmessage=function(e){if(e.data.url){\nimportScripts(e.data.url);}}"],{type:"text/javascript"})):"";Ni.className="Layout";Ni.GoJSScriptURL=Bq;Ni.declareWorkerLayout=yq;
1759 "undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&"undefined"!==typeof self&&"undefined"!==typeof self.DedicatedWorkerGlobalScope&&(self.onmessage=function(a){a=a.data;if("_GoJS"===a._GoJS)if(a.url)importScripts(a.url);else if(a.version)self.postMessage({_GoJS:"_GoJS",version:R.version},void 0);else{var b=performance.now(),c=null;a.layout&&(c=xq(a.layout));var d=null;c&&c.Yv&&(d=new c.Yv);if(!d)throw Error("no registered Worker Layout: "+a.layout);d.network=Dq(d,a,!0);
1760 d.workerLayout=function(){var a=Fq(d,d.network,!1);a._GoJS="_GoJS";a.time=performance.now()-b;self.postMessage(a,void 0);return!0};d.doLayout(new H)}});function Aq(){this.Yv=null;this.Ry=this.l=this.name="";this.scripts=[];this.bf=null;this.Tm=new Bb}function sq(a){eb(this);F&&!a&&v("LayoutNetwork constructor requires non-null Layout argument");this.qc=a;this.Ff=new I;this.ve=new I;this.ou=new Bb;this.ju=new Bb}
1761 sq.prototype.clear=function(){if(this.Ff)for(var a=this.Ff.iterator;a.next();)a.value.clear();if(this.ve)for(a=this.ve.iterator;a.next();)a.value.clear();this.Ff=new I;this.ve=new I;this.ou=new Bb;this.ju=new Bb};
1762 sq.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.Ff.count+" edges: "+this.ve.count;if(1<a){for(var c=this.Ff.iterator;c.next();)b+="\n "+c.value.toString(a-1);for(c=this.ve.iterator;c.next();)b+="\n "+c.value.toString(a-1)}return b};sq.prototype.createVertex=function(){return new Gq(this)};sq.prototype.createEdge=function(){return new Hq(this)};
1763 sq.prototype.Mg=function(a,b,c){if(null!==a){void 0===b&&(b=!1);A(b,"boolean",sq,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof V)return!a.isLinkLabel;if(a instanceof S){var b=a.fromNode;if(null===b||b.isLinkLabel)return!1;a=a.toNode;return null===a||a.isLinkLabel?!1:!0}return!1});for(a=a.iterator;a.next();){var d=a.value;if(d instanceof V&&(!b||d.isTopLevel)&&d.canLayout()&&c(d))if(d instanceof If&&null===d.layout)this.Mg(d.memberParts,!1);else if(null===this.vj(d)){var e=
1764 this.createVertex();e.node=d;this.Ng(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof S&&(!b||d.isTopLevel)&&d.canLayout()&&c(d)&&null===this.Rq(d)){var f=d.fromNode;e=d.toNode;null!==f&&null!==e&&f!==e&&(f=this.findGroupVertex(f),e=this.findGroupVertex(e),null!==f&&null!==e&&this.Qk(f,e,d))}}};
1765 sq.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.vj(b);if(null!==a)return a;for(b=b.containingGroup;null!==b;){a=this.vj(b);if(null!==a)return a;b=b.containingGroup}return null};t=sq.prototype;t.Ng=function(a){if(null!==a){F&&w(a,Gq,sq,"addVertex:vertex");this.Ff.add(a);var b=a.node;null!==b&&this.ou.add(b,a);a.network=this}};
1766 t.zk=function(a){if(null===a)return null;F&&w(a,V,sq,"addNode:node");var b=this.vj(a);null===b&&(b=this.createVertex(),b.node=a,this.Ng(b));return b};t.aw=function(a){if(null!==a&&(F&&w(a,Gq,sq,"deleteVertex:vertex"),Iq(this,a))){for(var b=a.zd,c=b.count-1;0<=c;c--){var d=b.M(c);this.Hk(d)}b=a.Nd;for(a=b.count-1;0<=a;a--)c=b.M(a),this.Hk(c)}};function Iq(a,b){if(null===b)return!1;var c=a.Ff.remove(b);c&&(b=b.node,null!==b&&a.ou.remove(b));return c}
1767 t.bA=function(a){null!==a&&(F&&w(a,V,sq,"deleteNode:node"),a=this.vj(a),null!==a&&this.aw(a))};t.vj=function(a){if(null===a)return null;F&&w(a,V,sq,"findVertex:node");return this.ou.J(a)};t.Gm=function(a){if(null!==a){F&&w(a,Hq,sq,"addEdge:edge");Jq(this,a);var b=a.toVertex;null!==b&&b.Rv(a);b=a.fromVertex;null!==b&&b.Pv(a)}};function Jq(a,b){if(null!==b){a.ve.add(b);var c=b.link;null!==c&&null===a.Rq(c)&&a.ju.add(c,b);b.network=a}}
1768 t.Fz=function(a){if(null===a)return null;F&&w(a,S,sq,"addLink:link");var b=a.fromNode,c=a.toNode,d=this.Rq(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.zk(b)),null!==c&&(d.toVertex=this.zk(c)),this.Gm(d)):(null!==b?d.fromVertex=this.zk(b):d.fromVertex=null,null!==c?d.toVertex=this.zk(c):d.toVertex=null);return d};t.Hk=function(a){if(null!==a){F&&w(a,Hq,sq,"deleteEdge:edge");var b=a.toVertex;null!==b&&b.$v(a);b=a.fromVertex;null!==b&&b.Zv(a);Kq(this,a)}};
1769 function Kq(a,b){null!==b&&a.ve.remove(b)&&(b=b.link,null!==b&&a.ju.remove(b))}t.aA=function(a){null!==a&&(F&&w(a,S,sq,"deleteLink:link"),a=this.Rq(a),null!==a&&this.Hk(a))};t.Rq=function(a){if(null===a)return null;F&&w(a,S,sq,"findEdge:link");return this.ju.J(a)};
1770 t.Qk=function(a,b,c){if(null===a||null===b)return null;F&&(w(a,Gq,sq,"linkVertexes:fromVertex"),w(b,Gq,sq,"linkVertexes:toVertex"),null!==c&&w(c,S,sq,"linkVertexes:link"));if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.Gm(d);return d}return null};t.en=function(a){if(null!==a){F&&w(a,Hq,sq,"reverseEdge:edge");var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.Zv(a),c.$v(a),a.en(),b.Rv(a),c.Pv(a))}};
1771 t.Oq=function(){for(var a=Ma(),b=this.ve.iterator;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.Hk(a[c]);Oa(a)};sq.prototype.deleteArtificialVertexes=function(){for(var a=Ma(),b=this.Ff.iterator;b.next();){var c=b.value;null===c.node&&null===c.data&&a.push(c)}c=a.length;for(b=0;b<c;b++)this.aw(a[b]);b=Ma();for(c=this.ve.iterator;c.next();){var d=c.value;null===d.link&&null===d.data&&b.push(d)}c=b.length;for(d=0;d<c;d++)this.Hk(b[d]);Oa(a);Oa(b)};
1772 function Lq(a){for(var b=Ma(),c=a.ve.iterator;c.next();){var d=c.value;null!==d.fromVertex&&null!==d.toVertex||b.push(d)}c=b.length;for(d=0;d<c;d++)a.Hk(b[d]);Oa(b)}
1773 sq.prototype.mz=function(a){void 0===a&&(a=!0);a&&(this.deleteArtificialVertexes(),Lq(this),this.Oq());a=new H;for(var b=!0;b;){b=!1;for(var c=this.Ff.iterator;c.next();){var d=c.value;if(0<d.zd.count||0<d.Nd.count){b=this.layout.createNetwork();a.add(b);Mq(this,b,d);b=!0;break}}}a.sort(function(a,b){return null===a||null===b||a===b?0:b.vertexes.count-a.vertexes.count});return a};
1774 function Mq(a,b,c){if(null!==c&&c.network!==b){Iq(a,c);b.Ng(c);for(var d=c.sourceEdges;d.next();){var e=d.value;e.network!==b&&(Kq(a,e),Jq(b,e),Mq(a,b,e.fromVertex))}for(d=c.destinationEdges;d.next();)c=d.value,c.network!==b&&(Kq(a,c),Jq(b,c),Mq(a,b,c.toVertex))}}sq.prototype.kA=function(){for(var a=new I,b=this.Ff.iterator;b.next();)a.add(b.value.node);for(b=this.ve.iterator;b.next();)a.add(b.value.link);return a};
1775 na.Object.defineProperties(sq.prototype,{layout:{configurable:!0,get:function(){return this.qc},set:function(a){null!==a&&(this.qc=a)}},vertexes:{configurable:!0,get:function(){return this.Ff}},edges:{configurable:!0,get:function(){return this.ve}}});sq.prototype.findAllParts=sq.prototype.kA;sq.prototype.splitIntoSubNetworks=sq.prototype.mz;sq.prototype.deleteSelfEdges=sq.prototype.Oq;sq.prototype.reverseEdge=sq.prototype.en;sq.prototype.linkVertexes=sq.prototype.Qk;
1776 sq.prototype.findEdge=sq.prototype.Rq;sq.prototype.deleteLink=sq.prototype.aA;sq.prototype.deleteEdge=sq.prototype.Hk;sq.prototype.addLink=sq.prototype.Fz;sq.prototype.addEdge=sq.prototype.Gm;sq.prototype.findVertex=sq.prototype.vj;sq.prototype.deleteNode=sq.prototype.bA;sq.prototype.deleteVertex=sq.prototype.aw;sq.prototype.addNode=sq.prototype.zk;sq.prototype.addVertex=sq.prototype.Ng;sq.prototype.addParts=sq.prototype.Mg;sq.className="LayoutNetwork";
1777 function Gq(a){eb(this);F&&!a&&v("LayoutVertex constructor requires non-null LayoutNetwork argument");this.Zc=a;this.l=(new L(0,0,10,10)).freeze();this.w=(new J(5,5)).freeze();this.Xi=this.tb=null;this.zd=new H;this.Nd=new H}
1778 Gq.prototype.serializeVertexProperties=function(a){a.id=ob(this);a.key=this.node?this.node.key:this.data?this.data.Oi:void 0;void 0===a.key&&(a.key=null);a.x=this.bounds.x;a.y=this.bounds.y;a.EB=this.bounds.width;a.NA=this.bounds.height;a.fx=this.focus.x;a.fy=this.focus.y;var b=[];this.zd.each(function(a){b.push(ob(a))});a.jz=b;var c=[];this.Nd.each(function(a){c.push(ob(a))});a.yy=c};
1779 Gq.prototype.Pq=function(a,b,c){if(null!==a){this.x=a.x;this.y=a.y;this.width=a.EB;this.height=a.NA;this.focusX=a.fx;this.focusY=a.fy;var d=this;a.jz&&a.jz.forEach(function(a){(a=c.get(a))&&d.zd.add(a)});a.yy&&a.yy.forEach(function(a){(a=c.get(a))&&d.Nd.add(a)})}};Gq.prototype.clear=function(){this.Xi=this.tb=null;this.zd=new H;this.Nd=new H};
1780 Gq.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+ob(this);if(0<a&&(b+=null!==this.node?"("+this.node.toString()+")":"",1<a)){a="";for(var c=!0,d=this.zd.iterator;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Nd.iterator;d.next();){var f=d.value;c?c=!1:e+=",";e+=f.toString(0)}b+=" sources: "+a+" destinations: "+e}return b};
1781 Gq.prototype.commit=function(){var a=this.tb;if(null!==a){var b=this.bounds,c=a.bounds;Ga(c)?(c.x=b.x,c.y=b.y,c.width=b.width,c.height=b.height):a.bounds=b.copy()}else if(a=this.node,null!==a){b=this.bounds;if(!(a instanceof If)){c=L.alloc();var d=this.network.layout.yj(a,c),e=a.locationObject.ja(Kc);if(d.o()&&e.o()){a.moveTo(b.x+this.focusX-(e.x-d.x),b.y+this.focusY-(e.y-d.y));L.free(c);return}L.free(c)}a.moveTo(b.x,b.y)}};
1782 Gq.prototype.Rv=function(a){null!==a&&(F&&w(a,Hq,Gq,"addSourceEdge:edge"),this.zd.contains(a)||this.zd.add(a))};Gq.prototype.$v=function(a){null!==a&&(F&&w(a,Hq,Gq,"deleteSourceEdge:edge"),this.zd.remove(a))};Gq.prototype.Pv=function(a){null!==a&&(F&&w(a,Hq,Gq,"addDestinationEdge:edge"),this.Nd.contains(a)||this.Nd.add(a))};Gq.prototype.Zv=function(a){null!==a&&(F&&w(a,Hq,Gq,"deleteDestinationEdge:edge"),this.Nd.remove(a))};
1783 function Nq(a,b){F&&w(a,Gq,Gq,"standardComparer:m");F&&w(b,Gq,Gq,"standardComparer:n");a=a.Xi;b=b.Xi;return a?b?(a=a.text,b=b.text,a<b?-1:a>b?1:0):1:null!==b?-1:0}
1784 na.Object.defineProperties(Gq.prototype,{sourceEdgesArrayAccess:{configurable:!0,get:function(){return this.zd._dataArray}},destinationEdgesArrayAccess:{configurable:!0,get:function(){return this.Nd._dataArray}},data:{configurable:!0,get:function(){return this.tb},set:function(a){this.tb=a;if(null!==a&&a.bounds){var b=a.bounds;a=b.x;var c=b.y,d=b.width;b=b.height;this.w.h(d/2,b/2);this.l.h(a,c,d,b)}}},node:{configurable:!0,get:function(){return this.Xi},
1785 set:function(a){if(this.Xi!==a){F&&null!==a&&w(a,V,Gq,"node");this.Xi=a;a.Ya();var b=this.network.layout,c=L.alloc(),d=b.yj(a,c);b=d.x;var e=d.y,f=d.width;d=d.height;isNaN(b)&&(b=0);isNaN(e)&&(e=0);this.l.h(b,e,f,d);L.free(c);if(!(a instanceof If)&&(a=a.locationObject.ja(Kc),a.o())){this.w.h(a.x-b,a.y-e);return}this.w.h(f/2,d/2)}}},bounds:{configurable:!0,get:function(){return this.l},set:function(a){this.l.A(a)||(F&&w(a,L,Gq,"bounds"),this.l.assign(a))}},focus:{configurable:!0,
1786 get:function(){return this.w},set:function(a){this.w.A(a)||(F&&w(a,J,Gq,"focus"),this.w.assign(a))}},centerX:{configurable:!0,get:function(){return this.l.x+this.w.x},set:function(a){var b=this.l;b.x+this.w.x!==a&&(F&&C(a,Gq,"centerX"),b.ka(),b.x=a-this.w.x,b.freeze())}},centerY:{configurable:!0,get:function(){return this.l.y+this.w.y},set:function(a){var b=this.l;b.y+this.w.y!==a&&(F&&C(a,Gq,"centerY"),b.ka(),b.y=a-this.w.y,b.freeze())}},focusX:{configurable:!0,
1787 get:function(){return this.w.x},set:function(a){var b=this.w;b.x!==a&&(b.ka(),b.x=a,b.freeze())}},focusY:{configurable:!0,get:function(){return this.w.y},set:function(a){var b=this.w;b.y!==a&&(b.ka(),b.y=a,b.freeze())}},x:{configurable:!0,get:function(){return this.l.x},set:function(a){var b=this.l;b.x!==a&&(b.ka(),b.x=a,b.freeze())}},y:{configurable:!0,get:function(){return this.l.y},set:function(a){var b=this.l;b.y!==a&&(b.ka(),b.y=a,b.freeze())}},width:{configurable:!0,
1788 enumerable:!0,get:function(){return this.l.width},set:function(a){var b=this.l;b.width!==a&&(b.ka(),b.width=a,b.freeze())}},height:{configurable:!0,get:function(){return this.l.height},set:function(a){var b=this.l;b.height!==a&&(b.ka(),b.height=a,b.freeze())}},network:{configurable:!0,get:function(){return this.Zc},set:function(a){F&&w(a,sq,Gq,"network");this.Zc=a}},sourceVertexes:{configurable:!0,get:function(){for(var a=new I,b=this.sourceEdges;b.next();)a.add(b.value.fromVertex);
1789 return a.iterator}},destinationVertexes:{configurable:!0,get:function(){for(var a=new I,b=this.destinationEdges;b.next();)a.add(b.value.toVertex);return a.iterator}},vertexes:{configurable:!0,get:function(){for(var a=new I,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.zd.iterator}},destinationEdges:{configurable:!0,
1790 enumerable:!0,get:function(){return this.Nd.iterator}},edges:{configurable:!0,get:function(){for(var a=new H,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.zd.count+this.Nd.count}}});Gq.prototype.deleteDestinationEdge=Gq.prototype.Zv;Gq.prototype.addDestinationEdge=Gq.prototype.Pv;Gq.prototype.deleteSourceEdge=Gq.prototype.$v;
1791 Gq.prototype.addSourceEdge=Gq.prototype.Rv;Gq.className="LayoutVertex";Gq.standardComparer=Nq;
1792 Gq.smartComparer=function(a,b){F&&w(a,Gq,Gq,"smartComparer:m");F&&w(b,Gq,Gq,"smartComparer:n");if(null!==a){if(null!==b){a=a.Xi;var c=b.Xi;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<b.length;c++)if(""!==a[c]&&void 0!==a[c]){var d=parseFloat(b[c]),e=parseFloat(a[c]);if(isNaN(d))if(isNaN(e)){if(0!==b[c].localeCompare(a[c]))return b[c].localeCompare(a[c])}else return 1;
1793 else{if(isNaN(e))return-1;if(0!==d-e)return d-e}}else if(""!==b[c])return 1;return""!==a[c]&&void 0!==a[c]?-1:0}return 1}return null!==c?-1:0}return 1}return null!==b?-1:0};function Hq(a){eb(this);F&&!a&&v("LayoutEdge constructor requires non-null LayoutNetwork argument");this.Yc=a;this.ld=this.dd=this.$l=this.tb=null}Hq.prototype.clear=function(){this.ld=this.dd=this.$l=this.tb=null};
1794 Hq.prototype.serializeEdgeProperties=function(a){a.id=ob(this);a.key=this.link?this.link.key:this.data?this.data.Oi:void 0;void 0===a.key&&(a.key=null);a.from=this.fromVertex?ob(this.fromVertex):null;a.zB=this.toVertex?ob(this.toVertex):null};Hq.prototype.deserializeEdgeProperties=function(a,b){if(null!==a){var c=b.get(a.from);c&&(this.fromVertex=c);if(a=b.get(a.zB))this.toVertex=a}};
1795 Hq.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+ob(this);0<a&&(b+=null!==this.$l?"("+this.$l.toString()+")":"",1<a&&(b+=" "+(this.dd?this.dd.toString():"null")+" --\x3e "+(this.ld?this.ld.toString():"null")));return b};Hq.prototype.en=function(){var a=this.dd;this.dd=this.ld;this.ld=a};Hq.prototype.commit=function(){};Hq.prototype.Oy=function(a){F&&w(a,Gq,Hq,"getOtherVertex:v");return this.ld===a?this.dd:this.dd===a?this.ld:null};
1796 na.Object.defineProperties(Hq.prototype,{network:{configurable:!0,get:function(){return this.Yc},set:function(a){F&&w(a,sq,Hq,"network");this.Yc=a}},data:{configurable:!0,get:function(){return this.tb},set:function(a){this.tb!==a&&(F&&null!==a&&A(a,"object",Hq,"data"),this.tb=a)}},link:{configurable:!0,get:function(){return this.$l},set:function(a){this.$l!==a&&(F&&null!==a&&w(a,S,Hq,"link"),this.$l=a)}},fromVertex:{configurable:!0,get:function(){return this.dd},
1797 set:function(a){this.dd!==a&&(F&&null!==a&&w(a,Gq,Hq,"fromVertex"),this.dd=a)}},toVertex:{configurable:!0,get:function(){return this.ld},set:function(a){this.ld!==a&&(F&&null!==a&&w(a,Gq,Hq,"toVertex"),this.ld=a)}}});Hq.prototype.getOtherVertex=Hq.prototype.Oy;Hq.className="LayoutEdge";
1798 function gl(){0<arguments.length&&Ba(gl);Ni.call(this);this.isViewportSized=!0;this.Eq=this.Fq=NaN;this.bh=(new Fb(NaN,NaN)).freeze();this.yf=(new Fb(10,10)).freeze();this.Db=Oq;this.Kb=Pq;this.hd=Qq;this.bd=Rq}ma(gl,Ni);gl.prototype.cloneProtected=function(a){Ni.prototype.cloneProtected.call(this,a);a.Fq=this.Fq;a.Eq=this.Eq;a.bh.assign(this.bh);a.yf.assign(this.yf);a.Db=this.Db;a.Kb=this.Kb;a.hd=this.hd;a.bd=this.bd};
1799 gl.prototype.pb=function(a){a.classType===gl?a===Qq||a===Sq||a===Tq||a===Uq?this.sorting=a:a===Pq||a===Vq?this.arrangement=a:a===Oq||a===Wq?this.alignment=a:v("Unknown enum value: "+a):Ni.prototype.pb.call(this,a)};
1800 gl.prototype.doLayout=function(a){F&&null===a&&v("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);var b=this.qy(a);a=this.diagram;for(var c=b.copy().iterator;c.next();){var d=c.value;if(!d.$h()||null===d.fromNode&&null===d.toNode){if(d.Ya(),d instanceof If)for(d=d.memberParts;d.next();)b.remove(d.value)}else b.remove(d)}var e=b.ta();if(0!==e.length){switch(this.sorting){case Uq:e.reverse();
1801 break;case Qq:e.sort(this.comparer);break;case Sq:e.sort(this.comparer),e.reverse()}var f=this.wrappingColumn;isNaN(f)&&(f=0);var g=this.wrappingWidth;isNaN(g)&&null!==a?(b=a.padding,g=Math.max(a.viewportBounds.width-b.left-b.right,0)):g=Math.max(this.wrappingWidth,0);0>=f&&0>=g&&(f=1);b=this.spacing.width;isFinite(b)||(b=0);c=this.spacing.height;isFinite(c)||(c=0);null!==a&&a.Ca("Layout");d=[];switch(this.alignment){case Wq:var h=b,k=c,l=L.alloc(),m=Math.max(this.cellSize.width,1);if(!isFinite(m))for(var n=
1802 m=0;n<e.length;n++){var p=this.yj(e[n],l);m=Math.max(m,p.width)}m=Math.max(m+h,1);n=Math.max(this.cellSize.height,1);if(!isFinite(n))for(p=n=0;p<e.length;p++){var r=this.yj(e[p],l);n=Math.max(n,r.height)}n=Math.max(n+k,1);p=this.arrangement;for(var q=r=this.arrangementOrigin.x,u=this.arrangementOrigin.y,y=0,x=0,z=0;z<e.length;z++){var B=e[z],D=this.yj(B,l),G=Math.ceil((D.width+h)/m)*m,M=Math.ceil((D.height+k)/n)*n;switch(p){case Vq:var Y=Math.abs(q-D.width);break;default:Y=q+D.width}if(0<f&&y>f-1||
1803 0<g&&0<y&&Y-r>g)d.push(new L(0,u,g+h,x)),y=0,q=r,u+=x,x=0;x=Math.max(x,M);switch(p){case Vq:D=-D.width;break;default:D=0}B.moveTo(q+D,u);switch(p){case Vq:q-=G;break;default:q+=G}y++}d.push(new L(0,u,g+h,x));L.free(l);break;case Oq:k=g;m=f;n=b;p=c;g=L.alloc();r=Math.max(this.cellSize.width,1);f=u=l=0;h=J.alloc();for(q=0;q<e.length;q++)x=e[q],y=this.yj(x,g),x=x.Pf(x.locationObject,x.locationSpot,h),l=Math.max(l,x.x),u=Math.max(u,y.width-x.x),f=Math.max(f,x.y);q=this.arrangement;switch(q){case Vq:l+=
1804 n;break;default:u+=n}r=isFinite(r)?Math.max(r+n,1):Math.max(l+u,1);var Q=x=this.arrangementOrigin.x;z=this.arrangementOrigin.y;u=0;k>=l&&(k-=l);l=B=0;G=Math.max(this.cellSize.height,1);D=f=0;M=!0;y=J.alloc();for(Y=0;Y<e.length;Y++){var ca=e[Y],T=this.yj(ca,g),P=ca.Pf(ca.locationObject,ca.locationSpot,h);if(0<u)switch(q){case Vq:Q=(Q-x-(T.width-P.x))/r;Q=K.da(Math.round(Q),Q)?Math.round(Q):Math.floor(Q);Q=Q*r+x;break;default:Q=(Q-x+P.x)/r,Q=K.da(Math.round(Q),Q)?Math.round(Q):Math.ceil(Q),Q=Q*r+x}else switch(q){case Vq:B=
1805 Q+P.x+T.width;break;default:B=Q-P.x}switch(q){case Vq:var xa=-(Q+P.x)+B;break;default:xa=Q+T.width-P.x-B}if(0<m&&u>m-1||0<k&&0<u&&xa>k){d.push(new L(0,M?z-f:z,k+n,D+f+p));for(Q=0;Q<u&&Y!==u;Q++){xa=e[Y-u+Q];var ka=xa.Pf(xa.locationObject,xa.locationSpot,y);xa.moveTo(xa.position.x,xa.position.y+f-ka.y)}D+=p;z=M?z+D:z+(D+f);u=D=f=0;Q=x;M=!1}Q===x&&(l=q===Vq?Math.max(l,T.width-P.x):Math.min(l,-P.x));f=Math.max(f,P.y);D=Math.max(D,T.height-P.y);isFinite(G)&&(D=Math.max(D,Math.max(T.height,G)-P.y));M?
1806 ca.moveTo(Q-P.x,z-P.y):ca.moveTo(Q-P.x,z);switch(q){case Vq:Q-=P.x+n;break;default:Q+=T.width-P.x+n}u++}d.push(new L(0,z,k+n,(M?D:D+f)+p));if(e.length!==u)for(k=0;k<u;k++)m=e[e.length-u+k],n=m.Pf(m.locationObject,m.locationSpot,h),m.moveTo(m.position.x,m.position.y+f-n.y);J.free(h);J.free(y);if(q===Vq)for(e=0;e<d.length;e++)f=d[e],f.width+=l,f.x-=l;else for(e=0;e<d.length;e++)f=d[e],f.x>l&&(f.width+=f.x-l,f.x=l);L.free(g)}for(h=f=g=e=0;h<d.length;h++)k=d[h],e=Math.min(e,k.x),g=Math.min(g,k.y),f=Math.max(f,
1807 k.x+k.width);this.arrangement===Vq?this.commitLayers(d,new J(e+b/2-(f+e),g-c/2)):this.commitLayers(d,new J(e-b/2,g-c/2));null!==a&&a.cb("Layout");this.isValidLayout=!0}};gl.prototype.commitLayers=function(){};function Rq(a,b){F&&w(a,U,gl,"standardComparer:a");F&&w(b,U,gl,"standardComparer:b");a=a.text;b=b.text;return a<b?-1:a>b?1:0}
1808 na.Object.defineProperties(gl.prototype,{wrappingWidth:{configurable:!0,get:function(){return this.Fq},set:function(a){this.Fq!==a&&(A(a,"number",gl,"wrappingWidth"),0<a||isNaN(a))&&(this.Fq=a,this.isViewportSized=isNaN(a),this.D())}},wrappingColumn:{configurable:!0,get:function(){return this.Eq},set:function(a){this.Eq!==a&&(A(a,"number",gl,"wrappingColumn"),0<a||isNaN(a))&&(this.Eq=a,this.D())}},cellSize:{configurable:!0,get:function(){return this.bh},set:function(a){w(a,
1809 Fb,gl,"cellSize");this.bh.A(a)||(this.bh.assign(a),this.D())}},spacing:{configurable:!0,get:function(){return this.yf},set:function(a){w(a,Fb,gl,"spacing");this.yf.A(a)||(this.yf.assign(a),this.D())}},alignment:{configurable:!0,get:function(){return this.Db},set:function(a){this.Db!==a&&(gb(a,gl,gl,"alignment"),a===Oq||a===Wq)&&(this.Db=a,this.D())}},arrangement:{configurable:!0,get:function(){return this.Kb},set:function(a){this.Kb!==a&&(gb(a,gl,gl,"arrangement"),
1810 a===Pq||a===Vq)&&(this.Kb=a,this.D())}},sorting:{configurable:!0,get:function(){return this.hd},set:function(a){this.hd!==a&&(gb(a,gl,gl,"sorting"),a===Tq||a===Uq||a===Qq||a===Sq)&&(this.hd=a,this.D())}},comparer:{configurable:!0,get:function(){return this.bd},set:function(a){this.bd!==a&&(A(a,"function",gl,"comparer"),this.bd=a,this.D())}}});
1811 var Wq=new E(gl,"Position",0),Oq=new E(gl,"Location",1),Pq=new E(gl,"LeftToRight",2),Vq=new E(gl,"RightToLeft",3),Tq=new E(gl,"Forward",4),Uq=new E(gl,"Reverse",5),Qq=new E(gl,"Ascending",6),Sq=new E(gl,"Descending",7);gl.className="GridLayout";gl.standardComparer=Rq;
1812 gl.smartComparer=function(a,b){F&&w(a,U,gl,"standardComparer:a");F&&w(b,U,gl,"standardComparer:b");if(null!==a){if(null!==b){a=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/);b=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/);for(var c=0;c<a.length;c++)if(""!==b[c]&&void 0!==b[c]){var d=parseFloat(a[c]),e=parseFloat(b[c]);if(isNaN(d))if(isNaN(e)){if(0!==a[c].localeCompare(b[c]))return a[c].localeCompare(b[c])}else return 1;else{if(isNaN(e))return-1;
1813 if(0!==d-e)return d-e}}else if(""!==a[c])return 1;return""!==b[c]&&void 0!==b[c]?-1:0}return 1}return null!==b?-1:0};gl.Position=Wq;gl.Location=Oq;gl.LeftToRight=Pq;gl.RightToLeft=Vq;gl.Forward=Tq;gl.Reverse=Uq;gl.Ascending=Qq;gl.Descending=Sq;function Ii(){this.zp=new I;this.$o=new I;this.Ja=new I;this.ff=new Bb;this.ef=new Bb;this.bk=new Bb;this.C=null;this.Br=!1}t=Ii.prototype;t.clear=function(){this.zp.clear();this.$o.clear();this.Ja.clear();this.ff.clear();this.ef.clear();this.bk.clear()};
1814 t.me=function(a){F&&null!==a&&w(a,R,Ii,"setDiagram");this.C=a};t.zj=function(a){if(a instanceof V){if(this.zp.add(a),a instanceof If){var b=a.containingGroup;null===b?this.C.Oh.add(a):b.em.add(a);b=a.layout;null!==b&&(b.diagram=this.C)}}else a instanceof S?this.$o.add(a):a instanceof Ve||this.Ja.add(a);b=a.data;null===b||a instanceof Ve||(a instanceof S?this.ef.add(b,a):this.ff.add(b,a))};
1815 t.Rc=function(a){a.Ak();if(a instanceof V){if(this.zp.remove(a),a instanceof If){var b=a.containingGroup;null===b?this.C.Oh.remove(a):b.em.remove(a);b=a.layout;null!==b&&(b.diagram=null)}}else a instanceof S?this.$o.remove(a):a instanceof Ve||this.Ja.remove(a);b=a.data;null===b||a instanceof Ve||(a instanceof S?this.ef.remove(b):this.ff.remove(b))};
1816 t.Sd=function(){for(var a=this.C.nodeTemplateMap.iterator;a.next();){var b=a.value,c=a.key;(!b.Tc()||b instanceof If)&&v('Invalid node template in Diagram.nodeTemplateMap: template for "'+c+'" must be a Node or a simple Part, not a Group or Link: '+b)}for(a=this.C.groupTemplateMap.iterator;a.next();)b=a.value,c=a.key,b instanceof If||v('Invalid group template in Diagram.groupTemplateMap: template for "'+c+'" must be a Group, not a normal Node or Link: '+b);for(a=this.C.linkTemplateMap.iterator;a.next();)b=
1817 a.value,c=a.key,b instanceof S||v('Invalid link template in Diagram.linkTemplateMap: template for "'+c+'" must be a Link, not a normal Node or simple Part: '+b);a=Ma();for(b=this.C.selection.iterator;b.next();)(c=b.value.data)&&a.push(c);b=Ma();for(c=this.C.highlighteds.iterator;c.next();){var d=c.value.data;d&&b.push(d)}c=Ma();for(d=this.nodes.iterator;d.next();){var e=d.value;null!==e.data&&(c.push(e.data),c.push(e.location))}for(d=this.links.iterator;d.next();)e=d.value,null!==e.data&&(c.push(e.data),
1818 c.push(e.location));for(d=this.parts.iterator;d.next();)e=d.value,null!==e.data&&(c.push(e.data),c.push(e.location));this.removeAllModeledParts();this.addAllModeledParts();for(d=0;d<a.length;d++)e=this.Fc(a[d]),null!==e&&(e.isSelected=!0);for(d=0;d<b.length;d++)e=this.Fc(b[d]),null!==e&&(e.isHighlighted=!0);for(d=0;d<c.length;d+=2)e=this.Fc(c[d]),null!==e&&(e.location=c[d+1]);Oa(a);Oa(b);Oa(c)};Ii.prototype.addAllModeledParts=function(){this.addModeledParts(this.diagram.model.nodeDataArray)};
1819 Ii.prototype.addModeledParts=function(a,b){var c=this,d=this.diagram.model;a.forEach(function(a){d.$a(a)&&Xq(c,a,!1)});a.forEach(function(a){d.$a(a)&&c.resolveReferencesForData(a)});!1!==b&&uk(this.diagram,!1)};
1820 function Xq(a,b,c){if(void 0!==b&&null!==b&&!a.diagram.undoManager.isUndoingRedoing&&!a.ff.contains(b)){void 0===c&&(c=!0);a:{if(void 0!==b&&null!==b&&!a.C.undoManager.isUndoingRedoing&&!a.ff.contains(b)){var d=a.Vq(b);var e=gp(a,b,d);if(null!==e&&(yg(e),e=e.copy(),null!==e)){var f=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0;e.Zf=d;e.tb=b;a.Br&&(e.uh="Tool");a.diagram.add(e);e.tb=null;e.data=b;a.diagram.skipsModelSourceBindings=f;d=e;break a}}d=null}null!==d&&c&&a.resolveReferencesForData(b)}}
1821 Ii.prototype.insertLink=function(){return null};Ii.prototype.resolveReferencesForData=function(){};Ii.prototype.Vq=function(a){return this.C.model.Vq(a)};
1822 function gp(a,b,c){a=a.C;var d=a.model;d.Aj()&&d.fu(b)?(b=a.groupTemplateMap.J(c),null===b&&(b=a.groupTemplateMap.J(""),null===b&&(Yq||(Yq=!0,Ea('No Group template found for category "'+c+'"'),Ea(" Using default group template")),b=a.Ru))):(b=a.nodeTemplateMap.J(c),null===b&&(b=a.nodeTemplateMap.J(""),null===b&&(Zq||(Zq=!0,Ea('No Node template found for category "'+c+'"'),Ea(" Using default node template")),b=a.Tu)));return b}Ii.prototype.getLinkCategoryForData=function(){return""};
1823 Ii.prototype.setLinkCategoryForData=function(){};Ii.prototype.setFromNodeForLink=function(){};Ii.prototype.setToNodeForLink=function(){};Ii.prototype.findLinkTemplateForCategory=function(a){var b=this.C.linkTemplateMap.J(a);null===b&&(b=this.C.linkTemplateMap.J(""),null===b&&($q||($q=!0,Ea('No Link template found for category "'+a+'"'),Ea(" Using default link template")),b=this.C.Su));return b};Ii.prototype.removeAllModeledParts=function(){this.su(this.diagram.model.nodeDataArray)};
1824 Ii.prototype.su=function(a){var b=this;a.forEach(function(a){b.nr(a)})};Ii.prototype.nr=function(a){a=this.Fc(a);null!==a&&(bk(this.diagram,a,!1),this.unresolveReferencesForPart(a))};Ii.prototype.unresolveReferencesForPart=function(){};Ii.prototype.removeDataForLink=function(){};Ii.prototype.findPartForKey=function(a){if(null===a||void 0===a)return null;a=this.C.model.Qb(a);return null!==a?this.ff.J(a):null};
1825 Ii.prototype.Hb=function(a){if(null===a||void 0===a)return null;a=this.C.model.Qb(a);if(null===a)return null;a=this.ff.J(a);return a instanceof V?a:null};Ii.prototype.findLinkForKey=function(){return null};t=Ii.prototype;t.Fc=function(a){if(null===a)return null;var b=this.ff.J(a);return null!==b?b:b=this.ef.J(a)};t.rj=function(a){if(null===a)return null;a=this.ff.J(a);return a instanceof V?a:null};t.Ec=function(a){return null===a?null:this.ef.J(a)};
1826 t.Vt=function(a){for(var b=0;b<arguments.length;++b);b=new I;for(var c=this.zp.iterator;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var g=arguments[f];if(Ga(g)&&ar(this,e,g)){b.add(d);break}}}return b.iterator};t.Ut=function(a){for(var b=0;b<arguments.length;++b);b=new I;for(var c=this.$o.iterator;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var g=arguments[f];if(Ga(g)&&ar(this,e,g)){b.add(d);break}}}return b.iterator};
1827 function ar(a,b,c){for(var d in c){var e=b[d],f=c[d];if(Ha(f)){if(!Ha(e)||e.length<f.length)return!1;for(var g=0;g<e.length;g++){var h=f[g];if(void 0!==h&&!br(a,e[g],h))return!1}}else if(!br(a,e,f))return!1}return!0}function br(a,b,c){if("function"===typeof c){if(!c(b))return!1}else if(c instanceof RegExp){if(!b||!c.test(b.toString()))return!1}else if(Ga(b)&&Ga(c)){if(!ar(a,b,c))return!1}else if(b!==c)return!1;return!0}
1828 Ii.prototype.doModelChanged=function(a){if(this.C){var b=this.C;if(a.model===b.model){var c=a.change;b.doModelChanged(a);if(b.ba){b.ba=!1;try{var d=a.modelChange;if(""!==d)if(c===Ce){if("nodeCategory"===d){var e=this.Fc(a.object),f=a.newValue;null!==e&&"string"===typeof f&&(e.category=f)}else"nodeDataArray"===d&&(this.su(a.oldValue),this.addModeledParts(a.newValue));b.isModified=!0}else if(c===Le){var g=a.newValue;"nodeDataArray"===d&&Ga(g)&&Xq(this,g);b.isModified=!0}else if(c===Me){var h=a.oldValue;
1829 "nodeDataArray"===d&&Ga(h)&&this.nr(h);b.isModified=!0}else c===De&&("SourceChanged"===d?null!==a.object?this.updateDataBindings(a.object,a.propertyName):(this.xr(),this.updateAllTargetBindings()):"ModelDisplaced"===d&&this.Sd());else if(c===Ce){var k=a.propertyName,l=a.object;if(l===b.model){if("nodeKeyProperty"===k||"nodeCategoryProperty"===k)b.undoManager.isUndoingRedoing||this.Sd()}else this.updateDataBindings(l,k);b.isModified=!0}else if(c===Le||c===Me){var m=a.change===Le,n=m?a.newParam:a.oldParam,
1830 p=m?a.newValue:a.oldValue,r=this.bk.J(a.object);if(Array.isArray(r))for(a=0;a<r.length;a++){var q=r[a];if(m)Hn(q,p,n);else if(!(0>n)){var u=n+zn(q);q.Rc(u,!0);Ln(q,u,n)}}b.isModified=!0}}finally{b.ba=!0}}}}};Ii.prototype.updateAllTargetBindings=function(a){void 0===a&&(a="");for(var b=this.parts.iterator;b.next();)b.value.Ia(a);for(b=this.nodes.iterator;b.next();)b.value.Ia(a);for(b=this.links.iterator;b.next();)b.value.Ia(a)};
1831 Ii.prototype.xr=function(){for(var a=this.C.model,b=new I,c=a.nodeDataArray,d=0;d<c.length;d++)b.add(c[d]);var e=[];this.nodes.each(function(a){null===a.data||b.contains(a.data)||e.push(a.data)});this.parts.each(function(a){null===a.data||b.contains(a.data)||e.push(a.data)});e.forEach(function(b){cr(a,b,!1)});for(d=0;d<c.length;d++){var f=c[d];null===this.Fc(f)&&dr(a,f,!1)}this.refreshDataBoundLinks();for(c=this.parts.iterator;c.next();)c.value.updateRelationshipsFromData();for(c=this.nodes.iterator;c.next();)c.value.updateRelationshipsFromData();
1832 for(c=this.links.iterator;c.next();)c.value.updateRelationshipsFromData()};Ii.prototype.refreshDataBoundLinks=function(){};Ii.prototype.updateRelationshipsFromData=function(){};
1833 Ii.prototype.updateDataBindings=function(a,b){if("string"===typeof b){var c=this.Fc(a);if(null!==c)c.Ia(b);else{c=null;for(var d=this.bk.iterator;d.next();){for(var e=d.value,f=0;f<e.length;f++){var g=e[f].Gy(a);null!==g&&(null===c&&(c=Ma()),c.push(g))}if(null!==c)break}if(null!==c){for(d=0;d<c.length;d++)c[d].Ia(b);Oa(c)}}a===this.diagram.model.modelData&&this.updateAllTargetBindings(b)}};
1834 function Xj(a,b){var c=b.Ni;if(Ha(c)){var d=a.bk.J(c);if(null===d)d=[],d.push(b),a.bk.add(c,d);else{for(a=0;a<d.length;a++)if(d[a]===b)return;d.push(b)}}}function ak(a,b,c){Vj(b,function(a){a=a.$.j;for(var b=a.length,d=0;d<b;d++)sk(c,a[d])});var d=b.Ni;if(Ha(d)){var e=a.bk.J(d);if(null!==e)for(var f=0;f<e.length;f++)if(e[f]===b){e.splice(f,1);0===e.length&&a.bk.remove(d);break}}}
1835 Ii.prototype.Fk=function(a,b,c){void 0===c&&(c=!1);var d=new Bb;if(Ha(a))for(var e=0;e<a.length;e++)er(this,a[e],b,d,c);else for(a=a.iterator;a.next();)er(this,a.value,b,d,c);if(null!==b){c=b.model;a=b.toolManager.findTool("Dragging");a=null!==a?a.dragOptions.dragsLink:b.wl.dragsLink;e=new I;for(var f=new Bb,g=d.iterator;g.next();){var h=g.value;if(h instanceof S)a||null!==h.fromNode&&null!==h.toNode||e.add(h);else if(h instanceof V&&null!==h.data&&c.Sm()){var k=h;h=g.key;var l=h.Rg();null!==l&&(l=
1836 d.J(l),null!==l?(c.ne(k.data,c.pa(l.data)),k=b.Ec(k.data),h=h.uj(),null!==h&&null!==k&&f.add(h,k)):c.ne(k.data,void 0))}}0<e.count&&b.tu(e,!1);if(0<f.count)for(c=f.iterator;c.next();)d.add(c.key,c.value)}if(null!==b&&null!==this.C&&(b=b.model,c=b.afterCopyFunction,null!==c)){var m=new Bb;d.each(function(a){null!==a.key.data&&m.add(a.key.data,a.value.data)});c(m,b,this.C.model)}for(b=d.iterator;b.next();)b.value.Ia();return d};
1837 function er(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.J(b);var f=a.copyPartData(b,c);if(!(f instanceof U))return null;f.isSelected=!1;f.isHighlighted=!1;d.add(b,f);if(b instanceof V){for(var g=b.linksConnected;g.next();){var h=g.value;if(h.fromNode===b){var k=d.J(h);null!==k&&(k.fromNode=f)}h.toNode===b&&(h=d.J(h),null!==h&&(h.toNode=f))}if(b instanceof If&&f instanceof If)for(b=b.memberParts;b.next();)g=er(a,b.value,c,d,e),g instanceof S||null===g||(g.containingGroup=
1838 f)}else if(b instanceof S&&f instanceof S)for(g=b.fromNode,null!==g&&(g=d.J(g),null!==g&&(f.fromNode=g)),g=b.toNode,null!==g&&(g=d.J(g),null!==g&&(f.toNode=g)),b=b.labelNodes;b.next();)g=er(a,b.value,c,d,e),null!==g&&g instanceof V&&(g.labeledLink=f);return f}
1839 Ii.prototype.copyPartData=function(a,b){var c=null,d=a.data;if(null!==d&&null!==b){var e=b.model;a instanceof S||(d=e.copyNodeData(d),Ga(d)&&(e.Gf(d),c=b.Fc(d)))}else yg(a),c=a.copy(),null!==c&&(e=this.C,null!==b?b.add(c):null!==d&&null!==e&&null!==e.commandHandler&&e.commandHandler.copiesClipboardData&&(b=e.model,e=null,c instanceof S||(e=b.copyNodeData(d)),Ga(e)&&(c.data=e)));return c};
1840 na.Object.defineProperties(Ii.prototype,{nodes:{configurable:!0,get:function(){return this.zp}},links:{configurable:!0,get:function(){return this.$o}},parts:{configurable:!0,get:function(){return this.Ja}},diagram:{configurable:!0,get:function(){return this.C}},addsToTemporaryLayer:{configurable:!0,get:function(){return this.Br},set:function(a){A(a,"boolean",Ii,"addsToTemporaryLayer");this.Br=a}}});
1841 Ii.prototype.updateAllRelationshipsFromData=Ii.prototype.xr;Ii.prototype.findLinksByExample=Ii.prototype.Ut;Ii.prototype.findNodesByExample=Ii.prototype.Vt;Ii.prototype.findLinkForData=Ii.prototype.Ec;Ii.prototype.findNodeForData=Ii.prototype.rj;Ii.prototype.findPartForData=Ii.prototype.Fc;Ii.prototype.findNodeForKey=Ii.prototype.Hb;Ii.prototype.removeModeledPart=Ii.prototype.nr;Ii.prototype.removeModeledParts=Ii.prototype.su;Ii.prototype.rebuildParts=Ii.prototype.Sd;var Zq=!1,Yq=!1,$q=!1;
1842 Ii.className="PartManager";function fr(a){Ii.apply(this,arguments)}ma(fr,Ii);fr.prototype.addAllModeledParts=function(){var a=this.diagram.model;this.addModeledParts(a.nodeDataArray);gr(this,a.linkDataArray)};fr.prototype.addModeledParts=function(a){Ii.prototype.addModeledParts.call(this,a,!1);for(a=this.links.iterator;a.next();)hp(a.value);uk(this.diagram,!1)};function gr(a,b){b.forEach(function(b){hr(a,b)});uk(a.diagram,!1)}
1843 function hr(a,b){if(void 0!==b&&null!==b&&!a.diagram.undoManager.isUndoingRedoing&&!a.ef.contains(b)){var c=a.getLinkCategoryForData(b),d=a.findLinkTemplateForCategory(c);if(null!==d){yg(d);var e=d.copy();if(null!==e){d=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0;e.Zf=c;e.tb=b;c=a.diagram.model;var f=ir(c,b,!0);""!==f&&(e.fromPortId=f);f=jr(c,b,!0);void 0!==f&&(f=a.Hb(f),f instanceof V&&(e.fromNode=f));f=ir(c,b,!1);""!==f&&(e.toPortId=f);f=jr(c,b,!1);void 0!==f&&(f=a.Hb(f),
1844 f instanceof V&&(e.toNode=f));c=c.Nf(b);Array.isArray(c)&&c.forEach(function(b){b=a.Hb(b);null!==b&&(b.labeledLink=e)});a.Br&&(e.uh="Tool");a.diagram.add(e);e.tb=null;e.data=b;a.diagram.skipsModelSourceBindings=d}}}}fr.prototype.removeAllModeledParts=function(){var a=this.diagram.model;kr(this,a.linkDataArray);this.su(a.nodeDataArray)};function kr(a,b){b.forEach(function(b){a.nr(b)})}fr.prototype.getLinkCategoryForData=function(a){return this.diagram.model.Yt(a)};
1845 fr.prototype.setLinkCategoryForData=function(a,b){return this.diagram.model.rr(a,b)};fr.prototype.setFromNodeForLink=function(a,b){var c=this.diagram.model;c.Pw(a.data,c.pa(null!==b?b.data:null))};fr.prototype.setToNodeForLink=function(a,b){var c=this.diagram.model;c.Uw(a.data,c.pa(null!==b?b.data:null))};fr.prototype.removeDataForLink=function(a){this.diagram.model.$m(a.data)};
1846 fr.prototype.findPartForKey=function(a){var b=Ii.prototype.findPartForKey.call(this,a);return null===b&&(a=this.diagram.model.Pg(a),null!==a)?this.ef.J(a):b};fr.prototype.findLinkForKey=function(a){if(null===a||void 0===a)return null;a=this.diagram.model.Pg(a);return null!==a?this.ef.J(a):null};
1847 fr.prototype.doModelChanged=function(a){var b=this;Ii.prototype.doModelChanged.call(this,a);if(this.diagram){var c=this.diagram;if(a.model===c.model){var d=a.change;if(c.ba){c.ba=!1;try{var e=a.modelChange;if(""!==e)if(d===Ce){if("linkFromKey"===e){var f=this.Ec(a.object);if(null!==f){var g=this.Hb(a.newValue);f.fromNode=g}}else if("linkToKey"===e){var h=this.Ec(a.object);if(null!==h){var k=this.Hb(a.newValue);h.toNode=k}}else if("linkFromPortId"===e){var l=this.Ec(a.object);if(null!==l){var m=a.newValue;
1848 "string"===typeof m&&(l.fromPortId=m)}}else if("linkToPortId"===e){var n=this.Ec(a.object);if(null!==n){var p=a.newValue;"string"===typeof p&&(n.toPortId=p)}}else if("nodeGroupKey"===e){var r=this.Fc(a.object);if(null!==r){var q=a.newValue;if(void 0!==q){var u=this.Hb(q);u instanceof If?r.containingGroup=u:r.containingGroup=null}else r.containingGroup=null}}else if("linkLabelKeys"===e){var y=this.Ec(a.object);if(null!==y){var x=a.oldValue,z=a.newValue;Array.isArray(x)&&x.forEach(function(a){0<=z.indexOf(a)||
1849 (a=b.Hb(a),null!==a&&(a.labeledLink=null))});Array.isArray(z)&&z.forEach(function(a){a=b.Hb(a);null!==a&&(a.labeledLink=y)})}}else if("linkCategory"===e){var B=this.Ec(a.object),D=a.newValue;null!==B&&"string"===typeof D&&(B.category=D)}else"linkDataArray"===e&&(kr(this,a.oldValue),gr(this,a.newValue));c.isModified=!0}else if(d===Le){var G=a.newValue;if("linkDataArray"===e&&"object"===typeof G&&null!==G)hr(this,G);else if("linkLabelKeys"===e&&lr(G)){var M=this.Ec(a.object),Y=this.Hb(G);null!==M&&
1850 null!==Y&&(Y.labeledLink=M)}c.isModified=!0}else{if(d===Me){var Q=a.oldValue;if("linkDataArray"===e&&"object"===typeof Q&&null!==Q)this.nr(Q);else if("linkLabelKeys"===e&&lr(Q)){var ca=this.Hb(Q);null!==ca&&(ca.labeledLink=null)}c.isModified=!0}}else if(d===Ce){var T=a.propertyName;a.object!==c.model||"linkFromKeyProperty"!==T&&"linkToKeyProperty"!==T&&"linkFromPortIdProperty"!==T&&"linkToPortIdProperty"!==T&&"linkLabelKeysProperty"!==T&&"nodeIsGroupProperty"!==T&&"nodeGroupKeyProperty"!==T&&"linkCategoryProperty"!==
1851 T||c.undoManager.isUndoingRedoing||this.Sd();c.isModified=!0}}finally{c.ba=!0}}}}};fr.prototype.refreshDataBoundLinks=function(){var a=this,b=this.diagram.model,c=new I,d=b.linkDataArray;d.forEach(function(a){c.add(a)});var e=[];this.links.each(function(a){null===a.data||c.contains(a.data)||e.push(a.data)});e.forEach(function(a){mr(b,a,!1)});d.forEach(function(c){null===a.Ec(c)&&nr(b,c,!1)})};
1852 fr.prototype.updateRelationshipsFromData=function(a){var b=a.data;if(null!==b){var c=a.diagram;if(null!==c){var d=c.model;if(a instanceof S){var e=jr(d,b,!0);e=c.Hb(e);a.fromNode=e;e=jr(d,b,!1);e=c.Hb(e);a.toNode=e;b=d.Nf(b);if(0<b.length||0<a.labelNodes.count){if(1===b.length&&1===a.labelNodes.count){e=b[0];var f=a.labelNodes.first();if(d.pa(f.data)===e)return}e=(new I).addAll(b);var g=new I;a.labelNodes.each(function(a){null!==a.data&&(a=d.pa(a.data),void 0!==a&&g.add(a))});b=g.copy();b.mr(e);e=
1853 e.copy();e.mr(g);if(0<b.count||0<e.count)b.each(function(b){b=c.Hb(b);null!==b&&b.labeledLink===a&&(b.labeledLink=null)}),e.each(function(b){b=c.Hb(b);null!==b&&b.labeledLink!==a&&(b.labeledLink=a)})}}else!(a instanceof Ve)&&(b=d.Wh(b),b=c.findPartForKey(b),null===b||b instanceof If)&&(a.containingGroup=b)}}};
1854 fr.prototype.resolveReferencesForData=function(a){var b=this.diagram.model,c=b.pa(a);if(void 0!==c){var d=or(b,c),e=this.Fc(a);if(null!==d&&null!==e){d=d.iterator;for(var f={};d.next();){var g=d.value;b.$a(g)?e instanceof If&&b.Wh(g)===c&&(g=this.Fc(g),null!==g&&(g.containingGroup=e)):(f.link=this.Ec(g),null!==f.link&&e instanceof V&&(jr(b,g,!0)===c&&(f.link.fromNode=e),jr(b,g,!1)===c&&(f.link.toNode=e),g=b.Nf(g),Array.isArray(g)&&g.some(function(a){return function(b){return b===c?(e.labeledLink=
1855 a.link,!0):!1}}(f))));f={link:f.link}}pr(b,c)}a=b.Wh(a);void 0!==a&&(a=this.Hb(a),a instanceof If&&(e.containingGroup=a))}};fr.prototype.unresolveReferencesForPart=function(a){var b=this.diagram.model;if(a instanceof V){var c=b.pa(a.data);if(void 0!==c){for(var d=a.linksConnected;d.next();)qr(b,c,d.value.data);a.isLinkLabel&&(d=a.labeledLink,null!==d&&qr(b,c,d.data));if(a instanceof If)for(a=a.memberParts;a.next();)d=a.value.data,b.$a(d)&&qr(b,c,d)}}};
1856 fr.prototype.copyPartData=function(a,b){var c=Ii.prototype.copyPartData.call(this,a,b);if(a instanceof S)if(a=a.data,null!==a&&null!==b){var d=b.model;a=d.Nq(a);"object"===typeof a&&null!==a&&(d.mj(a),c=b.Ec(a))}else null!==c&&(b=this.diagram,null!==a&&null!==b&&null!==b.commandHandler&&b.commandHandler.copiesClipboardData&&(b=b.model.Nq(a),"object"===typeof b&&null!==b&&(c.data=b)));return c};
1857 fr.prototype.insertLink=function(a,b,c,d){var e=this.diagram,f=e.model,g=e.toolManager.findTool("Linking"),h="";null!==a&&(null===b&&(b=a),h=b.portId,null===h&&(h=""));b="";null!==c&&(null===d&&(d=c),b=d.portId,null===b&&(b=""));d=g.archetypeLinkData;if(d instanceof S){if(yg(d),f=d.copy(),null!==f)return f.fromNode=a,f.fromPortId=h,f.toNode=c,f.toPortId=b,e.add(f),a=g.archetypeLabelNodeData,a instanceof V&&(yg(a),a=a.copy(),null!==a&&(a.labeledLink=f,e.add(a))),f}else if(null!==d&&(d=f.Nq(d),"object"===
1858 typeof d&&null!==d))return null!==a&&rr(f,d,f.pa(a.data),!0),sr(f,d,h,!0),null!==c&&rr(f,d,f.pa(c.data),!1),sr(f,d,b,!1),f.mj(d),a=g.archetypeLabelNodeData,null===a||a instanceof V||(a=f.copyNodeData(a),"object"===typeof a&&null!==a&&(f.Gf(a),a=f.pa(a),void 0!==a&&f.Qv(d,a))),e.Ec(d);return null};fr.prototype.findLinkForKey=fr.prototype.findLinkForKey;fr.prototype.findPartForKey=fr.prototype.findPartForKey;fr.prototype.removeAllModeledParts=fr.prototype.removeAllModeledParts;
1859 fr.prototype.addModeledParts=fr.prototype.addModeledParts;fr.prototype.addAllModeledParts=fr.prototype.addAllModeledParts;fr.className="GraphLinksPartManager";function tr(){Ii.apply(this,arguments);this.Ch=null}ma(tr,Ii);
1860 function ur(a,b,c){if(null!==b&&null!==c){var d=a.diagram.toolManager.findTool("Linking"),e=b,f=c;if(a.diagram.isTreePathToChildren)for(b=f.linksConnected;b.next();){if(b.value.toNode===f)return}else for(e=c,f=b,b=e.linksConnected;b.next();)if(b.value.fromNode===e)return;if(null===d||!ag(d,e,f,null,!0))if(d=a.getLinkCategoryForData(c.data),b=a.findLinkTemplateForCategory(d),null!==b&&(yg(b),b=b.copy(),null!==b)){var g=a.diagram.skipsModelSourceBindings;a.diagram.skipsModelSourceBindings=!0;b.Zf=d;
1861 b.tb=c.data;b.fromNode=e;b.toNode=f;a.diagram.add(b);b.tb=null;b.data=c.data;a.diagram.skipsModelSourceBindings=g}}}tr.prototype.getLinkCategoryForData=function(a){return this.diagram.model.au(a)};tr.prototype.setLinkCategoryForData=function(a,b){this.diagram.model.xu(a,b)};
1862 tr.prototype.setFromNodeForLink=function(a,b,c){var d=this.diagram.model;void 0===c&&(c=null);b=null!==b?b.data:null;if(this.diagram.isTreePathToChildren)d.ne(a.data,d.pa(b));else{var e=this.Ch;this.Ch=a;null!==c&&d.ne(c.data,void 0);d.ne(b,d.pa(null!==a.toNode?a.toNode.data:null));this.Ch=e}};
1863 tr.prototype.setToNodeForLink=function(a,b,c){var d=this.diagram.model;void 0===c&&(c=null);b=null!==b?b.data:null;if(this.diagram.isTreePathToChildren){var e=this.Ch;this.Ch=a;null!==c&&d.ne(c.data,void 0);d.ne(b,d.pa(null!==a.fromNode?a.fromNode.data:null));this.Ch=e}else d.ne(a.data,d.pa(b))};tr.prototype.removeDataForLink=function(a){this.diagram.model.ne(a.data,void 0)};
1864 tr.prototype.findLinkForKey=function(a){if(null===a||void 0===a)return null;a=this.diagram.model.Qb(a);return null!==a?this.ef.J(a):null};
1865 tr.prototype.doModelChanged=function(a){Ii.prototype.doModelChanged.call(this,a);if(this.diagram){var b=this.diagram;if(a.model===b.model){var c=a.change;if(b.ba){b.ba=!1;try{var d=a.modelChange;if(""!==d){if(c===Ce){if("nodeParentKey"===d){var e=a.object,f=this.Hb(a.newValue),g=this.rj(e);if(null!==this.Ch)null!==f&&(this.Ch.data=e,this.Ch.category=this.getLinkCategoryForData(e));else if(null!==g){var h=g.uj();null!==h?null===f?b.remove(h):b.isTreePathToChildren?h.fromNode=f:h.toNode=f:ur(this,f,
1866 g)}}else if("parentLinkCategory"===d){var k=this.rj(a.object),l=a.newValue;if(null!==k&&"string"===typeof l){var m=k.uj();null!==m&&(m.category=l)}}b.isModified=!0}}else if(c===Ce){var n=a.propertyName;a.object===b.model&&"nodeParentKeyProperty"===n&&(b.undoManager.isUndoingRedoing||this.Sd());b.isModified=!0}}finally{b.ba=!0}}}}};
1867 tr.prototype.updateRelationshipsFromData=function(a){var b=a.data;if(null!==b){var c=a.diagram;if(null!==c){var d=c.model;a instanceof V&&(b=d.Xh(b),b=c.Hb(b),d=a.Rg(),b!==d&&(d=a.uj(),null!==b?null!==d?c.isTreePathToChildren?d.fromNode=b:d.toNode=b:ur(this,b,a):null!==d&&bk(c,d,!1)))}}};tr.prototype.updateDataBindings=function(a,b){Ii.prototype.updateDataBindings.call(this,a,b);"string"===typeof b&&null!==this.Fc(a)&&(a=this.Ec(a),null!==a&&a.Ia(b))};
1868 tr.prototype.resolveReferencesForData=function(a){var b=this.diagram.model,c=b.pa(a);if(void 0!==c){var d=or(b,c),e=this.Fc(a);if(null!==d&&null!==e){for(d=d.iterator;d.next();){var f=d.value;b.$a(f)&&e instanceof V&&b.Xh(f)===c&&ur(this,e,this.rj(f))}pr(b,c)}a=b.Xh(a);void 0!==a&&e instanceof V&&(a=this.Hb(a),ur(this,a,e))}};
1869 tr.prototype.unresolveReferencesForPart=function(a){var b=this.diagram.model;if(a instanceof V){var c=b.pa(a.data),d=this.Ec(a.data);if(null!==d){d.isSelected=!1;d.isHighlighted=!1;var e=d.layer;if(null!==e){var f=e.Rc(-1,d,!1);0<=f&&this.diagram.ab(Me,"parts",e,d,null,f,null);f=d.layerChanged;null!==f&&f(d,e,null)}}d=this.diagram.isTreePathToChildren;for(a=a.linksConnected;a.next();)e=a.value,e=(d?e.toNode:e.fromNode).data,b.$a(e)&&qr(b,c,e)}};
1870 tr.prototype.insertLink=function(a,b,c){b=this.diagram.model;var d=a,e=c;this.diagram.isTreePathToChildren||(d=c,e=a);return null!==d&&null!==e?(b.ne(e.data,b.pa(d.data)),e.uj()):null};tr.prototype.findLinkForKey=tr.prototype.findLinkForKey;tr.className="TreePartManager";
1871 function X(a){this.Zi=new I;this.Wi=new I;this.Gu=',\n "insertedNodeKeys": ';this.Ax=',\n "modifiedNodeData": ';this.Iu=',\n "removedNodeKeys": ';this.ii=null;F&&1<arguments.length&&v("Model constructor can only take one optional argument, the Array of node data.");eb(this);this.Yn=this.va="";this.lg=!1;this.l={};this.xc=[];this.bb=new Bb;this.Yi="key";this.ul=this.bm=null;this.Pn=this.Qn=!1;this.Sn=!0;this.xn=null;this.jk="category";this.eg=new Bb;this.pv=new H;this.Hg=!1;this.w=null;this.undoManager=
1872 new Oe;void 0!==a&&(this.nodeDataArray=a)}X.prototype.cloneProtected=function(a){a.va=this.va;a.Yn=this.Yn;a.lg=this.lg;a.Yi=this.Yi;a.bm=this.bm;a.ul=this.ul;a.Qn=this.Qn;a.Pn=this.Pn;a.Sn=this.Sn;a.xn=this.xn;a.jk=this.jk};X.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};X.prototype.clear=function(){this.xc=[];this.bb.clear();this.eg.clear();this.undoManager.clear()};
1873 X.prototype.toString=function(a){void 0===a&&(a=0);if(1<a)return this.ur();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.nodeDataArray;for(var c=a.length,d=0;d<c;d++){var e=a[d];b+=" "+this.pa(e)+":"+Qa(e)}}return b};
1874 X.prototype.AB=function(a){w(a,Be,X,"toIncrementalData:e");a.change!==De&&v("Model.toIncrementalData argument is not a Transaction ChangedEvent:"+a.toString());var b=a.object;if(!(a.isTransactionFinished&&b instanceof Ne))return null;vr(this,b);a=this.ox(b,"FinishedUndo"===a.propertyName);this.ii=null;return a};
1875 X.prototype.ox=function(a,b){var c=this,d=!1,e=new I,f=new I,g=new I,h=this.ii;a.changes.each(function(a){a.model===c&&("nodeDataArray"===a.modelChange?a.change===Le?e.add(a.newValue):a.change===Me&&g.add(a.oldValue):c.$a(a.object)?f.add(a.object):a.change!==Ce||c.modelData!==a.object&&"modelData"!==a.propertyName?null!==a.object&&(h&&h.contains(a.object)?h.get(a.object).each(function(a){c.$a(a)&&f.add(a)}):a.object instanceof X||c.Cj()&&c.Dc(a.object)||wr(c,a.object).each(function(a){f.add(a)})):
1876 d=!0)});var k=this.Wi;k.clear();e.each(function(a){k.add(c.pa(a));b||f.add(a)});var l=this.Zi;l.clear();g.each(function(a){l.add(c.pa(a));b&&f.add(a)});a=c.cloneDeep(f.ta());var m=null;d&&(null===m&&(m={}),m.modelData=this.cloneDeep(this.modelData));0<k.count&&(null===m&&(m={}),b?m.removedNodeKeys=k.ta():m.insertedNodeKeys=k.ta());0<a.length&&(null===m&&(m={}),m.modifiedNodeData=a);0<l.count&&(null===m&&(m={}),b?m.insertedNodeKeys=l.ta():m.removedNodeKeys=l.ta());l.clear();k.clear();return m};
1877 X.prototype.cloneDeep=function(a){return xr(this,a,!0)};
1878 function xr(a,b,c,d,e,f){function g(a,c){h?(void 0===a.__gohashid&&f.push(a),d.set(a,c)):(a=wb++,d.set(a,c),e.set(a,b))}if(!Ga(b))return b;f||(f=[]);var h=Object.isExtensible(b);d||(d=new Bb);if(h){var k=d.get(b);if(k)return k}else for(e||(e=new Bb),k=e.iterator;k.next();){var l=k.key;if(k.value===b&&(l=d.get(l)))return l}if(Array.isArray(b)){k=[];g(b,k);for(var m=0;m<b.length;m++)k.push(xr(a,b[m],!1,d,e,f))}else if(b instanceof J||b instanceof Fb||b instanceof L||b instanceof hc||b instanceof N)k=
1879 b.copy(),g(b,k);else{if(b instanceof Ol||b instanceof zd||b instanceof E)return b;if(b instanceof H)k=(new H).addAll(xr(a,b.ta(),!1,d,e,f)),g(b,k);else if(b instanceof I)k=(new I).addAll(xr(a,b.ta(),!1,d,e,f)),g(b,k);else if(b instanceof Bb)k=(new Bb).addAll(xr(a,b.ta(),!1,d,e,f)),g(b,k);else if(b instanceof Date)k=new Date(b.getTime()),g(b,k);else if(b instanceof RegExp)k=new RegExp(b),g(b,k),k.lastIndex=b.lastIndex;else if("function"===typeof b.copy)k=b.copy(),g(b,k);else for(m in k={},g(b,k),b)"__gohashid"!==
1880 m&&(k[m]=xr(a,b[m],!1,d,e,f))}c&&f.forEach(function(a){delete a.__gohashid});return k}t=X.prototype;
1881 t.gl=function(){var a="";""!==this.name&&(a+=',\n "name": '+this.quote(this.name));""!==this.dataFormat&&(a+=',\n "dataFormat": '+this.quote(this.dataFormat));this.isReadOnly&&(a+=',\n "isReadOnly": '+this.isReadOnly);"key"!==this.nodeKeyProperty&&"string"===typeof this.nodeKeyProperty&&(a+=',\n "nodeKeyProperty": '+this.quote(this.nodeKeyProperty));this.copiesArrays&&(a+=',\n "copiesArrays": true');this.copiesArrayObjects&&(a+=',\n "copiesArrayObjects": true');this.copiesKey||(a+=',\n "copiesKey": false');
1882 "category"!==this.nodeCategoryProperty&&"string"===typeof this.nodeCategoryProperty&&(a+=',\n "nodeCategoryProperty": '+this.quote(this.nodeCategoryProperty));return a};
1883 t.kr=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.dataFormat=a.dataFormat);a.isReadOnly&&(this.isReadOnly=!0);a.nodeKeyProperty&&(this.nodeKeyProperty=a.nodeKeyProperty);a.copiesArrays&&(this.copiesArrays=!0);a.copiesArrayObjects&&(this.copiesArrayObjects=!0);!1===a.copiesKey&&(this.copiesKey=!1);a.nodeCategoryProperty&&(this.nodeCategoryProperty=a.nodeCategoryProperty)};function yr(a){return',\n "modelData": '+zr(a,a.modelData)}
1884 function Ar(a,b){b=b.modelData;Ga(b)&&(a.bn(b),a.modelData=b)}t.px=function(){var a=this.modelData,b=!1,c;for(c in a)if(!Br(c,a[c])){b=!0;break}a="";b&&(a=yr(this));return a+',\n "nodeDataArray": '+Cr(this,this.nodeDataArray,!0)};t.Fw=function(a){Ar(this,a);a=a.nodeDataArray;Ha(a)&&(this.bn(a),this.nodeDataArray=a)};
1885 function Dr(a,b,c,d){if(b===c)return!0;if(typeof b!==typeof c||"function"===typeof b||"function"===typeof c)return!1;if(Array.isArray(b)&&Array.isArray(c)){if(d.J(b)===c)return!0;d.add(b,c);if(b.length!==c.length)return!1;for(var e=0;e<b.length;e++)if(!Dr(a,b[e],c[e],d))return!1;return!0}if(Ga(b)&&Ga(c)){if(d.J(b)===c)return!0;d.add(b,c);for(var f in b){var g=b[f];if(!Br(f,g)){var h=c[f];if(void 0===h||!Dr(a,g,h,d))return!1}}for(e in c)if(f=c[e],!Br(e,f)&&(g=b[e],void 0===g||!Dr(a,g,f,d)))return!1;
1886 return!0}return!1}function Er(a,b,c){a[c]!==b[c]&&v("Model.computeJsonDifference: Model."+c+' is not the same in both models: "'+a[c]+'" and "'+b[c]+'"')}
1887 t.zr=function(a){Er(this,a,"nodeKeyProperty");var b=this.Wi;b.clear();var c=new I,d=this.Zi;d.clear();d.addAll(this.bb.iteratorKeys);for(var e=new Bb,f=a.nodeDataArray,g=f.length,h=0;h<g;h++){var k=f[h],l=a.pa(k);if(void 0!==l){d.remove(l);var m=this.Qb(l);null===m?(b.add(l),c.add(k)):Dr(this,m,k,e)||c.add(k)}else this.lu(k),l=this.pa(k),b.add(l),c.add(k)}f="";Dr(this,this.modelData,a.modelData,e)||(f+=yr(this));0<b.count&&(f+=this.Gu+Cr(this,b.ta(),!0));0<c.count&&(f+=this.Ax+Cr(this,c.ta(),!0));
1888 0<d.count&&(f+=this.Iu+Cr(this,d.ta(),!0));d.clear();b.clear();return f};t.Uz=function(a,b){w(a,X,X,"computeJsonDifference:newmodel");void 0===b&&(b=Fr(this,this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.gl()+this.zr(a)+"}"};
1889 function vr(a,b){function c(a,b){if(b=b.part)if(b=b.data,a!==b){var c=d.get(a);null===c?(c=new I,c.add(b),d.add(a,c)):c.add(b)}}var d=a.ii;null===d&&(d=new Bb,b.changes.each(function(a){if(null!==a.diagram){var b=a.change;if(b===Ce)(a=a.object.panel)&&(b=a.data)&&c(b,a);else if(b===Le||b===Me)a=a.object,(b=a.itemArray)&&c(b,a)}}),a.ii=d)}function wr(a,b){for(var c=new I,d=0;d<a.nodeDataArray.length;d++){var e=a.nodeDataArray[d];Gr(a,b,e,e,c)}return c}
1890 function Gr(a,b,c,d,e){if(Array.isArray(c))for(var f=0;f<c.length;f++){var g=c[f];if(g===b)return e.add(d),!0;if(Gr(a,b,g,d,e))return!0}else if(Ga(c)&&Object.getPrototypeOf(c)===Object.prototype)for(f in c){g=c[f];if(g===b)return e.add(d),!0;if(Gr(a,b,g,d,e))return!0}return!1}
1891 t.nx=function(a,b){var c=this,d=!1,e=new I,f=new I,g=new I,h=this.ii;a.changes.each(function(a){a.model===c&&("nodeDataArray"===a.modelChange?a.change===Le?e.add(a.newValue):a.change===Me&&g.add(a.oldValue):c.$a(a.object)?f.add(a.object):a.change!==Ce||c.modelData!==a.object&&"modelData"!==a.propertyName?null!==a.object&&(h&&h.contains(a.object)?h.get(a.object).each(function(a){c.$a(a)&&f.add(a)}):a.object instanceof X||c.Cj()&&c.Dc(a.object)||wr(c,a.object).each(function(a){f.add(a)})):d=!0)});var k=
1892 this.Wi;k.clear();e.each(function(a){k.add(c.pa(a));b||f.add(a)});var l=this.Zi;l.clear();g.each(function(a){l.add(c.pa(a));b&&f.add(a)});a="";d&&(a+=yr(this));0<k.count&&(a+=(b?this.Iu:this.Gu)+Cr(this,k.ta(),!0));0<f.count&&(a+=this.Ax+Cr(this,f.ta(),!0));0<l.count&&(a+=(b?this.Gu:this.Iu)+Cr(this,l.ta(),!0));l.clear();k.clear();return a};
1893 t.jr=function(a){(void 0!==a.name&&a.name!==this.name||void 0!==a.dataFormat&&a.dataFormat!==this.dataFormat||void 0!==a.isReadOnly&&a.isReadOnly!==this.isReadOnly||void 0!==a.nodeKeyProperty&&a.nodeKeyProperty!==this.nodeKeyProperty||void 0!==a.copiesArrays&&a.copiesArrays!==this.copiesArrays||void 0!==a.copiesArrayObjects&&a.copiesArrayObjects!==this.copiesArrayObjects||void 0!==a.copiesKey&&a.copiesKey!==this.copiesKey||void 0!==a.nodeCategoryProperty&&a.nodeCategoryProperty!==this.nodeCategoryProperty)&&
1894 v("applyIncrementalJson cannot change Model properties");Ar(this,a);var b=a.insertedNodeKeys,c=a.modifiedNodeData,d=new Bb;if(Array.isArray(c))for(var e=0;e<c.length;e++){var f=c[e],g=this.pa(f);void 0!==g&&null!==g&&d.set(g,f)}if(Array.isArray(b))for(e=b.length,f=0;f<e;f++){g=b[f];var h=this.Qb(g);null===h&&(h=(h=d.get(g))?h:this.copyNodeData({}),this.jn(h,g),this.Gf(h))}if(Array.isArray(c))for(b=c.length,d=0;d<b;d++)if(e=c[d],f=this.pa(e),f=this.Qb(f),null!==f){for(var k in e)"__gohashid"===k||
1895 k===this.nodeKeyProperty||this.Ok()&&k===this.nodeIsGroupProperty||this.setDataProperty(f,k,e[k]);this.kn(e,f)}a=a.removedNodeKeys;if(Array.isArray(a))for(c=a.length,k=0;k<c;k++)b=this.Qb(a[k]),null!==b&&this.an(b)};
1896 t.nz=function(a,b){w(a,Be,X,"toIncrementalJson:e");a.change!==De&&v("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.isTransactionFinished&&c instanceof Ne))return'{ "incremental": 0 }';void 0===b&&(b=Fr(this,this));vr(this,c);a=this.nx(c,"FinishedUndo"===a.propertyName);this.ii=null;return"2"===b?'{ "incremental": 2'+a+"}":'{ "class": '+this.quote(b)+', "incremental": 1'+this.gl()+a+"}"};t.BB=function(a,b){return this.nz(a,b)};
1897 t.ur=function(a){void 0===a&&(a=Fr(this,this));return'{ "class": '+this.quote(a)+this.gl()+this.px()+"}"};t.toJSON=function(a){return this.ur(a)};t.ny=function(a){var b=null;if("string"===typeof a)try{b=qa.JSON.parse(a)}catch(d){F&&Ea("JSON.parse error: "+d.toString())}else"object"===typeof a?b=a:v("Unable to modify a Model from: "+a);var c=b.incremental;"number"!==typeof c&&v("Unable to apply non-incremental changes to Model: "+a);0!==c&&(this.Ca("applyIncrementalJson"),this.jr(b),this.cb("applyIncrementalJson"))};
1898 t.Lz=function(a){return this.ny(a)};X.constructGraphLinksModel=function(){F&&v("Unable to construct a Model. Provided JSON requires GraphLinksModel, which is not loaded.");return new X};t=X.prototype;
1899 t.bn=function(a){if(Ha(a))for(var b=a.length,c=0;c<b;c++){var d=a[c];if(Ga(d)){var e=c;d=this.bn(d);Array.isArray(a)?a[e]=d:v("Cannot replace an object in an HTMLCollection or NodeList at "+e)}}else if(Ga(a)){for(b in a)if(c=a[b],Ga(c)&&(c=this.bn(c),a[b]=c,"points"===b&&Array.isArray(c))){e=0===c.length%2;for(d=0;d<c.length;d++)if("number"!==typeof c[d]){e=!1;break}if(e){e=new H;for(d=0;d<c.length/2;d++)e.add(new J(c[2*d],c[2*d+1]));e.freeze();a[b]=e}}return Hr(a)}return a};
1900 t.quote=function(a){for(var b="",c=a.length,d=0;d<c;d++){var e=a[d];if('"'===e||"\\"===e)b+="\\"+e;else if("\b"===e)b+="\\b";else if("\f"===e)b+="\\f";else if("\n"===e)b+="\\n";else if("\r"===e)b+="\\r";else if("\t"===e)b+="\\t";else{var f=a.charCodeAt(d);b=16>f?b+("\\u000"+a.charCodeAt(d).toString(16)):32>f?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===f?b+"\\u2028":8233===f?b+"\\u2029":b+e}}return'"'+b+'"'};
1901 t.pn=function(a){return void 0===a?"undefined":null===a?"null":!0===a?"true":!1===a?"false":"string"===typeof a?this.quote(a):"number"===typeof a?Infinity===a?"9e9999":-Infinity===a?"-9e9999":isNaN(a)?'{"class":"NaN"}':a.toString():a instanceof Date?'{"class":"Date", "value":"'+a.toJSON()+'"}':a instanceof Number?this.pn(a.valueOf()):Ha(a)?Cr(this,a):Ga(a)?zr(this,a):"function"===typeof a?"null":a.toString()};
1902 function Cr(a,b,c){void 0===c&&(c=!1);var d=b.length;if(0>=d)return"[]";var e=new hb;e.add("[");c&&1<d&&e.add("\n");for(var f=0;f<d;f++){var g=b[f];void 0!==g&&(0<f&&(e.add(","),c&&e.add("\n")),e.add(a.pn(g)))}c&&1<d&&e.add("\n");e.add("]");return e.toString()}function Br(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function Ir(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
1903 function zr(a,b){var c=b;if(c instanceof J)b={"class":"go.Point",x:Ir(c.x),y:Ir(c.y)};else if(c instanceof Fb)b={"class":"go.Size",width:Ir(c.width),height:Ir(c.height)};else if(c instanceof L)b={"class":"go.Rect",x:Ir(c.x),y:Ir(c.y),width:Ir(c.width),height:Ir(c.height)};else if(c instanceof hc)b={"class":"go.Margin",top:Ir(c.top),right:Ir(c.right),bottom:Ir(c.bottom),left:Ir(c.left)};else if(c instanceof N)c.eb()?b={"class":"go.Spot",x:Ir(c.x),y:Ir(c.y),offsetX:Ir(c.offsetX),offsetY:Ir(c.offsetY)}:
1904 b={"class":"go.Spot","enum":c.toString()};else if(c instanceof Ol){b={"class":"go.Brush",type:c.type.name};if(c.type===Rl)b.color=c.color;else if(c.type===Ul||c.type===Pl)b.start=c.start,b.end=c.end,c.type===Pl&&(0!==c.startRadius&&(b.startRadius=Ir(c.startRadius)),isNaN(c.endRadius)||(b.endRadius=Ir(c.endRadius)));if(null!==c.colorStops){var d={};for(c=c.colorStops.iterator;c.next();)d[c.key]=c.value;b.colorStops=d}}else if(c instanceof zd)b={"class":"go.Geometry",type:c.type.name},0!==c.startX&&
1905 (b.startX=Ir(c.startX)),0!==c.startY&&(b.startY=Ir(c.startY)),0!==c.endX&&(b.endX=Ir(c.endX)),0!==c.endY&&(b.endY=Ir(c.endY)),c.spot1.A(Ec)||(b.spot1=c.spot1),c.spot2.A(Oc)||(b.spot2=c.spot2),c.type===Ad&&(b.path=Jd(c));else if(c instanceof E)b={"class":"go.EnumValue",classType:Fr(a,c.classType),name:c.name};else if(F&&null!==Kr(Fr(a,c)))return Ea("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager or other unknown data into JSON text: "+c.toString()),"{}";
1906 d="{";c=!0;for(var e in b){var f=Mn(b,e);if(!Br(e,f))if(c?c=!1:d+=",",d+=JSON.stringify(e)+":","points"===e&&f instanceof H){var g="[";for(f=f.iterator;f.next();){var h=f.value;1<g.length&&(g+=",");g+=a.pn(h.x);g+=",";g+=a.pn(h.y)}g+="]";d+=g}else d+=a.pn(f)}return d+"}"}function Lr(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}
1907 function Hr(a){if("object"!==typeof a)return a;var b=a["class"]||"";if("NaN"===b)return NaN;if("Date"===b)return new Date(a.value);if(0!==b.indexOf("go."))return a;b=b.substr(3);var c=a;if("Point"===b)c=new J(Lr(a.x),Lr(a.y));else if("Size"===b)c=new Fb(Lr(a.width),Lr(a.height));else if("Rect"===b)c=new L(Lr(a.x),Lr(a.y),Lr(a.width),Lr(a.height));else if("Margin"===b)c=new hc(Lr(a.top),Lr(a.right),Lr(a.bottom),Lr(a.left));else if("Spot"===b)"string"===typeof a["enum"]?c=vd(a["enum"]):c=new N(Lr(a.x),
1908 Lr(a.y),Lr(a.offsetX),Lr(a.offsetY));else if("Brush"===b){if(c=new Ol,c.type=fb(Ol,a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof N&&(c.start=a.start),a.end instanceof N&&(c.end=a.end),"number"===typeof a.startRadius&&(c.startRadius=Lr(a.startRadius)),"number"===typeof a.endRadius&&(c.endRadius=Lr(a.endRadius)),a=a.colorStops,Ga(a))for(var d in a)c.addColorStop(parseFloat(d),a[d])}else"Geometry"===b?(c=null,"string"===typeof a.path?c=Md(a.path):c=new zd,c.type=fb(zd,a.type),
1909 "number"===typeof a.startX&&(c.startX=Lr(a.startX)),"number"===typeof a.startY&&(c.startY=Lr(a.startY)),"number"===typeof a.endX&&(c.endX=Lr(a.endX)),"number"===typeof a.endY&&(c.endY=Lr(a.endY)),a.spot1 instanceof N&&(c.spot1=a.spot1),a.spot2 instanceof N&&(c.spot2=a.spot2)):"EnumValue"===b&&(d=a.classType,0===d.indexOf("go.")&&(d=d.substr(3)),d=Kr(d),"function"===typeof d&&(c=fb(d,a.name)));return c}t.Sh=function(a){A(a,"function",X,"addChangedListener:listener");this.pv.add(a)};
1910 t.dl=function(a){A(a,"function",X,"removeChangedListener:listener");this.pv.remove(a)};t.Mt=function(a){this.skipsUndoManager||this.undoManager.pw(a);for(var b=this.pv,c=b.length,d=0;d<c;d++)b.M(d)(a)};t.ab=function(a,b,c,d,e,f,g){Mr(this,"",a,b,c,d,e,f,g)};t.g=function(a,b,c,d,e){Mr(this,"",Ce,a,this,b,c,d,e)};t.qu=function(a,b,c,d,e,f){Mr(this,"",Ce,b,a,c,d,e,f)};
1911 function Mr(a,b,c,d,e,f,g,h,k){void 0===h&&(h=null);void 0===k&&(k=null);var l=new Be;l.model=a;l.change=c;l.modelChange=b;l.propertyName=d;l.object=e;l.oldValue=f;l.oldParam=h;l.newValue=g;l.newParam=k;a.Mt(l)}
1912 X.prototype.changeState=function(a,b){if(null!==a&&a.model===this)if(a.change===Ce){var c=a.object,d=a.propertyName,e=a.J(b);d===this.nodeKeyProperty&&this.$a(c)&&(b=a.J(!b),void 0!==b&&this.bb.remove(b),void 0!==e&&this.bb.add(e,c));ik(c,d,e)}else a.change===Le?(c=a.newParam,"nodeDataArray"===a.modelChange?(a=a.newValue,Ga(a)&&"number"===typeof c&&(d=this.pa(a),b?(this.xc[c]===a&&La(this.xc,c),void 0!==d&&this.bb.remove(d)):(this.xc[c]!==a&&Ka(this.xc,c,a),void 0!==d&&this.bb.add(d,a)))):""===a.modelChange?
1913 ((d=a.object)&&!Ha(d)&&a.propertyName&&(d=Mn(a.object,a.propertyName)),Ha(d)&&"number"===typeof c&&(a=a.newValue,b?La(d,c):Ka(d,c,a))):v("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.change===Me?(c=a.oldParam,"nodeDataArray"===a.modelChange?(a=a.oldValue,Ga(a)&&"number"===typeof c&&(d=this.pa(a),b?(this.xc[c]!==a&&Ka(this.xc,c,a),void 0!==d&&this.bb.add(d,a)):(this.xc[c]===a&&La(this.xc,c),void 0!==d&&this.bb.remove(d)))):""===a.modelChange?((d=a.object)&&!Ha(d)&&a.propertyName&&(d=
1914 Mn(a.object,a.propertyName)),Ha(d)&&"number"===typeof c&&(a=a.oldValue,b?Ka(d,c,a):La(d,c))):v("unknown ChangedEvent.Remove modelChange: "+a.toString())):a.change!==De&&v("unknown ChangedEvent: "+a.toString())};X.prototype.Ca=function(a){return this.undoManager.Ca(a)};X.prototype.cb=function(a){return this.undoManager.cb(a)};X.prototype.Uf=function(){return this.undoManager.Uf()};
1915 X.prototype.commit=function(a,b){void 0===b&&(b="");var c=this.skipsUndoManager;null===b&&(this.skipsUndoManager=!0,b="");this.undoManager.Ca(b);var d=!1;try{a(this),d=!0}finally{d?this.undoManager.cb(b):this.undoManager.Uf(),this.skipsUndoManager=c}};t=X.prototype;t.Ia=function(a,b){void 0===b&&(b="");Mr(this,"SourceChanged",De,b,a,null,null)};function Nr(a,b,c){"string"!==typeof a&&"function"!==typeof a&&ya(a,"string or function",b,c)}
1916 t.pa=function(a){if(null!==a){var b=this.Yi;if(""!==b&&(b=Mn(a,b),void 0!==b)){if(lr(b))return b;v("Key value for node data "+a+" is not a number or a string: "+b)}}};
1917 t.jn=function(a,b){void 0!==b&&null!==b&&lr(b)||ya(b,"number or string",X,"setKeyForNodeData:key");if(null!==a){var c=this.Yi;if(""!==c)if(this.$a(a)){var d=Mn(a,c);d!==b&&null===this.Qb(b)&&(ik(a,c,b),void 0!==d&&this.bb.remove(d),this.bb.add(b,a),Mr(this,"nodeKey",Ce,c,a,d,b),"string"===typeof c&&this.Ia(a,c),this.pr(d,b))}else ik(a,c,b)}};function lr(a){return"number"===typeof a||"string"===typeof a}t.$a=function(a){var b=this.pa(a);return void 0===b?!1:this.bb.J(b)===a};
1918 t.Qb=function(a){null===a&&v("Model.findNodeDataForKey:key must not be null");return void 0!==a&&lr(a)?this.bb.J(a):null};
1919 t.lu=function(a){if(null!==a){var b=this.Yi;if(""!==b){var c=this.pa(a);if(void 0===c||this.bb.contains(c)){var d=this.bm;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.bb.contains(c))){ik(a,b,c);return}if("string"===typeof c){for(d=2;this.bb.contains(c+d);)d++;ik(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.bb.count-1;this.bb.contains(c);)c--;ik(a,b,c)}else F&&v("Model.getKeyForNodeData returned something other than a string or a number: "+c)}}}};
1920 t.Gf=function(a){null!==a&&(rb(a),this.$a(a)||dr(this,a,!0))};function dr(a,b,c){var d=a.pa(b);if(void 0===d||a.bb.J(d)!==b)a.lu(b),d=a.pa(b),void 0===d?v("Model.makeNodeDataKeyUnique failed on "+b+". Data not added to Model."):(a.bb.add(d,b),d=null,c&&(d=a.xc.length,Ka(a.xc,d,b)),Mr(a,"nodeDataArray",Le,"nodeDataArray",a,null,b,null,d),a.dn(b),a.cn(b))}t.Hz=function(a){if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.Gf(a[c]);else for(a=a.iterator;a.next();)this.Gf(a.value)};
1921 t.an=function(a){null!==a&&cr(this,a,!0)};function cr(a,b,c){var d=a.pa(b);void 0!==d&&a.bb.remove(d);d=null;if(c){a:if(c=a.xc,Array.isArray(c))d=c.indexOf(b);else{d=c.length;for(var e=0;e<d;e++)if(c[e]===b){d=e;break a}d=-1}if(0>d)return;La(a.xc,d)}Mr(a,"nodeDataArray",Me,"nodeDataArray",a,b,null,d,null);a.wr(b)}t.pB=function(a){if(Ha(a))for(var b=a.length,c=0;c<b;c++)this.an(a[c]);else for(a=a.iterator;a.next();)this.an(a.value)};
1922 t.dB=function(a){if(a!==this.nodeDataArray&&Ha(a)){var b=this.Zi;b.clear();b.addAll(this.bb.iteratorKeys);var c=this.Wi;c.clear();for(var d=a.length,e=0;e<d;e++){var f=a[e],g=this.pa(f);if(void 0!==g){c.add(g);var h=this.Qb(g);h!==f&&(null!==h?(this.Iq(h,f),this.kn(f,h)):(f=this.cloneDeep(f),this.jn(f,g),this.Gf(f)))}else g=this.cloneDeep(f),this.Gf(g),c.add(this.pa(g))}for(a=b.iterator;a.next();)d=a.value,c.contains(d)||(d=this.Qb(d))&&this.an(d);b.clear();c.clear()}};
1923 t.pr=function(a,b){void 0!==b&&(a=or(this,a),a instanceof I&&this.eg.add(b,a))};t.ix=function(){};t.dn=function(){};t.cn=function(){};t.wr=function(){};function qr(a,b,c){if(void 0!==b){var d=a.eg.J(b);null===d&&(d=new I,a.eg.add(b,d));d.add(c)}}function pr(a,b,c){if(void 0!==b){var d=a.eg.J(b);d instanceof I&&(void 0===c||null===c?a.eg.remove(b):(d.remove(c),0===d.count&&a.eg.remove(b)))}}function or(a,b){if(void 0===b)return null;a=a.eg.J(b);return a instanceof I?a:null}
1924 t.Tz=function(a){void 0===a?this.eg.clear():this.eg.remove(a)};X.prototype.copyNodeData=function(a){if(null===a)return null;var b=this.ul;a=null!==b?b(a,this):Or(this,a,!0);Ga(a)&&eb(a);return a};
1925 function Or(a,b,c){if(a.copiesArrays&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=Or(a,b[c],a.copiesArrayObjects);d.push(e)}eb(d);return d}if(c&&Ga(b)){c=(c=b.constructor)?new c:{};e=a.copiesKey||"string"!==typeof a.nodeKeyProperty?null:a.nodeKeyProperty;for(d in b)if("__gohashid"===d)c.__gohashid=void 0;else if(d===e)c[e]=void 0;else{var f=Mn(b,d);var g=Fr(a,f);"GraphObject"===g||"Diagram"===g||"Layer"===g||"RowColumnDefinition"===g||"AnimationManager"===g||"Tool"===g||"CommandHandler"===
1926 g||"Layout"===g||"InputEvent"===g||"DiagramEvent"===g?(F&&"_"!==d[0]&&Ea('Warning: found GraphObject or Diagram reference when copying model data on property "'+d+'" of data object: '+b.toString()+" \nModel data should not have any references to a Diagram or any part of a diagram, such as: "+f.toString()),g=!0):g=f instanceof X||f instanceof Oe||f instanceof Ne||f instanceof Be?!0:!1;g?ik(c,d,f):(f=Or(a,f,!1),ik(c,d,f))}eb(c);return c}return b instanceof J?b.copy():b instanceof Fb?b.copy():b instanceof
1927 L?b.copy():b instanceof N?b.copy():b instanceof hc?b.copy():b}
1928 X.prototype.setDataProperty=function(a,b,c){F&&(A(a,"object",X,"setDataProperty:data"),A(b,"string",X,"setDataProperty:propname"),""===b&&v("Model.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.$a(a)){if(b===this.nodeKeyProperty){this.jn(a,c);return}if(b===this.nodeCategoryProperty){this.hn(a,c);return}}else!Pr&&a instanceof O&&(Pr=!0,Ea('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),Ea(" Is that really your intent?"));var d=
1929 Mn(a,b);d!==c&&(ik(a,b,c),this.qu(a,b,d,c))};t=X.prototype;t.set=function(a,b,c){this.setDataProperty(a,b,c)};t.Iq=function(a,b){if(b){var c=this.$a(a),d;for(d in b)"__gohashid"===d||c&&d===this.nodeKeyProperty||this.setDataProperty(a,d,b[d])}};t.Dz=function(a,b){this.bu(a,-1,b)};
1930 t.bu=function(a,b,c){F&&(Ia(a,X,"insertArrayItem:arr"),C(b,X,"insertArrayItem:idx"),a===this.xc&&v("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray"));0>b&&(b=a.length);Ka(a,b,c);Mr(this,"",Le,"",a,null,c,null,b)};
1931 t.Hw=function(a,b){void 0===b&&(b=-1);F&&(Ia(a,X,"removeArrayItem:arr"),C(b,X,"removeArrayItem:idx"));a===this.xc&&v("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=a.length-1);var c=a[b];La(a,b);Mr(this,"",Me,"",a,c,null,b,null)};t.Vq=function(a){if(null===a)return"";var b=this.jk;if(""===b)return"";b=Mn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
1932 t.hn=function(a,b){A(b,"string",X,"setCategoryForNodeData:cat");if(null!==a){var c=this.jk;if(""!==c)if(this.$a(a)){var d=Mn(a,c);void 0===d&&(d="");d!==b&&(ik(a,c,b),Mr(this,"nodeCategory",Ce,c,a,d,b))}else ik(a,c,b)}};t.kn=function(a,b){this.hn(b,this.Vq(a))};t.Sm=function(){return!1};t.Ok=function(){return!1};t.Cj=function(){return!1};t.hu=function(){return!1};t.Aj=function(){return!1};function Li(){return new X}
1933 function Fr(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 Fr(a,b.constructor);return typeof b}function Kr(a){return Qr[a]?Qr[a]:void 0!==qa.go&&qa.go[a]?qa.go[a]:null}function Mn(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){F&&Ea("property get error: "+d.toString())}return c}
1934 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){F&&Ea("property set error: "+d.toString())}}
1935 na.Object.defineProperties(X.prototype,{name:{configurable:!0,get:function(){return this.va},set:function(a){var b=this.va;b!==a&&(A(a,"string",X,"name"),this.va=a,this.g("name",b,a))}},dataFormat:{configurable:!0,get:function(){return this.Yn},set:function(a){var b=this.Yn;b!==a&&(A(a,"string",X,"dataFormat"),this.Yn=a,this.g("dataFormat",b,a))}},isReadOnly:{configurable:!0,get:function(){return this.lg},set:function(a){var b=this.lg;b!==a&&(A(a,"boolean",
1936 X,"isReadOnly"),this.lg=a,this.g("isReadOnly",b,a))}},modelData:{configurable:!0,get:function(){return this.l},set:function(a){var b=this.l;b!==a&&(A(a,"object",X,"modelData"),this.l=a,this.g("modelData",b,a),this.Ia(a))}},undoManager:{configurable:!0,get:function(){return this.w},set:function(a){var b=this.w;b!==a&&(w(a,Oe,X,"undoManager"),null!==b&&b.ez(this),this.w=a,null!==a&&a.ly(this))}},skipsUndoManager:{configurable:!0,get:function(){return this.Hg},
1937 set:function(a){A(a,"boolean",X,"skipsUndoManager");this.Hg=a}},nodeKeyProperty:{configurable:!0,get:function(){return this.Yi},set:function(a){var b=this.Yi;b!==a&&(Nr(a,X,"nodeKeyProperty"),""===a&&v("Model.nodeKeyProperty may not be the empty string"),0<this.bb.count&&v("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Yi=a,this.g("nodeKeyProperty",b,a))}},makeUniqueKeyFunction:{configurable:!0,get:function(){return this.bm},set:function(a){var b=
1938 this.bm;b!==a&&(null!==a&&A(a,"function",X,"makeUniqueKeyFunction"),this.bm=a,this.g("makeUniqueKeyFunction",b,a))}},nodeDataArray:{configurable:!0,get:function(){return this.xc},set:function(a){var b=this.xc;if(b!==a){Ia(a,X,"nodeDataArray");this.bb.clear();this.ix();for(var c=a.length,d=0;d<c;d++){var e=a[d];if(!Ga(e)){v("Model.nodeDataArray must only contain Objects, not: "+e);return}rb(e)}this.xc=a;d=new H;for(e=0;e<c;e++){var f=a[e],g=this.pa(f);void 0===g?d.add(f):null!==this.bb.J(g)?
1939 d.add(f):this.bb.add(g,f)}for(d=d.iterator;d.next();)e=d.value,this.lu(e),f=this.pa(e),void 0!==f&&this.bb.add(f,e);Mr(this,"nodeDataArray",Ce,"nodeDataArray",this,b,a);for(b=0;b<c;b++)d=a[b],this.dn(d),this.cn(d);Array.isArray(a)||(this.isReadOnly=!0)}}},copyNodeDataFunction:{configurable:!0,get:function(){return this.ul},set:function(a){var b=this.ul;b!==a&&(null!==a&&A(a,"function",X,"copyNodeDataFunction"),this.ul=a,this.g("copyNodeDataFunction",b,a))}},copiesArrays:{configurable:!0,
1940 enumerable:!0,get:function(){return this.Qn},set:function(a){var b=this.Qn;b!==a&&(null!==a&&A(a,"boolean",X,"copiesArrays"),this.Qn=a,this.g("copiesArrays",b,a))}},copiesArrayObjects:{configurable:!0,get:function(){return this.Pn},set:function(a){var b=this.Pn;b!==a&&(null!==a&&A(a,"boolean",X,"copiesArrayObjects"),this.Pn=a,this.g("copiesArrayObjects",b,a))}},copiesKey:{configurable:!0,get:function(){return this.Sn},set:function(a){var b=this.Sn;b!==a&&(null!==a&&A(a,
1941 "boolean",X,"copiesKey"),this.Sn=a,this.g("copiesKey",b,a))}},afterCopyFunction:{configurable:!0,get:function(){return this.xn},set:function(a){var b=this.xn;b!==a&&(null!==a&&A(a,"function",X,"afterCopyFunction"),this.xn=a,this.g("afterCopyFunction",b,a))}},nodeCategoryProperty:{configurable:!0,get:function(){return this.jk},set:function(a){var b=this.jk;b!==a&&(Nr(a,X,"nodeCategoryProperty"),this.jk=a,this.g("nodeCategoryProperty",b,a))}},type:{configurable:!0,
1942 get:function(){return"Model"}}});X.prototype.setCategoryForNodeData=X.prototype.hn;X.prototype.getCategoryForNodeData=X.prototype.Vq;X.prototype.removeArrayItem=X.prototype.Hw;X.prototype.insertArrayItem=X.prototype.bu;X.prototype.addArrayItem=X.prototype.Dz;X.prototype.assignAllDataProperties=X.prototype.Iq;X.prototype.set=X.prototype.set;X.prototype.clearUnresolvedReferences=X.prototype.Tz;X.prototype.mergeNodeDataArray=X.prototype.dB;X.prototype.removeNodeDataCollection=X.prototype.pB;
1943 X.prototype.removeNodeData=X.prototype.an;X.prototype.addNodeDataCollection=X.prototype.Hz;X.prototype.addNodeData=X.prototype.Gf;X.prototype.makeNodeDataKeyUnique=X.prototype.lu;X.prototype.findNodeDataForKey=X.prototype.Qb;X.prototype.containsNodeData=X.prototype.$a;X.prototype.setKeyForNodeData=X.prototype.jn;X.prototype.getKeyForNodeData=X.prototype.pa;X.prototype.updateTargetBindings=X.prototype.Ia;X.prototype.commit=X.prototype.commit;X.prototype.rollbackTransaction=X.prototype.Uf;
1944 X.prototype.commitTransaction=X.prototype.cb;X.prototype.startTransaction=X.prototype.Ca;X.prototype.raiseDataChanged=X.prototype.qu;X.prototype.raiseChanged=X.prototype.g;X.prototype.raiseChangedEvent=X.prototype.ab;X.prototype.removeChangedListener=X.prototype.dl;X.prototype.addChangedListener=X.prototype.Sh;X.prototype.writeJsonValue=X.prototype.pn;X.prototype.replaceJsonObjects=X.prototype.bn;X.prototype.applyIncrementalJSON=X.prototype.Lz;X.prototype.applyIncrementalJson=X.prototype.ny;
1945 X.prototype.toJSON=X.prototype.toJSON;X.prototype.toJson=X.prototype.ur;X.prototype.toIncrementalJSON=X.prototype.BB;X.prototype.toIncrementalJson=X.prototype.nz;X.prototype.computeJsonDifference=X.prototype.Uz;X.prototype.toIncrementalData=X.prototype.AB;X.prototype.clear=X.prototype.clear;var Pr=!1,Qr={};X.className="Model";
1946 X.fromJSON=X.fromJson=function(a,b){void 0===b&&(b=null);null!==b&&w(b,X,X,"fromJson:model");var c=null;if("string"===typeof a)try{c=qa.JSON.parse(a)}catch(f){F&&Ea("JSON.parse error: "+f.toString())}else"object"===typeof a?c=a:v("Unable to construct a Model from: "+a);if(null===b){a=null;var d=c["class"];if("string"===typeof d)try{var e=null;0===d.indexOf("go.")?(d=d.substr(3),e=Kr(d)):(e=Kr(d),null===e&&(e=qa[d]));"function"===typeof e&&(a=new e)}catch(f){}null===a||a instanceof X?b=a:v("Unable to construct a Model of declared class: "+
1947 c["class"])}null===b&&(b=X.constructGraphLinksModel());b.kr(c);b.Fw(c);return b};X.safePropertyValue=Mn;X.safePropertySet=ik;Qr.Brush=Ol;Qr.ChangedEvent=Be;Qr.Geometry=zd;Qr.Margin=hc;Qr.Panel=W;Qr.Point=J;Qr.Rect=L;Qr.Size=Fb;Qr.Spot=N;Qr.Transaction=Ne;Qr.UndoManager=Oe;
1948 function Ui(a,b,c){eb(this);this.s=!1;void 0===a?a="":A(a,"string",Ui,"constructor:targetprop");void 0===b?b=a:A(b,"string",Ui,"constructor:sourceprop");void 0===c?c=null:null!==c&&A(c,"function",Ui,"constructor:conv");this.l=-1;this.vd=null;this.Cm=a;this.Bm=this.uq=0;this.ut=null;this.No=!1;this.um=b;this.On=c;this.mp=Rr;this.Hn=null;this.av=new I}
1949 Ui.prototype.copy=function(){var a=new Ui;a.Cm=this.Cm;a.uq=this.uq;a.Bm=this.Bm;a.ut=this.ut;a.No=this.No;a.um=this.um;a.On=this.On;a.mp=this.mp;a.Hn=this.Hn;return a};t=Ui.prototype;t.pb=function(a){a.classType===Ui?this.mode=a:Da(this,a)};t.toString=function(){return"Binding("+this.targetProperty+":"+this.sourceProperty+(-1!==this.Ij?" "+this.Ij:"")+" "+this.mode.name+")"};t.freeze=function(){this.s=!0;return this};t.ka=function(){this.s=!1;return this};
1950 t.Yy=function(a){void 0===a&&(a=null);null!==a&&A(a,"function",Ui,"makeTwoWay");this.mode=En;this.backConverter=a;return this};t.hr=function(a){void 0===a&&(a="");F&&A(a,"string",Ui,"ofObject:srcname");this.sourceName=a;this.isToModel=!1;return this};t.fB=function(){this.sourceName=null;this.isToModel=!0;return this};function Bl(a,b,c){a=a.sourceName;return null===a||""===a?b:"/"===a?c.part:"."===a?c:".."===a?c.panel:b.ib(a)}
1951 t.jx=function(a,b,c){var d=this.um;if(void 0===c||""===d||d===c){c=this.Cm;var e=this.On;if(null===e&&""===c)Ea("Binding error: target property is the empty string: "+this.toString());else{F&&"string"===typeof c&&("function"!==typeof a.setAttribute&&0<c.length&&"_"!==c[0]&&!Ra(a,c)?Ea("Binding error: undefined target property: "+c+" on "+a.toString()):"name"===c&&a instanceof O&&Ea("Binding error: cannot modify GraphObject.name on "+a.toString()));var f=b;""!==d&&(f=Mn(b,d));if(void 0!==f)if(null===
1952 e)""!==c&&ik(a,c,f);else try{if(""!==c){var g=e(f,a);F&&void 0===g&&Ea('Binding warning: conversion function returned undefined when setting target property "'+c+'" on '+a.toString()+", function is: "+e);ik(a,c,g)}else e(f,a)}catch(h){F&&Ea("Binding error: "+h.toString()+' setting target property "'+c+'" on '+a.toString()+" with conversion function: "+e)}}}};
1953 t.yr=function(a,b,c,d){if(this.mp===En){var e=this.Cm;if(void 0===c||e===c){c=this.um;var f=this.Hn,g=a;""!==e&&(g=Mn(a,e));if(void 0!==g&&!this.av.contains(a))try{this.av.add(a);var h=null!==d?d.diagram:null,k=null!==h?h.model:null;if(null===f)if(""!==c)null!==k?(F&&k.nodeKeyProperty===c&&k.$a(b)&&Ea("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),k.setDataProperty(b,c,g)):ik(b,c,g);else{if(null!==k&&null!==d&&0<=d.itemIndex&&null!==d.panel&&Array.isArray(d.panel.itemArray)){var l=
1954 d.itemIndex,m=d.panel.itemArray;k.Hw(m,l);k.bu(m,l,g)}}else try{if(""!==c){var n=f(g,b,k);null!==k?(F&&(k.nodeKeyProperty===c&&k.$a(b)&&Ea("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),void 0===n&&Ea('Binding warning: conversion function returned undefined when setting source property "'+c+'" on '+b.toString()+", function is: "+f)),k.setDataProperty(b,c,n)):ik(b,c,n)}else{var p=f(g,b,k);if(void 0!==p&&null!==k&&null!==d&&0<=d.itemIndex&&null!==d.panel&&Array.isArray(d.panel.itemArray)){var r=
1955 d.itemIndex,q=d.panel.itemArray;k.Hw(q,r);k.bu(q,r,p)}}}catch(u){F&&Ea("Binding error: "+u.toString()+' setting source property "'+c+'" on '+b.toString()+" with conversion function: "+f)}}finally{this.av.remove(a)}}}};
1956 na.Object.defineProperties(Ui.prototype,{Ij:{configurable:!0,get:function(){return this.l},set:function(a){this.s&&va(this);A(a,"number",Ui,"targetId");this.l=a}},targetProperty:{configurable:!0,get:function(){return this.Cm},set:function(a){this.s&&va(this);A(a,"string",Ui,"targetProperty");this.Cm=a}},sourceName:{configurable:!0,get:function(){return this.ut},set:function(a){this.s&&va(this);null!==a&&A(a,"string",Ui,"sourceName");this.ut=a;null!==a&&(this.No=
1957 !1)}},isToModel:{configurable:!0,get:function(){return this.No},set:function(a){this.s&&va(this);A(a,"boolean",Ui,"isToModel");this.No=a}},sourceProperty:{configurable:!0,get:function(){return this.um},set:function(a){this.s&&va(this);A(a,"string",Ui,"sourceProperty");this.um=a}},converter:{configurable:!0,get:function(){return this.On},set:function(a){this.s&&va(this);null!==a&&A(a,"function",Ui,"converter");this.On=a}},backConverter:{configurable:!0,
1958 get:function(){return this.Hn},set:function(a){this.s&&va(this);null!==a&&A(a,"function",Ui,"backConverter");this.Hn=a}},mode:{configurable:!0,get:function(){return this.mp},set:function(a){this.s&&va(this);gb(a,Ui,Ui,"mode");this.mp=a}}});Ui.prototype.updateSource=Ui.prototype.yr;Ui.prototype.updateTarget=Ui.prototype.jx;Ui.prototype.ofModel=Ui.prototype.fB;Ui.prototype.ofObject=Ui.prototype.hr;Ui.prototype.makeTwoWay=Ui.prototype.Yy;
1959 var dl="Binding",Rr=new E(Ui,"OneWay",1),En=new E(Ui,"TwoWay",2);Ui.className="Binding";Ui.parseEnum=function(a,b){A(a,"function",Ui,"parseEnum:ctor");gb(b,a,Ui,"parseEnum:defval");return function(c){c=fb(a,c);return null===c?b:c}};Ui.toString=Qa;Ui.OneWay=Rr;Ui.TwoWay=En;
1960 function Sr(a,b){X.call(this);this.Fu=',\n "insertedLinkKeys": ';this.zx=',\n "modifiedLinkData": ';this.Hu=',\n "removedLinkKeys": ';F&&2<arguments.length&&v("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");this.fd=[];this.mg=new I;this.mb=new Bb;this.Si="";this.Mj=this.tl=this.cm=null;this.nf="from";this.pf="to";this.gk=this.fk="";this.ek="category";this.ge="";this.gm="isGroup";this.Ke="group";this.Rn=!1;void 0!==a&&(this.nodeDataArray=
1961 a);void 0!==b&&(this.linkDataArray=b)}ma(Sr,X);Sr.constructGraphLinksModel=X.constructGraphLinksModel;Sr.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.Si=this.Si;a.cm=this.cm;a.tl=this.tl;a.nf=this.nf;a.pf=this.pf;a.fk=this.fk;a.gk=this.gk;a.ek=this.ek;a.ge=this.ge;a.gm=this.gm;a.Ke=this.Ke;a.Rn=this.Rn};t=Sr.prototype;t.clear=function(){X.prototype.clear.call(this);this.fd=[];this.mb.clear();this.mg.clear()};
1962 t.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.ur();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.nodeDataArray;var c=a.length,d;for(d=0;d<c;d++){var e=a[d];b+=" "+this.pa(e)+":"+Qa(e)}b+="\n link data:";a=this.linkDataArray;c=a.length;for(d=0;d<c;d++)e=a[d],b+=" "+jr(this,e,!0)+"--\x3e"+jr(this,e,!1)}return b};
1963 t.ox=function(a,b){""===this.linkKeyProperty&&v("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalData() to succeed.");var c=X.prototype.ox.call(this,a,b),d=this,e=new I,f=new I,g=new I,h=this.ii;a.changes.each(function(a){a.model===d&&("linkDataArray"===a.modelChange?a.change===Le?e.add(a.newValue):a.change===Me&&g.add(a.oldValue):d.Dc(a.object)?f.add(a.object):null!==a.object&&(null!==a.object&&h&&h.contains(a.object)?h.get(a.object).each(function(a){d.Dc(a)&&f.add(a)}):
1964 a.object instanceof X||d.$a(a.object)||Tr(d,a.object).each(function(a){f.add(a)})))});var k=this.Wi;k.clear();e.each(function(a){k.add(d.bc(a));b||f.add(a)});var l=this.Zi;l.clear();g.each(function(a){l.add(d.bc(a));b&&f.add(a)});a=d.cloneDeep(f.ta());0<k.count&&(null===c&&(c={}),b?c.removedLinkKeys=k.ta():c.insertedLinkKeys=k.ta());0<a.length&&(null===c&&(c={}),c.modifiedLinkData=a);0<l.count&&(null===c&&(c={}),b?c.insertedLinkKeys=l.ta():c.removedLinkKeys=l.ta());l.clear();k.clear();return c};
1965 t.gl=function(){var a=X.prototype.gl.call(this),b="";"category"!==this.linkCategoryProperty&&"string"===typeof this.linkCategoryProperty&&(b+=',\n "linkCategoryProperty": '+this.quote(this.linkCategoryProperty));""!==this.linkKeyProperty&&"string"===typeof this.linkKeyProperty&&(b+=',\n "linkKeyProperty": '+this.quote(this.linkKeyProperty));"from"!==this.linkFromKeyProperty&&"string"===typeof this.linkFromKeyProperty&&(b+=',\n "linkFromKeyProperty": '+this.quote(this.linkFromKeyProperty));"to"!==
1966 this.linkToKeyProperty&&"string"===typeof this.linkToKeyProperty&&(b+=',\n "linkToKeyProperty": '+this.quote(this.linkToKeyProperty));""!==this.linkFromPortIdProperty&&"string"===typeof this.linkFromPortIdProperty&&(b+=',\n "linkFromPortIdProperty": '+this.quote(this.linkFromPortIdProperty));""!==this.linkToPortIdProperty&&"string"===typeof this.linkToPortIdProperty&&(b+=',\n "linkToPortIdProperty": '+this.quote(this.linkToPortIdProperty));""!==this.linkLabelKeysProperty&&"string"===typeof this.linkLabelKeysProperty&&
1967 (b+=',\n "linkLabelKeysProperty": '+this.quote(this.linkLabelKeysProperty));"isGroup"!==this.nodeIsGroupProperty&&"string"===typeof this.nodeIsGroupProperty&&(b+=',\n "nodeIsGroupProperty": '+this.quote(this.nodeIsGroupProperty));"group"!==this.nodeGroupKeyProperty&&"string"===typeof this.nodeGroupKeyProperty&&(b+=',\n "nodeGroupKeyProperty": '+this.quote(this.nodeGroupKeyProperty));return a+b};
1968 t.kr=function(a){X.prototype.kr.call(this,a);a.linkKeyProperty&&(this.linkKeyProperty=a.linkKeyProperty);a.linkFromKeyProperty&&(this.linkFromKeyProperty=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.linkToKeyProperty=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.linkFromPortIdProperty=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.linkToPortIdProperty=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.linkCategoryProperty=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.linkLabelKeysProperty=
1969 a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.nodeIsGroupProperty=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&(this.nodeGroupKeyProperty=a.nodeGroupKeyProperty)};t.px=function(){var a=X.prototype.px.call(this),b=',\n "linkDataArray": '+Cr(this,this.linkDataArray,!0);return a+b};t.Fw=function(a){X.prototype.Fw.call(this,a);a=a.linkDataArray;Array.isArray(a)&&(this.bn(a),this.linkDataArray=a)};
1970 t.zr=function(a){if(!(a instanceof Sr))return v("Model.computeJsonDifference: newmodel must be a GraphLinksModel"),"";""===this.linkKeyProperty&&v("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var b=X.prototype.zr.call(this,a);Er(this,a,"linkKeyProperty");Er(this,a,"linkFromKeyProperty");Er(this,a,"linkToKeyProperty");Er(this,a,"linkLabelKeysProperty");Er(this,a,"nodeIsGroupProperty");Er(this,a,"nodeGroupKeyProperty");var c=this.Wi;c.clear();
1971 var d=new I,e=this.Zi;e.clear();e.addAll(this.mb.iteratorKeys);for(var f=new Bb,g=a.linkDataArray,h=g.length,k=0;k<h;k++){var l=g[k],m=a.bc(l);if(void 0!==m){e.remove(m);var n=this.Pg(m);null===n?(c.add(m),d.add(l)):Dr(this,n,l,f)||d.add(l)}else this.er(l),m=this.bc(l),c.add(m),d.add(l)}a=b;0<c.count&&(a+=this.Fu+Cr(this,c.ta(),!0));0<d.count&&(a+=this.zx+Cr(this,d.ta(),!0));0<e.count&&(a+=this.Hu+Cr(this,e.ta(),!0));e.clear();c.clear();return a};
1972 function Tr(a,b){for(var c=new I,d=0;d<a.linkDataArray.length;d++){var e=a.linkDataArray[d];Gr(a,b,e,e,c)}return c}
1973 t.nx=function(a,b){""===this.linkKeyProperty&&v("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var c=X.prototype.nx.call(this,a,b),d=this,e=new I,f=new I,g=new I,h=this.ii;a.changes.each(function(a){a.model===d&&("linkDataArray"===a.modelChange?a.change===Le?e.add(a.newValue):a.change===Me&&g.add(a.oldValue):d.Dc(a.object)?f.add(a.object):null!==a.object&&(null!==a.object&&h&&h.contains(a.object)?h.get(a.object).each(function(a){d.Dc(a)&&f.add(a)}):
1974 a.object instanceof X||d.$a(a.object)||Tr(d,a.object).each(function(a){f.add(a)})))});var k=this.Wi;k.clear();e.each(function(a){k.add(d.bc(a));b||f.add(a)});var l=this.Zi;l.clear();g.each(function(a){l.add(d.bc(a));b&&f.add(a)});a=c;0<k.count&&(a+=(b?this.Hu:this.Fu)+Cr(this,k.ta(),!0));0<f.count&&(a+=this.zx+Cr(this,f.ta(),!0));0<l.count&&(a+=(b?this.Fu:this.Hu)+Cr(this,l.ta(),!0));l.clear();k.clear();return a};
1975 t.jr=function(a){(void 0!==a.linkCategoryProperty&&a.linkCategoryProperty!==this.linkCategoryProperty||void 0!==a.linkKeyProperty&&a.linkKeyProperty!==this.linkKeyProperty||void 0!==a.linkFromKeyProperty&&a.linkFromKeyProperty!==this.linkFromKeyProperty||void 0!==a.linkToKeyProperty&&a.linkToKeyProperty!==this.linkToKeyProperty||void 0!==a.linkFromPortIdProperty&&a.linkFromPortIdProperty!==this.linkFromPortIdProperty||void 0!==a.linkToPortIdProperty&&a.linkToPortIdProperty!==this.linkToPortIdProperty||
1976 void 0!==a.linkLabelKeysProperty&&a.linkLabelKeysProperty!==this.linkLabelKeysProperty||void 0!==a.nodeIsGroupProperty&&a.nodeIsGroupProperty!==this.nodeIsGroupProperty||void 0!==a.nodeGroupKeyProperty&&a.nodeGroupKeyProperty!==this.nodeGroupKeyProperty)&&v("applyIncrementalJson cannot change Model properties");X.prototype.jr.call(this,a);var b=a.insertedLinkKeys;if(Array.isArray(b))for(var c=b.length,d=0;d<c;d++){var e=b[d],f=this.Pg(e);null===f&&(f=this.Nq({}),this.vu(f,e),this.mj(f))}b=a.modifiedLinkData;
1977 if(Array.isArray(b))for(c=b.length,d=0;d<c;d++)if(e=b[d],f=this.bc(e),f=this.Pg(f),null!==f){for(var g in e)"__gohashid"!==g&&g!==this.linkKeyProperty&&this.setDataProperty(f,g,e[g]);Ur(this,e,f)}a=a.removedLinkKeys;if(Array.isArray(a))for(g=a.length,b=0;b<g;b++)c=this.Pg(a[b]),null!==c&&this.$m(c)};
1978 Sr.prototype.changeState=function(a,b){if(null!==a&&a.model===this){if(a.change===Ce){var c=a.object,d=a.propertyName;if(d===this.linkKeyProperty&&this.Dc(c)){var e=a.J(b);b=a.J(!b);void 0!==b&&this.mb.remove(b);void 0!==e&&this.mb.add(e,c);ik(c,d,e);return}}else if(a.change===Le){c=a.newParam;if("linkDataArray"===a.modelChange){a=a.newValue;Ga(a)&&"number"===typeof c&&(d=this.bc(a),b?(this.mg.remove(a),this.fd[c]===a&&this.fd.splice(c,1),void 0!==d&&this.mb.remove(d)):(this.mg.add(a),this.fd[c]!==
1979 a&&this.fd.splice(c,0,a),void 0!==d&&this.mb.add(d,a)));return}if("linkLabelKeys"===a.modelChange){d=this.Nf(a.object);Array.isArray(d)&&"number"===typeof c&&(b?(c=d.indexOf(a.newValue),0<=c&&d.splice(c,1)):0>d.indexOf(a.newValue)&&d.splice(c,0,a.newValue));return}}else if(a.change===Me){c=a.oldParam;if("linkDataArray"===a.modelChange){a=a.oldValue;Ga(a)&&"number"===typeof c&&(d=this.bc(a),b?(this.mg.add(a),this.fd[c]!==a&&this.fd.splice(c,0,a),void 0!==d&&this.mb.add(d,a)):(this.mg.remove(a),this.fd[c]===
1980 a&&this.fd.splice(c,1),void 0!==d&&this.mb.remove(d)));return}if("linkLabelKeys"===a.modelChange){d=this.Nf(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=Sr.prototype;t.Um=function(a){if(void 0!==a){var b=this.Mj;if(null!==b){var c=this.Qb(a);null===c&&(c=this.copyNodeData(b),ik(c,this.nodeKeyProperty,a),this.Gf(c))}return a}};
1981 t.My=function(a){return jr(this,a,!0)};t.Pw=function(a,b){rr(this,a,b,!0)};t.Py=function(a){return jr(this,a,!1)};t.Uw=function(a,b){rr(this,a,b,!1)};function jr(a,b,c){if(null!==b&&(a=c?a.nf:a.pf,""!==a&&(a=Mn(b,a),void 0!==a))){if(lr(a))return a;v((c?"FromKey":"ToKey")+" value for link data "+b+" is not a number or a string: "+a)}}
1982 function rr(a,b,c,d){null===c&&(c=void 0);void 0===c||lr(c)||ya(c,"number or string",Sr,d?"setFromKeyForLinkData:key":"setToKeyForLinkData:key");if(null!==b){var e=d?a.nf:a.pf;if(""!==e)if(c=a.Um(c),a.Dc(b)){var f=Mn(b,e);f!==c&&(pr(a,f,b),ik(b,e,c),null===a.Qb(c)&&qr(a,c,b),Mr(a,d?"linkFromKey":"linkToKey",Ce,e,b,f,c),"string"===typeof e&&a.Ia(b,e))}else ik(b,e,c)}}t.Ny=function(a){return ir(this,a,!0)};t.Qw=function(a,b){sr(this,a,b,!0)};t.Qy=function(a){return ir(this,a,!1)};
1983 t.Vw=function(a,b){sr(this,a,b,!1)};function ir(a,b,c){if(null===b)return"";a=c?a.fk:a.gk;if(""===a)return"";b=Mn(b,a);return void 0===b?"":b}function sr(a,b,c,d){A(c,"string",Sr,d?"setFromPortIdForLinkData:portname":"setToPortIdForLinkData:portname");if(null!==b){var e=d?a.fk:a.gk;if(""!==e)if(a.Dc(b)){var f=Mn(b,e);void 0===f&&(f="");f!==c&&(ik(b,e,c),Mr(a,d?"linkFromPortId":"linkToPortId",Ce,e,b,f,c),"string"===typeof e&&a.Ia(b,e))}else ik(b,e,c)}}
1984 t.Nf=function(a){if(null===a)return Vr;var b=this.ge;if(""===b)return Vr;a=Mn(a,b);return void 0===a?Vr:a};t.wu=function(a,b){Ia(b,Sr,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.ge;if(""!==c)if(this.Dc(a)){var d=Mn(a,c);void 0===d&&(d=Vr);if(d!==b){if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)pr(this,d[f],a);ik(a,c,b);e=b.length;for(f=0;f<e;f++){var g=b[f];null===this.Qb(g)&&qr(this,g,a)}Mr(this,"linkLabelKeys",Ce,c,a,d,b);"string"===typeof c&&this.Ia(a,c)}}else ik(a,c,b)}};
1985 t.Qv=function(a,b){if(null!==b&&void 0!==b&&(lr(b)||ya(b,"number or string",Sr,"addLabelKeyForLinkData:key"),null!==a)){var c=this.ge;if(""!==c){var d=Mn(a,c);if(void 0===d)c=[],c.push(b),this.wu(a,c);else if(Array.isArray(d)){var e=d.indexOf(b);0<=e||(e=d.length,d.push(b),this.Dc(a)&&(null===this.Qb(b)&&qr(this,b,a),Mr(this,"linkLabelKeys",Le,c,a,null,b,null,e)))}else v(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
1986 t.dz=function(a,b){if(null!==b&&void 0!==b&&(lr(b)||ya(b,"number or string",Sr,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.ge;if(""!==c){var d=Mn(a,c);if(Array.isArray(d)){var e=d.indexOf(b);0>e||(d.splice(e,1),this.Dc(a)&&(pr(this,b,a),Mr(this,"linkLabelKeys",Me,c,a,b,null,e,null)))}else void 0!==d&&v(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};
1987 t.bc=function(a){if(null!==a){var b=this.Si;if(""!==b&&(b=Mn(a,b),void 0!==b)){if(lr(b))return b;v("Key value for link data "+a+" is not a number or a string: "+b)}}};t.vu=function(a,b){void 0!==b&&null!==b&&lr(b)||ya(b,"number or string",Sr,"setKeyForLinkData:key");if(null!==a){var c=this.Si;if(""!==c)if(this.Dc(a)){var d=Mn(a,c);d!==b&&null===this.Pg(b)&&(ik(a,c,b),void 0!==d&&this.mb.remove(d),this.mb.add(b,a),Mr(this,"linkKey",Ce,c,a,d,b),"string"===typeof c&&this.Ia(a,c))}else ik(a,c,b)}};
1988 t.Pg=function(a){null===a&&v("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&lr(a)?this.mb.J(a):null};
1989 t.er=function(a){if(null!==a){var b=this.Si;if(""!==b){var c=this.bc(a);if(void 0===c||this.mb.contains(c)){var d=this.cm;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.mb.contains(c))){ik(a,b,c);return}if("string"===typeof c){for(d=2;this.mb.contains(c+d);)d++;ik(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(c=-this.mb.count-1;this.mb.contains(c);)c--;ik(a,b,c)}else F&&v("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+c)}}}};
1990 t.Dc=function(a){return null===a?!1:this.mg.contains(a)};t.mj=function(a){null!==a&&(rb(a),this.Dc(a)||nr(this,a,!0))};function nr(a,b,c){if(""!==a.linkKeyProperty){var d=a.bc(b);if(void 0!==d&&a.mb.J(d)===b)return;a.er(b);d=a.bc(b);if(void 0===d){v("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.mb.add(d,b)}a.mg.add(b);d=null;c&&(d=a.fd.length,a.fd.splice(d,0,b));Mr(a,"linkDataArray",Le,"linkDataArray",a,null,b,null,d);Wr(a,b)}
1991 t.Gz=function(a){if(Array.isArray(a))for(var b=a.length,c=0;c<b;c++)this.mj(a[c]);else for(a=a.iterator;a.next();)this.mj(a.value)};t.$m=function(a){null!==a&&mr(this,a,!0)};function mr(a,b,c){a.mg.remove(b);var d=a.bc(b);void 0!==d&&a.mb.remove(d);d=null;if(c){d=a.fd.indexOf(b);if(0>d)return;a.fd.splice(d,1)}Mr(a,"linkDataArray",Me,"linkDataArray",a,b,null,d,null);c=jr(a,b,!0);pr(a,c,b);c=jr(a,b,!1);pr(a,c,b);d=a.Nf(b);if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)c=d[f],pr(a,c,b)}
1992 t.nB=function(a){if(Array.isArray(a))for(var b=a.length,c=0;c<b;c++)this.$m(a[c]);else for(a=a.iterator;a.next();)this.$m(a.value)};
1993 t.cB=function(a){""===this.linkKeyProperty&&v("GraphLinksModel.linkKeyProperty must not be an empty string for .mergeLinkDataArray() to succeed.");if(a!==this.linkDataArray&&Ha(a)){var b=this.Zi;b.clear();b.addAll(this.mb.iteratorKeys);var c=this.Wi;c.clear();for(var d=a.length,e=0;e<d;e++){var f=a[e],g=this.bc(f);if(void 0!==g){c.add(g);var h=this.Pg(g);h!==f&&(null!==h?(this.Iq(h,f),Ur(this,f,h)):(f=this.cloneDeep(f),this.vu(f,g),this.mj(f)))}else g=this.cloneDeep(f),this.mj(g),c.add(this.bc(g))}for(a=
1994 b.iterator;a.next();)d=a.value,c.contains(d)||(d=this.Pg(d))&&this.$m(d);b.clear();c.clear()}};function Wr(a,b){var c=jr(a,b,!0);c=a.Um(c);null===a.Qb(c)&&qr(a,c,b);c=jr(a,b,!1);c=a.Um(c);null===a.Qb(c)&&qr(a,c,b);var d=a.Nf(b);if(Array.isArray(d))for(var e=d.length,f=0;f<e;f++)c=d[f],null===a.Qb(c)&&qr(a,c,b)}
1995 t.Nq=function(a){if(null===a)return null;var b=this.tl;a=null!==b?b(a,this):Or(this,a,!0);Ga(a)&&(eb(a),""!==this.nf&&ik(a,this.nf,void 0),""!==this.pf&&ik(a,this.pf,void 0),""!==this.ge&&ik(a,this.ge,[]));return a};t.fu=function(a){if(null===a)return!1;var b=this.gm;return""===b?!1:Mn(a,b)?!0:!1};t.Wh=function(a){if(null!==a){var b=this.Ke;if(""!==b&&(b=Mn(a,b),void 0!==b)){if(lr(b))return b;v("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
1996 t.sr=function(a,b){null===b&&(b=void 0);void 0===b||lr(b)||ya(b,"number or string",Sr,"setGroupKeyForNodeData:key");if(null!==a){var c=this.Ke;if(""!==c)if(this.$a(a)){var d=Mn(a,c);d!==b&&(pr(this,d,a),ik(a,c,b),null===this.Qb(b)&&qr(this,b,a),Mr(this,"nodeGroupKey",Ce,c,a,d,b),"string"===typeof c&&this.Ia(a,c))}else ik(a,c,b)}};
1997 Sr.prototype.copyNodeData=function(a){if(null===a)return null;a=X.prototype.copyNodeData.call(this,a);this.Dk||""===this.Ke||void 0===Mn(a,this.Ke)||ik(a,this.Ke,void 0);return a};
1998 Sr.prototype.setDataProperty=function(a,b,c){F&&(A(a,"object",Sr,"setDataProperty:data"),A(b,"string",Sr,"setDataProperty:propname"),""===b&&v("GraphLinksModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.$a(a)){if(b===this.nodeKeyProperty){this.jn(a,c);return}if(b===this.nodeCategoryProperty){this.hn(a,c);return}if(b===this.nodeGroupKeyProperty){this.sr(a,c);return}F&&b===this.nodeIsGroupProperty&&v("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+
1999 b)}else if(this.Dc(a)){if(b===this.linkFromKeyProperty){rr(this,a,c,!0);return}if(b===this.linkToKeyProperty){rr(this,a,c,!1);return}if(b===this.linkFromPortIdProperty){sr(this,a,c,!0);return}if(b===this.linkToPortIdProperty){sr(this,a,c,!1);return}if(b===this.linkKeyProperty){this.vu(a,c);return}if(b===this.linkCategoryProperty){this.rr(a,c);return}if(b===this.linkLabelKeysProperty){this.wu(a,c);return}}var d=Mn(a,b);d!==c&&(ik(a,b,c),this.qu(a,b,d,c))};t=Sr.prototype;
2000 t.Iq=function(a,b){if(b){var c=this.$a(a),d=this.Dc(a),e;for(e in b)"__gohashid"===e||c&&e===this.nodeKeyProperty||c&&e===this.nodeIsGroupProperty&&Mn(a,e)===b[e]||d&&e===this.linkKeyProperty||this.setDataProperty(a,e,b[e])}};
2001 t.pr=function(a,b){X.prototype.pr.call(this,a,b);for(var c=this.bb.iterator;c.next();)this.Jw(c.value,a,b);for(c=this.mg.iterator;c.next();){var d=c.value,e=a,f=b;if(jr(this,d,!0)===e){var g=this.nf;ik(d,g,f);Mr(this,"linkFromKey",Ce,g,d,e,f);"string"===typeof g&&this.Ia(d,g)}jr(this,d,!1)===e&&(g=this.pf,ik(d,g,f),Mr(this,"linkToKey",Ce,g,d,e,f),"string"===typeof g&&this.Ia(d,g));g=this.Nf(d);if(Array.isArray(g))for(var h=g.length,k=this.ge,l=0;l<h;l++)g[l]===e&&(g[l]=f,Mr(this,"linkLabelKeys",Le,
2002 k,d,e,f,l,l))}};t.Jw=function(a,b,c){if(this.Wh(a)===b){var d=this.Ke;ik(a,d,c);Mr(this,"nodeGroupKey",Ce,d,a,b,c);"string"===typeof d&&this.Ia(a,d)}};t.ix=function(){X.prototype.ix.call(this);for(var a=this.linkDataArray,b=a.length,c=0;c<b;c++)Wr(this,a[c])};
2003 t.dn=function(a){X.prototype.dn.call(this,a);a=this.pa(a);var b=or(this,a);if(null!==b){var c=Ma();for(b=b.iterator;b.next();){var d=b.value;if(this.$a(d)){if(this.Wh(d)===a){var e=this.Ke;Mr(this,"nodeGroupKey",Ce,e,d,a,a);"string"===typeof e&&this.Ia(d,e);c.push(d)}}else if(jr(this,d,!0)===a&&(e=this.nf,Mr(this,"linkFromKey",Ce,e,d,a,a),"string"===typeof e&&this.Ia(d,e),c.push(d)),jr(this,d,!1)===a&&(e=this.pf,Mr(this,"linkToKey",Ce,e,d,a,a),"string"===typeof e&&this.Ia(d,e),c.push(d)),e=this.Nf(d),
2004 Array.isArray(e))for(var f=e.length,g=this.ge,h=0;h<f;h++)e[h]===a&&(Mr(this,"linkLabelKeys",Le,g,d,a,a,h,h),c.push(d))}for(b=0;b<c.length;b++)pr(this,a,c[b]);Oa(c)}};t.cn=function(a){X.prototype.cn.call(this,a);var b=this.Wh(a);null===this.Qb(b)&&qr(this,b,a)};t.wr=function(a){X.prototype.wr.call(this,a);var b=this.Wh(a);pr(this,b,a)};
2005 t.Yt=function(a){if(null===a)return"";var b=this.ek;if(""===b)return"";b=Mn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};Sr.prototype.getLinkCategoryForData=function(a){return this.Yt(a)};
2006 Sr.prototype.rr=function(a,b){A(b,"string",Sr,"setCategoryForLinkData:cat");if(null!==a){var c=this.ek;if(""!==c)if(this.Dc(a)){var d=Mn(a,c);void 0===d&&(d="");d!==b&&(ik(a,c,b),Mr(this,"linkCategory",Ce,c,a,d,b),"string"===typeof c&&this.Ia(a,c))}else ik(a,c,b)}};Sr.prototype.setLinkCategoryForData=function(a,b){this.rr(a,b)};t=Sr.prototype;t.kn=function(a,b){X.prototype.kn.call(this,a,b);this.sr(b,this.Wh(a))};
2007 function Ur(a,b,c){a.rr(c,a.Yt(b));a.Pw(c,a.My(b));a.Uw(c,a.Py(b));a.wu(c,a.Nf(b));a.Qw(c,a.Ny(b));a.Vw(c,a.Qy(b))}t.Ok=function(){return!0};t.Cj=function(){return!0};t.hu=function(){return!0};t.Aj=function(){return!0};
2008 na.Object.defineProperties(Sr.prototype,{archetypeNodeData:{configurable:!0,get:function(){return this.Mj},set:function(a){var b=this.Mj;b!==a&&(null!==a&&A(a,"object",Sr,"archetypeNodeData"),this.Mj=a,this.g("archetypeNodeData",b,a))}},linkFromKeyProperty:{configurable:!0,get:function(){return this.nf},set:function(a){var b=this.nf;b!==a&&(Nr(a,Sr,"linkFromKeyProperty"),this.nf=a,this.g("linkFromKeyProperty",b,a))}},linkToKeyProperty:{configurable:!0,get:function(){return this.pf},
2009 set:function(a){var b=this.pf;b!==a&&(Nr(a,Sr,"linkToKeyProperty"),this.pf=a,this.g("linkToKeyProperty",b,a))}},linkFromPortIdProperty:{configurable:!0,get:function(){return this.fk},set:function(a){var b=this.fk;b!==a&&(Nr(a,Sr,"linkFromPortIdProperty"),!F||a!==this.linkFromKeyProperty&&a!==this.linkToKeyProperty||v("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.fk=a,this.g("linkFromPortIdProperty",b,a))}},
2010 linkToPortIdProperty:{configurable:!0,get:function(){return this.gk},set:function(a){var b=this.gk;b!==a&&(Nr(a,Sr,"linkToPortIdProperty"),!F||a!==this.linkFromKeyProperty&&a!==this.linkToKeyProperty||v("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.gk=a,this.g("linkToPortIdProperty",b,a))}},linkLabelKeysProperty:{configurable:!0,get:function(){return this.ge},set:function(a){var b=this.ge;b!==
2011 a&&(Nr(a,Sr,"linkLabelKeysProperty"),this.ge=a,this.g("linkLabelKeysProperty",b,a))}},linkDataArray:{configurable:!0,get:function(){return this.fd},set:function(a){var b=this.fd;if(b!==a){Ia(a,Sr,"linkDataArray");this.mb.clear();for(var c=a.length,d=0;d<c;d++){var e=a[d];if(!Ga(e)){v("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}rb(e)}this.fd=a;if(""!==this.linkKeyProperty){d=new H;for(e=0;e<c;e++){var f=a[e],g=this.bc(f);void 0===g?d.add(f):null!==this.mb.J(g)?
2012 d.add(f):this.mb.add(g,f)}for(d=d.iterator;d.next();)e=d.value,this.er(e),f=this.bc(e),void 0!==f&&this.mb.add(f,e)}d=new I;for(e=0;e<c;e++)d.add(a[e]);this.mg=d;Mr(this,"linkDataArray",Ce,"linkDataArray",this,b,a);for(b=0;b<c;b++)Wr(this,a[b])}}},linkKeyProperty:{configurable:!0,get:function(){return this.Si},set:function(a){var b=this.Si;if(b!==a){Nr(a,Sr,"linkKeyProperty");this.Si=a;this.mb.clear();for(var c=this.linkDataArray.length,d=0;d<c;d++){var e=this.linkDataArray[d],f=this.bc(e);
2013 void 0===f&&(this.er(e),f=this.bc(e));void 0!==f&&this.mb.add(f,e)}this.g("linkKeyProperty",b,a)}}},makeUniqueLinkKeyFunction:{configurable:!0,get:function(){return this.cm},set:function(a){var b=this.cm;b!==a&&(null!==a&&A(a,"function",Sr,"makeUniqueLinkKeyFunction"),this.cm=a,this.g("makeUniqueLinkKeyFunction",b,a))}},copyLinkDataFunction:{configurable:!0,get:function(){return this.tl},set:function(a){var b=this.tl;b!==a&&(null!==a&&A(a,"function",Sr,"copyLinkDataFunction"),
2014 this.tl=a,this.g("copyLinkDataFunction",b,a))}},nodeIsGroupProperty:{configurable:!0,get:function(){return this.gm},set:function(a){var b=this.gm;b!==a&&(Nr(a,Sr,"nodeIsGroupProperty"),this.gm=a,this.g("nodeIsGroupProperty",b,a))}},nodeGroupKeyProperty:{configurable:!0,get:function(){return this.Ke},set:function(a){var b=this.Ke;b!==a&&(Nr(a,Sr,"nodeGroupKeyProperty"),this.Ke=a,this.g("nodeGroupKeyProperty",b,a))}},Dk:{configurable:!0,get:function(){return this.Rn},
2015 set:function(a){this.Rn!==a&&(A(a,"boolean",Sr,"copiesGroupKeyOfNodeData"),this.Rn=a)}},linkCategoryProperty:{configurable:!0,get:function(){return this.ek},set:function(a){var b=this.ek;b!==a&&(Nr(a,Sr,"linkCategoryProperty"),this.ek=a,this.g("linkCategoryProperty",b,a))}},type:{configurable:!0,get:function(){return"GraphLinksModel"}}});Sr.prototype.setCategoryForLinkData=Sr.prototype.rr;Sr.prototype.getCategoryForLinkData=Sr.prototype.Yt;
2016 Sr.prototype.assignAllDataProperties=Sr.prototype.Iq;Sr.prototype.setGroupKeyForNodeData=Sr.prototype.sr;Sr.prototype.getGroupKeyForNodeData=Sr.prototype.Wh;Sr.prototype.isGroupForNodeData=Sr.prototype.fu;Sr.prototype.copyLinkData=Sr.prototype.Nq;Sr.prototype.mergeLinkDataArray=Sr.prototype.cB;Sr.prototype.removeLinkDataCollection=Sr.prototype.nB;Sr.prototype.removeLinkData=Sr.prototype.$m;Sr.prototype.addLinkDataCollection=Sr.prototype.Gz;Sr.prototype.addLinkData=Sr.prototype.mj;
2017 Sr.prototype.containsLinkData=Sr.prototype.Dc;Sr.prototype.makeLinkDataKeyUnique=Sr.prototype.er;Sr.prototype.findLinkDataForKey=Sr.prototype.Pg;Sr.prototype.setKeyForLinkData=Sr.prototype.vu;Sr.prototype.getKeyForLinkData=Sr.prototype.bc;Sr.prototype.removeLabelKeyForLinkData=Sr.prototype.dz;Sr.prototype.addLabelKeyForLinkData=Sr.prototype.Qv;Sr.prototype.setLabelKeysForLinkData=Sr.prototype.wu;Sr.prototype.getLabelKeysForLinkData=Sr.prototype.Nf;Sr.prototype.setToPortIdForLinkData=Sr.prototype.Vw;
2018 Sr.prototype.getToPortIdForLinkData=Sr.prototype.Qy;Sr.prototype.setFromPortIdForLinkData=Sr.prototype.Qw;Sr.prototype.getFromPortIdForLinkData=Sr.prototype.Ny;Sr.prototype.setToKeyForLinkData=Sr.prototype.Uw;Sr.prototype.getToKeyForLinkData=Sr.prototype.Py;Sr.prototype.setFromKeyForLinkData=Sr.prototype.Pw;Sr.prototype.getFromKeyForLinkData=Sr.prototype.My;Sr.prototype.clear=Sr.prototype.clear;var Vr=Object.freeze([]);Sr.className="GraphLinksModel";Qr.GraphLinksModel=Sr;
2019 X.constructGraphLinksModel=X.constructGraphLinksModel=function(){return new Sr};X.initDiagramModel=Li=function(){return new Sr};function Xr(a){F&&1<arguments.length&&v("TreeModel constructor can only take one optional argument, the Array of node data.");X.call(this);this.Le="parent";this.Tn=!1;this.lk="parentLinkCategory";void 0!==a&&(this.nodeDataArray=a)}ma(Xr,X);Xr.constructGraphLinksModel=X.constructGraphLinksModel;
2020 Xr.prototype.cloneProtected=function(a){X.prototype.cloneProtected.call(this,a);a.Le=this.Le;a.Tn=this.Tn;a.lk=this.lk};t=Xr.prototype;t.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.ur();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.nodeDataArray;for(var c=a.length,d=0;d<c;d++){var e=a[d];b+=" "+this.pa(e)+":"+Qa(e)}}return b};
2021 t.gl=function(){var a=X.prototype.gl.call(this),b="";"parent"!==this.nodeParentKeyProperty&&"string"===typeof this.nodeParentKeyProperty&&(b+=',\n "nodeParentKeyProperty": '+this.quote(this.nodeParentKeyProperty));return a+b};t.kr=function(a){X.prototype.kr.call(this,a);a.nodeParentKeyProperty&&(this.nodeParentKeyProperty=a.nodeParentKeyProperty)};t.zr=function(a){Er(this,a,"nodeParentKeyProperty");return X.prototype.zr.call(this,a)};
2022 t.jr=function(a){void 0!==a.nodeParentKeyProperty&&a.nodeParentKeyProperty!==this.nodeParentKeyProperty&&v("applyIncrementalJson cannot change Model properties");X.prototype.jr.call(this,a)};t.Um=function(a){return a};t.Xh=function(a){if(null!==a){var b=this.Le;if(""!==b&&(b=Mn(a,b),void 0!==b)){if(lr(b))return b;v("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
2023 t.ne=function(a,b){null===b&&(b=void 0);void 0===b||lr(b)||ya(b,"number or string",Xr,"setParentKeyForNodeData:key");if(null!==a){var c=this.Le;if(""!==c)if(b=this.Um(b),this.$a(a)){var d=Mn(a,c);d!==b&&(pr(this,d,a),ik(a,c,b),null===this.Qb(b)&&qr(this,b,a),Mr(this,"nodeParentKey",Ce,c,a,d,b),"string"===typeof c&&this.Ia(a,c))}else ik(a,c,b)}};
2024 t.au=function(a){if(null===a)return"";var b=this.lk;if(""===b)return"";b=Mn(a,b);if(void 0===b)return"";if("string"===typeof b)return b;v("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};Xr.prototype.getLinkCategoryForData=function(a){return this.au(a)};
2025 Xr.prototype.xu=function(a,b){A(b,"string",Xr,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.lk;if(""!==c)if(this.$a(a)){var d=Mn(a,c);void 0===d&&(d="");d!==b&&(ik(a,c,b),Mr(this,"parentLinkCategory",Ce,c,a,d,b),"string"===typeof c&&this.Ia(a,c))}else ik(a,c,b)}};Xr.prototype.setLinkCategoryForData=function(a,b){this.xu(a,b)};
2026 Xr.prototype.copyNodeData=function(a){if(null===a)return null;a=X.prototype.copyNodeData.call(this,a);this.Ek||""===this.Le||void 0===Mn(a,this.Le)||ik(a,this.Le,void 0);return a};
2027 Xr.prototype.setDataProperty=function(a,b,c){F&&(A(a,"object",Xr,"setDataProperty:data"),A(b,"string",Xr,"setDataProperty:propname"),""===b&&v("TreeModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.$a(a)){if(b===this.nodeKeyProperty){this.jn(a,c);return}if(b===this.nodeCategoryProperty){this.hn(a,c);return}if(b===this.nodeParentKeyProperty){this.ne(a,c);return}}var d=Mn(a,b);d!==c&&(ik(a,b,c),this.qu(a,b,d,c))};t=Xr.prototype;
2028 t.pr=function(a,b){X.prototype.pr.call(this,a,b);for(var c=this.bb.iterator;c.next();)this.Jw(c.value,a,b)};t.Jw=function(a,b,c){if(this.Xh(a)===b){var d=this.Le;ik(a,d,c);Mr(this,"nodeParentKey",Ce,d,a,b,c);"string"===typeof d&&this.Ia(a,d)}};
2029 t.dn=function(a){X.prototype.dn.call(this,a);a=this.pa(a);var b=or(this,a);if(null!==b){var c=Ma();for(b=b.iterator;b.next();){var d=b.value;if(this.$a(d)&&this.Xh(d)===a){var e=this.Le;Mr(this,"nodeParentKey",Ce,e,d,a,a);"string"===typeof e&&this.Ia(d,e);c.push(d)}}for(b=0;b<c.length;b++)pr(this,a,c[b]);Oa(c)}};t.cn=function(a){X.prototype.cn.call(this,a);var b=this.Xh(a);b=this.Um(b);null===this.Qb(b)&&qr(this,b,a)};t.wr=function(a){X.prototype.wr.call(this,a);var b=this.Xh(a);pr(this,b,a)};
2030 t.kn=function(a,b){X.prototype.kn.call(this,a,b);this.xu(b,this.au(a));this.ne(b,this.Xh(a))};t.Sm=function(){return!0};t.hu=function(){return!0};
2031 na.Object.defineProperties(Xr.prototype,{nodeParentKeyProperty:{configurable:!0,get:function(){return this.Le},set:function(a){var b=this.Le;b!==a&&(Nr(a,Xr,"nodeParentKeyProperty"),this.Le=a,this.g("nodeParentKeyProperty",b,a))}},Ek:{configurable:!0,get:function(){return this.Tn},set:function(a){this.Tn!==a&&(A(a,"boolean",Xr,"copiesParentKeyOfNodeData"),this.Tn=a)}},parentLinkCategoryProperty:{configurable:!0,get:function(){return this.lk},set:function(a){var b=
2032 this.lk;b!==a&&(Nr(a,Xr,"parentLinkCategoryProperty"),this.lk=a,this.g("parentLinkCategoryProperty",b,a))}},linkCategoryProperty:{configurable:!0,get:function(){return this.parentLinkCategoryProperty},set:function(a){this.parentLinkCategoryProperty=a}},type:{configurable:!0,get:function(){return"TreeModel"}}});Xr.prototype.setParentLinkCategoryForNodeData=Xr.prototype.xu;Xr.prototype.getParentLinkCategoryForNodeData=Xr.prototype.au;
2033 Xr.prototype.setParentKeyForNodeData=Xr.prototype.ne;Xr.prototype.getParentKeyForNodeData=Xr.prototype.Xh;Xr.className="TreeModel";Qr.TreeModel=Xr;function Yr(){0<arguments.length&&Ba(Yr);Ni.call(this);this.Lx=this.io=this.fc=0;this.js=360;this.Kx=Zr;this.Uj=0;this.Bx=new J;this.Ur=this.je=0;this.Ht=new $r;this.Ou=this.kk=0;this.xz=600;this.Np=NaN;this.Cn=1;this.pq=0;this.zm=360;this.Kb=Zr;this.N=as;this.hd=bs;this.bd=Nq;this.yf=6;this.xp=cs}ma(Yr,Ni);
2034 Yr.prototype.cloneProtected=function(a){Ni.prototype.cloneProtected.call(this,a);a.Np=this.Np;a.Cn=this.Cn;a.pq=this.pq;a.zm=this.zm;a.Kb=this.Kb;a.N=this.N;a.hd=this.hd;a.bd=this.bd;a.yf=this.yf;a.xp=this.xp};
2035 Yr.prototype.pb=function(a){if(a.classType===Yr)if(a===ds||a===es||a===fs||a===gs||a===bs)this.sorting=a;else if(a===hs||a===is||a===as||a===js)this.direction=a;else if(a===ks||a===ls||a===Zr||a===ms)this.arrangement=a;else{if(a===ns||a===cs)this.nodeDiameterFormula=a}else Ni.prototype.pb.call(this,a)};Yr.prototype.createNetwork=function(){return new os(this)};
2036 Yr.prototype.doLayout=function(a){F&&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.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);a=this.network.vertexes;if(1>=a.count)1===a.count&&(a=a.first(),a.centerX=0,a.centerY=0);else{var b=new H;b.addAll(a.iterator);a=new H;var c=new H;var d=this.sort(b);var e,f,g=this.Ur;var h=this.arrangement;var k=this.nodeDiameterFormula;
2037 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)||360<p||1>p)p=360;b=this.spacing;isFinite(b)||(b=NaN);h===ms&&k===ns?h=Zr:h===ms&&k!==ns&&(h=this.arrangement);if((this.direction===hs||this.direction===is)&&this.sorting!==bs){for(k=0;!(k>=d.length);k+=2){a.add(d.M(k));if(k+1>=d.length)break;c.add(d.M(k+1))}this.direction===hs?(this.arrangement===ms&&a.reverse(),d=new H,d.addAll(a),
2038 d.addAll(c)):(this.arrangement===ms&&c.reverse(),d=new H,d.addAll(c),d.addAll(a))}k=d.length;for(var r=f=e=0;r<d.length;r++){var q=n+p*f*(this.direction===as?1:-1)/k,u=d.M(r).diameter;isNaN(u)&&(u=ps(d.M(r),q));360>p&&(0===r||r===d.length-1)&&(u/=2);e+=u;f++}if(isNaN(l)||h===ms){isNaN(b)&&(b=6);if(h!==Zr&&h!==ms){f=-Infinity;for(g=0;g<k;g++)r=d.M(g),e=d.M(g===k-1?0:g+1),isNaN(r.diameter)&&ps(r,0),isNaN(e.diameter)&&ps(e,0),f=Math.max(f,(r.diameter+e.diameter)/2);g=f+b;h===ks?l=(f+b)/(2*Math.PI/k):
2039 l=qs(this,g*(360<=p?k:k-1),m,n*Math.PI/180,p*Math.PI/180)}else l=qs(this,e+(360<=p?k:k-1)*(h!==ms?b:1.6*b),m,n*Math.PI/180,p*Math.PI/180);f=l*m}else if(f=l*m,r=rs(this,l,f,n*Math.PI/180,p*Math.PI/180),isNaN(b)){if(h===Zr||h===ms)b=(r-e)/(360<=p?k:k-1)}else if(h===Zr||h===ms)r=(r-e)/(360<=p?k:k-1),r<b?(l=qs(this,e+b*(360<=p?k:k-1),m,n*Math.PI/180,p*Math.PI/180),f=l*m):b=r;else{g=-Infinity;for(e=0;e<k;e++)q=d.M(e),u=d.M(e===k-1?0:e+1),isNaN(q.diameter)&&ps(q,0),isNaN(u.diameter)&&ps(u,0),g=Math.max(g,
2040 (q.diameter+u.diameter)/2);g+=b;e=qs(this,g*(360<=p?k:k-1),m,n*Math.PI/180,p*Math.PI/180);e>l?(l=e,f=l*m):g=r/(360<=p?k:k-1)}this.Kx=h;this.fc=l;this.io=m;this.Lx=n;this.js=p;this.Uj=b;this.je=f;this.Ur=g;b=d;d=this.Kx;h=this.fc;l=this.Lx;m=this.js;n=this.Uj;p=this.je;k=this.Ur;if(this.direction!==hs&&this.direction!==is||d!==ms)if(this.direction===hs||this.direction===is){g=0;switch(d){case ls:g=180*ss(this,h,p,l,k)/Math.PI;break;case Zr:k=b=0;g=a.first();null!==g&&(b=ps(g,Math.PI/2));g=c.first();
2041 null!==g&&(k=ps(g,Math.PI/2));g=180*ss(this,h,p,l,n+(b+k)/2)/Math.PI;break;case ks:g=m/b.length}if(this.direction===hs){switch(d){case ls:ts(this,a,l,js);break;case Zr:us(this,a,l,js);break;case ks:vs(this,a,m/2,l,js)}switch(d){case ls:ts(this,c,l+g,as);break;case Zr:us(this,c,l+g,as);break;case ks:vs(this,c,m/2,l+g,as)}}else{switch(d){case ls:ts(this,c,l,js);break;case Zr:us(this,c,l,js);break;case ks:vs(this,c,m/2,l,js)}switch(d){case ls:ts(this,a,l+g,as);break;case Zr:us(this,a,l+g,as);break;case ks:vs(this,
2042 a,m/2,l+g,as)}}}else switch(d){case ls:ts(this,b,l,this.direction);break;case Zr:us(this,b,l,this.direction);break;case ks:vs(this,b,m,l,this.direction);break;case ms:ws(this,b,m,l,this.direction)}else ws(this,b,m,l-m/2,as)}this.updateParts();this.network=null;this.isValidLayout=!0};
2043 function vs(a,b,c,d,e){var f=a.js,g=a.fc;a=a.je;d=d*Math.PI/180;c=c*Math.PI/180;for(var h=b.length,k=0;k<h;k++){var l=d+(e===as?k*c/(360<=f?h:h-1):-(k*c)/h),m=b.M(k),n=g*Math.tan(l)/a;n=Math.sqrt((g*g+a*a*n*n)/(1+n*n));m.centerX=n*Math.cos(l);m.centerY=n*Math.sin(l);m.actualAngle=180*l/Math.PI}}
2044 function us(a,b,c,d){var e=a.fc,f=a.je,g=a.Uj;c=c*Math.PI/180;for(var h=b.length,k=0;k<h;k++){var l=b.M(k),m=b.M(k===h-1?0:k+1),n=f*Math.sin(c);l.centerX=e*Math.cos(c);l.centerY=n;l.actualAngle=180*c/Math.PI;isNaN(l.diameter)&&ps(l,0);isNaN(m.diameter)&&ps(m,0);l=ss(a,e,f,d===as?c:-c,(l.diameter+m.diameter)/2+g);c+=d===as?l:-l}}
2045 function ts(a,b,c,d){var e=a.fc,f=a.je,g=a.Ur;c=c*Math.PI/180;for(var h=b.length,k=0;k<h;k++){var l=b.M(k);l.centerX=e*Math.cos(c);l.centerY=f*Math.sin(c);l.actualAngle=180*c/Math.PI;l=ss(a,e,f,d===as?c:-c,g);c+=d===as?l:-l}}function ws(a,b,c,d,e){var f=a.js;a.kk=0;a.Ht=new $r;if(360>c){for(f=d+(e===as?f:-f);0>f;)f+=360;f%=360;180<f&&(f-=360);f*=Math.PI/180;a.Ou=f;xs(a,b,c,d,e)}else ys(a,b,c,d,e);a.Ht.commit(b)}
2046 function ys(a,b,c,d,e){var f=a.fc,g=a.Uj,h=a.io,k=f*Math.cos(d*Math.PI/180),l=a.je*Math.sin(d*Math.PI/180),m=b.ta();if(3===m.length)m[0].centerX=f,m[0].centerY=0,m[1].centerX=m[0].centerX-m[0].width/2-m[1].width/2-g,m[1].y=m[0].y,m[2].centerX=(m[0].centerX+m[1].centerX)/2,m[2].y=m[0].y-m[2].height-g;else if(4===m.length)m[0].centerX=f,m[0].centerY=0,m[2].centerX=-m[0].centerX,m[2].centerY=m[0].centerY,m[1].centerX=0,m[1].y=Math.min(m[0].y,m[2].y)-m[1].height-g,m[3].centerX=0,m[3].y=Math.max(m[0].y+
2047 m[0].height+g,m[2].y+m[2].height+g);else{f=J.alloc();for(var n=0;n<m.length;n++){m[n].centerX=k;m[n].centerY=l;if(n>=m.length-1)break;zs(a,k,l,m,n,e,f)||As(a,k,l,m,n,e,f);k=f.x;l=f.y}J.free(f);a.kk++;if(!(23<a.kk)){k=m[0].centerX;l=m[0].centerY;f=m[m.length-1].centerX;n=m[m.length-1].centerY;var p=Math.abs(k-f)-((m[0].width+m[m.length-1].width)/2+g),r=Math.abs(l-n)-((m[0].height+m[m.length-1].height)/2+g);g=0;1>Math.abs(r)?Math.abs(k-f)<(m[0].width+m[m.length-1].width)/2&&(g=0):g=0<r?r:1>Math.abs(p)?
2048 0:p;k=Math.abs(f)>Math.abs(n)?0<f!==l>n:0<n!==k<f;if(k=e===as?k:!k)g=-Math.abs(g),g=Math.min(g,-m[m.length-1].width),g=Math.min(g,-m[m.length-1].height);a.Ht.compare(g,m);1<Math.abs(g)&&(a.fc=8>a.kk?a.fc-g/(2*Math.PI):5>m.length&&10<g?a.fc/2:a.fc-(0<g?1.7:-2.3),a.je=a.fc*h,ys(a,b,c,d,e))}}}
2049 function xs(a,b,c,d,e){for(var f=a.fc,g=a.je,h=a.io,k=f*Math.cos(d*Math.PI/180),l=g*Math.sin(d*Math.PI/180),m=J.alloc(),n=b.ta(),p=0;p<n.length;p++){n[p].centerX=k;n[p].centerY=l;if(p>=n.length-1)break;zs(a,k,l,n,p,e,m)||As(a,k,l,n,p,e,m);k=m.x;l=m.y}J.free(m);a.kk++;if(!(23<a.kk)){k=Math.atan2(l,k);k=e===as?a.Ou-k:k-a.Ou;k=Math.abs(k)<Math.abs(k-2*Math.PI)?k:k-2*Math.PI;f=k*(f+g)/2;g=a.Ht;if(Math.abs(f)<Math.abs(g.Om))for(g.Om=f,g.hl=[],g.qn=[],k=0;k<n.length;k++)g.hl[k]=n[k].bounds.x,g.qn[k]=n[k].bounds.y;
2050 1<Math.abs(f)&&(a.fc=8>a.kk?a.fc-f/(2*Math.PI):a.fc-(0<f?1.7:-2.3),a.je=a.fc*h,xs(a,b,c,d,e))}}function zs(a,b,c,d,e,f,g){var h=a.fc,k=a.je,l=0;a=(d[e].width+d[e+1].width)/2+a.Uj;var m=!1;if(0<=c!==(f===as)){if(f=b+a,f>h){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}
2051 function As(a,b,c,d,e,f,g){var h=a.fc,k=a.je,l=0;a=(d[e].height+d[e+1].height)/2+a.Uj;d=!1;if(0<=b!==(f===as)){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}Yr.prototype.commitLayout=function(){this.commitNodes();this.isRouting&&this.commitLinks()};
2052 Yr.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 J(0,0):(c.x=this.arrangementOrigin.x+this.fc,c.y=this.arrangementOrigin.y+this.je);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.Ya(),a=this.group.position.copy(),c=this.group.location.copy(),b=b.oe(c.oe(a)),this.group.move(b),this.Bx=b.oe(a))};
2053 Yr.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};function rs(a,b,c,d,e){var f=a.xz;if(.001>Math.abs(a.io-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}
2054 function qs(a,b,c,d,e){return b/(void 0!==d&&void 0!==e?rs(a,1,c,d,e):rs(a,1,c))}function ss(a,b,c,d,e){if(.001>Math.abs(a.io-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}}
2055 Yr.prototype.sort=function(a){switch(this.sorting){case fs:break;case gs:a.reverse();break;case ds:a.sort(this.comparer);break;case es:a.sort(this.comparer);a.reverse();break;case bs:return this.Bw(Bs(a));default:v("Invalid sorting type.")}return a};
2056 function Bs(a){for(var b=[],c=0;c<a.length;c++)b.push(0);c=new H;for(var d=0;d<a.length;d++){var e=-1,f=-1;if(0===d)for(var g=0;g<a.length;g++){var h=a.M(g).edgesCount;h>e&&(e=h,f=g)}else for(g=0;g<a.length;g++)h=b[g],h>e&&(e=h,f=g);c.add(a.M(f));b[f]=-1;f=a.M(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}
2057 Yr.prototype.Bw=function(a){for(var b=[],c=0;c<a.length;c++){var d=a.M(c);b[c]=[];for(var e,f=d.destinationEdges;f.next();)e=a.indexOf(f.value.toVertex),e!==c&&0>b[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;c<b.length;c++)f[c]=0;c=[];var g=[],h=[];d=[];e=new H;for(var k=0,l=0;l<b.length;l++){var m=b[l].length;if(1===m)d.push(l);else if(0===m)e.add(a.M(l));else{if(0===k)c.push(l);else{for(var n=m=Infinity,
2058 p=-1,r=[],q=0;q<c.length;q++)0>b[c[q]].indexOf(c[q===c.length-1?0:q+1])&&r.push(q===c.length-1?0:q+1);if(0===r.length)for(q=0;q<c.length;q++)r.push(q);for(q=0;q<r.length;q++){for(var u=r[q],y=b[l],x=0,z=0;z<g.length;z++){var B=f[g[z]],D=f[h[z]];if(B<D){var G=B;B=D}else G=D;if(G<u&&u<=B)for(D=0;D<y.length;D++){var M=y[D];0>c.indexOf(M)||G<f[M]&&f[M]<B||G===f[M]||B===f[M]||x++}else for(D=0;D<y.length;D++)M=y[D],0>c.indexOf(M)||G<f[M]&&f[M]<B&&G!==f[M]&&B!==f[M]&&x++}y=x;for(z=x=0;z<b[l].length;z++)G=
2059 c.indexOf(b[l][z]),0<=G&&(G=Math.abs(u-(G>=u?G+1:G)),x+=G<c.length+1-G?G:c.length+1-G);for(z=0;z<g.length;z++)G=f[g[z]],B=f[h[z]],G>=u&&G++,B>=u&&B++,G>B&&(D=B,B=G,G=D),B-G<(c.length+2)/2===(G<u&&u<=B)&&x++;if(y<m||y===m&&x<n)m=y,n=x,p=u}c.splice(p,0,l);for(m=0;m<c.length;m++)f[c[m]]=m;for(m=0;m<b[l].length;m++)n=b[l][m],0<=c.indexOf(n)&&(g.push(l),h.push(n))}k++}}for(g=c.length;;){f=!0;for(h=0;h<d.length;h++)if(k=d[h],l=b[k][0],m=c.indexOf(l),0<=m){for(p=n=0;p<b[l].length;p++)r=c.indexOf(b[l][p]),
2060 0>r||r===m||(q=r>m?r-m:m-r,n+=r<m!==q>g-q?1:-1);c.splice(0>n?m:m+1,0,k);d.splice(h,1);h--}else f=!1;if(f)break;else c.push(d[0]),d.splice(0,1)}for(b=0;b<c.length;b++)e.add(a.M(c[b]));return e};
2061 na.Object.defineProperties(Yr.prototype,{radius:{configurable:!0,get:function(){return this.Np},set:function(a){this.Np!==a&&(A(a,"number",Yr,"radius"),0<a||isNaN(a))&&(this.Np=a,this.D())}},aspectRatio:{configurable:!0,get:function(){return this.Cn},set:function(a){this.Cn!==a&&(A(a,"number",Yr,"aspectRatio"),0<a&&(this.Cn=a,this.D()))}},startAngle:{configurable:!0,get:function(){return this.pq},set:function(a){this.pq!==a&&(A(a,"number",Yr,"startAngle"),
2062 this.pq=a,this.D())}},sweepAngle:{configurable:!0,get:function(){return this.zm},set:function(a){this.zm!==a&&(A(a,"number",Yr,"sweepAngle"),0<a&&360>=a?this.zm=a:this.zm=360,this.D())}},arrangement:{configurable:!0,get:function(){return this.Kb},set:function(a){this.Kb!==a&&(gb(a,Yr,Yr,"arrangement"),a===ms||a===Zr||a===ls||a===ks)&&(this.Kb=a,this.D())}},direction:{configurable:!0,get:function(){return this.N},set:function(a){this.N!==a&&(gb(a,Yr,Yr,"direction"),
2063 a===as||a===js||a===hs||a===is)&&(this.N=a,this.D())}},sorting:{configurable:!0,get:function(){return this.hd},set:function(a){this.hd!==a&&(gb(a,Yr,Yr,"sorting"),a===fs||a===gs||a===ds||es||a===bs)&&(this.hd=a,this.D())}},comparer:{configurable:!0,get:function(){return this.bd},set:function(a){this.bd!==a&&(A(a,"function",Yr,"comparer"),this.bd=a,this.D())}},spacing:{configurable:!0,get:function(){return this.yf},set:function(a){this.yf!==a&&(A(a,"number",
2064 Yr,"spacing"),this.yf=a,this.D())}},nodeDiameterFormula:{configurable:!0,get:function(){return this.xp},set:function(a){this.xp!==a&&(gb(a,Yr,Yr,"nodeDiameterFormula"),a===cs||a===ns)&&(this.xp=a,this.D())}},actualXRadius:{configurable:!0,get:function(){return this.fc}},actualYRadius:{configurable:!0,get:function(){return this.je}},actualSpacing:{configurable:!0,get:function(){return this.Uj}},actualCenter:{configurable:!0,get:function(){return this.Bx}}});
2065 var Zr=new E(Yr,"ConstantSpacing",0),ls=new E(Yr,"ConstantDistance",1),ks=new E(Yr,"ConstantAngle",2),ms=new E(Yr,"Packed",3),as=new E(Yr,"Clockwise",4),js=new E(Yr,"Counterclockwise",5),hs=new E(Yr,"BidirectionalLeft",6),is=new E(Yr,"BidirectionalRight",7),fs=new E(Yr,"Forwards",8),gs=new E(Yr,"Reverse",9),ds=new E(Yr,"Ascending",10),es=new E(Yr,"Descending",11),bs=new E(Yr,"Optimized",12),cs=new E(Yr,"Pythagorean",13),ns=new E(Yr,"Circular",14);Yr.className="CircularLayout";Yr.ConstantSpacing=Zr;
2066 Yr.ConstantDistance=ls;Yr.ConstantAngle=ks;Yr.Packed=ms;Yr.Clockwise=as;Yr.Counterclockwise=js;Yr.BidirectionalLeft=hs;Yr.BidirectionalRight=is;Yr.Forwards=fs;Yr.Reverse=gs;Yr.Ascending=ds;Yr.Descending=es;Yr.Optimized=bs;Yr.Pythagorean=cs;Yr.Circular=ns;function $r(){this.Om=-Infinity;this.qn=this.hl=null}
2067 $r.prototype.compare=function(a,b){if(0<a&&0>this.Om||Math.abs(a)<Math.abs(this.Om)&&!(0>a&&0<this.Om))for(this.Om=a,this.hl=[],this.qn=[],a=0;a<b.length;a++)this.hl[a]=b[a].bounds.x,this.qn[a]=b[a].bounds.y};$r.prototype.commit=function(a){if(null!==this.hl&&null!==this.qn)for(var b=0;b<this.hl.length;b++){var c=a.M(b);c.x=this.hl[b];c.y=this.qn[b]}};$r.className="VertexArrangement";function os(a){sq.call(this,a)}ma(os,sq);os.prototype.createVertex=function(){return new Cs(this)};
2068 os.prototype.createEdge=function(){return new Ds(this)};os.className="CircularNetwork";function Cs(a){Gq.call(this,a);this.L=this.Sj=NaN}ma(Cs,Gq);
2069 function ps(a,b){var c=a.network;if(null===c)return NaN;c=c.layout;if(null===c)return NaN;if(c.arrangement===ms)if(c.nodeDiameterFormula===ns)a.Sj=Math.max(a.width,a.height);else{c=Math.abs(Math.sin(b));b=Math.abs(Math.cos(b));if(0===c)return a.width;if(0===b)return a.height;a.Sj=Math.min(a.height/c,a.width/b)}else a.Sj=c.nodeDiameterFormula===ns?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.Sj}
2070 na.Object.defineProperties(Cs.prototype,{diameter:{configurable:!0,get:function(){return this.Sj},set:function(a){this.Sj!==a&&(A(a,"number",Cs,"diameter"),this.Sj=a)}},actualAngle:{configurable:!0,get:function(){return this.L},set:function(a){this.L!==a&&(A(a,"number",Cs,"actualAngle"),this.L=a)}}});Cs.className="CircularVertex";function Ds(a){Hq.call(this,a)}ma(Ds,Hq);Ds.className="CircularEdge";
2071 function Es(){0<arguments.length&&Ba(Es);Ni.call(this);this.Qh=null;this.Ro=0;this.Vd=(new Fb(100,100)).freeze();this.Bn=!1;this.xf=!0;this.pd=!1;this.dm=100;this.lo=1;this.ig=1E3;this.pp=10;this.Op=Math;this.Al=.05;this.zl=50;this.xl=150;this.yl=0;this.ao=10;this.$n=5}ma(Es,Ni);
2072 Es.prototype.cloneProtected=function(a){Ni.prototype.cloneProtected.call(this,a);a.Vd.assign(this.Vd);a.Bn=this.Bn;a.xf=this.xf;a.pd=this.pd;a.dm=this.dm;a.lo=this.lo;a.ig=this.ig;a.pp=this.pp;a.Op=this.Op;a.Al=this.Al;a.zl=this.zl;a.xl=this.xl;a.yl=this.yl;a.ao=this.ao;a.$n=this.$n};
2073 Es.prototype.serializeLayoutProperties=function(a,b){Ni.prototype.serializeLayoutProperties.call(this,a,b);a.arrangementSpacing={width:this.arrangementSpacing.width,height:this.arrangementSpacing.height};a.arrangesToOrigin=this.arrangesToOrigin;a.setsPortSpots=this.setsPortSpots;a.comments=this.comments;a.maxIterations=this.maxIterations;a.epsilonDistance=this.epsilonDistance;a.infinityDistance=this.infinityDistance;a.moveLimit=this.moveLimit;a.defaultSpringStiffness=this.defaultSpringStiffness;a.defaultSpringLength=
2074 this.defaultSpringLength;a.defaultElectricalCharge=this.defaultElectricalCharge;a.defaultGravitationalMass=this.defaultGravitationalMass;a.defaultCommentSpringLength=this.defaultCommentSpringLength;a.defaultCommentElectricalCharge=this.defaultCommentElectricalCharge};
2075 Es.prototype.deserializeLayoutProperties=function(a,b,c,d,e){Ni.prototype.deserializeLayoutProperties.call(this,a,b,c,d,e);this.arrangementSpacing=new Fb(a.arrangementSpacing.width,a.arrangementSpacing.height);this.arrangesToOrigin=a.arrangesToOrigin;this.setsPortSpots=a.setsPortSpots;this.comments=a.comments;this.maxIterations=a.maxIterations;this.epsilonDistance=a.epsilonDistance;this.infinityDistance=a.infinityDistance;this.moveLimit=a.moveLimit;this.defaultSpringStiffness=a.defaultSpringStiffness;
2076 this.defaultSpringLength=a.defaultSpringLength;this.defaultElectricalCharge=a.defaultElectricalCharge;this.defaultGravitationalMass=a.defaultGravitationalMass;this.defaultCommentSpringLength=a.defaultCommentSpringLength;this.defaultCommentElectricalCharge=a.defaultCommentElectricalCharge};Es.prototype.createNetwork=function(){return new Fs(this)};
2077 Es.prototype.doLayout=function(a){F&&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));if(!this.kx()){a=this.maxIterations;if(0<this.network.vertexes.count){this.network.Oq();for(var b=this.network.vertexes.iterator;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.iterator;b.next();)c=b.value,c.stiffness=this.springStiffness(c),
2078 c.length=this.springLength(c);this.Sv();this.Ro=0;if(this.needsClusterLayout()){b=this.network;c=b.mz();for(var d=c.iterator;d.next();){this.network=d.value;for(var e=this.network.vertexes.iterator;e.next();){var f=e.value;f.Rd=f.vertexes.count;f.ci=1;f.Ck=null;f.$e=null}Gs(this,0,a)}this.network=b;var g=d=c.iterator;F&&w(b,Fs,Es,"arrangeConnectedGraphs:singletons");d=this.arrangementSpacing;var h=g.count,k=!0;f=e=0;for(var l=Ma(),m=0;m<h+b.vertexes.count+2;m++)l[m]=null;h=0;g.reset();for(var n=L.alloc();g.next();)if(m=
2079 g.value,this.computeBounds(m,n),k)k=!1,e=n.x+n.width/2,f=n.y+n.height/2,l[0]=new J(n.x+n.width+d.width,n.y),l[1]=new J(n.x,n.y+n.height+d.height),h=2;else{var p=Hs(l,h,e,f,n.width,n.height,d),r=l[p],q=new J(r.x+n.width+d.width,r.y),u=new J(r.x,r.y+n.height+d.height);p+1<h&&l.splice(p+1,0,null);l[p]=q;l[p+1]=u;h++;p=r.x-n.x;r=r.y-n.y;for(m=m.vertexes.iterator;m.next();)q=m.value,q.centerX+=p,q.centerY+=r}L.free(n);for(m=b.vertexes.iterator;m.next();)g=m.value,p=g.bounds,2>h?(e=p.x+p.width/2,f=p.y+
2080 p.height/2,l[0]=new J(p.x+p.width+d.width,p.y),l[1]=new J(p.x,p.y+p.height+d.height),h=2):(k=Hs(l,h,e,f,p.width,p.height,d),n=l[k],r=new J(n.x+p.width+d.width,n.y),p=new J(n.x,n.y+p.height+d.height),k+1<h&&l.splice(k+1,0,null),l[k]=r,l[k+1]=p,h++,g.centerX=n.x+g.width/2,g.centerY=n.y+g.height/2);Oa(l);for(d=c.iterator;d.next();){c=d.value;for(e=c.vertexes.iterator;e.next();)b.Ng(e.value);for(c=c.edges.iterator;c.next();)b.Gm(c.value)}}Is(this,a);this.updateParts()}this.dm=a;this.network=null;this.isValidLayout=
2081 !0}};Es.prototype.needsClusterLayout=function(){if(3>this.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.Sc(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};Es.prototype.computeBounds=function(a,b){var c=!0;for(a=a.vertexes.iterator;a.next();){var d=a.value;c?(c=!1,b.set(d.bounds)):b.Xc(d.bounds)}return b};
2082 function Js(a,b,c){F&&(C(b,Es,"computeClusterLayoutIterations:level"),C(c,Es,"computeClusterLayoutIterations:maxiter"));return Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10)}
2083 function Gs(a,b,c){F&&(C(b,Es,"layoutClusters:level"),C(c,Es,"layoutClusters:maxiter"));if(Ks(a,b)){var d=a.ig;a.ig*=1+1/(b+1);var e=Ls(a,b),f=Math.max(0,Js(a,b,c));a.maxIterations+=f;Gs(a,b+1,c);Is(a,f);Ms(a,e,b);c=e.vertexes.ta();c.sort(function(a,b){return null===a||null===b||a===b?0:b.Rd-a.Rd});for(e=0;e<c.length;e++)Ns(a,c[e],b);a.ig=d}}
2084 function Ks(a,b){F&&C(b,Es,"hasClusters:level");if(10<b||3>a.network.vertexes.count)return!1;a.Qh=a.network.vertexes.ta();a=a.Qh;a.sort(function(a,b){return null===a||null===b||a===b?0:b.Rd-a.Rd});for(b=a.length-1;0<=b&&1>=a[b].Rd;)b--;return 1<a.length-b}
2085 function Ls(a,b){F&&C(b,Es,"pushSubNetwork:level");for(var c=a.network,d=new Fs(a),e=0;e<a.Qh.length;e++){var f=a.Qh[e];if(1<f.Rd){d.Ng(f);var g=new Os;g.Du=f.Rd;g.Eu=f.width;g.Cu=f.height;g.qx=f.focus.x;g.sx=f.focus.y;null===f.$e&&(f.$e=new H);f.$e.add(g);f.Nw=f.$e.count-1}else break}for(f=c.edges.iterator;f.next();){var h=f.value;e=h.fromVertex;g=h.toVertex;e.network===d&&g.network===d?d.Gm(h):e.network===d?(h=e.Ck,null===h&&(h=new H,e.Ck=h),h.add(g),e.Rd--,e.ci+=g.ci):g.network===d&&(h=g.Ck,null===
2086 h&&(h=new H,g.Ck=h),h.add(e),g.Rd--,g.ci+=e.ci)}for(e=d.edges.iterator;e.next();)f=e.value,f.length*=Math.max(1,K.sqrt((f.fromVertex.ci+f.toVertex.ci)/(4*b+1)));for(b=d.vertexes.iterator;b.next();){e=b.value;var k=e.Ck;if(null!==k&&0<k.count&&(g=e.$e.M(e.$e.count-1).Du-e.Rd,!(0>=g))){for(var l=h=0,m=k.count-g;m<k.count;m++){var n=k.M(m),p=null;for(f=n.edges.iterator;f.next();){var r=f.value;if(r.Oy(n)===e){p=r;break}}null!==p&&(l+=p.length,h+=n.width*n.height)}f=e.centerX;k=e.centerY;m=e.width;n=
2087 e.height;p=e.focus;r=m*n;1>r&&(r=1);h=K.sqrt((h+r+l*l*4/(g*g))/r);g=(h-1)*m/2;h=(h-1)*n/2;e.bounds=new L(f-p.x-g,k-p.y-h,m+2*g,n+2*h);e.focus=new J(p.x+g,p.y+h)}}a.network=d;return c}
2088 function Ms(a,b,c){F&&(w(b,Fs,Es,"popNetwork:oldnet"),C(c,Es,"popNetwork:level"));for(c=a.network.vertexes.iterator;c.next();){var d=c.value;d.network=b;if(null!==d.$e){var e=d.$e.M(d.Nw);d.Rd=e.Du;var f=e.qx,g=e.sx;d.bounds=new L(d.centerX-f,d.centerY-g,e.Eu,e.Cu);d.focus=new J(f,g);d.Nw--}}for(c=a.network.edges.iterator;c.next();)c.value.network=b;a.network=b}
2089 function Ns(a,b,c){F&&(w(b,Ps,Es,"surroundNode:oldnet"),C(c,Es,"surroundNode:level"));var d=b.Ck;if(null!==d&&0!==d.count){c=b.centerX;var e=b.centerY,f=b.width,g=b.height;null!==b.$e&&0<b.$e.count&&(g=b.$e.M(0),f=g.Eu,g=g.Cu);f=K.sqrt(f*f+g*g)/2;for(var h=!1,k=g=0,l=0,m=b.vertexes.iterator;m.next();){var n=m.value;1>=n.Rd?k++:(h=!0,l++,g+=Math.atan2(b.centerY-n.centerY,b.centerX-n.centerX))}if(0!==k)for(0<l&&(g/=l),l=b=0,b=h?2*Math.PI/(k+1):2*Math.PI/k,0===k%2&&(l=b/2),1<d.count&&d.sort(function(a,
2090 b){return null===a||null===b||a===b?0:b.width*b.height-a.width*a.height}),h=0===k%2?0:1,d=d.iterator;d.next();)if(k=d.value,!(1<k.Rd||a.isFixed(k))){m=null;for(n=k.edges.iterator;n.next();){m=n.value;break}n=k.width;var p=k.height;n=K.sqrt(n*n+p*p)/2;m=f+m.length+n;n=g+(b*(h/2>>1)+l)*(0===h%2?1:-1);k.centerX=c+m*Math.cos(n);k.centerY=e+m*Math.sin(n);h++}}}
2091 function Hs(a,b,c,d,e,f,g){var h=9E19,k=-1,l=0;a:for(;l<b;l++){var m=a[l],n=m.x-c,p=m.y-d;n=n*n+p*p;if(n<h){for(p=l-1;0<=p;p--)if(a[p].y>m.y&&a[p].x-m.x<e+g.width)continue a;for(p=l+1;p<b;p++)if(a[p].x>m.x&&a[p].y-m.y<f+g.height)continue a;k=l;h=n}}return k}Es.prototype.Sv=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)};
2092 Es.prototype.addComments=function(a){var b=a.node;if(null!==b)for(b=b.gw();b.next();){var c=b.value;if("Comment"===c.category&&c.isVisible()){var d=this.network.vj(c);null===d&&(d=this.network.zk(c));d.charge=this.defaultCommentElectricalCharge;c=null;for(var e=d.destinationEdges;e.next();){var f=e.value;if(f.toVertex===a){c=f;break}}if(null===c)for(e=d.sourceEdges;e.next();)if(f=e.value,f.fromVertex===a){c=f;break}null===c&&(c=this.network.Qk(a,d,null));c.length=this.defaultCommentSpringLength}}};
2093 function Qs(a,b){F&&(w(a,Ps,Es,"getNodeDistance:vertexA"),w(b,Ps,Es,"getNodeDistance:vertexB"));var c=a.bounds,d=c.x;a=c.y;var e=c.width;c=c.height;var f=b.bounds,g=f.x;b=f.y;var h=f.width;f=f.height;return d+e<g?a>b+f?(c=d+e-g,a=a-b-f,K.sqrt(c*c+a*a)):a+c<b?(d=d+e-g,a=a+c-b,K.sqrt(d*d+a*a)):g-(d+e):d>g+h?a>b+f?(c=d-g-h,a=a-b-f,K.sqrt(c*c+a*a)):a+c<b?(d=d-g-h,a=a+c-b,K.sqrt(d*d+a*a)):d-(g+h):a>b+f?a-(b+f):a+c<b?b-(a+c):.1}
2094 function Is(a,b){F&&C(b,Es,"performIterations:num");a.Qh=null;for(b=a.Ro+b;a.Ro<b&&(a.Ro++,Rs(a)););a.Qh=null}
2095 function Rs(a){null===a.Qh&&(a.Qh=a.network.vertexes.ta());var b=a.Qh;if(0>=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;g<b.length;g++){var h=b[g];h.forceX=0;h.forceY=0;var k=h.centerX;h=h.centerY;d=Math.min(d,k);e=Math.max(e,k);c=Math.min(c,h);f=Math.max(f,h)}(e=e-d>f-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.ig;var l=d=h=0;for(f=
2096 0;f<b.length;f++){g=b[f];d=g.bounds;h=g.focus;k=d.x+h.x;var m=d.y+h.y;d=g.charge*a.electricalFieldX(k,m);l=g.charge*a.electricalFieldY(k,m);d+=g.mass*a.gravitationalFieldX(k,m);l+=g.mass*a.gravitationalFieldY(k,m);g.forceX+=d;g.forceY+=l;for(var n=f+1;n<b.length;n++){var p=b[n];if(p!==g){d=p.bounds;h=p.focus;l=d.x+h.x;var r=d.y+h.y;if(k-l>c||l-k>c){if(e)break}else if(m-r>c||r-m>c){if(!e)break}else{var q=Qs(g,p);1>q?(d=a.randomNumberGenerator,null===d&&(a.randomNumberGenerator=d=new Ss),q=d.random(),
2097 h=d.random(),k>l?(d=Math.abs(p.bounds.right-g.bounds.x),d=(1+d)*q):k<l?(d=Math.abs(p.bounds.x-g.bounds.right),d=-(1+d)*q):(d=Math.max(p.width,g.width),d=(1+d)*q-d/2),m>r?(l=Math.abs(p.bounds.bottom-g.bounds.y),l=(1+l)*h):k<l?(l=Math.abs(p.bounds.y-g.bounds.bottom),l=-(1+l)*h):(l=Math.max(p.height,g.height),l=(1+l)*h-l/2)):(h=-(g.charge*p.charge)/(q*q),d=(l-k)/q*h,l=(r-m)/q*h);g.forceX+=d;g.forceY+=l;p.forceX-=d;p.forceY-=l}}}}for(e=a.network.edges.iterator;e.next();)h=e.value,c=h.fromVertex,f=h.toVertex,
2098 g=c.bounds,k=c.focus,d=g.x+k.x,g=g.y+k.y,m=f.bounds,n=f.focus,k=m.x+n.x,m=m.y+n.y,n=Qs(c,f),1>n?(n=a.randomNumberGenerator,null===n&&(a.randomNumberGenerator=n=new Ss),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;e<b.length;e++)c=b[e],a.isFixed(c)?a.moveFixedVertex(c):d=Math.max(d,a.moveVertex(c)||
2099 0);return d>a.epsilonDistance*a.epsilonDistance}Es.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};Es.prototype.moveFixedVertex=function(){};Es.prototype.commitLayout=function(){this.Rw();this.commitNodes();this.isRouting&&this.commitLinks()};
2100 Es.prototype.Rw=function(){if(this.setsPortSpots)for(var a=this.network.edges.iterator;a.next();){var b=a.value.link;null!==b&&(b.fromSpot=fd,b.toSpot=fd)}};Es.prototype.commitNodes=function(){var a=0,b=0;if(this.arrangesToOrigin){var c=L.alloc();this.computeBounds(this.network,c);b=this.arrangementOrigin;a=b.x-c.x;b=b.y-c.y;L.free(c)}c=L.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()}L.free(c)};
2101 Es.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};Es.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Al:a};Es.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.zl:a};Es.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.xl:a};Es.prototype.electricalFieldX=function(){return 0};Es.prototype.electricalFieldY=function(){return 0};
2102 Es.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.yl:a};Es.prototype.gravitationalFieldX=function(){return 0};Es.prototype.gravitationalFieldY=function(){return 0};Es.prototype.isFixed=function(a){return a.isFixed};
2103 na.Object.defineProperties(Es.prototype,{currentIteration:{configurable:!0,get:function(){return this.Ro}},arrangementSpacing:{configurable:!0,get:function(){return this.Vd},set:function(a){w(a,Fb,Es,"arrangementSpacing");this.Vd.A(a)||(this.Vd.assign(a),this.D())}},arrangesToOrigin:{configurable:!0,get:function(){return this.Bn},set:function(a){this.Bn!==a&&(A(a,"boolean",Es,"arrangesToOrigin"),this.Bn=a,this.D())}},setsPortSpots:{configurable:!0,
2104 get:function(){return this.xf},set:function(a){this.xf!==a&&(A(a,"boolean",Es,"setsPortSpots"),this.xf=a,this.D())}},comments:{configurable:!0,get:function(){return this.pd},set:function(a){this.pd!==a&&(A(a,"boolean",Es,"comments"),this.pd=a,this.D())}},maxIterations:{configurable:!0,get:function(){return this.dm},set:function(a){this.dm!==a&&(A(a,"number",Es,"maxIterations"),0<=a&&(this.dm=a,this.D()))}},epsilonDistance:{configurable:!0,get:function(){return this.lo},
2105 set:function(a){this.lo!==a&&(A(a,"number",Es,"epsilonDistance"),0<a&&(this.lo=a,this.D()))}},infinityDistance:{configurable:!0,get:function(){return this.ig},set:function(a){this.ig!==a&&(A(a,"number",Es,"infinityDistance"),1<a&&(this.ig=a,this.D()))}},moveLimit:{configurable:!0,get:function(){return this.pp},set:function(a){this.pp!==a&&(A(a,"number",Es,"moveLimit"),1<a&&(this.pp=a,this.D()))}},randomNumberGenerator:{configurable:!0,get:function(){return this.Op},
2106 set:function(a){this.Op!==a&&(null!==a&&"function"!==typeof a.random&&v('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.Op=a)}},defaultSpringStiffness:{configurable:!0,get:function(){return this.Al},set:function(a){this.Al!==a&&(A(a,"number",Es,"defaultSpringStiffness"),this.Al=a,this.D())}},defaultSpringLength:{configurable:!0,get:function(){return this.zl},set:function(a){this.zl!==a&&(A(a,"number",Es,"defaultSpringLength"),
2107 this.zl=a,this.D())}},defaultElectricalCharge:{configurable:!0,get:function(){return this.xl},set:function(a){this.xl!==a&&(A(a,"number",Es,"defaultElectricalCharge"),this.xl=a,this.D())}},defaultGravitationalMass:{configurable:!0,get:function(){return this.yl},set:function(a){this.yl!==a&&(A(a,"number",Es,"defaultGravitationalMass"),this.yl=a,this.D())}},defaultCommentSpringLength:{configurable:!0,get:function(){return this.ao},set:function(a){this.ao!==
2108 a&&(A(a,"number",Es,"defaultCommentSpringLength"),this.ao=a,this.D())}},defaultCommentElectricalCharge:{configurable:!0,get:function(){return this.$n},set:function(a){this.$n!==a&&(A(a,"number",Es,"defaultCommentElectricalCharge"),this.$n=a,this.D())}}});Es.className="ForceDirectedLayout";function Os(){this.sx=this.qx=this.Cu=this.Eu=this.Du=0}Os.className="ForceDirectedSubnet";function Fs(a){sq.call(this,a)}ma(Fs,sq);Fs.prototype.createVertex=function(){return new Ps(this)};
2109 Fs.prototype.createEdge=function(){return new Ts(this)};Fs.className="ForceDirectedNetwork";function Ps(a){Gq.call(this,a);this.Qa=!1;this.kb=this.L=NaN;this.ci=this.Rd=this.Pa=this.W=0;this.$e=this.Ck=null;this.Nw=0}ma(Ps,Gq);Ps.prototype.serializeVertexProperties=function(a,b){Gq.prototype.serializeVertexProperties.call(this,a,b);a.isFixed=this.isFixed;a.charge=this.charge;a.mass=this.mass};
2110 Ps.prototype.Pq=function(a,b,c,d){Gq.prototype.Pq.call(this,a,b,c,d);this.isFixed=a.isFixed;this.charge=a.charge;this.mass=a.mass};
2111 na.Object.defineProperties(Ps.prototype,{isFixed:{configurable:!0,get:function(){return this.Qa},set:function(a){this.Qa!==a&&(A(a,"boolean",Ps,"isFixed"),this.Qa=a)}},charge:{configurable:!0,get:function(){return this.L},set:function(a){this.L!==a&&(A(a,"number",Ps,"charge"),this.L=a)}},mass:{configurable:!0,get:function(){return this.kb},set:function(a){this.kb!==a&&(A(a,"number",Ps,"mass"),this.kb=a)}},forceX:{configurable:!0,get:function(){return this.W},
2112 set:function(a){this.W!==a&&(A(a,"number",Ps,"forceX"),this.W=a)}},forceY:{configurable:!0,get:function(){return this.Pa},set:function(a){this.Pa!==a&&(A(a,"number",Ps,"forceY"),this.Pa=a)}}});Ps.className="ForceDirectedVertex";function Ts(a){Hq.call(this,a);this.l=this.w=NaN}ma(Ts,Hq);Ts.prototype.serializeEdgeProperties=function(a,b){Hq.prototype.serializeEdgeProperties.call(this,a,b);a.stiffness=this.stiffness;a.length=this.length};
2113 Ts.prototype.deserializeEdgeProperties=function(a,b,c,d){Hq.prototype.deserializeEdgeProperties.call(this,a,b,c,d);this.stiffness=a.stiffness;this.length=a.length};na.Object.defineProperties(Ts.prototype,{stiffness:{configurable:!0,get:function(){return this.w},set:function(a){this.w!==a&&(A(a,"number",Ts,"stiffness"),this.w=a)}},length:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(A(a,"number",Ts,"length"),this.l=a)}}});Ts.className="ForceDirectedEdge";
2114 function Ss(){var a=0;void 0===a&&(a=42);this.seed=a;this.oz=48271;this.qz=2147483647;this.Q=44488.07041494893;this.rz=3399;this.pz=1/2147483647;this.random()}Ss.prototype.random=function(){var a=this.seed%this.Q*this.oz-this.seed/this.Q*this.rz;0<a?this.seed=a:this.seed=a+this.qz;return this.seed*this.pz};Ss.className="RandomNumberGenerator";
2115 function Us(){0<arguments.length&&Ba(Us);Ni.call(this);this.ec=this.Ee=25;this.N=0;this.vl=Vs;this.Zl=Ws;this.Ol=Xs;this.ck=4;this.kl=Ys;this.zg=15;this.xf=!0;this.Zo=4;this.Ha=this.Ui=this.ya=-1;this.uc=this.yh=0;this.Na=this.Ed=this.Fd=this.fe=this.Eb=null;this.Ah=0;this.sp=this.hk=null;this.Kc=0;this.tp=null;this.ad=new J;this.Ie=[];this.Ie.length=100}ma(Us,Ni);
2116 Us.prototype.cloneProtected=function(a){Ni.prototype.cloneProtected.call(this,a);a.Ee=this.Ee;a.ec=this.ec;a.N=this.N;a.vl=this.vl;a.Zl=this.Zl;a.Ol=this.Ol;a.ck=this.ck;a.kl=this.kl;a.zg=this.zg;a.xf=this.xf;a.Zo=this.Zo};
2117 Us.prototype.serializeLayoutProperties=function(a,b){Ni.prototype.serializeLayoutProperties.call(this,a,b);a.layerSpacing=this.layerSpacing;a.columnSpacing=this.columnSpacing;a.direction=this.direction;a.cycleRemoveOption=this.cycleRemoveOption.name;a.layeringOption=this.layeringOption.name;a.initializeOption=this.initializeOption.name;a.iterations=this.iterations;a.aggressiveOption=this.aggressiveOption.name;a.packOption=this.packOption;a.setsPortSpots=this.setsPortSpots;a.linkSpacing=this.linkSpacing;
2118 a.ya=this.ya;a.Ui=this.Ui;a.Ha=this.Ha;a.yh=this.yh;a.uc=this.uc;a.Eb=this.Eb;a.Ah=this.Ah;a.Kc=this.Kc;a.ad={x:this.ad.x,y:this.ad.y}};
2119 Us.prototype.deserializeLayoutProperties=function(a,b,c,d,e){Ni.prototype.deserializeLayoutProperties.call(this,a,b,c,d,e);this.layerSpacing=a.layerSpacing;this.columnSpacing=a.columnSpacing;this.direction=a.direction;this.cycleRemoveOption=fb(Us,a.cycleRemoveOption);this.layeringOption=fb(Us,a.layeringOption);this.initializeOption=fb(Us,a.initializeOption);this.iterations=a.iterations;this.aggressiveOption=fb(Us,a.aggressiveOption);this.packOption=a.packOption;this.setsPortSpots=a.setsPortSpots;
2120 this.linkSpacing=a.linkSpacing;this.ya=a.ya;this.Ui=a.Ui;this.Ha=a.Ha;this.yh=a.yh;this.uc=a.uc;this.Eb=a.Eb;this.Ah=a.Ah;this.Kc=a.Kc;this.ad=new J(this.ad.x,this.ad.y);e&&!d&&e.edges.each(function(a){if(!a.link&&a.fromVertex&&a.toVertex&&(null===a.fromVertex.node||null===a.toVertex.node)){for(var b=a.fromVertex;null!==b&&null===b.node&&0<b.zd.count;){var c=b.zd.M(0);if(c.link){a.link=c.link;break}b=c.fromVertex}if(!a.link){for(c=a.toVertex;null!==c&&null===c.node&&0<c.Nd.count;){var d=c.Nd.M(0);
2121 if(d.link){a.link=d.link;break}c=d.toVertex}if(!a.link)for(c=c.zd.iterator;c.next();)if(d=c.value,d.link&&d.fromVertex===b){a.link=d.link;break}}}})};Us.prototype.pb=function(a){a.classType===Us?0===a.name.indexOf("Aggressive")?this.aggressiveOption=a:0===a.name.indexOf("Cycle")?this.cycleRemoveOption=a:0===a.name.indexOf("Init")?this.initializeOption=a:0===a.name.indexOf("Layer")?this.layeringOption=a:v("Unknown enum value: "+a):Ni.prototype.pb.call(this,a)};Us.prototype.createNetwork=function(){return new Zs(this)};
2122 Us.prototype.doLayout=function(a){F&&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.arrangementOrigin=this.initialOrigin(this.arrangementOrigin);this.Ui=-1;this.uc=this.yh=0;this.tp=this.sp=this.hk=null;for(a=0;a<this.Ie.length;a++)this.Ie[a]=null;if(0<this.network.vertexes.count){this.network.Oq();if(this.kx())return;this.cycleRemoveOption!==$s&&this.removeCycles();for(a=
2123 this.network.vertexes.iterator;a.next();)a.value.layer=-1;this.ya=-1;this.assignLayers();for(a.reset();a.next();)this.ya=Math.max(this.ya,a.value.layer);this.cycleRemoveOption===$s&&this.removeCycles();a=this.network;for(var b=[],c=a.edges.iterator;c.next();){var d=c.value;d.valid=!1;b.push(d)}for(c=0;c<b.length;c++){d=b[c];var e=d.fromVertex,f=d.toVertex;if(!(d.valid||(null===e.node&&null===e.data||null===f.node&&null===f.data)&&e.layer===f.layer)){var g=0,h=0,k=0,l=0;if(null!==d.link){h=d.link;
2124 if(null===h)continue;var m=e.node;g=f.node;if(null===m||null===g)continue;var n=h.fromNode;k=h.toNode;var p=h.fromPort;h=h.toPort;if(d.rev){l=n;var r=p;n=k;p=h;k=l;h=r}var q=e.focus;l=f.focus;var u=d.rev?f.bounds:e.bounds;r=J.alloc();m!==n?u.o()&&n.isVisible()?n.actualBounds.o()?(n.Pf(p,Kc,r),r.x+=n.actualBounds.x-u.x,r.y+=n.actualBounds.y-u.y):(n.Pf(p,Kc,r),r.o()||r.assign(q)):r.assign(q):u.o()?(n.Pf(p,Kc,r),r.o()||r.assign(q)):r.assign(q);n=d.rev?e.bounds:f.bounds;m=J.alloc();g!==k?n.o()&&k.isVisible()?
2125 k.actualBounds.o()?(k.Pf(h,Kc,m),m.x+=k.actualBounds.x-n.x,m.y+=k.actualBounds.y-n.y):(k.Pf(h,Kc,m),m.o()||m.assign(l)):m.assign(l):n.o()?(k.Pf(h,Kc,m),m.o()||m.assign(l)):m.assign(l);90===this.N||270===this.N?(g=Math.round((r.x-q.x)/this.ec),k=r.x,h=Math.round((m.x-l.x)/this.ec),l=m.x):(g=Math.round((r.y-q.y)/this.ec),k=r.y,h=Math.round((m.y-l.y)/this.ec),l=m.y);J.free(r);J.free(m);d.portFromColOffset=g;d.portFromPos=k;d.portToColOffset=h;d.portToPos=l}else d.portFromColOffset=0,d.portFromPos=0,
2126 d.portToColOffset=0,d.portToPos=0;r=e.layer;m=f.layer;n=0;u=d.link;if(null!==u){var y=u.fromPort,x=u.toPort;if(null!==y&&null!==x){var z=u.fromNode;p=u.toNode;if(null!==z&&null!==p){var B=at(this,!0),D=at(this,!1),G=this.setsPortSpots?B:u.computeSpot(!0,y);q=this.setsPortSpots?D:u.computeSpot(!1,x);var M=u.isOrthogonal;G.Uc()&&G.Qf(D)&&q.Uc()&&q.Qf(B)?n=0:(B=u.getLinkPoint(z,y,G,!0,M,p,x,J.alloc()),D=u.getLinkDirection(z,y,B,G,!0,M,p,x),J.free(B),G.br()||D!==bt(this,d,!0)?this.setsPortSpots&&null!==
2127 z&&1===z.ports.count&&d.rev&&(n+=1):n+=1,G=u.getLinkPoint(p,x,q,!1,M,z,y,J.alloc()),u=u.getLinkDirection(p,x,G,q,!1,M,z,y),J.free(G),q.br()||u!==bt(this,d,!1)?this.setsPortSpots&&null!==p&&1===p.ports.count&&d.rev&&(n+=2):n+=2)}}}p=n;n=1===p||3===p?!0:!1;if(p=2===p||3===p?!0:!1)q=a.createVertex(),q.node=null,q.If=1,q.layer=r,q.near=e,a.Ng(q),e=a.Qk(e,q,d.link),e.valid=!1,e.rev=d.rev,e.portFromColOffset=g,e.portToColOffset=0,e.portFromPos=k,e.portToPos=0,e=q;u=1;n&&u--;if(r-m>u&&0<r){d.valid=!1;q=
2128 a.createVertex();q.node=null;q.If=2;q.layer=r-1;a.Ng(q);e=a.Qk(e,q,d.link);e.valid=!0;e.rev=d.rev;e.portFromColOffset=p?0:g;e.portToColOffset=0;e.portFromPos=p?0:k;e.portToPos=0;e=q;for(r--;r-m>u&&0<r;)q=a.createVertex(),q.node=null,q.If=3,q.layer=r-1,a.Ng(q),e=a.Qk(e,q,d.link),e.valid=!0,e.rev=d.rev,e.portFromColOffset=0,e.portToColOffset=0,e.portFromPos=0,e.portToPos=0,e=q,r--;e=a.Qk(q,f,d.link);e.valid=!n;n&&(q.near=f);e.rev=d.rev;e.portFromColOffset=0;e.portToColOffset=h;e.portFromPos=0;e.portToPos=
2129 l}else d.valid=!0}}a=this.Eb=[];for(b=0;b<=this.ya;b++)a[b]=0;for(b=this.network.vertexes.iterator;b.next();)b.value.index=-1;this.initializeIndices();this.Ui=-1;for(c=this.uc=this.yh=0;c<=this.ya;c++)a[c]>a[this.uc]&&(this.Ui=a[c]-1,this.uc=c),a[c]<a[this.yh]&&(this.yh=c);this.tp=[];for(c=0;c<a.length;c++)this.tp[c]=[];for(b.reset();b.next();)a=b.value,this.tp[a.layer][a.index]=a;this.Ha=-1;for(a=0;a<=this.ya;a++){b=ct(this,a);c=0;d=this.Eb[a];for(f=0;f<d;f++)e=b[f],c+=this.nodeMinColumnSpace(e,
2130 !0),e.column=c,c+=1,c+=this.nodeMinColumnSpace(e,!1);this.Ha=Math.max(this.Ha,c-1);dt(this,a,b)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.isValidLayout=!0};Us.prototype.linkMinLength=function(){return 1};function et(a){var b=a.fromVertex.node||a.fromVertex.data;a=a.toVertex.node||a.toVertex.data;return null===b&&null===a?8:null===b||null===a?4:1}
2131 Us.prototype.nodeMinLayerSpace=function(a,b){return null===a.node&&null===a.data?0:90===this.N||270===this.N?b?a.focus.y+10:a.bounds.height-a.focus.y+10:b?a.focus.x+10:a.bounds.width-a.focus.x+10};Us.prototype.nodeMinColumnSpace=function(a,b){if(null===a.node&&null===a.data)return 0;var c=b?a.Yk:a.Xk;if(null!==c)return c;c=this.N;return 90===c||270===c?b?a.Yk=a.focus.x/this.ec+1|0:a.Xk=(a.bounds.width-a.focus.x)/this.ec+1|0:b?a.Yk=a.focus.y/this.ec+1|0:a.Xk=(a.bounds.height-a.focus.y)/this.ec+1|0};
2132 function ft(a){null===a.hk&&(a.hk=[]);for(var b=0,c=a.network.vertexes.iterator;c.next();){var d=c.value;a.hk[b]=d.layer;b++;a.hk[b]=d.column;b++;a.hk[b]=d.index;b++}return a.hk}function gt(a,b){var c=0;for(a=a.network.vertexes.iterator;a.next();){var d=a.value;d.layer=b[c];c++;d.column=b[c];c++;d.index=b[c];c++}}
2133 function ht(a,b,c){F&&(C(b,Us,"crossingMatrix:unfixedLayer"),C(c,Us,"crossingMatrix:direction"));var d=ct(a,b),e=a.Eb[b];if(null===a.sp||a.sp.length<e*e)a.sp=[];for(var f=a.sp,g=0;g<e;g++){var h=0,k=d[g],l=k.near;if(null!==l&&l.layer===k.layer)if(k=l.index,k>g)for(var m=g+1;m<k;m++){var n=d[m];n.near===l&&n.If===l.If||h++}else for(m=g-1;m>k;m--)n=d[m],n.near===l&&n.If===l.If||h++;var p;if(0<=c)for(k=d[g].sourceEdgesArrayAccess,l=0;l<k.length;l++){var r=k[l];if(r.valid&&r.fromVertex.layer!==b)for(n=
2134 r.fromVertex.index,m=r.portToPos,r=r.portFromPos,p=l+1;p<k.length;p++){var q=k[p];if(q.valid&&q.fromVertex.layer!==b){var u=q.fromVertex.index;var y=q.portToPos;q=q.portFromPos;m<y&&(n>u||n===u&&r>q)&&h++;y<m&&(u>n||u===n&&q>r)&&h++}}}if(0>=c)for(k=d[g].destinationEdgesArrayAccess,l=0;l<k.length;l++)if(r=k[l],r.valid&&r.toVertex.layer!==b)for(n=r.toVertex.index,m=r.portToPos,r=r.portFromPos,p=l+1;p<k.length;p++)q=k[p],q.valid&&q.toVertex.layer!==b&&(u=q.toVertex.index,y=q.portToPos,q=q.portFromPos,
2135 r<q&&(n>u||n===u&&m>y)&&h++,q<r&&(u>n||u===n&&y>m)&&h++);f[g*e+g]=h;for(k=g+1;k<e;k++){var x=0,z=0;if(0<=c){h=d[g].sourceEdgesArrayAccess;var B=d[k].sourceEdgesArrayAccess;for(l=0;l<h.length;l++)if(r=h[l],r.valid&&r.fromVertex.layer!==b)for(n=r.fromVertex.index,r=r.portFromPos,p=0;p<B.length;p++)q=B[p],q.valid&&q.fromVertex.layer!==b&&(u=q.fromVertex.index,q=q.portFromPos,(n<u||n===u&&r<q)&&z++,(u<n||u===n&&q<r)&&x++)}if(0>=c)for(h=d[g].destinationEdgesArrayAccess,B=d[k].destinationEdgesArrayAccess,
2136 l=0;l<h.length;l++)if(r=h[l],r.valid&&r.toVertex.layer!==b)for(n=r.toVertex.index,m=r.portToPos,p=0;p<B.length;p++)q=B[p],q.valid&&q.toVertex.layer!==b&&(u=q.toVertex.index,y=q.portToPos,(n<u||n===u&&m<y)&&z++,(u<n||u===n&&y<m)&&x++);f[g*e+k]=x;f[k*e+g]=z}}dt(a,b,d);return f}Us.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.ya;b++)for(var c=ht(this,b,1),d=this.Eb[b],e=0;e<d;e++)for(var f=e;f<d;f++)a+=c[e*d+f];return a};
2137 function it(a){for(var b=0,c=0;c<=a.ya;c++){for(var d=a,e=c,f=ct(d,e),g=d.Eb[e],h=0,k=0;k<g;k++){var l=f[k].destinationEdgesArrayAccess;if(null!==l)for(var m=0;m<l.length;m++){var n=l[m];if(n.valid&&n.toVertex.layer!==e){var p=n.fromVertex.column+n.portFromColOffset;var r=n.toVertex.column+n.portToColOffset;h+=(Math.abs(p-r)+1)*et(n)}}}dt(d,e,f);b+=h}return b}
2138 Us.prototype.normalize=function(){var a=Infinity;this.Ha=-1;for(var b=this.network.vertexes.iterator;b.next();){var c=b.value;a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0));this.Ha=Math.max(this.Ha,c.column+this.nodeMinColumnSpace(c,!1))}for(b.reset();b.next();)b.value.column-=a;this.Ha-=a};
2139 function jt(a,b,c){F&&(C(b,Us,"barycenters:unfixedLayer"),C(c,Us,"barycenters:direction"));for(var d=ct(a,b),e=a.Eb[b],f=[],g=0;g<e;g++){var h=d[g],k=null;0>=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<k.length;p++){h=k[p];var r=h.fromVertex;h.valid&&!h.rev&&r.layer!==b&&(m+=r.column,n++)}if(null!==l)for(k=0;k<l.length;k++)h=l[k],p=h.toVertex,h.valid&&!h.rev&&p.layer!==
2140 b&&(m+=p.column,n++);f[g]=0===n?-1:m/n}dt(a,b,d);return f}
2141 function kt(a,b,c){F&&(C(b,Us,"medians:unfixedLayer"),C(c,Us,"medians:direction"));for(var d=ct(a,b),e=a.Eb[b],f=[],g=0;g<e;g++){var h=d[g],k=null;0>=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<k.length;p++){h=k[p];var r=h.fromVertex;h.valid&&!h.rev&&r.layer!==b&&(n[m]=r.column+h.portFromColOffset,m++)}if(null!==l)for(k=0;k<l.length;k++)h=l[k],p=h.toVertex,
2142 h.valid&&!h.rev&&p.layer!==b&&(n[m]=p.column+h.portToColOffset,m++);0===m?f[g]=-1:(n.sort(function(a,b){return a-b}),l=m>>1,f[g]=0!==(m&1)?n[l]:n[l-1]+n[l]>>1)}dt(a,b,d);return f}
2143 function lt(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&&lt(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&&lt(a,k,c,d,e,f)}}
2144 function mt(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var g=b.destinationEdges;g.next();)mt(a,g.value.toVertex,c,d,e,f);if(f)for(b=b.sourceEdges;b.next();)mt(a,b.value.fromVertex,c,d,e,f)}}
2145 Us.prototype.removeCycles=function(){for(var a=this.network.edges.iterator;a.next();)a.value.rev=!1;switch(this.vl){default:case nt: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!==ot(a);){for(e=pt(a);null!==e;)d[c]=e,c--,e.valid=!1,e=pt(a);for(e=qt(a);null!==e;)d[b]=e,b++,e.valid=!1,e=qt(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&&
2146 k++;l=0;for(var m=h.sourceEdges;m.next();)m.value.fromVertex.valid&&l++;if(null===e||f<k-l)e=h,f=k-l}}null!==e&&(d[b]=e,b++,e.valid=!1)}for(b=0;b<a.vertexes.count;b++)d[b].index=b;for(d=a.edges.iterator;d.next();)b=d.value,b.fromVertex.index>b.toVertex.index&&(a.en(b),b.rev=!0);break;case Vs:for(d=this.network.vertexes.iterator;d.next();)a=d.value,a.Og=-1,a.finish=-1;for(a=this.network.edges.iterator;a.next();)a.value.forest=!1;this.Ah=0;for(d.reset();d.next();)b=d.value,0===b.sourceEdges.count&&
2147 rt(this,b);for(d.reset();d.next();)b=d.value,-1===b.Og&&rt(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.Og<b.Og&&c<f&&(this.network.en(d),d.rev=!0));break;case $s:a=this.network;b=a.vertexes.iterator;for(d=Infinity;b.next();)d=Math.min(d,b.value.layer);if(Infinity>d){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;c<d.length;c++)if(e=d[c],!e||
2148 0===e.length)b++;else if(0<c)for(f=0;f<e.length;f++)e[f].layer-=b;for(d=a.edges.iterator;d.next();)b=d.value,b.fromVertex.layer<b.toVertex.layer&&(a.en(b),b.rev=!0)}}};function ot(a){for(a=a.vertexes.iterator;a.next();){var b=a.value;if(b.valid)return b}return null}function pt(a){for(a=a.vertexes.iterator;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.destinationEdges;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
2149 function qt(a){for(a=a.vertexes.iterator;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.sourceEdges;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function rt(a,b){b.Og=a.Ah;a.Ah++;for(var c=b.destinationEdges;c.next();){var d=c.value,e=d.toVertex;-1===e.Og&&(d.forest=!0,rt(a,e))}b.finish=a.Ah;a.Ah++}
2150 Us.prototype.assignLayers=function(){switch(this.Zl){case st:tt(this);break;case ut:for(var a,b=this.network.vertexes.iterator;b.next();)a=vt(this,b.value),this.ya=Math.max(a,this.ya);for(b.reset();b.next();)a=b.value,a.layer=this.ya-a.layer;break;default:case Ws:tt(this);for(b=this.network.vertexes.iterator;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.sourceEdges.count&&wt(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.ya=-1;for(b.reset();b.next();){var c=
2151 b.value;c.layer-=a;this.ya=Math.max(this.ya,c.layer)}}};function tt(a){for(var b=a.network.vertexes.iterator;b.next();){var c=xt(a,b.value);a.ya=Math.max(c,a.ya)}}function xt(a,b){var c=0;if(-1===b.layer){for(var d=b.destinationEdges;d.next();){var e=d.value,f=e.toVertex;e=a.linkMinLength(e);c=Math.max(c,xt(a,f)+e)}b.layer=c}else c=b.layer;return c}
2152 function vt(a,b){var c=0;if(-1===b.layer){for(var d=b.sourceEdges;d.next();){var e=d.value,f=e.fromVertex;e=a.linkMinLength(e);c=Math.max(c,vt(a,f)+e)}b.layer=c}else c=b.layer;return c}
2153 function wt(a,b){if(!b.valid){b.valid=!0;for(var c=b.destinationEdges;c.next();)wt(a,c.value.toVertex);for(c=a.network.vertexes.iterator;c.next();)c.value.component=-1;for(var d=b.sourceEdgesArrayAccess,e=d.length,f=0;f<e;f++){var g=d[f],h=g.fromVertex,k=g.toVertex;g=a.linkMinLength(g);h.layer-k.layer>g&&lt(a,h,0,-1,!0,!1)}for(lt(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;
2154 e=p.length;for(var r=0;r<e;r++){var q=p[r],u=q.fromVertex;m+=1;1!==u.component&&(f+=1,u=u.layer-l.layer,q=a.linkMinLength(q),d=Math.min(d,u-q))}p=l.destinationEdgesArrayAccess;e=p.length;for(r=0;r<e;r++)q=p[r].toVertex,--m,1!==q.component?--f:n=!0;(null===k||m<h)&&!n&&(k=l,h=m)}}if(0<f){for(c.reset();c.next();)e=c.value,1===e.component&&(e.layer+=d);b.component=0}else k.component=0}for(c=a.network.vertexes.iterator;c.next();)c.value.component=-1;for(lt(a,b,1,-1,!0,!1);0!==b.component;){d=0;e=Infinity;
2155 f=0;h=null;for(k=a.network.vertexes.iterator;k.next();)if(g=k.value,1===g.component){l=0;m=!1;p=g.sourceEdgesArrayAccess;n=p.length;for(r=0;r<n;r++)q=p[r].fromVertex,l+=1,1!==q.component?d+=1:m=!0;p=g.destinationEdgesArrayAccess;n=p.length;for(r=0;r<n;r++)q=p[r],u=q.toVertex,--l,1!==u.component&&(--d,u=g.layer-u.layer,q=a.linkMinLength(q),e=Math.min(e,u-q));(null===h||l>f)&&!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}}}
2156 function bt(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}
2157 Us.prototype.initializeIndices=function(){switch(this.Ol){default:case yt:for(var a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;b.index=this.Eb[c];this.Eb[c]++}break;case Xs:a=this.network.vertexes.iterator;for(b=this.ya;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&zt(this,c);break;case At:for(a=this.network.vertexes.iterator,b=0;b<=this.ya;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Bt(this,c)}};
2158 function zt(a,b){var c=b.layer;b.index=a.Eb[c];a.Eb[c]++;b=b.destinationEdgesArrayAccess;for(c=!0;c;){c=!1;for(var d=0;d<b.length-1;d++){var e=b[d],f=b[d+1];e.portFromColOffset>f.portFromColOffset&&(c=!0,b[d]=f,b[d+1]=e)}}for(c=0;c<b.length;c++)d=b[c],d.valid&&(d=d.toVertex,-1===d.index&&zt(a,d))}
2159 function Bt(a,b){var c=b.layer;b.index=a.Eb[c];a.Eb[c]++;b=b.sourceEdgesArrayAccess;for(var d=!0;d;)for(d=!1,c=0;c<b.length-1;c++){var e=b[c],f=b[c+1];e.portToColOffset>f.portToColOffset&&(d=!0,b[c]=f,b[c+1]=e)}for(c=0;c<b.length;c++)d=b[c],d.valid&&(d=d.fromVertex,-1===d.index&&Bt(a,d))}
2160 Us.prototype.reduceCrossings=function(){var a=this.countCrossings(),b=ft(this),c,d;for(c=0;c<this.ck;c++){for(d=0;d<=this.ya;d++)Ct(this,d,1),Dt(this,d,1);var e=this.countCrossings();e<a&&(a=e,b=ft(this));for(d=this.ya;0<=d;d--)Ct(this,d,-1),Dt(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=ft(this))}gt(this,b);for(c=0;c<this.ck;c++){for(d=0;d<=this.ya;d++)Ct(this,d,0),Dt(this,d,0);e=this.countCrossings();e<a&&(a=e,b=ft(this));for(d=this.ya;0<=d;d--)Ct(this,d,0),Dt(this,d,0);e=this.countCrossings();
2161 e<a&&(a=e,b=ft(this))}gt(this,b);var f,g,h;switch(this.kl){case Et:break;case Ft:for(h=a+1;(d=this.countCrossings())<h;)for(h=d,c=this.ya;0<=c;c--)for(g=0;g<=c;g++){for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Dt(this,d,-1)||f;e=this.countCrossings();e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Dt(this,d,1)||f;e=this.countCrossings();e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Dt(this,d,1)||f;e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=
2162 Dt(this,d,-1)||f;e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Dt(this,d,0)||f;e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Dt(this,d,0)||f;e>=a?gt(this,b):(a=e,b=ft(this))}break;default:case Ys:for(c=this.ya,g=0,h=a+1;(d=this.countCrossings())<h;){h=d;for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Dt(this,d,-1)||f;e=this.countCrossings();e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Dt(this,d,1)||f;e=this.countCrossings();e>=a?gt(this,b):
2163 (a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Dt(this,d,1)||f;e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Dt(this,d,-1)||f;e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=c;d>=g;d--)f=Dt(this,d,0)||f;e>=a?gt(this,b):(a=e,b=ft(this));for(f=!0;f;)for(f=!1,d=g;d<=c;d++)f=Dt(this,d,0)||f;e>=a?gt(this,b):(a=e,b=ft(this))}}gt(this,b)};
2164 function Ct(a,b,c){F&&(C(b,Us,"medianBarycenterCrossingReduction:unfixedLayer"),C(c,Us,"medianBarycenterCrossingReduction:direction"));var d=ct(a,b),e=a.Eb[b],f=kt(a,b,c),g=jt(a,b,c);for(c=0;c<e;c++)-1===g[c]&&(g[c]=d[c].column),-1===f[c]&&(f[c]=d[c].column);for(var h=!0,k;h;)for(h=!1,c=0;c<e-1;c++)if(f[c+1]<f[c]||f[c+1]===f[c]&&g[c+1]<g[c])h=!0,k=f[c],f[c]=f[c+1],f[c+1]=k,k=g[c],g[c]=g[c+1],g[c+1]=k,k=d[c],d[c]=d[c+1],d[c+1]=k;for(c=f=0;c<e;c++)k=d[c],k.index=c,f+=a.nodeMinColumnSpace(k,!0),k.column=
2165 f,f+=1,f+=a.nodeMinColumnSpace(k,!1);dt(a,b,d)}
2166 function Dt(a,b,c){var d=ct(a,b),e=a.Eb[b];c=ht(a,b,c);var f;var g=[];for(f=0;f<e;f++)g[f]=-1;var h=[];for(f=0;f<e;f++)h[f]=-1;for(var k=!1,l=!0;l;)for(l=!1,f=0;f<e-1;f++){var m=c[d[f].index*e+d[f+1].index],n=c[d[f+1].index*e+d[f].index],p=0,r=0,q=d[f].column,u=d[f+1].column,y=a.nodeMinColumnSpace(d[f],!0),x=a.nodeMinColumnSpace(d[f],!1),z=a.nodeMinColumnSpace(d[f+1],!0),B=a.nodeMinColumnSpace(d[f+1],!1);y=q-y+z;x=u-x+B;var D=d[f].sourceEdges.iterator;for(D.reset();D.next();)if(z=D.value,B=z.fromVertex,
2167 z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z<f&&(p+=2*(f-z),r+=2*(f+1-z));z===f+1&&(p+=1);z>f+1&&(p+=4*(z-f),r+=4*(z-(f+1)))}D=d[f].destinationEdges.iterator;for(D.reset();D.next();)if(z=D.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f+1&&(r+=1)}D=d[f+1].sourceEdges.iterator;for(D.reset();D.next();)if(z=D.value,B=z.fromVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z<f&&(p+=2*(f+1-z),r+=2*(f-z));z===f&&(r+=1);z>f+1&&(p+=4*(z-(f+1)),r+=4*(z-f))}D=d[f+1].destinationEdges.iterator;
2168 for(D.reset();D.next();)if(z=D.value,B=z.toVertex,z.valid&&B.layer===b){for(z=0;d[z]!==B;)z++;z===f&&(p+=1)}z=B=0;D=g[d[f].index];var G=h[d[f].index],M=g[d[f+1].index],Y=h[d[f+1].index];-1!==D&&(B+=Math.abs(D-q),z+=Math.abs(D-x));-1!==G&&(B+=Math.abs(G-q),z+=Math.abs(G-x));-1!==M&&(B+=Math.abs(M-u),z+=Math.abs(M-y));-1!==Y&&(B+=Math.abs(Y-u),z+=Math.abs(Y-y));if(r<p-.5||r===p&&n<m-.5||r===p&&n===m&&z<B-.5)l=k=!0,d[f].column=x,d[f+1].column=y,m=d[f],d[f]=d[f+1],d[f+1]=m}for(f=0;f<e;f++)d[f].index=
2169 f;dt(a,b,d);return k}
2170 Us.prototype.straightenAndPack=function(){var a=0!==(this.zg&1);var b=0!==(this.zg&Gt);1E3<this.network.edges.count&&b&&(a=!1);if(a){var c=[];for(b=0;b<=this.ya;b++)c[b]=0;for(var d,e=this.network.vertexes.iterator;e.next();){var f=e.value;b=f.layer;d=f.column;f=this.nodeMinColumnSpace(f,!1);c[b]=Math.max(c[b],d+f)}for(e.reset();e.next();)f=e.value,b=f.layer,d=f.column,f.column=(8*(this.Ha-c[b])>>1)+8*d;this.Ha*=8}if(0!==(this.zg&2))for(c=!0;c;){c=!1;for(b=this.uc+1;b<=this.ya;b++)c=Ht(this,b,1)||
2171 c;for(b=this.uc-1;0<=b;b--)c=Ht(this,b,-1)||c;c=Ht(this,this.uc,0)||c}if(0!==(this.zg&4)){for(b=this.uc+1;b<=this.ya;b++)It(this,b,1);for(b=this.uc-1;0<=b;b--)It(this,b,-1);It(this,this.uc,0)}a&&(Jt(this,-1),Jt(this,1));if(0!==(this.zg&2))for(c=!0;c;){c=!1;c=Ht(this,this.uc,0)||c;for(b=this.uc+1;b<=this.ya;b++)c=Ht(this,b,0)||c;for(b=this.uc-1;0<=b;b--)c=Ht(this,b,0)||c}};
2172 function Ht(a,b,c){F&&(C(b,Us,"bendStraighten:unfixedLayer"),C(c,Us,"bendStraighten:direction"));for(var d=!1;Kt(a,b,c);)d=!0;return d}
2173 function Kt(a,b,c){F&&(C(b,Us,"shiftbendStraighten:unfixedLayer"),C(c,Us,"shiftbendStraighten:direction"));var d,e=ct(a,b),f=a.Eb[b],g=jt(a,b,-1);if(0<c)for(d=0;d<f;d++)g[d]=-1;var h=jt(a,b,1);if(0>c)for(d=0;d<f;d++)h[d]=-1;for(var k=!1,l=!0;l;)for(l=!1,d=0;d<f;d++){var m=e[d].column,n=a.nodeMinColumnSpace(e[d],!0),p=a.nodeMinColumnSpace(e[d],!1),r=0;0>d-1||m-e[d-1].column-1>n+a.nodeMinColumnSpace(e[d-1],!1)?r=m-1:r=m;n=d+1>=f||e[d+1].column-m-1>p+a.nodeMinColumnSpace(e[d+1],!0)?m+1:m;var q=p=0,u=
2174 0;if(0>=c)for(var y=e[d].sourceEdges.iterator;y.next();){var x=y.value;var z=x.fromVertex;if(x.valid&&z.layer!==b){var B=et(x);var D=x.portFromColOffset;x=x.portToColOffset;z=z.column;p+=(Math.abs(m+x-(z+D))+1)*B;q+=(Math.abs(r+x-(z+D))+1)*B;u+=(Math.abs(n+x-(z+D))+1)*B}}if(0<=c)for(y=e[d].destinationEdges.iterator;y.next();)x=y.value,z=x.toVertex,x.valid&&z.layer!==b&&(B=et(x),D=x.portFromColOffset,x=x.portToColOffset,z=z.column,p+=(Math.abs(m+D-(z+x))+1)*B,q+=(Math.abs(r+D-(z+x))+1)*B,u+=(Math.abs(n+
2175 D-(z+x))+1)*B);x=D=B=0;y=g[e[d].index];z=h[e[d].index];-1!==y&&(B+=Math.abs(y-m),D+=Math.abs(y-r),x+=Math.abs(y-n));-1!==z&&(B+=Math.abs(z-m),D+=Math.abs(z-r),x+=Math.abs(z-n));if(q<p||q===p&&D<B)l=k=!0,e[d].column=r;else if(u<p||u===p&&x<B)l=k=!0,e[d].column=n}dt(a,b,e);a.normalize();return k}
2176 function It(a,b,c){F&&(C(b,Us,"medianStraighten:unfixedLayer"),C(c,Us,"medianStraighten:direction"));var d=ct(a,b),e=a.Eb[b],f=kt(a,b,c),g=[];for(c=0;c<e;c++)g[c]=f[c];for(f=!0;f;)for(f=!1,c=0;c<e;c++){var h=d[c].column,k=a.nodeMinColumnSpace(d[c],!0),l=a.nodeMinColumnSpace(d[c],!1),m=0;if(-1===g[c])if(0===c&&c===e-1)m=h;else if(0===c){var n=d[c+1].column;n-h===l+a.nodeMinColumnSpace(d[c+1],!0)?m=h-1:m=h}else c===e-1?(n=d[c-1].column,m=h-n===k+a.nodeMinColumnSpace(d[c-1],!1)?h+1:h):(n=d[c-1].column,
2177 k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,m=(k+l)/2|0);else 0===c&&c===e-1?m=g[c]:0===c?(n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,m=Math.min(g[c],l)):c===e-1?(n=d[c-1].column,k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,m=Math.max(g[c],k)):(n=d[c-1].column,k=n+a.nodeMinColumnSpace(d[c-1],!1)+k+1,n=d[c+1].column,l=n-a.nodeMinColumnSpace(d[c+1],!0)-l-1,k<g[c]&&g[c]<l?m=g[c]:k>=g[c]?m=k:l<=g[c]&&(m=l));m!==h&&(f=!0,d[c].column=m)}dt(a,b,
2178 d);a.normalize()}function Lt(a,b){F&&(C(b,Us,"packAux:column"),C(1,Us,"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}
2179 function Mt(a,b){F&&(C(b,Us,"tightPackAux:column"),C(1,Us,"tightPackAux:direction"));var c=b+1;var d,e=[],f=[];for(d=0;d<=a.ya;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.ya;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}
2180 function Jt(a,b){F&&C(b,Us,"componentPack:direction");for(var c=0;c<=a.Ha;c++)for(;Lt(a,c););a.normalize();for(c=0;c<a.Ha;c++)for(;Mt(a,c););a.normalize();var d;if(0<b)for(c=0;c<=a.Ha;c++){var e=ft(a);var f=it(a);for(d=f+1;f<d;){d=f;Nt(a,c,1);var g=it(a);g>f?gt(a,e):g<f&&(f=g,e=ft(a))}}if(0>b)for(c=a.Ha;0<=c;c--)for(e=ft(a),f=it(a),d=f+1;f<d;)d=f,Nt(a,c,-1),g=it(a),g>f?gt(a,e):g<f&&(f=g,e=ft(a));a.normalize()}
2181 function Nt(a,b,c){a.Kc=0;for(var d=a.network.vertexes.iterator;d.next();)d.value.component=-1;if(0<c)for(d.reset();d.next();){var e=d.value;e.column-a.nodeMinColumnSpace(e,!0)<=b&&(e.component=a.Kc)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Kc);a.Kc++;for(d.reset();d.next();)b=d.value,-1===b.component&&(mt(a,b,a.Kc,-1,!0,!0),a.Kc++);var f;b=[];for(f=0;f<a.Kc*a.Kc;f++)b[f]=!1;e=[];for(f=0;f<(a.ya+1)*(a.Ha+1);f++)e[f]=-1;for(d.reset();d.next();){f=
2182 d.value;for(var g=f.layer,h=Math.max(0,f.column-a.nodeMinColumnSpace(f,!0)),k=Math.min(a.Ha,f.column+a.nodeMinColumnSpace(f,!1));h<=k;h++)e[g*(a.Ha+1)+h]=f.component}for(f=0;f<=a.ya;f++){if(0<c)for(g=0;g<a.Ha;g++)-1!==e[f*(a.Ha+1)+g]&&-1!==e[f*(a.Ha+1)+g+1]&&e[f*(a.Ha+1)+g]!==e[f*(a.Ha+1)+g+1]&&(b[e[f*(a.Ha+1)+g]*a.Kc+e[f*(a.Ha+1)+g+1]]=!0);if(0>c)for(g=a.Ha;0<g;g--)-1!==e[f*(a.Ha+1)+g]&&-1!==e[f*(a.Ha+1)+g-1]&&e[f*(a.Ha+1)+g]!==e[f*(a.Ha+1)+g-1]&&(b[e[f*(a.Ha+1)+g]*a.Kc+e[f*(a.Ha+1)+g-1]]=!0)}e=
2183 [];for(f=0;f<a.Kc;f++)e[f]=!0;g=[];for(g.push(0);0!==g.length;)if(k=g[g.length-1],g.pop(),e[k])for(e[k]=!1,f=0;f<a.Kc;f++)b[k*a.Kc+f]&&g.splice(0,0,f);if(0<c)for(d.reset();d.next();)a=d.value,e[a.component]&&--a.column;if(0>c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)}
2184 Us.prototype.commitLayout=function(){if(this.setsPortSpots)for(var a=at(this,!0),b=at(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.Vv();this.isRouting&&this.commitLinks()};function at(a,b){return 270===a.N?b?md:pd:90===a.N?b?pd:md:180===a.N?b?nd:od:b?od:nd}
2185 Us.prototype.commitNodes=function(){this.fe=[];this.Fd=[];this.Ed=[];this.Na=[];for(var a=0;a<=this.ya;a++)this.fe[a]=0,this.Fd[a]=0,this.Ed[a]=0,this.Na[a]=0;for(a=this.network.vertexes.iterator;a.next();){var b=a.value,c=b.layer;this.fe[c]=Math.max(this.fe[c],this.nodeMinLayerSpace(b,!0));this.Fd[c]=Math.max(this.Fd[c],this.nodeMinLayerSpace(b,!1))}b=0;c=this.Ee;for(var d=0;d<=this.ya;d++){var e=c;0>=this.fe[d]+this.Fd[d]&&(e=0);0<d&&(b+=e/2);90===this.N||0===this.N?(b+=this.Fd[d],this.Ed[d]=b,
2186 b+=this.fe[d]):(b+=this.fe[d],this.Ed[d]=b,b+=this.Fd[d]);d<this.ya&&(b+=e/2);this.Na[d]=b}c=b;b=this.arrangementOrigin;for(d=0;d<=this.ya;d++)270===this.N?this.Ed[d]=b.y+this.Ed[d]:90===this.N?(this.Ed[d]=b.y+c-this.Ed[d],this.Na[d]=c-this.Na[d]):180===this.N?this.Ed[d]=b.x+this.Ed[d]:(this.Ed[d]=b.x+c-this.Ed[d],this.Na[d]=c-this.Na[d]);a.reset();for(c=d=Infinity;a.next();){e=a.value;var f=e.layer,g=e.column|0;if(270===this.N||90===this.N){var h=b.x+this.ec*g;f=this.Ed[f]}else h=this.Ed[f],f=b.y+
2187 this.ec*g;e.centerX=h;e.centerY=f;d=Math.min(e.x,d);c=Math.min(e.y,c)}d=b.x-d;b=b.y-c;this.ad=new J(d,b);for(a.reset();a.next();)c=a.value,c.x+=d,c.y+=b,c.commit()};
2188 Us.prototype.Vv=function(){for(var a=0,b=this.Ee,c=0;c<=this.ya;c++)a+=this.fe[c],a+=this.Fd[c];a+=this.ya*b;b=[];c=this.ec*this.Ha;for(var d=this.maxLayer;0<=d;d--)270===this.N?0===d?b.push(new L(0,0,c,Math.abs(this.Na[0]))):b.push(new L(0,this.Na[d-1],c,Math.abs(this.Na[d-1]-this.Na[d]))):90===this.N?0===d?b.push(new L(0,this.Na[0],c,Math.abs(this.Na[0]-a))):b.push(new L(0,this.Na[d],c,Math.abs(this.Na[d-1]-this.Na[d]))):180===this.N?0===d?b.push(new L(0,0,Math.abs(this.Na[0]),c)):b.push(new L(this.Na[d-
2189 1],0,Math.abs(this.Na[d-1]-this.Na[d]),c)):0===d?b.push(new L(this.Na[0],0,Math.abs(this.Na[0]-a),c)):b.push(new L(this.Na[d],0,Math.abs(this.Na[d-1]-this.Na[d]),c));this.commitLayers(b,this.ad)};Us.prototype.commitLayers=function(){};
2190 Us.prototype.commitLinks=function(){for(var a=this.network.edges.iterator,b;a.next();)b=a.value.link,null!==b&&(b.di(),b.Bk(),b.Jf());for(a.reset();a.next();)b=a.value.link,null!==b&&b.Jj();for(a.reset();a.next();){var c=a.value;b=c.link;if(null!==b){b.di();var d=b,e=d.fromNode,f=d.toNode,g=d.fromPort,h=d.toPort;if(null!==e){var k=e.findVisibleNode();null!==k&&k!==e&&(e=k,g=k.port)}null!==f&&(k=f.findVisibleNode(),null!==k&&k!==f&&(f=k,h=k.port));var l=b.computeSpot(!0,g);k=b.computeSpot(!1,h);var m=
2191 c.fromVertex,n=c.toVertex;if(c.valid){if(b.curve===qg&&4===b.pointsCount)if(m.column===n.column)c=b.getLinkPoint(e,g,l,!0,!1,f,h),g=b.getLinkPoint(f,h,k,!1,!1,e,g),c.o()||c.set(e.actualBounds.center),g.o()||g.set(f.actualBounds.center),b.Bk(),b.Hf(c.x,c.y),b.Hf((2*c.x+g.x)/3,(2*c.y+g.y)/3),b.Hf((c.x+2*g.x)/3,(c.y+2*g.y)/3),b.Hf(g.x,g.y);else{var p=!1,r=!1;null!==g&&l===Bc&&(p=!0);null!==h&&k===Bc&&(r=!0);if(p||r){var q=b.i(0).x;c=b.i(0).y;m=b.i(3).x;d=b.i(3).y;p&&(90===this.N||270===this.N?(p=q,n=
2192 (c+d)/2):(p=(q+m)/2,n=c),b.O(1,p,n),l=b.getLinkPoint(e,g,l,!0,!1,f,h),l.o()||l.set(e.actualBounds.center),b.O(0,l.x,l.y));r&&(90===this.N||270===this.N?(l=m,c=(c+d)/2):(l=(q+m)/2,c=d),b.O(2,l,c),e=b.getLinkPoint(f,h,k,!1,!1,e,g),e.o()||e.set(f.actualBounds.center),b.O(3,e.x,e.y))}}b.Jf()}else if(m.layer===n.layer)b.Jf();else{p=r=!1;q=b.firstPickIndex+1;if(b.isOrthogonal){p=!0;var u=b.pointsCount;4<u&&b.points.removeRange(2,u-3)}else if(b.curve===qg)r=!0,u=b.pointsCount,4<u&&b.points.removeRange(2,
2193 u-3),4===u&&(q=2);else{u=b.pointsCount;var y=l===Bc,x=k===Bc;2<u&&y&&x?b.points.removeRange(1,u-2):3<u&&y&&!x?b.points.removeRange(1,u-3):3<u&&!y&&x?b.points.removeRange(2,u-2):4<u&&!y&&!x&&b.points.removeRange(2,u-3)}if(c.rev){for(;null!==n&&m!==n;){var z=u=null;for(y=n.sourceEdges.iterator;y.next()&&(x=y.value,x.link!==c.link||(u=x.fromVertex,z=x.toVertex,null!==u.node)););if(u!==m){y=b.i(q-1).x;x=b.i(q-1).y;var B=u.centerX;var D=u.centerY;if(p)180===this.N||0===this.N?q===b.firstPickIndex+1?(b.m(q++,
2194 y,x),b.m(q++,y,D)):(null!==z?z.centerY:x)!==D&&(z=this.Na[u.layer-1]+this.ad.x,b.m(q++,z,x),b.m(q++,z,D)):q===b.firstPickIndex+1?(b.m(q++,y,x),b.m(q++,B,x)):(null!==z?z.centerX:y)!==B&&(z=this.Na[u.layer-1]+this.ad.y,b.m(q++,y,z),b.m(q++,B,z));else if(q===b.firstPickIndex+1){z=Math.max(10,this.fe[n.layer]);var G=Math.max(10,this.Fd[n.layer]);if(r)180===this.N?B<=n.bounds.x?(n=n.bounds.x,b.m(q++,n-z,D),b.m(q++,n,D),b.m(q++,n+G,D)):(b.m(q++,B-z,D),b.m(q++,B,D),b.m(q++,B+G,D)):90===this.N?D>=n.bounds.bottom?
2195 (n=n.bounds.y+n.bounds.height,b.m(q++,B,n+G),b.m(q++,B,n),b.m(q++,B,n-z)):(b.m(q++,B,D+G),b.m(q++,B,D),b.m(q++,B,D-z)):270===this.N?D<=n.bounds.y?(n=n.bounds.y,b.m(q++,B,n-z),b.m(q++,B,n),b.m(q++,B,n+G)):(b.m(q++,B,D-z),b.m(q++,B,D),b.m(q++,B,D+G)):0===this.N&&(B>=n.bounds.right?(n=n.bounds.x+n.bounds.width,b.m(q++,n+G,D),b.m(q++,n,D),b.m(q++,n-z,D)):(b.m(q++,B+G,D),b.m(q++,B,D),b.m(q++,B-z,D)));else{b.m(q++,y,x);var M=0;if(180===this.N||0===this.N){if(180===this.N?B>=n.bounds.right:B<=n.bounds.x)M=
2196 (0===this.N?-z:G)/2;b.m(q++,y+M,D)}else{if(270===this.N?D>=n.bounds.bottom:D<=n.bounds.y)M=(90===this.N?-z:G)/2;b.m(q++,B,x+M)}b.m(q++,B,D)}}else z=Math.max(10,this.fe[u.layer]),G=Math.max(10,this.Fd[u.layer]),180===this.N?(r&&b.m(q++,B-z,D),b.m(q++,B,D),r&&b.m(q++,B+G,D)):90===this.N?(r&&b.m(q++,B,D+G),b.m(q++,B,D),r&&b.m(q++,B,D-z)):270===this.N?(r&&b.m(q++,B,D-z),b.m(q++,B,D),r&&b.m(q++,B,D+G)):(r&&b.m(q++,B+G,D),b.m(q++,B,D),r&&b.m(q++,B-z,D))}n=u}if(null===h||l!==Bc||p)if(y=b.i(q-1).x,x=b.i(q-
2197 1).y,B=b.i(q).x,D=b.i(q).y,p)n=this.Fd[m.layer],180===this.N||0===this.N?(p=x,p>=m.bounds.y&&p<=m.bounds.bottom&&(180===this.N?B>=m.bounds.x:B<=m.bounds.right)&&(n=m.centerX+(180===this.N?-n:n),p<m.bounds.y+m.bounds.height/2?p=m.bounds.y-this.ec/2:p=m.bounds.bottom+this.ec/2,b.m(q++,n,x),b.m(q++,n,p)),b.m(q++,B,p)):(p=y,p>=m.bounds.x&&p<=m.bounds.right&&(270===this.N?D>=m.bounds.y:D<=m.bounds.bottom)&&(n=m.centerY+(270===this.N?-n:n),p<m.bounds.x+m.bounds.width/2?p=m.bounds.x-this.ec/2:p=m.bounds.right+
2198 this.ec/2,b.m(q++,y,n),b.m(q++,p,n)),b.m(q++,p,D)),b.m(q++,B,D);else if(r)z=Math.max(10,this.fe[m.layer]),G=Math.max(10,this.Fd[m.layer]),180===this.N&&B>=m.bounds.x?(n=m.bounds.x+m.bounds.width,b.O(q-2,n,x),b.O(q-1,n+G,x)):90===this.N&&D<=m.bounds.bottom?(n=m.bounds.y,b.O(q-2,y,n),b.O(q-1,y,n-z)):270===this.N&&D>=m.bounds.y?(n=m.bounds.y+m.bounds.height,b.O(q-2,y,n),b.O(q-1,y,n+G)):0===this.N&&B<=m.bounds.right&&(n=m.bounds.x,b.O(q-2,n,x),b.O(q-1,n-z,x));else{z=Math.max(10,this.fe[m.layer]);G=Math.max(10,
2199 this.Fd[m.layer]);p=0;if(180===this.N||0===this.N){if(180===this.N?B<=m.bounds.x:B>=m.bounds.right)p=(0===this.N?G:-z)/2;b.m(q++,B+p,x)}else{if(270===this.N?D<=m.bounds.y:D>=m.bounds.bottom)p=(90===this.N?G:-z)/2;b.m(q++,y,D+p)}b.m(q++,B,D)}}else{for(;null!==m&&m!==n;){z=u=null;for(m=m.destinationEdges.iterator;m.next()&&(y=m.value,y.link!==c.link||(u=y.toVertex,z=y.fromVertex,null!==z.node&&(z=null),null!==u.node)););u!==n&&(y=b.i(q-1).x,x=b.i(q-1).y,B=u.centerX,D=u.centerY,p?180===this.N||0===this.N?
2200 (null!==z?z.centerY:x)!==D&&(z=this.Na[u.layer]+this.ad.x,q===b.firstPickIndex+1&&(z=0===this.N?Math.max(z,y):Math.min(z,y)),b.m(q++,z,x),b.m(q++,z,D)):(null!==z?z.centerX:y)!==B&&(z=this.Na[u.layer]+this.ad.y,q===b.firstPickIndex+1&&(z=90===this.N?Math.max(z,x):Math.min(z,x)),b.m(q++,y,z),b.m(q++,B,z)):(z=Math.max(10,this.fe[u.layer]),G=Math.max(10,this.Fd[u.layer]),180===this.N?(b.m(q++,B+G,D),r&&b.m(q++,B,D),b.m(q++,B-z,D)):90===this.N?(b.m(q++,B,D-z),r&&b.m(q++,B,D),b.m(q++,B,D+G)):270===this.N?
2201 (b.m(q++,B,D+G),r&&b.m(q++,B,D),b.m(q++,B,D-z)):(b.m(q++,B-z,D),r&&b.m(q++,B,D),b.m(q++,B+G,D))));m=u}p&&(y=b.i(q-1).x,x=b.i(q-1).y,B=b.i(q).x,D=b.i(q).y,180===this.N||0===this.N?x!==D&&(z=0===this.N?Math.min(Math.max((B+y)/2,this.Na[n.layer]+this.ad.x),B):Math.max(Math.min((B+y)/2,this.Na[n.layer]+this.ad.x),B),b.m(q++,z,x),b.m(q++,z,D)):y!==B&&(z=90===this.N?Math.min(Math.max((D+x)/2,this.Na[n.layer]+this.ad.y),D):Math.max(Math.min((D+x)/2,this.Na[n.layer]+this.ad.y),D),b.m(q++,y,z),b.m(q++,B,z)))}null!==
2202 d&&r&&(null!==g&&(l===Bc&&(l=b.i(0),d=b.i(2),l.A(d)||b.O(1,(l.x+d.x)/2,(l.y+d.y)/2)),l=b.getLinkPoint(e,g,Bc,!0,!1,f,h),l.o()||l.set(e.actualBounds.center),b.O(0,l.x,l.y)),null!==h&&(k===Bc&&(k=b.i(b.pointsCount-1),l=b.i(b.pointsCount-3),k.A(l)||b.O(b.pointsCount-2,(k.x+l.x)/2,(k.y+l.y)/2)),e=b.getLinkPoint(f,h,Bc,!1,!1,e,g),e.o()||e.set(f.actualBounds.center),b.O(b.pointsCount-1,e.x,e.y)));b.Jf();c.commit()}}}this.avoidOrthogonalOverlaps()};
2203 Us.prototype.avoidOrthogonalOverlaps=function(){if(!(0>=this.linkSpacing)){for(var a=new H,b=this.network.edges.iterator;b.next();){var c=b.value.link;null!==c&&c.isOrthogonal&&!a.contains(c)&&a.add(c)}if(0<a.count)if(90===this.N||270===this.N){b=0;c=[];for(a=a.iterator;a.next();){var d=a.value;if(null!==d&&d.isOrthogonal)for(var e=2;e<d.pointsCount-3;e++){var f=d.i(e);var g=d.i(e+1);if(this.B(f.y,g.y)&&!this.B(f.x,g.x)){var h=new Ot;h.layer=Math.floor(f.y/2);var k=d.i(0),l=d.i(d.pointsCount-1);h.first=
2204 k.x*k.x+k.y;h.cc=l.x*l.x+l.y;h.md=Math.min(f.x,g.x);h.Bc=Math.max(f.x,g.x);h.index=e;h.link=d;if(e+2<d.pointsCount){k=d.i(e-1);l=d.i(e+2);var m=0;k.y<f.y?m=l.y<f.y?3:f.x<g.x?2:1:k.y>f.y&&(m=l.y>f.y?0:g.x<f.x?2:1);h.l=m}c.push(h)}}}if(1<c.length)for(c.sort(this.gz),a=0;a<c.length;){f=c[a].layer;for(d=a+1;d<c.length&&c[d].layer===f;)d++;if(1<d-a)for(f=a;f<d;){g=c[f].Bc;for(e=a+1;e<d&&c[e].md<g;)g=Math.max(g,c[e].Bc),e++;g=e-f;if(1<g){this.Gj(c,this.uu,f,f+g);m=1;h=c[f].cc;for(k=f;k<e;k++)l=c[k],l.cc!==
2205 h&&(m++,h=l.cc);this.Gj(c,this.fz,f,f+g);var n=1;h=c[f].first;for(k=f;k<e;k++)l=c[k],l.first!==h&&(n++,h=l.first);k=!0;l=n;m<n?(k=!1,l=m,h=c[f].cc,this.Gj(c,this.uu,f,f+g)):h=c[f].first;m=0;for(n=f;n<e;n++){var p=c[n];(k?p.first:p.cc)!==h&&(m++,h=k?p.first:p.cc);var r=p.link;f=r.i(p.index);g=r.i(p.index+1);var q=this.linkSpacing*(m-(l-1)/2);if(!r.isAvoiding||Pt(f.x,f.y+q,g.x,g.y+q))b++,r.di(),r.O(p.index,f.x,f.y+q),r.O(p.index+1,g.x,g.y+q),r.Jf()}}f=e}a=d}}else{b=0;c=[];for(a=a.iterator;a.next();)if(d=
2206 a.value,null!==d&&d.isOrthogonal)for(e=2;e<d.pointsCount-3;e++)f=d.i(e),g=d.i(e+1),this.B(f.x,g.x)&&!this.B(f.y,g.y)&&(h=new Ot,h.layer=Math.floor(f.x/2),k=d.i(0),l=d.i(d.pointsCount-1),h.first=k.x+k.y*k.y,h.cc=l.x+l.y*l.y,h.md=Math.min(f.y,g.y),h.Bc=Math.max(f.y,g.y),h.index=e,h.link=d,e+2<d.pointsCount&&(k=d.i(e-1),l=d.i(e+2),m=0,k.x<f.x?m=l.x<f.x?3:f.y<g.y?2:1:k.x>f.x&&(m=l.x>f.x?0:g.y<f.y?2:1),h.l=m),c.push(h));if(1<c.length)for(c.sort(this.gz),a=0;a<c.length;){f=c[a].layer;for(d=a+1;d<c.length&&
2207 c[d].layer===f;)d++;if(1<d-a)for(f=a;f<d;){g=c[f].Bc;for(e=a+1;e<d&&c[e].md<g;)g=Math.max(g,c[e].Bc),e++;g=e-f;if(1<g){this.Gj(c,this.uu,f,f+g);m=1;h=c[f].cc;for(k=f;k<e;k++)l=c[k],l.cc!==h&&(m++,h=l.cc);this.Gj(c,this.fz,f,f+g);n=1;h=c[f].first;for(k=f;k<e;k++)l=c[k],l.first!==h&&(n++,h=l.first);k=!0;l=n;m<n?(k=!1,l=m,h=c[f].cc,this.Gj(c,this.uu,f,f+g)):h=c[f].first;m=0;for(n=f;n<e;n++)if(p=c[n],(k?p.first:p.cc)!==h&&(m++,h=k?p.first:p.cc),r=p.link,f=r.i(p.index),g=r.i(p.index+1),q=this.linkSpacing*
2208 (m-(l-1)/2),!r.isAvoiding||Pt(f.x+q,f.y,g.x+q,g.y))b++,r.di(),r.O(p.index,f.x+q,f.y),r.O(p.index+1,g.x+q,g.y),r.Jf()}f=e}a=d}}}};t=Us.prototype;t.gz=function(a,b){return a instanceof Ot&&b instanceof Ot&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.md<b.md?-1:a.md>b.md?1:a.Bc<b.Bc?-1:a.Bc>b.Bc?1:0:0};t.fz=function(a,b){return a instanceof Ot&&b instanceof Ot&&a!==b?a.first<b.first?-1:a.first>b.first||a.l<b.l?1:a.l>b.l||a.md<b.md?-1:a.md>b.md?1:a.Bc<b.Bc?-1:a.Bc>b.Bc?1:0:0};
2209 t.uu=function(a,b){return a instanceof Ot&&b instanceof Ot&&a!==b?a.cc<b.cc?-1:a.cc>b.cc||a.l<b.l?1:a.l>b.l||a.md<b.md?-1:a.md>b.md?1:a.Bc<b.Bc?-1:a.Bc>b.Bc?1:0:0};t.B=function(a,b){F&&(C(a,Us,"isApprox:a"),C(b,Us,"isApprox:b"));a-=b;return-1<a&&1>a};
2210 t.Gj=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<b(d,e)&&(a[c]=e,a[c+1]=d);else if(0===c)if(d>=e)a.sort(b);else for(c=a.slice(0,d),c.sort(b),b=0;b<d;b++)a[b]=c[b];else if(d>=e)for(d=a.slice(c),d.sort(b),b=c;b<e;b++)a[b]=d[b-c];else for(e=a.slice(c,d),e.sort(b),b=c;b<d;b++)a[b]=e[b-c]};
2211 function Pt(a,b,c,d){F&&(C(a,Us,"isUnoccupied2:px"),C(b,Us,"isUnoccupied2:py"),C(c,Us,"isUnoccupied2:qx"),C(d,Us,"isUnoccupied2:qy"));return!0}function ct(a,b){var c=a.Eb[b];if(c>=a.Ie.length){var d=[];for(var e=0;e<a.Ie.length;e++)d[e]=a.Ie[e];a.Ie=d}void 0===a.Ie[c]||null===a.Ie[c]?d=[]:(d=a.Ie[c],a.Ie[c]=null);a=a.tp[b];for(b=0;b<a.length;b++)c=a[b],d[c.index]=c;return d}function dt(a,b,c){a.Ie[a.Eb[b]]=c}
2212 na.Object.defineProperties(Us.prototype,{layerSpacing:{configurable:!0,get:function(){return this.Ee},set:function(a){this.Ee!==a&&(A(a,"number",Us,"layerSpacing"),0<=a&&(this.Ee=a,this.D()))}},columnSpacing:{configurable:!0,get:function(){return this.ec},set:function(a){this.ec!==a&&(A(a,"number",Us,"columnSpacing"),0<a&&(this.ec=a,this.D()))}},direction:{configurable:!0,get:function(){return this.N},set:function(a){this.N!==a&&(A(a,"number",Us,"direction"),
2213 0===a||90===a||180===a||270===a?(this.N=a,this.D()):v("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))}},cycleRemoveOption:{configurable:!0,get:function(){return this.vl},set:function(a){this.vl!==a&&(gb(a,Us,Us,"cycleRemoveOption"),a===nt||a===Vs||a===$s)&&(this.vl=a,this.D())}},layeringOption:{configurable:!0,get:function(){return this.Zl},set:function(a){this.Zl!==a&&(gb(a,Us,Us,"layeringOption"),a===Ws||a===st||a===ut)&&(this.Zl=a,this.D())}},initializeOption:{configurable:!0,
2214 enumerable:!0,get:function(){return this.Ol},set:function(a){this.Ol!==a&&(gb(a,Us,Us,"initializeOption"),a===Xs||a===At||a===yt)&&(this.Ol=a,this.D())}},iterations:{configurable:!0,get:function(){return this.ck},set:function(a){this.ck!==a&&(C(a,Zs,"iterations"),0<=a&&(this.ck=a,this.D()))}},aggressiveOption:{configurable:!0,get:function(){return this.kl},set:function(a){this.kl!==a&&(gb(a,Us,Us,"aggressiveOption"),a===Et||a===Ys||a===Ft)&&(this.kl=a,this.D())}},packOption:{configurable:!0,
2215 enumerable:!0,get:function(){return this.zg},set:function(a){this.zg!==a&&(A(a,"number",Us,"packOption"),0<=a&&8>a&&(this.zg=a,this.D()))}},setsPortSpots:{configurable:!0,get:function(){return this.xf},set:function(a){this.xf!==a&&(A(a,"boolean",Us,"setsPortSpots"),this.xf=a,this.D())}},linkSpacing:{configurable:!0,get:function(){return this.Zo},set:function(a){this.Zo!==a&&(A(a,"number",Us,"linkSpacing"),0<=a&&(this.Zo=a,this.D()))}},maxLayer:{configurable:!0,
2216 get:function(){return this.ya}},maxIndex:{configurable:!0,get:function(){return this.Ui}},maxColumn:{configurable:!0,get:function(){return this.Ha}},minIndexLayer:{configurable:!0,get:function(){return this.yh}},maxIndexLayer:{configurable:!0,get:function(){return this.uc}}});
2217 var Vs=new E(Us,"CycleDepthFirst",0),nt=new E(Us,"CycleGreedy",1),$s=new E(Us,"CycleFromLayers",2),Ws=new E(Us,"LayerOptimalLinkLength",0),st=new E(Us,"LayerLongestPathSink",1),ut=new E(Us,"LayerLongestPathSource",2),Xs=new E(Us,"InitDepthFirstOut",0),At=new E(Us,"InitDepthFirstIn",1),yt=new E(Us,"InitNaive",2),Et=new E(Us,"AggressiveNone",0),Ys=new E(Us,"AggressiveLess",1),Ft=new E(Us,"AggressiveMore",2),Gt=8;Us.className="LayeredDigraphLayout";Us.CycleDepthFirst=Vs;Us.CycleGreedy=nt;
2218 Us.CycleFromLayers=$s;Us.LayerOptimalLinkLength=Ws;Us.LayerLongestPathSink=st;Us.LayerLongestPathSource=ut;Us.InitDepthFirstOut=Xs;Us.InitDepthFirstIn=At;Us.InitNaive=yt;Us.AggressiveNone=Et;Us.AggressiveLess=Ys;Us.AggressiveMore=Ft;Us.PackNone=0;Us.PackExpand=1;Us.PackStraighten=2;Us.PackMedian=4;Us.PackAll=15;function Ot(){this.index=this.Bc=this.md=this.cc=this.first=this.layer=0;this.link=null;this.l=0}Ot.className="SegInfo";function Zs(a){sq.call(this,a)}ma(Zs,sq);Zs.prototype.createVertex=function(){return new Qt(this)};
2219 Zs.prototype.createEdge=function(){return new Rt(this)};Zs.className="LayeredDigraphNetwork";function Qt(a){Gq.call(this,a);this.Xa=this.dh=this.Qi=-1;this.L=NaN;this.W=null;this.valid=!1;this.finish=this.Og=NaN;this.If=0;this.Xk=this.Yk=null}ma(Qt,Gq);
2220 Qt.prototype.serializeVertexProperties=function(a,b){Gq.prototype.serializeVertexProperties.call(this,a,b);a.layer=this.layer;a.column=this.column;a.index=this.index;a.component=this.component;a.near=this.near?ob(this.near):null;a.valid=this.valid;a.Og=this.Og;a.finish=this.finish;a.If=this.If;a.Yk=this.Yk;a.Xk=this.Xk};
2221 Qt.prototype.Pq=function(a,b,c,d){Gq.prototype.Pq.call(this,a,b,c,d);this.layer=a.layer;this.column=a.column;this.index=a.index;this.component=a.component;if(b=b.get(a.near))this.near=b;this.valid=a.valid;this.Og=a.Og;this.finish=a.finish;this.If=a.If;this.Yk=a.Yk;this.Xk=a.Xk};
2222 na.Object.defineProperties(Qt.prototype,{layer:{configurable:!0,get:function(){return this.Qi},set:function(a){this.Qi!==a&&(A(a,"number",Qt,"layer"),this.Qi=a)}},column:{configurable:!0,get:function(){return this.dh},set:function(a){this.dh!==a&&(A(a,"number",Qt,"column"),this.dh=a)}},index:{configurable:!0,get:function(){return this.Xa},set:function(a){this.Xa!==a&&(A(a,"number",Qt,"index"),this.Xa=a)}},component:{configurable:!0,get:function(){return this.L},
2223 set:function(a){this.L!==a&&(A(a,"number",Qt,"component"),this.L=a)}},near:{configurable:!0,get:function(){return this.W},set:function(a){this.W!==a&&(F&&null!==a&&w(a,Qt,Qt,"near"),this.W=a)}}});Qt.className="LayeredDigraphVertex";function Rt(a){Hq.call(this,a);this.l=this.Qa=this.kb=!1;this.Pa=this.L=NaN;this.W=this.w=0}ma(Rt,Hq);
2224 Rt.prototype.serializeEdgeProperties=function(a,b){Hq.prototype.serializeEdgeProperties.call(this,a,b);a.valid=this.valid;a.rev=this.rev;a.forest=this.forest;a.portFromPos=this.portFromPos;a.portToPos=this.portToPos;a.portFromColOffset=this.portFromColOffset;a.portToColOffset=this.portToColOffset};
2225 Rt.prototype.deserializeEdgeProperties=function(a,b,c,d){Hq.prototype.deserializeEdgeProperties.call(this,a,b,c,d);this.valid=a.valid;this.rev=a.rev;this.forest=a.forest;this.portFromPos=a.portFromPos;this.portToPos=a.portToPos;this.portFromColOffset=a.portFromColOffset;this.portToColOffset=a.portToColOffset};
2226 na.Object.defineProperties(Rt.prototype,{fromVertex:{configurable:!0,get:function(){return this.dd},set:function(a){this.dd!==a&&(F&&null!==a&&w(a,Qt,Rt,"fromVertex"),this.dd=a)}},toVertex:{configurable:!0,get:function(){return this.ld},set:function(a){this.ld!==a&&(F&&null!==a&&w(a,Qt,Rt,"toVertex"),this.ld=a)}},valid:{configurable:!0,get:function(){return this.kb},set:function(a){this.kb!==a&&(A(a,"boolean",Rt,"valid"),this.kb=a)}},rev:{configurable:!0,
2227 enumerable:!0,get:function(){return this.Qa},set:function(a){this.Qa!==a&&(A(a,"boolean",Rt,"rev"),this.Qa=a)}},forest:{configurable:!0,get:function(){return this.l},set:function(a){this.l!==a&&(A(a,"boolean",Rt,"forest"),this.l=a)}},portFromPos:{configurable:!0,get:function(){return this.L},set:function(a){this.L!==a&&(A(a,"number",Rt,"portFromPos"),this.L=a)}},portToPos:{configurable:!0,get:function(){return this.Pa},set:function(a){this.Pa!==a&&(A(a,"number",
2228 Rt,"portToPos"),this.Pa=a)}},portFromColOffset:{configurable:!0,get:function(){return this.w},set:function(a){this.w!==a&&(A(a,"number",Rt,"portFromColOffset"),this.w=a)}},portToColOffset:{configurable:!0,get:function(){return this.W},set:function(a){this.W!==a&&(A(a,"number",Rt,"portToColOffset"),this.W=a)}}});Rt.className="LayeredDigraphEdge";
2229 function Z(){0<arguments.length&&Ba(Z);Ni.call(this);this.Pb=new I;this.Ip=St;this.qd=Tt;this.Bq=Ut;this.Gs=Vt;this.Cx=[];this.pd=!0;this.Kb=Wt;this.Vd=(new Fb(10,10)).freeze();var a=new Xt(this);this.Y=new Yt(a);this.Z=new Yt(a);this.Hv=[]}ma(Z,Ni);Z.prototype.cloneProtected=function(a){Ni.prototype.cloneProtected.call(this,a);a.Ip=this.Ip;a.Bq=this.Bq;a.Gs=this.Gs;a.pd=this.pd;a.Kb=this.Kb;a.Vd.assign(this.Vd);a.Y.copyInheritedPropertiesFrom(this.Y);a.Z.copyInheritedPropertiesFrom(this.Z)};
2230 Z.prototype.pb=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):Ni.prototype.pb.call(this,a)};Z.prototype.createNetwork=function(){return new Xt(this)};
2231 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 R?(c.Mg(a.nodes,!0,b),c.Mg(a.links,!0,b)):a instanceof If?c.Mg(a.memberParts,!1,b):c.Mg(a.iterator,!1,b);return c};
2232 Z.prototype.doLayout=function(a){F&&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!==Zt&&(this.arrangementOrigin=this.initialOrigin(this.arrangementOrigin));var b=this.diagram;null===b&&a instanceof R&&(b=a);this.path===St&&null!==b?this.qd=b.isTreePathToChildren?Tt:$t:this.qd=this.path===St?Tt:this.path;if(0<this.network.vertexes.count){this.network.Oq();
2233 for(a=this.network.vertexes.iterator;a.next();)b=a.value,b.initialized=!1,b.level=0,b.parent=null,b.children=[];if(0<this.Pb.count){a=new I;for(b=this.Pb.iterator;b.next();){var c=b.value;c instanceof V?(c=this.network.vj(c),null!==c&&a.add(c)):c instanceof Yt&&a.add(c)}this.Pb=a}0===this.Pb.count&&this.findRoots();for(a=this.Pb.copy().iterator;a.next();)b=a.value,b.initialized||(b.initialized=!0,au(this,b));b=this.network.vertexes;for(a=null;a=bu(b),0<a.count;)b=cu(this,a),null!==b&&this.Pb.add(b),
2234 b.initialized=!0,au(this,b),b=a;for(a=this.Pb.iterator;a.next();)b=a.value,b instanceof Yt&&du(this,b);for(a=this.Pb.iterator;a.next();)b=a.value,b instanceof Yt&&eu(this,b);for(a=this.Pb.iterator;a.next();)b=a.value,b instanceof Yt&&fu(this,b);this.Sv();if(this.layerStyle===gu){a=[];for(b=this.network.vertexes.iterator;b.next();){c=b.value;var d=c.parent;null===d&&(d=c);d=0===d.angle||180===d.angle;var e=a[c.level];void 0===e&&(e=0);a[c.level]=Math.max(e,d?c.width:c.height)}for(b=0;b<a.length;b++)void 0===
2235 a[b]&&(a[b]=0);this.Cx=a;for(b=this.network.vertexes.iterator;b.next();)c=b.value,d=c.parent,null===d&&(d=c),0===d.angle||180===d.angle?(180===d.angle&&(c.focusX+=a[c.level]-c.width),c.width=a[c.level]):(270===d.angle&&(c.focusY+=a[c.level]-c.height),c.height=a[c.level])}else if(this.layerStyle===hu)for(a=this.network.vertexes.iterator;a.next();){b=a.value;c=0===b.angle||180===b.angle;d=-1;for(e=0;e<b.children.length;e++){var f=b.children[e];d=Math.max(d,c?f.width:f.height)}if(0<=d)for(e=0;e<b.children.length;e++)f=
2236 b.children[e],c?(180===b.angle&&(f.focusX+=d-f.width),f.width=d):(270===b.angle&&(f.focusY+=d-f.height),f.height=d)}for(a=this.Pb.iterator;a.next();)b=a.value,b instanceof Yt&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.Pb=new I;this.isValidLayout=!0};function bu(a){var b=new I;for(a=a.iterator;a.next();){var c=a.value;c.initialized||b.add(c)}return b}
2237 Z.prototype.findRoots=function(){for(var a=this.network.vertexes,b=a.iterator;b.next();){var c=b.value;switch(this.qd){case Tt:0===c.sourceEdges.count&&this.Pb.add(c);break;case $t:0===c.destinationEdges.count&&this.Pb.add(c);break;default:v("Unhandled path value "+this.qd.toString())}}0===this.Pb.count&&(a=cu(this,a),null!==a&&this.Pb.add(a))};
2238 function cu(a,b){var c=999999,d=null;for(b=b.iterator;b.next();){var e=b.value;switch(a.qd){case Tt:e.sourceEdges.count<c&&(c=e.sourceEdges.count,d=e);break;case $t:e.destinationEdges.count<c&&(c=e.destinationEdges.count,d=e);break;default:v("Unhandled path value "+a.qd.toString())}}return d}
2239 function au(a,b){if(null!==b){F&&w(b,Yt,Z,"walkTree:v");switch(a.qd){case Tt:if(0<b.destinationEdges.count){for(var c=new H,d=b.destinationVertexes;d.next();){var e=d.value;iu(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.ta())}break;case $t:if(0<b.sourceEdges.count){c=new H;for(d=b.sourceVertexes;d.next();)e=d.value,iu(a,b,e)&&c.add(e);0<c.count&&(b.children=c.ta())}break;default:v("Unhandled path value"+a.qd.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var f=c[e];f.initialized=!0;f.level=b.level+
2240 1;f.parent=b;a.Pb.remove(f)}for(b=0;b<d;b++)au(a,c[b])}}function iu(a,b,c){F&&w(b,Yt,Z,"walkOK:v");F&&w(c,Yt,Z,"walkOK:c");if(c.initialized){if(null===b)var d=!1;else{F&&w(c,Yt,Z,"isAncestor:a");F&&w(b,Yt,Z,"isAncestor:b");for(d=b.parent;null!==d&&d!==c;)d=d.parent;d=d===c}if(d||c.level>b.level)return!1;a.removeChild(c.parent,c)}return!0}
2241 Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){F&&w(a,Yt,Z,"removeChild:p");F&&w(b,Yt,Z,"removeChild:c");for(var c=a.children,d=0,e=0;e<c.length;e++)c[e]===b&&d++;if(0<d){d=Array(c.length-d);for(var f=e=0;f<c.length;f++)c[f]!==b&&(d[e++]=c[f]);a.children=d}}};
2242 function du(a,b){if(null!==b){F&&w(b,Yt,Z,"initializeTree:v");a.initializeTreeVertexValues(b);b.alignment===ju&&a.sortTreeVertexChildren(b);for(var c=0,d=b.childrenCount,e=0,f=b.children,g=f.length,h=0;h<g;h++){var k=f[h];du(a,k);c+=k.descendantCount+1;d=Math.max(d,k.maxChildrenCount);e=Math.max(e,k.maxGenerationCount)}b.descendantCount=c;b.maxChildrenCount=d;b.maxGenerationCount=0<d?e+1:0}}
2243 function ku(a,b){F&&w(b,Yt,Z,"mom:v");switch(a.Bq){default:case Ut:return null!==b.parent?b.parent:a.Y;case lu:return null===b.parent?a.Y:null===b.parent.parent?a.Z:b.parent;case mu:return null!==b.parent?null!==b.parent.parent?b.parent.parent:a.Z:a.Y;case nu:var c=!0;if(0===b.childrenCount)c=!1;else for(var d=b.children,e=d.length,f=0;f<e;f++)if(0<d[f].childrenCount){c=!1;break}return c&&null!==b.parent?a.Z:null!==b.parent?b.parent:a.Y}}
2244 Z.prototype.initializeTreeVertexValues=function(a){F&&w(a,Yt,Z,"initializeTreeVertexValues:v");var b=ku(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===ju){b=a.angle;for(var c=a.parent.children,d=0;d<c.length&&a!==c[d];)d++;0===d%2?d!==c.length-1&&(b=90===b?180:180===b?270:270===b?180:270):b=90===b?0:180===b?90:270===b?0:90;a.angle=b}a.initialized=!0};
2245 function eu(a,b){if(null!==b){F&&w(b,Yt,Z,"assignTree:v");a.assignTreeVertexValues(b);b=b.children;for(var c=b.length,d=0;d<c;d++)eu(a,b[d])}}Z.prototype.assignTreeVertexValues=function(){};function fu(a,b){if(null!==b){F&&w(b,Yt,Z,"sortTree:v");b.alignment!==ju&&a.sortTreeVertexChildren(b);b=b.children;for(var c=b.length,d=0;d<c;d++)fu(a,b[d])}}
2246 Z.prototype.sortTreeVertexChildren=function(a){F&&w(a,Yt,Z,"sortTreeVertexChildren:v");switch(a.sorting){case ou:break;case pu:a.children.reverse();break;case qu:a.children.sort(a.comparer);break;case ru:a.children.sort(a.comparer);a.children.reverse();break;default:v("Unhandled sorting value "+a.sorting.toString())}};Z.prototype.Sv=function(){if(this.comments)for(var a=this.network.vertexes.iterator;a.next();)this.addComments(a.value)};
2247 Z.prototype.addComments=function(a){F&&w(a,Yt,Z,"addComments:v");var b=a.angle,c=a.parent,d=0;var e=!1;null!==c&&(d=c.angle,e=c.alignment,e=su(e));b=90===b||270===b;d=90===d||270===d;c=0===a.childrenCount;var f=0,g=0,h=0,k=a.commentSpacing;if(null!==a.node)for(var l=a.node.gw();l.next();){var m=l.value;"Comment"===m.category&&m.canLayout()&&(null===a.comments&&(a.comments=[]),a.comments.push(m),m.Ya(),m=m.measuredBounds,b&&!c||!e&&!d&&c||e&&d&&c?(f=Math.max(f,m.width),g+=m.height+Math.abs(h)):(f+=
2248 m.width+Math.abs(h),g=Math.max(g,m.height)),h=k)}null!==a.comments&&(b&&!c||!e&&!d&&c||e&&d&&c?(f+=Math.abs(a.commentMargin),g=Math.max(0,g-a.height)):(g+=Math.abs(a.commentMargin),f=Math.max(0,f-a.width)),e=L.allocAt(0,0,a.bounds.width+f,a.bounds.height+g),a.bounds=e,L.free(e))};function su(a){return a===tu||a===ju||a===uu||a===vu}function wu(a){return a===tu||a===ju}
2249 function xu(a){F&&w(a,Yt,Z,"isLeftSideBus:v");var b=a.parent;if(null!==b){var c=b.alignment;if(su(c)){if(wu(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===uu)return!0}}return!1}
2250 Z.prototype.layoutComments=function(a){F&&w(a,Yt,Z,"layoutComments:v");if(null!==a.comments){var b=a.node.measuredBounds,c=a.parent,d=a.angle,e=0;var f=!1;null!==c&&(e=c.angle,f=c.alignment,f=su(f));d=90===d||270===d;c=90===e||270===e;for(var g=0===a.childrenCount,h=xu(a),k=0,l=a.comments,m=l.length,n=J.alloc(),p=0;p<m;p++){var r=l[p],q=r.measuredBounds;if(d&&!g||!f&&!c&&g||f&&c&&g){if(135<e&&!f||c&&h)if(0<=a.commentMargin)for(n.h(a.bounds.x-a.commentMargin-q.width,a.bounds.y+k),r.move(n),r=r.Od();r.next();){var u=
2251 r.value;u.fromSpot=nd;u.toSpot=od}else for(n.h(a.bounds.x+2*a.focus.x-a.commentMargin,a.bounds.y+k),r.move(n),r=r.Od();r.next();)u=r.value,u.fromSpot=od,u.toSpot=nd;else if(0<=a.commentMargin)for(n.h(a.bounds.x+2*a.focus.x+a.commentMargin,a.bounds.y+k),r.move(n),r=r.Od();r.next();)u=r.value,u.fromSpot=od,u.toSpot=nd;else for(n.h(a.bounds.x+a.commentMargin-q.width,a.bounds.y+k),r.move(n),r=r.Od();r.next();)u=r.value,u.fromSpot=nd,u.toSpot=od;k=0<=a.commentSpacing?k+(q.height+a.commentSpacing):k+(a.commentSpacing-
2252 q.height)}else{if(135<e&&!f||!c&&h)if(0<=a.commentMargin)for(n.h(a.bounds.x+k,a.bounds.y-a.commentMargin-q.height),r.move(n),r=r.Od();r.next();)u=r.value,u.fromSpot=md,u.toSpot=pd;else for(n.h(a.bounds.x+k,a.bounds.y+2*a.focus.y-a.commentMargin),r.move(n),r=r.Od();r.next();)u=r.value,u.fromSpot=pd,u.toSpot=md;else if(0<=a.commentMargin)for(n.h(a.bounds.x+k,a.bounds.y+2*a.focus.y+a.commentMargin),r.move(n),r=r.Od();r.next();)u=r.value,u.fromSpot=pd,u.toSpot=md;else for(n.h(a.bounds.x+k,a.bounds.y+
2253 a.commentMargin-q.height),r.move(n),r=r.Od();r.next();)u=r.value,u.fromSpot=md,u.toSpot=pd;k=0<=a.commentSpacing?k+(q.width+a.commentSpacing):k+(a.commentSpacing-q.width)}}J.free(n);b=k-a.commentSpacing-(d?b.height:b.width);if(this.qd===Tt)for(a=a.destinationEdges;a.next();)e=a.value.link,null===e||e.isAvoiding||(e.fromEndSegmentLength=0<b?b:NaN);else for(a=a.sourceEdges;a.next();)e=a.value.link,null===e||e.isAvoiding||(e.toEndSegmentLength=0<b?b:NaN)}};
2254 Z.prototype.layoutTree=function(a){if(null!==a){F&&w(a,Yt,Z,"layoutTree:v");for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case yu:zu(this,a);break;case Au:if(a.alignment===ju)zu(this,a);else if(F&&w(a,Yt,Z,"layoutTreeBlock:v"),0===a.childrenCount)d=a.parent,c=!1,b=0,null!==d&&(b=d.angle,c=d.alignment,c=su(c)),d=xu(a),a.V.h(0,0),a.Ba.h(a.width,a.height),null===a.parent||null===a.comments||(180!==b&&270!==b||c)&&!d?a.la.h(0,0):180===b&&!c||(90===b||270===b)&&
2255 d?a.la.h(a.width-2*a.focus.x,0):a.la.h(0,a.height-2*a.focus.y),a.cr=null,a.qr=null;else{var e=Fu(a);b=90===e||270===e;var f=0,g=a.children,h=g.length;for(c=0;c<h;c++)d=g[c],f=Math.max(f,b?d.Ba.width:d.Ba.height);var k=a.alignment;d=k===Gu;var l=k===Hu,m=su(k),n=Math.max(0,a.breadthLimit);c=Iu(a);var p=a.nodeSpacing,r=Ju(a),q=a.rowSpacing,u=0;if(d||l||a.fn||a.gn&&1===a.maxGenerationCount)u=Math.max(0,a.rowIndent);d=a.width;var y=a.height,x=0,z=0,B=0,D=null,G=null,M=0,Y=0,Q=0,ca=0,T=0,P=0,xa=0,ka=0;
2256 m&&!wu(k)&&135<e&&g.reverse();if(wu(k))if(1<h)for(var Aa=0;Aa<h;Aa++)0===Aa%2&&Aa!==h-1&&(ka=Math.max(ka,b?g[Aa].Ba.width:g[Aa].Ba.height));else 1===h&&(ka=b?g[0].Ba.width:g[0].Ba.height);if(m){switch(k){case tu:z=135>e?Ku(a,g,ka,x,z):Lu(a,g,ka,x,z);ka=z.x;x=z.width;z=z.height;break;case uu:for(D=0;D<h;D++)G=g[D],n=G.Ba,B=0===P?0:q,b?(G.V.h(f-n.width,ca+B),x=Math.max(x,n.width),z=Math.max(z,ca+B+n.height),ca+=B+n.height):(G.V.h(Q+B,f-n.height),x=Math.max(x,Q+B+n.width),z=Math.max(z,n.height),Q+=B+
2257 n.width),P++;break;case vu:for(D=0;D<h;D++)G=g[D],f=G.Ba,n=0===P?0:q,b?(G.V.h(p/2+a.focus.x,ca+n),x=Math.max(x,f.width),z=Math.max(z,ca+n+f.height),ca+=n+f.height):(G.V.h(Q+n,p/2+a.focus.y),x=Math.max(x,Q+n+f.width),z=Math.max(z,f.height),Q+=n+f.width),P++}D=Mu(this,2);G=Mu(this,2);b?(D[0].h(0,0),D[1].h(0,z),G[0].h(x,0)):(D[0].h(0,0),D[1].h(x,0),G[0].h(0,z));G[1].h(x,z)}else for(Aa=0;Aa<h;Aa++){var Ua=g[Aa],tb=Ua.Ba;if(b){0<n&&0<P&&Q+p+tb.width>n&&(Q<f&&Nu(a,k,f-Q,0,xa,Aa-1),T++,P=0,xa=Aa,B=z,Q=0,
2258 ca=135<e?-z-q:z+q);Ou(this,Ua,0,ca);var Xa=0;if(0===P){if(D=Ua.cr,G=Ua.qr,M=tb.width,Y=tb.height,null===D||null===G||e!==Fu(Ua))D=Mu(this,2),G=Mu(this,2),D[0].h(0,0),D[1].h(0,Y),G[0].h(M,0),G[1].h(M,Y)}else{var Ya=Ma();Y=Pu(this,a,Ua,D,G,M,Y,Ya);Xa=Y.x;D=Ya[0];G=Ya[1];M=Y.width;Y=Y.height;Oa(Ya);Q<tb.width&&0>Xa&&(Qu(a,-Xa,0,xa,Aa-1),Ru(D,-Xa,0),Ru(G,-Xa,0),Xa=0)}Ua.V.h(Xa,ca);x=Math.max(x,M);z=Math.max(z,B+(0===T?0:q)+tb.height);Q=M}else{0<n&&0<P&&ca+p+tb.height>n&&(ca<f&&Nu(a,k,0,f-ca,xa,Aa-1),
2259 T++,P=0,xa=Aa,B=x,ca=0,Q=135<e?-x-q:x+q);Ou(this,Ua,Q,0);Xa=0;if(0===P){if(D=Ua.cr,G=Ua.qr,M=tb.width,Y=tb.height,null===D||null===G||e!==Fu(Ua))D=Mu(this,2),G=Mu(this,2),D[0].h(0,0),D[1].h(M,0),G[0].h(0,Y),G[1].h(M,Y)}else Ya=Ma(),Y=Pu(this,a,Ua,D,G,M,Y,Ya),Xa=Y.x,D=Ya[0],G=Ya[1],M=Y.width,Y=Y.height,Oa(Ya),ca<tb.height&&0>Xa&&(Qu(a,0,-Xa,xa,Aa-1),Ru(D,0,-Xa),Ru(G,0,-Xa),Xa=0);Ua.V.h(Q,Xa);z=Math.max(z,Y);x=Math.max(x,B+(0===T?0:q)+tb.width);ca=Y}P++}0<T&&(b?(z+=Math.max(0,c),Q<x&&Nu(a,k,x-Q,0,xa,
2260 h-1),0<u&&(l||Qu(a,u,0,0,h-1),x+=u)):(x+=Math.max(0,c),ca<z&&Nu(a,k,0,z-ca,xa,h-1),0<u&&(l||Qu(a,0,u,0,h-1),z+=u)));u=l=0;switch(k){case Su:b?l+=x/2-a.focus.x-r/2:u+=z/2-a.focus.y-r/2;break;case Tu:0<T?b?l+=x/2-a.focus.x-r/2:u+=z/2-a.focus.y-r/2:b?(ka=g[0].V.x+g[0].la.x,l+=ka+(g[h-1].V.x+g[h-1].la.x+2*g[h-1].focus.x-ka)/2-a.focus.x-r/2):(ka=g[0].V.y+g[0].la.y,u+=ka+(g[h-1].V.y+g[h-1].la.y+2*g[h-1].focus.y-ka)/2-a.focus.y-r/2);break;case Gu:b?(l-=r,x+=r):(u-=r,z+=r);break;case Hu:b?(l+=x-a.width+r,
2261 x+=r):(u+=z-a.height+r,z+=r);break;case tu:b?1<h?l+=ka+p/2-a.focus.x:l+=g[0].focus.x-a.focus.x+g[0].la.x:1<h?u+=ka+p/2-a.focus.y:u+=g[0].focus.y-a.focus.y+g[0].la.y;break;case uu:b?l+=x+p/2-a.focus.x:u+=z+p/2-a.focus.y;break;case vu:break;default:v("Unhandled alignment value "+k.toString())}for(r=0;r<h;r++)ka=g[r],b?ka.V.h(ka.V.x+ka.la.x-l,ka.V.y+(135<e?(m?-z:-ka.Ba.height)+ka.la.y-c:y+c+ka.la.y)):ka.V.h(ka.V.x+(135<e?(m?-x:-ka.Ba.width)+ka.la.x-c:d+c+ka.la.x),ka.V.y+ka.la.y-u);h=g=0;m?b?(x=Uu(a,
2262 x,l),0>l&&(l=0),135<e&&(u+=z+c),z+=y+c,k===vu&&(g+=p/2+a.focus.x),h+=y+c):(135<e&&(l+=x+c),x+=d+c,z=Vu(a,z,u),0>u&&(u=0),k===vu&&(h+=p/2+a.focus.y),g+=d+c):b?(null===a.comments?d>x&&(x=Wu(k,d-x,0),g=x.x,h=x.y,x=d,l=0):x=Uu(a,x,l),0>l&&(g-=l,l=0),135<e&&(u+=z+c),z=Math.max(Math.max(z,y),z+y+c),h+=y+c):(135<e&&(l+=x+c),x=Math.max(Math.max(x,d),x+d+c),null===a.comments?y>z&&(z=Wu(k,0,y-z),g=z.x,h=z.y,z=y,u=0):z=Vu(a,z,u),0>u&&(h-=u,u=0),g+=d+c);if(0<T)e=Mu(this,4),T=Mu(this,4),b?(e[2].h(0,y+c),e[3].h(e[2].x,
2263 z),T[2].h(x,e[2].y),T[3].h(T[2].x,e[3].y)):(e[2].h(d+c,0),e[3].h(x,e[2].y),T[2].h(e[2].x,z),T[3].h(e[3].x,T[2].y));else{e=Mu(this,D.length+2);T=Mu(this,G.length+2);for(k=0;k<D.length;k++)m=D[k],e[k+2].h(m.x+g,m.y+h);for(k=0;k<G.length;k++)m=G[k],T[k+2].h(m.x+g,m.y+h)}b?(e[0].h(l,0),e[1].h(e[0].x,y),e[2].y<e[1].y&&(e[2].x>e[0].x?e[2].assign(e[1]):e[1].assign(e[2])),e[3].y<e[2].y&&(e[3].x>e[0].x?e[3].assign(e[2]):e[2].assign(e[3])),T[0].h(l+d,0),T[1].h(T[0].x,y),T[2].y<T[1].y&&(T[2].x<T[0].x?T[2].assign(T[1]):
2264 T[1].assign(T[2])),T[3].y<T[2].y&&(T[3].x<T[0].x?T[3].assign(T[2]):T[2].assign(T[3])),e[2].y-=c/2,T[2].y-=c/2):(e[0].h(0,u),e[1].h(d,e[0].y),e[2].x<e[1].x&&(e[2].y>e[0].y?e[2].assign(e[1]):e[1].assign(e[2])),e[3].x<e[2].x&&(e[3].y>e[0].y?e[3].assign(e[2]):e[2].assign(e[3])),T[0].h(0,u+y),T[1].h(d,T[0].y),T[2].x<T[1].x&&(T[2].y<T[0].y?T[2].assign(T[1]):T[1].assign(T[2])),T[3].x<T[2].x&&(T[3].y<T[0].y?T[3].assign(T[2]):T[2].assign(T[3])),e[2].x-=c/2,T[2].x-=c/2);Xu(this,D);Xu(this,G);a.cr=e;a.qr=T;
2265 a.la.h(l,u);a.Ba.h(x,z)}break;default:v("Unhandled compaction value "+a.compaction.toString())}}};
2266 function zu(a,b){F&&w(b,Yt,Z,"layoutTreeNone:v");if(0===b.childrenCount){var c=!1,d=0;null!==b.parent&&(d=b.parent.angle,c=b.parent.alignment,c=su(c));var e=xu(b);b.V.h(0,0);b.Ba.h(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.la.h(0,0):180===d&&!c||(90===d||270===d)&&e?b.la.h(b.width-2*b.focus.x,0):b.la.h(0,b.height-2*b.focus.y)}else{d=Fu(b);c=90===d||270===d;var f=0;e=b.children;for(var g=e.length,h=0;h<g;h++){var k=e[h];f=Math.max(f,c?k.Ba.width:k.Ba.height)}var l=
2267 b.alignment,m=l===Gu,n=l===Hu;h=su(l);var p=Math.max(0,b.breadthLimit);k=Iu(b);var r=b.nodeSpacing,q=Ju(b),u=m||n?0:q/2,y=b.rowSpacing,x=0;if(m||n||b.fn||b.gn&&1===b.maxGenerationCount)x=Math.max(0,b.rowIndent);m=b.width;var z=b.height,B=0,D=0,G=0,M=0,Y=0,Q=0,ca=0,T=0,P=0,xa=0;h&&!wu(l)&&135<d&&e.reverse();if(wu(l))if(1<g)for(var ka=0;ka<g;ka++){var Aa=e[ka],Ua=Aa.Ba;0===ka%2&&ka!==g-1?P=Math.max(P,(c?Ua.width:Ua.height)+Yu(Aa)-r):0!==ka%2&&(xa=Math.max(xa,(c?Ua.width:Ua.height)+Yu(Aa)-r))}else 1===
2268 g&&(P=c?e[0].Ba.width:e[0].Ba.height);if(h)switch(l){case tu:case ju:D=135>d?Ku(b,e,P,B,D):Lu(b,e,P,B,D);P=D.x;B=D.width;D=D.height;break;case uu:for(a=0;a<g;a++)p=e[a],u=p.Ba,G=0===ca?0:y,c?(p.V.h(f-u.width,Y+G),B=Math.max(B,u.width),D=Math.max(D,Y+G+u.height),Y+=G+u.height):(p.V.h(M+G,f-u.height),B=Math.max(B,M+G+u.width),D=Math.max(D,u.height),M+=G+u.width),ca++;break;case vu:for(f=0;f<g;f++)a=e[f],p=a.Ba,u=0===ca?0:y,c?(a.V.h(r/2+b.focus.x,Y+u),B=Math.max(B,p.width),D=Math.max(D,Y+u+p.height),
2269 Y+=u+p.height):(a.V.h(M+u,r/2+b.focus.y),B=Math.max(B,M+u+p.width),D=Math.max(D,p.height),M+=u+p.width),ca++}else for(xa=0;xa<g;xa++)ka=e[xa],Aa=ka.Ba,c?(0<p&&0<ca&&M+r+Aa.width>p&&(M<f&&Nu(b,l,f-M,0,T,xa-1),Q++,ca=0,T=xa,G=D,M=0,Y=135<d?-D-y:D+y),Ua=0===ca?u:r,Ou(a,ka,0,Y),ka.V.h(M+Ua,Y),B=Math.max(B,M+Ua+Aa.width),D=Math.max(D,G+(0===Q?0:y)+Aa.height),M+=Ua+Aa.width):(0<p&&0<ca&&Y+r+Aa.height>p&&(Y<f&&Nu(b,l,0,f-Y,T,xa-1),Q++,ca=0,T=xa,G=B,Y=0,M=135<d?-B-y:B+y),Ua=0===ca?u:r,Ou(a,ka,M,0),ka.V.h(M,
2270 Y+Ua),D=Math.max(D,Y+Ua+Aa.height),B=Math.max(B,G+(0===Q?0:y)+Aa.width),Y+=Ua+Aa.height),ca++;0<Q&&(c?(D+=Math.max(0,k),M<B&&Nu(b,l,B-M,0,T,g-1),0<x&&(n||Qu(b,x,0,0,g-1),B+=x)):(B+=Math.max(0,k),Y<D&&Nu(b,l,0,D-Y,T,g-1),0<x&&(n||Qu(b,0,x,0,g-1),D+=x)));x=n=0;switch(l){case Su:c?n+=B/2-b.focus.x-q/2:x+=D/2-b.focus.y-q/2;break;case Tu:0<Q?c?n+=B/2-b.focus.x-q/2:x+=D/2-b.focus.y-q/2:c?(l=e[0].V.x+e[0].la.x,n+=l+(e[g-1].V.x+e[g-1].la.x+2*e[g-1].focus.x-l)/2-b.focus.x-q/2):(l=e[0].V.y+e[0].la.y,x+=l+(e[g-
2271 1].V.y+e[g-1].la.y+2*e[g-1].focus.y-l)/2-b.focus.y-q/2);break;case Gu:c?(n-=q,B+=q):(x-=q,D+=q);break;case Hu:c?(n+=B-b.width+q,B+=q):(x+=D-b.height+q,D+=q);break;case tu:case ju:c?1<g?n+=P+r/2-b.focus.x:n+=e[0].focus.x-b.focus.x+e[0].la.x:1<g?x+=P+r/2-b.focus.y:x+=e[0].focus.y-b.focus.y+e[0].la.y;break;case uu:c?n+=B+r/2-b.focus.x:x+=D+r/2-b.focus.y;break;case vu:break;default:v("Unhandled alignment value "+l.toString())}for(q=0;q<g;q++)l=e[q],c?l.V.h(l.V.x+l.la.x-n,l.V.y+(135<d?(h?-D:-l.Ba.height)+
2272 l.la.y-k:z+k+l.la.y)):l.V.h(l.V.x+(135<d?(h?-B:-l.Ba.width)+l.la.x-k:m+k+l.la.x),l.V.y+l.la.y-x);c?(B=Uu(b,B,n),0>n&&(n=0),135<d&&(x+=D+k),D=Math.max(Math.max(D,z),D+z+k)):(135<d&&(n+=B+k),B=Math.max(Math.max(B,m),B+m+k),D=Vu(b,D,x),0>x&&(x=0));b.la.h(n,x);b.Ba.h(B,D)}}
2273 function Ku(a,b,c,d,e){F&&w(a,Yt,Z,"layoutBusChildrenPosDir:v");var f=b.length;if(0===f)return new L(c,0,d,e);if(1===f)return a=b[0],d=a.Ba.width,e=a.Ba.height,new L(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=90===Fu(a),l=0,m=0,n=0,p=0;p<f;p++)if(!(0!==p%2||1<f&&p===f-1)){var r=b[p],q=r.Ba,u=0===l?0:h;if(k){var y=Yu(r)-g;r.V.h(c-(q.width+y),n+u);d=Math.max(d,q.width+y);e=Math.max(e,n+u+q.height);n+=u+q.height}else y=Yu(r)-g,r.V.h(m+u,c-(q.height+y)),e=Math.max(e,q.height+y),d=Math.max(d,m+
2274 u+q.width),m+=u+q.width;l++}l=0;r=m;p=n;k?(m=c+g,n=0):(m=0,n=c+g);for(q=0;q<f;q++)if(0!==q%2){u=b[q];y=u.Ba;var x=0===l?0:h;if(k){var z=Yu(u)-g;u.V.h(m+z,n+x);d=Math.max(d,m+y.width+z);e=Math.max(e,n+x+y.height);n+=x+y.height}else z=Yu(u)-g,u.V.h(m+x,n+z),d=Math.max(d,m+x+y.width),e=Math.max(e,n+y.height+z),m+=x+y.width;l++}1<f&&1===f%2&&(b=b[f-1],f=b.Ba,h=Zu(b),k?(b.V.h(c+g/2-b.focus.x-b.la.x,e+h),k=c+g/2-b.focus.x-b.la.x,d=Math.max(d,k+f.width),0>k&&(d-=k),e=Math.max(e,Math.max(p,n)+h+f.height),
2275 0>b.V.x&&(c=$u(a,b.V.x,!1,c,g))):(b.V.h(d+h,c+g/2-b.focus.y-b.la.y),d=Math.max(d,Math.max(r,m)+h+f.width),n=c+g/2-b.focus.y-b.la.y,e=Math.max(e,n+f.height),0>n&&(e-=n),0>b.V.y&&(c=$u(a,b.V.y,!0,c,g))));return new L(c,0,d,e)}
2276 function Lu(a,b,c,d,e){F&&w(a,Yt,Z,"layoutBusChildrenNegDir:v");var f=b.length;if(0===f)return new L(c,0,d,e);if(1===f)return b=b[0],d=b.Ba.width,e=b.Ba.height,new L(c,0,d,e);for(var g=a.nodeSpacing,h=a.rowSpacing,k=270===Fu(a),l=0,m=0,n=0,p=0;p<f;p++)if(!(0!==p%2||1<f&&p===f-1)){var r=b[p],q=r.Ba,u=0===l?0:h;if(k){var y=Yu(r)-g;n-=u+q.height;r.V.h(c-(q.width+y),n);d=Math.max(d,q.width+y);e=Math.max(e,Math.abs(n))}else y=Yu(r)-g,m-=u+q.width,r.V.h(m,c-(q.height+y)),e=Math.max(e,q.height+y),d=Math.max(d,
2277 Math.abs(m));l++}l=0;r=m;p=n;k?(m=c+g,n=0):(m=0,n=c+g);for(q=0;q<f;q++)if(0!==q%2){u=b[q];y=u.Ba;var x=0===l?0:h;if(k){var z=Yu(u)-g;n-=x+y.height;u.V.h(m+z,n);d=Math.max(d,m+y.width+z);e=Math.max(e,Math.abs(n))}else z=Yu(u)-g,m-=x+y.width,u.V.h(m,n+z),e=Math.max(e,n+y.height+z),d=Math.max(d,Math.abs(m));l++}1<f&&1===f%2&&(h=b[f-1],l=h.Ba,q=Zu(h),k?(h.V.h(c+g/2-h.focus.x-h.la.x,-e-l.height-q),m=c+g/2-h.focus.x-h.la.x,d=Math.max(d,m+l.width),0>m&&(d-=m),e=Math.max(e,Math.abs(Math.min(p,n))+q+l.height),
2278 0>h.V.x&&(c=$u(a,h.V.x,!1,c,g))):(h.V.h(-d-l.width-q,c+g/2-h.focus.y-h.la.y),d=Math.max(d,Math.abs(Math.min(r,m))+q+l.width),n=c+g/2-h.focus.y-h.la.y,e=Math.max(e,n+l.height),0>n&&(e-=n),0>h.V.y&&(c=$u(a,h.V.y,!0,c,g))));for(a=0;a<f;a++)g=b[a],k?g.V.h(g.V.x,g.V.y+e):g.V.h(g.V.x+d,g.V.y);return new L(c,0,d,e)}function Yu(a){F&&w(a,Yt,Z,"fixRelativePostions:child");return null===a.parent?0:a.parent.nodeSpacing}
2279 function Zu(a){F&&w(a,Yt,Z,"fixRelativePostions:lastchild");return null===a.parent?0:a.parent.rowSpacing}function $u(a,b,c,d,e){F&&w(a,Yt,Z,"fixRelativePostions:v");a=a.children;for(var f=a.length,g=0;g<f;g++)c?a[g].V.h(a[g].V.x,a[g].V.y-b):a[g].V.h(a[g].V.x-b,a[g].V.y);b=a[f-1];return Math.max(d,c?b.la.y+b.focus.y-e/2:b.la.x+b.focus.x-e/2)}
2280 function Uu(a,b,c){F&&w(a,Yt,Z,"calculateSubwidth:v");switch(a.alignment){case Tu:case Su:return c+a.width>b&&(b=c+a.width),0>c&&(b-=c),b;case Gu:return a.width>b?a.width:b;case Hu:return 2*a.focus.x>b?a.width:b+a.width-2*a.focus.x;case tu:case ju:return Math.max(a.width,Math.max(b,c+a.width)-Math.min(0,c));case uu:return a.width-a.focus.x+a.nodeSpacing/2+b;case vu:return Math.max(a.width,a.focus.x+a.nodeSpacing/2+b);default:return b}}
2281 function Vu(a,b,c){F&&w(a,Yt,Z,"calculateSubheight:v");switch(a.alignment){case Tu:case Su:return c+a.height>b&&(b=c+a.height),0>c&&(b-=c),b;case Gu:return a.height>b?a.height:b;case Hu:return 2*a.focus.y>b?a.height:b+a.height-2*a.focus.y;case tu:case ju:return Math.max(a.height,Math.max(b,c+a.height)-Math.min(0,c));case uu:return a.height-a.focus.y+a.nodeSpacing/2+b;case vu:return Math.max(a.height,a.focus.y+a.nodeSpacing/2+b);default:return b}}
2282 function Wu(a,b,c){F&&w(a,E,Z,"alignOffset:align");switch(a){case Su:b/=2;c/=2;break;case Tu:b/=2;c/=2;break;case Gu:c=b=0;break;case Hu:break;default:v("Unhandled alignment value "+a.toString())}return new J(b,c)}function Nu(a,b,c,d,e,f){F&&w(a,Yt,Z,"shiftRelPosAlign:v");F&&w(b,E,Z,"shiftRelPosAlign:align");b=Wu(b,c,d);Qu(a,b.x,b.y,e,f)}function Qu(a,b,c,d,e){F&&w(a,Yt,Z,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].V;f.x+=b;f.y+=c}}
2283 function Ou(a,b,c,d){F&&(w(b,Yt,Z,"recordMidPoints:v"),A(c,"number",Z,"recordMidPoints:x"),A(d,"number",Z,"recordMidPoints:y"));var e=b.parent;switch(a.qd){case Tt:for(a=b.sourceEdges;a.next();)b=a.value,b.fromVertex===e&&b.relativePoint.h(c,d);break;case $t:for(a=b.destinationEdges;a.next();)b=a.value,b.toVertex===e&&b.relativePoint.h(c,d);break;default:v("Unhandled path value "+a.qd.toString())}}function Ru(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
2284 function Pu(a,b,c,d,e,f,g,h){F&&w(b,Yt,Z,"mergeFringes:parent");F&&w(c,Yt,Z,"mergeFringes:child");var k=Fu(b),l=90===k||270===k,m=b.nodeSpacing;b=d;var n=e;d=f;var p=g,r=c.cr,q=c.qr;g=c.Ba;var u=l?Math.max(p,g.height):Math.max(d,g.width);if(null===r||k!==Fu(c))r=Mu(a,2),q=Mu(a,2),l?(r[0].h(0,0),r[1].h(0,g.height),q[0].h(g.width,0),q[1].h(q[0].x,r[1].y)):(r[0].h(0,0),r[1].h(g.width,0),q[0].h(0,g.height),q[1].h(r[1].x,q[0].y));if(l){p=9999999;if(!(null===n||2>n.length||null===r||2>r.length))for(e=c=
2285 0;c<n.length&&e<r.length;){f=n[c];var y=r[e];k=y.x;l=y.y;k+=d;var x=f;c+1<n.length&&(x=n[c+1]);var z=y;y=z.x;z=z.y;e+1<r.length&&(z=r[e+1],y=z.x,z=z.y,y+=d);var B=p;f.y===l?B=k-f.x:f.y>l&&f.y<z?B=k+(f.y-l)/(z-l)*(y-k)-f.x:l>f.y&&l<x.y&&(B=k-(f.x+(l-f.y)/(x.y-f.y)*(x.x-f.x)));B<p&&(p=B);x.y<=f.y?c++:z<=l?e++:(x.y<=z&&c++,z<=x.y&&e++)}p=d-p;p+=m;c=r;e=p;if(null===b||2>b.length||null===c||2>c.length)d=null;else{m=Mu(a,b.length+c.length);for(d=f=k=0;f<c.length&&c[f].y<b[0].y;)l=c[f++],m[d++].h(l.x+e,
2286 l.y);for(;k<b.length;)l=b[k++],m[d++].h(l.x,l.y);for(k=b[b.length-1].y;f<c.length&&c[f].y<=k;)f++;for(;f<c.length&&c[f].y>k;)l=c[f++],m[d++].h(l.x+e,l.y);c=Mu(a,d);for(k=0;k<d;k++)c[k].assign(m[k]);Xu(a,m);d=c}f=q;k=p;if(null===n||2>n.length||null===f||2>f.length)e=null;else{m=Mu(a,n.length+f.length);for(e=l=c=0;c<n.length&&n[c].y<f[0].y;)x=n[c++],m[e++].h(x.x,x.y);for(;l<f.length;)x=f[l++],m[e++].h(x.x+k,x.y);for(f=f[f.length-1].y;c<n.length&&n[c].y<=f;)c++;for(;c<n.length&&n[c].y>f;)k=n[c++],m[e++].h(k.x,
2287 k.y);f=Mu(a,e);for(c=0;c<e;c++)f[c].assign(m[c]);Xu(a,m);e=f}f=Math.max(0,p)+g.width;g=u;Xu(a,b);Xu(a,r);Xu(a,n);Xu(a,q);h[0]=d;h[1]=e;return new L(p,0,f,g)}d=9999999;if(!(null===n||2>n.length||null===r||2>r.length))for(e=c=0;c<n.length&&e<r.length;)f=n[c],y=r[e],k=y.x,l=y.y,l+=p,x=f,c+1<n.length&&(x=n[c+1]),z=y,y=z.x,z=z.y,e+1<r.length&&(z=r[e+1],y=z.x,z=z.y,z+=p),B=d,f.x===k?B=l-f.y:f.x>k&&f.x<y?B=l+(f.x-k)/(y-k)*(z-l)-f.y:k>f.x&&k<x.x&&(B=l-(f.y+(k-f.x)/(x.x-f.x)*(x.y-f.y))),B<d&&(d=B),x.x<=f.x?
2288 c++:y<=k?e++:(x.x<=y&&c++,y<=x.x&&e++);p-=d;p+=m;c=r;e=p;if(null===b||2>b.length||null===c||2>c.length)d=null;else{m=Mu(a,b.length+c.length);for(d=f=k=0;f<c.length&&c[f].x<b[0].x;)l=c[f++],m[d++].h(l.x,l.y+e);for(;k<b.length;)l=b[k++],m[d++].h(l.x,l.y);for(k=b[b.length-1].x;f<c.length&&c[f].x<=k;)f++;for(;f<c.length&&c[f].x>k;)l=c[f++],m[d++].h(l.x,l.y+e);c=Mu(a,d);for(k=0;k<d;k++)c[k].assign(m[k]);Xu(a,m);d=c}f=q;k=p;if(null===n||2>n.length||null===f||2>f.length)e=null;else{m=Mu(a,n.length+f.length);
2289 for(e=l=c=0;c<n.length&&n[c].x<f[0].x;)x=n[c++],m[e++].h(x.x,x.y);for(;l<f.length;)x=f[l++],m[e++].h(x.x,x.y+k);for(f=f[f.length-1].x;c<n.length&&n[c].x<=f;)c++;for(;c<n.length&&n[c].x>f;)k=n[c++],m[e++].h(k.x,k.y);f=Mu(a,e);for(c=0;c<e;c++)f[c].assign(m[c]);Xu(a,m);e=f}f=u;g=Math.max(0,p)+g.height;Xu(a,b);Xu(a,r);Xu(a,n);Xu(a,q);h[0]=d;h[1]=e;return new L(p,0,f,g)}function Mu(a,b){a=a.Hv[b];if(void 0!==a&&(a=a.pop(),void 0!==a))return a;a=[];for(var c=0;c<b;c++)a[c]=new J;return a}
2290 function Xu(a,b){var c=b.length,d=a.Hv[c];void 0===d&&(d=[],a.Hv[c]=d);d.push(b)}
2291 Z.prototype.arrangeTrees=function(){if(this.Kb===Zt)for(var a=this.Pb.iterator;a.next();){var b=a.value;if(b instanceof Yt){var c=b.node;if(null!==c){var d=c.position;c=d.x;d=d.y;isFinite(c)||(c=0);isFinite(d)||(d=0);av(this,b,c,d)}}}else{a=[];for(b=this.Pb.iterator;b.next();)c=b.value,c instanceof Yt&&a.push(c);switch(this.sorting){case ou:break;case pu:a.reverse();break;case qu:a.sort(this.comparer);break;case ru:a.sort(this.comparer);a.reverse();break;default:v("Unhandled sorting value "+this.sorting.toString())}c=
2292 this.arrangementOrigin;b=c.x;c=c.y;for(d=0;d<a.length;d++){var e=a[d];av(this,e,b+e.la.x,c+e.la.y);switch(this.Kb){case Wt:c+=e.Ba.height+this.Vd.height;break;case bv:b+=e.Ba.width+this.Vd.width;break;default:v("Unhandled arrangement value "+this.Kb.toString())}}}};function av(a,b,c,d){if(null!==b){F&&w(b,Yt,Z,"assignAbsolutePositions:v");b.x=c;b.y=d;b=b.children;for(var e=b.length,f=0;f<e;f++){var g=b[f];av(a,g,c+g.V.x,d+g.V.y)}}}
2293 Z.prototype.commitLayout=function(){this.Rw();this.commitNodes();this.Vv();this.isRouting&&this.commitLinks()};Z.prototype.commitNodes=function(){for(var a=this.network.vertexes.iterator;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)};
2294 Z.prototype.Vv=function(){if(this.layerStyle===gu){for(var a=this.Cx,b=[],c=null,d=this.network.vertexes.iterator;d.next();){var e=d.value;null===c?c=e.bounds.copy():c.Xc(e.bounds);var f=b[e.level];void 0===f?f=Iu(e):f=Math.max(f,Iu(e));b[e.level]=f}for(d=0;d<b.length;d++)void 0===b[d]&&(b[d]=0);90===this.angle||270===this.angle?(c.Pc(this.nodeSpacing/2,this.layerSpacing),d=new J(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.Pc(this.layerSpacing,this.nodeSpacing/2),d=new J(-this.layerSpacing/2,-this.nodeSpacing/
2295 2));e=[];c=90===this.angle||270===this.angle?c.width:c.height;f=0;if(180===this.angle||270===this.angle)for(var g=0;g<a.length;g++)f+=a[g]+b[g];for(g=0;g<a.length;g++){var h=a[g]+b[g];270===this.angle?(f-=h,e.push(new L(0,f,c,h))):90===this.angle?(e.push(new L(0,f,c,h)),f+=h):180===this.angle?(f-=h,e.push(new L(f,0,h,c))):(e.push(new L(f,0,h,c)),f+=h)}this.commitLayers(e,d)}};Z.prototype.commitLayers=function(){};Z.prototype.commitLinks=function(){for(var a=this.network.edges.iterator;a.next();)a.value.commit()};
2296 Z.prototype.Rw=function(){for(var a=this.Pb.iterator;a.next();){var b=a.value;b instanceof Yt&&cv(this,b)}};function cv(a,b){if(null!==b){F&&w(b,Yt,Z,"setPortSpotsTree:v");a.setPortSpots(b);b=b.children;for(var c=b.length,d=0;d<c;d++)cv(a,b[d])}}
2297 Z.prototype.setPortSpots=function(a){F&&w(a,Yt,Z,"setPortSpots:v");var b=a.alignment;if(su(b)){F&&w(a,Yt,Z,"setPortSpotsBus:v");F&&w(b,E,Z,"setPortSpots:align");var c=this.qd===Tt,d=Fu(a);switch(d){case 0:var e=od;break;case 90:e=pd;break;case 180:e=nd;break;default:e=md}var f=a.children,g=f.length;switch(b){case tu:case ju:for(b=0;b<g;b++){var h=f[b];h=(c?h.sourceEdges:h.destinationEdges).first();if(null!==h&&(h=h.link,null!==h)){var k=90===d||270===d?nd:md;if(1===g||b===g-1&&1===g%2)switch(d){case 0:k=
2298 nd;break;case 90:k=md;break;case 180:k=od;break;default:k=pd}else 0===b%2&&(k=90===d||270===d?od:pd);c?(a.setsPortSpot&&(h.fromSpot=e),a.setsChildPortSpot&&(h.toSpot=k)):(a.setsPortSpot&&(h.fromSpot=k),a.setsChildPortSpot&&(h.toSpot=e))}}break;case uu:d=90===d||270===d?od:pd;for(f=c?a.destinationEdges:a.sourceEdges;f.next();)g=f.value.link,null!==g&&(c?(a.setsPortSpot&&(g.fromSpot=e),a.setsChildPortSpot&&(g.toSpot=d)):(a.setsPortSpot&&(g.fromSpot=d),a.setsChildPortSpot&&(g.toSpot=e)));break;case vu:for(d=
2299 90===d||270===d?nd:md,f=c?a.destinationEdges:a.sourceEdges;f.next();)g=f.value.link,null!==g&&(c?(a.setsPortSpot&&(g.fromSpot=e),a.setsChildPortSpot&&(g.toSpot=d)):(a.setsPortSpot&&(g.fromSpot=d),a.setsChildPortSpot&&(g.toSpot=e)))}}else if(c=Fu(a),this.qd===Tt)for(e=a.destinationEdges;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Ib())switch(c){case 0:d.fromSpot=od;break;case 90:d.fromSpot=pd;break;case 180:d.fromSpot=nd;break;default:d.fromSpot=md}else d.fromSpot=a.portSpot;
2300 if(a.setsChildPortSpot)if(a.childPortSpot.Ib())switch(c){case 0:d.toSpot=nd;break;case 90:d.toSpot=md;break;case 180:d.toSpot=od;break;default:d.toSpot=pd}else d.toSpot=a.childPortSpot}}else for(e=a.sourceEdges;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Ib())switch(c){case 0:d.toSpot=od;break;case 90:d.toSpot=pd;break;case 180:d.toSpot=nd;break;default:d.toSpot=md}else d.toSpot=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Ib())switch(c){case 0:d.fromSpot=nd;break;
2301 case 90:d.fromSpot=md;break;case 180:d.fromSpot=od;break;default:d.fromSpot=pd}else d.fromSpot=a.childPortSpot}};function Fu(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}function Iu(a){F&&w(a,Yt,Z,"computeLayerSpacing:v");var b=Fu(a);b=90===b||270===b;var c=a.layerSpacing;if(0<a.layerSpacingParentOverlap){var d=Math.min(1,a.layerSpacingParentOverlap);c-=b?a.height*d:a.width*d}c<(b?-a.height:-a.width)&&(c=b?-a.height:-a.width);return c}
2302 function Ju(a){F&&w(a,Yt,Z,"computeNodeIndent:v");var b=Fu(a),c=a.nodeIndent;if(0<a.nodeIndentPastParent){var d=Math.min(1,a.nodeIndentPastParent);c+=90===b||270===b?a.width*d:a.height*d}return c=Math.max(0,c)}
2303 na.Object.defineProperties(Z.prototype,{roots:{configurable:!0,get:function(){return this.Pb},set:function(a){this.Pb!==a&&(w(a,I,Z,"roots"),this.Pb=a,this.D())}},path:{configurable:!0,get:function(){return this.Ip},set:function(a){this.Ip!==a&&(gb(a,Z,Z,"path"),this.Ip=a,this.D())}},treeStyle:{configurable:!0,get:function(){return this.Bq},set:function(a){this.Kb!==a&&(gb(a,Z,Z,"treeStyle"),a===Ut||a===mu||a===nu||a===lu)&&(this.Bq=a,this.D())}},layerStyle:{configurable:!0,
2304 enumerable:!0,get:function(){return this.Gs},set:function(a){this.Kb!==a&&(gb(a,Z,Z,"layerStyle"),a===Vt||a===hu||a===gu)&&(this.Gs=a,this.D())}},comments:{configurable:!0,get:function(){return this.pd},set:function(a){this.pd!==a&&(A(a,"boolean",Z,"comments"),this.pd=a,this.D())}},arrangement:{configurable:!0,get:function(){return this.Kb},set:function(a){this.Kb!==a&&(gb(a,Z,Z,"arrangement"),a===Wt||a===bv||a===Zt)&&(this.Kb=a,this.D())}},arrangementSpacing:{configurable:!0,
2305 enumerable:!0,get:function(){return this.Vd},set:function(a){w(a,Fb,Z,"arrangementSpacing");this.Vd.A(a)||(this.Vd.assign(a),this.D())}},rootDefaults:{configurable:!0,get:function(){return this.Y},set:function(a){this.Y!==a&&(w(a,Yt,Z,"rootDefaults"),this.Y=a,this.D())}},alternateDefaults:{configurable:!0,get:function(){return this.Z},set:function(a){this.Z!==a&&(w(a,Yt,Z,"alternateDefaults"),this.Z=a,this.D())}},sorting:{configurable:!0,get:function(){return this.Y.sorting},
2306 set:function(a){this.Y.sorting!==a&&(gb(a,Z,Z,"sorting"),a===ou||a===pu||a===qu||ru)&&(this.Y.sorting=a,this.D())}},comparer:{configurable:!0,get:function(){return this.Y.comparer},set:function(a){this.Y.comparer!==a&&(A(a,"function",Z,"comparer"),this.Y.comparer=a,this.D())}},angle:{configurable:!0,get:function(){return this.Y.angle},set:function(a){this.Y.angle!==a&&(A(a,"number",Z,"angle"),0===a||90===a||180===a||270===a?(this.Y.angle=a,this.D()):v("TreeLayout.angle must be 0, 90, 180, or 270"))}},
2307 alignment:{configurable:!0,get:function(){return this.Y.alignment},set:function(a){this.Y.alignment!==a&&(gb(a,Z,Z,"alignment"),this.Y.alignment=a,this.D())}},nodeIndent:{configurable:!0,get:function(){return this.Y.nodeIndent},set:function(a){this.Y.nodeIndent!==a&&(A(a,"number",Z,"nodeIndent"),0<=a&&(this.Y.nodeIndent=a,this.D()))}},nodeIndentPastParent:{configurable:!0,get:function(){return this.Y.nodeIndentPastParent},set:function(a){this.Y.nodeIndentPastParent!==
2308 a&&(A(a,"number",Z,"nodeIndentPastParent"),0<=a&&1>=a&&(this.Y.nodeIndentPastParent=a,this.D()))}},nodeSpacing:{configurable:!0,get:function(){return this.Y.nodeSpacing},set:function(a){this.Y.nodeSpacing!==a&&(A(a,"number",Z,"nodeSpacing"),this.Y.nodeSpacing=a,this.D())}},layerSpacing:{configurable:!0,get:function(){return this.Y.layerSpacing},set:function(a){this.Y.layerSpacing!==a&&(A(a,"number",Z,"layerSpacing"),this.Y.layerSpacing=a,this.D())}},layerSpacingParentOverlap:{configurable:!0,
2309 enumerable:!0,get:function(){return this.Y.layerSpacingParentOverlap},set:function(a){this.Y.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.Y.layerSpacingParentOverlap=a,this.D()))}},compaction:{configurable:!0,get:function(){return this.Y.compaction},set:function(a){this.Y.compaction!==a&&(gb(a,Z,Z,"compaction"),a===yu||a===Au)&&(this.Y.compaction=a,this.D())}},breadthLimit:{configurable:!0,get:function(){return this.Y.breadthLimit},
2310 set:function(a){this.Y.breadthLimit!==a&&(A(a,"number",Z,"breadthLimit"),0<=a&&(this.Y.breadthLimit=a,this.D()))}},rowSpacing:{configurable:!0,get:function(){return this.Y.rowSpacing},set:function(a){this.Y.rowSpacing!==a&&(A(a,"number",Z,"rowSpacing"),this.Y.rowSpacing=a,this.D())}},rowIndent:{configurable:!0,get:function(){return this.Y.rowIndent},set:function(a){this.Y.rowIndent!==a&&(A(a,"number",Z,"rowIndent"),0<=a&&(this.Y.rowIndent=a,this.D()))}},commentSpacing:{configurable:!0,
2311 enumerable:!0,get:function(){return this.Y.commentSpacing},set:function(a){this.Y.commentSpacing!==a&&(A(a,"number",Z,"commentSpacing"),this.Y.commentSpacing=a,this.D())}},commentMargin:{configurable:!0,get:function(){return this.Y.commentMargin},set:function(a){this.Y.commentMargin!==a&&(A(a,"number",Z,"commentMargin"),this.Y.commentMargin=a,this.D())}},setsPortSpot:{configurable:!0,get:function(){return this.Y.setsPortSpot},set:function(a){this.Y.setsPortSpot!==a&&(A(a,
2312 "boolean",Z,"setsPortSpot"),this.Y.setsPortSpot=a,this.D())}},portSpot:{configurable:!0,get:function(){return this.Y.portSpot},set:function(a){w(a,N,Z,"portSpot");this.Y.portSpot.A(a)||(this.Y.portSpot=a,this.D())}},setsChildPortSpot:{configurable:!0,get:function(){return this.Y.setsChildPortSpot},set:function(a){this.Y.setsChildPortSpot!==a&&(A(a,"boolean",Z,"setsChildPortSpot"),this.Y.setsChildPortSpot=a,this.D())}},childPortSpot:{configurable:!0,get:function(){return this.Y.childPortSpot},
2313 set:function(a){w(a,N,Z,"childPortSpot");this.Y.childPortSpot.A(a)||(this.Y.childPortSpot=a,this.D())}},alternateSorting:{configurable:!0,get:function(){return this.Z.sorting},set:function(a){this.Z.sorting!==a&&(gb(a,Z,Z,"alternateSorting"),a===ou||a===pu||a===qu||ru)&&(this.Z.sorting=a,this.D())}},alternateComparer:{configurable:!0,get:function(){return this.Z.comparer},set:function(a){this.Z.comparer!==a&&(A(a,"function",Z,"alternateComparer"),this.Z.comparer=a,this.D())}},
2314 alternateAngle:{configurable:!0,get:function(){return this.Z.angle},set:function(a){this.Z.angle!==a&&(A(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.Z.angle=a,this.D())}},alternateAlignment:{configurable:!0,get:function(){return this.Z.alignment},set:function(a){this.Z.alignment!==a&&(gb(a,Z,Z,"alternateAlignment"),this.Z.alignment=a,this.D())}},alternateNodeIndent:{configurable:!0,get:function(){return this.Z.nodeIndent},set:function(a){this.Z.nodeIndent!==
2315 a&&(A(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.Z.nodeIndent=a,this.D()))}},alternateNodeIndentPastParent:{configurable:!0,get:function(){return this.Z.nodeIndentPastParent},set:function(a){this.Z.nodeIndentPastParent!==a&&(A(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.Z.nodeIndentPastParent=a,this.D()))}},alternateNodeSpacing:{configurable:!0,get:function(){return this.Z.nodeSpacing},set:function(a){this.Z.nodeSpacing!==a&&(A(a,"number",Z,"alternateNodeSpacing"),
2316 this.Z.nodeSpacing=a,this.D())}},alternateLayerSpacing:{configurable:!0,get:function(){return this.Z.layerSpacing},set:function(a){this.Z.layerSpacing!==a&&(A(a,"number",Z,"alternateLayerSpacing"),this.Z.layerSpacing=a,this.D())}},alternateLayerSpacingParentOverlap:{configurable:!0,get:function(){return this.Z.layerSpacingParentOverlap},set:function(a){this.Z.layerSpacingParentOverlap!==a&&(A(a,"number",Z,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.Z.layerSpacingParentOverlap=
2317 a,this.D()))}},alternateCompaction:{configurable:!0,get:function(){return this.Z.compaction},set:function(a){this.Z.compaction!==a&&(gb(a,Z,Z,"alternateCompaction"),a===yu||a===Au)&&(this.Z.compaction=a,this.D())}},alternateBreadthLimit:{configurable:!0,get:function(){return this.Z.breadthLimit},set:function(a){this.Z.breadthLimit!==a&&(A(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.Z.breadthLimit=a,this.D()))}},alternateRowSpacing:{configurable:!0,get:function(){return this.Z.rowSpacing},
2318 set:function(a){this.Z.rowSpacing!==a&&(A(a,"number",Z,"alternateRowSpacing"),this.Z.rowSpacing=a,this.D())}},alternateRowIndent:{configurable:!0,get:function(){return this.Z.rowIndent},set:function(a){this.Z.rowIndent!==a&&(A(a,"number",Z,"alternateRowIndent"),0<=a&&(this.Z.rowIndent=a,this.D()))}},alternateCommentSpacing:{configurable:!0,get:function(){return this.Z.commentSpacing},set:function(a){this.Z.commentSpacing!==a&&(A(a,"number",Z,"alternateCommentSpacing"),
2319 this.Z.commentSpacing=a,this.D())}},alternateCommentMargin:{configurable:!0,get:function(){return this.Z.commentMargin},set:function(a){this.Z.commentMargin!==a&&(A(a,"number",Z,"alternateCommentMargin"),this.Z.commentMargin=a,this.D())}},alternateSetsPortSpot:{configurable:!0,get:function(){return this.Z.setsPortSpot},set:function(a){this.Z.setsPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsPortSpot"),this.Z.setsPortSpot=a,this.D())}},alternatePortSpot:{configurable:!0,
2320 enumerable:!0,get:function(){return this.Z.portSpot},set:function(a){w(a,N,Z,"alternatePortSpot");this.Z.portSpot.A(a)||(this.Z.portSpot=a,this.D())}},alternateSetsChildPortSpot:{configurable:!0,get:function(){return this.Z.setsChildPortSpot},set:function(a){this.Z.setsChildPortSpot!==a&&(A(a,"boolean",Z,"alternateSetsChildPortSpot"),this.Z.setsChildPortSpot=a,this.D())}},alternateChildPortSpot:{configurable:!0,get:function(){return this.Z.childPortSpot},set:function(a){w(a,
2321 N,Z,"alternateChildPortSpot");this.Z.childPortSpot.A(a)||(this.Z.childPortSpot=a,this.D())}}});
2322 var St=new E(Z,"PathDefault",-1),Tt=new E(Z,"PathDestination",0),$t=new E(Z,"PathSource",1),ou=new E(Z,"SortingForwards",10),pu=new E(Z,"SortingReverse",11),qu=new E(Z,"SortingAscending",12),ru=new E(Z,"SortingDescending",13),Su=new E(Z,"AlignmentCenterSubtrees",20),Tu=new E(Z,"AlignmentCenterChildren",21),Gu=new E(Z,"AlignmentStart",22),Hu=new E(Z,"AlignmentEnd",23),tu=new E(Z,"AlignmentBus",24),ju=new E(Z,"AlignmentBusBranching",25),uu=new E(Z,"AlignmentTopLeftBus",26),vu=new E(Z,"AlignmentBottomRightBus",
2323 27),yu=new E(Z,"CompactionNone",30),Au=new E(Z,"CompactionBlock",31),Ut=new E(Z,"StyleLayered",40),nu=new E(Z,"StyleLastParents",41),mu=new E(Z,"StyleAlternating",42),lu=new E(Z,"StyleRootOnly",43),Wt=new E(Z,"ArrangementVertical",50),bv=new E(Z,"ArrangementHorizontal",51),Zt=new E(Z,"ArrangementFixedRoots",52),Vt=new E(Z,"LayerIndividual",60),hu=new E(Z,"LayerSiblings",61),gu=new E(Z,"LayerUniform",62);Z.className="TreeLayout";Z.PathDefault=St;Z.PathDestination=Tt;Z.PathSource=$t;
2324 Z.SortingForwards=ou;Z.SortingReverse=pu;Z.SortingAscending=qu;Z.SortingDescending=ru;Z.AlignmentCenterSubtrees=Su;Z.AlignmentCenterChildren=Tu;Z.AlignmentStart=Gu;Z.AlignmentEnd=Hu;Z.AlignmentBus=tu;Z.AlignmentBusBranching=ju;Z.AlignmentTopLeftBus=uu;Z.AlignmentBottomRightBus=vu;Z.CompactionNone=yu;Z.CompactionBlock=Au;Z.StyleLayered=Ut;Z.StyleLastParents=nu;Z.StyleAlternating=mu;Z.StyleRootOnly=lu;Z.ArrangementVertical=Wt;Z.ArrangementHorizontal=bv;Z.ArrangementFixedRoots=Zt;Z.LayerIndividual=Vt;
2325 Z.LayerSiblings=hu;Z.LayerUniform=gu;function Xt(a){sq.call(this,a)}ma(Xt,sq);Xt.prototype.createVertex=function(){return new Yt(this)};Xt.prototype.createEdge=function(){return new dv(this)};Xt.className="TreeNetwork";
2326 function Yt(a){Gq.call(this,a);this.Pa=!1;this.Ic=null;this.L=[];this.Yc=this.kb=this.W=this.Qa=0;this.pd=null;this.V=new J(0,0);this.Ba=new Fb(0,0);this.la=new J(0,0);this.gn=this.fn=this.sB=!1;this.qr=this.cr=null;this.hd=ou;this.bd=Nq;this.dc=0;this.Db=Tu;this.Qs=this.Ps=0;this.Rs=20;this.Ee=50;this.Fs=0;this.Sr=Au;this.Kr=0;this.dt=25;this.Rr=this.ct=10;this.Qr=20;this.qt=!0;this.Zs=fd;this.pt=!0;this.Nr=fd}ma(Yt,Gq);
2327 Yt.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.hd=a.sorting,this.bd=a.comparer,this.dc=a.angle,this.Db=a.alignment,this.Ps=a.nodeIndent,this.Qs=a.nodeIndentPastParent,this.Rs=a.nodeSpacing,this.Ee=a.layerSpacing,this.Fs=a.layerSpacingParentOverlap,this.Sr=a.compaction,this.Kr=a.breadthLimit,this.dt=a.rowSpacing,this.ct=a.rowIndent,this.Rr=a.commentSpacing,this.Qr=a.commentMargin,this.qt=a.setsPortSpot,this.Zs=a.portSpot,this.pt=a.setsChildPortSpot,this.Nr=a.childPortSpot)};
2328 na.Object.defineProperties(Yt.prototype,{initialized:{configurable:!0,get:function(){return this.Pa},set:function(a){this.Pa!==a&&(A(a,"boolean",Yt,"initialized"),this.Pa=a)}},parent:{configurable:!0,get:function(){return this.Ic},set:function(a){this.Ic!==a&&(F&&null!==a&&w(a,Yt,Yt,"parent"),this.Ic=a)}},children:{configurable:!0,get:function(){return this.L},set:function(a){if(this.L!==a){null===a||Array.isArray(a)||ya(a,"Array",Yt,"children:value");if(null!==
2329 a)for(var b=a.length,c=0;c<b;c++){var d=a[c];F&&w(d,Yt,Yt,"children")}this.L=a}}},level:{configurable:!0,get:function(){return this.Qa},set:function(a){this.Qa!==a&&(A(a,"number",Yt,"level"),this.Qa=a)}},descendantCount:{configurable:!0,get:function(){return this.W},set:function(a){this.W!==a&&(A(a,"number",Yt,"descendantCount"),this.W=a)}},maxChildrenCount:{configurable:!0,get:function(){return this.kb},set:function(a){this.kb!==a&&(A(a,"number",Yt,"maxChildrenCount"),
2330 this.kb=a)}},maxGenerationCount:{configurable:!0,get:function(){return this.Yc},set:function(a){this.Yc!==a&&(A(a,"number",Yt,"maxGenerationCount"),this.Yc=a)}},comments:{configurable:!0,get:function(){return this.pd},set:function(a){if(this.pd!==a){null===a||Array.isArray(a)||ya(a,"Array",Yt,"comments:value");if(null!==a)for(var b=a.length,c=0;c<b;c++){var d=a[c];F&&w(d,V,Yt,"comments")}this.pd=a}}},sorting:{configurable:!0,get:function(){return this.hd},
2331 set:function(a){this.hd!==a&&(gb(a,Z,Yt,"sorting"),this.hd=a)}},comparer:{configurable:!0,get:function(){return this.bd},set:function(a){this.bd!==a&&(A(a,"function",Yt,"comparer"),this.bd=a)}},angle:{configurable:!0,get:function(){return this.dc},set:function(a){this.dc!==a&&(A(a,"number",Yt,"angle"),this.dc=a)}},alignment:{configurable:!0,get:function(){return this.Db},set:function(a){this.Db!==a&&(gb(a,Z,Yt,"alignment"),this.Db=a)}},nodeIndent:{configurable:!0,
2332 enumerable:!0,get:function(){return this.Ps},set:function(a){this.Ps!==a&&(A(a,"number",Yt,"nodeIndent"),this.Ps=a)}},nodeIndentPastParent:{configurable:!0,get:function(){return this.Qs},set:function(a){this.Qs!==a&&(A(a,"number",Yt,"nodeIndentPastParent"),this.Qs=a)}},nodeSpacing:{configurable:!0,get:function(){return this.Rs},set:function(a){this.Rs!==a&&(A(a,"number",Yt,"nodeSpacing"),this.Rs=a)}},layerSpacing:{configurable:!0,get:function(){return this.Ee},
2333 set:function(a){this.Ee!==a&&(A(a,"number",Yt,"layerSpacing"),this.Ee=a)}},layerSpacingParentOverlap:{configurable:!0,get:function(){return this.Fs},set:function(a){this.Fs!==a&&(A(a,"number",Yt,"layerSpacingParentOverlap"),this.Fs=a)}},compaction:{configurable:!0,get:function(){return this.Sr},set:function(a){this.Sr!==a&&(gb(a,Z,Yt,"compaction"),this.Sr=a)}},breadthLimit:{configurable:!0,get:function(){return this.Kr},set:function(a){this.Kr!==a&&(A(a,"number",
2334 Yt,"breadthLimit"),this.Kr=a)}},rowSpacing:{configurable:!0,get:function(){return this.dt},set:function(a){this.dt!==a&&(A(a,"number",Yt,"rowSpacing"),this.dt=a)}},rowIndent:{configurable:!0,get:function(){return this.ct},set:function(a){this.ct!==a&&(A(a,"number",Yt,"rowIndent"),this.ct=a)}},commentSpacing:{configurable:!0,get:function(){return this.Rr},set:function(a){this.Rr!==a&&(A(a,"number",Yt,"commentSpacing"),this.Rr=a)}},commentMargin:{configurable:!0,
2335 enumerable:!0,get:function(){return this.Qr},set:function(a){this.Qr!==a&&(A(a,"number",Yt,"commentMargin"),this.Qr=a)}},setsPortSpot:{configurable:!0,get:function(){return this.qt},set:function(a){this.qt!==a&&(A(a,"boolean",Yt,"setsPortSpot"),this.qt=a)}},portSpot:{configurable:!0,get:function(){return this.Zs},set:function(a){w(a,N,Yt,"portSpot");this.Zs.A(a)||(this.Zs=a)}},setsChildPortSpot:{configurable:!0,get:function(){return this.pt},set:function(a){this.pt!==
2336 a&&(A(a,"boolean",Yt,"setsChildPortSpot"),this.pt=a)}},childPortSpot:{configurable:!0,get:function(){return this.Nr},set:function(a){w(a,N,Yt,"childPortSpot");this.Nr.A(a)||(this.Nr=a)}},childrenCount:{configurable:!0,get:function(){return this.children.length}},relativePosition:{configurable:!0,get:function(){return this.V},set:function(a){this.V.set(a)}},subtreeSize:{configurable:!0,get:function(){return this.Ba},set:function(a){this.Ba.set(a)}},
2337 subtreeOffset:{configurable:!0,get:function(){return this.la},set:function(a){this.la.set(a)}}});Yt.className="TreeVertex";function dv(a){Hq.call(this,a);this.yv=new J(0,0)}ma(dv,Hq);
2338 dv.prototype.commit=function(){var a=this.link;if(null!==a&&!a.isAvoiding){var b=this.network.layout,c=null,d=null;switch(b.qd){case Tt:c=this.fromVertex;d=this.toVertex;break;case $t:c=this.toVertex;d=this.fromVertex;break;default:v("Unhandled path value "+b.qd.toString())}if(null!==c&&null!==d)if(b=this.yv,0!==b.x||0!==b.y||c.sB){d=c.bounds;var e=Fu(c),f=Iu(c),g=c.rowSpacing;a.Jj();var h=a.curve===qg,k=a.isOrthogonal,l;a.di();if(k||h){for(l=2;4<a.pointsCount;)a.Iw(2);var m=a.i(1);var n=a.i(2)}else{for(l=
2339 1;3<a.pointsCount;)a.Iw(1);m=a.i(0);n=a.i(a.pointsCount-1)}var p=a.i(a.pointsCount-1);0===e?(c.alignment===Hu?(e=d.bottom+b.y,0===b.y&&m.y>p.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Ju(c))))):c.alignment===Gu?(e=d.top+b.y,0===b.y&&m.y<p.y-c.rowIndent&&(e=Math.max(e,Math.min(m.y,e+Ju(c))))):e=c.fn||c.gn&&1===c.maxGenerationCount?d.top-c.la.y+b.y:d.y+d.height/2+b.y,h?(a.m(l,m.x,e),l++,a.m(l,d.right+f,e),l++,a.m(l,d.right+f+(b.x-g)/3,e),l++,a.m(l,d.right+f+2*(b.x-g)/3,e),l++,a.m(l,d.right+f+(b.x-
2340 g),e),l++,a.m(l,n.x,e)):(k&&(a.m(l,d.right+f/2,m.y),l++),a.m(l,d.right+f/2,e),l++,a.m(l,d.right+f+b.x-(k?g/2:g),e),l++,k&&a.m(l,a.i(l-1).x,n.y))):90===e?(c.alignment===Hu?(e=d.right+b.x,0===b.x&&m.x>p.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Ju(c))))):c.alignment===Gu?(e=d.left+b.x,0===b.x&&m.x<p.x-c.rowIndent&&(e=Math.max(e,Math.min(m.x,e+Ju(c))))):e=c.fn||c.gn&&1===c.maxGenerationCount?d.left-c.la.x+b.x:d.x+d.width/2+b.x,h?(a.m(l,e,m.y),l++,a.m(l,e,d.bottom+f),l++,a.m(l,e,d.bottom+f+(b.y-g)/
2341 3),l++,a.m(l,e,d.bottom+f+2*(b.y-g)/3),l++,a.m(l,e,d.bottom+f+(b.y-g)),l++,a.m(l,e,n.y)):(k&&(a.m(l,m.x,d.bottom+f/2),l++),a.m(l,e,d.bottom+f/2),l++,a.m(l,e,d.bottom+f+b.y-(k?g/2:g)),l++,k&&a.m(l,n.x,a.i(l-1).y))):180===e?(c.alignment===Hu?(e=d.bottom+b.y,0===b.y&&m.y>p.y+c.rowIndent&&(e=Math.min(e,Math.max(m.y,e-Ju(c))))):c.alignment===Gu?(e=d.top+b.y,0===b.y&&m.y<p.y-c.rowIndent&&(e=Math.max(e,Math.min(m.y,e+Ju(c))))):e=c.fn||c.gn&&1===c.maxGenerationCount?d.top-c.la.y+b.y:d.y+d.height/2+b.y,h?
2342 (a.m(l,m.x,e),l++,a.m(l,d.left-f,e),l++,a.m(l,d.left-f+(b.x+g)/3,e),l++,a.m(l,d.left-f+2*(b.x+g)/3,e),l++,a.m(l,d.left-f+(b.x+g),e),l++,a.m(l,n.x,e)):(k&&(a.m(l,d.left-f/2,m.y),l++),a.m(l,d.left-f/2,e),l++,a.m(l,d.left-f+b.x+(k?g/2:g),e),l++,k&&a.m(l,a.i(l-1).x,n.y))):270===e?(c.alignment===Hu?(e=d.right+b.x,0===b.x&&m.x>p.x+c.rowIndent&&(e=Math.min(e,Math.max(m.x,e-Ju(c))))):c.alignment===Gu?(e=d.left+b.x,0===b.x&&m.x<p.x-c.rowIndent&&(e=Math.max(e,Math.min(m.x,e+Ju(c))))):e=c.fn||c.gn&&1===c.maxGenerationCount?
2343 d.left-c.la.x+b.x:d.x+d.width/2+b.x,h?(a.m(l,e,m.y),l++,a.m(l,e,d.top-f),l++,a.m(l,e,d.top-f+(b.y+g)/3),l++,a.m(l,e,d.top-f+2*(b.y+g)/3),l++,a.m(l,e,d.top-f+(b.y+g)),l++,a.m(l,e,n.y)):(k&&(a.m(l,m.x,d.top-f/2),l++),a.m(l,e,d.top-f/2),l++,a.m(l,e,d.top-f+b.y+(k?g/2:g)),l++,k&&a.m(l,n.x,a.i(l-1).y))):v("Invalid angle "+e);a.Jf()}else b=d,F&&w(c,Yt,dv,"adjustRouteForAngleChange:parent"),F&&w(b,Yt,dv,"adjustRouteForAngleChange:child"),a=this.link,f=Fu(c),f!==Fu(b)&&(g=Iu(c),h=c.bounds,c=b.bounds,0===
2344 f&&c.left-h.right<g+1||90===f&&c.top-h.bottom<g+1||180===f&&h.left-c.right<g+1||270===f&&h.top-c.bottom<g+1||(a.Jj(),c=a.curve===qg,b=a.isOrthogonal,d=su(this.fromVertex.alignment),a.di(),0===f?(f=h.right+g/2,c?4===a.pointsCount&&(c=a.i(3).y,a.O(1,f-20,a.i(1).y),a.m(2,f-20,c),a.m(3,f,c),a.m(4,f+20,c),a.O(5,a.i(5).x,c)):b?d?a.O(3,a.i(2).x,a.i(4).y):6===a.pointsCount&&(a.O(2,f,a.i(2).y),a.O(3,f,a.i(3).y)):4===a.pointsCount?a.m(2,f,a.i(2).y):3===a.pointsCount?a.O(1,f,a.i(2).y):2===a.pointsCount&&a.m(1,
2345 f,a.i(1).y)):90===f?(f=h.bottom+g/2,c?4===a.pointsCount&&(c=a.i(3).x,a.O(1,a.i(1).x,f-20),a.m(2,c,f-20),a.m(3,c,f),a.m(4,c,f+20),a.O(5,c,a.i(5).y)):b?d?a.O(3,a.i(2).x,a.i(4).y):6===a.pointsCount&&(a.O(2,a.i(2).x,f),a.O(3,a.i(3).x,f)):4===a.pointsCount?a.m(2,a.i(2).x,f):3===a.pointsCount?a.O(1,a.i(2).x,f):2===a.pointsCount&&a.m(1,a.i(1).x,f)):180===f?(f=h.left-g/2,c?4===a.pointsCount&&(c=a.i(3).y,a.O(1,f+20,a.i(1).y),a.m(2,f+20,c),a.m(3,f,c),a.m(4,f-20,c),a.O(5,a.i(5).x,c)):b?d?a.O(3,a.i(2).x,a.i(4).y):
2346 6===a.pointsCount&&(a.O(2,f,a.i(2).y),a.O(3,f,a.i(3).y)):4===a.pointsCount?a.m(2,f,a.i(2).y):3===a.pointsCount?a.O(1,f,a.i(2).y):2===a.pointsCount&&a.m(1,f,a.i(1).y)):270===f&&(f=h.top-g/2,c?4===a.pointsCount&&(c=a.i(3).x,a.O(1,a.i(1).x,f+20),a.m(2,c,f+20),a.m(3,c,f),a.m(4,c,f-20),a.O(5,c,a.i(5).y)):b?d?a.O(3,a.i(2).x,a.i(4).y):6===a.pointsCount&&(a.O(2,a.i(2).x,f),a.O(3,a.i(3).x,f)):4===a.pointsCount?a.m(2,a.i(2).x,f):3===a.pointsCount?a.O(1,a.i(2).x,f):2===a.pointsCount&&a.m(1,a.i(1).x,f)),a.Jf()))}};
2347 na.Object.defineProperties(dv.prototype,{fromVertex:{configurable:!0,get:function(){return this.dd},set:function(a){this.dd!==a&&(F&&null!==a&&w(a,Yt,dv,"fromVertex"),this.dd=a)}},toVertex:{configurable:!0,get:function(){return this.ld},set:function(a){this.ld!==a&&(F&&null!==a&&w(a,Yt,dv,"toVertex"),this.ld=a)}},relativePoint:{configurable:!0,get:function(){return this.yv},set:function(a){this.yv.set(a)}}});dv.className="TreeEdge";
2348 Ta.prototype.initializeStandardTools=function(){this.fb("Action",new Rg,this.mouseDownTools);this.fb("Relinking",new of,this.mouseDownTools);this.fb("LinkReshaping",new og,this.mouseDownTools);this.fb("Rotating",new Pg,this.mouseDownTools);this.fb("Resizing",new vg,this.mouseDownTools);this.fb("Linking",new hg,this.mouseMoveTools);this.fb("Dragging",new gf,this.mouseMoveTools);this.fb("DragSelecting",new Ug,this.mouseMoveTools);this.fb("Panning",new Vg,this.mouseMoveTools);this.fb("ContextMenu",new Xg,
2349 this.mouseUpTools);this.fb("TextEditing",new hh,this.mouseUpTools);this.fb("ClickCreating",new Sg,this.mouseUpTools);this.fb("ClickSelecting",new Qg,this.mouseUpTools)};Nn("Horizontal",new Sm);Nn("Spot",new Um);Nn("Table",new Ym);Nn("Viewbox",new cn);Nn("TableRow",new an);Nn("TableColumn",new bn);Nn("Graduated",new nn);Nn("Grid",new dn);Hi.add("GraphLinksModel",fr);Hi.add("TreeModel",tr);yq(Es,null);yq(Us,null);
2350 var ev=qa.go,fv={get licenseKey(){return R.licenseKey},set licenseKey(a){R.licenseKey=a},get version(){return R.version},Group:If,EnumValue:E,List:H,Set:I,Map:Bb,Point:J,Size:Fb,Rect:L,Margin:hc,Spot:N,Geometry:zd,PathFigure:ve,PathSegment:we,InputEvent:ye,DiagramEvent:Ae,ChangedEvent:Be,Model:X,GraphLinksModel:Sr,TreeModel:Xr,Binding:Ui,Transaction:Ne,UndoManager:Oe,CommandHandler:ll,Tool:Qe,DraggingTool:gf,DraggingInfo:pf,DraggingOptions:hf,LinkingBaseTool:Tf,LinkingTool:hg,RelinkingTool:of,LinkReshapingTool:og,
2351 ResizingTool:vg,RotatingTool:Pg,ClickSelectingTool:Qg,ActionTool:Rg,ClickCreatingTool:Sg,HTMLInfo:ef,ContextMenuTool:Xg,DragSelectingTool:Ug,PanningTool:Vg,TextEditingTool:hh,ToolManager:Ta,Animation:Dh,AnimationManager:zh,AnimationTrigger:si,Layer:xi,Diagram:R,Palette:el,Overview:hl,Brush:Ol,GraphObject:O,Panel:W,RowColumnDefinition:jk,Shape:Uf,TextBlock:ih,TextBlockMetrics:Ho,Picture:rk,Part:U,Adornment:Ve,Node:V,Link:S,Placeholder:xg,Layout:Ni,LayoutNetwork:sq,LayoutVertex:Gq,LayoutEdge:Hq,GridLayout:gl,
2352 PanelLayout:hm,CircularLayout:Yr,CircularNetwork:os,CircularVertex:Cs,CircularEdge:Ds,ForceDirectedLayout:Es,ForceDirectedNetwork:Fs,ForceDirectedVertex:Ps,ForceDirectedEdge:Ts,LayeredDigraphLayout:Us,LayeredDigraphNetwork:Zs,LayeredDigraphVertex:Qt,LayeredDigraphEdge:Rt,TreeLayout:Z,TreeNetwork:Xt,TreeVertex:Yt,TreeEdge:dv};
2353 "object"===typeof ev&&ev.version&&v("WARNING: a `go` object on the root object is already defined. "+("Debug"in ev?"debug ":"")+"version: "+ev.version+", replaced with version: "+fv.version);R.prototype.go=fv;qa.go=fv;("undefined"===typeof qa||"undefined"===typeof qa.module||"object"!==typeof qa.module.exports)&&qa.define&&"function"===typeof qa.define&&qa.define.amd&&qa.define(fv);fv.Debug=F;F.Nz(fv); 'undefined'!==typeof module&&'object'===typeof module.exports&&(module.exports='undefined'!==typeof global?global.go:self.go); })();
@@ -136,7 +136,7 class GeneratorConfiguration(Configuration):
136 136 print(generator)
137 137 json_trmode = json.dumps({"periode": generator.periode, "Delay": generator.delay, "width": generator.width, "enable": generator.selector})
138 138 print(json_trmode)
139 base64_trmode = base64.urlsafe_b64encode(json_trmode.encode('ascii'))
139 base64_trmode = base64.standard_b64encode(json_trmode.encode('ascii'))
140 140 print(base64_trmode)
141 141 trmode_url = self.device.url() + "trmode?params="
142 142 complete_url_trmode = trmode_url + base64_trmode.decode('ascii')
@@ -21,10 +21,7
21 21 <li><a>----------------</a></li>
22 22 <li><a href="{{ experiment.get_absolute_url_start}}"><span class="fa fa-play" aria-hidden="true"></span> Start</a></li>
23 23 <li><a href="{{ experiment.get_absolute_url_stop }}"><span class="fa fa-stop" aria-hidden="true"></span> Stop</a></li>
24 <li><a href="{% url 'url_mix_experiment' experiment.id %}"><span class="fa fa-random" aria-hidden="true"></span> Mix RC Configurations </a></li>
25 24 <li><a href="{% url 'url_add_dev_conf' experiment.id %}"><span class="fa fa-plus-circle" aria-hidden="true"></span> Add Configuration</a></li>
26 <li><a href="{% url 'url_sum_experiment' experiment.id %}"><span class="fa fa-list-alt" aria-hidden="true"></span> Summary</a></li>
27
28 25 </ul>
29 26 </span>
30 27 {% endblock %}
@@ -18,4 +18,4
18 18 meteorológicos que puedan cubrir estratégicamente todo el territorio nacional. De este modo, el IGP contribuye con ciencia para protegernos,
19 19 con ciencia para avanzar.</p>
20 20
21 {% endblock %}
21 {% endblock %} No newline at end of file
@@ -152,7 +152,7 class PedestalConfiguration(Configuration):
152 152 byte_table.append(temp[1])
153 153 byte_table.append(temp[0])
154 154 print(byte_table)
155 coded_table = base64.urlsafe_b64encode(bytes(byte_table))
155 coded_table = base64.standard_b64encode(bytes(byte_table))
156 156 coded_table_ascii = coded_table.decode('ascii')
157 157 print(coded_table_ascii)
158 158 data = {'axis': pedestal_axis, 'speed': pedestal.speed, 'table': coded_table_ascii}
@@ -168,9 +168,9 class PedestalConfiguration(Configuration):
168 168 json_az = json.dumps({"axis": 'azimuth', "position": first_position})
169 169 json_el = json.dumps({"axis": 'elevation', "position": 0.0})
170 170
171 base64_table = base64.urlsafe_b64encode(json_data.encode('ascii'))
172 base64_az = base64.urlsafe_b64encode(json_az.encode('ascii'))
173 base64_el = base64.urlsafe_b64encode(json_el.encode('ascii'))
171 base64_table = base64.standard_b64encode(json_data.encode('ascii'))
172 base64_az = base64.standard_b64encode(json_az.encode('ascii'))
173 base64_el = base64.standard_b64encode(json_el.encode('ascii'))
174 174
175 175 table_url = self.device.url() + "table?params="
176 176 az_url = self.device.url() + "position?params="
General Comments 0
You need to be logged in to leave comments. Login now