gojs 无水印版

2019年12月04日 阅读数:144
这篇文章主要向大家介绍gojs 无水印版,主要内容包括基础应用、实用技巧、原理机制等方面,希望对大家有所帮助。

直接复制新建go.js文件便可 javascript

/*
 * GoJS v1.7.24 JavaScript Library for HTML Diagrams
 * Northwoods Software, https://www.nwoods.com/
 * GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
 * Copyright (C) 1998-2017 by Northwoods Software Corporation.  All Rights Reserved.
 * THIS SOFTWARE IS LICENSED.  THE LICENSE AGREEMENT IS AT: https://gojs.net/1.7.24/doc/license.html.
 */
(function(window) { var g,ca={};if(!window.document||void 0===window.document.createElement("canvas").getContext)throw window.console&&window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."),Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");if(!Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript");
    Function.prototype.bind||(Function.prototype.bind=function(a){function b(){return f.apply(a,e.concat(d.call(arguments)))}function c(){}var d=Array.prototype.slice,e=d.call(arguments,1),f=this;c.prototype=this.prototype;b.prototype=new c;return b});
    (function(){for(var a=0,b=["ms","moz","webkit","o"],c=0;c<b.length&&!window.requestAnimationFrame;++c)window.requestAnimationFrame=window[b[c]+"RequestAnimationFrame"],window.cancelAnimationFrame=window[b[c]+"CancelAnimationFrame"]||window[b[c]+"CancelRequestAnimationFrame"];window.requestAnimationFrame||(window.requestAnimationFrame=function(b){var c=(new Date).getTime(),f=Math.max(8,16-(c-a)),h=window.setTimeout(function(){b(c+f)},f);a=c+f;return h});window.cancelAnimationFrame||(window.cancelAnimationFrame=
        function(a){window.clearTimeout(a)})})();ca.Debug=null;
    var w={md:1,Sc:2,dd:4,cd:8,Hn:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android"),xI:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 9.0"),sF:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0"),tF:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7"),eL:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Edge/"),Hk:void 0!==window.navigator&&void 0!==
    window.navigator.platform&&0<=window.navigator.platform.toUpperCase().indexOf("MAC"),uF:void 0!==window.navigator&&void 0!==window.navigator.platform&&null!==window.navigator.platform.match(/(iPhone|iPod|iPad)/i),EE:function(a,b,c){var d=-1;return function(){var e=this,f=arguments;-1!==d&&w.clearTimeout(d);d=w.setTimeout(function(){d=-1;c||a.apply(e,f)},b);c&&!d&&a.apply(e,f)}},setTimeout:function(a,b){return window.setTimeout(a,b)},clearTimeout:function(a){window.clearTimeout(a)},createElement:function(a){return window.document.createElement(a)},
        k:function(a){throw Error(a);},ma:function(a,b){var c="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(c+="  to value: "+b);w.k(c)},G:function(a,b,c,d){a instanceof b||(c=w.getTypeName(c),void 0!==d&&(c+="."+d),w.Bd(a,b,c))},j:function(a,b,c,d){typeof a!==b&&(c=w.getTypeName(c),void 0!==d&&(c+="."+d),w.Bd(a,b,c))},wd:function(a,b,c){"number"===typeof a&&isFinite(a)||(b=w.getTypeName(b),void 0!==c&&(b+="."+c),w.k(b+" must be a real number type, and not NaN or Infinity: "+
            a))},mb:function(a,b,c,d){a instanceof da&&a.Ee===b||(c=w.getTypeName(c),void 0!==d&&(c+="."+d),w.Bd(a,"a constant of class "+w.lf(b),c))},DK:function(a,b){"string"===typeof a?ea(a)||w.k('Color "'+a+'" is not a valid color string for '+b):a instanceof ha||w.k("Value for "+b+" must be a color string or a Brush, not "+a)},Bd:function(a,b,c,d){b=w.getTypeName(b);c=w.getTypeName(c);void 0!==d&&(c+="."+d);"string"===typeof a?w.k(c+" value is not an instance of "+b+': "'+a+'"'):w.k(c+" value is not an instance of "+
            b+": "+a)},Fa:function(a,b,c,d){c=w.getTypeName(c);void 0!==d&&(c+="."+d);w.k(c+" is not in the range "+b+": "+a)},kd:function(a){w.k(w.lf(a)+" constructor cannot take any arguments.")},Ma:function(a){w.k("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.")},Fj:function(a,b){w.k("No property to set for this enum value: "+b+" on "+a.toString())},
        trace:function(a){window.console&&window.console.log(a)},hx:{},It:function(a,b){!0!==w.hx[a]&&(w.hx[a]=!0,window.console&&window.console.log(a+" is deprecated in "+b+", see the GoJS change log for more information."))},Pa:function(a){return"object"===typeof a&&null!==a},isArray:function(a){return Array.isArray(a)||a instanceof NodeList||a instanceof HTMLCollection},zI:function(a){return Array.isArray(a)},Xz:function(a,b,c){w.isArray(a)||w.Bd(a,"Array or NodeList or HTMLCollection",b,c)},Za:function(a){return a.length},
        Nl:function(a){return Array.prototype.slice.call(a)},Ba:function(a,b){Array.isArray(a);return a[b]},uE:function(a,b,c){Array.isArray(a)?a[b]=c:w.k("Cannot replace an object in an HTMLCollection or NodeList at "+b)},Kl:function(a,b){if(Array.isArray(a))return a.indexOf(b);for(var c=a.length,d=0;d<c;d++)if(a[d]===b)return d;return-1},sh:function(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):w.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},Lg:function(a,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):w.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},Ay:[],K:function(){var a=w.Ay.pop();return void 0===a?new z:a},xb:function(a,b){var c=w.Ay.pop();if(void 0===c)return new z(a,b);c.x=a;c.y=b;return c},v:function(a){w.Ay.push(a)},PB:[],mm:function(){var a=w.PB.pop();return void 0===a?new ia:a},Ck:function(a){w.PB.push(a)},By:[],Jf:function(){var a=w.By.pop();return void 0===a?new B:a},mg:function(a,b,c,d){var e=w.By.pop();
            if(void 0===e)return new B(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},Db:function(a){w.By.push(a)},QB:[],Kf:function(){var a=w.QB.pop();return void 0===a?new ka:a},we:function(a){w.QB.push(a)},Cy:null,s:function(){var a=w.Cy;return null!==a?(w.Cy=null,a):new la},q:function(a){a.reset();w.Cy=a},OB:[],cb:function(){var a=w.OB.pop();return void 0===a?[]:a},ta:function(a){a.length=0;w.OB.push(a)},jo:Object.freeze([]),qm:1,nc:function(a){a.__gohashid=w.qm++},Vp:function(a){var b=a.__gohashid;
            void 0===b&&(b=w.qm++,a.__gohashid=b);return b},Od:function(a){return a.__gohashid},ga:function(a,b){b.Ly=a;ca[a]=b},Ka:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},ni:function(a){a.ZG=!0},defineProperty:function(a,b,c,d,e){w.j(a,"function","Util.defineProperty:classfunc");w.j(b,"object","Util.defineProperty:propobj");w.j(c,"function","Util.defineProperty:getter");w.j(d,"function","Util.defineProperty:setter");for(var f in b){b=b[f];c={get:c,set:d,
            enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,f,c);e=Object.getOwnPropertyDescriptor(a.prototype,f);b&&e&&Object.defineProperty(a.prototype,b,e);break}},aK:!1,u:function(a,b,c,d){w.j(a,"function","Util.defineReadOnlyProperty:classfunc");w.j(b,"object","Util.defineReadOnlyProperty:propobj");w.j(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var f=b[e];b={get:c,set:function(a){w.k('The property "'+f+'" is read-only and cannot be set to '+
            a)},enumerable:!0};if(void 0!==d)for(var h in d)b[h]=d[h];Object.defineProperty(a.prototype,e,b);d=Object.getOwnPropertyDescriptor(a.prototype,e);f&&d&&Object.defineProperty(a.prototype,f,d);break}},ce:function(a,b){for(var c in b)b[c]=!0;a.prototype.VG=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===typeof a?w.lf(a):null===a?"*":""},lf:function(a){if("function"===typeof a){if(a.Ly)return a.Ly;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9,
            c).trim();if(""!==b)return a.Ly=b}else if("object"===typeof a&&a.constructor)return w.lf(a.constructor);return typeof a},p:function(a,b,c){w.j(a,"function","Util.defineEnumValue:classfunc");w.j(b,"string","Util.defineEnumValue:name");w.j(c,"number","Util.defineEnumValue:num");c=new da(a,b,c);Object.freeze(c);a[b]=c;var d=a.Uu;d instanceof ma||(d=new ma("string",da),a.Uu=d);d.add(b,c);return c},tb:function(a,b){if(!a||!b)return null;var c=void 0;try{"function"===typeof b?c=b(a):"function"===typeof a.getAttribute?
            (c=a.getAttribute(b),null===c&&(c=void 0)):c=a[b]}catch(d){}return c},La:function(a,b,c){if(a&&b)try{"function"===typeof b?b(a,c):"function"===typeof a.setAttribute?a.setAttribute(b,c):a[b]=c}catch(d){}},Ju:function(a,b){w.j(a,"object","Setting properties requires Objects as arguments");w.j(b,"object","Setting properties requires Objects as arguments");var c=a instanceof C,d=a instanceof D,e;for(e in b){""===e&&w.k("Setting properties requires non-empty property names");var f=a,h=e;if(c||d){var k=
            e.indexOf(".");if(0<k){var l=e.substring(0,k);if(c)f=a.xd(l);else if(f=a[l],void 0===f||null===f)f=a.eb[l];w.Pa(f)?h=e.substr(k+1):w.k("Unable to find object named: "+l+" in "+a.toString()+" when trying to set property: "+e)}}if("_"!==h[0]&&!w.jF(f,h))if(d&&"ModelChanged"===h){a.iH(b[h]);continue}else if(d&&"Changed"===h){a.jn(b[h]);continue}else if(d&&w.jF(a.eb,h))f=a.eb;else if(d&&oa(a,h)){a.Nw(h,b[h]);continue}else if(a instanceof F&&"Changed"===h){a.jn(b[h]);continue}else w.k('Trying to set undefined property "'+
            h+'" on object: '+f.toString());f[h]=b[e];"_"===h[0]&&f instanceof G&&f.fH(h)}},jF:function(a,b){if(a.hasOwnProperty(b))return!0;for(var c=Object.getPrototypeOf(a);c&&c!==Function;){if(c.hasOwnProperty(b))return!0;var d=c.VG;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},lJ:function(a){for(var b=[],c=0;256>c;c++)b[c]=c;for(var d=0,e=0,c=0;256>c;c++)d=(d+b[c]+119)%256,e=b[c],b[c]=b[d],b[d]=e;for(var d=c=0,f="",h=0;h<a.length;h++)c=(c+1)%256,d=(d+b[c])%256,e=b[c],b[c]=b[d],b[d]=e,f+=String.fromCharCode(a.charCodeAt(h)^
            b[(b[c]+b[d])%256]);return f},lI:function(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);for(var d=[],e=0,c=0;c<a.length;c+=2)d[e++]=b[a.substr(c,2)];a=d.join("");return""===a?"0":a},Mg:function(a){return w.lJ(w.lI(a))},om:null,adym:"7da71ca0ad381e90",vfo:"2be641fdb162",uH:"@COLOR1",vH:"@COLOR2",FE:!1,Ft:null,Gt:null};
    w.om=function(){var a=window.document.createElement("canvas"),b=a.getContext("2d");b[w.Mg("7ca11abfd022028846")]=w.Mg("398c3597c01238");for(var c=["5da73c80a36755d3038e4972187c3cae51fd22","32ab5ff3b26f42dc0ed90f22432913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)b[w.Mg("7ca11abfd7330390")](w.Mg(c[d-1]),10,15*d+0);b[w.Mg("7ca11abfd022028846")]=w.Mg("39f046ebb36e4b");for(d=1;5>d;d++)b[w.Mg("7ca11abfd7330390")](w.Mg(c[d-
    1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])w.p=function(a,b){var c=new da(a,b,2);Object.freeze(c);a[b]=c;var d=a.Uu;d instanceof ma||(d=new ma("string",da),a.Uu=d);d.add(b,c);return c};return a}();function da(a,b,c){w.nc(this);this.dC=a;this.Sb=b;this.cH=c}w.ga("EnumValue",da);da.prototype.toString=function(){return w.lf(this.dC)+"."+this.Sb};w.u(da,{Ee:"classType"},function(){return this.dC});w.u(da,{name:"name"},function(){return this.Sb});w.u(da,{value:"value"},function(){return this.cH});
    var pa;da.findName=pa=function(a,b){if(void 0===b||null===b||""===b)return null;w.j(a,"function","findName:classfunc");w.j(b,"string","EnumValue.findName:name");var c=a.Uu;return c instanceof ma?c.ka(b):null};function qa(){this.bC=[]}qa.prototype.toString=function(){return this.bC.join("")};qa.prototype.add=function(a){""!==a&&this.bC.push(a)};function ra(){}
    function sa(a){void 0===a&&(a=42);this.seed=a;this.wy=48271;this.Tu=2147483647;this.NB=this.Tu/this.wy;this.KG=this.Tu%this.wy;this.JG=1/this.Tu;this.random()}sa.prototype.random=function(){var a=this.seed%this.NB*this.wy-this.seed/this.NB*this.KG;this.seed=0<a?a:a+this.Tu;return this.seed*this.JG};function ta(){}w.u(ta,{i:"iterator"},function(){return this});ta.prototype.reset=ta.prototype.reset=function(){};ta.prototype.next=ta.prototype.next=function(){return!1};ta.prototype.hasNext=function(){return!1};
    ta.prototype.first=ta.prototype.first=function(){return null};ta.prototype.any=function(){return!1};ta.prototype.all=function(){return!0};ta.prototype.each=function(){return this};ta.prototype.map=function(){return this};ta.prototype.filter=function(){return this};ta.prototype.concat=function(a){return a.i};w.u(ta,{count:"count"},function(){return 0});ta.prototype.Nf=function(){};ta.prototype.toString=function(){return"EmptyIterator"};var ua=new ta;function va(a){this.key=-1;this.value=a}
    w.ce(va,{key:!0,value:!0});w.u(va,{i:"iterator"},function(){return this});va.prototype.reset=va.prototype.reset=function(){this.key=-1};va.prototype.next=va.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};va.prototype.hasNext=function(){return this.next()};va.prototype.first=va.prototype.first=function(){this.key=0;return this.value};va.prototype.any=function(a){this.key=-1;return a(this.value)};va.prototype.all=function(a){this.key=-1;return a(this.value)};
    va.prototype.each=function(a){this.key=-1;a(this.value);return this};va.prototype.map=function(a){return new va(a(this.value))};va.prototype.filter=function(a){return a(this.value)?new va(this.value):ua};va.prototype.concat=function(a){return new xa(this,a.i)};w.u(va,{count:"count"},function(){return 1});va.prototype.Nf=function(){this.value=null};va.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function xa(a,b){this.nl=a;this.ol=b;this.Vu=!1}w.ce(xa,{key:!0,value:!0});
    w.u(xa,{i:"iterator"},function(){return this});xa.prototype.reset=xa.prototype.reset=function(){this.nl.reset();this.ol.reset();this.Vu=!1};xa.prototype.next=xa.prototype.next=function(){if(!this.Vu){var a=this.nl;if(a.next())return this.key=a.key,this.value=a.value,!0;this.Vu=!0}return this.Vu&&(a=this.ol,a.next())?(this.key=a.key,this.value=a.value,!0):!1};xa.prototype.hasNext=function(){return this.next()};
    xa.prototype.first=xa.prototype.first=function(){this.reset();return this.next()?this.value:null};xa.prototype.any=function(a){return this.nl.any(a)||this.ol.any(a)?!0:!1};xa.prototype.all=function(a){return this.nl.all(a)&&this.ol.all(a)?!0:!1};xa.prototype.each=function(a){this.nl.each(a);this.ol.each(a);return this};xa.prototype.map=function(a){return new xa(this.nl.map(a),this.ol.map(a))};xa.prototype.filter=function(a){return new xa(this.nl.filter(a),this.ol.filter(a))};
    xa.prototype.concat=function(a){return new xa(this,a.i)};w.u(xa,{count:"count"},function(){return this.nl.count+this.ol.count});xa.prototype.Nf=function(){this.value=this.key=null};xa.prototype.toString=function(){return"ConcatIterator()"};function za(a){this.xc=a;this.$h=null;a.Qb=null;this.Sa=a.F;this.wc=-1}w.ce(za,{key:!0,value:!0});w.u(za,{i:"iterator"},function(){return this});w.defineProperty(za,{iq:"predicate"},function(){return this.$h},function(a){this.$h=a});
    za.prototype.reset=za.prototype.reset=function(){var a=this.xc;a.Qb=null;this.Sa=a.F;this.wc=-1};za.prototype.next=za.prototype.next=function(){var a=this.xc;if(a.F!==this.Sa){if(0>this.key)return!1;w.Ma(a)}var a=a.n,b=a.length,c=++this.wc,d=this.$h;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.wc=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Nf()}return!1};za.prototype.hasNext=function(){return this.next()};
    za.prototype.first=za.prototype.first=function(){var a=this.xc;this.Sa=a.F;this.wc=0;var a=a.n,b=a.length,c=this.$h;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.wc=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};za.prototype.any=function(a){var b=this.xc;b.Qb=null;var c=b.F;this.wc=-1;for(var d=b.n,e=d.length,f=this.$h,h=0;h<e;h++){var k=d[h];if(null===f||f(k)){if(a(k))return!0;b.F!==c&&w.Ma(b)}}return!1};
    za.prototype.all=function(a){var b=this.xc;b.Qb=null;var c=b.F;this.wc=-1;for(var d=b.n,e=d.length,f=this.$h,h=0;h<e;h++){var k=d[h];if(null===f||f(k)){if(!a(k))return!1;b.F!==c&&w.Ma(b)}}return!0};za.prototype.each=function(a){var b=this.xc;b.Qb=null;var c=b.F;this.wc=-1;for(var d=b.n,e=d.length,f=this.$h,h=0;h<e;h++){var k=d[h];if(null===f||f(k))a(k),b.F!==c&&w.Ma(b)}return this};
    za.prototype.map=function(a){var b=this.xc;b.Qb=null;var c=b.F;this.wc=-1;for(var d=[],e=b.n,f=e.length,h=this.$h,k=0;k<f;k++){var l=e[k];if(null===h||h(l))d.push(a(l)),b.F!==c&&w.Ma(b)}a=new H;a.n=d;a.Hc();return a.i};za.prototype.filter=function(a){var b=this.xc;b.Qb=null;var c=b.F;this.wc=-1;for(var d=[],e=b.n,f=e.length,h=this.$h,k=0;k<f;k++){var l=e[k];if(null===h||h(l))a(l)&&d.push(l),b.F!==c&&w.Ma(b)}a=new H(b.na);a.n=d;a.Hc();return a.i};
    za.prototype.concat=function(a){this.xc.Qb=null;return new xa(this,a.i)};w.u(za,{count:"count"},function(){var a=this.$h;if(null!==a){for(var b=0,c=this.xc.n,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.xc.n.length});za.prototype.Nf=function(){this.key=-1;this.value=null;this.Sa=-1;this.$h=null;this.xc.Qb=this};za.prototype.toString=function(){return"ListIterator@"+this.wc+"/"+this.xc.count};function Aa(a){this.xc=a;a.Oi=null;this.Sa=a.F;this.wc=a.n.length}w.ce(Aa,{key:!0,value:!0});
    w.u(Aa,{i:"iterator"},function(){return this});Aa.prototype.reset=Aa.prototype.reset=function(){var a=this.xc;a.Oi=null;this.Sa=a.F;this.wc=a.n.length};Aa.prototype.next=Aa.prototype.next=function(){var a=this.xc;if(a.F!==this.Sa){if(0>this.key)return!1;w.Ma(a)}var b=--this.wc;if(0<=b)return this.key=b,this.value=a.n[b],!0;this.Nf();return!1};Aa.prototype.hasNext=function(){return this.next()};
    Aa.prototype.first=Aa.prototype.first=function(){var a=this.xc;this.Sa=a.F;var b=a.n;this.wc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};Aa.prototype.any=function(a){var b=this.xc;b.Oi=null;var c=b.F,d=b.n,e=d.length;this.wc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.F!==c&&w.Ma(b)}return!1};Aa.prototype.all=function(a){var b=this.xc;b.Oi=null;var c=b.F,d=b.n,e=d.length;this.wc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.F!==c&&w.Ma(b)}return!0};
    Aa.prototype.each=function(a){var b=this.xc;b.Oi=null;var c=b.F,d=b.n,e=d.length;this.wc=e;for(e-=1;0<=e;e--)a(d[e]),b.F!==c&&w.Ma(b);return this};Aa.prototype.map=function(a){var b=this.xc;b.Oi=null;var c=b.F,d=[],e=b.n,f=e.length;this.wc=f;for(f-=1;0<=f;f--)d.push(a(e[f])),b.F!==c&&w.Ma(b);a=new H;a.n=d;a.Hc();return a.i};
    Aa.prototype.filter=function(a){var b=this.xc;b.Oi=null;var c=b.F,d=[],e=b.n,f=e.length;this.wc=f;for(f-=1;0<=f;f--){var h=e[f];a(h)&&d.push(h);b.F!==c&&w.Ma(b)}a=new H(b.na);a.n=d;a.Hc();return a.i};Aa.prototype.concat=function(a){this.xc.Oi=null;return new xa(this,a.i)};w.u(Aa,{count:"count"},function(){return this.xc.n.length});Aa.prototype.Nf=function(){this.key=-1;this.value=null;this.Sa=-1;this.xc.Oi=this};
    Aa.prototype.toString=function(){return"ListIteratorBackwards("+this.wc+"/"+this.xc.count+")"};
    function H(a){w.nc(this);this.P=!1;this.n=[];this.F=0;this.Oi=this.Qb=null;void 0===a||null===a?this.na=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.na=a:w.Fa(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.na=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:w.Fa(a,"null, a primitive type name, or a class type",
        "List constructor: type")}w.ga("List",H);H.prototype.Hc=function(){var a=this.F;a++;999999999<a&&(a=0);this.F=a};H.prototype.freeze=H.prototype.freeze=function(){this.P=!0;return this};H.prototype.thaw=H.prototype.Qa=function(){this.P=!1;return this};H.prototype.toString=function(){return"List("+w.getTypeName(this.na)+")#"+w.Od(this)};H.prototype.add=H.prototype.add=function(a){null!==a&&(this.P&&w.ma(this,a),this.n.push(a),this.Hc())};H.prototype.push=H.prototype.push=function(a){this.add(a)};
    H.prototype.addAll=H.prototype.Jc=function(a){if(null===a)return this;this.P&&w.ma(this);var b=this.n;if(w.isArray(a))for(var c=w.Za(a),d=0;d<c;d++){var e=w.Ba(a,d);b.push(e)}else for(a=a.i;a.next();)e=a.value,b.push(e);this.Hc();return this};H.prototype.clear=H.prototype.clear=function(){this.P&&w.ma(this);this.n.length=0;this.Hc()};H.prototype.contains=H.prototype.contains=function(a){return null===a?!1:-1!==this.n.indexOf(a)};H.prototype.has=H.prototype.has=function(a){return this.contains(a)};
    H.prototype.indexOf=H.prototype.indexOf=function(a){return null===a?-1:this.n.indexOf(a)};H.prototype.elt=H.prototype.ea=function(a){var b=this.n;(0>a||a>=b.length)&&w.Fa(a,"0 <= i < length",H,"elt:i");return b[a]};H.prototype.get=H.prototype.get=function(a){return this.ea(a)};H.prototype.setElt=H.prototype.kg=function(a,b){var c=this.n;(0>a||a>=c.length)&&w.Fa(a,"0 <= i < length",H,"setElt:i");this.P&&w.ma(this,a);c[a]=b};H.prototype.set=H.prototype.set=function(a,b){this.kg(a,b)};
    H.prototype.first=H.prototype.first=function(){var a=this.n;return 0===a.length?null:a[0]};H.prototype.last=H.prototype.fe=function(){var a=this.n,b=a.length;return 0<b?a[b-1]:null};H.prototype.pop=H.prototype.pop=function(){this.P&&w.ma(this);var a=this.n;return 0<a.length?a.pop():null};H.prototype.any=function(a){for(var b=this.n,c=this.F,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.F!==c&&w.Ma(this)}return!1};
    H.prototype.all=function(a){for(var b=this.n,c=this.F,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.F!==c&&w.Ma(this)}return!0};H.prototype.each=function(a){for(var b=this.n,c=this.F,d=b.length,e=0;e<d;e++)a(b[e]),this.F!==c&&w.Ma(this);return this};H.prototype.map=function(a){for(var b=new H,c=[],d=this.n,e=this.F,f=d.length,h=0;h<f;h++)c.push(a(d[h])),this.F!==e&&w.Ma(this);b.n=c;b.Hc();return b};
    H.prototype.filter=function(a){for(var b=new H(this.na),c=[],d=this.n,e=this.F,f=d.length,h=0;h<f;h++){var k=d[h];a(k)&&c.push(k);this.F!==e&&w.Ma(this)}b.n=c;b.Hc();return b};H.prototype.concat=function(a){return this.copy().Jc(a)};H.prototype.insertAt=H.prototype.Qd=function(a,b){0>a&&w.Fa(a,">= 0",H,"insertAt:i");this.P&&w.ma(this,a);var c=this.n;a>=c.length?c.push(b):c.splice(a,0,b);this.Hc();return!0};
    H.prototype.remove=H.prototype["delete"]=H.prototype.remove=function(a){if(null===a)return!1;this.P&&w.ma(this,a);var b=this.n;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Hc();return!0};H.prototype.removeAt=H.prototype.bd=function(a){var b=this.n;(0>a||a>=b.length)&&w.Fa(a,"0 <= i < length",H,"removeAt:i");this.P&&w.ma(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Hc()};
    H.prototype.removeRange=H.prototype.removeRange=function(a,b){var c=this.n,d=c.length;if(0>a)a=0;else if(a>=d)return this;if(0>b)return this;b>=d&&(b=d-1);if(a>b)return this;this.P&&w.ma(this);for(var e=a,f=b+1;f<d;)c[e++]=c[f++];c.length=d-(b-a+1);this.Hc();return this};H.prototype.copy=function(){var a=new H(this.na),b=this.n;0<b.length&&(a.n=Array.prototype.slice.call(b));return a};H.prototype.toArray=H.prototype.gc=function(){for(var a=this.n,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};
    H.prototype.toSet=H.prototype.yG=function(){for(var a=new I(this.na),b=this.n,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};H.prototype.sort=H.prototype.sort=function(a){this.P&&w.ma(this);this.n.sort(a);this.Hc();return this};
    H.prototype.sortRange=H.prototype.wq=function(a,b,c){var d=this.n,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);this.P&&w.ma(this);var f=c-b;if(1>=f)return this;(0>b||b>=e-1)&&w.Fa(b,"0 <= from < length",H,"sortRange:from");if(2===f)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.Hc()),this;if(0===b)if(c>=e)d.sort(a);else for(f=d.slice(0,c),f.sort(a),a=0;a<c;a++)d[a]=f[a];else if(c>=e)for(f=d.slice(b),f.sort(a),a=b;a<e;a++)d[a]=f[a-b];else for(f=d.slice(b,c),f.sort(a),a=b;a<c;a++)d[a]=f[a-
    b];this.Hc();return this};H.prototype.reverse=H.prototype.reverse=function(){this.P&&w.ma(this);this.n.reverse();this.Hc();return this};w.u(H,{count:"count"},function(){return this.n.length});w.u(H,{size:"size"},function(){return this.n.length});w.u(H,{length:"length"},function(){return this.n.length});w.u(H,{i:"iterator"},function(){if(0>=this.n.length)return ua;var a=this.Qb;return null!==a?(a.reset(),a):new za(this)});
    w.u(H,{Kn:"iteratorBackwards"},function(){if(0>=this.n.length)return ua;var a=this.Oi;return null!==a?(a.reset(),a):new Aa(this)});function Ba(a){this.bi=a;a.Qb=null;this.Sa=a.F;this.Va=null}w.ce(Ba,{key:!0,value:!0});w.u(Ba,{i:"iterator"},function(){return this});Ba.prototype.reset=Ba.prototype.reset=function(){var a=this.bi;a.Qb=null;this.Sa=a.F;this.Va=null};
    Ba.prototype.next=Ba.prototype.next=function(){var a=this.bi;if(a.F!==this.Sa){if(null===this.key)return!1;w.Ma(a)}var b=this.Va,b=null===b?a.Ea:b.Xa;if(null!==b)return this.Va=b,this.value=b.value,this.key=b.key,!0;this.Nf();return!1};Ba.prototype.hasNext=function(){return this.next()};Ba.prototype.first=Ba.prototype.first=function(){var a=this.bi;this.Sa=a.F;a=a.Ea;if(null!==a){this.Va=a;var b=a.value;this.key=a.key;return this.value=b}return null};
    Ba.prototype.any=function(a){var b=this.bi;b.Qb=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(a(d.value))return!0;b.F!==c&&w.Ma(b);d=d.Xa}return!1};Ba.prototype.all=function(a){var b=this.bi;b.Qb=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(!a(d.value))return!1;b.F!==c&&w.Ma(b);d=d.Xa}return!0};Ba.prototype.each=function(a){var b=this.bi;b.Qb=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;)a(d.value),b.F!==c&&w.Ma(b),d=d.Xa;return this};
    Ba.prototype.map=function(a){var b=this.bi;b.Qb=null;for(var c=new H,d=b.F,e=b.Ea;null!==e;)c.add(a(e.value)),b.F!==d&&w.Ma(b),e=e.Xa;return c.i};Ba.prototype.filter=function(a){var b=this.bi;b.Qb=null;for(var c=new H(b.na),d=b.F,e=b.Ea;null!==e;){var f=e.value;a(f)&&c.add(f);b.F!==d&&w.Ma(b);e=e.Xa}return c.i};Ba.prototype.concat=function(a){this.bi.Qb=null;return new xa(this,a.i)};w.u(Ba,{count:"count"},function(){return this.bi.pd});
    Ba.prototype.Nf=function(){this.value=this.key=null;this.Sa=-1;this.bi.Qb=this};Ba.prototype.toString=function(){return null!==this.Va?"SetIterator@"+this.Va.value:"SetIterator"};
    function I(a){w.nc(this);this.P=!1;void 0===a||null===a?this.na=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.na=a:w.Fa(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.na=a===Object?"object":a===String?"string":a===Number?"number":a:w.Fa(a,"null, a primitive type name, or a class type","Set constructor: type");this.qd={};this.pd=0;this.Qb=null;this.F=0;this.Uh=this.Ea=null}w.ga("Set",I);
    I.prototype.Hc=function(){var a=this.F;a++;999999999<a&&(a=0);this.F=a};I.prototype.freeze=I.prototype.freeze=function(){this.P=!0;return this};I.prototype.thaw=I.prototype.Qa=function(){this.P=!1;return this};I.prototype.toString=function(){return"Set("+w.getTypeName(this.na)+")#"+w.Od(this)};
    I.prototype.add=I.prototype.add=function(a){if(null===a)return!1;this.P&&w.ma(this,a);var b=a;w.Pa(a)&&(b=w.Vp(a));return void 0===this.qd[b]?(this.pd++,a=new Ca(a,a),this.qd[b]=a,b=this.Uh,null===b?this.Ea=a:(a.hp=b,b.Xa=a),this.Uh=a,this.Hc(),!0):!1};I.prototype.addAll=I.prototype.Jc=function(a){if(null===a)return this;this.P&&w.ma(this);if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++)this.add(w.Ba(a,c));else for(a=a.i;a.next();)this.add(a.value);return this};
    I.prototype.contains=I.prototype.contains=function(a){if(null===a)return!1;var b=a;return w.Pa(a)&&(b=w.Od(a),void 0===b)?!1:void 0!==this.qd[b]};I.prototype.has=I.prototype.has=function(a){return this.contains(a)};I.prototype.containsAll=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(!this.contains(a.value))return!1;return!0};I.prototype.containsAny=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(this.contains(a.value))return!0;return!1};
    I.prototype.first=I.prototype.first=function(){var a=this.Ea;return null===a?null:a.value};I.prototype.any=function(a){for(var b=this.F,c=this.Ea;null!==c;){if(a(c.value))return!0;this.F!==b&&w.Ma(this);c=c.Xa}return!1};I.prototype.all=function(a){for(var b=this.F,c=this.Ea;null!==c;){if(!a(c.value))return!1;this.F!==b&&w.Ma(this);c=c.Xa}return!0};I.prototype.each=function(a){for(var b=this.F,c=this.Ea;null!==c;)a(c.value),this.F!==b&&w.Ma(this),c=c.Xa;return this};
    I.prototype.map=function(a){for(var b=new I,c=this.F,d=this.Ea;null!==d;)b.add(a(d.value)),this.F!==c&&w.Ma(this),d=d.Xa;return b};I.prototype.filter=function(a){for(var b=new I(this.na),c=this.F,d=this.Ea;null!==d;){var e=d.value;a(e)&&b.add(e);this.F!==c&&w.Ma(this);d=d.Xa}return b};I.prototype.concat=function(a){return this.copy().Jc(a)};
    I.prototype.remove=I.prototype["delete"]=I.prototype.remove=function(a){if(null===a)return!1;this.P&&w.ma(this,a);var b=a;if(w.Pa(a)&&(b=w.Od(a),void 0===b))return!1;a=this.qd[b];if(void 0===a)return!1;var c=a.Xa,d=a.hp;null!==c&&(c.hp=d);null!==d&&(d.Xa=c);this.Ea===a&&(this.Ea=c);this.Uh===a&&(this.Uh=d);delete this.qd[b];this.pd--;this.Hc();return!0};
    I.prototype.removeAll=I.prototype.$x=function(a){if(null===a)return this;this.P&&w.ma(this);if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++)this.remove(w.Ba(a,c));else for(a=a.i;a.next();)this.remove(a.value);return this};I.prototype.retainAll=function(a){if(null===a||0===this.count)return this;this.P&&w.ma(this);var b=new I(this.na);b.Jc(a);a=[];for(var c=this.i;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.$x(a);return this};
    I.prototype.clear=I.prototype.clear=function(){this.P&&w.ma(this);this.qd={};this.pd=0;this.Uh=this.Ea=null;this.Hc()};I.prototype.copy=function(){var a=new I(this.na),b=this.qd,c;for(c in b)a.add(b[c].value);return a};I.prototype.toArray=I.prototype.gc=function(){var a=Array(this.pd),b=this.qd,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};I.prototype.toList=function(){var a=new H(this.na),b=this.qd,c;for(c in b)a.add(b[c].value);return a};w.u(I,{count:"count"},function(){return this.pd});
    w.u(I,{size:"size"},function(){return this.pd});w.u(I,{i:"iterator"},function(){if(0>=this.pd)return ua;var a=this.Qb;return null!==a?(a.reset(),a):new Ba(this)});function Da(a){this.Ga=a;this.Sa=a.F;this.Va=null}w.ce(Da,{key:!0,value:!0});w.u(Da,{i:"iterator"},function(){return this});Da.prototype.reset=Da.prototype.reset=function(){this.Sa=this.Ga.F;this.Va=null};
    Da.prototype.next=Da.prototype.next=function(){var a=this.Ga;if(a.F!==this.Sa){if(null===this.key)return!1;w.Ma(a)}var b=this.Va,b=null===b?a.Ea:b.Xa;if(null!==b)return this.Va=b,this.value=this.key=a=b.key,!0;this.Nf();return!1};Da.prototype.hasNext=function(){return this.next()};Da.prototype.first=Da.prototype.first=function(){var a=this.Ga;this.Sa=a.F;a=a.Ea;return null!==a?(this.Va=a,this.value=this.key=a=a.key):null};
    Da.prototype.any=function(a){var b=this.Ga,c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(a(d.key))return!0;b.F!==c&&w.Ma(b);d=d.Xa}return!1};Da.prototype.all=function(a){var b=this.Ga,c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(!a(d.key))return!1;b.F!==c&&w.Ma(b);d=d.Xa}return!0};Da.prototype.each=function(a){var b=this.Ga,c=b.F;this.Va=null;for(var d=b.Ea;null!==d;)a(d.key),b.F!==c&&w.Ma(b),d=d.Xa;return this};
    Da.prototype.map=function(a){var b=this.Ga,c=b.F;this.Va=null;for(var d=new H,e=b.Ea;null!==e;)d.add(a(e.key)),b.F!==c&&w.Ma(b),e=e.Xa;return d.i};Da.prototype.filter=function(a){var b=this.Ga,c=b.F;this.Va=null;for(var d=new H(b.Th),e=b.Ea;null!==e;){var f=e.key;a(f)&&d.add(f);b.F!==c&&w.Ma(b);e=e.Xa}return d.i};Da.prototype.concat=function(a){return new xa(this,a.i)};w.u(Da,{count:"count"},function(){return this.Ga.pd});Da.prototype.Nf=function(){this.value=this.key=null;this.Sa=-1};
    Da.prototype.toString=function(){return null!==this.Va?"MapKeySetIterator@"+this.Va.value:"MapKeySetIterator"};function Ea(a){w.nc(this);this.P=!0;this.Ga=a}w.Ka(Ea,I);Ea.prototype.freeze=function(){return this};Ea.prototype.Qa=function(){return this};Ea.prototype.toString=function(){return"MapKeySet("+this.Ga.toString()+")"};Ea.prototype.add=Ea.prototype.add=function(){w.k("This Set is read-only: "+this.toString());return!1};
    Ea.prototype.set=Ea.prototype.set=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype.contains=Ea.prototype.contains=function(a){return this.Ga.contains(a)};Ea.prototype.has=Ea.prototype.has=function(a){return this.contains(a)};Ea.prototype.remove=Ea.prototype["delete"]=Ea.prototype.remove=function(){w.k("This Set is read-only: "+this.toString());return!1};Ea.prototype.clear=Ea.prototype.clear=function(){w.k("This Set is read-only: "+this.toString())};
    Ea.prototype.first=Ea.prototype.first=function(){var a=this.Ga.Ea;return null!==a?a.key:null};Ea.prototype.any=function(a){for(var b=this.Ga.Ea;null!==b;){if(a(b.key))return!0;b=b.Xa}return!1};Ea.prototype.all=function(a){for(var b=this.Ga.Ea;null!==b;){if(!a(b.key))return!1;b=b.Xa}return!0};Ea.prototype.each=function(a){for(var b=this.Ga.Ea;null!==b;)a(b.key),b=b.Xa;return this};Ea.prototype.map=function(a){for(var b=new I,c=this.Ga.Ea;null!==c;)b.add(a(c.key)),c=c.Xa;return b};
    Ea.prototype.filter=function(a){for(var b=new I(this.Ga.Th),c=this.Ga.Ea;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.Xa}return b};Ea.prototype.concat=function(a){return this.yG().Jc(a)};Ea.prototype.copy=function(){return new Ea(this.Ga)};Ea.prototype.toSet=Ea.prototype.yG=function(){var a=new I(this.Ga.Th),b=this.Ga.qd,c;for(c in b)a.add(b[c].key);return a};Ea.prototype.toArray=Ea.prototype.gc=function(){var a=this.Ga.qd,b=Array(this.Ga.pd),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};
    Ea.prototype.toList=function(){var a=new H(this.Ga.Th),b=this.Ga.qd,c;for(c in b)a.add(b[c].key);return a};w.u(Ea,{count:"count"},function(){return this.Ga.pd});w.u(Ea,{size:"size"},function(){return this.Ga.pd});w.u(Ea,{i:"iterator"},function(){return 0>=this.Ga.pd?ua:new Da(this.Ga)});function Ga(a){this.Ga=a;a.Pi=null;this.Sa=a.F;this.Va=null}w.ce(Ga,{key:!0,value:!0});w.u(Ga,{i:"iterator"},function(){return this});
    Ga.prototype.reset=Ga.prototype.reset=function(){var a=this.Ga;a.Pi=null;this.Sa=a.F;this.Va=null};Ga.prototype.next=Ga.prototype.next=function(){var a=this.Ga;if(a.F!==this.Sa){if(null===this.key)return!1;w.Ma(a)}var b=this.Va,b=null===b?a.Ea:b.Xa;if(null!==b)return this.Va=b,this.value=b.value,this.key=b.key,!0;this.Nf();return!1};Ga.prototype.hasNext=function(){return this.next()};
    Ga.prototype.first=Ga.prototype.first=function(){var a=this.Ga;this.Sa=a.F;a=a.Ea;if(null!==a){this.Va=a;var b=a.value;this.key=a.key;return this.value=b}return null};Ga.prototype.any=function(a){var b=this.Ga;b.Pi=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(a(d.value))return!0;b.F!==c&&w.Ma(b);d=d.Xa}return!1};Ga.prototype.all=function(a){var b=this.Ga;b.Pi=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(!a(d.value))return!1;b.F!==c&&w.Ma(b);d=d.Xa}return!0};
    Ga.prototype.each=function(a){var b=this.Ga;b.Pi=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;)a(d.value),b.F!==c&&w.Ma(b),d=d.Xa;return this};Ga.prototype.map=function(a){var b=this.Ga;b.Pi=null;var c=b.F;this.Va=null;for(var d=new H,e=b.Ea;null!==e;)d.add(a(e.value)),b.F!==c&&w.Ma(b),e=e.Xa;return d.i};Ga.prototype.filter=function(a){var b=this.Ga;b.Pi=null;var c=b.F;this.Va=null;for(var d=new H(b.Th),e=b.Ea;null!==e;){var f=e.value;a(f)&&d.add(f);b.F!==c&&w.Ma(b);e=e.Xa}return d.i};
    Ga.prototype.concat=function(a){this.Ga.Pi=null;return new xa(this,a.i)};w.u(Ga,{count:"count"},function(){return this.Ga.pd});Ga.prototype.Nf=function(){this.value=this.key=null;this.Sa=-1;this.Ga.Pi=this};Ga.prototype.toString=function(){return null!==this.Va?"MapValueSetIterator@"+this.Va.value:"MapValueSetIterator"};function Ca(a,b){this.key=a;this.value=b;this.hp=this.Xa=null}w.ce(Ca,{key:!0,value:!0});Ca.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};
    function Ha(a){this.Ga=a;a.Qb=null;this.Sa=a.F;this.Va=null}w.ce(Ha,{key:!0,value:!0});w.u(Ha,{i:"iterator"},function(){return this});Ha.prototype.reset=Ha.prototype.reset=function(){var a=this.Ga;a.Qb=null;this.Sa=a.F;this.Va=null};Ha.prototype.next=Ha.prototype.next=function(){var a=this.Ga;if(a.F!==this.Sa){if(null===this.key)return!1;w.Ma(a)}var b=this.Va,b=null===b?a.Ea:b.Xa;if(null!==b)return this.Va=b,this.key=b.key,this.value=b.value,!0;this.Nf();return!1};Ha.prototype.hasNext=function(){return this.next()};
    Ha.prototype.first=Ha.prototype.first=function(){var a=this.Ga;this.Sa=a.F;a=a.Ea;return null!==a?(this.Va=a,this.key=a.key,this.value=a.value,a):null};Ha.prototype.any=function(a){var b=this.Ga;b.Qb=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(a(d))return!0;b.F!==c&&w.Ma(b);d=d.Xa}return!1};Ha.prototype.all=function(a){var b=this.Ga;b.Qb=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;){if(!a(d))return!1;b.F!==c&&w.Ma(b);d=d.Xa}return!0};
    Ha.prototype.each=function(a){var b=this.Ga;b.Qb=null;var c=b.F;this.Va=null;for(var d=b.Ea;null!==d;)a(d),b.F!==c&&w.Ma(b),d=d.Xa;return this};Ha.prototype.map=function(a){var b=this.Ga;b.Qb=null;var c=b.F;this.Va=null;for(var d=new H,e=b.Ea;null!==e;)d.add(a(e)),b.F!==c&&w.Ma(b),e=e.Xa;return d.i};Ha.prototype.filter=function(a){var b=this.Ga;b.Qb=null;var c=b.F;this.Va=null;for(var d=new H,e=b.Ea;null!==e;)a(e)&&d.add(e),b.F!==c&&w.Ma(b),e=e.Xa;return d.i};
    Ha.prototype.concat=function(a){this.Ga.Qb=null;return new xa(this,a.i)};w.u(Ha,{count:"count"},function(){return this.Ga.pd});Ha.prototype.Nf=function(){this.value=this.key=null;this.Sa=-1;this.Ga.Qb=this};Ha.prototype.toString=function(){return null!==this.Va?"MapIterator@"+this.Va:"MapIterator"};
    function ma(a,b){w.nc(this);this.P=!1;void 0===a||null===a?this.Th=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.Th=a:w.Fa(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.Th=a===Object?"object":a===String?"string":a===Number?"number":a:w.Fa(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.st=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
    b||"function"===b?this.st=b:w.Fa(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.st=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:w.Fa(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.qd={};this.pd=0;this.Pi=this.Qb=null;this.F=0;this.Uh=this.Ea=null}w.ga("Map",ma);
    ma.prototype.Hc=function(){var a=this.F;a++;999999999<a&&(a=0);this.F=a};ma.prototype.freeze=ma.prototype.freeze=function(){this.P=!0;return this};ma.prototype.thaw=ma.prototype.Qa=function(){this.P=!1;return this};ma.prototype.toString=function(){return"Map("+w.getTypeName(this.Th)+","+w.getTypeName(this.st)+")#"+w.Od(this)};
    ma.prototype.add=ma.prototype.add=function(a,b){this.P&&w.ma(this,a);var c=a;w.Pa(a)&&(c=w.Vp(a));var d=this.qd[c];if(void 0===d)return this.pd++,d=new Ca(a,b),this.qd[c]=d,c=this.Uh,null===c?this.Ea=d:(d.hp=c,c.Xa=d),this.Uh=d,this.Hc(),!0;d.value=b;return!1};ma.prototype.set=ma.prototype.set=function(a,b){return this.add(a,b)};
    ma.prototype.addAll=ma.prototype.Jc=function(a){if(null===a)return this;if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++){var d=w.Ba(a,c);this.add(d.key,d.value)}else for(a=a.i;a.next();)this.add(a.key,a.value);return this};ma.prototype.first=ma.prototype.first=function(){return this.Ea};ma.prototype.any=function(a){for(var b=this.F,c=this.Ea;null!==c;){if(a(c))return!0;this.F!==b&&w.Ma(this);c=c.Xa}return!1};
    ma.prototype.all=function(a){for(var b=this.F,c=this.Ea;null!==c;){if(!a(c))return!1;this.F!==b&&w.Ma(this);c=c.Xa}return!0};ma.prototype.each=function(a){for(var b=this.F,c=this.Ea;null!==c;)a(c),this.F!==b&&w.Ma(this),c=c.Xa;return this};ma.prototype.map=function(a){for(var b=new ma(this.Th),c=this.F,d=this.Ea;null!==d;)b.add(d.key,a(d)),this.F!==c&&w.Ma(this),d=d.Xa;return b};
    ma.prototype.filter=function(a){for(var b=new ma(this.Th,this.st),c=this.F,d=this.Ea;null!==d;)a(d)&&b.add(d.key,d.value),this.F!==c&&w.Ma(this),d=d.Xa;return b};ma.prototype.concat=function(a){return this.copy().Jc(a)};ma.prototype.contains=ma.prototype.contains=function(a){var b=a;return w.Pa(a)&&(b=w.Od(a),void 0===b)?!1:void 0!==this.qd[b]};ma.prototype.has=ma.prototype.has=function(a){return this.contains(a)};
    ma.prototype.getValue=ma.prototype.ka=function(a){var b=a;if(w.Pa(a)&&(b=w.Od(a),void 0===b))return null;a=this.qd[b];return void 0===a?null:a.value};ma.prototype.get=ma.prototype.get=function(a){return this.ka(a)};
    ma.prototype.remove=ma.prototype["delete"]=ma.prototype.remove=function(a){if(null===a)return!1;this.P&&w.ma(this,a);var b=a;if(w.Pa(a)&&(b=w.Od(a),void 0===b))return!1;a=this.qd[b];if(void 0===a)return!1;var c=a.Xa,d=a.hp;null!==c&&(c.hp=d);null!==d&&(d.Xa=c);this.Ea===a&&(this.Ea=c);this.Uh===a&&(this.Uh=d);delete this.qd[b];this.pd--;this.Hc();return!0};ma.prototype.clear=ma.prototype.clear=function(){this.P&&w.ma(this);this.qd={};this.pd=0;this.Uh=this.Ea=null;this.Hc()};
    ma.prototype.copy=function(){var a=new ma(this.Th,this.st),b=this.qd,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};ma.prototype.toArray=ma.prototype.gc=function(){var a=this.qd,b=Array(this.pd),c=0,d;for(d in a){var e=a[d];b[c]=new Ca(e.key,e.value);c++}return b};ma.prototype.toKeySet=ma.prototype.Gj=function(){return new Ea(this)};w.u(ma,{count:"count"},function(){return this.pd});w.u(ma,{size:"size"},function(){return this.pd});
    w.u(ma,{i:"iterator"},function(){if(0>=this.count)return ua;var a=this.Qb;return null!==a?(a.reset(),a):new Ha(this)});w.u(ma,{BF:"iteratorKeys"},function(){return 0>=this.count?ua:new Da(this)});w.u(ma,{CF:"iteratorValues"},function(){if(0>=this.count)return ua;var a=this.Pi;return null!==a?(a.reset(),a):new Ga(this)});function z(a,b){void 0===a?this.y=this.x=0:(this.x=a,this.y=b)}w.ga("Point",z);w.ni(z);w.ce(z,{x:!0,y:!0});z.prototype.assign=function(a){this.x=a.x;this.y=a.y};
    z.prototype.setTo=z.prototype.m=function(a,b){this.x=a;this.y=b;return this};z.prototype.set=z.prototype.set=function(a){this.x=a.x;this.y=a.y;return this};z.prototype.copy=function(){var a=new z;a.x=this.x;a.y=this.y;return a};z.prototype.Ha=function(){Object.freeze(this);return this};z.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};z.prototype.freeze=function(){return this};z.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};
    z.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new z(c,e)}return new z};z.stringify=function(a){return a.x.toString()+" "+a.y.toString()};z.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};z.prototype.equals=z.prototype.L=function(a){return a instanceof z?this.x===a.x&&this.y===a.y:!1};
    z.prototype.equalTo=z.prototype.kx=function(a,b){return this.x===a&&this.y===b};z.prototype.equalsApprox=z.prototype.Kc=function(a){return J(this.x,a.x)&&J(this.y,a.y)};z.prototype.add=z.prototype.add=function(a){this.x+=a.x;this.y+=a.y;return this};z.prototype.subtract=z.prototype.Ej=function(a){this.x-=a.x;this.y-=a.y;return this};z.prototype.offset=z.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};
    z.prototype.rotate=z.prototype.rotate=function(a){if(0===a)return this;var b=this.x,c=this.y;if(0===b&&0===c)return this;var d=0,e=0;360<=a?a-=360:0>a&&(a+=360);90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(a=a*Math.PI/180,d=Math.cos(a),e=Math.sin(a));this.x=d*b-e*c;this.y=e*b+d*c;return this};z.prototype.scale=z.prototype.scale=function(a,b){this.x*=a;this.y*=b;return this};z.prototype.distanceSquaredPoint=z.prototype.zf=function(a){var b=a.x-this.x;a=a.y-this.y;return b*b+a*a};
    z.prototype.distanceSquared=z.prototype.Pp=function(a,b){var c=a-this.x,d=b-this.y;return c*c+d*d};z.prototype.normalize=z.prototype.normalize=function(){var a=this.x,b=this.y,c=Math.sqrt(a*a+b*b);0<c&&(this.x=a/c,this.y=b/c);return this};z.prototype.directionPoint=z.prototype.Pb=function(a){return Ka(a.x-this.x,a.y-this.y)};z.prototype.direction=z.prototype.direction=function(a,b){return Ka(a-this.x,b-this.y)};
    function Ka(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}z.prototype.projectOntoLineSegment=function(a,b,c,d){La(a,b,c,d,this.x,this.y,this);return this};z.prototype.projectOntoLineSegmentPoint=function(a,b){La(a.x,a.y,b.x,b.y,this.x,this.y,this);return this};z.prototype.snapToGrid=function(a,b,c,d){Na(this.x,this.y,a,b,c,d,this);return this};
    z.prototype.snapToGridPoint=function(a,b){Na(this.x,this.y,a.x,a.y,b.width,b.height,this);return this};z.prototype.setRectSpot=z.prototype.Zn=function(a,b){this.x=a.x+b.x*a.width+b.offsetX;this.y=a.y+b.y*a.height+b.offsetY;return this};z.prototype.setSpot=z.prototype.Lu=function(a,b,c,d,e){this.x=a+e.x*c+e.offsetX;this.y=b+e.y*d+e.offsetY;return this};z.prototype.transform=function(a){a.nb(this);return this};function Pa(a,b){b.pi(a);return a}var Ra;
    z.distanceLineSegmentSquared=Ra=function(a,b,c,d,e,f){var h=e-c,k=f-d,l=h*h+k*k;c-=a;d-=b;var m=-c*h-d*k;if(0>=m||m>=l)return h=e-a,k=f-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var Sa;z.distanceSquared=Sa=function(a,b,c,d){a=c-a;b=d-b;return a*a+b*b};var Ta;z.direction=Ta=function(a,b,c,d){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};
    z.prototype.isReal=z.prototype.I=function(){return isFinite(this.x)&&isFinite(this.y)};function ia(a,b){void 0===a?this.height=this.width=0:(this.width=a,this.height=b)}w.ga("Size",ia);w.ni(ia);w.ce(ia,{width:!0,height:!0});ia.prototype.assign=function(a){this.width=a.width;this.height=a.height};ia.prototype.setTo=ia.prototype.m=function(a,b){this.width=a;this.height=b;return this};ia.prototype.set=ia.prototype.set=function(a){this.width=a.width;this.height=a.height;return this};
    ia.prototype.copy=function(){var a=new ia;a.width=this.width;a.height=this.height;return a};ia.prototype.Ha=function(){Object.freeze(this);return this};ia.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};ia.prototype.freeze=function(){return this};ia.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};
    ia.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));return new ia(c,e)}return new ia};ia.stringify=function(a){return a.width.toString()+" "+a.height.toString()};ia.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};ia.prototype.equals=ia.prototype.L=function(a){return a instanceof ia?this.width===a.width&&this.height===a.height:!1};
    ia.prototype.equalTo=ia.prototype.kx=function(a,b){return this.width===a&&this.height===b};ia.prototype.equalsApprox=ia.prototype.Kc=function(a){return J(this.width,a.width)&&J(this.height,a.height)};ia.prototype.isReal=ia.prototype.I=function(){return isFinite(this.width)&&isFinite(this.height)};
    function B(a,b,c,d){void 0===a?this.height=this.width=this.y=this.x=0:a instanceof z?b instanceof z?(this.x=Math.min(a.x,b.x),this.y=Math.min(a.y,b.y),this.width=Math.abs(a.x-b.x),this.height=Math.abs(a.y-b.y)):b instanceof ia?(this.x=a.x,this.y=a.y,this.width=b.width,this.height=b.height):w.k("Incorrect arguments supplied to Rect constructor"):(this.x=a,this.y=b,this.width=c,this.height=d)}w.ga("Rect",B);w.ni(B);w.ce(B,{x:!0,y:!0,width:!0,height:!0});
    B.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height};function Ua(a,b,c){a.width=b;a.height=c}B.prototype.setTo=B.prototype.m=function(a,b,c,d){this.x=a;this.y=b;this.width=c;this.height=d;return this};B.prototype.set=B.prototype.set=function(a){this.x=a.x;this.y=a.y;this.width=a.width;this.height=a.height;return this};B.prototype.setPoint=B.prototype.Yg=function(a){this.x=a.x;this.y=a.y;return this};
    B.prototype.setSize=function(a){this.width=a.width;this.height=a.height;return this};B.prototype.copy=function(){var a=new B;a.x=this.x;a.y=this.y;a.width=this.width;a.height=this.height;return a};B.prototype.Ha=function(){Object.freeze(this);return this};B.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};B.prototype.freeze=function(){return this};B.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};
    B.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));for(var e=0;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));for(var f=0;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new B(c,e,f,h)}return new B};B.stringify=function(a){return a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString()};
    B.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};B.prototype.equals=B.prototype.L=function(a){return a instanceof B?this.x===a.x&&this.y===a.y&&this.width===a.width&&this.height===a.height:!1};B.prototype.equalTo=B.prototype.kx=function(a,b,c,d){return this.x===a&&this.y===b&&this.width===c&&this.height===d};B.prototype.equalsApprox=B.prototype.Kc=function(a){return J(this.x,a.x)&&J(this.y,a.y)&&J(this.width,a.width)&&J(this.height,a.height)};
    function Va(a,b){return Wa(a.x,b.x)&&Wa(a.y,b.y)&&Wa(a.width,b.width)&&Wa(a.height,b.height)}B.prototype.containsPoint=B.prototype.Ia=function(a){return this.x<=a.x&&this.x+this.width>=a.x&&this.y<=a.y&&this.y+this.height>=a.y};B.prototype.containsRect=B.prototype.xk=function(a){return this.x<=a.x&&a.x+a.width<=this.x+this.width&&this.y<=a.y&&a.y+a.height<=this.y+this.height};
    B.prototype.contains=B.prototype.contains=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return this.x<=a&&a+c<=this.x+this.width&&this.y<=b&&b+d<=this.y+this.height};B.prototype.reset=function(){this.height=this.width=this.y=this.x=0};B.prototype.offset=B.prototype.offset=function(a,b){this.x+=a;this.y+=b;return this};B.prototype.inflate=B.prototype.Af=function(a,b){return Xa(this,b,a,b,a)};B.prototype.addMargin=B.prototype.Ow=function(a){return Xa(this,a.top,a.right,a.bottom,a.left)};
    B.prototype.subtractMargin=B.prototype.MJ=function(a){return Xa(this,-a.top,-a.right,-a.bottom,-a.left)};B.prototype.grow=function(a,b,c,d){return Xa(this,a,b,c,d)};function Xa(a,b,c,d,e){var f=a.width;c+e<=-f?(a.x+=f/2,a.width=0):(a.x-=e,a.width+=c+e);c=a.height;b+d<=-c?(a.y+=c/2,a.height=0):(a.y-=b,a.height+=b+d);return a}B.prototype.intersectRect=function(a){return Ya(this,a.x,a.y,a.width,a.height)};B.prototype.intersect=B.prototype.lF=function(a,b,c,d){return Ya(this,a,b,c,d)};
    function Ya(a,b,c,d,e){var f=Math.max(a.x,b),h=Math.max(a.y,c);b=Math.min(a.x+a.width,b+d);c=Math.min(a.y+a.height,c+e);a.x=f;a.y=h;a.width=Math.max(0,b-f);a.height=Math.max(0,c-h);return a}B.prototype.intersectsRect=B.prototype.Zf=function(a){return this.mF(a.x,a.y,a.width,a.height)};
    B.prototype.intersects=B.prototype.mF=function(a,b,c,d){var e=this.width,f=this.x;if(Infinity!==e&&Infinity!==c&&(e+=f,c+=a,isNaN(c)||isNaN(e)||f>c||a>e))return!1;a=this.height;c=this.y;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};function $a(a,b){var c=a.width,d=b.width+10+10,e=a.x,f=b.x-10;if(e>d+f||f>c+e)return!1;c=a.height;d=b.height+10+10;e=a.y;f=b.y-10;return e>d+f||f>c+e?!1:!0}B.prototype.unionPoint=B.prototype.vi=function(a){return ab(this,a.x,a.y,0,0)};
    B.prototype.unionRect=B.prototype.Jh=function(a){return ab(this,a.x,a.y,a.width,a.height)};B.prototype.union=B.prototype.DG=function(a,b,c,d){void 0===c&&(c=0);void 0===d&&(d=0);return ab(this,a,b,c,d)};function ab(a,b,c,d,e){var f=Math.min(a.x,b),h=Math.min(a.y,c);b=Math.max(a.x+a.width,b+d);c=Math.max(a.y+a.height,c+e);a.x=f;a.y=h;a.width=b-f;a.height=c-h;return a}B.prototype.setSpot=B.prototype.Lu=function(a,b,c){this.x=a-c.offsetX-c.x*this.width;this.y=b-c.offsetY-c.y*this.height;return this};
    var db;B.contains=db=function(a,b,c,d,e,f,h,k){void 0===h&&(h=0);void 0===k&&(k=0);return a<=e&&e+h<=a+c&&b<=f&&f+k<=b+d};B.intersects=function(a,b,c,d,e,f,h,k){c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=f;return b>k||f>a?!1:!0};w.defineProperty(B,{left:"left"},function(){return this.x},function(a){this.x=a});w.defineProperty(B,{top:"top"},function(){return this.y},function(a){this.y=a});w.defineProperty(B,{right:"right"},function(){return this.x+this.width},function(a){this.x+=a-(this.x+this.width)});
    w.defineProperty(B,{bottom:"bottom"},function(){return this.y+this.height},function(a){this.y+=a-(this.y+this.height)});w.defineProperty(B,{position:"position"},function(){return new z(this.x,this.y)},function(a){this.x=a.x;this.y=a.y});w.defineProperty(B,{size:"size"},function(){return new ia(this.width,this.height)},function(a){this.width=a.width;this.height=a.height});
    w.defineProperty(B,{Ml:"center"},function(){return new z(this.x+this.width/2,this.y+this.height/2)},function(a){this.x=a.x-this.width/2;this.y=a.y-this.height/2});w.defineProperty(B,{la:"centerX"},function(){return this.x+this.width/2},function(a){this.x=a-this.width/2});w.defineProperty(B,{ra:"centerY"},function(){return this.y+this.height/2},function(a){this.y=a-this.height/2});B.prototype.isReal=B.prototype.I=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};
    B.prototype.isEmpty=function(){return 0===this.width&&0===this.height};function hb(a,b,c,d){void 0===a?this.left=this.bottom=this.right=this.top=0:void 0===b?this.left=this.bottom=this.right=this.top=a:void 0===c?(d=b,this.top=a,this.right=b,this.bottom=a,this.left=d):void 0!==d?(this.top=a,this.right=b,this.bottom=c,this.left=d):w.k("Invalid arguments to Margin constructor")}w.ga("Margin",hb);w.ni(hb);w.ce(hb,{top:!0,right:!0,bottom:!0,left:!0});
    hb.prototype.assign=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left};hb.prototype.setTo=hb.prototype.m=function(a,b,c,d){this.top=a;this.right=b;this.bottom=c;this.left=d;return this};hb.prototype.set=hb.prototype.set=function(a){this.top=a.top;this.right=a.right;this.bottom=a.bottom;this.left=a.left;return this};hb.prototype.copy=function(){var a=new hb;a.top=this.top;a.right=this.right;a.bottom=this.bottom;a.left=this.left;return a};
    hb.prototype.Ha=function(){Object.freeze(this);return this};hb.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};hb.prototype.freeze=function(){return this};hb.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};
    hb.parse=function(a){if("string"===typeof a){a=a.split(" ");for(var b=0,c=NaN;""===a[b];)b++;var d=a[b++];d&&(c=parseFloat(d));if(isNaN(c))return new hb;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new hb(c);for(var f=NaN;""===a[b];)b++;(d=a[b++])&&(f=parseFloat(d));if(isNaN(f))return new hb(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new hb(c,e):new hb(c,e,f,h)}return new hb};
    hb.stringify=function(a){return a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString()};hb.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};hb.prototype.equals=hb.prototype.L=function(a){return a instanceof hb?this.top===a.top&&this.right===a.right&&this.bottom===a.bottom&&this.left===a.left:!1};
    hb.prototype.equalTo=hb.prototype.kx=function(a,b,c,d){return this.top===a&&this.right===b&&this.bottom===c&&this.left===d};hb.prototype.equalsApprox=hb.prototype.Kc=function(a){return J(this.top,a.top)&&J(this.right,a.right)&&J(this.bottom,a.bottom)&&J(this.left,a.left)};hb.prototype.isReal=hb.prototype.I=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function ka(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}w.ni(ka);
    w.ce(ka,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});ka.prototype.set=ka.prototype.set=function(a){this.m11=a.m11;this.m12=a.m12;this.m21=a.m21;this.m22=a.m22;this.dx=a.dx;this.dy=a.dy;return this};ka.prototype.copy=function(){var a=new ka;a.m11=this.m11;a.m12=this.m12;a.m21=this.m21;a.m22=this.m22;a.dx=this.dx;a.dy=this.dy;return a};ka.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
    ka.prototype.equals=ka.prototype.L=function(a){return a instanceof ka?this.m11===a.m11&&this.m12===a.m12&&this.m21===a.m21&&this.m22===a.m22&&this.dx===a.dx&&this.dy===a.dy:!1};ka.prototype.isIdentity=ka.prototype.hu=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};ka.prototype.reset=ka.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this};
    ka.prototype.multiply=ka.prototype.multiply=function(a){var b=this.m12*a.m11+this.m22*a.m12,c=this.m11*a.m21+this.m21*a.m22,d=this.m12*a.m21+this.m22*a.m22,e=this.m11*a.dx+this.m21*a.dy+this.dx,f=this.m12*a.dx+this.m22*a.dy+this.dy;this.m11=this.m11*a.m11+this.m21*a.m12;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};
    ka.prototype.multiplyInverted=ka.prototype.KF=function(a){var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,f=a.m11*b,h=b*(a.m21*a.dy-a.m22*a.dx),k=b*(a.m12*a.dx-a.m11*a.dy);a=this.m12*c+this.m22*d;b=this.m11*e+this.m21*f;e=this.m12*e+this.m22*f;f=this.m11*h+this.m21*k+this.dx;h=this.m12*h+this.m22*k+this.dy;this.m11=this.m11*c+this.m21*d;this.m12=a;this.m21=b;this.m22=e;this.dx=f;this.dy=h;return this};
    ka.prototype.invert=ka.prototype.vx=function(){var a=1/(this.m11*this.m22-this.m12*this.m21),b=-this.m12*a,c=-this.m21*a,d=this.m11*a,e=a*(this.m21*this.dy-this.m22*this.dx),f=a*(this.m12*this.dx-this.m11*this.dy);this.m11=this.m22*a;this.m12=b;this.m21=c;this.m22=d;this.dx=e;this.dy=f;return this};
    ka.prototype.rotate=ka.prototype.rotate=function(a,b,c){360<=a?a-=360:0>a&&(a+=360);if(0===a)return this;this.translate(b,c);var d=0,e=0;90===a?(d=0,e=1):180===a?(d=-1,e=0):270===a?(d=0,e=-1):(e=a*Math.PI/180,d=Math.cos(e),e=Math.sin(e));a=this.m12*d+this.m22*e;var f=this.m11*-e+this.m21*d,h=this.m12*-e+this.m22*d;this.m11=this.m11*d+this.m21*e;this.m12=a;this.m21=f;this.m22=h;this.translate(-b,-c);return this};
    ka.prototype.translate=ka.prototype.translate=function(a,b){this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};ka.prototype.scale=ka.prototype.scale=function(a,b){void 0===b&&(b=a);this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};ka.prototype.transformPoint=ka.prototype.nb=function(a){var b=a.x,c=a.y;a.x=b*this.m11+c*this.m21+this.dx;a.y=b*this.m12+c*this.m22+this.dy;return a};
    ka.prototype.invertedTransformPoint=ka.prototype.pi=function(a){var b=1/(this.m11*this.m22-this.m12*this.m21),c=-this.m12*b,d=this.m11*b,e=b*(this.m12*this.dx-this.m11*this.dy),f=a.x,h=a.y;a.x=f*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.y=f*c+h*d+e;return a};
    ka.prototype.transformRect=ka.prototype.CG=function(a){var b=a.x,c=a.y,d=b+a.width,e=c+a.height,f=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*f+c*k+m,q=b*h+c*l+n,r=d*f+c*k+m,c=d*h+c*l+n,s=b*f+e*k+m,b=b*h+e*l+n,f=d*f+e*k+m,d=d*h+e*l+n,e=p,h=q,p=Math.min(p,r),e=Math.max(e,r),h=Math.min(h,c),q=Math.max(q,c),p=Math.min(p,s),e=Math.max(e,s),h=Math.min(h,b),q=Math.max(q,b),p=Math.min(p,f),e=Math.max(e,f),h=Math.min(h,d),q=Math.max(q,d);a.x=p;a.y=h;a.width=e-p;a.height=q-h;return a};
    function L(a,b,c,d){void 0===a?this.offsetY=this.offsetX=this.y=this.x=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d)}w.ga("Spot",L);w.ni(L);w.ce(L,{x:!0,y:!0,offsetX:!0,offsetY:!0});L.prototype.assign=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY};L.prototype.setTo=L.prototype.m=function(a,b,c,d){this.x=a;this.y=b;this.offsetX=c;this.offsetY=d;return this};
    L.prototype.set=L.prototype.set=function(a){this.x=a.x;this.y=a.y;this.offsetX=a.offsetX;this.offsetY=a.offsetY;return this};L.prototype.copy=function(){var a=new L;a.x=this.x;a.y=this.y;a.offsetX=this.offsetX;a.offsetY=this.offsetY;return a};L.prototype.Ha=function(){Object.freeze(this);return this};L.prototype.S=function(){return Object.isFrozen(this)?this:this.copy().freeze()};L.prototype.freeze=function(){return this};
    L.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);return this};function ib(a,b){a.x=NaN;a.y=NaN;a.offsetX=b;return a}var xb;
    L.parse=xb=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return yb;if("TopLeft"===a)return Ab;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return Bb;if("TopRight"===a)return Gb;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return Ib;if("Center"===a)return Jb;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return Pb;if("BottomLeft"===a)return Qb;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return Rb;if("BottomRight"===a)return Sb;if("TopSide"===a)return Xb;if("LeftSide"===
        a)return Yb;if("RightSide"===a)return Zb;if("BottomSide"===a)return $b;if("TopBottomSides"===a)return ac;if("LeftRightSides"===a)return bc;if("TopLeftSides"===a)return ec;if("TopRightSides"===a)return fc;if("BottomLeftSides"===a)return gc;if("BottomRightSides"===a)return hc;if("NotTopSide"===a)return ic;if("NotLeftSide"===a)return jc;if("NotRightSide"===a)return nc;if("NotBottomSide"===a)return oc;if("AllSides"===a)return pc;if("Default"===a)return qc;a=a.split(" ");for(var b=0,c=0;""===a[b];)b++;
        var d=a[b++];void 0!==d&&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 h=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(h=parseFloat(d));return new L(c,e,f,h)}return new L};L.stringify=function(a){return a.Yc()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString()};
    L.prototype.toString=function(){return this.Yc()?0===this.offsetX&&0===this.offsetY?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.L(yb)?"None":this.L(Ab)?"TopLeft":this.L(Bb)?"Top":this.L(Gb)?"TopRight":this.L(Ib)?"Left":this.L(Jb)?"Center":this.L(Pb)?"Right":this.L(Qb)?"BottomLeft":this.L(Rb)?"Bottom":this.L(Sb)?"BottomRight":this.L(Xb)?"TopSide":this.L(Yb)?"LeftSide":this.L(Zb)?"RightSide":this.L($b)?"BottomSide":this.L(ac)?"TopBottomSides":this.L(bc)?
        "LeftRightSides":this.L(ec)?"TopLeftSides":this.L(fc)?"TopRightSides":this.L(gc)?"BottomLeftSides":this.L(hc)?"BottomRightSides":this.L(ic)?"NotTopSide":this.L(jc)?"NotLeftSide":this.L(nc)?"NotRightSide":this.L(oc)?"NotBottomSide":this.L(pc)?"AllSides":this.L(qc)?"Default":"None"};L.prototype.equals=L.prototype.L=function(a){return a instanceof L?(this.x===a.x||isNaN(this.x)&&isNaN(a.x))&&(this.y===a.y||isNaN(this.y)&&isNaN(a.y))&&this.offsetX===a.offsetX&&this.offsetY===a.offsetY:!1};
    L.prototype.opposite=L.prototype.OF=function(){return new L(.5-(this.x-.5),.5-(this.y-.5),-this.offsetX,-this.offsetY)};L.prototype.includesSide=L.prototype.sj=function(a){if(!this.uj())return!1;if(!a.uj())if(a.L(rc))a=Yb;else if(a.L(sc))a=Zb;else if(a.L(yc))a=Xb;else if(a.L(zc))a=$b;else return!1;a=a.offsetY;return(this.offsetY&a)===a};L.prototype.isSpot=L.prototype.Yc=function(){return!isNaN(this.x)&&!isNaN(this.y)};L.prototype.isNoSpot=L.prototype.Sd=function(){return isNaN(this.x)||isNaN(this.y)};
    L.prototype.isSide=L.prototype.uj=function(){return isNaN(this.x)&&isNaN(this.y)&&1===this.offsetX&&0!==this.offsetY};L.prototype.isNone=L.prototype.BI=function(){return isNaN(this.x)&&isNaN(this.y)&&0===this.offsetX&&0===this.offsetY};L.prototype.isDefault=L.prototype.Xc=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var yb;L.None=yb=ib(new L(0,0,0,0),0).Ha();var qc;L.Default=qc=ib(new L(0,0,-1,0),-1).Ha();var Ab;L.TopLeft=Ab=(new L(0,0,0,0)).Ha();var Bb;
    L.TopCenter=Bb=(new L(.5,0,0,0)).Ha();var Gb;L.TopRight=Gb=(new L(1,0,0,0)).Ha();var Ib;L.LeftCenter=Ib=(new L(0,.5,0,0)).Ha();var Jb;L.Center=Jb=(new L(.5,.5,0,0)).Ha();var Pb;L.RightCenter=Pb=(new L(1,.5,0,0)).Ha();var Qb;L.BottomLeft=Qb=(new L(0,1,0,0)).Ha();var Rb;L.BottomCenter=Rb=(new L(.5,1,0,0)).Ha();var Sb;L.BottomRight=Sb=(new L(1,1,0,0)).Ha();var Gc;L.MiddleTop=Gc=Bb;var Hc;L.MiddleLeft=Hc=Ib;var Ic;L.MiddleRight=Ic=Pb;var Jc;L.MiddleBottom=Jc=Rb;var yc;L.Top=yc=Bb;var rc;L.Left=rc=Ib;
    var sc;L.Right=sc=Pb;var zc;L.Bottom=zc=Rb;var Xb;L.TopSide=Xb=ib(new L(0,0,1,w.md),1).Ha();var Yb;L.LeftSide=Yb=ib(new L(0,0,1,w.Sc),1).Ha();var Zb;L.RightSide=Zb=ib(new L(0,0,1,w.dd),1).Ha();var $b;L.BottomSide=$b=ib(new L(0,0,1,w.cd),1).Ha();var ac;L.TopBottomSides=ac=ib(new L(0,0,1,w.md|w.cd),1).Ha();var bc;L.LeftRightSides=bc=ib(new L(0,0,1,w.Sc|w.dd),1).Ha();var ec;L.TopLeftSides=ec=ib(new L(0,0,1,w.md|w.Sc),1).Ha();var fc;L.TopRightSides=fc=ib(new L(0,0,1,w.md|w.dd),1).Ha();var gc;
    L.BottomLeftSides=gc=ib(new L(0,0,1,w.cd|w.Sc),1).Ha();var hc;L.BottomRightSides=hc=ib(new L(0,0,1,w.cd|w.dd),1).Ha();var ic;L.NotTopSide=ic=ib(new L(0,0,1,w.Sc|w.dd|w.cd),1).Ha();var jc;L.NotLeftSide=jc=ib(new L(0,0,1,w.md|w.dd|w.cd),1).Ha();var nc;L.NotRightSide=nc=ib(new L(0,0,1,w.md|w.Sc|w.cd),1).Ha();var oc;L.NotBottomSide=oc=ib(new L(0,0,1,w.md|w.Sc|w.dd),1).Ha();var pc;L.AllSides=pc=ib(new L(0,0,1,w.md|w.Sc|w.dd|w.cd),1).Ha();function Kc(){this.Ub=[1,0,0,1,0,0]}
    Kc.prototype.copy=function(){var a=new Kc;a.Ub[0]=this.Ub[0];a.Ub[1]=this.Ub[1];a.Ub[2]=this.Ub[2];a.Ub[3]=this.Ub[3];a.Ub[4]=this.Ub[4];a.Ub[5]=this.Ub[5];return a};Kc.prototype.translate=function(a,b){this.Ub[4]+=this.Ub[0]*a+this.Ub[2]*b;this.Ub[5]+=this.Ub[1]*a+this.Ub[3]*b};Kc.prototype.scale=function(a,b){this.Ub[0]*=a;this.Ub[1]*=a;this.Ub[2]*=b;this.Ub[3]*=b};function Lc(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.yE=[];this.pattern=null}
    Lc.prototype.addColorStop=function(a,b){this.yE.push({offset:a,color:b})};
    function Oc(a,b,c){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.Ln=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.Hp=!1;this.Gg=this.at=this.$s=0;this.document=b||document;this.ME=c;this.Fx=null;this.path=[];this.wh=new Kc;this.stack=[];this.mf=[];this.ix=a;this.gJ="http://www.w3.org/2000/svg";
        this.width=this.ix.width;this.height=this.ix.height;this.km=Pc(this,"svg",{width:this.width+"px",height:this.height+"px",viewBox:"0 0 "+this.ix.width+" "+this.ix.height});this.km.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.km.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");Qc(this,1,0,0,1,0,0);a=w.qm++;b=Pc(this,"clipPath",{id:"mainClip"+a});b.appendChild(Pc(this,"rect",{x:0,y:0,width:this.width,height:this.height}));
        this.km.appendChild(b);this.mf[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}g=Oc.prototype;g.arc=function(a,b,c,d,e,f){Rc(this,a,b,c,d,e,f)};g.beginPath=function(){this.path=[]};g.bezierCurveTo=function(a,b,c,d,e,f){this.path.push(["C",a,b,c,d,e,f])};g.clearRect=function(){};g.clip=function(){Sc(this,"clipPath",this.path,new Kc)};g.closePath=function(){this.path.push(["z"])};g.createLinearGradient=function(a,b,c,d){var e=new Lc("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};
    g.createPattern=function(){return null};g.createRadialGradient=function(a,b,c,d,e,f){var h=new Lc("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=f;return h};
    g.drawImage=function(a,b,c,d,e,f,h,k,l){var m="";a instanceof HTMLCanvasElement&&(m=a.toDataURL());a instanceof HTMLImageElement&&(m=a.src);void 0===d&&(f=b,h=c,k=d=a.naturalWidth,l=e=a.naturalHeight);d=d||0;e=e||0;f=f||0;h=h||0;k=k||0;l=l||0;m={x:0,y:0,width:a.naturalWidth,height:a.naturalHeight,href:m,preserveAspectRatio:"xMidYMid slice"};Wa(d,k)&&Wa(e,l)||(m.preserveAspectRatio="none");var n="";k/=d;l/=e;if(0!==f||0!==h)n+=" translate("+f+", "+h+")";if(1!==k||1!==l)n+=" scale("+k+", "+l+")";if(0!==
        b||0!==c)n+=" translate("+-b+", "+-c+")";if(0!==b||0!==c||d!==a.naturalWidth||e!==a.naturalHeight)a="CLIP"+w.qm++,f=Pc(this,"clipPath",{id:a}),f.appendChild(Pc(this,"rect",{x:b,y:c,width:d,height:e})),this.km.appendChild(f),m["clip-path"]="url(#"+a+")";Tc(this,"image",m,this.wh,n);this.addElement("image",m)};g.fill=function(){Sc(this,"fill",this.path,this.wh)};g.Ng=function(){this.Hp?this.clip():this.fill()};g.fillRect=function(a,b,c,d){Uc(this,"fill",[a,b,c,d],this.wh)};
    g.fillText=function(a,b,c){a=[a,b,c];b=this.textAlign;"left"===b?b="start":"right"===b?b="end":"center"===b&&(b="middle");b={x:a[1],y:a[2],style:"font: "+this.font,"text-anchor":b};Tc(this,"fill",b,this.wh);this.addElement("text",b,a[0])};g.lineTo=function(a,b){this.path.push(["L",a,b])};g.moveTo=function(a,b){this.path.push(["M",a,b])};g.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};g.rect=function(a,b,c,d){this.path.push(["M",a,b],["L",a+c,b],["L",a+c,b+d],["L",a,b+d],["z"])};
    g.restore=function(){this.wh=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.Ln=a.Ln;this.lineJoin=a.lineJoin;this.lineWidth=a.lineWidth;this.miterLimit=a.miterLimit;this.shadowBlur=a.shadowBlur;this.shadowColor=a.shadowColor;this.shadowOffsetX=a.shadowOffsetX;this.shadowOffsetY=a.shadowOffsetY;this.strokeStyle=a.strokeStyle;this.textAlign=a.textAlign};
    g.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,Ln:this.Ln,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.wh.copy())};
    g.setTransform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||Qc(this,a,b,c,d,e,f)};g.scale=function(a,b){this.wh.scale(a,b)};g.translate=function(a,b){this.wh.translate(a,b)};g.transform=function(){};g.stroke=function(){Sc(this,"stroke",this.path,this.wh)};g.Dj=function(){this.Hp||this.stroke()};g.strokeRect=function(a,b,c,d){Uc(this,"stroke",[a,b,c,d],this.wh)};
    function Pc(a,b,c,d){a=a.document.createElementNS(a.gJ,b);if(w.Pa(c))for(var e in c)a.setAttributeNS("href"===e?"http://www.w3.org/1999/xlink":"",e,c[e]);void 0!==d&&(a.textContent=d);return a}g.addElement=function(a,b,c){a=Pc(this,a,b,c);0<this.mf.length?this.mf[this.mf.length-1].appendChild(a):this.km.appendChild(a);return this.Fx=a};
    function Tc(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"===b?(a.fillStyle instanceof Lc?c.fill=Vc(a,a.fillStyle):(/^rgba\(/.test(a.fillStyle)&&(b=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),c.fill="rgb("+b[1]+","+b[2]+","+b[3]+")",c["fill-opacity"]=b[4]),c.fill=a.fillStyle),c.stroke="none"):"stroke"===b&&(c.fill="none",a.strokeStyle instanceof Lc?c.stroke=Vc(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),
            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);a=d.Ub;a="matrix("+a[0]+", "+a[1]+", "+a[2]+", "+a[3]+", "+a[4]+", "+a[5]+")";void 0!==e&&(a+=e);c.transform=a}
    function Vc(a,b){var c="GRAD"+w.qm++,d;if("linear"===b.type)d=Pc(a,"linearGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"});else if("radial"===b.type)d=Pc(a,"radialGradient",{x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c});else if("pattern"===b.type){var e=b.pattern;d={width:e.width,height:e.height,id:c,patternUnits:"userSpaceOnUse"};var f="";e instanceof HTMLCanvasElement&&(f=e.toDataURL());e instanceof HTMLImageElement&&(f=e.src);e={x:0,y:0,width:e.width,height:e.height,
        href:f};d=Pc(a,"pattern",d);d.appendChild(Pc(a,"image",e))}else throw Error("invalid gradient");for(var e=b.yE,f=e.length,h=[],k=0;k<f;k++){var l=e[k],m=l.color,l={offset:l.offset,"stop-color":m};/^rgba\(/.test(m)&&(m=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m),l["stop-color"]="rgb("+m[1]+","+m[2]+","+m[3]+")",l["stop-opacity"]=m[4]);h.push(l)}h.sort(function(a,b){return a.offset>b.offset?1:-1});for(k=0;k<f;k++)d.appendChild(Pc(a,"stop",h[k]));a.km.appendChild(d);
        return"url(#"+c+")"}function Uc(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};Tc(a,b,c,d);a.addElement("rect",c)}
    function Sc(a,b,c,d){for(var e=[],f=0;f<c.length;f++){var h=w.Nl(c[f]),k=[h.shift()];if("A"===k[0])k.push(h.shift()+","+h.shift(),h.shift(),h.shift()+","+h.shift(),h.shift()+","+h.shift());else for(;h.length;)k.push(h.shift()+","+h.shift());e.push(k.join(" "))}c={d:e.join(" ")};Tc(a,b,c,d);"clipPath"===b?(b="CLIP"+w.qm++,d=Pc(a,"clipPath",{id:b}),d.appendChild(Pc(a,"path",c)),a.km.appendChild(d),0<a.mf.length&&a.mf[a.mf.length-1].setAttributeNS(null,"clip-path","url(#"+b+")")):a.addElement("path",
        c)}function Rc(a,b,c,d,e,f,h){var k=Math.abs(e-f);if(e!==f){var l=b+d*Math.cos(f);f=c+d*Math.sin(f);k>=2*Math.PI?(Rc(a,b,c,d,e,e+Math.PI,h),Rc(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,f])):(b+=d*Math.cos(e),c+=d*Math.sin(e),k=180*k/Math.PI,e=h?0:1,h=180<=k===!!h?0:1,0!==a.path.length?a.path.push(["L",b,c]):a.path.push(["M",b,c]),a.path.push(["A",d,d,k,h,e,l,f]))}}function Qc(a,b,c,d,e,f,h){var k=new Kc;k.Ub=[b,c,d,e,f,h];b={};Tc(a,"g",b,k);k=a.addElement("g",b);a.mf.push(k)}
    g.bb=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+w.qm++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,f,h;c=Pc(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",PL:this.shadowBlur/2});d=Pc(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=Pc(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});f=Pc(this,"feOffset",{"in":"comp",result:"offsetBlur",
        dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=Pc(this,"feMerge",{});h.appendChild(Pc(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(Pc(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(f);b.appendChild(h);0<this.mf.length&&this.mf[this.mf.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};g.sB=function(a,b,c){this.$s=a;this.at=b;this.Gg=c};g.$n=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};
    g.ao=function(){this.shadowOffsetX=this.$s;this.shadowOffsetY=this.at;this.shadowBlur=this.Gg};g.lA=function(){return!1};g.iA=function(){};g.Fe=function(){};g.ly=function(){};Oc.prototype.rotate=function(){};function Wc(a,b){this.ownerDocument=void 0===b?document:b;var c=this.ownerDocument.createElement("canvas");c.tabIndex=0;this.Kd=c;this.yk=new Xc(c);c.Z=a;Object.seal(this)}g=Wc.prototype;g.toDataURL=function(a,b){return this.Kd.toDataURL(a,b)};g.getBoundingClientRect=function(){return this.Kd.getBoundingClientRect()};
    g.focus=function(){return this.Kd.focus()};g.addEventListener=function(a,b,c){this.Kd.addEventListener(a,b,c)};g.removeEventListener=function(a,b,c){this.Kd.removeEventListener(a,b,c)};w.defineProperty(Wc,{width:"width"},function(){return this.Kd.width},function(a){this.Kd.width=a});w.defineProperty(Wc,{height:"height"},function(){return this.Kd.height},function(a){this.Kd.height=a});w.u(Wc,{style:"style"},function(){return this.Kd.style});
    function Xc(a){a.getContext&&a.getContext("2d")||w.k("Browser does not support HTML Canvas Element");this.ua=a.getContext("2d");this.Iy=this.Ky=this.Jy="";this.Tq=!1;this.Gg=this.at=this.$s=0;Object.seal(this)}Xc.prototype.ly=function(a){this.ua.zA=a};w.defineProperty(Xc,{fillStyle:"fillStyle"},function(){return this.ua.fillStyle},function(a){this.Iy!==a&&(this.Iy=this.ua.fillStyle=a)});
    w.defineProperty(Xc,{font:"font"},function(){return this.ua.font},function(a){this.Jy!==a&&(this.Jy=this.ua.font=a)});w.defineProperty(Xc,{globalAlpha:"globalAlpha"},function(){return this.ua.globalAlpha},function(a){this.ua.globalAlpha=a});w.defineProperty(Xc,{lineCap:"lineCap"},function(){return this.ua.lineCap},function(a){this.ua.lineCap=a});w.defineProperty(Xc,{Ln:"lineDashOffset"},function(){return this.ua.Ln},function(a){this.ua.Ln=a});
    w.defineProperty(Xc,{lineJoin:"lineJoin"},function(){return this.ua.lineJoin},function(a){this.ua.lineJoin=a});w.defineProperty(Xc,{lineWidth:"lineWidth"},function(){return this.ua.lineWidth},function(a){this.ua.lineWidth=a});w.defineProperty(Xc,{miterLimit:"miterLimit"},function(){return this.ua.miterLimit},function(a){this.ua.miterLimit=a});w.defineProperty(Xc,{shadowBlur:"shadowBlur"},function(){return this.ua.shadowBlur},function(a){this.ua.shadowBlur=a});
    w.defineProperty(Xc,{shadowColor:"shadowColor"},function(){return this.ua.shadowColor},function(a){this.ua.shadowColor=a});w.defineProperty(Xc,{shadowOffsetX:"shadowOffsetX"},function(){return this.ua.shadowOffsetX},function(a){this.ua.shadowOffsetX=a});w.defineProperty(Xc,{shadowOffsetY:"shadowOffsetY"},function(){return this.ua.shadowOffsetY},function(a){this.ua.shadowOffsetY=a});
    w.defineProperty(Xc,{strokeStyle:"strokeStyle"},function(){return this.ua.strokeStyle},function(a){this.Ky!==a&&(this.Ky=this.ua.strokeStyle=a)});w.defineProperty(Xc,{textAlign:"textAlign"},function(){return this.ua.textAlign},function(a){this.ua.textAlign=a});w.defineProperty(Xc,{zA:"imageSmoothingEnabled"},function(){return this.ua.zA},function(a){this.ua.zA=a});g=Xc.prototype;g.arc=function(a,b,c,d,e,f){this.ua.arc(a,b,c,d,e,f)};g.beginPath=function(){this.ua.beginPath()};
    g.bezierCurveTo=function(a,b,c,d,e,f){this.ua.bezierCurveTo(a,b,c,d,e,f)};g.clearRect=function(a,b,c,d){this.ua.clearRect(a,b,c,d)};g.clip=function(){this.ua.clip()};g.closePath=function(){this.ua.closePath()};g.createLinearGradient=function(a,b,c,d){return this.ua.createLinearGradient(a,b,c,d)};g.createPattern=function(a,b){return this.ua.createPattern(a,b)};g.createRadialGradient=function(a,b,c,d,e,f){return this.ua.createRadialGradient(a,b,c,d,e,f)};
    g.drawImage=function(a,b,c,d,e,f,h,k,l){void 0===d?this.ua.drawImage(a,b,c):this.ua.drawImage(a,b,c,d,e,f,h,k,l)};g.fill=function(){this.ua.fill()};g.fillRect=function(a,b,c,d){this.ua.fillRect(a,b,c,d)};g.fillText=function(a,b,c){this.ua.fillText(a,b,c)};g.getImageData=function(a,b,c,d){return this.ua.getImageData(a,b,c,d)};g.lineTo=function(a,b){this.ua.lineTo(a,b)};g.measureText=function(a){return this.ua.measureText(a)};g.moveTo=function(a,b){this.ua.moveTo(a,b)};
    g.quadraticCurveTo=function(a,b,c,d){this.ua.quadraticCurveTo(a,b,c,d)};g.rect=function(a,b,c,d){this.ua.rect(a,b,c,d)};g.restore=function(){this.ua.restore()};Xc.prototype.rotate=function(a){this.ua.rotate(a)};g=Xc.prototype;g.save=function(){this.ua.save()};g.setTransform=function(a,b,c,d,e,f){this.ua.setTransform(a,b,c,d,e,f)};g.scale=function(a,b){this.ua.scale(a,b)};g.stroke=function(){this.ua.stroke()};
    g.transform=function(a,b,c,d,e,f){1===a&&0===b&&0===c&&1===d&&0===e&&0===f||this.ua.transform(a,b,c,d,e,f)};g.translate=function(a,b){this.ua.translate(a,b)};g.Ng=function(a){if(a instanceof ha&&a.type===bd){var b=a.so;a=a.Ny;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.Tq?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.Tq?this.clip():this.fill()};
    g.Dj=function(){this.Tq||this.stroke()};w.defineProperty(Xc,{Hp:"clipInsteadOfFill"},function(){return this.Tq},function(a){this.Tq=a});g=Xc.prototype;g.sB=function(a,b,c){this.$s=a;this.at=b;this.Gg=c};g.$n=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};g.ao=function(){this.shadowOffsetX=this.$s;this.shadowOffsetY=this.at;this.shadowBlur=this.Gg};
    g.lA=function(a,b){var c=this.ua;if(void 0!==c.setLineDash)c.setLineDash(a),c.lineDashOffset=b;else if(void 0!==c.webkitLineDash)c.webkitLineDash=a,c.webkitLineDashOffset=b;else if(void 0!==c.mozDash)c.mozDash=a,c.mozDashOffset=b;else return!1;return!0};g.iA=function(){var a=this.ua;void 0!==a.setLineDash?(a.setLineDash(w.jo),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=w.jo,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0)};
    g.Fe=function(a){a&&(this.Jy="");this.Iy=this.Ky=""};
    var cd=(Math.sqrt(2)-1)/3*4,dd=(new z(0,0)).Ha(),ed=(new B(0,0,0,0)).Ha(),fd=(new hb(0,0,0,0)).Ha(),nd=(new hb(2,2,2,2)).Ha(),od=(new z(6,6)).Ha(),pd=(new z(-Infinity,-Infinity)).Ha(),qd=(new z(Infinity,Infinity)).Ha(),rd=(new ia(0,0)).Ha(),Ad=(new ia(1,1)).Ha(),Bd=(new ia(6,6)).Ha(),Cd=(new ia(8,8)).Ha(),Dd=(new ia(10,10)).Ha(),Ed=(new ia(Infinity,Infinity)).Ha(),Fd=(new z(NaN,NaN)).Ha(),Gd=(new ia(NaN,NaN)).Ha(),Nd=(new B(NaN,NaN,NaN,NaN)).Ha(),Od=(new L(.156,.156)).Ha(),Pd=(new L(.844,.844)).Ha(),
        Qd=new ra,Rd=new ra,Sd=null;function Td(a){if(0>=a)return 0;var b=Sd;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);Sd=b}return 1>a?(c=1/a,2E3>=c?1/b[c|0]:Math.sqrt(a)):2E3>=a?b[a|0]:Math.sqrt(a)}function J(a,b){var c=a-b;return.5>c&&-.5<c}function Wa(a,b){var c=a-b;return 5E-8>c&&-5E-8<c}
    function Ud(a,b,c,d,e,f,h){0>=e&&(e=1E-6);var k=0,l=0,m=0,n=0;a<c?(l=a,k=c):(l=c,k=a);b<d?(n=b,m=d):(n=d,m=b);if(a===c)return n<=h&&h<=m&&a-e<=f&&f<=a+e;if(b===d)return l<=f&&f<=k&&b-e<=h&&h<=b+e;k+=e;l-=e;if(l<=f&&f<=k&&(m+=e,n-=e,n<=h&&h<=m))if(k-l>m-n)if(a-c>e||c-a>e){if(f=(d-b)/(c-a)*(f-a)+b,f-e<=h&&h<=f+e)return!0}else return!0;else if(b-d>e||d-b>e){if(h=(c-a)/(d-b)*(h-b)+a,h-e<=f&&f<=h+e)return!0}else return!0;return!1}
    function Vd(a,b,c,d,e,f,h,k,l,m,n,p){if(Ud(a,b,h,k,p,c,d)&&Ud(a,b,h,k,p,e,f))return Ud(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,u=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(q+s)/2;c=(r+u)/2;var s=(s+e)/2,u=(u+f)/2,t=(d+s)/2,x=(c+u)/2;return Vd(a,b,q,r,d,c,t,x,l,m,n,p)||Vd(t,x,s,u,e,f,h,k,l,m,n,p)}
    function Wd(a,b,c,d,e,f,h,k,l,m){if(Ud(a,b,h,k,l,c,d)&&Ud(a,b,h,k,l,e,f))ab(m,a,b,0,0),ab(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Wd(a,b,n,p,d,c,s,u,l,m);Wd(s,u,q,r,e,f,h,k,l,m)}}
    function Xd(a,b,c,d,e,f,h,k,l,m){if(Ud(a,b,h,k,l,c,d)&&Ud(a,b,h,k,l,e,f))0===m.length&&(m.push(a),m.push(b)),m.push(h),m.push(k);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+f)/2,s=(d+q)/2,u=(c+r)/2;Xd(a,b,n,p,d,c,s,u,l,m);Xd(s,u,q,r,e,f,h,k,l,m)}}
    function ee(a,b,c,d,e,f,h,k,l,m,n,p,q,r){var s=1-l;a=a*s+c*l;b=b*s+d*l;c=c*s+e*l;d=d*s+f*l;e=e*s+h*l;f=f*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+f*l;m.x=a;m.y=b;n.x=k;n.y=h;p.x=k*s+c*l;p.y=h*s+d*l;q.x=c;q.y=d;r.x=e;r.y=f}function fe(a,b,c,d,e,f,h,k,l,m){if(Ud(a,b,e,f,m,c,d))return Ud(a,b,e,f,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var q=(n+c)/2,r=(p+d)/2;return fe(a,b,n,p,q,r,h,k,l,m)||fe(q,r,c,d,e,f,h,k,l,m)}
    function ge(a,b,c,d,e,f,h,k){if(Ud(a,b,e,f,h,c,d))ab(k,a,b,0,0),ab(k,e,f,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;ge(a,b,l,m,n,p,h,k);ge(n,p,c,d,e,f,h,k)}}function he(a,b,c,d,e,f,h,k){if(Ud(a,b,e,f,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(f);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+f)/2;var n=(l+c)/2,p=(m+d)/2;he(a,b,l,m,n,p,h,k);he(n,p,c,d,e,f,h,k)}}
    function ie(a,b,c,d,e,f,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(Ud(a,b,h,k,q,c,d)&&Ud(a,b,h,k,q,e,f)){var s=(a-h)*(m-p)-(b-k)*(l-n);if(0===s)return!1;q=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/s;s=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/s;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(h=l=0,b<k?(l=b,h=k):(l=k,h=b),s<l||s>h)return!1}else if(a<h?l=a:(l=h,h=a),q<l||q>h)return!1;r.x=q;r.y=s;return!0}var s=(a+c)/2,u=(b+d)/2;c=(c+e)/2;d=(d+f)/2;e=(e+h)/2;f=(f+k)/2;var t=(s+c)/2,x=(u+d)/2;c=(c+e)/2;d=(d+f)/2;var v=(t+c)/2,A=(x+d)/2,
        y=(n-l)*(n-l)+(p-m)*(p-m),K=!1;ie(a,b,s,u,t,x,v,A,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<y&&(y=b,K=!0));a=r.x;s=r.y;ie(v,A,c,d,e,f,h,k,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<y?K=!0:(r.x=a,r.y=s));return K}
    function je(a,b,c,d,e,f,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(Ud(a,b,h,k,q,c,d)&&Ud(a,b,h,k,q,e,f)){q=(a-h)*(m-p)-(b-k)*(l-n);if(0===q)return r;var s=((a*k-b*h)*(l-n)-(a-h)*(l*p-m*n))/q,u=((a*k-b*h)*(m-p)-(b-k)*(l*p-m*n))/q;if(s>=n)return r;if((l>n?l-n:n-l)<(m>p?m-p:p-m)){if(a=l=0,b<k?(l=b,a=k):(l=k,a=b),u<l||u>a)return r}else if(a<h?(l=a,a=h):l=h,s<l||s>a)return r;0<q?r++:0>q&&r--}else{var s=(a+c)/2,u=(b+d)/2,t=(c+e)/2,x=(d+f)/2;e=(e+h)/2;f=(f+k)/2;d=(s+t)/2;c=(u+x)/2;var t=(t+e)/2,x=(x+f)/2,
        v=(d+t)/2,A=(c+x)/2,r=r+je(a,b,s,u,d,c,v,A,l,m,n,p,q),r=r+je(v,A,t,x,e,f,h,k,l,m,n,p,q)}return r}
    function La(a,b,c,d,e,f,h){if(Wa(a,c)){var k=0;c=0;b<d?(k=b,c=d):(k=d,c=b);d=f;if(d<k)return h.x=a,h.y=k,!1;if(d>c)return h.x=a,h.y=c,!1;h.x=a;h.y=d;return!0}if(Wa(b,d)){a<c?k=a:(k=c,c=a);d=e;if(d<k)return h.x=k,h.y=b,!1;if(d>c)return h.x=c,h.y=b,!1;h.x=d;h.y=b;return!0}k=((a-e)*(a-c)+(b-f)*(b-d))/((c-a)*(c-a)+(d-b)*(d-b));if(-5E-6>k)return h.x=a,h.y=b,!1;if(1.000005<k)return h.x=c,h.y=d,!1;h.x=a+k*(c-a);h.y=b+k*(d-b);return!0}
    function ke(a,b,c,d,e,f,h,k,l){if(J(a,c)&&J(b,d))return l.x=a,l.y=b,!1;if(Wa(e,h)){if(Wa(a,c))return La(a,b,c,d,e,f,l),!1;f=(d-b)/(c-a)*(e-a)+b;return La(a,b,c,d,e,f,l)}k=(k-f)/(h-e);if(Wa(a,c)){f=k*(a-e)+f;c=h=0;b<d?(h=b,c=d):(h=d,c=b);if(f<h)return l.x=a,l.y=h,!1;if(f>c)return l.x=a,l.y=c,!1;l.x=a;l.y=f;return!0}h=(d-b)/(c-a);if(Wa(k,h))return La(a,b,c,d,e,f,l),!1;e=(h*a-k*e+f-b)/(h-k);if(Wa(h,0)){a<c?h=a:(h=c,c=a);if(e<h)return l.x=h,l.y=b,!1;if(e>c)return l.x=c,l.y=b,!1;l.x=e;l.y=b;return!0}f=
        h*(e-a)+b;return La(a,b,c,d,e,f,l)}function le(a,b,c,d,e,f,h,k,l){var m=1E21,n=a,p=b;if(ke(a,b,a,d,e,f,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f);q<m&&(m=q,n=l.x,p=l.y)}ke(c,b,c,d,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));ke(a,b,c,b,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));ke(a,d,c,d,e,f,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-f)*(l.y-f),q<m&&(m=q,n=l.x,p=l.y));l.x=n;l.y=p;return 1E21>m}
    function me(a,b,c,d,e,f,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(f-k)/m,h=a,n=k*h+(f-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(f-k)/m,a=b-d*a,h=(f-k*e-a)/(d-k),n=d*h+a);l.m(h,n);return l}
    function ne(a,b,c){var d=b.x,e=b.y,f=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===f?(f=a=0,e<h?(a=e,f=h):(a=h,f=e),k<=d&&d<=l&&a<=n&&f>=m):e===h?(d<f?a=d:(a=f,f=d),m<=e&&e<=n&&a<=l&&f>=k):a.Ia(b)||a.Ia(c)||oe(k,m,l,m,d,e,f,h)||oe(l,m,l,n,d,e,f,h)||oe(l,n,k,n,d,e,f,h)||oe(k,n,k,m,d,e,f,h)?!0:!1}function oe(a,b,c,d,e,f,h,k){return 0>=xe(a,b,c,d,e,f)*xe(a,b,c,d,h,k)&&0>=xe(e,f,h,k,a,b)*xe(e,f,h,k,c,d)}
    function xe(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}function ye(a){0>a&&(a+=360);360<=a&&(a-=360);return a}
    function ze(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);d=b<c?1:-1;var f=[],h=e/2,k=b;for(b=Math.min(2*e,Math.abs(c-b));1E-5<b;){c=k+d*Math.min(b,h);var e=(c-k)/2,l=a*Math.cos(e),m=a*Math.sin(e),n=-m,p=l*l+n*n,q=p+l*l+n*m,p=4/3*(Math.sqrt(2*p*q)-q)/(l*m-n*l),m=l-p*n,l=n+p*l,n=-l,p=e+k,e=Math.cos(p),p=Math.sin(p);f.push([0+a*Math.cos(k),0+a*Math.sin(k),0+m*e-l*p,0+m*p+l*e,0+m*e-n*p,0+m*p+n*e,0+a*Math.cos(c),0+a*Math.sin(c)]);b-=Math.abs(c-k);k=c}return f}
    function Na(a,b,c,d,e,f,h){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/f)*f+d;var k=c;c+e-a<e/2&&(k=c+e);a=d;d+f-b<f/2&&(a=d+f);h.m(k,a)}function Ae(a,b){var c=Math.max(a,b),d=Math.min(a,b),e=1,f=1;do e=c%d,c=f=d,d=e;while(0<e);return f}
    function Be(a,b,c,d){var e=0>c,f=0>d,h=0,k=h=0;a<b?(h=1,k=0):(h=0,k=1);var l=0,m=0,n=0,p=0,l=0===h?a:b,n=0===h?c:d;if(0===h?e:f)n=-n;h=k;m=0===h?a:b;p=0===h?c:d;if(0===h?e:f)p=-p;a=a=0;if(0<p)if(0<n){b=l*l;a=m*m;l*=n;c=m*p;d=-a+c;e=-a+Math.sqrt(l*l+c*c);m=d;for(f=0;9999999999>f;++f){m=.5*(d+e);if(m===d||m===e)break;k=l/(m+b);h=c/(m+a);k=k*k+h*h-1;if(0<k)d=m;else if(0>k)e=m;else break}n=b*n/(m+b)-n;p=a*p/(m+a)-p;a=Math.sqrt(n*n+p*p)}else a=Math.abs(p-m);else p=l*l-m*m,a=l*n,a<p?(p=a/p,a=m*Math.sqrt(Math.abs(1-
            p*p)),n=l*p-n,a=Math.sqrt(n*n+a*a)):a=Math.abs(n-l);return a}function Ce(a){1<arguments.length&&w.k("Geometry constructor can take at most one optional argument, the Geometry type.");w.nc(this);this.P=!1;void 0===a&&(a=De);this.na=a;this.Gb=this.yb=this.Ic=this.zc=0;this.Oj=new H(Ee);this.zv=this.Oj.F;this.jv=(new B).freeze();this.fb=!0;this.Iq=this.mo=null;this.Jq=NaN;this.hi=Ab;this.ii=Sb;this.Oo=this.Qo=NaN;this.Gi=Fe}w.ga("Geometry",Ce);w.ni(Ce);
    Ce.prototype.copy=function(){var a=new Ce;a.na=this.na;a.zc=this.zc;a.Ic=this.Ic;a.yb=this.yb;a.Gb=this.Gb;for(var b=this.Oj.n,c=b.length,d=a.Oj,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.zv=this.zv;a.jv.assign(this.jv);a.fb=this.fb;a.mo=this.mo;a.Iq=this.Iq;a.Jq=this.Jq;a.hi=this.hi.S();a.ii=this.ii.S();a.Qo=this.Qo;a.Oo=this.Oo;a.Gi=this.Gi;return a};var Ge;Ce.Line=Ge=w.p(Ce,"Line",0);var He;Ce.Rectangle=He=w.p(Ce,"Rectangle",1);var Le;Ce.Ellipse=Le=w.p(Ce,"Ellipse",2);var De;
    Ce.Path=De=w.p(Ce,"Path",3);Ce.prototype.Ha=function(){this.freeze();Object.freeze(this);return this};Ce.prototype.freeze=function(){this.P=!0;var a=this.fc;a.freeze();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].freeze();return this};Ce.prototype.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);this.P=!1;var a=this.fc;a.Qa();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].Qa();return this};
    Ce.prototype.equalsApprox=Ce.prototype.Kc=function(a){if(!(a instanceof Ce))return!1;if(this.type!==a.type)return this.type===Ge&&a.type===De?Me(this,a):a.type===Ge&&this.type===De?Me(a,this):!1;if(this.type===De){var b=this.fc.n;a=a.fc.n;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Kc(a[d]))return!1;return!0}return J(this.ha,a.ha)&&J(this.fa,a.fa)&&J(this.C,a.C)&&J(this.D,a.D)};
    function Me(a,b){if(a.type!==Ge||b.type!==De)return!1;if(1===b.fc.count){var c=b.fc.ea(0);if(1===c.vb.count&&J(a.ha,c.ha)&&J(a.fa,c.fa)&&(c=c.vb.ea(0),c.type===Ne&&J(a.C,c.C)&&J(a.D,c.D)))return!0}return!1}var Oe;Ce.stringify=Oe=function(a){return a.toString()};Ce.prototype.ic=function(a){a.Ee===Ce?this.type=a:w.Fj(this,a)};
    Ce.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case Ge:return 0>a?"M"+this.ha.toString()+" "+this.fa.toString()+"L"+this.C.toString()+" "+this.D.toString():"M"+this.ha.toFixed(a)+" "+this.fa.toFixed(a)+"L"+this.C.toFixed(a)+" "+this.D.toFixed(a);case He:var b=new B(this.ha,this.fa,0,0);b.DG(this.C,this.D,0,0);return 0>a?"M"+b.x.toString()+" "+b.y.toString()+"H"+b.right.toString()+"V"+b.bottom.toString()+"H"+b.left.toString()+"z":"M"+b.x.toFixed(a)+" "+b.y.toFixed(a)+"H"+b.right.toFixed(a)+
        "V"+b.bottom.toFixed(a)+"H"+b.left.toFixed(a)+"z";case Le:b=new B(this.ha,this.fa,0,0);b.DG(this.C,this.D,0,0);if(0>a){var c=b.left.toString()+" "+(b.y+b.height/2).toString(),d=b.right.toString()+" "+(b.y+b.height/2).toString();return"M"+c+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+d+"A"+(b.width/2).toString()+" "+(b.height/2).toString()+" 0 0 1 "+c}c=b.left.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);d=b.right.toFixed(a)+" "+(b.y+b.height/2).toFixed(a);return"M"+c+"A"+(b.width/
        2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+d+"A"+(b.width/2).toFixed(a)+" "+(b.height/2).toFixed(a)+" 0 0 1 "+c;case De:for(var b="",c=this.fc.n,d=c.length,e=0;e<d;e++){var f=c[e];0<e&&(b+=" x ");f.gu&&(b+="F ");b+=f.toString(a)}return b;default:return this.type.toString()}};
    Ce.fillPath=function(a){"string"!==typeof a&&w.Bd(a,"string",Ce,"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};var Pe;
    Ce.parse=Pe=function(a,b){function c(){return m>=u-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new z(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function f(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new z(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&w.Bd(a,"string",Ce,"parse:str");a=a.replace(/,/gm," ");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,
        "$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm,"$1 $2");a=a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,"$1 $2");a=a.replace(/([0-9])([+\-])/gm,"$1 $2");a=a.replace(/(\.[0-9]*)(\.)/gm,"$1 $2");a=a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm,"$1 $3 $4 ");a=a.replace(/[\s\r\t\n]+/gm," ");a=a.replace(/^\s+|\s+$/g,"");for(var l=a.split(" "),m=-1,n="",p="",q=new z(0,0),r=new z(0,0),s=new z(0,
        0),u=l.length,t=w.s(),x=!1,v=!1,A=!0,y=null;!(m>=u-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":A=!0;v=x=!1;break;case "M":y=f();null===t.Xb||!0===A?(M(t,y.x,y.y,x,!1,!v),A=!1):t.moveTo(y.x,y.y);for(q=s;!c();)y=f(),t.lineTo(y.x,y.y);break;case "L":for(;!c();)y=f(),t.lineTo(y.x,y.y);break;case "H":for(;!c();)s=y=new z((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),t.lineTo(s.x,s.y);break;case "V":for(;!c();)s=y=new z(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),t.lineTo(s.x,s.y);
        break;case "C":for(;!c();){var K=e(),E=h(),y=f();N(t,K.x,K.y,E.x,E.y,y.x,y.y)}break;case "S":for(;!c();)K=k(),E=h(),y=f(),N(t,K.x,K.y,E.x,E.y,y.x,y.y);break;case "Q":for(;!c();)E=h(),y=f(),Qe(t,E.x,E.y,y.x,y.y);break;case "T":for(;!c();)r=E=k(),y=f(),Qe(t,E.x,E.y,y.x,y.y);break;case "B":for(;!c();){var y=parseFloat(d()),K=parseFloat(d()),E=parseFloat(d()),P=parseFloat(d()),$=parseFloat(d()),S=$,ba=!1;c()||(S=parseFloat(d()),c()||(ba=0!==parseFloat(d())));n===n.toLowerCase()&&(E+=s.x,P+=s.y);t.arcTo(y,
        K,E,P,$,S,ba)}break;case "A":for(;!c();)K=Math.abs(parseFloat(d())),E=Math.abs(parseFloat(d())),P=parseFloat(d()),$=!!parseFloat(d()),S=!!parseFloat(d()),y=f(),Re(t,K,E,P,$,S,y.x,y.y);break;case "Z":y=t.o.fc.n[t.o.fc.length-1];O(t);s=q;break;case "F":y="";for(K=1;l[m+K];)if(null!==l[m+K].match(/[Uu]/))K++;else if(null===l[m+K].match(/[A-Za-z]/))K++;else{y=l[m+K];break}y.match(/[Mm]/)?x=!0:Se(t);break;case "U":y="";for(K=1;l[m+K];)if(null!==l[m+K].match(/[Ff]/))K++;else if(null===l[m+K].match(/[A-Za-z]/))K++;
    else{y=l[m+K];break}y.match(/[Mm]/)?v=!0:t.bb(!1)}q=t.o;w.q(t);if(b)for(t=q.fc.i;t.next();)y=t.value,y.gu=!0;return q};function Te(a,b){for(var c=a.length,d=w.K(),e=0;e<c;e++){var f=a[e];d.x=f[0];d.y=f[1];b.nb(d);f[0]=d.x;f[1]=d.y;d.x=f[2];d.y=f[3];b.nb(d);f[2]=d.x;f[3]=d.y;d.x=f[4];d.y=f[5];b.nb(d);f[4]=d.x;f[5]=d.y;d.x=f[6];d.y=f[7];b.nb(d);f[6]=d.x;f[7]=d.y}w.v(d)}
    Ce.prototype.Ax=function(){if(this.fb||this.zv!==this.fc.F)return!0;for(var a=this.fc.n,b=a.length,c=0;c<b;c++)if(a[c].Ax())return!0;return!1};Ce.prototype.ty=function(){this.fb=!1;this.Iq=this.mo=null;this.Jq=NaN;this.zv=this.fc.F;for(var a=this.fc.n,b=a.length,c=0;c<b;c++)a[c].ty()};Ce.prototype.uh=function(){var a=this.jv;a.Qa();isNaN(this.Qo)||isNaN(this.Oo)?a.m(0,0,0,0):a.m(0,0,this.Qo,this.Oo);Ue(this,a,!1);ab(a,0,0,0,0);a.freeze()};
    Ce.prototype.computeBoundsWithoutOrigin=Ce.prototype.yH=function(){var a=new B;Ue(this,a,!0);return a};
    function Ue(a,b,c){switch(a.type){case Ge:case He:case Le:c?b.m(a.zc,a.Ic,0,0):ab(b,a.zc,a.Ic,0,0);ab(b,a.yb,a.Gb,0,0);break;case De:var d=a.fc;a=d.n;for(var d=d.length,e=0;e<d;e++){var f=a[e];c&&0===e?b.m(f.ha,f.fa,0,0):ab(b,f.ha,f.fa,0,0);for(var h=f.vb.n,k=h.length,l=f.ha,m=f.fa,n=0;n<k;n++){var p=h[n];switch(p.type){case Ne:case nf:l=p.C;m=p.D;ab(b,l,m,0,0);break;case of:Wd(l,m,p.uc,p.Qc,p.Ch,p.Dh,p.C,p.D,.5,b);l=p.C;m=p.D;break;case pf:ge(l,m,p.uc,p.Qc,p.C,p.D,.5,b);l=p.C;m=p.D;break;case qf:case rf:var q=
        p.type===qf?sf(p,f):tf(p,f,l,m),r=q.length;if(0===r){l=p.la;m=p.ra;ab(b,l,m,0,0);break}for(var p=null,s=0;s<r;s++)p=q[s],Wd(p[0],p[1],p[2],p[3],p[4],p[5],p[6],p[7],.5,b);null!==p&&(l=p[6],m=p[7]);break;default:w.k("Unknown Segment type: "+p.type)}}}break;default:w.k("Unknown Geometry type: "+a.type)}}Ce.prototype.normalize=Ce.prototype.normalize=function(){this.P&&w.ma(this);var a=this.yH();this.offset(-a.x,-a.y);return new z(-a.x,-a.y)};
    Ce.prototype.offset=Ce.prototype.offset=function(a,b){this.P&&w.ma(this);this.transform(1,0,0,1,a,b);return this};Ce.prototype.scale=Ce.prototype.scale=function(a,b){this.P&&w.ma(this);this.transform(a,0,0,b,0,0);return this};Ce.prototype.rotate=Ce.prototype.rotate=function(a,b,c){this.P&&w.ma(this);void 0===b&&(b=0);void 0===c&&(c=0);var d=w.Kf();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);w.we(d);return this};
    Ce.prototype.transform=Ce.prototype.transform=function(a,b,c,d,e,f){var h=0,k=0;switch(this.type){case Ge:case He:case Le:h=this.zc;k=this.Ic;this.zc=h*a+k*c+e;this.Ic=h*b+k*d+f;h=this.yb;k=this.Gb;this.yb=h*a+k*c+e;this.Gb=h*b+k*d+f;break;case De:for(var l=this.fc.n,m=l.length,n=0;n<m;n++){var p=l[n],h=p.ha,k=p.fa;p.ha=h*a+k*c+e;p.fa=h*b+k*d+f;for(var p=p.vb.n,q=p.length,r=0;r<q;r++){var s=p[r];switch(s.type){case Ne:case nf:h=s.C;k=s.D;s.C=h*a+k*c+e;s.D=h*b+k*d+f;break;case of:h=s.uc;k=s.Qc;s.uc=
        h*a+k*c+e;s.Qc=h*b+k*d+f;h=s.Ch;k=s.Dh;s.Ch=h*a+k*c+e;s.Dh=h*b+k*d+f;h=s.C;k=s.D;s.C=h*a+k*c+e;s.D=h*b+k*d+f;break;case pf:h=s.uc;k=s.Qc;s.uc=h*a+k*c+e;s.Qc=h*b+k*d+f;h=s.C;k=s.D;s.C=h*a+k*c+e;s.D=h*b+k*d+f;break;case qf:h=s.la;k=s.ra;s.la=h*a+k*c+e;s.ra=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.ze+=h);0>a&&(s.ze=180-s.ze,s.rf=-s.rf);0>d&&(s.ze=-s.ze,s.rf=-s.rf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case rf:h=s.C;k=s.D;s.C=h*
        a+k*c+e;s.D=h*b+k*d+f;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Hj+=h);0>a&&(s.Hj=180-s.Hj,s.am=!s.am);0>d&&(s.Hj=-s.Hj,s.am=!s.am);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:w.k("Unknown Segment type: "+s.type)}}}}this.fb=!0;return this};
    Ce.prototype.Ia=function(a,b,c,d){var e=a.x,f=a.y,h=this.gb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.fc.n,s=r.length,u=0;u<s;u++){var t=r[u];if(t.gu){if(c&&t.Ia(e,f,b))return!0;for(var x=t.vb,l=t.ha,m=t.fa,v=l,A=m,y=x.n,K=0;K<=x.length;K++){var E,P;K!==x.length?(E=y[K],P=E.type,p=E.C,q=E.D):(P=Ne,p=v,q=A);switch(P){case nf:n=uf(e,f,h,a,l,m,v,A);if(isNaN(n))return!0;k+=n;v=p;A=q;break;case Ne:n=uf(e,f,h,a,l,m,p,q);if(isNaN(n))return!0;k+=n;break;case of:n=je(l,m,E.uc,E.Qc,E.Ch,E.Dh,p,q,h,
        a,e,f,.5);k+=n;break;case pf:n=je(l,m,(l+2*E.uc)/3,(m+2*E.Qc)/3,(2*E.uc+p)/3,(2*E.Qc+q)/3,p,q,h,a,e,f,.5);k+=n;break;case qf:case rf:P=E.type===qf?sf(E,t):tf(E,t,l,m);var $=P.length;if(0===$){n=uf(e,f,h,a,l,m,E.la,E.ra);if(isNaN(n))return!0;k+=n;break}for(var S=null,ba=0;ba<$;ba++){S=P[ba];if(0===ba){n=uf(e,f,h,a,l,m,S[0],S[1]);if(isNaN(n))return!0;k+=n}n=je(S[0],S[1],S[2],S[3],S[4],S[5],S[6],S[7],h,a,e,f,.5);k+=n}null!==S&&(p=S[6],q=S[7]);break;default:w.k("Unknown Segment type: "+E.type)}l=p;m=
        q}if(0!==k)return!0;k=0}else if(t.Ia(e,f,d?b:b+2))return!0}return 0!==k};function uf(a,b,c,d,e,f,h,k){if(Ud(e,f,h,k,.05,a,b))return NaN;var l=(a-c)*(f-k);if(0===l)return 0;var m=((a*d-b*c)*(e-h)-(a-c)*(e*k-f*h))/l;b=(a*d-b*c)*(f-k)/l;if(m>=a)return 0;if((e>h?e-h:h-e)<(f>k?f-k:k-f)){if(e=a=0,f<k?(a=f,e=k):(a=k,e=f),b<a||b>e)return 0}else if(e<h?(a=e,e=h):a=h,m<a||m>e)return 0;return 0<l?1:-1}function vf(a,b,c,d){a=a.fc.n;for(var e=a.length,f=0;f<e;f++)if(a[f].Ia(b,c,d))return!0;return!1}
    Ce.prototype.getPointAlongPath=Ce.prototype.dI=function(a,b){0>a?a=0:1<a&&(a=1);void 0===b&&(b=new z);if(this.type===Ge)return b.m(this.ha+a*(this.C-this.ha),this.fa+a*(this.D-this.fa)),b;for(var c=this.qx,d=this.Rt,e=c.length,f=this.St*a,h=0,k=0;k<e;k++)for(var l=d[k],m=l.length,n=0;n<m;n++){var p=l[n];if(h+p>=f)return d=(f-h)/p,c=c[k],k=c[2*n],e=c[2*n+1],b.m(k+(c[2*n+2]-k)*d,e+(c[2*n+3]-e)*d),b;h+=p}b.m(NaN,NaN);return b};
    Ce.prototype.getAngleAlongPath=Ce.prototype.ZE=function(a){0>a?a=0:1<a&&(a=1);var b=0;if(this.type===Ge)return b=180*Math.atan2(this.D-this.fa,this.C-this.ha)/Math.PI;for(var b=this.qx,c=this.Rt,d=b.length,e=this.St*a,f=0,h=0;h<d;h++){var k=c[h],l=k.length;for(a=0;a<l;a++){var m=k[a];if(f+m>=e)return b=b[h],b=180*Math.atan2(b[2*a+3]-b[2*a+1],b[2*a+2]-b[2*a])/Math.PI;f+=m}}return NaN};
    Ce.prototype.getFractionForPoint=Ce.prototype.$H=function(a){if(this.type===Ge){var b=this.ha,c=this.fa,d=this.C,e=this.D;if(b!==d||c!==e){var f=a.x;a=a.y;var h=0,k=0;return b===d?(c<e?(h=c,k=e):(h=e,k=c),a<=h?h===c?0:1:a>=k?k===c?0:1:Math.abs(a-c)/(k-h)):c===e?(b<d?(h=b,k=d):(h=d,k=b),f<=h?h===b?0:1:f>=k?k===b?0:1:Math.abs(f-b)/(k-h)):((f-b)*(f-b)+(a-c)*(a-c))/((d-b)*(d-b)+(e-c)*(e-c))}}else if(this.type===He){if(b=this.ha,c=this.fa,d=this.C,e=this.D,b!==d||c!==e){var h=d-b,k=e-c,l=2*h+2*k,f=a.x;
        a=a.y;f=Math.min(Math.max(f,b),d);a=Math.min(Math.max(a,c),e);var b=Math.abs(f-b),d=Math.abs(f-d),c=Math.abs(a-c),e=Math.abs(a-e),m=Math.min(b,d,c,e);if(m===c)return f/l;if(m===d)return(h+a)/l;if(m===e)return(2*h+k-f)/l;if(m===b)return(2*h+2*k-a)/l}}else{for(var e=this.qx,h=this.Rt,k=this.St,l=w.K(),c=Infinity,b=d=0,f=e.length,n=m=0,p=0;p<f;p++)for(var q=e[p],r=h[p],s=q.length,u=0;u<s;u+=2){var t=q[u],x=q[u+1];if(0!==u){La(m,n,t,x,a.x,a.y,l);var v=(l.x-a.x)*(l.x-a.x)+(l.y-a.y)*(l.y-a.y);v<c&&(c=v,
        d=b,d+=Math.sqrt((l.x-m)*(l.x-m)+(l.y-n)*(l.y-n)));b+=r[(u-2)/2]}m=t;n=x}w.v(l);a=d/k;return 0>a?0:1<a?1:a}return 0};w.u(Ce,{qx:null},function(){wf(this);return this.mo});
    function wf(a){if(null===a.mo){a.Ax()&&a.ty();var b=a.mo=[],c=a.Iq=[],d=[],e=[];if(a.type===Ge)d.push(a.ha),d.push(a.fa),d.push(a.C),d.push(a.D),b.push(d),e.push(Math.sqrt((a.ha-a.C)*(a.ha-a.C)+(a.fa-a.D)*(a.fa-a.D))),c.push(e);else if(a.type===He)d.push(a.ha),d.push(a.fa),d.push(a.C),d.push(a.fa),d.push(a.C),d.push(a.D),d.push(a.ha),d.push(a.D),d.push(a.ha),d.push(a.fa),b.push(d),e.push(Math.abs(a.ha-a.C)),e.push(Math.abs(a.fa-a.D)),e.push(Math.abs(a.ha-a.C)),e.push(Math.abs(a.fa-a.D)),c.push(e);
    else if(a.type===Le){var f=new Ee;f.ha=a.C;f.fa=(a.fa+a.D)/2;var h=new xf(qf);h.ze=0;h.rf=360;h.la=(a.ha+a.C)/2;h.ra=(a.fa+a.D)/2;h.radiusX=Math.abs(a.ha-a.C)/2;h.radiusY=Math.abs(a.fa-a.D)/2;f.add(h);a=sf(h,f);e=a.length;if(0===e)d.push(h.la),d.push(h.ra);else for(var h=f.ha,f=f.fa,k=0;k<e;k++){var l=a[k];Xd(h,f,l[2],l[3],l[4],l[5],l[6],l[7],.5,d);h=l[6];f=l[7]}b.push(d);c.push(yf(d))}else for(var m=a.fc.i;m.next();){var n=m.value,d=[];d.push(n.ha);d.push(n.fa);for(var h=n.ha,f=n.fa,p=h,q=f,r=n.vb.n,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               s=r.length,u=0;u<s;u++){var t=r[u];switch(t.na){case nf:4<=d.length&&(b.push(d),c.push(yf(d)));d=[];d.push(t.C);d.push(t.D);h=t.C;f=t.D;p=h;q=f;break;case Ne:d.push(t.C);d.push(t.D);h=t.C;f=t.D;break;case of:Xd(h,f,t.Fd,t.Ye,t.oh,t.Fg,t.yb,t.Gb,.5,d);h=t.C;f=t.D;break;case pf:he(h,f,t.Fd,t.Ye,t.yb,t.Gb,.5,d);h=t.C;f=t.D;break;case qf:a=sf(t,n);e=a.length;if(0===e){d.push(t.la);d.push(t.ra);h=t.la;f=t.ra;break}for(k=0;k<e;k++)l=a[k],Xd(h,f,l[2],l[3],l[4],l[5],l[6],l[7],.5,d),h=l[6],f=l[7];break;case rf:a=
        tf(t,n,h,f);e=a.length;if(0===e){d.push(t.la);d.push(t.ra);h=t.la;f=t.ra;break}for(k=0;k<e;k++)l=a[k],Xd(h,f,l[2],l[3],l[4],l[5],l[6],l[7],.5,d),h=l[6],f=l[7];break;default:w.k("Segment not of valid type: "+t.na)}t.Sh&&(d.push(p),d.push(q))}4<=d.length&&(b.push(d),c.push(yf(d)))}}}w.u(Ce,{Rt:null},function(){wf(this);return this.Iq});
    w.u(Ce,{St:null},function(){var a=this.Jq;if(isNaN(a)){if(this.type===Ge)var a=Math.abs(this.C-this.ha),b=Math.abs(this.D-this.fa),a=Math.sqrt(a*a+b*b);else if(this.type===He)a=Math.abs(this.C-this.ha),b=Math.abs(this.D-this.fa),a=2*a+2*b;else for(var b=this.Rt,c=b.length,d=a=0;d<c;d++)for(var e=b[d],f=e.length,h=0;h<f;h++)a+=e[h];this.Jq=a}return a});function yf(a){for(var b=[],c=0,d=0,e=a.length,f=0;f<e;f+=2){var h=a[f],k=a[f+1];0!==f&&(c=Math.sqrt(Sa(c,d,h,k)),b.push(c));c=h;d=k}return b}
    w.defineProperty(Ce,{type:"type"},function(){return this.na},function(a){this.na!==a&&(this.P&&w.ma(this,a),this.na=a,this.fb=!0)});w.defineProperty(Ce,{ha:"startX"},function(){return this.zc},function(a){this.zc!==a&&(this.P&&w.ma(this,a),this.zc=a,this.fb=!0)});w.defineProperty(Ce,{fa:"startY"},function(){return this.Ic},function(a){this.Ic!==a&&(this.P&&w.ma(this,a),this.Ic=a,this.fb=!0)});
    w.defineProperty(Ce,{C:"endX"},function(){return this.yb},function(a){this.yb!==a&&(this.P&&w.ma(this,a),this.yb=a,this.fb=!0)});w.defineProperty(Ce,{D:"endY"},function(){return this.Gb},function(a){this.Gb!==a&&(this.P&&w.ma(this,a),this.Gb=a,this.fb=!0)});w.defineProperty(Ce,{fc:"figures"},function(){return this.Oj},function(a){this.Oj!==a&&(this.P&&w.ma(this,a),this.Oj=a,this.fb=!0)});Ce.prototype.add=Ce.prototype.add=function(a){this.Oj.add(a);return this};
    Ce.prototype.setSpots=function(a,b,c,d,e,f,h,k){this.P&&w.ma(this);this.hi=(new L(a,b,e,f)).freeze();this.ii=(new L(c,d,h,k)).freeze();return this};w.defineProperty(Ce,{A:"spot1"},function(){return this.hi},function(a){this.P&&w.ma(this,a);this.hi=a.S()});w.defineProperty(Ce,{B:"spot2"},function(){return this.ii},function(a){this.P&&w.ma(this,a);this.ii=a.S()});w.defineProperty(Ce,{be:"defaultStretch"},function(){return this.Gi},function(a){this.P&&w.ma(this,a);this.Gi=a});
    w.u(Ce,{gb:"bounds"},function(){this.Ax()&&(this.ty(),this.uh());return this.jv});function Ee(a,b,c,d){w.nc(this);this.P=!1;void 0===c&&(c=!0);this.Gm=c;void 0===d&&(d=!0);this.Ro=d;this.zc=void 0!==a?a:0;this.Ic=void 0!==b?b:0;this.lp=new H(xf);this.yw=this.lp.F;this.fb=!0}w.ga("PathFigure",Ee);w.ni(Ee);
    Ee.prototype.copy=function(){var a=new Ee;a.Gm=this.Gm;a.Ro=this.Ro;a.zc=this.zc;a.Ic=this.Ic;for(var b=this.lp.n,c=b.length,d=a.lp,e=0;e<c;e++){var f=b[e].copy();d.add(f)}a.yw=this.yw;a.fb=this.fb;return a};Ee.prototype.equalsApprox=Ee.prototype.Kc=function(a){if(!(a instanceof Ee&&J(this.ha,a.ha)&&J(this.fa,a.fa)))return!1;var b=this.vb.n;a=a.vb.n;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Kc(a[d]))return!1;return!0};g=Ee.prototype;
    g.toString=function(a){void 0===a&&(a=-1);for(var b=0>a?"M"+this.ha.toString()+" "+this.fa.toString():"M"+this.ha.toFixed(a)+" "+this.fa.toFixed(a),c=this.vb.n,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};g.freeze=function(){this.P=!0;var a=this.vb;a.freeze();for(var b=a.n,a=a.length,c=0;c<a;c++)b[c].freeze();return this};g.Qa=function(){this.P=!1;var a=this.vb;a.Qa();for(var a=a.n,b=a.length,c=0;c<b;c++)a[c].Qa();return this};
    g.Ax=function(){if(this.fb)return!0;var a=this.vb;if(this.yw!==a.F)return!0;for(var a=a.n,b=a.length,c=0;c<b;c++)if(a[c].fb)return!0;return!1};g.ty=function(){this.fb=!1;var a=this.vb;this.yw=a.F;for(var a=a.n,b=a.length,c=0;c<b;c++){var d=a[c];d.fb=!1;d.pg=null}};w.defineProperty(Ee,{gu:"isFilled"},function(){return this.Gm},function(a){this.P&&w.ma(this,a);this.Gm=a});w.defineProperty(Ee,{dm:"isShadowed"},function(){return this.Ro},function(a){this.P&&w.ma(this,a);this.Ro=a});
    w.defineProperty(Ee,{ha:"startX"},function(){return this.zc},function(a){this.P&&w.ma(this,a);this.zc=a;this.fb=!0});w.defineProperty(Ee,{fa:"startY"},function(){return this.Ic},function(a){this.P&&w.ma(this,a);this.Ic=a;this.fb=!0});w.defineProperty(Ee,{vb:"segments"},function(){return this.lp},function(a){this.P&&w.ma(this,a);this.lp=a;this.fb=!0});Ee.prototype.add=Ee.prototype.add=function(a){this.lp.add(a);return this};
    Ee.prototype.Ia=function(a,b,c){for(var d=this.ha,e=this.fa,f=d,h=e,k=this.vb.n,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case nf:f=n.C;h=n.D;d=n.C;e=n.D;break;case Ne:if(Ud(d,e,n.C,n.D,c,a,b))return!0;d=n.C;e=n.D;break;case of:if(Vd(d,e,n.uc,n.Qc,n.Ch,n.Dh,n.C,n.D,.5,a,b,c))return!0;d=n.C;e=n.D;break;case pf:if(fe(d,e,n.uc,n.Qc,n.C,n.D,.5,a,b,c))return!0;d=n.C;e=n.D;break;case qf:case rf:var p=n.type===qf?sf(n,this):tf(n,this,d,e),q=p.length;if(0===q){if(Ud(d,e,n.la,n.ra,c,a,b))return!0;
        d=n.la;e=n.ra;break}for(var r=null,s=0;s<q;s++)if(r=p[s],0===s&&Ud(d,e,r[0],r[1],c,a,b)||Vd(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:w.k("Unknown Segment type: "+n.type)}if(n.xx&&(d!==f||e!==h)&&Ud(d,e,f,h,c,a,b))return!0}return!1};
    function xf(a,b,c,d,e,f,h,k){w.nc(this);this.P=!1;void 0===a&&(a=Ne);this.na=a;this.yb=void 0!==b?b:0;this.Gb=void 0!==c?c:0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===f&&(f=0);void 0===h&&(h=0);a===rf?(a=f%360,0>a&&(a+=360),this.Fd=a,this.Ye=0,this.oh=Math.max(d,0),this.Fg=Math.max(e,0),this.Vo="boolean"===typeof h?!!h:!1,this.qo=!!k):(this.Fd=d,this.Ye=e,a===qf&&(f=Math.max(f,0)),this.oh=f,"number"===typeof h?(a===qf&&(h=Math.max(h,0)),this.Fg=h):this.Fg=0,this.qo=this.Vo=!1);this.Sh=!1;this.fb=
        !0;this.pg=null}w.ga("PathSegment",xf);w.ni(xf);xf.prototype.copy=function(){var a=new xf;a.na=this.na;a.yb=this.yb;a.Gb=this.Gb;a.Fd=this.Fd;a.Ye=this.Ye;a.oh=this.oh;a.Fg=this.Fg;a.Vo=this.Vo;a.qo=this.qo;a.Sh=this.Sh;a.fb=this.fb;return a};
    xf.prototype.equalsApprox=xf.prototype.Kc=function(a){if(!(a instanceof xf)||this.type!==a.type||this.xx!==a.xx)return!1;switch(this.type){case nf:case Ne:return J(this.C,a.C)&&J(this.D,a.D);case of:return J(this.C,a.C)&&J(this.D,a.D)&&J(this.uc,a.uc)&&J(this.Qc,a.Qc)&&J(this.Ch,a.Ch)&&J(this.Dh,a.Dh);case pf:return J(this.C,a.C)&&J(this.D,a.D)&&J(this.uc,a.uc)&&J(this.Qc,a.Qc);case qf:return J(this.ze,a.ze)&&J(this.rf,a.rf)&&J(this.la,a.la)&&J(this.ra,a.ra)&&J(this.radiusX,a.radiusX)&&J(this.radiusY,
            a.radiusY);case rf:return this.am===a.am&&this.Bx===a.Bx&&J(this.Hj,a.Hj)&&J(this.C,a.C)&&J(this.D,a.D)&&J(this.radiusX,a.radiusX)&&J(this.radiusY,a.radiusY);default:return!1}};xf.prototype.ic=function(a){a.Ee===xf?this.type=a:w.Fj(this,a)};
    xf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case nf:b=0>a?"M"+this.C.toString()+" "+this.D.toString():"M"+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case Ne:b=0>a?"L"+this.C.toString()+" "+this.D.toString():"L"+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case of:b=0>a?"C"+this.uc.toString()+" "+this.Qc.toString()+" "+this.Ch.toString()+" "+this.Dh.toString()+" "+this.C.toString()+" "+this.D.toString():"C"+this.uc.toFixed(a)+" "+this.Qc.toFixed(a)+" "+this.Ch.toFixed(a)+
        " "+this.Dh.toFixed(a)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case pf:b=0>a?"Q"+this.uc.toString()+" "+this.Qc.toString()+" "+this.C.toString()+" "+this.D.toString():"Q"+this.uc.toFixed(a)+" "+this.Qc.toFixed(a)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;case qf:b=0>a?"B"+this.ze.toString()+" "+this.rf.toString()+" "+this.la.toString()+" "+this.ra.toString()+" "+this.radiusX:"B"+this.ze.toFixed(a)+" "+this.rf.toFixed(a)+" "+this.la.toFixed(a)+" "+this.ra.toFixed(a)+" "+this.radiusX;
        break;case rf:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.Hj.toString()+" "+(this.Bx?1:0)+" "+(this.am?1:0)+" "+this.C.toString()+" "+this.D.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.Hj.toFixed(a)+" "+(this.Bx?1:0)+" "+(this.am?1:0)+" "+this.C.toFixed(a)+" "+this.D.toFixed(a);break;default:b=this.type.toString()}return b+(this.Sh?"z":"")};var nf;xf.Move=nf=w.p(xf,"Move",0);var Ne;xf.Line=Ne=w.p(xf,"Line",1);var of;
    xf.Bezier=of=w.p(xf,"Bezier",2);var pf;xf.QuadraticBezier=pf=w.p(xf,"QuadraticBezier",3);var qf;xf.Arc=qf=w.p(xf,"Arc",4);var rf;xf.SvgArc=rf=w.p(xf,"SvgArc",4);xf.prototype.freeze=function(){this.P=!0;return this};xf.prototype.Qa=function(){this.P=!1;return this};xf.prototype.close=xf.prototype.close=function(){this.Sh=!0;return this};
    function sf(a,b){if(null!==a.pg&&!1===b.fb)return a.pg;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.pg=[],a.pg;var e=a.Fd,f=a.Ye,h=ze(c<d?c:d,a.ze,a.ze+a.rf,!1);if(c!==d){var k=w.Kf();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);Te(h,k);w.we(k)}c=h.length;for(d=0;d<c;d++)k=h[d],k[0]+=e,k[1]+=f,k[2]+=e,k[3]+=f,k[4]+=e,k[5]+=f,k[6]+=e,k[7]+=f;a.pg=h;return a.pg}
    function tf(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.pg&&!1===b.fb)return a.pg;b=a.oh;var f=a.Fg;if(0===b||0===f)return a.pg=[],a.pg;var h=Math.PI/180*a.Fd,k=a.Vo,l=a.qo,m=a.yb,n=a.Gb,p=Math.cos(h),q=Math.sin(h),r=p*(c-m)/2+q*(d-n)/2,h=-q*(c-m)/2+p*(d-n)/2,s=r*r/(b*b)+h*h/(f*f);1<s&&(b*=Math.sqrt(s),f*=Math.sqrt(s));s=(k===l?-1:1)*Math.sqrt((b*b*f*f-b*b*h*h-f*f*r*r)/(b*b*h*h+f*f*r*r));isNaN(s)&&(s=0);k=s*b*h/f;s=s*-f*
        r/b;isNaN(k)&&(k=0);isNaN(s)&&(s=0);c=(c+m)/2+p*k-q*s;d=(d+n)/2+q*k+p*s;n=e(1,0,(r-k)/b,(h-s)/f);p=(r-k)/b;m=(h-s)/f;r=(-r-k)/b;k=(-h-s)/f;h=e(p,m,r,k);r=(p*r+m*k)/(Math.sqrt(p*p+m*m)*Math.sqrt(r*r+k*k));-1>=r?h=Math.PI:1<=r&&(h=0);!l&&0<h&&(h-=2*Math.PI);l&&0>h&&(h+=2*Math.PI);l=b>f?1:b/f;r=b>f?f/b:1;b=ze(b>f?b:f,n,n+h,!0);f=w.Kf();f.reset();f.translate(c,d);f.rotate(a.Fd,0,0);f.scale(l,r);Te(b,f);w.we(f);a.pg=b;return a.pg}
    w.defineProperty(xf,{xx:"isClosed"},function(){return this.Sh},function(a){this.Sh!==a&&(this.Sh=a,this.fb=!0)});w.defineProperty(xf,{type:"type"},function(){return this.na},function(a){this.P&&w.ma(this,a);this.na=a;this.fb=!0});w.defineProperty(xf,{C:"endX"},function(){return this.yb},function(a){this.P&&w.ma(this,a);this.yb=a;this.fb=!0});w.defineProperty(xf,{D:"endY"},function(){return this.Gb},function(a){this.P&&w.ma(this,a);this.Gb=a;this.fb=!0});
    w.defineProperty(xf,{uc:"point1X"},function(){return this.Fd},function(a){this.P&&w.ma(this,a);this.Fd=a;this.fb=!0});w.defineProperty(xf,{Qc:"point1Y"},function(){return this.Ye},function(a){this.P&&w.ma(this,a);this.Ye=a;this.fb=!0});w.defineProperty(xf,{Ch:"point2X"},function(){return this.oh},function(a){this.P&&w.ma(this,a);this.oh=a;this.fb=!0});w.defineProperty(xf,{Dh:"point2Y"},function(){return this.Fg},function(a){this.P&&w.ma(this,a);this.Fg=a;this.fb=!0});
    w.defineProperty(xf,{la:"centerX"},function(){return this.Fd},function(a){this.P&&w.ma(this,a);this.Fd=a;this.fb=!0});w.defineProperty(xf,{ra:"centerY"},function(){return this.Ye},function(a){this.P&&w.ma(this,a);this.Ye=a;this.fb=!0});w.defineProperty(xf,{radiusX:"radiusX"},function(){return this.oh},function(a){0>a&&w.Fa(a,">= zero",xf,"radiusX");this.P&&w.ma(this,a);this.oh=a;this.fb=!0});
    w.defineProperty(xf,{radiusY:"radiusY"},function(){return this.Fg},function(a){0>a&&w.Fa(a,">= zero",xf,"radiusY");this.P&&w.ma(this,a);this.Fg=a;this.fb=!0});w.defineProperty(xf,{ze:"startAngle"},function(){return this.yb},function(a){this.yb!==a&&(this.P&&w.ma(this,a),a%=360,0>a&&(a+=360),this.yb=a,this.fb=!0)});w.defineProperty(xf,{rf:"sweepAngle"},function(){return this.Gb},function(a){this.P&&w.ma(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Gb=a;this.fb=!0});
    w.defineProperty(xf,{am:"isClockwiseArc"},function(){return this.qo},function(a){this.P&&w.ma(this,a);this.qo=a;this.fb=!0});w.defineProperty(xf,{Bx:"isLargeArc"},function(){return this.Vo},function(a){this.P&&w.ma(this,a);this.Vo=a;this.fb=!0});w.defineProperty(xf,{Hj:"xAxisRotation"},function(){return this.Fd},function(a){a%=360;0>a&&(a+=360);this.P&&w.ma(this,a);this.Fd=a;this.fb=!0});
    function zf(){this.Z=null;this.Pz=(new z(0,0)).freeze();this.Wy=(new z(0,0)).freeze();this.gv=this.dw=0;this.hv=1;this.Tv="";this.Iw=this.vv=!1;this.sv=this.iv=0;this.Jj=this.Ev=this.Pv=!1;this.vr=null;this.Gw=0;this.Ig=this.Fw=null}w.ga("InputEvent",zf);
    zf.prototype.copy=function(){var a=new zf;a.Z=this.Z;a.Pz.assign(this.ef);a.Wy.assign(this.da);a.dw=this.dw;a.gv=this.gv;a.hv=this.hv;a.Tv=this.Tv;a.vv=this.vv;a.Iw=this.Iw;a.iv=this.iv;a.sv=this.sv;a.Pv=this.Pv;a.Ev=this.Ev;a.Jj=this.Jj;a.vr=this.vr;a.Gw=this.Gw;a.Fw=this.Fw;a.Ig=this.Ig;return a};
    zf.prototype.toString=function(){var a="^";0!==this.zd&&(a+="M:"+this.zd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Ge&&(a+="C:"+this.Ge);0!==this.Sl&&(a+="D:"+this.Sl);this.Cc&&(a+="h");this.bubbles&&(a+="b");null!==this.da&&(a+="@"+this.da.toString());return a};w.defineProperty(zf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});w.defineProperty(zf,{ef:"viewPoint"},function(){return this.Pz},function(a){w.G(a,z,zf,"viewPoint");this.Pz.assign(a)});
    w.defineProperty(zf,{da:"documentPoint"},function(){return this.Wy},function(a){w.G(a,z,zf,"documentPoint");this.Wy.assign(a)});zf.prototype.getMultiTouchViewPoint=zf.prototype.tx=function(a,b){var c=this.g;if(null===c)return b;Af(c,this.event,a,b);return b};zf.prototype.getMultiTouchDocumentPoint=function(a,b){var c=this.g;if(null===c)return b;Af(c,this.event,a,b);b.assign(c.CB(b));return b};w.defineProperty(zf,{zd:"modifiers"},function(){return this.dw},function(a){this.dw=a});
    w.defineProperty(zf,{button:"button"},function(){return this.gv},function(a){this.gv=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});w.defineProperty(zf,{buttons:"buttons"},function(){return this.hv},function(a){this.hv=a});w.defineProperty(zf,{key:"key"},function(){return this.Tv},function(a){this.Tv=a});w.defineProperty(zf,{Tl:"down"},function(){return this.vv},function(a){this.vv=a});
    w.defineProperty(zf,{up:"up"},function(){return this.Iw},function(a){this.Iw=a});w.defineProperty(zf,{Ge:"clickCount"},function(){return this.iv},function(a){this.iv=a});w.defineProperty(zf,{Sl:"delta"},function(){return this.sv},function(a){this.sv=a});w.defineProperty(zf,{iu:"isMultiTouch"},function(){return this.Pv},function(a){this.Pv=a});w.defineProperty(zf,{Cc:"handled"},function(){return this.Ev},function(a){this.Ev=a});
    w.defineProperty(zf,{bubbles:"bubbles"},function(){return this.Jj},function(a){this.Jj=a});w.defineProperty(zf,{event:"event"},function(){return this.vr},function(a){this.vr=a});w.u(zf,{vj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});w.u(zf,{Hk:"isMac"},function(){return w.Hk});w.defineProperty(zf,{timestamp:"timestamp"},function(){return this.Gw},function(a){this.Gw=a});
    w.defineProperty(zf,{lg:"targetDiagram"},function(){return this.Fw},function(a){this.Fw=a});w.defineProperty(zf,{Re:"targetObject"},function(){return this.Ig},function(a){this.Ig=a});w.defineProperty(zf,{control:"control"},function(){return 0!==(this.zd&1)},function(a){this.zd=a?this.zd|1:this.zd&-2});w.defineProperty(zf,{shift:"shift"},function(){return 0!==(this.zd&4)},function(a){this.zd=a?this.zd|4:this.zd&-5});
    w.defineProperty(zf,{alt:"alt"},function(){return 0!==(this.zd&2)},function(a){this.zd=a?this.zd|2:this.zd&-3});w.defineProperty(zf,{ru:"meta"},function(){return 0!==(this.zd&8)},function(a){this.zd=a?this.zd|8:this.zd&-9});w.defineProperty(zf,{left:"left"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?0===this.button:0!==(this.buttons&1)},function(a){this.buttons=a?this.buttons|1:this.buttons&-2});
    w.defineProperty(zf,{right:"right"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?2===this.button:0!==(this.buttons&2)},function(a){this.buttons=a?this.buttons|2:this.buttons&-3});w.defineProperty(zf,{tL:"middle"},function(){var a=this.event;return null!==a&&a instanceof MouseEvent&&("mousedown"===a.type||"mouseup"===a.type)?1===this.button:0!==(this.buttons&4)},function(a){this.buttons=a?this.buttons|4:this.buttons&-5});
    function Bf(){this.Z=null;this.Sb="";this.mw=this.Dw=null;this.Qq=!1}w.ga("DiagramEvent",Bf);Bf.prototype.copy=function(){var a=new Bf;a.Z=this.Z;a.Sb=this.Sb;a.Dw=this.Dw;a.mw=this.mw;a.Qq=this.Qq;return a};Bf.prototype.toString=function(){var a="*"+this.name;null!==this.uB&&(a+=":"+this.uB.toString());null!==this.XA&&(a+="("+this.XA.toString()+")");return a};w.defineProperty(Bf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});
    w.defineProperty(Bf,{name:"name"},function(){return this.Sb},function(a){this.Sb=a});w.defineProperty(Bf,{uB:"subject"},function(){return this.Dw},function(a){this.Dw=a});w.defineProperty(Bf,{XA:"parameter"},function(){return this.mw},function(a){this.mw=a});w.defineProperty(Bf,{cancel:"cancel"},function(){return this.Qq},function(a){this.Qq!==a&&w.It("DiagramEvent.cancel","2.0");this.Qq=a});function Cf(){this.Rq=Nf;this.Xm=this.cw="";this.ss=this.ts=this.xs=this.ys=this.ws=this.Z=this.me=null}
    w.ga("ChangedEvent",Cf);var Of;Cf.Transaction=Of=w.p(Cf,"Transaction",-1);var Nf;Cf.Property=Nf=w.p(Cf,"Property",0);var Pf;Cf.Insert=Pf=w.p(Cf,"Insert",1);var Qf;Cf.Remove=Qf=w.p(Cf,"Remove",2);Cf.prototype.clear=Cf.prototype.clear=function(){this.ss=this.ts=this.xs=this.ys=this.ws=this.Z=this.me=null};
    Cf.prototype.copy=function(){var a=new Cf;a.Rq=this.Rq;a.cw=this.cw;a.Xm=this.Xm;a.me=this.me;a.Z=this.Z;a.ws=this.ws;var b=this.ys;a.ys=w.Pa(b)&&"function"===typeof b.S?b.S():b;b=this.xs;a.xs=w.Pa(b)&&"function"===typeof b.S?b.S():b;b=this.ts;a.ts=w.Pa(b)&&"function"===typeof b.S?b.S():b;b=this.ss;a.ss=w.Pa(b)&&"function"===typeof b.S?b.S():b;return a};Cf.prototype.ic=function(a){a.Ee===Cf?this.Ac=a:w.Fj(this,a)};
    Cf.prototype.toString=function(){var a="",a=this.Ac===Of?a+"* ":this.Ac===Nf?a+(null!==this.aa?"!m":"!d"):a+((null!==this.aa?"!m":"!d")+this.Ac);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.qf&&this.qf!==this.propertyName&&(a+=" "+this.qf);a+=": ";this.Ac===Of?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=Rf(this.object)),null!==this.oldValue&&(a+="  old: "+Rf(this.oldValue)),null!==this.Aj&&(a+=" "+this.Aj),null!==this.newValue&&
    (a+="  new: "+Rf(this.newValue)),null!==this.zj&&(a+=" "+this.zj));return a};Cf.prototype.getValue=Cf.prototype.ka=function(a){return a?this.oldValue:this.newValue};Cf.prototype.getParam=function(a){return a?this.Aj:this.zj};Cf.prototype.canUndo=Cf.prototype.canUndo=function(){return null!==this.aa||null!==this.g?!0:!1};Cf.prototype.undo=Cf.prototype.undo=function(){this.canUndo()&&(null!==this.aa?this.aa.qn(this,!0):null!==this.g&&this.g.qn(this,!0))};
    Cf.prototype.canRedo=Cf.prototype.canRedo=function(){return null!==this.aa||null!==this.g?!0:!1};Cf.prototype.redo=Cf.prototype.redo=function(){this.canRedo()&&(null!==this.aa?this.aa.qn(this,!1):null!==this.g&&this.g.qn(this,!1))};w.defineProperty(Cf,{aa:"model"},function(){return this.me},function(a){this.me=a});w.defineProperty(Cf,{g:"diagram"},function(){return this.Z},function(a){this.Z=a});w.defineProperty(Cf,{Ac:"change"},function(){return this.Rq},function(a){this.Rq=a});
    w.defineProperty(Cf,{qf:"modelChange"},function(){return this.cw},function(a){this.cw=a});w.defineProperty(Cf,{propertyName:"propertyName"},function(){return this.Xm},function(a){this.Xm=a});w.u(Cf,{AF:"isTransactionFinished"},function(){return this.Rq===Of&&("CommittedTransaction"===this.Xm||"FinishedUndo"===this.Xm||"FinishedRedo"===this.Xm)});w.defineProperty(Cf,{object:"object"},function(){return this.ws},function(a){this.ws=a});
    w.defineProperty(Cf,{oldValue:"oldValue"},function(){return this.ys},function(a){this.ys=a});w.defineProperty(Cf,{Aj:"oldParam"},function(){return this.xs},function(a){this.xs=a});w.defineProperty(Cf,{newValue:"newValue"},function(){return this.ts},function(a){this.ts=a});w.defineProperty(Cf,{zj:"newParam"},function(){return this.ss},function(a){this.ss=a});
    function F(a){1<arguments.length&&w.k("Model constructor can only take one optional argument, the Array of node data.");w.nc(this);this.fr=this.Sb="";this.Ni=!1;this.uz={};this.De=[];this.Gc=new ma(null,Object);this.fk="key";this.vo=this.Zo=null;this.Xq=this.Yq=!1;this.Hq=null;this.Sm="category";this.Hi=new ma(null,I);this.bk=null;this.dj=!1;this.Oz=null;this.ia=new Sf;void 0!==a&&(this.hg=a)}w.ga("Model",F);
    F.prototype.cloneProtected=function(a){a.Sb=this.Sb;a.fr=this.fr;a.Ni=this.Ni;a.fk=this.fk;a.Zo=this.Zo;a.vo=this.vo;a.Yq=this.Yq;a.Xq=this.Xq;a.Hq=this.Hq;a.Sm=this.Sm};F.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};F.prototype.clear=F.prototype.clear=function(){this.De=[];this.Gc.clear();this.Hi.clear();this.ia.clear()};g=F.prototype;
    g.toString=function(a){void 0===a&&(a=0);if(1<a)return this.xB();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.hg;for(var c=w.Za(a),d=0;d<c;d++)var e=w.Ba(a,d),b=b+(" "+this.pb(e)+":"+Rf(e))}return b};
    g.fo=function(){var a="";""!==this.name&&(a+=',\n  "name": '+this.quote(this.name));""!==this.Ql&&(a+=',\n  "dataFormat": '+this.quote(this.Ql));this.hb&&(a+=',\n  "isReadOnly": '+this.hb);"key"!==this.em&&"string"===typeof this.em&&(a+=',\n  "nodeKeyProperty": '+this.quote(this.em));this.eA&&(a+=',\n  "copiesArrays": true');this.dA&&(a+=',\n  "copiesArrayObjects": true');"category"!==this.Vn&&"string"===typeof this.Vn&&(a+=',\n  "nodeCategoryProperty": '+this.quote(this.Vn));return a};
    g.Au=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.Ql=a.dataFormat);a.isReadOnly&&(this.hb=a.isReadOnly);a.nodeKeyProperty&&(this.em=a.nodeKeyProperty);a.copiesArrays&&(this.eA=a.copiesArrays);a.copiesArrayObjects&&(this.dA=a.copiesArrayObjects);a.nodeCategoryProperty&&(this.Vn=a.nodeCategoryProperty)};function Tf(a){return',\n  "modelData": '+Uf(a,a.Ik)}function Vf(a,b){var c=b.modelData;w.Pa(c)&&(a.Du(c),a.Ik=c)}
    g.JB=function(){var a=this.Ik,b=!1,c;for(c in a)if(!Wf(c,a[c])){b=!0;break}a="";b&&(a=Tf(this));return a+',\n  "nodeDataArray": '+Xf(this,this.hg,!0)};g.$A=function(a){Vf(this,a);a=a.nodeDataArray;w.isArray(a)&&(this.Du(a),this.hg=a)};
    function Yf(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.ka(b)===c)return!0;d.add(b,c);if(b.length!==c.length)return!1;for(var e=0;e<b.length;e++)if(!Yf(a,b[e],c[e],d))return!1;return!0}if(w.Pa(b)&&w.Pa(c)){if(d.ka(b)===c)return!0;d.add(b,c);for(e in b){var f=b[e];if(!Wf(e,f)){var h=c[e];if(void 0===h||!Yf(a,f,h,d))return!1}}for(var k in c)if(h=c[k],!Wf(k,h)&&(f=b[k],void 0===f||!Yf(a,f,h,d)))return!1;
        return!0}return!1}function Zf(a,b,c){a[c]!==b[c]&&w.k("Model.computeJsonDifference: Model."+c+' is not the same in both models: "'+a[c]+'" and "'+b[c]+'"')}
    g.KB=function(a){Zf(this,a,"nodeKeyProperty");this instanceof $f&&Zf(this,a,"nodeParentKeyProperty");for(var b=new I,c=new I,d=(new I).Jc(this.Gc.BF),e=new ma,f=a.hg,h=0;h<f.length;h++){var k=f[h],l=a.pb(k);if(void 0!==l){d.remove(l);var m=this.ve(l);null===m?(b.add(l),c.add(k)):Yf(this,m,k,e)||c.add(k)}else this.MA(k),l=this.pb(k),b.add(l),c.add(k)}f="";Yf(this,this.Ik,a.Ik,e)||(f+=Tf(this));0<b.count&&(f+=this.Ey+Xf(this,b.gc(),!0));0<c.count&&(f+=this.SB+Xf(this,c.gc(),!0));0<d.count&&(f+=this.Gy+
        Xf(this,d.gc(),!0));return f};F.prototype.computeJsonDifference=F.prototype.computeJSONDifference=function(a,b){w.G(a,F,F,"computeJsonDifference:newmodel");void 0===b&&(b=this.constructor===F?"go.Model":this.constructor===Q?"go.GraphLinksModel":this.constructor===$f?"go.TreeModel":w.lf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.fo()+this.KB(a)+"}"};g=F.prototype;g.Ey=',\n  "insertedNodeKeys": ';g.SB=',\n  "modifiedNodeData": ';g.Gy=',\n  "removedNodeKeys": ';
    g.IB=function(a,b){var c=this,d=!1,e=new I,f=new I,h=new I;a.Xf.each(function(a){a.aa===c&&("nodeDataArray"===a.qf?a.Ac===Pf?e.add(a.newValue):a.Ac===Qf&&h.add(a.oldValue):c.He(a.object)?f.add(a.object):c.Ik===a.object&&a.Ac===Nf&&(d=!0))});var k=new I;e.each(function(a){k.add(c.pb(a));b||f.add(a)});var l=new I;h.each(function(a){l.add(c.pb(a));b&&f.add(a)});var m="";d&&(m+=Tf(this));0<k.count&&(m+=(b?this.Gy:this.Ey)+Xf(this,k.gc(),!0));0<f.count&&(m+=this.SB+Xf(this,f.gc(),!0));0<l.count&&(m+=(b?
            this.Ey:this.Gy)+Xf(this,l.gc(),!0));return m};
    g.ZA=function(a){Vf(this,a);var b=a.insertedNodeKeys,c=a.modifiedNodeData,d=new ma;if(w.isArray(c))for(var e=0;e<c.length;e++){var f=w.Ba(c,e),h=this.pb(f);void 0!==h&&null!==h&&d.set(h,f)}if(w.isArray(b))for(var e=w.Za(b),k=0;k<e;k++)f=w.Ba(b,k),h=this.ve(f),null===h&&(h=(h=d.get(f))?h:this.copyNodeData({}),this.my(h,f),this.Hl(h));if(w.isArray(c))for(e=w.Za(c),k=0;k<e;k++)if(f=w.Ba(c,k),h=this.pb(f),h=this.ve(h),null!==h)for(var l in f)"__gohashid"!==l&&l!==this.em&&l!==this.hq&&this.setDataProperty(h,
        l,f[l]);a=a.removedNodeKeys;if(w.isArray(a))for(e=w.Za(a),k=0;k<e;k++)f=w.Ba(a,k),h=this.ve(f),null!==h&&this.by(h)};
    F.prototype.toIncrementalJson=F.prototype.toIncrementalJSON=function(a,b){w.G(a,Cf,F,"toIncrementalJson:e");a.Ac!==Of&&w.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.AF&&c instanceof ag))return'{ "incremental": 0 }';void 0===b&&(b=this.constructor===F?"go.Model":this.constructor===Q?"go.GraphLinksModel":this.constructor===$f?"go.TreeModel":w.lf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.fo()+this.IB(c,"FinishedUndo"===
            a.propertyName)+"}"};F.prototype.toJson=F.prototype.toJSON=F.prototype.xB=function(a){void 0===a&&(a=this.constructor===F?"go.Model":this.constructor===Q?"go.GraphLinksModel":this.constructor===$f?"go.TreeModel":w.lf(this));return'{ "class": '+this.quote(a)+this.fo()+this.JB()+"}"};
    F.prototype.applyIncrementalJson=F.prototype.applyIncrementalJSON=function(a){var b=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{b=window.JSON.parse(a)}catch(c){}else w.trace("WARNING: no JSON.parse available");else"object"===typeof a?b=a:w.k("Unable to modify a Model from: "+a);var d=b.incremental;"number"!==typeof d&&w.k("Unable to apply non-incremental changes to Model: "+a);0!==d&&(this.Hb("applyIncrementalJson"),this.ZA(b),this.Wc("applyIncrementalJson"))};
    F.fromJson=F.fromJSON=function(a,b){void 0===b&&(b=null);null!==b&&w.G(b,F,F,"fromJson:model");var c=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{c=window.JSON.parse(a)}catch(d){}else w.trace("WARNING: no JSON.parse available");else"object"===typeof a?c=a:w.k("Unable to construct a Model from: "+a);if(null===b){var e;e=null;var f=c["class"];if("string"===typeof f)try{var h=null;0===f.indexOf("go.")?(f=f.substr(3),h=ca[f]):(h=ca[f],void 0===h&&(h=window[f]));"function"===typeof h&&
    (e=new h)}catch(k){}null===e||e instanceof F?b=e:w.k("Unable to construct a Model of declared class: "+c["class"])}null===b&&(b=new Q);b.Au(c);b.$A(c);return b};
    F.prototype.replaceJsonObjects=F.prototype.Du=function(a){if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++){var d=w.Ba(a,c);w.Pa(d)&&w.uE(a,c,this.Du(d))}else if(w.Pa(a)){for(c in a)if(d=a[c],w.Pa(d)&&(d=this.Du(d),a[c]=d,"points"===c&&Array.isArray(d))){for(var e=0===d.length%2,f=0;f<d.length;f++)if("number"!==typeof d[f]){e=!1;break}if(e){e=new H(z);for(f=0;f<d.length/2;f++)e.add(new z(d[2*f],d[2*f+1]));e.freeze();a[c]=e}}if("object"===typeof a){c=a;d=a["class"];if("NaN"===d)c=NaN;else if("Date"===
        d)c=new Date(a.value);else if("go.Point"===d)c=new z(mg(a.x),mg(a.y));else if("go.Size"===d)c=new ia(mg(a.width),mg(a.height));else if("go.Rect"===d)c=new B(mg(a.x),mg(a.y),mg(a.width),mg(a.height));else if("go.Margin"===d)c=new hb(mg(a.top),mg(a.right),mg(a.bottom),mg(a.left));else if("go.Spot"===d)c="string"===typeof a["enum"]?xb(a["enum"]):new L(mg(a.x),mg(a.y),mg(a.offsetX),mg(a.offsetY));else if("go.Brush"===d){if(c=new ha,c.type=pa(ha,a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof
        L&&(c.start=a.start),a.end instanceof L&&(c.end=a.end),"number"===typeof a.startRadius&&(c.Ou=mg(a.startRadius)),"number"===typeof a.endRadius&&(c.Kt=mg(a.endRadius)),a=a.colorStops,w.Pa(a))for(b in a)c.addColorStop(parseFloat(b),a[b])}else"go.Geometry"===d?(b=null,b="string"===typeof a.path?Pe(a.path):new Ce,b.type=pa(Ce,a.type),"number"===typeof a.startX&&(b.ha=mg(a.startX)),"number"===typeof a.startY&&(b.fa=mg(a.startY)),"number"===typeof a.endX&&(b.C=mg(a.endX)),"number"===typeof a.endY&&(b.D=
        mg(a.endY)),a.spot1 instanceof L&&(b.A=a.spot1),a.spot2 instanceof L&&(b.B=a.spot2),c=b):"go.EnumValue"===d&&(b=a.classType,0===b.indexOf("go.")&&(b=b.substr(3)),c=pa(ca[b],a.name));a=c}}return a};
    F.prototype.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+'"'};
    F.prototype.writeJsonValue=F.prototype.Su=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.Su(a.valueOf()):w.isArray(a)?Xf(this,a):w.Pa(a)?Uf(this,a):"function"===typeof a?"null":a.toString()};
    function Xf(a,b,c){void 0===c&&(c=!1);var d=w.Za(b);if(0>=d)return"[]";var e=new qa;e.add("[ ");c&&1<d&&e.add("\n");for(var f=0;f<d;f++){var h=w.Ba(b,f);void 0!==h&&(0<f&&(e.add(","),c&&e.add("\n")),e.add(a.Su(h)))}c&&1<d&&e.add("\n");e.add(" ]");return e.toString()}function Wf(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function ng(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
    function Uf(a,b){var c=b;if(c instanceof z)b={"class":"go.Point",x:ng(c.x),y:ng(c.y)};else if(c instanceof ia)b={"class":"go.Size",width:ng(c.width),height:ng(c.height)};else if(c instanceof B)b={"class":"go.Rect",x:ng(c.x),y:ng(c.y),width:ng(c.width),height:ng(c.height)};else if(c instanceof hb)b={"class":"go.Margin",top:ng(c.top),right:ng(c.right),bottom:ng(c.bottom),left:ng(c.left)};else if(c instanceof L)b=c.Yc()?{"class":"go.Spot",x:ng(c.x),y:ng(c.y),offsetX:ng(c.offsetX),offsetY:ng(c.offsetY)}:
        {"class":"go.Spot","enum":c.toString()};else if(c instanceof ha){b={"class":"go.Brush",type:c.type.name};if(c.type===og)b.color=c.color;else if(c.type===pg||c.type===bd)b.start=c.start,b.end=c.end,c.type===bd&&(0!==c.Ou&&(b.startRadius=ng(c.Ou)),isNaN(c.Kt)||(b.endRadius=ng(c.Kt)));if(null!==c.uk){for(var d={},c=c.uk.i;c.next();)d[c.key]=c.value;b.colorStops=d}}else if(c instanceof Ce)b={"class":"go.Geometry",type:c.type.name},0!==c.ha&&(b.startX=ng(c.ha)),0!==c.fa&&(b.startY=ng(c.fa)),0!==c.C&&(b.endX=
        ng(c.C)),0!==c.D&&(b.endY=ng(c.D)),c.A.L(Ab)||(b.spot1=c.A),c.B.L(Sb)||(b.spot2=c.B),c.type===De&&(b.path=Oe(c));else if(c instanceof da)b={"class":"go.EnumValue",classType:w.lf(c.Ee),name:c.name};else if(c instanceof G||c instanceof D||c instanceof qg||c instanceof F||c instanceof rg||c instanceof sg||c instanceof tg||c instanceof ug||c instanceof Sf||c instanceof ag)return w.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+c.toString()),
        "{}";var d="{",c=!0,e;for(e in b){var f=w.tb(b,e);if(!Wf(e,f))if(c?c=!1:d+=", ",d+='"'+e+'":',"points"===e&&f instanceof H&&f.na===z){for(var h="[",f=f.i;f.next();){var k=f.value;1<h.length&&(h+=",");h+=a.Su(k.x);h+=",";h+=a.Su(k.y)}h+="]";d+=h}else d+=a.Su(f)}return d+"}"}function mg(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}
    w.defineProperty(F,{name:"name"},function(){return this.Sb},function(a){var b=this.Sb;b!==a&&(w.j(a,"string",F,"name"),this.Sb=a,this.h("name",b,a))});w.defineProperty(F,{Ql:"dataFormat"},function(){return this.fr},function(a){var b=this.fr;b!==a&&(w.j(a,"string",F,"dataFormat"),this.fr=a,this.h("dataFormat",b,a))});w.defineProperty(F,{hb:"isReadOnly"},function(){return this.Ni},function(a){var b=this.Ni;b!==a&&(w.j(a,"boolean",F,"isReadOnly"),this.Ni=a,this.h("isReadOnly",b,a))});
    w.defineProperty(F,{Ik:"modelData"},function(){return this.uz},function(a){var b=this.uz;b!==a&&(w.j(a,"object",F,"modelData"),this.uz=a,this.h("modelData",b,a),this.Ib(a))});F.prototype.addChangedListener=F.prototype.jn=function(a){w.j(a,"function",F,"addChangedListener:listener");null===this.bk&&(this.bk=new H("function"));this.bk.add(a)};
    F.prototype.removeChangedListener=F.prototype.Bu=function(a){w.j(a,"function",F,"removeChangedListener:listener");null!==this.bk&&(this.bk.remove(a),0===this.bk.count&&(this.bk=null))};F.prototype.Ww=function(a){this.wb||this.ia.iF(a);if(null!==this.bk){var b=this.bk,c=b.length;if(1===c)b=b.ea(0),b(a);else if(0!==c)for(var d=b.gc(),e=0;e<c;e++)b=d[e],b(a)}};F.prototype.raiseChangedEvent=F.prototype.ad=function(a,b,c,d,e,f,h){vg(this,"",a,b,c,d,e,f,h)};
    F.prototype.raiseChanged=F.prototype.h=function(a,b,c,d,e){vg(this,"",Nf,a,this,b,c,d,e)};F.prototype.raiseDataChanged=F.prototype.YA=function(a,b,c,d,e,f){vg(this,"",Nf,b,a,c,d,e,f)};function vg(a,b,c,d,e,f,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new Cf;m.aa=a;m.Ac=c;m.qf=b;m.propertyName=d;m.object=e;m.oldValue=f;m.Aj=k;m.newValue=h;m.zj=l;a.Ww(m)}
    w.defineProperty(F,{ia:"undoManager"},function(){return this.Oz},function(a){var b=this.Oz;b!==a&&(w.G(a,Sf,F,"undoManager"),null!==b&&b.pJ(this),this.Oz=a,null!==a&&a.hH(this))});w.defineProperty(F,{wb:"skipsUndoManager"},function(){return this.dj},function(a){w.j(a,"boolean",F,"skipsUndoManager");this.dj=a});
    F.prototype.qn=function(a,b){if(null!==a&&a.aa===this)if(a.Ac===Nf){var c=a.object,d=a.propertyName,e=a.ka(b);w.La(c,d,e)}else a.Ac===Pf?(c=a.zj,"nodeDataArray"===a.qf?(d=a.newValue,w.Pa(d)&&"number"===typeof c&&(e=this.pb(d),b?(w.Ba(this.De,c)===d&&w.Lg(this.De,c),void 0!==e&&this.Gc.remove(e)):(w.Ba(this.De,c)!==d&&w.sh(this.De,c,d),void 0!==e&&this.Gc.add(e,d)))):""===a.qf?(d=a.object,!w.isArray(d)&&a.propertyName&&(d=w.tb(a.object,a.propertyName)),w.isArray(d)&&"number"===typeof c&&(e=a.newValue,
        b?w.Lg(d,c):w.sh(d,c,e))):w.k("unknown ChangedEvent.Insert modelChange: "+a.toString())):a.Ac===Qf?(c=a.Aj,"nodeDataArray"===a.qf?(d=a.oldValue,w.Pa(d)&&"number"===typeof c&&(e=this.pb(d),b?(w.Ba(this.De,c)!==d&&w.sh(this.De,c,d),void 0!==e&&this.Gc.add(e,d)):(w.Ba(this.De,c)===d&&w.Lg(this.De,c),void 0!==e&&this.Gc.remove(e)))):""===a.qf?(d=a.object,!w.isArray(d)&&a.propertyName&&(d=w.tb(a.object,a.propertyName)),w.isArray(d)&&"number"===typeof c&&(e=a.oldValue,b?w.sh(d,c,e):w.Lg(d,c))):w.k("unknown ChangedEvent.Remove modelChange: "+
        a.toString())):a.Ac!==Of&&w.k("unknown ChangedEvent: "+a.toString())};F.prototype.startTransaction=F.prototype.Hb=function(a){return this.ia.Hb(a)};F.prototype.commitTransaction=F.prototype.Wc=function(a){return this.ia.Wc(a)};F.prototype.rollbackTransaction=F.prototype.mq=function(){return this.ia.mq()};F.prototype.commit=function(a,b){this.ia.Hb(b);try{a(this)}finally{this.ia.Wc(b)}};
    F.prototype.updateTargetBindings=F.prototype.Ib=function(a,b){void 0===b&&(b="");vg(this,"SourceChanged",Of,b,a,null,null)};w.defineProperty(F,{em:"nodeKeyProperty"},function(){return this.fk},function(a){var b=this.fk;b!==a&&(wg(a,F,"nodeKeyProperty"),""===a&&w.k("Model.nodeKeyProperty may not be the empty string"),0<this.Gc.count&&w.k("Cannot set Model.nodeKeyProperty when there is existing node data"),this.fk=a,this.h("nodeKeyProperty",b,a))});
    function wg(a,b,c){"string"!==typeof a&&"function"!==typeof a&&w.Bd(a,"string or function",b,c)}F.prototype.getKeyForNodeData=F.prototype.pb=function(a){if(null!==a){var b=this.fk;if(""!==b&&(b=w.tb(a,b),void 0!==b)){if(xg(b))return b;w.k("Key value for node data "+a+" is not a number or a string: "+b)}}};
    F.prototype.setKeyForNodeData=F.prototype.my=function(a,b){void 0!==b&&null!==b&&xg(b)||w.Bd(b,"number or string",F,"setKeyForNodeData:key");if(null!==a){var c=this.fk;if(""!==c)if(this.He(a)){var d=w.tb(a,c);d!==b&&null===this.ve(b)&&(w.La(a,c,b),this.Gc.remove(d),this.Gc.add(b,a),vg(this,"nodeKey",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c),this.Cu(d,b))}else w.La(a,c,b)}};
    w.defineProperty(F,{mL:"makeUniqueKeyFunction"},function(){return this.Zo},function(a){var b=this.Zo;b!==a&&(null!==a&&w.j(a,"function",F,"makeUniqueKeyFunction"),this.Zo=a,this.h("makeUniqueKeyFunction",b,a))});function xg(a){return"number"===typeof a||"string"===typeof a}F.prototype.containsNodeData=F.prototype.He=function(a){var b=this.pb(a);return void 0===b?!1:this.Gc.ka(b)===a};
    F.prototype.findNodeDataForKey=F.prototype.ve=function(a){null===a&&w.k("Model.findNodeDataForKey:key must not be null");return void 0!==a&&xg(a)?this.Gc.ka(a):null};
    w.defineProperty(F,{hg:"nodeDataArray"},function(){return this.De},function(a){var b=this.De;if(b!==a){w.Xz(a,F,"nodeDataArray");this.Gc.clear();this.EB();for(var c=w.Za(a),d=0;d<c;d++){var e=w.Ba(a,d);if(!w.Pa(e)){w.k("Model.nodeDataArray must only contain Objects, not: "+e);return}w.Vp(e)}this.De=a;for(var f=new H(Object),d=0;d<c;d++){var e=w.Ba(a,d),h=this.pb(e);void 0===h?f.add(e):null!==this.Gc.ka(h)?f.add(e):this.Gc.add(h,e)}for(d=f.i;d.next();)e=d.value,this.MA(e),f=this.pb(e),void 0!==f&&
    this.Gc.add(f,e);vg(this,"nodeDataArray",Nf,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=w.Ba(a,d),this.lq(e),this.kq(e);this.xE();w.zI(a)||(this.hb=!0)}});
    F.prototype.makeNodeDataKeyUnique=F.prototype.MA=function(a){if(null!==a){var b=this.fk;if(""!==b){var c=this.pb(a);if(void 0===c||this.Gc.contains(c)){var d=this.Zo;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.Gc.contains(c))){w.La(a,b,c);return}if("string"===typeof c){for(d=2;this.Gc.contains(c+d);)d++;w.La(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.Gc.count-1;this.Gc.contains(d);)d--;w.La(a,b,d)}else w.k("Model.getKeyForNodeData returned something other than a string or a number: "+
        c)}}}};F.prototype.addNodeData=F.prototype.Hl=function(a){null!==a&&(w.Vp(a),this.He(a)||yg(this,a,!0))};function yg(a,b,c){var d=a.pb(b);if(void 0===d||a.Gc.ka(d)!==b)a.MA(b),d=a.pb(b),void 0===d?w.k("Model.makeNodeDataKeyUnique failed on "+b+".  Data not added to Model."):(a.Gc.add(d,b),d=null,c&&(d=w.Za(a.De),w.sh(a.De,d,b)),vg(a,"nodeDataArray",Pf,"nodeDataArray",a,null,b,null,d),a.lq(b),a.kq(b))}
    F.prototype.addNodeDataCollection=function(a){if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++)this.Hl(w.Ba(a,c));else for(a=a.i;a.next();)this.Hl(a.value)};F.prototype.removeNodeData=F.prototype.by=function(a){null!==a&&zg(this,a,!0)};function zg(a,b,c){var d=a.pb(b);void 0!==d&&a.Gc.remove(d);d=null;if(c){d=w.Kl(a.De,b);if(0>d)return;w.Lg(a.De,d)}vg(a,"nodeDataArray",Qf,"nodeDataArray",a,b,null,d,null);a.Ru(b)}
    F.prototype.removeNodeDataCollection=function(a){if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++)this.by(w.Ba(a,c));else for(a=a.i;a.next();)this.by(a.value)};g=F.prototype;g.Cu=function(a,b){var c=Ag(this,a);c instanceof I&&this.Hi.add(b,c)};g.EB=function(){};g.lq=function(){};g.kq=function(){};g.Ru=function(){};function Bg(a,b,c){if(void 0!==b){var d=a.Hi.ka(b);null===d&&(d=new I(Object),a.Hi.add(b,d));d.add(c)}}
    function Ug(a,b,c){if(void 0!==b){var d=a.Hi.ka(b);d instanceof I&&(void 0===c||null===c?a.Hi.remove(b):(d.remove(c),0===d.count&&a.Hi.remove(b)))}}function Ag(a,b){if(void 0===b)return null;var c=a.Hi.ka(b);return c instanceof I?c:null}F.prototype.clearUnresolvedReferences=F.prototype.xE=function(a){void 0===a?this.Hi.clear():this.Hi.remove(a)};
    w.defineProperty(F,{HK:"copyNodeDataFunction"},function(){return this.vo},function(a){var b=this.vo;b!==a&&(null!==a&&w.j(a,"function",F,"copyNodeDataFunction"),this.vo=a,this.h("copyNodeDataFunction",b,a))});w.defineProperty(F,{eA:"copiesArrays"},function(){return this.Yq},function(a){var b=this.Yq;b!==a&&(null!==a&&w.j(a,"boolean",F,"copiesArrays"),this.Yq=a,this.h("copiesArrays",b,a))});
    w.defineProperty(F,{dA:"copiesArrayObjects"},function(){return this.Xq},function(a){var b=this.Xq;b!==a&&(null!==a&&w.j(a,"boolean",F,"copiesArrayObjects"),this.Xq=a,this.h("copiesArrayObjects",b,a))});F.prototype.copyNodeData=function(a){if(null===a)return null;var b=null,b=this.vo,b=null!==b?b(a,this):Vg(this,a,!0);w.Pa(b)&&w.nc(b);return b};
    function Vg(a,b,c){if(a.eA&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=Vg(a,b[c],a.dA);d.push(e)}w.nc(d);return d}if(c&&w.Pa(b)){c=(c=b.constructor)?new c:{};for(d in b)if("__gohashid"!==d){var e=w.tb(b,d),f;f=e;f instanceof G||f instanceof D||f instanceof qg||f instanceof Wg||f instanceof Xg||f instanceof rg||f instanceof sg||f instanceof tg||f instanceof zf||f instanceof Bf?("_"!==d[0]&&w.trace('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()),f=!0):f=f instanceof F||f instanceof Sf||f instanceof ag||f instanceof Cf?!0:!1;f||(e=Vg(a,e,!1));w.La(c,d,e)}w.nc(c);return c}return b instanceof z?b.copy():b instanceof ia?b.copy():b instanceof B?b.copy():b instanceof L?b.copy():b instanceof hb?b.copy():b}
    w.defineProperty(F,{jH:"afterCopyFunction"},function(){return this.Hq},function(a){var b=this.Hq;b!==a&&(null!==a&&w.j(a,"function",F,"afterCopyFunction"),this.Hq=a,this.h("afterCopyFunction",b,a))});var Yg=!1;
    F.prototype.set=F.prototype.setDataProperty=function(a,b,c){if(this.He(a))if(b===this.em)this.my(a,c);else{if(b===this.Vn){this.ky(a,c);return}}else!Yg&&a instanceof G&&(Yg=!0,w.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),w.trace("  Is that really your intent?"));var d=w.tb(a,b);d!==c&&(w.La(a,b,c),this.YA(a,b,d,c))};F.prototype.addArrayItem=function(a,b){this.AA(a,-1,b)};
    F.prototype.insertArrayItem=F.prototype.AA=function(a,b,c){a===this.De&&w.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=w.Za(a));w.sh(a,b,c);vg(this,"",Pf,"",a,null,c,null,b)};F.prototype.removeArrayItem=F.prototype.WF=function(a,b){void 0===b&&(b=-1);a===this.De&&w.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=w.Za(a)-1);var c=w.Ba(a,b);w.Lg(a,b);vg(this,"",Qf,"",a,c,null,b,null)};
    w.defineProperty(F,{Vn:"nodeCategoryProperty"},function(){return this.Sm},function(a){var b=this.Sm;b!==a&&(wg(a,F,"nodeCategoryProperty"),this.Sm=a,this.h("nodeCategoryProperty",b,a))});F.prototype.getCategoryForNodeData=F.prototype.sA=function(a){if(null===a)return"";var b=this.Sm;if(""===b)return"";b=w.tb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
    F.prototype.setCategoryForNodeData=F.prototype.ky=function(a,b){w.j(b,"string",F,"setCategoryForNodeData:cat");if(null!==a){var c=this.Sm;if(""!==c)if(this.He(a)){var d=w.tb(a,c);void 0===d&&(d="");d!==b&&(w.La(a,c,b),vg(this,"nodeCategory",Nf,c,a,d,b))}else w.La(a,c,b)}};
    function Q(a,b){F.call(this);2<arguments.length&&w.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");this.gf=[];this.Ri=new I(Object);this.ed=new ma(null,Object);this.rl="";this.vm=this.uo=this.$o=null;this.Vh="from";this.Wh="to";this.Om=this.Nm="";this.Mm="category";this.Bg="";this.dp="isGroup";this.lh="group";this.Zq=!1;void 0!==a&&(this.hg=a);void 0!==b&&(this.Rg=b)}w.Ka(Q,F);w.ga("GraphLinksModel",Q);
    Q.prototype.cloneProtected=function(a){F.prototype.cloneProtected.call(this,a);a.rl=this.rl;a.$o=this.$o;a.uo=this.uo;a.Vh=this.Vh;a.Wh=this.Wh;a.Nm=this.Nm;a.Om=this.Om;a.Mm=this.Mm;a.Bg=this.Bg;a.dp=this.dp;a.lh=this.lh;a.Zq=this.Zq};Q.prototype.clear=Q.prototype.clear=function(){F.prototype.clear.call(this);this.gf=[];this.ed.clear();this.Ri.clear()};g=Q.prototype;
    g.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.xB();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.hg;for(var c=w.Za(a),d=0,d=0;d<c;d++)var e=w.Ba(a,d),b=b+(" "+this.pb(e)+":"+Rf(e));b+="\n link data:";a=this.Rg;c=w.Za(a);for(d=0;d<c;d++)e=w.Ba(a,d),b+=" "+this.Xl(e)+"--\x3e"+this.Yl(e)}return b};
    g.fo=function(){var a=F.prototype.fo.call(this),b="";"category"!==this.mu&&"string"===typeof this.mu&&(b+=',\n  "linkCategoryProperty": '+this.quote(this.mu));""!==this.yj&&"string"===typeof this.yj&&(b+=',\n  "linkKeyProperty": '+this.quote(this.yj));"from"!==this.Mn&&"string"===typeof this.Mn&&(b+=',\n  "linkFromKeyProperty": '+this.quote(this.Mn));"to"!==this.Nn&&"string"===typeof this.Nn&&(b+=',\n  "linkToKeyProperty": '+this.quote(this.Nn));""!==this.nu&&"string"===typeof this.nu&&(b+=',\n  "linkFromPortIdProperty": '+
        this.quote(this.nu));""!==this.pu&&"string"===typeof this.pu&&(b+=',\n  "linkToPortIdProperty": '+this.quote(this.pu));""!==this.ou&&"string"===typeof this.ou&&(b+=',\n  "linkLabelKeysProperty": '+this.quote(this.ou));"isGroup"!==this.hq&&"string"===typeof this.hq&&(b+=',\n  "nodeIsGroupProperty": '+this.quote(this.hq));"group"!==this.wu&&"string"===typeof this.wu&&(b+=',\n  "nodeGroupKeyProperty": '+this.quote(this.wu));return a+b};
    g.Au=function(a){F.prototype.Au.call(this,a);a.linkKeyProperty&&(this.yj=a.linkKeyProperty);a.linkFromKeyProperty&&(this.Mn=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.Nn=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.nu=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.pu=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.mu=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.ou=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.hq=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&
    (this.wu=a.nodeGroupKeyProperty)};g.JB=function(){var a=F.prototype.JB.call(this),b=',\n  "linkDataArray": '+Xf(this,this.Rg,!0);return a+b};g.$A=function(a){F.prototype.$A.call(this,a);a=a.linkDataArray;w.isArray(a)&&(this.Du(a),this.Rg=a)};
    g.KB=function(a){if(!(a instanceof Q))return w.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel"),"";""===this.yj&&w.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var b=F.prototype.KB.call(this,a);Zf(this,a,"linkKeyProperty");Zf(this,a,"linkFromKeyProperty");Zf(this,a,"linkToKeyProperty");Zf(this,a,"linkLabelKeysProperty");Zf(this,a,"nodeIsGroupProperty");Zf(this,a,"nodeGroupKeyProperty");for(var c=new I,d=new I,e=(new I).Jc(this.ed.BF),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  f=new ma,h=a.Rg,k=0;k<h.length;k++){var l=h[k],m=a.bf(l);if(void 0!==m){e.remove(m);var n=this.Rp(m);null===n?(c.add(m),d.add(l)):Yf(this,n,l,f)||d.add(l)}else this.Mx(l),m=this.bf(l),c.add(m),d.add(l)}a=b;0<c.count&&(a+=this.Dy+Xf(this,c.gc(),!0));0<d.count&&(a+=this.RB+Xf(this,d.gc(),!0));0<e.count&&(a+=this.Fy+Xf(this,e.gc(),!0));return a};g.Dy=',\n  "insertedLinkKeys": ';g.RB=',\n  "modifiedLinkData": ';g.Fy=',\n  "removedLinkKeys": ';
    g.IB=function(a,b){""===this.yj&&w.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var c=F.prototype.IB.call(this,a,b),d=this,e=new I,f=new I,h=new I;a.Xf.each(function(a){a.aa===d&&("linkDataArray"===a.qf?a.Ac===Pf?e.add(a.newValue):a.Ac===Qf&&h.add(a.oldValue):d.vh(a.object)&&f.add(a.object))});var k=new I;e.each(function(a){k.add(d.bf(a));b||f.add(a)});var l=new I;h.each(function(a){l.add(d.bf(a));b&&f.add(a)});0<k.count&&(c+=(b?this.Fy:this.Dy)+
        Xf(this,k.gc(),!0));0<f.count&&(c+=this.RB+Xf(this,f.gc(),!0));0<l.count&&(c+=(b?this.Dy:this.Fy)+Xf(this,l.gc(),!0));return c};
    g.ZA=function(a){F.prototype.ZA.call(this,a);var b=a.insertedLinkKeys,c=a.modifiedLinkData,d=new ma;if(w.isArray(c))for(var e=0;e<c.length;e++){var f=w.Ba(c,e),h=this.bf(f);void 0!==h&&null!==h&&d.set(h,f)}if(w.isArray(b))for(var e=w.Za(b),k=0;k<e;k++)f=w.Ba(b,k),h=this.Rp(f),null===h&&(h=(h=d.get(f))?h:this.Zw({}),this.mG(h,f),this.xt(h));if(w.isArray(c))for(e=w.Za(c),k=0;k<e;k++)if(f=w.Ba(c,k),h=this.bf(f),h=this.Rp(h),null!==h)for(var l in f)"__gohashid"!==l&&l!==this.yj&&this.setDataProperty(h,
        l,f[l]);a=a.removedLinkKeys;if(w.isArray(a))for(e=w.Za(a),k=0;k<e;k++)f=w.Ba(a,k),h=this.Rp(f),null!==h&&this.ay(h)};
    g.qn=function(a,b){if(a.Ac===Pf){var c=a.zj;if("linkDataArray"===a.qf){var d=a.newValue;if(w.Pa(d)&&"number"===typeof c){var e=this.bf(d);b?(this.Ri.remove(d),w.Ba(this.gf,c)===d&&w.Lg(this.gf,c),void 0!==e&&this.ed.remove(e)):(this.Ri.add(d),w.Ba(this.gf,c)!==d&&w.sh(this.gf,c,d),void 0!==e&&this.ed.add(e,d))}return}if("linkLabelKeys"===a.qf){d=this.Dk(a.object);w.isArray(d)&&"number"===typeof c&&(b?(c=w.Kl(d,a.newValue),0<=c&&w.Lg(d,c)):0>w.Kl(d,a.newValue)&&w.sh(d,c,a.newValue));return}}else if(a.Ac===
        Qf){c=a.Aj;if("linkDataArray"===a.qf){d=a.oldValue;w.Pa(d)&&"number"===typeof c&&(e=this.bf(d),b?(this.Ri.add(d),w.Ba(this.gf,c)!==d&&w.sh(this.gf,c,d),void 0!==e&&this.ed.add(e,d)):(this.Ri.remove(d),w.Ba(this.gf,c)===d&&w.Lg(this.gf,c),void 0!==e&&this.ed.remove(e)));return}if("linkLabelKeys"===a.qf){d=this.Dk(a.object);w.isArray(d)&&"number"===typeof c&&(b?0>w.Kl(d,a.newValue)&&w.sh(d,c,a.newValue):(c=w.Kl(d,a.newValue),0<=c&&w.Lg(d,c)));return}}F.prototype.qn.call(this,a,b)};
    w.defineProperty(Q,{Vz:"archetypeNodeData"},function(){return this.vm},function(a){var b=this.vm;b!==a&&(null!==a&&w.G(a,Object,Q,"archetypeNodeData"),this.vm=a,this.h("archetypeNodeData",b,a))});Q.prototype.On=function(a){if(void 0!==a){var b=this.vm;if(null!==b){var c=this.ve(a);null===c&&(c=this.copyNodeData(b),w.La(c,this.fk,a),this.Hl(c))}return a}};
    w.defineProperty(Q,{Mn:"linkFromKeyProperty"},function(){return this.Vh},function(a){var b=this.Vh;b!==a&&(wg(a,Q,"linkFromKeyProperty"),this.Vh=a,this.h("linkFromKeyProperty",b,a))});Q.prototype.getFromKeyForLinkData=Q.prototype.Xl=function(a){if(null!==a){var b=this.Vh;if(""!==b&&(b=w.tb(a,b),void 0!==b)){if(xg(b))return b;w.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
    Q.prototype.setFromKeyForLinkData=Q.prototype.kB=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||w.Bd(b,"number or string",Q,"setFromKeyForLinkData:key");if(null!==a){var c=this.Vh;if(""!==c)if(b=this.On(b),this.vh(a)){var d=w.tb(a,c);d!==b&&(Ug(this,d,a),w.La(a,c,b),null===this.ve(b)&&Bg(this,b,a),vg(this,"linkFromKey",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    w.defineProperty(Q,{Nn:"linkToKeyProperty"},function(){return this.Wh},function(a){var b=this.Wh;b!==a&&(wg(a,Q,"linkToKeyProperty"),this.Wh=a,this.h("linkToKeyProperty",b,a))});Q.prototype.getToKeyForLinkData=Q.prototype.Yl=function(a){if(null!==a){var b=this.Wh;if(""!==b&&(b=w.tb(a,b),void 0!==b)){if(xg(b))return b;w.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
    Q.prototype.setToKeyForLinkData=Q.prototype.qB=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||w.Bd(b,"number or string",Q,"setToKeyForLinkData:key");if(null!==a){var c=this.Wh;if(""!==c)if(b=this.On(b),this.vh(a)){var d=w.tb(a,c);d!==b&&(Ug(this,d,a),w.La(a,c,b),null===this.ve(b)&&Bg(this,b,a),vg(this,"linkToKey",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    w.defineProperty(Q,{nu:"linkFromPortIdProperty"},function(){return this.Nm},function(a){var b=this.Nm;b!==a&&(wg(a,Q,"linkFromPortIdProperty"),a!==this.Mn&&a!==this.Nn||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Nm=a,this.h("linkFromPortIdProperty",b,a))});Q.prototype.getFromPortIdForLinkData=Q.prototype.aI=function(a){if(null===a)return"";var b=this.Nm;if(""===b)return"";a=w.tb(a,b);return void 0===a?"":a};
    Q.prototype.setFromPortIdForLinkData=Q.prototype.lB=function(a,b){w.j(b,"string",Q,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.Nm;if(""!==c)if(this.vh(a)){var d=w.tb(a,c);void 0===d&&(d="");d!==b&&(w.La(a,c,b),vg(this,"linkFromPortId",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    w.defineProperty(Q,{pu:"linkToPortIdProperty"},function(){return this.Om},function(a){var b=this.Om;b!==a&&(wg(a,Q,"linkToPortIdProperty"),a!==this.Mn&&a!==this.Nn||w.k("linkFromPortIdProperty name must not be the same as the GraphLinksModel.linkFromKeyProperty or linkToKeyProperty: "+a),this.Om=a,this.h("linkToPortIdProperty",b,a))});Q.prototype.getToPortIdForLinkData=Q.prototype.eI=function(a){if(null===a)return"";var b=this.Om;if(""===b)return"";a=w.tb(a,b);return void 0===a?"":a};
    Q.prototype.setToPortIdForLinkData=Q.prototype.rB=function(a,b){w.j(b,"string",Q,"setToPortIdForLinkData:portname");if(null!==a){var c=this.Om;if(""!==c)if(this.vh(a)){var d=w.tb(a,c);void 0===d&&(d="");d!==b&&(w.La(a,c,b),vg(this,"linkToPortId",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};w.defineProperty(Q,{ou:"linkLabelKeysProperty"},function(){return this.Bg},function(a){var b=this.Bg;b!==a&&(wg(a,Q,"linkLabelKeysProperty"),this.Bg=a,this.h("linkLabelKeysProperty",b,a))});
    Q.prototype.getLabelKeysForLinkData=Q.prototype.Dk=function(a){if(null===a)return w.jo;var b=this.Bg;if(""===b)return w.jo;a=w.tb(a,b);return void 0===a?w.jo:a};
    Q.prototype.setLabelKeysForLinkData=Q.prototype.nG=function(a,b){w.Xz(b,Q,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.Bg;if(""!==c)if(this.vh(a)){var d=w.tb(a,c);void 0===d&&(d=w.jo);if(d!==b){for(var e=w.Za(d),f=0;f<e;f++){var h=w.Ba(d,f);Ug(this,h,a)}w.La(a,c,b);e=w.Za(b);for(f=0;f<e;f++)h=w.Ba(b,f),null===this.ve(h)&&Bg(this,h,a);vg(this,"linkLabelKeys",Nf,c,a,d,b);"string"===typeof c&&this.Ib(a,c)}}else w.La(a,c,b)}};
    Q.prototype.addLabelKeyForLinkData=Q.prototype.nE=function(a,b){if(null!==b&&void 0!==b&&(xg(b)||w.Bd(b,"number or string",Q,"addLabelKeyForLinkData:key"),null!==a)){var c=this.Bg;if(""!==c){var d=w.tb(a,c);if(void 0===d)c=[],c.push(b),this.nG(a,c);else if(w.isArray(d)){var e=w.Kl(d,b);0<=e||(e=w.Za(d),w.sh(d,Infinity,b),this.vh(a)&&(null===this.ve(b)&&Bg(this,b,a),vg(this,"linkLabelKeys",Pf,c,a,null,b,null,e)))}else w.k(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
    Q.prototype.removeLabelKeyForLinkData=Q.prototype.oJ=function(a,b){if(null!==b&&void 0!==b&&(xg(b)||w.Bd(b,"number or string",Q,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.Bg;if(""!==c){var d=w.tb(a,c);if(w.isArray(d)){var e=w.Kl(d,b);0>e||(w.Lg(d,e),this.vh(a)&&(Ug(this,b,a),vg(this,"linkLabelKeys",Qf,c,a,b,null,e,null)))}else void 0!==d&&w.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};
    w.defineProperty(Q,{Rg:"linkDataArray"},function(){return this.gf},function(a){var b=this.gf;if(b!==a){w.Xz(a,Q,"linkDataArray");this.ed.clear();for(var c=w.Za(a),d=0;d<c;d++){var e=w.Ba(a,d);if(!w.Pa(e)){w.k("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}w.Vp(e)}this.gf=a;if(""!==this.yj){for(var f=new H(Object),d=0;d<c;d++){var e=w.Ba(a,d),h=this.bf(e);void 0===h?f.add(e):null!==this.ed.ka(h)?f.add(e):this.ed.add(h,e)}for(d=f.i;d.next();)e=d.value,this.Mx(e),f=this.bf(e),
    void 0!==f&&this.ed.add(f,e)}f=new I(Object);for(d=0;d<c;d++)e=w.Ba(a,d),f.add(e);this.Ri=f;vg(this,"linkDataArray",Nf,"linkDataArray",this,b,a);for(d=0;d<c;d++)e=w.Ba(a,d),Zg(this,e)}});
    w.defineProperty(Q,{yj:"linkKeyProperty"},function(){return this.rl},function(a){var b=this.rl;if(b!==a){wg(a,Q,"linkKeyProperty");this.rl=a;this.ed.clear();for(var c=w.Za(this.Rg),d=0;d<c;d++){var e=w.Ba(this.Rg,d),f=this.bf(e);void 0===f&&(this.Mx(e),f=this.bf(e));void 0!==f&&this.ed.add(f,e)}this.h("linkKeyProperty",b,a)}});
    Q.prototype.getKeyForLinkData=Q.prototype.bf=function(a){if(null!==a){var b=this.rl;if(""!==b&&(b=w.tb(a,b),void 0!==b)){if(xg(b))return b;w.k("Key value for link data "+a+" is not a number or a string: "+b)}}};
    Q.prototype.setKeyForLinkData=Q.prototype.mG=function(a,b){void 0!==b&&null!==b&&xg(b)||w.Bd(b,"number or string",Q,"setKeyForLinkData:key");if(null!==a){var c=this.rl;if(""!==c)if(this.vh(a)){var d=w.tb(a,c);d!==b&&null===this.Rp(b)&&(w.La(a,c,b),this.ed.remove(d),this.ed.add(b,a),vg(this,"linkKey",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    w.defineProperty(Q,{nL:"makeUniqueLinkKeyFunction"},function(){return this.$o},function(a){var b=this.$o;b!==a&&(null!==a&&w.j(a,"function",Q,"makeUniqueLinkKeyFunction"),this.$o=a,this.h("makeUniqueLinkKeyFunction",b,a))});Q.prototype.findLinkDataForKey=Q.prototype.Rp=function(a){null===a&&w.k("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&xg(a)?this.ed.ka(a):null};
    Q.prototype.makeLinkDataKeyUnique=Q.prototype.Mx=function(a){if(null!==a){var b=this.rl;if(""!==b){var c=this.bf(a);if(void 0===c||this.ed.contains(c)){var d=this.$o;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.ed.contains(c))){w.La(a,b,c);return}if("string"===typeof c){for(d=2;this.ed.contains(c+d);)d++;w.La(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.ed.count-1;this.ed.contains(d);)d--;w.La(a,b,d)}else w.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+
        c)}}}};Q.prototype.containsLinkData=Q.prototype.vh=function(a){return null===a?!1:this.Ri.contains(a)};Q.prototype.addLinkData=Q.prototype.xt=function(a){null!==a&&(w.Vp(a),this.vh(a)||$g(this,a,!0))};
    function $g(a,b,c){if(""!==a.yj){var d=a.bf(b);if(void 0!==d&&a.ed.ka(d)===b)return;a.Mx(b);d=a.bf(b);if(void 0===d){w.k("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.ed.add(d,b)}a.Ri.add(b);d=null;c&&(d=w.Za(a.gf),w.sh(a.gf,d,b));vg(a,"linkDataArray",Pf,"linkDataArray",a,null,b,null,d);Zg(a,b)}Q.prototype.addLinkDataCollection=function(a){if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++)this.xt(w.Ba(a,c));else for(a=a.i;a.next();)this.xt(a.value)};
    Q.prototype.removeLinkData=Q.prototype.ay=function(a){null!==a&&ah(this,a,!0)};function ah(a,b,c){a.Ri.remove(b);var d=a.bf(b);void 0!==d&&a.ed.remove(d);d=null;if(c){d=w.Kl(a.gf,b);if(0>d)return;w.Lg(a.gf,d)}vg(a,"linkDataArray",Qf,"linkDataArray",a,b,null,d,null);c=a.Xl(b);Ug(a,c,b);c=a.Yl(b);Ug(a,c,b);d=a.Dk(b);if(w.isArray(d))for(var e=w.Za(d),f=0;f<e;f++)c=w.Ba(d,f),Ug(a,c,b)}
    Q.prototype.removeLinkDataCollection=function(a){if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++)this.ay(w.Ba(a,c));else for(a=a.i;a.next();)this.ay(a.value)};function Zg(a,b){var c=a.Xl(b),c=a.On(c);null===a.ve(c)&&Bg(a,c,b);c=a.Yl(b);c=a.On(c);null===a.ve(c)&&Bg(a,c,b);var d=a.Dk(b);if(w.isArray(d))for(var e=w.Za(d),f=0;f<e;f++)c=w.Ba(d,f),null===a.ve(c)&&Bg(a,c,b)}
    w.defineProperty(Q,{GK:"copyLinkDataFunction"},function(){return this.uo},function(a){var b=this.uo;b!==a&&(null!==a&&w.j(a,"function",Q,"copyLinkDataFunction"),this.uo=a,this.h("copyLinkDataFunction",b,a))});Q.prototype.copyLinkData=Q.prototype.Zw=function(a){if(null===a)return null;var b=null,b=this.uo,b=null!==b?b(a,this):Vg(this,a,!0);w.Pa(b)&&(w.nc(b),""!==this.Vh&&w.La(b,this.Vh,void 0),""!==this.Wh&&w.La(b,this.Wh,void 0),""!==this.Bg&&w.La(b,this.Bg,[]));return b};
    w.defineProperty(Q,{hq:"nodeIsGroupProperty"},function(){return this.dp},function(a){var b=this.dp;b!==a&&(wg(a,Q,"nodeIsGroupProperty"),this.dp=a,this.h("nodeIsGroupProperty",b,a))});Q.prototype.isGroupForNodeData=Q.prototype.EA=function(a){if(null===a)return!1;var b=this.dp;return""===b?!1:w.tb(a,b)?!0:!1};w.defineProperty(Q,{wu:"nodeGroupKeyProperty"},function(){return this.lh},function(a){var b=this.lh;b!==a&&(wg(a,Q,"nodeGroupKeyProperty"),this.lh=a,this.h("nodeGroupKeyProperty",b,a))});
    w.defineProperty(Q,{un:"copiesGroupKeyOfNodeData"},function(){return this.Zq},function(a){this.Zq!==a&&(w.j(a,"boolean",Q,"copiesGroupKeyOfNodeData"),this.Zq=a)});Q.prototype.getGroupKeyForNodeData=Q.prototype.Cn=function(a){if(null!==a){var b=this.lh;if(""!==b&&(b=w.tb(a,b),void 0!==b)){if(xg(b))return b;w.k("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
    Q.prototype.setGroupKeyForNodeData=Q.prototype.mB=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||w.Bd(b,"number or string",Q,"setGroupKeyForNodeData:key");if(null!==a){var c=this.lh;if(""!==c)if(this.He(a)){var d=w.tb(a,c);d!==b&&(Ug(this,d,a),w.La(a,c,b),null===this.ve(b)&&Bg(this,b,a),vg(this,"nodeGroupKey",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    Q.prototype.copyNodeData=function(a){if(null===a)return null;a=F.prototype.copyNodeData.call(this,a);this.un||""===this.lh||void 0===w.tb(a,this.lh)||w.La(a,this.lh,void 0);return a};
    Q.prototype.setDataProperty=function(a,b,c){if(this.He(a))if(b===this.em)this.my(a,c);else{if(b===this.Vn){this.ky(a,c);return}if(b===this.wu){this.mB(a,c);return}b===this.hq&&w.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.vh(a)){if(b===this.Mn){this.kB(a,c);return}if(b===this.Nn){this.qB(a,c);return}if(b===this.nu){this.lB(a,c);return}if(b===this.pu){this.rB(a,c);return}if(b===this.yj){this.mG(a,c);return}if(b===this.mu){this.lG(a,c);return}if(b===
        this.ou){this.nG(a,c);return}}else!Yg&&a instanceof G&&(Yg=!0,w.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),w.trace("  Is that really your intent?"));var d=w.tb(a,b);d!==c&&(w.La(a,b,c),this.YA(a,b,d,c))};g=Q.prototype;
    g.Cu=function(a,b){F.prototype.Cu.call(this,a,b);for(var c=this.Gc.i;c.next();)this.dB(c.value,a,b);for(c=this.Ri.i;c.next();){var d=c.value,e=a,f=b;if(this.Xl(d)===e){var h=this.Vh;w.La(d,h,f);vg(this,"linkFromKey",Nf,h,d,e,f);"string"===typeof h&&this.Ib(d,h)}this.Yl(d)===e&&(h=this.Wh,w.La(d,h,f),vg(this,"linkToKey",Nf,h,d,e,f),"string"===typeof h&&this.Ib(d,h));h=this.Dk(d);if(w.isArray(h))for(var k=w.Za(h),l=this.Bg,m=0;m<k;m++)w.Ba(h,m)===e&&(w.uE(h,m,f),vg(this,"linkLabelKeys",Pf,l,d,e,f,m,
        m))}};g.dB=function(a,b,c){if(this.Cn(a)===b){var d=this.lh;w.La(a,d,c);vg(this,"nodeGroupKey",Nf,d,a,b,c);"string"===typeof d&&this.Ib(a,d)}};g.EB=function(){F.prototype.EB.call(this);for(var a=this.Rg,b=w.Za(a),c=0;c<b;c++){var d=w.Ba(a,c);Zg(this,d)}};
    g.lq=function(a){F.prototype.lq.call(this,a);a=this.pb(a);var b=Ag(this,a);if(null!==b){for(var c=new H(Object),b=b.i;b.next();){var d=b.value;if(this.He(d)){if(this.Cn(d)===a){var e=this.lh;vg(this,"nodeGroupKey",Nf,e,d,a,a);"string"===typeof e&&this.Ib(d,e);c.add(d)}}else if(this.Xl(d)===a&&(e=this.Vh,vg(this,"linkFromKey",Nf,e,d,a,a),"string"===typeof e&&this.Ib(d,e),c.add(d)),this.Yl(d)===a&&(e=this.Wh,vg(this,"linkToKey",Nf,e,d,a,a),"string"===typeof e&&this.Ib(d,e),c.add(d)),e=this.Dk(d),w.isArray(e))for(var f=
        w.Za(e),h=this.Bg,k=0;k<f;k++)w.Ba(e,k)===a&&(vg(this,"linkLabelKeys",Pf,h,d,a,a,k,k),c.add(d))}for(c=c.i;c.next();)Ug(this,a,c.value)}};g.kq=function(a){F.prototype.kq.call(this,a);var b=this.Cn(a);null===this.ve(b)&&Bg(this,b,a)};g.Ru=function(a){F.prototype.Ru.call(this,a);var b=this.Cn(a);Ug(this,b,a)};w.defineProperty(Q,{mu:"linkCategoryProperty"},function(){return this.Mm},function(a){var b=this.Mm;b!==a&&(wg(a,Q,"linkCategoryProperty"),this.Mm=a,this.h("linkCategoryProperty",b,a))});
    Q.prototype.getCategoryForLinkData=Q.prototype.sx=function(a){if(null===a)return"";var b=this.Mm;if(""===b)return"";b=w.tb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.k("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};
    Q.prototype.setCategoryForLinkData=Q.prototype.lG=function(a,b){w.j(b,"string",Q,"setCategoryForLinkData:cat");if(null!==a){var c=this.Mm;if(""!==c)if(this.vh(a)){var d=w.tb(a,c);void 0===d&&(d="");d!==b&&(w.La(a,c,b),vg(this,"linkCategory",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    function $f(a){1<arguments.length&&w.k("TreeModel constructor can only take one optional argument, the Array of node data.");F.call(this);this.mh="parent";this.$q=!1;this.Vm="parentLinkCategory";void 0!==a&&(this.hg=a)}w.Ka($f,F);w.ga("TreeModel",$f);$f.prototype.cloneProtected=function(a){F.prototype.cloneProtected.call(this,a);a.mh=this.mh;a.$q=this.$q;a.Vm=this.Vm};
    $f.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.xB();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.hg;for(var c=w.Za(a),d=0;d<c;d++)var e=w.Ba(a,d),b=b+(" "+this.pb(e)+":"+Rf(e))}return b};$f.prototype.fo=function(){var a=F.prototype.fo.call(this),b="";"parent"!==this.xu&&"string"===typeof this.xu&&(b+=',\n  "nodeParentKeyProperty": '+this.quote(this.xu));return a+b};
    $f.prototype.Au=function(a){F.prototype.Au.call(this,a);a.nodeParentKeyProperty&&(this.xu=a.nodeParentKeyProperty)};$f.prototype.On=function(a){return a};w.defineProperty($f,{xu:"nodeParentKeyProperty"},function(){return this.mh},function(a){var b=this.mh;b!==a&&(wg(a,$f,"nodeParentKeyProperty"),this.mh=a,this.h("nodeParentKeyProperty",b,a))});
    w.defineProperty($f,{vn:"copiesParentKeyOfNodeData"},function(){return this.$q},function(a){this.$q!==a&&(w.j(a,"boolean",$f,"copiesParentKeyOfNodeData"),this.$q=a)});$f.prototype.getParentKeyForNodeData=$f.prototype.En=function(a){if(null!==a){var b=this.mh;if(""!==b&&(b=w.tb(a,b),void 0!==b)){if(xg(b))return b;w.k("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
    $f.prototype.setParentKeyForNodeData=$f.prototype.ti=function(a,b){null===b&&(b=void 0);void 0===b||xg(b)||w.Bd(b,"number or string",$f,"setParentKeyForNodeData:key");if(null!==a){var c=this.mh;if(""!==c)if(b=this.On(b),this.He(a)){var d=w.tb(a,c);d!==b&&(Ug(this,d,a),w.La(a,c,b),null===this.ve(b)&&Bg(this,b,a),vg(this,"nodeParentKey",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    w.defineProperty($f,{EL:"parentLinkCategoryProperty"},function(){return this.Vm},function(a){var b=this.Vm;b!==a&&(wg(a,$f,"parentLinkCategoryProperty"),this.Vm=a,this.h("parentLinkCategoryProperty",b,a))});$f.prototype.getParentLinkCategoryForNodeData=$f.prototype.cI=function(a){if(null===a)return"";var b=this.Vm;if(""===b)return"";b=w.tb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;w.k("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};
    $f.prototype.setParentLinkCategoryForNodeData=$f.prototype.EJ=function(a,b){w.j(b,"string",$f,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.Vm;if(""!==c)if(this.He(a)){var d=w.tb(a,c);void 0===d&&(d="");d!==b&&(w.La(a,c,b),vg(this,"parentLinkCategory",Nf,c,a,d,b),"string"===typeof c&&this.Ib(a,c))}else w.La(a,c,b)}};
    $f.prototype.copyNodeData=function(a){if(null===a)return null;a=F.prototype.copyNodeData.call(this,a);this.vn||""===this.mh||void 0===w.tb(a,this.mh)||w.La(a,this.mh,void 0);return a};
    $f.prototype.setDataProperty=function(a,b,c){if(this.He(a))if(b===this.em)this.my(a,c);else{if(b===this.Vn){this.ky(a,c);return}if(b===this.xu){this.ti(a,c);return}}else!Yg&&a instanceof G&&(Yg=!0,w.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),w.trace("  Is that really your intent?"));var d=w.tb(a,b);d!==c&&(w.La(a,b,c),this.YA(a,b,d,c))};g=$f.prototype;g.Cu=function(a,b){F.prototype.Cu.call(this,a,b);for(var c=this.Gc.i;c.next();)this.dB(c.value,a,b)};
    g.dB=function(a,b,c){if(this.En(a)===b){var d=this.mh;w.La(a,d,c);vg(this,"nodeParentKey",Nf,d,a,b,c);"string"===typeof d&&this.Ib(a,d)}};g.lq=function(a){F.prototype.lq.call(this,a);a=this.pb(a);var b=Ag(this,a);if(null!==b){for(var c=new H(Object),b=b.i;b.next();){var d=b.value;if(this.He(d)&&this.En(d)===a){var e=this.mh;vg(this,"nodeParentKey",Nf,e,d,a,a);"string"===typeof e&&this.Ib(d,e);c.add(d)}}for(c=c.i;c.next();)Ug(this,a,c.value)}};
    g.kq=function(a){F.prototype.kq.call(this,a);var b=this.En(a),b=this.On(b);null===this.ve(b)&&Bg(this,b,a)};g.Ru=function(a){F.prototype.Ru.call(this,a);var b=this.En(a);Ug(this,b,a)};
    function bh(a,b,c){w.nc(this);this.P=!1;void 0===a?a="":w.j(a,"string",bh,"constructor:targetprop");void 0===b?b=a:w.j(b,"string",bh,"constructor:sourceprop");void 0===c?c=null:null!==c&&w.j(c,"function",bh,"constructor:conv");this.PD=-1;this.Ig=null;this.xp=a;this.wp=this.kt=0;this.Aw=null;this.Qr=!1;this.np=b;this.Wq=c;this.ks=ch;this.Pq=null;this.ez=new I}w.ga("Binding",bh);
    bh.prototype.copy=function(){var a=new bh;a.xp=this.xp;a.kt=this.kt;a.wp=this.wp;a.Aw=this.Aw;a.Qr=this.Qr;a.np=this.np;a.Wq=this.Wq;a.ks=this.ks;a.Pq=this.Pq;return a};var ch;bh.OneWay=ch=w.p(bh,"OneWay",1);var dh;bh.TwoWay=dh=w.p(bh,"TwoWay",2);bh.parseEnum=function(a,b){w.j(a,"function",bh,"parseEnum:ctor");w.mb(b,a,bh,"parseEnum:defval");return function(c){c=pa(a,c);return null===c?b:c}};bh.prototype.ic=function(a){a.Ee===bh?this.mode=a:w.Fj(this,a)};var Rf;
    bh.toString=Rf=function(a){var b=a;w.Pa(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()};bh.prototype.toString=function(){return"Binding("+this.py+":"+this.qG+(-1!==this.lm?" "+this.lm:"")+" "+this.mode.name+")"};bh.prototype.freeze=function(){this.P=!0;return this};
    bh.prototype.Qa=function(){this.P=!1;return this};w.defineProperty(bh,{lm:null},function(){return this.PD},function(a){this.P&&w.ma(this);w.j(a,"number",bh,"targetId");this.PD=a});w.defineProperty(bh,{py:"targetProperty"},function(){return this.xp},function(a){this.P&&w.ma(this);w.j(a,"string",bh,"targetProperty");this.xp=a});w.defineProperty(bh,{xq:"sourceName"},function(){return this.Aw},function(a){this.P&&w.ma(this);null!==a&&w.j(a,"string",bh,"sourceName");this.Aw=a;null!==a&&(this.Qr=!1)});
    w.defineProperty(bh,{Dx:"isToModel"},function(){return this.Qr},function(a){this.P&&w.ma(this);w.j(a,"boolean",bh,"isToModel");this.Qr=a});w.defineProperty(bh,{qG:"sourceProperty"},function(){return this.np},function(a){this.P&&w.ma(this);w.j(a,"string",bh,"sourceProperty");this.np=a});w.defineProperty(bh,{BH:"converter"},function(){return this.Wq},function(a){this.P&&w.ma(this);null!==a&&w.j(a,"function",bh,"converter");this.Wq=a});
    w.defineProperty(bh,{pH:"backConverter"},function(){return this.Pq},function(a){this.P&&w.ma(this);null!==a&&w.j(a,"function",bh,"backConverter");this.Pq=a});w.defineProperty(bh,{mode:"mode"},function(){return this.ks},function(a){this.P&&w.ma(this);w.mb(a,bh,bh,"mode");this.ks=a});bh.prototype.makeTwoWay=bh.prototype.QI=function(a){void 0===a&&(a=null);null!==a&&w.j(a,"function",bh,"makeTwoWay");this.mode=dh;this.pH=a;return this};
    bh.prototype.ofObject=bh.prototype.Px=function(a){void 0===a&&(a="");this.xq=a;this.Dx=!1;return this};bh.prototype.ofModel=function(){this.xq=null;this.Dx=!0;return this};function eh(a,b,c){a=a.xq;var d=null;return d=null===a||""===a?b:"/"===a?c.U:"."===a?c:".."===a?c.Q:b.xd(a)}
    bh.prototype.updateTarget=bh.prototype.FG=function(a,b,c){var d=this.np;if(void 0===c||""===d||d===c){c=this.xp;var e=this.Wq;if(null===e&&""===c)w.trace("Binding error: target property is the empty string: "+this.toString());else{var f=b;""!==d&&(f=w.tb(b,d));if(void 0!==f)if(null===e)""!==c&&w.La(a,c,f);else try{if(""!==c){var h=e(f,a);w.La(a,c,h)}else e(f,a)}catch(k){}}}};
    bh.prototype.updateSource=bh.prototype.qy=function(a,b,c,d){if(this.ks===dh){var e=this.xp;if(void 0===c||e===c){c=this.np;var f=this.Pq,h=a;""!==e&&(h=w.tb(a,e));if(void 0!==h&&!this.ez.contains(a))try{this.ez.add(a);var k=null!==d?d.g:null,l=null!==k?k.aa:null;if(null===f)if(""!==c)null!==l?l.setDataProperty(b,c,h):w.La(b,c,h);else{if(null!==l&&null!==d&&0<=d.ku&&null!==d.Q&&Array.isArray(d.Q.cq)){var m=d.ku,n=d.Q.cq;l.WF(n,m);l.AA(n,m,h)}}else try{if(""!==c){var p=f(h,b,l);null!==l?l.setDataProperty(b,
        c,p):w.La(b,c,p)}else p=f(h,b,l),void 0!==p&&null!==l&&null!==d&&0<=d.ku&&null!==d.Q&&Array.isArray(d.Q.cq)&&(m=d.ku,n=d.Q.cq,l.WF(n,m),l.AA(n,m,p))}catch(q){}}finally{this.ez.remove(a)}}}};function ag(){this.LG=(new H(Cf)).freeze();this.Sb="";this.SC=!1}w.ga("Transaction",ag);ag.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.Xf.count.toString()+(this.eu?"":", incomplete");if(void 0!==a&&0<a){a=this.Xf.count;for(var c=0;c<a;c++){var d=this.Xf.ea(c);null!==d&&(b+="\n  "+d.toString())}}return b};
    ag.prototype.clear=ag.prototype.clear=function(){var a=this.Xf;a.Qa();for(var b=a.count-1;0<=b;b--){var c=a.ea(b);null!==c&&c.clear()}a.clear();a.freeze()};ag.prototype.canUndo=ag.prototype.canUndo=function(){return this.eu};ag.prototype.undo=ag.prototype.undo=function(){if(this.canUndo())for(var a=this.Xf.count-1;0<=a;a--){var b=this.Xf.ea(a);null!==b&&b.undo()}};ag.prototype.canRedo=ag.prototype.canRedo=function(){return this.eu};
    ag.prototype.redo=ag.prototype.redo=function(){if(this.canRedo())for(var a=this.Xf.count,b=0;b<a;b++){var c=this.Xf.ea(b);null!==c&&c.redo()}};w.u(ag,{Xf:"changes"},function(){return this.LG});w.defineProperty(ag,{name:"name"},function(){return this.Sb},function(a){this.Sb=a});w.defineProperty(ag,{eu:"isComplete"},function(){return this.SC},function(a){this.SC=a});
    function Sf(){this.vz=new I(F);this.ff=!1;this.PG=(new H(ag)).freeze();this.fh=-1;this.gD=999;this.Pf=!1;this.rv=null;this.El=0;this.cC=!1;this.kh=(new H("string")).freeze();this.cp=new H("number");this.fz=!0;this.pz=!1}w.ga("UndoManager",Sf);
    Sf.prototype.toString=function(a){for(var b="UndoManager "+this.rj+"<"+this.history.count+"<="+this.GF,b=b+"[",c=this.LF.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.LF.ea(d);b+="]";if(void 0!==a&&0<a)for(c=this.history.count,d=0;d<c;d++)b+="\n "+this.history.ea(d).toString(a-1);return b};
    Sf.prototype.clear=Sf.prototype.clear=function(){var a=this.history;a.Qa();for(var b=a.count-1;0<=b;b--){var c=a.ea(b);null!==c&&c.clear()}a.clear();this.fh=-1;a.freeze();this.Pf=!1;this.rv=null;this.El=0;this.kh.Qa();this.kh.clear();this.kh.freeze();this.cp.clear()};Sf.prototype.addModel=Sf.prototype.hH=function(a){this.vz.add(a)};Sf.prototype.removeModel=Sf.prototype.pJ=function(a){this.vz.remove(a)};
    Sf.prototype.startTransaction=Sf.prototype.Hb=function(a){void 0===a&&(a="");null===a&&(a="");if(this.ab)return!1;!0===this.fz&&(this.fz=!1,this.El++,this.gd("StartingFirstTransaction",a,this.mj),0<this.El&&this.El--);this.isEnabled&&(this.kh.Qa(),this.kh.add(a),this.kh.freeze(),null===this.mj?this.cp.add(0):this.cp.add(this.mj.Xf.count));this.El++;var b=1===this.Ih;b&&this.gd("StartedTransaction",a,this.mj);return b};
    Sf.prototype.commitTransaction=Sf.prototype.Wc=function(a){void 0===a&&(a="");return fh(this,!0,a)};Sf.prototype.rollbackTransaction=Sf.prototype.mq=function(){return fh(this,!1,"")};
    function fh(a,b,c){if(a.ab)return!1;a.Yz&&1>a.Ih&&w.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Ih;d&&b&&a.gd("CommittingTransaction",c,a.mj);var e=0;if(0<a.Ih&&(a.El--,a.isEnabled)){var f=a.kh.count;0<f&&(""===c&&(c=a.kh.ea(0)),a.kh.Qa(),a.kh.bd(f-1),a.kh.freeze());f=a.cp.count;0<f&&(e=a.cp.ea(f-1),a.cp.bd(f-1))}f=a.mj;if(d){if(b){a.pz=!1;if(a.isEnabled&&null!==f){b=f;b.eu=!0;b.name=c;d=a.history;d.Qa();for(e=d.count-1;e>a.rj;e--)f=d.ea(e),null!==f&&f.clear(),
        d.bd(e),a.pz=!0;e=a.GF;0===e&&(e=1);0<e&&d.count>=e&&(f=d.ea(0),null!==f&&f.clear(),d.bd(0),a.fh--);d.add(b);a.fh++;d.freeze();f=b}a.gd("CommittedTransaction",c,f)}else{a.Pf=!0;try{a.isEnabled&&null!==f&&(f.eu=!0,f.undo())}finally{a.gd("RolledBackTransaction",c,f),a.Pf=!1}null!==f&&f.clear()}a.rv=null;return!0}if(a.isEnabled&&!b&&null!==f){a=e;c=f.Xf;for(b=c.count-1;b>=a;b--)d=c.ea(b),null!==d&&d.undo(),c.Qa(),c.bd(b);c.freeze()}return!1}
    Sf.prototype.canUndo=Sf.prototype.canUndo=function(){if(!this.isEnabled||0<this.Ih||this.ab)return!1;var a=this.AG;return null!==a&&a.canUndo()?!0:!1};Sf.prototype.undo=Sf.prototype.undo=function(){if(this.canUndo()){var a=this.AG;try{this.gd("StartingUndo","Undo",a),this.Pf=!0,this.fh--,a.undo()}catch(b){w.trace("undo error: "+b.toString())}finally{this.Pf=!1,this.gd("FinishedUndo","Undo",a)}}};
    Sf.prototype.canRedo=Sf.prototype.canRedo=function(){if(!this.isEnabled||0<this.Ih||this.ab)return!1;var a=this.zG;return null!==a&&a.canRedo()?!0:!1};Sf.prototype.redo=Sf.prototype.redo=function(){if(this.canRedo()){var a=this.zG;try{this.gd("StartingRedo","Redo",a),this.Pf=!0,this.fh++,a.redo()}catch(b){w.trace("redo error: "+b.toString())}finally{this.Pf=!1,this.gd("FinishedRedo","Redo",a)}}};
    Sf.prototype.gd=function(a,b,c){void 0===c&&(c=null);var d=new Cf;d.Ac=Of;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.$I;a.next();)b=a.value,d.aa=b,b.Ww(d)};Sf.prototype.handleChanged=Sf.prototype.iF=function(a){if(this.isEnabled&&!this.ab&&!this.skipsEvent(a)){var b=this.mj;null===b&&(this.rv=b=new ag);var c=a.copy(),b=b.Xf;b.Qa();b.add(c);b.freeze();this.Yz&&0>=this.Ih&&!this.fz&&(a=a.g,null!==a&&!1===a.Jn||w.trace("Change not within a transaction: "+c.toString()))}};
    Sf.prototype.skipsEvent=function(a){if(null===a||0>a.Ac.value)return!0;a=a.object;if(a instanceof G){if(a=a.layer,null!==a&&a.Mc)return!0}else if(a instanceof qg&&a.Mc)return!0;return!1};w.u(Sf,{$I:"models"},function(){return this.vz.i});w.defineProperty(Sf,{isEnabled:"isEnabled"},function(){return this.ff},function(a){this.ff=a});w.u(Sf,{AG:"transactionToUndo"},function(){return 0<=this.rj&&this.rj<=this.history.count-1?this.history.ea(this.rj):null});
    w.u(Sf,{zG:"transactionToRedo"},function(){return this.rj<this.history.count-1?this.history.ea(this.rj+1):null});w.u(Sf,{ab:"isUndoingRedoing"},function(){return this.Pf});w.u(Sf,{history:"history"},function(){return this.PG});w.defineProperty(Sf,{GF:"maxHistoryLength"},function(){return this.gD},function(a){this.gD=a});w.u(Sf,{rj:"historyIndex"},function(){return this.fh});w.u(Sf,{mj:"currentTransaction"},function(){return this.rv});w.u(Sf,{Ih:"transactionLevel"},function(){return this.El});
    w.u(Sf,{vF:"isInTransaction"},function(){return 0<this.El});w.defineProperty(Sf,{Yz:"checksTransactionLevel"},function(){return this.cC},function(a){this.cC=a});w.u(Sf,{LF:"nestedTransactionNames"},function(){return this.kh});function sg(){0<arguments.length&&w.kd(sg);w.nc(this);this.Z=null;this.fC=!1;this.AC=this.gC=!0;this.iC=this.jC=this.BC=this.kC=!1;this.ul=this.WB=null;this.hE=1.05;this.xC=1;this.qz=NaN;this.cD=null;this.Sz=NaN;this.Rz=ed;this.cj=null;this.ED=0}w.ga("CommandHandler",sg);
    var gh=null,hh="";sg.prototype.toString=function(){return"CommandHandler"};w.u(sg,{g:"diagram"},function(){return this.Z});sg.prototype.Rc=function(a){this.Z=a};
    sg.prototype.doKeyDown=function(){var a=this.g;if(null!==a){var b=a.R,c=w.Hk?b.ru: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()&&
        this.selectAll():"Esc"===f?this.canStopCommand()&&this.stopCommand():"Up"===f?a.pe&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===f?a.pe&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===f?a.oe&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===f?a.oe&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===f?d&&a.oe?a.scroll("page","left"):a.pe&&a.scroll("page","up"):"PageDown"===f?d&&a.oe?a.scroll("page","right"):a.pe&&a.scroll("page","down"):"Home"===
    f?c&&a.pe?a.scroll("document","up"):!c&&a.oe&&a.scroll("document","left"):"End"===f?c&&a.pe?a.scroll("document","down"):!c&&a.oe&&a.scroll("document","right"):" "===f?this.canScrollToPart()&&this.scrollToPart():"Subtract"===f?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===f?this.canIncreaseZoom()&&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():b.event&&113===b.event.which?this.canEditTextBlock()&&this.editTextBlock():b.event&&93===b.event.which?this.canShowContextMenu()&&this.showContextMenu():b.bubbles=!0:this.canCopySelection()&&this.copySelection()}};sg.prototype.doKeyUp=function(){var a=this.g;null!==a&&(a.R.bubbles=!0)};sg.prototype.stopCommand=function(){var a=this.g;if(null!==a){var b=a.$a;b instanceof ih&&a.yf&&a.Xw();null!==b&&b.doCancel()}};sg.prototype.canStopCommand=function(){return!0};
    sg.prototype.selectAll=function(){var a=this.g;if(null!==a){a.oa();try{a.ec="wait";a.Aa("ChangingSelection");for(var b=a.Lk;b.next();)b.value.ib=!0;for(var c=a.ig;c.next();)c.value.ib=!0;for(var d=a.links;d.next();)d.value.ib=!0}finally{a.Aa("ChangedSelection"),a.ec=""}}};sg.prototype.canSelectAll=function(){var a=this.g;return null!==a&&a.yf};
    sg.prototype.deleteSelection=function(){var a=this.g;if(null!==a&&!a.Aa("SelectionDeleting",a.selection))try{a.ec="wait";a.Hb("Delete");a.Aa("ChangingSelection");for(var b=new I(R),c=a.selection.i;c.next();)jh(b,c.value,!0,this.MH?Infinity:0,this.KE,function(a){return a.canDelete()});a.cB(b,!0);a.Aa("SelectionDeleted",b)}finally{a.Aa("ChangedSelection"),a.Wc("Delete"),a.ec=""}};sg.prototype.canDeleteSelection=function(){var a=this.g;return null===a||a.hb||a.Cf||!a.kn||0===a.selection.count?!1:!0};
    function jh(a,b,c,d,e,f){void 0===f&&(f=null);if(!(a.contains(b)||null!==f&&!f(b)||b instanceof kh))if(a.add(b),b instanceof T){if(c&&b instanceof V)for(var h=b.Oc;h.next();)jh(a,h.value,c,d,e,f);if(e)for(h=b.ge;h.next();){var k=h.value;if(!a.contains(k)){var l=k.Y,m=k.$;null!==l&&a.contains(l)&&null!==m&&a.contains(m)?jh(a,k,c,d,e,f):null!==l&&null!==m||jh(a,k,c,d,e,f)}}if(1<d)for(b=b.VE();b.next();)jh(a,b.value,c,d-1,e,f)}else if(b instanceof W)for(b=b.Ef;b.next();)jh(a,b.value,c,d,e,f)}
    sg.prototype.Kp=function(a,b,c){var d=new ma(R,R);for(a=a.i;a.next();)lh(this,a.value,b,d,c);if(null!==b){c=b.aa;a=!1;null!==b.eb.te&&(a=b.eb.te.oj);for(var e=new I(W),f=new ma(W,W),h=d.i;h.next();){var k=h.value;if(k instanceof W){var l=k;a||null!==l.Y&&null!==l.$||e.add(l)}else if(c instanceof $f&&k instanceof T&&null!==k.data){var l=c,m=k,k=h.key,n=k.Bk();null!==n&&(n=d.ka(n),null!==n?(l.ti(m.data,l.pb(n.data)),l=b.Yf(m.data),k=k.An(),null!==k&&null!==l&&f.add(k,l)):l.ti(m.data,void 0))}}0<e.count&&
    b.cB(e,!1);if(0<f.count)for(c=f.i;c.next();)d.add(c.key,c.value)}if(null!==b&&null!==this.g&&(b=b.aa,c=b.jH,null!==c)){var p=new ma;d.each(function(a){null!==a.key.data&&p.add(a.key.data,a.value.data)});c(p,b,this.g.aa)}for(b=d.i;b.next();)b.value.Ib();return d};
    function lh(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.ka(b);var f=null,h=b.data;if(null!==h&&null!==c){var k=c.aa;b instanceof W?k instanceof Q&&(h=k.Zw(h),w.Pa(h)&&(k.xt(h),f=c.Yf(h))):(h=k.copyNodeData(h),w.Pa(h)&&(k.Hl(h),f=c.xh(h)))}else mh(b),f=b.copy(),null!==f&&(null!==c?c.add(f):null!==h&&null!==a.g&&a.CH&&(k=a.g.aa,h=f instanceof W&&k instanceof Q?k.Zw(h):k.copyNodeData(h),w.Pa(h)&&(f.data=h)));if(!(f instanceof R))return null;f.ib=!1;f.Qg=!1;d.add(b,f);
        if(b instanceof T){for(h=b.ge;h.next();){k=h.value;if(k.Y===b){var l=d.ka(k);null!==l&&(l.Y=f)}k.$===b&&(l=d.ka(k),null!==l&&(l.$=f))}if(b instanceof V&&f instanceof V)for(h=f,b=b.Oc;b.next();)k=lh(a,b.value,c,d,e),k instanceof W||null===k||(k.Da=h)}else if(b instanceof W&&f instanceof W)for(h=b.Y,null!==h&&(h=d.ka(h),null!==h&&(f.Y=h)),h=b.$,null!==h&&(h=d.ka(h),null!==h&&(f.$=h)),b=b.Ef;b.next();)h=lh(a,b.value,c,d,e),null!==h&&h instanceof T&&(h.Wb=f);return f}
    sg.prototype.copySelection=function(){var a=this.g;if(null!==a){for(var b=new I(R),a=a.selection.i;a.next();)jh(b,a.value,!0,this.FH?Infinity:0,this.DH,function(a){return a.canCopy()});this.copyToClipboard(b)}};sg.prototype.canCopySelection=function(){var a=this.g;return null!==a&&a.tk&&a.Tz&&0!==a.selection.count?!0:!1};sg.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
    sg.prototype.canCutSelection=function(){var a=this.g;return null!==a&&!a.hb&&!a.Cf&&a.tk&&a.kn&&a.Tz&&0!==a.selection.count?!0:!1};sg.prototype.copyToClipboard=function(a){var b=this.g;if(null!==b){var c=null;if(null===a)gh=null,hh="";else{var c=b.aa,d=!1,e=!1,f=null;try{if(c instanceof $f){var h=c,d=h.vn;h.vn=this.DE}c instanceof Q&&(h=c,e=h.un,h.un=this.CE);f=b.Kp(a,null,!0)}finally{c instanceof $f&&(c.vn=d),c instanceof Q&&(c.un=e),c=new H(R),c.Jc(f),gh=c,hh=b.aa.Ql}}b.Aa("ClipboardChanged",c)}};
    sg.prototype.pasteFromClipboard=function(){var a=new I(R),b=gh;if(null===b)return a;var c=this.g;if(null===c||hh!==c.aa.Ql)return a;var d=c.aa,e=!1,f=!1,h=null;try{if(d instanceof $f){var k=d,e=k.vn;k.vn=this.DE}d instanceof Q&&(k=d,f=k.un,k.un=this.CE);h=c.Kp(b,c,!1)}finally{for(d instanceof $f&&(d.vn=e),d instanceof Q&&(d.un=f),b=h.i;b.next();)c=b.value,d=b.key,c.location.I()||(d.location.I()?c.location=d.location:!c.position.I()&&d.position.I()&&(c.position=d.position)),a.add(c)}return a};
    sg.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.ec="wait";b.Hb("Paste");b.Aa("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&nh(b);for(var d=c.i;d.next();)d.value.ib=!0;b.Aa("ChangedSelection");if(null!==a){var e=b.computePartsBounds(b.selection);if(e.I()){var f=b.eb.te;null===f&&(f=new oh,f.Rc(b));var h=f.computeEffectiveCollection(b.selection);f.moveParts(h,new z(a.x-e.la,a.y-e.ra),!1)}}b.Aa("ClipboardPasted",c)}finally{b.Wc("Paste"),b.ec=
        ""}};sg.prototype.canPasteSelection=function(){var a=this.g;return null===a||a.hb||a.Cf||!a.Dp||!a.Tz||null===gh||hh!==a.aa.Ql?!1:!0};sg.prototype.undo=function(){var a=this.g;null!==a&&a.ia.undo()};sg.prototype.canUndo=function(){var a=this.g;return null===a||a.hb||a.Cf?!1:a.qE&&a.ia.canUndo()};sg.prototype.redo=function(){var a=this.g;null!==a&&a.ia.redo()};sg.prototype.canRedo=function(){var a=this.g;return null===a||a.hb||a.Cf?!1:a.qE&&a.ia.canRedo()};
    sg.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.vy);w.wd(a,sg,"decreaseZoom:factor");var b=this.g;null!==b&&b.Ll===ph&&(a*=b.scale,a<b.Ah||a>b.zh||(b.scale=a))};sg.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.vy);w.wd(a,sg,"canDecreaseZoom:factor");var b=this.g;if(null===b||b.Ll!==ph)return!1;a*=b.scale;return a<b.Ah||a>b.zh?!1:b.Vw};
    sg.prototype.increaseZoom=function(a){void 0===a&&(a=this.vy);w.wd(a,sg,"increaseZoom:factor");var b=this.g;null!==b&&b.Ll===ph&&(a*=b.scale,a<b.Ah||a>b.zh||(b.scale=a))};sg.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.vy);w.wd(a,sg,"canIncreaseZoom:factor");var b=this.g;if(null===b||b.Ll!==ph)return!1;a*=b.scale;return a<b.Ah||a>b.zh?!1:b.Vw};sg.prototype.resetZoom=function(a){void 0===a&&(a=this.ex);w.wd(a,sg,"resetZoom:newscale");var b=this.g;null===b||a<b.Ah||a>b.zh||(b.scale=a)};
    sg.prototype.canResetZoom=function(a){void 0===a&&(a=this.ex);w.wd(a,sg,"canResetZoom:newscale");var b=this.g;return null===b||a<b.Ah||a>b.zh?!1:b.Vw};sg.prototype.zoomToFit=function(){var a=this.g;if(null!==a){var b=a.scale,c=a.position;b===this.Sz&&!isNaN(this.qz)&&a.se.L(this.Rz)?(a.scale=this.qz,a.position=this.cD,this.Sz=NaN,this.Rz=ed):(this.qz=b,this.cD=c.copy(),a.zoomToFit(),this.Sz=a.scale,this.Rz=a.se.copy())}};sg.prototype.canZoomToFit=function(){var a=this.g;return null===a?!1:a.Vw};
    sg.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&w.G(a,R,sg,"part");var b=this.g;if(null!==b){if(null===a){try{null!==this.cj&&(this.cj.next()?a=this.cj.value:this.cj=null)}catch(c){this.cj=null}null===a&&(0<b.Zl.count?this.cj=b.Zl.i:0<b.selection.count&&(this.cj=b.selection.i),null!==this.cj&&this.cj.next()&&(a=this.cj.value))}if(null!==a){var d=b.Oa;d.Wn("Scroll To Part");var e=this.AJ;if(0<e){var f=Jh(this,a,[a]),h=function(){b.Hb();for(var a=f.pop();0<f.length&&a instanceof
    T&&a.tc&&(!(a instanceof V)||a.Zc);)a=f.pop();0<f.length?(a instanceof R&&b.gG(a.W),a instanceof T&&!a.tc&&(a.tc=!0),a instanceof V&&!a.Zc&&(a.Zc=!0)):(a instanceof R&&b.wE(a.W),b.bB("LayoutCompleted",k));b.Wc("Scroll To Part")},k=function(){setTimeout(h,(d.isEnabled?d.duration:0)+e)};b.Nw("LayoutCompleted",k);h()}else{var l=b.position.copy();b.wE(a.W);l.Kc(b.position)&&d.Gh()}}}};
    function Jh(a,b,c){if(b.isVisible())return c;if(b instanceof kh)Jh(a,b.xf,c);else if(b instanceof W){var d=b.Y;null!==d&&Jh(a,d,c);b=b.$;null!==b&&Jh(a,b,c)}else b instanceof T&&(d=b.Wb,null!==d&&Jh(a,d,c),d=b.Bk(),null!==d&&(d.tc||d.zq||c.push(d),Jh(a,d,c))),b=b.Da,null!==b&&(b.Zc||b.uy||c.push(b),Jh(a,b,c));return c}sg.prototype.canScrollToPart=function(a){void 0===a&&(a=null);if(null!==a&&!(a instanceof R))return!1;a=this.g;return null===a||0===a.selection.count&&0===a.Zl.count?!1:a.oe&&a.pe};
    sg.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Hb("Collapse Tree");b.Oa.Wn("Collapse Tree");var c=new H(T);if(null!==a&&a.tc)a.collapseTree(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof T&&(a=e,a.tc&&(a.collapseTree(),c.add(a)))}b.Aa("TreeCollapsed",c)}finally{b.Wc("Collapse Tree")}};
    sg.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.hb)return!1;if(null!==a){if(!(a instanceof T&&a.tc))return!1;if(0<a.px().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof T&&b.tc&&0<b.px().count)return!0;return!1};
    sg.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Hb("Expand Tree");b.Oa.Wn("Expand Tree");var c=new H(T);if(null===a||a.tc)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof T&&(a=e,a.tc||(a.expandTree(),c.add(a)))}else a.expandTree(),c.add(a);b.Aa("TreeExpanded",c)}finally{b.Wc("Expand Tree")}};
    sg.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.hb)return!1;if(null!==a){if(!(a instanceof T)||a.tc)return!1;if(0<a.px().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof T&&!b.tc&&0<b.px().count)return!0;return!1};
    sg.prototype.groupSelection=function(){var a=this.g;if(null!==a){var b=a.aa;if(b instanceof Q){var c=this.rE;if(null!==c){var d=null;try{a.ec="wait";a.Hb("Group");a.Aa("ChangingSelection");for(var e=new H(R),f=a.selection.i;f.next();){var h=f.value;h.ee()&&h.canGroup()&&e.add(h)}for(var k=new H(R),l=e.i;l.next();){for(var m=l.value,f=!1,n=e.i;n.next();)if(m.qi(n.value)){f=!0;break}f||k.add(m)}if(0<k.count){var p=k.first().Da;if(null!==p)for(;null!==p;){for(var e=!1,q=k.i;q.next();)if(!q.value.qi(p)){e=
        !0;break}if(e)p=p.Da;else break}if(c instanceof V)mh(c),d=c.copy(),null!==d&&a.add(d);else if(b.EA(c)){var r=b.copyNodeData(c);w.Pa(r)&&(b.Hl(r),d=a.ox(r))}if(null!==d){null!==p&&this.isValidMember(p,d)&&(d.Da=p);for(var s=k.i;s.next();){var u=s.value;this.isValidMember(d,u)&&(u.Da=d)}a.select(d)}}a.Aa("ChangedSelection");a.Aa("SelectionGrouped",d)}finally{a.Wc("Group"),a.ec=""}}}}};
    sg.prototype.canGroupSelection=function(){var a=this.g;if(null===a||a.hb||a.Cf||!a.Dp||!a.Qw||!(a.aa instanceof Q)||null===this.rE)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canGroup())return!0}return!1};function Kh(a){var b=w.cb();for(a=a.i;a.next();){var c=a.value;c instanceof W||b.push(c)}a=new I(R);for(var c=b.length,d=0;d<c;d++){for(var e=b[d],f=!0,h=0;h<c;h++)if(e.qi(b[h])){f=!1;break}f&&a.add(e)}w.ta(b);return a}
    sg.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof W)return!1;if(null!==a){if(a===b||a.qi(b))return!1;var c=a.OA;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.OA;return null!==c?c(a,b):!0};
    sg.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b){var c=b.aa;if(c instanceof Q)try{b.ec="wait";b.Hb("Ungroup");b.Aa("ChangingSelection");var d=new H(V);if(null!==a)d.add(a);else for(var e=b.selection.i;e.next();){var f=e.value;f instanceof V&&(a=f,a.canUngroup()&&d.add(a))}if(0<d.count){b.Xw();for(var h=d.i;h.next();){var k=h.value;k.expandSubGraph();var l=k.Da,m=null!==l&&null!==l.data?c.pb(l.data):void 0,n=new H(R);n.Jc(k.Oc);for(var p=n.i;p.next();){var q=
        p.value;q.ib=!0;if(!(q instanceof W)){var r=q.data;null!==r?c.mB(r,m):q.Da=l}}b.remove(k)}}b.Aa("ChangedSelection");b.Aa("SelectionUngrouped",d,n)}finally{b.Wc("Ungroup"),b.ec=""}}};sg.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.hb||b.Cf||!b.kn||!b.Uw||!(b.aa instanceof Q))return!1;if(null!==a){if(!(a instanceof V))return!1;if(a.canUngroup())return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&b.canUngroup())return!0;return!1};
    sg.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=Kh(a).i;d.next();){var e=d.value;null!==e.Da&&(!b||this.isValidMember(null,e)?e.Da=null:c=!1)}return c};
    sg.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Hb("Collapse SubGraph");b.Oa.Wn("Collapse SubGraph");var c=new H(V);if(null!==a&&a.Zc)a.collapseSubGraph(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof V&&(a=e,a.Zc&&(a.collapseSubGraph(),c.add(a)))}b.Aa("SubGraphCollapsed",c)}finally{b.Wc("Collapse SubGraph")}};
    sg.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.hb)return!1;if(null!==a)return a instanceof V&&a.Zc?!0:!1;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&b.Zc)return!0;return!1};
    sg.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null!==b)try{b.Hb("Expand SubGraph");b.Oa.Wn("Expand SubGraph");var c=new H(V);if(null===a||a.Zc)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof V&&(a=e,a.Zc||(a.expandSubGraph(),c.add(a)))}else a.expandSubGraph(),c.add(a);b.Aa("SubGraphExpanded",c)}finally{b.Wc("Expand SubGraph")}};
    sg.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.hb)return!1;if(null!==a)return a instanceof V&&!a.Zc?!0:!1;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof V&&!b.Zc)return!0;return!1};
    sg.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&w.G(a,Lh,sg,"editTextBlock");var b=this.g;if(null!==b){var c=b.eb.vB;if(null!==c){if(null===a){a=null;for(var d=b.selection.i;d.next();){var e=d.value;if(e.canEdit()){a=e;break}}if(null===a)return;a=a.Mt(function(a){return a instanceof Lh&&a.kA})}null!==a&&(b.$a=null,c.$g=a,b.$a=c)}}};
    sg.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);var b=this.g;if(null===b||b.hb||b.Cf||!b.Tw||null===b.eb.vB)return!1;if(null!==a){if(!(a instanceof Lh))return!1;a=a.U;if(null!==a&&a.canEdit())return!0}else for(b=b.selection.i;b.next();)if(a=b.value,a.canEdit()&&(a=a.Mt(function(a){return a instanceof Lh&&a.kA}),null!==a))return!0;return!1};
    sg.prototype.showContextMenu=function(a){var b=this.g;if(null!==b){var c=b.eb.cA;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new zf,e=null;a instanceof G?e=a.Wa(Jb):b.AI||(e=b.qb,e=new z(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.g=b,d.ef=b.BG(e),d.da=e,d.left=!1,d.right=!0,d.up=!0,b.R=d);b.$a=c;Mh(c,!1,a)}}};
    sg.prototype.canShowContextMenu=function(a){var b=this.g;if(null===b)return!1;var c=b.eb.cA;if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0};w.defineProperty(sg,{CH:"copiesClipboardData"},function(){return this.fC},function(a){w.j(a,"boolean",sg,"copiesClipboardData");this.fC=a});
    w.defineProperty(sg,{DH:"copiesConnectedLinks"},function(){return this.gC},function(a){w.j(a,"boolean",sg,"copiesConnectedLinks");this.gC=a});w.defineProperty(sg,{KE:"deletesConnectedLinks"},function(){return this.AC},function(a){w.j(a,"boolean",sg,"deletesConnectedLinks");this.AC=a});w.defineProperty(sg,{FH:"copiesTree"},function(){return this.kC},function(a){w.j(a,"boolean",sg,"copiesTree");this.kC=a});
    w.defineProperty(sg,{MH:"deletesTree"},function(){return this.BC},function(a){w.j(a,"boolean",sg,"deletesTree");this.BC=a});w.defineProperty(sg,{DE:"copiesParentKey"},function(){return this.jC},function(a){w.j(a,"boolean",sg,"copiesParentKey");this.jC=a});w.defineProperty(sg,{CE:"copiesGroupKey"},function(){return this.iC},function(a){w.j(a,"boolean",sg,"copiesGroupKey");this.iC=a});
    w.defineProperty(sg,{rE:"archetypeGroupData"},function(){return this.WB},function(a){null!==a&&w.G(a,Object,sg,"archetypeGroupData");var b=this.g;null!==b&&(b=b.aa,b instanceof Q&&(a instanceof V||b.EA(a)||w.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.WB=a});w.defineProperty(sg,{OA:"memberValidation"},function(){return this.ul},function(a){null!==a&&w.j(a,"function",sg,"memberValidation");this.ul=a});
    w.defineProperty(sg,{ex:"defaultScale"},function(){return this.xC},function(a){w.wd(a,sg,"defaultScale");0<a||w.k("defaultScale must be larger than zero, not: "+a);this.xC=a});w.defineProperty(sg,{vy:"zoomFactor"},function(){return this.hE},function(a){w.wd(a,sg,"zoomFactor");1<a||w.k("zoomFactor must be larger than 1.0, not: "+a);this.hE=a});w.defineProperty(sg,{AJ:"scrollToPartPause"},function(){return this.ED},function(a){w.wd(a,sg,"scrollToPartPause");this.ED=a});
    function rg(){0<arguments.length&&w.kd(rg);w.nc(this);this.Z=null;this.Sb="";this.ff=!0;this.QC=!1;this.bE=null;this.Lw=-1}w.ga("Tool",rg);rg.prototype.Rc=function(a){this.Z=a};rg.prototype.toString=function(){return""!==this.name?this.name+" Tool":w.lf(Object.getPrototypeOf(this))};rg.prototype.updateAdornments=function(){};rg.prototype.canStart=function(){return this.isEnabled};rg.prototype.doStart=function(){};rg.prototype.doActivate=function(){this.sa=!0};
    rg.prototype.doDeactivate=function(){this.sa=!1};rg.prototype.doStop=function(){};rg.prototype.doCancel=function(){this.stopTool()};rg.prototype.stopTool=function(){var a=this.g;null!==a&&a.$a===this&&(a.$a=null,a.ec="")};rg.prototype.doMouseDown=function(){!this.sa&&this.canStart()&&this.doActivate()};rg.prototype.doMouseMove=function(){};rg.prototype.doMouseUp=function(){this.stopTool()};rg.prototype.doMouseWheel=function(){};rg.prototype.canStartMultiTouch=function(){return!0};
    rg.prototype.standardPinchZoomStart=function(){var a=this.g;if(null!==a){var b=a.R,c=b.tx(0,w.xb(NaN,NaN)),d=b.tx(1,w.xb(NaN,NaN));if(c.I()&&d.I()&&(this.doCancel(),a.Yt("hasGestureZoom"))){a.qD=a.scale;var e=d.x-c.x,f=d.y-c.y;a.KD=Math.sqrt(e*e+f*f);b.bubbles=!1}w.v(c);w.v(d)}};
    rg.prototype.standardPinchZoomMove=function(){var a=this.g;if(null!==a){var b=a.R,c=b.tx(0,w.xb(NaN,NaN)),d=b.tx(1,w.xb(NaN,NaN));if(c.I()&&d.I()&&(this.doCancel(),a.Yt("hasGestureZoom"))){var e=d.x-c.x,f=d.y-c.y,f=Math.sqrt(e*e+f*f)/a.KD,e=new z((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.qD*f,h=a.ob;if(f!==a.scale&&h.canResetZoom(f)){var k=a.pm;a.pm=e;h.resetZoom(f);a.pm=k}b.bubbles=!1}w.v(c);w.v(d)}};
    rg.prototype.doKeyDown=function(){var a=this.g;null!==a&&"Esc"===a.R.key&&this.doCancel()};rg.prototype.doKeyUp=function(){};rg.prototype.startTransaction=rg.prototype.Hb=function(a){void 0===a&&(a=this.name);this.Lf=null;var b=this.g;return null===b?!1:b.Hb(a)};rg.prototype.stopTransaction=rg.prototype.Nk=function(){var a=this.g;return null===a?!1:null===this.Lf?a.mq():a.Wc(this.Lf)};
    rg.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.yf){var b=a.R,c=a.Pt(b.da,!1);if(null!==c)if(w.Hk?b.ru:b.control){a.Aa("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Da;null!==b&&(b.ib=!b.ib);a.Aa("ChangedSelection")}else if(b.shift){if(!c.ib){a.Aa("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Da;null!==b&&(b.ib=!0);a.Aa("ChangedSelection")}}else{if(!c.ib){for(b=c;null!==b&&!b.canSelect();)b=b.Da;null!==b&&a.select(b)}}else!b.left||(w.Hk?b.ru:b.control)||
    b.shift||a.Xw()}};rg.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.Mc});var c=this.g;if(null===c)return!1;var d=c.R,e=c.Le(d.da,a,b);d.Re=e;Nh(e,d,c);return d.Cc};
    function Nh(a,b,c){b.Cc=!1;if(null===a||a.fu()){var d=0;b.left?d=1===b.Ge?1:2===b.Ge?2:1:b.right&&1===b.Ge&&(d=3);var e="";if(null!==a){switch(d){case 1:e="ObjectSingleClicked";break;case 2:e="ObjectDoubleClicked";break;case 3:e="ObjectContextClicked"}0!==d&&c.Aa(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.Aa(e)}if(null!==a)for(;null!==a;){c=null;switch(d){case 1:c=a.click;break;case 2:c=a.Jt?a.Jt:
        a.click;break;case 3:c=a.bA}if(null!==c&&(c(b,a),b.Cc))break;a=a.Q}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.Jt?c.Jt:c.click;break;case 3:a=c.bA}null!==a&&a(b)}}}
    rg.prototype.standardMouseOver=function(){var a=this.g;if(null!==a){var b=a.R;if(null!==b.g&&!0!==a.Oa.qc){var c=a.wb;a.wb=!0;var d=a.ll?a.Le(b.da,null,null):null;b.Re=d;var e=!1;if(d!==a.wo){var f=a.wo,h=f;a.wo=d;this.doCurrentObjectChanged(f,d);for(b.Cc=!1;null!==f;){var k=f.tu;if(null!==k){if(d===f)break;if(null!==d&&d.bm(f))break;k(b,f,d);e=!0;if(b.Cc)break}f=f.Q}f=h;for(b.Cc=!1;null!==d;){k=d.su;if(null!==k){if(f===d)break;if(null!==f&&f.bm(d))break;k(b,d,f);e=!0;if(b.Cc)break}d=d.Q}d=a.wo}if(null!==
        d){f=d;for(h="";null!==f;){h=f.cursor;if(""!==h)break;f=f.Q}a.ec=h;b.Cc=!1;for(f=d;null!==f;){d=f.SA;if(null!==d&&(d(b,f),e=!0,b.Cc))break;f=f.Q}}else a.ec="",d=a.SA,null!==d&&(d(b),e=!0);e&&a.Ne();a.wb=c}}};rg.prototype.doCurrentObjectChanged=function(){};
    rg.prototype.standardMouseWheel=function(){var a=this.g;if(null!==a){var b=a.R,c=b.Sl;if(0!==c&&a.se.I()){var d=a.ob,e=a.eb.uu;if((e===Oh&&!b.shift||e===Ph&&b.control)&&(0<c?d.canIncreaseZoom():d.canDecreaseZoom()))e=a.pm,a.pm=b.ef,0<c?d.increaseZoom():d.decreaseZoom(),a.pm=e,b.bubbles=!1;else if(e===Oh&&b.shift||e===Ph&&!b.control){var d=a.position.copy(),e=0<c?c:-c,f=b.event.deltaX,h=b.event.deltaY;void 0===f||void 0===h||0===f&&0===h||b.shift?!b.shift&&a.pe?(f=a.Hu,e=e/40*f,0<c?a.scroll("pixel",
        "up",e):a.scroll("pixel","down",e)):b.shift&&a.oe&&(f=a.Gu,e=e/40*f,0<c?a.scroll("pixel","left",e):a.scroll("pixel","right",e)):(0!==f&&a.oe&&(0<f?a.scroll("pixel","left",-f):a.scroll("pixel","right",f)),0!==h&&a.pe&&(0<h?a.scroll("pixel","up",-h):a.scroll("pixel","down",h)));a.position.L(d)||(b.bubbles=!1)}}}};rg.prototype.standardWaitAfter=function(a,b){w.j(a,"number",rg,"standardWaitAfter:delay");this.cancelWaitAfter();var c=this,d=b.copy();this.Lw=w.setTimeout(function(){c.doWaitAfter(d)},a)};
    rg.prototype.cancelWaitAfter=function(){-1!==this.Lw&&w.clearTimeout(this.Lw);this.Lw=-1};rg.prototype.doWaitAfter=function(){};rg.prototype.findToolHandleAt=function(a,b){var c=this.g;if(null===c)return null;c=c.Le(a,function(a){for(;null!==a&&!(a.Q instanceof kh);)a=a.Q;return a});return null===c?null:c.U.vd===b?c:null};
    rg.prototype.isBeyondDragSize=function(a,b){var c=this.g;if(null===c)return!1;void 0===a&&(a=c.Bc.ef);void 0===b&&(b=c.R.ef);var d=c.eb.QH,e=d.width,d=d.height;c.Bc.vj&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};w.u(rg,{g:"diagram"},function(){return this.Z});w.defineProperty(rg,{name:"name"},function(){return this.Sb},function(a){w.j(a,"string",rg,"name");this.Sb=a});
    w.defineProperty(rg,{isEnabled:"isEnabled"},function(){return this.ff},function(a){w.j(a,"boolean",rg,"isEnabled");this.ff=a});w.defineProperty(rg,{sa:"isActive"},function(){return this.QC},function(a){w.j(a,"boolean",rg,"isActive");this.QC=a});w.defineProperty(rg,{Lf:"transactionResult"},function(){return this.bE},function(a){null!==a&&w.j(a,"string",rg,"transactionResult");this.bE=a});
    function oh(){rg.call(this);0<arguments.length&&w.kd(oh);this.name="Dragging";this.hC=this.UC=!0;this.Kr=this.GC=!1;this.YC=!0;this.gz=(new ia(NaN,NaN)).freeze();this.hz=Ab;this.iz=(new z(NaN,NaN)).freeze();this.FC=!1;this.hw=this.gw=this.Xy=this.eC=this.EC=this.pC=this.aj=null;this.qr=this.WC=!1;this.qp=new z(NaN,NaN);this.Bw=new z;this.Ew=!1;this.TC=!0;this.Co=100;this.Nj=[];this.OG=(new I(R)).freeze()}w.Ka(oh,rg);w.ga("DraggingTool",oh);
    w.defineProperty(oh,{qF:"isCopyEnabled"},function(){return this.UC},function(a){w.j(a,"boolean",oh,"isCopyEnabled");this.UC=a});w.defineProperty(oh,{EH:"copiesEffectiveCollection"},function(){return this.hC},function(a){w.j(a,"boolean",oh,"copiesEffectiveCollection");this.hC=a});w.defineProperty(oh,{RH:"dragsTree"},function(){return this.GC},function(a){w.j(a,"boolean",oh,"dragsTree");this.GC=a});
    w.defineProperty(oh,{zx:"isGridSnapEnabled"},function(){return this.Kr},function(a){w.j(a,"boolean",oh,"isGridSnapEnabled");this.Kr=a});w.defineProperty(oh,{uI:"isComplexRoutingRealtime"},function(){return this.TC},function(a){w.j(a,"boolean",oh,"isComplexRoutingRealtime");this.TC=a});w.defineProperty(oh,{wI:"isGridSnapRealtime"},function(){return this.YC},function(a){w.j(a,"boolean",oh,"isGridSnapRealtime");this.YC=a});
    w.defineProperty(oh,{hF:"gridSnapCellSize"},function(){return this.gz},function(a){w.G(a,ia,oh,"gridSnapCellSize");this.gz.L(a)||(this.gz=a=a.S())});w.defineProperty(oh,{fI:"gridSnapCellSpot"},function(){return this.hz},function(a){w.G(a,L,oh,"gridSnapCellSpot");this.hz.L(a)||(this.hz=a=a.S())});w.defineProperty(oh,{gI:"gridSnapOrigin"},function(){return this.iz},function(a){w.G(a,z,oh,"gridSnapOrigin");this.iz.L(a)||(this.iz=a=a.S())});
    w.defineProperty(oh,{oj:"dragsLink"},function(){return this.FC},function(a){w.j(a,"boolean",oh,"dragsLink");this.FC=a});w.defineProperty(oh,{xn:"currentPart"},function(){return this.pC},function(a){null!==a&&w.G(a,R,oh,"currentPart");this.pC=a});w.defineProperty(oh,{dc:"copiedParts"},function(){return this.eC},function(a){this.eC=a});w.defineProperty(oh,{Zb:"draggedParts"},function(){return this.EC},function(a){this.EC=a});
    w.u(oh,{WK:"draggingParts"},function(){return null!==this.dc?this.dc.Gj():null!==this.Zb?this.Zb.Gj():this.OG});w.defineProperty(oh,{jd:"draggedLink"},function(){return this.Xy},function(a){null!==a&&w.G(a,W,oh,"draggedLink");this.Xy!==a&&(this.Xy=a,null!==a?(this.gw=a.Lc,this.hw=a.ld):this.hw=this.gw=null)});w.defineProperty(oh,{yx:"isDragOutStarted"},function(){return this.WC},function(a){this.WC=a});
    w.defineProperty(oh,{Mk:"startPoint"},function(){return this.Bw},function(a){w.G(a,z,oh,"startPoint");this.Bw.L(a)||(this.Bw=a=a.S())});w.defineProperty(oh,{GE:"delay"},function(){return this.Co},function(a){w.j(a,"number",oh,"delay");this.Co=a});oh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.hb&&!a.Bt||!a.Jl&&!a.tk&&!a.Bt||!a.yf)return!1;var b=a.R;return!b.left||a.$a!==this&&(!this.isBeyondDragSize()||b.vj&&b.timestamp-a.Bc.timestamp<this.Co)?!1:null!==this.findDraggablePart()};
    oh.prototype.findDraggablePart=function(){var a=this.g;if(null===a)return null;a=a.Pt(a.Bc.da,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.Da;return null!==a&&(a.canMove()||a.canCopy())?a:null};oh.prototype.standardMouseSelect=function(){var a=this.g;if(null!==a&&a.yf){var b=a.Pt(a.Bc.da,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.Da;this.xn=b;this.xn.ib||(a.Aa("ChangingSelection"),b=a.R,(w.Hk?b.ru:b.control)||b.shift||nh(a),this.xn.ib=!0,a.Aa("ChangedSelection"))}}};
    oh.prototype.doActivate=function(){var a=this.g;if(null!==a){null===this.xn&&this.standardMouseSelect();var b=this.xn;null!==b&&(b.canMove()||b.canCopy())&&(this.sa=!0,this.qp.set(a.position),Qh(this,a.selection),this.Nj.length=0,this.Zb=this.computeEffectiveCollection(a.selection),a.Nu=!0,Rh(this,this.Zb),this.Hb("Drag"),this.Mk=a.Bc.da,a.cf=!0,a.Bt&&(this.yx=!0,this.qr=!1,Sh=this,Th=this.g,this.doSimulatedDragOut()))}};
    function Qh(a,b){if(a.oj){var c=a.g;null!==c&&c.ln&&(c.aa instanceof Q&&1===b.count&&b.first()instanceof W?(a.jd=b.first(),a.jd.canRelinkFrom()&&a.jd.canRelinkTo()&&a.jd.Et(),a.aj=c.eb.VF,null===a.aj&&(a.aj=new Uh,a.aj.Rc(c))):(a.jd=null,a.aj=null))}}
    oh.prototype.computeEffectiveCollection=function(a){var b=null!==this.g&&this.g.$a===this,c=new ma(R);if(null===a)return c;for(var d=a.i;d.next();)Vh(this,c,d.value,b);if(null!==this.jd&&this.oj)return c;for(d=a.i;d.next();)a=d.value,a instanceof W&&(b=a.Y,null===b||c.contains(b)?(b=a.$,null===b||c.contains(b)||c.remove(a)):c.remove(a));return c};function Wh(a){return void 0===a?new Xh(dd):new Xh(a.copy())}
    function Vh(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof T){b.add(c,Wh(c.location));if(c instanceof V)for(var e=c.Oc;e.next();)Vh(a,b,e.value,d);for(e=c.ge;e.next();){var f=e.value;if(!b.contains(f)){var h=f.Y,k=f.$;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&Vh(a,b,f,d)}}if(a.RH)for(c=c.VE();c.next();)Vh(a,b,c.value,d)}else if(c instanceof W)for(f=c,b.add(f,Wh()),c=f.Ef;c.next();)Vh(a,b,c.value,d);else c instanceof kh||b.add(c,Wh(c.location))}
    oh.prototype.doDeactivate=function(){this.sa=!1;var a=this.g;null!==a&&Yh(a);Zh(this);$h(this,this.Zb);this.Zb=this.xn=null;this.qr=this.yx=!1;if(0<ai.count){for(var b=ai.length,c=0;c<b;c++){var d=ai.ea(c);bi(d);ci(d);Zh(d);null!==d.g&&Yh(d.g)}ai.clear()}bi(this);this.qp.m(NaN,NaN);Sh=Th=null;ci(this);a.cf=!1;a.ec="";a.Nu=!1;this.Nk()};function Zh(a){var b=a.g;if(null!==b){var c=b.wb;b.wb=!0;di(a,b.R,null);b.wb=c}a.Nj.length=0}
    function ni(){var a=Sh;ci(a);Ai(a);var b=a.g;null!==b&&a.qp.I()&&(b.position=a.qp);null!==b&&Yh(b)}oh.prototype.doCancel=function(){ci(this);Ai(this);var a=this.g;null!==a&&this.qp.I()&&(a.position=this.qp);this.stopTool()};function Rh(a,b){if(null!==b){a.Ew=!0;for(var c=b.i;c.next();){var d=c.key;d instanceof W&&(d.jm=!0)}}}function $h(a,b){if(null!==b){for(var c=b.i;c.next();){var d=c.key;d instanceof W&&(d.jm=!1,Bi(d)&&d.$b())}a.Ew=!1}}
    oh.prototype.doKeyDown=function(){var a=this.g;null!==a&&(a=a.R,null!==a&&this.sa&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};oh.prototype.doKeyUp=function(){var a=this.g;null!==a&&null!==a.R&&this.sa&&this.doMouseMove()};function Ci(a,b){for(var c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,h=a.i;h.next();){var k=h.value;if(k.ee()&&k.isVisible()){var l=k.location,k=l.x,l=l.y;isNaN(k)||isNaN(l)||(k<c&&(c=k),l<d&&(d=l),k>e&&(e=k),l>f&&(f=l))}}Infinity===c?b.m(0,0,0,0):b.m(c,d,e-c,f-d)}
    function Di(a,b){if(null===a.dc){var c=a.g;if(!(null===c||b&&(c.hb||c.Cf))&&null!==a.Zb){var d=c.ia;d.isEnabled&&d.vF?null!==d.mj&&0<d.mj.Xf.count&&(c.ia.mq(),c.Hb("Drag")):Ai(a);c.wb=!b;c.Fq=!b;a.Mk=c.Bc.da;d=a.EH?a.Zb.Gj():c.selection;d=c.Kp(d,c,!0);for(c=d.i;c.next();)c.value.location=c.key.location;c=w.Jf();Ci(d,c);w.Db(c);for(var c=new ma(R),e=a.Zb.i;e.next();){var f=e.key;f.ee()&&f.canCopy()&&(f=d.ka(f),null!==f&&(f.Je(),c.add(f,Wh(f.location))))}for(d=d.i;d.next();)e=d.value,e instanceof W&&
    e.canCopy()&&c.add(e,Wh());a.dc=c;Qh(a,c.Gj());null!==a.jd&&(c=a.jd,d=c.Yn,c.Jk(a.Mk.x-(d.x+d.width/2),a.Mk.y-(d.y+d.height/2)))}}}function ci(a){var b=a.g;if(null!==b){if(null!==a.dc&&(b.cB(a.dc.Gj(),!1),a.dc=null,null!==a.Zb))for(var c=a.Zb.i;c.next();)c.key instanceof W&&(c.value.point=new z(0,0));b.wb=!1;b.Fq=!1;a.Mk=b.Bc.da}}function bi(a){if(null!==a.jd){if(a.oj&&null!==a.aj){var b=a.aj;null!==b.g&&(b.g.remove(b.Vd),b.g.remove(b.Wd))}a.jd=null;a.aj=null}}
    function Ei(a,b,c){var d=a.g;if(null!==d){var e=a.Mk,f=w.K();f.assign(d.R.da);a.moveParts(b,f.Ej(e),c);w.v(f)}}
    oh.prototype.moveParts=function(a,b,c){if(null!==a&&(w.G(a,ma,oh,"moveParts:parts"),0!==a.count)){var d=w.K(),e=w.K();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);(b=this.Ew)||Rh(this,a);for(var f=new H(Fi),h=new H(Ca),k=a.i;k.next();){var l=k.key;if(l.ee()){var m=Gi(this,l,a);if(null!==m)f.add(new Fi(l,k.value,m));else if(!c||l.canMove()){m=k.value.point;d.assign(m);var n=new z,p=this.computeMove(l,d.add(e),a,n);l.location=p;k.value.oG=n.Ej(m)}}else k.key instanceof W&&h.add(k.Va)}for(c=f.i;c.next();)f=
        c.value,m=f.info.point,d.assign(m),f.Pc.location=d.add(f.hI.oG);c=w.K();m=w.K();for(h=h.i;h.next();)if(k=h.value,f=k.key,f instanceof W)if(f.jm)l=f.Y,n=f.$,null!==this.jd&&this.oj?(k=k.value.point,a.add(f,Wh(e)),l=e.x-k.x,k=e.y-k.y,f.Jk(l,k)):(null!==l&&(c.assign(l.location),p=a.ka(l),null!==p&&c.Ej(p.point)),null!==n&&(m.assign(n.location),p=a.ka(n),null!==p&&m.Ej(p.point)),null!==l&&null!==n?c.Kc(m)?(k=k.value.point,l=d,l.assign(c),l.Ej(k),a.add(f,Wh(c)),f.Jk(l.x,l.y)):(f.jm=!1,f.$b()):(k=k.value.point,
        n=null!==l?c:null!==n?m:e,a.add(f,Wh(n)),l=n.x-k.x,k=n.y-k.y,f.Jk(l,k)));else if(null===f.Y||null===f.$)k=k.value.point,a.add(f,Wh(e)),l=e.x-k.x,k=e.y-k.y,f.Jk(l,k);w.v(d);w.v(e);w.v(c);w.v(m);b||(Hi(this.g),$h(this,a))}};function Gi(a,b,c){b=b.Da;if(null!==b){a=Gi(a,b,c);if(null!==a)return a;a=c.ka(b);if(null!==a)return a}return null}
    function Ai(a){if(null!==a.Zb){for(var b=a.g,c=a.Zb.i;c.next();){var d=c.key;d.ee()&&(d.location=c.value.point)}for(c=a.Zb.i;c.next();)if(d=c.key,d instanceof W&&d.jm){var e=c.value.point;a.Zb.add(d,Wh());d.Jk(-e.x,-e.y)}b.cg()}}
    oh.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new z);d.assign(b);if(null===a)return d;void 0===c&&(c=null);var e=b;if(this.zx&&(this.wI||null===c||null!==this.g&&this.g.R.up)&&(e=w.K(),c=e,c.assign(b),null!==a)){var f=this.g;if(null!==f){var h=f.Fn,k=this.hF,f=k.width,k=k.height,l=this.gI,m=l.x,l=l.y,n=this.fI;if(null!==h){var p=h.ux;isNaN(f)&&(f=p.width);isNaN(k)&&(k=p.height);h=h.gF;isNaN(m)&&(m=h.x);isNaN(l)&&(l=h.y)}h=w.xb(0,0);h.Lu(0,0,f,k,n);Na(b.x,b.y,m+h.x,l+h.y,f,k,c);w.v(h)}}c=
        null!==a.LE?a.LE(a,b,e):e;k=a.ZI;f=k.x;isNaN(f)&&(f=a.location.x);k=k.y;isNaN(k)&&(k=a.location.y);h=a.TI;m=h.x;isNaN(m)&&(m=a.location.x);h=h.y;isNaN(h)&&(h=a.location.y);d.m(Math.max(f,Math.min(c.x,m)),Math.max(k,Math.min(c.y,h)));e!==b&&w.v(e);return d};function Ii(a,b){if(null===b)return!0;var c=b.U;return null===c||c instanceof kh||c.layer.Mc||a.Zb&&a.Zb.contains(c)||a.dc&&a.dc.contains(c)?!0:!1}
    function Ji(a,b){var c=a.g;if(null!==c){a.oj&&(null!==a.jd&&(a.jd.Y=null,a.jd.$=null),Ki(a,!1));var d=Li(c,b,null,function(b){return!Ii(a,b)}),e=c.R;e.Re=d;var f=c.wb,h=!1;try{c.wb=!0;h=di(a,e,d);if(!a.sa&&null===Sh)return;if(null===d){var k=c.cJ;null!==k&&(k(e),h=!0)}if(!a.sa&&null===Sh)return;a.doDragOver(b,d);if(!a.sa&&null===Sh)return}finally{c.wb=f,h&&c.cg()}(c.oe||c.pe)&&c.jA(e.ef)}}
    function di(a,b,c){var d=!1,e=a.Nj.length,f=0<e?a.Nj[0]:null;if(c===f)return!1;b.Cc=!1;for(var h=0;h<e;h++){var k=a.Nj[h],l=k.bJ;if(null!==l&&(l(b,k,c),d=!0,b.Cc))break}a.Nj.length=0;if(!a.sa&&null===Sh||null===c)return d;for(b.Cc=!1;null!==c;)a.Nj.push(c),c=Mi(c);e=a.Nj.length;for(h=0;h<e&&(k=a.Nj[h],l=k.aJ,null===l||(l(b,k,f),d=!0,!b.Cc));h++);return d}function Mi(a){var b=a.Q;return null!==b?b:a instanceof R&&!(a instanceof V)&&(a=a.Da,null!==a&&a.kI)?a:null}
    function Ni(a,b,c){var d=a.aj;if(null===d)return null;var e=a.g.zn(b,d.TF,function(a){return d.findValidLinkablePort(a,c)});a=w.K();for(var f=Infinity,h=null,e=e.i;e.next();){var k=e.value;if(null!==k.U){var l=k.Wa(Jb,a),l=b.zf(l);l<f&&(h=k,f=l)}}w.v(a);return h}
    function Ki(a,b){var c=a.jd;if(null!==c&&!(2>c.qa)){var d=a.g;if(null!==d&&!d.hb){var e=a.aj;if(null!==e){var f=null,h=null;null===c.Y&&(f=Ni(a,c.l(0),!1),null!==f&&(h=f.U));var k=null,l=null;null===c.$&&(k=Ni(a,c.l(c.qa-1),!0),null!==k&&(l=k.U));e.isValidLink(h,f,l,k)?b?(c.Lp=c.l(0),c.Mp=c.l(c.qa-1),c.jm=!1,c.Y=h,null!==f&&(c.Pg=f.Ud),c.$=l,null!==k&&(c.Hh=k.Ud),c.Lc!==a.gw&&d.Aa("LinkRelinked",c,a.gw),c.ld!==a.hw&&d.Aa("LinkRelinked",c,a.hw)):Oi(e,h,f,l,k):Oi(e,null,null,null,null)}}}}
    oh.prototype.doDragOver=function(){};
    function Pi(a,b){var c=a.g;if(null!==c){a.oj&&Ki(a,!0);Zh(a);var d=Li(c,b,null,function(b){return!Ii(a,b)}),e=c.R;e.Re=d;if(null!==d){e.Cc=!1;for(var f=d;null!==f;){var h=f.PA;if(null!==h&&(h(e,f),e.Cc))break;f=Mi(f)}}else f=c.PA,null!==f&&f(e);if(a.sa||null!==Sh){for(e=(a.dc||a.Zb).i;e.next();)f=e.key,f instanceof T&&f.ge.each(function(a){a.jm=!1});a.doDropOnto(b,d);if(a.sa||null!==Sh){d=w.Jf();for(e=c.selection.i;e.next();)f=e.value,f instanceof T&&Qi(c,f.getAvoidableRect(d));w.Db(d)}}}}
    function Qi(a,b){var c=!1;a.qb.xk(b)&&(c=!0);c=a.nA(b,function(a){return a.U},function(a){return a instanceof W},!0,function(a){return a instanceof W},c);if(0!==c.count)for(c=c.i;c.next();){var d=c.value;d.$l&&d.$b()}}oh.prototype.doDropOnto=function(){};
    oh.prototype.doMouseMove=function(){if(this.sa){var a=this.g;null!==a&&null!==this.xn&&null!==this.Zb&&(this.mayCopy()?(a.ec="copy",Di(this,!1),Rh(this,this.dc),Ei(this,this.dc,!1),$h(this,this.dc)):this.mayMove()?(a.ec="default",ci(this),Ei(this,this.Zb,!0)):this.mayDragOut()?(a.ec="no-drop",Di(this,!1),Ei(this,this.dc,!1)):ci(this),Ji(this,a.R.da))}};
    oh.prototype.doMouseUp=function(){if(this.sa){var a=this.g;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.dc?(ci(this),Di(this,!0),Rh(this,this.dc),Ei(this,this.dc,!1),$h(this,this.dc),null!==this.dc&&a.jG(this.dc.Gj())):(b=!0,ci(this),this.mayMove()&&(Ei(this,this.Zb,!0),Ji(this,a.R.da)));this.qr=!0;Pi(this,a.R.da);if(this.sa){this.dc=null;if(b&&null!==this.Zb)for(b=this.Zb.i;b.next();){var d=b.key;d instanceof T&&(d=d.Da,null===d||null===d.placeholder||this.Zb.contains(d)||d.placeholder.H())}a.sc();
        $h(this,this.Zb);this.Lf=c?"Copy":"Move";a.Aa(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};oh.prototype.mayCopy=function(){if(!this.qF)return!1;var a=this.g;if(null===a||a.hb||a.Cf||!a.Dp||!a.tk||(w.Hk?!a.R.alt:!a.R.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canCopy())return!0}return null!==this.jd&&this.oj&&this.jd.canCopy()?!0:!1};
    oh.prototype.mayDragOut=function(){if(!this.qF)return!1;var a=this.g;if(null===a||!a.Bt||!a.tk||a.Jl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canCopy())return!0}return null!==this.jd&&this.oj&&this.jd.canCopy()?!0:!1};oh.prototype.mayMove=function(){var a=this.g;if(null===a||a.hb||!a.Jl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.ee()&&b.canMove())return!0}return null!==this.jd&&this.oj&&this.jd.canMove()?!0:!1};var ai=new H(oh),Sh=null,Th=null;
    oh.prototype.getDraggingSource=function(){return Sh};oh.prototype.mayDragIn=function(){var a=this.g;if(null===a||!a.pE||a.hb||a.Cf||!a.Dp)return!1;var b=Sh;return null===b||null===b.g||b.g.aa.Ql!==a.aa.Ql?!1:!0};oh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.g;a.Oa.Gh();Ri(a);a.Oa.Gh();a=Sh;null!==a&&null!==a.g&&(a.g.ec="copy")}};oh.prototype.doSimulatedDragLeave=function(){var a=Sh;null!==a&&a.doSimulatedDragOut();this.doCancel()};
    oh.prototype.doSimulatedDragOver=function(){var a=this.g;if(null!==a){var b=Sh;null!==b&&null!==b.Zb&&this.mayDragIn()&&(a.ec="copy",Si(this,b.Zb.Gj(),!1),Ei(this,this.dc,!1),Ji(this,a.R.da))}};
    oh.prototype.doSimulatedDrop=function(){var a=this.g;if(null!==a){var b=Sh;if(null!==b){var c=b.g;b.qr=!0;ci(this);this.mayDragIn()&&(this.Hb("Drop"),Si(this,b.Zb.Gj(),!0),Ei(this,this.dc,!1),null!==this.dc&&a.jG(this.dc.Gj()),Pi(this,a.R.da),a.sc(),b=a.selection,null!==this.dc?this.Lf="ExternalCopy":b=new I(R),this.dc=null,a.doFocus(),a.Aa("ExternalObjectsDropped",b,c),this.Nk())}}};
    function Si(a,b,c){if(null===a.dc){var d=a.g;if(null!==d&&!d.hb&&!d.Cf){d.wb=!c;d.Fq=!c;a.Mk=d.R.da;c=d.Kp(b,d,!0);var e=w.Jf();Ci(b,e);var d=e.x+e.width/2,f=e.y+e.height/2;w.Db(e);var e=a.Bw,h=new ma(R),k=w.K();for(b=b.i;b.next();){var l=b.value,m=c.ka(l);l.ee()&&l.canCopy()?(l=l.location,k.m(e.x-(d-l.x),e.y-(f-l.y)),m.location=k,m.Je(),h.add(m,Wh(k))):l instanceof W&&l.canCopy()&&(m.Jk(e.x-d,e.y-f),h.add(m,Wh()))}w.v(k);a.dc=h;Qh(a,h.Gj());null!==a.jd&&(c=a.jd,d=c.Yn,c.Jk(a.Mk.x-(d.x+d.width/2),
        a.Mk.y-(d.y+d.height/2)))}}}oh.prototype.doSimulatedDragOut=function(){var a=this.g;null!==a&&(this.mayCopy()||this.mayMove()?a.ec="":a.ec="no-drop")};function Xh(a){this.point=a;this.oG=dd}w.ga("DraggingInfo",Xh);function Fi(a,b,c){this.Pc=a;this.info=b;this.hI=c}
    function Ti(){0<arguments.length&&w.kd(Ti);rg.call(this);this.AD=100;this.aD=!1;var a=new W,b=new X;b.pf=!0;b.stroke="blue";a.add(b);b=new X;b.yq="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.ag="Tool";this.VD=a;a=new T;b=new X;b.Ud="";b.Cb="Rectangle";b.fill=null;b.stroke="magenta";b.lb=2;b.Ca=Ad;a.add(b);a.gm=!1;a.ag="Tool";this.TD=a;this.UD=b;a=new T;b=new X;b.Ud="";b.Cb="Rectangle";b.fill=null;b.stroke="magenta";b.lb=2;b.Ca=Ad;a.add(b);a.gm=!1;a.ag="Tool";this.WD=a;this.XD=b;this.yD=this.xD=
        this.tD=this.sD=this.uD=null;this.XC=!0;this.bH=new ma(G,"boolean");this.BD=this.sl=this.QD=null}w.Ka(Ti,rg);w.ga("LinkingBaseTool",Ti);Ti.prototype.doStop=function(){var a=this.g;null!==a&&Yh(a);this.Wg=this.Vg=this.Ug=this.Tg=this.lc=null;this.sy.clear();this.If=null};w.defineProperty(Ti,{TF:"portGravity"},function(){return this.AD},function(a){w.j(a,"number",Ti,"portGravity");0<=a&&(this.AD=a)});
    w.defineProperty(Ti,{aq:"isUnconnectedLinkValid"},function(){return this.aD},function(a){w.j(a,"boolean",Ti,"isUnconnectedLinkValid");this.aD=a});w.defineProperty(Ti,{Zg:"temporaryLink"},function(){return this.VD},function(a){w.G(a,W,Ti,"temporaryLink");this.VD=a});w.defineProperty(Ti,{Vd:"temporaryFromNode"},function(){return this.TD},function(a){w.G(a,T,Ti,"temporaryFromNode");this.TD=a});
    w.defineProperty(Ti,{bo:"temporaryFromPort"},function(){return this.UD},function(a){w.G(a,G,Ti,"temporaryFromPort");this.UD=a});w.defineProperty(Ti,{Wd:"temporaryToNode"},function(){return this.WD},function(a){w.G(a,T,Ti,"temporaryToNode");this.WD=a});w.defineProperty(Ti,{co:"temporaryToPort"},function(){return this.XD},function(a){w.G(a,G,Ti,"temporaryToPort");this.XD=a});w.defineProperty(Ti,{lc:"originalLink"},function(){return this.uD},function(a){null!==a&&w.G(a,W,Ti,"originalLink");this.uD=a});
    w.defineProperty(Ti,{Tg:"originalFromNode"},function(){return this.sD},function(a){null!==a&&w.G(a,T,Ti,"originalFromNode");this.sD=a});w.defineProperty(Ti,{Ug:"originalFromPort"},function(){return this.tD},function(a){null!==a&&w.G(a,G,Ti,"originalFromPort");this.tD=a});w.defineProperty(Ti,{Vg:"originalToNode"},function(){return this.xD},function(a){null!==a&&w.G(a,T,Ti,"originalToNode");this.xD=a});
    w.defineProperty(Ti,{Wg:"originalToPort"},function(){return this.yD},function(a){null!==a&&w.G(a,G,Ti,"originalToPort");this.yD=a});w.defineProperty(Ti,{Rd:"isForwards"},function(){return this.XC},function(a){w.j(a,"boolean",Ti,"isForwards");this.XC=a});w.u(Ti,{sy:"validPortsCache"},function(){return this.bH});w.defineProperty(Ti,{If:"targetPort"},function(){return this.QD},function(a){null!==a&&w.G(a,G,Ti,"targetPort");this.QD=a});
    Ti.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.Ca=b.W.size;e?(d.Bb=b.Bb,d.nm=b.nm):(d.Ab=b.Ab,d.Vl=b.Vl);c.Ff=Jb;var f=w.K();c.location=b.Wa(Jb,f);w.v(f);d.angle=b.Wl();null!==this.Vx&&this.Vx(a,b,c,d,e)}};Ti.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.Ca=Ad,b.Ab=yb,b.Bb=yb);null!==a&&null!==this.g&&(a.location=this.g.R.da);null!==this.Vx&&this.Vx(null,null,a,b,c)};Ti.prototype.doMouseDown=function(){this.sa&&this.doMouseMove()};
    Ti.prototype.doMouseMove=function(){if(this.sa){var a=this.g;if(null!==a){this.If=this.findTargetPort(this.Rd);if(null!==this.If&&this.If.U instanceof T){var b=this.If.U;this.Rd?this.copyPortProperties(b,this.If,this.Wd,this.co,!0):this.copyPortProperties(b,this.If,this.Vd,this.bo,!1)}else this.Rd?this.setNoTargetPortProperties(this.Wd,this.co,!0):this.setNoTargetPortProperties(this.Vd,this.bo,!1);(a.oe||a.pe)&&a.jA(a.R.ef)}}};
    Ti.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.U;if(!(c instanceof T))return null;for(;null!==a;){var d=b?a.wG:a.XE;if(!0===d&&(null!==a.Ud||a instanceof T)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.Q}return null};
    Ti.prototype.findTargetPort=function(a){var b=this.g,c=b.R.da,d=this.TF;0>=d&&(d=.1);for(var e=this,f=b.zn(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,f=f.i;f.next();){var h=f.value,k=h.U;if(k instanceof T){var l=h.Wa(Jb,w.K()),m=c.x-l.x,n=c.y-l.y;w.v(l);l=m*m+n*n;l<d&&(m=this.sy.ka(h),null!==m?m&&(b=h,d=l):a&&this.isValidLink(this.Tg,this.Ug,k,h)||!a&&this.isValidLink(k,h,this.Vg,this.Wg)?(this.sy.add(h,!0),b=h,d=l):this.sy.add(h,!1))}}return null!==b&&(c=b.U,
    c instanceof T&&(null===c.layer||c.layer.Ct))?b:null};Ti.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.aq;if(null!==this.g&&this.g.$a===this&&(null!==a.layer&&!a.layer.Ct||!0!==b.XE))return!1;var c=b.qA;if(Infinity>c){if(null!==this.lc&&a===this.Tg&&b===this.Ug)return!0;var d=b.Ud;null===d&&(d="");if(a.nx(d).count>=c)return!1}return!0};
    Ti.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.aq;if(null!==this.g&&this.g.$a===this&&(null!==a.layer&&!a.layer.Ct||!0!==b.wG))return!1;var c=b.SJ;if(Infinity>c){if(null!==this.lc&&a===this.Vg&&b===this.Wg)return!0;var d=b.Ud;null===d&&(d="");if(a.Og(d).count>=c)return!1}return!0};Ti.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.U,d=b.U;return null!==c&&c===d};
    Ti.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.U;if(!(c instanceof T))return!1;var d=a.Ud;null===d&&(d="");var e=b.U;if(!(e instanceof T))return!1;var f=b.Ud;null===f&&(f="");for(e=e.Og(f);e.next();)if(f=e.value,f.Y===c&&f.Pg===d)return!0;return!1};
    Ti.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.YH&&d.RJ||!this.isInSameNode(b,d))&&(b.XH&&d.QJ||!this.isLinked(b,d)))||null!==this.lc&&(null!==a&&this.isLabelDependentOnLink(a,this.lc)||null!==c&&this.isLabelDependentOnLink(c,this.lc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.lc))return!1;if(null!==a){var e=a.Kx;if(null!==e&&!e(a,b,c,d,this.lc))return!1}if(null!==
        c&&(e=c.Kx,null!==e&&!e(a,b,c,d,this.lc)))return!1;e=this.Kx;return null!==e?e(a,b,c,d,this.lc):!0};Ti.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.Wb;if(null===c)return!1;if(c===b)return!0;var d=new I(T);d.add(a);return Ui(this,c,b,d)};function Ui(a,b,c,d){if(b===c)return!0;var e=b.Y;if(null!==e&&e.Bf&&(d.add(e),Ui(a,e.Wb,c,d)))return!0;b=b.$;return null!==b&&b.Bf&&(d.add(b),Ui(a,b.Wb,c,d))?!0:!1}
    Ti.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.aq;var d=null!==this.g?this.g.YJ:Vi;if(d!==Vi){if(d===Wi){if(null!==c&&!c.Nc)return!0;for(d=b.ge;d.next();){var e=d.value;if(e!==c&&e.Nc&&e.$===b)return!1}return!Xi(this,a,b,c,!0)}if(d===Yi){if(null!==c&&!c.Nc)return!0;for(d=a.ge;d.next();)if(e=d.value,e!==c&&e.Nc&&e.Y===a)return!1;return!Xi(this,a,b,c,!0)}if(d===Zi)return a===b?a=!0:(d=new I(T),d.add(b),a=$i(this,d,a,b,c)),!a;if(d===aj)return!Xi(this,
        a,b,c,!1);if(d===bj)return a===b?a=!0:(d=new I(T),d.add(b),a=cj(this,d,a,b,c)),!a}return!0};function Xi(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var f=b.ge;f.next();){var h=f.value;if(h!==d&&(!e||h.Nc)&&h.$===b&&(h=h.Y,h!==b&&Xi(a,h,c,d,e)))return!0}return!1}function $i(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.ge;f.next();){var h=f.value;if(h!==e&&h.$===c&&(h=h.Y,h!==c&&$i(a,b,h,d,e)))return!0}return!1}
    function cj(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.ge;f.next();){var h=f.value;if(h!==e){var k=h.Y,h=h.$,k=k===c?h:k;if(k!==c&&cj(a,b,k,d,e))return!0}}return!1}w.defineProperty(Ti,{Kx:"linkValidation"},function(){return this.sl},function(a){null!==a&&w.j(a,"function",Ti,"linkValidation");this.sl=a});w.defineProperty(Ti,{Vx:"portTargeted"},function(){return this.BD},function(a){null!==a&&w.j(a,"function",Ti,"portTargeted");this.BD=a});
    function dj(){0<arguments.length&&w.kd(dj);Ti.call(this);this.name="Linking";this.YB={};this.XB=null;this.ba=ej;this.LD=null}w.Ka(dj,Ti);w.ga("LinkingTool",dj);var ej;dj.Either=ej=w.p(dj,"Either",0);var fj;dj.ForwardsOnly=fj=w.p(dj,"ForwardsOnly",0);var gj;dj.BackwardsOnly=gj=w.p(dj,"BackwardsOnly",0);w.defineProperty(dj,{lH:"archetypeLinkData"},function(){return this.YB},function(a){null!==a&&w.G(a,Object,dj,"archetypeLinkData");a instanceof G&&w.G(a,W,dj,"archetypeLinkData");this.YB=a});
    w.defineProperty(dj,{sE:"archetypeLabelNodeData"},function(){return this.XB},function(a){null!==a&&w.G(a,Object,dj,"archetypeLabelNodeData");a instanceof G&&w.G(a,T,dj,"archetypeLabelNodeData");this.XB=a});w.defineProperty(dj,{direction:"direction"},function(){return this.ba},function(a){w.mb(a,dj,dj,"direction");this.ba=a});w.defineProperty(dj,{rG:"startObject"},function(){return this.LD},function(a){null!==a&&w.G(a,G,dj,"startObject");this.LD=a});
    dj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.hb||a.Cf||!a.Ct)return!1;var b=a.aa;return(b instanceof Q||b instanceof $f)&&a.R.left&&(a.$a===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
    dj.prototype.findLinkablePort=function(){var a=this.g;if(null===a)return null;var b=this.rG;null===b&&(b=a.Le(a.Bc.da,null,null));if(null===b||!(b.U instanceof T))return null;a=this.direction;if(a===ej||a===fj){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.Rd=!0,c}if(a===ej||a===gj)if(c=this.findValidLinkablePort(b,!0),null!==c)return this.Rd=!1,c;return null};
    dj.prototype.doActivate=function(){var a=this.g;if(null!==a){var b=this.findLinkablePort();null!==b&&(this.Hb(this.name),a.cf=!0,a.ec="pointer",this.Rd?(null===this.Wd||this.Wd.location.I()||(this.Wd.location=a.R.da),this.Ug=b,b=this.Ug.U,b instanceof T&&(this.Tg=b),this.copyPortProperties(this.Tg,this.Ug,this.Vd,this.bo,!1)):(null===this.Vd||this.Vd.location.I()||(this.Vd.location=a.R.da),this.Wg=b,b=this.Wg.U,b instanceof T&&(this.Vg=b),this.copyPortProperties(this.Vg,this.Wg,this.Wd,this.co,!0)),
        a.add(this.Vd),a.add(this.Wd),null!==this.Zg&&(null!==this.Vd&&(this.Zg.Y=this.Vd),null!==this.Wd&&(this.Zg.$=this.Wd),this.Zg.$b(),a.add(this.Zg)),this.sa=!0)}};dj.prototype.doDeactivate=function(){this.sa=!1;var a=this.g;null!==a&&(a.remove(this.Zg),a.remove(this.Vd),a.remove(this.Wd),a.cf=!1,a.ec="",this.Nk())};dj.prototype.doStop=function(){Ti.prototype.doStop.call(this);this.rG=null};
    dj.prototype.doMouseUp=function(){if(this.sa){var a=this.g;if(null===a)return;var b=this.Lf=null,c=null,d=null,e=null,f=this.If=this.findTargetPort(this.Rd);if(null!==f){var h=f.U;h instanceof T&&(this.Rd?(null!==this.Tg&&(b=this.Tg,c=this.Ug),d=h,e=f):(b=h,c=f,null!==this.Vg&&(d=this.Vg,e=this.Wg)))}else this.Rd?null!==this.Tg&&this.aq&&(b=this.Tg,c=this.Ug):null!==this.Vg&&this.aq&&(d=this.Vg,e=this.Wg);null!==b||null!==d?(h=this.insertLink(b,c,d,e),null!==h?(null===f&&(this.Rd?h.Mp=a.R.da:h.Lp=
        a.R.da),a.yf&&a.select(h),this.Lf=this.name,a.Aa("LinkDrawn",h)):(a.aa.xE(),this.doNoLink(b,c,d,e))):this.Rd?this.doNoLink(this.Tg,this.Ug,null,null):this.doNoLink(null,null,this.Vg,this.Wg)}this.stopTool()};
    dj.prototype.insertLink=function(a,b,c,d){var e=this.g;if(null===e)return null;var f=e.aa;if(f instanceof $f){var h=a;b=c;e.Td||(h=c,b=a);if(null!==h&&null!==b)return f.ti(b.data,f.pb(h.data)),b.An()}else if(f instanceof Q)if(h="",null!==a&&(null===b&&(b=a),h=b.Ud,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.Ud,null===b&&(b="")),d=this.lH,d instanceof W){if(mh(d),f=d.copy(),null!==f)return f.Y=a,f.Pg=h,f.$=c,f.Hh=b,e.add(f),a=this.sE,a instanceof T&&(mh(a),a=a.copy(),null!==a&&(a.Wb=f,e.add(a))),
        f}else if(null!==d&&(d=f.Zw(d),w.Pa(d)))return null!==a&&f.kB(d,f.pb(a.data)),f.lB(d,h),null!==c&&f.qB(d,f.pb(c.data)),f.rB(d,b),f.xt(d),a=this.sE,null===a||a instanceof T||(a=f.copyNodeData(a),w.Pa(a)&&(f.Hl(a),a=f.pb(a),void 0!==a&&f.nE(d,a))),f=e.Yf(d);return null};dj.prototype.doNoLink=function(){};
    function Uh(){0<arguments.length&&w.kd(Uh);Ti.call(this);this.name="Relinking";var a=new X;a.Cb="Diamond";a.Ca=Cd;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Oe=0;this.KC=a;a=new X;a.Cb="Diamond";a.Ca=Cd;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.Oe=-1;this.YD=a;this.hc=null;this.vD=new B}w.Ka(Uh,Ti);w.ga("RelinkingTool",Uh);
    Uh.prototype.updateAdornments=function(a){if(null!==a&&a instanceof W){var b="RelinkFrom",c=null;if(a.ib&&null!==this.g&&!this.g.hb){var d=a.Iu;null!==d&&a.canRelinkFrom()&&a.W.I()&&a.isVisible()&&d.W.I()&&d.xj()&&(c=a.Qp(b),null===c&&(c=this.makeAdornment(d,!1),a.Gl(b,c)))}null===c&&a.Bj(b);b="RelinkTo";c=null;a.ib&&null!==this.g&&!this.g.hb&&(d=a.Iu,null!==d&&a.canRelinkTo()&&a.W.I()&&a.isVisible()&&d.W.I()&&d.xj()&&(c=a.Qp(b),null===c&&(c=this.makeAdornment(d,!0),a.Gl(b,c))));null===c&&a.Bj(b)}};
    Uh.prototype.makeAdornment=function(a,b){var c=new kh;c.type=hj;var d=b?this.PJ:this.WH;null!==d&&c.add(d.copy());c.sb=a;return c};w.defineProperty(Uh,{WH:"fromHandleArchetype"},function(){return this.KC},function(a){null!==a&&w.G(a,G,Uh,"fromHandleArchetype");this.KC=a});w.defineProperty(Uh,{PJ:"toHandleArchetype"},function(){return this.YD},function(a){null!==a&&w.G(a,G,Uh,"toHandleArchetype");this.YD=a});w.u(Uh,{handle:"handle"},function(){return this.hc});
    Uh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.hb||a.Cf||!a.ln)return!1;var b=a.aa;if(!(b instanceof Q||b instanceof $f)||!a.R.left)return!1;b=this.findToolHandleAt(a.Bc.da,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Bc.da,"RelinkTo"));return null!==b};
    Uh.prototype.doActivate=function(){var a=this.g;if(null!==a){if(null===this.lc){var b=this.findToolHandleAt(a.Bc.da,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Bc.da,"RelinkTo"));if(null===b)return;var c=b.U;if(!(c instanceof kh&&c.xf instanceof W))return;this.hc=b;this.Rd=null===c||"RelinkTo"===c.vd;this.lc=c.xf}this.Hb(this.name);a.cf=!0;a.ec="pointer";this.Ug=this.lc.Lc;this.Tg=this.lc.Y;this.Wg=this.lc.ld;this.Vg=this.lc.$;this.vD.set(this.lc.W);null!==this.lc&&0<this.lc.qa&&(null===this.lc.Y&&
    (null!==this.bo&&(this.bo.Ca=rd),null!==this.Vd&&(this.Vd.location=this.lc.l(0))),null===this.lc.$&&(null!==this.co&&(this.co.Ca=rd),null!==this.Wd&&(this.Wd.location=this.lc.l(this.lc.qa-1))));this.copyPortProperties(this.Tg,this.Ug,this.Vd,this.bo,!1);this.copyPortProperties(this.Vg,this.Wg,this.Wd,this.co,!0);a.add(this.Vd);a.add(this.Wd);null!==this.Zg&&(null!==this.Vd&&(this.Zg.Y=this.Vd),null!==this.Wd&&(this.Zg.$=this.Wd),this.copyLinkProperties(this.lc,this.Zg),this.Zg.$b(),a.add(this.Zg));
        this.sa=!0}};Uh.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.zt=a.zt;b.fA=a.fA;var c=a.af;if(c===ij||c===jj)c=kj;b.af=c;b.bx=a.bx;b.gy=a.gy;b.vq=a.vq;b.Ab=a.Ab;b.Vl=a.Vl;b.Wt=a.Wt;b.Xt=a.Xt;b.Bb=a.Bb;b.nm=a.nm;b.Pu=a.Pu;b.Qu=a.Qu}};Uh.prototype.doDeactivate=function(){this.sa=!1;var a=this.g;null!==a&&(a.remove(this.Zg),a.remove(this.Vd),a.remove(this.Wd),a.cf=!1,a.ec="",this.Nk())};Uh.prototype.doStop=function(){Ti.prototype.doStop.call(this);this.hc=null};
    Uh.prototype.doMouseUp=function(){if(this.sa){var a=this.g;if(null===a)return;this.Lf=null;var b=this.Tg,c=this.Ug,d=this.Vg,e=this.Wg,f=this.lc;this.If=this.findTargetPort(this.Rd);if(null!==this.If){var h=this.If.U;h instanceof T&&(this.Rd?(d=h,e=this.If):(b=h,c=this.If))}else this.aq?this.Rd?e=d=null:c=b=null:f=null;null!==f?(this.reconnectLink(f,this.Rd?d:b,this.Rd?e:c,this.Rd),null===this.If&&(this.Rd?f.Mp=a.R.da:f.Lp=a.R.da,f.$b()),a.yf&&(f.ib=!0),this.Lf=this.name,a.Aa("LinkRelinked",f,this.Rd?
        this.Wg:this.Ug)):this.doNoRelink(this.lc,this.Rd);lj(this.lc,this.vD)}this.stopTool()};Uh.prototype.reconnectLink=function(a,b,c,d){if(null===this.g)return!1;c=null!==c&&null!==c.Ud?c.Ud:"";d?(a.$=b,a.Hh=c):(a.Y=b,a.Pg=c);return!0};Uh.prototype.doNoRelink=function(){};function Oi(a,b,c,d,e){null!==a.g&&(null!==b?(a.copyPortProperties(b,c,a.Vd,a.bo,!1),a.g.add(a.Vd)):a.g.remove(a.Vd),null!==d?(a.copyPortProperties(d,e,a.Wd,a.co,!0),a.g.add(a.Wd)):a.g.remove(a.Wd))}
    function mj(){0<arguments.length&&w.kd(mj);rg.call(this);this.name="LinkReshaping";var a=new X;a.Cb="Rectangle";a.Ca=Bd;a.fill="lightblue";a.stroke="dodgerblue";this.fl=a;a=new X;a.Cb="Diamond";a.Ca=Bd;a.fill="lightblue";a.stroke="dodgerblue";this.hD=a;this.CD=3;this.Hy=this.hc=null;this.fp=new z;this.jw=null}w.Ka(mj,rg);w.ga("LinkReshapingTool",mj);var nj;mj.None=nj=w.p(mj,"None",0);var oj;mj.Horizontal=oj=w.p(mj,"Horizontal",1);var Hj;mj.Vertical=Hj=w.p(mj,"Vertical",2);var Ij;
    mj.All=Ij=w.p(mj,"All",3);mj.prototype.getReshapingBehavior=mj.prototype.bF=function(a){return a&&a.Az?a.Az:nj};mj.prototype.setReshapingBehavior=mj.prototype.Ku=function(a,b){w.G(a,G,mj,"setReshapingBehavior:obj");w.mb(b,mj,mj,"setReshapingBehavior:behavior");a.Az=b};
    mj.prototype.updateAdornments=function(a){if(null!==a&&a instanceof W){if(a.ib&&null!==this.g&&!this.g.hb){var b=a.path;if(null!==b&&a.canReshape()&&a.W.I()&&a.isVisible()&&b.W.I()&&b.xj()){var c=a.Qp(this.name);if(null===c||c.pD!==a.qa||c.gE!==a.Eu)c=this.makeAdornment(b),null!==c&&(c.pD=a.qa,c.gE=a.Eu,a.Gl(this.name,c));if(null!==c){c.location=a.position;return}}}a.Bj(this.name)}};
    mj.prototype.makeAdornment=function(a){var b=a.U,c=b.qa,d=b.ac,e=null;if(null!==b.points&&1<c){e=new kh;e.type=hj;var c=b.Qt,f=b.Gx,h=d?1:0;if(b.Eu&&b.af!==Jj)for(var k=c+h;k<f-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.Oe=k,l.hB=.5,l.qA=999,e.add(l))}for(k=c+1;k<f;k++)if(l=this.makeHandle(a,k),null!==l){l.Oe=k;if(k!==c)if(k===c+1&&d){var h=b.l(c),m=b.l(c+1);J(h.x,m.x)&&J(h.y,m.y)&&(m=b.l(c-1));J(h.x,m.x)?(this.Ku(l,Hj),l.cursor="n-resize"):J(h.y,m.y)&&(this.Ku(l,oj),l.cursor="w-resize")}else k===
    f-1&&d?(h=b.l(f-1),m=b.l(f),J(h.x,m.x)&&J(h.y,m.y)&&(h=b.l(f+1)),J(h.x,m.x)?(this.Ku(l,Hj),l.cursor="n-resize"):J(h.y,m.y)&&(this.Ku(l,oj),l.cursor="w-resize")):k!==f&&(this.Ku(l,Ij),l.cursor="move");e.add(l)}e.sb=a}return e};mj.prototype.makeHandle=function(){var a=this.$t;return null===a?null:a.copy()};w.defineProperty(mj,{$t:"handleArchetype"},function(){return this.fl},function(a){null!==a&&w.G(a,G,mj,"handleArchetype");this.fl=a});
    mj.prototype.makeResegmentHandle=function(){var a=this.YI;return null===a?null:a.copy()};w.defineProperty(mj,{YI:"midHandleArchetype"},function(){return this.hD},function(a){null!==a&&w.G(a,G,mj,"midHandleArchetype");this.hD=a});w.u(mj,{handle:"handle"},function(){return this.hc});w.u(mj,{At:"adornedLink"},function(){return this.Hy});mj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.hb&&a.Rw&&a.R.left?null!==this.findToolHandleAt(a.Bc.da,this.name):!1};
    mj.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.hc=this.findToolHandleAt(a.Bc.da,this.name),null!==this.hc)){var b=this.hc.U.xf;if(b instanceof W){this.Hy=b;a.cf=!0;this.Hb(this.name);if(b.Eu&&999===this.hc.qA){var c=b.points.copy(),d=this.hc.Wa(Jb);c.Qd(this.hc.Oe+1,d);b.ac&&c.Qd(this.hc.Oe+1,d);b.points=c;b.de();this.hc=this.findToolHandleAt(a.Bc.da,this.name);if(null===this.hc){this.doDeactivate();return}}this.fp=b.l(this.hc.Oe);this.jw=b.points.copy();this.sa=!0}}};
    mj.prototype.doDeactivate=function(){this.Nk();this.Hy=this.hc=null;var a=this.g;null!==a&&(a.cf=!1);this.sa=!1};mj.prototype.doCancel=function(){var a=this.At;null!==a&&(a.points=this.jw);this.stopTool()};mj.prototype.doMouseMove=function(){var a=this.g;this.sa&&null!==a&&(a=this.computeReshape(a.R.da),this.reshape(a))};
    mj.prototype.doMouseUp=function(){var a=this.g;if(this.sa&&null!==a){var b=this.computeReshape(a.R.da);this.reshape(b);b=this.At;if(null!==b&&b.Eu){var c=this.handle.Oe,d=b.l(c-1),e=b.l(c),f=b.l(c+1);if(b.ac){if(c>b.Qt+1&&c<b.Gx-1){var h=b.l(c-2);if(Math.abs(d.x-e.x)<this.Eh&&Math.abs(d.y-e.y)<this.Eh&&(Kj(this,h,d,e,f,!0)||Kj(this,h,d,e,f,!1))){var k=b.points.copy();Kj(this,h,d,e,f,!0)?(k.kg(c-2,new z(h.x,(f.y+h.y)/2)),k.kg(c+1,new z(f.x,(f.y+h.y)/2))):(k.kg(c-2,new z((f.x+h.x)/2,h.y)),k.kg(c+1,
        new z((f.x+h.x)/2,f.y)));k.bd(c);k.bd(c-1);b.points=k;b.de()}else h=b.l(c+2),Math.abs(e.x-f.x)<this.Eh&&Math.abs(e.y-f.y)<this.Eh&&(Kj(this,d,e,f,h,!0)||Kj(this,d,e,f,h,!1))&&(k=b.points.copy(),Kj(this,d,e,f,h,!0)?(k.kg(c-1,new z(d.x,(d.y+h.y)/2)),k.kg(c+2,new z(h.x,(d.y+h.y)/2))):(k.kg(c-1,new z((d.x+h.x)/2,d.y)),k.kg(c+2,new z((d.x+h.x)/2,h.y))),k.bd(c+1),k.bd(c),b.points=k,b.de())}}else h=w.K(),La(d.x,d.y,f.x,f.y,e.x,e.y,h)&&h.zf(e)<this.Eh*this.Eh&&(k=b.points.copy(),k.bd(c),b.points=k,b.de()),
        w.v(h)}a.sc();this.Lf=this.name;a.Aa("LinkReshaped",this.At,this.jw)}this.stopTool()};function Kj(a,b,c,d,e,f){return f?Math.abs(b.y-c.y)<a.Eh&&Math.abs(c.y-d.y)<a.Eh&&Math.abs(d.y-e.y)<a.Eh:Math.abs(b.x-c.x)<a.Eh&&Math.abs(c.x-d.x)<a.Eh&&Math.abs(d.x-e.x)<a.Eh}w.defineProperty(mj,{Eh:"resegmentingDistance"},function(){return this.CD},function(a){w.j(a,"number",mj,"resegmentingDistance");this.CD=a});
    mj.prototype.reshape=function(a){var b=this.At;b.im();var c=this.handle.Oe,d=this.bF(this.handle);if(b.ac)if(c===b.Qt+1)c=b.Qt+1,d===Hj?(b.ca(c,b.l(c-1).x,a.y),b.ca(c+1,b.l(c+2).x,a.y)):d===oj&&(b.ca(c,a.x,b.l(c-1).y),b.ca(c+1,a.x,b.l(c+2).y));else if(c===b.Gx-1)c=b.Gx-1,d===Hj?(b.ca(c-1,b.l(c-2).x,a.y),b.ca(c,b.l(c+1).x,a.y)):d===oj&&(b.ca(c-1,a.x,b.l(c-2).y),b.ca(c,a.x,b.l(c+1).y));else{var d=c,e=b.l(d),f=b.l(d-1),h=b.l(d+1);J(f.x,e.x)&&J(e.y,h.y)?(J(f.x,b.l(d-2).x)&&!J(f.y,b.l(d-2).y)?(b.w(d,a.x,
        f.y),c++,d++):b.ca(d-1,a.x,f.y),J(h.y,b.l(d+2).y)&&!J(h.x,b.l(d+2).x)?b.w(d+1,h.x,a.y):b.ca(d+1,h.x,a.y)):J(f.y,e.y)&&J(e.x,h.x)?(J(f.y,b.l(d-2).y)&&!J(f.x,b.l(d-2).x)?(b.w(d,f.x,a.y),c++,d++):b.ca(d-1,f.x,a.y),J(h.x,b.l(d+2).x)&&!J(h.y,b.l(d+2).y)?b.w(d+1,a.x,h.y):b.ca(d+1,a.x,h.y)):J(f.x,e.x)&&J(e.x,h.x)?(J(f.x,b.l(d-2).x)&&!J(f.y,b.l(d-2).y)?(b.w(d,a.x,f.y),c++,d++):b.ca(d-1,a.x,f.y),J(h.x,b.l(d+2).x)&&!J(h.y,b.l(d+2).y)?b.w(d+1,a.x,h.y):b.ca(d+1,a.x,h.y)):J(f.y,e.y)&&J(e.y,h.y)&&(J(f.y,b.l(d-
            2).y)&&!J(f.x,b.l(d-2).x)?(b.w(d,f.x,a.y),c++,d++):b.ca(d-1,f.x,a.y),J(h.y,b.l(d+2).y)&&!J(h.x,b.l(d+2).x)?b.w(d+1,h.x,a.y):b.ca(d+1,h.x,a.y));b.ca(c,a.x,a.y)}else b.ca(c,a.x,a.y),e=b.Y,f=b.Lc,null!==e&&(d=e.findVisibleNode(),null!==d&&d!==e&&(e=d,f=e.port)),1===c&&b.computeSpot(!0,f).Sd()&&(d=f.Wa(Jb,w.K()),e=b.getLinkPointFromPoint(e,f,d,a,!0,w.K()),b.ca(0,e.x,e.y),w.v(d),w.v(e)),e=b.$,f=b.ld,null!==e&&(d=e.findVisibleNode(),null!==d&&d!==e&&(e=d,f=e.port)),c===b.qa-2&&b.computeSpot(!1,f).Sd()&&
    (d=f.Wa(Jb,w.K()),e=b.getLinkPointFromPoint(e,f,d,a,!1,w.K()),b.ca(b.qa-1,e.x,e.y),w.v(d),w.v(e));b.kj()};mj.prototype.computeReshape=function(a){var b=this.At,c=this.handle.Oe;switch(this.bF(this.handle)){case Ij:return a;case Hj:return b=b.l(c),new z(b.x,a.y);case oj:return b=b.l(c),new z(a.x,b.y);default:case nj:return b.l(c)}};w.u(mj,{AL:"originalPoint"},function(){return this.fp});w.u(mj,{BL:"originalPoints"},function(){return this.jw});
    function Lj(){0<arguments.length&&w.kd(Lj);rg.call(this);this.name="Resizing";this.Yh=(new ia(1,1)).freeze();this.Xh=(new ia(9999,9999)).freeze();this.Kj=(new ia(NaN,NaN)).freeze();this.Kr=!1;this.Fc=null;var a=new X;a.qh=Jb;a.Cb="Rectangle";a.Ca=Bd;a.fill="lightblue";a.stroke="dodgerblue";a.lb=1;a.cursor="pointer";this.fl=a;this.hc=null;this.fp=new z;this.rD=new ia;this.wD=new z;this.dz=new ia(0,0);this.cz=new ia(Infinity,Infinity);this.bz=new ia(1,1);this.oD=!0}w.Ka(Lj,rg);w.ga("ResizingTool",Lj);
    Lj.prototype.updateAdornments=function(a){if(!(null===a||a instanceof W)){if(a.ib&&null!==this.g&&!this.g.hb){var b=a.cG;if(null!==b&&a.canResize()&&a.W.I()&&a.isVisible()&&b.W.I()&&b.xj()){var c=a.Qp(this.name);if(null===c||c.sb!==b)c=this.makeAdornment(b);if(null!==c){var d=b.Wl();c.angle=d;var e=b.Wa(c.Ff,w.K()),f=b.pj();c.location=e;w.v(e);e=c.placeholder;if(null!==e){var b=b.Ja,h=w.mm();h.m(b.width*f,b.height*f);e.Ca=h;w.Ck(h)}this.updateResizeHandles(c,d);a.Gl(this.name,c);return}}}a.Bj(this.name)}};
    Lj.prototype.makeAdornment=function(a){var b=null,b=a.U.bG;if(null===b){b=new kh;b.type=Mj;b.Ff=Jb;var c=new Nj;c.pf=!0;b.add(c);b.add(this.makeHandle(a,Ab));b.add(this.makeHandle(a,Gb));b.add(this.makeHandle(a,Sb));b.add(this.makeHandle(a,Qb));b.add(this.makeHandle(a,Gc));b.add(this.makeHandle(a,Ic));b.add(this.makeHandle(a,Jc));b.add(this.makeHandle(a,Hc))}else if(mh(b),b=b.copy(),null===b)return null;b.sb=a;return b};
    Lj.prototype.makeHandle=function(a,b){var c=this.$t;if(null===c)return null;c=c.copy();c.alignment=b;return c};
    Lj.prototype.updateResizeHandles=function(a,b){if(null!==a)if(!a.alignment.Xc()&&("pointer"===a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.Sd()&&(c=Jb);var d=b;if(0>=c.x)d=0>=c.y?d+225:1<=c.y?d+135:d+180;else if(1<=c.x)0>=c.y?d+=315:1<=c.y&&(d+=45);else if(0>=c.y)d+=270;else if(1<=c.y)d+=90;else break a;0>d?d+=360:360<=d&&(d-=360);a.cursor=22.5>d?"e-resize":67.5>d?"se-resize":112.5>d?"s-resize":157.5>d?"sw-resize":202.5>d?"w-resize":247.5>d?"nw-resize":292.5>d?"n-resize":337.5>d?
        "ne-resize":"e-resize"}else if(a instanceof C)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};w.defineProperty(Lj,{$t:"handleArchetype"},function(){return this.fl},function(a){null!==a&&w.G(a,G,Lj,"handleArchetype");this.fl=a});w.u(Lj,{handle:"handle"},function(){return this.hc});w.defineProperty(Lj,{sb:"adornedObject"},function(){return this.Fc},function(a){null!==a&&w.G(a,G,Lj,"adornedObject");this.Fc=a});
    Lj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.hb&&a.Dt&&a.R.left?null!==this.findToolHandleAt(a.Bc.da,this.name):!1};
    Lj.prototype.doActivate=function(){var a=this.g;null!==a&&(this.hc=this.findToolHandleAt(a.Bc.da,this.name),null!==this.hc&&(this.Fc=this.hc.U.sb,this.fp.set(this.sb.Wa(this.handle.alignment.OF())),this.wD.set(this.Fc.U.location),this.rD.set(this.Fc.Ca),this.bz=this.computeCellSize(),this.dz=this.computeMinSize(),this.cz=this.computeMaxSize(),a.cf=!0,this.oD=a.Oa.isEnabled,a.Oa.isEnabled=!1,this.Hb(this.name),this.sa=!0))};
    Lj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Nk(),this.Fc=this.hc=null,this.sa=a.cf=!1,a.Oa.isEnabled=this.oD)};Lj.prototype.doCancel=function(){null!==this.sb&&(this.sb.Ca=this.PF,this.sb.U.location=this.hJ);this.stopTool()};Lj.prototype.doMouseMove=function(){var a=this.g;if(this.sa&&null!==a){var b=this.dz,c=this.cz,d=this.bz,e=this.sb.$E(a.R.da,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);a.cg();w.v(e)}};
    Lj.prototype.doMouseUp=function(){var a=this.g;if(this.sa&&null!==a){var b=this.dz,c=this.cz,d=this.bz,e=this.sb.$E(a.R.da,w.K()),f=this.computeReshape(),b=this.computeResize(e,this.handle.alignment,b,c,d,f);this.resize(b);w.v(e);a.sc();this.Lf=this.name;a.Aa("PartResized",this.sb,this.PF)}this.stopTool()};
    Lj.prototype.resize=function(a){var b=this.g;if(null!==b){var c=this.sb,d=c.U;c.Ca=a.size;d.Je();a=this.sb.Wa(this.handle.alignment.OF());d instanceof V?(c=new H(R),c.add(d),b.moveParts(c,this.fp.copy().Ej(a),!0)):d.location=d.location.copy().Ej(a).add(this.fp)}};
    Lj.prototype.computeResize=function(a,b,c,d,e,f){b.Sd()&&(b=Jb);var h=this.sb.Ja,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!f){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=w.K();Na(a.x,a.y,k,l,e.width,e.height,q);a=h.copy();0>=b.x?0>=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):(a.width=
        a.height/p,a.x=m-a.width))):1<=b.y?(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=Math.max(m-a.x,c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,p<b?a.height=p*a.width:(a.width=a.height/p,a.x=m-a.width))):(a.x=Math.max(q.x,m-d.width),a.x=Math.min(a.x,m-c.width),a.width=m-a.x,f||(a.height=p*a.width,a.y=l+.5*(n-l-a.height))):1<=b.x?0>=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),
        a.height=Math.max(n-a.y,c.height),f||(b=a.height/a.width,p<b?(a.height=p*a.width,a.y=n-a.height):a.width=a.height/p)):1<=b.y?(a.width=Math.max(Math.min(q.x-k,d.width),c.width),a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(b=a.height/a.width,p<b?a.height=p*a.width:a.width=a.height/p)):(a.width=Math.max(Math.min(q.x-k,d.width),c.width),f||(a.height=p*a.width,a.y=l+.5*(n-l-a.height))):0>=b.y?(a.y=Math.max(q.y,n-d.height),a.y=Math.min(a.y,n-c.height),a.height=n-a.y,f||(a.width=a.height/p,a.x=
        k+.5*(m-k-a.width))):1<=b.y&&(a.height=Math.max(Math.min(q.y-l,d.height),c.height),f||(a.width=a.height/p,a.x=k+.5*(m-k-a.width)));w.v(q);return a};Lj.prototype.computeReshape=function(){var a=Oj;this.sb instanceof X&&(a=Pj(this.sb));return!(a===Qj||a===Rj||null!==this.g&&this.g.R.shift)};Lj.prototype.computeMinSize=function(){var a=this.sb.si.copy(),b=this.si;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};
    Lj.prototype.computeMaxSize=function(){var a=this.sb.Gf.copy(),b=this.Gf;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
    Lj.prototype.computeCellSize=function(){var a=new ia(NaN,NaN),b=this.sb.U;if(null!==b){var c=b.sJ;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.Fp;isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width);isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.height);b=this.g;(isNaN(a.width)||isNaN(a.height))&&b&&(c=b.eb.te,null!==c&&c.zx&&(c=c.hF,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&
    0<c.height&&(a.height=c.height)),b=b.Fn,null!==b&&b.visible&&this.zx&&(c=b.ux,isNaN(a.width)&&!isNaN(c.width)&&0<c.width&&(a.width=c.width),isNaN(a.height)&&!isNaN(c.height)&&0<c.height&&(a.height=c.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};
    w.defineProperty(Lj,{si:"minSize"},function(){return this.Yh},function(a){w.G(a,ia,Lj,"minSize");if(!this.Yh.L(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.Yh.m(b,a)}});w.defineProperty(Lj,{Gf:"maxSize"},function(){return this.Xh},function(a){w.G(a,ia,Lj,"maxSize");if(!this.Xh.L(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.Xh.m(b,a)}});
    w.defineProperty(Lj,{Fp:"cellSize"},function(){return this.Kj},function(a){w.G(a,ia,Lj,"cellSize");this.Kj.L(a)||this.Kj.assign(a)});w.defineProperty(Lj,{zx:"isGridSnapEnabled"},function(){return this.Kr},function(a){w.j(a,"boolean",Lj,"isGridSnapEnabled");this.Kr=a});w.u(Lj,{PF:"originalDesiredSize"},function(){return this.rD});w.u(Lj,{hJ:"originalLocation"},function(){return this.wD});
    function Sj(){0<arguments.length&&w.kd(Sj);rg.call(this);this.name="Rotating";this.JD=45;this.HD=2;this.Fc=null;var a=new X;a.Cb="Ellipse";a.Ca=Cd;a.fill="lightblue";a.stroke="dodgerblue";a.lb=1;a.cursor="pointer";this.fl=a;this.hc=null;this.iw=0;this.DD=new z}w.Ka(Sj,rg);w.ga("RotatingTool",Sj);
    Sj.prototype.updateAdornments=function(a){if(null!==a){if(a instanceof W){var b=a.eB;if(b===a||b===a.path||b.pf)return}if(a.ib&&null!==this.g&&!this.g.hb&&(b=a.eB,null!==b&&a.canRotate()&&a.W.I()&&a.isVisible()&&b.W.I()&&b.xj())){var c=a.Qp(this.name);if(null===c||c.sb!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.Wl();var d=null,e=null;b===a||b===a.bg?(d=a.bg,e=a.Ff):(d=b,e=Jb);for(var f=d.Ja,e=w.xb(f.width*e.x+e.offsetX,f.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.nb(e),d=d.Q;var d=
        e.y,f=Math.max(e.x-b.Ja.width,0),h=w.K();c.location=b.Wa(new L(1,0,50+f,d),h);w.v(h);w.v(e);a.Gl(this.name,c);return}}a.Bj(this.name)}};Sj.prototype.makeAdornment=function(a){var b=null,b=a.U.vJ;if(null===b){b=new kh;b.type=Tj;b.Ff=Jb;var c=this.$t;null!==c&&b.add(c.copy())}else if(mh(b),b=b.copy(),null===b)return null;b.sb=a;return b};w.defineProperty(Sj,{$t:"handleArchetype"},function(){return this.fl},function(a){null!==a&&w.G(a,G,Sj,"handleArchetype");this.fl=a});w.u(Sj,{handle:"handle"},function(){return this.hc});
    w.defineProperty(Sj,{sb:"adornedObject"},function(){return this.Fc},function(a){null!==a&&w.G(a,G,Sj,"adornedObject");this.Fc=a});Sj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null!==a&&!a.hb&&a.Sw&&a.R.left?null!==this.findToolHandleAt(a.Bc.da,this.name):!1};
    Sj.prototype.doActivate=function(){var a=this.g;if(null!==a&&(this.hc=this.findToolHandleAt(a.Bc.da,this.name),null!==this.hc)){this.Fc=this.hc.U.sb;var b=this.Fc.U,c=b.bg;this.DD=this.Fc===b||this.Fc===c?c.Wa(b.Ff):this.Fc.Wa(Jb);this.iw=this.Fc.angle;a.cf=!0;a.hA=!0;this.Hb(this.name);this.sa=!0}};Sj.prototype.doDeactivate=function(){var a=this.g;null!==a&&(this.Nk(),this.Fc=this.hc=null,this.sa=a.cf=!1)};Sj.prototype.doCancel=function(){var a=this.g;null!==a&&(a.hA=!1);this.rotate(this.iw);this.stopTool()};
    Sj.prototype.doMouseMove=function(){var a=this.g;this.sa&&null!==a&&(a=this.computeRotate(a.R.da),this.rotate(a))};Sj.prototype.doMouseUp=function(){var a=this.g;if(this.sa&&null!==a){a.hA=!1;var b=this.computeRotate(a.R.da);this.rotate(b);a.sc();this.Lf=this.name;a.Aa("PartRotated",this.Fc,this.iw)}this.stopTool()};Sj.prototype.rotate=function(a){null!==this.Fc&&(this.Fc.angle=a)};
    Sj.prototype.computeRotate=function(a){a=this.DD.Pb(a);var b=this.Fc.Q;null!==b&&(a-=b.Wl(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.IJ),180),c=Math.min(Math.abs(this.HJ),b/2);(null===this.g||!this.g.R.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};w.defineProperty(Sj,{IJ:"snapAngleMultiple"},function(){return this.JD},function(a){w.j(a,"number",Sj,"snapAngleMultiple");this.JD=a});
    w.defineProperty(Sj,{HJ:"snapAngleEpsilon"},function(){return this.HD},function(a){w.j(a,"number",Sj,"snapAngleEpsilon");this.HD=a});w.u(Sj,{zL:"originalAngle"},function(){return this.iw});function Uj(){rg.call(this);0<arguments.length&&w.kd(Uj);this.name="ClickSelecting"}w.Ka(Uj,rg);w.ga("ClickSelectingTool",Uj);Uj.prototype.canStart=function(){return!this.isEnabled||null===this.g||this.isBeyondDragSize()?!1:!0};
    Uj.prototype.doMouseUp=function(){this.sa&&(this.standardMouseSelect(),!this.standardMouseClick()&&null!==this.g&&this.g.R.vj&&this.g.eb.doToolTip());this.stopTool()};function Vj(){rg.call(this);0<arguments.length&&w.kd(Vj);this.name="Action";this.ko=null}w.Ka(Vj,rg);w.ga("ActionTool",Vj);
    Vj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a)return!1;var b=a.R,c=a.Le(b.da,function(a){for(;null!==a.Q&&!a.wx;)a=a.Q;return a});if(null!==c){if(!c.wx)return!1;this.ko=c;a.wo=a.Le(b.da,null,null);return!0}return!1};Vj.prototype.doMouseDown=function(){if(this.sa){var a=this.g.R,b=this.ko;null!==b&&(a.Re=b,null!==b.jE&&b.jE(a,b))}else this.canStart()&&this.doActivate()};
    Vj.prototype.doMouseMove=function(){if(this.sa){var a=this.g.R,b=this.ko;null!==b&&(a.Re=b,null!==b.kE&&b.kE(a,b))}};Vj.prototype.doMouseUp=function(){if(this.sa){var a=this.g,b=a.R,c=this.ko;if(null===c)return;b.Re=c;null!==c.lE&&c.lE(b,c);this.isBeyondDragSize()||Nh(c,b,a)}this.stopTool()};Vj.prototype.doCancel=function(){var a=this.g;if(null!==a){var a=a.R,b=this.ko;if(null===b)return;a.Re=b;null!==b.iE&&b.iE(a,b)}this.stopTool()};Vj.prototype.doStop=function(){this.ko=null};
    function Wj(){rg.call(this);0<arguments.length&&w.kd(Wj);this.name="ClickCreating";this.vm=null;this.VC=!0;this.JC=new z(0,0)}w.Ka(Wj,rg);w.ga("ClickCreatingTool",Wj);
    Wj.prototype.canStart=function(){if(!this.isEnabled||null===this.Vz)return!1;var a=this.g;if(null===a||a.hb||a.Cf||!a.Dp||!a.R.left||this.isBeyondDragSize())return!1;if(this.vI){if(1===a.R.Ge&&(this.JC=a.R.ef.copy()),2!==a.R.Ge||this.isBeyondDragSize(this.JC))return!1}else if(1!==a.R.Ge)return!1;return a.$a!==this&&null!==a.Pt(a.R.da,!0)?!1:!0};Wj.prototype.doMouseUp=function(){var a=this.g;this.sa&&null!==a&&this.insertPart(a.R.da);this.stopTool()};
    Wj.prototype.insertPart=function(a){var b=this.g;if(null===b)return null;var c=this.Vz;if(null===c)return null;this.Hb(this.name);var d=null;c instanceof R?c.ee()&&(mh(c),d=c.copy(),null!==d&&b.add(d)):null!==c&&(c=b.aa.copyNodeData(c),w.Pa(c)&&(b.aa.Hl(c),d=b.xh(c)));null!==d&&(d.location=a,b.yf&&b.select(d));b.sc();this.Lf=this.name;b.Aa("PartCreated",d);this.Nk();return d};
    w.defineProperty(Wj,{Vz:"archetypeNodeData"},function(){return this.vm},function(a){null!==a&&w.G(a,Object,Wj,"archetypeNodeData");this.vm=a});w.defineProperty(Wj,{vI:"isDoubleClick"},function(){return this.VC},function(a){w.j(a,"boolean",Wj,"isDoubleClick");this.VC=a});function Xj(){this.dE=this.fD=this.kz=this.Gz=null}w.ga("HTMLInfo",Xj);w.defineProperty(Xj,{LA:"mainElement"},function(){return this.fD},function(a){null!==a&&w.G(a,HTMLElement,Xj,"mainElement");this.fD=a});
    w.defineProperty(Xj,{show:"show"},function(){return this.Gz},function(a){this.Gz!==a&&(null!==a&&w.j(a,"function",Xj,"show"),this.Gz=a)});w.defineProperty(Xj,{Gn:"hide"},function(){return this.kz},function(a){this.kz!==a&&(null!==a&&w.j(a,"function",Xj,"hide"),this.kz=a)});w.defineProperty(Xj,{GB:"valueFunction"},function(){return this.dE},function(a){this.dE=a});function Yj(a,b,c){this.text=a;this.zE=b;this.visible=c}
    function Zj(){rg.call(this);0<arguments.length&&w.kd(Zj);this.name="ContextMenu";this.oC=this.Oy=this.lC=null;this.lD=new z;this.Qy=this.Bm=null;var a=this;this.Nz=function(){a.stopTool()};ak(this)}w.Ka(Zj,rg);w.ga("ContextMenuTool",Zj);
    function ak(a){var b=new Xj;b.show=function(a,b,c){c.showDefaultContextMenu()};b.Gn=function(a,b){b.hideDefaultContextMenu()};a.Bm=b;a.Nz=function(){a.stopTool()};if(!1===w.FE){var b=w.createElement("div"),c=w.createElement("div");b.style.cssText="top: 0px;z-index:300;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:299;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;opacity: 0.8;";
        var d=w.createElement("style");window.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);b.addEventListener("contextmenu",bk,!1);b.addEventListener("selectstart",bk,!1);
        c.addEventListener("contextmenu",bk,!1);window.document.body&&(window.document.body.appendChild(b),window.document.body.appendChild(c));w.Gt=b;w.Ft=c;w.FE=!0}}function bk(a){a.preventDefault();return!1}Zj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null===a||this.isBeyondDragSize()||!a.R.right?!1:null!==this.Bm&&a.R.vj||null!==this.findObjectWithContextMenu()?!0:!1};Zj.prototype.doStart=function(){var a=this.g;null!==a&&this.lD.set(a.Bc.da)};
    Zj.prototype.doStop=function(){this.hideContextMenu();this.ax=null};Zj.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.g;if(null===b)return null;var c=b.R,d=null;a instanceof D||(d=a instanceof G?a:b.Le(c.da,null,function(a){return!a.layer.Mc}));if(null!==d){for(a=d;null!==a;){if(null!==a.contextMenu)return a;a=a.Q}if(null!==this.Bm&&b.R.vj)return d.U}else if(null!==b.contextMenu)return b;return null};Zj.prototype.doActivate=function(){};
    Zj.prototype.doMouseDown=function(){rg.prototype.doMouseDown.call(this);null!==this.g&&this.g.eb.df.contains(this)&&ck(this)};Zj.prototype.doMouseUp=function(){ck(this)};function ck(a){var b=a.g;if(null!==b)if(a.sa){var c=a.Ol;if(null!==c){if(!(c instanceof Xj)){var d=b.Le(b.R.da,null,null);null!==d&&d.bm(c)&&a.standardMouseClick(null,null)}a.stopTool();a.canStart()&&(b.$a=a,a.doMouseUp())}}else a.canStart()&&(Mh(a,!0),a.sa||a.stopTool())}
    function Mh(a,b,c){void 0===c&&(c=null);b&&a.standardMouseSelect();if(!a.standardMouseClick())if(a.sa=!0,b=a.Bm,null===c&&(c=a.findObjectWithContextMenu()),null!==c){var d=c.contextMenu;null!==d?(a.ax=c instanceof G?c:null,a.showContextMenu(d,a.ax)):null!==b&&a.showContextMenu(b,a.ax)}else null!==b&&a.showContextMenu(b,null)}Zj.prototype.doMouseMove=function(){this.sa&&null!==this.g&&this.g.eb.doMouseMove()};
    Zj.prototype.showContextMenu=function(a,b){null!==b&&w.G(b,G,Zj,"showContextMenu:obj");var c=this.g;if(null!==c){a!==this.Ol&&this.hideContextMenu();if(a instanceof kh){a.ag="Tool";a.gm=!1;a.scale=1/c.scale;a.vd=this.name;null!==a.placeholder&&(a.placeholder.scale=c.scale);c.add(a);if(null!==b){var c=null,d=b.Ul();null!==d&&(c=d.data);a.sb=b;a.data=c}else a.data=c.aa;a.Je();this.positionContextMenu(a,b)}else a instanceof Xj&&a.show(b,c,this);this.Ol=a}};
    Zj.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.g;if(null!==b){var c=b.R.da.copy(),d=a.za,e=b.qb;b.R.vj&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y+d.height>e.bottom&&(c.y-=d.height+5);c.y<e.y&&(c.y=e.y);a.position=c}}};
    Zj.prototype.hideContextMenu=function(){var a=this.g;if(null!==a){var b=this.Ol;null!==b&&(b instanceof kh?(a.remove(b),null!==this.Oy&&this.Oy.Bj(b.vd),b.data=null,b.sb=null):b instanceof Xj&&(null!==b.Gn?b.Gn(a,this):null!==b.LA&&(b.LA.style.display="none")),this.Ol=null,this.standardMouseOver())}};
    function dk(a){if(null===a.g)return null;a=new H(Yj);a.add(new Yj("Copy",function(a){a.ob.copySelection()},function(a){return a.ob.canCopySelection()}));a.add(new Yj("Cut",function(a){a.ob.cutSelection()},function(a){return a.ob.canCutSelection()}));a.add(new Yj("Delete",function(a){a.ob.deleteSelection()},function(a){return a.ob.canDeleteSelection()}));a.add(new Yj("Paste",function(a){a.ob.pasteSelection(a.R.da)},function(a){return a.ob.canPasteSelection()}));a.add(new Yj("Select All",function(a){a.ob.selectAll()},
        function(a){return a.ob.canSelectAll()}));a.add(new Yj("Undo",function(a){a.ob.undo()},function(a){return a.ob.canUndo()}));a.add(new Yj("Redo",function(a){a.ob.redo()},function(a){return a.ob.canRedo()}));a.add(new Yj("Scroll To Part",function(a){a.ob.scrollToPart()},function(a){return a.ob.canScrollToPart()}));a.add(new Yj("Zoom To Fit",function(a){a.ob.zoomToFit()},function(a){return a.ob.canZoomToFit()}));a.add(new Yj("Reset Zoom",function(a){a.ob.resetZoom()},function(a){return a.ob.canResetZoom()}));
        a.add(new Yj("Group Selection",function(a){a.ob.groupSelection()},function(a){return a.ob.canGroupSelection()}));a.add(new Yj("Ungroup Selection",function(a){a.ob.ungroupSelection()},function(a){return a.ob.canUngroupSelection()}));a.add(new Yj("Edit Text",function(a){a.ob.editTextBlock()},function(a){return a.ob.canEditTextBlock()}));return a}
    Zj.prototype.showDefaultContextMenu=function(){var a=this.g;if(null!==a){null===this.Qy&&(this.Qy=dk(this));w.Gt.innerHTML="";w.Ft.addEventListener("click",this.Nz,!1);var b=this,c=w.createElement("ul");c.className="goCXul";w.Gt.appendChild(c);c.innerHTML="";for(var d=this.Qy.i;d.next();){var e=d.value,f=e.visible;if("function"===typeof e.zE&&("function"!==typeof f||f(a))){f=w.createElement("li");f.className="goCXli";var h=w.createElement("a");h.className="goCXa";h.href="#";h.MG=e.zE;h.addEventListener("click",
        function(c){this.MG(a);b.stopTool();c.preventDefault();return!1},!1);h.textContent=e.text;f.appendChild(h);c.appendChild(f)}}w.Gt.style.display="block";w.Ft.style.display="block"}};Zj.prototype.hideDefaultContextMenu=function(){null!==this.Ol&&this.Ol===this.Bm&&(w.Gt.style.display="none",w.Ft.style.display="none",w.Ft.removeEventListener("click",this.Nz,!1),this.Ol=null)};w.defineProperty(Zj,{Ol:"currentContextMenu"},function(){return this.lC},function(a){this.lC=a;this.Oy=a instanceof kh?a.xf:null});
    w.defineProperty(Zj,{VK:"defaultTouchContextMenu"},function(){return this.Bm},function(a){this.Bm=a});w.defineProperty(Zj,{ax:"currentObject"},function(){return this.oC},function(a){null!==a&&w.G(a,G,Zj,"currentObject");this.oC=a});w.u(Zj,{vL:"mouseDownPoint"},function(){return this.lD});
    function ek(){rg.call(this);0<arguments.length&&w.kd(ek);this.name="DragSelecting";this.Co=175;this.$C=!1;var a=new R;a.ag="Tool";a.gm=!1;var b=new X;b.name="SHAPE";b.Cb="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.xm=a}w.Ka(ek,rg);w.ga("DragSelectingTool",ek);
    ek.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.yf)return!1;var b=a.R;return!b.left||a.$a!==this&&(!this.isBeyondDragSize()||b.timestamp-a.Bc.timestamp<this.GE||null!==a.Pt(b.da,!0))?!1:!0};ek.prototype.doActivate=function(){var a=this.g;null!==a&&(this.sa=!0,a.cf=!0,a.wb=!0,a.add(this.th),this.doMouseMove())};ek.prototype.doDeactivate=function(){var a=this.g;null!==a&&(Yh(a),a.remove(this.th),a.wb=!1,this.sa=a.cf=!1)};
    ek.prototype.doMouseMove=function(){var a=this.g;if(null!==a&&this.sa&&null!==this.th){var b=this.computeBoxBounds(),c=this.th.xd("SHAPE");null===c&&(c=this.th.Ld());c.Ca=b.size;this.th.position=b.position;(a.oe||a.pe)&&a.jA(a.R.ef)}};ek.prototype.doMouseUp=function(){if(this.sa){var a=this.g;a.remove(this.th);try{a.ec="wait",this.selectInRect(this.computeBoxBounds())}finally{a.ec=""}}this.stopTool()};
    ek.prototype.computeBoxBounds=function(){var a=this.g;return null===a?new B(0,0,0,0):new B(a.Bc.da,a.R.da)};
    ek.prototype.selectInRect=function(a){var b=this.g;if(null!==b){var c=b.R;b.Aa("ChangingSelection");a=b.Ak(a,null,function(a){return a instanceof R?a.canSelect():!1},this.DI);if(w.Hk?c.ru:c.control)if(c.shift)for(a=a.i;a.next();)c=a.value,c.ib&&(c.ib=!1);else for(a=a.i;a.next();)c=a.value,c.ib=!c.ib;else{if(!c.shift){for(var c=new H(R),d=b.selection.i;d.next();){var e=d.value;a.contains(e)||c.add(e)}for(c=c.i;c.next();)c.value.ib=!1}for(a=a.i;a.next();)c=a.value,c.ib||(c.ib=!0)}b.Aa("ChangedSelection")}};
    w.defineProperty(ek,{GE:"delay"},function(){return this.Co},function(a){w.j(a,"number",ek,"delay");this.Co=a});w.defineProperty(ek,{DI:"isPartialInclusion"},function(){return this.$C},function(a){w.j(a,"boolean",ek,"isPartialInclusion");this.$C=a});w.defineProperty(ek,{th:"box"},function(){return this.xm},function(a){null!==a&&w.G(a,R,ek,"box");this.xm=a});
    function fk(){rg.call(this);0<arguments.length&&w.kd(fk);this.name="Panning";this.yz=new z;this.Jj=!1;var a=this;this.ND=function(){window.document.removeEventListener("scroll",a.ND,!1);a.stopTool()}}w.Ka(fk,rg);w.ga("PanningTool",fk);fk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;return null===a||!a.oe&&!a.pe||!a.R.left||a.$a!==this&&!this.isBeyondDragSize()?!1:!0};
    fk.prototype.doActivate=function(){var a=this.g;null!==a&&(this.Jj?(a.R.bubbles=!0,window.document.addEventListener("scroll",this.ND,!1)):(a.ec="move",a.cf=!0,this.yz=a.position.copy()),this.sa=!0)};fk.prototype.doDeactivate=function(){var a=this.g;null!==a&&(a.ec="",this.sa=a.cf=!1)};fk.prototype.doCancel=function(){var a=this.g;null!==a&&(a.position=this.yz,a.cf=!1);this.stopTool()};fk.prototype.doMouseMove=function(){this.move()};fk.prototype.doMouseUp=function(){this.move();this.stopTool()};
    fk.prototype.move=function(){var a=this.g;if(this.sa&&a)if(this.Jj)a.R.bubbles=!0;else{var b=a.position,c=a.Bc.da,d=a.R.da,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.oe||(e=b.x);a.pe||(c=b.y);a.position=new z(e,c)}};w.defineProperty(fk,{bubbles:"bubbles"},function(){return this.Jj},function(a){w.j(a,"boolean",fk,"bubbles");this.Jj=a});w.u(fk,{CL:"originalPosition"},function(){return this.yz});
    function gk(){0<arguments.length&&w.kd(gk);rg.call(this);this.name="TextEditing";this.Lz=this.lk=null;this.MD=hk;this.Cl=null;this.Sa=ik;this.wl=null;this.iD=1;this.FD=!0;var a=new Xj;this.qC=null;this.yC=a;this.Ry=null;jk(this,a)}w.ga("TextEditingTool",gk);w.Ka(gk,rg);var kk;gk.LostFocus=kk=w.p(gk,"LostFocus",0);var lk;gk.MouseDown=lk=w.p(gk,"MouseDown",1);var mk;gk.Tab=mk=w.p(gk,"Tab",2);var nk;gk.Enter=nk=w.p(gk,"Enter",3);gk.SingleClick=w.p(gk,"SingleClick",0);var hk;
    gk.SingleClickSelected=hk=w.p(gk,"SingleClickSelected",1);var ok;gk.DoubleClick=ok=w.p(gk,"DoubleClick",2);var ik;gk.StateNone=ik=w.p(gk,"StateNone",0);var pk;gk.StateActive=pk=w.p(gk,"StateActive",1);var qk;gk.StateEditing=qk=w.p(gk,"StateEditing",2);var rk;gk.StateValidating=rk=w.p(gk,"StateValidating",3);var sk;gk.StateInvalid=sk=w.p(gk,"StateInvalid",4);var tk;gk.StateValidated=tk=w.p(gk,"StateValidated",5);
    function jk(a,b){var c=w.createElement("textarea");a.Ry=c;c.addEventListener("input",function(){if(null!==a.$g){var b=a.VI(this.value),c=this.OJ;this.style.width=20+b.za.width*c+"px";this.style.height=10+b.za.height*c+"px";this.rows=b.IA}},!1);c.addEventListener("keydown",function(b){if(null!==a.$g){var c=b.which;13===c?(!1===a.$g.Cx&&b.preventDefault(),a.acceptText(nk)):9===c?(a.acceptText(mk),b.preventDefault()):27===c&&(a.doCancel(),null!==a.g&&a.g.doFocus())}},!1);c.addEventListener("focus",function(){uk(a)},
        !1);c.addEventListener("blur",function(){vk(a)},!1);b.GB=function(){return c.value};b.LA=c;b.show=function(a,b,f){if(f.state===sk)c.style.border="3px solid red",c.focus();else{var h=a.Wa(Jb),k=b.position,l=b.scale,m=a.pj()*l;m<f.JF&&(m=f.JF);var n=a.Ja.width*m+6,p=a.Ja.height*m+2,q=(h.x-k.x)*l,h=(h.y-k.y)*l;c.value=a.text;b.nj.style.font=a.font;c.style.cssText="position: absolute;z-index: 100;font: inherit;fontSize: "+100*m+"%;lineHeight: normal;width: "+n+"px;height: "+p+"px;left: "+((q-n/2|0)-1)+
        "px;top: "+((h-p/2|0)-1)+"px;text-align: "+a.textAlign+";margin: 0;padding: 1px;border: 0;outline: none;white-space: pre-wrap;overflow: hidden;";c.OJ=m;b.nj.appendChild(c);c.focus();f.jy&&(c.select(),c.setSelectionRange(0,9999))}};b.Gn=function(a){a.nj.removeChild(c)}}w.defineProperty(gk,{$g:"textBlock"},function(){return this.Lz},function(a){null!==a&&w.G(a,Lh,gk,"textBlock");this.Lz=a});w.defineProperty(gk,{lj:"currentTextEditor"},function(){return this.qC},function(a){this.qC=a});
    w.defineProperty(gk,{KH:"defaultTextEditor"},function(){return this.yC},function(a){this.yC=a});w.defineProperty(gk,{sG:"starting"},function(){return this.MD},function(a){w.mb(a,gk,gk,"starting");this.MD=a});
    gk.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||a.hb||!a.R.left||this.isBeyondDragSize())return!1;var b=a.Le(a.R.da,null,function(a){return a instanceof Lh});if(null===b||!b.kA||!b.U.canEdit())return!1;b=b.U;return null===b||this.sG===hk&&!b.ib||this.sG===ok&&2>a.R.Ge?!1:!0};gk.prototype.doStart=function(){this.sa||null===this.$g||this.doActivate()};
    gk.prototype.doActivate=function(){if(!this.sa){var a=this.g;if(null!==a){var b=this.$g;null===b&&(b=a.Le(a.R.da,function(a){return a instanceof Lh?a:null}));if(null!==b&&(this.$g=b,null!==b.U)){this.sa=!0;this.Sa=pk;var c=this.KH;null!==b.vG&&(c=b.vG);this.lk=this.$g.copy();var d=new B(this.$g.Wa(Ab),this.$g.Wa(Sb));a.gG(d);if(c instanceof Xj)c.show(b,a,this);else{c.style.position="absolute";c.style.zIndex="100";c.textEditingTool=this;if("function"===typeof c.onActivate)c.onActivate();a.nj.appendChild(c);
        "function"===typeof c.focus&&c.focus();"function"===typeof c.select&&this.jy&&(c.select(),c.setSelectionRange(0,9999))}this.lj=c}}}};gk.prototype.doCancel=function(){null!==this.wl&&this.lj instanceof HTMLElement&&(this.lj.style.border=this.wl,this.wl=null);this.stopTool()};gk.prototype.doMouseUp=function(){!this.sa&&this.canStart()&&this.doActivate()};gk.prototype.doMouseDown=function(){this.sa&&this.acceptText(lk)};
    gk.prototype.acceptText=function(a){switch(a){case lk:if(this.Sa===tk)this.lj instanceof HTMLElement&&this.lj.focus();else if(this.Sa===pk||this.Sa===sk||this.Sa===qk)this.Sa=rk,wk(this);break;case kk:case nk:case mk:if(nk===a&&!0===this.Lz.Cx)break;if(this.Sa===pk||this.Sa===sk||this.Sa===qk)this.Sa=rk,wk(this)}};
    function wk(a){var b=a.$g,c=a.g,d=a.lj;if(null!==b&&null!==d){var e=b.text,f="";d instanceof Xj?null!==d.GB&&(f=d.GB()):(f=d.value,f="function"===typeof f?f():f);a.isValidText(b,e,f)?(a.Hb(a.name),a.Sa=tk,d instanceof Xj?d.show(b,c,a):null!==a.wl&&(d.style.border=a.wl,a.wl=null),a.Lf=a.name,b.text=f,null!==b.uG&&b.uG(b,e,f),null!==c&&c.Aa("TextEdited",b,e),a.Nk(),a.stopTool(),null!==c&&c.doFocus()):(a.Sa=sk,null!==b.mA&&b.mA(a,e,f),d instanceof Xj?d.show(b,c,a):(null===a.wl&&(a.wl=d.style.border,
        d.style.border="3px solid red"),"function"===typeof d.focus&&d.focus()))}}gk.prototype.doDeactivate=function(){var a=this.g;if(null!==a){this.Sa=ik;this.$g=null;if(null!==this.lj){var b=this.lj;if(b instanceof Xj)b.Gn(a,this);else{if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.nj.removeChild(b)}}this.sa=!1}};gk.prototype.doFocus=function(){uk(this)};gk.prototype.doBlur=function(){vk(this)};
    function uk(a){if(null!==a.lj){var b=a.Ry;a.Sa===pk&&(a.Sa=qk);"function"===typeof b.select&&a.jy&&(b.select(),b.setSelectionRange(0,9999))}}function vk(a){if(null!==a.lj){var b=a.Ry;"function"===typeof b.focus&&b.focus();"function"===typeof b.select&&a.jy&&(b.select(),b.setSelectionRange(0,9999))}}gk.prototype.isValidText=function(a,b,c){w.G(a,Lh,gk,"isValidText:textblock");var d=this.wB;if(null!==d&&!d(a,b,c))return!1;d=a.wB;return null===d||d(a,b,c)?!0:!1};
    w.defineProperty(gk,{wB:"textValidation"},function(){return this.Cl},function(a){null!==a&&w.j(a,"function",gk,"textValidation");this.Cl=a});w.defineProperty(gk,{JF:"minimumEditorScale"},function(){return this.iD},function(a){null!==a&&w.j(a,"number",gk,"minimumEditorScale");this.iD=a});w.defineProperty(gk,{jy:"selectsTextOnActivate"},function(){return this.FD},function(a){null!==a&&w.j(a,"boolean",gk,"selectsTextOnActivate");this.FD=a});
    w.defineProperty(gk,{state:"state"},function(){return this.Sa},function(a){this.Sa!==a&&(w.mb(a,gk,gk,"starting"),this.Sa=a)});gk.prototype.measureTemporaryTextBlock=gk.prototype.VI=function(a){var b=this.lk;b.text=a;xk(b,this.$g.Wo,Infinity);return b};function ih(){rg.call(this);this.name="ToolManager";this.RG=new H(rg);this.SG=new H(rg);this.TG=new H(rg);this.NC=this.OC=850;this.DC=(new ia(2,2)).Ha();this.ZD=5E3;this.mD=Ph;this.LC=yk;this.qv=this.rC=null;this.hn=-1}w.Ka(ih,rg);
    w.ga("ToolManager",ih);var Ph;ih.WheelScroll=Ph=w.p(ih,"WheelScroll",0);var Oh;ih.WheelZoom=Oh=w.p(ih,"WheelZoom",1);ih.WheelNone=w.p(ih,"WheelNone",2);var yk;ih.GestureZoom=yk=w.p(ih,"GestureZoom",3);var zk;ih.GestureCancel=zk=w.p(ih,"GestureCancel",4);var Ak;ih.GestureNone=Ak=w.p(ih,"GestureNone",5);w.defineProperty(ih,{uu:"mouseWheelBehavior"},function(){return this.mD},function(a){w.mb(a,ih,ih,"mouseWheelBehavior");this.mD=a});
    w.defineProperty(ih,{Up:"gestureBehavior"},function(){return this.LC},function(a){w.mb(a,ih,ih,"gestureBehavior");this.LC=a});ih.prototype.initializeStandardTools=function(){this.dH=new Vj;this.VF=new Uh;this.MI=new mj;this.eG=new Lj;this.xJ=new Sj;this.FF=new dj;this.te=new oh;this.PH=new ek;this.iJ=new fk;this.cA=new Zj;this.vB=new gk;this.rH=new Wj;this.sH=new Uj};
    ih.prototype.updateAdornments=function(a){var b=this.Pl;if(b instanceof kh&&this.qv===a){var c=b.sb;(null!==a?c.U===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}};
    ih.prototype.doMouseDown=function(){var a=this.g;if(null!==a){var b=a.R;b.vj&&this.Up===zk&&(b.bubbles=!1);if(b.iu){this.cancelWaitAfter();if(this.Up===Ak){b.bubbles=!0;return}if(this.Up===zk)return;if(a.$a.canStartMultiTouch()){a.$a.standardPinchZoomStart();return}}var c=a.ia;c.Yz&&0!==c.Ih&&w.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.df.length,d=0;d<c;d++){var e=this.df.ea(d);null===e.g&&e.Rc(this.g);if(e.canStart()){a.doFocus();a.$a=e;
        a.$a===e&&(e.sa||e.doActivate(),e.doMouseDown());return}}1===a.R.button&&(this.uu===Ph?this.uu=Oh:this.uu===Oh&&(this.uu=Ph));this.doActivate();this.standardWaitAfter(this.kF,b)}};
    ih.prototype.doMouseMove=function(){var a=this.g;if(null!==a){var b=a.R;if(b.iu){if(this.Up===Ak){b.bubbles=!0;return}if(this.Up===zk)return;if(a.$a.canStartMultiTouch()){a.$a.standardPinchZoomMove();return}}if(this.sa)for(var c=this.dg.length,d=0;d<c;d++){var e=this.dg.ea(d);null===e.g&&e.Rc(this.g);if(e.canStart()){a.doFocus();a.$a=e;a.$a===e&&(e.sa||e.doActivate(),e.doMouseMove());return}}Bk(this,a);null===b.event||"mousemove"!==b.event.type&&b.event.cancelable||(b.bubbles=!0)}};
    function Bk(a,b){a.standardMouseOver();a.isBeyondDragSize()&&a.standardWaitAfter(a.sa?a.kF:a.nI,b.R)}ih.prototype.doCurrentObjectChanged=function(a,b){var c=this.Pl;null===c||null!==b&&c instanceof kh&&(b===c||b.bm(c))||this.hideToolTip()};ih.prototype.doWaitAfter=function(a){var b=this.g;null!==b&&b.Fb&&(this.doMouseHover(),this.sa||this.doToolTip(),a.vj&&!b.R.Cc&&(a=a.copy(),a.button=2,a.buttons=2,b.R=a,b.jt=!0,b.doMouseUp()))};
    ih.prototype.doMouseHover=function(){var a=this.g;if(null!==a){var b=a.R;null===b.Re&&(b.Re=a.Le(b.da,null,null));var c=b.Re;if(null!==c)for(b.Cc=!1;null!==c;){a=this.sa?c.QA:c.RA;if(null!==a&&(a(b,c),b.Cc))break;c=c.Q}else c=this.sa?a.QA:a.RA,null!==c&&c(b)}};
    ih.prototype.doToolTip=function(){var a=this.g;if(null!==a){var b=a.R;null===b.Re&&(b.Re=a.Le(b.da,null,null));b=b.Re;if(null!==b){if(a=this.Pl,!(a instanceof kh)||b!==a&&!b.bm(a)){for(;null!==b;){a=b.yB;if(null!==a){this.showToolTip(a,b);return}b=b.Q}this.hideToolTip()}}else a=a.yB,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
    ih.prototype.showToolTip=function(a,b){null!==b&&w.G(b,G,ih,"showToolTip:obj");var c=this.g;if(null!==c){a!==this.Pl&&this.hideToolTip();if(a instanceof kh){a.ag="Tool";a.gm=!1;a.scale=1/c.scale;a.vd="ToolTip";null!==a.placeholder&&(a.placeholder.scale=c.scale);c.add(a);if(null!==b){var c=null,d=b.Ul();null!==d&&(c=d.data);a.sb=b;a.data=c}else a.data=c.aa;a.Je();this.positionToolTip(a,b)}else a instanceof Xj&&a!==this.Pl&&a.show(b,c,this);this.Pl=a;-1!==this.hn&&(w.clearTimeout(this.hn),this.hn=-1);
        c=this.TJ;if(0<c&&Infinity!==c){var e=this;this.hn=w.setTimeout(function(){e.hideToolTip()},c)}}};ih.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.g;if(null!==b){var c=b.R.da.copy(),d=a.za,e=b.qb;b.R.vj&&(c.x-=d.width);c.x+d.width>e.right&&(c.x-=d.width+5);c.x<e.x&&(c.x=e.x);c.y=c.y+20+d.height>e.bottom?c.y-(d.height+5):c.y+20;c.y<e.y&&(c.y=e.y);a.position=c}}};
    ih.prototype.hideToolTip=function(){-1!==this.hn&&(w.clearTimeout(this.hn),this.hn=-1);var a=this.g;if(null!==a){var b=this.Pl;null!==b&&(b instanceof kh?(a.remove(b),null!==this.qv&&this.qv.Bj(b.vd),b.data=null,b.sb=null):b instanceof Xj&&null!==b.Gn&&b.Gn(a,this),this.Pl=null)}};w.defineProperty(ih,{Pl:"currentToolTip"},function(){return this.rC},function(a){this.rC=a;this.qv=null!==a&&a instanceof kh?a.xf:null});
    ih.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.g;if(null!==a){if(this.sa)for(var b=this.eg.length,c=0;c<b;c++){var d=this.eg.ea(c);null===d.g&&d.Rc(this.g);if(d.canStart()){a.doFocus();a.$a=d;a.$a===d&&(d.sa||d.doActivate(),d.doMouseUp());return}}a.doFocus();this.doDeactivate()}};ih.prototype.doMouseWheel=function(){this.standardMouseWheel()};ih.prototype.doKeyDown=function(){var a=this.g;null!==a&&a.ob.doKeyDown()};ih.prototype.doKeyUp=function(){var a=this.g;null!==a&&a.ob.doKeyUp()};
    ih.prototype.doCancel=function(){null!==Sh&&Sh.doCancel();rg.prototype.doCancel.call(this)};ih.prototype.findTool=function(a){w.j(a,"string",ih,"findTool:name");for(var b=this.df.length,c=0;c<b;c++){var d=this.df.ea(c);if(d.name===a)return d}b=this.dg.length;for(c=0;c<b;c++)if(d=this.dg.ea(c),d.name===a)return d;b=this.eg.length;for(c=0;c<b;c++)if(d=this.eg.ea(c),d.name===a)return d;return null};
    ih.prototype.replaceTool=function(a,b){w.j(a,"string",ih,"replaceTool:name");null!==b&&(w.G(b,rg,ih,"replaceTool:newtool"),b.g&&b.g!==this.g&&w.k("Cannot share tools between Diagrams: "+b.toString()),b.Rc(this.g));for(var c=this.df.length,d=0;d<c;d++){var e=this.df.ea(d);if(e.name===a)return null!==b?this.df.kg(d,b):this.df.bd(d),e}c=this.dg.length;for(d=0;d<c;d++)if(e=this.dg.ea(d),e.name===a)return null!==b?this.dg.kg(d,b):this.dg.bd(d),e;c=this.eg.length;for(d=0;d<c;d++)if(e=this.eg.ea(d),e.name===
        a)return null!==b?this.eg.kg(d,b):this.eg.bd(d),e;return null};function Ck(a,b,c,d){w.j(b,"string",ih,"replaceStandardTool:name");w.G(d,H,ih,"replaceStandardTool:list");null!==c&&(w.G(c,rg,ih,"replaceStandardTool:newtool"),c.g&&c.g!==a.g&&w.k("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.Rc(a.g));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}w.u(ih,{df:"mouseDownTools"},function(){return this.RG});w.u(ih,{dg:"mouseMoveTools"},function(){return this.SG});
    w.u(ih,{eg:"mouseUpTools"},function(){return this.TG});w.defineProperty(ih,{nI:"hoverDelay"},function(){return this.OC},function(a){w.j(a,"number",ih,"hoverDelay");this.OC=a});w.defineProperty(ih,{kF:"holdDelay"},function(){return this.NC},function(a){w.j(a,"number",ih,"holdDelay");this.NC=a});w.defineProperty(ih,{QH:"dragSize"},function(){return this.DC},function(a){w.G(a,ia,ih,"dragSize");this.DC=a.S()});
    w.defineProperty(ih,{TJ:"toolTipDuration"},function(){return this.ZD},function(a){w.j(a,"number",ih,"toolTipDuration");this.ZD=a});w.defineProperty(ih,{dH:"actionTool"},function(){return this.findTool("Action")},function(a){Ck(this,"Action",a,this.df)});w.defineProperty(ih,{VF:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){Ck(this,"Relinking",a,this.df)});
    w.defineProperty(ih,{MI:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){Ck(this,"LinkReshaping",a,this.df)});w.defineProperty(ih,{eG:"resizingTool"},function(){return this.findTool("Resizing")},function(a){Ck(this,"Resizing",a,this.df)});w.defineProperty(ih,{xJ:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){Ck(this,"Rotating",a,this.df)});
    w.defineProperty(ih,{FF:"linkingTool"},function(){return this.findTool("Linking")},function(a){Ck(this,"Linking",a,this.dg)});w.defineProperty(ih,{te:"draggingTool"},function(){return this.findTool("Dragging")},function(a){Ck(this,"Dragging",a,this.dg)});w.defineProperty(ih,{PH:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){Ck(this,"DragSelecting",a,this.dg)});
    w.defineProperty(ih,{iJ:"panningTool"},function(){return this.findTool("Panning")},function(a){Ck(this,"Panning",a,this.dg)});w.defineProperty(ih,{cA:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){Ck(this,"ContextMenu",a,this.eg)});w.defineProperty(ih,{vB:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){Ck(this,"TextEditing",a,this.eg)});
    w.defineProperty(ih,{rH:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){Ck(this,"ClickCreating",a,this.eg)});w.defineProperty(ih,{sH:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){Ck(this,"ClickSelecting",a,this.eg)});
    function Xg(){this.sC=Dk;this.kr=this.lr=this.Z=null;this.tm=this.mr=this.nr=0;this.no=this.qc=this.So=this.Xj=!1;this.kl=this.ff=!0;this.ov=this.nv=this.nC=null;this.mC=0;this.pv=null;this.dv=new I("string");this.Zy=600;this.UG=new z(0,0);this.aC=this.$B=this.cE=!1;this.Tm=new ma(G,Qk)}w.ga("AnimationManager",Xg);Xg.prototype.Rc=function(a){this.Z=a};function Dk(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}w.u(Xg,{zK:"animationReasons"},function(){return this.dv});
    Xg.prototype.canStart=function(){return!0};Xg.prototype.prepareAutomaticAnimation=Xg.prototype.Wn=function(a){this.ff&&(this.kl||this.Z.Jn)&&(this.dv.add(a),this.canStart(a)&&(this.Xj&&this.Gh(),this.qc=!0))};function Rk(a){if(a.ff&&(a.dv.clear(),a.qc))if(!a.no)a.qc=!1;else if(0===a.tm){var b=+new Date;a.tm=b;requestAnimationFrame(function(){if(!1!==a.qc&&!a.Xj&&a.tm===b){var c=a.Z;c.qj("temporaryPixelRatio")&&(c.kk=1);Sk(c);a.qc=!1;c.Aa("AnimationStarting");Tk(a,b)}})}}
    function Yk(a,b,c,d,e,f){if(!(!a.qc||"position"===c&&d.L(e)||b instanceof R&&!b.oF)){var h=a.Tm;if(h.contains(b)){var h=h.ka(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=Zk(d));h.$w&&void 0!==l[c]?h.Lt[c]=Zk(e):(f||(h.Lt[c]=Zk(e)),l[c]=Zk(e));f&&0===c.indexOf("position:")&&b instanceof R&&(h.Lt.location=Zk(b.location))}else k=new ra,l=new ra,k[c]=Zk(d),l[c]=Zk(e),d=l,e=k.position,e instanceof z&&!e.I()&&a.dv.contains("Expand SubGraph")&&e.assign(d.position),k=new Qk(k,l,f),f&&0===c.indexOf("position:")&&
    b instanceof R&&(k.Lt.location=Zk(b.location)),h.add(b,k);a.no=!0}}function Zk(a){return a instanceof z?a.copy():a instanceof ia?a.copy():a}
    function Tk(a,b){var c;function d(){if(!1!==f.Xj&&f.tm===b){var a=+new Date,c=a>s?m:a-r;$k(f);al(f,e,q,h,c,m);f.nv&&f.nv();Ri(e);bl(f);a>s?cl(f):requestAnimationFrame(d)}}void 0===c&&(c=new ra);var e=a.Z;if(null!==e){a.Xj=!0;var f=a,h=c.YK||a.sC,k=c.xL||null,l=c.yL||null,m=c.duration||a.Zy,n=a.UG;for(c=a.Tm.i;c.next();){var p=c.value.start.position;p instanceof z&&(p.I()||p.assign(n))}a.nC=h;a.nv=k;a.ov=l;a.mC=m;a.pv=a.Tm;var q=a.pv;for(c=q.i;c.next();)k=c.value.end,k["position:placeholder"]&&(l=
        k["position:placeholder"],n=l.Wa(Ab),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n);$k(a);al(a,e,q,h,0,m);Ri(a.Z);bl(a);var r=+new Date,s=r+m;f.tm===b&&requestAnimationFrame(function(){d()})}}function $k(a){if(!a.So){var b=a.Z;a.cE=b.wb;a.$B=b.Pe;a.aC=b.Nu;b.wb=!0;b.Pe=!0;b.Nu=!0;a.So=!0}}function bl(a){var b=a.Z;b.wb=a.cE;b.Pe=a.$B;b.Nu=a.aC;a.So=!1}
    function al(a,b,c,d,e,f){for(c=c.i;c.next();){var h=c.key,k=c.value,l=k.start,k=k.end,m;for(m in k)if(("position"!==m||!k["position:placeholder"]&&!k["position:node"])&&void 0!==dl[m])dl[m](h,l[m],k[m],d,e,f)}d=b.DA;b.DA=!0;m=a.sC;0!==a.nr&&0!==a.mr&&(c=a.nr,b.ub=m(e,c,a.mr-c,f));null!==a.lr&&null!==a.kr&&(c=a.lr,a=a.kr,b.jb=new z(m(e,c.x,a.x-c.x,f),m(e,c.y,a.y-c.y,f)));b.DA=d}
    Xg.prototype.stopAnimation=Xg.prototype.Gh=function(){!0===this.qc&&(this.qc=!1,this.tm=0,this.no&&this.Z.Ne());this.Xj&&this.ff&&cl(this)};
    function cl(a){a.Xj=!1;a.no=!1;$k(a);for(var b=a.Z,c=a.nC,d=a.mC,e=a.pv.i;e.next();){var f=e.key,h=e.value,k=h.start,l=h.end,m=h.Lt,n;for(n in l)if(void 0!==dl[n]){var p=n;!h.$w||"position:node"!==p&&"position:placeholder"!==p||(p="position");dl[p](f,k[n],void 0!==m[n]?m[n]:h.$w?k[n]:l[n],c,d,d)}h.$w&&void 0!==m.location&&f instanceof R&&(f.location=m.location);h.Zx&&f instanceof R&&f.yd(!1)}for(c=a.Z.links;c.next();)d=c.value,null!==d.kp&&(d.points=d.kp,d.kp=null);b.Lx.clear();b.kk=null;b.sc();b.oa();
        b.cg();el(b);bl(a);a.ov&&a.ov();a.tm=0;a.pv=null;a.ov=null;a.nv=null;a.lr=null;a.kr=null;a.nr=0;a.mr=0;a.Tm=new ma(G,Qk);b.Aa("AnimationFinished");b.Ne()}
    function fl(a,b,c){var d=b.W,e=c.W,f=null;c instanceof V&&(f=c.placeholder);null!==f?(d=f.Wa(Ab),d.x+=f.padding.left,d.y+=f.padding.top,Yk(a,b,"position",d,b.position,!1)):Yk(a,b,"position",new z(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);Yk(a,b,"scale",.01,b.scale,!1);if(b instanceof V)for(b=b.Oc;b.next();)f=b.value,f instanceof T&&fl(a,f,c)}
    function gl(a,b,c){if(b.isVisible()){var d=null;c instanceof V&&(d=c.placeholder);null!==d?Yk(a,b,"position:placeholder",b.position,d,!0):Yk(a,b,"position:node",b.position,c,!0);Yk(a,b,"scale",b.scale,.01,!0);a.qc&&(d=a.Tm,d.contains(b)&&(d.ka(b).Zx=!0));if(b instanceof V)for(b=b.Oc;b.next();)d=b.value,d instanceof T&&gl(a,d,c)}}function hl(a,b,c){a.qc&&(null===a.lr&&b.I()&&null===a.kr&&(a.lr=b.copy()),a.kr=c.copy(),a.no=!0)}
    function il(a,b,c){a.qc&&a.Z.Jn&&(0===a.nr&&0===a.mr&&(a.nr=b),a.mr=c,a.no=!0)}w.defineProperty(Xg,{isEnabled:"isEnabled"},function(){return this.ff},function(a){w.j(a,"boolean",Xg,"isEnabled");this.ff=a});w.defineProperty(Xg,{duration:"duration"},function(){return this.Zy},function(a){w.j(a,"number",Xg,"duration");1>a&&w.Fa(a,">= 1",Xg,"duration");this.Zy=a});w.u(Xg,{of:"isAnimating"},function(){return this.Xj});w.u(Xg,{EI:"isTicking"},function(){return this.So});
    w.defineProperty(Xg,{wF:"isInitial"},function(){return this.kl},function(a){w.j(a,"boolean",Xg,"isInitial");this.kl=a});function Qk(a,b,c){this.start=a;this.end=b;this.Lt=new ra;this.$w=c;this.Zx=!1}
    var dl={opacity:function(a,b,c,d,e,f){a.opacity=d(e,b,c-b,f)},position:function(a,b,c,d,e,f){e!==f?a.ny(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):a.position=new z(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},"position:node":function(a,b,c,d,e,f){var h=a.W,k=c.W;c=k.x+k.width/2-h.width/2;h=k.y+k.height/2-h.height/2;e!==f?a.ny(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f)):a.position=new z(d(e,b.x,c-b.x,f),d(e,b.y,h-b.y,f))},"position:placeholder":function(a,b,c,d,e,f){e!==f?a.ny(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f)):
        a.position=new z(d(e,b.x,c.x-b.x,f),d(e,b.y,c.y-b.y,f))},scale:function(a,b,c,d,e,f){a.scale=d(e,b,c-b,f)},visible:function(a,b,c,d,e,f){a.visible=e!==f?b:c}};function qg(){0<arguments.length&&w.kd(qg);w.nc(this);this.Z=null;this.zb=new H(R);this.Sb="";this.yc=1;this.oz=!1;this.xl=this.Qz=this.Xk=this.Wk=this.Vk=this.Uk=this.Sk=this.Tk=this.Rk=this.Zk=this.Qk=this.Yk=this.Pk=this.Ok=!0;this.lz=!1;this.kw=[]}w.ga("Layer",qg);qg.prototype.Rc=function(a){this.Z=a};
    qg.prototype.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,h=0,k=this.zb.i;k.next();){var l=k.value;l instanceof V?e++:l instanceof T?d++:l instanceof W?f++:l instanceof kh?h++:c++}k="";0<c&&(k+=c+" Parts ");0<d&&(k+=d+" Nodes ");0<e&&(k+=e+" Groups ");0<f&&(k+=f+" Links ");0<h&&(k+=h+" Adornments ");if(1<a)for(a=this.zb.i;a.next();)c=a.value,k+="\n    "+c.toString(),d=c.data,null!==d&&w.Od(d)&&(k+=" #"+w.Od(d)),c instanceof T?k+=" "+
        Rf(d):c instanceof W&&(k+=" "+Rf(c.Y)+" "+Rf(c.$));return b+" "+this.zb.count+": "+k};qg.prototype.findObjectAt=qg.prototype.Le=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.xl)return null;var d=!1;null!==this.g&&this.g.qb.Ia(a)&&(d=!0);for(var e=w.K(),f=this.zb.n,h=f.length;h--;){var k=f[h];if((!0!==d||!1!==jl(k))&&k.isVisible()&&(e.assign(a),Pa(e,k.rh),k=k.Le(e,b,c),null!==k&&(null!==b&&(k=b(k)),null!==k&&(null===c||c(k)))))return w.v(e),k}w.v(e);return null};
    qg.prototype.findObjectsAt=qg.prototype.Ot=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof I||(d=new I(G));if(!1===this.xl)return d;var e=!1;null!==this.g&&this.g.qb.Ia(a)&&(e=!0);for(var f=w.K(),h=this.zb.n,k=h.length;k--;){var l=h[k];if((!0!==e||!1!==jl(l))&&l.isVisible()){f.assign(a);Pa(f,l.rh);var m=l;l.Ot(f,b,c,d)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||(d instanceof I&&d.add(m),d instanceof H&&d.add(m)))}}w.v(f);return d};
    qg.prototype.findObjectsIn=qg.prototype.Ak=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(G));if(!1===this.xl)return e;var f=!1;null!==this.g&&this.g.qb.xk(a)&&(f=!0);for(var h=this.zb.n,k=h.length;k--;){var l=h[k];if((!0!==f||!1!==jl(l))&&l.isVisible()){var m=l;l.Ak(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||(e instanceof I&&e.add(m),e instanceof H&&e.add(m)))}}return e};
    qg.prototype.nA=function(a,b,c,d,e,f,h){if(!1===this.xl)return e;for(var k=this.zb.n,l=k.length;l--;){var m=k[l];if((!0!==h||!1!==jl(m))&&f(m)&&m.isVisible()){var n=m;m.Ak(a,b,c,d,e)&&(null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||(e instanceof I&&e.add(n),e instanceof H&&e.add(n)))}}return e};
    qg.prototype.findObjectsNear=qg.prototype.zn=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(G));if(!1===this.xl)return f;var h=!1;null!==this.g&&this.g.qb.Ia(a)&&(h=!0);for(var k=w.K(),l=w.K(),m=this.zb.n,n=m.length;n--;){var p=m[n];if((!0!==h||!1!==jl(p))&&p.isVisible()){k.assign(a);Pa(k,p.rh);l.m(a.x+b,a.y);Pa(l,p.rh);var q=p;p.zn(k,l,c,d,e,f)&&(null!==c&&(q=
        c(q)),null===q||null!==d&&!d(q)||(f instanceof I&&f.add(q),f instanceof H&&f.add(q)))}}w.v(k);w.v(l);return f};g=qg.prototype;g.Hf=function(a,b){if(this.visible){var c;c=void 0===b?a.qb:b;for(var d=this.zb.n,e=d.length,f=0;f<e;f++){var h=d[f];h.eD=f;if(!(h instanceof W&&!1===h.Mf)){if(h instanceof kh){var k=h;if(null!==k.xf)continue}if($a(h.W,c))for(h.Hf(!0),kl(h),h=h.Pw;h.next();)k=h.value,xk(k,Infinity,Infinity),k.jc(),k.Hf(!0);else h.Hf(!1),null!==h.Pw&&0<h.Pw.count&&kl(h)}}}};
    g.ue=function(a,b,c){if(this.visible&&0!==this.yc&&(void 0===c&&(c=!0),c||!this.Mc)){c=this.zb.n;var d=c.length;if(0!==d){1!==this.yc&&(a.globalAlpha=this.yc);var e=this.kw;e.length=0;for(var f=b.scale,h=0;h<d;h++){var k=c[h];if(jl(k)){if(k instanceof W){var l=k;l.ac&&e.push(l);if(!1===l.Mf)continue}l=k.W;1<l.width*f||1<l.height*f?k.ue(a,b):ll(k,a)}}a.globalAlpha=1}}};
    function ml(a,b,c,d){if(a.visible&&0!==a.yc){1!==a.yc&&(b.globalAlpha=a.yc);var e=a.kw;e.length=0;var f=c.scale;a=a.zb.n;for(var h=a.length,k=d.length,l=0;l<h;l++){var m=a[l];if(jl(m)){if(m instanceof W){var n=m;n.ac&&e.push(n);if(!1===n.Mf)continue}var n=nl(m,m.W),p;a:{p=n;for(var q=d,r=k,s=2/f,u=4/f,t=0;t<r;t++){var x=q[t];if(0!==x.width&&0!==x.height&&p.mF(x.x-s,x.y-s,x.width+u,x.height+u)){p=!0;break a}}p=!1}p&&(1<n.width*f||1<n.height*f?m.ue(b,c):ll(m,b))}}b.globalAlpha=1}}
    g.h=function(a,b,c,d,e){var f=this.g;null!==f&&f.ad(Nf,a,this,b,c,d,e)};g.Xp=function(a,b,c){var d=this.zb;b.Uv=this;if(a>=d.count)a=d.count;else if(d.ea(a)===b)return-1;d.Qd(a,b);b.au(c);d=this.g;null!==d&&(c?d.oa():d.Xp(b));ol(this,a,b);return a};
    g.nf=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.nf(a,b,c);var d=this.zb;if(0>a||a>=d.length){if(a=d.indexOf(b),0>a)return-1}else if(d.ea(a)!==b&&(a=d.indexOf(b),0>a))return-1;b.bu(c);d.bd(a);d=this.g;null!==d&&(c?d.oa():d.nf(b));b.Uv=null;return a};
    function ol(a,b,c){b=pl(a,b,c);if(c instanceof V&&null!==c&&isNaN(c.io)){if(0!==c.Oc.count){for(var d=-1,e=a.zb.n,f=e.length,h=0;h<f;h++){var k=e[h];if(k===c&&(b=h,0<=d))break;if(0>d&&k.Da===c&&(d=h,0<=b))break}!(0>d)&&d<b&&(e=a.zb,e.bd(b),e.Qd(d,c))}c=c.Da;null!==c&&ol(a,-1,c)}}
    function pl(a,b,c){var d=c.io;if(isNaN(d))return b;a=a.zb;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,h=NaN;0<=f;){h=a.ea(f).io;if(!isNaN(h))break;f--}for(var k=b+1,l=NaN;k<e;){l=a.ea(k).io;if(!isNaN(l))break;k++}if(!isNaN(h)&&h>d)for(;;){if(-1===f||h<=d){f++;if(f===b)break;a.bd(b);a.Qd(f,c);return f}for(h=NaN;0<=--f&&(h=a.ea(f).io,isNaN(h)););}else if(!isNaN(l)&&l<d)for(;;){if(k===e||l>=d){k--;if(k===b)break;a.bd(b);a.Qd(k,c);return k}for(l=NaN;++k<e&&(l=a.ea(k).io,
        isNaN(l)););}return b}g.clear=function(){for(var a=this.zb.gc(),b=a.length,c=0;c<b;c++)a[c].Hf(!1),this.nf(-1,a[c],!1)};w.u(qg,{Lk:"parts"},function(){return this.zb.i});w.u(qg,{FL:"partsBackwards"},function(){return this.zb.Kn});w.u(qg,{g:"diagram"},function(){return this.Z});
    w.defineProperty(qg,{name:"name"},function(){return this.Sb},function(a){w.j(a,"string",qg,"name");var b=this.Sb;if(b!==a){var c=this.g;if(null!==c)for(""===b&&w.k("Cannot rename default Layer to: "+a),c=c.Ix;c.next();)c.value.name===a&&w.k("Layer.name is already present in this diagram: "+a);this.Sb=a;this.h("name",b,a);for(a=this.zb.i;a.next();)a.value.ag=this.Sb}});
    w.defineProperty(qg,{opacity:"opacity"},function(){return this.yc},function(a){var b=this.yc;b!==a&&(w.j(a,"number",qg,"opacity"),(0>a||1<a)&&w.Fa(a,"0 <= value <= 1",qg,"opacity"),this.yc=a,this.h("opacity",b,a),a=this.g,null!==a&&a.oa())});w.defineProperty(qg,{Mc:"isTemporary"},function(){return this.oz},function(a){var b=this.oz;b!==a&&(w.j(a,"boolean",qg,"isTemporary"),this.oz=a,this.h("isTemporary",b,a))});
    w.defineProperty(qg,{visible:"visible"},function(){return this.Qz},function(a){var b=this.Qz;if(b!==a){w.j(a,"boolean",qg,"visible");this.Qz=a;this.h("visible",b,a);for(b=this.zb.i;b.next();)b.value.yd(a);a=this.g;null!==a&&a.oa()}});w.defineProperty(qg,{Xg:"pickable"},function(){return this.xl},function(a){var b=this.xl;b!==a&&(w.j(a,"boolean",qg,"pickable"),this.xl=a,this.h("pickable",b,a))});
    w.defineProperty(qg,{pF:"isBoundsIncluded"},function(){return this.lz},function(a){this.lz!==a&&(this.lz=a,null!==this.g&&this.g.sc())});w.defineProperty(qg,{tk:"allowCopy"},function(){return this.Ok},function(a){var b=this.Ok;b!==a&&(w.j(a,"boolean",qg,"allowCopy"),this.Ok=a,this.h("allowCopy",b,a))});w.defineProperty(qg,{kn:"allowDelete"},function(){return this.Pk},function(a){var b=this.Pk;b!==a&&(w.j(a,"boolean",qg,"allowDelete"),this.Pk=a,this.h("allowDelete",b,a))});
    w.defineProperty(qg,{Tw:"allowTextEdit"},function(){return this.Yk},function(a){var b=this.Yk;b!==a&&(w.j(a,"boolean",qg,"allowTextEdit"),this.Yk=a,this.h("allowTextEdit",b,a))});w.defineProperty(qg,{Qw:"allowGroup"},function(){return this.Qk},function(a){var b=this.Qk;b!==a&&(w.j(a,"boolean",qg,"allowGroup"),this.Qk=a,this.h("allowGroup",b,a))});
    w.defineProperty(qg,{Uw:"allowUngroup"},function(){return this.Zk},function(a){var b=this.Zk;b!==a&&(w.j(a,"boolean",qg,"allowUngroup"),this.Zk=a,this.h("allowUngroup",b,a))});w.defineProperty(qg,{Ct:"allowLink"},function(){return this.Rk},function(a){var b=this.Rk;b!==a&&(w.j(a,"boolean",qg,"allowLink"),this.Rk=a,this.h("allowLink",b,a))});
    w.defineProperty(qg,{ln:"allowRelink"},function(){return this.Tk},function(a){var b=this.Tk;b!==a&&(w.j(a,"boolean",qg,"allowRelink"),this.Tk=a,this.h("allowRelink",b,a))});w.defineProperty(qg,{Jl:"allowMove"},function(){return this.Sk},function(a){var b=this.Sk;b!==a&&(w.j(a,"boolean",qg,"allowMove"),this.Sk=a,this.h("allowMove",b,a))});
    w.defineProperty(qg,{Rw:"allowReshape"},function(){return this.Uk},function(a){var b=this.Uk;b!==a&&(w.j(a,"boolean",qg,"allowReshape"),this.Uk=a,this.h("allowReshape",b,a))});w.defineProperty(qg,{Dt:"allowResize"},function(){return this.Vk},function(a){var b=this.Vk;b!==a&&(w.j(a,"boolean",qg,"allowResize"),this.Vk=a,this.h("allowResize",b,a))});
    w.defineProperty(qg,{Sw:"allowRotate"},function(){return this.Wk},function(a){var b=this.Wk;b!==a&&(w.j(a,"boolean",qg,"allowRotate"),this.Wk=a,this.h("allowRotate",b,a))});w.defineProperty(qg,{yf:"allowSelect"},function(){return this.Xk},function(a){var b=this.Xk;b!==a&&(w.j(a,"boolean",qg,"allowSelect"),this.Xk=a,this.h("allowSelect",b,a))});
    function D(a){function b(){window.document.removeEventListener("DOMContentLoaded",b,!1);ql(c)}1<arguments.length&&w.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");w.nc(this);rl=[];this.Tc=!0;this.VB=new Xg;this.VB.Rc(this);this.Hd=17;this.Mr=!1;this.Bz="default";var c=this;null!==window.document.body?ql(this):window.document.addEventListener("DOMContentLoaded",b,!1);this.cc=new H(qg);this.Mb=this.Jb=0;this.hk=this.Nb=this.tf=this.Fb=null;this.aG();this.Po=
        null;this.$F();this.jb=(new z(NaN,NaN)).freeze();this.ub=1;this.Jv=(new z(NaN,NaN)).freeze();this.Kv=NaN;this.bw=1E-4;this.$v=100;this.hd=new ka;this.Mw=(new z(NaN,NaN)).freeze();this.Bv=(new B(NaN,NaN,NaN,NaN)).freeze();this.uw=(new hb(0,0,0,0)).freeze();this.vw=sl;this.rw=this.pw=null;this.wm=ph;this.to=qc;this.il=ph;this.Mo=qc;this.Lv=this.Iv=Ab;this.Ce=!0;this.Ir=!1;this.xg=new I(R);this.cl=new ma(W,B);this.pr=!0;this.Nq=250;this.oo=-1;this.fv=(new hb(16,16,16,16)).freeze();this.tv=this.Uf=!1;
        this.Ho=!0;this.Li=new zf;this.Vc=new zf;this.Rb=new zf;this.ih=this.zi=null;this.jt=!1;this.Uy=this.Vy=null;tl(this);this.ep=new I(T);this.Dl=new I(V);this.Yo=new I(W);this.zb=new I(R);this.Rv=!0;this.Hw=ul;this.RC=!1;this.Jw=Vi;this.Py=this.Sy=this.Mz=null;this.mv="";this.jr="auto";this.Di=this.ej=this.Ui=this.ew=this.Vi=this.Wi=this.Xi=this.Ci=this.Ii=this.Ai=null;this.wz=!1;this.zD={};this.ow=0;this.Zh=[null,null];this.My=null;this.Fq=this.Ty=this.Hz=this.GD=this.dj=!1;this.bD=!0;this.nz=this.$d=
            !1;this.me=null;var d=this;this.jD=function(a){if(a.aa===d.aa&&d.Ta){d.Ta=!1;try{var b=a.Ac;""===a.qf&&b===Nf&&vl(d,a.object,a.propertyName)}finally{d.Ta=!0}}};this.kD=function(a){wl(d,a)};this.fE=!0;this.fh=-2;this.Ei=new ma(Object,R);this.Lj=new ma(Object,W);this.Im=new ma(Object,Array);this.gp=new ma("string",Array);this.zz=new H(xl);this.Ni=!1;this.Pk=this.Ok=this.Wu=this.ff=!0;this.Yu=this.Xu=!1;this.cv=this.av=this.Xk=this.Wk=this.Vk=this.Uk=this.Sk=this.Tk=this.Rk=this.$u=this.Zk=this.Qk=this.Yk=
            !0;this.ll=this.ZC=!1;this.bv=this.Zu=this.Gv=this.Fv=!0;this.xw=this.tw=16;this.Dz=this.sw=!1;this.Ts=this.ww=null;this.Ez=this.Fz=0;this.hf=(new hb(5)).freeze();this.zw=(new I(R)).freeze();this.aw=999999999;this.Hv=(new I(R)).freeze();this.jl=this.Fm=this.Wj=!0;this.gl=this.Vj=!1;this.ke=null;this.um=!0;this.gh=!1;this.QG=new I(W);this.PC=new I(yl);this.Gd=null;this.qD=1;this.KD=0;this.ph={scale:1,position:new z,bounds:new B,isScroll:!1};this.eE=(new B(NaN,NaN,NaN,NaN)).freeze();this.uv=(new B(NaN,
            NaN,NaN,NaN)).freeze();this.Sv=!1;this.wv=null;this.lw=new I(zl);Al(this);this.Wv=this.Dv=this.fw=this.vC=this.uC=this.wC=this.ak=this.el=this.Yi=null;Bl(this);this.rd=null;this.Cv=!1;this.wo=null;this.eb=new ih;this.eb.initializeStandardTools();this.$a=this.Ht=this.eb;this.ob=new sg;this.aa=new Q;this.dj=!0;this.Tb=new tg;this.dj=!1;this.HC=this.Yy=null;this.Ed=1;this.kk=null;var e=w.vfo.split(".");!0!==w.hx.licenseKey&&"1"===e[0]&&7>parseInt(e[1],10)&&(w.trace("Warning: You have entered a license key for GoJS version 1.7 or later, but this library is version "+
            w.vfo+". This license key will do nothing until you upgrade to GoJS 1.7 or later."),w.hx.licenseKey=!0);this.pl=1;this.Km=0;this.dD=new z;this.aE=500;this.ev=new z;this.bt=null;this.ml=!1;this.preventDefault=this.Yx=this.RF=this.SF=this.QF=this.Sn=this.Sg=this.Tn=this.Qn=this.Rn=this.HB=this.zB=this.AB=this.BB=this.zl=this.Ps=this.yl=this.Os=null;this.nD=1;this.Ov=!1;this.hl=new Cl;void 0!==a&&Dl(this,a);this.Tc=!1}w.ga("Diagram",D);
    D.prototype.clear=D.prototype.clear=function(){var a=null;null!==this.rd&&(a=this.rd.U);this.aa.clear();for(var b=this.cc.length,c=0;c<b;c++)this.cc.n[c].clear();this.xg.clear();this.cl.clear();this.ep.clear();this.Dl.clear();this.Yo.clear();this.zb.clear();this.Ei.clear();this.Lj.clear();this.Im.clear();this.zw.Qa();this.zw.clear();this.zw.freeze();this.Hv.Qa();this.Hv.clear();this.Hv.freeze();gh=this.wo=null;hh="";this.uv=(new B(NaN,NaN,NaN,NaN)).freeze();null!==a&&(this.add(a),this.zb.remove(a));
        this.oa()};
    D.prototype.reset=D.prototype.reset=function(){this.Tc=!0;this.clear();this.cc=new H(qg);this.aG();this.$F();this.jb=(new z(NaN,NaN)).freeze();this.ub=1;this.Jv=(new z(NaN,NaN)).freeze();this.Kv=NaN;this.bw=1E-4;this.$v=100;this.Mw=(new z(NaN,NaN)).freeze();this.Bv=(new B(NaN,NaN,NaN,NaN)).freeze();this.uw=(new hb(0,0,0,0)).freeze();this.vw=sl;this.rw=this.pw=null;this.wm=ph;this.to=qc;this.il=ph;this.Mo=qc;this.Lv=this.Iv=Ab;this.Nq=250;this.fv=(new hb(16,16,16,16)).freeze();this.Rv=!0;this.Hw=ul;
        this.Jw=Vi;this.jr="auto";this.Di=this.ej=this.Ui=this.ew=this.Vi=this.Wi=this.Xi=this.Ci=this.Ii=this.Ai=null;this.Ni=!1;this.Pk=this.Ok=this.Wu=this.ff=!0;this.Yu=this.Xu=!1;this.bv=this.Zu=this.Gv=this.Fv=this.cv=this.av=this.Xk=this.Wk=this.Vk=this.Uk=this.Sk=this.Tk=this.Rk=this.$u=this.Zk=this.Qk=this.Yk=!0;this.xw=this.tw=16;this.hf=(new hb(5)).freeze();this.aw=999999999;this.ke=null;this.Sv=!1;Bl(this);this.rd=null;this.eb=new ih;this.eb.initializeStandardTools();this.$a=this.Ht=this.eb;this.ob=
            new sg;this.dj=!0;Al(this);this.Tb=new tg;this.dj=!1;this.aa=new Q;this.gh=!1;this.Ho=!0;this.Tc=this.Uf=!1;this.oa();this.ih=this.zi=null;tl(this);this.mv=""};
    function Bl(a){a.Yi=new ma("string",R);var b=new T,c=new Lh;c.bind(new bh("text","",Rf));b.add(c);a.wC=b;a.Yi.add("",b);b=new T;c=new Lh;c.stroke="brown";c.bind(new bh("text","",Rf));b.add(c);a.Yi.add("Comment",b);b=new T;b.gm=!1;b.Wz=!1;c=new X;c.Cb="Ellipse";c.fill="black";c.stroke=null;c.Ca=(new ia(3,3)).Ha();b.add(c);a.Yi.add("LinkLabel",b);a.el=new ma("string",V);b=new V;b.jB="GROUPPANEL";b.type=El;c=new Lh;c.font="bold 12pt sans-serif";c.bind(new bh("text","",Rf));b.add(c);c=new C(Fl);c.name=
        "GROUPPANEL";var d=new X;d.Cb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new Nj;d.padding=(new hb(5,5,5,5)).Ha();c.add(d);b.add(c);a.uC=b;a.el.add("",b);a.ak=new ma("string",W);b=new W;c=new X;c.pf=!0;b.add(c);c=new X;c.yq="Standard";c.fill="black";c.stroke=null;c.lb=0;b.add(c);a.vC=b;a.ak.add("",b);b=new W;c=new X;c.pf=!0;c.stroke="brown";b.add(c);a.ak.add("Comment",b);b=new kh;b.type=Fl;c=new X;c.fill=null;c.stroke="dodgerblue";c.lb=3;b.add(c);c=new Nj;c.margin=(new hb(1.5,
        1.5,1.5,1.5)).Ha();b.add(c);a.fw=b;a.Dv=b;b=new kh;b.type=hj;c=new X;c.pf=!0;c.fill=null;c.stroke="dodgerblue";c.lb=3;b.add(c);a.Wv=b}
    function ql(a){var b=w.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=w.createElement("div");c.style.position="absolute";c.style.visibility="hidden";c.style.width="200px";c.style.height="150px";c.style.overflow="hidden";c.style.boxSizing="content-box";c.appendChild(b);window.document.body.appendChild(c);var d=b.offsetWidth;c.style.overflow="scroll";b=b.offsetWidth;d===b&&(b=c.clientWidth);window.document.body.removeChild(c);c=d-b;0!==c||w.uF||
    (c=11);a.Hd=c;c=w.createElement("div");c.dir="rtl";c.style.cssText="font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";c.textContent="A";window.document.body.appendChild(c);d="reverse";0<c.scrollLeft?d="default":(c.scrollLeft=1,0===c.scrollLeft&&(d="negative"));window.document.body.removeChild(c);a.Bz=d}D.prototype.ic=function(a){a.Ee===D?this.Ll=a:w.Fj(this,a)};
    D.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.nj&&this.nj.id&&(b=this.nj.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.cc.i;c.next();)b+="\n  "+c.value.toString(a-1);return b};D.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.Z instanceof D?b.Z:null};
    w.defineProperty(D,{nj:"div"},function(){return this.Nb},function(a){null!==a&&w.G(a,HTMLDivElement,D,"div");if(this.Nb!==a){rl=[];var b=this.Nb;null!==b?(b.Z=void 0,b.innerHTML="",null!==this.Fb&&(this.Fb.removeEventListener("touchstart",this.BB,!1),this.Fb.removeEventListener("touchmove",this.AB,!1),this.Fb.removeEventListener("touchend",this.zB,!1),this.Fb.Kd.Z=null),b=this.eb,null!==b&&(b.df.each(function(a){a.cancelWaitAfter()}),b.dg.each(function(a){a.cancelWaitAfter()}),b.eg.each(function(a){a.cancelWaitAfter()})),
        b.cancelWaitAfter(),this.$a.doCancel(),this.tf=this.Fb=null,window.removeEventListener("resize",this.HB,!1),window.removeEventListener("mousemove",this.Rn,!0),window.removeEventListener("mousedown",this.Qn,!0),window.removeEventListener("mouseup",this.Tn,!0),window.removeEventListener("mousewheel",this.Sg,!0),window.removeEventListener("DOMMouseScroll",this.Sg,!0),window.removeEventListener("mouseout",this.Sn,!0)):this.gh=!1;this.Nb=null;if(null!==a){if(b=a.Z)b.nj=null;Dl(this,a);this.Xx()}}});
    function Gl(a){var b=a.Fb;b.addEventListener("touchstart",a.BB,!1);b.addEventListener("touchmove",a.AB,!1);b.addEventListener("touchend",a.zB,!1);b.addEventListener("mousemove",a.Rn,!1);b.addEventListener("mousedown",a.Qn,!1);b.addEventListener("mouseup",a.Tn,!1);b.addEventListener("mousewheel",a.Sg,!1);b.addEventListener("DOMMouseScroll",a.Sg,!1);b.addEventListener("mouseout",a.Sn,!1);b.addEventListener("keydown",a.GI,!1);b.addEventListener("keyup",a.HI,!1);b.addEventListener("selectstart",function(a){a.preventDefault();
        return!1},!1);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);b.addEventListener("gesturechange",function(b){a.eb.Up===zk&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.QF,!1);b.addEventListener("pointermove",a.SF,!1);b.addEventListener("pointerleave",a.RF,!1);window.addEventListener("resize",a.HB,!1)}D.prototype.computePixelRatio=function(){return null!==this.kk?this.kk:this.nD};D.prototype.doMouseMove=function(){this.$a.doMouseMove()};
    D.prototype.doMouseDown=function(){this.$a.doMouseDown()};D.prototype.doMouseUp=function(){this.$a.doMouseUp()};D.prototype.doMouseWheel=function(){this.$a.doMouseWheel()};D.prototype.doKeyDown=function(){this.$a.doKeyDown()};D.prototype.doKeyUp=function(){this.$a.doKeyUp()};D.prototype.doFocus=function(){this.focus()};D.prototype.focus=D.prototype.focus=function(){this.Fb&&this.Fb.focus()};
    function Sk(a){if(null!==a.Fb){var b=a.Nb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.gl?a.Hd:0,d=a.Vj?a.Hd:0,e=a.Ed;a.Ed=a.computePixelRatio();a.Ed!==e&&(a.Ir=!0,a.Ne());if(b.clientWidth!==a.Jb+c||b.clientHeight!==a.Mb+d)a.Fm=!0,a.Ce=!0,b=a.Tb,null!==b&&b.Ex&&a.Ll===ph&&b.J(),a.$d||a.Ne()}}}
    function Al(a){var b=new qg;b.name="Background";a.wt(b);b=new qg;b.name="";a.wt(b);b=new qg;b.name="Foreground";a.wt(b);b=new qg;b.name="Adornment";b.Mc=!0;a.wt(b);b=new qg;b.name="Tool";b.Mc=!0;b.pF=!0;a.wt(b);b=new qg;b.name="Grid";b.yf=!1;b.Xg=!1;b.Mc=!0;a.gH(b,a.Nt("Background"))}
    function Hl(a){a.rd=new C(Il);a.rd.name="GRID";var b=new X;b.Cb="LineH";b.stroke="lightgray";b.lb=.5;b.interval=1;a.rd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.lb=.5;b.interval=5;a.rd.add(b);b=new X;b.Cb="LineH";b.stroke="gray";b.lb=1;b.interval=10;a.rd.add(b);b=new X;b.Cb="LineV";b.stroke="lightgray";b.lb=.5;b.interval=1;a.rd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.lb=.5;b.interval=5;a.rd.add(b);b=new X;b.Cb="LineV";b.stroke="gray";b.lb=1;b.interval=10;a.rd.add(b);b=new R;b.add(a.rd);
        b.ag="Grid";b.io=0;b.FA=!1;b.oF=!1;b.Xg=!1;b.KA="GRID";a.add(b);a.zb.remove(b);a.rd.visible=!1}function Jl(){this.Z.isEnabled?this.Z.OH(this):Kl(this.Z)}function Ll(a){this.Z.isEnabled?(this.Z.Dz=!0,this.Z.Fz=a.target.scrollTop,this.Z.Ez=a.target.scrollLeft):Kl(this.Z)}
    D.prototype.diagramScroll=D.prototype.OH=function(a){if(this.Dz&&null!==this.Fb){this.sw=!0;var b=this.se,c=this.qb,d=this.hy,e=b.x-d.left,f=b.y-d.top,h=b.width+d.left+d.right,k=b.height+d.top+d.bottom,l=b.right+d.right,d=b.bottom+d.bottom,m=c.x,b=c.y,n=c.width,p=c.height,q=c.right,r=c.bottom,c=this.scale,s;s=a.scrollLeft;if(this.Mr)switch(this.Bz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var u=s;n<h||p<k?(s=w.xb(this.position.x,this.position.y),
    this.oe&&this.Ez!==u&&(s.x=u/c+e,this.Ez=u),this.pe&&this.Fz!==a.scrollTop&&(s.y=a.scrollTop/c+f,this.Fz=a.scrollTop),this.position=s,w.v(s),this.Fm=this.sw=!1):(s=w.K(),a.XG&&this.oe&&(e<m&&(this.position=s.m(u+e,this.position.y)),l>q&&(this.position=s.m(-(this.ww.scrollWidth-this.Jb)+u-this.Jb/c+l,this.position.y))),a.YG&&this.pe&&(f<b&&(this.position=s.m(this.position.x,a.scrollTop+f)),d>r&&(this.position=s.m(this.position.x,-(this.ww.scrollHeight-this.Mb)+a.scrollTop-this.Mb/c+d))),w.v(s),Ml(this),
        this.Fm=this.sw=!1,b=this.se,c=this.qb,l=b.right,q=c.right,d=b.bottom,r=c.bottom,e=b.x,m=c.x,f=b.y,b=c.y,n>=h&&e>=m&&l<=q&&(this.Ts.style.width="1px"),p>=k&&f>=b&&d<=r&&(this.Ts.style.height="1px"))}};D.prototype.computeBounds=D.prototype.uh=function(){0<this.xg.count&&Hi(this);return Nl(this)};
    function Nl(a){if(a.WE.I()){var b=a.WE.copy();b.Ow(a.padding);return b}for(var c=!0,d=a.cc.n,e=d.length,f=0;f<e;f++){var h=d[f];if(h.visible&&(!h.Mc||h.pF))for(var h=h.zb.n,k=h.length,l=0;l<k;l++){var m=h[l];m.FA&&m.isVisible()&&(m=m.W,m.I()&&(c?(c=!1,b=m.copy()):b.Jh(m)))}}c&&(b=new B(0,0,0,0));b.Ow(a.padding);return b}
    D.prototype.computePartsBounds=function(a,b){void 0===b&&(b=!1);for(var c=null,d=a.i;d.next();){var e=d.value;!b&&e instanceof W||(e.Je(),null===c?c=e.W.copy():c.Jh(e.W))}return null===c?new B(NaN,NaN,0,0):c};
    function Ol(a,b){if((b||a.gh)&&!a.Tc&&null!==a.Fb&&!a.Oa.of&&a.se.I()){a.Tc=!0;var c=a.wm;b&&a.il!==ph&&(c=a.il);var d=c!==ph?Pl(a,c):a.scale,c=a.qb.copy(),e=a.Jb/d,f=a.Mb/d,h=null,k=a.Oa;k.qc&&(h=a.jb.copy());a.position.Qa();var l=a.to;b&&!l.Yc()&&a.Mo.Yc()&&(l=a.Mo);Ql(a,a.jb,a.se,e,f,l,b);a.position.freeze();null!==h&&hl(k,h,a.jb);e=a.scale;a.scale=d;a.Tc=!1;d=a.qb;d.Kc(c)||a.yu(c,d,e,a.scale,!1)}}
    function Pl(a,b){var c=a.ob.ex;if(null===a.Fb)return c;a.Wj&&Rl(a,a.uh());var d=a.se;if(!d.I())return c;var e=d.width,d=d.height,f=a.Jb,h=a.Mb,k=f/e,l=h/d;return b===Sl?(e=Math.min(l,k),e>c&&(e=c),e<a.Ah&&(e=a.Ah),e>a.zh&&(e=a.zh),e):b===Tl?(e=l>k?(h-a.Hd)/d:(f-a.Hd)/e,e>c&&(e=c),e<a.Ah&&(e=a.Ah),e>a.zh&&(e=a.zh),e):a.scale}D.prototype.zoomToFit=D.prototype.zoomToFit=function(){this.scale=Pl(this,Sl)};
    D.prototype.zoomToRect=function(a,b){void 0===b&&(b=Sl);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Sl||b===Tl)if(isNaN(c))e=this.qb.height*this.scale/d;else if(isNaN(d))e=this.qb.width*this.scale/c;else var e=this.Jb,f=this.Mb,e=b===Tl?f/d>e/c?(f-(this.Vj?this.Hd:0))/d:(e-(this.gl?this.Hd:0))/c:Math.min(f/d,e/c);this.scale=e;this.position=new z(a.x,a.y)}};w.defineProperty(D,{DA:null},function(){return this.Tc},function(a){this.Tc=a});
    D.prototype.alignDocument=function(a,b){this.Wj&&Rl(this,this.uh());var c=this.se,d=this.qb;this.position=new z(c.x+(a.x*c.width+a.offsetX)-(b.x*d.width-b.offsetX),c.y+(a.y*c.height+a.offsetY)-(b.y*d.height-b.offsetY))};
    function Ql(a,b,c,d,e,f,h){var k=b.x,l=b.y;if(h||a.gB===sl)f.Yc()&&(d>c.width&&(k=c.x+(f.x*c.width+f.offsetX)-(f.x*d-f.offsetX)),e>c.height&&(l=c.y+(f.y*c.height+f.offsetY)-(f.y*e-f.offsetY))),f=a.hy,h=d-c.width,d<c.width+f.left+f.right?(k=Math.min(k+d/2,c.right+Math.max(h,f.right)-d/2),k=Math.max(k,c.left-Math.max(h,f.left)+d/2),k-=d/2):k>c.left?k=c.left:k<c.right-d&&(k=c.right-d),d=e-c.height,e<c.height+f.top+f.bottom?(l=Math.min(l+e/2,c.bottom+Math.max(d,f.bottom)-e/2),l=Math.max(l,c.top-Math.max(d,
            f.top)+e/2),l-=e/2):l>c.top?l=c.top:l<c.bottom-e&&(l=c.bottom-e);b.x=isFinite(k)?k:-a.padding.left;b.y=isFinite(l)?l:-a.padding.top;null!==a.UF&&(a=a.UF(a,b),b.x=a.x,b.y=a.y)}D.prototype.findPartAt=D.prototype.Pt=function(a,b){var c=b?Li(this,a,function(a){return a.U},function(a){return a.canSelect()}):Li(this,a,function(a){return a.U});return c instanceof R?c:null};
    D.prototype.findObjectAt=D.prototype.Le=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);Hi(this);for(var d=this.cc.Kn;d.next();){var e=d.value;if(e.visible&&(e=e.Le(a,b,c),null!==e))return e}return null};function Li(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);Hi(a);for(a=a.cc.Kn;a.next();){var e=a.value;if(e.visible&&!e.Mc&&(e=e.Le(b,c,d),null!==e))return e}return null}
    D.prototype.findObjectsAt=D.prototype.Ot=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof I||(d=new I(G));Hi(this);for(var e=this.cc.Kn;e.next();){var f=e.value;f.visible&&f.Ot(a,b,c,d)}return d};D.prototype.findObjectsIn=D.prototype.Ak=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(G));Hi(this);for(var f=this.cc.Kn;f.next();){var h=f.value;h.visible&&h.Ak(a,b,c,d,e)}return e};
    D.prototype.nA=function(a,b,c,d,e,f){var h=new I(G);Hi(this);for(var k=this.cc.Kn;k.next();){var l=k.value;l.visible&&l.nA(a,b,c,d,h,e,f)}return h};D.prototype.findObjectsNear=D.prototype.zn=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(G));Hi(this);for(var h=this.cc.Kn;h.next();){var k=h.value;k.visible&&k.zn(a,b,c,d,e,f)}return f};
    D.prototype.acceptEvent=function(a){var b=this.Vc;this.Vc=this.Rb;this.Rb=b;Ul(this,this,a,b,a instanceof MouseEvent);return b};
    function Ul(a,b,c,d,e){d.g=b;d.event=c;e?Vl(a,c,d):(d.ef=b.Rb.ef,d.da=b.Rb.da);a=0;c.ctrlKey&&(a+=1);c.altKey&&(a+=2);c.shiftKey&&(a+=4);c.metaKey&&(a+=8);d.zd=a;d.button=c.button;void 0===c.buttons||w.xI||(d.buttons=c.buttons);w.Hk&&0===c.button&&c.ctrlKey&&(d.button=2);d.Tl=!1;d.up=!1;d.Ge=1;d.Sl=0;d.Cc=!1;d.bubbles=!1;d.timestamp=Date.now();d.iu=!1;a=c.path||c.vk&&c.vk()||null;d.lg=c.target.Z||(a?a[0].Z:null);d.Re=null}
    function Wl(a,b,c,d,e){d.g=a;Vl(a,c,d);d.zd=0;d.button=0;d.buttons=1;d.Tl=!0;d.up=!1;d.Ge=1;d.Sl=0;d.Cc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.iu=e;c=b.path||b.vk&&b.vk()||null;d.lg=b.target.Z||(c?c[0].Z:null);d.Re=null;a.Li=d.copy();Sh=null}
    function Xl(a,b,c,d,e){var f=null;d.g=a;null!==c?((f=window.document.elementFromPoint(c.clientX,c.clientY))&&f.Z?f=f.Z:(c=b instanceof TouchEvent?b.targetTouches[0]:b,f=a),d.lg=f,Vl(a,c,d)):null!==a.Vc?(d.da=a.Vc.da,d.ef=a.Vc.ef,d.lg=a.Vc.lg):null!==a.Li&&(d.da=a.Li.da,d.ef=a.Li.ef,d.lg=a.Li.lg);d.zd=0;d.button=0;d.buttons=1;d.Tl=!1;d.up=!1;d.Ge=1;d.Sl=0;d.Cc=!1;d.bubbles=!1;d.event=b;d.timestamp=Date.now();d.iu=e;d.Re=null}
    function Yl(a,b){if(a.bubbles)return!0;void 0!==b.stopPropagation&&b.stopPropagation();b.preventDefault();b.cancelBubble=!0;return!1}
    D.prototype.GI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Rb;Ul(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.Tl=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del";break;case 48:b.key="0";break;case 187:case 61:case 107:b.key=
        "Add";break;case 189:case 173:case 109:b.key="Subtract";break;case 27:b.key="Esc"}this.Z.doKeyDown();return Yl(b,a)};
    D.prototype.HI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Rb;Ul(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.up=!0;switch(a.which){case 8:b.key="Backspace";break;case 33:b.key="PageUp";break;case 34:b.key="PageDown";break;case 35:b.key="End";break;case 36:b.key="Home";break;case 37:b.key="Left";break;case 38:b.key="Up";break;case 39:b.key="Right";break;case 40:b.key="Down";break;case 45:b.key="Insert";break;case 46:b.key="Del"}this.Z.doKeyUp();return Yl(b,a)};
    D.prototype.Ar=function(a){var b=this.Fb;if(null===b)return new z(0,0);var c=this.Jb,d=this.Mb,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.hd?(a=new z(c,a),Pa(a,this.hd),a):new z(c,a)};function Vl(a,b,c){var d=a.Fb,e=a.Jb,f=a.Mb,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-f/d.height*d.top);c.ef.m(h,k);null!==a.hd?(b=w.xb(h,k),a.hd.pi(b),c.da.assign(b),w.v(b)):c.da.m(h,k)}
    function Af(a,b,c,d){var e=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;e=b.targetTouches[c]}else if(null!==a.Zh[0])e=a.Zh[c];else return;c=a.Fb;b=a.Jb;a=a.Mb;var f=0,h=0;null!==c&&null!==e&&(c=c.getBoundingClientRect(),f=e.clientX-b/c.width*c.left,h=e.clientY-a/c.height*c.top);d.m(f,h)}D.prototype.invalidateDocumentBounds=D.prototype.sc=function(){this.Wj||(this.Wj=!0,this.Ne(!0))};function el(a){a.$d||Hi(a);a.Wj&&Rl(a,a.uh())}
    D.prototype.redraw=D.prototype.Xx=function(){this.Tc||this.$d||(this.oa(),Zl(this),Ml(this),this.sc(),this.cg())};D.prototype.isUpdateRequested=function(){return this.Uf};D.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Oa,c=b.isEnabled;b.Gh();b.isEnabled=!1;Ri(this);this.gh=!1;b.isEnabled=c;null!==a&&w.setTimeout(a,1)};
    D.prototype.requestUpdate=D.prototype.Ne=function(a){void 0===a&&(a=!1);if(!0!==this.Uf&&!(this.Tc||!1===a&&this.$d)){this.Uf=!0;var b=this;requestAnimationFrame(function(){b.Uf&&b.cg()})}};D.prototype.maybeUpdate=D.prototype.cg=function(){if(!this.Ho||this.Uf)this.Ho&&(this.Ho=!1),Ri(this)};function $l(a,b){a.Oa.of||a.Tc||!a.Fm||Kl(a)||(b&&Hi(a),Ol(a,!1))}
    function Ri(a){if(!a.$d&&(a.Uf=!1,null!==a.Nb)){a.$d=!0;var b=a.Oa,c=a.zz;if(!b.So&&0!==c.length){for(var d=c.n,e=d.length,f=0;f<e;f++){var h=d[f];am(h,!1);h.H()}c.clear()}c=a.PC;0<c.count&&(c.each(function(a){a.FB()}),c.clear());d=c=!1;b.of&&(d=!0,c=a.wb,a.wb=!0);b.qc||Sk(a);$l(a,!1);null!==a.rd&&(a.rd.visible&&!a.Cv&&(bm(a),a.Cv=!0),!a.rd.visible&&a.Cv&&(a.Cv=!1));Hi(a);e=!1;if(!a.gh||a.um)a.gh?cm(a,!a.tv):(a.Hb("Initial Layout"),!1===b.isEnabled&&b.Gh(),cm(a,!1)),e=!0;a.tv=!1;Hi(a);a.Hz||b.of||
    el(a);$l(a,!0);e&&(a.gh||fm(a),a.Aa("LayoutCompleted"));Hi(a);e&&!a.gh&&(a.gh=!0,a.Wc("Initial Layout"),a.wb||a.ia.clear(),w.setTimeout(function(){a.ri=!1},1));nm(a);Rk(b);a.ue(a.tf);d&&(a.wb=c);a.$d=!1}}w.u(D,{Jn:null},function(){return this.gh});
    function fm(a){var b=a.cc.n;a.Hf(b,b.length,a);a.il!==ph?a.scale=Pl(a,a.il):a.wm!==ph?a.scale=Pl(a,a.wm):(b=a.rI,isFinite(b)&&0<b&&(a.scale=b));b=a.qI;if(b.I())a.position=b;else{b=w.K();b.Zn(a.se,a.pI);var c=a.qb,c=w.mg(0,0,c.width,c.height),d=w.K();d.Zn(c,a.sI);d.m(b.x-d.x,b.y-d.y);a.position=d;w.Db(c);w.v(d);w.v(b);Zl(a);$l(a,!0);Ol(a,!0)}a.Aa("InitialLayoutCompleted");bm(a)}
    function Hi(a){if((a.$d||!a.Oa.of)&&0!==a.xg.count){for(var b=0;23>b;b++){var c=a.xg.i;if(null===c||0===a.xg.count)break;a.xg=new I(R);a.FB(c,a.xg)}a.ig.each(function(a){a instanceof V&&0!==(a.ya&65536)!==!1&&(a.ya^=65536)})}}
    D.prototype.FB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.ee()||c instanceof V||(c.cm()?(xk(c,Infinity,Infinity),c.jc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof V&&c.isVisible()&&Bm(this,c);for(a.reset();a.next();)c=a.value,c instanceof W&&c.isVisible()&&(c.cm()?(xk(c,Infinity,Infinity),c.jc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof kh&&c.isVisible()&&(c.cm()?(xk(c,Infinity,Infinity),c.jc()):b.add(c))};
    function Bm(a,b){for(var c=w.cb(),d=w.cb(),e=b.Oc;e.next();){var f=e.value;f.isVisible()&&(f instanceof V?(Cm(f)||Dm(f)||Em(f))&&Bm(a,f):f instanceof W?f.Y===b||f.$===b?d.push(f):c.push(f):(xk(f,Infinity,Infinity),f.jc()))}for(var e=c.length,h=0;h<e;h++)f=c[h],xk(f,Infinity,Infinity),f.jc();w.ta(c);xk(b,Infinity,Infinity);b.jc();e=d.length;for(h=0;h<e;h++)f=d[h],xk(f,Infinity,Infinity),f.jc();w.ta(d)}D.prototype.Hf=function(a,b,c,d){var e=this.Oa;if(this.jl||e.of)for(e=0;e<b;e++)a[e].Hf(c,d)};
    D.prototype.ue=function(a,b){void 0===b&&(b=null);null===this.Nb&&w.k("No div specified");var c=this.Fb;null===c&&w.k("No canvas specified");var d=this.Oa;if(!d.qc&&(Fm(this),"0"!==this.Nb.style.opacity)){var e=a!==this.tf,f=this.cc.n,h=f.length,k=this;this.Hf(f,h,k);if(e)a.Fe(!0),Ml(this);else if(!this.Ce&&null===b&&!d.Xj)return;var h=this.jb,l=this.ub,m=Math.round(h.x*l)/l,n=Math.round(h.y*l)/l,d=this.hd;d.reset();1!==l&&d.scale(l);0===h.x&&0===h.y||d.translate(-m,-n);l=this.Ed;w.Hn?(c.width=c.width,
        a.Fe(!0),a.scale(l,l)):(a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.clearRect(0,0,this.Jb,this.Mb));a.setTransform(1,0,0,1,0,0);a.scale(l,l);a.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);c=null!==b?function(c){var d=b;if(c.visible&&0!==c.yc){var e=c.zb.n,f=e.length;if(0!==f){1!==c.yc&&(a.globalAlpha=c.yc);c=c.kw;c.length=0;for(var h=k.scale,l=0;l<f;l++){var m=e[l];if(jl(m)&&!d.contains(m)){if(m instanceof W){var n=m;n.ac&&c.push(n);if(!1===n.Mf)continue}n=m.W;1<n.width*h||1<n.height*h?m.ue(a,k):ll(m,
        a)}}a.globalAlpha=1}}}:function(b){b.ue(a,k)};Gm(this,a);h=f.length;for(m=0;m<h;m++)a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),c(f[m]);this.hl?this.hl.om(this)&&this.wv():this.Ar=function(){return new z(0,0)};e?(this.tf.Fe(!0),Ml(this)):this.Ce=this.jl=!1}};
    function Hm(a,b,c,d,e){null===a.Nb&&w.k("No div specified");var f=a.Fb;null===f&&w.k("No canvas specified");if(!a.Oa.qc){var h=a.tf;if(a.Ce){Fm(a);var k=a.Ed;w.Hn?(f.width=f.width,h.Fe(!0)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.Jb*k,a.Mb*k));h.ly(!1);h.drawImage(a.Yy.Kd,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.jb;var f=a.ub,l=Math.round(e.x*f)/f,m=Math.round(e.y*f)/f;d=a.hd;d.reset();1!==f&&d.scale(f);0===e.x&&0===e.y||d.translate(-l,-m);h.save();h.beginPath();e=c.length;for(f=0;f<
    e;f++)l=c[f],0!==l.width&&0!==l.height&&h.rect(Math.floor(l.x),Math.floor(l.y),Math.ceil(l.width),Math.ceil(l.height));h.clip();h.setTransform(1,0,0,1,0,0);h.scale(k,k);h.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);c=a.cc.n;e=c.length;a.Hf(c,e,a);Gm(a,h);for(f=0;f<e;f++)ml(c[f],h,a,b);h.restore();h.Fe(!0);a.hl?a.hl.om(a)&&a.wv():a.Ar=function(){return new z(0,0)};a.jl=!1;a.Ce=!1;a.Yx()}}}
    function Im(a,b,c,d,e,f,h,k,l,m){null===a.Nb&&w.k("No div specified");null===a.Fb&&w.k("No canvas specified");void 0===h&&(h=null);void 0===k&&(k=null);void 0===l&&(l=!1);void 0===m&&(m=!1);Fm(a);a.tf.Fe(!0);Ml(a);a.nz=!0;var n=a.ub;a.ub=e;var p=a.cc.n,q=p.length;try{var r=new B(f.x,f.y,d.width/e,d.height/e),s=r.copy();s.Ow(c);bm(a,s);Hi(a);a.Hf(p,q,a,r);var u=a.Ed;b.setTransform(1,0,0,1,0,0);b.scale(u,u);b.clearRect(0,0,d.width,d.height);null!==k&&""!==k&&(b.fillStyle=k,b.fillRect(0,0,d.width,d.height));
        var t=w.Kf();t.reset();t.translate(c.left,c.top);t.scale(e);0===f.x&&0===f.y||t.translate(-f.x,-f.y);b.setTransform(t.m11,t.m12,t.m21,t.m22,t.dx,t.dy);w.we(t);Gm(a,b);var x;if(null!==h){var v=new I(R),A=h.i;for(A.reset();A.next();){var y=A.value;!1===m&&"Grid"===y.layer.name||null===y||v.add(y)}x=function(c){var d=l;if(c.visible&&0!==c.yc&&(void 0===d&&(d=!0),d||!c.Mc)){var d=c.zb.n,e=d.length;if(0!==e){1!==c.yc&&(b.globalAlpha=c.yc);c=c.kw;c.length=0;for(var f=a.scale,h=0;h<e;h++){var k=d[h];if(jl(k)&&
            v.contains(k)){if(k instanceof W){var m=k;m.ac&&c.push(m);if(!1===m.Mf)continue}m=k.W;1<m.width*f||1<m.height*f?k.ue(b,a):ll(k,b)}}b.globalAlpha=1}}}}else if(!l&&m){var K=a.Fn.U,E=K.layer;x=function(c){c===E?K.ue(b,a):c.ue(b,a,l)}}else x=function(c){c.ue(b,a,l)};for(c=0;c<q;c++)x(p[c]);a.nz=!1;a.hl?a.hl.om(a)&&a.wv():a.Ar=function(){return new z(0,0)}}finally{a.ub=n,a.tf.Fe(!0),Ml(a),a.Hf(p,q,a),bm(a)}}D.prototype.getRenderingHint=D.prototype.qj=function(a){return this.hk[a]};
    D.prototype.setRenderingHint=D.prototype.FJ=function(a,b){this.hk[a]=b;this.Xx()};D.prototype.resetRenderingHints=D.prototype.aG=function(){this.hk=new ra;this.hk.drawShadows=!0;this.hk.textGreeking=!0;this.hk.viewportOptimizations=w.uF?!1:!0;this.hk.temporaryPixelRatio=!0;this.hk.pictureRatioOptimization=!0};function Gm(a,b){var c=a.hk;null!==c&&(void 0!==c.imageSmoothingEnabled&&b.ly(!!c.imageSmoothingEnabled),c=c.defaultFont,void 0!==c&&null!==c&&(b.font=c))}
    D.prototype.getInputOption=D.prototype.Yt=function(a){return this.Po[a]};D.prototype.setInputOption=function(a,b){this.Po[a]=b};D.prototype.resetInputOptions=D.prototype.$F=function(){this.Po=new ra;this.Po.extraTouchArea=10;this.Po.extraTouchThreshold=10;this.Po.hasGestureZoom=!0};D.prototype.setProperties=function(a){w.Ju(this,a)};function nm(a){if(0===a.ia.Ih&&0!==a.cl.count){for(;0<a.cl.count;){var b=a.cl;a.cl=new ma(W,B);for(b=b.i;b.next();){var c=b.key;lj(c,b.value);c.Me()}}a.oa()}}
    D.prototype.oa=function(a){void 0===a&&(a=null);if(null===a)this.Ce=!0,this.Ne();else{var b=this.qb;null!==a&&a.I()&&b.Zf(a)&&(this.Ce=!0,this.Ne())}for(b=this.lw.i;b.next();)b.value.oa(a)};
    D.prototype.nF=function(a,b){if(!0!==this.Ce){this.Ce=!0;var c=!0===this.qj("temporaryPixelRatio");if(!0===this.qj("viewportOptimizations")&&this.gB!==Jm&&this.hy.kx(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=w.Jf(),f=Math.max(a.x,b.x),h=Math.max(a.y,b.y),k=Math.min(a.x+a.width,b.x+b.width),l=Math.min(a.y+a.height,b.y+b.height);e.x=f;e.y=h;e.width=Math.max(0,k-f)*d;e.height=Math.max(0,l-h)*d;if(0<e.width&&0<e.height){if(!this.$d&&(this.Uf=!1,null!==this.Nb)){this.$d=!0;nm(this);
        this.se.I()||Rl(this,this.uh());var m=this.Fb;if(null!==m){var n=this.Ed,h=this.Jb*n,k=this.Mb*n,f=this.scale*n,d=Math.round(Math.round(b.x*f)-Math.round(a.x*f)),f=Math.round(Math.round(b.y*f)-Math.round(a.y*f)),l=this.Yy,p=this.HC;l.width!==h&&(l.width=h);l.height!==k&&(l.height=k);p.clearRect(0,0,h,k);var l=190*this.Ed,q=70*this.Ed,r=Math.max(d,0),s=Math.max(f,0),u=Math.floor(h-r),t=Math.floor(k-s);p.ly(!1);p.drawImage(m.Kd,r,s,u,t,0,0,u,t);this.hl.om(this)&&p.clearRect(0,0,l,q);var m=w.cb(),p=
            w.cb(),t=Math.abs(d),u=Math.abs(f),x=0===r?0:h-t,r=w.xb(x,0),t=w.xb(t+x,k);p.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y)));var v=this.hd;v.reset();v.scale(n,n);1!==this.ub&&v.scale(this.ub);n=this.jb;(0!==n.x||0!==n.y)&&isFinite(n.x)&&isFinite(n.y)&&v.translate(-n.x,-n.y);Pa(r,v);Pa(t,v);m.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y)));x=0===s?0:k-u;r.m(0,x);t.m(h,u+x);p.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-
            t.x),Math.abs(r.y-t.y)));Pa(r,v);Pa(t,v);m.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y)));this.hl.om(this)&&(h=0<d?0:-d,k=0<f?0:-f,r.m(h,k),t.m(l+h,q+k),p.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y))),Pa(r,v),Pa(t,v),m.push(new B(Math.min(r.x,t.x),Math.min(r.y,t.y),Math.abs(r.x-t.x),Math.abs(r.y-t.y))));w.v(r);w.v(t);$l(this,!1);Hm(this,m,p,d,f);w.ta(m);w.ta(p);this.$d=!1}}}else this.cg();w.Db(e);c&&(this.kk=1,this.cg(),
        this.kk=null,this.Yx())}else c?(this.kk=1,this.cg(),this.kk=null,this.Yx()):this.cg()}};function Zl(a){!1===a.Fm&&(a.Fm=!0)}function Ml(a){!1===a.jl&&(a.jl=!0)}function Fm(a){!1!==a.Ir&&(a.Ir=!1,Km(a,a.Jb,a.Mb))}function Km(a,b,c){var d=a.Fb,e=a.Ed,f=b*e,e=c*e;if(d.width!==f||d.height!==e)d.width=f,d.height=e,d.style.width=b+"px",d.style.height=c+"px",a.Ce=!0,a.tf.Fe(!0)}
    function Kl(a){var b=a.Fb;if(null===b)return!0;var c=a.Nb,d=a.Jb,e=a.Mb,f=a.eE.copy();if(!f.I())return!0;var h=!1,k=a.gl?a.Hd:0,l=a.Vj?a.Hd:0,m=c.clientWidth||d+k,c=c.clientHeight||e+l;if(m!==d+k||c!==e+l)a.gl=!1,a.Vj=!1,l=k=0,a.Jb=m,a.Mb=c,h=a.Ir=!0;a.Fm=!1;var n=a.qb,p=a.se,q=0,r=0,s=0,u=0,m=n.width,c=n.height,t=a.hy;a.aA.Yc()?(p.width>m&&(q=t.left,r=t.right),p.height>c&&(s=t.top,u=t.bottom)):(q=t.left,r=t.right,s=t.top,u=t.bottom);var t=p.width+q+r,x=p.height+s+u,q=p.x-q,v=n.x,r=p.right+r,A=n.right+
        k,s=p.y-s,y=n.y,u=p.bottom+u,n=n.bottom+l,K="1px",E="1px",p=a.scale,P=!(t<m+k),$=!(x<c+l);if(a.gB!==sl||P||$)P&&a.xA&&a.oe&&(K=1,q+1<v&&(K=Math.max((v-q)*p+a.Jb,K)),r>A+1&&(K=Math.max((r-A)*p+a.Jb,K)),m+k+1<t&&(K=Math.max((t-m+k)*p+a.Jb,K)),K=K.toString()+"px"),$&&a.yA&&a.pe&&(E=1,s+1<y&&(E=Math.max((y-s)*p+a.Mb,E)),u>n+1&&(E=Math.max((u-n)*p+a.Mb,E)),c+l+1<x&&(E=Math.max((x-c+l)*p+a.Mb,E)),E=E.toString()+"px");var P="1px"!==K,S="1px"!==E;P&&S||!P&&!S||($=!(x<c+l),S&&(A-=a.Hd),P&&(n-=a.Hd),t<m+k||
    !a.xA||!a.oe||(K=1,q+1<v&&(K=Math.max((v-q)*p+a.Jb,K)),r>A+1&&(K=Math.max((r-A)*p+a.Jb,K)),m+1<t&&(K=Math.max((t-m)*p+a.Jb,K)),K=K.toString()+"px"),P="1px"!==K,k=P!==a.Vj?a.Mb-a.Hd:a.Mb,$&&a.yA&&a.pe&&(E=1,s+1<y&&(E=Math.max((y-s)*p+k,E)),u>n+1&&(E=Math.max((u-n)*p+k,E)),c+1<x&&(E=Math.max((x-c)*p+k,E)),E=E.toString()+"px"),S="1px"!==E);if(a.sw&&P===a.Vj&&S===a.gl)return d===a.Jb&&e===a.Mb||a.cg(),!1;P!==a.Vj&&(a.Mb="1px"===K?a.Mb+a.Hd:Math.max(a.Mb-a.Hd,1),h=!0);a.Vj=P;a.Ts.style.width=K;S!==a.gl&&
    (a.Jb="1px"===E?a.Jb+a.Hd:Math.max(a.Jb-a.Hd,1),h=!0,a.Mr&&(k=w.K(),S?(b.style.left=a.Hd+"px",a.position=k.m(a.jb.x+a.Hd/a.scale,a.jb.y)):(b.style.left="0px",a.position=k.m(a.jb.x-a.Hd/a.scale,a.jb.y)),w.v(k)));a.gl=S;a.Ts.style.height=E;b=a.ww;k=b.scrollLeft;a.xA&&a.oe&&(m+1<t?k=(a.position.x-q)*p:q+1<v?k=b.scrollWidth-b.clientWidth:r>A+1&&(k=a.position.x*p));if(a.Mr)switch(a.Bz){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=
        k;a.yA&&a.pe&&(c+1<x?b.scrollTop=(a.position.y-s)*p:s+1<y?b.scrollTop=b.scrollHeight-b.clientHeight:u>n+1&&(b.scrollTop=a.position.y*p));h&&(a.Ir=!0);m=a.Jb;c=a.Mb;b.style.width=m+(a.gl?a.Hd:0)+"px";b.style.height=c+(a.Vj?a.Hd:0)+"px";a.Dz=!1;return d!==m||e!==c||a.Oa.qc?(n=a.qb,a.yu(f,n,p,a.scale,h),!1):!0}
    D.prototype.add=D.prototype.add=function(a){w.G(a,R,D,"add:part");var b=a.g;if(b!==this){null!==b&&w.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.Fq&&(a.ql="Tool");var c=a.ag,b=this.Nt(c);null===b&&(b=this.Nt(""));null===b&&w.k('Cannot add a Part when unable find a Layer named "'+c+'" and there is no default Layer');a.layer!==b&&(c=b.Xp(99999999,a,a.g===this),0<=c&&this.ad(Pf,"parts",b,null,a,null,c),b.Mc||this.sc(),a.J(Lm),c=a.Hx,null!==
    c&&c(a,null,b))}};
    D.prototype.Xp=function(a){if(a instanceof T){if(this.ep.add(a),a instanceof V){var b=a.Da;null===b?this.Dl.add(a):b.bp.add(a);b=a.Tb;null!==b&&(b.g=this)}}else a instanceof W?this.Yo.add(a):a instanceof kh||this.zb.add(a);var c=this;Mm(a,function(a){Nm(c,a)});(a instanceof kh||a instanceof V&&null!==a.Lb)&&a.H();b=a.data;null!==b&&(a instanceof kh||(a instanceof W?this.Lj.add(b,a):this.Ei.add(b,a)),Mm(a,function(a){Om(c,a)}));!0!==Dm(a)&&!0!==Em(a)||this.xg.add(a);Pm(a,!0,this);Qm(a)?(a.W.I()&&this.oa(nl(a,
        a.W)),this.sc()):a.isVisible()&&a.W.I()&&this.oa(nl(a,a.W));this.Ne()};
    D.prototype.nf=function(a){a.Et();if(a instanceof T){if(this.ep.remove(a),a instanceof V){var b=a.Da;null===b?this.Dl.remove(a):b.bp.remove(a);b=a.Tb;null!==b&&(b.g=null)}}else a instanceof W?this.Yo.remove(a):a instanceof kh||this.zb.remove(a);var c=this;Mm(a,function(a){Rm(c,a)});b=a.data;null!==b&&(a instanceof kh||(a instanceof W?this.Lj.remove(b):this.Ei.remove(b)),Mm(a,function(a){Sm(c,a)}));this.xg.remove(a);Qm(a)?(a.W.I()&&this.oa(nl(a,a.W)),this.sc()):a.isVisible()&&a.W.I()&&this.oa(nl(a,
            a.W));this.Ne()};D.prototype.remove=D.prototype.remove=function(a){w.G(a,R,D,"remove:part");Tm(this,a,!0)};function Tm(a,b,c){var d=b.layer;null!==d&&d.g===a&&(b.ib=!1,b.Qg=!1,b.J(Um),c&&b.yn(),c=d.nf(-1,b,!1),0<=c&&a.ad(Qf,"parts",d,b,null,c,null),a=b.Hx,null!==a&&a(b,d,null))}
    D.prototype.removeParts=D.prototype.cB=function(a,b){if(w.isArray(a))for(var c=w.Za(a),d=0;d<c;d++){var e=w.Ba(a,d);b&&!e.canDelete()||this.remove(e)}else for(e=new I(R),e.Jc(a),c=e.i;c.next();)e=c.value,b&&!e.canDelete()||this.remove(e)};D.prototype.copyParts=D.prototype.Kp=function(a,b,c){return this.ob.Kp(a,b,c)};
    D.prototype.moveParts=D.prototype.moveParts=function(a,b,c){w.G(b,z,D,"moveParts:offset");var d=this.eb;if(null!==d){d=d.te;null===d&&(d=new oh,d.Rc(this));var e=new ma(R);if(null!==a)a=a.i;else{for(a=this.Lk;a.next();)Vh(d,e,a.value,c);for(a=this.ig;a.next();)Vh(d,e,a.value,c);a=this.links}for(;a.next();)Vh(d,e,a.value,c);d.moveParts(e,b,c)}};
    function Vm(a,b,c){w.G(b,qg,D,"addLayer:layer");null!==b.g&&b.g!==a&&w.k("Cannot share a Layer with another Diagram: "+b+" of "+b.g);null===c?null!==b.g&&w.k("Cannot add an existing Layer to this Diagram again: "+b):(w.G(c,qg,D,"addLayer:existingLayer"),c.g!==a&&w.k("Existing Layer must be in this Diagram: "+c+" not in "+c.g),b===c&&w.k("Cannot move a Layer before or after itself: "+b));if(b.g!==a){b=b.name;a=a.cc;c=a.count;for(var d=0;d<c;d++)a.ea(d).name===b&&w.k("Cannot add Layer with the name '"+
        b+"'; a Layer with the same name is already present in this Diagram.")}}D.prototype.addLayer=D.prototype.wt=function(a){Vm(this,a,null);a.Rc(this);var b=this.cc,c=b.count-1;if(!a.Mc)for(;0<=c&&b.ea(c).Mc;)c--;b.Qd(c+1,a);null!==this.me&&this.ad(Pf,"layers",this,null,a,null,c+1);this.oa();this.sc()};
    D.prototype.addLayerBefore=D.prototype.gH=function(a,b){Vm(this,a,b);a.Rc(this);var c=this.cc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.me&&this.ad(Qf,"layers",this,a,null,d,null));for(var e=c.count,f=0;f<e;f++)if(c.ea(f)===b){c.Qd(f,a);break}null!==this.me&&this.ad(Pf,"layers",this,null,a,null,f);this.oa();0>d&&this.sc()};
    D.prototype.addLayerAfter=function(a,b){Vm(this,a,b);a.Rc(this);var c=this.cc,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.me&&this.ad(Qf,"layers",this,a,null,d,null));for(var e=c.count,f=0;f<e;f++)if(c.ea(f)===b){c.Qd(f+1,a);break}null!==this.me&&this.ad(Pf,"layers",this,null,a,null,f+1);this.oa();0>d&&this.sc()};
    D.prototype.removeLayer=function(a){w.G(a,qg,D,"removeLayer:layer");a.g!==this&&w.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.g);if(""!==a.name){var b=this.cc,c=b.indexOf(a);if(b.remove(a)){for(b=a.zb.copy().i;b.next();){var d=b.value,e=d.ag;d.ag=e!==a.name?e:""}null!==this.me&&this.ad(Qf,"layers",this,a,null,c,null);this.oa();this.sc()}}};D.prototype.findLayer=D.prototype.Nt=function(a){for(var b=this.Ix;b.next();){var c=b.value;if(c.name===a)return c}return null};
    D.prototype.addModelChangedListener=D.prototype.iH=function(a){w.j(a,"function",D,"addModelChangedListener:listener");null===this.ih&&(this.ih=new H("function"));this.ih.add(a);this.aa.jn(a)};D.prototype.removeModelChangedListener=function(a){w.j(a,"function",D,"removeModelChangedListener:listener");null!==this.ih&&(this.ih.remove(a),0===this.ih.count&&(this.ih=null));this.aa.Bu(a)};
    D.prototype.addChangedListener=D.prototype.jn=function(a){w.j(a,"function",D,"addChangedListener:listener");null===this.zi&&(this.zi=new H("function"));this.zi.add(a)};D.prototype.removeChangedListener=D.prototype.Bu=function(a){w.j(a,"function",D,"removeChangedListener:listener");null!==this.zi&&(this.zi.remove(a),0===this.zi.count&&(this.zi=null))};
    D.prototype.Ww=function(a){this.wb||this.ia.iF(a);a.Ac!==Of&&(this.ri=!0);if(null!==this.zi){var b=this.zi,c=b.length;if(1===c)b=b.ea(0),b(a);else if(0!==c)for(var d=b.gc(),e=0;e<c;e++)b=d[e],b(a)}};D.prototype.raiseChangedEvent=D.prototype.ad=function(a,b,c,d,e,f,h){void 0===f&&(f=null);void 0===h&&(h=null);var k=new Cf;k.g=this;k.Ac=a;k.propertyName=b;k.object=c;k.oldValue=d;k.Aj=f;k.newValue=e;k.zj=h;this.Ww(k)};
    D.prototype.raiseChanged=D.prototype.h=function(a,b,c,d,e){this.ad(Nf,a,this,b,c,d,e)};w.u(D,{Oa:"animationManager"},function(){return this.VB});w.u(D,{ia:"undoManager"},function(){return this.me.ia});w.defineProperty(D,{wb:"skipsUndoManager"},function(){return this.dj},function(a){w.j(a,"boolean",D,"skipsUndoManager");this.dj=a;this.me.dj=a});w.defineProperty(D,{hA:"delaysLayout"},function(){return this.Ty},function(a){this.Ty=a});
    D.prototype.qn=function(a,b){if(null!==a&&a.g===this){var c=this.Pe;try{this.Pe=!0;var d=a.Ac,e;if(d===Nf){var f=a.object,h=a.propertyName,k=a.ka(b);w.La(f,h,k);if(f instanceof G){var l,m=f.U;null!==m&&m.de()}this.ri=!0}else if(d===Pf){var n=a.object,p=a.zj,f=a.newValue;if(n instanceof C)if("number"===typeof p&&f instanceof G){l=f;var q=n;b?q.nf(p):q.Qd(p,l);m=n.U;null!==m&&m.de()}else{if("number"===typeof p&&f instanceof Wg){var r=f,q=n;b?r.xe?q.ZF(p):q.XF(p):(e=r.xe?q.Nd(r.index):q.Md(r.index),
        e.Jp(r))}}else if(n instanceof qg){var s=!0===a.Aj;if("number"===typeof p&&f instanceof R){var m=f,u=n;b?(m.ib=!1,m.Qg=!1,m.de(),u.nf(s?p:-1,m,s)):u.Xp(p,m,s)}}else if(n instanceof D){if("number"===typeof p&&f instanceof qg){var t=f;b?this.cc.bd(p):(d=t,d.Rc(this),this.cc.Qd(p,d))}}else w.k("unknown ChangedEvent.Insert object: "+a.toString());this.ri=!0}else d===Qf?(n=a.object,p=a.Aj,f=a.oldValue,n instanceof C?"number"===typeof p&&f instanceof G?(q=n,b?q.Qd(p,f):q.nf(p)):"number"===typeof p&&f instanceof
        Wg&&(r=f,q=n,b?(e=r.xe?q.Nd(r.index):q.Md(r.index),e.Jp(r)):r.xe?q.ZF(p):q.XF(p)):n instanceof qg?(s=!0===a.zj,"number"===typeof p&&f instanceof R&&(m=f,u=n,b?u.Xp(p,m,s):(m.ib=!1,m.Qg=!1,m.de(),u.nf(s?p:-1,m,s)))):n instanceof D?"number"===typeof p&&f instanceof qg&&(t=f,b?(d=t,d.Rc(this),this.cc.Qd(p,d)):this.cc.bd(p)):w.k("unknown ChangedEvent.Remove object: "+a.toString()),this.ri=!0):d!==Of&&w.k("unknown ChangedEvent: "+a.toString())}finally{this.Pe=c}}};
    D.prototype.startTransaction=D.prototype.Hb=function(a){return this.ia.Hb(a)};D.prototype.commitTransaction=D.prototype.Wc=function(a){return this.ia.Wc(a)};D.prototype.rollbackTransaction=D.prototype.mq=function(){return this.ia.mq()};D.prototype.commit=function(a,b){this.ia.Hb(b);try{a(this)}finally{this.ia.Wc(b)}};D.prototype.updateAllTargetBindings=D.prototype.EG=function(a){void 0===a&&(a="");for(var b=this.Lk;b.next();)b.value.Ib(a);for(b=this.ig;b.next();)b.value.Ib(a);for(b=this.links;b.next();)b.value.Ib(a)};
    D.prototype.updateAllRelationshipsFromData=D.prototype.XJ=function(){for(var a=this.aa,b=new I,c=a.hg,d=0;d<c.length;d++){var e=c[d];b.add(e)}var f=[];this.ig.each(function(a){null===a.data||b.contains(a.data)||f.push(a.data)});this.Lk.each(function(a){null===a.data||b.contains(a.data)||f.push(a.data)});f.forEach(function(b){zg(a,b,!1)});for(d=0;d<c.length;d++){var e=c[d],h=this.xh(e);null===h&&yg(a,e,!1)}if(a instanceof Q){for(var k=new I,c=a.Rg,d=0;d<c.length;d++)e=c[d],k.add(e);var l=[];this.links.each(function(a){null===
    a.data||k.contains(a.data)||l.push(a.data)});l.forEach(function(b){ah(a,b,!1)});for(d=0;d<c.length;d++)e=c[d],h=this.Yf(e),null===h&&$g(a,e,!1)}for(d=this.Lk;d.next();)h=d.value,h.updateRelationshipsFromData();for(d=this.ig;d.next();)d.value.updateRelationshipsFromData();for(d=this.links;d.next();)h=d.value,h.updateRelationshipsFromData()};
    function Wm(a,b,c){if(a.Tc||a.$d)a.ub=c,c=a.Oa,c.qc&&il(c,b,a.ub);else if(a.Tc=!0,null===a.Fb)a.ub=c;else{var d=a.qb.copy(),e=a.Jb,f=a.Mb;d.width=a.Jb/b;d.height=a.Mb/b;var h=a.pm.x,k=a.pm.y,l=a.aA;isNaN(h)&&(l.uj()?l.sj(Yb)?h=0:l.sj(Zb)&&(h=e-1):h=l.Yc()?l.x*(e-1):e/2);isNaN(k)&&(l.uj()?l.sj(Xb)?k=0:l.sj($b)&&(k=f-1):k=l.Yc()?l.y*(f-1):f/2);null!==a.fG&&(c=a.fG(a,c));c<a.Ah&&(c=a.Ah);c>a.zh&&(c=a.zh);e=w.xb(a.jb.x+h/b-h/c,a.jb.y+k/b-k/c);a.position=e;w.v(e);a.ub=c;a.yu(d,a.qb,b,c,!1);a.Tc=!1;Ol(a,
        !1);c=a.Oa;c.qc&&il(c,b,a.ub);a.oa();Zl(a)}}
    D.prototype.yu=function(a,b,c,d,e){a.L(b)||(void 0===e&&(e=!1),e||Zl(this),Ml(this),d=this.Tb,null===d||!d.Ex||this.Ll!==ph||e||a.width===b.width&&a.height===b.height||d.J(),d=this.$a,!0===this.ll&&d instanceof ih&&(this.R.da=this.CB(this.R.ef),Bk(d,this)),this.Tc||this.nF(a,b),bm(this),this.ph.scale=c,this.ph.position.x=a.x,this.ph.position.y=a.y,this.ph.bounds.set(a),this.ph.isScroll=e,this.Aa("ViewportBoundsChanged",this.ph,a),this.GA&&this.links.each(function(a){a.$l&&a.W.Zf(b)&&a.$b()}))};
    function bm(a,b){void 0===b&&(b=null);var c=a.rd;if(null!==c&&c.visible){for(var d=w.mm(),e=1,f=1,h=c.xa.n,k=h.length,l=0;l<k;l++){var m=h[l],n=m.interval;2>n||(Xm(m.Cb)?f=f*n/Ae(f,n):e=e*n/Ae(e,n))}h=c.ux;d.m(f*h.width,e*h.height);h=f=l=k=0;if(null!==b)k=b.width,l=b.height,f=b.x,h=b.y;else{e=w.Jf();f=a.qb;e.m(f.x,f.y,f.width,f.height);for(h=a.lw.i;h.next();)f=h.value.qb,f.I()&&ab(e,f.x,f.y,f.width,f.height);if(!e.I()){w.Db(e);return}k=e.width;l=e.height;f=e.x;h=e.y;w.Db(e)}c.width=k+2*d.width;c.height=
        l+2*d.height;e=w.K();Na(f,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);w.Ck(d);c.U.location=e;w.v(e)}}D.prototype.clearSelection=D.prototype.Xw=function(){var a=0<this.selection.count;a&&this.Aa("ChangingSelection");nh(this);a&&this.Aa("ChangedSelection")};function nh(a){a=a.selection;if(0<a.count){for(var b=a.gc(),c=b.length,d=0;d<c;d++)b[d].ib=!1;a.Qa();a.clear();a.freeze()}}
    D.prototype.select=D.prototype.select=function(a){null!==a&&(w.G(a,R,D,"select:part"),a.layer.g===this&&(!a.ib||1<this.selection.count)&&(this.Aa("ChangingSelection"),nh(this),a.ib=!0,this.Aa("ChangedSelection")))};
    D.prototype.selectCollection=D.prototype.jG=function(a){this.Aa("ChangingSelection");nh(this);if(w.isArray(a))for(var b=w.Za(a),c=0;c<b;c++){var d=w.Ba(a,c);d instanceof R||w.k("Diagram.selectCollection given something that is not a Part: "+d);d.ib=!0}else for(a=a.i;a.next();)d=a.value,d instanceof R||w.k("Diagram.selectCollection given something that is not a Part: "+d),d.ib=!0;this.Aa("ChangedSelection")};
    D.prototype.clearHighlighteds=D.prototype.qH=function(){var a=this.Zl;if(0<a.count){for(var b=a.gc(),c=b.length,d=0;d<c;d++)b[d].Qg=!1;a.Qa();a.clear();a.freeze()}};D.prototype.highlight=function(a){null!==a&&a.layer.g===this&&(w.G(a,R,D,"highlight:part"),!a.Qg||1<this.Zl.count)&&(this.qH(),a.Qg=!0)};
    D.prototype.highlightCollection=function(a){for(var b=(new I(R)).Jc(a),c=this.Zl.copy().$x(b).i;c.next();)a=c.value,a.Qg=!1;for(b=b.i;b.next();)a=b.value,a instanceof R||w.k("Diagram.highlightCollection given something that is not a Part: "+a),a.Qg=!0};
    D.prototype.scroll=D.prototype.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.Hu:this.Gu);else if("page"===a)a=d?this.qb.height:this.qb.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.Hu:this.Gu),0),e*=c);else{if("document"===a){e=this.se;d=this.qb;c=w.K();"up"===b?this.position=c.m(d.x,e.y):"left"===b?this.position=c.m(e.x,d.y):"down"===b?this.position=c.m(d.x,e.bottom-d.height):"right"===b&&(this.position=c.m(e.right-d.width,
            d.y));w.v(c);return}w.k("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:w.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+b);this.position=c};D.prototype.scrollToRect=D.prototype.gG=function(a){var b=this.qb;b.xk(a)||(a=a.Ml,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};
    D.prototype.centerRect=D.prototype.wE=function(a){var b=this.qb;a=a.Ml;a.x-=b.width/2;a.y-=b.height/2;this.position=a};D.prototype.transformDocToView=D.prototype.BG=function(a){var b=this.hd;b.reset();1!==this.ub&&b.scale(this.ub);var c=this.jb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.hd)};
    D.prototype.transformViewToDoc=D.prototype.CB=function(a){var b=this.hd;b.reset();1!==this.ub&&b.scale(this.ub);var c=this.jb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return Pa(a.copy(),this.hd)};var ph;D.None=ph=w.p(D,"None",0);var Sl;D.Uniform=Sl=w.p(D,"Uniform",1);var Tl;D.UniformToFill=Tl=w.p(D,"UniformToFill",2);var Vi;D.CycleAll=Vi=w.p(D,"CycleAll",10);var Zi;D.CycleNotDirected=Zi=w.p(D,"CycleNotDirected",11);var aj;
    D.CycleNotDirectedFast=aj=w.p(D,"CycleNotDirectedFast",12);var bj;D.CycleNotUndirected=bj=w.p(D,"CycleNotUndirected",13);var Wi;D.CycleDestinationTree=Wi=w.p(D,"CycleDestinationTree",14);var Yi;D.CycleSourceTree=Yi=w.p(D,"CycleSourceTree",15);var sl;D.DocumentScroll=sl=w.p(D,"DocumentScroll",1);var Jm;D.InfiniteScroll=Jm=w.p(D,"InfiniteScroll",2);var ul;D.TreeParentCollapsed=ul=w.p(D,"TreeParentCollapsed",21);var Ym;D.AllParentsCollapsed=Ym=w.p(D,"AllParentsCollapsed",22);var Zm;
    D.AnyParentsCollapsed=Zm=w.p(D,"AnyParentsCollapsed",23);w.defineProperty(D,{YJ:"validCycle"},function(){return this.Jw},function(a){var b=this.Jw;b!==a&&(w.mb(a,D,D,"validCycle"),this.Jw=a,this.h("validCycle",b,a))});w.u(D,{Ix:"layers"},function(){return this.cc.i});w.defineProperty(D,{Cf:"isModelReadOnly"},function(){var a=this.me;return null===a?!1:a.hb},function(a){var b=this.me;null!==b&&(b.hb=a)});
    w.defineProperty(D,{hb:"isReadOnly"},function(){return this.Ni},function(a){var b=this.Ni;b!==a&&(w.j(a,"boolean",D,"isReadOnly"),this.Ni=a,this.h("isReadOnly",b,a))});w.defineProperty(D,{isEnabled:"isEnabled"},function(){return this.ff},function(a){var b=this.ff;b!==a&&(w.j(a,"boolean",D,"isEnabled"),this.ff=a,this.h("isEnabled",b,a))});
    w.defineProperty(D,{Tz:"allowClipboard"},function(){return this.Wu},function(a){var b=this.Wu;b!==a&&(w.j(a,"boolean",D,"allowClipboard"),this.Wu=a,this.h("allowClipboard",b,a))});w.defineProperty(D,{tk:"allowCopy"},function(){return this.Ok},function(a){var b=this.Ok;b!==a&&(w.j(a,"boolean",D,"allowCopy"),this.Ok=a,this.h("allowCopy",b,a))});
    w.defineProperty(D,{kn:"allowDelete"},function(){return this.Pk},function(a){var b=this.Pk;b!==a&&(w.j(a,"boolean",D,"allowDelete"),this.Pk=a,this.h("allowDelete",b,a))});w.defineProperty(D,{Bt:"allowDragOut"},function(){return this.Xu},function(a){var b=this.Xu;b!==a&&(w.j(a,"boolean",D,"allowDragOut"),this.Xu=a,this.h("allowDragOut",b,a))});
    w.defineProperty(D,{pE:"allowDrop"},function(){return this.Yu},function(a){var b=this.Yu;b!==a&&(w.j(a,"boolean",D,"allowDrop"),this.Yu=a,this.h("allowDrop",b,a))});w.defineProperty(D,{Tw:"allowTextEdit"},function(){return this.Yk},function(a){var b=this.Yk;b!==a&&(w.j(a,"boolean",D,"allowTextEdit"),this.Yk=a,this.h("allowTextEdit",b,a))});
    w.defineProperty(D,{Qw:"allowGroup"},function(){return this.Qk},function(a){var b=this.Qk;b!==a&&(w.j(a,"boolean",D,"allowGroup"),this.Qk=a,this.h("allowGroup",b,a))});w.defineProperty(D,{Uw:"allowUngroup"},function(){return this.Zk},function(a){var b=this.Zk;b!==a&&(w.j(a,"boolean",D,"allowUngroup"),this.Zk=a,this.h("allowUngroup",b,a))});
    w.defineProperty(D,{Dp:"allowInsert"},function(){return this.$u},function(a){var b=this.$u;b!==a&&(w.j(a,"boolean",D,"allowInsert"),this.$u=a,this.h("allowInsert",b,a))});w.defineProperty(D,{Ct:"allowLink"},function(){return this.Rk},function(a){var b=this.Rk;b!==a&&(w.j(a,"boolean",D,"allowLink"),this.Rk=a,this.h("allowLink",b,a))});
    w.defineProperty(D,{ln:"allowRelink"},function(){return this.Tk},function(a){var b=this.Tk;b!==a&&(w.j(a,"boolean",D,"allowRelink"),this.Tk=a,this.h("allowRelink",b,a))});w.defineProperty(D,{Jl:"allowMove"},function(){return this.Sk},function(a){var b=this.Sk;b!==a&&(w.j(a,"boolean",D,"allowMove"),this.Sk=a,this.h("allowMove",b,a))});
    w.defineProperty(D,{Rw:"allowReshape"},function(){return this.Uk},function(a){var b=this.Uk;b!==a&&(w.j(a,"boolean",D,"allowReshape"),this.Uk=a,this.h("allowReshape",b,a))});w.defineProperty(D,{Dt:"allowResize"},function(){return this.Vk},function(a){var b=this.Vk;b!==a&&(w.j(a,"boolean",D,"allowResize"),this.Vk=a,this.h("allowResize",b,a))});
    w.defineProperty(D,{Sw:"allowRotate"},function(){return this.Wk},function(a){var b=this.Wk;b!==a&&(w.j(a,"boolean",D,"allowRotate"),this.Wk=a,this.h("allowRotate",b,a))});w.defineProperty(D,{yf:"allowSelect"},function(){return this.Xk},function(a){var b=this.Xk;b!==a&&(w.j(a,"boolean",D,"allowSelect"),this.Xk=a,this.h("allowSelect",b,a))});
    w.defineProperty(D,{qE:"allowUndo"},function(){return this.av},function(a){var b=this.av;b!==a&&(w.j(a,"boolean",D,"allowUndo"),this.av=a,this.h("allowUndo",b,a))});w.defineProperty(D,{Vw:"allowZoom"},function(){return this.cv},function(a){var b=this.cv;b!==a&&(w.j(a,"boolean",D,"allowZoom"),this.cv=a,this.h("allowZoom",b,a))});
    w.defineProperty(D,{yA:"hasVerticalScrollbar"},function(){return this.Gv},function(a){var b=this.Gv;b!==a&&(w.j(a,"boolean",D,"hasVerticalScrollbar"),this.Gv=a,Zl(this),this.oa(),this.h("hasVerticalScrollbar",b,a),Ol(this,!1))});w.defineProperty(D,{xA:"hasHorizontalScrollbar"},function(){return this.Fv},function(a){var b=this.Fv;b!==a&&(w.j(a,"boolean",D,"hasHorizontalScrollbar"),this.Fv=a,Zl(this),this.oa(),this.h("hasHorizontalScrollbar",b,a),Ol(this,!1))});
    w.defineProperty(D,{oe:"allowHorizontalScroll"},function(){return this.Zu},function(a){var b=this.Zu;b!==a&&(w.j(a,"boolean",D,"allowHorizontalScroll"),this.Zu=a,this.h("allowHorizontalScroll",b,a),Ol(this,!1))});w.defineProperty(D,{pe:"allowVerticalScroll"},function(){return this.bv},function(a){var b=this.bv;b!==a&&(w.j(a,"boolean",D,"allowVerticalScroll"),this.bv=a,this.h("allowVerticalScroll",b,a),Ol(this,!1))});
    w.defineProperty(D,{Gu:"scrollHorizontalLineChange"},function(){return this.tw},function(a){var b=this.tw;b!==a&&(w.j(a,"number",D,"scrollHorizontalLineChange"),0>a&&w.Fa(a,">= 0",D,"scrollHorizontalLineChange"),this.tw=a,this.h("scrollHorizontalLineChange",b,a))});
    w.defineProperty(D,{Hu:"scrollVerticalLineChange"},function(){return this.xw},function(a){var b=this.xw;b!==a&&(w.j(a,"number",D,"scrollVerticalLineChange"),0>a&&w.Fa(a,">= 0",D,"scrollVerticalLineChange"),this.xw=a,this.h("scrollVerticalLineChange",b,a))});w.defineProperty(D,{R:"lastInput"},function(){return this.Rb},function(a){this.Rb=a});w.defineProperty(D,{Bc:"firstInput"},function(){return this.Li},function(a){this.Li=a});
    w.defineProperty(D,{ec:"currentCursor"},function(){return this.mv},function(a){""===a&&(a=this.jr);var b=this.mv;if(b!==a){w.j(a,"string",D,"currentCursor");var c=this.Fb,d=this.Nb;null!==c&&(this.mv=a,c.style.cursor=a,d.style.cursor=a,c.style.cursor===b&&(c.style.cursor="-webkit-"+a,d.style.cursor="-webkit-"+a,c.style.cursor===b&&(c.style.cursor="-moz-"+a,d.style.cursor="-moz-"+a,c.style.cursor===b&&(c.style.cursor=a,d.style.cursor=a))))}});
    w.defineProperty(D,{MK:"defaultCursor"},function(){return this.jr},function(a){""===a&&(a="auto");var b=this.jr;b!==a&&(w.j(a,"string",D,"defaultCursor"),this.jr=a,this.h("defaultCursor",b,a))});w.defineProperty(D,{click:"click"},function(){return this.Ai},function(a){var b=this.Ai;b!==a&&(null!==a&&w.j(a,"function",D,"click"),this.Ai=a,this.h("click",b,a))});
    w.defineProperty(D,{Jt:"doubleClick"},function(){return this.Ii},function(a){var b=this.Ii;b!==a&&(null!==a&&w.j(a,"function",D,"doubleClick"),this.Ii=a,this.h("doubleClick",b,a))});w.defineProperty(D,{bA:"contextClick"},function(){return this.Ci},function(a){var b=this.Ci;b!==a&&(null!==a&&w.j(a,"function",D,"contextClick"),this.Ci=a,this.h("contextClick",b,a))});
    w.defineProperty(D,{SA:"mouseOver"},function(){return this.Xi},function(a){var b=this.Xi;b!==a&&(null!==a&&w.j(a,"function",D,"mouseOver"),this.Xi=a,this.h("mouseOver",b,a))});w.defineProperty(D,{RA:"mouseHover"},function(){return this.Wi},function(a){var b=this.Wi;b!==a&&(null!==a&&w.j(a,"function",D,"mouseHover"),this.Wi=a,this.h("mouseHover",b,a))});
    w.defineProperty(D,{QA:"mouseHold"},function(){return this.Vi},function(a){var b=this.Vi;b!==a&&(null!==a&&w.j(a,"function",D,"mouseHold"),this.Vi=a,this.h("mouseHold",b,a))});w.defineProperty(D,{cJ:"mouseDragOver"},function(){return this.ew},function(a){var b=this.ew;b!==a&&(null!==a&&w.j(a,"function",D,"mouseDragOver"),this.ew=a,this.h("mouseDragOver",b,a))});
    w.defineProperty(D,{PA:"mouseDrop"},function(){return this.Ui},function(a){var b=this.Ui;b!==a&&(null!==a&&w.j(a,"function",D,"mouseDrop"),this.Ui=a,this.h("mouseDrop",b,a))});w.defineProperty(D,{yB:"toolTip"},function(){return this.ej},function(a){var b=this.ej;b!==a&&(this.ej=a,this.h("toolTip",b,a))});w.defineProperty(D,{contextMenu:"contextMenu"},function(){return this.Di},function(a){var b=this.Di;b!==a&&(this.Di=a,this.h("contextMenu",b,a))});
    w.defineProperty(D,{ob:"commandHandler"},function(){return this.My},function(a){var b=this.My;b!==a&&(w.G(a,sg,D,"commandHandler"),null!==a.g&&w.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Rc(null),this.My=a,a.Rc(this))});w.defineProperty(D,{eb:"toolManager"},function(){return this.Mz},function(a){var b=this.Mz;b!==a&&(w.G(a,ih,D,"toolManager"),null!==a.g&&w.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Rc(null),this.Mz=a,a.Rc(this))});
    w.defineProperty(D,{Ht:"defaultTool"},function(){return this.Sy},function(a){var b=this.Sy;b!==a&&(w.G(a,rg,D,"defaultTool"),this.Sy=a,this.$a===b&&(this.$a=a))});w.defineProperty(D,{$a:"currentTool"},function(){return this.Py},function(a){var b=this.Py;null!==b&&(b.sa&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.Ht);null!==a&&(w.G(a,rg,D,"currentTool"),this.Py=a,a.Rc(this),a.doStart())});w.u(D,{selection:"selection"},function(){return this.zw});
    w.defineProperty(D,{UI:"maxSelectionCount"},function(){return this.aw},function(a){var b=this.aw;if(b!==a)if(w.j(a,"number",D,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.aw=a,this.h("maxSelectionCount",b,a),!this.ia.ab&&(a=this.selection.count-a,0<a)){this.Aa("ChangingSelection");for(var b=this.selection.gc(),c=0;c<a;c++)b[c].ib=!1;this.Aa("ChangedSelection")}}else w.Fa(a,">= 0",D,"maxSelectionCount")});
    w.defineProperty(D,{fJ:"nodeSelectionAdornmentTemplate"},function(){return this.fw},function(a){var b=this.fw;b!==a&&(w.G(a,kh,D,"nodeSelectionAdornmentTemplate"),this.fw=a,this.h("nodeSelectionAdornmentTemplate",b,a))});w.defineProperty(D,{iI:"groupSelectionAdornmentTemplate"},function(){return this.Dv},function(a){var b=this.Dv;b!==a&&(w.G(a,kh,D,"groupSelectionAdornmentTemplate"),this.Dv=a,this.h("groupSelectionAdornmentTemplate",b,a))});
    w.defineProperty(D,{NI:"linkSelectionAdornmentTemplate"},function(){return this.Wv},function(a){var b=this.Wv;b!==a&&(w.G(a,kh,D,"linkSelectionAdornmentTemplate"),this.Wv=a,this.h("linkSelectionAdornmentTemplate",b,a))});w.u(D,{Zl:"highlighteds"},function(){return this.Hv});
    w.defineProperty(D,{ri:"isModified"},function(){var a=this.ia;return a.isEnabled?null!==a.mj?!0:this.Ov&&this.fh!==a.rj:this.Ov},function(a){if(this.Ov!==a){w.j(a,"boolean",D,"isModified");this.Ov=a;var b=this.ia;!a&&b.isEnabled&&(this.fh=b.rj);a||$m(this)}});function $m(a){var b=a.ri;a.fE!==b&&(a.fE=b,a.Aa("Modified"))}
    w.defineProperty(D,{aa:"model"},function(){return this.me},function(a){var b=this.me;if(b!==a){w.G(a,F,D,"model");this.$a.doCancel();null!==b&&b.ia!==a.ia&&b.ia.vF&&w.k("Do not replace a Diagram.model while a transaction is in progress.");this.Oa.Gh();this.Xw();this.gh=!1;this.Ho=!0;this.fh=-2;this.Uf=!1;var c=this.$d;this.$d=!0;this.Oa.Wn("Model");null!==b&&(null!==this.ih&&this.ih.each(function(a){b.Bu(a)}),b.Bu(this.kD),b instanceof Q&&an(this,b.Rg),an(this,b.hg));this.me=a;a.jn(this.jD);bn(this,
        a.hg);a instanceof Q&&cn(this,a.Rg);a.Bu(this.jD);a.jn(this.kD);null!==this.ih&&this.ih.each(function(b){a.jn(b)});this.$d=c;this.Tc||this.oa();null!==b&&(a.ia.isEnabled=b.ia.isEnabled)}});w.defineProperty(D,{Ta:null},function(){return this.bD},function(a){this.bD=a});w.u(D,{Lx:null},function(){return this.QG});
    function wl(a,b){if(b.aa===a.aa){var c=b.Ac,d=b.propertyName;if(c===Of&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.eb,c.df.each(function(b){b.Rc(a)}),c.dg.each(function(b){b.Rc(a)}),c.eg.each(function(b){b.Rc(a)}),a.$d||a.gh||(a.tv=!0,a.Ho&&(a.Uf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Oa;e.of&&!a.wb&&e.Gh();a.Aa("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Oa,e.of&&!a.wb&&e.Gh());else if(a.Ta){a.Ta=!1;try{var f=b.qf;if(""!==f)if(c===Nf){if("linkFromKey"===f){var h=
        b.object,k=a.Yf(h);if(null!==k){var l=b.newValue,m=a.Ke(l);k.Y=m}}else if("linkToKey"===f)h=b.object,k=a.Yf(h),null!==k&&(l=b.newValue,m=a.Ke(l),k.$=m);else if("linkFromPortId"===f){if(h=b.object,k=a.Yf(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.Pg=n)}}else if("linkToPortId"===f)h=b.object,k=a.Yf(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Hh=n));else if("nodeGroupKey"===f){var h=b.object,p=a.xh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.Ke(q);p.Da=r instanceof V?r:
        null}else p.Da=null}}else if("linkLabelKeys"===f){if(h=b.object,k=a.Yf(h),null!==k){var s=b.oldValue,u=b.newValue;if(w.isArray(s))for(var t=w.Za(s),x=0;x<t;x++){var v=w.Ba(s,x),m=a.Ke(v);null!==m&&(m.Wb=null)}if(w.isArray(u))for(t=w.Za(u),x=0;x<t;x++)v=w.Ba(u,x),m=a.Ke(v),null!==m&&(m.Wb=k)}}else if("nodeParentKey"===f){var A=b.object,y=a.Ke(b.newValue),K=a.ox(A);if(null!==K){var E=K.An();null!==E?null===y?a.remove(E):a.Td?E.Y=y:E.$=y:dn(a,y,K)}}else if("parentLinkCategory"===f){var A=b.object,K=
        a.ox(A),P=b.newValue;null!==K&&"string"===typeof P&&(E=K.An(),null!==E&&(E.vd=P))}else if("nodeCategory"===f){var h=b.object,$=a.xh(h),P=b.newValue;null!==$&&"string"===typeof P&&($.vd=P)}else if("linkCategory"===f){var h=b.object,S=a.Yf(h),P=b.newValue;null!==S&&"string"===typeof P&&(S.vd=P)}else if("nodeDataArray"===f){var ba=b.oldValue;an(a,ba);var ga=b.newValue;bn(a,ga)}else"linkDataArray"===f&&(ba=b.oldValue,an(a,ba),ga=b.newValue,cn(a,ga));a.ri=!0}else c===Pf?(ga=b.newValue,"nodeDataArray"===
    f&&w.Pa(ga)?en(a,ga):"linkDataArray"===f&&w.Pa(ga)?fn(a,ga):"linkLabelKeys"===f&&xg(ga)&&(k=a.Yf(b.object),m=a.Ke(ga),null!==k&&null!==m&&(m.Wb=k)),a.ri=!0):c===Qf?(ba=b.oldValue,"nodeDataArray"===f&&w.Pa(ba)?gn(a,ba):"linkDataArray"===f&&w.Pa(ba)?gn(a,ba):"linkLabelKeys"===f&&xg(ba)&&(m=a.Ke(ba),null!==m&&(m.Wb=null)),a.ri=!0):c===Of&&("SourceChanged"===f?null!==b.object?vl(a,b.object,b.propertyName):(a.XJ(),a.EG()):"ModelDisplaced"===f&&a.fm());else if(c===Nf){var ya=b.propertyName,h=b.object;if(h===
        a.aa){if("nodeKeyProperty"===ya||"nodeCategoryProperty"===ya||"linkFromKeyProperty"===ya||"linkToKeyProperty"===ya||"linkFromPortIdProperty"===ya||"linkToPortIdProperty"===ya||"linkLabelKeysProperty"===ya||"nodeIsGroupProperty"===ya||"nodeGroupKeyProperty"===ya||"nodeParentKeyProperty"===ya||"linkCategoryProperty"===ya)a.ia.ab||a.fm()}else vl(a,h,ya);a.ri=!0}else if(c===Pf||c===Qf)hn(a,b),a.ri=!0;else if(c===Of){if("FinishedUndo"===d||"FinishedRedo"===d)a.ia.Pf=!0,a.Aa("ChangedSelection"),Hi(a),a.ia.Pf=
        !1;e=a.Oa;"RolledBackTransaction"===d&&e.Gh();a.tv=!0;a.cg();0===a.ia.Ih&&Rk(e);"CommittedTransaction"===d&&a.ia.pz&&(a.fh=Math.min(a.fh,a.ia.rj-1));var Fa=b.AF;Fa&&($m(a),a.Lx.clear());!a.wz&&Fa&&(a.wz=!0,w.setTimeout(function(){a.$a.standardMouseOver();a.wz=!1},10))}}finally{a.Ta=!0}}}}
    function vl(a,b,c){if("string"===typeof c){var d=a.xh(b);if(null!==d)d.Ib(c),a.aa instanceof $f&&(d=a.Yf(b),null!==d&&d.Ib(c));else{for(var d=null,e=a.Im.i;e.next();){for(var f=e.value,h=0;h<f.length;h++){var k=f[h].UH(b);null!==k&&(null===d&&(d=w.cb()),d.push(k))}if(null!==d)break}if(null!==d){for(e=0;e<d.length;e++)d[e].Ib(c);w.ta(d)}}b===a.aa.Ik&&a.EG(c)}}w.defineProperty(D,{Pe:"skipsModelSourceBindings"},function(){return this.GD},function(a){this.GD=a});
    w.defineProperty(D,{Nu:null},function(){return this.Hz},function(a){this.Hz=a});function hn(a,b){var c=b.Ac===Pf,d=c?b.zj:b.Aj,e=c?b.newValue:b.oldValue,f=a.Im.ka(b.object);if(Array.isArray(f))for(var h=0;h<f.length;h++){var k=f[h];if(c)jn(k,e,d);else{var l=d;if(!(0>l)){var m=l;kn(k)&&m++;k.nf(m,!0);ln(k,m,l)}}}}function Om(a,b){var c=b.$j;if(w.isArray(c)){var d=a.Im.ka(c);if(null===d)d=[],d.push(b),a.Im.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
    function Sm(a,b){var c=b.$j;if(w.isArray(c)){var d=a.Im.ka(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.Im.remove(c);break}}}function Nm(a,b){for(var c=b.xa.n,d=c.length,e=0;e<d;e++){var f=c[e];f instanceof xl&&mn(a,f)}}
    function mn(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var d=b.Ue;null!==d&&(d.Jo instanceof Event&&null!==b.Ve&&b.Ve(b,d.Jo),!0===d.Nv&&(null!==b.ki&&b.ki(b,d.Cz),null!==b.g&&b.g.zz.add(b)));c=c.src;d=a.gp.ka(c);if(null===d)d=[],d.push(b),a.gp.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}function Rm(a,b){for(var c=b.xa.n,d=c.length,e=0;e<d;e++){var f=c[e];f instanceof xl&&nn(a,f)}}
    function nn(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var c=c.src,d=a.gp.ka(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.gp.remove(c);break}}}
    D.prototype.rebuildParts=D.prototype.fm=function(){for(var a=this.VA.i;a.next();){var b=a.value,c=a.key;(!b.ee()||b instanceof V)&&w.k('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.wA.i;a.next();)b=a.value,c=a.key,b instanceof V||w.k('Invalid group template in Diagram.groupTemplateMap: template for "'+c+'" must be a Group, not a normal Node or Link: '+b);for(a=this.JA.i;a.next();)b=a.value,c=a.key,b instanceof
    W||w.k('Invalid link template in Diagram.linkTemplateMap: template for "'+c+'" must be a Link, not a normal Node or simple Part: '+b);a=w.cb();for(b=this.selection.i;b.next();)(c=b.value.data)&&a.push(c);for(var b=w.cb(),d=this.Zl.i;d.next();)(c=d.value.data)&&b.push(c);c=w.cb();for(d=this.ig.i;d.next();){var e=d.value;null!==e.data&&(c.push(e.data),c.push(e.location))}for(d=this.links.i;d.next();)e=d.value,null!==e.data&&(c.push(e.data),c.push(e.location));for(d=this.Lk.i;d.next();)e=d.value,null!==
    e.data&&(c.push(e.data),c.push(e.location));d=this.aa;d instanceof Q&&an(this,d.Rg);an(this,d.hg);bn(this,d.hg);d instanceof Q&&cn(this,d.Rg);for(d=0;d<a.length;d++)e=this.xh(a[d]),null!==e&&(e.ib=!0);for(d=0;d<b.length;d++)e=this.xh(b[d]),null!==e&&(e.Qg=!0);for(d=0;d<c.length;d+=2)e=this.xh(c[d]),null!==e&&(e.location=c[d+1]);w.ta(a);w.ta(b);w.ta(c)};
    function bn(a,b){if(null!==b){for(var c=a.aa,d=c instanceof Q,e=w.Za(b),f=0;f<e;f++){var h=w.Ba(b,f);c.He(h)?en(a,h,!1):d&&fn(a,h)}if(d||c instanceof $f){for(f=0;f<e;f++)h=w.Ba(b,f),c.He(h)&&on(a,h);if(d)for(c=a.links;c.next();)pn(c.value)}qn(a,!1)}}function en(a,b,c){if(void 0!==b&&null!==b&&!a.ia.ab&&!a.Ei.contains(b)){void 0===c&&(c=!0);var d=a.sA(b),e=rn(a,b,d);if(null!==e&&(mh(e),e=e.copy(),null!==e)){var f=a.Pe;a.Pe=!0;e.yi=d;e.Zd=b;a.add(e);e.Zd=null;e.data=b;c&&on(a,b);a.Pe=f}}}
    D.prototype.sA=function(a){return this.aa.sA(a)};var sn=!1,tn=!1;function rn(a,b,c){var d=!1,e=a.aa;e instanceof Q&&(d=e.EA(b));d?(b=a.wA.ka(c),null===b&&(b=a.wA.ka(""),null===b&&(tn||(tn=!0,w.trace('No Group template found for category "'+c+'"'),w.trace("  Using default group template")),b=a.uC))):(b=a.VA.ka(c),null===b&&(b=a.VA.ka(""),null===b&&(sn||(sn=!0,w.trace('No Node template found for category "'+c+'"'),w.trace("  Using default node template")),b=a.wC)));return b}
    function on(a,b){var c=a.aa;if(c instanceof Q||c instanceof $f){var d=c.pb(b);if(void 0!==d){var e=Ag(c,d),f=a.xh(b);if(null!==e&&null!==f){for(e=e.i;e.next();){var h=e.value;if(c instanceof Q){var k=c;if(k.He(h)){if(f instanceof V&&k.Cn(h)===d){var l=f,h=a.xh(h);null!==h&&(h.Da=l)}}else{var m=a.Yf(h);if(null!==m&&f instanceof T&&(l=f,k.Xl(h)===d&&(m.Y=l),k.Yl(h)===d&&(m.$=l),h=k.Dk(h),w.isArray(h)))for(k=0;k<w.Za(h);k++)if(w.Ba(h,k)===d){l.Wb=m;break}}}else c instanceof $f&&(m=c,m.He(h)&&f instanceof
    T&&(l=f,m.En(h)===d&&(h=a.ox(h),dn(a,l,h))))}Ug(c,d)}c instanceof Q?(c=c.Cn(b),void 0!==c&&(c=a.Ke(c),c instanceof V&&(f.Da=c))):c instanceof $f&&(c=c.En(b),void 0!==c&&f instanceof T&&(l=f,f=a.Ke(c),dn(a,f,l)))}}}
    function dn(a,b,c){if(null!==b&&null!==c){var d=a.eb.FF,e=b,f=c;if(a.Td)for(b=f.ge;b.next();){if(b.value.$===f)return}else for(e=c,f=b,b=e.ge;b.next();)if(b.value.Y===e)return;if(null===d||!Xi(d,e,f,null,!0))if(d=a.sx(c.data),b=un(a,d),null!==b&&(mh(b),b=b.copy(),null!==b)){var h=a.Pe;a.Pe=!0;b.yi=d;b.Zd=c.data;b.Y=e;b.$=f;a.add(b);b.Zd=null;b.data=c.data;a.Pe=h}}}function cn(a,b){if(null!==b){for(var c=w.Za(b),d=0;d<c;d++){var e=w.Ba(b,d);fn(a,e)}qn(a,!1)}}
    function fn(a,b){if(void 0!==b&&null!==b&&!a.ia.ab&&!a.Lj.contains(b)){var c=a.sx(b),d=un(a,c);if(null!==d&&(mh(d),d=d.copy(),null!==d)){var e=a.Pe;a.Pe=!0;d.yi=c;d.Zd=b;var c=a.aa,f=c.aI(b);""!==f&&(d.Pg=f);f=c.Xl(b);void 0!==f&&(f=a.Ke(f),f instanceof T&&(d.Y=f));f=c.eI(b);""!==f&&(d.Hh=f);f=c.Yl(b);void 0!==f&&(f=a.Ke(f),f instanceof T&&(d.$=f));c=c.Dk(b);if(w.isArray(c))for(var f=w.Za(c),h=0;h<f;h++){var k=w.Ba(c,h),k=a.Ke(k);null!==k&&(k.Wb=d)}a.add(d);d.Zd=null;d.data=b;a.Pe=e}}}
    D.prototype.sx=function(a){var b=this.aa,c="";b instanceof Q?c=b.sx(a):b instanceof $f&&(c=b.cI(a));return c};var vn=!1;function un(a,b){var c=a.JA.ka(b);null===c&&(c=a.JA.ka(""),null===c&&(vn||(vn=!0,w.trace('No Link template found for category "'+b+'"'),w.trace("  Using default link template")),c=a.vC));return c}function an(a,b){for(var c=w.Za(b),d=0;d<c;d++){var e=w.Ba(b,d);gn(a,e)}}
    function gn(a,b){if(void 0!==b&&null!==b){var c=a.xh(b);if(null!==c){Tm(a,c,!1);var d=a.aa;if(d instanceof Q&&c instanceof T){var e=d.pb(c.data);if(void 0!==e){for(var f=c.ge;f.next();)Bg(d,e,f.value.data);c.Bf&&(f=c.Wb,null!==f&&Bg(d,e,f.data));if(c instanceof V)for(c=c.Oc;c.next();)f=c.value.data,d.He(f)&&Bg(d,e,f)}}else if(d instanceof $f&&c instanceof T){f=a.Yf(c.data);if(null!==f){f.ib=!1;f.Qg=!1;var h=f.layer;if(null!==h){var k=h.nf(-1,f,!1);0<=k&&a.ad(Qf,"parts",h,f,null,k,null);k=f.Hx;null!==
    k&&k(f,h,null)}}f=a.Td;for(c=c.ge;c.next();)h=c.value,h=(f?h.$:h.Y).data,d.He(h)&&Bg(d,e,h)}}}}D.prototype.findPartForKey=D.prototype.VH=function(a){if(null===a||void 0===a)return null;var b=this.aa.ve(a);return null!==b?this.Ei.ka(b):this.aa instanceof Q&&(b=this.aa.Rp(a),null!==b)?this.Lj.ka(b):null};D.prototype.findNodeForKey=D.prototype.Ke=function(a){if(null===a||void 0===a)return null;a=this.aa.ve(a);if(null===a)return null;a=this.Ei.ka(a);return a instanceof T?a:null};
    D.prototype.findPartForData=D.prototype.xh=function(a){if(null===a)return null;var b=this.Ei.ka(a);return null!==b?b:b=this.Lj.ka(a)};D.prototype.findNodeForData=D.prototype.ox=function(a){if(null===a)return null;a=this.Ei.ka(a);return a instanceof T?a:null};D.prototype.findLinkForData=D.prototype.Yf=function(a){return null===a?null:this.Lj.ka(a)};
    D.prototype.findNodesByExample=function(a){for(var b=new I(T),c=this.ep.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var h=arguments[f];if(w.Pa(h)&&wn(this,e,h)){b.add(d);break}}}return b.i};D.prototype.findLinksByExample=function(a){for(var b=new I(W),c=this.Yo.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var f=0;f<arguments.length;f++){var h=arguments[f];if(w.Pa(h)&&wn(this,e,h)){b.add(d);break}}}return b.i};
    function wn(a,b,c){for(var d in c){var e=b[d],f=c[d];if(w.isArray(f)){if(!w.isArray(e)||e.length<f.length)return!1;for(var h=0;h<e.length;h++){var k=e[h],l=f[h];if(void 0!==l&&!xn(a,k,l))return!1}}else if(!xn(a,e,f))return!1}return!0}function xn(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(w.Pa(b)&&w.Pa(c)){if(!wn(a,b,c))return!1}else if(b!==c)return!1;return!0}
    w.defineProperty(D,{wL:"nodeTemplate"},function(){return this.Yi.ka("")},function(a){var b=this.Yi.ka("");b!==a&&(w.G(a,R,D,"nodeTemplate"),this.Yi.add("",a),this.h("nodeTemplate",b,a),this.ia.ab||this.fm())});w.defineProperty(D,{VA:"nodeTemplateMap"},function(){return this.Yi},function(a){var b=this.Yi;b!==a&&(w.G(a,ma,D,"nodeTemplateMap"),this.Yi=a,this.h("nodeTemplateMap",b,a),this.ia.ab||this.fm())});
    w.defineProperty(D,{$K:"groupTemplate"},function(){return this.el.ka("")},function(a){var b=this.el.ka("");b!==a&&(w.G(a,V,D,"groupTemplate"),this.el.add("",a),this.h("groupTemplate",b,a),this.ia.ab||this.fm())});w.defineProperty(D,{wA:"groupTemplateMap"},function(){return this.el},function(a){var b=this.el;b!==a&&(w.G(a,ma,D,"groupTemplateMap"),this.el=a,this.h("groupTemplateMap",b,a),this.ia.ab||this.fm())});
    w.defineProperty(D,{lL:"linkTemplate"},function(){return this.ak.ka("")},function(a){var b=this.ak.ka("");b!==a&&(w.G(a,W,D,"linkTemplate"),this.ak.add("",a),this.h("linkTemplate",b,a),this.ia.ab||this.fm())});w.defineProperty(D,{JA:"linkTemplateMap"},function(){return this.ak},function(a){var b=this.ak;b!==a&&(w.G(a,ma,D,"linkTemplateMap"),this.ak=a,this.h("linkTemplateMap",b,a),this.ia.ab||this.fm())});w.defineProperty(D,{AI:null},function(){return this.ll},function(a){this.ll=a});
    w.defineProperty(D,{cf:"isMouseCaptured"},function(){return this.ZC},function(a){var b=this.Fb;null!==b&&(a?(this.R.bubbles=!1,b.removeEventListener("mousemove",this.Rn,!1),b.removeEventListener("mousedown",this.Qn,!1),b.removeEventListener("mouseup",this.Tn,!1),b.removeEventListener("mousewheel",this.Sg,!1),b.removeEventListener("DOMMouseScroll",this.Sg,!1),b.removeEventListener("mouseout",this.Sn,!1),window.addEventListener("mousemove",this.Rn,!0),window.addEventListener("mousedown",this.Qn,!0),
        window.addEventListener("mouseup",this.Tn,!0),window.addEventListener("mousewheel",this.Sg,!0),window.addEventListener("DOMMouseScroll",this.Sg,!0),window.addEventListener("mouseout",this.Sn,!0),window.addEventListener("selectstart",this.preventDefault,!1)):(window.removeEventListener("mousemove",this.Rn,!0),window.removeEventListener("mousedown",this.Qn,!0),window.removeEventListener("mouseup",this.Tn,!0),window.removeEventListener("mousewheel",this.Sg,!0),window.removeEventListener("DOMMouseScroll",
        this.Sg,!0),window.removeEventListener("mouseout",this.Sn,!0),window.removeEventListener("selectstart",this.preventDefault,!1),b.addEventListener("mousemove",this.Rn,!1),b.addEventListener("mousedown",this.Qn,!1),b.addEventListener("mouseup",this.Tn,!1),b.addEventListener("mousewheel",this.Sg,!1),b.addEventListener("DOMMouseScroll",this.Sg,!1),b.addEventListener("mouseout",this.Sn,!1)),this.ZC=a)});
    w.defineProperty(D,{position:"position"},function(){return this.jb},function(a){var b=this.jb;if(!b.L(a)){w.G(a,z,D,"position");var c=this.qb.copy();a=a.copy();if(!this.Tc&&null!==this.Fb){this.Tc=!0;var d=this.scale;Ql(this,a,this.se,this.Jb/d,this.Mb/d,this.to,!1);this.Tc=!1}this.jb=a.S();a=this.Oa;a.qc&&hl(a,b,this.jb);this.Tc||this.yu(c,this.qb,this.ub,this.ub,!1)}});
    w.defineProperty(D,{qI:"initialPosition"},function(){return this.Jv},function(a){this.Jv.L(a)||(w.G(a,z,D,"initialPosition"),this.Jv=a.S())});w.defineProperty(D,{rI:"initialScale"},function(){return this.Kv},function(a){this.Kv!==a&&(w.j(a,"number",D,"initialScale"),this.Kv=a)});
    w.defineProperty(D,{Fn:"grid"},function(){null===this.rd&&Hl(this);return this.rd},function(a){var b=this.rd;if(b!==a){null===b&&(Hl(this),b=this.rd);w.G(a,C,D,"grid");a.type!==Il&&w.k("Diagram.grid must be a Panel of type Panel.Grid");var c=b.Q;null!==c&&c.remove(b);this.rd=a;a.name="GRID";null!==c&&c.add(a);bm(this);this.oa();this.h("grid",b,a)}});
    w.u(D,{qb:"viewportBounds"},function(){var a=this.eE;if(null===this.Fb)return a;var b=this.jb,c=this.ub;a.m(b.x,b.y,Math.max(this.Jb,0)/c,Math.max(this.Mb,0)/c);return a});w.defineProperty(D,{WE:"fixedBounds"},function(){return this.Bv},function(a){var b=this.Bv;b.L(a)||(w.G(a,B,D,"fixedBounds"),-Infinity!==a.width&&Infinity!==a.height&&-Infinity!==a.height||w.k("fixedBounds width/height must not be Infinity"),this.Bv=a=a.S(),this.sc(),this.h("fixedBounds",b,a))});
    w.defineProperty(D,{hy:"scrollMargin"},function(){return this.uw},function(a){"number"===typeof a?a=new hb(a):w.G(a,hb,D,"scrollMargin");var b=this.uw;b.L(a)||(this.uw=a=a.S(),this.sc(),this.h("scrollMargin",b,a))});w.defineProperty(D,{gB:"scrollMode"},function(){return this.vw},function(a){var b=this.vw;b!==a&&(w.mb(a,D,D,"scrollMode"),this.vw=a,a===sl&&Ol(this,!1),this.h("scrollMode",b,a))});
    w.defineProperty(D,{UF:"positionComputation"},function(){return this.pw},function(a){var b=this.pw;b!==a&&(null!==a&&w.j(a,"function",D,"positionComputation"),this.pw=a,Ol(this,!1),this.h("positionComputation",b,a))});w.defineProperty(D,{fG:"scaleComputation"},function(){return this.rw},function(a){var b=this.rw;b!==a&&(null!==a&&w.j(a,"function",D,"scaleComputation"),this.rw=a,Wm(this,this.scale,this.scale),this.h("scaleComputation",b,a))});w.u(D,{se:"documentBounds"},function(){return this.uv});
    function Rl(a,b){a.Wj=!1;var c=a.uv;c.L(b)||(b=b.S(),a.uv=b,Ol(a,!1),a.Aa("DocumentBoundsChanged",null,c.copy()),Zl(a))}w.defineProperty(D,{GA:"isVirtualized"},function(){return this.Sv},function(a){var b=this.Sv;b!==a&&(w.j(a,"boolean",D,"isVirtualized"),this.Sv=a,this.h("isVirtualized",b,a))});w.defineProperty(D,{scale:"scale"},function(){return this.ub},function(a){var b=this.ub;w.wd(a,D,"scale");b!==a&&Wm(this,b,a)});
    w.defineProperty(D,{Ll:"autoScale"},function(){return this.wm},function(a){var b=this.wm;b!==a&&(w.mb(a,D,D,"autoScale"),this.wm=a,this.h("autoScale",b,a),a!==ph&&Ol(this,!1))});w.defineProperty(D,{cL:"initialAutoScale"},function(){return this.il},function(a){var b=this.il;b!==a&&(w.mb(a,D,D,"initialAutoScale"),this.il=a,this.h("initialAutoScale",b,a))});
    w.defineProperty(D,{sI:"initialViewportSpot"},function(){return this.Lv},function(a){var b=this.Lv;b!==a&&(w.G(a,L,D,"initialViewportSpot"),a.Yc()||w.k("initialViewportSpot must be a specific Spot: "+a),this.Lv=a,this.h("initialViewportSpot",b,a))});w.defineProperty(D,{pI:"initialDocumentSpot"},function(){return this.Iv},function(a){var b=this.Iv;b!==a&&(w.G(a,L,D,"initialDocumentSpot"),a.Yc()||w.k("initialViewportSpot must be a specific Spot: "+a),this.Iv=a,this.h("initialDocumentSpot",b,a))});
    w.defineProperty(D,{Ah:"minScale"},function(){return this.bw},function(a){w.wd(a,D,"minScale");var b=this.bw;b!==a&&(0<a?(this.bw=a,this.h("minScale",b,a),a>this.scale&&(this.scale=a)):w.Fa(a,"> 0",D,"minScale"))});w.defineProperty(D,{zh:"maxScale"},function(){return this.$v},function(a){w.wd(a,D,"maxScale");var b=this.$v;b!==a&&(0<a?(this.$v=a,this.h("maxScale",b,a),a<this.scale&&(this.scale=a)):w.Fa(a,"> 0",D,"maxScale"))});
    w.defineProperty(D,{pm:"zoomPoint"},function(){return this.Mw},function(a){this.Mw.L(a)||(w.G(a,z,D,"zoomPoint"),this.Mw=a=a.S())});w.defineProperty(D,{aA:"contentAlignment"},function(){return this.to},function(a){var b=this.to;b.L(a)||(w.G(a,L,D,"contentAlignment"),this.to=a=a.S(),this.h("contentAlignment",b,a),Ol(this,!1))});
    w.defineProperty(D,{dL:"initialContentAlignment"},function(){return this.Mo},function(a){var b=this.Mo;b.L(a)||(w.G(a,L,D,"initialContentAlignment"),this.Mo=a=a.S(),this.h("initialContentAlignment",b,a))});w.defineProperty(D,{padding:"padding"},function(){return this.hf},function(a){"number"===typeof a?a=new hb(a):w.G(a,hb,D,"padding");var b=this.hf;b.L(a)||(this.hf=a=a.S(),this.sc(),this.h("padding",b,a))});w.u(D,{ig:"nodes"},function(){return this.ep.i});w.u(D,{links:"links"},function(){return this.Yo.i});
    w.u(D,{Lk:"parts"},function(){return this.zb.i});D.prototype.findTopLevelNodesAndLinks=function(){for(var a=new I(R),b=this.ep.i;b.next();){var c=b.value;c.$p&&a.add(c)}for(b=this.Yo.i;b.next();)c=b.value,c.$p&&a.add(c);return a.i};D.prototype.findTopLevelGroups=function(){return this.Dl.i};
    w.defineProperty(D,{Tb:"layout"},function(){return this.ke},function(a){var b=this.ke;b!==a&&(w.G(a,tg,D,"layout"),null!==b&&(b.g=null,b.group=null),this.ke=a,a.g=this,a.group=null,this.um=!0,this.h("layout",b,a),this.Ne())});D.prototype.layoutDiagram=function(a){Hi(this);a&&qn(this,!0);cm(this,!1)};function qn(a,b){for(var c=a.Dl.i;c.next();)yn(a,c.value,b);null!==a.Tb&&(b?a.Tb.Df=!1:a.Tb.J())}
    function yn(a,b,c){if(null!==b){for(var d=b.bp.i;d.next();)yn(a,d.value,c);null!==b.Tb&&(c?b.Tb.Df=!1:b.Tb.J())}}function cm(a,b){if(a.um&&!a.Ty){var c=a.Ta;a.Ta=!0;try{var d=a.ia.Ih;0===d&&a.Hb("Layout");var e=a.Oa;1!==a.ia.Ih||e.of||e.qc||b||e.Wn("Layout");a.um=!1;for(var f=a.Dl.i;f.next();)zn(a,f.value,b);var h=a.Tb;h.Df||(!b||h.zF||0===d?(h.doLayout(a),Hi(a),h.Df=!0):a.um=!0)}finally{0===d&&a.Wc("Layout"),a.Ta=c}}}
    function zn(a,b,c){if(null!==b){for(var d=b.bp.i;d.next();)zn(a,d.value,c);d=b.Tb;null===d||d.Df||(!c||d.zF?(b.Un=!b.location.I(),d.doLayout(b),b.J(An),Bm(a,b),d.Df=!0):a.um=!0)}}w.defineProperty(D,{Td:"isTreePathToChildren"},function(){return this.Rv},function(a){var b=this.Rv;if(b!==a&&(w.j(a,"boolean",D,"isTreePathToChildren"),this.Rv=a,this.h("isTreePathToChildren",b,a),!this.ia.ab))for(a=this.ig;a.next();)Bn(a.value)});
    D.prototype.findTreeRoots=function(){for(var a=new H(T),b=this.ig;b.next();){var c=b.value;c.$p&&null===c.An()&&a.add(c)}return a.i};w.defineProperty(D,{DB:"treeCollapsePolicy"},function(){return this.Hw},function(a){var b=this.Hw;b!==a&&(a!==ul&&a!==Ym&&a!==Zm&&w.k("Unknown Diagram.treeCollapsePolicy: "+a),this.Hw=a,this.h("treeCollapsePolicy",b,a))});w.defineProperty(D,{yh:null},function(){return this.RC},function(a){this.RC=a});
    function tl(a){function b(a){var b=a.toLowerCase(),h=new H("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new ma("string",H),d=new ma("string","string");b("AnimationStarting");b("AnimationFinished");b("BackgroundSingleClicked");b("BackgroundDoubleClicked");b("BackgroundContextClicked");b("ClipboardChanged");b("ClipboardPasted");b("DocumentBoundsChanged");b("ExternalObjectsDropped");b("InitialLayoutCompleted");b("LayoutCompleted");b("LinkDrawn");b("LinkRelinked");b("LinkReshaped");b("Modified");
        b("ObjectSingleClicked");b("ObjectDoubleClicked");b("ObjectContextClicked");b("PartCreated");b("PartResized");b("PartRotated");b("SelectionMoved");b("SelectionCopied");b("SelectionDeleting");b("SelectionDeleted");b("SelectionGrouped");b("SelectionUngrouped");b("ChangingSelection");b("ChangedSelection");b("SubGraphCollapsed");b("SubGraphExpanded");b("TextEdited");b("TreeCollapsed");b("TreeExpanded");b("ViewportBoundsChanged");a.Vy=c;a.Uy=d}
    function oa(a,b){var c=a.Uy.ka(b);return null!==c?c:a.Uy.ka(b.toLowerCase())}function Cn(a,b){var c=a.Vy.ka(b);if(null!==c)return c;c=a.Vy.ka(b.toLowerCase());if(null!==c)return c;w.k("Unknown DiagramEvent name: "+b);return null}D.prototype.addDiagramListener=D.prototype.Nw=function(a,b){w.j(a,"string",D,"addDiagramListener:name");w.j(b,"function",D,"addDiagramListener:listener");var c=Cn(this,a);null!==c&&c.add(b)};
    D.prototype.removeDiagramListener=D.prototype.bB=function(a,b){w.j(a,"string",D,"removeDiagramListener:name");w.j(b,"function",D,"addDiagramListener:listener");var c=Cn(this,a);null!==c&&c.remove(b)};D.prototype.raiseDiagramEvent=D.prototype.Aa=function(a,b,c){var d=Cn(this,a),e=new Bf;e.g=this;a=oa(this,a);null!==a&&(e.name=a);void 0!==b&&(e.uB=b);void 0!==c&&(e.XA=c);b=d.length;if(1===b)d=d.ea(0),d(e);else if(0!==b)for(c=d.gc(),a=0;a<b;a++)d=c[a],d(e);return e.cancel};
    D.prototype.isUnoccupied=D.prototype.bq=function(a,b){void 0===b&&(b=null);return Dn(this,!1,null,b).bq(a.x,a.y,a.width,a.height)};D.prototype.computeOccupiedArea=function(){return this.GA?this.qb.copy():this.Wj?Nl(this):this.se.copy()};
    function Dn(a,b,c,d){null===a.Gd&&(a.Gd=new En);if(a.Gd.cu||a.Gd.group!==c||a.Gd.tB!==d){if(null===c){b=a.computeOccupiedArea();b.Af(100,100);a.Gd.initialize(b);b=w.Jf();for(var e=a.ig;e.next();){var f=e.value,h=f.layer;null!==h&&h.visible&&!h.Mc&&Fn(a,f,d,b)}}else for(c.W.I()||c.Je(),b=c.W.copy(),b.Af(20,20),a.Gd.initialize(b),b=w.Jf(),e=c.Oc;e.next();)f=e.value,f instanceof T&&Fn(a,f,d,b);w.Db(b);a.Gd.group=c;a.Gd.tB=d;a.Gd.cu=!1}else b&&Gn(a.Gd);return a.Gd}
    function Fn(a,b,c,d){if(b!==c)if(b.isVisible()&&b.Wz&&!b.Bf){c=b.getAvoidableRect(d);d=a.Gd.pn;b=a.Gd.on;for(var e=c.x+c.width,f=c.y+c.height,h=c.x;h<e;h+=d){for(var k=c.y;k<f;k+=b)Hn(a.Gd,h,k);Hn(a.Gd,h,f)}for(k=c.y;k<f;k+=b)Hn(a.Gd,e,k);Hn(a.Gd,e,f)}else if(b instanceof V)for(b=b.Oc;b.next();)e=b.value,e instanceof T&&Fn(a,e,c,d)}D.invalidatePositionArray=D.prototype.CA=function(a){null!==this.Gd&&!this.Gd.cu&&(void 0===a&&(a=null),null===a||a.Wz&&!a.Bf)&&(this.Gd.cu=!0)};
    D.prototype.simulatedMouseMove=function(a,b,c){if(null!==Sh){var d=Sh.g;c instanceof D||(c=null);var e=Th;c!==e&&(null!==e&&e!==d&&null!==e.eb.te&&(Yh(e),Sh.yx=!1,e.eb.te.doSimulatedDragLeave()),Th=c,null!==c&&c!==d&&null!==c.eb.te&&(ni(),e=c.eb.te,ai.contains(e)||ai.add(e),c.eb.te.doSimulatedDragEnter()));if(null===c||c===d||!c.pE||c.hb||!c.Dp)return!1;d=c.eb.te;null!==d&&(null!==a?b=c.Ar(a):null===b&&(b=new z),c.Rb.da=b,c.Rb.Tl=!1,c.Rb.up=!1,d.doSimulatedDragOver());return!0}return!1};
    D.prototype.simulatedMouseUp=function(a,b,c,d){if(null!==Sh){null===d&&(d=b);b=Th;var e=Sh.g;if(d!==b){if(null!==b&&b!==e&&null!==b.eb.te)return Yh(b),Sh.yx=!1,b.eb.te.doSimulatedDragLeave(),!1;Th=d;null!==d&&null!==d.eb.te&&(ni(),b=d.eb.te,ai.contains(b)||ai.add(b),d.eb.te.doSimulatedDragEnter())}if(null===d)return Sh.doCancel(),!0;if(d!==this)return null!==a&&(c=d.Ar(a)),d.Rb.da=c,d.Rb.Tl=!1,d.Rb.up=!0,a=d.eb.te,null!==a&&a.doSimulatedDrop(),a=Sh,null!==a&&(d=a.mayCopy(),a.Lf=d?"Copy":"Move",a.stopTool()),
        !0}return!1};w.defineProperty(D,{CK:"autoScrollInterval"},function(){return this.Nq},function(a){var b=this.Nq;w.wd(a,D,"scale");b!==a&&(this.Nq=a,this.h("autoScrollInterval",b,a))});w.defineProperty(D,{vE:"autoScrollRegion"},function(){return this.fv},function(a){"number"===typeof a?a=new hb(a):w.G(a,hb,D,"autoScrollRegion");var b=this.fv;b.L(a)||(this.fv=a=a.S(),this.sc(),this.h("autoScrollRegion",b,a))});
    D.prototype.doAutoScroll=D.prototype.jA=function(a){this.ev.assign(a);In(this,this.ev).Kc(this.position)?Yh(this):Jn(this)};function Jn(a){-1===a.oo&&(a.oo=w.setTimeout(function(){if(-1!==a.oo){Yh(a);var b=a.R.event;if(null!==b){var c=In(a,a.ev);c.Kc(a.position)||(a.position=c,a.R.da=a.CB(a.ev),c=b.path||b.vk&&b.vk()||null,a.simulatedMouseMove(b,null,b.target.Z||(c?c[0].Z:null))||a.doMouseMove(),a.Wj=!0,Rl(a,a.uh()),a.Ce=!0,a.cg(),Jn(a))}}},a.Nq))}
    function Yh(a){-1!==a.oo&&(w.clearTimeout(a.oo),a.oo=-1)}
    function In(a,b){var c=a.position,d=a.vE;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.qb,f=a.scale,e=w.mg(0,0,e.width*f,e.height*f),h=w.xb(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.Gu,1),k=k|0;h.x-=k;b.x<e.x+d.left/2&&(h.x-=k);b.x<e.x+d.left/4&&(h.x-=4*k)}else b.x<=e.x+e.width&&b.x>e.x+e.width-d.right&&(k=Math.max(a.Gu,1),k|=0,h.x+=k,b.x>e.x+e.width-d.right/2&&(h.x+=k),b.x>e.x+e.width-d.right/4&&(h.x+=4*k));b.y>=e.y&&b.y<e.y+d.top?(k=Math.max(a.Hu,1),k|=0,h.y-=k,b.y<e.y+
    d.top/2&&(h.y-=k),b.y<e.y+d.top/4&&(h.y-=4*k)):b.y<=e.y+e.height&&b.y>e.y+e.height-d.bottom&&(k=Math.max(a.Hu,1),k|=0,h.y+=k,b.y>e.y+e.height-d.bottom/2&&(h.y+=k),b.y>e.y+e.height-d.bottom/4&&(h.y+=4*k));h.Kc(dd)||(c=new z(c.x+h.x/f,c.y+h.y/f));w.Db(e);w.v(h);return c}D.prototype.makeSvg=D.prototype.makeSVG=function(a){void 0===a&&(a=new ra);a.context="svg";a=Kn(this,a);return null!==a?a.km:null};
    D.prototype.makeImage=function(a){void 0===a&&(a=new ra);var b=(a.document||document).createElement("img");b.src=this.OI(a);return b};
    D.prototype.makeImageData=D.prototype.OI=function(a){void 0===a&&(a=new ra);var b=Kn(this,a);if(null!==b){var c=a.returnType,c=void 0===c?"string":c.toLowerCase();switch(c){case "imagedata":return b.yk.getImageData(0,0,b.width,b.height);case "blob":b=b.Kd;c=a.callback;if("function"!==typeof c){w.k('Error: Diagram.makeImageData called with "returnType: toBlob", but no "callback" function property defined.');break}if("function"===typeof b.toBlob)return b.toBlob(c,a.type,a.details),"toBlob";if("function"===
        typeof b.msToBlob)return c(b.msToBlob()),"msToBlob";c(null);break;default:return b.toDataURL(a.type,a.details)}}return""};var Ln=!1;
    function Kn(a,b){a.Oa.Gh();a.cg();if(null===a.Fb)return null;"object"!==typeof b&&w.k("properties argument must be an Object.");var c=!1,d=b.size||null,e=b.scale||null;void 0!==b.scale&&isNaN(b.scale)&&(e="NaN");var f=b.maxSize;void 0===b.maxSize&&(c=!0,f="svg"===b.context?new ia(Infinity,Infinity):new ia(2E3,2E3));var h=b.position||null,k=b.parts||null,l=void 0===b.padding?1:b.padding,m=b.background||null,n=b.omitTemporary;void 0===n&&(n=!0);var p=b.document||document,q=b.elementFinished||null,r=
        b.showTemporary;void 0===r&&(r=!n);n=b.showGrid;void 0===n&&(n=r);null!==d&&isNaN(d.width)&&isNaN(d.height)&&(d=null);"number"===typeof l?l=new hb(l):l instanceof hb||(l=new hb(0));l.left=Math.max(l.left,0);l.right=Math.max(l.right,0);l.top=Math.max(l.top,0);l.bottom=Math.max(l.bottom,0);a.tf.Fe(!0);var s=new Wc(null,p),u=s.yk;if(!(d||e||k||h)){s.width=a.Jb+Math.ceil(l.left+l.right);s.height=a.Mb+Math.ceil(l.top+l.bottom);if("svg"===b.context)return u=new Oc(s.Kd,p,q),Im(a,u,l,new ia(s.width,s.height),
        a.ub,a.jb,k,m,r,n),u;a.pr=!1;Im(a,u,l,new ia(s.width,s.height),a.ub,a.jb,k,m,r,n);a.pr=!0;return s}var t=a.ob.ex,x=new z(0,0),v=a.se.copy();v.MJ(a.padding);if(r)for(var A=!0,A=a.cc.n,y=A.length,K=0;K<y;K++){var E=A[K];if(E.visible&&E.Mc)for(var E=E.zb.n,P=E.length,$=0;$<P;$++){var S=E[$];S.FA&&S.isVisible()&&(S=S.W,S.I()&&v.Jh(S))}}x.x=v.x;x.y=v.y;if(null!==k){var ba,A=!0,y=k.i;for(y.reset();y.next();)S=y.value,S instanceof R&&(E=S.layer,null!==E&&!E.visible||null!==E&&!r&&E.Mc||!S.isVisible()||(S=
        S.W,S.I()&&(A?(A=!1,ba=S.copy()):ba.Jh(S))));A&&(ba=new B(0,0,0,0));v.width=ba.width;v.height=ba.height;x.x=ba.x;x.y=ba.y}null!==h&&h.I()&&(x=h,e||(e=t));A=S=0;null!==l&&(S=l.left+l.right,A=l.top+l.bottom);K=y=0;null!==d&&(y=d.width,K=d.height,isFinite(y)&&(y=Math.max(0,y-S)),isFinite(K)&&(K=Math.max(0,K-A)));ba=h=0;null!==d&&null!==e?("NaN"===e&&(e=t),d.I()?(h=y,ba=K):isNaN(K)?(h=y,ba=v.height*e):(h=v.width*e,ba=K)):null!==d?d.I()?(e=Math.min(y/v.width,K/v.height),h=y,ba=K):isNaN(K)?(e=y/v.width,
        h=y,ba=v.height*e):(e=K/v.height,h=v.width*e,ba=K):null!==e?"NaN"===e&&f.I()?(e=Math.min((f.width-S)/v.width,(f.height-A)/v.height),e>t?(e=t,h=v.width,ba=v.height):(h=f.width,ba=f.height)):(h=v.width*e,ba=v.height*e):(e=t,h=v.width,ba=v.height);null!==l?(h+=S,ba+=A):l=new hb(0);null!==f&&(d=f.width,f=f.height,"svg"!==b.context&&c&&!Ln&&(h>d||ba>f)&&(w.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. ("+Math.ceil(h)+"x"+Math.ceil(ba)+" vs 2000x2000) Consider increasing the max size."),
        Ln=!0),isNaN(d)&&(d=2E3),isNaN(f)&&(f=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(f)&&(ba=Math.min(ba,f)));s.width=Math.ceil(h);s.height=Math.ceil(ba);if("svg"===b.context)return u=new Oc(s.Kd,p,q),Im(a,u,l,new ia(Math.ceil(h),Math.ceil(ba)),e,x,k,m,r,n),u;a.pr=!1;Im(a,u,l,new ia(Math.ceil(h),Math.ceil(ba)),e,x,k,m,r,n);a.pr=!0;return s}D.inherit=function(a,b){w.j(a,"function",D,"inherit");w.j(b,"function",D,"inherit");b.ZG&&w.k("Cannot inherit from "+w.lf(b));w.Ka(a,b)};
    function Cl(){this.OD=null;this.aH="63ad05bbe23a1786468a4c741b6d2";this.Ji=this.aH===this._tk?!0:null}
    function Mn(a){var b="f",c=window[w.Mg("76a715b2f73f148a")][w.Mg("72ba13b5")],d=w.Mg;if(window[d("7da7")]&&window[d("7da7")][d("76a115b6ed251eaf4692")]){a.Ji=!0;var e=window[d("7da7")][d("76a115b6ed251eaf4692")],e=d(e).split(d("39e9"));if(6>e.length)return;var f=d(e[1]).split(".");if("7da71ca0"!==e[4])return;var h=d(w[d("6cae19")]).split(".");if(f[0]>h[0]||f[0]===h[0]&&f[1]>=h[1]){f=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h<f;h++)b+=c[h];f=b[d("73a612b6fb191d")](d(e[2]));0>
    f&&d(e[2])!==d("7da71ca0ad381e90")&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));0>f&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Ji=!(0<=f&&f<b[d("73a612b6fb191d")](d("35")));if(!a.Ji)return}else return}f=c[d("76ad18b4f73e")];for(h=c[d("73a612b6fb191d")](d("35e7"))+2;h<f;h++)b+=c[h];f=b[d("73a612b6fb191d")](d(w.adym));0>f&&d(w.adym)!==d("7da71ca0ad381e90")&&(f=b[d("73a612b6fb191d")](d("76a715b2ef3e149757")));a.Ji=!(0<=f&&f<b[d("73a612b6fb191d")](d("35")));a.Ji&&(b=window.document[d("79ba13b2f7333e8846865a7d00")]("div"),
        c=d("02cncncn"),"."===c[0]&&(c=c[d("69bd14a0f724128a44")](1)),b[d("79a417a0f0181a8946")]=c,window.document[d("78a712aa")]?(window.document[d("78a712aa")][d("7bb806b6ed32388c4a875b")](b),c=window[d("7dad0290ec3b0b91578e5b40007031bf")](b)[d("7dad0283f1390b81519f4645156528bf")](d("78a704b7e62456904c9b12701b6532a8")),window.document[d("78a712aa")][d("68ad1bbcf533388c4a875b")](b),c&&-1!==c.indexOf(d(w.uH))&&-1!==c.indexOf(d(w.vH))&&(a.Ji=!1)):(a.Ji=null,a.Ji=!1))}
    Cl.prototype.om=function(a){a.tf.setTransform(a.Ed,0,0,a.Ed,0,0);null===this.Ji&&Mn(this);return 0<this.Ji&&this!==this.OD?!0:!1};Cl.prototype.t=function(){this.OD=null};
    function Dl(a,b){void 0!==b&&null!==b||w.k("Diagram setup requires an argument DIV.");null!==a.Nb&&w.k("Diagram has already completed setup.");"string"===typeof b?a.Nb=window.document.getElementById(b):b instanceof HTMLDivElement?a.Nb=b:w.k("No DIV or DIV id supplied: "+b);null===a.Nb&&w.k("Invalid DIV id; could not get element with id: "+b);void 0!==a.Nb.Z&&w.k("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Nb,null).position&&(a.Nb.style.position=
        "relative");a.Nb.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Nb.style["-ms-touch-action"]="none";a.Nb.innerHTML="";a.Nb.Z=a;var c=new Wc(a);c.Kd.innerHTML="This text is displayed if your browser does not support the Canvas HTML element.";void 0!==c.style&&(c.style.position="absolute",c.style.top="0px",c.style.left="0px","rtl"===window.getComputedStyle(a.Nb,null).getPropertyValue("direction")&&(a.Mr=!0),c.style.zIndex="2",c.style.YL="none",c.style.webkitUserSelect="none",c.style.MozUserSelect=
        "none");a.Jb=a.Nb.clientWidth||1;a.Mb=a.Nb.clientHeight||1;a.Fb=c;a.tf=c.yk;var d=a.tf;a.nD=(window.devicePixelRatio||1)/(d.ua.webkitBackingStorePixelRatio||d.ua.mozBackingStorePixelRatio||d.ua.msBackingStorePixelRatio||d.ua.oBackingStorePixelRatio||d.ua.backingStorePixelRatio||1);a.Ed=a.computePixelRatio();Km(a,a.Jb,a.Mb);a.wv=function(){return true;};a.Nb.insertBefore(c.Kd,a.Nb.firstChild);c=new Wc(null);c.width=1;c.height=1;a.Yy=c;a.HC=c.yk;var c=w.createElement("div"),
        e=w.createElement("div");c.style.position="absolute";c.style.overflow="auto";c.style.width=a.Jb+"px";c.style.height=a.Mb+"px";c.style.zIndex="1";e.style.position="absolute";e.style.width="1px";e.style.height="1px";a.Nb.appendChild(c);c.appendChild(e);c.onscroll=Jl;c.onmousedown=Ll;c.ontouchstart=Ll;c.Z=a;c.XG=!0;c.YG=!0;a.ww=c;a.Ts=e;a.Yx=w.EE(function(){a.kk=null;a.oa()},300,!1);a.HB=w.EE(function(){Sk(a)},250,!1);a.preventDefault=function(a){a.preventDefault();return!1};a.Rn=function(b){if(a.isEnabled){a.ll=
        !0;var c=a.Vc;w.Hn&&c.vj?(b.preventDefault(),b.simulated=!0,a.bt=b):(a.Vc=a.Rb,a.Rb=c,Ul(a,a,b,c,!0),a.simulatedMouseMove(b,null,b.target.Z)||(a.doMouseMove(),a.$a.isBeyondDragSize()&&(a.pl=0),Yl(c,b)))}};a.Qn=function(b){if(a.isEnabled){a.ll=!0;var c=a.Vc;if(w.Hn&&null!==a.bt)a.bt=b,b.preventDefault();else if(w.Hn&&400>b.timeStamp-a.Km)b.preventDefault();else if(a.ml)b.preventDefault();else{a.Vc=a.Rb;a.Rb=c;Ul(a,a,b,c,!0);c.Tl=!0;c.Ge=b.detail;if(w.sF||w.tF)b.timeStamp-a.Km<a.aE&&!a.$a.isBeyondDragSize()?
        a.pl++:a.pl=1,a.Km=b.timeStamp,c.Ge=a.pl;a.Li=c;!0===c.vr.simulated?(b.preventDefault(),b.simulated=!0):(Sh=null,a.doMouseDown(),a.Li=a.Li.copy(),1===b.button?b.preventDefault():Yl(c,b))}}};a.Tn=function(b){if(a.isEnabled)if(a.ml&&2===b.button)b.preventDefault();else if(a.ml&&0===b.button&&(a.ml=!1),a.jt)b.preventDefault();else{a.ll=!0;var c=a.Vc;if(w.Hn){if(400>b.timeStamp-a.Km){b.preventDefault();return}a.Km=b.timeStamp}if(w.Hn&&null!==a.bt)a.bt=null,b.preventDefault();else{a.Vc=a.Rb;a.Rb=c;Ul(a,
        a,b,c,!0);c.up=!0;c.Ge=b.detail;if(w.sF||w.tF)c.Ge=a.pl;c.bubbles=b.bubbles;var d=b.path||b.vk&&b.vk();c.lg=b.target.Z||d[0].Z||null;a.simulatedMouseUp(b,null,new z,c.lg)||(a.doMouseUp(),Yh(a),Yl(c,b))}}};a.Sg=function(b){if(a.isEnabled){var c=a.Vc;a.Vc=a.Rb;a.Rb=c;Ul(a,a,b,c,!0);c.bubbles=!0;c.Sl=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();Yl(c,b)}};a.Sn=function(){if(a.isEnabled){a.ll=!1;var b=a.$a;b.cancelWaitAfter();b.standardMouseOver()}};a.BB=function(b){if(a.isEnabled){a.jt=
        !1;a.ml=!0;var c=a.Vc;a.Vc=a.Rb;a.Rb=c;Wl(a,b,b.targetTouches[0],c,1<b.touches.length);a.doMouseDown();Yl(c,b)}};a.AB=function(b){if(a.isEnabled){var c=a.Vc;a.Vc=a.Rb;a.Rb=c;var d=null;0<b.targetTouches.length?d=b.targetTouches[0]:0<b.changedTouches.length&&(d=b.changedTouches[0]);Xl(a,b,d,c,1<b.touches.length);a.simulatedMouseMove(d?d:b,null,c.lg)||a.doMouseMove();Yl(c,b)}};a.zB=function(b){if(a.isEnabled)if(a.jt)b.preventDefault();else{var c=a.Vc;a.Vc=a.Rb;a.Rb=c;if(!(1<b.touches.length)){var d=
        null,e=null;0<b.targetTouches.length?e=b.targetTouches[0]:0<b.changedTouches.length&&(e=b.changedTouches[0]);c.g=a;c.Ge=1;if(null!==e){d=window.document.elementFromPoint(e.clientX,e.clientY);null!==d&&d.Z instanceof D&&d.Z!==a&&Vl(d.Z,e,c);Vl(a,e,c);var m=e.screenX,n=e.screenY,p=a.dD;b.timeStamp-a.Km<a.aE&&!(25<Math.abs(p.x-m)||25<Math.abs(p.y-n))?a.pl++:a.pl=1;c.Ge=a.pl;a.Km=b.timeStamp;a.dD.m(m,n)}c.zd=0;c.button=0;c.buttons=1;c.Tl=!1;c.up=!0;c.Sl=0;c.Cc=!1;c.bubbles=!1;c.event=b;c.timestamp=Date.now();
        null===d?(d=b.path||b.vk&&b.vk()||null,c.lg=b.target.Z||(d?d[0].Z:null)):c.lg=d.Z?d.Z:null;c.Re=null;a.simulatedMouseUp(e?e:b,null,new z,c.lg)||a.doMouseUp();Yl(c,b);a.ml=!1}}};a.QF=function(b){if("touch"===b.pointerType){var c=a.zD;void 0===c[b.pointerId]&&(a.ow++,c[b.pointerId]=b);a.Zh[0]=null;a.Zh[1]=null;for(var d in c)if(null===a.Zh[0])a.Zh[0]=c[d];else if(null===a.Zh[1]){a.Zh[1]=c[d];break}a.isEnabled&&(a.jt=!1,a.ml=!0,b=a.Zh[0],d=a.Vc,a.Vc=a.Rb,a.Rb=d,Wl(a,b,b,d,1<a.ow),a.doMouseDown(),Yl(d,
        b))}};a.SF=function(b){if("touch"===b.pointerType&&!(2>a.ow)){var c=a.Zh;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&c[1]!==b&&(c=a.Vc,a.Vc=a.Rb,a.Rb=c,Xl(a,b,b,c,!0),a.simulatedMouseMove(b,null,c.lg)||(a.doMouseMove(),Yl(c,b)))}};a.RF=function(b){if("touch"===b.pointerType){var c=a.zD;void 0!==c[b.pointerId]&&(a.ow--,delete c[b.pointerId],c=a.Zh,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};
        d.Fe(!0);Gl(a)}function Nn(a){1<arguments.length&&w.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");D.call(this,a);this.Bt=!0;this.Jl=!1;this.hb=!0;this.aA=Bb;this.Tb=new On}w.Ka(Nn,D);w.ga("Palette",Nn);
    function zl(a){1<arguments.length&&w.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");D.call(this,a);this.Oa.isEnabled=!1;this.Tc=!0;this.gk=null;this.xv=!0;this.FJ("drawShadows",!1);var b=new R,c=new X;c.stroke="magenta";c.lb=2;c.fill="transparent";c.name="BOXSHAPE";b.gm=!0;b.jB="BOXSHAPE";b.KA="BOXSHAPE";b.dG="BOXSHAPE";b.cursor="move";b.add(c);this.xm=b;c=new kh;c.type=Mj;c.Ff=Jb;var d=new Nj;d.pf=!0;c.add(d);d=new X;d.qh=Jb;d.Cb="Rectangle";d.Ca=new ia(64,
        64);d.cursor="se-resize";d.alignment=Sb;c.add(d);b.bG=c;this.kn=this.tk=!1;this.yf=this.Dt=!0;this.vE=new hb(0,0,0,0);this.Jz=new Wc(null);this.$G=this.Jz.yk;this.eb.te=new Pn;this.eb.eG=new Qn;var e=this;this.click=function(){var a=e.gk;if(null!==a){var b=a.qb,c=e.R.da;a.position=new z(c.x-b.width/2,c.y-b.height/2)}};this.NF=function(){Rn(e)};this.MF=function(){null!==e.gk&&(e.sc(),e.oa())};this.Ll=Sl;this.Tc=!1}w.Ka(zl,D);w.ga("Overview",zl);
    function Sn(a){a.Tc||a.$d||!1!==a.Uf||(a.Uf=!0,requestAnimationFrame(function(){if(a.Uf&&!a.$d&&(a.Uf=!1,null!==a.Nb)){a.$d=!0;Hi(a);a.se.I()||Rl(a,a.uh());null===a.Nb&&w.k("No div specified");null===a.Fb&&w.k("No canvas specified");if(a.Ce){var b=a.gk;if(null!==b&&!b.Oa.of&&!b.Oa.qc){var b=a.tf,c=a.Jz;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.Fb.width,a.Fb.height);b.drawImage(c.Kd,0,0);c=a.hd;c.reset();1!==a.scale&&c.scale(a.scale);0===a.position.x&&0===a.position.y||c.translate(-a.position.x,
        -a.position.y);b.scale(a.Ed,a.Ed);b.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);for(var c=a.cc.n,d=c.length,e=0;e<d;e++)c[e].ue(b,a);a.jl=!1;a.Ce=!1}}a.$d=!1}}))}zl.prototype.computePixelRatio=function(){return 1};
    zl.prototype.ue=function(){null===this.Nb&&w.k("No div specified");null===this.Fb&&w.k("No canvas specified");if(this.Ce){var a=this.gk;if(null!==a&&!a.Oa.of){Fm(this);var b=a.Fn;(null!==b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&bm(a);var c=this.Fb,b=this.tf,d=this.Jz,e=this.$G;d.width=c.width;d.height=c.height;b.Fe(!0);b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,c.width,c.height);d=this.hd;d.reset();1!==this.scale&&d.scale(this.scale);0===this.position.x&&0===this.position.y||d.translate(-this.position.x,
        -this.position.y);b.scale(this.Ed,this.Ed);b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);for(var d=this.xv,f=this.qb,h=a.cc.n,k=h.length,a=0;a<k;a++){var l=h[a],m=b,n=f,p=d;if(l.visible&&0!==l.yc&&(void 0===p&&(p=!0),p||!l.Mc)){1!==l.yc&&(m.globalAlpha=l.yc);for(var p=this.scale,l=l.zb.n,q=l.length,r=0;r<q;r++){var s=l[r],u=s.W;u.Zf(n)&&(1<u.width*p||1<u.height*p?s.ue(m,this):ll(s,m))}m.globalAlpha=1}}e.drawImage(c.Kd,0,0);c=this.cc.n;e=c.length;for(a=0;a<e;a++)c[a].ue(b,this);this.Ce=this.jl=!1}}};
    w.defineProperty(zl,{WA:"observed"},function(){return this.gk},function(a){var b=this.gk;null!==a&&w.G(a,D,zl,"observed");a instanceof zl&&w.k("Overview.observed Diagram may not be an Overview itself: "+a);b!==a&&(null!==b&&(this.remove(this.th),b.bB("ViewportBoundsChanged",this.NF),b.bB("DocumentBoundsChanged",this.MF),b.lw.remove(this)),this.gk=a,null!==a&&(a.Nw("ViewportBoundsChanged",this.NF),a.Nw("DocumentBoundsChanged",this.MF),a.lw.add(this),this.add(this.th),Rn(this)),this.sc(),this.h("observed",
        b,a))});w.defineProperty(zl,{th:"box"},function(){return this.xm},function(a){var b=this.xm;b!==a&&(this.xm=a,this.remove(b),this.add(this.xm),Rn(this),this.h("box",b,a))});w.defineProperty(zl,{XK:"drawsTemporaryLayers"},function(){return this.xv},function(a){this.xv!==a&&(this.xv=a,this.Xx())});
    function Rn(a){var b=a.th;if(null!==b){var c=a.gk;if(null!==c){a.Ce=!0;var c=c.qb,d=b.Iu,e=w.mm();e.m(c.width,c.height);d.Ca=e;w.Ck(e);a=2/a.scale;d instanceof X&&(d.lb=a);b.location=new z(c.x-a/2,c.y-a/2)}}}zl.prototype.uh=function(){var a=this.gk;return null===a?ed:a.se};zl.prototype.nF=function(){!0!==this.Ce&&(this.Ce=!0,Sn(this))};
    zl.prototype.yu=function(a,b,c,d,e){this.Tc||(Ml(this),this.oa(),Zl(this),this.sc(),Rn(this),this.ph.scale=c,this.ph.position.x=a.x,this.ph.position.y=a.y,this.ph.bounds.set(a),this.ph.isScroll=e,this.Aa("ViewportBoundsChanged",this.ph,a))};function Pn(){oh.call(this);this.vl=null}w.Ka(Pn,oh);
    Pn.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.g;if(null===a||!a.Jl||!a.yf)return!1;var b=a.WA;if(null===b)return!1;if(null===this.findDraggablePart()){var c=b.qb;this.vl=new z(c.width/2,c.height/2);a=a.Bc.da;b.position=new z(a.x-this.vl.x,a.y-this.vl.y)}return!0};Pn.prototype.doActivate=function(){this.vl=null;oh.prototype.doActivate.call(this)};
    Pn.prototype.moveParts=function(){var a=this.g,b=a.WA;if(null!==b){var c=a.th;if(null!==c){if(null===this.vl){var d=a.Bc.da,c=c.location;this.vl=new z(d.x-c.x,d.y-c.y)}a=a.R.da;b.position=new z(a.x-this.vl.x,a.y-this.vl.y)}}};function Qn(){Lj.call(this)}w.Ka(Qn,Lj);Qn.prototype.resize=function(a){var b=this.g.WA;if(null!==b){var c=b.qb.copy();b.position=a.position;(c.width!==a.width||c.height!==a.height)&&0<a.width&&0<a.height&&(b.scale=Math.min(c.width/a.width,c.height/a.height))}};
    function Tn(){this.gg=this.$c=this.Ad=this.Dc=0}function ha(a){1<arguments.length&&w.k("Brush constructor can take at most one optional argument, the Brush type.");w.nc(this);this.P=!1;void 0===a?(this.na=og,this.ro="black"):"string"===typeof a?(this.na=og,this.ro=a):(this.na=a,this.ro="black");var b=this.na;b===pg?(this.pp=Bb,this.Fo=Rb):this.Fo=b===bd?this.pp=Jb:this.pp=yb;this.Cw=0;this.yv=NaN;this.eh=this.nw=this.dh=null;this.Ny=this.so=0}w.ga("Brush",ha);var og;ha.Solid=og=w.p(ha,"Solid",0);
    var pg;ha.Linear=pg=w.p(ha,"Linear",1);var bd;ha.Radial=bd=w.p(ha,"Radial",2);var Un;ha.Pattern=Un=w.p(ha,"Pattern",4);var Vn;ha.Lab=Vn=w.p(ha,"Lab",5);var Wn;ha.HSL=Wn=w.p(ha,"HSL",6);ha.prototype.copy=function(){var a=new ha;a.na=this.na;a.ro=this.ro;a.pp=this.pp.S();a.Fo=this.Fo.S();a.Cw=this.Cw;a.yv=this.yv;null!==this.dh&&(a.dh=this.dh.copy());a.nw=this.nw;return a};g=ha.prototype;g.Ha=function(){this.freeze();Object.freeze(this);return this};
    g.freeze=function(){this.P=!0;null!==this.dh&&this.dh.freeze();return this};g.Qa=function(){Object.isFrozen(this)&&w.k("cannot thaw constant: "+this);this.P=!1;null!==this.dh&&this.dh.Qa();return this};g.ic=function(a){a.Ee===ha?this.type=a:w.Fj(this,a)};
    g.toString=function(){var a="Brush(";if(this.type===og)a+=this.color;else if(a=this.type===pg?a+"Linear ":this.type===bd?a+"Radial ":this.type===Un?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.uk)for(var b=this.uk.i;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
    ha.prototype.addColorStop=ha.prototype.addColorStop=function(a,b){this.P&&w.ma(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&w.Fa(a,"0 <= loc <= 1",ha,"addColorStop:loc");w.j(b,"string",ha,"addColorStop:color");null===this.dh&&(this.dh=new ma("number","string"));this.dh.add(a,b);this.na===og&&(this.type=pg);this.eh=null};
    w.defineProperty(ha,{type:"type"},function(){return this.na},function(a){this.P&&w.ma(this,a);w.mb(a,ha,ha,"type");this.na=a;this.start.Sd()&&(a===pg?this.start=Bb:a===bd&&(this.start=Jb));this.end.Sd()&&(a===pg?this.end=Rb:a===bd&&(this.end=Jb));this.eh=null});w.defineProperty(ha,{color:"color"},function(){return this.ro},function(a){this.P&&w.ma(this,a);this.ro=a;this.eh=null});
    w.defineProperty(ha,{start:"start"},function(){return this.pp},function(a){this.P&&w.ma(this,a);w.G(a,L,ha,"start");this.pp=a.S();this.eh=null});w.defineProperty(ha,{end:"end"},function(){return this.Fo},function(a){this.P&&w.ma(this,a);w.G(a,L,ha,"end");this.Fo=a.S();this.eh=null});w.defineProperty(ha,{Ou:"startRadius"},function(){return this.Cw},function(a){this.P&&w.ma(this,a);w.wd(a,ha,"startRadius");0>a&&w.Fa(a,">= zero",ha,"startRadius");this.Cw=a;this.eh=null});
    w.defineProperty(ha,{Kt:"endRadius"},function(){return this.yv},function(a){this.P&&w.ma(this,a);w.wd(a,ha,"endRadius");0>a&&w.Fa(a,">= zero",ha,"endRadius");this.yv=a;this.eh=null});w.defineProperty(ha,{uk:"colorStops"},function(){return this.dh},function(a){this.P&&w.ma(this,a);this.dh=a;this.eh=null});w.defineProperty(ha,{pattern:"pattern"},function(){return this.nw},function(a){this.P&&w.ma(this,a);this.nw=a;this.eh=null});
    ha.randomColor=function(a,b){void 0===a&&(a=128);void 0===b&&(b=Math.max(a,255));var c=Math.abs(b-a),d=Math.floor(a+Math.random()*c).toString(16),e=Math.floor(a+Math.random()*c).toString(16),c=Math.floor(a+Math.random()*c).toString(16);2>d.length&&(d="0"+d);2>e.length&&(e="0"+e);2>c.length&&(c="0"+c);return"#"+d+e+c};var Xn=(new Wc(null)).yk,ea;
    ha.isValidColor=ea=function(a){if("black"===a)return!0;if(""===a)return!1;Xn.fillStyle="#000000";var b=Xn.fillStyle;Xn.fillStyle=a;if(Xn.fillStyle!==b)return!0;Xn.fillStyle="#FFFFFF";b=Xn.fillStyle;Xn.fillStyle=a;return Xn.fillStyle!==b};var Yn=new Tn,Zn=new Tn,$n=new Tn,ao=new Tn;ha.lighten=function(a){return bo(a)};
    ha.prototype.lightenBy=function(a,b){this.P&&w.ma(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Vn:b;if(this.type===og)co(this.color),this.color=eo(c,d);else if((this.type===pg||this.type===bd)&&null!==this.uk)for(var e=this.uk.i;e.next();)co(e.value),this.addColorStop(e.key,eo(c,d));return this};var bo;ha.lightenBy=bo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Vn:c;co(a);return eo(b,c)};ha.darken=function(a){return fo(a)};
    ha.prototype.darkenBy=function(a,b){this.P&&w.ma(this);var c=void 0===a||"number"!==typeof a?.2:a,d=void 0===b?Vn:b;if(this.type===og)co(this.color),this.color=eo(-c,d);else if((this.type===pg||this.type===bd)&&null!==this.uk)for(var e=this.uk.i;e.next();)co(e.value),this.addColorStop(e.key,eo(-c,d));return this};var fo;ha.darkenBy=fo=function(a,b,c){b=void 0===b||"number"!==typeof b?.2:b;c=void 0===c?Vn:c;co(a);return eo(-b,c)};
    function eo(a,b){switch(b){case Vn:var c=100*ho(Yn.Dc),d=100*ho(Yn.Ad),e=100*ho(Yn.$c);$n.Dc=.4124564*c+.3575761*d+.1804375*e;$n.Ad=.2126729*c+.7151522*d+.072175*e;$n.$c=.0193339*c+.119192*d+.9503041*e;$n.gg=Yn.gg;c=io($n.Dc/jo[0]);d=io($n.Ad/jo[1]);e=io($n.$c/jo[2]);ao.Dc=116*d-16;ao.Ad=500*(c-d);ao.$c=200*(d-e);ao.gg=$n.gg;ao.Dc=Math.min(100,Math.max(0,ao.Dc+100*a));c=(ao.Dc+16)/116;d=c-ao.$c/200;$n.Dc=jo[0]*ko(ao.Ad/500+c);$n.Ad=jo[1]*(ao.Dc>lo*mo?Math.pow(c,3):ao.Dc/lo);$n.$c=jo[2]*ko(d);$n.gg=
        ao.gg;c=-.969266*$n.Dc+1.8760108*$n.Ad+.041556*$n.$c;d=.0556434*$n.Dc+-.2040259*$n.Ad+1.0572252*$n.$c;Yn.Dc=255*no((3.2404542*$n.Dc+-1.5371385*$n.Ad+-.4985314*$n.$c)/100);Yn.Ad=255*no(c/100);Yn.$c=255*no(d/100);Yn.gg=$n.gg;Yn.Dc=Math.round(Yn.Dc);255<Yn.Dc?Yn.Dc=255:0>Yn.Dc&&(Yn.Dc=0);Yn.Ad=Math.round(Yn.Ad);255<Yn.Ad?Yn.Ad=255:0>Yn.Ad&&(Yn.Ad=0);Yn.$c=Math.round(Yn.$c);255<Yn.$c?Yn.$c=255:0>Yn.$c&&(Yn.$c=0);return"rgba("+Yn.Dc+", "+Yn.Ad+", "+Yn.$c+", "+Yn.gg+")";case Wn:var e=Yn.Dc/255,f=Yn.Ad/
        255,h=Yn.$c/255,k=Math.max(e,f,h),d=Math.min(e,f,h),l=k-d,d=(k+d)/2;if(0===l)c=e=0;else{switch(k){case e:c=(f-h)/l%6;break;case f:c=(h-e)/l+2;break;case h:c=(e-f)/l+4}c*=60;0>c&&(c+=360);e=l/(1-Math.abs(2*d-1))}Zn.Dc=Math.round(c);Zn.Ad=Math.round(100*e);Zn.$c=Math.round(100*d);Zn.gg=Yn.gg;Zn.$c=Math.min(100,Math.max(0,Zn.$c+100*a));return"hsla("+Zn.Dc+", "+Zn.Ad+"%, "+Zn.$c+"%, "+Zn.gg+")";default:return w.k("Unknown color space: "+b),"rgba(0, 0, 0, 1)"}}
    function co(a){Xn.clearRect(0,0,1,1);Xn.fillStyle="#000000";var b=Xn.fillStyle;Xn.fillStyle=a;Xn.fillStyle!==b?(Xn.fillRect(0,0,1,1),a=Xn.getImageData(0,0,1,1).data,Yn.Dc=a[0],Yn.Ad=a[1],Yn.$c=a[2],Yn.gg=a[3]/255):(Xn.fillStyle="#FFFFFF",Xn.fillStyle=a,Yn.Dc=0,Yn.Ad=0,Yn.$c=0,Yn.gg=1)}function ho(a){a/=255;return.04045>=a?a/12.92:Math.pow((a+.055)/1.055,2.4)}function no(a){return.0031308>=a?12.92*a:1.055*Math.pow(a,1/2.4)-.055}var mo=216/24389,lo=24389/27,jo=[95.047,100,108.883];
    function io(a){return a>mo?Math.pow(a,1/3):(lo*a+16)/116}function ko(a){var b=a*a*a;return b>mo?b:(116*a-16)/lo}
    function G(){w.nc(this);this.O=4225027;this.yc=1;this.nh=null;this.Sb="";this.bc=this.Eb=null;this.jb=(new z(NaN,NaN)).freeze();this.Te=Gd;this.Yh=rd;this.Xh=Ed;this.hd=new ka;this.sm=new ka;this.Si=new ka;this.ub=this.Do=1;this.ng=0;this.Hg=oo;this.Pm=fd;this.sd=(new B(NaN,NaN,NaN,NaN)).freeze();this.oc=(new B(NaN,NaN,NaN,NaN)).freeze();this.Uc=(new B(0,0,NaN,NaN)).freeze();this.V=this.Ds=this.Es=null;this.rm=this.ie=qc;this.Qs=0;this.bj=1;this.Uq=0;this.Bi=1;this.ft=null;this.Us=-Infinity;this.$m=
        0;this.an=dd;this.bn=kj;this.cr="";this.vc=this.ja=null;this.po=-1;this.fn=this.qg=this.bl=this.op=null;this.Az=nj;this.Wm=null}w.ni(G);w.ga("GraphObject",G);
    G.prototype.cloneProtected=function(a){a.O=this.O|6144;a.yc=this.yc;a.Sb=this.Sb;a.Eb=this.Eb;a.bc=this.bc;a.jb.assign(this.jb);a.Te=this.Te.S();a.Yh=this.Yh.S();a.Xh=this.Xh.S();a.Si=this.Si.copy();a.ub=this.ub;a.ng=this.ng;a.Hg=this.Hg;a.Pm=this.Pm.S();a.sd.assign(this.sd);a.oc.assign(this.oc);a.Uc.assign(this.Uc);a.Ds=this.Ds;null!==this.V&&(a.V=this.V.copy());a.ie=this.ie.S();a.rm=this.rm.S();a.Qs=this.Qs;a.bj=this.bj;a.Uq=this.Uq;a.Bi=this.Bi;a.ft=this.ft;a.Us=this.Us;a.$m=this.$m;a.an=this.an.S();
        a.bn=this.bn;a.cr=this.cr;null!==this.ja&&(a.ja=this.ja.copy());a.vc=this.vc;a.po=this.po;null!==this.bl&&(a.bl=w.Nl(this.bl));null!==this.qg&&(a.qg=this.qg.copy());a.fn=this.fn};G.prototype.addCopyProperty=G.prototype.fH=function(a){var b=this.bl;if(w.isArray(b))for(var c=0;c<b.length;c++){if(b[c]===a)return}else this.bl=b=[];b.push(a)};G.prototype.oi=function(a){a.Es=null;a.Wm=null;a.H()};
    G.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!==this.bl)for(var b=0;b<this.bl.length;b++){var c=this.bl[b];a[c]=this[c]}return a};G.prototype.copy=function(){return this.clone()};G.prototype.ic=function(a){a.Ee===W?0===a.name.indexOf("Orient")?this.qq=a:w.k("Unknown Link enum value for GraphObject.segmentOrientation property: "+a):a.Ee===G?this.stretch=a:w.Fj(this,a)};G.prototype.toString=function(){return w.lf(Object.getPrototypeOf(this))+"#"+w.Od(this)};
    var Oj;G.None=Oj=w.p(G,"None",0);var oo;G.Default=oo=w.p(G,"Default",0);var po;G.Vertical=po=w.p(G,"Vertical",4);var qo;G.Horizontal=qo=w.p(G,"Horizontal",5);var Fe;G.Fill=Fe=w.p(G,"Fill",3);var Qj;G.Uniform=Qj=w.p(G,"Uniform",1);var Rj;G.UniformToFill=Rj=w.p(G,"UniformToFill",2);var ro;G.FlipVertical=ro=w.p(G,"FlipVertical",1);var so;G.FlipHorizontal=so=w.p(G,"FlipHorizontal",2);var to;G.FlipBoth=to=w.p(G,"FlipBoth",3);function uo(a){null===a.ja&&(a.ja=new vo)}
    G.prototype.Pd=function(){if(null===this.V){var a=new wo;a.Tj=yb;a.pk=yb;a.Rj=10;a.nk=10;a.Qj=xo;a.mk=xo;a.Sj=0;a.ok=0;this.V=a}};function yo(a,b,c,d,e,f,h){var k=.001,l=f.length;a.moveTo(b,c);d-=b;k=e-c;0===d&&(d=.001);e=k/d;for(var m=Math.sqrt(d*d+k*k),n=0,p=!0,q=0===h?!1:!0;.1<=m;){if(q){k=f[n++%l];for(k-=h;0>k;)k+=f[n++%l],p=!p;q=!1}else k=f[n++%l];k>m&&(k=m);var r=Math.sqrt(k*k/(1+e*e));0>d&&(r=-r);b+=r;c+=e*r;p?a.lineTo(b,c):a.moveTo(b,c);m-=k;p=!p}}
    G.prototype.raiseChangedEvent=G.prototype.ad=function(a,b,c,d,e,f,h){var k=this.U;if(null!==k&&(k.Xn(a,b,c,d,e,f,h),zo(this)&&c===this&&a===Nf&&Ao(this,k,b),c===k&&0!==(k.O&16777216)&&null!==k.data))for(a=this.xa.n,c=a.length,d=0;d<c;d++)e=a[d],e instanceof C&&Mm(e,function(a){null!==a.data&&0!==(a.O&16777216)&&a.Ib(b)})};
    function Ao(a,b,c){var d=a.Ul();if(null!==d)for(var e=a.vc.i;e.next();){var f=e.value,h=null;if(null!==f.xq){h=eh(f,d,a);if(null===h)continue;f.qy(a,h,c,null)}else if(f.Dx){var k=b.g;null===k||k.Pe||f.qy(a,k.aa.Ik,c,d)}else{var l=d.data;if(null===l)continue;k=b.g;null===k||k.Pe||f.qy(a,l,c,d)}h===a&&(k=d.mx(f.lm),null!==k&&f.FG(k,h,c))}}G.prototype.mx=function(a){return this.po===a?this:null};G.prototype.raiseChanged=G.prototype.h=function(a,b,c){this.ad(Nf,a,this,b,c)};
    function Bo(a,b,c,d,e){var f=a.sd,h=a.Si;h.reset();Co(a,h,b,c,d,e);a.Si=h;f.x=b;f.y=c;f.width=d;f.height=e;h.hu()||h.CG(f)}function Do(a,b,c,d){if(!1===a.Xg)return!1;d.multiply(a.transform);return c?a.Zf(b,d):a.tn(b,d)}
    G.prototype.UE=function(a,b,c){if(!1===this.Xg)return!1;var d=this.Ja;b=a.zf(b);var e=!1;c&&(e=Ra(a.x,a.y,0,0,0,d.height)<b||Ra(a.x,a.y,0,d.height,d.width,d.height)<b||Ra(a.x,a.y,d.width,d.height,d.width,0)<b||Ra(a.x,a.y,d.width,0,0,0)<b);c||(e=Ra(a.x,a.y,0,0,0,d.height)<b&&Ra(a.x,a.y,0,d.height,d.width,d.height)<b&&Ra(a.x,a.y,d.width,d.height,d.width,0)<b&&Ra(a.x,a.y,d.width,0,0,0)<b);return e};G.prototype.ah=function(){return!0};
    G.prototype.containsPoint=G.prototype.Ia=function(a){var b=w.K();b.assign(a);this.transform.nb(b);var c=this.W;if(!c.I())return w.v(b),!1;var d=this.g;if(null!==d&&d.ml){var e=d.Yt("extraTouchThreshold"),f=d.Yt("extraTouchArea"),h=f/2,k=this.Ja,d=this.pj()*d.scale,l=1/d;if(k.width*d<e&&k.height*d<e)return a=db(c.x-h*l,c.y-h*l,c.width+f*l,c.height+f*l,b.x,b.y),w.v(b),a}if(this instanceof kh||this instanceof X?db(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.Ia(b))return e=!1,e=this.qg&&!this.qg.Ia(b)?
        !1:null!==this.bc&&c.Ia(b)?!0:null!==this.Eb&&this.Uc.Ia(a)?!0:this.wk(a),w.v(b),e;w.v(b);return!1};G.prototype.wk=function(a){var b=this.Ja;return db(0,0,b.width,b.height,a.x,a.y)};G.prototype.containsRect=G.prototype.xk=function(a){if(0===this.angle)return this.W.xk(a);var b=this.Ja,b=w.mg(0,0,b.width,b.height),c=this.transform,d=!1,e=w.xb(a.x,a.y);b.Ia(c.pi(e))&&(e.m(a.x,a.bottom),b.Ia(c.pi(e))&&(e.m(a.right,a.bottom),b.Ia(c.pi(e))&&(e.m(a.right,a.y),b.Ia(c.pi(e))&&(d=!0))));w.v(e);w.Db(b);return d};
    G.prototype.containedInRect=G.prototype.tn=function(a,b){if(void 0===b)return a.xk(this.W);var c=this.Ja,d=!1,e=w.xb(0,0);a.Ia(b.nb(e))&&(e.m(0,c.height),a.Ia(b.nb(e))&&(e.m(c.width,c.height),a.Ia(b.nb(e))&&(e.m(c.width,0),a.Ia(b.nb(e))&&(d=!0))));w.v(e);return d};
    G.prototype.intersectsRect=G.prototype.Zf=function(a,b){if(void 0===b&&(b=this.transform,0===this.angle))return a.Zf(this.W);var c=this.Ja,d=b,e=w.xb(0,0),f=w.xb(0,c.height),h=w.xb(c.width,c.height),k=w.xb(c.width,0),l=!1;if(a.Ia(d.nb(e))||a.Ia(d.nb(f))||a.Ia(d.nb(h))||a.Ia(d.nb(k)))l=!0;else{var c=w.mg(0,0,c.width,c.height),m=w.xb(a.x,a.y);c.Ia(d.pi(m))?l=!0:(m.m(a.x,a.bottom),c.Ia(d.pi(m))?l=!0:(m.m(a.right,a.bottom),c.Ia(d.pi(m))?l=!0:(m.m(a.right,a.y),c.Ia(d.pi(m))&&(l=!0))));w.v(m);w.Db(c);!l&&
    (ne(a,e,f)||ne(a,f,h)||ne(a,h,k)||ne(a,k,e))&&(l=!0)}w.v(e);w.v(f);w.v(h);w.v(k);return l};G.prototype.getDocumentPoint=G.prototype.Wa=function(a,b){void 0===b&&(b=new z);if(a instanceof L){a.Sd()&&w.k("getDocumentPoint:s Spot must be specific: "+a.toString());var c=this.Ja;b.m(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY)}else b.set(a);this.rh.nb(b);return b};
    G.prototype.getDocumentAngle=G.prototype.Wl=function(){var a;a=this.rh;1===a.m11&&0===a.m12?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360));return a};G.prototype.getDocumentScale=G.prototype.pj=function(){if(0!==(this.O&4096)===!1)return this.Do;var a=this.ub;return null!==this.Q?a*this.Q.pj():a};G.prototype.getLocalPoint=G.prototype.$E=function(a,b){void 0===b&&(b=new z);b.assign(a);this.rh.pi(b);return b};
    G.prototype.getNearestIntersectionPoint=G.prototype.aF=function(a,b,c){return this.Dn(a.x,a.y,b.x,b.y,c)};g=G.prototype;g.Dn=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy);if(null!==this.mn)return f=this.W,le(f.left,f.top,f.right,f.bottom,a,b,c,d,e);h=a*k+b*m+p;a=a*l+b*n+q;b=c*k+d*m+p;c=c*l+d*n+q;e.m(0,0);d=this.Ja;c=le(0,0,d.width,d.height,h,a,b,c,e);e.transform(f);return c};
    function xk(a,b,c,d,e){if(!1!==Cm(a)){var f=a.margin,h=f.right+f.left,f=f.top+f.bottom;b=Math.max(b-h,0);c=Math.max(c-f,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-f,0);var h=a.angle,f=0,f=a.Ca,k=0;a instanceof X&&(k=a.lb);90===h||270===h?(b=isFinite(f.height)?f.height+k:b,c=isFinite(f.width)?f.width+k:c):(b=isFinite(f.width)?f.width+k:b,c=isFinite(f.height)?f.height+k:c);var f=d||0,k=e||0,l=a instanceof C;switch(Eo(a,!0)){case Oj:k=f=0;l&&(c=b=Infinity);break;case Fe:isFinite(b)&&b>d&&(f=b);isFinite(c)&&
    c>e&&(k=c);break;case qo:isFinite(b)&&b>d&&(f=b);k=0;l&&(c=Infinity);break;case po:isFinite(c)&&c>e&&(k=c),f=0,l&&(b=Infinity)}var l=a.Gf,m=a.si;f>l.width&&m.width<l.width&&(f=l.width);k>l.height&&m.height<l.height&&(k=l.height);d=Math.max(f/a.scale,m.width);e=Math.max(k/a.scale,m.height);l.width<d&&(d=Math.min(m.width,d));l.height<e&&(e=Math.min(m.height,e));b=Math.min(l.width,b);c=Math.min(l.height,c);b=Math.max(d,b);c=Math.max(e,c);if(90===h||270===h)f=b,b=c,c=f,f=d,d=e,e=f;a.sd.Qa();a.Pn(b,c,
        d,e);a.sd.freeze();a.sd.I()||w.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.sd.toString());am(a,!1)}}g.Pn=function(){};g.tj=function(){return!1};
    g.jc=function(a,b,c,d,e){this.Mi();var f=w.Jf();f.assign(this.oc);this.oc.Qa();if(!1===Dm(this)){var h=this.oc;h.x=a;h.y=b;h.width=c;h.height=d}else this.jj(a,b,c,d);this.oc.freeze();this.qg=void 0===e?null:e;c=!1;void 0!==e?c=!0:null!==this.Q&&(e=this.Q.Uc,d=this.za,null!==this.mn&&(d=this.oc),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 Lh&&(a=this.Uc,this.Zv>a.height||this.vf.We>a.width))&&(c=!0);this.O=c?this.O|256:this.O&-257;this.oc.I()||
    w.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.oc.toString());this.Qx(f,this.oc);Fo(this,!1);w.Db(f)};g.jj=function(){};
    function Go(a,b,c,d,e){var f=a.W;f.x=b;f.y=c;f.width=d;f.height=e;if(!a.Ca.I()){f=a.sd;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=f.width+b;f=f.height+h;d+=b;e+=h;b=Eo(a,!0);c===d&&f===e&&(b=Oj);switch(b){case Oj:if(c>d||f>e)am(a,!0),xk(a,c>d?d:c,f>e?e:f);break;case Fe:am(a,!0);xk(a,d,e,0,0);break;case qo:am(a,!0);xk(a,d,f,0,0);break;case po:am(a,!0),xk(a,c,e,0,0)}}}
    g.Qx=function(a,b){var c=this.U;null!==c&&null!==c.g&&(c.Iu!==this&&c.cG!==this&&c.eB!==this||Ho(c,!0),this.oa(),Va(a,b)||(c.Gk(),this.vs(c)))};g.vs=function(a){null!==this.Ud&&(Ho(a,!0),a instanceof T&&Io(a,this))};w.defineProperty(G,{uq:"shadowVisible"},function(){return this.fn},function(a){var b=this.fn;b!==a&&(this.fn=a,this.oa(),this.h("shadowVisible",b,a))});
    G.prototype.ue=function(a,b){if(this.visible){var c=this.oc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)){var d=this.opacity,e=1;if(1!==d){if(0===d)return;e=a.globalAlpha;a.globalAlpha=e*d}if(a instanceof Oc)a:{if(this.visible){var f=null,h=a.Fx;if(this instanceof C&&(this.type===Jo||this.type===Ko))Lo(this,a,b);else{var k=this.oc;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.Q;0!==(this.O&4096)===!0&&Mo(this);var c=0!==(this.O&256),n=!1;this instanceof
    Lh&&(a.font=this.font);if(c){n=m.ah()?m.Ja:m.W;if(null!==this.qg)var p=this.qg,q=p.x,r=p.y,s=p.width,p=p.height;else q=Math.max(k.x,n.x),r=Math.max(k.y,n.y),s=Math.min(k.right,n.right)-q,p=Math.min(k.bottom,n.bottom)-r;if(q>k.width+k.x||k.x>n.width+n.x||r>k.height+k.y||k.y>n.height+n.y)break a;n=!0;Qc(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}if(this.tj()){var u=this;if(!u.isVisible())break a}a.wh.Ub=[1,0,0,1,0,0];this instanceof Lh&&1<this.IA&&Qc(a,1,0,0,1,0,0);q=!1;this.tj()&&
    this.dm&&b.qj("drawShadows")&&(r=this.en,a.sB(r.x*b.scale*b.Ed,r.y*b.scale*b.Ed,u.Gg),a.ao(),a.shadowColor=u.dn);u=!1;this.U&&b.qj("drawShadows")&&(u=this.U.dm);!0===this.uq?(a.ao(),!1===q&&u&&(Qc(a,1,0,0,1,0,0),a.bb(),q=!0)):!1===this.uq&&a.$n();null!==this.bc&&(No(this,a,this.bc,!0,!0),!1===q&&u&&(Qc(a,1,0,0,1,0,0),a.bb(),q=!0),this.bc instanceof ha&&this.bc.type===bd?(a.beginPath(),a.rect(k.x,k.y,k.width,k.height),a.Ng(this.bc)):a.fillRect(k.x,k.y,k.width,k.height));this instanceof C?Qc(a,l.m11,
        l.m12,l.m21,l.m22,l.dx,l.dy):a.wh.Ub=[l.m11,l.m12,l.m21,l.m22,l.dx,l.dy];null!==this.Eb&&(!1===q&&u&&(Qc(a,1,0,0,1,0,0),a.bb(),q=!0),s=this.Ja,l=k=0,r=s.width,s=s.height,p=0,this instanceof X&&(s=this.Ua.gb,k=s.x,l=s.y,r=s.width,s=s.height,p=this.ji),No(this,a,this.Eb,!0,!1),this.Eb instanceof ha&&this.Eb.type===bd?(a.beginPath(),a.rect(k-p/2,l-p/2,r+p,s+p),a.Ng(this.Eb)):a.fillRect(k-p/2,l-p/2,r+p,s+p));u&&(null!==this.Eb||null!==this.bc||null!==m&&0!==(m.O&512)||null!==m&&(m.type===Fl||m.type===
    Mj)&&m.Ld()!==this)?(Oo(this,!0),null===this.uq&&a.$n()):Oo(this,!1);this.zk(a,b);u&&0!==(this.O&512)===!0&&a.ao();this.tj()&&u&&a.$n();c&&(a.restore(),n&&a.mf.pop());this instanceof C&&(f=a.mf.pop());!0===q&&a.mf.pop();this instanceof Lh&&1<this.IA&&(f=a.mf.pop());null!==a.ME&&(null===f&&(h===a.Fx?(Qc(a,1,0,0,1,0,0),f=a.mf.pop()):f=a.Fx),a.ME(this,f))}}}}else{if(this instanceof C&&(this.type===Jo||this.type===Ko)){Lo(this,a,b);1!==d&&(a.globalAlpha=e);return}this instanceof W&&this.qu(!1);f=this.transform;
        h=this.Q;0!==(this.O&4096)===!0&&Mo(this);m=0!==(this.O&256);a.Hp&&(m=!1);this instanceof Lh&&(a.font=this.font);if(m){n=h.ah()?h.Ja:h.W;null!==this.qg?(q=this.qg,k=q.x,l=q.y,u=q.width,q=q.height):(k=Math.max(c.x,n.x),l=Math.max(c.y,n.y),u=Math.min(c.right,n.right)-k,q=Math.min(c.bottom,n.bottom)-l);if(k>c.width+c.x||c.x>n.width+n.x||l>c.height+c.y||c.y>n.height+n.y){1!==d&&(a.globalAlpha=e);return}a.save();a.beginPath();a.rect(k,l,u,q);a.clip()}if(this.tj()){if(!this.isVisible()){1!==d&&(a.globalAlpha=
            e);return}this.dm&&b.qj("drawShadows")&&(n=this.en,a.sB(n.x*b.scale*b.Ed,n.y*b.scale*b.Ed,this.Gg),a.ao(),a.shadowColor=this.dn)}n=!1;this.U&&b.qj("drawShadows")&&(n=this.U.dm);!0===this.uq?a.ao():!1===this.uq&&a.$n();null!==this.bc&&(No(this,a,this.bc,!0,!0),this.bc instanceof ha&&this.bc.type===bd?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Ng(this.bc)):a.fillRect(c.x,c.y,c.width,c.height));f.hu()||a.transform(f.m11,f.m12,f.m21,f.m22,f.dx,f.dy);null!==this.Eb&&(u=this.Ja,k=c=0,l=u.width,u=
            u.height,q=0,this instanceof X&&(u=this.Ua.gb,c=u.x,k=u.y,l=u.width,u=u.height,q=this.ji),No(this,a,this.Eb,!0,!1),this.Eb instanceof ha&&this.Eb.type===bd?(a.beginPath(),a.rect(c-q/2,k-q/2,l+q,u+q),a.Ng(this.Eb)):a.fillRect(c-q/2,k-q/2,l+q,u+q));n&&(null!==this.Eb||null!==this.bc||null!==h&&0!==(h.O&512)||null!==h&&(h.type===Fl||h.type===Mj)&&h.Ld()!==this)?(Oo(this,!0),null===this.uq&&a.$n()):Oo(this,!1);this.zk(a,b);n&&0!==(this.O&512)===!0&&a.ao();this.tj()&&n&&a.$n();m?(a.restore(),this instanceof
        C?a.Fe(!0):a.Fe(!1)):f.hu()||(h=1/(f.m11*f.m22-f.m12*f.m21),a.transform(f.m22*h,-f.m12*h,-f.m21*h,f.m11*h,h*(f.m21*f.dy-f.m22*f.dx),h*(f.m12*f.dx-f.m11*f.dy)))}1!==d&&(a.globalAlpha=e)}}};
    function Lo(a,b,c){var d=a.oc;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.bc&&(No(a,b,a.bc,!0,!0),a.bc instanceof ha&&a.bc.type===bd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Ng(a.bc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Eb&&(No(a,b,a.Eb,!0,!1),a.Eb instanceof ha&&a.Eb.type===bd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Ng(a.Eb)):b.fillRect(d.x,d.y,d.width,d.height)),a.zk(b,c))}G.prototype.zk=function(){};
    function No(a,b,c,d,e){if(null!==c){var f=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===og)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Ja,f=h.width,h=h.height;if(e)var l=a.W,f=l.width,h=l.height;var m=b instanceof Xc;if(m&&c.eh&&(c.type===Un||c.so===f&&c.Ny===h))k=c.eh;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.W,f=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*f+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*f+c.end.offsetX;q=c.end.y*h+c.end.offsetY;
        l+=r;p+=r;n+=s;q+=s;if(c.type===pg)k=b.createLinearGradient(l,n,p,q);else if(c.type===bd)s=isNaN(c.Kt)?Math.max(f,h)/2:c.Kt,isNaN(c.Ou)?(r=0,s=Math.max(f,h)/2):r=c.Ou,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===Un)try{k=b.createPattern(c.pattern,"repeat")}catch(u){k=null}else w.Bd(c.type,"Brush type");if(c.type!==Un&&(e=c.uk,null!==e))for(e=e.i;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.eh=k,null!==k&&(c.so=f,c.Ny=h),null===k&&c.type===Un&&-1!==c.so)){c.so=-1;var t=a.g;null!==t&&
        -1===c.so&&w.setTimeout(function(){t.Xx()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}G.prototype.isContainedBy=G.prototype.bm=function(a){if(a instanceof C)a:{if(this!==a&&null!==a)for(var b=this.Q;null!==b;){if(b===a){a=!0;break a}b=b.Q}a=!1}else a=!1;return a};G.prototype.isVisibleObject=G.prototype.xj=function(){if(!this.visible)return!1;var a=this.Q;return null!==a?a.xj():!0};
    G.prototype.isEnabledObject=G.prototype.fu=function(){for(var a=this instanceof C?this:this.Q;null!==a&&a.isEnabled;)a=a.Q;return null===a};w.defineProperty(G,{NE:"enabledChanged"},function(){return null!==this.ja?this.ja.tr:null},function(a){uo(this);var b=this.ja.tr;b!==a&&(null!==a&&w.j(a,"function",G,"enabledChanged"),this.ja.tr=a,this.h("enabledChanged",b,a))});
    function Mo(a){if(0!==(a.O&2048)===!0){var b=a.hd;b.reset();if(!a.oc.I()||!a.sd.I()){Po(a,!1);return}b.translate(a.oc.x,a.oc.y);b.translate(-a.za.x,-a.za.y);var c=a.Ja;Co(a,b,c.x,c.y,c.width,c.height);Po(a,!1);Qo(a,!0)}0!==(a.O&4096)===!0&&(b=a.Q,null===b?(a.sm.set(a.hd),a.Do=a.scale,Qo(a,!1)):null!==b.rh&&(c=a.sm,c.reset(),b.ah()?c.multiply(b.sm):null!==b.Q&&c.multiply(b.Q.sm),c.multiply(a.hd),a.Do=a.scale*b.Do,Qo(a,!1)))}
    function Co(a,b,c,d,e,f){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=Jb;a.tj()&&a.Ff.Yc()&&(h=a.Ff);var k=w.K();if(a instanceof R&&a.bg!==a)for(c=a.bg,d=c.Ja,k.Lu(d.x,d.y,d.width,d.height,h),c.Si.nb(k),k.offset(-c.za.x,-c.za.y),h=c.Q;null!==h&&h!==a;)h.Si.nb(k),k.offset(-h.za.x,-h.za.y),h=h.Q;else k.Lu(c,d,e,f,h);b.rotate(a.angle,k.x,k.y);w.v(k)}}g=G.prototype;g.H=function(a){void 0===a&&(a=!1);if(!0!==Cm(this)){am(this,!0);Fo(this,!0);var b=this.Q;null===b||a||b.H()}};
    g.Zp=function(){!0!==Cm(this)&&(am(this,!0),Fo(this,!0))};function Ro(a){if(!1===Dm(a)){var b=a.Q;null!==b?b.H():a.tj()&&(b=a.g,null!==b&&(b.xg.add(a),a instanceof T&&a.$f(),b.Ne()));Fo(a,!0)}}g.Mi=function(){0!==(this.O&2048)===!1&&(Po(this,!0),Qo(this,!0))};g.BA=function(){Qo(this,!0)};g.oa=function(){var a=this.U;null!==a&&a.oa()};
    function Eo(a,b){var c=a.stretch,d=a.Q;if(null!==d&&d.na===So)return To(a,d.Nd(a.Vb),d.Md(a.column),b);if(null!==d&&d.na===Fl&&d.Ld()===a)return Uo(a,Fe,b);if(c===oo){if(null!==d){if(d.na===Mj&&d.Ld()===a)return Uo(a,Fe,b);c=d.be;return c===oo?Uo(a,Oj,b):Uo(a,c,b)}return Uo(a,Oj,b)}return Uo(a,c,b)}
    function To(a,b,c,d){var e=a.stretch;if(e!==oo)return Uo(a,e,d);var f=e=null;switch(b.stretch){case po:f=!0;break;case Fe:f=!0}switch(c.stretch){case qo:e=!0;break;case Fe:e=!0}b=a.Q.be;null===e&&(e=b===qo||b===Fe);null===f&&(f=b===po||b===Fe);return!0===e&&!0===f?Uo(a,Fe,d):!0===e?Uo(a,qo,d):!0===f?Uo(a,po,d):Uo(a,Oj,d)}
    function Uo(a,b,c){if(c)return b;if(b===Oj)return Oj;c=a.Ca;if(c.I())return Oj;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===qo)return Oj;if(b===Fe)return po}else{if(b===po)return Oj;if(b===Fe)return qo}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===po)return Oj;if(b===Fe)return qo}else{if(b===qo)return Oj;if(b===Fe)return po}return b}
    w.defineProperty(G,{qq:"segmentOrientation"},function(){return this.bn},function(a){var b=this.bn;b!==a&&(this.bn=a,this.H(),this.h("segmentOrientation",b,a),a===kj&&(this.angle=0))});w.defineProperty(G,{Oe:"segmentIndex"},function(){return this.Us},function(a){a=Math.round(a);var b=this.Us;b!==a&&(this.Us=a,this.H(),this.h("segmentIndex",b,a))});
    w.defineProperty(G,{hB:"segmentFraction"},function(){return this.$m},function(a){isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.$m;b!==a&&(this.$m=a,this.H(),this.h("segmentFraction",b,a))});w.defineProperty(G,{iB:"segmentOffset"},function(){return this.an},function(a){var b=this.an;b.L(a)||(this.an=a=a.S(),this.H(),this.h("segmentOffset",b,a))});w.defineProperty(G,{stretch:"stretch"},function(){return this.Hg},function(a){var b=this.Hg;b!==a&&(this.Hg=a,this.H(),this.h("stretch",b,a))});
    w.defineProperty(G,{name:"name"},function(){return this.Sb},function(a){var b=this.Sb;b!==a&&(this.Sb=a,null!==this.U&&(this.U.Rm=null),this.h("name",b,a))});w.defineProperty(G,{opacity:"opacity"},function(){return this.yc},function(a){var b=this.yc;b!==a&&(w.j(a,"number",G,"opacity"),(0>a||1<a)&&w.Fa(a,"0 <= value <= 1",G,"opacity"),this.yc=a,this.h("opacity",b,a),a=this.g,b=this.U,null!==a&&null!==b&&a.oa(nl(b,b.W)))});
    w.defineProperty(G,{visible:"visible"},function(){return 0!==(this.O&1)},function(a){var b=0!==(this.O&1);b!==a&&(this.O^=1,this.h("visible",b,a),b=this.Q,null!==b?b.H():this.tj()&&this.yd(a),this.oa(),Vo(this))});w.defineProperty(G,{Xg:"pickable"},function(){return 0!==(this.O&2)},function(a){var b=0!==(this.O&2);b!==a&&(this.O^=2,this.h("pickable",b,a))});
    w.defineProperty(G,{XH:"fromLinkableDuplicates"},function(){return 0!==(this.O&4)},function(a){var b=0!==(this.O&4);b!==a&&(this.O^=4,this.h("fromLinkableDuplicates",b,a))});w.defineProperty(G,{YH:"fromLinkableSelfNode"},function(){return 0!==(this.O&8)},function(a){var b=0!==(this.O&8);b!==a&&(this.O^=8,this.h("fromLinkableSelfNode",b,a))});
    w.defineProperty(G,{QJ:"toLinkableDuplicates"},function(){return 0!==(this.O&16)},function(a){var b=0!==(this.O&16);b!==a&&(this.O^=16,this.h("toLinkableDuplicates",b,a))});w.defineProperty(G,{RJ:"toLinkableSelfNode"},function(){return 0!==(this.O&32)},function(a){var b=0!==(this.O&32);b!==a&&(this.O^=32,this.h("toLinkableSelfNode",b,a))});w.defineProperty(G,{pf:"isPanelMain"},function(){return 0!==(this.O&64)},function(a){var b=0!==(this.O&64);b!==a&&(this.O^=64,this.H(),this.h("isPanelMain",b,a))});
    w.defineProperty(G,{wx:"isActionable"},function(){return 0!==(this.O&128)},function(a){var b=0!==(this.O&128);b!==a&&(this.O^=128,this.h("isActionable",b,a))});w.defineProperty(G,{mn:"areaBackground"},function(){return this.bc},function(a){var b=this.bc;b!==a&&(a instanceof ha&&a.freeze(),this.bc=a,this.oa(),this.h("areaBackground",b,a))});
    w.defineProperty(G,{background:"background"},function(){return this.Eb},function(a){var b=this.Eb;b!==a&&(a instanceof ha&&a.freeze(),this.Eb=a,this.oa(),this.h("background",b,a))});function Oo(a,b){a.O=b?a.O|512:a.O&-513}function zo(a){return 0!==(a.O&1024)}function Wo(a,b){a.O=b?a.O|1024:a.O&-1025}function Po(a,b){a.O=b?a.O|2048:a.O&-2049}function Qo(a,b){a.O=b?a.O|4096:a.O&-4097}function Cm(a){return 0!==(a.O&8192)}function am(a,b){a.O=b?a.O|8192:a.O&-8193}
    function Dm(a){return 0!==(a.O&16384)}function Fo(a,b){a.O=b?a.O|16384:a.O&-16385}w.u(G,{U:"part"},function(){if(this.tj())return this;if(null!==this.Wm)return this.Wm;var a;for(a=this.Q;a;){if(a instanceof R)return this.Wm=a;a=a.Q}return null});w.u(G,{Q:"panel"},function(){return this.nh});G.prototype.hm=function(a){this.nh=a};w.u(G,{layer:"layer"},function(){var a=this.U;return null!==a?a.layer:null},{configurable:!0});w.u(G,{g:"diagram"},function(){var a=this.U;return null!==a?a.g:null},{configurable:!0});
    w.defineProperty(G,{position:"position"},function(){return this.jb},function(a){var b=a.x,c=a.y,d=this.jb,e=d.x,f=d.y;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))?this.pB():(a=a.S(),this.oB(a,d)&&this.h("position",d,a))});G.prototype.pB=function(){};G.prototype.oB=function(a){this.jb=a;Ro(this);this.Mi();return!0};G.prototype.ny=function(a,b){this.jb.m(a,b);this.Mi()};w.u(G,{W:"actualBounds"},function(){return this.oc});
    w.defineProperty(G,{scale:"scale"},function(){return this.ub},function(a){var b=this.ub;b!==a&&(0>=a&&w.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.ub=a,this.Mi(),this.H(),this.h("scale",b,a))});w.defineProperty(G,{angle:"angle"},function(){return this.ng},function(a){var b=this.ng;b!==a&&(a%=360,0>a&&(a+=360),b!==a&&(this.ng=a,Vo(this),this.H(),this.Mi(),this.h("angle",b,a)))});
    w.defineProperty(G,{Ca:"desiredSize"},function(){return this.Te},function(a){var b=a.width,c=a.height,d=this.Te,e=d.width,f=d.height;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(this.Te=a=a.S(),this.H(),this instanceof X&&this.Me(),this.h("desiredSize",d,a),zo(this)&&(a=this.U,null!==a&&(Ao(this,a,"width"),Ao(this,a,"height"))))});
    w.defineProperty(G,{width:"width"},function(){return this.Te.width},function(a){var b=this.Te.width;b===a||isNaN(b)&&isNaN(a)||(b=this.Te,this.Te=a=(new ia(a,this.Te.height)).freeze(),this.H(),this instanceof X&&this.Me(),this.h("desiredSize",b,a),zo(this)&&(a=this.U,null!==a&&Ao(this,a,"width")))});
    w.defineProperty(G,{height:"height"},function(){return this.Te.height},function(a){var b=this.Te.height;b===a||isNaN(b)&&isNaN(a)||(b=this.Te,this.Te=a=(new ia(this.Te.width,a)).freeze(),this.H(),this instanceof X&&this.Me(),this.h("desiredSize",b,a),zo(this)&&(a=this.U,null!==a&&Ao(this,a,"height")))});
    w.defineProperty(G,{si:"minSize"},function(){return this.Yh},function(a){var b=this.Yh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Yh=a,this.H(),this.h("minSize",b,a))});w.defineProperty(G,{Gf:"maxSize"},function(){return this.Xh},function(a){var b=this.Xh;b.L(a)||(a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Xh=a,this.H(),this.h("maxSize",b,a))});w.u(G,{za:"measuredBounds"},function(){return this.sd});
    w.u(G,{Ja:"naturalBounds"},function(){return this.Uc},{configurable:!0});w.defineProperty(G,{margin:"margin"},function(){return this.Pm},function(a){"number"===typeof a&&(a=new hb(a));var b=this.Pm;b.L(a)||(this.Pm=a=a.S(),this.H(),this.h("margin",b,a))});w.u(G,{transform:null},function(){0!==(this.O&2048)===!0&&Mo(this);return this.hd});w.u(G,{rh:null},function(){0!==(this.O&4096)===!0&&Mo(this);return this.sm});
    w.defineProperty(G,{alignment:"alignment"},function(){return this.ie},function(a){var b=this.ie;b.L(a)||(a.Sd()&&!a.Xc()&&w.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.ie=a=a.S(),Ro(this),this.h("alignment",b,a))});w.defineProperty(G,{column:"column"},function(){return this.Uq},function(a){a=Math.round(a);var b=this.Uq;b!==a&&(0>a&&w.Fa(a,">= 0",G,"column"),this.Uq=a,this.H(),this.h("column",b,a))});
    w.defineProperty(G,{xH:"columnSpan"},function(){return this.Bi},function(a){a=Math.round(a);var b=this.Bi;b!==a&&(1>a&&w.Fa(a,">= 1",G,"columnSpan"),this.Bi=a,this.H(),this.h("columnSpan",b,a))});w.defineProperty(G,{Vb:"row"},function(){return this.Qs},function(a){a=Math.round(a);var b=this.Qs;b!==a&&(0>a&&w.Fa(a,">= 0",G,"row"),this.Qs=a,this.H(),this.h("row",b,a))});
    w.defineProperty(G,{rowSpan:"rowSpan"},function(){return this.bj},function(a){a=Math.round(a);var b=this.bj;b!==a&&(1>a&&w.Fa(a,">= 1",G,"rowSpan"),this.bj=a,this.H(),this.h("rowSpan",b,a))});w.defineProperty(G,{oy:"spanAllocation"},function(){return this.ft},function(a){var b=this.ft;b!==a&&(null!==a&&w.j(a,"function",G,"spanAllocation"),this.ft=a,this.H(),this.h("spanAllocation",b,a))});
    w.defineProperty(G,{qh:"alignmentFocus"},function(){return this.rm},function(a){var b=this.rm;b.L(a)||(!a.Sd()||a.Xc()||a.L(yb)&&this instanceof T||w.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.rm=a=a.S(),this.H(),this.h("alignmentFocus",b,a))});
    w.defineProperty(G,{Ud:"portId"},function(){return this.Ds},function(a){var b=this.Ds;if(b!==a){var c=this.U;null===c||c instanceof T||(w.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&Xo(c,this);this.Ds=a;if(null!==a&&c){c.Fk=!0;null===c.ne&&Yo(c);var d=this.Ud;null!==d&&c.ne.add(d,this)}this.h("portId",b,a)}});function Zo(a){var b=a.U;if(b instanceof T&&(null!==a.Ud||a===b.port)){var c=b.g;null===c||c.ia.ab||Io(b,a)}}
    function Vo(a){var b=a.g;null===b||b.ia.ab||(a instanceof C?a instanceof T?a.$f():$o(a,a,function(a){Zo(a)}):Zo(a))}w.defineProperty(G,{Bb:"toSpot"},function(){return null!==this.V?this.V.pk:yb},function(a){this.Pd();var b=this.V.pk;b.L(a)||(a=a.S(),this.V.pk=a,this.h("toSpot",b,a),Zo(this))});
    w.defineProperty(G,{nm:"toEndSegmentLength"},function(){return null!==this.V?this.V.nk:10},function(a){this.Pd();var b=this.V.nk;b!==a&&(0>a&&w.Fa(a,">= 0",G,"toEndSegmentLength"),this.V.nk=a,this.h("toEndSegmentLength",b,a),Zo(this))});w.defineProperty(G,{Pu:"toEndSegmentDirection"},function(){return null!==this.V?this.V.mk:xo},function(a){this.Pd();var b=this.V.mk;b!==a&&(w.It("GraphObject.toEndSegmentDirection","2.0"),this.V.mk=a,this.h("toEndSegmentDirection",b,a),Zo(this))});
    w.defineProperty(G,{Qu:"toShortLength"},function(){return null!==this.V?this.V.ok:0},function(a){this.Pd();var b=this.V.ok;b!==a&&(this.V.ok=a,this.h("toShortLength",b,a),Zo(this))});w.defineProperty(G,{wG:"toLinkable"},function(){return null!==this.V?this.V.nt:null},function(a){this.Pd();var b=this.V.nt;b!==a&&(this.V.nt=a,this.h("toLinkable",b,a))});
    w.defineProperty(G,{SJ:"toMaxLinks"},function(){return null!==this.V?this.V.ot:Infinity},function(a){this.Pd();var b=this.V.ot;b!==a&&(0>a&&w.Fa(a,">= 0",G,"toMaxLinks"),this.V.ot=a,this.h("toMaxLinks",b,a))});w.defineProperty(G,{Ab:"fromSpot"},function(){return null!==this.V?this.V.Tj:yb},function(a){this.Pd();var b=this.V.Tj;b.L(a)||(a=a.S(),this.V.Tj=a,this.h("fromSpot",b,a),Zo(this))});
    w.defineProperty(G,{Vl:"fromEndSegmentLength"},function(){return null!==this.V?this.V.Rj:10},function(a){this.Pd();var b=this.V.Rj;b!==a&&(0>a&&w.Fa(a,">= 0",G,"fromEndSegmentLength"),this.V.Rj=a,this.h("fromEndSegmentLength",b,a),Zo(this))});w.defineProperty(G,{Wt:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.Qj:xo},function(a){this.Pd();var b=this.V.Qj;b!==a&&(w.It("GraphObject.fromEndSegmentDirection","2.0"),this.V.Qj=a,this.h("fromEndSegmentDirection",b,a),Zo(this))});
    w.defineProperty(G,{Xt:"fromShortLength"},function(){return null!==this.V?this.V.Sj:0},function(a){this.Pd();var b=this.V.Sj;b!==a&&(this.V.Sj=a,this.h("fromShortLength",b,a),Zo(this))});w.defineProperty(G,{XE:"fromLinkable"},function(){return null!==this.V?this.V.wr:null},function(a){this.Pd();var b=this.V.wr;b!==a&&(this.V.wr=a,this.h("fromLinkable",b,a))});
    w.defineProperty(G,{qA:"fromMaxLinks"},function(){return null!==this.V?this.V.xr:Infinity},function(a){this.Pd();var b=this.V.xr;b!==a&&(0>a&&w.Fa(a,">= 0",G,"fromMaxLinks"),this.V.xr=a,this.h("fromMaxLinks",b,a))});w.defineProperty(G,{cursor:"cursor"},function(){return this.cr},function(a){var b=this.cr;b!==a&&(w.j(a,"string",G,"cursor"),this.cr=a,this.h("cursor",b,a))});
    w.defineProperty(G,{click:"click"},function(){return null!==this.ja?this.ja.Ai:null},function(a){uo(this);var b=this.ja.Ai;b!==a&&(null!==a&&w.j(a,"function",G,"click"),this.ja.Ai=a,this.h("click",b,a))});w.defineProperty(G,{Jt:"doubleClick"},function(){return null!==this.ja?this.ja.Ii:null},function(a){uo(this);var b=this.ja.Ii;b!==a&&(null!==a&&w.j(a,"function",G,"doubleClick"),this.ja.Ii=a,this.h("doubleClick",b,a))});
    w.defineProperty(G,{bA:"contextClick"},function(){return null!==this.ja?this.ja.Ci:null},function(a){uo(this);var b=this.ja.Ci;b!==a&&(null!==a&&w.j(a,"function",G,"contextClick"),this.ja.Ci=a,this.h("contextClick",b,a))});w.defineProperty(G,{su:"mouseEnter"},function(){return null!==this.ja?this.ja.ns:null},function(a){uo(this);var b=this.ja.ns;b!==a&&(null!==a&&w.j(a,"function",G,"mouseEnter"),this.ja.ns=a,this.h("mouseEnter",b,a))});
    w.defineProperty(G,{tu:"mouseLeave"},function(){return null!==this.ja?this.ja.os:null},function(a){uo(this);var b=this.ja.os;b!==a&&(null!==a&&w.j(a,"function",G,"mouseLeave"),this.ja.os=a,this.h("mouseLeave",b,a))});w.defineProperty(G,{SA:"mouseOver"},function(){return null!==this.ja?this.ja.Xi:null},function(a){uo(this);var b=this.ja.Xi;b!==a&&(null!==a&&w.j(a,"function",G,"mouseOver"),this.ja.Xi=a,this.h("mouseOver",b,a))});
    w.defineProperty(G,{RA:"mouseHover"},function(){return null!==this.ja?this.ja.Wi:null},function(a){uo(this);var b=this.ja.Wi;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHover"),this.ja.Wi=a,this.h("mouseHover",b,a))});w.defineProperty(G,{QA:"mouseHold"},function(){return null!==this.ja?this.ja.Vi:null},function(a){uo(this);var b=this.ja.Vi;b!==a&&(null!==a&&w.j(a,"function",G,"mouseHold"),this.ja.Vi=a,this.h("mouseHold",b,a))});
    w.defineProperty(G,{aJ:"mouseDragEnter"},function(){return null!==this.ja?this.ja.ls:null},function(a){uo(this);var b=this.ja.ls;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragEnter"),this.ja.ls=a,this.h("mouseDragEnter",b,a))});w.defineProperty(G,{bJ:"mouseDragLeave"},function(){return null!==this.ja?this.ja.ms:null},function(a){uo(this);var b=this.ja.ms;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDragLeave"),this.ja.ms=a,this.h("mouseDragLeave",b,a))});
    w.defineProperty(G,{PA:"mouseDrop"},function(){return null!==this.ja?this.ja.Ui:null},function(a){uo(this);var b=this.ja.Ui;b!==a&&(null!==a&&w.j(a,"function",G,"mouseDrop"),this.ja.Ui=a,this.h("mouseDrop",b,a))});w.defineProperty(G,{jE:"actionDown"},function(){return null!==this.ja?this.ja.Cq:null},function(a){uo(this);var b=this.ja.Cq;b!==a&&(null!==a&&w.j(a,"function",G,"actionDown"),this.ja.Cq=a,this.h("actionDown",b,a))});
    w.defineProperty(G,{kE:"actionMove"},function(){return null!==this.ja?this.ja.Dq:null},function(a){uo(this);var b=this.ja.Dq;b!==a&&(null!==a&&w.j(a,"function",G,"actionMove"),this.ja.Dq=a,this.h("actionMove",b,a))});w.defineProperty(G,{lE:"actionUp"},function(){return null!==this.ja?this.ja.Eq:null},function(a){uo(this);var b=this.ja.Eq;b!==a&&(null!==a&&w.j(a,"function",G,"actionUp"),this.ja.Eq=a,this.h("actionUp",b,a))});
    w.defineProperty(G,{iE:"actionCancel"},function(){return null!==this.ja?this.ja.Bq:null},function(a){uo(this);var b=this.ja.Bq;b!==a&&(null!==a&&w.j(a,"function",G,"actionCancel"),this.ja.Bq=a,this.h("actionCancel",b,a))});w.defineProperty(G,{yB:"toolTip"},function(){return null!==this.ja?this.ja.ej:null},function(a){uo(this);var b=this.ja.ej;b!==a&&(this.ja.ej=a,this.h("toolTip",b,a))});
    w.defineProperty(G,{contextMenu:"contextMenu"},function(){return null!==this.ja?this.ja.Di:null},function(a){uo(this);var b=this.ja.Di;b!==a&&(this.ja.Di=a,this.h("contextMenu",b,a))});G.prototype.bind=G.prototype.bind=function(a){a.Ig=this;var b=this.Ul();null!==b&&ap(b)&&w.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.vc&&(this.vc=new H(bh));this.vc.add(a)};
    G.prototype.findTemplateBinder=G.prototype.Ul=function(){for(var a=this instanceof C?this:this.Q;null!==a;){if(null!==a.$k)return a;a=a.Q}return null};G.prototype.setProperties=function(a){w.Ju(this,a)};var bp;
    G.make=bp=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var f=cp.ka(a);"function"===typeof f?(c=w.Nl(arguments),d=f(c),w.Pa(d)||w.k('GraphObject.make invoked object builder "'+a+'", but it did not return an Object')):e=ca[a]}null===d&&(void 0!==e&&null!==e&&e.constructor||w.k("GraphObject.make requires a class function or GoJS class name or name of an object builder, not: "+a),d=new e);f=1;if(d instanceof D&&1<c.length){var h=d,e=c[1];if("string"===
        typeof e||e instanceof HTMLDivElement)Dl(h,e),f++}for(;f<c.length;f++)e=c[f],void 0===e?w.k("Undefined value at argument "+f+" for object being constructed by GraphObject.make: "+d):dp(d,e);return d};
    function dp(a,b){if("string"===typeof b)if(a instanceof Lh)a.text=b;else if(a instanceof X)a.Cb=b;else if(a instanceof xl)a.source=b;else if(a instanceof C){var c=pa(C,b);null!==c?a.type=c:w.k("Unknown Panel type as an argument to GraphObject.make: "+b)}else a instanceof ha?(c=pa(ha,b),null!==c?a.type=c:w.k("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof Ce?(c=pa(Ce,b),null!==c?a.type=c:w.k("Unknown Geometry type as an argument to GraphObject.make: "+b)):a instanceof xf?
        (c=pa(xf,b),null!==c?a.type=c:w.k("Unknown PathSegment type as an argument to GraphObject.make: "+b)):w.k("Unable to use a string as an argument to GraphObject.make: "+b);else if(b instanceof G)c=b,a instanceof C||w.k("A GraphObject can only be added to a Panel, not to: "+a),a.add(c);else if(b instanceof Wg){var d=b,c=a,e;d.xe&&c.getRowDefinition?e=c.getRowDefinition(d.index):!d.xe&&c.getColumnDefinition?e=c.getColumnDefinition(d.index):w.k("A RowColumnDefinition can only be added to a Panel, not to: "+
        a);e.Jp(d)}else if(b instanceof da)"function"===typeof a.ic?a.ic(b):w.Fj(a,b);else if(b instanceof bh)a instanceof G?a.bind(b):a instanceof Wg?a.bind(b):w.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof Ee)a instanceof Ce?a.fc.add(b):w.k("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof xf)a instanceof Ee?a.vb.add(b):w.k("A PathSegment can only be added to a PathFigure, not to: "+a);else if(b instanceof tg)a instanceof
    D?a.Tb=b:a instanceof V?a.Tb=b:w.k("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++)dp(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof ha){e=new ra;for(c in b)d=parseFloat(c),isNaN(d)?e[c]=b[c]:a.addColorStop(d,b[c]);w.Ju(a,e)}else if(a instanceof Wg){void 0!==b.row?(e=b.row,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&w.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.xe=!0,
        a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&w.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.xe=!1,a.index=e);e=new ra;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);w.Ju(a,e)}else w.Ju(a,b);else w.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}var cp=new ma("string","function");
    G.getBuilders=function(){var a=new ma("string","function"),b;for(b in cp)if(b!==b.toLowerCase()){var c=cp.ka(b);"function"===typeof c&&a.add(b,c)}a.freeze();return a};var ep;G.defineBuilder=ep=function(a,b){w.j(a,"string",G,"defineBuilder:name");w.j(b,"function",G,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||w.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);cp.add(a,b)};var fp;
    G.takeBuilderArgument=fp=function(a,b,c){void 0===c&&(c=null);var d=a[1];if("function"===typeof c?c(d):"string"===typeof d)return a.splice(1,1),d;if(void 0===b)throw Error("no "+("function"===typeof c?"satisfactory":"string")+" argument for GraphObject builder "+a[0]);return b};
    ep("Button",function(){var a=new ha(pg);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new ha(pg);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=bp(C,Fl,{wx:!0,NE:function(a,b){var e=a.xd("ButtonBorder");null!==e&&(e.fill=b?a._buttonFillNormal:a._buttonFillDisabled)},_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue",_buttonFillDisabled:"darkgray"},bp(X,{name:"ButtonBorder",Cb:"Rectangle",A:new L(0,0,2.761423749153968,2.761423749153968),
        B:new L(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.su=function(a,b){if(b.fu()){var e=b.xd("ButtonBorder");if(e instanceof X){var f=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=f;f=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=f}}};a.tu=function(a,b){if(b.fu()){var e=b.xd("ButtonBorder");e instanceof X&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)}};return a});
    ep("TreeExpanderButton",function(){var a=bp("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},bp(X,{name:"ButtonIcon",Cb:"MinusLine",Ca:Bd},(new bh("figure","isTreeExpanded",function(a,c){var d=c.Q;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).Px()),{visible:!1},(new bh("visible","isTreeLeaf",function(a){return!a})).Px());a.click=function(a,c){var d=c.U;d instanceof kh&&(d=d.xf);if(d instanceof T){var e=d.g;if(null!==e){e=e.ob;if(d.tc){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return;
        a.Cc=!0;d.tc?e.collapseTree(d):e.expandTree(d)}}};return a});
    ep("SubGraphExpanderButton",function(){var a=bp("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},bp(X,{name:"ButtonIcon",Cb:"MinusLine",Ca:Bd},(new bh("figure","isSubGraphExpanded",function(a,c){var d=c.Q;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).Px()));a.click=function(a,c){var d=c.U;d instanceof kh&&(d=d.xf);if(d instanceof V){var e=d.g;if(null!==e){e=e.ob;if(d.Zc){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Cc=
        !0;d.Zc?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});ep("ContextMenuButton",function(){var a=bp("Button");a.stretch=qo;var b=a.xd("ButtonBorder");b instanceof X&&(b.Cb="Rectangle",b.A=new L(0,0,2,3),b.B=new L(1,1,-2,-2));return a});
    ep("PanelExpanderButton",function(a){var b=fp(a,"COLLAPSIBLE"),c=bp("Button",{_buttonExpandedFigure:"TriangleUp",_buttonCollapsedFigure:"TriangleDown"},bp(X,"TriangleUp",{name:"ButtonIcon",Ca:new ia(6,4)},(new bh("figure","visible",function(a){return a?c._buttonExpandedFigure:c._buttonCollapsedFigure})).Px(b)));a=c.xd("ButtonBorder");a instanceof X&&(a.stroke=null,a.fill="transparent");c.click=function(a,c){var f=c.g;if(null!==f&&!f.hb){var h=c.Ul();null===h&&(h=c.U);null!==h&&(h=h.xd(b),null!==h&&
    (f.Hb("Collapse/Expand Panel"),h.visible=!h.visible,f.Wc("Collapse/Expand Panel")))}};return c});
    ep("CheckBoxButton",function(a){var b=fp(a);a=bp("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},bp(X,{name:"ButtonIcon",ZH:"M0 4 L3 9 9 0",lb:2,stretch:Fe,rA:Qj,visible:!1},""!==b?(new bh("visible",b)).QI():[]));a.click=function(a,d){var e=a.g;if(!(null===e||e.hb||""!==b&&e.aa.hb)){a.Cc=!0;var f=d.xd("ButtonIcon");e.Hb("checkbox");f.visible=!f.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.Wc("checkbox")}};return a});
    ep("CheckBox",function(a){a=fp(a);a=bp("CheckBoxButton",a,{name:"Button",margin:new hb(0,1,0,0)});var b=bp(C,"Horizontal",a,{wx:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,_buttonFillDisabled:a._buttonFillDisabled,su:a.su,tu:a.tu,click:a.click,_buttonClick:a.click});a.su=null;a.tu=null;a.click=null;return b});
    function vo(){this.tr=this.Di=this.ej=this.Bq=this.Eq=this.Dq=this.Cq=this.Ui=this.ms=this.ls=this.Vi=this.Wi=this.Xi=this.os=this.ns=this.Ci=this.Ii=this.Ai=null}vo.prototype.copy=function(){var a=new vo;a.Ai=this.Ai;a.Ii=this.Ii;a.Ci=this.Ci;a.ns=this.ns;a.os=this.os;a.Xi=this.Xi;a.Wi=this.Wi;a.Vi=this.Vi;a.ls=this.ls;a.ms=this.ms;a.Ui=this.Ui;a.Cq=this.Cq;a.Dq=this.Dq;a.Eq=this.Eq;a.Bq=this.Bq;a.ej=this.ej;a.Di=this.Di;a.tr=this.tr;return a};
    function C(a){G.call(this);void 0===a?this.na=Tj:(w.mb(a,C,C,"type"),this.na=a);this.xa=new H(G);this.hf=fd;this.na===Il&&(this.In=!0);this.gr=qc;this.Gi=oo;this.na===So&&gp(this);this.Bp=Qj;this.Fr=Dd;this.Gr=dd;this.Cr=0;this.Br=100;this.Er=10;this.Dr=0;this.$k=this.Zd=this.Uj=this.Cm=this.Em=null;this.Tr=NaN;this.zg=this.$j=null;this.To="category";this.yg=null;this.gj=new B(NaN,NaN,NaN,NaN);this.lk=this.Rs=this.Al=null;this.Ij=""}w.Ka(C,G);w.ni(C);w.ga("Panel",C);
    function gp(a){a.Mj=fd;a.Ph=1;a.Fi=null;a.Am=null;a.Oh=1;a.Nh=null;a.zm=null;a.ae=[];a.Xd=[];a.Zm=hp;a.ym=hp;a.fj=0;a.Qi=0}
    C.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.na=this.na;a.hf=this.hf.S();a.gr=this.gr.S();a.Gi=this.Gi;if(a.na===So){a.Mj=this.Mj.S();a.Ph=this.Ph;a.Fi=this.Fi;a.Am=this.Am;a.Oh=this.Oh;a.Nh=this.Nh;a.zm=this.zm;var b=[];if(0<this.ae.length)for(var c=this.ae,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var f=c[e].copy();f.hm(a);b[e]=f}a.ae=b;b=[];if(0<this.Xd.length)for(c=this.Xd,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(f=c[e].copy(),f.hm(a),b[e]=f);a.Xd=b;a.Zm=this.Zm;
        a.ym=this.ym;a.fj=this.fj;a.Qi=this.Qi}a.Bp=this.Bp;a.Fr=this.Fr.S();a.Gr=this.Gr.S();a.Cr=this.Cr;a.Br=this.Br;a.Er=this.Er;a.Dr=this.Dr;a.Em=this.Em;a.Uj=this.Uj;a.Zd=this.Zd;a.$k=this.$k;a.Tr=this.Tr;a.$j=this.$j;a.zg=this.zg;a.To=this.To;a.gj.assign(this.gj);a.Ij=this.Ij;null!==this.Rs&&(a.Rs=this.Rs)};C.prototype.oi=function(a){G.prototype.oi.call(this,a);a.xa=this.xa;for(var b=a.xa.n,c=b.length,d=0;d<c;d++)b[d].nh=a;a.Al=null};
    C.prototype.copy=function(){var a=G.prototype.copy.call(this);if(null!==a){for(var b=this.xa.n,c=b.length,d=0;d<c;d++){var e=b[d].copy(),f=a;e.hm(f);e.Wm=null;var h=f.xa,k=h.count;h.Qd(k,e);h=f.U;if(null!==h){h.Rm=null;null!==e.Ud&&h instanceof T&&(h.Fk=!0);var l=f.g;null!==l&&l.ia.ab||h.ad(Pf,"elements",f,null,e,null,k)}}return a}return null};C.prototype.ic=function(a){a.Ee===C?this.type=a:G.prototype.ic.call(this,a)};C.prototype.toString=function(){return"Panel("+this.type+")#"+w.Od(this)};var Tj;
    C.Position=Tj=w.p(C,"Position",0);C.Horizontal=w.p(C,"Horizontal",1);var El;C.Vertical=El=w.p(C,"Vertical",2);var Mj;C.Spot=Mj=w.p(C,"Spot",3);var Fl;C.Auto=Fl=w.p(C,"Auto",4);var So;C.Table=So=w.p(C,"Table",5);C.Viewbox=w.p(C,"Viewbox",6);var Jo;C.TableRow=Jo=w.p(C,"TableRow",7);var Ko;C.TableColumn=Ko=w.p(C,"TableColumn",8);var hj;C.Link=hj=w.p(C,"Link",9);var Il;C.Grid=Il=w.p(C,"Grid",10);var ip;C.Graduated=ip=w.p(C,"Graduated",11);
    w.defineProperty(C,{type:"type"},function(){return this.na},function(a){var b=this.na;b!==a&&(b!==Jo&&b!==Ko||w.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+a),this.na=a,this.na===Il?this.In=!0:this.na===So&&gp(this),this.H(),this.h("type",b,a))});w.u(C,{elements:"elements"},function(){return this.xa.i});w.u(C,{Ja:"naturalBounds"},function(){return this.Uc});
    w.defineProperty(C,{padding:"padding"},function(){return this.hf},function(a){"number"===typeof a?(0>a&&w.Fa(a,">= 0",C,"padding"),a=new hb(a)):(w.G(a,hb,C,"padding"),0>a.left&&w.Fa(a.left,">= 0",C,"padding:value.left"),0>a.right&&w.Fa(a.right,">= 0",C,"padding:value.right"),0>a.top&&w.Fa(a.top,">= 0",C,"padding:value.top"),0>a.bottom&&w.Fa(a.bottom,">= 0",C,"padding:value.bottom"));var b=this.hf;b.L(a)||(this.hf=a=a.S(),this.H(),this.h("padding",b,a))});
    w.defineProperty(C,{Rl:"defaultAlignment"},function(){return this.gr},function(a){var b=this.gr;b.L(a)||(this.gr=a=a.S(),this.H(),this.h("defaultAlignment",b,a))});w.defineProperty(C,{be:"defaultStretch"},function(){return this.Gi},function(a){var b=this.Gi;b!==a&&(w.mb(a,G,C,"defaultStretch"),this.Gi=a,this.H(),this.h("defaultStretch",b,a))});
    w.defineProperty(C,{SK:"defaultSeparatorPadding"},function(){return void 0===this.Mj?fd:this.Mj},function(a){if(void 0!==this.Mj){"number"===typeof a&&(a=new hb(a));var b=this.Mj;b.L(a)||(this.Mj=a=a.S(),this.H(),this.h("defaultSeparatorPadding",b,a))}});
    w.defineProperty(C,{QK:"defaultRowSeparatorStroke"},function(){return void 0===this.Fi?null:this.Fi},function(a){var b=this.Fi;b!==a&&(null===a||"string"===typeof a||a instanceof ha)&&(a instanceof ha&&a.freeze(),this.Fi=a,this.oa(),this.h("defaultRowSeparatorStroke",b,a))});
    w.defineProperty(C,{RK:"defaultRowSeparatorStrokeWidth"},function(){return void 0===this.Ph?1:this.Ph},function(a){if(void 0!==this.Ph){var b=this.Ph;b!==a&&isFinite(a)&&0<=a&&(this.Ph=a,this.H(),this.h("defaultRowSeparatorStrokeWidth",b,a))}});
    w.defineProperty(C,{PK:"defaultRowSeparatorDashArray"},function(){return void 0===this.Am?null:this.Am},function(a){if(void 0!==this.Am){var b=this.Am;if(b!==a){null===a||Array.isArray(a)||w.Bd(a,"Array",C,"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)||w.k("defaultRowSeparatorDashArray value "+f+" at index "+e+" must be a positive number or zero.");d+=f}if(0===d){if(null===b)return;a=null}}this.Am=a;this.oa();
        this.h("defaultRowSeparatorDashArray",b,a)}}});w.defineProperty(C,{KK:"defaultColumnSeparatorStroke"},function(){return void 0===this.Nh?null:this.Nh},function(a){if(void 0!==this.Nh){var b=this.Nh;b!==a&&(null===a||"string"===typeof a||a instanceof ha)&&(a instanceof ha&&a.freeze(),this.Nh=a,this.oa(),this.h("defaultColumnSeparatorStroke",b,a))}});
    w.defineProperty(C,{LK:"defaultColumnSeparatorStrokeWidth"},function(){return void 0===this.Oh?1:this.Oh},function(a){if(void 0!==this.Oh){var b=this.Oh;b!==a&&isFinite(a)&&0<=a&&(this.Oh=a,this.H(),this.h("defaultColumnSeparatorStrokeWidth",b,a))}});
    w.defineProperty(C,{JK:"defaultColumnSeparatorDashArray"},function(){return void 0===this.zm?null:this.zm},function(a){if(void 0!==this.zm){var b=this.zm;if(b!==a){null===a||Array.isArray(a)||w.Bd(a,"Array",C,"defaultColumnSeparatorDashArray: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)||w.k("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.zm=
        a;this.oa();this.h("defaultColumnSeparatorDashArray",b,a)}}});w.defineProperty(C,{$L:"viewboxStretch"},function(){return this.Bp},function(a){var b=this.Bp;b!==a&&(w.mb(a,G,C,"viewboxStretch"),this.Bp=a,this.H(),this.h("viewboxStretch",b,a))});
    w.defineProperty(C,{ux:"gridCellSize"},function(){return this.Fr},function(a){var b=this.Fr;if(!b.L(a)){w.G(a,ia,C,"gridCellSize");a.I()&&0!==a.width&&0!==a.height||w.k("Invalid Panel.gridCellSize: "+a);this.Fr=a.S();var c=this.g;null!==c&&this===c.Fn&&bm(c);this.oa();this.h("gridCellSize",b,a)}});
    w.defineProperty(C,{gF:"gridOrigin"},function(){return this.Gr},function(a){var b=this.Gr;if(!b.L(a)){w.G(a,z,C,"gridOrigin");a.I()||w.k("Invalid Panel.gridOrigin: "+a);this.Gr=a.S();var c=this.g;null!==c&&this===c.Fn&&bm(c);this.oa();this.h("gridOrigin",b,a)}});w.defineProperty(C,{Ek:"graduatedMin"},function(){return this.Cr},function(a){w.wd(a,C,"graduatedMin");var b=this.Cr;b!==a&&(this.Cr=a,this.H(),this.h("graduatedMin",b,a),zo(this)&&(a=this.U,null!==a&&Ao(this,a,"graduatedRange")))});
    w.defineProperty(C,{uA:"graduatedMax"},function(){return this.Br},function(a){w.wd(a,C,"graduatedMax");var b=this.Br;b!==a&&(this.Br=a,this.H(),this.h("graduatedMax",b,a),zo(this)&&(a=this.U,null!==a&&Ao(this,a,"graduatedRange")))});w.u(C,{Zt:"graduatedRange"},function(){return this.uA-this.Ek});w.defineProperty(C,{vA:"graduatedTickUnit"},function(){return this.Er},function(a){w.wd(a,C,"graduatedTickUnit");var b=this.Er;b!==a&&0<a&&(this.Er=a,this.H(),this.h("graduatedTickUnit",b,a))});
    w.defineProperty(C,{fF:"graduatedTickBase"},function(){return this.Dr},function(a){w.wd(a,C,"graduatedTickBase");var b=this.Dr;b!==a&&(this.Dr=a,this.H(),this.h("graduatedTickBase",b,a))});g=C.prototype;g.vs=function(a){G.prototype.vs.call(this,a);for(var b=this.xa.n,c=b.length,d=0;d<c;d++)b[d].vs(a)};
    g.zk=function(a,b){if(this.na===Il){var c=this.pj()*b.scale;0>=c&&(c=1);var d=this.ux,e=d.width,d=d.height,f=this.Ja,h=f.width,f=f.height,k=Math.ceil(h/e),l=Math.ceil(f/d),m=this.gF;a.save();a.beginPath();a.rect(0,0,h,f);a.clip();for(var n=[],p=this.xa.n,q=p.length,r=0;r<q;r++){var s=p[r],u=[];n.push(u);if(s.visible)for(var s=Xm(s.Cb),t=r+1;t<q;t++){var x=p[t];x.visible&&Xm(x.Cb)===s&&(x=x.interval,2<=x&&u.push(x))}}p=this.xa.n;q=p.length;for(r=0;r<q;r++){var v=p[r];if(v.visible&&(u=v.interval,!(2>
        e*u*c))){s=v.opacity;t=1;if(1!==s){if(0===s)continue;t=a.globalAlpha;a.globalAlpha=t*s}var x=n[r],A=!1,y=!0,K=v.tG;null!==K&&(A=!0,y=a.lA(K,v.wf));if("LineV"===v.Cb&&null!==v.stroke){a.lineWidth=v.lb;No(this,a,v.stroke,!1,!1);a.beginPath();for(var E=Math.floor(-m.x/e),P=E;P<=E+k;P++){var $=P*e+m.x;0<=$&&$<=h&&jp(P,u,x)&&(A&&!y?yo(a,$,0,$,f,K,v.wf):(a.moveTo($,0),a.lineTo($,f)))}a.stroke()}else if("LineH"===v.Cb&&null!==v.stroke){a.lineWidth=v.lb;No(this,a,v.stroke,!1,!1);a.beginPath();for(P=E=Math.floor(-m.y/
        d);P<=E+l;P++)$=P*d+m.y,0<=$&&$<=f&&jp(P,u,x)&&(A&&!y?yo(a,0,$,h,$,K,v.wf):(a.moveTo(0,$),a.lineTo(h,$)));a.stroke()}else if("BarV"===v.Cb&&null!==v.fill)for(No(this,a,v.fill,!0,!1),v=v.width,isNaN(v)&&(v=e),P=E=Math.floor(-m.x/e);P<=E+k;P++)$=P*e+m.x,0<=$&&$<=h&&jp(P,u,x)&&a.fillRect($,0,v,f);else if("BarH"===v.Cb&&null!==v.fill)for(No(this,a,v.fill,!0,!1),v=v.height,isNaN(v)&&(v=d),P=E=Math.floor(-m.y/d);P<=E+l;P++)$=P*d+m.y,0<=$&&$<=f&&jp(P,u,x)&&a.fillRect(0,$,h,v);A&&a.iA();1!==s&&(a.globalAlpha=
        t)}}a.restore();a.Fe(!1)}else if(this.na===ip){e=this.Ja;c=e.width;e=e.height;a.save();a.beginPath();a.rect(-1,-1,c+1,e+1);a.clip();c=this.Ld();c.ue(a,b);e=this.pj()*b.scale;0>=e&&(e=1);d=c.W;h=this.xa.n;f=this.Em;k=h.length;for(l=0;l<k;l++)if(q=h[l],m=f[l],n=m.length,q.visible&&q!==c&&0!==m.length)if(q instanceof X){if(!(2>this.vA*q.interval*c.kf.St/this.Zt*e))for(r=q.za,u=q.lb*q.scale,s=q.qh,s.Sd()&&(s=Bb),p=0;p<n;p++)t=q,x=m[p][0],A=d,E=m[p][1],P=r,v=u,y=s,K=t.hd,K.reset(),K.translate(x.x+A.x,
        x.y+A.y),K.rotate(E+t.angle,0,0),K.translate(-P.width*y.x+y.offsetX+v/2,-P.height*y.y+y.offsetY+v/2),K.scale(t.scale,t.scale),Po(t,!1),t.sm.set(t.hd),t.Do=t.scale,Qo(t,!1),q.ue(a,b),q.hd.reset()}else if(q instanceof Lh)for(null===this.lk&&(this.lk=new Lh),r=this.lk,kp(q,r),p=0;p<n;p++)x=m[p],3<x.length&&(s=x[6],r.Jd=x[2],r.ng=x[3],r.le=x[4],r.vf=x[5],r.Uc=x[8],r.jc(s.x,s.y,s.width,s.height),q=r,u=d,t=x[7],x=x[8],A=q.hd,A.reset(),A.translate(s.x+u.x,s.y+u.y),A.translate(-t.x,-t.y),Co(q,A,x.x,x.y,x.width,
        x.height),Po(q,!1),q.sm.set(q.hd),q.Do=q.scale,Qo(q,!1),r.ue(a,b));a.restore();a.Fe(!0)}else{this.na===So&&(a.lineCap="butt",lp(this,a,!0,this.ae,!0),lp(this,a,!1,this.Xd,!0),Kp(this,a,!0,this.ae),Kp(this,a,!1,this.Xd),lp(this,a,!0,this.ae,!1),lp(this,a,!1,this.Xd,!1));(c=this.du)&&a.save();e=this.Ld();d=this.xa.n;h=d.length;for(f=0;f<h;f++)k=d[f],c&&k===e&&(a.Hp=!0),k.ue(a,b),c&&k===e&&(a.Hp=!1);c&&(a.restore(),a.Fe(!0))}};
    function kp(a,b){b.O=a.O|6144;b.yc=a.yc;b.Eb=a.Eb;b.bc=a.bc;b.Te=a.Te.S();b.Yh=a.Yh.S();b.Xh=a.Xh.S();b.Si=a.Si.copy();b.ub=a.ub;b.ng=a.ng;b.Hg=a.Hg;b.Pm=a.Pm.S();b.ie=a.ie.S();b.rm=a.rm.S();b.$m=a.$m;b.an=a.an.S();b.bn=a.bn;null!==a.qg&&(b.qg=a.qg.copy());b.fn=a.fn;a instanceof Lh&&(b.Jd=a.Jd,b.rc=a.rc,b.sg=a.sg,b.Bl=a.Bl,b.rg=a.rg,b.Fl=a.Fl,b.Hm=a.Hm,b.Zj=a.Zj,b.Yj=a.Yj,b.Zi=a.Zi,b.rk=a.rk,b.vf.Pj=null,b.fi=a.fi,b.gi=a.gi,b.hh=a.hh,b.Wo=a.Wo,b.wg=a.wg,b.vg=a.vg,b.ug=a.ug,b.Dm=a.Dm)}
    function Kp(a,b,c,d){for(var e=d.length,f=a.W,h=c?a.Nd(0):a.Md(0),k=0;k<e;k++){var l=d[k];if(void 0!==l&&l!==h&&0!==l.Ya){if(c){if(l.position>f.height)continue}else if(l.position>f.width)continue;var m=l.sq;isNaN(m)&&(m=c?a.Ph:a.Oh);var n=l.rq;null===n&&(n=c?a.Fi:a.Nh);0!==m&&null!==n&&(No(a,b,n,!1,!1),b.beginPath(),n=l.position+m,c?n>f.height&&(m-=n-f.height):n>f.width&&(m-=n-f.width),l=l.position+m/2,b.lineWidth=m,n=a.padding,c?(l+=n.top,m=n.left,n=f.width-n.right,b.moveTo(m,l),b.lineTo(n,l)):(l+=
        n.left,m=n.top,n=f.height-n.bottom,b.moveTo(l,m),b.lineTo(l,n)),b.stroke())}}}
    function lp(a,b,c,d,e){for(var f=d.length,h=a.W,k=0;k<f;k++){var l=d[k];if(void 0!==l&&null!==l.background&&l.gA!==e&&0!==l.Ya){var m=c?h.height:h.width;if(!(l.position>m)){var n=l.$e(),p=l.sq;isNaN(p)&&(p=c?a.Ph:a.Oh);var q=l.rq;null===q&&(q=c?a.Fi:a.Nh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Ya;p+n>m&&(n=m-p);0>=n||(m=a.padding,No(a,b,l.background,!0,!1),c?b.fillRect(m.left,p+m.top,h.width-(m.left+m.right),n):b.fillRect(p+m.left,m.top,n,h.height-(m.top+m.bottom)))}}}}
    function jp(a,b,c){if(0!==a%b)return!1;b=c.length;for(var d=0;d<b;d++)if(0===a%c[d])return!1;return!0}function Xm(a){return"LineV"===a||"BarV"===a}
    g.Dn=function(a,b,c,d,e){var f=this.ah(),h=this.transform,k=1/(h.m11*h.m22-h.m12*h.m21),l=h.m22*k,m=-h.m12*k,n=-h.m21*k,p=h.m11*k,q=k*(h.m21*h.dy-h.m22*h.dx),r=k*(h.m12*h.dx-h.m11*h.dy);if(null!==this.mn)return h=this.W,le(h.left,h.top,h.right,h.bottom,a,b,c,d,e);if(null!==this.background)f=a*l+b*n+q,k=a*m+b*p+r,a=c*l+d*n+q,l=c*m+d*p+r,e.m(0,0),c=this.Ja,c=le(0,0,c.width,c.height,f,k,a,l,e),e.transform(h);else{f||(l=1,n=m=0,p=1,r=q=0);k=a*l+b*n+q;a=a*m+b*p+r;l=c*l+d*n+q;d=c*m+d*p+r;e.m(l,d);m=(l-
        k)*(l-k)+(d-a)*(d-a);c=!1;p=this.xa.n;r=p.length;n=w.K();q=null;b=Infinity;var s=null;this.du&&(s=w.K(),q=this.Ld(),(c=q.Dn(k,a,l,d,s))&&(b=(k-s.x)*(k-s.x)+(a-s.y)*(a-s.y)));for(var u=0;u<r;u++){var t=p[u];t.visible&&t!==q&&t.Dn(k,a,l,d,n)&&(c=!0,t=(k-n.x)*(k-n.x)+(a-n.y)*(a-n.y),t<m&&(m=t,e.set(n)))}this.du&&(b>m&&e.set(s),w.v(s));w.v(n);f&&e.transform(h)}return c};
    g.H=function(a){G.prototype.H.call(this,a);if(this.na===Fl||this.na===hj)a=this.Ld(),null!==a&&a.H(!0);a=this.xa.n;for(var b=a.length,c=0;c<b;c++){var d=a[c];if(!d.Ca.I()){var e=Eo(d,!1);(d instanceof Nj||d instanceof C||d instanceof Lh||e!==Oj)&&d.H(!0)}}};g.Zp=function(){if(!1===Cm(this)){am(this,!0);Fo(this,!0);for(var a=this.xa.n,b=a.length,c=0;c<b;c++)a[c].Zp()}};g.Mi=function(){if(0!==(this.O&2048)===!1){Po(this,!0);Qo(this,!0);for(var a=this.xa.n,b=a.length,c=0;c<b;c++)a[c].BA()}};
    g.BA=function(){Qo(this,!0);for(var a=this.xa.n,b=a.length,c=0;c<b;c++)a[c].BA()};
    g.Pn=function(a,b,c,d){var e=this.gj;e.width=0;e.height=0;var f=this.Ca,h=this.si;void 0===c&&(c=h.width,d=h.height);c=Math.max(c,h.width);d=Math.max(d,h.height);var k=this.Gf;isNaN(f.width)||(a=Math.min(f.width,k.width));isNaN(f.height)||(b=Math.min(f.height,k.height));a=Math.max(c,a);b=Math.max(d,b);var l=this.padding;a=Math.max(a-l.left-l.right,0);b=Math.max(b-l.top-l.bottom,0);var m=this.xa.n;if(0!==m.length){var n=this.na.Sb;switch(n){case "Position":var p=a,q=b,r=c,s=d,u=m.length;e.x=0;e.y=
        0;e.width=0;e.height=0;for(var t=Lp(this),x=0;x<u;x++){var v=m[x];if(v.visible||v===t){var A=v.margin,y=A.right+A.left,K=A.top+A.bottom;xk(v,p,q,r,s);var E=v.za,P=Math.max(E.width+y,0),$=Math.max(E.height+K,0),S=v.position.x,ba=v.position.y;isFinite(S)||(S=0);isFinite(ba)||(ba=0);if(v instanceof X){var ga=v;if(ga.rF)var ya=ga.lb/2,S=S-ya,ba=ba-ya}ab(e,S,ba,P,$)}}break;case "Vertical":for(var Fa=a,eb=c,wa=m.length,U=w.cb(),sb=Lp(this),Kb=0;Kb<wa;Kb++){var Oa=m[Kb];if(Oa.visible||Oa===sb){var Mc=Eo(Oa,
        !1);if(Mc!==Oj&&Mc!==po)U.push(Oa);else{var Ma=Oa.margin,bg=Ma.right+Ma.left,cg=Ma.top+Ma.bottom;xk(Oa,Fa,Infinity,eb,0);var sd=Oa.za,td=Math.max(sd.width+bg,0),Nc=Math.max(sd.height+cg,0);e.width=Math.max(e.width,td);e.height+=Nc}}}var qh=U.length;if(0!==qh){this.Ca.width?Fa=Math.min(this.Ca.width,this.Gf.width):0!==e.width&&(Fa=Math.min(e.width,this.Gf.width));for(Kb=0;Kb<qh;Kb++)if(Oa=U[Kb],Oa.visible||Oa===sb)Ma=Oa.margin,bg=Ma.right+Ma.left,cg=Ma.top+Ma.bottom,xk(Oa,Fa,Infinity,eb,0),sd=Oa.za,
        td=Math.max(sd.width+bg,0),Nc=Math.max(sd.height+cg,0),e.width=Math.max(e.width,td),e.height+=Nc;w.ta(U)}break;case "Horizontal":for(var Ve=b,fb=d,pb=m.length,na=w.cb(),ja=Lp(this),Za=0;Za<pb;Za++){var Ia=m[Za];if(Ia.visible||Ia===ja){var kb=Eo(Ia,!1);if(kb!==Oj&&kb!==qo)na.push(Ia);else{var Hd=Ia.margin,Df=Hd.right+Hd.left,pe=Hd.top+Hd.bottom;xk(Ia,Infinity,Ve,0,fb);var Yd=Ia.za,gd=Math.max(Yd.width+Df,0),rh=Math.max(Yd.height+pe,0);e.width+=gd;e.height=Math.max(e.height,rh)}}}var Ef=na.length;if(0!==
        Ef){this.Ca.height?Ve=Math.min(this.Ca.height,this.Gf.height):0!==e.height&&(Ve=Math.min(e.height,this.Gf.height));for(Za=0;Za<Ef;Za++)if(Ia=na[Za],Ia.visible||Ia===ja)Hd=Ia.margin,Df=Hd.right+Hd.left,pe=Hd.top+Hd.bottom,xk(Ia,Infinity,Ve,0,fb),Yd=Ia.za,gd=Math.max(Yd.width+Df,0),rh=Math.max(Yd.height+pe,0),e.width+=gd,e.height=Math.max(e.height,rh);w.ta(na)}break;case "Spot":a:{var Cg=a,Cb=b,Ac=c,Zd=d,sh=m.length,qb=this.Ld(),Ja=qb.margin,Lb=0,Ff=0,Dg=Ja.right+Ja.left,th=Ja.top+Ja.bottom;xk(qb,Cg,
        Cb,Ac,Zd);for(var gb=qb.za,tc=gb.width,Vb=gb.height,qe=Math.max(tc+Dg,0),uc=Math.max(Vb+th,0),vc=this.du,rb=w.mg(-Ja.left,-Ja.top,qe,uc),kc=!0,tb=Lp(this),Bc=0;Bc<sh;Bc++){var bb=m[Bc];if(bb!==qb&&(bb.visible||bb===tb)){Ja=bb.margin;Lb=Ja.right+Ja.left;Ff=Ja.top+Ja.bottom;xk(bb,Cg,Cb,0,0);var gb=bb.za,qe=Math.max(gb.width+Lb,0),uc=Math.max(gb.height+Ff,0),Qa=bb.alignment;Qa.Xc()&&(Qa=this.Rl);Qa.Yc()||(Qa=Jb);var Hb=bb.qh;Hb.Xc()&&(Hb=Jb);var ud=null;bb instanceof C&&""!==bb.Ij&&(bb.jc(0,0,gb.width,
        gb.height),ud=bb.xd(bb.Ij),ud===bb&&(ud=null));var dg,We;if(null!==ud){for(var eg=ud.Ja,pj=ud.margin,Mb=w.xb(Hb.x*eg.width+Hb.offsetX-pj.left,Hb.y*eg.height+Hb.offsetY-pj.top);ud!==bb;)ud.transform.nb(Mb),ud=ud.Q;dg=Qa.x*tc+Qa.offsetX-Mb.x;We=Qa.y*Vb+Qa.offsetY-Mb.y;w.v(Mb)}else dg=Qa.x*tc+Qa.offsetX-(Hb.x*gb.width-Hb.offsetX)-Ja.left,We=Qa.y*Vb+Qa.offsetY-(Hb.y*gb.height-Hb.offsetY)-Ja.top;kc?(kc=!1,e.x=dg,e.y=We,e.width=qe,e.height=uc):ab(e,dg,We,qe,uc)}}kc?e.assign(rb):vc?e.lF(rb.x,rb.y,rb.width,
        rb.height):ab(e,rb.x,rb.y,rb.width,rb.height);w.Db(rb);var Cc=qb.stretch;Cc===oo&&(Cc=Eo(qb,!1));switch(Cc){case Oj:break a;case Fe:if(!isFinite(Cg)&&!isFinite(Cb))break a;break;case qo:if(!isFinite(Cg))break a;break;case po:if(!isFinite(Cb))break a}gb=qb.za;tc=gb.width;Vb=gb.height;qe=Math.max(tc+Dg,0);uc=Math.max(Vb+th,0);Ja=qb.margin;rb=w.mg(-Ja.left,-Ja.top,qe,uc);for(Bc=0;Bc<sh;Bc++)bb=m[Bc],bb===qb||!bb.visible&&bb!==tb||(Ja=bb.margin,Lb=Ja.right+Ja.left,Ff=Ja.top+Ja.bottom,gb=bb.za,qe=Math.max(gb.width+
        Lb,0),uc=Math.max(gb.height+Ff,0),Qa=bb.alignment,Qa.Xc()&&(Qa=this.Rl),Qa.Yc()||(Qa=Jb),Hb=bb.qh,Hb.Xc()&&(Hb=Jb),kc?(kc=!1,e.x=Qa.x*tc+Qa.offsetX-(Hb.x*gb.width-Hb.offsetX)-Ja.left,e.y=Qa.y*Vb+Qa.offsetY-(Hb.y*gb.height-Hb.offsetY)-Ja.top,e.width=qe,e.height=uc):ab(e,Qa.x*tc+Qa.offsetX-(Hb.x*gb.width-Hb.offsetX)-Ja.left,Qa.y*Vb+Qa.offsetY-(Hb.y*gb.height-Hb.offsetY)-Ja.top,qe,uc));kc?e.assign(rb):vc?e.lF(rb.x,rb.y,rb.width,rb.height):ab(e,rb.x,rb.y,rb.width,rb.height);w.Db(rb)}break;case "Auto":var wc=
        a,hd=b,lb=c,Nb=d,re=m.length,ub=this.Ld(),$d=ub.margin,uh=wc,vh=hd,Eg=$d.right+$d.left,id=$d.top+$d.bottom;xk(ub,wc,hd,lb,Nb);var Id=ub.za,cc=0,vb=null;ub instanceof X&&(vb=ub,cc=vb.lb*vb.scale);var vd=Math.max(Id.width+Eg,0),jb=Math.max(Id.height+id,0),dc=Mp(ub),ei=dc.x*vd+dc.offsetX,Yc=dc.y*jb+dc.offsetY,Db=Np(ub),se=Db.x*vd+Db.offsetX,Xe=Db.y*jb+Db.offsetY;isFinite(wc)&&(uh=Math.max(Math.abs(ei-se)-cc,0));isFinite(hd)&&(vh=Math.max(Math.abs(Yc-Xe)-cc,0));var Zc=w.mm();Zc.m(0,0);for(var Gf=Lp(this),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      Fg=0;Fg<re;Fg++){var wh=m[Fg];if(wh!==ub&&(wh.visible||wh===Gf)){var $d=wh.margin,Ek=$d.right+$d.left,wb=$d.top+$d.bottom;xk(wh,uh,vh,0,0);Id=wh.za;vd=Math.max(Id.width+Ek,0);jb=Math.max(Id.height+wb,0);Zc.m(Math.max(vd,Zc.width),Math.max(jb,Zc.height))}}if(1===re)e.width=vd,e.height=jb,w.Ck(Zc);else{var dc=Mp(ub),Db=Np(ub),ae=0,jd=0;Db.x!==dc.x&&Db.y!==dc.y&&(ae=Zc.width/Math.abs(Db.x-dc.x),jd=Zc.height/Math.abs(Db.y-dc.y));w.Ck(Zc);cc=0;null!==vb&&(cc=vb.lb*vb.scale,Pj(vb)===Qj&&(ae=jd=Math.max(ae,
        jd)));var ae=ae+(Math.abs(dc.offsetX)+Math.abs(Db.offsetX)+cc),jd=jd+(Math.abs(dc.offsetY)+Math.abs(Db.offsetY)+cc),Ie=ub.stretch;Ie===oo&&(Ie=Eo(ub,!1));switch(Ie){case Oj:Nb=lb=0;break;case Fe:isFinite(wc)&&(ae=wc);isFinite(hd)&&(jd=hd);break;case qo:isFinite(wc)&&(ae=wc);Nb=0;break;case po:lb=0,isFinite(hd)&&(jd=hd)}ub.Zp();xk(ub,ae,jd,lb,Nb);e.width=ub.za.width+Eg;e.height=ub.za.height+id}break;case "Table":for(var fi=a,gi=b,qj=c,rj=d,Eb=m.length,xh=w.cb(),yh=w.cb(),fa=0;fa<Eb;fa++){var aa=m[fa],
        be=aa instanceof C?aa:null;if(null===be||be.type!==Jo&&be.type!==Ko||!aa.visible)xh.push(aa);else{yh.push(be);for(var fg=be.xa.n,hi=fg.length,Fb=0;Fb<hi;Fb++){var ii=fg[Fb];be.type===Jo?ii.Vb=aa.Vb:be.type===Ko&&(ii.column=aa.column);xh.push(ii)}}}Eb=xh.length;0===Eb&&(this.Nd(0),this.Md(0));for(var Tb=[],fa=0;fa<Eb;fa++)aa=xh[fa],am(aa,!0),Fo(aa,!0),Tb[aa.Vb]||(Tb[aa.Vb]=[]),Tb[aa.Vb][aa.column]||(Tb[aa.Vb][aa.column]=[]),Tb[aa.Vb][aa.column].push(aa);w.ta(xh);for(var Ye=w.cb(),Je=w.cb(),Ze=w.cb(),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  te={count:0},ue={count:0},$c=fi,Jd=gi,zh=this.ae,Eb=zh.length,fa=0;fa<Eb;fa++){var Y=zh[fa];void 0!==Y&&(Y.Ya=0)}zh=this.Xd;Eb=zh.length;for(fa=0;fa<Eb;fa++)Y=zh[fa],void 0!==Y&&(Y.Ya=0);for(var kd=Tb.length,gg=0,fa=0;fa<kd;fa++)Tb[fa]&&(gg=Math.max(gg,Tb[fa].length));for(var ji=Math.min(this.fj,kd-1),Ah=Math.min(this.Qi,gg-1),lc=0,kd=Tb.length,Bh=Lp(this),fa=0;fa<kd;fa++)if(Tb[fa])for(var gg=Tb[fa].length,mb=this.Nd(fa),Fb=mb.Ya=0;Fb<gg;Fb++)if(Tb[fa][Fb]){var nb=this.Md(Fb);void 0===Ye[Fb]&&(nb.Ya=
        0,Ye[Fb]=!0);for(var dm=Tb[fa][Fb],$e=dm.length,Fk=0;Fk<$e;Fk++)if(aa=dm[Fk],aa.visible||aa===Bh){var ki=1<aa.bj||1<aa.Bi;ki&&(fa<ji||Fb<Ah||Je.push(aa));var xc=aa.margin,Hf=xc.right+xc.left,hg=xc.top+xc.bottom,Ob=To(aa,mb,nb,!1),af=aa.Ca,Gk=!isNaN(af.height),em=!isNaN(af.width)&&Gk;ki||Ob===Oj||em||fa<ji||Fb<Ah||(void 0!==te[Fb]||Ob!==Fe&&Ob!==qo||(te[Fb]=-1,te.count++),void 0!==ue[fa]||Ob!==Fe&&Ob!==po||(ue[fa]=-1,ue.count++),Ze.push(aa));xk(aa,Infinity,Infinity,0,0);if(!(fa<ji||Fb<Ah)){var If=
        aa.za,bf=Math.max(If.width+Hf,0),cf=Math.max(If.height+hg,0);if(1===aa.bj&&(Ob===Oj||Ob===qo)){var Y=this.Nd(fa),mc=Y.$e(),lc=Math.max(cf-Y.Ya,0);lc+mc>Jd&&(lc=Math.max(Jd-mc,0));var ig=0===Y.Ya;Y.Ya+=lc;Jd=Math.max(Jd-(lc+(ig?mc:0)),0)}1!==aa.Bi||Ob!==Oj&&Ob!==po||(Y=this.Md(Fb),mc=Y.$e(),lc=Math.max(bf-Y.Ya,0),lc+mc>$c&&(lc=Math.max($c-mc,0)),ig=0===Y.Ya,Y.Ya+=lc,$c=Math.max($c-(lc+(ig?mc:0)),0));ki&&aa.Zp()}}}w.ta(Ye);for(var Dc=0,zb=0,Eb=this.Ip,fa=0;fa<Eb;fa++){var li=this.Xd[fa];void 0!==li&&
    (Dc+=li.Ra,0!==li.Ra&&(Dc+=li.$e()))}Eb=this.pq;for(fa=0;fa<Eb;fa++){var Gg=this.ae[fa];void 0!==Gg&&(zb+=Gg.Ra,0!==Gg.Ra&&(zb+=Gg.$e()))}for(var $c=Math.max(fi-Dc,0),sj=Jd=Math.max(gi-zb,0),mp=$c,Eb=Ze.length,fa=0;fa<Eb;fa++){var aa=Ze[fa],mb=this.Nd(aa.Vb),nb=this.Md(aa.column),Hg=aa.za,xc=aa.margin,Hf=xc.right+xc.left,hg=xc.top+xc.bottom;te[aa.column]=0===nb.Ya&&void 0!==te[aa.column]?Math.max(Hg.width+Hf,te[aa.column]):null;ue[aa.Vb]=0===mb.Ya&&void 0!==ue[aa.Vb]?Math.max(Hg.height+hg,ue[aa.Vb]):
        null}var Jf=0,Ig=0,Jg;for(Jg in ue)"count"!==Jg&&(Jf+=ue[Jg]);for(Jg in te)"count"!==Jg&&(Ig+=te[Jg]);for(var ob=w.mm(),fa=0;fa<Eb;fa++)if(aa=Ze[fa],aa.visible||aa===Bh){var mb=this.Nd(aa.Vb),nb=this.Md(aa.column),Wb=0;isFinite(nb.width)?Wb=nb.width:(Wb=isFinite($c)&&null!==te[aa.column]?0===Ig?nb.Ya+$c:te[aa.column]/Ig*mp:null!==te[aa.column]?$c:nb.Ya||$c,Wb=Math.max(0,Wb-nb.$e()));var Ec=0;isFinite(mb.height)?Ec=mb.height:(Ec=isFinite(Jd)&&null!==ue[aa.Vb]?0===Jf?mb.Ya+Jd:ue[aa.Vb]/Jf*sj:null!==
    ue[aa.Vb]?Jd:mb.Ya||Jd,Ec=Math.max(0,Ec-mb.$e()));ob.m(Math.max(nb.Bh,Math.min(Wb,nb.he)),Math.max(mb.Bh,Math.min(Ec,mb.he)));Ob=To(aa,mb,nb,!1);switch(Ob){case qo:ob.height=Math.max(ob.height,mb.Ya+Jd);break;case po:ob.width=Math.max(ob.width,nb.Ya+$c)}xc=aa.margin;Hf=xc.right+xc.left;hg=xc.top+xc.bottom;aa.Zp();xk(aa,ob.width,ob.height,nb.Bh,mb.Bh);If=aa.za;bf=Math.max(If.width+Hf,0);cf=Math.max(If.height+hg,0);isFinite($c)&&(bf=Math.min(bf,ob.width));isFinite(Jd)&&(cf=Math.min(cf,ob.height));var df=
        0,df=mb.Ya;mb.Ya=Math.max(mb.Ya,cf);lc=mb.Ya-df;Jd=Math.max(Jd-lc,0);df=nb.Ya;nb.Ya=Math.max(nb.Ya,bf);lc=nb.Ya-df;$c=Math.max($c-lc,0)}w.ta(Ze);var Kd=w.mm(),Eb=Je.length;if(0!==Eb)for(var wd=w.cb(),ef=w.cb(),fa=0;fa<kd;fa++)if(Tb[fa])for(gg=Tb[fa].length,mb=this.Nd(fa),wd[fa]=mb.Ya,Fb=0;Fb<gg;Fb++)Tb[fa][Fb]&&(nb=this.Md(Fb),ef[Fb]=nb.Ya);for(fa=0;fa<Eb;fa++)if(aa=Je[fa],aa.visible||aa===Bh){mb=this.Nd(aa.Vb);nb=this.Md(aa.column);ob.m(Math.max(nb.Bh,Math.min(fi,nb.he)),Math.max(mb.Bh,Math.min(gi,
        mb.he)));Ob=To(aa,mb,nb,!1);switch(Ob){case Fe:0!==ef[nb.index]&&(ob.width=Math.min(ob.width,ef[nb.index]));0!==wd[mb.index]&&(ob.height=Math.min(ob.height,wd[mb.index]));break;case qo:0!==ef[nb.index]&&(ob.width=Math.min(ob.width,ef[nb.index]));break;case po:0!==wd[mb.index]&&(ob.height=Math.min(ob.height,wd[mb.index]))}isFinite(nb.width)&&(ob.width=nb.width);isFinite(mb.height)&&(ob.height=mb.height);Kd.m(0,0);for(var cb=1;cb<aa.bj&&!(aa.Vb+cb>=this.pq);cb++)Y=this.Nd(aa.Vb+cb),lc=Ob===Fe||Ob===
    po?Math.max(Y.Bh,0===wd[aa.Vb+cb]?Y.he:Math.min(wd[aa.Vb+cb],Y.he)):Math.max(Y.Bh,isNaN(Y.jf)?Y.he:Math.min(Y.jf,Y.he)),Kd.height+=lc;for(cb=1;cb<aa.Bi&&!(aa.column+cb>=this.Ip);cb++)Y=this.Md(aa.column+cb),lc=Ob===Fe||Ob===qo?Math.max(Y.Bh,0===ef[aa.column+cb]?Y.he:Math.min(ef[aa.column+cb],Y.he)):Math.max(Y.Bh,isNaN(Y.jf)?Y.he:Math.min(Y.jf,Y.he)),Kd.width+=lc;ob.width+=Kd.width;ob.height+=Kd.height;xc=aa.margin;Hf=xc.right+xc.left;hg=xc.top+xc.bottom;xk(aa,ob.width,ob.height,qj,rj);for(var If=
        aa.za,bf=Math.max(If.width+Hf,0),cf=Math.max(If.height+hg,0),ff=0,cb=0;cb<aa.bj&&!(aa.Vb+cb>=this.pq);cb++)Y=this.Nd(aa.Vb+cb),ff+=Y.total||0;if(ff<cf){var ld=cf-ff,Kg=cf-ff;if(null!==aa.oy)for(var gf=aa.oy,cb=0;cb<aa.bj&&!(0>=ld)&&!(aa.Vb+cb>=this.pq);cb++){var Y=this.Nd(aa.Vb+cb),Fc=Y.Ra||0,mi=gf(aa,Y,Kg);Y.Ya=Math.min(Y.he,Fc+mi);Y.Ra!==Fc&&(ld-=Y.Ra-Fc)}for(;0<ld;){Fc=Y.Ra||0;isNaN(Y.height)&&Y.he>Fc&&(Y.Ya=Math.min(Y.he,Fc+ld),Y.Ra!==Fc&&(ld-=Y.Ra-Fc));if(0===Y.index)break;Y=this.Nd(Y.index-
        1)}}for(var Ke=0,cb=0;cb<aa.Bi&&!(aa.column+cb>=this.Ip);cb++)Y=this.Md(aa.column+cb),Ke+=Y.total||0;if(Ke<bf){ld=bf-Ke;Kg=bf-Ke;if(null!==aa.oy)for(gf=aa.oy,cb=0;cb<aa.Bi&&!(0>=ld)&&!(aa.column+cb>=this.Ip);cb++)Y=this.Md(aa.column+cb),Fc=Y.Ra||0,mi=gf(aa,Y,Kg),Y.Ya=Math.min(Y.he,Fc+mi),Y.Ra!==Fc&&(ld-=Y.Ra-Fc);for(;0<ld;){Fc=Y.Ra||0;isNaN(Y.width)&&Y.he>Fc&&(Y.Ya=Math.min(Y.he,Fc+ld),Y.Ra!==Fc&&(ld-=Y.Ra-Fc));if(0===Y.index)break;Y=this.Md(Y.index-1)}}}w.ta(Je);w.Ck(Kd);w.Ck(ob);void 0!==wd&&w.ta(wd);
        void 0!==ef&&w.ta(ef);for(var Lg=0,Mg=0,Ob=Eo(this,!0),tj=this.Ca,Hk=this.Gf,ve=zb=Dc=0,ad=0,Eb=this.Ip,fa=0;fa<Eb;fa++)void 0!==this.Xd[fa]&&(Y=this.Md(fa),isFinite(Y.width)?(ve+=Y.width,ve+=Y.$e()):Op(Y)===Pp?(ve+=Y.Ra,ve+=Y.$e()):0!==Y.Ra&&(Dc+=Y.Ra,Dc+=Y.$e()));var Lg=isFinite(tj.width)?Math.min(tj.width,Hk.width):Ob!==Oj&&isFinite(fi)?fi:Dc,Lg=Math.max(Lg,this.si.width),Lg=Math.max(Lg-ve,0),Ik=Math.max(Lg/Dc,1);isFinite(Ik)||(Ik=1);for(fa=0;fa<Eb;fa++)void 0!==this.Xd[fa]&&(Y=this.Md(fa),isFinite(Y.width)||
        Op(Y)===Pp||(Y.Ya=Y.Ra*Ik),Y.position=e.width,0!==Y.Ra&&(e.width+=Y.Ra,e.width+=Y.$e()));Eb=this.pq;for(fa=0;fa<Eb;fa++)void 0!==this.ae[fa]&&(Y=this.Nd(fa),isFinite(Y.height)?(ad+=Y.height,ad+=Y.$e()):Op(Y)===Pp?(ad+=Y.Ra,ad+=Y.$e()):0!==Y.Ra&&(zb+=Y.Ra,0!==Y.Ra&&(zb+=Y.$e())));var Mg=isFinite(tj.height)?Math.min(tj.height,Hk.height):Ob!==Oj&&isFinite(gi)?gi:zb,Mg=Math.max(Mg,this.si.height),Mg=Math.max(Mg-ad,0),Ch=Math.max(Mg/zb,1);isFinite(Ch)||(Ch=1);for(fa=0;fa<Eb;fa++)void 0!==this.ae[fa]&&
        (Y=this.Nd(fa),isFinite(Y.height)||Op(Y)===Pp||(Y.Ya=Y.Ra*Ch),Y.position=e.height,0!==Y.Ra&&(e.height+=Y.Ra,0!==Y.Ra&&(e.height+=Y.$e())));Eb=yh.length;for(fa=0;fa<Eb;fa++){var md=yh[fa];md.type===Jo?(Wb=e.width,Y=this.Nd(md.Vb),Ec=Y.Ya):(Y=this.Md(md.column),Wb=Y.Ya,Ec=e.height);md.sd.m(0,0,Wb,Ec);am(md,!1);Tb[md.Vb]||(Tb[md.Vb]=[]);Tb[md.Vb][md.column]||(Tb[md.Vb][md.column]=[]);Tb[md.Vb][md.column].push(md)}w.ta(yh);this.Rs=Tb;break;case "Viewbox":var uj=a,gm=b,lt=c,mt=d;1<m.length&&w.k("Viewbox Panel cannot contain more than one GraphObject.");
        var hf=m[0];hf.ub=1;hf.Zp();xk(hf,Infinity,Infinity,lt,mt);var Jk=hf.za,hm=hf.margin,nt=hm.right+hm.left,ot=hm.top+hm.bottom;if(isFinite(uj)||isFinite(gm)){var bw=hf.scale,im=Jk.width,jm=Jk.height,pt=Math.max(uj-nt,0),qt=Math.max(gm-ot,0),Kk=1;this.Bp===Qj?0!==im&&0!==jm&&(Kk=Math.min(pt/im,qt/jm)):0!==im&&0!==jm&&(Kk=Math.max(pt/im,qt/jm));0===Kk&&(Kk=1E-4);hf.ub*=Kk;bw!==hf.scale&&(am(hf,!0),xk(hf,Infinity,Infinity,lt,mt))}Jk=hf.za;e.width=isFinite(uj)?uj:Math.max(Jk.width+nt,0);e.height=isFinite(gm)?
            gm:Math.max(Jk.height+ot,0);break;case "Link":var rt=m.length;if(this instanceof kh||this instanceof W){var oi=null;this instanceof W&&(oi=this);this instanceof kh&&(oi=this.xf);if(oi instanceof W){var Lk=oi;if(0===rt){var km=this.Ja;Ua(km,0,0);var we=this.za;we.m(0,0,0,0)}else{var lm=this instanceof kh?null:oi.path,Ng=oi.Yn,jf=this.gj;jf.assign(Ng);jf.x=0;jf.y=0;var Dh=Lk.points,pi=oi.qa;this.qu(!1);var st=Ng.width,tt=Ng.height;this.Ti.m(Ng.x,Ng.y);null===this.bh&&(this.bh=new H(B));this.bh.clear();
        null!==lm&&(Qp(lm,st,tt,this),we=lm.za,jf.Jh(we),this.bh.add(we));for(var Og=w.Kf(),Mk=w.K(),Pg=w.K(),np=0;np<rt;np++){var Ub=m[np];if(Ub!==lm)if(Ub.pf&&Ub instanceof X)Qp(Ub,st,tt,this),we=Ub.za,jf.Jh(we),this.bh.add(we);else if(2>pi)xk(Ub,Infinity,Infinity),we=Ub.za,jf.Jh(we),this.bh.add(we);else{var xd=Ub.Oe,vt=Ub.hB,op=Ub.qh;op.Sd()&&(op=Jb);var jg=Ub.qq,cw=Ub.iB,Nk=0,Ok=0,mm=0;if(xd<-pi||xd>=pi){var wt=Lk.IF,Kf=Lk.HF;jg!==kj&&(mm=Lk.computeAngle(Ub,jg,Kf),Ub.ng=mm);Nk=wt.x-Ng.x;Ok=wt.y-Ng.y}else{var Ld,
            kf;if(0<=xd)Ld=Dh.ea(xd),kf=xd<pi-1?Dh.ea(xd+1):Ld;else{var qi=pi+xd;Ld=Dh.ea(qi);kf=0<qi?Dh.ea(qi-1):Ld}if(Ld.Kc(kf)){var ri,si;0<=xd?(ri=0<xd?Dh.ea(xd-1):Ld,si=xd<pi-2?Dh.ea(xd+2):kf):(ri=qi<pi-1?Dh.ea(qi+1):Ld,si=1<qi?Dh.ea(qi-2):kf);var xt=ri.zf(Ld),yt=kf.zf(si),Kf=xt>yt+10?0<=xd?ri.Pb(Ld):Ld.Pb(ri):yt>xt+10?0<=xd?kf.Pb(si):si.Pb(kf):0<=xd?ri.Pb(si):si.Pb(ri)}else Kf=0<=xd?Ld.Pb(kf):kf.Pb(Ld);jg!==kj&&(mm=Lk.computeAngle(Ub,jg,Kf),Ub.ng=mm);Nk=Ld.x+(kf.x-Ld.x)*vt-Ng.x;Ok=Ld.y+(kf.y-Ld.y)*vt-Ng.y}xk(Ub,
            Infinity,Infinity);var we=Ub.za,km=Ub.Ja,Pk=0;Ub instanceof X&&(Pk=Ub.lb);var ti=km.width+Pk,vj=km.height+Pk;Og.reset();Og.translate(-we.x,-we.y);Og.scale(Ub.scale,Ub.scale);Og.rotate(jg===kj?Ub.angle:Kf,ti/2,vj/2);jg!==Rp&&jg!==Sp||Og.rotate(90,ti/2,vj/2);jg!==Tp&&jg!==Up||Og.rotate(-90,ti/2,vj/2);jg===Vp&&(45<Kf&&135>Kf||225<Kf&&315>Kf)&&Og.rotate(-Kf,ti/2,vj/2);var wj=new B(0,0,ti,vj);Mk.Zn(wj,op);Og.nb(Mk);var dw=-Mk.x+Pk/2*Ub.scale,ew=-Mk.y+Pk/2*Ub.scale;Pg.assign(cw);isNaN(Pg.x)&&(Pg.x=0<=xd?
            ti/2+3:-(ti/2+3));isNaN(Pg.y)&&(Pg.y=-(vj/2+3));Pg.rotate(Kf);Nk+=Pg.x;Ok+=Pg.y;wj.set(we);wj.x=Nk+dw;wj.y=Ok+ew;this.bh.add(wj);jf.Jh(wj)}}if(this instanceof W)for(var zt=this.Ef;zt.next();)xk(zt.value,Infinity,Infinity);this.gj=jf;var pp=this.Ti;pp.m(pp.x+jf.x,pp.y+jf.y);Ua(e,jf.width||0,jf.height||0);w.we(Og);w.v(Mk);w.v(Pg)}}}break;case "Grid":break;case "Graduated":var fw=a,gw=b,hw=c,iw=d,Qg=this.Ld();this.Cm=[];var xj=Qg.margin,jw=xj.right+xj.left,kw=xj.top+xj.bottom;xk(Qg,fw,gw,hw,iw);var At=
        Qg.za,lw=At.height,mw=Math.max(At.width+jw,0),nw=Math.max(lw+kw,0),Bt=new B(-xj.left,-xj.top,mw,nw);this.Cm.push(Bt);e.assign(Bt);for(var Uk=Qg.kf,Ct=Qg.lb,qp=Uk.qx,yj=Uk.Rt,ui=Uk.St,ow=qp.length,rp=0,sp=0,zj=w.cb(),tp=0;tp<ow;tp++){for(var up=qp[tp],Dt=[],sp=rp=0,pw=up.length,Aj=0;Aj<pw;Aj+=2){var Et=up[Aj],Ft=up[Aj+1];if(0!==Aj){var yd=180*Math.atan2(Ft-sp,Et-rp)/Math.PI;0>yd&&(yd+=360);Dt.push(yd)}rp=Et;sp=Ft}zj.push(Dt)}var Gt;if(null===this.Uj){for(var Ht=[],vp=this.xa.n,It=vp.length,wp=0;wp<
    It;wp++){var Vk=vp[wp],Jt=[];Ht.push(Jt);if(Vk.visible)for(var qw=Vk.interval,xp=0;xp<It;xp++){var Wk=vp[xp];if(Wk.visible&&Vk!==Wk&&!(Vk instanceof X&&!(Wk instanceof X)||Vk instanceof Lh&&!(Wk instanceof Lh))){var Kt=Wk.interval;Kt>qw&&Jt.push(Kt)}}}this.Uj=Ht}Gt=this.Uj;var Lt=this.xa.n,rw=Lt.length,Eh=0,Mt=0,Nt=ui;this.Em=[];for(var om=[],pm=0;pm<rw;pm++){var Fh=Lt[pm],om=[];if(Fh.visible&&Fh!==Qg){var Ot=Fh.interval,Pt=this.vA;if(!(2>Pt*Ot*ui/this.Zt)){var ce=this.fF,Qt=Gt[pm],vi=yj[0][0],Lf=
        0,zd=0,Mt=ui*Fh.eF-1E-4,Nt=ui*Fh.cF+1E-4,Bj=Pt*Ot;if(ce<this.Ek)var wi=(this.Ek-ce)/Bj,wi=0===wi%1?wi:Math.floor(wi+1),ce=ce+wi*Bj;else ce>this.Ek+Bj&&(wi=Math.floor((ce-this.Ek)/Bj),ce-=wi*Bj);for(;ce<=this.uA;){var yp;a:{for(var sw=Qt.length,zp=0;zp<sw;zp++)if(Wa((ce-this.fF)%(Qt[zp]*this.vA),0)){yp=!1;break a}yp=!0}if(yp&&(Eh=(ce-this.Ek)*ui/this.Zt,Eh>ui&&(Eh=ui),Mt<=Eh&&Eh<=Nt)){for(var yd=zj[Lf][zd],Cj=yj[Lf][zd];Lf<yj.length;){for(;Eh>vi&&zd<yj[Lf].length-1;)zd++,yd=zj[Lf][zd],Cj=yj[Lf][zd],
        vi+=Cj;if(Eh<=vi)break;Lf++;zd=0;yd=zj[Lf][zd];Cj=yj[Lf][zd];vi+=Cj}var Md=qp[Lf],Rt=Md[2*zd],St=Md[2*zd+1],qm=(Eh-(vi-Cj))/Cj,Ap=new z(Rt+(Md[2*zd+2]-Rt)*qm+Ct/2-Uk.gb.x,St+(Md[2*zd+3]-St)*qm+Ct/2-Uk.gb.y);Ap.scale(Qg.scale,Qg.scale);var kg=yd,Dj=zj[Lf];1E-4>qm?0<zd?kg=Dj[zd-1]:Wa(Md[0],Md[Md.length-2])&&Wa(Md[1],Md[Md.length-1])&&(kg=Dj[Dj.length-1]):.9999<qm&&(zd+1<Dj.length?kg=Dj[zd+1]:Wa(Md[0],Md[Md.length-2])&&Wa(Md[1],Md[Md.length-1])&&(kg=Dj[0]));yd!==kg&&(180<Math.abs(yd-kg)&&(yd<kg?yd+=
        360:kg+=360),yd=(yd+kg)/2%360);if(Fh instanceof Lh){var Bp="",Bp=null!==Fh.dF?Fh.dF(ce):(+ce.toFixed(2)).toString();""!==Bp&&om.push([Ap,yd,Bp])}else om.push([Ap,yd])}ce+=Bj}}}this.Em.push(om)}w.ta(zj);for(var tw=this.Em,uw=m.length,rm=0;rm<uw;rm++){var xi=m[rm],Cp=tw[rm];if(xi.visible&&xi!==Qg&&0!==Cp.length){if(xi instanceof X){var Gh=xi,Tt=Cp,vw=e,Dp=Gh.qh;Dp.Sd()&&(Dp=Bb);var ww=Gh.angle;Gh.ng=0;xk(Gh,Infinity,Infinity);Gh.ng=ww;var Ut=Gh.za,Ep=Ut.width,Fp=Ut.height,Vt=w.mg(0,0,Ep,Fp),de=w.K();
        de.Zn(Vt,Dp);w.Db(Vt);for(var sm=-de.x,tm=-de.y,yi=new B,xw=Tt.length,um=0;um<xw;um++)for(var Gp=Tt[um],Wt=Gp[0].x,Xt=Gp[0].y,Yt=Gp[1],vm=0;4>vm;vm++){switch(vm){case 0:de.m(sm,tm);break;case 1:de.m(sm+Ep,tm);break;case 2:de.m(sm,tm+Fp);break;case 3:de.m(sm+Ep,tm+Fp)}de.rotate(Yt+Gh.angle);de.offset(Wt,Xt);0===um&&0===vm?yi.m(de.x,de.y,0,0):yi.vi(de);de.offset(-Wt,-Xt);de.rotate(-Yt-Gh.angle)}w.v(de);this.Cm.push(yi);ab(vw,yi.x,yi.y,yi.width,yi.height)}else if(xi instanceof Lh){var wm=xi,Zt=Cp,yw=
        e;null===this.lk&&(this.lk=new Lh);var Mf=this.lk;kp(wm,Mf);var Hp=wm.qh;Hp.Sd()&&(Hp=Bb);for(var Hh=wm.qq,zw=wm.iB,zi=null,xm=0,ym=0,Rg=0,Ip=0,Aw=Zt.length,zm=0;zm<Aw;zm++){var lg=Zt[zm],xm=lg[0].x,ym=lg[0].y,Rg=lg[1];Hh!==kj&&(Ip=W.computeAngle(Hh,Rg),Mf.ng=Ip);Mf.text=lg[2];xk(Mf,Infinity,Infinity);var Ih=Mf.za,Ej=Mf.Ja,Fj=Ej.width,Gj=Ej.height,Sg=w.Kf();Sg.reset();Sg.translate(-Ih.x,-Ih.y);Sg.scale(Mf.scale,Mf.scale);Sg.rotate(Hh===kj?Mf.angle:Rg,Fj/2,Gj/2);Hh!==Rp&&Hh!==Sp||Sg.rotate(90,Fj/2,
        Gj/2);Hh!==Tp&&Hh!==Up||Sg.rotate(-90,Fj/2,Gj/2);Hh===Vp&&(45<Rg&&135>Rg||225<Rg&&315>Rg)&&Sg.rotate(-Rg,Fj/2,Gj/2);var $t=w.mg(0,0,Fj,Gj),Xk=w.K();Xk.Zn($t,Hp);Sg.nb(Xk);var Bw=-Xk.x,Cw=-Xk.y,Tg=w.K();Tg.assign(zw);isNaN(Tg.x)&&(Tg.x=Fj/2+3);isNaN(Tg.y)&&(Tg.y=-(Gj/2+3));Tg.rotate(Rg);var xm=xm+(Tg.x+Bw),ym=ym+(Tg.y+Cw),Jp=new B(xm,ym,Ih.width,Ih.height),Dw=new B(Ih.x,Ih.y,Ih.width,Ih.height),Ew=new B(Ej.x,Ej.y,Ej.width,Ej.height),au=new Wp;au.Jp(Mf.vf);lg.push(Ip);lg.push(Mf.le);lg.push(au);lg.push(Jp);
        lg.push(Dw);lg.push(Ew);0===zm?zi=Jp.copy():zi.Jh(Jp);w.v(Tg);w.v(Xk);w.Db($t);w.we(Sg)}this.Cm.push(zi);ab(yw,zi.x,zi.y,zi.width,zi.height)}am(xi,!1)}}break;case "TableRow":case "TableColumn":w.k(this.toString()+" is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");break;default:w.k("Unknown panel type: "+n)}}var lf=e.width,mf=e.height,Am=this.padding,Fw=Am.top+Am.bottom,lf=lf+(Am.left+Am.right),mf=mf+Fw;isFinite(f.width)&&(lf=f.width);isFinite(f.height)&&
    (mf=f.height);lf=Math.min(k.width,lf);mf=Math.min(k.height,mf);lf=Math.max(h.width,lf);mf=Math.max(h.height,mf);lf=Math.max(c,lf);mf=Math.max(d,mf);e.width=lf;e.height=mf;Ua(this.Uc,lf,mf);Bo(this,0,0,lf,mf)};C.prototype.findMainElement=C.prototype.Ld=function(){if(null===this.Al){var a=this.xa.n,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.pf)return this.Al=d}this.Al=a[0]}return this.Al};function Lp(a){return null!==a.U?a.U.bg:null}
    C.prototype.jj=function(a,b,c,d){var e=this.gj,f=this.xa.n,h=w.mg(0,0,0,0);if(0===f.length){var k=this.W;k.x=a;k.y=b;k.width=c;k.height=d}else{if(!this.Ca.I()){var l=Eo(this,!0),m=this.sd,n=m.width,p=m.height,q=this.margin,r=q.left+q.right,s=q.top+q.bottom;n===c&&p===d&&(l=Oj);switch(l){case Oj:if(n>c||p>d)this.H(),xk(this,n>c?c:n,p>d?d:p);break;case Fe:this.H(!0);xk(this,c+r,d+s,0,0);break;case qo:this.H(!0);xk(this,c+r,p+s,0,0);break;case po:this.H(!0),xk(this,n+r,d+s,0,0)}}k=this.W;k.x=a;k.y=b;
        k.width=c;k.height=d;var u=this.na.Sb;switch(u){case "Position":for(var t=f.length,x=e.x-this.padding.left,v=e.y-this.padding.top,A=0;A<t;A++){var y=f[A],K=y.za,E=y.margin,P=y.position.x,$=y.position.y;h.x=isNaN(P)?-x:P-x;h.y=isNaN($)?-v:$-v;if(y instanceof X){var S=y;if(S.rF){var ba=S.lb/2;h.x-=ba;h.y-=ba}}h.x+=E.left;h.y+=E.top;h.width=K.width;h.height=K.height;y.visible&&y.jc(h.x,h.y,h.width,h.height)}break;case "Vertical":for(var ga=f.length,ya=this.padding.left,Fa=this.yF,eb=Fa?e.height:this.padding.top,
                                                                                                                                                                                                                                                                                                                                                                                                                                                              wa=0;wa<ga;wa++){var U=ya,sb=f[wa];if(sb.visible){var Kb=sb.za,Oa=sb.margin,Mc=Oa.left+Oa.right,Ma=ya+this.padding.right,bg=Kb.width,cg=Eo(sb,!1);if(isNaN(sb.Ca.width)&&cg===Fe||cg===qo)bg=Math.max(e.width-Mc-Ma,0);var sd=bg+Mc+Ma,td=sb.alignment;td.Xc()&&(td=this.Rl);td.Yc()||(td=Jb);Fa&&(eb-=Kb.height+Oa.bottom+Oa.top);sb.jc(U+td.offsetX+Oa.left+(e.width*td.x-sd*td.x),eb+td.offsetY+Oa.top,bg,Kb.height);Fa||(eb+=Kb.height+Oa.bottom+Oa.top)}}break;case "Horizontal":for(var Nc=f.length,qh=this.padding.top,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                            Ve=this.yF,fb=Ve?e.width:this.padding.left,pb=0;pb<Nc;pb++){var na=qh,ja=f[pb];if(ja.visible){var Za=ja.za,Ia=ja.margin,kb=Ia.top+Ia.bottom,Hd=qh+this.padding.bottom,Df=Za.height,pe=Eo(ja,!1);if(isNaN(ja.Ca.height)&&pe===Fe||pe===po)Df=Math.max(e.height-kb-Hd,0);var Yd=Df+kb+Hd,gd=ja.alignment;gd.Xc()&&(gd=this.Rl);gd.Yc()||(gd=Jb);Ve&&(fb-=Za.width+Ia.left+Ia.right);ja.jc(fb+gd.offsetX+Ia.left,na+gd.offsetY+Ia.top+(e.height*gd.y-Yd*gd.y),Za.width,Df);Ve||(fb+=Za.width+Ia.left+Ia.right)}}break;case "Spot":var rh=
            f.length,Ef=this.Ld(),Cg=Ef.za,Cb=Cg.width,Ac=Cg.height,Zd=this.padding,sh=Zd.left,qb=Zd.top;h.x=sh-e.x;h.y=qb-e.y;Ef.jc(h.x,h.y,Cb,Ac);for(var Ja=0;Ja<rh;Ja++){var Lb=f[Ja];if(Lb!==Ef){var Ff=Lb.za,Dg=Ff.width,th=Ff.height,gb=Lb.alignment;gb.Xc()&&(gb=this.Rl);gb.Yc()||(gb=Jb);var tc=Lb.qh;tc.Xc()&&(tc=Jb);var Vb=null;Lb instanceof C&&""!==Lb.Ij&&(Vb=Lb.xd(Lb.Ij),Vb===Lb&&(Vb=null));if(null!==Vb){for(var qe=Vb.Ja,uc=w.xb(tc.x*qe.width+tc.offsetX,tc.y*qe.height+tc.offsetY);Vb!==Lb;)Vb.transform.nb(uc),
            Vb=Vb.Q;h.x=gb.x*Cb+gb.offsetX-uc.x;h.y=gb.y*Ac+gb.offsetY-uc.y;w.v(uc)}else h.x=gb.x*Cb+gb.offsetX-(tc.x*Dg-tc.offsetX),h.y=gb.y*Ac+gb.offsetY-(tc.y*th-tc.offsetY);h.x-=e.x;h.y-=e.y;Lb.visible&&Lb.jc(sh+h.x,qb+h.y,Dg,th)}}break;case "Auto":var vc=f.length,rb=this.Ld(),kc=rb.za,tb=w.Jf();tb.m(0,0,1,1);var Bc=rb.margin,bb=Bc.left,Qa=Bc.top,Hb=this.padding,ud=Hb.left,dg=Hb.top;h.x=bb;h.y=Qa;h.width=kc.width;h.height=kc.height;rb.jc(ud+h.x,dg+h.y,h.width,h.height);var We=Mp(rb),eg=Np(rb),pj=0+We.y*kc.height+
            We.offsetY,Mb=0+eg.x*kc.width+eg.offsetX,Cc=0+eg.y*kc.height+eg.offsetY;tb.x=0+We.x*kc.width+We.offsetX;tb.y=pj;ab(tb,Mb,Cc,0,0);tb.x+=bb+ud;tb.y+=Qa+dg;for(var wc=0;wc<vc;wc++){var hd=f[wc];if(hd!==rb){var lb=hd.za,Bc=hd.margin,Nb=Math.max(lb.width+Bc.right+Bc.left,0),re=Math.max(lb.height+Bc.top+Bc.bottom,0),ub=hd.alignment;ub.Xc()&&(ub=this.Rl);ub.Yc()||(ub=Jb);h.x=tb.width*ub.x+ub.offsetX-Nb*ub.x+Bc.left+tb.x;h.y=tb.height*ub.y+ub.offsetY-re*ub.y+Bc.top+tb.y;h.width=tb.width;h.height=tb.height;
            hd.visible&&(db(tb.x,tb.y,tb.width,tb.height,h.x,h.y,lb.width,lb.height)?hd.jc(h.x,h.y,lb.width,lb.height):hd.jc(h.x,h.y,lb.width,lb.height,new B(tb.x,tb.y,tb.width,tb.height)))}}w.Db(tb);break;case "Table":for(var $d=f.length,uh=this.padding,vh=uh.left,Eg=uh.top,id=this.Rs,Id=0,cc=0,vb=id.length,vd=0,jb=0;jb<vb;jb++)id[jb]&&(vd=Math.max(vd,id[jb].length));for(var dc=Math.min(this.fj,vb-1);dc!==vb&&(void 0===this.ae[dc]||0===this.ae[dc].Ra);)dc++;for(var dc=Math.min(dc,vb-1),ei=-this.ae[dc].jb,Yc=
            Math.min(this.Qi,vd-1);Yc!==vd&&(void 0===this.Xd[Yc]||0===this.Xd[Yc].Ra);)Yc++;for(var Yc=Math.min(Yc,vd-1),Db=-this.Xd[Yc].jb,se=w.mm(),jb=0;jb<vb;jb++)if(id[jb]){var vd=id[jb].length,Xe=this.Nd(jb),cc=Xe.jb+ei+Eg;0!==Xe.Ra&&(cc+=Xe.AE());for(var Zc=0;Zc<vd;Zc++)if(id[jb][Zc]){var Gf=this.Md(Zc),Id=Gf.jb+Db+vh;0!==Gf.Ra&&(Id+=Gf.AE());for(var Fg=id[jb][Zc],wh=Fg.length,Ek=0;Ek<wh;Ek++){var wb=Fg[Ek],ae=wb.za,jd=wb instanceof C?wb:null;if(null===jd||jd.type!==Jo&&jd.type!==Ko){se.m(0,0);for(var Ie=
            1;Ie<wb.rowSpan&&!(jb+Ie>=this.pq);Ie++){var fi=this.Nd(jb+Ie);se.height+=fi.total}for(Ie=1;Ie<wb.xH&&!(Zc+Ie>=this.Ip);Ie++){var gi=this.Md(Zc+Ie);se.width+=gi.total}var qj=Gf.Ra+se.width,rj=Xe.Ra+se.height;h.x=Id;h.y=cc;h.width=qj;h.height=rj;var Eb=Id,xh=cc,yh=qj,fa=rj;Id+qj>e.width&&(yh=Math.max(e.width-Id,0));cc+rj>e.height&&(fa=Math.max(e.height-cc,0));var aa=wb.alignment,be=0,fg=0,hi=0,Fb=0;if(aa.Xc()){aa=this.Rl;aa.Yc()||(aa=Jb);var be=aa.x,fg=aa.y,hi=aa.offsetX,Fb=aa.offsetY,ii=Gf.alignment,
            Tb=Xe.alignment;ii.Yc()&&(be=ii.x,hi=ii.offsetX);Tb.Yc()&&(fg=Tb.y,Fb=Tb.offsetY)}else be=aa.x,fg=aa.y,hi=aa.offsetX,Fb=aa.offsetY;if(isNaN(be)||isNaN(fg))fg=be=.5,Fb=hi=0;var Ye=ae.width,Je=ae.height,Ze=wb.margin,te=Ze.left+Ze.right,ue=Ze.top+Ze.bottom,$c=To(wb,Xe,Gf,!1);!isNaN(wb.Ca.width)||$c!==Fe&&$c!==qo||(Ye=Math.max(qj-te,0));!isNaN(wb.Ca.height)||$c!==Fe&&$c!==po||(Je=Math.max(rj-ue,0));var Jd=wb.Gf,zh=wb.si,Ye=Math.min(Jd.width,Ye),Je=Math.min(Jd.height,Je),Ye=Math.max(zh.width,Ye),Je=Math.max(zh.height,
            Je),Y=Je+ue;h.x+=h.width*be-(Ye+te)*be+hi+Ze.left;h.y+=h.height*fg-Y*fg+Fb+Ze.top;wb.visible&&(db(Eb,xh,yh,fa,h.x,h.y,ae.width,ae.height)?wb.jc(h.x,h.y,Ye,Je):wb.jc(h.x,h.y,Ye,Je,new B(Eb,xh,yh,fa)))}else{wb.Mi();wb.oc.Qa();var kd=wb.oc,gg=w.mg(kd.x,kd.y,kd.width,kd.height);kd.x=jd.type===Jo?vh:Id;kd.y=jd.type===Ko?Eg:cc;kd.width=ae.width;kd.height=ae.height;wb.oc.freeze();Fo(wb,!1);if(!Va(gg,kd)){var ji=wb.U;null!==ji&&(ji.Gk(),wb.vs(ji))}w.Db(gg)}}}}w.Ck(se);for(jb=0;jb<$d;jb++)wb=f[jb],jd=wb instanceof
        C?wb:null,null===jd||jd.type!==Jo&&jd.type!==Ko||(kd=wb.oc,wb.Uc.Qa(),wb.Uc.m(0,0,kd.width,kd.height),wb.Uc.freeze());break;case "Viewbox":var Ah=f[0],lc=Ah.za,Bh=Ah.margin,mb=Bh.top+Bh.bottom,nb=Math.max(lc.width+(Bh.right+Bh.left),0),dm=Math.max(lc.height+mb,0),$e=Ah.alignment;$e.Xc()&&($e=this.Rl);$e.Yc()||($e=Jb);h.x=e.width*$e.x-nb*$e.x+$e.offsetX;h.y=e.height*$e.y-dm*$e.y+$e.offsetY;h.width=lc.width;h.height=lc.height;Ah.jc(h.x,h.y,h.width,h.height);break;case "Link":var Fk=f.length;if(this instanceof
            kh||this instanceof W){var ki=null;this instanceof W&&(ki=this);this instanceof kh&&(ki=this.xf);var xc=ki,Hf=this instanceof kh?null:xc.path;if(null!==this.bh){var hg=this.bh.n,Ob=0;if(null!==Hf&&Ob<this.bh.count){var af=hg[Ob];Ob++;Hf.jc(af.x-this.gj.x,af.y-this.gj.y,af.width,af.height)}for(var Gk=0;Gk<Fk;Gk++){var em=f[Gk];em!==Hf&&Ob<this.bh.count&&(af=hg[Ob],Ob++,em.jc(af.x-this.gj.x,af.y-this.gj.y,af.width,af.height))}}var If=xc.points,bf=If.count;if(2<=bf&&this instanceof W)for(var cf=this.Ef;cf.next();){var mc=
            cf.value,ig=bf,Dc=If,zb=mc.Oe,li=mc.hB,Gg=mc.qh,sj=mc.qq,mp=mc.iB,Hg=0,Jf=0,Ig=0;if(zb<-ig||zb>=ig){var Jg=this.IF,ob=this.HF;sj!==kj&&(Ig=this.computeAngle(mc,sj,ob),mc.angle=Ig);Hg=Jg.x;Jf=Jg.y}else{var Wb=void 0,Ec=void 0;if(0<=zb)Wb=Dc.n[zb],Ec=zb<ig-1?Dc.n[zb+1]:Wb;else var df=ig+zb,Wb=Dc.n[df],Ec=0<df?Dc.n[df-1]:Wb;if(Wb.Kc(Ec)){var Kd=void 0,wd=void 0;0<=zb?(Kd=0<zb?Dc.n[zb-1]:Wb,wd=zb<ig-2?Dc.n[zb+2]:Ec):(Kd=df<ig-1?Dc.n[df+1]:Wb,wd=1<df?Dc.n[df-2]:Ec);var ef=Kd.zf(Wb),cb=Ec.zf(wd),ob=ef>
        cb+10?0<=zb?Kd.Pb(Wb):Wb.Pb(Kd):cb>ef+10?0<=zb?Ec.Pb(wd):wd.Pb(Ec):0<=zb?Kd.Pb(wd):wd.Pb(Kd)}else ob=0<=zb?Wb.Pb(Ec):Ec.Pb(Wb);sj!==kj&&(Ig=this.computeAngle(mc,sj,ob),mc.angle=Ig);Hg=Wb.x+(Ec.x-Wb.x)*li;Jf=Wb.y+(Ec.y-Wb.y)*li}if(Gg.L(yb))mc.location=new z(Hg,Jf);else{Gg.Sd()&&(Gg=Jb);var ff=w.Kf();ff.reset();ff.scale(mc.scale,mc.scale);ff.rotate(mc.angle,0,0);var ld=mc.Ja,Kg=w.mg(0,0,ld.width,ld.height),gf=w.K();gf.Zn(Kg,Gg);ff.nb(gf);var Fc=-gf.x,mi=-gf.y,Ke=mp.copy();isNaN(Ke.x)&&(Ke.x=0<=zb?gf.x+
            3:-(gf.x+3));isNaN(Ke.y)&&(Ke.y=-(gf.y+3));Ke.rotate(ob);Hg+=Ke.x;Jf+=Ke.y;ff.CG(Kg);var Fc=Fc+Kg.x,mi=mi+Kg.y,Lg=w.xb(Hg+Fc,Jf+mi);mc.move(Lg);w.v(Lg);w.v(gf);w.Db(Kg);w.we(ff)}}this.qu(!1)}break;case "Grid":break;case "Graduated":if(null!==this.Cm){var Mg=this.Ld(),tj=this.Em,Hk=this.Cm,ve=0,ad=Hk[ve];ve++;Mg.jc(ad.x-e.x,ad.y-e.y,ad.width,ad.height);for(var Ik=f.length,Ch=0;Ch<Ik;Ch++){var md=f[Ch],uj=tj[Ch];md.visible&&md!==Mg&&0!==uj.length&&(ad=Hk[ve],ve++,md.jc(ad.x-e.x,ad.y-e.y,ad.width,ad.height))}this.Cm=
            null}break;case "TableRow":case "TableColumn":w.k(this.toString()+" is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");break;default:w.k("Unknown panel type: "+u)}w.Db(h)}};C.prototype.wk=function(a){var b=this.Ja,c=Lp(this);if(db(0,0,b.width,b.height,a.x,a.y)){for(var b=this.xa.n,d=b.length,e=w.xb(0,0);d--;){var f=b[d];if(f.visible||f===c)if(Pa(e.set(a),f.transform),f.Ia(e))return w.v(e),!0}w.v(e);return null===this.Eb&&null===this.bc?!1:!0}return!1};
    C.prototype.mx=function(a){if(this.po===a)return this;for(var b=this.xa.n,c=b.length,d=0;d<c;d++){var e=b[d].mx(a);if(null!==e)return e}return null};function $o(a,b,c){c(a,b);if(b instanceof C){b=b.xa.n;for(var d=b.length,e=0;e<d;e++)$o(a,b[e],c)}}function Mm(a,b){Xp(a,a,b)}function Xp(a,b,c){c(b);b=b.xa.n;for(var d=b.length,e=0;e<d;e++){var f=b[e];f instanceof C&&Xp(a,f,c)}}C.prototype.walkVisualTree=C.prototype.ZJ=function(a){Yp(this,this,a)};
    function Yp(a,b,c){c(b);if(b instanceof C){b=b.xa.n;for(var d=b.length,e=0;e<d;e++)Yp(a,b[e],c)}}C.prototype.findInVisualTree=C.prototype.Mt=function(a){return Zp(this,this,a)};function Zp(a,b,c){if(c(b))return b;if(b instanceof C){b=b.xa.n;for(var d=b.length,e=0;e<d;e++){var f=Zp(a,b[e],c);if(null!==f)return f}}return null}
    C.prototype.findObject=C.prototype.xd=function(a){if(this.name===a)return this;for(var b=this.xa.n,c=b.length,d=0;d<c;d++){var e=b[d];if(e.name===a)return e;if(e instanceof C)if(null===e.$j&&null===e.zg){if(e=e.xd(a),null!==e)return e}else if(kn(e)&&(e=e.xa.first(),null!==e&&(e=e.xd(a),null!==e)))return e}return null};
    function $p(a){a=a.xa.n;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];if(e instanceof C)c=Math.max(c,$p(e));else if(e instanceof X){a:{if(null!==!e.Tf)switch(e.Go){case "None":case "Square":case "Ellipse":case "Circle":case "LineH":case "LineV":case "FramedRectangle":case "RoundedRectangle":case "Line1":case "Line2":case "Border":case "Cube1":case "Cube2":case "Junction":case "Cylinder1":case "Cylinder2":case "Cylinder3":case "Cylinder4":case "PlusLine":case "XLine":case "ThinCross":case "ThickCross":e=0;
        break a}e=e.ji/2*e.gn*e.pj()}c=Math.max(c,e)}}return c}g=C.prototype;g.ah=function(){return!(this.type===Jo||this.type===Ko)};
    g.Le=function(a,b,c){if(!1===this.Xg)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(Dm(this))return null;var d=this.Ja,e=1/this.pj(),f=this.ah(),h=f?a:Pa(w.xb(a.x,a.y),this.transform),k=this.g,l=10,m=5;null!==k&&(l=k.Yt("extraTouchArea"),m=l/2);if(db(-(m*e),-(m*e),d.width+l*e,d.height+l*e,h.x,h.y)){if(!this.In){var e=this.xa.n,n=e.length,k=w.K(),m=(l=this.du)?this.Ld():null;if(l&&(m.ah()?Pa(k.set(a),m.transform):k.set(a),!m.Ia(k)))return w.v(k),f||w.v(h),null;for(var p=Lp(this);n--;){var q=
        e[n];if(q.visible||q===p)if(q.ah()?Pa(k.set(a),q.transform):k.set(a),!l||q!==m){var r=null;q instanceof C?r=q.Le(k,b,c):!0===q.Xg&&q.Ia(k)&&(r=q);if(null!==r&&(null!==b&&(r=b(r)),null!==r&&(null===c||c(r))))return w.v(k),f||w.v(h),r}}w.v(k)}if(null===this.background&&null===this.mn)return f||w.v(h),null;a=db(0,0,d.width,d.height,h.x,h.y)?this:null;f||w.v(h);return a}f||w.v(h);return null};
    g.Ot=function(a,b,c,d){if(!1===this.Xg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);d instanceof H||d instanceof I||(d=new H(G));var e=this.Ja,f=this.ah(),h=f?a:Pa(w.xb(a.x,a.y),this.transform);if(db(0,0,e.width,e.height,h.x,h.y)){if(!this.In){for(var e=this.xa.n,k=e.length,l=w.K(),m=Lp(this);k--;){var n=e[k];if(n.visible||n===m){n.ah()?Pa(l.set(a),n.transform):l.set(a);var p=n,n=n instanceof C?n:null;(null!==n?n.Ot(l,b,c,d):p.Ia(l))&&!1!==p.Xg&&(null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||
    d.add(p))}}w.v(l)}f||w.v(h);return null!==this.background||null!==this.mn}f||w.v(h);return!1};
    g.Ak=function(a,b,c,d,e,f){if(!1===this.Xg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=f;void 0===f&&(h=w.Kf(),h.reset());h.multiply(this.transform);if(this.tn(a,h))return aq(this,b,c,e),void 0===f&&w.we(h),!0;if(this.Zf(a,h)){if(!this.In)for(var k=Lp(this),l=this.xa.n,m=l.length;m--;){var n=l[m];if(n.visible||n===k){var p=n.W,q=this.Ja;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=n;n=n instanceof C?n:null;q=w.Kf();q.set(h);if(null!==n?n.Ak(a,b,c,d,e,q):Do(p,a,d,
            q))null!==b&&(p=b(p)),null===p||null!==c&&!c(p)||e.add(p);w.we(q)}}}void 0===f&&w.we(h);return d}void 0===f&&w.we(h);return!1};function aq(a,b,c,d){for(var e=a.xa.n,f=e.length;f--;){var h=e[f];if(h.visible){var k=h.W,l=a.Ja;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof C&&aq(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}}
    g.zn=function(a,b,c,d,e,f){if(!1===this.Xg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ja,k=this.ah(),l=k?a:Pa(w.xb(a.x,a.y),this.transform),m=k?b:Pa(w.xb(b.x,b.y),this.transform),n=l.zf(m),p=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height||Ra(l.x,l.y,0,0,0,h.height)<n||Ra(l.x,l.y,0,h.height,h.width,h.height)<n||Ra(l.x,l.y,h.width,h.height,h.width,0)<n||Ra(l.x,l.y,h.width,0,0,0)<n,h=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height&&Ra(l.x,l.y,0,0,0,h.height)<n&&Ra(l.x,l.y,0,h.height,h.width,h.height)<
        n&&Ra(l.x,l.y,h.width,h.height,h.width,0)<n&&Ra(l.x,l.y,h.width,0,0,0)<n;k||(w.v(l),w.v(m));if(p){if(!this.In){for(var k=w.K(),l=w.K(),m=Lp(this),n=this.xa.n,q=n.length;q--;){var r=n[q];if(r.visible||r===m){var s=r.W,u=this.Ja;s.x>u.width||s.y>u.height||0>s.x+s.width||0>s.y+s.height||(r.ah()?(s=r.transform,Pa(k.set(a),s),Pa(l.set(b),s)):(k.set(a),l.set(b)),s=r,r=r instanceof C?r:null,null!==r?!r.zn(k,l,c,d,e,f):!s.UE(k,l,e))||(null!==c&&(s=c(s)),null===s||null!==d&&!d(s)||f.add(s))}}w.v(k);w.v(l)}return e?
        p:h}return!1};function Mp(a){var b=null;a instanceof X&&(b=a.A,b===qc&&(b=null),a=a.kf,null!==a&&null===b&&(b=a.A));null===b&&(b=Ab);return b}function Np(a){var b=null;a instanceof X&&(b=a.B,b===qc&&(b=null),a=a.kf,null!==a&&null===b&&(b=a.B));null===b&&(b=Sb);return b}C.prototype.add=C.prototype.add=function(a){w.G(a,G,C,"add:element");this.Qd(this.xa.count,a)};C.prototype.elt=C.prototype.ea=function(a){return this.xa.ea(a)};
    C.prototype.insertAt=C.prototype.Qd=function(a,b){b instanceof R&&w.k("Cannot add a Part to a Panel: "+b+"; use a Panel instead");if(this===b||this.bm(b))this===b&&w.k("Cannot make a Panel contain itself: "+this.toString()),w.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.Q;null!==c&&c!==this&&w.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: "+b.toString()+", already contained by "+c.toString()+", cannot be shared by this Panel: "+
        this.toString());this.na!==Il||b instanceof X||w.k("Can only add Shapes to a Grid Panel, not: "+b);this.na!==ip||b instanceof X||b instanceof Lh||w.k("Can only add Shapes or TextBlocks to a Graduated Panel, not: "+b);b.hm(this);b.Wm=null;if(null!==this.cq){var d=b.data;null!==d&&"object"===typeof d&&(null===this.yg&&(this.yg=new ma(Object,C)),this.yg.add(d,b))}var e=this.xa,d=-1;if(c===this){for(var f=-1,h=this.xa.n,k=h.length,l=0;l<k;l++)if(h[l]===b){f=l;break}if(-1!==f){if(f===a||f+1>=e.count&&
        a>=e.count)return;e.bd(f);d=f}else w.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>a||a>e.count)a=e.count;e.Qd(a,b);if(0===a||b.pf)this.Al=null;this.H();b.H();null!==b.Ud?this.Fk=!0:b instanceof C&&!0===b.Fk&&(this.Fk=!0);this.Uj=null;c=this.U;null!==c&&(c.Rm=null,c.ck=NaN,this.Fk&&c instanceof T&&(c.Fk=!0),c.Fk&&c instanceof T&&(c.ne=null),e=this.g,null!==e&&e.ia.ab||(-1!==d&&c.ad(Qf,"elements",this,b,null,d,null),c.ad(Pf,"elements",this,null,b,null,a),
    this.fu()||bq(this,b,!1)))};w.defineProperty(C,{Fk:null},function(){return 0!==(this.O&8388608)},function(a){0!==(this.O&8388608)!==a&&(this.O^=8388608)});function cq(a,b){a.O=b?a.O|16777216:a.O&-16777217}C.prototype.remove=C.prototype.remove=function(a){w.G(a,G,C,"remove:element");for(var b=this.xa.n,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.nf(d,!0)};C.prototype.removeAt=C.prototype.bd=function(a){0<=a&&this.nf(a,!0)};
    C.prototype.nf=function(a,b){var c=this.xa,d=c.ea(a);d.Wm=null;d.hm(null);if(null!==this.yg){var e=d.data;"object"===typeof e&&this.yg.remove(e)}c.bd(a);am(this,!1);this.H();this.Al===d&&(this.Al=null);this.Uj=null;var f=this.U;null!==f&&(f.Rm=null,f.ck=NaN,f.de(),f instanceof T&&(d instanceof C?$o(d,d,function(a,c){Xo(f,c,b)}):Xo(f,d,b)),c=this.g,null!==c&&c.ia.ab||f.ad(Qf,"elements",this,d,null,a,null))};w.u(C,{pq:"rowCount"},function(){return void 0===this.ae?0:this.ae.length});
    C.prototype.getRowDefinition=C.prototype.Nd=function(a){0>a&&w.Fa(a,">= 0",C,"getRowDefinition:idx");a=Math.round(a);var b=this.ae;if(void 0===b[a]){var c=new Wg;c.hm(this);c.xe=!0;c.index=a;b[a]=c}return b[a]};C.prototype.removeRowDefinition=C.prototype.ZF=function(a){0>a&&w.Fa(a,">= 0",C,"removeRowDefinition:idx");a=Math.round(a);var b=this.ae;this.ad(Qf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.H()};w.u(C,{Ip:"columnCount"},function(){return void 0===this.Xd?0:this.Xd.length});
    C.prototype.getColumnDefinition=C.prototype.Md=function(a){0>a&&w.Fa(a,">= 0",C,"getColumnDefinition:idx");a=Math.round(a);var b=this.Xd;if(void 0===b[a]){var c=new Wg;c.hm(this);c.xe=!1;c.index=a;b[a]=c}return b[a]};C.prototype.removeColumnDefinition=C.prototype.XF=function(a){0>a&&w.Fa(a,">= 0",C,"removeColumnDefinition:idx");a=Math.round(a);var b=this.Xd;this.ad(Qf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.H()};
    w.defineProperty(C,{zJ:"rowSizing"},function(){return void 0===this.Zm?hp:this.Zm},function(a){if(void 0!==this.Zm){var b=this.Zm;b!==a&&(a!==hp&&a!==Pp&&w.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Zm=a,this.H(),this.h("rowSizing",b,a))}});
    w.defineProperty(C,{wH:"columnSizing"},function(){return void 0===this.ym?hp:this.ym},function(a){if(void 0!==this.ym){var b=this.ym;b!==a&&(a!==hp&&a!==Pp&&w.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.ym=a,this.H(),this.h("columnSizing",b,a))}});
    w.defineProperty(C,{XL:"topIndex"},function(){return void 0===this.fj?0:this.fj},function(a){if(void 0!==this.fj){var b=this.fj;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.fj=a,this.H(),this.h("topIndex",b,a))}});
    w.defineProperty(C,{kL:"leftIndex"},function(){return void 0===this.Qi?0:this.Qi},function(a){if(void 0!==this.Qi){var b=this.Qi;b!==a&&((!isFinite(a)||0>a)&&w.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.Qi=a,this.H(),this.h("leftIndex",b,a))}});C.prototype.findRowForLocalY=function(a){if(0>a||this.type!==So)return-1;for(var b=0,c=this.ae,d=c.length,e=this.fj;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))break}return e};
    C.prototype.findColumnForLocalX=function(a){if(0>a||this.type!==So)return-1;for(var b=0,c=this.Xd,d=c.length,e=this.Qi;e<d;e++){var f=c[e];if(void 0!==f&&(b+=f.total,a<b))break}return e};C.prototype.graduatedPointForValue=function(a,b){void 0===b&&(b=new z(NaN,NaN));if(this.type!==ip)return b.m(NaN,NaN),b;a=Math.min(Math.max(a,this.Ek),this.uA);var c=(a-this.Ek)/this.Zt,d=this.Ld();d.kf.dI(c,b);c=w.Kf();c.set(d.transform);b.transform(c);w.we(c);return b};
    C.prototype.graduatedValueForPoint=function(a){if(this.type!==ip)return NaN;var b=this.Ld(),c=b.kf,d=w.Kf();d.set(b.transform);d.vx();a.transform(d);w.we(d);return c.$H(a)*this.Zt+this.Ek};
    w.defineProperty(C,{data:"data"},function(){return this.Zd},function(a){var b=this.Zd;if(b!==a){var c=this instanceof R&&!(this instanceof kh);c&&w.j(a,"object",C,"data");mh(this);this.Zd=a;var d=this.g;null!==d&&(c?this instanceof W?(null!==b&&d.Lj.remove(b),null!==a&&d.Lj.add(a,this)):this instanceof R&&(null!==b&&d.Ei.remove(b),null!==a&&d.Ei.add(a,this)):(c=this.Q,null!==c&&null!==c.yg&&(null!==b&&c.yg.remove(b),null!==a&&c.yg.add(a,this))));this.h("data",b,a);null!==d&&d.ia.ab||null!==a&&this.Ib()}});
    w.defineProperty(C,{ku:"itemIndex"},function(){return this.Tr},function(a){var b=this.Tr;b!==a&&(this.Tr=a,this.h("itemIndex",b,a))});function ap(a){a=a.$k;return null!==a&&a.P}
    function mh(a){var b=a.$k;if(null===b)null!==a.data&&w.k("Template cannot have .data be non-null: "+a),a.$k=b=new H(bh);else if(b.P)return;var c=new H(G);cq(a,!1);$o(a,a,function(a,d){var e=d.vc;if(null!==e)for(Wo(d,!1),e=e.i;e.next();){var f=e.value;f.mode===dh&&Wo(d,!0);var h=f.xq;null!==h&&("/"===h&&cq(a,!0),h=eh(f,a,d),null!==h&&(c.add(h),null===h.op&&(h.op=new H(bh)),h.op.add(f)));b.add(f)}if(d instanceof C&&d.type===So){if(0<d.ae.length)for(e=d.ae,f=e.length,h=0;h<f;h++){var k=e[h];if(void 0!==
        k&&null!==k.vc)for(var l=k.vc.i;l.next();){var t=l.value;t.Ig=k;t.kt=2;t.wp=k.index;b.add(t)}}if(0<d.Xd.length)for(e=d.Xd,f=e.length,h=0;h<f;h++)if(k=e[h],void 0!==k&&null!==k.vc)for(l=k.vc.i;l.next();)t=l.value,t.Ig=k,t.kt=1,t.wp=k.index,b.add(t)}});for(var d=c.i;d.next();){var e=d.value;if(null!==e.op){Wo(e,!0);for(var f=e.op.i;f.next();){var h=f.value;null===e.vc&&(e.vc=new H(bh));e.vc.add(h)}}e.op=null}for(d=b.i;d.next();)if(e=d.value,f=e.Ig,null!==f){e.Ig=null;var k=e.py,l=k.indexOf(".");0<l&&
    f instanceof C&&(h=k.substring(0,l),k=k.substr(l+1),l=f.xd(h),null!==l?(f=l,e.py=k):w.trace('Warning: unable to find GraphObject named "'+h+'" for Binding: '+e.toString()));f instanceof Wg?(e.lm=w.Od(f.Q),f.Q.po=e.lm):(e.lm=w.Od(f),f.po=e.lm)}b.freeze();a instanceof R&&a.ee()&&a.Je()}C.prototype.copyTemplate=function(){var a=this.copy();a.ZJ(function(a){a instanceof C&&(a.$k=null,a.Zd=null);var c=a.vc;null!==c&&(a.vc=null,c.each(function(c){a.bind(c.copy())}))});return a};
    C.prototype.updateTargetBindings=C.prototype.Ib=function(a){var b=this.$k;if(null!==b)for(void 0===a&&(a=""),b=b.i;b.next();){var c=b.value,d=c.qG;if(""===a||""===d||d===a)if(d=c.py,null!==c.BH||""!==d){var d=this.data,e=c.xq;if(null!==e)d=""===e?this:"/"===e?this:"."===e?this:".."===e?this:this.xd(e);else{var f=this.g;null!==f&&c.Dx&&(d=f.aa.Ik)}if(null!==d){var f=this,h=c.lm;if(-1!==h){if(f=this.mx(h),null===f)continue}else null!==c.Ig&&(f=c.Ig);"/"===e?d=f.U:"."===e?d=f:".."===e&&(d=f.Q);e=c.kt;
        if(0!==e){if(!(f instanceof C))continue;h=f;1===e?f=h.Md(c.wp):2===e&&(f=h.Nd(c.wp))}void 0!==f&&c.FG(f,d)}}}};w.defineProperty(C,{cq:"itemArray"},function(){return this.$j},function(a){var b=this.$j;if(b!==a){var c=this.g;null!==c&&null!==b&&Sm(c,this);this.$j=a;null!==c&&null!==a&&Om(c,this);this.h("itemArray",b,a);null!==c&&c.ia.ab||this.aB()}});
    function kn(a){return a.type===Mj||a.type===Fl||a.type===hj||a.type===So&&0<a.xa.length&&(a=a.xa.ea(0),a.pf&&a instanceof C&&(a.type===Jo||a.type===Ko))?!0:!1}C.prototype.rebuildItemElements=C.prototype.aB=function(){var a=0;for(kn(this)&&(a=1);this.xa.length>a;)this.nf(this.xa.length-1,!1);a=this.cq;if(null!==a)for(var b=w.Za(a),c=0;c<b;c++)jn(this,w.Ba(a,c),c)};
    C.prototype.findItemPanelForData=C.prototype.UH=function(a){if(void 0===a||null===a||null===this.yg)return null;w.j(a,"object",C,"findItemPanelForData");return this.yg.ka(a)};
    function jn(a,b,c){if(!(void 0===b||null===b||0>c)){var d;d=dq(a,b);var e=a.FI,f=null;null!==e&&(f=e.ka(d));null===f&&(eq||(eq=!0,w.trace('No item template Panel found for category "'+d+'" on '+a),w.trace("  Using default item template."),d=new C,e=new Lh,e.bind(new bh("text","",Rf)),d.add(e),fq=d),f=fq);d=f;null!==d&&(mh(d),d=d.copy(),0!==(d.O&16777216)&&(e=a.Ul(),null!==e&&cq(e,!0)),"object"===typeof b&&(null===a.yg&&(a.yg=new ma(Object,C)),a.yg.add(b,d)),e=c,kn(a)&&e++,a.Qd(e,d),d.Zd=b,ln(a,e,
        c),d.Zd=null,d.data=b)}}function ln(a,b,c){for(a=a.xa;b<a.length;){var d=a.ea(b);if(d instanceof C){var e=b,f=c;d.type===Jo?d.Vb=e:d.type===Ko&&(d.column=e);d.ku=f}b++;c++}}
    w.defineProperty(C,{iL:"itemTemplate"},function(){return null===this.zg?null:this.zg.ka("")},function(a){if(null===this.zg){if(null===a)return;this.zg=new ma("string",C)}var b=this.zg.ka("");b!==a&&(w.G(a,C,C,"itemTemplate"),(a instanceof R||a.pf)&&w.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.zg.add("",a),this.h("itemTemplate",b,a),a=this.g,null!==a&&a.ia.ab||this.aB())});
    w.defineProperty(C,{FI:"itemTemplateMap"},function(){return this.zg},function(a){var b=this.zg;if(b!==a){w.G(a,ma,C,"itemTemplateMap");for(var c=a.i;c.next();){var d=c.value;(d instanceof R||d.pf)&&w.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.zg=a;this.h("itemTemplateMap",b,a);a=this.g;null!==a&&a.ia.ab||this.aB()}});
    w.defineProperty(C,{hL:"itemCategoryProperty"},function(){return this.To},function(a){var b=this.To;b!==a&&("string"!==typeof a&&"function"!==typeof a&&w.Bd(a,"string or function",C,"itemCategoryProperty"),this.To=a,this.h("itemCategoryProperty",b,a))});
    function dq(a,b){if(null===b)return"";var c=a.To,d="";if("function"===typeof c)d=c(b);else if("string"===typeof c&&"object"===typeof b){if(""===c)return"";d=w.tb(b,c)}else return"";if(void 0===d)return"";if("string"===typeof d)return d;w.k("Panel.getCategoryForItemData found a non-string category for "+b+": "+d);return""}var eq=!1,fq=null;
    w.defineProperty(C,{In:"isAtomic"},function(){return 0!==(this.O&1048576)},function(a){var b=0!==(this.O&1048576);b!==a&&(w.j(a,"boolean",C,"isAtomic"),this.O^=1048576,this.h("isAtomic",b,a))});w.defineProperty(C,{du:"isClipping"},function(){return 0!==(this.O&2097152)},function(a){var b=0!==(this.O&2097152);b!==a&&(w.j(a,"boolean",C,"isClipping"),this.O^=2097152,this.H(),this.h("isClipping",b,a))});
    w.defineProperty(C,{yF:"isOpposite"},function(){return 0!==(this.O&33554432)},function(a){var b=0!==(this.O&33554432);b!==a&&(w.j(a,"boolean",C,"isOpposite"),this.O^=33554432,this.H(),this.h("isOpposite",b,a))});w.defineProperty(C,{isEnabled:"isEnabled"},function(){return 0!==(this.O&4194304)},function(a){var b=0!==(this.O&4194304);if(b!==a){w.j(a,"boolean",C,"isEnabled");var c=null===this.Q||this.Q.fu();this.O^=4194304;this.h("isEnabled",b,a);b=this.g;null!==b&&b.ia.ab||c&&bq(this,this,a)}});
    function bq(a,b,c){var d=b.NE;null!==d&&d(b,c);if(b instanceof C){b=b.xa.n;for(var d=b.length,e=0;e<d;e++){var f=b[e];c&&f instanceof C&&!f.isEnabled||bq(a,f,c)}}}w.defineProperty(C,{eK:"alignmentFocusName"},function(){return this.Ij},function(a){var b=this.Ij;b!==a&&(this.Ij=a,this.H(),this.h("alignmentFocusName",b,a))});
    function Wg(){w.nc(this);this.nh=null;this.Qv=!0;this.wc=0;this.jf=NaN;this.ek=0;this.dk=Infinity;this.ie=qc;this.jb=this.Ra=0;this.vc=null;this.ct=gq;this.Hg=oo;this.Ys=this.ik=null;this.Zs=NaN;this.Eb=this.ai=null;this.br=!1}w.ga("RowColumnDefinition",Wg);
    Wg.prototype.copy=function(){var a=new Wg;a.Qv=this.Qv;a.wc=this.wc;a.jf=this.jf;a.ek=this.ek;a.dk=this.dk;a.ie=this.ie;a.Ra=this.Ra;a.jb=this.jb;a.Hg=this.Hg;a.ct=this.ct;a.ik=null===this.ik?null:this.ik.S();a.Ys=this.Ys;a.Zs=this.Zs;a.ai=null;null!==this.ai&&(a.ai=w.Nl(this.ai));a.Eb=this.Eb;a.br=this.br;a.vc=this.vc;return a};
    Wg.prototype.Jp=function(a){w.G(a,Wg,Wg,"copyFrom:pd");a.xe?this.height=a.height:this.width=a.width;this.Bh=a.Bh;this.he=a.he;this.alignment=a.alignment;this.stretch=a.stretch;this.Mu=a.Mu;this.ik=null===a.ik?null:a.ik.S();this.rq=a.rq;this.sq=a.sq;this.ai=null;a.ai&&(this.ai=w.Nl(a.ai));this.background=a.background;this.gA=a.gA;this.vc=a.vc};Wg.prototype.ic=function(a){a.Ee===Wg?this.Mu=a:w.Fj(this,a)};
    Wg.prototype.toString=function(){return"RowColumnDefinition "+(this.xe?"(Row ":"(Column ")+this.index+") #"+w.Od(this)};var gq;Wg.Default=gq=w.p(Wg,"Default",0);var Pp;Wg.None=Pp=w.p(Wg,"None",1);var hp;Wg.ProportionalExtra=hp=w.p(Wg,"ProportionalExtra",2);Wg.prototype.hm=function(a){this.nh=a};
    Wg.prototype.computeEffectiveSpacingTop=Wg.prototype.AE=function(){var a=0;if(0!==this.index){var b=this.nh,c=this.rq;null===c&&null!==b&&(c=this.xe?b.Fi:b.Nh);null!==c&&(a=this.sq,isNaN(a)&&(a=null!==b?this.xe?b.Ph:b.Oh:0))}b=this.kG;if(null===b)if(b=this.nh,null!==b)b=b.Mj;else return a;return a+(this.xe?b.top:b.left)};
    Wg.prototype.computeEffectiveSpacing=Wg.prototype.$e=function(){var a=0;if(0!==this.index){var b=this.nh,c=this.rq;null===c&&null!==b&&(c=this.xe?b.Fi:b.Nh);null!==c&&(a=this.sq,isNaN(a)&&(a=null!==b?this.xe?b.Ph:b.Oh:0))}b=this.kG;if(null===b)if(b=this.nh,null!==b)b=b.Mj;else return a;return a+(this.xe?b.top+b.bottom:b.left+b.right)};
    Wg.prototype.gd=function(a,b,c,d,e){var f=this.nh;if(null!==f&&(f.ad(Nf,a,this,b,c,d,e),null!==this.vc&&(b=f.g,null!==b&&!b.Pe&&(f=f.Ul(),null!==f&&(b=f.data,null!==b)))))for(c=this.vc.i;c.next();)c.value.qy(this,b,a,f)};w.u(Wg,{Q:"panel"},function(){return this.nh});w.defineProperty(Wg,{xe:"isRow"},function(){return this.Qv},function(a){this.Qv=a});w.defineProperty(Wg,{index:"index"},function(){return this.wc},function(a){this.wc=a});
    w.defineProperty(Wg,{height:"height"},function(){return this.jf},function(a){var b=this.jf;b!==a&&(0>a&&w.Fa(a,">= 0",Wg,"height"),this.jf=a,this.Ya=this.Ra,null!==this.Q&&this.Q.H(),this.gd("height",b,a))});w.defineProperty(Wg,{width:"width"},function(){return this.jf},function(a){var b=this.jf;b!==a&&(0>a&&w.Fa(a,">= 0",Wg,"width"),this.jf=a,this.Ya=this.Ra,null!==this.Q&&this.Q.H(),this.gd("width",b,a))});
    w.defineProperty(Wg,{Bh:"minimum"},function(){return this.ek},function(a){var b=this.ek;b!==a&&((0>a||!isFinite(a))&&w.Fa(a,">= 0",Wg,"minimum"),this.ek=a,this.Ya=this.Ra,null!==this.Q&&this.Q.H(),this.gd("minimum",b,a))});w.defineProperty(Wg,{he:"maximum"},function(){return this.dk},function(a){var b=this.dk;b!==a&&(0>a&&w.Fa(a,">= 0",Wg,"maximum"),this.dk=a,this.Ya=this.Ra,null!==this.Q&&this.Q.H(),this.gd("maximum",b,a))});
    w.defineProperty(Wg,{alignment:"alignment"},function(){return this.ie},function(a){var b=this.ie;b.L(a)||(this.ie=a.S(),null!==this.Q&&this.Q.H(),this.gd("alignment",b,a))});w.defineProperty(Wg,{stretch:"stretch"},function(){return this.Hg},function(a){var b=this.Hg;b!==a&&(this.Hg=a,null!==this.Q&&this.Q.H(),this.gd("stretch",b,a))});
    w.defineProperty(Wg,{kG:"separatorPadding"},function(){return this.ik},function(a){"number"===typeof a&&(a=new hb(a));var b=this.ik;null!==a&&null!==b&&b.L(a)||(null!==a&&(a=a.S()),this.ik=a,null!==this.Q&&this.Q.H(),this.gd("separatorPadding",b,a))});w.defineProperty(Wg,{rq:"separatorStroke"},function(){return this.Ys},function(a){var b=this.Ys;b!==a&&(null===a||"string"===typeof a||a instanceof ha)&&(a instanceof ha&&a.freeze(),this.Ys=a,null!==this.Q&&this.Q.H(),this.gd("separatorStroke",b,a))});
    w.defineProperty(Wg,{sq:"separatorStrokeWidth"},function(){return this.Zs},function(a){var b=this.Zs;b!==a&&(this.Zs=a,null!==this.Q&&this.Q.H(),this.gd("separatorStrokeWidth",b,a))});
    w.defineProperty(Wg,{LL:"separatorDashArray"},function(){return this.ai},function(a){var b=this.ai;if(b!==a){null===a||Array.isArray(a)||w.Bd(a,"Array",Wg,"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)||w.k("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.ai=a;null!==this.Q&&this.Q.oa();this.gd("separatorDashArray",b,a)}});
    w.defineProperty(Wg,{background:"background"},function(){return this.Eb},function(a){var b=this.Eb;b!==a&&(null===a||"string"===typeof a||a instanceof ha)&&(a instanceof ha&&a.freeze(),this.Eb=a,null!==this.Q&&this.Q.oa(),this.gd("background",b,a))});w.defineProperty(Wg,{gA:"coversSeparators"},function(){return this.br},function(a){var b=this.br;b!==a&&(w.j(a,"boolean",Wg,"coversSeparators"),this.br=a,null!==this.Q&&this.Q.oa(),this.gd("coversSeparators",b,a))});
    w.defineProperty(Wg,{Mu:"sizing"},function(){return this.ct},function(a){var b=this.ct;b!==a&&(this.ct=a,null!==this.Q&&this.Q.H(),this.gd("sizing",b,a))});function Op(a){if(a.Mu===gq){var b=a.nh;return a.xe?b.zJ:b.wH}return a.Mu}w.defineProperty(Wg,{Ya:"actual"},function(){return this.Ra},function(a){this.Ra=isNaN(this.jf)?Math.max(Math.min(this.dk,a),this.ek):Math.max(Math.min(this.dk,this.jf),this.ek)});
    w.defineProperty(Wg,{total:"total"},function(){return this.Ra+this.$e()},function(a){this.Ra=isNaN(this.jf)?Math.max(Math.min(this.dk,a),this.ek):Math.max(Math.min(this.dk,this.jf),this.ek);this.Ra=Math.max(0,this.Ra-this.$e())});w.defineProperty(Wg,{position:"position"},function(){return this.jb},function(a){this.jb=a});
    Wg.prototype.bind=Wg.prototype.bind=function(a){a.Ig=this;var b=this.Q;if(null!==b){var c=b.Ul();null!==c&&ap(c)&&w.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a+" on "+b)}null===this.vc&&(this.vc=new H(bh));this.vc.add(a)};
    function X(){G.call(this);this.Tf=this.Ua=null;this.Go="None";this.zr=oo;this.rc=this.Dd="black";this.ji=1;this.rp="butt";this.tp="miter";this.gn=10;this.sp=null;this.wf=0;this.ii=this.hi=qc;this.As=this.zs=NaN;this.Jr=!1;this.Cs=null;this.Io=this.yp="None";this.wg=1;this.vg=0;this.ug=1}w.Ka(X,G);w.ga("Shape",X);
    X.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.Ua=this.Ua;a.Go=this.Go;a.zr=this.zr;a.Tf=this.Tf;a.Dd=this.Dd;a.rc=this.rc;a.ji=this.ji;a.rp=this.rp;a.tp=this.tp;a.gn=this.gn;null!==this.sp&&(a.sp=w.Nl(this.sp));a.wf=this.wf;a.hi=this.hi.S();a.ii=this.ii.S();a.zs=this.zs;a.As=this.As;a.Jr=this.Jr;a.Cs=this.Cs;a.yp=this.yp;a.Io=this.Io;a.wg=this.wg;a.vg=this.vg;a.ug=this.ug};
    X.prototype.ic=function(a){a===Oj||a===Qj||a===Rj||a===oo?this.rA=a:G.prototype.ic.call(this,a)};X.prototype.toString=function(){return"Shape("+("None"!==this.Cb?this.Cb:"None"!==this.yq?this.yq:this.pA)+")#"+w.Od(this)};
    function hq(a,b,c,d){var e=c.length;if(!(4>e)){for(var f=d.za,h=Math.max(1,f.width),f=f.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,u=q=0,t=w.cb(),x=2;x<e;x+=2)m=c[x],n=c[x+1],p=m-k,q=n-l,0===p&&(p=.001),r=q/p,s=Math.atan2(q,p),q=Math.sqrt(p*p+q*q),t.push([p,s,r,q]),u+=q,k=m,l=n;k=c[0];l=c[1];p=d.za.width;d instanceof X&&(p-=d.lb);1>p&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,x=0,q=t[x],p=q[0],s=q[1],r=q[2],q=q[3],v=0;.1<=u;){0===v&&(n?(e=c,e-=m,u-=m,n=!1):e=c,0===e&&(e=1));if(e>u){w.ta(t);return}e>
    q?(v=e-q,e=q):v=0;var A=Math.sqrt(e*e/(1+r*r));0>p&&(A=-A);k+=A;l+=r*A;a.translate(k,l);a.rotate(s);a.translate(-(h/2),-(f/2));0===v&&d.zk(a,b);a.translate(h/2,f/2);a.rotate(-s);a.translate(-k,-l);u-=e;q-=e;if(0!==v){x++;if(x===t.length){w.ta(t);return}q=t[x];p=q[0];s=q[1];r=q[2];q=q[3];e=v}}w.ta(t)}}
    X.prototype.zk=function(a,b){if(null!==this.rc||null!==this.Dd){null!==this.Dd&&No(this,a,this.Dd,!0,!1);null!==this.rc&&No(this,a,this.rc,!1,!1);var c=this.ji;if(0===c){var d=this.U;d instanceof kh&&d.type===hj&&"Selection"===d.vd&&d.sb instanceof X&&d.xf.Ld()===d.sb&&(c=d.sb.lb)}a.lineWidth=c;a.lineJoin=this.tp;a.lineCap=this.rp;a.miterLimit=this.gn;var e=!1;this.U&&b.qj("drawShadows")&&(e=this.U.dm);var f=!0;null!==this.rc&&null===this.Dd&&(f=!1);var d=!1,h=!0,k=this.tG;null!==k&&(d=!0,h=a.lA(k,
        this.wf));var l=this.Ua;if(null!==l){if(l.na===Ge)a.beginPath(),d&&!h?yo(a,l.zc,l.Ic,l.yb,l.Gb,k,this.wf):(a.moveTo(l.zc,l.Ic),a.lineTo(l.yb,l.Gb)),null!==this.Dd&&a.Ng(this.Dd),0!==c&&null!==this.rc&&a.Dj();else if(l.na===He){var m=l.zc,n=l.Ic,p=l.yb,q=l.Gb,l=Math.min(m,p),r=Math.min(n,q),m=Math.abs(p-m),n=Math.abs(q-n);null!==this.Dd&&(a.beginPath(),a.rect(l,r,m,n),a.Ng(this.Dd));if(null!==this.rc){var s=p=0,u=0;f&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
        0,a.shadowBlur=0);d&&!h?(h=w.cb(),h.push(l),h.push(r),h.push(l+m),h.push(r),h.push(l+m),h.push(r+n),h.push(l),h.push(r+n),h.push(l),h.push(r),a.beginPath(),iq(a,h,k,this.wf),a.Dj(),w.ta(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.Dj());f&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u)}}else if(l.na===Le)m=l.zc,n=l.Ic,p=l.yb,q=l.Gb,l=Math.abs(p-m)/2,r=Math.abs(q-n)/2,m=Math.min(m,p)+l,n=Math.min(n,q)+r,a.beginPath(),a.moveTo(m,n-r),a.bezierCurveTo(m+cd*l,n-r,m+l,n-cd*r,m+l,n),a.bezierCurveTo(m+
        l,n+cd*r,m+cd*l,n+r,m,n+r),a.bezierCurveTo(m-cd*l,n+r,m-l,n+cd*r,m-l,n),a.bezierCurveTo(m-l,n-cd*r,m-cd*l,n-r,m,n-r),a.closePath(),null!==this.Dd&&a.Ng(this.Dd),d&&!h&&(h=w.cb(),Xd(m,n-r,m+cd*l,n-r,m+l,n-cd*r,m+l,n,.5,h),Xd(m+l,n,m+l,n+cd*r,m+cd*l,n+r,m,n+r,.5,h),Xd(m,n+r,m-cd*l,n+r,m-l,n+cd*r,m-l,n,.5,h),Xd(m-l,n,m-l,n-cd*r,m-cd*l,n-r,m,n-r,.5,h),a.beginPath(),iq(a,h,k,this.wf),w.ta(h)),0!==c&&null!==this.rc&&(f&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
        0,a.shadowBlur=0,a.Dj(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u):a.Dj());else if(l.na===De){r=l.Oj;n=r.length;for(q=0;q<n;q++){m=r.n[q];a.beginPath();a.moveTo(m.ha,m.fa);for(var p=m.vb.n,s=p.length,t=null,u=0;u<s;u++){var x=p[u];switch(x.na){case nf:a.moveTo(x.C,x.D);break;case Ne:a.lineTo(x.C,x.D);break;case of:a.bezierCurveTo(x.Fd,x.Ye,x.oh,x.Fg,x.yb,x.Gb);break;case pf:a.quadraticCurveTo(x.Fd,x.Ye,x.yb,x.Gb);break;case qf:if(x.radiusX===x.radiusY)t=Math.PI/180,a.arc(x.Fd,x.Ye,x.radiusX,
        x.ze*t,(x.ze+x.rf)*t,0>x.rf);else{var t=sf(x,m),v=t.length;if(0===v){a.lineTo(x.la,x.ra);break}for(var A=0;A<v;A++){var y=t[A];0===A&&a.lineTo(y[0],y[1]);a.bezierCurveTo(y[2],y[3],y[4],y[5],y[6],y[7])}}break;case rf:A=v=0;if(null!==t&&t.type===qf){t=sf(t,m);y=t.length;if(0===y){a.lineTo(x.la,x.ra);break}t=t[y-1]||null;null!==t&&(v=t[6],A=t[7])}else v=null!==t?t.C:m.ha,A=null!==t?t.D:m.fa;t=tf(x,m,v,A);v=t.length;if(0===v){a.lineTo(x.la,x.ra);break}for(A=0;A<v;A++)y=t[A],a.bezierCurveTo(y[2],y[3],
        y[4],y[5],y[6],y[7]);break;default:w.k("Segment not of valid type: "+x.na)}x.Sh&&a.closePath();t=x}e?(u=s=p=0,m.Ro?(!0===m.Gm&&null!==this.Dd?(a.Ng(this.Dd),f=!0):f=!1,0!==c&&null!==this.rc&&(f&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),d&&!h||a.Dj(),f&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u))):(f&&(p=a.shadowOffsetX,s=a.shadowOffsetY,u=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),!0===m.Gm&&null!==this.Dd&&
    a.Ng(this.Dd),0!==c&&null!==this.rc&&(d&&!h||a.Dj()),f&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=u))):(!0===m.Gm&&null!==this.Dd&&a.Ng(this.Dd),0===c||null===this.rc||d&&!h||a.Dj())}if(d&&!h)for(c=f,f=l.Oj,h=f.length,l=0;l<h;l++){r=f.n[l];a.beginPath();n=w.cb();n.push(r.ha);n.push(r.fa);q=r.ha;m=r.fa;p=q;s=m;u=r.vb.n;x=u.length;for(t=0;t<x;t++){v=u[t];switch(v.na){case nf:iq(a,n,k,this.wf);n.length=0;n.push(v.C);n.push(v.D);q=v.C;m=v.D;p=q;s=m;break;case Ne:n.push(v.C);n.push(v.D);q=v.C;
        m=v.D;break;case of:Xd(q,m,v.Fd,v.Ye,v.oh,v.Fg,v.yb,v.Gb,.5,n);q=v.C;m=v.D;break;case pf:he(q,m,v.Fd,v.Ye,v.yb,v.Gb,.5,n);q=v.C;m=v.D;break;case qf:A=sf(v,r);y=A.length;if(0===y){n.push(v.la);n.push(v.ra);q=v.la;m=v.ra;break}for(var K=0;K<y;K++){var E=A[K];Xd(q,m,E[2],E[3],E[4],E[5],E[6],E[7],.5,n);q=E[6];m=E[7]}break;case rf:A=tf(v,r,q,m);y=A.length;if(0===y){n.push(v.la);n.push(v.ra);q=v.la;m=v.ra;break}for(K=0;K<y;K++)E=A[K],Xd(q,m,E[2],E[3],E[4],E[5],E[6],E[7],.5,n),q=E[6],m=E[7];break;default:w.k("Segment not of valid type: "+
        v.na)}v.Sh&&(n.push(p),n.push(s),iq(a,n,k,this.wf))}iq(a,n,k,this.wf);w.ta(n);null!==this.rc&&(q=n=r=0,c&&e&&(r=a.shadowOffsetX,n=a.shadowOffsetY,q=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),a.Dj(),c&&e&&(a.shadowOffsetX=r,a.shadowOffsetY=n,a.shadowBlur=q))}}d&&a.iA();if(null!==this.Sx){d=this.Sx;xk(d,Infinity,Infinity);k=d.za;d.jc(0,0,k.width,k.height);c=this.kf;a.save();a.beginPath();k=w.cb();if(c.type===Ge)k.push(c.ha),k.push(c.fa),k.push(c.C),k.push(c.D),hq(a,b,k,d);else if(c.type===
        De)for(h=c.fc.i;h.next();){l=h.value;k.length=0;k.push(l.ha);k.push(l.fa);f=l.ha;r=l.fa;n=f;q=r;m=l.vb.n;p=m.length;for(s=0;s<p;s++){u=m[s];switch(u.na){case nf:hq(a,b,k,d);k.length=0;k.push(u.C);k.push(u.D);f=u.C;r=u.D;n=f;q=r;break;case Ne:k.push(u.C);k.push(u.D);f=u.C;r=u.D;break;case of:Xd(f,r,u.Fd,u.Ye,u.oh,u.Fg,u.yb,u.Gb,.5,k);f=u.C;r=u.D;break;case pf:he(f,r,u.Fd,u.Ye,u.yb,u.Gb,.5,k);f=u.C;r=u.D;break;case qf:c=sf(u,l);e=c.length;if(0===e){k.push(u.la);k.push(u.ra);f=u.la;r=u.ra;break}for(x=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 0;x<e;x++)t=c[x],Xd(f,r,t[2],t[3],t[4],t[5],t[6],t[7],.5,k),f=t[6],r=t[7];break;case rf:c=tf(u,l,f,r);e=c.length;if(0===e){k.push(u.la);k.push(u.ra);f=u.la;r=u.ra;break}for(x=0;x<e;x++)t=c[x],Xd(f,r,t[2],t[3],t[4],t[5],t[6],t[7],.5,k),f=t[6],r=t[7];break;default:w.k("Segment not of valid type: "+u.na)}u.Sh&&(k.push(n),k.push(q),hq(a,b,k,d))}hq(a,b,k,d)}else if(c.type===He)k.push(c.ha),k.push(c.fa),k.push(c.C),k.push(c.fa),k.push(c.C),k.push(c.D),k.push(c.ha),k.push(c.D),k.push(c.ha),k.push(c.fa),
        hq(a,b,k,d);else if(c.type===Le){h=new Ee;h.ha=c.C;h.fa=(c.fa+c.D)/2;f=new xf(qf);f.ze=0;f.rf=360;f.la=(c.ha+c.C)/2;f.ra=(c.fa+c.D)/2;f.radiusX=Math.abs(c.ha-c.C)/2;f.radiusY=Math.abs(c.fa-c.D)/2;h.add(f);c=sf(f,h);e=c.length;if(0===e)k.push(f.la),k.push(f.ra);else for(f=h.ha,r=h.fa,x=0;x<e;x++)t=c[x],Xd(f,r,t[2],t[3],t[4],t[5],t[6],t[7],.5,k),f=t[6],r=t[7];hq(a,b,k,d)}w.ta(k);a.restore();a.Fe(!1)}}}};
    function iq(a,b,c,d){var e=b.length;if(!(4>e)){var f=.001,h=c.length,k=b[0],l=b[1];if(4===e)yo(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=f=0,n=0,p=0,q=0,r=p=0,s=w.cb(),u=2;u<e;u+=2)f=b[u],m=b[u+1],n=f-k,p=m-l,0===n&&(n=.001),q=p/n,p=Math.sqrt(n*n+p*p),s.push([n,q,p]),r+=p,k=f,l=m;k=b[0];l=b[1];b=0;for(var e=!0,f=c[b%h],m=0!==d,u=0,p=s[u],n=p[0],q=p[1],p=p[2],t=0;.1<=r;){0===t&&(f=c[b%h],b++,m&&(d%=f,f-=d,m=!1));f>r&&(f=r);f>p?(t=f-p,f=p):t=0;var x=Math.sqrt(f*f/(1+q*q));0>n&&(x=-x);k+=x;l+=
        q*x;e?a.lineTo(k,l):a.moveTo(k,l);r-=f;p-=f;if(0!==t){u++;if(u===s.length){w.ta(s);return}p=s[u];n=p[0];q=p[1];p=p[2];f=t}else e=!e}w.ta(s)}}}X.prototype.getDocumentPoint=X.prototype.Wa=function(a,b){void 0===b&&(b=new z);if(a instanceof L){a.Sd()&&w.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ja,d=this.lb;b.m(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY)}else b.set(a);this.rh.nb(b);return b};
    X.prototype.wk=function(a,b){var c=this.kf;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.gb,e=this.lb/2;c.type!==Ge||b||(e+=2);var f=w.Jf();f.assign(d);f.Af(e+2,e+2);if(!f.Ia(a))return w.Db(f),!1;d=e+1E-4;if(c.type===Ge){if(null===this.stroke)return!1;d=(c.C-c.ha)*(a.x-c.ha)+(c.D-c.fa)*(a.y-c.fa);if(0>(c.ha-c.C)*(a.x-c.C)+(c.fa-c.D)*(a.y-c.D)||0>d)return!1;w.Db(f);return Ud(c.ha,c.fa,c.C,c.D,e,a.x,a.y)}if(c.type===He){var h=c.ha,k=c.fa,l=c.C,m=c.D;f.x=Math.min(h,l);f.y=Math.min(k,
        m);f.width=Math.abs(l-h);f.height=Math.abs(m-k);if(null===this.fill){f.Af(-d,-d);if(f.Ia(a))return w.Db(f),!1;f.Af(d,d)}null!==this.stroke&&f.Af(e,e);e=f.Ia(a);w.Db(f);return e}if(c.type===Le){var h=c.ha,k=c.fa,l=c.C,m=c.D,c=Math.min(h,l),n=Math.min(k,m),h=Math.abs(l-h)/2,k=Math.abs(m-k)/2,c=a.x-(c+h),n=a.y-(n+k);if(null===this.fill){h-=d;k-=d;if(0>=h||0>=k||1>=c*c/(h*h)+n*n/(k*k))return w.Db(f),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);w.Db(f);return 0>=h||0>=k?!1:1>=c*c/(h*h)+n*n/(k*k)}if(c.type===
        De)return w.Db(f),null===this.fill?vf(c,a.x,a.y,e):c.Ia(a,e,1<this.lb,b);w.k("Unknown Geometry type: "+c.type);return!1};
    X.prototype.Pn=function(a,b,c,d){var e=this.Ca,f=this.ji;a=Math.max(a,0);b=Math.max(b,0);var h;if(null!==this.Tf)h=this.kf.gb;else{var k=this.Cb,l=Qd[k];if(void 0===l){var m=jq[k];"string"===typeof m&&(m=jq[m]);"function"===typeof m?(l=m(null,100,100),Qd[k]=l):w.k("Unsupported Figure: "+k)}h=l.gb}var k=h.width,l=h.height,m=h.width,n=h.height;switch(Eo(this,!0)){case Oj:d=c=0;break;case Fe:m=Math.max(a-f,0);n=Math.max(b-f,0);break;case qo:m=Math.max(a-f,0);d=0;break;case po:c=0,n=Math.max(b-f,0)}isFinite(e.width)&&
    (m=e.width);isFinite(e.height)&&(n=e.height);e=this.Gf;h=this.si;c=Math.max(c,h.width)-f;d=Math.max(d,h.height)-f;m=Math.min(e.width,m);n=Math.min(e.height,n);m=isFinite(m)?Math.max(c,m):Math.max(k,c);n=isFinite(n)?Math.max(d,n):Math.max(l,d);c=Pj(this);switch(c){case Oj:break;case Fe:k=m;l=n;break;case Qj:c=Math.min(m/k,n/l);isFinite(c)||(c=1);k*=c;l*=c;break;default:w.k(c+" is not a valid geometryStretch.")}null!==this.Tf?(k=Math.max(k,.01),l=Math.max(l,.01),h=null!==this.Tf?this.Tf:this.Ua,e=k,
        d=l,c=h.copy(),h=h.gb,e/=h.width,d/=h.height,isFinite(e)||(e=1),isFinite(d)||(d=1),1===e&&1===d||c.scale(e,d),this.Ua=c):null!==this.Ua&&Wa(this.Ua.Qo,a-f)&&Wa(this.Ua.Oo,b-f)||(this.Ua=X.makeGeometry(this,k,l));h=this.Ua.gb;Infinity===a||Infinity===b?Bo(this,h.x-f/2,h.y-f/2,0===a&&0===k?0:h.width+f,0===b&&0===l?0:h.height+f):Bo(this,-(f/2),-(f/2),m+f,n+f)};
    function Qp(a,b,c,d){if(!1!==Cm(a)){a.sd.Qa();var e=a.ji;0===e&&d instanceof kh&&d.type===hj&&d.sb instanceof X&&(e=d.sb.lb);e*=a.ub;d instanceof W&&null!==d.Ua?(b=d.Ua.gb,Bo(a,b.x-e/2,b.y-e/2,b.width+e,b.height+e)):Bo(a,-(e/2),-(e/2),b+e,c+e);a.sd.freeze();a.sd.I()||w.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.sd.toString());am(a,!1)}}function Pj(a){var b=a.rA;return null!==a.Tf?b===oo?Fe:b:b===oo?Qd[a.Cb].be:b}X.prototype.jj=function(a,b,c,d){Go(this,a,b,c,d)};
    X.prototype.getNearestIntersectionPoint=X.prototype.aF=function(a,b,c){return this.Dn(a.x,a.y,b.x,b.y,c)};
    X.prototype.Dn=function(a,b,c,d,e){var f=this.transform,h=1/(f.m11*f.m22-f.m12*f.m21),k=f.m22*h,l=-f.m12*h,m=-f.m21*h,n=f.m11*h,p=h*(f.m21*f.dy-f.m22*f.dx),q=h*(f.m12*f.dx-f.m11*f.dy),f=a*k+b*m+p,h=a*l+b*n+q,k=c*k+d*m+p,l=c*l+d*n+q,m=this.lb/2,p=this.Ua;null===p&&(xk(this,Infinity,Infinity),p=this.Ua);q=p.gb;n=!1;if(p.type===Ge)if(1.5>=this.lb)n=ke(p.zc,p.Ic,p.yb,p.Gb,f,h,k,l,e);else{var r=0,s=0;p.zc===p.yb?(r=m,s=0):(b=(p.Gb-p.Ic)/(p.yb-p.zc),s=m/Math.sqrt(1+b*b),r=s*b);d=w.cb();b=new z;ke(p.zc+
        r,p.Ic+s,p.yb+r,p.Gb+s,f,h,k,l,b)&&d.push(b);b=new z;ke(p.zc-r,p.Ic-s,p.yb-r,p.Gb-s,f,h,k,l,b)&&d.push(b);b=new z;ke(p.zc+r,p.Ic+s,p.zc-r,p.Ic-s,f,h,k,l,b)&&d.push(b);b=new z;ke(p.yb+r,p.Gb+s,p.yb-r,p.Gb-s,f,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return w.ta(d),!1;n=!0;s=Infinity;for(r=0;r<b;r++){var k=d[r],u=(k.x-f)*(k.x-f)+(k.y-h)*(k.y-h);u<s&&(s=u,e.x=k.x,e.y=k.y)}w.ta(d)}else if(p.type===He)b=q.x-m,n=le(b,q.y-m,q.x+q.width+m,q.y+q.height+m,f,h,k,l,e);else if(p.type===Le)a:if(b=q.copy().Af(m,
            m),0===b.width)n=ke(b.x,b.y,b.x,b.y+b.height,f,h,k,l,e);else if(0===b.height)n=ke(b.x,b.y,b.x+b.width,b.y,f,h,k,l,e);else{a=b.width/2;var t=b.height/2;d=b.x+a;b=b.y+t;c=9999;f!==k&&(c=(h-l)/(f-k));if(9999>Math.abs(c)){n=h-b-c*(f-d);if(0>a*a*c*c+t*t-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+t*t-n*n);k=(-(a*a*c*n)+a*t*m)/(t*t+a*a*c*c)+d;a=(-(a*a*c*n)-a*t*m)/(t*t+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((f-k)*(f-k))+Math.abs((h-l)*(h-l));h=Math.abs((f-a)*(f-a))+Math.abs((h-b)*(h-
            b));d<h?(e.x=k,e.y=l):(e.x=a,e.y=b)}else{k=t*t;l=f-d;k-=k/(a*a)*l*l;if(0>k){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(k);l=b+m;b-=m;d=Math.abs(l-h);h=Math.abs(b-h);d<h?(e.x=f,e.y=l):(e.x=f,e.y=b)}n=!0}else if(p.type===De){var x=0,v=0,A=u=0,q=w.K(),r=k-f,s=l-h,s=r*r+s*s;e.x=k;e.y=l;for(r=0;r<p.fc.count;r++)for(var y=p.fc.n[r],K=y.vb,x=y.ha,v=y.fa,E=x,P=v,$=0;$<K.count;$++){var S=K.n[$],ba=S.type,u=S.C,A=S.D,ga=!1;switch(ba){case nf:E=u;P=A;break;case Ne:ga=kq(x,v,u,A,f,h,k,l,q);break;case of:var ga=
        S.uc,ba=S.Qc,ya=S.Ch,Fa=S.Dh,ga=ie(x,v,ga,ba,ya,Fa,u,A,f,h,k,l,.5,q);break;case pf:ga=(x+2*S.uc)/3;ba=(v+2*S.Qc)/3;ya=(2*S.uc+u)/3;Fa=(2*S.uc+u)/3;ga=ie(x,v,ga,ba,ya,Fa,u,A,f,h,k,l,.5,q);break;case qf:case rf:ba=S.type===qf?sf(S,y):tf(S,y,x,v);ya=ba.length;if(0===ya){ga=kq(x,v,S.la,S.ra,f,h,k,l,q);break}for(A=0;A<ya;A++)t=ba[A],0===A&&kq(x,v,t[0],t[1],f,h,k,l,q)&&(u=lq(f,h,q,s,e),u<s&&(s=u,n=!0)),ie(t[0],t[1],t[2],t[3],t[4],t[5],t[6],t[7],f,h,k,l,.5,q)&&(u=lq(f,h,q,s,e),u<s&&(s=u,n=!0));u=t[6];A=
        t[7];break;default:w.k("Unknown Segment type: "+ba)}x=u;v=A;ga&&(u=lq(f,h,q,s,e),u<s&&(s=u,n=!0));S.xx&&(u=E,A=P,kq(x,v,u,A,f,h,k,l,q)&&(u=lq(f,h,q,s,e),u<s&&(s=u,n=!0)))}f=c-a;h=d-b;b=Math.sqrt(f*f+h*h);0!==b&&(f/=b,h/=b);e.x-=f*m;e.y-=h*m;w.v(q)}else w.k("Unknown Geometry type: "+p.type);if(!n)return!1;this.transform.nb(e);return!0};function lq(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}
    function kq(a,b,c,d,e,f,h,k,l){var m=!1,n=(e-h)*(b-d)-(f-k)*(a-c);if(0===n)return!1;l.x=((e*k-f*h)*(a-c)-(e-h)*(a*d-b*c))/n;l.y=((e*k-f*h)*(b-d)-(f-k)*(a*d-b*c))/n;(a>c?a-c:c-a)<(b>d?b-d:d-b)?(e=b<d?b:d,a=b<d?d:b,(l.y>e||Wa(l.y,e))&&(l.y<a||Wa(l.y,a))&&(m=!0)):(e=a<c?a:c,a=a<c?c:a,(l.x>e||Wa(l.x,e))&&(l.x<a||Wa(l.x,a))&&(m=!0));return m}
    X.prototype.containedInRect=X.prototype.tn=function(a,b){if(void 0===b)return a.xk(this.W);var c=this.Ua;null===c&&(xk(this,Infinity,Infinity),c=this.Ua);var c=c.gb,d=this.lb/2,e=!1,f=w.K();f.m(c.x-d,c.y-d);a.Ia(b.nb(f))&&(f.m(c.x-d,c.bottom+d),a.Ia(b.nb(f))&&(f.m(c.right+d,c.bottom+d),a.Ia(b.nb(f))&&(f.m(c.right+d,c.y-d),a.Ia(b.nb(f))&&(e=!0))));w.v(f);return e};
    X.prototype.intersectsRect=X.prototype.Zf=function(a,b){if(this.tn(a,b)||void 0===b&&(b=this.transform,a.xk(this.W)))return!0;var c=w.Kf();c.set(b);c.vx();var d=a.left,e=a.right,f=a.top,h=a.bottom,k=w.K();k.m(d,f);c.nb(k);if(this.wk(k,!0))return w.v(k),!0;k.m(e,f);c.nb(k);if(this.wk(k,!0))return w.v(k),!0;k.m(d,h);c.nb(k);if(this.wk(k,!0))return w.v(k),!0;k.m(e,h);c.nb(k);if(this.wk(k,!0))return w.v(k),!0;var l=w.K(),m=w.K();c.set(b);c.KF(this.transform);c.vx();l.x=e;l.y=f;l.transform(c);k.x=d;k.y=
        f;k.transform(c);var n=!1;mq(this,k,l,m)?n=!0:(k.x=e,k.y=h,k.transform(c),mq(this,k,l,m)?n=!0:(l.x=d,l.y=h,l.transform(c),mq(this,k,l,m)?n=!0:(k.x=d,k.y=f,k.transform(c),mq(this,k,l,m)&&(n=!0))));w.v(k);w.we(c);w.v(l);w.v(m);return n};function mq(a,b,c,d){if(!a.aF(b,c,d))return!1;a=b.x;b=b.y;var e=c.x;c=c.y;var f=d.x;d=d.y;if(a===e){var h=0;a=0;b<c?(h=b,a=c):(h=c,a=b);return d>=h&&d<=a}a<e?(h=a,a=e):h=e;return f>=h&&f<=a}
    X.prototype.UE=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.Pp(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.wk(a,!0))return!0;var e=a.zf(b);b=e;1.5<this.lb&&(e=this.lb/2+Math.sqrt(e),e*=e);var f=this.Ua;if(null===f&&(xk(this,Infinity,Infinity),f=this.Ua,null===f))return!1;if(!c){var h=f.gb,k=h.x,l=h.y,m=h.x+h.width,h=h.y+h.height;if(Sa(a.x,a.y,k,l)<=e&&Sa(a.x,a.y,m,l)<=e&&Sa(a.x,a.y,k,h)<=e&&Sa(a.x,a.y,m,h)<=e)return!0}k=f.zc;l=f.Ic;m=f.yb;h=f.Gb;if(f.type===
        Ge){if(c=Ra(a.x,a.y,k,l,m,h),f=(k-m)*(a.x-m)+(l-h)*(a.y-h),c<=(0<=(m-k)*(a.x-k)+(h-l)*(a.y-l)&&0<=f?e:b))return!0}else{if(f.type===He)return b=!1,c&&(b=Ra(a.x,a.y,k,l,k,h)<=e||Ra(a.x,a.y,k,l,m,l)<=e||Ra(a.x,a.y,m,l,m,h)<=e||Ra(a.x,a.y,k,h,m,h)<=e),b;if(f.type===Le){b=a.x-(k+m)/2;var f=a.y-(l+h)/2,n=Math.abs(m-k)/2,p=Math.abs(h-l)/2;if(0===n||0===p)return c=Ra(a.x,a.y,k,l,m,h),c<=e?!0:!1;if(c){if(a=Be(n,p,b,f),a*a<=e)return!0}else return Sa(b,f,-n,0)>=e||Sa(b,f,0,-p)>=e||Sa(b,f,0,p)>=e||Sa(b,f,n,0)>=
    e?!1:!0}else if(f.type===De){h=f.gb;k=h.x;l=h.y;m=h.x+h.width;h=h.y+h.height;if(a.x>m&&a.x<k&&a.y>h&&a.y<l&&Ra(a.x,a.y,k,l,k,h)>e&&Ra(a.x,a.y,k,l,m,l)>e&&Ra(a.x,a.y,m,h,k,h)>e&&Ra(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?vf(f,a.x,a.y,b):f.Ia(a,b,!0))return!0}else{c=f.fc;for(b=0;b<c.count;b++){k=c.n[b];n=k.ha;p=k.fa;if(a.Pp(n,p)>e)return!1;l=k.vb.n;m=l.length;for(h=0;h<m;h++){var q=l[h];switch(q.type){case nf:case Ne:n=q.C;p=q.D;if(a.Pp(n,p)>e)return!1;break;case of:f=w.cb();
        Xd(n,p,q.uc,q.Qc,q.Ch,q.Dh,q.C,q.D,.8,f);n=d(f,a);w.ta(f);if(n)return!1;n=q.C;p=q.D;if(a.Pp(n,p)>e)return!1;break;case pf:f=w.cb();he(n,p,q.uc,q.Qc,q.C,q.D,.8,f);n=d(f,a);w.ta(f);if(n)return!1;n=q.C;p=q.D;if(a.Pp(n,p)>e)return!1;break;case qf:case rf:var r=q.type===qf?sf(q,k):tf(q,k,n,p),s=r.length;if(0===s){n=q.la;p=q.ra;if(a.Pp(n,p)>e)return!1;break}q=null;f=w.cb();for(b=0;b<s;b++)if(q=r[b],f.length=0,Xd(q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],.8,f),d(f,a))return w.ta(f),!1;w.ta(f);null!==q&&(n=
        q[6],p=q[7]);break;default:w.k("Unknown Segment type: "+q.type)}}}return!0}}}return!1};w.defineProperty(X,{kf:"geometry"},function(){return null!==this.Ua?this.Ua:this.Tf},function(a){var b=this.Ua;if(b!==a){this.Tf=null!==a?this.Ua=a.freeze():this.Ua=null;var c=this.U;null!==c&&(c.ck=NaN);this.H();this.h("geometry",b,a);zo(this)&&(a=this.U,null!==a&&Ao(this,a,"geometryString"))}});
    w.defineProperty(X,{ZH:"geometryString"},function(){return null===this.kf?"":this.kf.toString()},function(a){a=Pe(a);var b=a.normalize();this.kf=a;this.position=a=w.xb(-b.x,-b.y);w.v(a)});w.defineProperty(X,{rF:"isGeometryPositioned"},function(){return this.Jr},function(a){var b=this.Jr;b!==a&&(this.Jr=a,this.H(),this.h("isGeometryPositioned",b,a))});X.prototype.Me=function(){this.Ua=null};
    w.defineProperty(X,{fill:"fill"},function(){return this.Dd},function(a){var b=this.Dd;b!==a&&(a instanceof ha&&a.freeze(),this.Dd=a,this.oa(),this.h("fill",b,a))});w.defineProperty(X,{stroke:"stroke"},function(){return this.rc},function(a){var b=this.rc;b!==a&&(a instanceof ha&&a.freeze(),this.rc=a,this.oa(),this.h("stroke",b,a))});
    w.defineProperty(X,{lb:"strokeWidth"},function(){return this.ji},function(a){var b=this.ji;if(b!==a)if(0<=a){this.ji=a;this.H();var c=this.U;null!==c&&(c.ck=NaN);this.h("strokeWidth",b,a)}else w.Fa(a,"value >= 0",X,"strokeWidth:value")});w.defineProperty(X,{QL:"strokeCap"},function(){return this.rp},function(a){var b=this.rp;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?w.Fa(a,'"butt", "round", or "square"',X,"strokeCap"):(this.rp=a,this.oa(),this.h("strokeCap",b,a)))});
    w.defineProperty(X,{SL:"strokeJoin"},function(){return this.tp},function(a){var b=this.tp;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?w.Fa(a,'"miter", "bevel", or "round"',X,"strokeJoin"):(this.tp=a,this.oa(),this.h("strokeJoin",b,a)))});w.defineProperty(X,{TL:"strokeMiterLimit"},function(){return this.gn},function(a){var b=this.gn;if(b!==a)if(1<=a){this.gn=a;this.oa();var c=this.U;null!==c&&(c.ck=NaN);this.h("strokeMiterLimit",b,a)}else w.Fa(a,"value >= 1",X,"strokeWidth:value")});
    w.defineProperty(X,{tG:"strokeDashArray"},function(){return this.sp},function(a){var b=this.sp;if(b!==a){null===a||Array.isArray(a)||w.Bd(a,"Array",X,"strokeDashArray: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)||w.k("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.sp=a;this.oa();this.h("strokeDashArray",b,a)}});
    w.defineProperty(X,{RL:"strokeDashOffset"},function(){return this.wf},function(a){var b=this.wf;b!==a&&0<=a&&(this.wf=a,this.oa(),this.h("strokeDashOffset",b,a))});w.defineProperty(X,{Cb:"figure"},function(){return this.Go},function(a){var b=this.Go;if(b!==a){var c=jq[a];"function"===typeof c?c=a:(c=jq[a.toLowerCase()])||w.k("Unknown Shape.figure: "+a);b!==c&&(a=this.U,null!==a&&(a.ck=NaN),this.Go=c,this.Tf=null,this.Me(),this.H(),this.h("figure",b,c))}});
    w.defineProperty(X,{yq:"toArrow"},function(){return this.yp},function(a){var b=this.yp;!0===a?a="Standard":!1===a&&(a="");if(b!==a){var c=nq(a);null===c?w.k("Unknown Shape.toArrow: "+a):b!==c&&(this.yp=c,this.Tf=null,this.Me(),this.H(),oq(this),this.h("toArrow",b,c))}});
    w.defineProperty(X,{pA:"fromArrow"},function(){return this.Io},function(a){var b=this.Io;!0===a?a="Standard":!1===a&&(a="");if(b!==a){var c=nq(a);null===c?w.k("Unknown Shape.fromArrow: "+a):b!==c&&(this.Io=c,this.Tf=null,this.Me(),this.H(),oq(this),this.h("fromArrow",b,c))}});function oq(a){var b=a.g;null!==b&&b.ia.ab||(a.qq=pq,"None"!==a.yp?(a.Oe=-1,a.qh=Ic):"None"!==a.Io&&(a.Oe=0,a.qh=new L(1-Ic.x,Ic.y)))}
    w.defineProperty(X,{A:"spot1"},function(){return this.hi},function(a){w.G(a,L,X,"spot1");var b=this.hi;b.L(a)||(this.hi=a=a.S(),this.H(),this.h("spot1",b,a))});w.defineProperty(X,{B:"spot2"},function(){return this.ii},function(a){w.G(a,L,X,"spot2");var b=this.ii;b.L(a)||(this.ii=a=a.S(),this.H(),this.h("spot2",b,a))});w.defineProperty(X,{Ec:"parameter1"},function(){return this.zs},function(a){var b=this.zs;b!==a&&(this.zs=a,this.Me(),this.H(),this.h("parameter1",b,a))});
    w.defineProperty(X,{zu:"parameter2"},function(){return this.As},function(a){var b=this.As;b!==a&&(this.As=a,this.Me(),this.H(),this.h("parameter2",b,a))});w.u(X,{Ja:"naturalBounds"},function(){if(null!==this.Ua)return this.Uc.assign(this.Ua.gb),this.Uc;var a=this.Ca;return new B(0,0,a.width,a.height)});w.defineProperty(X,{Sx:"pathPattern"},function(){return this.Cs},function(a){var b=this.Cs;b!==a&&(this.Cs=a,this.oa(),this.h("pathPattern",b,a))});
    w.defineProperty(X,{GL:"pathObject"},function(){return this.Sx},function(a){this.Sx=a});w.defineProperty(X,{rA:"geometryStretch"},function(){return this.zr},function(a){var b=this.zr;b!==a&&(w.mb(a,G,X,"geometryStretch"),this.zr=a,this.h("geometryStretch",b,a))});
    w.defineProperty(X,{interval:"interval"},function(){return this.wg},function(a){var b=this.wg;a=Math.floor(a);if(b!==a&&0<=a){this.wg=a;var c=this.g;null!==c&&this.Q===c.Fn&&bm(c);this.H();c=this.Q;null!==c&&c.type===ip&&(c.Uj=null);this.h("interval",b,a)}});w.defineProperty(X,{eF:"graduatedStart"},function(){return this.vg},function(a){var b=this.vg;b!==a&&(0>a?a=0:1<a&&(a=1),this.vg=a,this.H(),this.h("graduatedStart",b,a))});
    w.defineProperty(X,{cF:"graduatedEnd"},function(){return this.ug},function(a){var b=this.ug;b!==a&&(0>a?a=0:1<a&&(a=1),this.ug=a,this.H(),this.h("graduatedEnd",b,a))});X.makeGeometry=function(a,b,c){var d=null;if("None"!==a.yq)d=Rd[a.yq];else if("None"!==a.pA)d=Rd[a.pA];else{var e=jq[a.Cb];"string"===typeof e&&(e=jq[e]);void 0===e&&w.k("Unknown Shape.figure: "+a.Cb);d=e(a,b,c);d.Qo=b;d.Oo=c}null===d&&(e=jq.Rectangle,"function"===typeof e&&(d=e(a,b,c)));return d};
    X.getFigureGenerators=function(){var a=new ma("string","function"),b;for(b in jq)if(b!==b.toLowerCase()){var c=jq[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};
    X.defineFigureGenerator=function(a,b){w.j(a,"string",X,"defineFigureGenerator:name");"string"===typeof b?""!==b&&jq[b]||w.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):w.j(b,"function",X,"defineFigureGenerator:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||w.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);jq[a]=b;jq[c]=a};
    X.getArrowheadGeometries=function(){var a=new ma("string",Ce),b;for(b in qq)if(void 0===Rd[b]){var c=Pe(qq[b],!1);Rd[b]=c;c=b.toLowerCase();c!==b&&(Rd[c]=b)}for(b in Rd)b!==b.toLowerCase()&&(c=Rd[b],c instanceof Ce&&a.add(b,c));a.freeze();return a};
    X.defineArrowheadGeometry=function(a,b){w.j(a,"string",X,"defineArrowheadGeometry:name");var c=null;"string"===typeof b?(w.j(b,"string",X,"defineArrowheadGeometry:pathstr"),c=Pe(b,!1)):(w.G(b,Ce,X,"defineArrowheadGeometry:pathstr"),c=b);var d=a.toLowerCase();""!==a&&"none"!==d&&a!==d||w.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);Rd[a]=c;Rd[d]=a};
    function Lh(){G.call(this);this.Jd="";this.rc="black";this.sg="13px sans-serif";this.Bl="start";this.rg=Oj;this.Fl=yc;this.Hm=!0;this.Yj=this.Zj=!1;this.Zi=rq;this.rk=sq;this.Zv=this.le=0;this.rz=this.sz=null;this.vf=new Wp;this.sr=!1;this.Ve=this.Sq=this.lt=this.Cl=this.mt=null;this.gi=this.fi=0;this.hh=Infinity;this.Wo=0;this.wg=1;this.vg=0;this.ug=1;this.Dm=null}w.Ka(Lh,G);w.ga("TextBlock",Lh);var tq=/[ \u200b\u00ad]/;
    Lh.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.Jd=this.Jd;a.rc=this.rc;a.sg=this.sg;a.Bl=this.Bl;a.rg=this.rg;a.Fl=this.Fl;a.Hm=this.Hm;a.Zj=this.Zj;a.Yj=this.Yj;a.Zi=this.Zi;a.rk=this.rk;a.le=this.le;a.Zv=this.Zv;a.sz=this.sz;a.rz=this.rz;a.vf.Jp(this.vf);a.sr=this.sr;a.mt=this.mt;a.Cl=this.Cl;a.lt=this.lt;a.Sq=this.Sq;a.Ve=this.Ve;a.fi=this.fi;a.gi=this.gi;a.hh=this.hh;a.Wo=this.Wo;a.wg=this.wg;a.vg=this.vg;a.ug=this.ug;a.Dm=this.Dm};
    Lh.prototype.ic=function(a){a.Ee===Lh?this.HG=a:G.prototype.ic.call(this,a)};Lh.prototype.toString=function(){return 22<this.Jd.length?'TextBlock("'+this.Jd.substring(0,20)+'"...)':'TextBlock("'+this.Jd+'")'};var uq=new ra,vq=0,wq=new ra,xq=0,yq="...",zq="",Aq=(new Wc(null)).yk;Lh.getEllipsis=function(){return yq};Lh.setEllipsis=function(a){yq=a;wq=new ra;xq=0};var Bq;Lh.None=Bq=w.p(Lh,"None",0);var Cq;Lh.WrapFit=Cq=w.p(Lh,"WrapFit",1);var sq;Lh.WrapDesiredSize=sq=w.p(Lh,"WrapDesiredSize",2);var rq;
    Lh.OverflowClip=rq=w.p(Lh,"OverflowClip",0);var Dq;Lh.OverflowEllipsis=Dq=w.p(Lh,"OverflowEllipsis",1);Lh.prototype.H=function(){G.prototype.H.call(this);this.rz=this.sz=null};w.defineProperty(Lh,{font:"font"},function(){return this.sg},function(a){var b=this.sg;b!==a&&(this.sg=a,this.vf.Pj=null,this.H(),this.h("font",b,a))});
    Lh.isValidFont=function(a){var b=Aq.font;if(a===b||"10px sans-serif"===a)return!0;Aq.font="10px sans-serif";var c;Aq.font=a;var d=Aq.font;if("10px sans-serif"!==d)return Aq.font=b,!0;Aq.font="19px serif";c=Aq.font;Aq.font=a;d=Aq.font;Aq.font=b;return d!==c};w.defineProperty(Lh,{text:"text"},function(){return this.Jd},function(a){var b=this.Jd;a=null!==a&&void 0!==a?a.toString():"";b!==a&&(this.Jd=a,this.H(),this.h("text",b,a))});
    w.defineProperty(Lh,{textAlign:"textAlign"},function(){return this.Bl},function(a){var b=this.Bl;b!==a&&("start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.Bl=a,this.oa(),this.h("textAlign",b,a)):w.Fa(a,'"start", "end", "left", "right", or "center"',Lh,"textAlign"))});w.defineProperty(Lh,{Tt:"flip"},function(){return this.rg},function(a){var b=this.rg;b!==a&&(w.mb(a,G,Lh,"flip"),this.rg=a,this.oa(),this.h("flip",b,a))});
    w.defineProperty(Lh,{ZL:"verticalAlignment"},function(){return this.Fl},function(a){var b=this.Fl;b.L(a)||(a.Sd()&&w.k("TextBlock.verticalAlignment for "+this+" must be a real Spot, not:"+a),this.Fl=a=a.S(),Ro(this),this.h("verticalAlignment",b,a))});w.u(Lh,{Ja:"naturalBounds"},function(){if(!this.Uc.I()){var a=Eq(this,this.Jd,this.vf,999999).width,b=Fq(this,a,this.vf),c=this.Ca;isNaN(c.width)||(a=c.width);isNaN(c.height)||(b=c.height);Ua(this.Uc,a,b)}return this.Uc});
    w.defineProperty(Lh,{Cx:"isMultiline"},function(){return this.Hm},function(a){var b=this.Hm;b!==a&&(this.Hm=a,this.H(),this.h("isMultiline",b,a))});w.defineProperty(Lh,{gL:"isUnderline"},function(){return this.Zj},function(a){var b=this.Zj;b!==a&&(this.Zj=a,this.oa(),this.h("isUnderline",b,a))});w.defineProperty(Lh,{fL:"isStrikethrough"},function(){return this.Yj},function(a){var b=this.Yj;b!==a&&(this.Yj=a,this.oa(),this.h("isStrikethrough",b,a))});
    w.defineProperty(Lh,{HG:"wrap"},function(){return this.rk},function(a){var b=this.rk;b!==a&&(this.rk=a,this.H(),this.h("wrap",b,a))});w.defineProperty(Lh,{overflow:"overflow"},function(){return this.Zi},function(a){var b=this.Zi;b!==a&&(this.Zi=a,this.H(),this.h("overflow",b,a))});w.defineProperty(Lh,{stroke:"stroke"},function(){return this.rc},function(a){var b=this.rc;b!==a&&(a instanceof ha&&a.freeze(),this.rc=a,this.oa(),this.h("stroke",b,a))});w.u(Lh,{IA:"lineCount"},function(){return this.le});
    w.defineProperty(Lh,{kA:"editable"},function(){return this.sr},function(a){var b=this.sr;b!==a&&(this.sr=a,this.h("editable",b,a))});w.defineProperty(Lh,{vG:"textEditor"},function(){return this.mt},function(a){var b=this.mt;b!==a&&(this.mt=a,this.h("textEditor",b,a))});w.defineProperty(Lh,{mA:"errorFunction"},function(){return this.Ve},function(a){var b=this.Ve;b!==a&&(null!==a&&w.j(a,"function",Lh,"errorFunction"),this.Ve=a,this.h("errorFunction",b,a))});
    w.defineProperty(Lh,{interval:"interval"},function(){return this.wg},function(a){var b=this.wg;a=Math.floor(a);if(b!==a&&0<=a){this.wg=a;this.H();var c=this.Q;null!==c&&c.type===ip&&(c.Uj=null);this.h("interval",b,a)}});w.defineProperty(Lh,{eF:"graduatedStart"},function(){return this.vg},function(a){var b=this.vg;b!==a&&(0>a?a=0:1<a&&(a=1),this.vg=a,this.H(),this.h("graduatedStart",b,a))});
    w.defineProperty(Lh,{cF:"graduatedEnd"},function(){return this.ug},function(a){var b=this.ug;b!==a&&(0>a?a=0:1<a&&(a=1),this.ug=a,this.H(),this.h("graduatedEnd",b,a))});w.defineProperty(Lh,{dF:"graduatedFunction"},function(){return this.Dm},function(a){var b=this.Dm;b!==a&&(null!==a&&w.j(a,"function",Lh,"graduatedFunction"),this.Dm=a,this.H(),this.h("graduatedFunction",b,a))});
    Lh.prototype.zk=function(a,b){if(null!==this.rc&&0!==this.Jd.length&&null!==this.sg){var c=this.Ja.width,d=this.Ja.height,e=Gq(this),f=a.textAlign=this.Bl,h=b.Mr;"start"===f&&(f=h?"right":"left");"end"===f&&(f=h?"left":"right");No(this,a,this.rc,!0,!1);(this.Zj||this.Yj)&&No(this,a,this.rc,!1,!1);var k=0,h=!1,l=w.xb(0,0);this.rh.nb(l);var m=w.xb(0,e);this.rh.nb(m);var n=l.zf(m);w.v(l);w.v(m);l=b.scale;8>n*l*l&&(h=!0);b.tf!==a&&(h=!1);!1===b.qj("textGreeking")&&(h=!1);n=this.fi;l=this.gi;switch(this.Tt){case so:a.translate(c,
        0);a.scale(-1,1);break;case ro:a.translate(0,d);a.scale(1,-1);break;case to:a.translate(c,d),a.scale(-1,-1)}var m=this.le,p=(n+e+l)*m;d>p&&(k=this.Fl,k=k.y*d-k.y*p+k.offsetY);for(var p=this.vf,q=0;q<m;q++){var r=p.sf[q],s=p.Se[q];r>c&&(r=c);var k=k+n,u=s,s=a,t=k,x=c,v=e,A=f,y=0;h?("left"===A?y=0:"right"===A?y=x-r:"center"===A&&(y=(x-r)/2),s.fillRect(0+y,t+.25*v,r,1)):("left"===A?y=0:"right"===A?y=x:"center"===A&&(y=x/2),s.fillText(u,0+y,t+v-.25*v),u=v/20|0,0===u&&(u=1),"right"===A?y-=r:"center"===
        A&&(y-=r/2),this.Zj&&(s.beginPath(),s.lineWidth=u,s.moveTo(0+y,t+v-.2*v),s.lineTo(0+y+r,t+v-.2*v),s.stroke()),this.Yj&&(s.beginPath(),s.lineWidth=u,t=t+v-v/2.2|0,0!==u%2&&(t+=.5),s.moveTo(0+y,t),s.lineTo(0+y+r,t),s.stroke()));k+=e+l}switch(this.Tt){case so:a.scale(-1,1);a.translate(-c,0);break;case ro:a.scale(1,-1);a.translate(0,-d);break;case to:a.scale(-1,-1),a.translate(-c,-d)}}};
    Lh.prototype.Pn=function(a,b,c,d){this.Wo=a;var e=this.vf;e.reset();var f=0,h=0;if(isNaN(this.Ca.width)){f=this.Jd.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===f.length)f=0;else if(this.Cx){for(var k=h=0,l=!1;!l;){var m=f.indexOf("\n",k);-1===m&&(m=f.length,l=!0);k=Hq(f.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.sg);k>h&&(h=k);k=m+1}f=h}else h=f.indexOf("\n",0),0<=h&&(f=f.substr(0,h)),f=k=Hq(f,this.sg);f=Math.min(f,a/this.scale);f=Math.max(8,f)}else f=this.Ca.width;null!==this.Q&&(f=Math.min(f,
        this.Q.Gf.width));h=Fq(this,f,e);m=h=isNaN(this.Ca.height)?Math.min(h,b/this.scale):this.Ca.height;if(0!==e.We&&1!==e.Se.length&&this.Zi===Dq&&(b=this.sg,l=this.Zi===Dq?Iq(b):0,k=this.fi+this.gi,k=Math.max(0,Gq(this)+k),m=Math.min(this.SI-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Se.length))){k=e.Se[m];for(a=Math.max(1,a-l);Hq(k,b)>a&&1<k.length;)k=k.substr(0,k.length-1);k+=yq;a=Hq(k,b);e.Se[m]=k;e.Se=e.Se.slice(0,m+1);e.sf[m]=a;e.sf=e.sf.slice(0,m+1);e.hj=e.Se.length;e.We=Math.max(e.We,a);this.le=
        e.hj}if(this.HG===Cq||isNaN(this.Ca.width))f=e.We,isNaN(this.Ca.width)&&(f=Math.max(8,f));f=Math.max(c,f);h=Math.max(d,h);Ua(this.Uc,f,h);Bo(this,0,0,f,h)};Lh.prototype.jj=function(a,b,c,d){Go(this,a,b,c,d)};
    function Eq(a,b,c,d){b=b.replace(/^\s+|\s+$/g,"");var e=0,f=0,h=0,k=a.sg,f=a.fi+a.gi,l=Math.max(0,Gq(a)+f),h=a.Zi===Dq?Iq(k):0;if(a.le>=a.hh)return new ia(0,l);if(a.rk===Bq){c.hj=1;f=Hq(b,k);if(0===h||f<=d)return c.We=Math.max(c.We,f),c.sf.push(c.We),c.Se.push(b),new ia(f,l);var m=Jq(b);b=b.substr(m.length);for(var n=Jq(b),f=Hq(m+n,k);0<n.length&&f<=d;)m+=n,b=b.substr(n.length),n=Jq(b),f=Hq((m+n).replace(/^\s+|\s+$/g,""),k);m+=n.replace(/^\s+|\s+$/g,"");for(d=Math.max(1,d-h);Hq(m,k)>d&&1<m.length;)m=
        m.substr(0,m.length-1);m+=yq;h=Hq(m,k);c.sf.push(h);c.We=h;c.Se.push(m);return new ia(h,l)}var p=0;0===b.length&&(p=1,c.sf.push(0),c.Se.push(b));for(;0<b.length;){m=Jq(b);for(b=b.substr(m.length);Hq(m,k)>d;){n=1;f=Hq(m.substr(0,n),k);for(h=0;f<=d;)n++,h=f,f=Hq(m.substr(0,n),k);1===n?(c.sf[a.le+p]=f,e=Math.max(e,f)):(c.sf[a.le+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Se[a.le+p]=m.substr(0,n);p++;m=m.substr(n);if(a.le+p>a.hh)break}n=Jq(b);for(f=Hq(m+n,k);0<n.length&&f<=d;)m+=n,b=b.substr(n.length),n=
        Jq(b),f=Hq((m+n).replace(/^\s+|\s+$/g,""),k);m=m.replace(/^\s+|\s+$/g,"");if(""!==m&&("\u00ad"===m[m.length-1]&&(m=m.substring(0,m.length-1)+"\u2010"),0===n.length?(c.sf.push(f),e=Math.max(e,f)):(h=Hq(m,k),c.sf.push(h),e=Math.max(e,h)),c.Se.push(m),p++,a.le+p>a.hh))break}c.hj=Math.min(a.hh,p);c.We=Math.max(c.We,e);return new ia(c.We,l*c.hj)}function Jq(a){for(var b=a.length,c=0;c<b&&!tq.test(a.charAt(c));)c++;for(;c<b&&tq.test(a.charAt(c));)c++;return c>=b?a:a.substr(0,c)}
    function Hq(a,b){zq!==b&&(zq=Aq.font=b);return Aq.measureText(a).width}function Gq(a){if(null!==a.vf.Pj)return a.vf.Pj;var b=a.sg;zq!==b&&(zq=Aq.font=b);var c=0;void 0!==uq[b]&&5E3>vq?c=uq[b]:(c=1.3*Aq.measureText("M").width,uq[b]=c,vq++);return a.vf.Pj=c}function Iq(a){zq!==a&&(zq=Aq.font=a);var b=0;void 0!==wq[a]&&5E3>xq?b=wq[a]:(b=Aq.measureText(yq).width,wq[a]=b,xq++);return b}
    function Fq(a,b,c){var d=a.Jd.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.fi+a.gi,e=Math.max(0,Gq(a)+e);if(0===d.length)return c.We=0,a.le=1,e;if(!a.Cx){var f=d.indexOf("\n",0);0<=f&&(d=d.substr(0,f))}for(var f=0,h=a.le=0,k=-1,l=!1;!l;)k=d.indexOf("\n",h),-1===k&&(k=d.length,l=!0),h<=k&&(h=d.substr(h,k-h),a.rk!==Bq?(c.hj=0,h=Eq(a,h,c,b),f+=h.height,a.le+=c.hj):(Eq(a,h,c,b),f+=e,a.le++),a.le===a.hh&&(l=!0)),h=k+1;return a.Zv=f}
    w.defineProperty(Lh,{wB:"textValidation"},function(){return this.Cl},function(a){var b=this.Cl;b!==a&&(null!==a&&w.j(a,"function",Lh,"textValidation"),this.Cl=a,this.h("textValidation",b,a))});w.defineProperty(Lh,{uG:"textEdited"},function(){return this.lt},function(a){var b=this.lt;b!==a&&(null!==a&&w.j(a,"function",Lh,"textEdited"),this.lt=a,this.h("textEdited",b,a))});
    w.defineProperty(Lh,{NL:"spacingAbove"},function(){return this.fi},function(a){var b=this.fi;b!==a&&(this.fi=a,this.h("spacingAbove",b,a))});w.defineProperty(Lh,{OL:"spacingBelow"},function(){return this.gi},function(a){var b=this.gi;b!==a&&(this.gi=a,this.h("spacingBelow",b,a))});w.defineProperty(Lh,{SI:"maxLines"},function(){return this.hh},function(a){var b=this.hh;b!==a&&(a=Math.floor(a),0>=a&&w.Fa(a,"> 0",Lh,"maxLines"),this.hh=a,this.h("maxLines",b,a),this.H())});w.u(Lh,{sL:"metrics"},function(){return this.vf});
    w.defineProperty(Lh,{EK:"choices"},function(){return this.Sq},function(a){var b=this.Sq;b!==a&&(null===a||Array.isArray(a)||w.Bd(a,"Array",Lh,"choices:value"),this.Sq=a,this.h("choices",b,a))});function Wp(){this.We=this.hj=0;this.sf=[];this.Se=[];this.Pj=null}Wp.prototype.reset=function(){this.We=this.hj=0;this.Pj=null;this.sf=[];this.Se=[]};Wp.prototype.Jp=function(a){this.hj=a.hj;this.Pj=a.Pj;this.We=a.We;this.sf=w.Nl(a.sf);this.Se=w.Nl(a.Se)};w.u(Wp,{AK:"arrSize"},function(){return this.sf});
    w.u(Wp,{BK:"arrText"},function(){return this.Se});w.u(Wp,{rL:"maxLineWidth"},function(){return this.We});w.u(Wp,{ZK:"fontHeight"},function(){return this.Pj});function xl(){G.call(this);this.Ue=null;this.et="";this.jk=Nd;this.Lo=Fe;this.ki=this.Ve=null;this.Ko=Jb;this.rg=Oj;this.vp=null;this.mz=!1;this.Av=!0;this.Xv=!1;this.mp=null}w.Ka(xl,G);w.ga("Picture",xl);
    xl.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.element=this.Ue;a.et=this.et;a.jk=this.jk.S();a.Lo=this.Lo;a.rg=this.rg;a.Ve=this.Ve;a.ki=this.ki;a.Ko=this.Ko.S();a.Av=this.Av;a.mp=this.mp};xl.prototype.ic=function(a){a===Oj||a===Qj||a===Rj?this.oI=a:G.prototype.ic.call(this,a)};xl.prototype.toString=function(){return"Picture("+this.source+")#"+w.Od(this)};var Kq=new ra,Lq=0,rl=[];
    function Mq(){var a=rl;if(0===a.length)for(var b=window.document.getElementsByTagName("canvas"),c=b.length,d=0;d<c;d++){var e=b[d];e.parentElement&&e.parentElement.Z&&a.push(e.parentElement.Z)}return a}var Nq;xl.clearCache=Nq=function(a){void 0===a&&(a="");w.j(a,"string",xl,"clearCache:url");""!==a?Kq[a]&&(delete Kq[a],Lq--):(Kq=new ra,Lq=0)};
    w.defineProperty(xl,{element:"element"},function(){return this.Ue},function(a){var b=this.Ue;if(b!==a){null===a||a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||w.k("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);this.mz=a instanceof HTMLCanvasElement;this.Ue=a;if(null!==a)if(a instanceof HTMLCanvasElement||!0===a.complete)a.Jo instanceof Event&&null!==this.Ve&&this.Ve(this,a.Jo),!0===a.Nv&&null!==this.ki&&this.ki(this,a.Cz),
        a.Nv=!0,this.Ca.I()||(am(this,!1),this.H());else{var c=this;a.MC||(a.addEventListener("load",function(b){Oq(a,b);c.Ca.I()||(am(c,!1),c.H())}),a.addEventListener("error",function(b){Pq(a,b)}),a.MC=!0)}this.h("element",b,a);this.oa()}});
    w.defineProperty(xl,{source:"source"},function(){return this.et},function(a){var b=this.et;if(b!==a){w.j(a,"string",xl,"source");this.et=a;var c=Kq,d=this.g;if(void 0!==c[a])var e=c[a].Ep[0].source;else{30<Lq&&(Nq(),c=Kq);var e=w.createElement("img"),f=this;e.addEventListener("load",function(a){Oq(e,a);f.Ca.I()||(am(f,!1),f.H())});e.addEventListener("error",function(a){Pq(e,a)});e.MC=!0;var h=this.mp;null!==h&&(e.crossOrigin=h(this));e.src=a;c[a]=new Qq(e);Lq++}null!==d&&nn(d,this);this.element=e;
        null!==d&&mn(d,this);this.H();this.oa();this.h("source",b,a)}});function Oq(a,b){a.Nv=!0;a.Jo=!1;for(var c=null,d=Mq(),e=d.length,f=0;f<e;f++){var h=d[f],k=h.gp.ka(a.src);if(null!==k)for(var l=k.length,m=0;m<l;m++)c=k[m],h.zz.add(c),h.Ne(),null===a.Cz&&(a.Cz=b,null!==c.ki&&c.ki(c,b))}}function Pq(a,b){a.Jo=b;for(var c=null,d=Mq(),e=d.length,f=0;f<e;f++)if(c=d[f].gp.ka(a.src),null!==c){for(var h=c.length,k=w.cb(),l=0;l<h;l++)k.push(c[l]);for(l=0;l<h;l++)c=k[l],null!==c.Ve&&c.Ve(c,b);w.ta(k)}}
    w.defineProperty(xl,{ML:"sourceCrossOrigin"},function(){return this.mp},function(a){if(this.mp!==a&&(null!==a&&w.j(a,"function",xl,"sourceCrossOrigin"),this.mp=a,null!==this.element)){var b=this.element.src;null===a&&"string"===typeof b?this.element.crossOrigin=null:null!==a&&(this.element.crossOrigin=a(this));this.element.src=b}});
    w.defineProperty(xl,{Cj:"sourceRect"},function(){return this.jk},function(a){var b=this.jk;b.L(a)||(w.G(a,B,xl,"sourceRect"),this.jk=a=a.S(),this.oa(),this.h("sourceRect",b,a))});w.defineProperty(xl,{oI:"imageStretch"},function(){return this.Lo},function(a){var b=this.Lo;b!==a&&(w.mb(a,G,xl,"imageStretch"),this.Lo=a,this.oa(),this.h("imageStretch",b,a))});
    w.defineProperty(xl,{Tt:"flip"},function(){return this.rg},function(a){var b=this.rg;b!==a&&(w.mb(a,G,xl,"flip"),this.rg=a,this.oa(),this.h("flip",b,a))});w.defineProperty(xl,{aL:"imageAlignment"},function(){return this.Ko},function(a){w.G(a,L,xl,"imageAlignment");var b=this.Ko;b.L(a)||(this.Ko=a=a.S(),this.H(),this.h("imageAlignment",b,a))});
    w.defineProperty(xl,{mA:"errorFunction"},function(){return this.Ve},function(a){var b=this.Ve;b!==a&&(null!==a&&w.j(a,"function",xl,"errorFunction"),this.Ve=a,this.h("errorFunction",b,a))});w.defineProperty(xl,{WL:"successFunction"},function(){return this.ki},function(a){var b=this.ki;b!==a&&(null!==a&&w.j(a,"function",xl,"successFunction"),this.ki=a,this.h("successFunction",b,a))});
    xl.prototype.zk=function(a,b){var c=this.Ue;if(null!==c){var d=c.src;null!==d&&""!==d||w.k('Element has no source ("src") attribute: '+c);if(!(c.Jo instanceof Event)&&!1!==c.Nv){var d=this.Ja,e=0,f=0,h=this.mz,k=h?+c.width:c.naturalWidth,h=h?+c.height:c.naturalHeight;void 0===k&&c.videoWidth&&(k=c.videoWidth);void 0===h&&c.videoHeight&&(h=c.videoHeight);k=k||d.width;h=h||d.height;if(0!==k&&0!==h){var l=k,m=h;this.Cj.I()&&(e=this.jk.x,f=this.jk.y,k=this.jk.width,h=this.jk.height);var n=k,p=h,q=this.Lo,
        r=this.Ko;switch(q){case Oj:if(this.Cj.I())break;n>=d.width&&(e=e+r.offsetX+(n*r.x-d.width*r.x));p>=d.height&&(f=f+r.offsetY+(p*r.y-d.height*r.y));k=Math.min(d.width,n);h=Math.min(d.height,p);break;case Fe:n=d.width;p=d.height;break;case Qj:case Rj:var s=0;q===Qj?(s=Math.min(d.height/p,d.width/n),n*=s,p*=s):q===Rj&&(s=Math.max(d.height/p,d.width/n),n*=s,p*=s,n>=d.width&&(e=(e+r.offsetX+(n*r.x-d.width*r.x)/n)*k),p>=d.height&&(f=(f+r.offsetY+(p*r.y-d.height*r.y)/p)*h),k*=1/(n/d.width),h*=1/(p/d.height),
            n=d.width,p=d.height)}var q=this.pj()*b.scale,u=k*h/(n*q*p*q),s=Kq[this.source],q=null;if(void 0!==s&&16<u){2>s.Ep.length&&(Rq(s,4,l,m),Rq(s,16,l,m));for(var l=s.Ep,m=l.length,q=l[0],t=0;t<m;t++)if(l[t].jq*l[t].jq<u)q=l[t];else break}if(!b.pr){if(null===this.vp)if(null===this.Ue)this.vp=!1;else{l=(new Wc(null)).yk;l.drawImage(this.Ue,0,0);try{l.getImageData(0,0,1,1).data[3]&&(this.vp=!1),this.vp=!1}catch(x){this.vp=!0}}if(this.vp)return}l=0;n<d.width&&(l=r.offsetX+(d.width*r.x-n*r.x));m=0;p<d.height&&
    (m=r.offsetY+(d.height*r.y-p*r.y));switch(this.Tt){case so:a.translate(Math.min(d.width,n),0);a.scale(-1,1);break;case ro:a.translate(0,Math.min(d.height,p));a.scale(1,-1);break;case to:a.translate(Math.min(d.width,n),Math.min(d.height,p)),a.scale(-1,-1)}if(b.qj("pictureRatioOptimization")&&!b.nz&&void 0!==s&&null!==q&&1!==q.jq){a.save();s=q.jq;try{a.drawImage(q.source,e/s,f/s,Math.min(q.source.width,k/s),Math.min(q.source.height,h/s),l,m,Math.min(d.width,n),Math.min(d.height,p))}catch(v){this.Av=
        !1}a.restore()}else try{a.drawImage(c,e,f,k,h,l,m,Math.min(d.width,n),Math.min(d.height,p))}catch(A){this.Av=!1}switch(this.Tt){case so:a.scale(-1,1);a.translate(-Math.min(d.width,n),0);break;case ro:a.scale(1,-1);a.translate(0,-Math.min(d.height,p));break;case to:a.scale(-1,-1),a.translate(-Math.min(d.width,n),-Math.min(d.height,p))}}}}};w.u(xl,{Ja:"naturalBounds"},function(){return this.Uc});
    xl.prototype.Pn=function(a,b,c,d){var e=this.Ca,f=Eo(this,!0),h=this.Ue,k=this.mz;if(k||!this.Xv&&h&&h.complete)this.Xv=!0;null===h&&(isFinite(a)||(a=0),isFinite(b)||(b=0));isFinite(e.width)||f===Fe||f===qo?(isFinite(a)||(a=this.Cj.I()?this.Cj.width:k?+h.width:h.naturalWidth),c=0):null!==h&&!1!==this.Xv&&(a=this.Cj.I()?this.Cj.width:k?+h.width:h.naturalWidth);isFinite(e.height)||f===Fe||f===po?(isFinite(b)||(b=this.Cj.I()?this.Cj.height:k?+h.height:h.naturalHeight),d=0):null!==h&&!1!==this.Xv&&(b=
            this.Cj.I()?this.Cj.height:k?+h.height:h.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.Gf;f=this.si;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===h||h.complete||(isFinite(a)||(a=0),isFinite(b)||(b=0));Ua(this.Uc,a,b);Bo(this,0,0,a,b)};xl.prototype.jj=function(a,b,c,d){Go(this,a,b,c,d)};function Qq(a){this.Ep=[new Sq(a,1)]}
    function Rq(a,b,c,d){var e=new Wc(null),f=e.yk,h=1/b;e.width=c/b;e.height=d/b;b=new Sq(e.Kd,b);c=a.Ep[a.Ep.length-1];f.setTransform(h*c.jq,0,0,h*c.jq,0,0);f.drawImage(c.source,0,0);a.Ep.push(b)}function Sq(a,b){this.source=a;this.jq=b}function la(){this.o=new Ce;this.Xb=null}g=la.prototype;g.reset=function(){this.o=new Ce;this.Xb=null};
    function M(a,b,c,d,e,f){null===a.o&&w.k("StreamGeometryContext has been closed");void 0!==e&&!0===e?(null===a.Xb&&w.k("Need to call beginFigure first"),d=new xf(nf),d.C=b,d.D=c,a.Xb.vb.add(d)):(a.Xb=new Ee,a.Xb.ha=b,a.Xb.fa=c,a.Xb.gu=d,a.o.fc.add(a.Xb));void 0!==f&&(a.Xb.Ro=f)}function O(a){null===a.o&&w.k("StreamGeometryContext has been closed");null===a.Xb&&w.k("Need to call beginFigure first");var b=a.Xb.vb.length;0<b&&a.Xb.vb.ea(b-1).close()}
    function Se(a){null===a.o&&w.k("StreamGeometryContext has been closed");null===a.Xb&&w.k("Need to call beginFigure first");0<a.Xb.vb.length&&(a.Xb.gu=!0)}g.bb=function(a){null===this.o&&w.k("StreamGeometryContext has been closed");null===this.Xb&&w.k("Need to call beginFigure first");this.Xb.dm=a};g.moveTo=function(a,b,c){void 0===c&&(c=!1);null===this.o&&w.k("StreamGeometryContext has been closed");null===this.Xb&&w.k("Need to call beginFigure first");var d=new xf(nf);d.C=a;d.D=b;c&&d.close();this.Xb.vb.add(d)};
    g.lineTo=function(a,b,c){void 0===c&&(c=!1);null===this.o&&w.k("StreamGeometryContext has been closed");null===this.Xb&&w.k("Need to call beginFigure first");var d=new xf(Ne);d.C=a;d.D=b;c&&d.close();this.Xb.vb.add(d)};function N(a,b,c,d,e,f,h,k){void 0===k&&(k=!1);null===a.o&&w.k("StreamGeometryContext has been closed");null===a.Xb&&w.k("Need to call beginFigure first");var l=new xf(of);l.uc=b;l.Qc=c;l.Ch=d;l.Dh=e;l.C=f;l.D=h;k&&l.close();a.Xb.vb.add(l)}
    function Qe(a,b,c,d,e){var f;void 0===f&&(f=!1);null===a.o&&w.k("StreamGeometryContext has been closed");null===a.Xb&&w.k("Need to call beginFigure first");var h=new xf(pf);h.uc=b;h.Qc=c;h.C=d;h.D=e;f&&h.close();a.Xb.vb.add(h)}g.arcTo=function(a,b,c,d,e,f,h){void 0===f&&(f=0);void 0===h&&(h=!1);null===this.o&&w.k("StreamGeometryContext has been closed");null===this.Xb&&w.k("Need to call beginFigure first");var k=new xf(qf);k.ze=a;k.rf=b;k.la=c;k.ra=d;k.radiusX=e;k.radiusY=0!==f?f:e;h&&k.close();this.Xb.vb.add(k)};
    function Re(a,b,c,d,e,f,h,k){var l;void 0===l&&(l=!1);null===a.o&&w.k("StreamGeometryContext has been closed");null===a.Xb&&w.k("Need to call beginFigure first");b=new xf(rf,h,k,b,c,d,e,f);l&&b.close();a.Xb.vb.add(b)}function Tq(a){a=Uq(a);var b=w.cb();b[0]=a[0];for(var c=1,d=1;d<a.length;)b[c]=a[d],b[c+1]=a[d],b[c+2]=a[d+1],d+=2,c+=3;w.ta(a);return b}
    function Uq(a){var b=Vq(a),c=w.cb(),d=Math.floor(b.length/2),e=b.length-1;a=0===a%2?2:1;for(var f=0;f<e;f++){var h=b[f],k=b[f+1],l=b[(d+f-1)%e],m=b[(d+f+a)%e];c[2*f]=h;c[2*f+1]=me(h.x,h.y,l.x,l.y,k.x,k.y,m.x,m.y,new z)}c[c.length]=c[0];w.ta(b);return c}function Vq(a){for(var b=w.cb(),c=1.5*Math.PI,d=0,e=0;e<a;e++)d=2*Math.PI/a*e+c,b[e]=new z(.5+.5*Math.cos(d),.5+.5*Math.sin(d));b.push(b[0]);return b}
    var jq={None:"Rectangle",Rectangle:function(a,b,c){a=new Ce;a.type=He;a.ha=0;a.fa=0;a.C=b;a.D=c;return a},Square:function(a,b,c){a=new Ce;a.be=Qj;a.type=He;a.ha=0;a.fa=0;a.C=Math.min(b,c);a.D=Math.min(b,c);return a},Ellipse:function(a,b,c){a=new Ce;a.type=Le;a.ha=0;a.fa=0;a.C=b;a.D=c;a.A=Od;a.B=Pd;return a},Circle:function(a,b,c){a=new Ce;a.be=Qj;a.type=Le;a.ha=0;a.fa=0;a.C=Math.min(b,c);a.D=Math.min(b,c);a.A=Od;a.B=Pd;return a},Connector:"Ellipse",TriangleRight:function(a,b,c){a=new Ce;var d=new Ee,
        e=new xf;e.C=b;e.D=.5*c;d.vb.add(e);b=new xf;b.C=0;b.D=c;d.vb.add(b.close());a.fc.add(d);a.A=new L(0,.25);a.B=new L(.5,.75);return a},TriangleDown:function(a,b,c){a=new Ce;var d=new Ee,e=new xf;e.C=b;e.D=0;d.vb.add(e);e=new xf;e.C=.5*b;e.D=c;d.vb.add(e.close());a.fc.add(d);a.A=new L(.25,0);a.B=new L(.75,.5);return a},TriangleLeft:function(a,b,c){a=new Ce;var d=new Ee;d.ha=b;d.fa=c;var e=new xf;e.C=0;e.D=.5*c;d.vb.add(e);c=new xf;c.C=b;c.D=0;d.vb.add(c.close());a.fc.add(d);a.A=new L(.5,.25);a.B=new L(1,
        .75);return a},TriangleUp:function(a,b,c){a=new Ce;var d=new Ee;d.ha=b;d.fa=c;var e=new xf;e.C=0;e.D=c;d.vb.add(e);c=new xf;c.C=.5*b;c.D=0;d.vb.add(c.close());a.fc.add(d);a.A=new L(.25,.5);a.B=new L(.75,1);return a},Line1:function(a,b,c){a=new Ce;a.type=Ge;a.ha=0;a.fa=0;a.C=b;a.D=c;return a},Line2:function(a,b,c){a=new Ce;a.type=Ge;a.ha=b;a.fa=0;a.C=0;a.D=c;return a},MinusLine:"LineH",LineH:function(a,b,c){a=new Ce;a.type=Ge;a.ha=0;a.fa=c/2;a.C=b;a.D=c/2;return a},LineV:function(a,b,c){a=new Ce;a.type=
        Ge;a.ha=b/2;a.fa=0;a.C=b/2;a.D=c;return a},BarH:"Rectangle",BarV:"Rectangle",Curve1:function(a,b,c){a=w.s();M(a,0,0,!1);N(a,cd*b,0,1*b,(1-cd)*c,b,c);b=a.o;w.q(a);return b},Curve2:function(a,b,c){a=w.s();M(a,0,0,!1);N(a,0,cd*c,(1-cd)*b,c,b,c);b=a.o;w.q(a);return b},Curve3:function(a,b,c){a=w.s();M(a,1*b,0,!1);N(a,1*b,cd*c,cd*b,1*c,0,1*c);b=a.o;w.q(a);return b},Curve4:function(a,b,c){a=w.s();M(a,1*b,0,!1);N(a,(1-cd)*b,0,0,(1-cd)*c,0,1*c);b=a.o;w.q(a);return b},Alternative:"Triangle",Merge:"Triangle",
        Triangle:function(a,b,c){a=w.s();M(a,.5*b,0*c,!0);a.lineTo(0*b,1*c);a.lineTo(1*b,1*c,!0);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,1);w.q(a);return b},Decision:"Diamond",Diamond:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(0,.5*c);a.lineTo(.5*b,1*c);a.lineTo(1*b,.5*c,!0);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.75);w.q(a);return b},Pentagon:function(a,b,c){var d=Vq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;5>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.2,.22);b.B=new L(.8,
            .9);w.q(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=Vq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;6>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.07,.25);b.B=new L(.93,.75);w.q(a);return b},Heptagon:function(a,b,c){var d=Vq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;7>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.2,.15);b.B=new L(.8,.85);w.q(a);return b},Octagon:function(a,b,c){var d=Vq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);
            for(var e=1;8>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.85);w.q(a);return b},Nonagon:function(a,b,c){var d=Vq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;9>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.17,.13);b.B=new L(.82,.82);w.q(a);return b},Decagon:function(a,b,c){var d=Vq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b},
        Dodecagon:function(a,b,c){var d=Vq(12);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.16,.16);b.B=new L(.84,.84);w.q(a);return b},FivePointedStar:function(a,b,c){var d=Uq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;10>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.312,.383);b.B=new L(.693,.765);w.q(a);return b},SixPointedStar:function(a,b,c){var d=Uq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;12>e;e++)a.lineTo(d[e].x*
            b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.17,.251);b.B=new L(.833,.755);w.q(a);return b},SevenPointedStar:function(a,b,c){var d=Uq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;14>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.363,.361);b.B=new L(.641,.709);w.q(a);return b},EightPointedStar:function(a,b,c){var d=Uq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;16>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.252,.255);b.B=new L(.75,.75);w.q(a);return b},NinePointedStar:function(a,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                        b,c){var d=Uq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;18>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.355,.361);b.B=new L(.645,.651);w.q(a);return b},TenPointedStar:function(a,b,c){var d=Uq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;20>e;e++)a.lineTo(d[e].x*b,d[e].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.281,.261);b.B=new L(.723,.748);w.q(a);return b},FivePointedBurst:function(a,b,c){var d=Tq(5);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(a,d[e].x*
            b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.312,.383);b.B=new L(.693,.765);w.q(a);return b},SixPointedBurst:function(a,b,c){var d=Tq(6);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.17,.251);b.B=new L(.833,.755);w.q(a);return b},SevenPointedBurst:function(a,b,c){var d=Tq(7);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(a,d[e].x*
            b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.363,.361);b.B=new L(.641,.709);w.q(a);return b},EightPointedBurst:function(a,b,c){var d=Tq(8);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.252,.255);b.B=new L(.75,.75);w.q(a);return b},NinePointedBurst:function(a,b,c){var d=Tq(9);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(a,d[e].x*
            b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.355,.361);b.B=new L(.645,.651);w.q(a);return b},TenPointedBurst:function(a,b,c){var d=Tq(10);a=w.s();M(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)N(a,d[e].x*b,d[e].y*c,d[e+1].x*b,d[e+1].y*c,d[e+2].x*b,d[e+2].y*c);w.ta(d);O(a);b=a.o;b.A=new L(.281,.261);b.B=new L(.723,.748);w.q(a);return b},Cloud:function(a,b,c){a=w.s();M(a,.08034461*b,.1944299*c,!0);N(a,-.09239631*b,.07836421*c,.1406031*b,-.0542823*c,.2008615*
            b,.05349299*c);N(a,.2450511*b,-.00697547*c,.3776197*b,-.01112067*c,.4338609*b,.074219*c);N(a,.4539471*b,0,.6066018*b,-.02526587*c,.6558228*b,.07004196*c);N(a,.6914277*b,-.01904177*c,.8921095*b,-.01220843*c,.8921095*b,.08370865*c);N(a,1.036446*b,.04105738*c,1.020377*b,.3022052*c,.9147671*b,.3194596*c);N(a,1.04448*b,.360238*c,.992256*b,.5219009*c,.9082935*b,.562044*c);N(a,1.032337*b,.5771781*c,1.018411*b,.8120651*c,.9212406*b,.8217117*c);N(a,1.028411*b,.9571472*c,.8556702*b,1.052487*c,.7592566*b,.9156953*
            c);N(a,.7431877*b,1.009325*c,.5624123*b,1.021761*c,.5101666*b,.9310455*c);N(a,.4820677*b,1.031761*c,.3030112*b,1.002796*c,.2609328*b,.9344623*c);N(a,.2329994*b,1.01518*c,.03213784*b,1.01518*c,.08034461*b,.870098*c);N(a,-.02812061*b,.9032597*c,-.01205169*b,.6835638*c,.06829292*b,.6545475*c);N(a,-.01812061*b,.6089503*c,-.00606892*b,.4555777*c,.06427569*b,.4265613*c);N(a,-.01606892*b,.3892545*c,-.01205169*b,.1944299*c,.08034461*b,.1944299*c);O(a);b=a.o;b.A=new L(.1,.1);b.B=new L(.9,.9);w.q(a);return b},
        Gate:"Crescent",Crescent:function(a,b,c){a=w.s();M(a,0,0,!0);N(a,1*b,0,1*b,1*c,0,1*c);N(a,.5*b,.75*c,.5*b,.25*c,0,0);O(a);b=a.o;b.A=new L(.511,.19);b.B=new L(.776,.76);w.q(a);return b},FramedRectangle:function(a,b,c){var d=w.s(),e=a?a.Ec:NaN;a=a?a.zu:NaN;isNaN(e)&&(e=.1);isNaN(a)&&(a=.1);M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c,!0);M(d,e*b,a*c,!1,!0);d.lineTo(e*b,(1-a)*c);d.lineTo((1-e)*b,(1-a)*c);d.lineTo((1-e)*b,a*c,!0);b=d.o;b.A=new L(e,a);b.B=new L(1-e,1-a);w.q(d);return b},
        Delay:"HalfEllipse",HalfEllipse:function(a,b,c){a=w.s();M(a,0,0,!0);N(a,cd*b,0,1*b,(.5-cd/2)*c,1*b,.5*c);N(a,1*b,(.5+cd/2)*c,cd*b,1*c,0,1*c);O(a);b=a.o;b.A=new L(0,.2);b.B=new L(.75,.8);w.q(a);return b},Heart:function(a,b,c){a=w.s();M(a,.5*b,1*c,!0);N(a,.1*b,.8*c,0,.5*c,0*b,.3*c);N(a,0*b,0,.45*b,0,.5*b,.3*c);N(a,.55*b,0,1*b,0,1*b,.3*c);N(a,b,.5*c,.9*b,.8*c,.5*b,1*c);O(a);b=a.o;b.A=new L(.15,.29);b.B=new L(.86,.68);w.q(a);return b},Spade:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(.51*b,.01*c);
            N(a,.6*b,.2*c,b,.25*c,b,.5*c);N(a,b,.8*c,.6*b,.8*c,.55*b,.7*c);N(a,.5*b,.75*c,.55*b,.95*c,.75*b,c);a.lineTo(.25*b,c);N(a,.45*b,.95*c,.5*b,.75*c,.45*b,.7*c);N(a,.4*b,.8*c,0,.8*c,0,.5*c);N(a,0,.25*c,.4*b,.2*c,.49*b,.01*c);O(a);b=a.o;b.A=new L(.19,.26);b.B=new L(.8,.68);w.q(a);return b},Club:function(a,b,c){a=w.s();M(a,.4*b,.6*c,!0);N(a,.5*b,.75*c,.45*b,.95*c,.15*b,1*c);a.lineTo(.85*b,c);N(a,.55*b,.95*c,.5*b,.75*c,.6*b,.6*c);var d=.2,e=.3,f=0,h=4*(Math.SQRT2-1)/3*d;N(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*
            b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);N(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);N(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e+.05)*b,(.5-h+f-.02)*c,.65*b,.36771243*c);d=.2;e=0;f=-.3;h=4*(Math.SQRT2-1)/3*d;N(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);N(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);N(a,(.5-d+
            e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,.35*b,.36771243*c);d=.2;e=-.3;f=0;h=4*(Math.SQRT2-1)/3*d;N(a,(.5+d+e-.05)*b,(.5-h+f-.02)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);N(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);N(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,.4*b,.6*c);O(a);b=a.o;b.A=new L(.06,.39);b.B=new L(.93,.58);w.q(a);return b},Ring:function(a,b,c){a=w.s();var d=4*(Math.SQRT2-1)/3*.5;M(a,b,.5*
            c,!0);N(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);N(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);N(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);N(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;M(a,.5*b,.1*c,!0,!0);N(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);N(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);N(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);N(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);b=a.o;b.A=new L(.146,.146);b.B=new L(.853,.853);b.be=Qj;w.q(a);return b},YinYang:function(a,b,c){var d=.5;a=w.s();d=.5;M(a,.5*b,0,!0);a.arcTo(270,
            180,.5*b,.5*b,.5*b);N(a,1*b,d*c,0,d*c,d*b,0,!0);var d=.1,e=.25;M(a,(.5+d)*b,e*c,!0,!0);a.arcTo(0,-360,.5*b,c*e,d*b);O(a);M(a,.5*b,0,!1);a.arcTo(270,-180,.5*b,.5*b,.5*b);a.bb(!1);e=.75;M(a,(.5+d)*b,e*c,!0);a.arcTo(0,360,.5*b,c*e,d*b);O(a);b=a.o;b.be=Qj;w.q(a);return b},Peace:function(a,b,c){a=w.s();var d=4*(Math.SQRT2-1)/3*.5;M(a,b,.5*c,!0);N(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);N(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);N(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);N(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;
            M(a,.5*b,.1*c,!0,!0);N(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);N(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);N(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);N(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);var d=.07,e=0,f=-.707*.11,h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0);N(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);N(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);N(a,(.5+h+e)*b,(.5+d+f)*
                c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);d=.07;e=-.707*.11;f=.707*.11;h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0);N(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);N(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);N(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);d=.07;e=.707*.11;f=.707*.11;h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0);N(a,(.5+d+e)*b,(.5-h+
                f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);N(a,(.5-d+e)*b,(.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);N(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);b=a.o;b.A=new L(.146,.146);b.B=new L(.853,.853);b.be=Qj;w.q(a);return b},NotAllowed:function(a,b,c){var d=.5*cd,e=.5;a=w.s();M(a,.5*b,(.5-e)*c,!0);N(a,(.5-d)*b,(.5-e)*c,(.5-e)*b,(.5-d)*c,(.5-e)*b,.5*c);N(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,
            (.5+e)*c);N(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5-d)*c,(.5+d)*b,(.5-e)*c,.5*b,(.5-e)*c);var e=.4,d=.4*cd,f=w.K(),h=w.K(),k=w.K(),l=w.K();ee(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.42,f,h,k,l,l);var m=w.K(),n=w.K(),p=w.K();ee(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.58,l,l,p,m,n);var q=w.K(),r=w.K(),s=w.K();ee(.5,.5+e,.5-d,.5+e,.5-e,.5+d,.5-e,.5,.42,q,r,s,l,l);var u=w.K(),t=w.K(),x=w.K();ee(.5,.5+e,.5-d,.5+e,.5-e,.5+d,.5-e,.5,.58,l,l,x,u,t);M(a,x.x*b,x.y*c,!0,!0);N(a,u.x*b,
            u.y*c,t.x*b,t.y*c,(.5-e)*b,.5*c);N(a,(.5-e)*b,(.5-d)*c,(.5-d)*b,(.5-e)*c,.5*b,(.5-e)*c);N(a,f.x*b,f.y*c,h.x*b,h.y*c,k.x*b,k.y*c);a.lineTo(x.x*b,x.y*c);O(a);M(a,s.x*b,s.y*c,!0,!0);a.lineTo(p.x*b,p.y*c);N(a,m.x*b,m.y*c,n.x*b,n.y*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,q.x*b,q.y*c,r.x*b,r.y*c,s.x*b,s.y*c);O(a);w.v(f);w.v(h);w.v(k);w.v(l);w.v(m);w.v(n);w.v(p);w.v(q);w.v(r);w.v(s);w.v(u);w.v(t);w.v(x);b=a.o;w.q(a);b.be=Qj;return b},Fragile:function(a,b,c){a=w.s();M(a,
            0,0,!0);a.lineTo(.25*b,0);a.lineTo(.2*b,.15*c);a.lineTo(.3*b,.25*c);a.lineTo(.29*b,.33*c);a.lineTo(.35*b,.25*c);a.lineTo(.3*b,.15*c);a.lineTo(.4*b,0);a.lineTo(1*b,0);N(a,1*b,.25*c,.75*b,.5*c,.55*b,.5*c);a.lineTo(.55*b,.9*c);a.lineTo(.7*b,.9*c);a.lineTo(.7*b,1*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.9*c);a.lineTo(.45*b,.9*c);a.lineTo(.45*b,.5*c);N(a,.25*b,.5*c,0,.25*c,0,0);O(a);b=a.o;b.A=new L(.25,0);b.B=new L(.75,.4);w.q(a);return b},HourGlass:function(a,b,c){a=w.s();M(a,.65*b,.5*c,!0);a.lineTo(1*b,
            1*c);a.lineTo(0,1*c);a.lineTo(.35*b,.5*c);a.lineTo(0,0);a.lineTo(1*b,0);O(a);b=a.o;w.q(a);return b},Lightning:function(a,b,c){a=w.s();M(a,0*b,.55*c,!0);a.lineTo(.75*b,0);a.lineTo(.25*b,.45*c);a.lineTo(.9*b,.48*c);a.lineTo(.4*b,1*c);a.lineTo(.65*b,.55*c);O(a);b=a.o;w.q(a);return b},Parallelogram1:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);w.q(d);return b},Input:"Output",Output:function(a,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(.1*b,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);O(a);b=a.o;b.A=new L(.1,0);b.B=new L(.9,1);w.q(a);return b},Parallelogram2:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.25);var d=w.s();M(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);w.q(d);return b},ThickCross:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.25);var d=w.s();M(d,(.5-a/2)*b,0,!0);d.lineTo((.5+a/2)*b,0);d.lineTo((.5+a/2)*b,(.5-a/2)*c);d.lineTo(1*b,(.5-
            a/2)*c);d.lineTo(1*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,(.5+a/2)*c);d.lineTo((.5+a/2)*b,1*c);d.lineTo((.5-a/2)*b,1*c);d.lineTo((.5-a/2)*b,(.5+a/2)*c);d.lineTo(0,(.5+a/2)*c);d.lineTo(0,(.5-a/2)*c);d.lineTo((.5-a/2)*b,(.5-a/2)*c);O(d);b=d.o;b.A=new L(.5-a/2,.5-a/2);b.B=new L(.5+a/2,.5+a/2);w.q(d);return b},ThickX:function(a,b,c){a=.25/Math.SQRT2;var d=w.s();M(d,.3*b,0,!0);d.lineTo(.5*b,.2*c);d.lineTo(.7*b,0);d.lineTo(1*b,.3*c);d.lineTo(.8*b,.5*c);d.lineTo(1*b,.7*c);d.lineTo(.7*b,1*c);d.lineTo(.5*b,.8*
            c);d.lineTo(.3*b,1*c);d.lineTo(0,.7*c);d.lineTo(.2*b,.5*c);d.lineTo(0,.3*c);O(d);b=d.o;b.A=new L(.5-a,.5-a);b.B=new L(.5+a,.5+a);w.q(d);return b},ThinCross:function(a,b,c){var d=a?a.Ec:NaN;isNaN(d)&&(d=.1);a=w.s();M(a,(.5-d/2)*b,0,!0);a.lineTo((.5+d/2)*b,0);a.lineTo((.5+d/2)*b,(.5-d/2)*c);a.lineTo(1*b,(.5-d/2)*c);a.lineTo(1*b,(.5+d/2)*c);a.lineTo((.5+d/2)*b,(.5+d/2)*c);a.lineTo((.5+d/2)*b,1*c);a.lineTo((.5-d/2)*b,1*c);a.lineTo((.5-d/2)*b,(.5+d/2)*c);a.lineTo(0,(.5+d/2)*c);a.lineTo(0,(.5-d/2)*c);a.lineTo((.5-
            d/2)*b,(.5-d/2)*c);O(a);b=a.o;w.q(a);return b},ThinX:function(a,b,c){a=w.s();M(a,.1*b,0,!0);a.lineTo(.5*b,.4*c);a.lineTo(.9*b,0);a.lineTo(1*b,.1*c);a.lineTo(.6*b,.5*c);a.lineTo(1*b,.9*c);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.6*c);a.lineTo(.1*b,1*c);a.lineTo(0,.9*c);a.lineTo(.4*b,.5*c);a.lineTo(0,.1*c);O(a);b=a.o;w.q(a);return b},RightTriangle:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=new L(0,.5);b.B=new L(.5,1);w.q(a);return b},RoundedIBeam:function(a,b,c){a=
            w.s();M(a,0,0,!0);a.lineTo(1*b,0);N(a,.5*b,.25*c,.5*b,.75*c,1*b,1*c);a.lineTo(0,1*c);N(a,.5*b,.75*c,.5*b,.25*c,0,0);O(a);b=a.o;w.q(a);return b},RoundedRectangle:function(a,b,c){var d=a?a.Ec:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*cd;var e=w.s();M(e,d,0,!0);e.lineTo(b-d,0);N(e,b-a,0,b,a,b,d);e.lineTo(b,c-d);N(e,b,c-a,b-a,c,b-d,c);e.lineTo(d,c);N(e,a,c,0,c-a,0,c-d);e.lineTo(0,d);N(e,0,a,a,0,d,0);O(e);b=e.o;1<a?(b.A=new L(0,0,a,a),b.B=new L(1,1,-a,-a)):(b.A=Ab,b.B=Sb);w.q(e);return b},
        Border:function(a,b,c){var d=a?a.Ec:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=w.s();M(a,d,0,!0);a.lineTo(b-d,0);N(a,b-0,0,b,0,b,d);a.lineTo(b,c-d);N(a,b,c-0,b-0,c,b-d,c);a.lineTo(d,c);N(a,0,c,0,c-0,0,c-d);a.lineTo(0,d);N(a,0,0,0,0,d,0);O(a);b=a.o;b.A=Ab;b.B=Sb;w.q(a);return b},SquareIBeam:function(a,b,c){var d=a?a.Ec:NaN;isNaN(d)&&(d=.2);a=w.s();M(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,d*c);a.lineTo((.5+d/2)*b,d*c);a.lineTo((.5+d/2)*b,(1-d)*c);a.lineTo(1*b,(1-d)*c);a.lineTo(1*b,1*
            c);a.lineTo(0,1*c);a.lineTo(0,(1-d)*c);a.lineTo((.5-d/2)*b,(1-d)*c);a.lineTo((.5-d/2)*b,d*c);a.lineTo(0,d*c);O(a);b=a.o;w.q(a);return b},Trapezoid:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.2);var d=w.s();M(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);w.q(d);return b},ManualLoop:"ManualOperation",ManualOperation:function(a,b,c){var d=a?a.Ec:NaN;isNaN(d)&&(d=0);a=w.s();M(a,d,0,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*
            b,1*c);O(a);b=a.o;b.A=new L(.1,0);b.B=new L(.9,1);w.q(a);return b},GenderMale:function(a,b,c){a=w.s();var d=.4*cd,e=.4,f=w.K(),h=w.K(),k=w.K(),l=w.K();M(a,(.5-e)*b,.5*c,!0);N(a,(.5-e)*b,(.5-d)*c,(.5-d)*b,(.5-e)*c,.5*b,(.5-e)*c);ee(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.44,k,l,h,f,f);N(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);var m=w.xb(h.x,h.y);ee(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.56,f,f,h,k,l);var n=w.xb(h.x,h.y);a.lineTo((.1*m.x+.855)*b,.1*m.y*c);a.lineTo(.85*b,.1*m.y*c);a.lineTo(.85*b,0);a.lineTo(1*
            b,0);a.lineTo(1*b,.15*c);a.lineTo((.1*n.x+.9)*b,.15*c);a.lineTo((.1*n.x+.9)*b,(.1*n.y+.05*.9)*c);a.lineTo(n.x*b,n.y*c);N(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);e=.35;d=.35*cd;M(a,.5*b,(.5-e)*c,!0,!0);N(a,(.5-d)*b,(.5-e)*c,(.5-e)*b,(.5-d)*c,(.5-e)*b,.5*c);N(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5-d)*c,(.5+
            d)*b,(.5-e)*c,.5*b,(.5-e)*c);M(a,(.5-e)*b,.5*c,!0);w.v(f);w.v(h);w.v(k);w.v(l);w.v(m);w.v(n);b=a.o;b.A=new L(.202,.257);b.B=new L(.692,.839);b.be=Qj;w.q(a);return b},GenderFemale:function(a,b,c){a=w.s();var d=.375,e=0,f=-.125,h=4*(Math.SQRT2-1)/3*d;M(a,(.525+e)*b,(.5+d+f)*c,!0);N(a,(.5+h+e)*b,(.5+d+f)*c,(.5+d+e)*b,(.5+h+f)*c,(.5+d+e)*b,(.5+f)*c);N(a,(.5+d+e)*b,(.5-h+f)*c,(.5+h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5-h+e)*b,(.5-d+f)*c,(.5-d+e)*b,(.5-h+f)*c,(.5-d+e)*b,(.5+f)*c);N(a,(.5-d+e)*b,
            (.5+h+f)*c,(.5-h+e)*b,(.5+d+f)*c,(.475+e)*b,(.5+d+f)*c);a.lineTo(.475*b,.85*c);a.lineTo(.425*b,.85*c);a.lineTo(.425*b,.9*c);a.lineTo(.475*b,.9*c);a.lineTo(.475*b,1*c);a.lineTo(.525*b,1*c);a.lineTo(.525*b,.9*c);a.lineTo(.575*b,.9*c);a.lineTo(.575*b,.85*c);a.lineTo(.525*b,.85*c);O(a);d=.325;e=0;f=-.125;h=4*(Math.SQRT2-1)/3*d;M(a,(.5+d+e)*b,(.5+f)*c,!0,!0);N(a,(.5+d+e)*b,(.5+h+f)*c,(.5+h+e)*b,(.5+d+f)*c,(.5+e)*b,(.5+d+f)*c);N(a,(.5-h+e)*b,(.5+d+f)*c,(.5-d+e)*b,(.5+h+f)*c,(.5-d+e)*b,(.5+f)*c);N(a,(.5-
            d+e)*b,(.5-h+f)*c,(.5-h+e)*b,(.5-d+f)*c,(.5+e)*b,(.5-d+f)*c);N(a,(.5+h+e)*b,(.5-d+f)*c,(.5+d+e)*b,(.5-h+f)*c,(.5+d+e)*b,(.5+f)*c);M(a,(.525+e)*b,(.5+d+f)*c,!0);b=a.o;b.A=new L(.232,.136);b.B=new L(.782,.611);b.be=Qj;w.q(a);return b},PlusLine:function(a,b,c){a=w.s();M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.o;w.q(a);return b},XLine:function(a,b,c){a=w.s();M(a,0,1*c,!1);a.lineTo(1*b,0);a.moveTo(0,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},AsteriskLine:function(a,b,c){a=
            w.s();var d=.2/Math.SQRT2;M(a,d*b,(1-d)*c,!1);a.lineTo((1-d)*b,d*c);a.moveTo(d*b,d*c);a.lineTo((1-d)*b,(1-d)*c);a.moveTo(0*b,.5*c);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0*c);a.lineTo(.5*b,1*c);b=a.o;w.q(a);return b},CircleLine:function(a,b,c){var d=.5*cd;a=w.s();M(a,1*b,.5*c,!1);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(.146,.146);b.B=new L(.853,.853);b.be=Qj;w.q(a);return b},Pie:function(a,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         b,c){a=w.s();var d=4*(Math.SQRT2-1)/3*.5;M(a,(.5*Math.SQRT2/2+.5)*b,(.5-.5*Math.SQRT2/2)*c,!0);N(a,.7*b,0*c,.5*b,0*c,.5*b,0*c);N(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);N(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.5*b,1*c);N(a,(.5+d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);a.lineTo(.5*b,.5*c);O(a);b=a.o;w.q(a);return b},PiePiece:function(a,b,c){var d=cd/Math.SQRT2*.5,e=Math.SQRT2/2,f=1-Math.SQRT2/2;a=w.s();M(a,b,c,!0);N(a,b,(1-d)*c,(e+d)*b,(f+d)*c,e*b,f*c);a.lineTo(0,c);O(a);b=a.o;w.q(a);return b},StopSign:function(a,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                   b,c){a=1/(Math.SQRT2+2);var d=w.s();M(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,a*c);d.lineTo(1*b,(1-a)*c);d.lineTo((1-a)*b,1*c);d.lineTo(a*b,1*c);d.lineTo(0,(1-a)*c);d.lineTo(0,a*c);O(d);b=d.o;b.A=new L(a/2,a/2);b.B=new L(1-a/2,1-a/2);w.q(d);return b},LogicImplies:function(a,b,c){var d=a?a.Ec:NaN;isNaN(d)&&(d=.2);a=w.s();M(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);b=a.o;b.A=Ab;b.B=new L(.8,.5);w.q(a);return b},LogicIff:function(a,b,c){var d=a?a.Ec:
            NaN;isNaN(d)&&(d=.2);a=w.s();M(a,(1-d)*b,0*c,!1);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,c);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(d*b,0);a.lineTo(0,.5*c);a.lineTo(d*b,c);b=a.o;b.A=new L(.2,0);b.B=new L(.8,.5);w.q(a);return b},LogicNot:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},LogicAnd:function(a,b,c){a=w.s();M(a,0,1*c,!1);a.lineTo(.5*b,0);a.lineTo(1*b,1*c);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,1);w.q(a);return b},LogicOr:function(a,b,c){a=w.s();
            M(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);b=a.o;b.A=new L(.219,0);b.B=new L(.78,.409);w.q(a);return b},LogicXor:function(a,b,c){a=w.s();M(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);var d=.5*cd;N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.be=Qj;w.q(a);return b},LogicTruth:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);
            b=a.o;w.q(a);return b},LogicFalsity:function(a,b,c){a=w.s();M(a,0,1*c,!1);a.lineTo(1*b,1*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);b=a.o;w.q(a);return b},LogicThereExists:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,.5*c);a.lineTo(0,.5*c);a.moveTo(1*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);b=a.o;w.q(a);return b},LogicForAll:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);a.moveTo(.25*b,.5*c);a.lineTo(.75*b,.5*c);b=a.o;b.A=new L(.25,0);b.B=new L(.75,.5);w.q(a);
            return b},LogicIsDefinedAs:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(b,0);a.moveTo(0,.5*c);a.lineTo(b,.5*c);a.moveTo(0,c);a.lineTo(b,c);b=a.o;b.A=new L(.01,.01);b.B=new L(.99,.49);w.q(a);return b},LogicIntersect:function(a,b,c){var d=.5*cd;a=w.s();M(a,0,1*c,!1);a.lineTo(0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);a.lineTo(1*b,1*c);b=a.o;b.A=new L(0,.5);b.B=Sb;w.q(a);return b},LogicUnion:function(a,b,c){var d=.5*cd;a=w.s();M(a,1*b,0,!1);a.lineTo(1*b,.5*c);N(a,
            1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);a.lineTo(0,0);b=a.o;b.A=Ab;b.B=new L(1,.5);w.q(a);return b},Arrow:function(a,b,c){var d=a?a.Ec:NaN,e=a?a.zu:NaN;isNaN(d)&&(d=.3);isNaN(e)&&(e=.3);a=w.s();M(a,0,(.5-e/2)*c,!0);a.lineTo((1-d)*b,(.5-e/2)*c);a.lineTo((1-d)*b,0);a.lineTo(1*b,.5*c);a.lineTo((1-d)*b,1*c);a.lineTo((1-d)*b,(.5+e/2)*c);a.lineTo(0,(.5+e/2)*c);O(a);b=a.o;b.A=new L(0,.5-e/2);d=me(0,.5+e/2,1,.5+e/2,1-d,1,1,.5,w.K());b.B=new L(d.x,d.y);w.v(d);w.q(a);return b},
        ISOProcess:"Chevron",Chevron:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.5*b,0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);O(a);b=a.o;w.q(a);return b},DoubleArrow:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.3*b,.214*c);a.lineTo(.3*b,0);a.lineTo(1*b,.5*c);a.lineTo(.3*b,1*c);a.lineTo(.3*b,.786*c);a.lineTo(0,1*c);O(a);M(a,.3*b,.214*c,!1);a.lineTo(.3*b,.786*c);a.bb(!1);b=a.o;w.q(a);return b},DoubleEndArrow:function(a,b,c){a=w.s();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);
            a.lineTo(.7*b,.7*c);a.lineTo(.3*b,.7*c);a.lineTo(.3*b,1*c);a.lineTo(0,.5*c);a.lineTo(.3*b,0);a.lineTo(.3*b,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);O(a);b=a.o;c=me(0,.5,.3,0,0,.3,.3,.3,w.K());b.A=new L(c.x,c.y);c=me(.7,1,1,.5,.7,.7,1,.7,c);b.B=new L(c.x,c.y);w.v(c);w.q(a);return b},IBeamArrow:function(a,b,c){a=w.s();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(.2*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.2*b,0);a.lineTo(.2*b,.3*c);a.lineTo(.7*b,.3*c);
            a.lineTo(.7*b,0);O(a);b=a.o;b.A=new L(0,.3);c=me(.7,1,1,.5,.7,.7,1,.7,w.K());b.B=new L(c.x,c.y);w.v(c);w.q(a);return b},Pointer:function(a,b,c){a=w.s();M(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(.2*b,.5*c);a.lineTo(0,0);O(a);b=a.o;b.A=new L(.2,.35);c=me(.2,.65,1,.65,0,1,1,.5,w.K());b.B=new L(c.x,c.y);w.v(c);w.q(a);return b},RoundedPointer:function(a,b,c){a=w.s();M(a,1*b,.5*c,!0);a.lineTo(0,1*c);N(a,.5*b,.75*c,.5*b,.25*c,0,0);O(a);b=a.o;b.A=new L(.4,.35);c=me(.2,.65,1,.65,0,1,1,.5,w.K());b.B=new L(c.x,
            c.y);w.v(c);w.q(a);return b},SplitEndArrow:function(a,b,c){a=w.s();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(.7*b,.7*c);a.lineTo(0,.7*c);a.lineTo(.2*b,.5*c);a.lineTo(0,.3*c);a.lineTo(.7*b,.3*c);a.lineTo(.7*b,0);O(a);b=a.o;b.A=new L(.2,.3);c=me(.7,1,1,.5,.7,.7,1,.7,w.K());b.B=new L(c.x,c.y);w.v(c);w.q(a);return b},MessageToUser:"SquareArrow",SquareArrow:function(a,b,c){a=w.s();M(a,1*b,.5*c,!0);a.lineTo(.7*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.7*b,0);O(a);b=a.o;b.A=Ab;b.B=new L(.7,1);w.q(a);
            return b},Cone1:function(a,b,c){var d=.5*cd,e=.1*cd;a=w.s();M(a,0,.9*c,!0);a.lineTo(.5*b,0);a.lineTo(1*b,.9*c);N(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);O(a);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,.97);w.q(a);return b},Cone2:function(a,b,c){a=w.s();M(a,0,.9*c,!0);N(a,(1-.85/.9)*b,1*c,.85/.9*b,1*c,1*b,.9*c);a.lineTo(.5*b,0);a.lineTo(0,.9*c);O(a);M(a,0,.9*c,!1);N(a,(1-.85/.9)*b,.8*c,.85/.9*b,.8*c,1*b,.9*c);a.bb(!1);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,.82);w.q(a);return b},
        Cube1:function(a,b,c){a=w.s();M(a,.5*b,1*c,!0);a.lineTo(1*b,.85*c);a.lineTo(1*b,.15*c);a.lineTo(.5*b,0*c);a.lineTo(0*b,.15*c);a.lineTo(0*b,.85*c);O(a);M(a,.5*b,1*c,!1);a.lineTo(.5*b,.3*c);a.lineTo(0,.15*c);a.moveTo(.5*b,.3*c);a.lineTo(1*b,.15*c);a.bb(!1);b=a.o;b.A=new L(0,.3);b.B=new L(.5,.85);w.q(a);return b},Cube2:function(a,b,c){a=w.s();M(a,0,.3*c,!0);a.lineTo(0*b,1*c);a.lineTo(.7*b,c);a.lineTo(1*b,.7*c);a.lineTo(1*b,0*c);a.lineTo(.3*b,0*c);O(a);M(a,0,.3*c,!1);a.lineTo(.7*b,.3*c);a.lineTo(1*b,
            0*c);a.moveTo(.7*b,.3*c);a.lineTo(.7*b,1*c);a.bb(!1);b=a.o;b.A=new L(0,.3);b.B=new L(.7,1);w.q(a);return b},MagneticData:"Cylinder1",Cylinder1:function(a,b,c){var d=.5*cd,e=.1*cd;a=w.s();M(a,0,.1*c,!0);N(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);a.lineTo(b,.9*c);N(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);M(a,0,.1*c,!1);N(a,0,(.1+e)*c,(.5-d)*b,.2*c,.5*b,.2*c);N(a,(.5+d)*b,.2*c,1*b,(.1+e)*c,1*b,.1*c);a.bb(!1);b=a.o;b.A=new L(0,
            .2);b.B=new L(1,.9);w.q(a);return b},Cylinder2:function(a,b,c){var d=.5*cd,e=.1*cd;a=w.s();M(a,0,.9*c,!0);a.lineTo(0,.1*c);N(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);a.lineTo(1*b,.9*c);N(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);M(a,0,.9*c,!1);N(a,0,(.9-e)*c,(.5-d)*b,.8*c,.5*b,.8*c);N(a,(.5+d)*b,.8*c,1*b,(.9-e)*c,1*b,.9*c);a.bb(!1);b=a.o;b.A=new L(0,.1);b.B=new L(1,.8);w.q(a);return b},Cylinder3:function(a,b,c){var d=.1*cd,e=.5*cd;a=w.s();
            M(a,.1*b,0,!0);a.lineTo(.9*b,0);N(a,(.9+d)*b,0,1*b,(.5-e)*c,1*b,.5*c);N(a,1*b,(.5+e)*c,(.9+d)*b,1*c,.9*b,1*c);a.lineTo(.1*b,1*c);N(a,(.1-d)*b,1*c,0,(.5+e)*c,0,.5*c);N(a,0,(.5-e)*c,(.1-d)*b,0,.1*b,0);M(a,.1*b,0,!1);N(a,(.1+d)*b,0,.2*b,(.5-e)*c,.2*b,.5*c);N(a,.2*b,(.5+e)*c,(.1+d)*b,1*c,.1*b,1*c);a.bb(!1);b=a.o;b.A=new L(.2,0);b.B=new L(.9,1);w.q(a);return b},DirectData:"Cylinder4",Cylinder4:function(a,b,c){var d=.1*cd,e=.5*cd;a=w.s();M(a,.9*b,0,!0);N(a,(.9+d)*b,0,1*b,(.5-e)*c,1*b,.5*c);N(a,1*b,(.5+
            e)*c,(.9+d)*b,1*c,.9*b,1*c);a.lineTo(.1*b,1*c);N(a,(.1-d)*b,1*c,0,(.5+e)*c,0,.5*c);N(a,0,(.5-e)*c,(.1-d)*b,0,.1*b,0);a.lineTo(.9*b,0);M(a,.9*b,0,!1);N(a,(.9-d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);N(a,.8*b,(.5+e)*c,(.9-d)*b,1*c,.9*b,1*c);a.bb(!1);b=a.o;b.A=new L(.1,0);b.B=new L(.8,1);w.q(a);return b},Prism1:function(a,b,c){a=w.s();M(a,.25*b,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(b,.5*c);a.lineTo(.5*b,c);a.lineTo(0,c);O(a);M(a,.25*b,.25*c,!1);a.lineTo(.5*b,c);a.bb(!1);b=a.o;b.A=new L(.408,.172);b.B=new L(.833,
            .662);w.q(a);return b},Prism2:function(a,b,c){a=w.s();M(a,0,.25*c,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);O(a);M(a,0,c,!1);a.lineTo(.25*b,.5*c);a.lineTo(b,.25*c);a.moveTo(0,.25*c);a.lineTo(.25*b,.5*c);a.bb(!1);b=a.o;b.A=new L(.25,.5);b.B=new L(.75,.75);w.q(a);return b},Pyramid1:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(b,.75*c);a.lineTo(.5*b,1*c);a.lineTo(0,.75*c);O(a);M(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.bb(!1);b=a.o;b.A=new L(.25,.367);b.B=new L(.75,
            .875);w.q(a);return b},Pyramid2:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(b,.85*c);a.lineTo(.5*b,1*c);a.lineTo(0,.85*c);O(a);M(a,.5*b,0,!1);a.lineTo(.5*b,.7*c);a.lineTo(0,.85*c);a.moveTo(.5*b,.7*c);a.lineTo(1*b,.85*c);a.bb(!1);b=a.o;b.A=new L(.25,.367);b.B=new L(.75,.875);w.q(a);return b},Actor:function(a,b,c){var d=.2*cd,e=.1*cd,f=.5,h=.1;a=w.s();M(a,f*b,(h+.1)*c,!0);N(a,(f-d)*b,(h+.1)*c,(f-.2)*b,(h+e)*c,(f-.2)*b,h*c);N(a,(f-.2)*b,(h-e)*c,(f-d)*b,(h-.1)*c,f*b,(h-.1)*c);N(a,(f+d)*b,(h-.1)*c,
            (f+.2)*b,(h-e)*c,(f+.2)*b,h*c);N(a,(f+.2)*b,(h+e)*c,(f+d)*b,(h+.1)*c,f*b,(h+.1)*c);d=.05;e=cd*d;M(a,.5*b,.2*c,!0);a.lineTo(.95*b,.2*c);f=.95;h=.25;N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);a.lineTo(1*b,.6*c);a.lineTo(.85*b,.6*c);a.lineTo(.85*b,.35*c);d=.025;e=cd*d;f=.825;h=.35;N(a,(f+d)*b,(h-e)*c,(f+e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f-e)*b,(h-d)*c,(f-d)*b,(h-e)*c,(f-d)*b,h*c);a.lineTo(.8*b,1*c);a.lineTo(.55*b,1*c);a.lineTo(.55*b,.7*c);d=.05;e=cd*d;f=.5;h=.7;N(a,(f+d)*b,(h-e)*c,(f+e)*b,(h-d)*c,
            f*b,(h-d)*c);N(a,(f-e)*b,(h-d)*c,(f-d)*b,(h-e)*c,(f-d)*b,h*c);a.lineTo(.45*b,1*c);a.lineTo(.2*b,1*c);a.lineTo(.2*b,.35*c);d=.025;e=cd*d;f=.175;h=.35;N(a,(f+d)*b,(h-e)*c,(f+e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f-e)*b,(h-d)*c,(f-d)*b,(h-e)*c,(f-d)*b,h*c);a.lineTo(.15*b,.6*c);a.lineTo(0*b,.6*c);a.lineTo(0*b,.25*c);d=.05;e=cd*d;f=.05;h=.25;N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);a.lineTo(.5*b,.2*c);b=a.o;b.A=new L(.2,.2);b.B=new L(.8,.65);w.q(a);return b},Card:function(a,b,c){a=w.s();M(a,1*b,0*c,!0);
            a.lineTo(1*b,1*c);a.lineTo(0*b,1*c);a.lineTo(0*b,.2*c);a.lineTo(.2*b,0*c);O(a);b=a.o;b.A=new L(0,.2);b.B=Sb;w.q(a);return b},Collate:function(a,b,c){a=w.s();M(a,.5*b,.5*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);M(a,.5*b,.5*c,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(.5*b,.5*c);b=a.o;b.A=new L(.25,0);b.B=new L(.75,.25);w.q(a);return b},CreateRequest:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,0,
            a*c,!1);d.lineTo(1*b,a*c);d.moveTo(0,(1-a)*c);d.lineTo(1*b,(1-a)*c);d.bb(!1);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},Database:function(a,b,c){a=w.s();var d=.5*cd,e=.1*cd;M(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);N(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);N(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);M(a,1*b,.1*c,!1);N(a,1*b,(.1+e)*c,(.5+d)*b,.2*c,.5*b,.2*c);N(a,(.5-d)*b,.2*c,0,(.1+e)*c,0,.1*c);a.moveTo(1*b,.2*c);
            N(a,1*b,(.2+e)*c,(.5+d)*b,.3*c,.5*b,.3*c);N(a,(.5-d)*b,.3*c,0,(.2+e)*c,0,.2*c);a.moveTo(1*b,.3*c);N(a,1*b,(.3+e)*c,(.5+d)*b,.4*c,.5*b,.4*c);N(a,(.5-d)*b,.4*c,0,(.3+e)*c,0,.3*c);a.bb(!1);b=a.o;b.A=new L(0,.4);b.B=new L(1,.9);w.q(a);return b},StoredData:"DataStorage",DataStorage:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);N(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(0,1*c);N(a,.25*b,.9*c,.25*b,.1*c,0,0);O(a);b=a.o;b.A=new L(.226,0);b.B=new L(.81,1);w.q(a);return b},DiskStorage:function(a,b,c){a=
            w.s();var d=.5*cd,e=.1*cd;M(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);N(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);N(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);M(a,1*b,.1*c,!1);N(a,1*b,(.1+e)*c,(.5+d)*b,.2*c,.5*b,.2*c);N(a,(.5-d)*b,.2*c,0,(.1+e)*c,0,.1*c);a.moveTo(1*b,.2*c);N(a,1*b,(.2+e)*c,(.5+d)*b,.3*c,.5*b,.3*c);N(a,(.5-d)*b,.3*c,0,(.2+e)*c,0,.2*c);a.bb(!1);b=a.o;b.A=new L(0,.3);b.B=new L(1,.9);w.q(a);return b},Display:function(a,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  b,c){a=w.s();M(a,.25*b,0,!0);a.lineTo(.75*b,0);N(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);O(a);b=a.o;b.A=new L(.25,0);b.B=new L(.75,1);w.q(a);return b},DividedEvent:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=w.s(),e=.2*cd;M(d,0,.2*c,!0);N(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);N(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);N(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);N(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c);
            M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.bb(!1);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},DividedProcess:function(a,b,c){a=a?a.Ec:NaN;if(isNaN(a)||.1>a)a=.1;var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,0,a*c,!1);d.lineTo(1*b,a*c);d.bb(!1);b=d.o;b.A=new L(0,a);b.B=Sb;w.q(d);return b},Document:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);b=a.o;b.A=Ab;b.B=new L(1,.6);w.q(a);
            return b},ExternalOrganization:function(a,b,c){a=a?a.Ec:NaN;if(isNaN(a)||.2>a)a=.2;var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,a*b,0,!1);d.lineTo(0,a*c);d.moveTo(1*b,a*c);d.lineTo((1-a)*b,0);d.moveTo(0,(1-a)*c);d.lineTo(a*b,1*c);d.moveTo((1-a)*b,1*c);d.lineTo(1*b,(1-a)*c);d.bb(!1);b=d.o;b.A=new L(a/2,a/2);b.B=new L(1-a/2,1-a/2);w.q(d);return b},ExternalProcess:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);O(a);
            M(a,.1*b,.4*c,!1);a.lineTo(.1*b,.6*c);a.moveTo(.9*b,.6*c);a.lineTo(.9*b,.4*c);a.moveTo(.6*b,.1*c);a.lineTo(.4*b,.1*c);a.moveTo(.4*b,.9*c);a.lineTo(.6*b,.9*c);a.bb(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.75);w.q(a);return b},File:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);O(a);M(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.bb(!1);b=a.o;b.A=new L(0,.25);b.B=Sb;w.q(a);return b},Interrupt:function(a,b,c){a=w.s();M(a,1*b,
            .5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},InternalStorage:function(a,b,c){var d=a?a.Ec:NaN;a=a?a.zu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);O(e);M(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.bb(!1);b=e.o;b.A=new L(d,a);b.B=Sb;w.q(e);return b},Junction:function(a,b,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             c){a=w.s();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,f=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.5+f)*b,1*c,.5*b,1*c);N(a,(.5-f)*b,1*c,0,(.5+f)*c,0,.5*c);N(a,0,(.5-f)*c,(.5-f)*b,0,.5*b,0);N(a,(.5+f)*b,0,1*b,(.5-f)*c,1*b,.5*c);M(a,(e+d)*b,(e+d)*c,!1);a.lineTo(e*b,e*c);a.moveTo(e*b,(e+d)*c);a.lineTo((e+d)*b,e*c);a.bb(!1);b=a.o;b.be=Qj;w.q(a);return b},LinedDocument:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);M(a,.1*
            b,0,!1);a.lineTo(.1*b,.75*c);a.bb(!1);b=a.o;b.A=new L(.1,0);b.B=new L(1,.6);w.q(a);return b},LoopLimit:function(a,b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(0,.25*c);a.lineTo(.25*b,0);a.lineTo(.75*b,0);a.lineTo(1*b,.25*c);a.lineTo(1*b,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=Sb;w.q(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=w.s();var d=.5*cd;M(a,.5*b,1*c,!0);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+
            d)*c,(.5+d)*b,.9*c,.6*b,.9*c);a.lineTo(1*b,.9*c);a.lineTo(1*b,1*c);a.lineTo(.5*b,1*c);b=a.o;b.A=new L(.15,.15);b.B=new L(.85,.8);w.q(a);return b},ManualInput:function(a,b,c){a=w.s();M(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);O(a);b=a.o;b.A=new L(0,.25);b.B=Sb;w.q(a);return b},MessageFromUser:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.7);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(a*b,.5*c);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=Ab;b.B=new L(a,1);w.q(d);return b},
        MicroformProcessing:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.25);var d=w.s();M(d,0,0,!0);d.lineTo(.5*b,a*c);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.5*b,(1-a)*c);d.lineTo(0,1*c);O(d);b=d.o;b.A=new L(0,a);b.B=new L(1,1-a);w.q(d);return b},MicroformRecording:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.15*c);a.lineTo(1*b,.85*c);a.lineTo(.75*b,.75*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=new L(1,.75);w.q(a);return b},MultiDocument:function(a,b,c){c/=.8;a=w.s();
            M(a,b,0,!0);a.lineTo(b,.5*c);N(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);N(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);N(a,.4*b,.4*c,.4*b,1*c,0,.7*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);a.lineTo(.1*b,.1*c);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);O(a);M(a,.1*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.54*c);a.moveTo(.2*b,.1*c);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.44*c);a.bb(!1);b=a.o;b.A=new L(0,.25);b.B=new L(.8,.77);w.q(a);return b},MultiProcess:function(a,b,c){a=w.s();
            M(a,.1*b,.1*c,!0);a.lineTo(.2*b,.1*c);a.lineTo(.2*b,0);a.lineTo(1*b,0);a.lineTo(1*b,.8*c);a.lineTo(.9*b,.8*c);a.lineTo(.9*b,.9*c);a.lineTo(.8*b,.9*c);a.lineTo(.8*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.2*c);a.lineTo(.1*b,.2*c);O(a);M(a,.2*b,.1*c,!1);a.lineTo(.9*b,.1*c);a.lineTo(.9*b,.8*c);a.moveTo(.1*b,.2*c);a.lineTo(.8*b,.2*c);a.lineTo(.8*b,.9*c);a.bb(!1);b=a.o;b.A=new L(0,.2);b.B=new L(.8,1);w.q(a);return b},OfflineStorage:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.1);var d=1-a,e=w.s();M(e,0,0,!0);e.lineTo(1*
            b,0);e.lineTo(.5*b,1*c);O(e);M(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.bb(!1);b=e.o;b.A=new L(d/4+.5*a,a);b.B=new L(3*d/4+.5*a,a+.5*d);w.q(e);return b},OffPageConnector:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(.75*b,0);a.lineTo(1*b,.5*c);a.lineTo(.75*b,1*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=Ab;b.B=new L(.75,1);w.q(a);return b},Or:function(a,b,c){a=w.s();var d=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,
            (.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.bb(!1);b=a.o;b.be=Qj;w.q(a);return b},PaperTape:function(a,b,c){c/=.8;a=w.s();M(a,0,.7*c,!0);a.lineTo(0,.3*c);N(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);N(a,.5*b,.4*c,.5*b,1*c,0,.7*c);O(a);b=a.o;b.A=new L(0,.49);b.B=new L(1,.75);w.q(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Ec:NaN;a=a?a.zu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo(1*b,0);e.lineTo((1-
            a)*b,.5*c);e.lineTo(1*b,1*c);e.lineTo(0,1*c);O(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Ec:NaN;a=a?a.zu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=w.s();M(e,0,0,!0);e.lineTo((1-a)*b,0);e.lineTo(1*b,.5*c);e.lineTo((1-a)*b,1*c);e.lineTo(0,1*c);O(e);b=e.o;b.A=new L(d,0);b.B=new L(1-a,1);w.q(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,
            1*c);O(d);M(d,(1-a)*b,0,!1);d.lineTo((1-a)*b,1*c);d.moveTo(a*b,0);d.lineTo(a*b,1*c);d.bb(!1);b=d.o;b.A=new L(a,0);b.B=new L(1-a,1);w.q(d);return b},Process:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);O(d);M(d,a*b,0,!1);d.lineTo(a*b,1*c);d.bb(!1);b=d.o;b.A=new L(a,0);b.B=Sb;w.q(d);return b},Sort:function(a,b,c){a=w.s();M(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);O(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5*
            c);a.bb(!1);b=a.o;b.A=new L(.25,.25);b.B=new L(.75,.5);w.q(a);return b},Start:function(a,b,c){a=w.s();M(a,.25*b,0,!0);M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);M(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.bb(!1);b=a.o;b.A=new L(.25,0);b.B=new L(.75,1);w.q(a);return b},Terminator:function(a,b,c){a=w.s();M(a,.25*b,0,!0);a.arcTo(270,180,.75*b,.5*c,.25*b,.5*c);a.arcTo(90,180,.25*b,.5*c,.25*b,.5*c);b=a.o;b.A=new L(.23,0);
            b.B=new L(.77,1);w.q(a);return b},TransmittalTape:function(a,b,c){a=a?a.Ec:NaN;isNaN(a)&&(a=.1);var d=w.s();M(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(.75*b,(1-a)*c);d.lineTo(0,(1-a)*c);O(d);b=d.o;b.A=Ab;b.B=new L(1,1-a);w.q(d);return b},AndGate:function(a,b,c){a=w.s();var d=.5*cd;M(a,0,0,!0);a.lineTo(.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=Ab;b.B=new L(.55,1);w.q(a);return b},Buffer:function(a,b,c){a=w.s();M(a,
            0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);O(a);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Clock:function(a,b,c){a=w.s();var d=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);M(a,.8*b,.75*c,!1);a.lineTo(.8*b,.25*c);a.lineTo(.6*b,.25*c);a.lineTo(.6*b,.75*c);a.lineTo(.4*b,.75*c);a.lineTo(.4*b,.25*c);a.lineTo(.2*b,.25*c);a.lineTo(.2*
            b,.75*c);a.bb(!1);b=a.o;b.be=Qj;w.q(a);return b},Ground:function(a,b,c){a=w.s();M(a,.5*b,0,!1);a.lineTo(.5*b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.3*b,.8*c);a.lineTo(.7*b,.8*c);a.moveTo(.4*b,1*c);a.lineTo(.6*b,1*c);b=a.o;w.q(a);return b},Inverter:function(a,b,c){a=w.s();var d=.1*cd;M(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);N(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);N(a,.8*b,(.5-d)*c,(.9-d)*b,.4*
            c,.9*b,.4*c);N(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.o;b.A=new L(0,.25);b.B=new L(.4,.75);w.q(a);return b},NandGate:function(a,b,c){a=w.s();var d=.5*cd,e=.4*cd,f=.1*cd;M(a,.8*b,.5*c,!0);N(a,.8*b,(.5+e)*c,(.4+d)*b,1*c,.4*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.4*b,0);N(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);M(a,1*b,.5*c,!0);N(a,1*b,(.5+f)*c,(.9+f)*b,.6*c,.9*b,.6*c);N(a,(.9-f)*b,.6*c,.8*b,(.5+f)*c,.8*b,.5*c);N(a,.8*b,(.5-f)*c,(.9-f)*b,.4*c,.9*b,.4*c);N(a,(.9+f)*b,.4*c,1*b,(.5-f)*c,1*b,.5*
            c);b=a.o;b.A=new L(0,.05);b.B=new L(.55,.95);w.q(a);return b},NorGate:function(a,b,c){a=w.s();var d=.5,e=cd*d,f=0,h=.5;M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);N(a,(f+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*cd;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A=
            new L(.2,.25);b.B=new L(.6,.75);w.q(a);return b},OrGate:function(a,b,c){a=w.s();var d=.5*cd;M(a,0,0,!0);N(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);N(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);N(a,.25*b,.75*c,.25*b,.25*c,0,0);O(a);b=a.o;b.A=new L(.2,.25);b.B=new L(.75,.75);w.q(a);return b},XnorGate:function(a,b,c){a=w.s();var d=.5,e=cd*d,f=.2,h=.5;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.8*b,.5*c,!0);N(a,.7*b,(h+e)*c,(f+e)*b,(h+d)*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);N(a,(f+e)*
            b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*cd;f=.9;h=.5;M(a,(f-d)*b,h*c,!0);N(a,(f-d)*b,(h-e)*c,(f-e)*b,(h-d)*c,f*b,(h-d)*c);N(a,(f+e)*b,(h-d)*c,(f+d)*b,(h-e)*c,(f+d)*b,h*c);N(a,(f+d)*b,(h+e)*c,(f+e)*b,(h+d)*c,f*b,(h+d)*c);N(a,(f-e)*b,(h+d)*c,(f-d)*b,(h+e)*c,(f-d)*b,h*c);b=a.o;b.A=new L(.4,.25);b.B=new L(.65,.75);w.q(a);return b},XorGate:function(a,b,c){a=w.s();var d=.5*cd;M(a,.1*b,0,!1);N(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);M(a,.2*b,0,!0);N(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);N(a,.9*b,(.5+d)*
            c,(.2+d)*b,1*c,.2*b,1*c);N(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);O(a);b=a.o;b.A=new L(.4,.25);b.B=new L(.8,.75);w.q(a);return b},Capacitor:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Resistor:function(a,b,c){a=w.s();M(a,0,.5*c,!1);a.lineTo(.1*b,0);a.lineTo(.2*b,1*c);a.lineTo(.3*b,0);a.lineTo(.4*b,1*c);a.lineTo(.5*b,0);a.lineTo(.6*b,1*c);a.lineTo(.7*b,.5*c);b=a.o;w.q(a);return b},Inductor:function(a,b,c){a=w.s();var d=.1*cd,e=.1;M(a,(e-.5*
            d)*b,c,!1);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;N(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);N(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;N(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.o;w.q(a);return b},ACvoltageSource:function(a,b,c){a=w.s();var d=.5*cd;M(a,0*b,.5*c,!1);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*
            c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);N(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.o;b.be=Qj;w.q(a);return b},DCvoltageSource:function(a,b,c){a=w.s();M(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},Diode:function(a,b,c){a=w.s();M(a,1*b,0,!1);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);a.lineTo(1*b,1*c);b=a.o;b.A=new L(0,.25);b.B=new L(.5,.75);w.q(a);return b},Wifi:function(a,b,c){var d=b,e=c;
            b*=.38;c*=.6;a=w.s();var f=.8*cd,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);O(a);f=.4*cd;h=.4;k=.2;l=.5;M(a,k*b+d,(l+h)*c+e,!0);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*
                b+d,(l-h)*c+e);N(a,k*b+d,(l-h)*c+e,(k-h+.5*f)*b+d,(l-f)*c+e,(k-h+.5*f)*b+d,l*c+e);N(a,(k-h+.5*f)*b+d,(l+f)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);O(a);f=.2*cd;h=.2;l=k=.5;M(a,(k-h)*b+d,l*c+e,!0);N(a,(k-h)*b+d,(l-f)*c+e,(k-f)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,(k-f)*b+d,(l+h)*c+e,(k-h)*b+d,(l+f)*c+e,(k-h)*b+d,l*c+e);f=.4*cd;h=.4;k=.8;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l-
                h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);O(a);f=.8*cd;h=.8;k=1;l=.5;M(a,k*b+d,(l-h)*c+e,!0);N(a,(k+f)*b+d,(l-h)*c+e,(k+h)*b+d,(l-f)*c+e,(k+h)*b+d,l*c+e);N(a,(k+h)*b+d,(l+f)*c+e,(k+f)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);N(a,k*b+d,(l+h)*c+e,(k+h-.5*f)*b+d,(l+f)*c+e,(k+h-.5*f)*b+d,l*c+e);N(a,(k+h-.5*f)*b+d,(l-f)*c+
                e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);O(a);b=a.o;w.q(a);return b},Email:function(a,b,c){a=w.s();M(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);O(a);M(a,0,0,!1);a.lineTo(.5*b,.6*c);a.lineTo(1*b,0);a.moveTo(0,1*c);a.lineTo(.45*b,.54*c);a.moveTo(1*b,1*c);a.lineTo(.55*b,.54*c);a.bb(!1);b=a.o;w.q(a);return b},Ethernet:function(a,b,c){a=w.s();M(a,.35*b,0,!0);a.lineTo(.65*b,0);a.lineTo(.65*b,.4*c);a.lineTo(.35*b,.4*c);a.lineTo(.35*b,0);O(a);M(a,.1*b,1*c,!0,!0);a.lineTo(.4*b,1*c);
            a.lineTo(.4*b,.6*c);a.lineTo(.1*b,.6*c);a.lineTo(.1*b,1*c);O(a);M(a,.6*b,1*c,!0,!0);a.lineTo(.9*b,1*c);a.lineTo(.9*b,.6*c);a.lineTo(.6*b,.6*c);a.lineTo(.6*b,1*c);O(a);M(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.5*b,.4*c);a.moveTo(.75*b,.5*c);a.lineTo(.75*b,.6*c);a.moveTo(.25*b,.5*c);a.lineTo(.25*b,.6*c);a.bb(!1);b=a.o;w.q(a);return b},Power:function(a,b,c){a=w.s();var d=.4*cd,e=.4,f=w.K(),h=w.K(),k=w.K(),l=w.K();ee(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);var m=w.xb(h.x,
            h.y);M(a,h.x*b,h.y*c,!0);N(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);N(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);ee(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);N(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*cd;e=.3;ee(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,f,f);a.lineTo(h.x*b,h.y*c);N(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);N(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);N(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+
            e)*b,.5*c);ee(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,f,f,h,k,l);N(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);O(a);M(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);O(a);w.v(f);w.v(h);w.v(k);w.v(l);w.v(m);b=a.o;b.A=new L(.25,.55);b.B=new L(.75,.8);w.q(a);return b},Fallout:function(a,b,c){a=w.s();var d=.5*cd;M(a,0*b,.5*c,!0);N(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);N(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,
            .5*c);var e=d=0;M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.4;e=0;O(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);d=.2;e=-.3;O(a);M(a,(.3+d)*b,(.8+e)*c,!0,!0);a.lineTo((.5+d)*b,(.5+e)*c);a.lineTo((.1+d)*b,(.5+e)*c);a.lineTo((.3+d)*b,(.8+e)*c);O(a);b=a.o;b.be=Qj;w.q(a);return b},IrritationHazard:function(a,b,c){a=w.s();M(a,.2*b,0*c,!0);a.lineTo(.5*b,.3*c);a.lineTo(.8*
            b,0*c);a.lineTo(1*b,.2*c);a.lineTo(.7*b,.5*c);a.lineTo(1*b,.8*c);a.lineTo(.8*b,1*c);a.lineTo(.5*b,.7*c);a.lineTo(.2*b,1*c);a.lineTo(0*b,.8*c);a.lineTo(.3*b,.5*c);a.lineTo(0*b,.2*c);O(a);b=a.o;b.A=new L(.3,.3);b.B=new L(.7,.7);w.q(a);return b},ElectricalHazard:function(a,b,c){a=w.s();M(a,.37*b,0*c,!0);a.lineTo(.5*b,.11*c);a.lineTo(.77*b,.04*c);a.lineTo(.33*b,.49*c);a.lineTo(1*b,.37*c);a.lineTo(.63*b,.86*c);a.lineTo(.77*b,.91*c);a.lineTo(.34*b,1*c);a.lineTo(.34*b,.78*c);a.lineTo(.44*b,.8*c);a.lineTo(.65*
            b,.56*c);a.lineTo(0*b,.68*c);O(a);b=a.o;w.q(a);return b},FireHazard:function(a,b,c){a=w.s();M(a,.1*b,1*c,!0);N(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);N(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);N(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);N(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);N(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);N(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);O(a);b=a.o;b.A=new L(.05,.645);b.B=new L(.884,.908);w.q(a);return b},BpmnActivityLoop:function(a,b,c){a=w.s();var d=4*(Math.SQRT2-1)/3*.5;M(a,.65*b,1*c,
            !1);N(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);N(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);N(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);N(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.35*b,.98*c);a.moveTo(.25*b,.8*c);a.lineTo(.35*b,1*c);a.lineTo(.1*b,1*c);b=a.o;w.q(a);return b},BpmnActivityParallel:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},BpmnActivitySequential:function(a,b,c){a=w.s();M(a,0,0,!1);a.lineTo(1*
            b,0);a.moveTo(0,.5*c);a.lineTo(1*b,.5*c);a.moveTo(0,1*c);a.lineTo(1*b,1*c);b=a.o;w.q(a);return b},BpmnActivityAdHoc:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,1*b,1*c,!1);M(a,0,.5*c,!1);N(a,.2*b,.35*c,.3*b,.35*c,.5*b,.5*c);N(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.o;w.q(a);return b},BpmnActivityCompensation:function(a,b,c){a=w.s();M(a,0,.5*c,!0);a.lineTo(.5*b,0);a.lineTo(.5*b,.5*c);a.lineTo(1*b,1*c);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);a.lineTo(.5*b,1*c);O(a);b=a.o;w.q(a);return b},BpmnTaskMessage:function(a,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      b,c){a=w.s();M(a,0,.2*c,!0);a.lineTo(1*b,.2*c);a.lineTo(1*b,.8*c);a.lineTo(0,.8*c);a.lineTo(0,.8*c);O(a);M(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.bb(!1);b=a.o;w.q(a);return b},BpmnTaskScript:function(a,b,c){a=w.s();M(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);N(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,0);N(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);O(a);M(a,.45*b,.73*c,!1);a.lineTo(.7*b,.73*c);a.moveTo(.38*b,.5*c);a.lineTo(.63*b,.5*c);a.moveTo(.31*b,.27*c);a.lineTo(.56*b,.27*c);a.bb(!1);b=a.o;w.q(a);return b},
        BpmnTaskUser:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,.335*b,(1-.555)*c,!0);a.lineTo(.335*b,.595*c);a.lineTo(.665*b,.595*c);a.lineTo(.665*b,(1-.555)*c);N(a,.88*b,.46*c,.98*b,.54*c,1*b,.68*c);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.68*c);N(a,.02*b,.54*c,.12*b,.46*c,.335*b,(1-.555)*c);a.lineTo(.365*b,.405*c);var d=.5-.285,e=Math.PI/4,f=4*(1-Math.cos(e))/(3*Math.sin(e)),e=f*d,f=f*d;N(a,(.5-(e+d)/2)*b,(d+(d+f)/2)*c,(.5-d)*b,(d+f)*c,(.5-d)*b,d*c);N(a,(.5-d)*b,(d-f)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c);
            N(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-f)*c,(.5+d)*b,d*c);N(a,(.5+d)*b,(d+f)*c,(.5+(e+d)/2)*b,(d+(d+f)/2)*c,.635*b,.405*c);a.lineTo(.635*b,.405*c);a.lineTo(.665*b,(1-.555)*c);a.lineTo(.665*b,.595*c);a.lineTo(.335*b,.595*c);M(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);M(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.o;w.q(a);return b},BpmnEventConditional:function(a,b,c){a=w.s();M(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);O(a);M(a,.2*b,.2*c,!1);a.lineTo(.8*b,.2*c);a.moveTo(.2*b,.4*c);a.lineTo(.8*
            b,.4*c);a.moveTo(.2*b,.6*c);a.lineTo(.8*b,.6*c);a.moveTo(.2*b,.8*c);a.lineTo(.8*b,.8*c);a.bb(!1);b=a.o;w.q(a);return b},BpmnEventError:function(a,b,c){a=w.s();M(a,0,1*c,!0);a.lineTo(.33*b,0);a.lineTo(.66*b,.5*c);a.lineTo(1*b,0);a.lineTo(.66*b,1*c);a.lineTo(.33*b,.5*c);O(a);b=a.o;w.q(a);return b},BpmnEventEscalation:function(a,b,c){a=w.s();M(a,0,0,!1);M(a,1*b,1*c,!1);M(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);O(a);b=a.o;w.q(a);return b},BpmnEventTimer:function(a,b,c){a=
            w.s();var d=.5*cd;M(a,1*b,.5*c,!0);N(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);N(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);N(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);N(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);M(a,.5*b,0,!1);a.lineTo(.5*b,.15*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,.85*c);a.moveTo(0,.5*c);a.lineTo(.15*b,.5*c);a.moveTo(1*b,.5*c);a.lineTo(.85*b,.5*c);a.moveTo(.5*b,.5*c);a.lineTo(.58*b,.1*c);a.moveTo(.5*b,.5*c);a.lineTo(.78*b,.54*c);a.bb(!1);b=a.o;b.be=Qj;w.q(a);return b}},Wq;for(Wq in jq)jq[Wq.toLowerCase()]=Wq;
    var qq={"":"",Standard:"F1 m 0,0 l 8,4 -8,4 2,-4 z",Backward:"F1 m 8,0 l -2,4 2,4 -8,-4 z",Triangle:"F1 m 0,0 l 8,4.62 -8,4.62 z",BackwardTriangle:"F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",Boomerang:"F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",BackwardBoomerang:"F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",SidewaysV:"m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",BackwardV:"m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",OpenTriangle:"m 0,0 l 8,4 -8,4",BackwardOpenTriangle:"m 8,0 l -8,4 8,4",OpenTriangleLine:"m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
        BackwardOpenTriangleLine:"m 8,0 l  -8,4 8,4 m -8.5,0 l 0,-8",OpenTriangleTop:"m 0,0 l 8,4 m 0,4",BackwardOpenTriangleTop:"m 8,0 l -8,4 m 0,4",OpenTriangleBottom:"m 0,8 l 8,-4",BackwardOpenTriangleBottom:"m 0,4 l 8,4",HalfTriangleTop:"F1 m 0,0 l 0,4 8,0 z m 0,8",BackwardHalfTriangleTop:"F1 m 8,0 l 0,4 -8,0 z m 0,8",HalfTriangleBottom:"F1 m 0,4 l 0,4 8,-4 z",BackwardHalfTriangleBottom:"F1 m 8,4 l 0,4 -8,-4 z",ForwardSemiCircle:"m 4,0 b 270 180 0 4 4",BackwardSemiCircle:"m 4,8 b 90 180 0 -4 4",Feather:"m 0,0 l 3,4 -3,4",
        BackwardFeather:"m 3,0 l -3,4 3,4",DoubleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardDoubleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",TripleFeathers:"m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",BackwardTripleFeathers:"m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",ForwardSlash:"m 0,8 l 5,-8",BackSlash:"m 0,0 l 5,8",DoubleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8",DoubleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8",TripleForwardSlash:"m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
        TripleBackSlash:"m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",Fork:"m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",LineFork:"m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",BackwardLineFork:"m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",CircleFork:"F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",BackwardCircleFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",CircleLineFork:"F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
        BackwardCircleLineFork:"F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",Circle:"F1 m 8,4 b 0 360 -4 0 4 z",Block:"F1 m 0,0 l 0,8 8,0 0,-8 z",StretchedDiamond:"F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",Diamond:"F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",Chevron:"F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",StretchedChevron:"F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",NormalArrow:"F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",X:"m 0,0 l 8,8 m 0,-8 l -8,8",TailedNormalArrow:"F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
        DoubleTriangle:"F1 m 0,0 l 4,4 -4,4 0,-8 z  m 4,0 l 4,4 -4,4 0,-8 z",BigEndArrow:"F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",ConcaveTailArrow:"F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",RoundedTriangle:"F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",SimpleArrow:"F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",AccelerationArrow:"F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",BoxArrow:"F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
        TriangleLine:"F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",CircleEndedArrow:"F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",DynamicWidthArrow:"F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",EquilibriumArrow:"m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",FastForward:"F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",Kite:"F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",HalfArrowTop:"F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",HalfArrowBottom:"F1 m 0,8 l 4,-4 4,0 -8,4 z",
        OpposingDirectionDoubleArrow:"F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",PartialDoubleTriangle:"F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",LineCircle:"F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",DoubleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",TripleLineCircle:"F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",CircleLine:"F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",DiamondCircle:"F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",PlusCircle:"F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
        OpenRightTriangleTop:"m 8,0 l 0,4 -8,0 m 0,4",OpenRightTriangleBottom:"m 8,8 l 0,-4 -8,0",Line:"m 0,0 l 0,8",DoubleLine:"m 0,0 l 0,8 m 2,0 l 0,-8",TripleLine:"m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",PentagonArrow:"F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"};
    function nq(a){var b=Rd[a];if(void 0===b){var c=a.toLowerCase();if("none"===c)return"None";b=Rd[c];if(void 0===b){var d=null,e;for(e in qq)if(e.toLowerCase()===c){d=e;break}if(null!==d)return a=Pe(qq[d],!1),Rd[d]=a,c!==d&&(Rd[c]=d),d}}return"string"===typeof b?b:b instanceof Ce?a:null}
    function R(a){C.call(this,a);this.N=2408959;this.ql=this.yi="";this.Ms=this.Js=this.Vs=this.Vr=null;this.Xs="";this.wi=this.Hr=this.Ws=this.cn=null;this.Ls="";this.ip=null;this.Ks=Gd;this.Ns="";this.jp=null;this.Jd="";this.Uv=this.Vq=this.al=null;this.Ti=(new z(NaN,NaN)).freeze();this.$r="";this.tl=null;this.as=Ab;this.js=pd;this.bs=qd;this.or=null;this.Wr=Xq;this.en=od;this.dn="gray";this.Gg=4;this.eD=-1;this.vt=NaN;this.NG=new B;this.Rm=null;this.ck=NaN}w.Ka(R,C);w.ga("Part",R);
    R.prototype.cloneProtected=function(a){C.prototype.cloneProtected.call(this,a);a.N=this.N&-4097|49152;a.yi=this.yi;a.ql=this.ql;a.Vr=this.Vr;a.Vs=this.Vs;a.Js=this.Js;a.Ms=this.Ms;a.Xs=this.Xs;a.Ws=this.Ws;a.Hr=this.Hr;a.wi=null;a.Ls=this.Ls;a.Ks=this.Ks.S();a.Ns=this.Ns;a.Jd=this.Jd;a.Vq=this.Vq;a.Ti.assign(this.Ti);a.$r=this.$r;a.as=this.as.S();a.js=this.js.S();a.bs=this.bs.S();a.or=this.or;a.Wr=this.Wr;a.en=this.en.S();a.dn=this.dn;a.Gg=this.Gg;a.vt=this.vt};
    R.prototype.oi=function(a){C.prototype.oi.call(this,a);a.Gk();a.cn=null;a.ip=null;a.jp=null;a.tl=null;a.Rm=null};R.prototype.toString=function(){var a=w.lf(Object.getPrototypeOf(this))+"#"+w.Od(this);null!==this.data&&(a+="("+Rf(this.data)+")");return a};R.LayoutNone=0;var Lm;R.LayoutAdded=Lm=1;var Um;R.LayoutRemoved=Um=2;R.LayoutShown=4;R.LayoutHidden=8;R.LayoutNodeSized=16;var An;R.LayoutGroupLayout=An=32;R.LayoutNodeReplaced=64;var Xq;R.LayoutStandard=Xq=Lm|Um|28|An|64;R.LayoutAll=16777215;
    R.prototype.Xn=function(a,b,c,d,e,f,h){var k=this.g;null!==k&&(a===Pf&&"elements"===b?e instanceof C?Mm(e,function(a){Om(k,a);Nm(k,a)}):e instanceof xl&&mn(k,e):a===Qf&&"elements"===b&&(e instanceof C?Mm(e,function(a){Sm(k,a);Rm(k,a)}):e instanceof xl&&nn(k,e)),k.ad(a,b,c,d,e,f,h))};R.prototype.updateTargetBindings=R.prototype.Ib=function(a){C.prototype.Ib.call(this,a);if(null!==this.data){a=this.xa.n;for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof C&&Mm(d,function(a){null!==a.data&&a.Ib()})}}};
    R.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.aa;c instanceof Q&&(a=c.Cn(a),b=b.VH(a),null===b||b instanceof V)&&(this.Da=b)}}};w.u(R,{key:"key"},function(){var a=this.g;return null===a?void 0:a.aa.pb(this.data)},{configurable:!0});w.u(R,{Pw:"adornments"},function(){return null===this.wi?ua:this.wi.CF});R.prototype.findAdornment=R.prototype.Qp=function(a){var b=this.wi;return null===b?null:b.ka(a)};
    R.prototype.addAdornment=R.prototype.Gl=function(a,b){if(null!==b){var c=null,d=this.wi;null!==d&&(c=d.ka(a));if(c!==b){if(null!==c){var e=c.g;null!==e&&e.remove(c)}null===d&&(this.wi=d=new ma("string",kh));b.yi!==a&&(b.vd=a);d.add(a,b);c=this.g;null!==c&&(c.add(b),b.data=this.data)}}};R.prototype.removeAdornment=R.prototype.Bj=function(a){var b=this.wi;if(null!==b){var c=b.ka(a);if(null!==c){var d=c.g;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.wi=null)}};
    R.prototype.clearAdornments=R.prototype.Et=function(){var a=this.wi;if(null!==a){for(var b=w.cb(),a=a.i;a.next();)b.push(a.key);for(var a=b.length,c=0;c<a;c++)this.Bj(b[c]);w.ta(b)}};
    R.prototype.updateAdornments=function(){var a=this.g;if(null!==a){a:{if(this.ib&&this.BJ){var b=this.Iu;if(!(null!==b&&this.W.I()&&this.isVisible()&&b.xj()&&b.W.I()))break a;var c=this.Qp("Selection");if(null===c){c=this.CJ;null===c&&(c=this instanceof W?a.NI:this instanceof V?a.iI:a.fJ);if(!(c instanceof kh))break a;mh(c);c=c.copy();null!==c&&(c.sb=b)}if(null!==c){var d=c.placeholder;if(null!==d){var e=b.pj(),f=0;b instanceof X&&(f=b.lb);var h=w.mm();h.m((b.Ja.width+f)*e,(b.Ja.height+f)*e);d.Ca=
        h;w.Ck(h)}c.angle=b.Wl();c.type!==hj&&(d=w.K(),c.location=b.Wa(Ab,d),w.v(d));this.Gl("Selection",c);break a}}this.Bj("Selection")}Yq(this,a);for(a=this.Pw;a.next();)b=a.value,b.Ib(),b.H()}};function Yq(a,b){b.eb.df.each(function(b){b.isEnabled&&b.updateAdornments(a)});b.eb.updateAdornments(a)}w.u(R,{layer:"layer"},function(){return this.Uv});w.u(R,{g:"diagram"},function(){var a=this.Uv;return null!==a?a.g:null});
    w.defineProperty(R,{ag:"layerName"},function(){return this.ql},function(a){var b=this.ql;if(b!==a){w.j(a,"string",R,"layerName");var c=this.g;if(null===c||null!==c.Nt(a)&&!c.Fq)if(this.ql=a,null!==c&&c.sc(),this.h("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.g,null!==c&&(a=c.Nt(a),null!==a&&a!==b))){var d=b.nf(-1,this,!0);0<=d&&c.ad(Qf,"parts",b,this,null,d,!0);d=a.Xp(99999999,this,!0);b.visible!==a.visible&&this.yd(a.visible);0<=d&&c.ad(Pf,"parts",a,null,this,!0,d);d=this.Hx;if(null!==
        d){var e=c.Ta;c.Ta=!0;d(this,b,a);c.Ta=e}}}});w.defineProperty(R,{Hx:"layerChanged"},function(){return this.Vr},function(a){var b=this.Vr;b!==a&&(null!==a&&w.j(a,"function",R,"layerChanged"),this.Vr=a,this.h("layerChanged",b,a))});w.defineProperty(R,{io:"zOrder"},function(){return this.vt},function(a){var b=this.vt;if(b!==a){w.j(a,"number",R,"zOrder");this.vt=a;var c=this.layer;null!==c&&ol(c,-1,this);this.h("zOrder",b,a);a=this.g;null!==a&&a.oa()}});
    R.prototype.invalidateAdornments=R.prototype.de=function(){var a=this.g;null!==a&&(Ml(a),0!==(this.N&16384)!==!0&&(this.N|=16384,a.Ne()))};function kl(a){0!==(a.N&16384)!==!1&&(a.updateAdornments(),a.N&=-16385)}function Zq(a){if(!1===Em(a)){var b=a.g;null!==b&&(b.xg.add(a),b.Ne());$q(a,!0);a.Mi()}}function ar(a){a.N|=2097152;if(!1!==Em(a)){var b=a.position,c=a.location;c.I()&&b.I()||br(a,b,c);var c=a.oc,d=c.copy();c.Qa();c.x=b.x;c.y=b.y;c.freeze();a.Qx(d,c);$q(a,!1)}}
    w.u(R,{bg:"locationObject"},function(){if(null===this.tl){var a=this.KA;""!==a?(a=this.xd(a),this.tl=null!==a?a:this):this.tl=this instanceof kh?this.type!==hj&&null!==this.placeholder?this.placeholder:this:this}return this.tl.visible?this.tl:this});w.defineProperty(R,{ZI:"minLocation"},function(){return this.js},function(a){var b=this.js;b.L(a)||(this.js=a=a.S(),this.h("minLocation",b,a))});
    w.defineProperty(R,{TI:"maxLocation"},function(){return this.bs},function(a){var b=this.bs;b.L(a)||(this.bs=a=a.S(),this.h("maxLocation",b,a))});w.defineProperty(R,{KA:"locationObjectName"},function(){return this.$r},function(a){var b=this.$r;b!==a&&(this.$r=a,this.tl=null,this.H(),this.h("locationObjectName",b,a))});w.defineProperty(R,{Ff:"locationSpot"},function(){return this.as},function(a){var b=this.as;b.L(a)||(this.as=a=a.S(),this.H(),this.h("locationSpot",b,a))});
    R.prototype.move=function(a){this.position=a};R.prototype.moveTo=R.prototype.moveTo=function(a,b){var c=w.xb(a,b);this.move(c);w.v(c)};R.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a&&!a.visible)return!1;a=this.g;if(null!==a&&(a=a.Oa,a.of&&(a=a.Tm.ka(this),null!==a&&a.Zx)))return!0;a=this.Da;return null===a||a.Zc&&a.isVisible()?!0:!1};
    R.prototype.yd=function(a){var b=this.g;a?(this.J(4),this.de(),null!==b&&b.xg.add(this)):(this.J(8),this.Et());this.Gk();null!==b&&(b.sc(),b.oa())};
    R.prototype.findObject=R.prototype.xd=function(a){if(this.name===a)return this;var b=this.Rm;null===b&&(this.Rm=b=new ra);if(void 0!==b[a])return b[a];for(var c=this.xa.n,d=c.length,e=0;e<d;e++){var f=c[e];if(f.name===a)return b[a]=f;if(f instanceof C)if(null===f.$j&&null===f.zg){if(f=f.xd(a),null!==f)return b[a]=f}else if(kn(f)&&(f=f.xa.first(),null!==f&&f.name===a))return b[a]=f}return b[a]=null};
    function cr(a,b,c,d){void 0===d&&(d=new z);c=c.Sd()?Jb:c;var e=b.Ja;d.m(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.nb(d);for(b=b.Q;null!==b&&b!==a;)b.transform.nb(d),b=b.Q;a.Si.nb(d);d.offset(-a.sd.x,-a.sd.y);return d}R.prototype.ensureBounds=R.prototype.Je=function(){xk(this,Infinity,Infinity);this.jc()};
    function nl(a,b){var c=a.NG,d;isNaN(a.ck)&&(a.ck=$p(a));d=a.ck;var e=2*d;if(!a.dm)return c.m(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;var e=b.y,f=b.width,h=b.height,k=a.shadowBlur,l=a.GJ,f=f+k,h=h+k;d-=k/2;e-=k/2;0<l.x?f+=l.x:(d+=l.x,f-=l.x);0<l.y?h+=l.y:(e+=l.y,h-=l.y);c.m(d-1,e-1,f+2,h+2);return c}
    R.prototype.jc=function(){this.Mi();if(!1===Dm(this))ar(this);else{var a=this.oc,b=w.Jf();b.assign(a);a.Qa();var c=jl(this);this.jj(0,0,this.sd.width,this.sd.height);var d=this.position;br(this,d,this.location);a.x=d.x;a.y=d.y;a.freeze();this.Qx(b,a);Fo(this,!1);b.L(a)?this.Hf(c):!this.ee()||J(b.width,a.width)&&J(b.height,a.height)||0<=this.eD&&this.J(16);w.Db(b);$q(this,!1)}};
    R.prototype.Qx=function(a,b){var c=this.g;if(null!==c){var d=!1;if(!1===c.Wj&&a.I()){var e=c.se,f=c.padding,h=e.x+f.left,k=e.y+f.top,l=e.width-2*f.right,e=e.height-2*f.bottom;a.x>h&&a.y>k&&a.right<l&&a.bottom<e&&b.x>h&&b.y>k&&b.right<l&&b.bottom<e&&(d=!0)}0!==(this.N&65536)!==!0&&a.L(b)||Pm(this,d,c);c.oa();Va(a,b)||(this instanceof T&&!c.ia.ab&&this.$f(),this.Gk())}};
    w.defineProperty(R,{location:"location"},function(){return this.Ti},function(a){var b=a.x,c=a.y,d=this.Ti,e=d.x,f=d.y;(e===b||isNaN(e)&&isNaN(b))&&(f===c||isNaN(f)&&isNaN(c))||(a=a.S(),b=a,this instanceof W?b=!1:(this.Ti=b,this.N|=2097152,!1===Dm(this)&&(Zq(this),c=this.jb,c.I()&&(e=c.copy(),c.m(c.x+(b.x-d.x),c.y+(b.y-d.y)),dr(this,this.g,c,e),this.h("position",e,c))),b=!0),b&&this.h("location",d,a))});g=R.prototype;
    g.oB=function(a,b){if(this instanceof W||!a.I())return!1;var c=this.g;if(null!==c&&(dr(this,c,a,b),!0===c.ia.ab))return!0;this.jb=a;this.N&=-2097153;c=this.Ti;if(c.I()){var d=c.copy();c.m(c.x+(a.x-b.x),c.y+(a.y-b.y));this.h("location",d,c)}!1===Em(this)&&!1===Dm(this)&&(Zq(this),ar(this));return!0};function dr(a,b,c,d){null===b||a instanceof kh||(b=b.Oa,b.qc&&Yk(b,a,"position",d.copy(),c.copy(),!1))}
    g.ny=function(a,b){var c=this.Ti,d=this.jb;Em(this)||Dm(this)?c.m(NaN,NaN):c.m(c.x+a-d.x,c.y+b-d.y);d.m(a,b);Zq(this)};g.pB=function(){this.N&=-2097153;Zq(this)};
    function br(a,b,c){var d=w.K(),e=a.Ff,f=a.bg;e.Sd()&&w.k("determineOffset: Part's locationSpot must be real: "+e.toString());var h=f.Ja,k=f instanceof X?f.lb:0;d.Lu(0,0,h.width+k,h.height+k,e);if(f!==a)for(d.offset(-k/2,-k/2),f.transform.nb(d),e=f.Q;null!==e&&e!==a;)e.transform.nb(d),e=e.Q;a.Si.nb(d);d.offset(-a.sd.x,-a.sd.y);e=a.g;f=c.I();h=b.I();f&&h?0!==(a.N&2097152)?er(a,b,c,e,d):fr(a,b,c,e,d):f?er(a,b,c,e,d):h&&fr(a,b,c,e,d);a.N|=2097152;w.v(d);a.Mi()}
    function er(a,b,c,d,e){var f=b.x,h=b.y;b.m(c.x-e.x,c.y-e.y);null!==d&&(c=d.Oa,(e=c.Xj)||!c.qc||a instanceof kh||Yk(c,a,"position",new z(f,h),b,!1),e||b.x===f&&b.y===h||(c=d.wb,d.wb=!0,a.h("position",new z(f,h),b),d.wb=c))}function fr(a,b,c,d,e){var f=c.copy();c.m(b.x+e.x,b.y+e.y);c.L(f)||null===d||(b=d.wb,d.wb=!0,a.h("location",f,c),d.wb=b)}
    function Pm(a,b,c){Ho(a,!1);a instanceof T&&c.CA(a);a.layer.Mc||b||c.sc();b=a.oc;var d=c.qb;d.I()?(jl(a)?$a(b,d)||a.Hf(!1):b.Zf(d)&&a.Hf(!0),a.updateAdornments()):c.jl=!0}g.cm=function(){return!0};
    function ll(a,b){var c=a.oc;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)&&a.isVisible()){var d=a.transform;null!==a.bc&&(No(a,b,a.bc,!0,!0),b.fillRect(c.x,c.y,c.width,c.height));null===a.bc&&null===a.Eb&&(No(a,b,"rgba(0,0,0,0.4)",!0,!1),b.fillRect(c.x,c.y,c.width,c.height));null!==a.Eb&&(d.hu()||b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),c=a.Ja,No(a,b,a.Eb,!0,!1),b.fillRect(0,0,c.width,c.height),d.hu()||(c=1/(d.m11*d.m22-d.m12*d.m21),b.transform(d.m22*c,-d.m12*c,-d.m21*c,d.m11*c,c*(d.m21*
        d.dy-d.m22*d.dx),c*(d.m12*d.dx-d.m11*d.dy))))}}g.ee=function(){return!0};g.tj=function(){return!0};
    w.defineProperty(R,{vd:"category"},function(){return this.yi},function(a){var b=this.yi;if(b!==a){w.j(a,"string",R,"category");var c=this.g,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof kh)){var f=c.aa.ia;f.isEnabled&&!f.ab&&(e=this.clone(),e.xa.Jc(this.xa))}this.yi=a;this.h("category",b,a);null===c||null===d||this instanceof kh?(e=this.xf,null!==e&&(a=e.wi,null!==a&&a.remove(b),e.Gl(this.vd,this))):(f=c.aa,f.ia.ab||(this instanceof W?(f instanceof Q?f.lG(d,a):f instanceof $f&&f.EJ(d,
            a),c=un(c,a),null!==c&&(mh(c),c=c.copy(),null!==c&&gr(this,c,b,a))):(null!==f&&f.ky(d,a),c=rn(c,d,a),null!==c&&(mh(c),c=c.copy(),null===c||c instanceof W||(c.location=this.location,gr(this,c,b,a)))),null!==e&&(b=this.clone(),b.xa.Jc(this.xa),this.h("self",e,b))))}});w.defineProperty(R,{self:"self"},function(){return this},function(a){gr(this,a,this.vd,a.vd)});var hr=!1;
    function gr(a,b,c,d){b.constructor===a.constructor||hr||(hr=!0,w.trace('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),w.trace("  Old class: "+w.lf(a)+", new class: "+w.lf(b)+", part: "+a.toString()));a.Et();var e=a.data;c=a.ag;var f=a.ib,h=a.Qg,k=!0,l=!0,m=!1;if(a instanceof T)var n=a,k=n.wj,l=n.tc,m=n.zq;b.oi(a);b.cloneProtected(a);a.yi=d;a.H();a.oa();b=a.g;d=!0;null!==b&&(d=b.wb,b.wb=!0);a.Zd=e;null!==e&&a.Ib();null!==b&&(b.wb=d);e=a.ag;e!==c&&(a.ql=c,
        a.ag=e);a instanceof T&&(n=a,n.wj=k,n.tc=l,n.zq=m,n.ee()&&n.J(64));a.ib=f;a.Qg=h}R.prototype.canCopy=function(){if(!this.GH)return!1;var a=this.layer;if(null===a)return!0;if(!a.tk)return!1;a=a.g;return null===a?!0:a.tk?!0:!1};R.prototype.canDelete=function(){if(!this.LH)return!1;var a=this.layer;if(null===a)return!0;if(!a.kn)return!1;a=a.g;return null===a?!0:a.kn?!0:!1};
    R.prototype.canEdit=function(){if(!this.NJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.Tw)return!1;a=a.g;return null===a?!0:a.Tw?!0:!1};R.prototype.canGroup=function(){if(!this.jI)return!1;var a=this.layer;if(null===a)return!0;if(!a.Qw)return!1;a=a.g;return null===a?!0:a.Qw?!0:!1};R.prototype.canMove=function(){if(!this.dJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.Jl)return!1;a=a.g;return null===a?!0:a.Jl?!0:!1};
    R.prototype.canReshape=function(){if(!this.qJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.Rw)return!1;a=a.g;return null===a?!0:a.Rw?!0:!1};R.prototype.canResize=function(){if(!this.rJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.Dt)return!1;a=a.g;return null===a?!0:a.Dt?!0:!1};R.prototype.canRotate=function(){if(!this.uJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.Sw)return!1;a=a.g;return null===a?!0:a.Sw?!0:!1};
    R.prototype.canSelect=function(){if(!this.gm)return!1;var a=this.layer;if(null===a)return!0;if(!a.yf)return!1;a=a.g;return null===a?!0:a.yf?!0:!1};w.defineProperty(R,{GH:"copyable"},function(){return 0!==(this.N&1)},function(a){var b=0!==(this.N&1);b!==a&&(this.N^=1,this.h("copyable",b,a))});w.defineProperty(R,{LH:"deletable"},function(){return 0!==(this.N&2)},function(a){var b=0!==(this.N&2);b!==a&&(this.N^=2,this.h("deletable",b,a))});
    w.defineProperty(R,{NJ:"textEditable"},function(){return 0!==(this.N&4)},function(a){var b=0!==(this.N&4);b!==a&&(this.N^=4,this.h("textEditable",b,a),this.de())});w.defineProperty(R,{jI:"groupable"},function(){return 0!==(this.N&8)},function(a){var b=0!==(this.N&8);b!==a&&(this.N^=8,this.h("groupable",b,a))});w.defineProperty(R,{dJ:"movable"},function(){return 0!==(this.N&16)},function(a){var b=0!==(this.N&16);b!==a&&(this.N^=16,this.h("movable",b,a))});
    w.defineProperty(R,{BJ:"selectionAdorned"},function(){return 0!==(this.N&32)},function(a){var b=0!==(this.N&32);b!==a&&(this.N^=32,this.h("selectionAdorned",b,a),this.de())});w.defineProperty(R,{FA:"isInDocumentBounds"},function(){return 0!==(this.N&64)},function(a){var b=0!==(this.N&64);if(b!==a){this.N^=64;var c=this.g;null!==c&&c.sc();this.h("isInDocumentBounds",b,a)}});
    w.defineProperty(R,{xF:"isLayoutPositioned"},function(){return 0!==(this.N&128)},function(a){var b=0!==(this.N&128);b!==a&&(this.N^=128,this.h("isLayoutPositioned",b,a),this.J(a?4:8))});w.defineProperty(R,{gm:"selectable"},function(){return 0!==(this.N&256)},function(a){var b=0!==(this.N&256);b!==a&&(this.N^=256,this.h("selectable",b,a),this.de())});
    w.defineProperty(R,{qJ:"reshapable"},function(){return 0!==(this.N&512)},function(a){var b=0!==(this.N&512);b!==a&&(this.N^=512,this.h("reshapable",b,a),this.de())});w.defineProperty(R,{rJ:"resizable"},function(){return 0!==(this.N&1024)},function(a){var b=0!==(this.N&1024);b!==a&&(this.N^=1024,this.h("resizable",b,a),this.de())});w.defineProperty(R,{uJ:"rotatable"},function(){return 0!==(this.N&2048)},function(a){var b=0!==(this.N&2048);b!==a&&(this.N^=2048,this.h("rotatable",b,a),this.de())});
    w.defineProperty(R,{ib:"isSelected"},function(){return 0!==(this.N&4096)},function(a){var b=0!==(this.N&4096);if(b!==a){var c=this.g;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.UI)){this.N^=4096;var d=!1;if(null!==c){d=c.wb;c.wb=!0;var e=c.selection;e.Qa();a?e.add(this):e.remove(this);e.freeze()}this.h("isSelected",b,a);this.de();a=this.DJ;null!==a&&a(this);null!==c&&(c.Ne(),c.wb=d)}}});
    w.defineProperty(R,{Qg:"isHighlighted"},function(){return 0!==(this.N&524288)},function(a){var b=0!==(this.N&524288);if(b!==a){this.N^=524288;var c=this.g;null!==c&&(c=c.Zl,c.Qa(),a?c.add(this):c.remove(this),c.freeze());this.h("isHighlighted",b,a);this.oa();a=this.mI;null!==a&&a(this)}});w.defineProperty(R,{dm:"isShadowed"},function(){return 0!==(this.N&8192)},function(a){var b=0!==(this.N&8192);b!==a&&(this.N^=8192,this.h("isShadowed",b,a),this.oa())});function Em(a){return 0!==(a.N&32768)}
    function $q(a,b){a.N=b?a.N|32768:a.N&-32769}function Ho(a,b){a.N=b?a.N|65536:a.N&-65537}function jl(a){return 0!==(a.N&131072)}R.prototype.Hf=function(a){this.N=a?this.N|131072:this.N&-131073};function ir(a,b){a.N=b?a.N|1048576:a.N&-1048577}w.defineProperty(R,{oF:"isAnimated"},function(){return 0!==(this.N&262144)},function(a){var b=0!==(this.N&262144);b!==a&&(this.N^=262144,this.h("isAnimated",b,a))});
    w.defineProperty(R,{mI:"highlightedChanged"},function(){return this.Hr},function(a){var b=this.Hr;b!==a&&(null!==a&&w.j(a,"function",R,"highlightedChanged"),this.Hr=a,this.h("highlightedChanged",b,a))});w.defineProperty(R,{jB:"selectionObjectName"},function(){return this.Xs},function(a){var b=this.Xs;b!==a&&(this.Xs=a,this.cn=null,this.h("selectionObjectName",b,a))});
    w.defineProperty(R,{CJ:"selectionAdornmentTemplate"},function(){return this.Vs},function(a){var b=this.Vs;b!==a&&(this instanceof W&&(a.type=hj),this.Vs=a,this.h("selectionAdornmentTemplate",b,a))});w.u(R,{Iu:"selectionObject"},function(){if(null===this.cn){var a=this.jB;null!==a&&""!==a?(a=this.xd(a),this.cn=null!==a?a:this):this instanceof W?(a=this.path,this.cn=null!==a?a:this):this.cn=this}return this.cn});
    w.defineProperty(R,{DJ:"selectionChanged"},function(){return this.Ws},function(a){var b=this.Ws;b!==a&&(null!==a&&w.j(a,"function",R,"selectionChanged"),this.Ws=a,this.h("selectionChanged",b,a))});w.defineProperty(R,{bG:"resizeAdornmentTemplate"},function(){return this.Js},function(a){var b=this.Js;b!==a&&(this.Js=a,this.h("resizeAdornmentTemplate",b,a))});
    w.defineProperty(R,{dG:"resizeObjectName"},function(){return this.Ls},function(a){var b=this.Ls;b!==a&&(this.Ls=a,this.ip=null,this.h("resizeObjectName",b,a))});w.u(R,{cG:"resizeObject"},function(){if(null===this.ip){var a=this.dG;null!==a&&""!==a?(a=this.xd(a),this.ip=null!==a?a:this):this.ip=this}return this.ip});w.defineProperty(R,{sJ:"resizeCellSize"},function(){return this.Ks},function(a){var b=this.Ks;b.L(a)||(this.Ks=a=a.S(),this.h("resizeCellSize",b,a))});
    w.defineProperty(R,{vJ:"rotateAdornmentTemplate"},function(){return this.Ms},function(a){var b=this.Ms;b!==a&&(this.Ms=a,this.h("rotateAdornmentTemplate",b,a))});w.defineProperty(R,{wJ:"rotateObjectName"},function(){return this.Ns},function(a){var b=this.Ns;b!==a&&(this.Ns=a,this.jp=null,this.h("rotateObjectName",b,a))});w.u(R,{eB:"rotateObject"},function(){if(null===this.jp){var a=this.wJ;null!==a&&""!==a?(a=this.xd(a),this.jp=null!==a?a:this):this.jp=this}return this.jp});
    w.defineProperty(R,{text:"text"},function(){return this.Jd},function(a){var b=this.Jd;b!==a&&(this.Jd=a,this.h("text",b,a))});
    w.defineProperty(R,{Da:"containingGroup"},function(){return this.al},function(a){if(this.ee()){var b=this.al;if(b!==a){null===a||this!==a&&!a.qi(this)||(this===a&&w.k("Cannot make a Group a member of itself: "+this.toString()),w.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.J(Um);var c=this.g;null!==b?jr(b,this):this instanceof V&&null!==c&&c.Dl.remove(this);this.al=a;null!==a?kr(a,this):this instanceof V&&null!==c&&c.Dl.add(this);this.J(Lm);
        if(null!==c){var d=this.data,e=c.aa;null!==d&&e instanceof Q&&e.mB(d,e.pb(null!==a?a.data:null))}d=this.BE;null!==d&&(e=!0,null!==c&&(e=c.Ta,c.Ta=!0),d(this,b,a),null!==c&&(c.Ta=e));if(this instanceof V)for(c=new I(R),jh(c,this,!0,0,!0),c=c.i;c.next();)if(d=c.value,d instanceof T)for(d=d.ge;d.next();)pn(d.value);if(this instanceof T){for(d=this.ge;d.next();)pn(d.value);c=this.Wb;null!==c&&pn(c)}this.h("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&ol(b,-1,a))}}else w.k("cannot set the Part.containingGroup of a Link or Adornment")});
    g=R.prototype;g.Gk=function(){var a=this.Da;null!==a&&(a.H(),null!==a.Lb&&a.Lb.H(),a.$f())};g.oa=function(){var a=this.g;null!==a&&!Dm(this)&&!Em(this)&&this.isVisible()&&this.oc.I()&&a.oa(nl(this,this.oc))};g.H=function(){C.prototype.H.call(this);var a=this.g;null!==a&&(a.xg.add(this),this instanceof T&&null!==this.Wb&&Ro(this.Wb),a.Ne(!0))};g.au=function(a){a||(a=this.al,null!==a&&kr(a,this))};g.bu=function(a){a||(a=this.al,null!==a&&jr(a,this))};
    g.yn=function(){var a=this.data;if(null!==a){var b=this.g;null!==b&&(b=b.aa,null!==b&&b.by(a))}};w.defineProperty(R,{BE:"containingGroupChanged"},function(){return this.Vq},function(a){var b=this.Vq;b!==a&&(null!==a&&w.j(a,"function",R,"containingGroupChanged"),this.Vq=a,this.h("containingGroupChanged",b,a))});R.prototype.findSubGraphLevel=function(){return lr(this,this)};function lr(a,b){var c=b.Da;return null!==c?1+lr(a,c):b instanceof T&&(c=b.Wb,null!==c)?lr(a,c):0}
    R.prototype.findTopLevelPart=function(){return mr(this,this)};function mr(a,b){var c=b.Da;return null!==c?mr(a,c):b instanceof T&&(c=b.Wb,null!==c)?mr(a,c):b}w.u(R,{$p:"isTopLevel"},function(){return null!==this.Da||this instanceof T&&null!==this.Wb?!1:!0});R.prototype.isMemberOf=R.prototype.qi=function(a){return a instanceof V?nr(this,this,a):!1};function nr(a,b,c){if(b===c||null===c)return!1;var d=b.Da;return null===d||d!==c&&!nr(a,d,c)?b instanceof T&&(b=b.Wb,null!==b)?nr(a,b,c):!1:!0}
    R.prototype.findCommonContainingGroup=R.prototype.TH=function(a){if(null===a)return null;if(this===a)return this.Da;for(var b=this;null!==b;){b instanceof V&&ir(b,!0);if(b instanceof T){var c=b.Wb;null!==c&&(b=c)}b=b.Da}for(var d=null,b=a;null!==b;){if(0!==(b.N&1048576)){d=b;break}b instanceof T&&(c=b.Wb,null!==c&&(b=c));b=b.Da}for(b=this;null!==b;)b instanceof V&&ir(b,!1),b instanceof T&&(c=b.Wb,null!==c&&(b=c)),b=b.Da;return d};
    w.defineProperty(R,{JI:"layoutConditions"},function(){return this.Wr},function(a){var b=this.Wr;b!==a&&(this.Wr=a,this.h("layoutConditions",b,a))});R.prototype.canLayout=function(){if(!this.xF||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Mc||this instanceof T&&this.Bf?!1:!0};
    R.prototype.invalidateLayout=R.prototype.J=function(a){void 0===a&&(a=16777215);var b;this.xF&&0!==(a&this.JI)?(b=this.layer,null!==b&&b.Mc||this instanceof T&&this.Bf?b=!1:(b=this.g,b=null!==b&&b.ia.ab?!1:!0)):b=!1;if(b)if(b=this.al,null!==b){var c=b.Tb;null!==c?c.J():b.J(a)}else a=this.g,null!==a&&(c=a.Tb,null!==c&&c.J())};function Qm(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Mc?!1:!0}
    w.defineProperty(R,{LE:"dragComputation"},function(){return this.or},function(a){var b=this.or;b!==a&&(null!==a&&w.j(a,"function",R,"dragComputation"),this.or=a,this.h("dragComputation",b,a))});w.defineProperty(R,{GJ:"shadowOffset"},function(){return this.en},function(a){var b=this.en;b.L(a)||(this.en=a=a.S(),this.oa(),this.h("shadowOffset",b,a))});
    w.defineProperty(R,{shadowColor:"shadowColor"},function(){return this.dn},function(a){var b=this.dn;b!==a&&(this.dn=a,this.oa(),this.h("shadowColor",b,a))});w.defineProperty(R,{shadowBlur:"shadowBlur"},function(){return this.Gg},function(a){var b=this.Gg;b!==a&&(this.Gg=a,this.oa(),this.h("shadowBlur",b,a))});function kh(a){0===arguments.length?R.call(this,Tj):R.call(this,a);this.N&=-257;this.ql="Adornment";this.Fc=null;this.pD=0;this.gE=!1;this.Lb=this.bh=null}w.Ka(kh,R);w.ga("Adornment",kh);
    kh.prototype.toString=function(){var a=this.xf;return"Adornment("+this.vd+")"+(null!==a?a.toString():"")};kh.prototype.updateRelationshipsFromData=function(){};kh.prototype.qu=function(a){var b=this.sb.U,c=this.sb;if(b instanceof W&&c instanceof X){var d=b.path,c=d.kf;b.qu(a);c=d.kf;a=this.xa.n;b=a.length;for(d=0;d<b;d++){var e=a[d];e.pf&&e instanceof X&&(e.Ua=c)}}};w.u(kh,{placeholder:"placeholder"},function(){return this.Lb});
    w.defineProperty(kh,{sb:"adornedObject"},function(){return this.Fc},function(a){var b=this.xf,c=null;null!==a&&(c=a.U);null===b||null!==a&&b===c||b.Bj(this.vd);this.Fc=a;null!==c&&c.Gl(this.vd,this)});w.u(kh,{xf:"adornedPart"},function(){var a=this.Fc;return null!==a?a.U:null});kh.prototype.cm=function(){var a=this.Fc;if(null===a)return!0;a=a.U;return null===a||!Dm(a)};kh.prototype.ee=function(){return!1};w.u(kh,{Da:"containingGroup"},function(){return null});
    kh.prototype.Xn=function(a,b,c,d,e,f,h){if(a===Pf&&"elements"===b)if(e instanceof Nj){var k=e;null===this.Lb?this.Lb=k:this.Lb!==k&&w.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")}else e instanceof C&&(k=e.Mt(function(a){return a instanceof Nj}),k instanceof Nj&&(null===this.Lb?this.Lb=k:this.Lb!==k&&w.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));else a===Qf&&"elements"===b&&null!==this.Lb&&(d===this.Lb?this.Lb=null:d instanceof C&&
        this.Lb.bm(d)&&(this.Lb=null));R.prototype.Xn.call(this,a,b,c,d,e,f,h)};kh.prototype.updateAdornments=function(){};kh.prototype.yn=function(){};function T(a){R.call(this,a);this.ya=13;this.pc=new H(W);this.qt=this.Uo=this.sl=this.Yr=this.Xr=null;this.Oq=nd;this.ne=this.Kh=null;this.Fs=or;this.qk=!1}w.Ka(T,R);w.ga("Node",T);
    T.prototype.cloneProtected=function(a){R.prototype.cloneProtected.call(this,a);a.ya=this.ya;a.ya=this.ya&-17;a.Xr=this.Xr;a.Yr=this.Yr;a.sl=this.sl;a.qt=this.qt;a.Oq=this.Oq.S();a.Fs=this.Fs};T.prototype.oi=function(a){R.prototype.oi.call(this,a);a.$f();a.Kh=this.Kh;a.ne=null};var pr;T.DirectionDefault=pr=w.p(T,"DirectionDefault",0);T.DirectionAbsolute=w.p(T,"DirectionAbsolute",1);var qr;T.DirectionRotatedNode=qr=w.p(T,"DirectionRotatedNode",2);var xo;
    T.DirectionRotatedNodeOrthogonal=xo=w.p(T,"DirectionRotatedNodeOrthogonal",3);T.SpreadingNone=w.p(T,"SpreadingNone",10);var or;T.SpreadingEvenly=or=w.p(T,"SpreadingEvenly",11);var rr;T.SpreadingPacked=rr=w.p(T,"SpreadingPacked",12);function sr(a,b){null!==b&&(null===a.Kh&&(a.Kh=new I(yl)),a.Kh.add(b))}
    function tr(a,b,c,d){if(null===b||null===a.Kh)return null;for(var e=a.Kh.i;e.next();){var f=e.value;if(f.gq===a&&f.vu===b&&f.Tx===c&&f.Ux===d||f.gq===b&&f.vu===a&&f.Tx===d&&f.Ux===c)return f}return null}T.prototype.invalidateLinkBundle=function(a,b,c){if(void 0===b||null===b)b="";if(void 0===c||null===c)c="";a=tr(this,a,b,c);null!==a&&a.Yp()};T.prototype.Xn=function(a,b,c,d,e,f,h){a===Pf&&"elements"===b?this.ne=null:a===Qf&&"elements"===b&&(this.ne=null);R.prototype.Xn.call(this,a,b,c,d,e,f,h)};
    T.prototype.invalidateConnectedLinks=T.prototype.$f=function(a){void 0===a&&(a=null);for(var b=this.ge;b.next();){var c=b.value;null!==a&&a.contains(c)||(ur(this,c.Lc),ur(this,c.ld),c.$b())}};function Io(a,b){for(var c=a.ge;c.next();){var d=c.value;if(d.Lc===b||d.ld===b)ur(a,d.Lc),ur(a,d.ld),d.$b()}}function ur(a,b){if(null!==b){var c=b.Es;null!==c&&c.Yp();c=a.Da;null===c||c.Zc||ur(c,c.port)}}T.prototype.cm=function(){return!0};
    w.defineProperty(T,{jJ:"portSpreading"},function(){return this.Fs},function(a){var b=this.Fs;b!==a&&(this.Fs=a,this.h("portSpreading",b,a),a=this.g,null!==a&&a.ia.ab||this.$f())});w.defineProperty(T,{Wz:"avoidable"},function(){return 0!==(this.ya&8)},function(a){var b=0!==(this.ya&8);if(b!==a){this.ya^=8;var c=this.g;null!==c&&c.CA(this);this.h("avoidable",b,a)}});
    w.defineProperty(T,{oH:"avoidableMargin"},function(){return this.Oq},function(a){"number"===typeof a?a=new hb(a):w.G(a,hb,T,"avoidableMargin");var b=this.Oq;if(!b.L(a)){this.Oq=a=a.S();var c=this.g;null!==c&&c.CA(this);this.h("avoidableMargin",b,a)}});T.prototype.getAvoidableRect=function(a){a.set(this.W);a.Ow(this.oH);return a};T.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.isVisible();)a=a.Da;return a};
    T.prototype.isVisible=function(){if(!R.prototype.isVisible.call(this))return!1;var a=!0,b=ul,c=this.g;if(null!==c){a=c.Oa;if(a.of&&(a=a.Tm.ka(this),null!==a&&a.Zx))return!0;a=c.Td;b=c.DB}if(b===ul){if(c=this.Bk(),null!==c&&!c.tc)return!1}else if(b===Ym){if(c=a?this.SE():this.TE(),0<c.count&&c.all(function(a){return!a.tc}))return!1}else if(b===Zm&&(c=a?this.SE():this.TE(),0<c.count&&c.any(function(a){return!a.tc})))return!1;c=this.Wb;return null!==c?c.isVisible():!0};
    T.prototype.yd=function(a){R.prototype.yd.call(this,a);for(var b=this.ge;b.next();)b.value.yd(a)};w.u(T,{ge:"linksConnected"},function(){return this.pc.i});T.prototype.findLinksConnected=T.prototype.QE=function(a){void 0===a&&(a=null);if(null===a)return this.pc.i;var b=new za(this.pc),c=this;b.iq=function(b){return b.Y===c&&b.Pg===a||b.$===c&&b.Hh===a};return b};
    T.prototype.findLinksOutOf=T.prototype.nx=function(a){void 0===a&&(a=null);var b=new za(this.pc),c=this;b.iq=function(b){return b.Y!==c?!1:null===a?!0:b.Pg===a};return b};T.prototype.findLinksInto=T.prototype.Og=function(a){void 0===a&&(a=null);var b=new za(this.pc),c=this;b.iq=function(b){return b.$!==c?!1:null===a?!0:b.Hh===a};return b};
    T.prototype.findNodesConnected=T.prototype.RE=function(a){void 0===a&&(a=null);for(var b=null,c=null,d=this.pc.i;d.next();){var e=d.value;if(e.Y===this){if(null===a||e.Pg===a)e=e.$,null!==b?b.add(e):null!==c&&c!==e?(b=new I(T),b.add(c),b.add(e)):c=e}else e.$!==this||null!==a&&e.Hh!==a||(e=e.Y,null!==b?b.add(e):null!==c&&c!==e?(b=new I(T),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new va(c):ua};
    T.prototype.findNodesOutOf=T.prototype.TE=function(a){void 0===a&&(a=null);for(var b=null,c=null,d=this.pc.i;d.next();){var e=d.value;e.Y!==this||null!==a&&e.Pg!==a||(e=e.$,null!==b?b.add(e):null!==c&&c!==e?(b=new I(T),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new va(c):ua};
    T.prototype.findNodesInto=T.prototype.SE=function(a){void 0===a&&(a=null);for(var b=null,c=null,d=this.pc.i;d.next();){var e=d.value;e.$!==this||null!==a&&e.Hh!==a||(e=e.Y,null!==b?b.add(e):null!==c&&c!==e?(b=new I(T),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new va(c):ua};
    T.prototype.findLinksBetween=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);var d=new za(this.pc),e=this;d.iq=function(d){return(d.Y!==e||d.$!==a||null!==b&&d.Pg!==b||null!==c&&d.Hh!==c)&&(d.Y!==a||d.$!==e||null!==c&&d.Pg!==c||null!==b&&d.Hh!==b)?!1:!0};return d};T.prototype.findLinksTo=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);var d=new za(this.pc),e=this;d.iq=function(d){return d.Y!==e||d.$!==a||null!==b&&d.Pg!==b||null!==c&&d.Hh===c?!1:!0};return d};
    w.defineProperty(T,{KI:"linkConnected"},function(){return this.Xr},function(a){var b=this.Xr;b!==a&&(null!==a&&w.j(a,"function",T,"linkConnected"),this.Xr=a,this.h("linkConnected",b,a))});w.defineProperty(T,{LI:"linkDisconnected"},function(){return this.Yr},function(a){var b=this.Yr;b!==a&&(null!==a&&w.j(a,"function",T,"linkDisconnected"),this.Yr=a,this.h("linkDisconnected",b,a))});
    w.defineProperty(T,{Kx:"linkValidation"},function(){return this.sl},function(a){var b=this.sl;b!==a&&(null!==a&&w.j(a,"function",T,"linkValidation"),this.sl=a,this.h("linkValidation",b,a))});
    function vr(a,b,c){ur(a,c);var d=a.pc.contains(b);d||a.pc.add(b);if(!d||b.Y===b.$){var e=a.KI;if(null!==e){var f=!0,h=a.g;null!==h&&(f=h.Ta,h.Ta=!0);e(a,b,c);null!==h&&(h.Ta=f)}}!d&&b.Nc&&(c=b.Y,b=b.$,null!==c&&null!==b&&c!==b&&(d=!0,h=a.g,null!==h&&(d=h.Td),a=d?b:c,e=d?c:b,a.qk||(a.qk=e),!e.wj||null!==h&&h.ia.ab||(d?c===e&&(e.wj=!1):b===e&&(e.wj=!1))))}
    function wr(a,b,c){ur(a,c);var d=a.pc.remove(b);if(d||b.$===b.Y){var e=a.LI,f=a.g;if(null!==e){var h=!0;null!==f&&(h=f.Ta,f.Ta=!0);e(a,b,c);null!==f&&(f.Ta=h)}}d&&b.Nc&&(c=!0,null!==f&&(c=f.Td),a=c?b.$:b.Y,b=c?b.Y:b.$,null!==a&&(a.qk=!1),null===b||b.wj||(0===b.pc.count?(b.qk=null,null!==f&&f.ia.ab||(b.wj=!0)):Bn(b)))}
    function Bn(a){a.qk=!1;if(0!==a.pc.count){var b=!0,c=a.g;if(null===c||!c.ia.ab){null!==c&&(b=c.Td);for(c=a.pc.i;c.next();){var d=c.value;if(d.Nc)if(b){if(d.Y===a){a.wj=!1;return}}else if(d.$===a){a.wj=!1;return}}a.wj=!0}}}
    T.prototype.updateRelationshipsFromData=function(){R.prototype.updateRelationshipsFromData.call(this);var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.aa;c instanceof $f&&(a=c.En(a),a=b.Ke(a),c=this.Bk(),a!==c&&(c=this.An(),null!==a?null!==c?b.Td?c.Y=a:c.$=a:dn(b,a,this):null!==c&&Tm(b,c,!1)))}}};T.prototype.au=function(a){R.prototype.au.call(this,a);a||(Bn(this),a=this.Uo,null!==a&&xr(a,this))};
    T.prototype.bu=function(a){R.prototype.bu.call(this,a);a||(a=this.Uo,null!==a&&null!==a.uf&&(a.uf.remove(this),a.H()))};T.prototype.yn=function(){if(0<this.pc.count){var a=this.g;if(null!==a)for(var b=a.ob.KE,c=this.pc.copy().i;c.next();){var d=c.value;b?a.remove(d):(d.Y===this&&(d.Y=null),d.$===this&&(d.$=null))}}this.Wb=null;R.prototype.yn.call(this)};w.u(T,{Bf:"isLinkLabel"},function(){return null!==this.Uo});
    w.defineProperty(T,{Wb:"labeledLink"},function(){return this.Uo},function(a){var b=this.Uo;if(b!==a){var c=this.g,d=this.data;if(null!==b){null!==b.uf&&(b.uf.remove(this),b.H());if(null!==c&&null!==d&&!c.ia.ab){var e=b.data,f=c.aa;if(null!==e&&f instanceof Q){var h=f.pb(d);void 0!==h&&f.oJ(e,h)}}this.Da=null}this.Uo=a;null!==a&&(xr(a,this),null===c||null===d||c.ia.ab||(e=a.data,f=c.aa,null!==e&&f instanceof Q&&(h=f.pb(d),void 0!==h&&f.nE(e,h))),this.Da=a.Da);Ro(this);this.h("labeledLink",b,a)}});
    T.prototype.findPort=T.prototype.oA=function(a){if(null===this.ne){if(""===a&&!1===this.Fk)return this;Yo(this)}var b=this.ne.ka(a);return null!==b||""!==a&&(b=this.ne.ka(""),null!==b)?b:this};w.u(T,{port:"port"},function(){return this.oA("")});w.u(T,{ports:"ports"},function(){null===this.ne&&Yo(this);return this.ne.CF});function Yo(a){null===a.ne?a.ne=new ma("string",G):a.ne.clear();$o(a,a,function(a,c){var d=c.Ud;null!==d&&a.ne.add(d,c)});0===a.ne.count&&a.ne.add("",a)}
    function Xo(a,b,c){var d=b.Ud;if(null!==d&&(null!==a.ne&&a.ne.remove(d),b=a.g,null!==b&&c)){c=null;for(d=a.QE(d);d.next();)a=d.value,null===c&&(c=w.cb()),c.push(a);if(null!==c){for(d=0;d<c.length;d++)a=c[d],b.remove(a);w.ta(c)}}}
    T.prototype.isInTreeOf=function(a){if(null===a||a===this)return!1;var b=!0,c=this.g;null!==c&&(b=c.Td);c=this;if(b)for(;c!==a;){for(var b=null,d=c.pc.i;d.next();){var e=d.value;if(e.Nc&&(b=e.Y,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.pc.i;d.next()&&(e=d.value,!e.Nc||(b=e.$,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
    T.prototype.findTreeRoot=function(){var a=!0,b=this.g;null!==b&&(a=b.Td);b=this;if(a)for(;;){for(var a=null,c=b.pc.i;c.next();){var d=c.value;if(d.Nc&&(a=d.Y,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.pc.i;c.next()&&(d=c.value,!d.Nc||(a=d.$,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
    T.prototype.findCommonTreeParent=function(a){if(null===a)return null;if(this===a)return this;for(var b=this;null!==b;)ir(b,!0),b=b.Bk();for(var c=null,b=a;null!==b;){if(0!==(b.N&1048576)){c=b;break}b=b.Bk()}for(b=this;null!==b;)ir(b,!1),b=b.Bk();return c};T.prototype.findTreeParentLink=T.prototype.An=function(){var a=!0,b=this.g;null!==b&&(a=b.Td);b=this.pc.i;if(a)for(;b.next();){if(a=b.value,a.Nc&&a.Y!==this)return a}else for(;b.next();)if(a=b.value,a.Nc&&a.$!==this)return a;return null};
    T.prototype.findTreeParentNode=T.prototype.Bk=function(){var a=this.qk;if(null===a)return null;if(a instanceof T)return a;var b=!0,a=this.g;null!==a&&(b=a.Td);a=this.pc.i;if(b)for(;a.next();){if(b=a.value,b.Nc&&(b=b.Y,b!==this))return this.qk=b}else for(;a.next();)if(b=a.value,b.Nc&&(b=b.$,b!==this))return this.qk=b;return this.qk=null};T.prototype.findTreeParentChain=function(){function a(b,d){if(null!==b){d.add(b);var e=b.An();null!==e&&(d.add(e),a(b.Bk(),d))}}var b=new I(R);a(this,b);return b};
    T.prototype.findTreeLevel=function(){return yr(this,this)};function yr(a,b){var c=b.Bk();return null===c?0:1+yr(a,c)}T.prototype.findTreeChildrenLinks=T.prototype.px=function(){var a=!0,b=this.g;null!==b&&(a=b.Td);var b=new za(this.pc),c=this;b.iq=a?function(a){return a.Nc&&a.Y===c?!0:!1}:function(a){return a.Nc&&a.$===c?!0:!1};return b};
    T.prototype.findTreeChildrenNodes=T.prototype.VE=function(){var a=!0,b=this.g;null!==b&&(a=b.Td);var c=b=null,d=this.pc.i;if(a)for(;d.next();)a=d.value,a.Nc&&a.Y===this&&(a=a.$,null!==b?b.add(a):null!==c&&c!==a?(b=new H(T),b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.Nc&&a.$===this&&(a=a.Y,null!==b?b.add(a):null!==c&&c!==a?(b=new H(T),b.add(c),b.add(a)):c=a);return null!==b?b.i:null!==c?new va(c):ua};
    T.prototype.findTreeParts=function(a){void 0===a&&(a=Infinity);w.j(a,"number",T,"findTreeParts:level");var b=new I(R);jh(b,this,!1,a,!0);return b};T.prototype.collapseTree=T.prototype.collapseTree=function(a){void 0===a&&(a=1);w.wd(a,T,"collapseTree:level");1>a&&(a=1);var b=this.g;if(null!==b&&!b.yh){b.yh=!0;var c=new I(T);c.add(this);zr(this,c,b.Td,a,b.Oa,this,b.DB===ul);b.yh=!1}};
    function zr(a,b,c,d,e,f,h){if(1<d)for(var k=c?a.nx():a.Og();k.next();){var l=k.value;l.Nc&&(l=l.tA(a),null===l||l===a||b.contains(l)||(b.add(l),zr(l,b,c,d-1,e,f,h)))}else Ar(a,b,c,e,f,h)}function Ar(a,b,c,d,e,f){for(var h=e===a?!0:a.tc,k=c?a.nx():a.Og();k.next();){var l=k.value;l.Nc&&(l=l.tA(a),null===l||l===a||b.contains(l)||(b.add(l),h&&(f&&gl(d,l,e),l.Gk(),l.yd(!1)),l.tc&&(l.zq=l.tc,Ar(l,b,c,d,e,f))))}a.tc=!1}
    T.prototype.expandTree=T.prototype.expandTree=function(a){void 0===a&&(a=2);w.wd(a,T,"expandTree:level");2>a&&(a=2);var b=this.g;if(null!==b&&!b.yh){b.yh=!0;var c=new I(T);c.add(this);Br(this,c,b.Td,a,b.Oa,this,b.DB===ul);b.yh=!1}};function Br(a,b,c,d,e,f,h){for(var k=f===a?!1:a.tc,l=c?a.nx():a.Og();l.next();){var m=l.value;m.Nc&&(k||m.Mf||m.$b(),m=m.tA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.yd(!0),m.Gk(),h&&fl(e,m,f)),2<d||m.zq))&&(m.zq=!1,Br(m,b,c,d-1,e,f,h))}a.tc=!0}
    w.defineProperty(T,{tc:"isTreeExpanded"},function(){return 0!==(this.ya&1)},function(a){var b=0!==(this.ya&1);if(b!==a){this.ya^=1;var c=this.g;this.h("isTreeExpanded",b,a);b=this.UJ;if(null!==b){var d=!0;null!==c&&(d=c.Ta,c.Ta=!0);b(this);null!==c&&(c.Ta=d)}null!==c&&c.ia.ab?this.yd(a):a?this.expandTree():this.collapseTree()}});w.defineProperty(T,{zq:"wasTreeExpanded"},function(){return 0!==(this.ya&2)},function(a){var b=0!==(this.ya&2);b!==a&&(this.ya^=2,this.h("wasTreeExpanded",b,a))});
    w.defineProperty(T,{UJ:"treeExpandedChanged"},function(){return this.qt},function(a){var b=this.qt;b!==a&&(null!==a&&w.j(a,"function",T,"treeExpandedChanged"),this.qt=a,this.h("treeExpandedChanged",b,a))});w.defineProperty(T,{wj:"isTreeLeaf"},function(){return 0!==(this.ya&4)},function(a){var b=0!==(this.ya&4);b!==a&&(this.ya^=4,this.h("isTreeLeaf",b,a))});
    function W(){R.call(this,hj);this.Yb=8;this.tg=null;this.Qh="";this.Jg=this.yr=null;this.li="";this.pt=null;this.Gq=kj;this.ar=0;this.dr=kj;this.er=NaN;this.Ym=Cr;this.dt=.5;this.uf=null;this.fd=(new H(z)).freeze();this.bh=this.zC=this.tC=this.xi=this.Ki=this.Ua=this.qw=this.kp=this.Xe=null;this.Kz=new z;this.V=this.SD=this.RD=null}w.Ka(W,R);w.ga("Link",W);
    W.prototype.cloneProtected=function(a){R.prototype.cloneProtected.call(this,a);a.Yb=this.Yb&-113;a.Qh=this.Qh;a.yr=this.yr;a.li=this.li;a.pt=this.pt;a.Gq=this.Gq;a.ar=this.ar;a.dr=this.dr;a.er=this.er;a.Ym=this.Ym;a.dt=this.dt;null!==this.V&&(a.V=this.V.copy())};W.prototype.oi=function(a){R.prototype.oi.call(this,a);this.Qh=a.Qh;this.li=a.li;a.Xe=null;a.$b();a.xi=this.xi};
    W.prototype.ic=function(a){a.Ee===W?2===(a.value&2)?this.gy=a:a===Jj||a===jj||a===ij?this.af=a:a===Dr||a===Er||a===Fr?this.zt=a:a!==Cr&&a!==kj&&w.k("Unknown Link enum value for a Link property: "+a):R.prototype.ic.call(this,a)};var Cr;W.Normal=Cr=w.p(W,"Normal",1);W.Orthogonal=w.p(W,"Orthogonal",2);W.AvoidsNodes=w.p(W,"AvoidsNodes",6);var Gr;W.AvoidsNodesStraight=Gr=w.p(W,"AvoidsNodesStraight",7);var kj;W.None=kj=w.p(W,"None",0);var Jj;W.Bezier=Jj=w.p(W,"Bezier",9);var jj;
    W.JumpGap=jj=w.p(W,"JumpGap",10);var ij;W.JumpOver=ij=w.p(W,"JumpOver",11);var Dr;W.End=Dr=w.p(W,"End",17);var Er;W.Scale=Er=w.p(W,"Scale",18);var Fr;W.Stretch=Fr=w.p(W,"Stretch",19);var pq;W.OrientAlong=pq=w.p(W,"OrientAlong",21);var Rp;W.OrientPlus90=Rp=w.p(W,"OrientPlus90",22);var Tp;W.OrientMinus90=Tp=w.p(W,"OrientMinus90",23);var Hr;W.OrientOpposite=Hr=w.p(W,"OrientOpposite",24);var Ir;W.OrientUpright=Ir=w.p(W,"OrientUpright",25);var Sp;W.OrientPlus90Upright=Sp=w.p(W,"OrientPlus90Upright",26);
    var Up;W.OrientMinus90Upright=Up=w.p(W,"OrientMinus90Upright",27);var Vp;W.OrientUpright45=Vp=w.p(W,"OrientUpright45",28);g=W.prototype;g.Pd=function(){null===this.V&&(this.V=new wo)};g.cm=function(){var a=this.Y;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(Dm(a)||Em(a))return!1}a=this.$;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),Dm(a)||Em(a))?!1:!0};g.oB=function(){return!1};g.pB=function(){};g.ee=function(){return!1};
    W.prototype.computeAngle=function(a,b,c){return W.computeAngle(b,c)};W.computeAngle=function(a,b){var c=0;switch(a){default:case kj:c=0;break;case pq:c=b;break;case Rp:c=b+90;break;case Tp:c=b-90;break;case Hr:c=b+180;break;case Ir:c=ye(b);90<c&&270>c&&(c-=180);break;case Sp:c=ye(b+90);90<c&&270>c&&(c-=180);break;case Up:c=ye(b-90);90<c&&270>c&&(c-=180);break;case Vp:c=ye(b);if(45<c&&135>c||225<c&&315>c)return 0;90<c&&270>c&&(c-=180)}return ye(c)};
    w.defineProperty(W,{Y:"fromNode"},function(){return this.tg},function(a){var b=this.tg;if(b!==a){var c=this.Lc;null!==b&&(this.Jg!==b&&wr(b,this,c),Jr(this),this.J(Um));this.tg=a;null!==a&&this.yd(a.isVisible());this.Ki=null;this.$b();var d=this.g;if(null!==d){var e=this.data,f=d.aa;if(null!==e)if(f instanceof Q){var h=null!==a?a.data:null;f.kB(e,f.pb(h))}else f instanceof $f&&(h=null!==a?a.data:null,d.Td?f.ti(e,f.pb(h)):(null!==b&&f.ti(b.data,void 0),f.ti(h,f.pb(null!==this.Jg?this.Jg.data:null))))}e=
        this.Lc;f=this.YE;null!==f&&(h=!0,null!==d&&(h=d.Ta,d.Ta=!0),f(this,c,e),null!==d&&(d.Ta=h));null!==a&&(this.Jg!==a&&vr(a,this,e),Kr(this),this.J(Lm));this.h("fromNode",b,a);pn(this)}});
    w.defineProperty(W,{Pg:"fromPortId"},function(){return this.Qh},function(a){var b=this.Qh;if(b!==a){var c=this.Y,d=this.Lc;null!==d&&ur(c,d);Jr(this);this.Qh=a;var e=this.Lc;null!==e&&ur(c,e);c=this.g;if(null!==c){var f=this.data,h=c.aa;null!==f&&h instanceof Q&&h.lB(f,a)}d!==e&&(this.Ki=null,this.$b(),f=this.YE,null!==f&&(h=!0,null!==c&&(h=c.Ta,c.Ta=!0),f(this,d,e),null!==c&&(c.Ta=h)));Kr(this);this.h("fromPortId",b,a)}});w.u(W,{Lc:"fromPort"},function(){var a=this.tg;return null===a?null:a.oA(this.Qh)});
    w.defineProperty(W,{YE:"fromPortChanged"},function(){return this.yr},function(a){var b=this.yr;b!==a&&(null!==a&&w.j(a,"function",W,"fromPortChanged"),this.yr=a,this.h("fromPortChanged",b,a))});
    w.defineProperty(W,{$:"toNode"},function(){return this.Jg},function(a){var b=this.Jg;if(b!==a){var c=this.ld;null!==b&&(this.tg!==b&&wr(b,this,c),Jr(this),this.J(Um));this.Jg=a;null!==a&&this.yd(a.isVisible());this.Ki=null;this.$b();var d=this.g;if(null!==d){var e=this.data,f=d.aa;if(null!==e)if(f instanceof Q){var h=null!==a?a.data:null;f.qB(e,f.pb(h))}else f instanceof $f&&(h=null!==a?a.data:null,d.Td?(null!==b&&f.ti(b.data,void 0),f.ti(h,f.pb(null!==this.tg?this.tg.data:null))):f.ti(e,f.pb(h)))}e=
        this.ld;f=this.xG;null!==f&&(h=!0,null!==d&&(h=d.Ta,d.Ta=!0),f(this,c,e),null!==d&&(d.Ta=h));null!==a&&(this.tg!==a&&vr(a,this,e),Kr(this),this.J(Lm));this.h("toNode",b,a);pn(this)}});
    w.defineProperty(W,{Hh:"toPortId"},function(){return this.li},function(a){var b=this.li;if(b!==a){var c=this.$,d=this.ld;null!==d&&ur(c,d);Jr(this);this.li=a;var e=this.ld;null!==e&&ur(c,e);c=this.g;if(null!==c){var f=this.data,h=c.aa;null!==f&&h instanceof Q&&h.rB(f,a)}d!==e&&(this.Ki=null,this.$b(),f=this.xG,null!==f&&(h=!0,null!==c&&(h=c.Ta,c.Ta=!0),f(this,d,e),null!==c&&(c.Ta=h)));Kr(this);this.h("toPortId",b,a)}});w.u(W,{ld:"toPort"},function(){var a=this.Jg;return null===a?null:a.oA(this.li)});
    w.defineProperty(W,{xG:"toPortChanged"},function(){return this.pt},function(a){var b=this.pt;b!==a&&(null!==a&&w.j(a,"function",W,"toPortChanged"),this.pt=a,this.h("toPortChanged",b,a))});w.defineProperty(W,{Ab:"fromSpot"},function(){return null!==this.V?this.V.Tj:qc},function(a){this.Pd();var b=this.V.Tj;b.L(a)||(a=a.S(),this.V.Tj=a,this.h("fromSpot",b,a),this.$b())});
    w.defineProperty(W,{Vl:"fromEndSegmentLength"},function(){return null!==this.V?this.V.Rj:NaN},function(a){this.Pd();var b=this.V.Rj;b!==a&&(0>a&&w.Fa(a,">= 0",W,"fromEndSegmentLength"),this.V.Rj=a,this.h("fromEndSegmentLength",b,a),this.$b())});w.defineProperty(W,{Wt:"fromEndSegmentDirection"},function(){return null!==this.V?this.V.Qj:pr},function(a){this.Pd();var b=this.V.Qj;b!==a&&(w.It("Link.fromEndSegmentDirection","2.0"),this.V.Qj=a,this.h("fromEndSegmentDirection",b,a),this.$b())});
    w.defineProperty(W,{Xt:"fromShortLength"},function(){return null!==this.V?this.V.Sj:NaN},function(a){this.Pd();var b=this.V.Sj;b!==a&&(this.V.Sj=a,this.h("fromShortLength",b,a),this.$b())});w.defineProperty(W,{Bb:"toSpot"},function(){return null!==this.V?this.V.pk:qc},function(a){this.Pd();var b=this.V.pk;b.L(a)||(a=a.S(),this.V.pk=a,this.h("toSpot",b,a),this.$b())});
    w.defineProperty(W,{nm:"toEndSegmentLength"},function(){return null!==this.V?this.V.nk:NaN},function(a){this.Pd();var b=this.V.nk;b!==a&&(0>a&&w.Fa(a,">= 0",W,"toEndSegmentLength"),this.V.nk=a,this.h("toEndSegmentLength",b,a),this.$b())});w.defineProperty(W,{Pu:"toEndSegmentDirection"},function(){return null!==this.V?this.V.mk:pr},function(a){this.Pd();var b=this.V.mk;b!==a&&(w.It("Link.toEndSegmentDirection","2.0"),this.V.mk=a,this.h("toEndSegmentDirection",b,a),this.$b())});
    w.defineProperty(W,{Qu:"toShortLength"},function(){return null!==this.V?this.V.ok:NaN},function(a){this.Pd();var b=this.V.ok;b!==a&&(this.V.ok=a,this.h("toShortLength",b,a),this.$b())});
    function pn(a){var b=a.Y,c=a.$,d=null,b=d=null!==b?null!==c?b.TH(c):b.Da:null!==c?c.Da:null,c=a.al;if(c!==b){null!==c&&jr(c,a);a.al=b;null!==b&&kr(b,a);var e=a.BE;if(null!==e){var f=!0,h=a.g;null!==h&&(f=h.Ta,h.Ta=!0);e(a,c,b);null!==h&&(h.Ta=f)}!a.Mf||a.RD!==c&&a.SD!==c||a.$b()}if(a.yI)for(a=a.Ef;a.next();)a.value.Da=d}W.prototype.Gk=function(){var a=this.Da;null!==a&&this.Y!==a&&this.$!==a&&a.Yw&&R.prototype.Gk.call(this)};
    W.prototype.getOtherNode=W.prototype.tA=function(a){var b=this.Y;return a===b?this.$:b};W.prototype.getOtherPort=function(a){var b=this.Lc;return a===b?this.ld:b};w.u(W,{yI:"isLabeledLink"},function(){return null===this.uf?!1:0<this.uf.count});w.u(W,{Ef:"labelNodes"},function(){return null===this.uf?ua:this.uf.i});function xr(a,b){null===a.uf&&(a.uf=new I(T));a.uf.add(b);a.H()}
    W.prototype.au=function(a){R.prototype.au.call(this,a);Lr(this)&&lj(this,this.W);if(!a){a=this.tg;var b=null;null!==a&&(b=this.Lc,vr(a,this,b));var c=this.Jg,d=null;null!==c&&(d=this.ld,c===a&&d===b||vr(c,this,d));Kr(this)}};W.prototype.bu=function(a){R.prototype.bu.call(this,a);Lr(this)&&lj(this,this.W);if(!a){a=this.tg;var b=null;null!==a&&(b=this.Lc,wr(a,this,b));var c=this.Jg,d=null;null!==c&&(d=this.ld,c===a&&d===b||wr(c,this,d));Jr(this)}};
    W.prototype.yn=function(){this.Mf=!0;if(null!==this.uf){var a=this.g;if(null!==a)for(var b=this.uf.copy().i;b.next();)a.remove(b.value)}b=this.data;null!==b&&(a=this.g,null!==a&&(a=a.aa,a instanceof Q?a.ay(b):a instanceof $f&&a.ti(b,void 0)))};
    W.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.g;if(null!==b){var c=b.aa;if(c instanceof Q){var d=c.Xl(a);this.Y=d=b.Ke(d);d=c.Yl(a);this.$=d=b.Ke(d);a=c.Dk(a);if(0<a.length||0<this.Ef.count){if(1===a.length&&1===this.Ef.count){var d=a[0],e=this.Ef.first();if(c.pb(e.data)===d)return}var d=(new I).Jc(a),f=new I;this.Ef.each(function(a){null!==a.data&&(a=c.pb(a.data),void 0!==a&&f.add(a))});a=f.copy();a.$x(d);d=d.copy();d.$x(f);if(0<a.count||0<d.count){var h=
        this;a.each(function(a){a=b.Ke(a);null!==a&&a.Wb===h&&(a.Wb=null)});d.each(function(a){a=b.Ke(a);null!==a&&a.Wb!==h&&(a.Wb=h)})}}}}}};W.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);c=a.x-c;b=a.y-b;R.prototype.move.call(this,a);this.Jk(c,b);for(a=this.Ef;a.next();){var d=a.value,e=d.position;d.moveTo(e.x+c,e.y+b)}};
    w.defineProperty(W,{mJ:"relinkableFrom"},function(){return 0!==(this.Yb&1)},function(a){var b=0!==(this.Yb&1);b!==a&&(this.Yb^=1,this.h("relinkableFrom",b,a),this.de())});w.defineProperty(W,{nJ:"relinkableTo"},function(){return 0!==(this.Yb&2)},function(a){var b=0!==(this.Yb&2);b!==a&&(this.Yb^=2,this.h("relinkableTo",b,a),this.de())});W.prototype.canRelinkFrom=function(){if(!this.mJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.ln)return!1;a=a.g;return null===a||a.ln?!0:!1};
    W.prototype.canRelinkTo=function(){if(!this.nJ)return!1;var a=this.layer;if(null===a)return!0;if(!a.ln)return!1;a=a.g;return null===a||a.ln?!0:!1};w.defineProperty(W,{Eu:"resegmentable"},function(){return 0!==(this.Yb&4)},function(a){var b=0!==(this.Yb&4);b!==a&&(this.Yb^=4,this.h("resegmentable",b,a),this.de())});
    w.defineProperty(W,{Nc:"isTreeLink"},function(){return 0!==(this.Yb&8)},function(a){var b=0!==(this.Yb&8);b!==a&&(this.Yb^=8,this.h("isTreeLink",b,a),null!==this.Y&&Bn(this.Y),null!==this.$&&Bn(this.$))});w.u(W,{path:"path"},function(){var a=this.Ld();return a instanceof X?a:null});
    w.u(W,{Yn:"routeBounds"},function(){this.eo();var a=new B;var b=Infinity,c=Infinity,d=this.qa;if(0===d)a.m(NaN,NaN,0,0);else{if(1===d)d=this.l(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.m(d.x,d.y,0,0);else if(2===d){var e=this.l(0),f=this.l(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y);a.m(e.x,e.y,0,0);a.vi(f)}else if(this.computeCurve()===Jj&&3<=d&&!this.ac)if(e=this.l(0),b=e.x,c=e.y,a.m(b,c,0,0),3===d)d=this.l(1),b=Math.min(d.x,b),c=Math.min(d.y,c),f=this.l(2),b=Math.min(f.x,b),c=Math.min(f.y,c),Wd(e.x,
        e.y,d.x,d.y,d.x,d.y,f.x,f.y,.5,a);else for(var h=3;h<d;h+=3){var k=this.l(h-2);h+3>=d&&(h=d-1);var l=this.l(h-1),f=this.l(h);Wd(e.x,e.y,k.x,k.y,l.x,l.y,f.x,f.y,.5,a);b=Math.min(f.x,b);c=Math.min(f.y,c);e=f}else for(e=this.l(0),f=this.l(1),b=Math.min(e.x,f.x),c=Math.min(e.y,f.y),a.m(e.x,e.y,0,0),a.vi(f),h=2;h<d;h++)e=this.l(h),b=Math.min(e.x,b),c=Math.min(e.y,c),a.vi(e);this.Kz.m(b-a.x,c-a.y)}return this.qw=a});w.u(W,{IF:"midPoint"},function(){this.eo();return this.computeMidPoint(new z)});
    W.prototype.computeMidPoint=function(a){var b=this.qa;if(0===b)return a.assign(Fd),a;if(1===b)return a.assign(this.l(0)),a;if(2===b){var c=this.l(0),d=this.l(1);a.m((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.computeCurve()===Jj&&3<=b&&!this.ac){if(3===b)return this.l(1);var c=(b-1)/3|0,e=3*(c/2|0);if(1===c%2){var c=this.l(e),d=this.l(e+1),f=this.l(e+2),e=this.l(e+3),b=d.x,h=d.y,d=f.x,k=f.y,f=(b+d)/2,l=(h+k)/2,h=((c.y+h)/2+l)/2,k=(l+(k+e.y)/2)/2;a.x=(((c.x+b)/2+f)/2+(f+(d+e.x)/2)/2)/2;a.y=(h+k)/2}else a.assign(this.l(e));
        return a}e=0;f=w.cb();for(h=0;h<b-1;h++)c=0,c=this.l(h),d=this.l(h+1),Wa(c.x,d.x)?(c=d.y-c.y,0>c&&(c=-c)):Wa(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.zf(d)),f.push(c),e+=c;for(d=h=c=0;c<e/2&&h<b;){d=f[h];if(c+d>e/2)break;c+=d;h++}w.ta(f);b=this.l(h);f=this.l(h+1);b.x===f.x?b.y>f.y?a.m(b.x,b.y-(e/2-c)):a.m(b.x,b.y+(e/2-c)):b.y===f.y?b.x>f.x?a.m(b.x-(e/2-c),b.y):a.m(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.m(b.x+c*(f.x-b.x),b.y+c*(f.y-b.y)));return a};w.u(W,{HF:"midAngle"},function(){this.eo();return this.computeMidAngle()});
    W.prototype.computeMidAngle=function(){var a=this.qa;if(2>a)return NaN;if(this.computeCurve()===Jj&&4<=a&&!this.ac){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.l(c),d=this.l(c+1),a=this.l(c+2),c=this.l(c+3),e=d.x,d=d.y,f=a.x,a=a.y,h=(e+f)/2,k=(d+a)/2;return Ta(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(f+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0<c&&c+1<a)return b=this.l(c-1),d=this.l(c+1),b.Pb(d)}c=a/2|0;if(0===a%2)return b=this.l(c-1),d=this.l(c),4<=a&&b.Kc(d)?(b=this.l(c-2),a=this.l(c+1),
        c=b.zf(d),e=d.zf(a),c>e+10?b.Pb(d):e>c+10?d.Pb(a):b.Pb(a)):null===this.Ua||this.ac?b.Pb(d):this.Ua.ZE(.5);if(null!==this.Ua&&!this.ac)return this.Ua.ZE(.5);b=this.l(c-1);d=this.l(c);a=this.l(c+1);c=b.zf(d);e=d.zf(a);return c>e+10?b.Pb(d):e>c+10?d.Pb(a):b.Pb(a)};
    w.defineProperty(W,{points:"points"},function(){return this.fd},function(a){var b=this.fd;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(z),d=0;d<a.length/2;d++)e=(new z(a[2*d],a[2*d+1])).freeze(),c.add(e);else{e=!0;for(d=0;d<a.length;d++){var f=a[d];if(!w.Pa(f)||"number"!==typeof f.x||isNaN(f.x)||"number"!==typeof f.y||isNaN(f.y)){e=!1;break}}if(e)for(c=new H(z),d=0;d<a.length;d++)e=
        a[d],c.add((new z(e.x,e.y)).freeze());else w.k("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.i;a.next();)a.value.freeze();else w.k("Link.points value is not an instance of List or Array: "+a);c.freeze();this.fd=c;this.Me();this.H();Mr(this);a=this.g;null!==a&&(a.Jn||a.ia.ab||a.Lx.add(this),a.Oa.qc&&(this.kp=c));this.h("points",b,c)}});w.u(W,{qa:"pointsCount"},function(){return this.fd.count});
    W.prototype.getPoint=W.prototype.l=function(a){return this.fd.n[a]};W.prototype.setPoint=W.prototype.Yg=function(a,b){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.kg(a,b)};W.prototype.setPointAt=W.prototype.ca=function(a,b,c){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.kg(a,new z(b,c))};
    W.prototype.insertPoint=function(a,b){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.Qd(a,b)};W.prototype.insertPointAt=W.prototype.w=function(a,b,c){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.Qd(a,new z(b,c))};W.prototype.addPoint=W.prototype.mi=function(a){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.add(a)};
    W.prototype.addPointAt=W.prototype.ij=function(a,b){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.add(new z(a,b))};W.prototype.removePoint=W.prototype.YF=function(a){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.bd(a)};W.prototype.clearPoints=W.prototype.Gp=function(){null===this.Xe&&w.k("Call Link.startRoute before modifying the points of the route.");this.fd.clear()};
    W.prototype.movePoints=W.prototype.Jk=function(a,b){if(0!==a||0!==b){for(var c=this.Mf,d=new H(z),e=this.fd.i;e.next();){var f=e.value;d.add((new z(f.x+a,f.y+b)).freeze())}d.freeze();e=this.fd;this.fd=d;this.H();c&&Mr(this);c=this.g;null!==c&&c.Oa.qc&&(this.kp=d);this.h("points",e,d)}};W.prototype.startRoute=W.prototype.im=function(){null===this.Xe&&(this.Xe=this.fd,this.fd=this.fd.copy())};
    W.prototype.commitRoute=W.prototype.kj=function(){if(null!==this.Xe){for(var a=this.Xe,b=this.fd,c=Infinity,d=Infinity,e=a.n,f=e.length,h=0;h<f;h++)var k=e[h],c=Math.min(k.x,c),d=Math.min(k.y,d);for(var l=Infinity,m=Infinity,n=b.n,p=n.length,h=0;h<p;h++)k=n[h],l=Math.min(k.x,l),m=Math.min(k.y,m),k.freeze();b.freeze();if(p===f)for(h=0;h<p;h++){if(f=e[h],k=n[h],f.x-c!==k.x-l||f.y-d!==k.y-m){this.H();this.Me();break}}else this.H(),this.Me();this.Xe=null;c=this.g;null!==c&&c.Oa.qc&&(this.kp=b);Mr(this);
        this.h("points",a,b)}};W.prototype.rollbackRoute=W.prototype.tJ=function(){null!==this.Xe&&(this.fd=this.Xe,this.Xe=null)};function Mr(a){0===a.fd.count?a.Mf=!1:(a.Mf=!0,a.Lp=a.l(0),a.Mp=a.l(a.qa-1),Nr(a,!1))}W.prototype.invalidateRoute=W.prototype.$b=function(){if(!this.jm){var a=this.g;a&&(a.Lx.contains(this)||a.ia.ab||a.Oa.EI&&!a.Oa.of)||(a=this.path,null!==a&&(this.Mf=!1,this.H(),a.H()))}};
    w.defineProperty(W,{Mf:null},function(){return 0!==(this.Yb&16)},function(a){0!==(this.Yb&16)!==a&&(this.Yb^=16)});w.defineProperty(W,{jm:"suspendsRouting"},function(){return 0!==(this.Yb&32)},function(a){0!==(this.Yb&32)!==a&&(this.Yb^=32)});w.defineProperty(W,{$z:null},function(){return 0!==(this.Yb&64)},function(a){0!==(this.Yb&64)!==a&&(this.Yb^=64)});w.defineProperty(W,{Lp:"defaultFromPoint"},function(){return this.tC},function(a){this.tC=a.copy()});
    w.defineProperty(W,{Mp:"defaultToPoint"},function(){return this.zC},function(a){this.zC=a.copy()});W.prototype.updateRoute=W.prototype.eo=function(){if(!this.Mf&&!this.$z){var a=!0;try{this.$z=!0,this.im(),a=this.computePoints()}finally{this.$z=!1,a?this.kj():this.tJ()}}};
    W.prototype.computePoints=function(){var a=this.g;if(null===a)return!1;var b=this.Y,c=null;null===b?(a.yl||(a.Os=new X,a.Os.Ca=rd,a.Os.lb=0,a.yl=new T,a.yl.add(a.Os),a.yl.Je()),this.Lp&&(a.yl.position=a.yl.location=this.Lp,a.yl.Je(),b=a.yl,c=a.Os)):c=this.Lc;if(null!==c&&!b.isVisible()){var d=b.findVisibleNode();null!==d&&d!==b?(b=d,c=d.port):b=d}this.RD=b;if(null===b||!b.location.I())return!1;for(;!(null===c||c.W.I()&&c.xj());)c=c.Q;if(null===c)return!1;var e=this.$,f=null;null===e?(a.zl||(a.Ps=
        new X,a.Ps.Ca=rd,a.Ps.lb=0,a.zl=new T,a.zl.add(a.Ps),a.zl.Je()),this.Mp&&(a.zl.position=a.zl.location=this.Mp,a.zl.Je(),e=a.zl,f=a.Ps)):f=this.ld;null===f||e.isVisible()||(a=e.findVisibleNode(),null!==a&&a!==e?(e=a,f=a.port):e=a);this.SD=e;if(null===e||!e.location.I())return!1;for(;!(null===f||f.W.I()&&f.xj());)f=f.Q;if(null===f)return!1;var h=this.qa,d=this.computeSpot(!0,c),a=this.computeSpot(!1,f),k=d===yb,l=a===yb,m=c===f&&null!==c,n=this.ac,p=this.af===Jj;this.Ki=m&&!n?p=!0:!1;var q=this.zt===
        kj||m;if(!n&&!m&&k&&l){if(k=!1,!q&&3<=h&&(q=this.getLinkPoint(b,c,d,!0,!1,e,f),l=this.getLinkPoint(e,f,a,!1,!1,b,c),k=this.adjustPoints(0,q,h-1,l))&&(q=this.getLinkPoint(b,c,d,!0,!1,e,f),l=this.getLinkPoint(e,f,a,!1,!1,b,c),this.adjustPoints(0,q,h-1,l)),!k)if(this.Gp(),p){var h=this.getLinkPoint(b,c,d,!0,!1,e,f),q=this.getLinkPoint(e,f,a,!1,!1,b,c),k=q.x-h.x,l=q.y-h.y,m=this.computeCurviness(),p=n=0,r=h.x+k/3,s=h.y+l/3,u=r,t=s;J(l,0)?t=0<k?t-m:t+m:(n=-k/l,p=Math.sqrt(m*m/(n*n+1)),0>m&&(p=-p),u=(0>
        l?-1:1)*p+r,t=n*(u-r)+s);var r=h.x+2*k/3,s=h.y+2*l/3,x=r,v=s;J(l,0)?v=0<k?v-m:v+m:(x=(0>l?-1:1)*p+r,v=n*(x-r)+s);this.Gp();this.mi(h);this.ij(u,t);this.ij(x,v);this.mi(q);this.Yg(0,this.getLinkPoint(b,c,d,!0,!1,e,f));this.Yg(3,this.getLinkPoint(e,f,a,!1,!1,b,c))}else d=this.getLinkPoint(b,c,d,!0,!1,e,f),a=this.getLinkPoint(e,f,a,!1,!1,b,c),this.hasCurviness()?(q=a.x-d.x,e=a.y-d.y,f=this.computeCurviness(),b=d.x+q/2,c=d.y+e/2,h=b,k=c,J(e,0)?k=0<q?k-f:k+f:(q=-q/e,h=Math.sqrt(f*f/(q*q+1)),0>f&&(h=-h),
        h=(0>e?-1:1)*h+b,k=q*(h-b)+c),this.mi(d),this.ij(h,k)):this.mi(d),this.mi(a)}else{p=this.$l;q&&(n&&p||m)&&this.Gp();var A=m?this.computeCurviness():0,p=this.getLinkPoint(b,c,d,!0,n,e,f),r=u=s=0;if(n||!k||m)if(t=this.computeEndSegmentLength(b,c,d,!0),r=this.getLinkDirection(b,c,p,d,!0,n,e,f),m&&(k||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(r-=n?90:30,0>A&&(r-=180)),0>r?r+=360:360<=r&&(r-=360),m&&(t+=Math.abs(A)*(n?1:2)),0===r?s=t:90===r?u=t:180===r?s=-t:270===r?u=-t:(s=t*Math.cos(r*Math.PI/180),u=t*
            Math.sin(r*Math.PI/180)),d.Sd()&&m){var y=c.Wa(Jb,w.K()),K=w.xb(y.x+1E3*s,y.y+1E3*u);this.getLinkPointFromPoint(b,c,y,K,!0,p);w.v(y);w.v(K)}var t=this.getLinkPoint(e,f,a,!1,n,b,c),E=v=x=0;if(n||!l||m)y=this.computeEndSegmentLength(e,f,a,!1),E=this.getLinkDirection(e,f,t,a,!1,n,b,c),m&&(l||d.L(a)||!n&&1===d.x+a.x&&1===d.y+a.y)&&(E+=n?0:30,0>A&&(E+=180)),0>E?E+=360:360<=E&&(E-=360),m&&(y+=Math.abs(A)*(n?1:2)),0===E?x=y:90===E?v=y:180===E?x=-y:270===E?v=-y:(x=y*Math.cos(E*Math.PI/180),v=y*Math.sin(E*
            Math.PI/180)),a.Sd()&&m&&(y=f.Wa(Jb,w.K()),K=w.xb(y.x+1E3*x,y.y+1E3*v),this.getLinkPointFromPoint(e,f,y,K,!1,t),w.v(y),w.v(K));a=p;if(n||!k||m)a=new z(p.x+s,p.y+u);d=t;if(n||!l||m)d=new z(t.x+x,t.y+v);!q&&!n&&k&&3<h&&this.adjustPoints(0,p,h-2,d)?this.Yg(h-1,t):!q&&!n&&l&&3<h&&this.adjustPoints(1,a,h-1,t)?this.Yg(0,p):!q&&(n?6<=h:4<h)&&this.adjustPoints(1,a,h-2,d)?(this.Yg(0,p),this.Yg(h-1,t)):(this.Gp(),this.mi(p),(n||!k||m)&&this.mi(a),n&&this.addOrthoPoints(a,r,d,E,b,e),(n||!l||m)&&this.mi(d),this.mi(t))}return!0};
    function Or(a,b){Math.abs(b.x-a.x)>Math.abs(b.y-a.y)?(b.x=b.x>=a.x?a.x+9E9:a.x-9E9,b.y=a.y):(b.y=b.y>=a.y?a.y+9E9:a.y-9E9,b.x=a.x);return b}
    W.prototype.getLinkPointFromPoint=function(a,b,c,d,e,f){void 0===f&&(f=new z);if(null===a||null===b)return f.assign(c),f;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.Q;null===e||e.ah()||(e=e.Q);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.rh;e=1/(a.m11*a.m22-a.m12*a.m21);var k=a.m22*e,l=-a.m12*e,m=-a.m21*e,n=a.m11*e,p=e*(a.m21*a.dy-a.m22*a.dx),q=e*(a.m12*a.dx-a.m11*a.dy);e=d.x*k+d.y*m+p;h=d.x*l+d.y*n+q;k=c.x*k+c.y*m+p;l=c.x*l+c.y*n+q}b.Dn(e,h,k,l,
        f);null!==a&&f.transform(a);return f};function Pr(a,b){var c=b.Es;null===c&&(c=new Qr,c.port=b,c.Pc=b.U,b.Es=c);return Rr(c,a)}
    W.prototype.getLinkPoint=function(a,b,c,d,e,f,h,k){void 0===k&&(k=new z);if(c.Yc())return b.Wa(c,k),k;if(c.uj()){var l=Pr(this,b);if(null!==l){k.assign(l.dq);if(e&&this.gy===Gr){var m=Pr(this,h);if(null!==m&&l.wn<m.wn){var l=w.K(),m=w.K(),n=new B(b.Wa(Ab,l),b.Wa(Sb,m)),p=this.computeSpot(!d,h);a=this.getLinkPoint(f,h,p,!d,e,a,b,m);(c.sj(Yb)||c.sj(Zb))&&a.y>=n.y&&a.y<=n.y+n.height?k.y=a.y:(c.sj(Xb)||c.sj($b))&&a.x>=n.x&&a.x<=n.x+n.width&&(k.x=a.x);w.v(l);w.v(m)}}return k}}c=b.Wa(Jb,w.K());l=f=null;
        this.qa>(e?6:2)?(l=d?this.l(1):this.l(this.qa-2),e&&(l=Or(c,l.copy()))):(f=w.K(),l=h.Wa(Jb,f),e&&(l=Or(c,l)),w.v(f));this.getLinkPointFromPoint(a,b,c,l,d,k);w.v(c);return k};
    W.prototype.getLinkDirection=function(a,b,c,d,e,f,h,k){a:if(d.Yc())c=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.uj()){var l=Pr(this,b);if(null!==l)switch(l.ye){case w.md:c=270;break a;case w.Sc:c=180;break a;default:case w.dd:c=0;break a;case w.cd:c=90;break a}}var l=b.Wa(Jb,w.K()),m=null,n=null;this.qa>(f?6:2)?(n=e?this.l(1):this.l(this.qa-2),n=f?Or(l,n.copy()):c):(m=w.K(),n=k.Wa(Jb,m),w.v(m));c=0;c=Math.abs(n.x-l.x)>Math.abs(n.y-
        l.y)?n.x>=l.x?0:180:n.y>=l.y?90:270;w.v(l)}d.Sd()&&h.qi(a)&&(c+=180,360<=c&&(c-=360));a=pr;a=e?this.Wt:this.Pu;a===pr&&(a=e?b.Wt:b.Pu);switch(a){case qr:b=b.Wl();c+=b;360<=c&&(c-=360);break;case pr:case xo:if(d.BI())break;b=b.Wl();if(0===b)break;45<=b&&135>b?c+=90:135<=b&&225>b?c+=180:225<=b&&315>b&&(c+=270);360<=c&&(c-=360)}return c};
    W.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.uj()&&(a=Pr(this,b),null!==a))return a.jx;a=NaN;a=d?this.Vl:this.nm;null!==b&&isNaN(a)&&(a=d?b.Vl:b.nm);isNaN(a)&&(a=10);return a};W.prototype.computeSpot=function(a,b){var c;if(a)if(c=b?b:this.Lc,null===c)c=Jb;else{var d=this.Ab;d.Xc()&&null!==c&&(d=c.Ab);c=d===qc?yb:d}else c=b?b:this.ld,null===c?c=Jb:(d=this.Bb,d.Xc()&&null!==c&&(d=c.Bb),c=d===qc?yb:d);return c};
    W.prototype.computeOtherPoint=function(a,b){var c=b.Wa(Jb),d;d=b.Es;d=null!==d?Rr(d,this):null;null!==d&&(c=d.dq);return c};W.prototype.computeShortLength=function(a){if(a){if(a=this.Xt,isNaN(a)){var b=this.Lc;null!==b&&(a=b.Xt)}}else a=this.Qu,isNaN(a)&&(b=this.ld,null!==b&&(a=b.Qu));return isNaN(a)?0:a};
    W.prototype.Ak=function(a,b,c,d,e,f){if(!1===this.Xg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=f;void 0===f&&(h=w.Kf(),h.reset());h.multiply(this.transform);if(this.tn(a,h))return aq(this,b,c,e),void 0===f&&w.we(h),!0;if(this.Zf(a,h)){var k=!1;if(!this.In)for(var l=this.xa.n,m=l.length;m--;){var n=l[m];if(n.visible||n===this.bg){var p=n.W,q=this.Ja;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=w.Kf();p.set(h);if(n instanceof C)k=n.Ak(a,b,c,d,e,p);else if(this.path===
        n){if(n instanceof X){var k=n,r=a,s=d,q=p;if(!1===k.Xg)k=!1;else if(q.multiply(k.transform),s)b:{var u=r,t=q;if(k.tn(u,t))k=!0;else{if(void 0===t&&(t=k.transform,u.xk(k.W))){k=!0;break b}var q=u.left,r=u.right,s=u.top,u=u.bottom,x=w.K(),v=w.K(),A=w.K(),y=w.Kf();y.set(t);y.KF(k.transform);y.vx();v.x=r;v.y=s;v.transform(y);x.x=q;x.y=s;x.transform(y);t=!1;mq(k,x,v,A)?t=!0:(x.x=r,x.y=u,x.transform(y),mq(k,x,v,A)?t=!0:(v.x=q,v.y=u,v.transform(y),mq(k,x,v,A)?t=!0:(x.x=q,x.y=s,x.transform(y),mq(k,x,v,A)&&
    (t=!0))));w.we(y);w.v(x);w.v(v);w.v(A);k=t}}else k=k.tn(r,q)}}else k=Do(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&(e instanceof I&&e.add(n),e instanceof H&&e.add(n)));w.we(p)}}}void 0===f&&w.we(h);return k||null!==this.background||null!==this.mn}void 0===f&&w.we(h);return!1};w.u(W,{ac:"isOrthogonal"},function(){return 2===(this.Ym.value&2)});w.u(W,{$l:"isAvoiding"},function(){return 4===(this.Ym.value&4)});
    W.prototype.computeCurve=function(){if(null===this.Ki){var a=this.Lc,b=this.ac;this.Ki=null!==a&&a===this.ld&&!b}return this.Ki?Jj:this.af};W.prototype.computeCorner=function(){if(this.af===Jj)return 0;var a=this.fA;if(isNaN(a)||0>a)a=10;return a};W.prototype.findMidLabel=function(){for(var a=this.path,b=this.xa.n,c=b.length,d=0;d<c;d++){var e=b[d];if(e!==a&&!e.pf&&(-Infinity===e.Oe||isNaN(e.Oe)))return e}for(a=this.Ef;a.next();)if(b=a.value,-Infinity===b.Oe||isNaN(b.Oe))return b;return null};
    W.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a;a=Math.max(14,this.computeThickness());var b=this.Lc,c=this.ld;if(null!==b&&null!==c){var d=this.findMidLabel();if(null!==d){var e=d.Ja,f=d.margin,h=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.qq;d===pq||d===Ir||d===Hr?a=Math.max(a,e):d===Tp||d===Up||d===Rp||d===Sp?a=Math.max(a,h):(b=b.Wa(Jb).Pb(c.Wa(Jb))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(b)*h)+Math.abs(Math.cos(b)*
            e)+1));this.af===Jj&&(a*=1.333)}}return a};W.prototype.arrangeBundledLinks=function(a,b){if(b)for(var c=0;c<a.length;c++)a[c].$b()};W.prototype.computeCurviness=function(){var a=this.bx;if(isNaN(a)){var a=16,b=this.xi;if(null!==b){for(var c=w.cb(),d=0,e=b.links,f=0;f<e.length;f++){var h=e[f],h=h.computeSpacing();c.push(h);d+=h}d=-d/2;for(f=0;f<e.length;f++){h=e[f];if(h===this){a=d+c[f]/2;break}d+=c[f]}b.gq===this.Y&&(a=-a);w.ta(c)}}return a};
    W.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return null!==a?Math.max(a.lb,1):1};W.prototype.hasCurviness=function(){return!isNaN(this.bx)||null!==this.xi};
    W.prototype.adjustPoints=function(a,b,c,d){var e=this.zt;if(this.ac){if(e===Er)return!1;e===Fr&&(e=Dr)}switch(e){case Er:var f=this.l(a),h=this.l(c);if(!f.Kc(b)||!h.Kc(d)){var e=f.x,f=f.y,k=h.x-e,l=h.y-f,m=Math.sqrt(k*k+l*l);if(!Wa(m,0)){var n=0;Wa(k,0)?n=0>l?-Math.PI/2:Math.PI/2:(n=Math.atan(l/Math.abs(k)),0>k&&(n=Math.PI-n));var h=b.x,p=b.y,l=d.x-h,q=d.y-p,r=Math.sqrt(l*l+q*q),k=0;Wa(l,0)?k=0>q?-Math.PI/2:Math.PI/2:(k=Math.atan(q/Math.abs(l)),0>l&&(k=Math.PI-k));m=r/m;n=k-n;this.Yg(a,b);for(a+=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          1;a<c;a++)b=this.l(a),k=b.x-e,l=b.y-f,b=Math.sqrt(k*k+l*l),Wa(b,0)||(q=0,Wa(k,0)?q=0>l?-Math.PI/2:Math.PI/2:(q=Math.atan(l/Math.abs(k)),0>k&&(q=Math.PI-q)),k=q+n,b*=m,this.ca(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.Yg(c,d)}}return!0;case Fr:f=this.l(a);p=this.l(c);if(!f.Kc(b)||!p.Kc(d)){var e=f.x,f=f.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-f)*(p-f),k=b.x,n=b.y,l=d.x,q=d.y,r=0,s=1;0!==l-k?(r=(q-n)/(l-k),s=Math.sqrt(1+1/(r*r))):r=9E9;this.Yg(a,b);for(a+=1;a<c;a++){b=this.l(a);var u=b.x,t=b.y,x=.5;0!==m&&(x=
        ((e-u)*(e-h)+(f-t)*(f-p))/m);var v=e+x*(h-e),A=f+x*(p-f);b=Math.sqrt((u-v)*(u-v)+(t-A)*(t-A));t<r*(u-v)+A&&(b=-b);0<r&&(b=-b);u=k+x*(l-k);x=n+x*(q-n);0!==r?(b=u+b/s,this.ca(a,b,x-(b-u)/r)):this.ca(a,u,x+b)}this.Yg(c,d)}return!0;case Dr:a:{if(this.ac&&(e=this.l(a),f=this.l(a+1),h=this.l(a+2),k=f.x,n=f.y,p=k,m=n,J(e.y,f.y)?J(f.x,h.x)?n=b.y:J(f.y,h.y)&&(k=b.x):J(e.x,f.x)&&(J(f.y,h.y)?k=b.x:J(f.x,h.x)&&(n=b.y)),this.ca(a+1,k,n),e=this.l(c),f=this.l(c-1),h=this.l(c-2),k=f.x,n=f.y,l=k,q=n,J(e.y,f.y)?J(f.x,
            h.x)?n=d.y:J(f.y,h.y)&&(k=d.x):J(e.x,f.x)&&(J(f.y,h.y)?k=d.x:J(f.x,h.x)&&(n=d.y)),this.ca(c-1,k,n),Bi(this))){this.ca(a+1,p,m);this.ca(c-1,l,q);c=!1;break a}this.Yg(a,b);this.Yg(c,d);c=!0}return c;default:return!1}};
    W.prototype.addOrthoPoints=function(a,b,c,d,e,f){b=-45<=b&&45>b?0:45<=b&&135>b?90:135<=b&&225>b?180:270;d=-45<=d&&45>d?0:45<=d&&135>d?90:135<=d&&225>d?180:270;var h=e.W.copy(),k=f.W.copy();if(h.I()&&k.I()){h.Af(8,8);k.Af(8,8);h.vi(a);k.vi(c);var l,m;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)l=new z(c.x,a.y),m=new z(c.x,(a.y+c.y)/2),180===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!1),m.x=l.x,m.y=c.y):270===d&&c.y<a.y||90===d&&c.y>a.y?(l.x=a.x<k.left?this.computeMidOrthoPosition(a.x,
        k.left,!1):a.x<k.right&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!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 z(a.x,c.y);m=new z((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.Ia(a)||h.Ia(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(180===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,
        k.bottom),!0):c.y>a.y&&(180===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<h.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 z(Math.max((a.x+c.x)/2,a.x),a.y),m=new z(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: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 z(c.x,a.y),m=new z(c.x,(a.y+c.y)/2),0===d?(l.x=this.computeMidOrthoPosition(a.x,c.x,!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,k.right,!1):a.x>k.left&&(270===d&&a.y<k.top||90===d&&a.y>k.bottom)?this.computeMidOrthoPosition(a.x,c.x,!1):k.left,m.x=l.x,m.y=c.y):180===d&&a.x>k.right&&a.y>k.top&&a.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 z(a.x,c.y);m=new z((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.Ia(a)||h.Ia(c))?l.y=this.computeMidOrthoPosition(a.y,c.y,!0):c.y<a.y&&(0===d||90===d)?l.y=this.computeMidOrthoPosition(h.top,Math.max(c.y,k.bottom),!0):c.y>a.y&&(0===d||270===d)&&(l.y=this.computeMidOrthoPosition(h.bottom,Math.min(c.y,k.top),!0)),m.x=c.x,m.y=l.y;if(l.y>h.top&&l.y<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 z(Math.min((a.x+c.x)/2,a.x),a.y),m=new z(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 z(a.x,c.y),m=new z((a.x+c.x)/2,c.y),270===d?(l.y=this.computeMidOrthoPosition(a.y,c.y,!0),m.x=c.x,m.y=l.y):180===d&&c.x<a.x||0===d&&c.x>a.x?(l.y=a.y<k.top?this.computeMidOrthoPosition(a.y,k.top,!0):a.y<k.bottom&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?
        this.computeMidOrthoPosition(a.y,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 z(c.x,a.y);m=new z(c.x,(a.y+c.y)/2);if(270===d||0===d&&c.x<h.left||180===d&&c.x>h.right)270===d&&(k.Ia(a)||h.Ia(c))?l.x=this.computeMidOrthoPosition(a.x,c.x,!1):c.x<a.x&&(270===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(270===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,
            Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<h.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 z(a.x,Math.max((a.y+c.y)/2,a.y)),m=new z(c.x,l.y)}else l.x=180===d||(90===d||270===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 z(a.x,c.y),m=new z((a.x+c.x)/2,c.y),90===d?(l.y=this.computeMidOrthoPosition(a.y,
        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.y,k.bottom,!0):a.y>k.top&&(180===d&&a.x<k.left||0===d&&a.x>k.right)?this.computeMidOrthoPosition(a.y,c.y,!0):k.top,m.x=c.x,m.y=l.y):270===d&&a.y>k.bottom&&a.x>k.left&&a.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 z(c.x,a.y);m=new z(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.Ia(a)||h.Ia(c))?l.x=this.computeMidOrthoPosition(a.x,
        c.x,!1):c.x<a.x&&(90===d||0===d)?l.x=this.computeMidOrthoPosition(h.left,Math.max(c.x,k.right),!1):c.x>a.x&&(90===d||180===d)&&(l.x=this.computeMidOrthoPosition(h.right,Math.min(c.x,k.left),!1)),m.x=l.x,m.y=c.y;if(l.x>h.left&&l.x<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 z(a.x,Math.min((a.y+c.y)/2,a.y)),m=new z(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;if(this.$l){var q=this.g,r;(r=null===q)||(q.Oa.of?r=!1:(r=q.$a,r=r instanceof oh?!r.Ew||r.uI:!0),r=!r);if(r||h.Ia(c)&&!f.qi(e)||k.Ia(a)&&!e.qi(f)||e===f||this.layer.Mc)b=!1;else{var s=Dn(q,!0,this.Da,null);if(s.bq(Math.min(a.x,n.x),Math.min(a.y,n.y),Math.abs(a.x-n.x),Math.abs(a.y-n.y))&&s.bq(Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y))&&s.bq(Math.min(p.x,c.x),Math.min(p.y,c.y),Math.abs(p.x-c.x),Math.abs(p.y-c.y)))b=!1;else{e=a;f=c;
        var u=r=null;if(q.GA){q=s.gb.copy();q.Af(-s.pn,-s.on);var t=w.K();Sr(s,a.x,a.y)||(le(q.x,q.y,q.x+q.width,q.y+q.height,a.x,a.y,n.x,n.y,t)?(r=a=t.copy(),b=t.Pb(n)):le(q.x,q.y,q.x+q.width,q.y+q.height,n.x,n.y,p.x,p.y,t)?(r=a=t.copy(),b=t.Pb(p)):le(q.x,q.y,q.x+q.width,q.y+q.height,p.x,p.y,c.x,c.y,t)&&(r=a=t.copy(),b=t.Pb(c)));Sr(s,c.x,c.y)||(le(q.x,q.y,q.x+q.width,q.y+q.height,c.x,c.y,p.x,p.y,t)?(u=c=t.copy(),d=p.Pb(t)):le(q.x,q.y,q.x+q.width,q.y+q.height,p.x,p.y,n.x,n.y,t)?(u=c=t.copy(),d=n.Pb(t)):le(q.x,
                q.y,q.x+q.width,q.y+q.height,n.x,n.y,a.x,a.y,t)&&(u=c=t.copy(),d=a.Pb(t)));w.v(t)}h=h.copy().Jh(k);h.Af(2*s.pn,2*s.on);Tr(s,a,b,c,d,h);k=Ur(s,c.x,c.y);!s.abort&&999999<=k&&(Gn(s),k=s.pG,h.Af(s.pn*k,s.on*k),Tr(s,a,b,c,d,h),k=Ur(s,c.x,c.y));!s.abort&&999999<=k&&(Gn(s),k=s.DF,h.Af(s.pn*k,s.on*k),Tr(s,a,b,c,d,h),k=Ur(s,c.x,c.y));!s.abort&&999999<=k&&s.GG&&(Gn(s),Tr(s,a,b,c,d,s.gb),k=Ur(s,c.x,c.y));if(!s.abort&&999999>k&&0!==Ur(s,c.x,c.y)){Vr(this,s,c.x,c.y,d,!0);h=this.l(2);if(4>this.qa)0===b||180===
        b?(h.x=a.x,h.y=c.y):(h.x=c.x,h.y=a.y),this.ca(2,h.x,h.y),this.w(3,h.x,h.y);else if(c=this.l(3),0===b||180===b)J(h.x,c.x)?(h=0===b?Math.max(h.x,a.x):Math.min(h.x,a.x),this.ca(2,h,a.y),this.ca(3,h,c.y)):J(h.y,c.y)?(Math.abs(a.y-h.y)<=s.on/2&&(this.ca(2,h.x,a.y),this.ca(3,c.x,a.y)),this.w(2,h.x,a.y)):this.ca(2,a.x,h.y);else if(90===b||270===b)J(h.y,c.y)?(h=90===b?Math.max(h.y,a.y):Math.min(h.y,a.y),this.ca(2,a.x,h),this.ca(3,c.x,h)):J(h.x,c.x)?(Math.abs(a.x-h.x)<=s.pn/2&&(this.ca(2,a.x,h.y),this.ca(3,
            a.x,c.y)),this.w(2,a.x,h.y)):this.ca(2,h.x,a.y);null!==r&&(a=this.l(1),c=this.l(2),a.x!==c.x&&a.y!==c.y?0===b||180===b?this.w(2,a.x,c.y):this.w(2,c.x,a.y):0===b||180===b?this.w(2,e.x,r.y):this.w(2,r.x,e.y));null!==u&&(0===d||180===d?this.ij(f.x,u.y):this.ij(u.x,f.y));b=!0}else b=!1}}}else b=!1;b||(this.mi(l),this.mi(m))}};W.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};
    function Bi(a){if(null===a.g||!a.$l)return!1;var b=a.points.n,c=b.length;if(4>c)return!1;a=Dn(a.g,!0,a.Da,null);for(var d=1;d<c-2;d++){var e=b[d],f=b[d+1];if(!a.bq(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}
    function Vr(a,b,c,d,e,f){var h=b.pn,k=b.on,l=Ur(b,c,d),m=c,n=d;for(0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;1<l&&Ur(b,m,n)===l-1;)c=m,d=n,0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k,l-=1;if(f){if(1<l)if(180===e||0===e)c=Math.floor(c/h)*h+h/2;else if(90===e||270===e)d=Math.floor(d/k)*k+k/2}else c=Math.floor(c/h)*h+h/2,d=Math.floor(d/k)*k+k/2;1<l&&(f=e,m=c,n=d,0===e?(f=90,n+=k):90===e?(f=180,m-=h):180===e?(f=270,n-=k):270===e&&(f=0,m+=h),Ur(b,m,n)===l-1?Vr(a,b,m,n,f,!1):(m=c,n=d,0===e?(f=270,n-=k):90===
    e?(f=0,m+=h):180===e?(f=90,n+=k):270===e&&(f=180,m-=h),Ur(b,m,n)===l-1&&Vr(a,b,m,n,f,!1)));a.ij(c,d)}W.prototype.findClosestSegment=function(a){var b=a.x;a=a.y;for(var c=this.l(0),d=this.l(1),e=Ra(b,a,c.x,c.y,d.x,d.y),f=0,h=1;h<this.qa-1;h++){var c=this.l(h+1),k=Ra(b,a,d.x,d.y,c.x,c.y),d=c;k<e&&(f=h,e=k)}return f};W.prototype.Me=function(){this.Ua=null};w.u(W,{kf:"geometry"},function(){null===this.Ua&&(this.eo(),this.Ua=this.makeGeometry());return this.Ua});
    W.prototype.qu=function(a){if(!a){if(!1===this.Mf)return;a=this.Ld();if(null!==this.Ua&&(null===a||null!==a.kf))return}this.Ua=this.makeGeometry();a=this.path;if(null!==a){a.Ua=this.Ua;for(var b=this.xa.n,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.pf&&e instanceof X&&(e.Ua=this.Ua)}}};
    W.prototype.makeGeometry=function(){var a=this.qa;if(2>a)return new Ce(Ge);var b=!1,c=this.g;null!==c&&Lr(this)&&c.cl.contains(this)&&null!==this.qw&&(b=!0);var d=c=0,e=this.l(0).copy(),f=e.copy(),c=this.fd.n,h=this.computeCurve();if(h===Jj&&3<=a&&!Wa(this.vq,0))if(3===a)var k=this.l(1),c=Math.min(e.x,k.x),d=Math.min(e.y,k.y),k=this.l(2),c=Math.min(c,k.x),d=Math.min(d,k.y);else{if(this.ac)for(k=0;k<a;k++)d=c[k],f.x=Math.min(d.x,f.x),f.y=Math.min(d.y,f.y);else for(k=3;k<a;k+=3)k+3>=a&&(k=a-1),c=this.l(k),
        f.x=Math.min(c.x,f.x),f.y=Math.min(c.y,f.y);c=f.x;d=f.y}else{for(k=0;k<a;k++)d=c[k],f.x=Math.min(d.x,f.x),f.y=Math.min(d.y,f.y);c=f.x;d=f.y}c-=this.Kz.x;d-=this.Kz.y;e.x-=c;e.y-=d;if(2!==a||Lr(this)){var l=w.s();0!==this.computeShortLength(!0)&&(e=Wr(this,e,!0,f));M(l,e.x,e.y,!1,!1);if(h===Jj&&3<=a&&!Wa(this.vq,0))if(3===a)k=this.l(1),a=k.x-c,b=k.y-d,k=this.l(2).copy(),k.x-=c,k.y-=d,0!==this.computeShortLength(!1)&&(k=Wr(this,k,!1,f)),N(l,a,b,a,b,k.x,k.y);else if(this.ac){for(var f=new z(c,d),e=this.l(1).copy(),
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             h=new z(c,d),a=new z(c,d),b=this.l(0),m=null,n=this.vq/3,k=1;k<this.qa-1;k++){var m=this.l(k),p=b,q=m,r=this.l(Xr(this,m,k,!1));if(!Wa(p.x,q.x)||!Wa(q.x,r.x))if(!Wa(p.y,q.y)||!Wa(q.y,r.y)){var s=n,u=h,t=a;isNaN(s)&&(s=this.vq/3);var x=p.x,p=p.y,v=q.x,q=q.y,A=r.x,r=r.y,y=s*Yr(x,p,v,q),s=s*Yr(v,q,A,r);Wa(p,q)&&Wa(v,A)&&(v>x?r>q?(u.x=v-y,u.y=q-y,t.x=v+s,t.y=q+s):(u.x=v-y,u.y=q+y,t.x=v+s,t.y=q-s):r>q?(u.x=v+y,u.y=q-y,t.x=v-s,t.y=q+s):(u.x=v+y,u.y=q+y,t.x=v-s,t.y=q-s));Wa(x,v)&&Wa(q,r)&&(q>p?(A>v?(u.x=
        v-y,u.y=q-y,t.x=v+s):(u.x=v+y,u.y=q-y,t.x=v-s),t.y=q+s):(A>v?(u.x=v-y,u.y=q+y,t.x=v+s):(u.x=v+y,u.y=q+y,t.x=v-s),t.y=q-s));if(Wa(x,v)&&Wa(v,A)||Wa(p,q)&&Wa(q,r))x=.5*(x+A),p=.5*(p+r),u.x=x,u.y=p,t.x=x,t.y=p;1===k?(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y)):2===k&&Wa(b.x,this.l(0).x)&&Wa(b.y,this.l(0).y)&&(e.x=.5*(b.x+m.x),e.y=.5*(b.y+m.y));N(l,e.x-c,e.y-d,h.x-c,h.y-d,m.x-c,m.y-d);f.set(h);e.set(a);b=m}}k=b.x;b=b.y;f=this.l(this.qa-1);0!==this.computeShortLength(!1)&&(f=Wr(this,f.copy(),!1,dd));k=.5*(k+f.x);
        b=.5*(b+f.y);N(l,a.x-c,a.y-d,k-c,b-d,f.x-c,f.y-d)}else for(k=3;k<a;k+=3)b=this.l(k-2),k+3>=a&&(k=a-1),f=this.l(k-1),e=this.l(k),k===a-1&&0!==this.computeShortLength(!1)&&(e=Wr(this,e.copy(),!1,dd)),N(l,b.x-c,b.y-d,f.x-c,f.y-d,e.x-c,e.y-d);else{f=w.K();f.assign(this.l(0));k=1;for(e=0;k<a;){k=Xr(this,f,k,1<k);u=this.l(k);if(k>=a-1){if(!f.L(u))0!==this.computeShortLength(!1)&&(u=Wr(this,u.copy(),!1,dd)),Zr(this,l,-c,-d,f,u,b);else if(0===e)for(k=1;k<a;)u=this.l(k++),Zr(this,l,-c,-d,f,u,b),f.assign(u);
        break}e=Xr(this,u,k+1,k<a-3);k=l;h=-c;m=-d;n=f;t=this.l(e);x=f;p=b;J(n.y,u.y)&&J(u.x,t.x)?(s=this.computeCorner(),s=Math.min(s,Math.abs(u.x-n.x)/2),s=v=Math.min(s,Math.abs(t.y-u.y)/2),J(s,0)?(Zr(this,k,h,m,n,u,p),x.assign(u)):(q=u.x,A=u.y,r=q,y=A,q=u.x>n.x?u.x-s:u.x+s,y=t.y>u.y?u.y+v:u.y-v,Zr(this,k,h,m,n,new z(q,A),p),Qe(k,u.x+h,u.y+m,r+h,y+m),x.m(r,y))):J(n.x,u.x)&&J(u.y,t.y)?(s=this.computeCorner(),v=Math.min(s,Math.abs(u.y-n.y)/2),v=s=Math.min(v,Math.abs(t.x-u.x)/2),J(s,0)?(Zr(this,k,h,m,n,u,
        p),x.assign(u)):(q=u.x,y=A=u.y,A=u.y>n.y?u.y-v:u.y+v,r=t.x>u.x?u.x+s:u.x-s,Zr(this,k,h,m,n,new z(q,A),p),Qe(k,u.x+h,u.y+m,r+h,y+m),x.m(r,y))):(Zr(this,k,h,m,n,u,p),x.assign(u));k=e}w.v(f)}c=l.o;w.q(l)}else l=this.l(1).copy(),l.x-=c,l.y-=d,0!==this.computeShortLength(!0)&&(e=Wr(this,e,!0,f)),0!==this.computeShortLength(!1)&&(l=Wr(this,l,!1,f)),c=new Ce(Ge),c.ha=e.x,c.fa=e.y,c.C=l.x,c.D=l.y;return c};
    function Yr(a,b,c,d){a=c-a;if(isNaN(a)||Infinity===a||-Infinity===a)return NaN;0>a&&(a=-a);b=d-b;if(isNaN(b)||Infinity===b||-Infinity===b)return NaN;0>b&&(b=-b);return Wa(a,0)?b:Wa(b,0)?a:Math.sqrt(a*a+b*b)}
    function Wr(a,b,c,d){var e=a.qa;if(2>e)return b;if(c){var f=a.l(1);c=f.x-d.x;d=f.y-d.y;f=Yr(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!0);a>e&&(a=e);c=a*(c-b.x)/f;a=a*(d-b.y)/f;b.x+=c;b.y+=a}else{f=a.l(e-2);c=f.x-d.x;d=f.y-d.y;f=Yr(b.x,b.y,c,d);if(0===f)return b;e=2===e?.5*f:f;a=a.computeShortLength(!1);a>e&&(a=e);c=a*(b.x-c)/f;a=a*(b.y-d)/f;b.x-=c;b.y-=a}return b}
    function Xr(a,b,c,d){for(var e=a.qa,f=b;Wa(b.x,f.x)&&Wa(b.y,f.y);){if(c>=e)return e-1;f=a.l(c++)}if(!Wa(b.x,f.x)&&!Wa(b.y,f.y))return c-1;for(var h=f;Wa(b.x,f.x)&&Wa(f.x,h.x)&&(!d||(b.y>=f.y?f.y>=h.y:f.y<=h.y))||Wa(b.y,f.y)&&Wa(f.y,h.y)&&(!d||(b.x>=f.x?f.x>=h.x:f.x<=h.x));){if(c>=e)return e-1;h=a.l(c++)}return c-2}
    function Zr(a,b,c,d,e,f,h){if(!h&&Lr(a)){h=[];var k=0;a.isVisible()&&(k=$r(a,e,f,h));var l=e.x,l=e.y;if(0<k)if(J(e.y,f.y))if(e.x<f.x)for(var m=0;m<k;){var n=Math.max(e.x,Math.min(h[m++]-5,f.x-10));b.lineTo(n+c,f.y+d);for(var l=n+c,p=Math.min(n+10,f.x);m<k;){var q=h[m];if(q<p+10)m++,p=Math.min(q+5,f.x);else break}q=(n+p)/2+c;q=f.y-10+d;n=p+c;p=f.y+d;a.af===jj?M(b,n,p,!1,!1):N(b,l,q,n,q,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.x,Math.max(h[m--]+5,f.x+10));b.lineTo(n+c,f.y+d);l=n+c;for(p=Math.max(n-10,
        f.x);0<=m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,f.x);else break;q=f.y-10+d;n=p+c;p=f.y+d;a.af===jj?M(b,n,p,!1,!1):N(b,l,q,n,q,n,p)}else if(J(e.x,f.x))if(e.y<f.y)for(m=0;m<k;){n=Math.max(e.y,Math.min(h[m++]-5,f.y-10));b.lineTo(f.x+c,n+d);l=n+d;for(p=Math.min(n+10,f.y);m<k;)if(q=h[m],q<p+10)m++,p=Math.min(q+5,f.y);else break;q=f.x-10+c;n=f.x+c;p+=d;a.af===jj?M(b,n,p,!1,!1):N(b,q,l,q,p,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.y,Math.max(h[m--]+5,f.y+10));b.lineTo(f.x+c,n+d);l=n+d;for(p=Math.max(n-10,f.y);0<=
    m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,f.y);else break;q=f.x-10+c;n=f.x+c;p+=d;a.af===jj?M(b,n,p,!1,!1):N(b,q,l,q,p,n,p)}}b.lineTo(f.x+c,f.y+d)}
    function $r(a,b,c,d){var e=a.g;if(null===e||b.L(c))return 0;for(e=e.Ix;e.next();){var f=e.value;if(null!==f&&f.visible)for(var f=f.zb.n,h=f.length,k=0;k<h;k++){var l=f[k];if(l instanceof W){if(l===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(l.isVisible()&&Lr(l)){var m=l.Yn;m.I()&&a.Yn.Zf(m)&&!a.usesSamePort(l)&&(m=l.path,null!==m&&m.xj()&&as(b,c,d,l))}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
    function as(a,b,c,d){for(var e=J(a.y,b.y),f=d.qa,h=d.l(0),k=w.K(),l=1;l<f;l++){var m=d.l(l);if(l<f-1){var n=d.l(l+1);if(h.y===m.y&&m.y===n.y){if(m.x>h.x&&n.x>m.x||m.x<h.x&&n.x<m.x)m=n,l++}else h.x===m.x&&m.x===n.x&&(m.y>h.y&&n.y>m.y||m.y<h.y&&n.y<m.y)&&(m=n,l++)}a:{var n=k,p=a.x,q=a.y,r=b.x,s=b.y,u=h.x,h=h.y,t=m.x,x=m.y;if(!J(p,r)){if(J(q,s)&&J(u,t)&&Math.min(p,r)<u&&Math.max(p,r)>u&&Math.min(h,x)<q&&Math.max(h,x)>q&&!J(h,x)){n.x=u;n.y=q;n=!0;break a}}else if(!J(q,s)&&J(h,x)&&Math.min(q,s)<h&&Math.max(q,
            s)>h&&Math.min(u,t)<p&&Math.max(u,t)>p&&!J(u,t)){n.x=p;n.y=h;n=!0;break a}n.x=0;n.y=0;n=!1}n&&(e?c.push(k.x):c.push(k.y));h=m}w.v(k)}w.u(W,{Qt:"firstPickIndex"},function(){var a;2>=this.qa?a=0:((a=this.ac)||(a=this.computeSpot(!0)!==yb),a=a?1:0);return a});w.u(W,{Gx:"lastPickIndex"},function(){var a=this.qa;if(0===a)a=0;else if(2>=a)a-=1;else{var b;(b=this.ac)||(b=this.computeSpot(!1)!==yb);a=b?a-2:a-1}return a});function Lr(a){a=a.af;return a===ij||a===jj}
    function Nr(a,b){if(b||Lr(a)){var c=a.g;null===c||c.cl.contains(a)||null===a.qw||c.cl.add(a,a.qw)}}function lj(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Mc){var d=c.g;if(null!==d)for(var e=!1,d=d.Ix;d.next();){var f=d.value;if(f.visible)if(f===c)for(var e=!0,h=!1,f=f.zb.n,k=f.length,l=0;l<k;l++){var m=f[l];m instanceof W&&(m===a?h=!0:h&&bs(a,m,b))}else if(e)for(f=f.zb.n,k=f.length,l=0;l<k;l++)m=f[l],m instanceof W&&bs(a,m,b)}}}
    function bs(a,b,c){if(null!==b&&null!==b.Ua&&Lr(b)){var d=b.Yn;d.I()&&(a.Yn.Zf(d)||c.Zf(d))&&(a.usesSamePort(b)||b.Me())}}W.prototype.usesSamePort=function(a){var b=this.qa,c=a.qa;if(0<b&&0<c){var d=this.l(0),e=a.l(0);if(d.Kc(e))return!0;b=this.l(b-1);a=a.l(c-1);if(b.Kc(a)||d.Kc(a)||b.Kc(e))return!0}else if(this.Y===a.Y||this.$===a.$||this.Y===a.$||this.$===a.Y)return!0;return!1};
    W.prototype.isVisible=function(){if(!R.prototype.isVisible.call(this))return!1;var a=this.Da,b=!0,c=this.g;null!==c&&(b=c.Td);var d=this.Y;if(null!==d){if(this.Nc&&b&&!d.tc)return!1;if(d===a)return!0;for(c=d;null!==c;){if(c.Wb===this)return!0;c=c.Da}c=d.findVisibleNode();if(null===c||c===a)return!1}d=this.$;if(null!==d){if(this.Nc&&!b&&!d.tc)return!1;if(d===a)return!0;for(c=d;null!==c;){if(c.Wb===this)return!0;c=c.Da}b=d.findVisibleNode();if(null===b||b===a)return!1}return!0};
    W.prototype.yd=function(a){R.prototype.yd.call(this,a);null!==this.xi&&this.xi.Yp();if(null!==this.uf)for(var b=this.uf.i;b.next();)b.value.yd(a)};w.defineProperty(W,{zt:"adjusting"},function(){return this.Gq},function(a){var b=this.Gq;b!==a&&(this.Gq=a,this.h("adjusting",b,a))});w.defineProperty(W,{fA:"corner"},function(){return this.ar},function(a){var b=this.ar;b!==a&&(this.ar=a,this.Me(),this.h("corner",b,a))});
    w.defineProperty(W,{af:"curve"},function(){return this.dr},function(a){var b=this.dr;b!==a&&(this.dr=a,this.$b(),this.Me(),Nr(this,b===jj||b===ij||a===jj||a===ij),this.h("curve",b,a))});w.defineProperty(W,{bx:"curviness"},function(){return this.er},function(a){var b=this.er;b!==a&&(this.er=a,this.$b(),this.Me(),this.h("curviness",b,a))});
    w.defineProperty(W,{gy:"routing"},function(){return this.Ym},function(a){var b=this.Ym;b!==a&&(this.Ym=a,this.Ki=null,this.$b(),Nr(this,2===(b.value&2)||2===(a.value&2)),this.h("routing",b,a))});w.defineProperty(W,{vq:"smoothness"},function(){return this.dt},function(a){var b=this.dt;b!==a&&(this.dt=a,this.Me(),this.h("smoothness",b,a))});
    function Kr(a){var b=a.tg;if(null!==b){var c=a.Jg;if(null!==c){var d=a.Qh;a=a.li;for(var e=null,f=null,h=b.pc.n,k=h.length,l=0;l<k;l++){var m=h[l];if(m.tg===b&&m.Qh===d&&m.Jg===c&&m.li===a||m.tg===c&&m.Qh===a&&m.Jg===b&&m.li===d)null===f?f=m:(null===e&&(e=[],e.push(f)),e.push(m))}if(null!==e){f=tr(b,c,d,a);null===f&&(f=new yl,f.gq=b,f.Tx=d,f.vu=c,f.Ux=a,sr(b,f),sr(c,f));f.links=e;for(l=0;l<e.length;l++)m=e[l],m.xi=f;f.Yp()}}}}
    function Jr(a){var b=a.xi;null!==b&&(a.xi=null,a=b.links.indexOf(a),0<=a&&(w.Lg(b.links,a),b.Yp()))}w.u(W,{key:"key"},function(){var a=this.g;return null!==a&&a.aa instanceof Q?a.aa.bf(this.data):void 0},{configurable:!0});function yl(){w.nc(this);this.Pf=this.Mv=!1;this.Ux=this.vu=this.Tx=this.gq=null;this.links=[]}yl.prototype.Yp=function(){if(!this.Mv){var a=this.links;0<a.length&&(a=a[0].g,null!==a&&(a.PC.add(this),this.Pf=a.ia.ab))}this.Mv=!0};
    yl.prototype.FB=function(){if(this.Mv){this.Mv=!1;var a=this.links;if(0<a.length){var b=a[0],c=b.g,c=null===c||c.Jn&&!this.Pf;this.Pf=!1;b.arrangeBundledLinks(a,c);1===a.length&&(b.xi=null,a.length=0)}0===a.length&&(a=this.gq,null!==this&&null!==a.Kh&&a.Kh.remove(this),a=this.vu,null!==this&&null!==a.Kh&&a.Kh.remove(this))}};w.ce(yl,{gq:!0,Tx:!0,vu:!0,Ux:!0,links:!0,spacing:!0});
    function En(){w.nc(this);this.tB=this.group=null;this.cu=!0;this.abort=!1;this.Dg=this.Cg=1;this.ds=this.cs=-1;this.Be=this.Ae=8;this.od=null;this.GG=!1;this.pG=22;this.DF=111}w.ce(En,{group:!0,tB:!0,cu:!0,abort:!0,GG:!0,pG:!0,DF:!0});
    En.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.Cg=Math.floor((a.x-this.Ae)/this.Ae)*this.Ae;this.Dg=Math.floor((b-this.Be)/this.Be)*this.Be;this.cs=Math.ceil((c+2*this.Ae)/this.Ae)*this.Ae;this.ds=Math.ceil((d+2*this.Be)/this.Be)*this.Be;a=1+(Math.ceil((this.cs-this.Cg)/this.Ae)|0);b=1+(Math.ceil((this.ds-this.Dg)/this.Be)|0);if(null===this.od||this.zp<a-1||this.Ap<b-1){c=[];for(d=0;d<=a;d++)c[d]=[];this.od=c;this.zp=a-1;this.Ap=b-1}if(null!==
        this.od)for(a=0;a<=this.zp;a++)for(b=0;b<=this.Ap;b++)this.od[a][b]=1E6}};w.u(En,{gb:null},function(){return new B(this.Cg,this.Dg,this.cs-this.Cg,this.ds-this.Dg)});w.defineProperty(En,{pn:null},function(){return this.Ae},function(a){0<a&&a!==this.Ae&&(this.Ae=a,this.initialize(this.gb))});w.defineProperty(En,{on:null},function(){return this.Be},function(a){0<a&&a!==this.Be&&(this.Be=a,this.initialize(this.gb))});function Sr(a,b,c){return a.Cg<=b&&b<=a.cs&&a.Dg<=c&&c<=a.ds}
    function Ur(a,b,c){if(!Sr(a,b,c))return 1E6;b-=a.Cg;b/=a.Ae;c-=a.Dg;c/=a.Be;return a.od[b|0][c|0]}function Hn(a,b,c){Sr(a,b,c)&&(b-=a.Cg,b/=a.Ae,c-=a.Dg,c/=a.Be,a.od[b|0][c|0]=0)}function Gn(a){if(null!==a.od)for(var b=0;b<=a.zp;b++)for(var c=0;c<=a.Ap;c++)1<=a.od[b][c]&&(a.od[b][c]=1E6)}
    En.prototype.bq=function(a,b,c,d){if(a>this.cs||a+c<this.Cg||b>this.ds||b+d<this.Dg)return!0;a=(a-this.Cg)/this.Ae|0;b=(b-this.Dg)/this.Be|0;c=Math.max(0,c)/this.Ae+1|0;var e=Math.max(0,d)/this.Be+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.zp)|0;for(c=Math.min(b+e-1,this.Ap)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.od[a][e])return!1;return!0};
    function cs(a,b,c,d,e,f,h,k,l){if(!(b<f||b>h||c<k||c>l)){var m,n;m=b|0;n=c|0;var p=a.od[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;f<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.od[m][n]);)a.od[m][n]=p,p+=1,e?n+=d:m+=d;m=e?n:m;if(e)if(0<d)for(c+=d;c<m;c+=d)cs(a,b,c,1,!e,f,h,k,l),cs(a,b,c,-1,!e,f,h,k,l);else for(c+=d;c>m;c+=d)cs(a,b,c,1,!e,f,h,k,l),cs(a,b,c,-1,!e,f,h,k,l);else if(0<d)for(b+=d;b<m;b+=d)cs(a,b,c,1,!e,f,h,k,l),cs(a,b,c,-1,!e,f,h,k,l);else for(b+=d;b>m;b+=d)cs(a,b,c,1,!e,f,h,k,l),cs(a,b,c,-1,!e,f,h,
        k,l)}}function ds(a,b,c,d,e,f,h,k,l){b|=0;c|=0;var m=0,n=1;for(a.od[b][c]=n;0===m&&b>f&&b<h&&c>k&&c<l;)n+=1,a.od[b][c]=n,e?c+=d:b+=d,m=a.od[b][c]}function es(a,b,c,d,e,f,h,k,l){b|=0;c|=0;var m=0;for(a.od[b][c]=999999;0===m&&b>f&&b<h&&c>k&&c<l;)a.od[b][c]=999999,e?c+=d:b+=d,m=a.od[b][c]}
    function Tr(a,b,c,d,e,f){if(null!==a.od){a.abort=!1;var h=b.x,k=b.y;if(Sr(a,h,k)&&(h-=a.Cg,h/=a.Ae,k-=a.Dg,k/=a.Be,b=d.x,d=d.y,Sr(a,b,d)))if(b-=a.Cg,b/=a.Ae,d-=a.Dg,d/=a.Be,1>=Math.abs(h-b)&&1>=Math.abs(k-d))a.abort=!0;else{var l=f.x,m=f.y,n=f.x+f.width,p=f.y+f.height,l=l-a.Cg,l=l/a.Ae,m=m-a.Dg,m=m/a.Be,n=n-a.Cg,n=n/a.Ae,p=p-a.Dg,p=p/a.Be;f=Math.max(0,Math.min(a.zp,l|0));n=Math.min(a.zp,Math.max(0,n|0));m=Math.max(0,Math.min(a.Ap,m|0));p=Math.min(a.Ap,Math.max(0,p|0));h|=0;k|=0;b|=0;d|=0;l=0===c||
    90===c?1:-1;c=90===c||270===c;0===a.od[h][k]?(ds(a,h,k,l,c,f,n,m,p),ds(a,h,k,1,!c,f,n,m,p),ds(a,h,k,-1,!c,f,n,m,p)):ds(a,h,k,l,c,h,k,h,k);0===a.od[b][d]?(es(a,b,d,0===e||90===e?1:-1,90===e||270===e,f,n,m,p),es(a,b,d,1,!(90===e||270===e),f,n,m,p),es(a,b,d,-1,!(90===e||270===e),f,n,m,p)):es(a,b,d,l,c,b,d,b,d);a.abort||(cs(a,h,k,1,!1,f,n,m,p),cs(a,h,k,-1,!1,f,n,m,p),cs(a,h,k,1,!0,f,n,m,p),cs(a,h,k,-1,!0,f,n,m,p))}}}function Qr(){w.nc(this);this.port=this.Pc=null;this.fg=[];this.fq=!1}
    w.ce(Qr,{Pc:!0,port:!0,fg:!0,fq:!0});Qr.prototype.toString=function(){for(var a=this.fg,b=this.Pc.toString()+" "+a.length.toString()+":",c=0;c<a.length;c++){var d=a[c];null!==d&&(b+="\n  "+d.toString())}return b};
    function fs(a,b,c,d){b=b.offsetY;switch(b){case w.cd:return 90;case w.Sc:return 180;case w.md:return 270;case w.dd:return 0}switch(b){case w.cd|w.md:return 180<c?270:90;case w.Sc|w.dd:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case w.Sc|w.md:return c>a&&c<=180+a?180:270;case w.md|w.dd:return c>180-a&&c<=360-a?270:0;case w.dd|w.cd:return c>a&&c<=180+a?90:0;case w.cd|w.Sc:return c>180-a&&c<=360-a?180:90;case w.Sc|w.md|w.dd:return 90<c&&c<=180+a?180:c>180+a&&c<=360-
    a?270:0;case w.md|w.dd|w.cd:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case w.dd|w.cd|w.Sc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case w.cd|w.Sc|w.md:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(w.Sc|w.md|w.dd|w.cd)&&(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}Qr.prototype.Yp=function(){this.fg.length=0};
    function Rr(a,b){var c=a.fg;if(0===c.length){a:if(!a.fq){c=a.fq;a.fq=!0;var d,e=null,f=a.Pc,f=f instanceof V?f:null;if(null===f||f.Zc)d=a.Pc.QE(a.port.Ud);else{if(!f.W.I()){a.fq=c;break a}e=f;d=e.PE()}var h=a.fg.length=0,k=a.port.Wa(Ab,w.K()),l=a.port.Wa(Sb,w.K()),f=w.mg(k.x,k.y,0,0);f.vi(l);w.v(k);w.v(l);k=w.xb(f.x+f.width/2,f.y+f.height/2);l=a.port.Wl();for(d=d.i;d.next();){var m=d.value;if(m.isVisible()){var n=m.Lc===a.port||m.Y.qi(e),p=m.computeSpot(n,a.port);if(p.uj()&&(n=n?m.ld:m.Lc,null!==
        n)){var q=n.U;if(null!==q){var r=q.findVisibleNode();null!==r&&r!==q&&(q=r,n=q.port);n=m.computeOtherPoint(q,n);q=k.Pb(n);q-=l;0>q&&(q+=360);p=fs(f,p,q,m.ac);r=0;0===p?(r=w.dd,180<q&&(q-=360)):r=90===p?w.cd:180===p?w.Sc:w.md;p=a.fg[h];void 0===p?(p=new gs(m,q,r),a.fg[h]=p):(p.link=m,p.angle=q,p.ye=r);p.Rx.set(n);h++}}}}w.v(k);a.fg.sort(Qr.prototype.eJ);e=a.fg.length;k=-1;for(h=l=0;h<e;h++)p=a.fg[h],void 0!==p&&(p.ye!==k&&(k=p.ye,l=0),p.Wp=l,l++);k=-1;l=0;for(h=e-1;0<=h;h--)p=a.fg[h],void 0!==p&&(p.ye!==
    k&&(k=p.ye,l=p.Wp+1),p.wn=l);h=a.fg;p=a.port;e=a.Pc.jJ;k=w.K();l=w.K();d=w.K();m=w.K();p.Wa(Ab,k);p.Wa(Gb,l);p.Wa(Sb,d);p.Wa(Qb,m);r=q=n=p=0;if(e===rr)for(var s=0;s<h.length;s++){var u=h[s];if(null!==u){var t=u.link.computeThickness();switch(u.ye){case w.cd:q+=t;break;case w.Sc:r+=t;break;case w.md:p+=t;break;default:case w.dd:n+=t}}}for(var x=0,v=0,A=1,s=0;s<h.length;s++)if(u=h[s],null!==u){var y,K;if(x!==u.ye){x=u.ye;switch(x){case w.cd:y=d;K=m;break;case w.Sc:y=m;K=k;break;case w.md:y=k;K=l;break;
        default:case w.dd:y=l,K=d}var E=K.x-y.x;K=K.y-y.y;switch(x){case w.cd:q>Math.abs(E)?(A=Math.abs(E)/q,q=Math.abs(E)):A=1;break;case w.Sc:r>Math.abs(K)?(A=Math.abs(K)/r,r=Math.abs(K)):A=1;break;case w.md:p>Math.abs(E)?(A=Math.abs(E)/p,p=Math.abs(E)):A=1;break;default:case w.dd:n>Math.abs(K)?(A=Math.abs(K)/n,n=Math.abs(K)):A=1}v=0}var P=u.dq;if(e===rr){t=u.link.computeThickness();t*=A;P.set(y);switch(x){case w.cd:P.x=y.x+E/2+q/2-v-t/2;break;case w.Sc:P.y=y.y+K/2+r/2-v-t/2;break;case w.md:P.x=y.x+E/2-
        p/2+v+t/2;break;default:case w.dd:P.y=y.y+K/2-n/2+v+t/2}v+=t}else t=.5,e===or&&(t=(u.Wp+1)/(u.wn+1)),P.x=y.x+E*t,P.y=y.y+K*t}w.v(k);w.v(l);w.v(d);w.v(m);y=a.fg;for(E=0;E<y.length;E++)K=y[E],null!==K&&(K.jx=a.computeEndSegmentLength(K));a.fq=c;w.Db(f)}c=a.fg}for(f=0;f<c.length;f++)if(y=c[f],null!==y&&y.link===b)return y;return null}Qr.prototype.eJ=function(a,b){return a===b?0:null===a?-1:null===b?1:a.ye<b.ye?-1:a.ye>b.ye?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
    Qr.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Pc,this.port,yb,b.Lc===this.port),d=a.Wp;if(0>d)return c;var e=a.wn;if(1>=e||!b.ac)return c;var b=a.Rx,f=a.dq;if(a.ye===w.Sc||a.ye===w.cd)d=e-1-d;return((a=a.ye===w.Sc||a.ye===w.dd)?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)};function gs(a,b,c){this.link=a;this.angle=b;this.ye=c;this.Rx=new z;this.wn=this.Wp=0;this.dq=new z;this.jx=0}
    w.ce(gs,{link:!0,angle:!0,ye:!0,Rx:!0,Wp:!0,wn:!0,dq:!0,jx:!0});gs.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.ye.toString()+":"+this.Wp.toString()+"/"+this.wn.toString()+" "+this.dq.toString()+" "+this.jx.toString()+" "+this.Rx.toString()};function wo(){this.pk=this.Tj=qc;this.nk=this.Rj=NaN;this.mk=this.Qj=pr;this.ok=this.Sj=NaN;this.nt=this.wr=null;this.ot=this.xr=Infinity}
    wo.prototype.copy=function(){var a=new wo;a.Tj=this.Tj.S();a.pk=this.pk.S();a.Rj=this.Rj;a.nk=this.nk;a.Qj=this.Qj;a.mk=this.mk;a.Sj=this.Sj;a.ok=this.ok;a.wr=this.wr;a.nt=this.nt;a.xr=this.xr;a.ot=this.ot;return a};function V(a){T.call(this,a);this.ya|=4608;this.fs=new I(R);this.bp=new I(V);this.Lb=this.ht=this.ul=this.gs=this.es=null;this.ke=new tg;this.ke.group=this}w.Ka(V,T);w.ga("Group",V);
    V.prototype.cloneProtected=function(a){T.prototype.cloneProtected.call(this,a);this.ya&=-32769;a.es=this.es;a.gs=this.gs;a.ul=this.ul;a.ht=this.ht;var b=a.Mt(function(a){return a instanceof Nj});a.Lb=b instanceof Nj?b:null;null!==this.ke?(a.ke=this.ke.copy(),a.ke.group=a):(null!==a.ke&&(a.ke.group=null),a.ke=null)};V.prototype.oi=function(a){T.prototype.oi.call(this,a);var b=a.Sp();for(a=a.Oc;a.next();){var c=a.value;c.H();c.J(8);c.Et();if(c instanceof T)c.$f(b);else if(c instanceof W)for(c=c.Ef;c.next();)c.value.$f(b)}};
    V.prototype.Xn=function(a,b,c,d,e,f,h){if(a===Pf&&"elements"===b)if(e instanceof Nj){var k=e;null===this.Lb?this.Lb=k:this.Lb!==k&&w.k("Cannot insert a second Placeholder into the visual tree of a Group.")}else e instanceof C&&(k=e.Mt(function(a){return a instanceof Nj}),k instanceof Nj&&(null===this.Lb?this.Lb=k:this.Lb!==k&&w.k("Cannot insert a second Placeholder into the visual tree of a Group.")));else a===Qf&&"elements"===b&&null!==this.Lb&&(d===this.Lb?this.Lb=null:d instanceof C&&this.Lb.bm(d)&&
        (this.Lb=null));T.prototype.Xn.call(this,a,b,c,d,e,f,h)};V.prototype.jj=function(a,b,c,d){this.tl=this.Lb;C.prototype.jj.call(this,a,b,c,d)};V.prototype.cm=function(){if(!T.prototype.cm.call(this))return!1;for(var a=this.Oc;a.next();){var b=a.value;if(b instanceof T){if(b.isVisible()&&Dm(b))return!1}else if(b instanceof W&&b.isVisible()&&Dm(b)&&b.Y!==this&&b.$!==this)return!1}return!0};w.u(V,{placeholder:"placeholder"},function(){return this.Lb});
    w.defineProperty(V,{zH:"computesBoundsAfterDrag"},function(){return 0!==(this.ya&2048)},function(a){var b=0!==(this.ya&2048);b!==a&&(w.j(a,"boolean",V,"computesBoundsAfterDrag"),this.ya^=2048,this.h("computesBoundsAfterDrag",b,a))});w.defineProperty(V,{Yw:"computesBoundsIncludingLinks"},function(){return 0!==(this.ya&4096)},function(a){w.j(a,"boolean",V,"computesBoundsIncludingLinks");var b=0!==(this.ya&4096);b!==a&&(this.ya^=4096,this.h("computesBoundsIncludingLinks",b,a))});
    w.defineProperty(V,{AH:"computesBoundsIncludingLocation"},function(){return 0!==(this.ya&8192)},function(a){w.j(a,"boolean",V,"computesBoundsIncludingLocation");var b=0!==(this.ya&8192);b!==a&&(this.ya^=8192,this.h("computesBoundsIncludingLocation",b,a))});w.defineProperty(V,{kI:"handlesDragDropForMembers"},function(){return 0!==(this.ya&16384)},function(a){w.j(a,"boolean",V,"handlesDragDropForMembers");var b=0!==(this.ya&16384);b!==a&&(this.ya^=16384,this.h("handlesDragDropForMembers",b,a))});
    w.u(V,{Oc:"memberParts"},function(){return this.fs.i});function kr(a,b){if(a.fs.add(b)){b instanceof V&&a.bp.add(b);var c=a.WI;if(null!==c){var d=!0,e=a.g;null!==e&&(d=e.Ta,e.Ta=!0);c(a,b);null!==e&&(e.Ta=d)}a.isVisible()&&a.Zc||b.yd(!1)}b instanceof W&&!a.Yw||(c=a.Lb,null===c&&(c=a),c.H())}
    function jr(a,b){if(a.fs.remove(b)){b instanceof V&&a.bp.remove(b);var c=a.XI;if(null!==c){var d=!0,e=a.g;null!==e&&(d=e.Ta,e.Ta=!0);c(a,b);null!==e&&(e.Ta=d)}a.isVisible()&&a.Zc||b.yd(!0)}b instanceof W&&!a.Yw||(c=a.Lb,null===c&&(c=a),c.H())}V.prototype.yn=function(){if(0<this.fs.count){var a=this.g;if(null!==a)for(var b=this.fs.copy().i;b.next();)a.remove(b.value)}T.prototype.yn.call(this)};
    w.defineProperty(V,{Tb:"layout"},function(){return this.ke},function(a){var b=this.ke;b!==a&&(null!==a&&w.G(a,tg,V,"layout"),null!==b&&(b.g=null,b.group=null),this.ke=a,null!==a&&(a.g=this.g,a.group=this),this.h("layout",b,a))});w.defineProperty(V,{WI:"memberAdded"},function(){return this.es},function(a){var b=this.es;b!==a&&(null!==a&&w.j(a,"function",V,"memberAdded"),this.es=a,this.h("memberAdded",b,a))});
    w.defineProperty(V,{XI:"memberRemoved"},function(){return this.gs},function(a){var b=this.gs;b!==a&&(null!==a&&w.j(a,"function",V,"memberRemoved"),this.gs=a,this.h("memberRemoved",b,a))});w.defineProperty(V,{OA:"memberValidation"},function(){return this.ul},function(a){var b=this.ul;b!==a&&(null!==a&&w.j(a,"function",V,"memberValidation"),this.ul=a,this.h("memberValidation",b,a))});
    V.prototype.canAddMembers=function(a){var b=this.g;if(null===b)return!1;b=b.ob;for(a=Kh(a).i;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};V.prototype.addMembers=function(a,b){var c=this.g;if(null===c)return!1;for(var c=c.ob,d=!0,e=Kh(a).i;e.next();){var f=e.value;!b||c.isValidMember(this,f)?f.Da=this:d=!1}return d};
    w.defineProperty(V,{WJ:"ungroupable"},function(){return 0!==(this.ya&256)},function(a){var b=0!==(this.ya&256);b!==a&&(w.j(a,"boolean",V,"ungroupable"),this.ya^=256,this.h("ungroupable",b,a))});V.prototype.canUngroup=function(){if(!this.WJ)return!1;var a=this.layer;if(null!==a&&!a.Uw)return!1;a=a.g;return null===a||a.Uw?!0:!1};
    V.prototype.$f=function(a){void 0===a&&(a=null);var b=0!==(this.ya&65536);T.prototype.$f.call(this,a);if(!b)for(0!==(this.ya&65536)!==!0&&(this.ya^=65536),b=this.PE();b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.Y;null!==d&&d!==this&&d.qi(this)&&!d.isVisible()?c.$b():(d=c.$,null!==d&&d!==this&&d.qi(this)&&!d.isVisible()&&c.$b())}}};
    V.prototype.findExternalLinksConnected=V.prototype.PE=function(){var a=this.Sp();a.add(this);for(var b=new I(W),c=a.i;c.next();){var d=c.value;if(d instanceof T)for(d=d.ge;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.i};V.prototype.findExternalNodesConnected=function(){var a=this.Sp();a.add(this);for(var b=new I(T),c=a.i;c.next();){var d=c.value;if(d instanceof T)for(d=d.ge;d.next();){var e=d.value,f=e.Y;a.contains(f)&&f!==this||b.add(f);e=e.$;a.contains(e)&&e!==this||b.add(e)}}return b.i};
    V.prototype.findContainingGroupChain=function(){function a(b,d){null!==b&&(d.add(b),a(b.Da,d))}var b=new I(V);a(this,b);return b};V.prototype.findSubGraphParts=V.prototype.Sp=function(){var a=new I(R);jh(a,this,!0,0,!0);a.remove(this);return a};V.prototype.yd=function(a){T.prototype.yd.call(this,a);for(var b=this.Oc;b.next();)b.value.yd(a)};V.prototype.collapseSubGraph=V.prototype.collapseSubGraph=function(){var a=this.g;if(null!==a&&!a.yh){a.yh=!0;var b=this.Sp();hs(this,b,a.Oa,this);a.yh=!1}};
    function hs(a,b,c,d){for(var e=a.Oc;e.next();){var f=e.value;f.yd(!1);if(f instanceof V){var h=f;h.Zc&&(h.uy=h.Zc,hs(h,b,c,d))}if(f instanceof T)f.$f(b),gl(c,f,d);else if(f instanceof W)for(f=f.Ef;f.next();)f.value.$f(b)}a.Zc=!1}V.prototype.expandSubGraph=V.prototype.expandSubGraph=function(){var a=this.g;if(null!==a&&!a.yh){a.yh=!0;var b=this.Sp();is(this,b,a.Oa,this);a.yh=!1}};
    function is(a,b,c,d){for(var e=a.Oc;e.next();){var f=e.value;f.yd(!0);if(f instanceof V){var h=f;h.uy&&(h.uy=!1,is(h,b,c,d))}if(f instanceof T)f.$f(b),fl(c,f,d);else if(f instanceof W)for(f=f.Ef;f.next();)f.value.$f(b)}a.Zc=!0}
    w.defineProperty(V,{Zc:"isSubGraphExpanded"},function(){return 0!==(this.ya&512)},function(a){var b=0!==(this.ya&512);if(b!==a){w.j(a,"boolean",V,"isSubGraphExpanded");this.ya^=512;var c=this.g;this.h("isSubGraphExpanded",b,a);b=this.LJ;if(null!==b){var d=!0;null!==c&&(d=c.Ta,c.Ta=!0);b(this);null!==c&&(c.Ta=d)}null!==c&&c.ia.ab?null!==this.Lb&&this.Lb.H():a?this.expandSubGraph():this.collapseSubGraph()}});
    w.defineProperty(V,{uy:"wasSubGraphExpanded"},function(){return 0!==(this.ya&1024)},function(a){var b=0!==(this.ya&1024);b!==a&&(w.j(a,"boolean",V,"wasSubGraphExpanded"),this.ya^=1024,this.h("wasSubGraphExpanded",b,a))});w.defineProperty(V,{LJ:"subGraphExpandedChanged"},function(){return this.ht},function(a){var b=this.ht;b!==a&&(null!==a&&w.j(a,"function",V,"subGraphExpandedChanged"),this.ht=a,this.h("subGraphExpandedChanged",b,a))});
    V.prototype.move=function(a){var b=this.position,c=b.x;isNaN(c)&&(c=0);b=b.y;isNaN(b)&&(b=0);var c=a.x-c,b=a.y-b,d=w.xb(c,b);T.prototype.move.call(this,a);for(a=this.Sp().i;a.next();){var e=a.value;if(!(e instanceof W||e instanceof T&&e.Bf)){var f=e.position,h=e.location;f.I()?(d.x=f.x+c,d.y=f.y+b,e.position=d):h.I()&&(d.x=h.x+c,d.y=h.y+b,e.location=d)}}for(a.reset();a.next();)e=a.value,e instanceof W&&(e.Mf||e.Y!==this&&e.$!==this)&&(f=e.position,d.x=f.x+c,d.y=f.y+b,e.move(d));w.v(d)};
    w.defineProperty(V,{Un:null},function(){return 0!==(this.ya&32768)},function(a){0!==(this.ya&32768)!==a&&(this.ya^=32768)});function Nj(){G.call(this);this.hf=fd;this.Ss=new B(NaN,NaN,NaN,NaN)}w.Ka(Nj,G);w.ga("Placeholder",Nj);Nj.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.hf=this.hf.S();a.Ss=this.Ss.copy()};Nj.prototype.wk=function(a){if(null===this.background&&null===this.mn)return!1;var b=this.Ja;return db(0,0,b.width,b.height,a.x,a.y)};
    Nj.prototype.Pn=function(){var a=this.U;null!==a&&(a instanceof V||a instanceof kh)||w.k("Placeholder is not inside a Group or Adornment.");if(a instanceof V){var b=this.computeBorder(this.Ss),c=this.Uc;Ua(c,b.width||0,b.height||0);Bo(this,0,0,c.width,c.height);for(var c=a.Oc,d=!1;c.next();)if(c.value.isVisible()){d=!0;break}!d||isNaN(b.x)||isNaN(b.y)||(c=new z,c.Zn(b,a.Ff),a.location=new z(c.x,c.y))}else{var b=this.Ca,c=this.Uc,d=this.padding,e=d.left+d.right,f=d.top+d.bottom;if(b.I())Ua(c,b.width+
        e||0,b.height+f||0),Bo(this,-d.left,-d.top,c.width,c.height);else{var h=a.sb,k=h.Wa(Ab,w.K()),b=w.mg(k.x,k.y,0,0);b.vi(h.Wa(Sb,k));b.vi(h.Wa(Gb,k));b.vi(h.Wa(Qb,k));a.Ti.m(b.x,b.y);Ua(c,b.width+e||0,b.height+f||0);Bo(this,-d.left,-d.top,c.width,c.height);w.v(k);w.Db(b)}}};Nj.prototype.jj=function(a,b,c,d){var e=this.W;e.x=a;e.y=b;e.width=c;e.height=d};
    Nj.prototype.computeBorder=function(a){var b=this.U;if(b instanceof V){var c=b;if(c.zH&&this.Ss.I()){var d=c.g;if(null!==d&&(d=d.$a,d instanceof oh&&!d.qr&&null!==d.Zb&&!d.Zb.contains(c)))return a.assign(this.Ss),a}}var c=w.Jf(),d=this.computeMemberBounds(c),e=this.padding;a.m(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));w.Db(c);b instanceof V&&(c=b,c.AH&&c.location.I()&&a.vi(c.location));return a};
    Nj.prototype.computeMemberBounds=function(a){if(!(this.U instanceof V))return a.m(0,0,0,0),a;for(var b=this.U,c=Infinity,d=Infinity,e=-Infinity,f=-Infinity,h=b.Oc;h.next();){var k=h.value;if(k.isVisible()){if(k instanceof W){var l=k;if(!b.Yw)continue;if(Cm(l))continue;if(l.Y===b||l.$===b)continue}k=k.W;k.left<c&&(c=k.left);k.top<d&&(d=k.top);k.right>e&&(e=k.right);k.bottom>f&&(f=k.bottom)}}isFinite(c)&&isFinite(d)?a.m(c,d,e-c,f-d):(b=b.location,c=this.padding,a.m(b.x+c.left,b.y+c.top,0,0));return a};
    w.defineProperty(Nj,{padding:"padding"},function(){return this.hf},function(a){"number"===typeof a?a=new hb(a):w.G(a,hb,Nj,"padding");var b=this.hf;b.L(a)||(this.hf=a=a.S(),this.h("padding",b,a))});function tg(){0<arguments.length&&w.kd(tg);w.nc(this);this.jz=this.Z=null;this.kl=this.Lr=!0;this.Sr=!1;this.Kq=(new z(0,0)).freeze();this.Nr=this.Pr=!0;this.CC="";this.Rr=!1;this.xz=null}w.ga("Layout",tg);
    tg.prototype.cloneProtected=function(a){a.Lr=this.Lr;a.kl=this.kl;a.Sr=this.Sr;a.Kq.assign(this.Kq);a.Pr=this.Pr;a.Nr=this.Nr;a.CC=this.CC;a.Rr=!0};tg.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};tg.prototype.ic=function(a){w.Fj(this,a)};tg.prototype.toString=function(){var a=w.lf(Object.getPrototypeOf(this)),a=a+"(";null!==this.group&&(a+=" in "+this.group);null!==this.g&&(a+=" for "+this.g);return a+")"};
    w.defineProperty(tg,{g:"diagram"},function(){return this.Z},function(a){null!==a&&w.G(a,D,tg,"diagram");this.Z=a});w.defineProperty(tg,{group:"group"},function(){return this.jz},function(a){this.jz!==a&&(null!==a&&w.G(a,V,tg,"group"),this.jz=a,null!==a&&(this.Z=a.g))});w.defineProperty(tg,{CI:"isOngoing"},function(){return this.Lr},function(a){this.Lr!==a&&(w.j(a,"boolean",tg,"isOngoing"),this.Lr=a)});
    w.defineProperty(tg,{wF:"isInitial"},function(){return this.kl},function(a){w.j(a,"boolean",tg,"isInitial");this.kl=a;a||(this.Rr=!0)});w.defineProperty(tg,{Ex:"isViewportSized"},function(){return this.Sr},function(a){this.Sr!==a&&(w.j(a,"boolean",tg,"isViewportSized"),(this.Sr=a)&&this.J())});w.defineProperty(tg,{ju:"isRouting"},function(){return this.Pr},function(a){this.Pr!==a&&(w.j(a,"boolean",tg,"isRouting"),this.Pr=a)});
    w.defineProperty(tg,{zF:"isRealtime"},function(){return this.Nr},function(a){this.Nr!==a&&(w.j(a,"boolean",tg,"isRealtime"),this.Nr=a)});w.defineProperty(tg,{Df:"isValidLayout"},function(){return this.Rr},function(a){this.Rr!==a&&(w.j(a,"boolean",tg,"isValidLayout"),this.Rr=a,a||(a=this.g,null!==a&&(a.um=!0)))});tg.prototype.invalidateLayout=tg.prototype.J=function(){if(this.Df){var a=this.g;if(null!==a&&!a.ia.ab){var b=a.Oa;!b.So&&(b.of&&b.Gh(),this.CI&&a.Jn||this.wF&&!a.Jn)&&(this.Df=!1,a.Ne())}}};
    w.defineProperty(tg,{network:"network"},function(){return this.xz},function(a){var b=this.xz;b!==a&&(null!==a&&w.G(a,ug,tg,"network"),null!==b&&(b.Tb=null),this.xz=a,null!==a&&(a.Tb=this))});tg.prototype.createNetwork=function(){return new ug};tg.prototype.makeNetwork=function(a){var b=this.createNetwork();b.Tb=this;a instanceof D?(b.sk(a.ig,!0),b.sk(a.links,!0)):a instanceof V?b.sk(a.Oc):b.sk(a.i);return b};
    tg.prototype.updateParts=function(){var a=this.g;if(null===a&&null!==this.network)for(var b=this.network.vertexes.i;b.next();){var c=b.value.Pc;if(null!==c&&(a=c.g,null!==a))break}this.Df=!0;try{null!==a&&a.Hb("Layout"),this.commitLayout()}finally{null!==a&&a.Wc("Layout")}};tg.prototype.commitLayout=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();if(this.ju)for(a=this.network.edges.i;a.next();)a.value.commit()};
    tg.prototype.doLayout=function(a){null===a&&w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new I(R);a instanceof D?(js(this,b,a.ig,!0,this.Un,!0,!1,!0),js(this,b,a.Lk,!0,this.Un,!0,!1,!0)):a instanceof V?js(this,b,a.Oc,!1,this.Un,!0,!1,!0):b.Jc(a.i);var c=b.count;if(0<c){a=this.g;null!==a&&a.Hb("Layout");for(var c=Math.ceil(Math.sqrt(c)),d=this.qe.x,e=d,f=this.qe.y,h=0,k=0,b=b.i;b.next();){var l=b.value;l.Je();var m=l.za,n=m.width,
        m=m.height;l.moveTo(e,f);l instanceof V&&(l.Un=!1);e+=Math.max(n,50)+20;k=Math.max(k,Math.max(m,50));h>=c-1?(h=0,e=d,f+=k+20,k=0):h++}null!==a&&a.Wc("Layout")}this.Df=!0};tg.prototype.Un=function(a){return!a.location.I()||a instanceof V&&a.Un?!0:!1};
    function js(a,b,c,d,e,f,h,k){for(c=c.i;c.next();){var l=c.value;d&&!l.$p||null!==e&&!e(l)||!l.canLayout()||(f&&l instanceof T?l.Bf||(l instanceof V?null===l.Tb?js(a,b,l.Oc,!1,e,f,h,k):(ks(l),b.add(l)):(ks(l),b.add(l))):h&&l instanceof W?b.add(l):!k||!l.ee()||l instanceof T||(ks(l),b.add(l)))}}function ks(a){var b=a.W;(0===b.width||0===b.height||isNaN(b.width)||isNaN(b.height))&&a.Je()}
    tg.prototype.collectParts=tg.prototype.tH=function(a){var b=new I(R);a instanceof D?(js(this,b,a.ig,!0,null,!0,!0,!0),js(this,b,a.links,!0,null,!0,!0,!0),js(this,b,a.Lk,!0,null,!0,!0,!0)):a instanceof V?js(this,b,a.Oc,!1,null,!0,!0,!0):js(this,b,a.i,!1,null,!0,!0,!0);return b};w.defineProperty(tg,{qe:"arrangementOrigin"},function(){return this.Kq},function(a){w.G(a,z,tg,"arrangementOrigin");this.Kq.L(a)||(this.Kq.assign(a),this.J())});
    tg.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.Wa(Ab),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a};
    function ug(){w.nc(this);this.ke=null;if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new I(ls);this.edges=new I(ms);this.Ox=new ma(T,ls);this.Jx=new ma(W,ms)}w.ga("LayoutNetwork",ug);
    ug.prototype.clear=function(){if(this.vertexes)for(var a=this.vertexes.i;a.next();){var b=a.value;b.clear();b.network=null}if(this.edges)for(a=this.edges.i;a.next();)b=a.value,b.clear(),b.network=null;this.vertexes=new I(ls);this.edges=new I(ms);this.Ox=new ma(T,ls);this.Jx=new ma(W,ms)};
    ug.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Tb?"("+this.Tb.toString()+")":"");if(0>=a)return b;b+=" vertexes: "+this.vertexes.count+" edges: "+this.edges.count;if(1<a){for(var c=this.vertexes.i;c.next();)b+="\n    "+c.value.toString(a-1);for(c=this.edges.i;c.next();)b+="\n    "+c.value.toString(a-1)}return b};w.defineProperty(ug,{Tb:"layout"},function(){return this.ke},function(a){this.ke=a});ug.prototype.createVertex=function(){return new ls};
    ug.prototype.createEdge=function(){return new ms};
    ug.prototype.addParts=ug.prototype.sk=function(a,b,c){if(null!==a){void 0===b&&(b=!1);w.j(b,"boolean",ug,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof T)return!a.Bf;if(a instanceof W){var b=a.Y;if(null===b||b.Bf)return!1;a=a.$;return null===a||a.Bf?!1:!0}return!1});for(a=a.i;a.next();){var d=a.value;if(d instanceof T&&(!b||d.$p)&&d.canLayout()&&c(d))if(d instanceof V&&null===d.Tb)this.sk(d.Oc,!1);else if(null===this.Bn(d)){var e=this.createVertex();e.Pc=d;
        this.Il(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof W&&(!b||d.$p)&&d.canLayout()&&c(d)&&null===this.lx(d)){var f=d.Y,e=d.$;null!==f&&null!==e&&f!==e&&(f=this.findGroupVertex(f),e=this.findGroupVertex(e),null!==f&&null!==e&&this.eq(f,e,d))}}};ug.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.Bn(b);if(null!==a)return a;for(b=b.Da;null!==b;){a=this.Bn(b);if(null!==a)return a;b=b.Da}return null};
    ug.prototype.addVertex=ug.prototype.Il=function(a){if(null!==a){this.vertexes.add(a);var b=a.Pc;null!==b&&this.Ox.add(b,a);a.network=this}};ug.prototype.addNode=ug.prototype.yt=function(a){if(null===a)return null;var b=this.Bn(a);null===b&&(b=this.createVertex(),b.Pc=a,this.Il(b));return b};ug.prototype.deleteVertex=ug.prototype.JE=function(a){if(null!==a&&ns(this,a)){for(var b=a.Qe,c=b.count-1;0<=c;c--){var d=b.ea(c);this.Np(d)}b=a.Ie;for(c=b.count-1;0<=c;c--)d=b.ea(c),this.Np(d)}};
    function ns(a,b){if(null===b)return!1;var c=a.vertexes.remove(b);c&&(a.Ox.remove(b.Pc),b.network=null);return c}ug.prototype.deleteNode=function(a){null!==a&&(a=this.Bn(a),null!==a&&this.JE(a))};ug.prototype.findVertex=ug.prototype.Bn=function(a){return null===a?null:this.Ox.ka(a)};ug.prototype.addEdge=ug.prototype.Cp=function(a){if(null!==a){this.edges.add(a);var b=a.link;null!==b&&null===this.lx(b)&&this.Jx.add(b,a);b=a.toVertex;null!==b&&b.oE(a);b=a.fromVertex;null!==b&&b.mE(a);a.network=this}};
    ug.prototype.addLink=function(a){if(null===a)return null;var b=a.Y,c=a.$,d=this.lx(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.yt(b)),null!==c&&(d.toVertex=this.yt(c)),this.Cp(d)):(d.fromVertex=null!==b?this.yt(b):null,d.toVertex=null!==c?this.yt(c):null);return d};ug.prototype.deleteEdge=ug.prototype.Np=function(a){if(null!==a){var b=a.toVertex;null!==b&&b.IE(a);b=a.fromVertex;null!==b&&b.HE(a);os(this,a)}};
    function os(a,b){null!==b&&a.edges.remove(b)&&(a.Jx.remove(b.link),b.network=null)}ug.prototype.deleteLink=function(a){null!==a&&(a=this.lx(a),null!==a&&this.Np(a))};ug.prototype.findEdge=ug.prototype.lx=function(a){return null===a?null:this.Jx.ka(a)};ug.prototype.linkVertexes=ug.prototype.eq=function(a,b,c){if(null===a||null===b)return null;if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.Cp(d);return d}return null};
    ug.prototype.reverseEdge=ug.prototype.ey=function(a){if(null!==a){var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.HE(a),c.IE(a),a.ey(),b.oE(a),c.mE(a))}};ug.prototype.deleteSelfEdges=ug.prototype.gx=function(){for(var a=w.cb(),b=this.edges.i;b.next();){var c=b.value;c.fromVertex===c.toVertex&&a.push(c)}b=a.length;for(c=0;c<b;c++)this.Np(a[c]);w.ta(a)};
    ug.prototype.deleteArtificialVertexes=function(){for(var a=w.cb(),b=this.vertexes.i;b.next();){var c=b.value;null===c.Pc&&a.push(c)}for(var c=a.length,d=0;d<c;d++)this.JE(a[d]);b=w.cb();for(c=this.edges.i;c.next();)d=c.value,null===d.link&&b.push(d);c=b.length;for(d=0;d<c;d++)this.Np(b[d]);w.ta(a);w.ta(b)};function ps(a){for(var b=w.cb(),c=a.edges.i;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.Np(b[d]);w.ta(b)}
    ug.prototype.splitIntoSubNetworks=ug.prototype.KJ=function(){this.deleteArtificialVertexes();ps(this);this.gx();for(var a=new H(ug),b=!0;b;)for(var b=!1,c=this.vertexes.i;c.next();){var d=c.value;if(0<d.Qe.count||0<d.Ie.count){b=this.Tb.createNetwork();a.add(b);qs(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};
    function qs(a,b,c){if(null!==c&&c.network!==b){ns(a,c);b.Il(c);for(var d=c.mc;d.next();){var e=d.value;e.network!==b&&(os(a,e),b.Cp(e),qs(a,b,e.fromVertex))}for(d=c.kc;d.next();)c=d.value,c.network!==b&&(os(a,c),b.Cp(c),qs(a,b,c.toVertex))}}ug.prototype.findAllParts=function(){for(var a=new I(R),b=this.vertexes.i;b.next();)a.add(b.value.Pc);for(b=this.edges.i;b.next();)a.add(b.value.link);return a};
    function ls(){w.nc(this);this.network=null;this.M=(new B(0,0,10,10)).freeze();this.T=(new z(5,5)).freeze();this.td=this.Zd=null;this.Qe=new H(ms);this.Ie=new H(ms)}w.ga("LayoutVertex",ls);ls.prototype.clear=function(){this.td=this.Zd=null;this.Qe=new H(ms);this.Ie=new H(ms)};
    ls.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+w.Od(this);if(0<a&&(b+=null!==this.Pc?"("+this.Pc.toString()+")":"",1<a)){a="";for(var c=!0,d=this.Qe.i;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Ie.i;d.next();){var f=d.value;c?c=!1:e+=",";e+=f.toString(0)}b+=" sources: "+a+" destinations: "+e}return b};
    w.defineProperty(ls,{data:"data"},function(){return this.Zd},function(a){this.Zd=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width,b=b.height;this.T.m(d/2,b/2);this.M.m(a,c,d,b)}});w.defineProperty(ls,{Pc:"node"},function(){return this.td},function(a){if(this.td!==a){this.td=a;a.Je();var b=a.W,c=b.x,d=b.y,e=b.width,b=b.height;isNaN(c)&&(c=0);isNaN(d)&&(d=0);this.M.m(c,d,e,b);if(!(a instanceof V)&&(a=a.bg.Wa(Jb),a.I())){this.T.m(a.x-c,a.y-d);return}this.T.m(e/2,b/2)}});
    w.defineProperty(ls,{gb:"bounds"},function(){return this.M},function(a){this.M.L(a)||this.M.assign(a)});w.defineProperty(ls,{focus:"focus"},function(){return this.T},function(a){this.T.L(a)||this.T.assign(a)});w.defineProperty(ls,{la:"centerX"},function(){return this.M.x+this.T.x},function(a){var b=this.M;b.x+this.T.x!==a&&(b.Qa(),b.x=a-this.T.x,b.freeze())});w.defineProperty(ls,{ra:"centerY"},function(){return this.M.y+this.T.y},function(a){var b=this.M;b.y+this.T.y!==a&&(b.Qa(),b.y=a-this.T.y,b.freeze())});
    w.defineProperty(ls,{Ut:"focusX"},function(){return this.T.x},function(a){var b=this.T;b.x!==a&&(b.Qa(),b.x=a,b.freeze())});w.defineProperty(ls,{Vt:"focusY"},function(){return this.T.y},function(a){var b=this.T;b.y!==a&&(b.Qa(),b.y=a,b.freeze())});w.defineProperty(ls,{x:"x"},function(){return this.M.x},function(a){var b=this.M;b.x!==a&&(b.Qa(),b.x=a,b.freeze())});w.defineProperty(ls,{y:"y"},function(){return this.M.y},function(a){var b=this.M;b.y!==a&&(b.Qa(),b.y=a,b.freeze())});
    w.defineProperty(ls,{width:"width"},function(){return this.M.width},function(a){var b=this.M;b.width!==a&&(b.Qa(),b.width=a,b.freeze())});w.defineProperty(ls,{height:"height"},function(){return this.M.height},function(a){var b=this.M;b.height!==a&&(b.Qa(),b.height=a,b.freeze())});
    ls.prototype.commit=function(){var a=this.Zd;if(null!==a){var b=this.gb,c=a.bounds;w.Pa(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.Pc,null!==a){b=this.gb;if(!(a instanceof V)){var c=a.W,d=a.bg.Wa(Jb);if(c.I()&&d.I()){a.moveTo(b.x+this.Ut-(d.x-c.x),b.y+this.Vt-(d.y-c.y));return}}a.moveTo(b.x,b.y)}};ls.prototype.addSourceEdge=ls.prototype.oE=function(a){null!==a&&(this.Qe.contains(a)||this.Qe.add(a))};
    ls.prototype.deleteSourceEdge=ls.prototype.IE=function(a){null!==a&&this.Qe.remove(a)};ls.prototype.addDestinationEdge=ls.prototype.mE=function(a){null!==a&&(this.Ie.contains(a)||this.Ie.add(a))};ls.prototype.deleteDestinationEdge=ls.prototype.HE=function(a){null!==a&&this.Ie.remove(a)};w.u(ls,{JJ:"sourceVertexes"},function(){for(var a=new I(ls),b=this.mc;b.next();)a.add(b.value.fromVertex);return a.i});
    w.u(ls,{NH:"destinationVertexes"},function(){for(var a=new I(ls),b=this.kc;b.next();)a.add(b.value.toVertex);return a.i});w.u(ls,{vertexes:"vertexes"},function(){for(var a=new I(ls),b=this.mc;b.next();)a.add(b.value.fromVertex);for(b=this.kc;b.next();)a.add(b.value.toVertex);return a.i});w.u(ls,{mc:"sourceEdges"},function(){return this.Qe.i});w.u(ls,{kc:"destinationEdges"},function(){return this.Ie.i});
    w.u(ls,{edges:"edges"},function(){for(var a=new H(ms),b=this.mc;b.next();)a.add(b.value);for(b=this.kc;b.next();)a.add(b.value);return a.i});w.u(ls,{SH:"edgesCount"},function(){return this.Qe.count+this.Ie.count});var rs;ls.standardComparer=rs=function(a,b){var c=a.td,d=b.td;return c?d?(c=c.text,d=d.text,c<d?-1:c>d?1:0):1:null!==d?-1:0};
    ls.smartComparer=function(a,b){if(null!==a){if(null!==b){var c=a.td,d=b.td;if(null!==c){if(null!==d){for(var c=c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var f=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(f)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;if(0!==f-h)return f-
        h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==d?-1:0}return 1}return null!==b?-1:0};function ms(){w.nc(this);this.toVertex=this.fromVertex=this.link=this.data=this.network=null}w.ga("LayoutEdge",ms);ms.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=this.data=null};
    ms.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+w.Od(this);0<a&&(b+=null!==this.link?"("+this.link.toString()+")":"",1<a&&(b+=" "+(this.fromVertex?this.fromVertex.toString():"null")+" --\x3e "+(this.toVertex?this.toVertex.toString():"null")));return b};ms.prototype.ey=function(){var a=this.fromVertex;this.fromVertex=this.toVertex;this.toVertex=a};ms.prototype.commit=function(){};
    ms.prototype.getOtherVertex=ms.prototype.bI=function(a){return this.toVertex===a?this.fromVertex:this.fromVertex===a?this.toVertex:null};function On(){0<arguments.length&&w.kd(On);tg.call(this);this.Ex=!0;this.tt=this.ut=NaN;this.Kj=(new ia(NaN,NaN)).freeze();this.ei=(new ia(10,10)).freeze();this.ie=ss;this.nd=ts;this.di=us;this.Mh=vs}w.Ka(On,tg);w.ga("GridLayout",On);
    On.prototype.cloneProtected=function(a){tg.prototype.cloneProtected.call(this,a);a.ut=this.ut;a.tt=this.tt;a.Kj.assign(this.Kj);a.ei.assign(this.ei);a.ie=this.ie;a.nd=this.nd;a.di=this.di;a.Mh=this.Mh};On.prototype.ic=function(a){a.Ee===On?a===us||a===ws||a===xs||a===ys?this.sorting=a:a===ts||a===zs?this.Wf=a:a===ss||a===As?this.alignment=a:w.k("Unknown enum value: "+a):tg.prototype.ic.call(this,a)};
    On.prototype.doLayout=function(a){null===a&&w.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.qe=this.initialOrigin(this.qe);var b=this.g;a=this.tH(a);for(var c=a.copy().i;c.next();){var d=c.value;if(d instanceof W){var e=d;if(null!==e.Y||null!==e.$){a.remove(e);continue}}d.Je();if(d instanceof V)for(d=d.Oc;d.next();)a.remove(d.value)}e=a.gc();if(0!==e.length){switch(this.sorting){case ys:e.reverse();break;case us:e.sort(this.comparer);
        break;case ws:e.sort(this.comparer),e.reverse()}var f=this.$J;isNaN(f)&&(f=0);var h=this.IG,h=isNaN(h)&&null!==b?Math.max(b.qb.width-b.padding.left-b.padding.right,0):Math.max(this.IG,0);0>=f&&0>=h&&(f=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.Hb("Layout");d=[];switch(this.alignment){case As:var k=a,l=c,m=Math.max(this.Fp.width,1);if(!isFinite(m))for(var n=m=0;n<e.length;n++)var p=e[n],q=p.za,m=Math.max(m,q.width);var m=Math.max(m+k,1),r=Math.max(this.Fp.height,
        1);if(!isFinite(r))for(n=r=0;n<e.length;n++)p=e[n],q=p.za,r=Math.max(r,q.height);for(var r=Math.max(r+l,1),s=this.Wf,u=this.qe.x,t=u,x=this.qe.y,v=0,A=0,n=0;n<e.length;n++){var p=e[n],q=p.za,y=Math.ceil((q.width+k)/m)*m,K=Math.ceil((q.height+l)/r)*r,E=0;switch(s){case zs:E=Math.abs(t-q.width);break;default:E=t+q.width}if(0<f&&v>f-1||0<h&&0<v&&E>h)d.push(new B(0,x,h+k,A)),v=0,t=u,x+=A,A=0;A=Math.max(A,K);K=0;switch(s){case zs:K=-q.width;break;default:K=0}p.moveTo(t+K,x);switch(s){case zs:t-=y;break;
        default:t+=y}v++}d.push(new B(0,x,h+k,A));break;case ss:k=f;l=a;m=c;n=Math.max(this.Fp.width,1);p=x=y=0;q=w.K();for(f=0;f<e.length;f++)r=e[f],s=r.za,u=cr(r,r.bg,r.Ff,q),y=Math.max(y,u.x),x=Math.max(x,s.width-u.x),p=Math.max(p,u.y);t=this.Wf;switch(t){case zs:y+=l;break;default:x+=l}var n=isFinite(n)?Math.max(n+l,1):Math.max(y+x,1),P=x=this.qe.x,v=this.qe.y,A=0;h>=y&&(h-=y);for(var y=K=0,E=Math.max(this.Fp.height,1),$=p=0,S=!0,ba=w.K(),f=0;f<e.length;f++){r=e[f];s=r.za;u=cr(r,r.bg,r.Ff,q);if(0<A)switch(t){case zs:P=
        (P-x-(s.width-u.x))/n;P=Wa(Math.round(P),P)?Math.round(P):Math.floor(P);P=P*n+x;break;default:P=(P-x+u.x)/n,P=Wa(Math.round(P),P)?Math.round(P):Math.ceil(P),P=P*n+x}else switch(t){case zs:K=P+u.x+s.width;break;default:K=P-u.x}var ga=0;switch(t){case zs:ga=-(P+u.x)+K;break;default:ga=P+s.width-u.x-K}if(0<k&&A>k-1||0<h&&0<A&&ga>h){d.push(new B(0,S?v-p:v,h+l,$+p+m));for(P=0;P<A&&f!==A;P++){var ga=e[f-A+P],ya=cr(ga,ga.bg,ga.Ff,ba);ga.moveTo(ga.position.x,ga.position.y+p-ya.y)}$+=m;v=S?v+$:v+($+p);A=$=
        p=0;P=x;S=!1}P===x&&(y=t===zs?Math.max(y,s.width-u.x):Math.min(y,-u.x));p=Math.max(p,u.y);$=Math.max($,s.height-u.y);isFinite(E)&&($=Math.max($,Math.max(s.height,E)-u.y));S?r.moveTo(P-u.x,v-u.y):r.moveTo(P-u.x,v);switch(t){case zs:P-=u.x+l;break;default:P+=s.width-u.x+l}A++}d.push(new B(0,v,h+l,(S?$:$+p)+m));for(P=0;P<A&&f!==A;P++)ga=e[f-A+P],ya=cr(ga,ga.bg,ga.Ff,q),ga.moveTo(ga.position.x,ga.position.y+p-ya.y);w.v(q);w.v(ba);if(t===zs)for(f=0;f<d.length;f++)e=d[f],e.width+=y,e.x-=y;else for(f=0;f<
    d.length;f++)e=d[f],e.x>y&&(e.width+=e.x-y,e.x=y)}for(k=f=h=e=0;k<d.length;k++)l=d[k],e=Math.min(e,l.x),h=Math.min(h,l.y),f=Math.max(f,l.x+l.width);this.Wf===zs?this.commitLayers(d,new z(e+a/2-(f+e),h-c/2)):this.commitLayers(d,new z(e-a/2,h-c/2));null!==b&&b.Wc("Layout");this.Df=!0}};On.prototype.commitLayers=function(){};w.defineProperty(On,{IG:"wrappingWidth"},function(){return this.ut},function(a){this.ut!==a&&(w.j(a,"number",On,"wrappingWidth"),0<a||isNaN(a))&&(this.ut=a,this.Ex=isNaN(a),this.J())});
    w.defineProperty(On,{$J:"wrappingColumn"},function(){return this.tt},function(a){this.tt!==a&&(w.j(a,"number",On,"wrappingColumn"),0<a||isNaN(a))&&(this.tt=a,this.J())});w.defineProperty(On,{Fp:"cellSize"},function(){return this.Kj},function(a){w.G(a,ia,On,"cellSize");this.Kj.L(a)||(this.Kj.assign(a),this.J())});w.defineProperty(On,{spacing:"spacing"},function(){return this.ei},function(a){w.G(a,ia,On,"spacing");this.ei.L(a)||(this.ei.assign(a),this.J())});
    w.defineProperty(On,{alignment:"alignment"},function(){return this.ie},function(a){this.ie!==a&&(w.mb(a,On,On,"alignment"),a===ss||a===As)&&(this.ie=a,this.J())});w.defineProperty(On,{Wf:"arrangement"},function(){return this.nd},function(a){this.nd!==a&&(w.mb(a,On,On,"arrangement"),a===ts||a===zs)&&(this.nd=a,this.J())});w.defineProperty(On,{sorting:"sorting"},function(){return this.di},function(a){this.di!==a&&(w.mb(a,On,On,"sorting"),a===xs||a===ys||a===us||a===ws)&&(this.di=a,this.J())});
    w.defineProperty(On,{comparer:"comparer"},function(){return this.Mh},function(a){this.Mh!==a&&(w.j(a,"function",On,"comparer"),this.Mh=a,this.J())});var vs;On.standardComparer=vs=function(a,b){var c=a.text,d=b.text;return c<d?-1:c>d?1:0};
    On.smartComparer=function(a,b){if(null!==a){if(null!==b){for(var c=a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),d=b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/),e=0;e<c.length;e++)if(""!==d[e]&&void 0!==d[e]){var f=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(f)){if(!isNaN(h))return 1;if(0!==c[e].localeCompare(d[e]))return c[e].localeCompare(d[e])}else{if(isNaN(h))return-1;if(0!==f-h)return f-h}}else if(""!==c[e])return 1;return""!==
    d[e]&&void 0!==d[e]?-1:0}return 1}return null!==b?-1:0};var As;On.Position=As=w.p(On,"Position",0);var ss;On.Location=ss=w.p(On,"Location",1);var ts;On.LeftToRight=ts=w.p(On,"LeftToRight",2);var zs;On.RightToLeft=zs=w.p(On,"RightToLeft",3);var xs;On.Forward=xs=w.p(On,"Forward",4);var ys;On.Reverse=ys=w.p(On,"Reverse",5);var us;On.Ascending=us=w.p(On,"Ascending",6);var ws;On.Descending=ws=w.p(On,"Descending",7);
    function Bs(){0<arguments.length&&w.kd(Bs);tg.call(this);this.az=this.Eo=this.Cd=0;this.rr=360;this.$y=Cs;this.dl=0;this.TB=new z;this.IC=Cs;this.kv=this.Vf=this.$D=0;this.Kw=new Ds;this.lv=this.Um=0;this.WG=600;this.Gs=NaN;this.Mq=1;this.gt=0;this.it=360;this.nd=Cs;this.ba=Es;this.di=Fs;this.Mh=rs;this.ei=6;this.us=Gs}w.Ka(Bs,tg);w.ga("CircularLayout",Bs);
    Bs.prototype.cloneProtected=function(a){tg.prototype.cloneProtected.call(this,a);a.Gs=this.Gs;a.Mq=this.Mq;a.gt=this.gt;a.it=this.it;a.nd=this.nd;a.ba=this.ba;a.di=this.di;a.Mh=this.Mh;a.ei=this.ei;a.us=this.us};Bs.prototype.ic=function(a){if(a.Ee===Bs)if(a===Hs||a===Is||a===Js||a===Ks||a===Fs)this.sorting=a;else if(a===Ls||a===Ms||a===Es||a===Ns)this.direction=a;else if(a===Os||a===Ps||a===Cs||a===Qs)this.Wf=a;else{if(a===Rs||a===Gs)this.Nx=a}else tg.prototype.ic.call(this,a)};
    Bs.prototype.createNetwork=function(){return new Ss};
    Bs.prototype.doLayout=function(a){null===a&&w.k("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.qe=this.initialOrigin(this.qe);a=this.network.vertexes;if(1>=a.count)1===a.count&&(a=a.first(),a.la=0,a.ra=0);else{var b=new H(Ts);b.Jc(a.i);a=new H(Ts);var c=new H(Ts),d;d=this.sort(b);var e=this.$y,f=this.IC,h=this.Cd,k=this.Eo,l=this.az,m=this.rr,b=this.dl,n=this.$D,p=this.Vf,q=this.kv,
        e=this.Wf,f=this.Nx,h=this.kJ;if(!isFinite(h)||0>=h)h=NaN;k=this.nH;if(!isFinite(k)||0>=k)k=1;l=this.ze;isFinite(l)||(l=0);m=this.rf;if(!isFinite(m)||360<m||1>m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===Qs&&f===Rs?e=Cs:e===Qs&&f!==Rs&&(f=Rs,e=this.Wf);if((this.direction===Ls||this.direction===Ms)&&this.sorting!==Fs){for(var r=0;!(r>=d.length);r+=2){a.add(d.ea(r));if(r+1>=d.length)break;c.add(d.ea(r+1))}this.direction===Ls?(this.Wf===Qs&&a.reverse(),d=new H(Ts),d.Jc(a),d.Jc(c)):(this.Wf===Qs&&
    c.reverse(),d=new H(Ts),d.Jc(c),d.Jc(a))}for(var s=d.length,u=n=0,r=0;r<d.length;r++){var p=l+m*u*(this.direction===Es?1:-1)/s,t=d.ea(r).diameter;isNaN(t)&&(t=Us(d.ea(r),p));360>m&&(0===r||r===d.length-1)&&(t/=2);n+=t;u++}if(isNaN(h)||e===Qs){isNaN(b)&&(b=6);if(e!==Cs&&e!==Qs){t=-Infinity;for(r=0;r<s;r++){var q=d.ea(r),x=d.ea(r===s-1?0:r+1);isNaN(q.diameter)&&Us(q,0);isNaN(x.diameter)&&Us(x,0);t=Math.max(t,(q.diameter+x.diameter)/2)}q=t+b;e===Os?(p=2*Math.PI/s,h=(t+b)/p):h=Vs(this,q*(360<=m?s:s-1),
        k,l*Math.PI/180,m*Math.PI/180)}else h=Vs(this,n+(360<=m?s:s-1)*(e!==Qs?b:1.6*b),k,l*Math.PI/180,m*Math.PI/180);p=h*k}else if(p=h*k,u=Ws(this,h,p,l*Math.PI/180,m*Math.PI/180),isNaN(b)){if(e===Cs||e===Qs)b=(u-n)/(360<=m?s:s-1)}else if(e===Cs||e===Qs)r=(u-n)/(360<=m?s:s-1),r<b?(h=Vs(this,n+b*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180),p=h*k):b=r;else{t=-Infinity;for(r=0;r<s;r++)q=d.ea(r),x=d.ea(r===s-1?0:r+1),isNaN(q.diameter)&&Us(q,0),isNaN(x.diameter)&&Us(x,0),t=Math.max(t,(q.diameter+x.diameter)/
        2);q=t+b;r=Vs(this,q*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180);r>h?(h=r,p=h*k):q=u/(360<=m?s:s-1)}this.$y=e;this.IC=f;this.Cd=h;this.Eo=k;this.az=l;this.rr=m;this.dl=b;this.$D=n;this.Vf=p;this.kv=q;b=d;d=this.$y;e=this.Cd;f=this.az;k=this.rr;l=this.dl;m=this.Vf;n=this.kv;if(this.direction!==Ls&&this.direction!==Ms||d!==Qs)if(this.direction===Ls||this.direction===Ms){h=0;switch(d){case Ps:h=180*Xs(this,e,m,f,n)/Math.PI;break;case Cs:n=b=0;h=a.first();null!==h&&(b=Us(h,Math.PI/2));h=c.first();null!==
    h&&(n=Us(h,Math.PI/2));h=180*Xs(this,e,m,f,l+(b+n)/2)/Math.PI;break;case Os:h=k/b.length}if(this.direction===Ls){switch(d){case Ps:Ys(this,a,f,Ns);break;case Cs:Zs(this,a,f,Ns);break;case Os:$s(this,a,k/2,f,Ns)}switch(d){case Ps:Ys(this,c,f+h,Es);break;case Cs:Zs(this,c,f+h,Es);break;case Os:$s(this,c,k/2,f+h,Es)}}else{switch(d){case Ps:Ys(this,c,f,Ns);break;case Cs:Zs(this,c,f,Ns);break;case Os:$s(this,c,k/2,f,Ns)}switch(d){case Ps:Ys(this,a,f+h,Es);break;case Cs:Zs(this,a,f+h,Es);break;case Os:$s(this,
        a,k/2,f+h,Es)}}}else switch(d){case Ps:Ys(this,b,f,this.direction);break;case Cs:Zs(this,b,f,this.direction);break;case Os:$s(this,b,k,f,this.direction);break;case Qs:at(this,b,k,f,this.direction)}else at(this,b,k,f-k/2,Es)}this.updateParts();this.network=null;this.Df=!0};
    function $s(a,b,c,d,e){var f=a.rr,h=a.Cd;a=a.Vf;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=d+(e===Es?l*c/(360<=f?k:k-1):-(l*c)/k),n=b.ea(l),p=h*Math.tan(m)/a,p=Math.sqrt((h*h+a*a*p*p)/(1+p*p));n.la=p*Math.cos(m);n.ra=p*Math.sin(m);n.actualAngle=180*m/Math.PI}}
    function Zs(a,b,c,d){var e=a.Cd,f=a.Vf,h=a.dl;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.ea(l),n=b.ea(l===k-1?0:l+1),p=f*Math.sin(c);m.la=e*Math.cos(c);m.ra=p;m.actualAngle=180*c/Math.PI;isNaN(m.diameter)&&Us(m,0);isNaN(n.diameter)&&Us(n,0);m=Xs(a,e,f,d===Es?c:-c,(m.diameter+n.diameter)/2+h);c+=d===Es?m:-m}}
    function Ys(a,b,c,d){var e=a.Cd,f=a.Vf,h=a.kv;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.ea(l);m.la=e*Math.cos(c);m.ra=f*Math.sin(c);m.actualAngle=180*c/Math.PI;m=Xs(a,e,f,d===Es?c:-c,h);c+=d===Es?m:-m}}function at(a,b,c,d,e){var f=a.lv,f=a.rr;a.Um=0;a.Kw=new Ds;if(360>c){for(f=d+(e===Es?f:-f);0>f;)f+=360;f%=360;180<f&&(f-=360);f*=Math.PI/180;a.lv=f;bt(a,b,c,d,e)}else ct(a,b,c,d,e);a.Kw.commit(b)}
    function ct(a,b,c,d,e){var f=a.Cd,h=a.dl,k=a.Eo,l=f*Math.cos(d*Math.PI/180),m=a.Vf*Math.sin(d*Math.PI/180),n=b.gc();if(3===n.length)n[0].la=f,n[0].ra=0,n[1].la=n[0].la-n[0].width/2-n[1].width/2-h,n[1].y=n[0].y,n[2].la=(n[0].la+n[1].la)/2,n[2].y=n[0].y-n[2].height-h;else if(4===n.length)n[0].la=f,n[0].ra=0,n[2].la=-n[0].la,n[2].ra=n[0].ra,n[1].la=0,n[1].y=Math.min(n[0].y,n[2].y)-n[1].height-h,n[3].la=0,n[3].y=Math.max(n[0].y+n[0].height+h,n[2].y+n[2].height+h);else{for(var f=w.K(),p=0;p<n.length;p++){n[p].la=
        l;n[p].ra=m;if(p>=n.length-1)break;dt(a,l,m,n,p,e,f)||et(a,l,m,n,p,e,f);l=f.x;m=f.y}w.v(f);a.Um++;if(!(23<a.Um)){var l=n[0].la,m=n[0].ra,f=n[n.length-1].la,p=n[n.length-1].ra,q=Math.abs(l-f)-((n[0].width+n[n.length-1].width)/2+h),r=Math.abs(m-p)-((n[0].height+n[n.length-1].height)/2+h),h=0;1>Math.abs(r)?Math.abs(l-f)<(n[0].width+n[n.length-1].width)/2&&(h=0):h=0<r?r:1>Math.abs(q)?0:q;q=!1;q=Math.abs(f)>Math.abs(p)?0<f!==m>p:0<p!==l<f;if(q=e===Es?q:!q)h=-Math.abs(h),h=Math.min(h,-n[n.length-1].width),
        h=Math.min(h,-n[n.length-1].height);a.Kw.compare(h,n);1<Math.abs(h)&&(a.Cd=8>a.Um?a.Cd-h/(2*Math.PI):5>n.length&&10<h?a.Cd/2:a.Cd-(0<h?1.7:-2.3),a.Vf=a.Cd*k,ct(a,b,c,d,e))}}}
    function bt(a,b,c,d,e){for(var f=a.Cd,h=a.Vf,k=a.Eo,l=f*Math.cos(d*Math.PI/180),m=h*Math.sin(d*Math.PI/180),n=w.K(),p=b.gc(),q=0;q<p.length;q++){p[q].la=l;p[q].ra=m;if(q>=p.length-1)break;dt(a,l,m,p,q,e,n)||et(a,l,m,p,q,e,n);l=n.x;m=n.y}w.v(n);a.Um++;if(!(23<a.Um)){l=Math.atan2(m,l);l=e===Es?a.lv-l:l-a.lv;l=Math.abs(l)<Math.abs(l-2*Math.PI)?l:l-2*Math.PI;f=l*(f+h)/2;h=a.Kw;if(Math.abs(f)<Math.abs(h.Tp))for(h.Tp=f,h.ho=[],h.Aq=[],l=0;l<p.length;l++)h.ho[l]=p[l].gb.x,h.Aq[l]=p[l].gb.y;1<Math.abs(f)&&
    (a.Cd=8>a.Um?a.Cd-f/(2*Math.PI):a.Cd-(0<f?1.7:-2.3),a.Vf=a.Cd*k,bt(a,b,c,d,e))}}function dt(a,b,c,d,e,f,h){var k=a.Cd,l=a.Vf,m=0,n=0;a=(d[e].width+d[e+1].width)/2+a.dl;var p=!1;if(0<=c!==(f===Es)){if(m=b+a,m>k){m=b-a;if(m<-k)return h.x=m,h.y=n,!1;p=!0}}else if(m=b-a,m<-k){m=b+a;if(m>k)return h.x=m,h.y=n,!1;p=!0}n=Math.sqrt(1-Math.min(1,m*m/(k*k)))*l;0>c!==p&&(n=-n);if(Math.abs(c-n)>(d[e].height+d[e+1].height)/2)return h.x=m,h.y=n,!1;h.x=m;h.y=n;return!0}
    function et(a,b,c,d,e,f,h){var k=a.Cd,l=a.Vf,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.dl;d=!1;if(0<=b!==(f===Es)){if(n=c-a,n<-l){n=c+a;if(n>l){h.x=m;h.y=n;return}d=!0}}else if(n=c+a,n>l){n=c-a;if(n<-l){h.x=m;h.y=n;return}d=!0}m=Math.sqrt(1-Math.min(1,n*n/(l*l)))*k;0>b!==d&&(m=-m);h.x=m;h.y=n}Bs.prototype.commitLayout=function(){this.commitNodes();this.ju&&this.commitLinks()};
    Bs.prototype.commitNodes=function(){var a=this.eH,b=null!==this.group&&null!==this.group.placeholder&&this.group.Zc,c=b?this.group.location.copy():null;b?a=new z(0,0):(a.x=this.qe.x+this.Cd,a.y=this.qe.y+this.Vf);for(var d=this.network.vertexes.i;d.next();){var e=d.value;e.x+=a.x;e.y+=a.y;e.commit()}b&&(this.group.Je(),a=this.group.position.copy(),b=this.group.location.copy(),c=c.Ej(b.Ej(a)),this.group.move(c),this.TB=c.Ej(a))};Bs.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
    function Ws(a,b,c,d,e){var f=a.WG;if(.001>Math.abs(a.Eo-1))return void 0!==d&&void 0!==e?e*b:2*Math.PI*b;a=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c;for(var h=0,k=0,k=void 0!==d&&void 0!==e?e/(f+1):Math.PI/(2*(f+1)),l=0,m=0;m<=f;m++)l=void 0!==d&&void 0!==e?d+m*e/f:m*Math.PI/(2*f),l=Math.sin(l),h+=Math.sqrt(1-a*a*l*l)*k;return void 0!==d&&void 0!==e?(b>c?b:c)*h:4*(b>c?b:c)*h}function Vs(a,b,c,d,e){var f=0,f=void 0!==d&&void 0!==e?Ws(a,1,c,d,e):Ws(a,1,c);return b/f}
    function Xs(a,b,c,d,e){if(.001>Math.abs(a.Eo-1))return e/b;var f=b>c?Math.sqrt(b*b-c*c)/b:Math.sqrt(c*c-b*b)/c,h=0;a=2*Math.PI/(700*a.network.vertexes.count);b>c&&(d+=Math.PI/2);for(var k=0;;k++){var l=Math.sin(d+k*a),h=h+(b>c?b:c)*Math.sqrt(1-f*f*l*l)*a;if(h>=e)return k*a}}
    Bs.prototype.sort=function(a){switch(this.sorting){case Js:break;case Ks:a.reverse();break;case Hs:a.sort(this.comparer);break;case Is:a.sort(this.comparer);a.reverse();break;case Fs:for(var b=[],c=0;c<a.length;c++)b.push(0);for(var d=new H(Ts),c=0;c<a.length;c++){var e=-1,f=-1;if(0===c)for(var h=0;h<a.length;h++){var k=a.ea(h).SH;k>e&&(e=k,f=h)}else for(h=0;h<a.length;h++)k=b[h],k>e&&(e=k,f=h);d.add(a.ea(f));b[f]=-1;f=a.ea(f);e=0;for(h=f.mc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&&
    b[e]++;for(f=f.kc;f.next();)e=a.indexOf(f.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(f=0;f<d.length;f++){b=d.ea(f);a[f]=[];for(var l=0,c=b.kc;c.next();)l=d.indexOf(c.value.toVertex),l!==f&&0>a[f].indexOf(l)&&a[f].push(l);for(b=b.mc;b.next();)l=d.indexOf(b.value.fromVertex),l!==f&&0>a[f].indexOf(l)&&a[f].push(l)}h=[];for(f=0;f<a.length;f++)h[f]=0;for(var b=[],k=[],m=[],c=[],e=new H(Ts),n=0,f=0;f<a.length;f++){var p=a[f].length;if(1===p)c.push(f);else if(0===p)e.add(d.ea(f));else{if(0===n)b.push(f);
    else{for(var q=Infinity,r=Infinity,s=-1,u=[],p=0;p<b.length;p++)0>a[b[p]].indexOf(b[p===b.length-1?0:p+1])&&u.push(p===b.length-1?0:p+1);if(0===u.length)for(p=0;p<b.length;p++)u.push(p);for(p=0;p<u.length;p++){var t=u[p],x,l=a[f];x=k;for(var v=m,A=h,y=t,K=b,E=0,P=0;P<x.length;P++){var $=A[x[P]],S=A[v[P]],ba=0,ga=0;$<S?(ba=$,ga=S):(ba=S,ga=$);if(ba<y&&y<=ga)for($=0;$<l.length;$++)S=l[$],0>K.indexOf(S)||ba<A[S]&&A[S]<ga||ba===A[S]||ga===A[S]||E++;else for($=0;$<l.length;$++)S=l[$],0>K.indexOf(S)||ba<
    A[S]&&A[S]<ga&&ba!==A[S]&&ga!==A[S]&&E++}x=E;for(A=v=0;A<a[f].length;A++)l=b.indexOf(a[f][A]),0<=l&&(l=Math.abs(t-(l>=t?l+1:l)),v+=l<b.length+1-l?l:b.length+1-l);for(A=0;A<k.length;A++)l=h[k[A]],y=h[m[A]],l>=t&&l++,y>=t&&y++,l>y&&(K=y,y=l,l=K),y-l<(b.length+2)/2===(l<t&&t<=y)&&v++;if(x<q||x===q&&v<r)q=x,r=v,s=t}b.splice(s,0,f);for(p=0;p<b.length;p++)h[b[p]]=p;for(p=0;p<a[f].length;p++)q=a[f][p],0<=b.indexOf(q)&&(k.push(f),m.push(q))}n++}}f=!1;for(h=b.length;;){f=!0;for(k=0;k<c.length;k++)if(m=c[k],
            n=a[m][0],l=b.indexOf(n),0<=l){for(r=p=0;r<a[n].length;r++)q=a[n][r],q=b.indexOf(q),0>q||q===l||(s=q>l?q-l:l-q,p+=q<l!==s>h-s?1:-1);b.splice(0>p?l:l+1,0,m);c.splice(k,1);k--}else f=!1;if(f)break;else b.push(c[0]),c.splice(0,1)}for(f=0;f<b.length;f++)e.add(d.ea(b[f]));return e;default:w.k("Invalid sorting type.")}return a};w.defineProperty(Bs,{kJ:"radius"},function(){return this.Gs},function(a){this.Gs!==a&&(w.j(a,"number",Bs,"radius"),0<a||isNaN(a))&&(this.Gs=a,this.J())});
    w.defineProperty(Bs,{nH:"aspectRatio"},function(){return this.Mq},function(a){this.Mq!==a&&(w.j(a,"number",Bs,"aspectRatio"),0<a&&(this.Mq=a,this.J()))});w.defineProperty(Bs,{ze:"startAngle"},function(){return this.gt},function(a){this.gt!==a&&(w.j(a,"number",Bs,"startAngle"),this.gt=a,this.J())});w.defineProperty(Bs,{rf:"sweepAngle"},function(){return this.it},function(a){this.it!==a&&(w.j(a,"number",Bs,"sweepAngle"),this.it=0<a&&360>=a?a:360,this.J())});
    w.defineProperty(Bs,{Wf:"arrangement"},function(){return this.nd},function(a){this.nd!==a&&(w.mb(a,Bs,Bs,"arrangement"),a===Qs||a===Cs||a===Ps||a===Os)&&(this.nd=a,this.J())});w.defineProperty(Bs,{direction:"direction"},function(){return this.ba},function(a){this.ba!==a&&(w.mb(a,Bs,Bs,"direction"),a===Es||a===Ns||a===Ls||a===Ms)&&(this.ba=a,this.J())});
    w.defineProperty(Bs,{sorting:"sorting"},function(){return this.di},function(a){this.di!==a&&(w.mb(a,Bs,Bs,"sorting"),a===Js||a===Ks||a===Hs||Is||a===Fs)&&(this.di=a,this.J())});w.defineProperty(Bs,{comparer:"comparer"},function(){return this.Mh},function(a){this.Mh!==a&&(w.j(a,"function",Bs,"comparer"),this.Mh=a,this.J())});w.defineProperty(Bs,{spacing:"spacing"},function(){return this.ei},function(a){this.ei!==a&&(w.j(a,"number",Bs,"spacing"),this.ei=a,this.J())});
    w.defineProperty(Bs,{Nx:"nodeDiameterFormula"},function(){return this.us},function(a){this.us!==a&&(w.mb(a,Bs,Bs,"nodeDiameterFormula"),a===Gs||a===Rs)&&(this.us=a,this.J())});w.u(Bs,{cK:"actualXRadius"},function(){return this.Cd});w.u(Bs,{dK:"actualYRadius"},function(){return this.Vf});w.u(Bs,{bK:"actualSpacing"},function(){return this.dl});w.u(Bs,{eH:"actualCenter"},function(){return this.TB});var Cs;Bs.ConstantSpacing=Cs=w.p(Bs,"ConstantSpacing",0);var Ps;
    Bs.ConstantDistance=Ps=w.p(Bs,"ConstantDistance",1);var Os;Bs.ConstantAngle=Os=w.p(Bs,"ConstantAngle",2);var Qs;Bs.Packed=Qs=w.p(Bs,"Packed",3);var Es;Bs.Clockwise=Es=w.p(Bs,"Clockwise",4);var Ns;Bs.Counterclockwise=Ns=w.p(Bs,"Counterclockwise",5);var Ls;Bs.BidirectionalLeft=Ls=w.p(Bs,"BidirectionalLeft",6);var Ms;Bs.BidirectionalRight=Ms=w.p(Bs,"BidirectionalRight",7);var Js;Bs.Forwards=Js=w.p(Bs,"Forwards",8);var Ks;Bs.Reverse=Ks=w.p(Bs,"Reverse",9);var Hs;Bs.Ascending=Hs=w.p(Bs,"Ascending",10);
    var Is;Bs.Descending=Is=w.p(Bs,"Descending",11);var Fs;Bs.Optimized=Fs=w.p(Bs,"Optimized",12);var Gs;Bs.Pythagorean=Gs=w.p(Bs,"Pythagorean",13);var Rs;Bs.Circular=Rs=w.p(Bs,"Circular",14);function Ds(){this.Tp=-Infinity;this.Aq=this.ho=null}Ds.prototype.compare=function(a,b){if(0<a&&0>this.Tp||Math.abs(a)<Math.abs(this.Tp)&&!(0>a&&0<this.Tp)){this.Tp=a;this.ho=[];this.Aq=[];for(var c=0;c<b.length;c++)this.ho[c]=b[c].gb.x,this.Aq[c]=b[c].gb.y}};
    Ds.prototype.commit=function(a){if(null!==this.ho&&null!==this.Aq)for(var b=0;b<this.ho.length;b++){var c=a.ea(b);c.x=this.ho[b];c.y=this.Aq[b]}};function Ss(){ug.call(this)}w.Ka(Ss,ug);w.ga("CircularNetwork",Ss);Ss.prototype.createVertex=function(){return new Ts};Ss.prototype.createEdge=function(){return new ft};function Ts(){ls.call(this);this.actualAngle=this.diameter=NaN}w.Ka(Ts,ls);w.ga("CircularVertex",Ts);
    function Us(a,b){var c=a.network;if(null===c)return NaN;c=c.Tb;if(null===c)return NaN;if(c.Wf===Qs)if(c.Nx===Rs)a.diameter=Math.max(a.width,a.height);else{var c=Math.abs(Math.sin(b)),d=Math.abs(Math.cos(b));if(0===c)return a.width;if(0===d)return a.height;a.diameter=Math.min(a.height/c,a.width/d)}else a.diameter=c.Nx===Rs?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.diameter}function ft(){ms.call(this)}w.Ka(ft,ms);w.ga("CircularEdge",ft);
    function gt(){0<arguments.length&&w.kd(gt);tg.call(this);this.Kg=null;this.Ur=0;this.og=(new ia(100,100)).freeze();this.Lq=!1;this.ci=!0;this.Lh=!1;this.ap=100;this.ur=1;this.Rh=1E3;this.Hs=Math;this.Bo=.05;this.Ao=50;this.yo=150;this.zo=0;this.ir=10;this.hr=5}w.Ka(gt,tg);w.ga("ForceDirectedLayout",gt);
    gt.prototype.cloneProtected=function(a){tg.prototype.cloneProtected.call(this,a);a.og.assign(this.og);a.Lq=this.Lq;a.ci=this.ci;a.Lh=this.Lh;a.ap=this.ap;a.ur=this.ur;a.Rh=this.Rh;a.Hs=this.Hs;a.Bo=this.Bo;a.Ao=this.Ao;a.yo=this.yo;a.zo=this.zo;a.ir=this.ir;a.hr=this.hr};gt.prototype.createNetwork=function(){return new ht};
    gt.prototype.doLayout=function(a){null===a&&w.k("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));a=this.NA;if(0<this.network.vertexes.count){this.network.gx();for(var b=this.network.vertexes.i;b.next();){var c=b.value;c.charge=this.electricalCharge(c);c.mass=this.gravitationalMass(c)}for(b=this.network.edges.i;b.next();)c=b.value,c.stiffness=this.springStiffness(c),c.length=this.springLength(c);
        this.Uz();this.Ur=0;if(this.needsClusterLayout()){b=this.network;for(c=b.KJ().i;c.next();){this.network=c.value;for(var d=this.network.vertexes.i;d.next();){var e=d.value;e.jg=e.vertexes.count;e.Kk=1;e.sn=null;e.Fh=null}it(this,0,a)}this.network=b;c.reset();for(var d=this.tE,f=c.count,h=!0,k=e=0,l=w.cb(),m=0;m<f+b.vertexes.count+2;m++)l[m]=null;f=0;c.reset();for(var n=w.Jf();c.next();)if(m=c.value,this.uh(m,n),h)h=!1,e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new z(n.x+n.width+d.width,n.y),l[1]=new z(n.x,
            n.y+n.height+d.height),f=2;else{var p=jt(l,f,e,k,n.width,n.height,d),q=l[p],r=new z(q.x+n.width+d.width,q.y),s=new z(q.x,q.y+n.height+d.height);p+1<f&&l.splice(p+1,0,null);l[p]=r;l[p+1]=s;f++;p=q.x-n.x;q=q.y-n.y;for(m=m.vertexes.i;m.next();)r=m.value,r.la+=p,r.ra+=q}w.Db(n);for(m=b.vertexes.i;m.next();)h=m.value,n=h.gb,2>f?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new z(n.x+n.width+d.width,n.y),l[1]=new z(n.x,n.y+n.height+d.height),f=2):(p=jt(l,f,e,k,n.width,n.height,d),q=l[p],r=new z(q.x+n.width+d.width,
            q.y),s=new z(q.x,q.y+n.height+d.height),p+1<f&&l.splice(p+1,0,null),l[p]=r,l[p+1]=s,f++,h.la=q.x+h.width/2,h.ra=q.y+h.height/2);w.ta(l);for(c.reset();c.next();){d=c.value;for(e=d.vertexes.i;e.next();)b.Il(e.value);for(d=d.edges.i;d.next();)b.Cp(d.value)}}kt(this,a);this.updateParts()}this.ap=a;this.network=null;this.Df=!0};
    gt.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().gb,d=this.network.vertexes.i;d.next();){if(d.value.gb.Zf(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};gt.prototype.uh=function(a,b){for(var c=!0,d=a.vertexes.i;d.next();){var e=d.value;c?(c=!1,b.set(e.gb)):b.Jh(e.gb)}return b};
    function it(a,b,c){if(ut(a,b)){var d=a.Rh;a.Rh*=1+1/(b+1);var e=bu(a,b),f=Math.max(0,Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10));a.NA+=f;it(a,b+1,c);kt(a,f);cu(a,e);b=a.Kg;null===b?b=new H(du):b.clear();b.Jc(e.vertexes);b.sort(function(a,b){return null===a||null===b||a===b?0:b.jg-a.jg});for(e=b.i;e.next();)eu(a,e.value);a.Rh=d}}
    function ut(a,b){if(10<b||3>a.network.vertexes.count)return!1;null===a.Kg?a.Kg=new H(du):a.Kg.clear();a.Kg.Jc(a.network.vertexes);var c=a.Kg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.jg-a.jg});for(var d=c.count-1;0<=d&&1>=c.ea(d).jg;)d--;return 1<c.count-d}
    function bu(a,b){for(var c=a.network,d=new ht,e=a.Kg.i;e.next();){var f=e.value;if(1<f.jg){d.Il(f);var h=new fu;h.yy=f.jg;h.zy=f.width;h.xy=f.height;h.LB=f.T.x;h.MB=f.T.y;null===f.Fh&&(f.Fh=new H(fu));f.Fh.add(h);f.fB=f.Fh.count-1}else break}for(var k=c.edges.i;k.next();)if(h=k.value,e=h.fromVertex,f=h.toVertex,e.network===d&&f.network===d)d.Cp(h);else if(e.network===d){var l=e.sn;null===l&&(l=new H(du),e.sn=l);l.add(f);e.jg--;e.Kk+=f.Kk}else f.network===d&&(l=f.sn,null===l&&(l=new H(du),f.sn=l),
        l.add(e),f.jg--,f.Kk+=e.Kk);for(e=d.edges.i;e.next();)f=e.value,f.length*=Math.max(1,Td((f.fromVertex.Kk+f.toVertex.Kk)/(4*b+1)));for(e=d.vertexes.i;e.next();)if(f=e.value,l=f.sn,null!==l&&0<l.count&&(h=f.Fh.ea(f.Fh.count-1),h=h.yy-f.jg,!(0>=h))){for(var m=0,n=0,p=l.count-h;p<l.count;p++){for(var q=l.ea(p),r=null,k=q.edges.i;k.next();){var s=k.value;if(s.bI(q)===f){r=s;break}}null!==r&&(n+=r.length,m+=q.width*q.height)}k=f.la;l=f.ra;p=f.width;q=f.height;r=f.T;s=p*q;1>s&&(s=1);m=Td((m+s+n*n*4/(h*h))/
        s);h=(m-1)*p/2;m=(m-1)*q/2;f.gb=new B(k-r.x-h,l-r.y-m,p+2*h,q+2*m);f.focus=new z(r.x+h,r.y+m)}a.network=d;return c}function cu(a,b){for(var c=a.network.vertexes.i;c.next();){var d=c.value;d.network=b;if(null!==d.Fh){var e=d.Fh.ea(d.fB);d.jg=e.yy;var f=e.LB,h=e.MB;d.gb=new B(d.la-f,d.ra-h,e.zy,e.xy);d.focus=new z(f,h);d.fB--}}for(c=a.network.edges.i;c.next();)c.value.network=b;a.network=b}
    function eu(a,b){var c=b.sn;if(null!==c&&0!==c.count){var d=b.la,e=b.ra,f=b.width,h=b.height;null!==b.Fh&&0<b.Fh.count&&(h=b.Fh.ea(0),f=h.zy,h=h.xy);for(var f=Td(f*f+h*h)/2,k=!1,l=h=0,m=0,n=b.vertexes.i;n.next();){var p=n.value;1>=p.jg?l++:(k=!0,m++,h+=Math.atan2(b.ra-p.ra,b.la-p.la))}if(0!==l)for(0<m&&(h/=m),n=m=0,m=k?2*Math.PI/(l+1):2*Math.PI/l,0===l%2&&(n=m/2),1<c.count&&c.sort(function(a,b){return null===a||null===b||a===b?0:b.width*b.height-a.width*a.height}),k=0===l%2?0:1,c=c.i;c.next();)if(l=
            c.value,!(1<l.jg||a.isFixed(l))){for(var p=null,q=l.edges.i;q.next();){p=q.value;break}var q=l.width,r=l.height,q=Td(q*q+r*r)/2,p=f+p.length+q,q=h+(m*(k/2>>1)+n)*(0===k%2?1:-1);l.la=d+p*Math.cos(q);l.ra=e+p*Math.sin(q);k++}}}function jt(a,b,c,d,e,f,h){var k=9E19,l=-1,m=0;a:for(;m<b;m++){var n=a[m],p=n.x-c,q=n.y-d,p=p*p+q*q;if(p<k){for(q=m-1;0<=q;q--)if(a[q].y>n.y&&a[q].x-n.x<e+h.width)continue a;for(q=m+1;q<b;q++)if(a[q].x>n.x&&a[q].y-n.y<f+h.height)continue a;l=m;k=p}}return l}
    gt.prototype.Uz=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
    gt.prototype.addComments=function(a){var b=a.Pc;if(null!==b)for(b=b.RE();b.next();){var c=b.value;if("Comment"===c.vd&&c.isVisible()){var d=this.network.Bn(c);null===d&&(d=this.network.yt(c));d.charge=this.IH;for(var c=null,e=d.kc;e.next();){var f=e.value;if(f.toVertex===a){c=f;break}}if(null===c)for(e=d.mc;e.next();)if(f=e.value,f.fromVertex===a){c=f;break}null===c&&(c=this.network.eq(a,d,null));c.length=this.JH}}};
    function gu(a,b){var c=a.M,d=c.x,e=c.y,f=c.width,c=c.height,h=b.M,k=h.x,l=h.y,m=h.width,h=h.height;return d+f<k?e>l+h?(d=d+f-k,e=e-l-h,Td(d*d+e*e)):e+c<l?(d=d+f-k,e=e+c-l,Td(d*d+e*e)):k-(d+f):d>k+m?e>l+h?(d=d-k-m,e=e-l-h,Td(d*d+e*e)):e+c<l?(d=d-k-m,e=e+c-l,Td(d*d+e*e)):d-(k+m):e>l+h?e-(l+h):e+c<l?l-(e+c):.1}function kt(a,b){a.Kg=null;for(var c=a.Ur+b;a.Ur<c&&(a.Ur++,hu(a)););a.Kg=null}
    function hu(a){null===a.Kg&&(a.Kg=new H(du),a.Kg.Jc(a.network.vertexes));var b=a.Kg.n;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.la,e=d,f=c.ra,h=f,c=1;c<b.length;c++){var k=b[c];k.forceX=0;k.forceY=0;var l=k.la,k=k.ra,d=Math.min(d,l),e=Math.max(e,l),f=Math.min(f,k),h=Math.max(h,k)}(f=e-d>h-f)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.la-b.la}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.ra-b.ra});for(var h=a.Rh,m=0,n=0,p=0,c=0;c<b.length;c++){var k=
        b[c],l=k.M,q=k.T,d=l.x+q.x,l=l.y+q.y,n=k.charge*a.electricalFieldX(d,l),p=k.charge*a.electricalFieldY(d,l),n=n+k.mass*a.gravitationalFieldX(d,l),p=p+k.mass*a.gravitationalFieldY(d,l);k.forceX+=n;k.forceY+=p;for(q=c+1;q<b.length;q++)if(e=b[q],e!==k){var r=e.M,n=e.T,p=r.x+n.x,r=r.y+n.y;if(d-p>h||p-d>h){if(f)break}else if(l-r>h||r-l>h){if(!f)break}else{var s=gu(k,e);1>s?(n=a.Wx,null===n&&(a.Wx=n=new sa(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.M.right-k.M.x),n=(1+n)*m):d<p?(n=Math.abs(e.M.x-k.M.right),
        n=-(1+n)*m):(n=Math.max(e.width,k.width),n=(1+n)*m-n/2),l>r?(p=Math.abs(e.M.bottom-k.M.y),p=(1+p)*s):d<p?(p=Math.abs(e.M.y-k.M.bottom),p=-(1+p)*s):(p=Math.max(e.height,k.height),p=(1+p)*s-p/2)):(m=-(k.charge*e.charge)/(s*s),n=(p-d)/s*m,p=(r-l)/s*m);k.forceX+=n;k.forceY+=p;e.forceX-=n;e.forceY-=p}}}for(c=a.network.edges.i;c.next();)f=c.value,k=f.fromVertex,e=f.toVertex,l=k.M,q=k.T,d=l.x+q.x,l=l.y+q.y,r=e.M,n=e.T,p=r.x+n.x,r=r.y+n.y,s=gu(k,e),1>s?(n=a.Wx,null===n&&(a.Wx=n=new sa(0)),m=n.random(),s=
        n.random(),n=(d>p?1:-1)*(1+(e.width>k.width?e.width:k.width))*m,p=(l>r?1:-1)*(1+(e.height>k.height?e.height:k.height))*s):(m=f.stiffness*(s-f.length),n=(p-d)/s*m,p=(r-l)/s*m),k.forceX+=n,k.forceY+=p,e.forceX-=n,e.forceY-=p;c=0;d=Math.max(a.Rh/20,50);for(e=0;e<b.length;e++)k=b[e],a.isFixed(k)?a.moveFixedVertex(k):(f=k.forceX,h=k.forceY,f<-d?f=-d:f>d&&(f=d),h<-d?h=-d:h>d&&(h=d),k.la+=f,k.ra+=h,c=Math.max(c,f*f+h*h));return c>a.OE*a.OE}gt.prototype.moveFixedVertex=function(){};
    gt.prototype.commitLayout=function(){this.nB();this.commitNodes();this.ju&&this.commitLinks()};gt.prototype.nB=function(){if(this.tq)for(var a=this.network.edges.i;a.next();){var b=a.value.link;null!==b&&(b.Ab=qc,b.Bb=qc)}};gt.prototype.commitNodes=function(){var a=0,b=0;if(this.mH){var c=w.Jf();this.uh(this.network,c);b=this.qe;a=b.x-c.x;b=b.y-c.y;w.Db(c)}for(var c=w.Jf(),d=this.network.vertexes.i;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.gb),c.x+=a,c.y+=b,e.gb=c;e.commit()}w.Db(c)};
    gt.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};gt.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Bo:a};gt.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Ao:a};gt.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.yo:a};gt.prototype.electricalFieldX=function(){return 0};gt.prototype.electricalFieldY=function(){return 0};
    gt.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.zo:a};gt.prototype.gravitationalFieldX=function(){return 0};gt.prototype.gravitationalFieldY=function(){return 0};gt.prototype.isFixed=function(a){return a.isFixed};w.u(gt,{IK:"currentIteration"},function(){return this.Ur});w.defineProperty(gt,{tE:"arrangementSpacing"},function(){return this.og},function(a){w.G(a,ia,gt,"arrangementSpacing");this.og.L(a)||(this.og.assign(a),this.J())});
    w.defineProperty(gt,{mH:"arrangesToOrigin"},function(){return this.Lq},function(a){this.Lq!==a&&(w.j(a,"boolean",gt,"arrangesToOrigin"),this.Lq=a,this.J())});w.defineProperty(gt,{tq:"setsPortSpots"},function(){return this.ci},function(a){this.ci!==a&&(w.j(a,"boolean",gt,"setsPortSpots"),this.ci=a,this.J())});w.defineProperty(gt,{comments:"comments"},function(){return this.Lh},function(a){this.Lh!==a&&(w.j(a,"boolean",gt,"comments"),this.Lh=a,this.J())});
    w.defineProperty(gt,{NA:"maxIterations"},function(){return this.ap},function(a){this.ap!==a&&(w.j(a,"number",gt,"maxIterations"),0<=a&&(this.ap=a,this.J()))});w.defineProperty(gt,{OE:"epsilonDistance"},function(){return this.ur},function(a){this.ur!==a&&(w.j(a,"number",gt,"epsilonDistance"),0<a&&(this.ur=a,this.J()))});w.defineProperty(gt,{bL:"infinityDistance"},function(){return this.Rh},function(a){this.Rh!==a&&(w.j(a,"number",gt,"infinityDistance"),1<a&&(this.Rh=a,this.J()))});
    w.defineProperty(gt,{Wx:"randomNumberGenerator"},function(){return this.Hs},function(a){this.Hs!==a&&(null!==a&&"function"!==typeof a.random&&w.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.Hs=a)});w.defineProperty(gt,{UK:"defaultSpringStiffness"},function(){return this.Bo},function(a){this.Bo!==a&&(w.j(a,"number",gt,"defaultSpringStiffness"),this.Bo=a,this.J())});
    w.defineProperty(gt,{TK:"defaultSpringLength"},function(){return this.Ao},function(a){this.Ao!==a&&(w.j(a,"number",gt,"defaultSpringLength"),this.Ao=a,this.J())});w.defineProperty(gt,{NK:"defaultElectricalCharge"},function(){return this.yo},function(a){this.yo!==a&&(w.j(a,"number",gt,"defaultElectricalCharge"),this.yo=a,this.J())});w.defineProperty(gt,{OK:"defaultGravitationalMass"},function(){return this.zo},function(a){this.zo!==a&&(w.j(a,"number",gt,"defaultGravitationalMass"),this.zo=a,this.J())});
    w.defineProperty(gt,{JH:"defaultCommentSpringLength"},function(){return this.ir},function(a){this.ir!==a&&(w.j(a,"number",gt,"defaultCommentSpringLength"),this.ir=a,this.J())});w.defineProperty(gt,{IH:"defaultCommentElectricalCharge"},function(){return this.hr},function(a){this.hr!==a&&(w.j(a,"number",gt,"defaultCommentElectricalCharge"),this.hr=a,this.J())});function fu(){this.MB=this.LB=this.xy=this.zy=this.yy=0}function ht(){ug.call(this)}w.Ka(ht,ug);w.ga("ForceDirectedNetwork",ht);
    ht.prototype.createVertex=function(){return new du};ht.prototype.createEdge=function(){return new iu};function du(){ls.call(this);this.isFixed=!1;this.mass=this.charge=NaN;this.Kk=this.jg=this.forceY=this.forceX=0;this.Fh=this.sn=null;this.fB=0}w.Ka(du,ls);w.ga("ForceDirectedVertex",du);function iu(){ms.call(this);this.length=this.stiffness=NaN}w.Ka(iu,ms);w.ga("ForceDirectedEdge",iu);
    function ju(){0<arguments.length&&w.kd(ju);tg.call(this);this.Yd=this.Lm=25;this.ba=0;this.xo=ku;this.Xo=lu;this.No=mu;this.Jm=4;this.lo=nu;this.$i=ou;this.ci=!0;this.Zr=4;this.Kb=this.Yv=this.rb=-1;this.Sf=this.hs=0;this.Ob=this.Qf=this.Rf=this.Ag=this.je=null;this.qs=0;this.ps=this.Qm=null;this.Eg=0;this.rs=null;this.ZB=new z;this.jh=[];this.jh.length=100}w.Ka(ju,tg);w.ga("LayeredDigraphLayout",ju);
    ju.prototype.cloneProtected=function(a){tg.prototype.cloneProtected.call(this,a);a.Lm=this.Lm;a.Yd=this.Yd;a.ba=this.ba;a.xo=this.xo;a.Xo=this.Xo;a.No=this.No;a.Jm=this.Jm;a.lo=this.lo;a.$i=this.$i;a.ci=this.ci;a.Zr=this.Zr};ju.prototype.ic=function(a){a.Ee===ju?0===a.name.indexOf("Aggressive")?this.kH=a:0===a.name.indexOf("Cycle")?this.HH=a:0===a.name.indexOf("Init")?this.tI=a:0===a.name.indexOf("Layer")?this.II=a:w.k("Unknown enum value: "+a):tg.prototype.ic.call(this,a)};
    ju.prototype.createNetwork=function(){return new pu};
    ju.prototype.doLayout=function(a){null===a&&w.k("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.qe=this.initialOrigin(this.qe);this.Yv=-1;this.Sf=this.hs=0;this.rs=this.ps=this.Qm=null;for(a=0;a<this.jh.length;a++)this.jh[a]=null;if(0<this.network.vertexes.count){this.network.gx();for(a=this.network.edges.i;a.next();)a.value.rev=!1;switch(this.xo){default:case qu:a=this.network;var b=
        0,c=a.vertexes.count-1,d=[];d.length=c+1;for(var e=a.vertexes.i;e.next();)e.value.valid=!0;for(;null!==ru(a);){for(e=su(a);null!==e;)d[c]=e,c--,e.valid=!1,e=su(a);for(e=tu(a);null!==e;)d[b]=e,b++,e.valid=!1,e=tu(a);for(var e=null,f=0,h=this.network.vertexes.i;h.next();){var k=h.value;if(k.valid){for(var l=0,m=k.kc;m.next();)m.value.toVertex.valid&&l++;for(var m=0,n=k.mc;n.next();)n.value.fromVertex.valid&&m++;if(null===e||f<l-m)e=k,f=l-m}}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.i;d.next();)b=d.value,b.fromVertex.index>b.toVertex.index&&(a.ey(b),b.rev=!0);break;case ku:for(d=this.network.vertexes.i;d.next();)a=d.value,a.Op=-1,a.finish=-1;for(a=this.network.edges.i;a.next();)a.value.forest=!1;this.qs=0;for(d.reset();d.next();)b=d.value,0===b.mc.count&&uu(this,b);for(d.reset();d.next();)b=d.value,-1===b.Op&&uu(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.Op<b.Op&&c<f&&(this.network.ey(d),d.rev=!0))}for(a=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      this.network.vertexes.i;a.next();)a.value.layer=-1;this.rb=-1;this.assignLayers();for(a.reset();a.next();)this.rb=Math.max(this.rb,a.value.layer);a=this.network;d=[];for(c=a.edges.i;c.next();)b=c.value,b.valid=!1,d.push(b);for(c=0;c<d.length;c++)if(b=d[c],f=b.fromVertex,e=b.toVertex,!b.valid&&(null!==f.td&&null!==e.td||f.layer!==e.layer)){m=k=l=h=0;if(null!==b.link){l=b.link;if(null===l)continue;var p=f.td,h=e.td;if(null===p||null===h)continue;var q=l.Y,k=l.$,r=l.Lc,m=l.ld;b.rev&&(l=q,n=r,q=k,r=m,
        k=l,m=n);var s=f.T,l=e.T,u=b.rev?e.M:f.M,n=w.K();u.I()?(cr(q,r,Jb,n),n.I()||n.assign(s)):n.assign(s);p!==q&&u.I()&&q.isVisible()&&(p=f.M,p.I()&&(n.x+=u.x-p.x,n.y+=u.y-p.y));q=b.rev?f.M:e.M;p=w.K();q.I()?(cr(k,m,Jb,p),p.I()||p.assign(l)):p.assign(l);h!==k&&q.I()&&k.isVisible()&&(h=e.M,h.I()&&(p.x+=q.x-h.x,p.y+=q.y-h.y));90===this.ba||270===this.ba?(h=Math.round((n.x-s.x)/this.Yd),k=n.x,l=Math.round((p.x-l.x)/this.Yd),m=p.x):(h=Math.round((n.y-s.y)/this.Yd),k=n.y,l=Math.round((p.y-l.y)/this.Yd),m=p.y);
        w.v(n);w.v(p);b.portFromColOffset=h;b.portFromPos=k;b.portToColOffset=l;b.portToPos=m}else b.portFromColOffset=0,b.portFromPos=0,b.portToColOffset=0,b.portToPos=0;n=f.layer;s=e.layer;a:if(p=b,q=0,u=p.link,null!==u){var t=u.Lc,x=u.ld;if(null!==t&&null!==x){var v=u.Y,r=u.$;if(null!==v&&null!==r){var A=t.Ab,y=x.Bb;this.tq||(u.Ab.Xc()||(A=u.Ab),u.Bb.Xc()||(y=u.Bb));var K=u.ac,E=vu(this,!0);if(A.Xc()||A===yb)A=E;var P=vu(this,!1);if(y.Xc()||y===yb)y=P;if(A.uj()&&A.sj(P)&&y.uj()&&y.sj(E)){q=0;break a}E=
        u.getLinkPoint(v,t,A,!0,K,r,x,w.K());A=u.getLinkDirection(v,t,E,A,!0,K,r,x);w.v(E);A===wu(this,p,!0)?q+=1:this.tq&&null!==v&&1===v.ports.count&&p.rev&&(q+=1);A=u.getLinkPoint(r,x,y,!1,K,v,t,w.K());u=u.getLinkDirection(r,x,A,y,!1,K,v,t);w.v(A);u===wu(this,p,!1)?q+=2:this.tq&&null!==r&&1===r.ports.count&&p.rev&&(q+=2)}}}p=1===q||3===q?!0:!1;if(q=2===q||3===q?!0:!1)r=a.createVertex(),r.td=null,r.nn=1,r.layer=n,r.near=f,a.Il(r),f=a.eq(f,r,b.link),f.valid=!1,f.rev=b.rev,f.portFromColOffset=h,f.portToColOffset=
        0,f.portFromPos=k,f.portToPos=0,f=r;u=1;p&&u--;if(n-s>u&&0<n){b.valid=!1;r=a.createVertex();r.td=null;r.nn=2;r.layer=n-1;a.Il(r);f=a.eq(f,r,b.link);f.valid=!0;f.rev=b.rev;f.portFromColOffset=q?0:h;f.portToColOffset=0;f.portFromPos=q?0:k;f.portToPos=0;f=r;for(n--;n-s>u&&0<n;)r=a.createVertex(),r.td=null,r.nn=3,r.layer=n-1,a.Il(r),f=a.eq(f,r,b.link),f.valid=!0,f.rev=b.rev,f.portFromColOffset=0,f.portToColOffset=0,f.portFromPos=0,f.portToPos=0,f=r,n--;f=a.eq(r,e,b.link);f.valid=!p;p&&(r.near=e);f.rev=
        b.rev;f.portFromColOffset=0;f.portToColOffset=l;f.portFromPos=0;f.portToPos=m}else b.valid=!0}d=this.je=[];for(b=0;b<=this.rb;b++)d[b]=0;for(a=this.network.vertexes.i;a.next();)a.value.index=-1;this.initializeIndices();this.Yv=-1;for(b=this.Sf=this.hs=0;b<=this.rb;b++)d[b]>d[this.Sf]&&(this.Yv=d[b]-1,this.Sf=b),d[b]<d[this.hs]&&(this.hs=b);this.rs=[];for(b=0;b<d.length;b++)this.rs[b]=[];for(a.reset();a.next();)d=a.value,this.rs[d.layer][d.index]=d;this.Kb=-1;for(a=0;a<=this.rb;a++){d=xu(this,a);b=
        0;c=this.je[a];for(e=0;e<c;e++)f=d[e],b+=this.nodeMinColumnSpace(f,!0),f.column=b,b+=1,b+=this.nodeMinColumnSpace(f,!1);this.Kb=Math.max(this.Kb,b-1);yu(this,a,d)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.Df=!0};ju.prototype.linkMinLength=function(){return 1};function zu(a){var b=a.fromVertex.td;a=a.toVertex.td;return null===b&&null===a?8:null===b||null===a?4:1}
    ju.prototype.nodeMinLayerSpace=function(a,b){return null===a.td?0:90===this.ba||270===this.ba?b?a.T.y+10:a.M.height-a.T.y+10:b?a.T.x+10:a.M.width-a.T.x+10};ju.prototype.nodeMinColumnSpace=function(a,b){if(null===a.td)return 0;var c=b?a.UA:a.TA;if(null!==c)return c;c=this.ba;return 90===c||270===c?b?a.UA=a.T.x/this.Yd+1|0:a.TA=(a.M.width-a.T.x)/this.Yd+1|0:b?a.UA=a.T.y/this.Yd+1|0:a.TA=(a.M.height-a.T.y)/this.Yd+1|0};
    function Au(a){null===a.Qm&&(a.Qm=[]);for(var b=0,c=a.network.vertexes.i;c.next();){var d=c.value;a.Qm[b]=d.layer;b++;a.Qm[b]=d.column;b++;a.Qm[b]=d.index;b++}return a.Qm}function Bu(a,b){for(var c=0,d=a.network.vertexes.i;d.next();){var e=d.value;e.layer=b[c];c++;e.column=b[c];c++;e.index=b[c];c++}}
    function Cu(a,b,c){var d=xu(a,b),e=a.je[b];if(null===a.ps||a.ps.length<e*e)a.ps=[];for(var f=a.ps,h=0;h<e;h++){var k=0,l=d[h],m=l.near,n=0;if(null!==m&&m.layer===l.layer)if(n=m.index,n>h)for(var p=h+1;p<n;p++)l=d[p],l.near===m&&l.nn===m.nn||k++;else for(p=h-1;p>n;p--)l=d[p],l.near===m&&l.nn===m.nn||k++;var m=0,q,r=q=p=l=0,s,u=0,t=0;s=0;var x;if(0<=c)for(n=d[h].Qe,m=0;m<n.count;m++)if(q=n.n[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=
        n.n[r],s.valid&&s.fromVertex.layer!==b&&(u=s.fromVertex.index,t=s.portToPos,s=s.portFromPos,p<t&&(l>u||l===u&&q>s)&&k++,t<p&&(u>l||u===l&&s>q)&&k++);if(0>=c)for(n=d[h].Ie,m=0;m<n.count;m++)if(q=n.n[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,q=q.portFromPos,r=m+1;r<n.count;r++)s=n.n[r],s.valid&&s.toVertex.layer!==b&&(u=s.toVertex.index,t=s.portToPos,s=s.portFromPos,q<s&&(l>u||l===u&&p>t)&&k++,s<q&&(u>l||u===l&&t>p)&&k++);f[h*e+h]=k;for(n=h+1;n<e;n++){var v=0,A=0;if(0<=c)for(k=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                     d[h].Qe,x=d[n].Qe,m=0;m<k.count;m++)if(q=k.n[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,q=q.portFromPos,r=0;r<x.count;r++)s=x.n[r],s.valid&&s.fromVertex.layer!==b&&(u=s.fromVertex.index,s=s.portFromPos,(l<u||l===u&&q<s)&&A++,(u<l||u===l&&s<q)&&v++);if(0>=c)for(k=d[h].Ie,x=d[n].Ie,m=0;m<k.count;m++)if(q=k.n[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,r=0;r<x.count;r++)s=x.n[r],s.valid&&s.toVertex.layer!==b&&(u=s.toVertex.index,t=s.portToPos,(l<u||l===u&&p<
    t)&&A++,(u<l||u===l&&t<p)&&v++);f[h*e+n]=v;f[n*e+h]=A}}yu(a,b,d);return f}ju.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.rb;b++)for(var c=Cu(this,b,1),d=this.je[b],e=0;e<d;e++)for(var f=e;f<d;f++)a+=c[e*d+f];return a};
    function Du(a){for(var b=0,c=0;c<=a.rb;c++){for(var d=a,e=c,f=xu(d,e),h=d.je[e],k=0,l=0;l<h;l++){var m=null,m=f[l].Ie,n,p=0,q=0;if(null!==m)for(var r=0;r<m.count;r++)n=m.n[r],n.valid&&n.toVertex.layer!==e&&(p=n.fromVertex.column+n.portFromColOffset,q=n.toVertex.column+n.portToColOffset,k+=(Math.abs(p-q)+1)*zu(n))}yu(d,e,f);b+=k}return b}
    ju.prototype.normalize=function(){var a=Infinity;this.Kb=-1;for(var b=this.network.vertexes.i;b.next();){var c=b.value,a=Math.min(a,c.column-this.nodeMinColumnSpace(c,!0));this.Kb=Math.max(this.Kb,c.column+this.nodeMinColumnSpace(c,!1))}for(b.reset();b.next();)b.value.column-=a;this.Kb-=a};
    function Eu(a,b,c){for(var d=xu(a,b),e=a.je[b],f=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Qe);var m=null;0<=c&&(m=k.Ie);var n=0,p=0,q=k.near;null!==q&&q.layer===k.layer&&(n+=q.column-1,p++);if(null!==l)for(q=0;q<l.count;q++){var k=l.n[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(n+=r.column,p++)}if(null!==m)for(l=0;l<m.count;l++)k=m.n[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(n+=q.column,p++);f[h]=0===p?-1:n/p}yu(a,b,d);return f}
    function Fu(a,b,c){for(var d=xu(a,b),e=a.je[b],f=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Qe);var m=null;0<=c&&(m=k.Ie);var n=0,p=[],q=k.near;null!==q&&q.layer===k.layer&&(p[n]=q.column-1,n++);if(null!==l)for(q=0;q<l.count;q++){var k=l.n[q],r=k.fromVertex;k.valid&&!k.rev&&r.layer!==b&&(p[n]=r.column+k.portFromColOffset,n++)}if(null!==m)for(l=0;l<m.count;l++)k=m.n[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(p[n]=q.column+k.portToColOffset,n++);0===n?f[h]=-1:(p.sort(function(a,b){return a-b}),
        m=n>>1,f[h]=0!==(n&1)?p[m]:p[m-1]+p[m]>>1)}yu(a,b,d);return f}function Gu(a,b,c,d,e,f){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.kc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Gu(a,m,c,d,e,f)}if(f)for(l=b.mc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Gu(a,m,c,d,e,f)}}
    function Hu(a,b,c,d,e,f){if(b.component===d){b.component=c;if(e)for(var h=b.kc;h.next();)Hu(a,h.value.toVertex,c,d,e,f);if(f)for(b=b.mc;b.next();)Hu(a,b.value.fromVertex,c,d,e,f)}}function ru(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid)return b}return null}function su(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.kc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
    function tu(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.mc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function uu(a,b){b.Op=a.qs;a.qs++;for(var c=b.kc;c.next();){var d=c.value,e=d.toVertex;-1===e.Op&&(d.forest=!0,uu(a,e))}b.finish=a.qs;a.qs++}
    ju.prototype.assignLayers=function(){switch(this.Xo){case Iu:Ju(this);break;case Ku:for(var a=0,b=this.network.vertexes.i;b.next();)a=Lu(this,b.value),this.rb=Math.max(a,this.rb);for(b.reset();b.next();)a=b.value,a.layer=this.rb-a.layer;break;default:case lu:Ju(this);for(b=this.network.vertexes.i;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.mc.count&&Mu(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.rb=-1;for(b.reset();b.next();){var c=b.value;c.layer-=
        a;this.rb=Math.max(this.rb,c.layer)}}};function Ju(a){for(var b=a.network.vertexes.i;b.next();){var c=Nu(a,b.value);a.rb=Math.max(c,a.rb)}}function Nu(a,b){var c=0;if(-1===b.layer){for(var d=b.kc;d.next();)var e=d.value,f=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Nu(a,f)+e);b.layer=c}else c=b.layer;return c}function Lu(a,b){var c=0;if(-1===b.layer){for(var d=b.mc;d.next();)var e=d.value,f=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Lu(a,f)+e);b.layer=c}else c=b.layer;return c}
    function Mu(a,b){if(!b.valid){b.valid=!0;for(var c=b.kc;c.next();)Mu(a,c.value.toVertex);for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(var d=b.Qe.n,e=d.length,f=0;f<e;f++){var h=d[f],k=h.fromVertex,l=h.toVertex,h=a.linkMinLength(h);k.layer-l.layer>h&&Gu(a,k,0,-1,!0,!1)}for(Gu(a,b,1,-1,!0,!0);0!==b.component;){for(var k=0,d=Infinity,l=0,m=null,n=a.network.vertexes.i;n.next();){var p=n.value;if(1===p.component){for(var q=0,r=!1,s=p.Qe.n,e=s.length,f=0;f<e;f++){var h=s[f],u=h.fromVertex,
        q=q+1;1!==u.component&&(k+=1,u=u.layer-p.layer,h=a.linkMinLength(h),d=Math.min(d,u-h))}h=p.Ie.n;e=h.length;for(f=0;f<e;f++)s=h[f].toVertex,q-=1,1!==s.component?k-=1:r=!0;(null===m||q<l)&&!r&&(m=p,l=q)}}if(0<k){for(c.reset();c.next();)e=c.value,1===e.component&&(e.layer+=d);b.component=0}else m.component=0}for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(Gu(a,b,1,-1,!0,!1);0!==b.component;){f=0;e=Infinity;d=0;h=null;for(k=a.network.vertexes.i;k.next();)if(l=k.value,1===l.component){m=
        0;n=!1;r=l.Qe.n;p=r.length;for(q=0;q<p;q++)s=r[q].fromVertex,m+=1,1!==s.component?f+=1:n=!0;r=l.Ie.n;p=r.length;for(q=0;q<p;q++)s=r[q],u=s.toVertex,m-=1,1!==u.component&&(f-=1,u=l.layer-u.layer,s=a.linkMinLength(s),e=Math.min(e,u-s));(null===h||m>d)&&!n&&(h=l,d=m)}if(0>f){for(c.reset();c.next();)f=c.value,1===f.component&&(f.layer-=e);b.component=0}else h.component=0}}}
    function wu(a,b,c){return 90===a.ba?c&&!b.rev||!c&&b.rev?270:90:180===a.ba?c&&!b.rev||!c&&b.rev?0:180:270===a.ba?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}
    ju.prototype.initializeIndices=function(){switch(this.No){default:case Ou:for(var a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;b.index=this.je[c];this.je[c]++}break;case mu:a=this.network.vertexes.i;for(b=this.rb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Pu(this,c);break;case Qu:for(a=this.network.vertexes.i,b=0;b<=this.rb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Ru(this,c)}};
    function Pu(a,b){var c=b.layer;b.index=a.je[c];a.je[c]++;for(var c=b.Ie.gc(),d=!0;d;)for(var d=!1,e=0;e<c.length-1;e++){var f=c[e],h=c[e+1];f.portFromColOffset>h.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.toVertex,-1===d.index&&Pu(a,d))}
    function Ru(a,b){var c=b.layer;b.index=a.je[c];a.je[c]++;for(var c=b.Qe.gc(),d=!0,e=0;d;)for(d=!1,e=0;e<c.length-1;e++){var f=c[e],h=c[e+1];f.portToColOffset>h.portToColOffset&&(d=!0,c[e]=h,c[e+1]=f)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.fromVertex,-1===d.index&&Ru(a,d))}
    ju.prototype.reduceCrossings=function(){for(var a=this.countCrossings(),b=Au(this),c=0,d=0,e=0,c=0;c<this.Jm;c++){for(d=0;d<=this.rb;d++)Su(this,d,1),Tu(this,d,1);e=this.countCrossings();e<a&&(a=e,b=Au(this));for(d=this.rb;0<=d;d--)Su(this,d,-1),Tu(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=Au(this))}Bu(this,b);for(c=0;c<this.Jm;c++){for(d=0;d<=this.rb;d++)Su(this,d,0),Tu(this,d,0);e=this.countCrossings();e<a&&(a=e,b=Au(this));for(d=this.rb;0<=d;d--)Su(this,d,0),Tu(this,d,0);e=this.countCrossings();
        e<a&&(a=e,b=Au(this))}Bu(this,b);var f=!1,h=c=0,k=0,d=0;switch(this.lo){case Uu:break;case Vu:for(k=a+1;(d=this.countCrossings())<k;)for(k=d,c=this.rb;0<=c;c--)for(h=0;h<=c;h++){for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,-1)||f;e=this.countCrossings();e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,1)||f;e=this.countCrossings();e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              d=h;d<=c;d++)f=Tu(this,d,-1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this))}break;default:case nu:for(c=this.rb,h=0,k=a+1;(d=this.countCrossings())<k;){k=d;for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,-1)||f;e=this.countCrossings();e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,1)||f;e=this.countCrossings();
        e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,-1)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=c;d>=h;d--)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this));for(f=!0;f;)for(f=!1,d=h;d<=c;d++)f=Tu(this,d,0)||f;e>=a?Bu(this,b):(a=e,b=Au(this))}}Bu(this,b)};
    function Su(a,b,c){var d=0,e=xu(a,b),f=a.je[b],h=Fu(a,b,c);c=Eu(a,b,c);for(d=0;d<f;d++)-1===c[d]&&(c[d]=e[d].column),-1===h[d]&&(h[d]=e[d].column);for(var k=!0,l;k;)for(k=!1,d=0;d<f-1;d++)if(h[d+1]<h[d]||h[d+1]===h[d]&&c[d+1]<c[d])k=!0,l=h[d],h[d]=h[d+1],h[d+1]=l,l=c[d],c[d]=c[d+1],c[d+1]=l,l=e[d],e[d]=e[d+1],e[d+1]=l;for(d=h=0;d<f;d++)l=e[d],l.index=d,h+=a.nodeMinColumnSpace(l,!0),l.column=h,h+=1,h+=a.nodeMinColumnSpace(l,!1);yu(a,b,e)}
    function Tu(a,b,c){var d=xu(a,b),e=a.je[b];c=Cu(a,b,c);var f=0,h;h=[];for(f=0;f<e;f++)h[f]=-1;var k;k=[];for(f=0;f<e;f++)k[f]=-1;for(var l=!1,m=!0;m;)for(m=!1,f=0;f<e-1;f++){var n=c[d[f].index*e+d[f+1].index],p=c[d[f+1].index*e+d[f].index],q=0,r=0,s=d[f].column,u=d[f+1].column,t=a.nodeMinColumnSpace(d[f],!0),x=a.nodeMinColumnSpace(d[f],!1),v=a.nodeMinColumnSpace(d[f+1],!0),A=a.nodeMinColumnSpace(d[f+1],!1),t=s-t+v,x=u-x+A,v=v=0,y=d[f].mc.i;for(y.reset();y.next();)if(v=y.value,A=v.fromVertex,v.valid&&
        A.layer===b){for(v=0;d[v]!==A;)v++;v<f&&(q+=2*(f-v),r+=2*(f+1-v));v===f+1&&(q+=1);v>f+1&&(q+=4*(v-f),r+=4*(v-(f+1)))}y=d[f].kc.i;for(y.reset();y.next();)if(v=y.value,A=v.toVertex,v.valid&&A.layer===b){for(v=0;d[v]!==A;)v++;v===f+1&&(r+=1)}y=d[f+1].mc.i;for(y.reset();y.next();)if(v=y.value,A=v.fromVertex,v.valid&&A.layer===b){for(v=0;d[v]!==A;)v++;v<f&&(q+=2*(f+1-v),r+=2*(f-v));v===f&&(r+=1);v>f+1&&(q+=4*(v-(f+1)),r+=4*(v-f))}y=d[f+1].kc.i;for(y.reset();y.next();)if(v=y.value,A=v.toVertex,v.valid&&
        A.layer===b){for(v=0;d[v]!==A;)v++;v===f&&(q+=1)}var v=A=0,y=h[d[f].index],K=k[d[f].index],E=h[d[f+1].index],P=k[d[f+1].index];-1!==y&&(A+=Math.abs(y-s),v+=Math.abs(y-x));-1!==K&&(A+=Math.abs(K-s),v+=Math.abs(K-x));-1!==E&&(A+=Math.abs(E-u),v+=Math.abs(E-t));-1!==P&&(A+=Math.abs(P-u),v+=Math.abs(P-t));if(r<q-.5||r===q&&p<n-.5||r===q&&p===n&&v<A-.5)m=l=!0,d[f].column=x,d[f+1].column=t,n=d[f],d[f]=d[f+1],d[f+1]=n}for(f=0;f<e;f++)d[f].index=f;yu(a,b,d);return l}
    ju.prototype.straightenAndPack=function(){var a=0,b=!1,c=0!==(this.$i&Wu),a=this.$i===ou;1E3<this.network.edges.count&&!a&&(c=!1);if(c){b=[];for(a=a=0;a<=this.rb;a++)b[a]=0;for(var d=0,e=this.network.vertexes.i;e.next();){var f=e.value,a=f.layer,d=f.column,f=this.nodeMinColumnSpace(f,!1);b[a]=Math.max(b[a],d+f)}for(e.reset();e.next();)f=e.value,a=f.layer,d=f.column,f.column=(8*(this.Kb-b[a])>>1)+8*d;this.Kb*=8}if(0!==(this.$i&Xu))for(b=!0;b;){b=!1;for(a=this.Sf+1;a<=this.rb;a++)b=Yu(this,a,1)||b;
        for(a=this.Sf-1;0<=a;a--)b=Yu(this,a,-1)||b;b=Yu(this,this.Sf,0)||b}if(0!==(this.$i&Zu)){for(a=this.Sf+1;a<=this.rb;a++)$u(this,a,1);for(a=this.Sf-1;0<=a;a--)$u(this,a,-1);$u(this,this.Sf,0)}c&&(av(this,-1),av(this,1));if(0!==(this.$i&Xu))for(b=!0;b;){b=!1;b=Yu(this,this.Sf,0)||b;for(a=this.Sf+1;a<=this.rb;a++)b=Yu(this,a,0)||b;for(a=this.Sf-1;0<=a;a--)b=Yu(this,a,0)||b}};function Yu(a,b,c){for(var d=!1;bv(a,b,c);)d=!0;return d}
    function bv(a,b,c){var d=0,e=xu(a,b),f=a.je[b],h=Eu(a,b,-1);if(0<c)for(d=0;d<f;d++)h[d]=-1;var k=Eu(a,b,1);if(0>c)for(d=0;d<f;d++)k[d]=-1;for(var l=!1,m=!0;m;)for(m=!1,d=0;d<f;d++){var n=e[d].column,p=a.nodeMinColumnSpace(e[d],!0),q=a.nodeMinColumnSpace(e[d],!1),r=0,r=0>d-1||n-e[d-1].column-1>p+a.nodeMinColumnSpace(e[d-1],!1)?n-1:n,p=0,p=d+1>=f||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=0,u=0,t=0,x=0,v=0;if(0>=c)for(var A=e[d].mc.i;A.next();){var v=A.value,y=v.fromVertex;v.valid&&
    y.layer!==b&&(t=zu(v),x=v.portFromColOffset,v=v.portToColOffset,y=y.column,q+=(Math.abs(n+v-(y+x))+1)*t,s+=(Math.abs(r+v-(y+x))+1)*t,u+=(Math.abs(p+v-(y+x))+1)*t)}if(0<=c)for(A=e[d].kc.i;A.next();)v=A.value,y=v.toVertex,v.valid&&y.layer!==b&&(t=zu(v),x=v.portFromColOffset,v=v.portToColOffset,y=y.column,q+=(Math.abs(n+x-(y+v))+1)*t,s+=(Math.abs(r+x-(y+v))+1)*t,u+=(Math.abs(p+x-(y+v))+1)*t);v=x=t=0;A=h[e[d].index];y=k[e[d].index];-1!==A&&(t+=Math.abs(A-n),x+=Math.abs(A-r),v+=Math.abs(A-p));-1!==y&&
    (t+=Math.abs(y-n),x+=Math.abs(y-r),v+=Math.abs(y-p));if(s<q||s===q&&x<t)m=l=!0,e[d].column=r;else if(u<q||u===q&&v<t)m=l=!0,e[d].column=p}yu(a,b,e);a.normalize();return l}
    function $u(a,b,c){var d=0,e=xu(a,b),f=a.je[b],h=Fu(a,b,c);c=[];for(d=0;d<f;d++)c[d]=h[d];for(h=!0;h;)for(h=!1,d=0;d<f;d++){var k=e[d].column,l=a.nodeMinColumnSpace(e[d],!0),m=a.nodeMinColumnSpace(e[d],!1),n=0,p=0,q=0,q=p=0;-1===c[d]?0===d&&d===f-1?n=k:0===d?(p=e[d+1].column,n=p-k===m+a.nodeMinColumnSpace(e[d+1],!0)?k-1:k):d===f-1?(q=e[d-1].column,n=k-q===l+a.nodeMinColumnSpace(e[d-1],!1)?k+1:k):(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+
        1],!0)-m-1,n=(q+p)/2|0):0===d&&d===f-1?n=c[d]:0===d?(p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,n=Math.min(c[d],p)):d===f-1?(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,n=Math.max(c[d],q)):(q=e[d-1].column,q=q+a.nodeMinColumnSpace(e[d-1],!1)+l+1,p=e[d+1].column,p=p-a.nodeMinColumnSpace(e[d+1],!0)-m-1,q<c[d]&&c[d]<p?n=c[d]:q>=c[d]?n=q:p<=c[d]&&(n=p));n!==k&&(h=!0,e[d].column=n)}yu(a,b,e);a.normalize()}
    function cv(a,b){for(var c=!0,d=a.network.vertexes.i;d.next();){var e=d.value,f=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-f<=b&&e.column+h>=b){c=!1;break}}e=!1;if(c)for(d.reset();d.next();)c=d.value,c.column>b&&(c.column-=1,e=!0);return e}
    function dv(a,b){for(var c=b,c=b+1,d=0,e=[],f=[],d=0;d<=a.rb;d++)e[d]=!1,f[d]=!1;for(var h=a.network.vertexes.i;h.next();){var d=h.value,k=d.column-a.nodeMinColumnSpace(d,!0),l=d.column+a.nodeMinColumnSpace(d,!1);k<=b&&l>=b&&(e[d.layer]=!0);k<=c&&l>=c&&(f[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.rb;d++)k=k&&!(e[d]&&f[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c}
    function av(a,b){for(var c=0;c<=a.Kb;c++)for(;cv(a,c););a.normalize();for(c=0;c<a.Kb;c++)for(;dv(a,c););a.normalize();var c=0,d,e=0,f=0,h=0;if(0<b)for(c=0;c<=a.Kb;c++)for(d=Au(a),e=Du(a),f=e+1;e<f;)f=e,ev(a,c,1),h=Du(a),h>e?Bu(a,d):h<e&&(e=h,d=Au(a));if(0>b)for(c=a.Kb;0<=c;c--)for(d=Au(a),e=Du(a),f=e+1;e<f;)f=e,ev(a,c,-1),h=Du(a),h>e?Bu(a,d):h<e&&(e=h,d=Au(a));a.normalize()}
    function ev(a,b,c){a.Eg=0;for(var d=a.network.vertexes.i;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.Eg)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.Eg);a.Eg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Hu(a,b,a.Eg,-1,!0,!0),a.Eg++);var f=0;b=[];for(f=0;f<a.Eg*a.Eg;f++)b[f]=!1;e=[];for(f=0;f<(a.rb+1)*(a.Kb+1);f++)e[f]=-1;for(d.reset();d.next();)for(var f=
        d.value,h=f.layer,k=Math.max(0,f.column-a.nodeMinColumnSpace(f,!0)),l=Math.min(a.Kb,f.column+a.nodeMinColumnSpace(f,!1));k<=l;k++)e[h*(a.Kb+1)+k]=f.component;for(f=0;f<=a.rb;f++){if(0<c)for(k=0;k<a.Kb;k++)-1!==e[f*(a.Kb+1)+k]&&-1!==e[f*(a.Kb+1)+k+1]&&e[f*(a.Kb+1)+k]!==e[f*(a.Kb+1)+k+1]&&(b[e[f*(a.Kb+1)+k]*a.Eg+e[f*(a.Kb+1)+k+1]]=!0);if(0>c)for(k=a.Kb;0<k;k--)-1!==e[f*(a.Kb+1)+k]&&-1!==e[f*(a.Kb+1)+k-1]&&e[f*(a.Kb+1)+k]!==e[f*(a.Kb+1)+k-1]&&(b[e[f*(a.Kb+1)+k]*a.Eg+e[f*(a.Kb+1)+k-1]]=!0)}e=[];for(f=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                0;f<a.Eg;f++)e[f]=!0;h=new H("number");h.add(0);for(l=0;0!==h.count;)if(l=h.n[h.count-1],h.bd(h.count-1),e[l])for(e[l]=!1,f=0;f<a.Eg;f++)b[l*a.Eg+f]&&h.Qd(0,f);if(0<c)for(d.reset();d.next();)a=d.value,e[a.component]&&(a.column-=1);if(0>c)for(d.reset();d.next();)c=d.value,e[c.component]&&(c.column+=1)}
    ju.prototype.commitLayout=function(){if(this.tq)for(var a=vu(this,!0),b=vu(this,!1),c=this.network.edges.i;c.next();){var d=c.value.link;null!==d&&(d.Ab=a,d.Bb=b)}this.commitNodes();this.Zz();this.ju&&this.commitLinks()};function vu(a,b){return 270===a.ba?b?Gc:Jc:90===a.ba?b?Jc:Gc:180===a.ba?b?Hc:Ic:b?Ic:Hc}
    ju.prototype.commitNodes=function(){this.Ag=[];this.Rf=[];this.Qf=[];this.Ob=[];for(var a=0;a<=this.rb;a++)this.Ag[a]=0,this.Rf[a]=0,this.Qf[a]=0,this.Ob[a]=0;for(a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;this.Ag[c]=Math.max(this.Ag[c],this.nodeMinLayerSpace(b,!0));this.Rf[c]=Math.max(this.Rf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.Lm,c=0;c<=this.rb;c++){var e=d;0>=this.Ag[c]+this.Rf[c]&&(e=0);0<c&&(b+=e/2);90===this.ba||0===this.ba?(b+=this.Rf[c],this.Qf[c]=b,b+=this.Ag[c]):
        (b+=this.Ag[c],this.Qf[c]=b,b+=this.Rf[c]);c<this.rb&&(b+=e/2);this.Ob[c]=b}d=b;b=this.qe;for(c=0;c<=this.rb;c++)270===this.ba?this.Qf[c]=b.y+this.Qf[c]:90===this.ba?(this.Qf[c]=b.y+d-this.Qf[c],this.Ob[c]=d-this.Ob[c]):180===this.ba?this.Qf[c]=b.x+this.Qf[c]:(this.Qf[c]=b.x+d-this.Qf[c],this.Ob[c]=d-this.Ob[c]);a.reset();for(d=e=Infinity;a.next();){var c=a.value,f=c.layer,h=c.column|0,k=0,l=0;270===this.ba||90===this.ba?(k=b.x+this.Yd*h,l=this.Qf[f]):(k=this.Qf[f],l=b.y+this.Yd*h);c.la=k;c.ra=l;
        e=Math.min(c.x,e);d=Math.min(c.y,d)}e=b.x-e;b=b.y-d;this.ZB=new z(e,b);for(a.reset();a.next();)c=a.value,c.x+=e,c.y+=b,c.commit()};
    ju.prototype.Zz=function(){for(var a=0,b=this.Lm,c=0;c<=this.rb;c++)a+=this.Ag[c],a+=this.Rf[c];for(var a=a+this.rb*b,b=[],c=this.Yd*this.Kb,d=this.RI;0<=d;d--)270===this.ba?0===d?b.push(new B(0,0,c,Math.abs(this.Ob[0]))):b.push(new B(0,this.Ob[d-1],c,Math.abs(this.Ob[d-1]-this.Ob[d]))):90===this.ba?0===d?b.push(new B(0,this.Ob[0],c,Math.abs(this.Ob[0]-a))):b.push(new B(0,this.Ob[d],c,Math.abs(this.Ob[d-1]-this.Ob[d]))):180===this.ba?0===d?b.push(new B(0,0,Math.abs(this.Ob[0]),c)):b.push(new B(this.Ob[d-
    1],0,Math.abs(this.Ob[d-1]-this.Ob[d]),c)):0===d?b.push(new B(this.Ob[0],0,Math.abs(this.Ob[0]-a),c)):b.push(new B(this.Ob[d],0,Math.abs(this.Ob[d-1]-this.Ob[d]),c));this.commitLayers(b,this.ZB)};ju.prototype.commitLayers=function(){};
    ju.prototype.commitLinks=function(){for(var a=this.network.edges.i,b;a.next();)b=a.value.link,null!==b&&(b.im(),b.Gp(),b.kj());for(a.reset();a.next();)b=a.value.link,null!==b&&b.eo();for(a.reset();a.next();){var c=a.value;b=c.link;if(null!==b){b.im();var d=b,e=d.Y,f=d.$,h=d.Lc,k=d.ld;if(null!==e){var l=e.findVisibleNode();null!==l&&l!==e&&(e=l,h=l.port)}if(null!==f){var m=f.findVisibleNode();null!==m&&m!==f&&(f=m,k=m.port)}var n=b.computeSpot(!0,h),p=b.computeSpot(!1,k),q=c.fromVertex,r=c.toVertex;
        if(c.valid){if(b.af===Jj&&4===b.qa){if(c.rev)var s=e,e=f,f=s,u=h,h=k,k=u;if(q.column===r.column){var t=b.getLinkPoint(e,h,n,!0,!1,f,k),x=b.getLinkPoint(f,k,p,!1,!1,e,h);t.I()||t.set(e.W.Ml);x.I()||x.set(f.W.Ml);b.Gp();b.ij(t.x,t.y);b.ij((2*t.x+x.x)/3,(2*t.y+x.y)/3);b.ij((t.x+2*x.x)/3,(t.y+2*x.y)/3);b.ij(x.x,x.y)}else{var v=!1,A=!1;null!==h&&n===yb&&(v=!0);null!==k&&p===yb&&(A=!0);if(v||A){var y=b.l(0).x,K=b.l(0).y,E=b.l(1).x,P=b.l(1).y,$=b.l(2).x,S=b.l(2).y,ba=b.l(3).x,ga=b.l(3).y;if(v){90===this.ba||
        270===this.ba?(E=y,P=(K+ga)/2):(E=(y+ba)/2,P=K);b.ca(1,E,P);var ya=b.getLinkPoint(e,h,n,!0,!1,f,k);ya.I()||ya.set(e.W.Ml);b.ca(0,ya.x,ya.y)}A&&(90===this.ba||270===this.ba?($=ba,S=(K+ga)/2):($=(y+ba)/2,S=ga),b.ca(2,$,S),ya=b.getLinkPoint(f,k,p,!1,!1,e,h),ya.I()||ya.set(f.W.Ml),b.ca(3,ya.x,ya.y))}}}b.kj()}else if(q.layer===r.layer)b.kj();else{var Fa=!1,eb=!1,wa=0,U=b.Qt+1;if(b.ac)eb=!0,wa=b.qa,4<wa&&b.points.removeRange(2,wa-3);else if(b.af===Jj)Fa=!0,wa=b.qa,4<wa&&b.points.removeRange(2,wa-3),U=2;
        else{var wa=b.qa,sb=n===yb,Kb=p===yb;2<wa&&sb&&Kb?b.points.removeRange(1,wa-2):3<wa&&sb&&!Kb?b.points.removeRange(1,wa-3):3<wa&&!sb&&Kb?b.points.removeRange(2,wa-2):4<wa&&!sb&&!Kb&&b.points.removeRange(2,wa-3)}var Oa,Mc;if(c.rev){for(var Ma=0;null!==r&&q!==r;){Mc=Oa=null;for(var bg=r.mc.i;bg.next();){var cg=bg.value;if(cg.link===c.link&&(Oa=cg.fromVertex,Mc=cg.toVertex,null===Oa.td))break}if(Oa!==q)if(fb=b.l(U-1).x,pb=b.l(U-1).y,na=Oa.la,ja=Oa.ra,eb)180===this.ba||0===this.ba?2===U?(b.w(U++,fb,pb),
            b.w(U++,fb,ja)):(Hd=null!==Mc?Mc.ra:pb,Hd!==ja&&(Za=this.Ob[Oa.layer-1],b.w(U++,Za,pb),b.w(U++,Za,ja))):2===U?(b.w(U++,fb,pb),b.w(U++,na,pb)):(Df=null!==Mc?Mc.la:fb,Df!==na&&(Za=this.Ob[Oa.layer-1],b.w(U++,fb,Za),b.w(U++,na,Za)));else if(2===U)if(Ia=Math.max(10,this.Ag[r.layer]),kb=Math.max(10,this.Rf[r.layer]),Fa)180===this.ba?na<=r.M.x?(Ma=r.M.x,b.w(U++,Ma-Ia,ja),b.w(U++,Ma,ja),b.w(U++,Ma+kb,ja)):(b.w(U++,na-Ia,ja),b.w(U++,na,ja),b.w(U++,na+kb,ja)):90===this.ba?ja>=r.M.bottom?(Ma=r.M.y+r.M.height,
            b.w(U++,na,Ma+kb),b.w(U++,na,Ma),b.w(U++,na,Ma-Ia)):(b.w(U++,na,ja+kb),b.w(U++,na,ja),b.w(U++,na,ja-Ia)):270===this.ba?ja<=r.M.y?(Ma=r.M.y,b.w(U++,na,Ma-Ia),b.w(U++,na,Ma),b.w(U++,na,Ma+kb)):(b.w(U++,na,ja-Ia),b.w(U++,na,ja),b.w(U++,na,ja+kb)):0===this.ba&&(na>=r.M.right?(Ma=r.M.x+r.M.width,b.w(U++,Ma+kb,ja),b.w(U++,Ma,ja),b.w(U++,Ma-Ia,ja)):(b.w(U++,na+kb,ja),b.w(U++,na,ja),b.w(U++,na-Ia,ja)));else{b.w(U++,fb,pb);var sd=0;if(180===this.ba||0===this.ba){if(180===this.ba?na>=r.M.right:na<=r.M.x)sd=
            (0===this.ba?-Ia:kb)/2;b.w(U++,fb+sd,ja)}else{if(270===this.ba?ja>=r.M.bottom:ja<=r.M.y)sd=(90===this.ba?-Ia:kb)/2;b.w(U++,na,pb+sd)}b.w(U++,na,ja)}else Ia=Math.max(10,this.Ag[Oa.layer]),kb=Math.max(10,this.Rf[Oa.layer]),180===this.ba?(Fa&&b.w(U++,na-Ia,ja),b.w(U++,na,ja),Fa&&b.w(U++,na+kb,ja)):90===this.ba?(Fa&&b.w(U++,na,ja+kb),b.w(U++,na,ja),Fa&&b.w(U++,na,ja-Ia)):270===this.ba?(Fa&&b.w(U++,na,ja-Ia),b.w(U++,na,ja),Fa&&b.w(U++,na,ja+kb)):(Fa&&b.w(U++,na+kb,ja),b.w(U++,na,ja),Fa&&b.w(U++,na-Ia,
            ja));r=Oa}if(null===k||n!==yb||eb)if(fb=b.l(U-1).x,pb=b.l(U-1).y,na=b.l(U).x,ja=b.l(U).y,eb){var td=this.Rf[q.layer],Nc=0;180===this.ba||0===this.ba?(Nc=pb,Nc>=q.M.y&&Nc<=q.M.bottom&&(180===this.ba?na>=q.M.x:na<=q.M.right)&&(Ma=q.la+(180===this.ba?-td:td),Nc=Nc<q.M.y+q.M.height/2?q.M.y-this.Yd/2:q.M.bottom+this.Yd/2,b.w(U++,Ma,pb),b.w(U++,Ma,Nc)),b.w(U++,na,Nc)):(Nc=fb,Nc>=q.M.x&&Nc<=q.M.right&&(270===this.ba?ja>=q.M.y:ja<=q.M.bottom)&&(Ma=q.ra+(270===this.ba?-td:td),Nc=Nc<q.M.x+q.M.width/2?q.M.x-
            this.Yd/2:q.M.right+this.Yd/2,b.w(U++,fb,Ma),b.w(U++,Nc,Ma)),b.w(U++,Nc,ja));b.w(U++,na,ja)}else if(Fa)Ia=Math.max(10,this.Ag[q.layer]),kb=Math.max(10,this.Rf[q.layer]),180===this.ba&&na>=q.M.x?(Ma=q.M.x+q.M.width,b.ca(U-2,Ma,pb),b.ca(U-1,Ma+kb,pb)):90===this.ba&&ja<=q.M.bottom?(Ma=q.M.y,b.ca(U-2,fb,Ma),b.ca(U-1,fb,Ma-Ia)):270===this.ba&&ja>=q.M.y?(Ma=q.M.y+q.M.height,b.ca(U-2,fb,Ma),b.ca(U-1,fb,Ma+kb)):0===this.ba&&na<=q.M.right&&(Ma=q.M.x,b.ca(U-2,Ma,pb),b.ca(U-1,Ma-Ia,pb));else{Ia=Math.max(10,
            this.Ag[q.layer]);kb=Math.max(10,this.Rf[q.layer]);sd=0;if(180===this.ba||0===this.ba){if(180===this.ba?na<=q.M.x:na>=q.M.right)sd=(0===this.ba?kb:-Ia)/2;b.w(U++,na+sd,pb)}else{if(270===this.ba?ja<=q.M.y:ja>=q.M.bottom)sd=(90===this.ba?kb:-Ia)/2;b.w(U++,fb,ja+sd)}b.w(U++,na,ja)}}else{for(;null!==q&&q!==r;){Mc=Oa=null;for(var qh=q.kc.i;qh.next();){var Ve=qh.value;if(Ve.link===c.link&&(Oa=Ve.toVertex,Mc=Ve.fromVertex,null!==Mc.td&&(Mc=null),null===Oa.td))break}var fb=0,pb=0,na=0,ja=0,Za=0,Ia=0,kb=0;
            if(Oa!==r)if(fb=b.l(U-1).x,pb=b.l(U-1).y,na=Oa.la,ja=Oa.ra,eb)if(180===this.ba||0===this.ba){var Hd=null!==Mc?Mc.ra:pb;Hd!==ja&&(Za=this.Ob[Oa.layer],2===U&&(Za=0===this.ba?Math.max(Za,fb):Math.min(Za,fb)),b.w(U++,Za,pb),b.w(U++,Za,ja))}else{var Df=null!==Mc?Mc.la:fb;Df!==na&&(Za=this.Ob[Oa.layer],2===U&&(Za=90===this.ba?Math.max(Za,pb):Math.min(Za,pb)),b.w(U++,fb,Za),b.w(U++,na,Za))}else Ia=Math.max(10,this.Ag[Oa.layer]),kb=Math.max(10,this.Rf[Oa.layer]),180===this.ba?(b.w(U++,na+kb,ja),Fa&&b.w(U++,
                na,ja),b.w(U++,na-Ia,ja)):90===this.ba?(b.w(U++,na,ja-Ia),Fa&&b.w(U++,na,ja),b.w(U++,na,ja+kb)):270===this.ba?(b.w(U++,na,ja+kb),Fa&&b.w(U++,na,ja),b.w(U++,na,ja-Ia)):(b.w(U++,na-Ia,ja),Fa&&b.w(U++,na,ja),b.w(U++,na+kb,ja));q=Oa}eb&&(fb=b.l(U-1).x,pb=b.l(U-1).y,na=b.l(U).x,ja=b.l(U).y,180===this.ba||0===this.ba?pb!==ja&&(Za=0===this.ba?Math.min(Math.max((na+fb)/2,this.Ob[r.layer]),na):Math.max(Math.min((na+fb)/2,this.Ob[r.layer]),na),b.w(U++,Za,pb),b.w(U++,Za,ja)):fb!==na&&(Za=90===this.ba?Math.min(Math.max((ja+
                pb)/2,this.Ob[r.layer]),ja):Math.max(Math.min((ja+pb)/2,this.Ob[r.layer]),ja),b.w(U++,fb,Za),b.w(U++,na,Za)))}if(null!==d&&Fa){if(null!==h){if(n===yb){var pe=b.l(0),Yd=b.l(2);pe.L(Yd)||b.ca(1,(pe.x+Yd.x)/2,(pe.y+Yd.y)/2)}ya=b.getLinkPoint(e,h,yb,!0,!1,f,k);ya.I()||ya.set(e.W.Ml);b.ca(0,ya.x,ya.y)}null!==k&&(p===yb&&(pe=b.l(b.qa-1),Yd=b.l(b.qa-3),pe.L(Yd)||b.ca(b.qa-2,(pe.x+Yd.x)/2,(pe.y+Yd.y)/2)),ya=b.getLinkPoint(f,k,yb,!1,!1,e,h),ya.I()||ya.set(f.W.Ml),b.ca(b.qa-1,ya.x,ya.y))}b.kj();c.commit()}}}for(var gd=
        new H(W),rh=this.network.edges.i;rh.next();){var Ef=rh.value.link;null!==Ef&&Ef.ac&&!gd.contains(Ef)&&gd.add(Ef)}if(0<gd.count)if(90===this.ba||270===this.ba){for(var Cg=0,Cb=new H(fv),Ac,Zd,sh=gd.i;sh.next();){var qb=sh.value;if(null!==qb&&qb.ac)for(var Ja=2;Ja<qb.qa-3;Ja++)if(Ac=qb.l(Ja),Zd=qb.l(Ja+1),gv(Ac.y,Zd.y)&&!gv(Ac.x,Zd.x)){var Lb=new fv;Lb.layer=Math.floor(Ac.y/2);var Ff=qb.l(0),Dg=qb.l(qb.qa-1);Lb.first=Ff.x*Ff.x+Ff.y;Lb.fe=Dg.x*Dg.x+Dg.y;Lb.Ze=Math.min(Ac.x,Zd.x);Lb.re=Math.max(Ac.x,
        Zd.x);Lb.index=Ja;Lb.link=qb;if(Ja+2<qb.qa){var th=qb.l(Ja-1),gb=qb.l(Ja+2),tc=0;th.y<Ac.y?tc=gb.y<Ac.y?3:Ac.x<Zd.x?2:1:th.y>Ac.y&&(tc=gb.y>Ac.y?0:Zd.x<Ac.x?2:1);Lb.ui=tc}Cb.add(Lb)}}if(1<Cb.count){Cb.sort(this.iG);for(var Vb=0;Vb<Cb.count;){for(var qe=Cb.n[Vb].layer,uc=Vb+1;uc<Cb.count&&Cb.n[uc].layer===qe;)uc++;if(1<uc-Vb)for(var vc=Vb;vc<uc;){for(var rb=Cb.n[vc].re,kc=Vb+1;kc<uc&&Cb.n[kc].Ze<rb;)rb=Math.max(rb,Cb.n[kc].re),kc++;var tb=kc-vc;if(1<tb){Cb.wq(this.iy,vc,vc+tb);for(var Bc=1,bb=Cb.n[vc].fe,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 Ja=vc;Ja<kc;Ja++){var Qa=Cb.n[Ja];Qa.fe!==bb&&(Bc++,bb=Qa.fe)}Cb.wq(this.hG,vc,vc+tb);for(var Hb=1,bb=Cb.n[vc].first,Ja=vc;Ja<kc;Ja++)Qa=Cb.n[Ja],Qa.first!==bb&&(Hb++,bb=Qa.first);var ud=!0,dg=Hb;Bc<Hb?(ud=!1,dg=Bc,bb=Cb.n[vc].fe,Cb.wq(this.iy,vc,vc+tb)):bb=Cb.n[vc].first;for(var We=0,Ja=vc;Ja<kc;Ja++){Qa=Cb.n[Ja];(ud?Qa.first:Qa.fe)!==bb&&(We++,bb=ud?Qa.first:Qa.fe);qb=Qa.link;Ac=qb.l(Qa.index);Zd=qb.l(Qa.index+1);var eg=this.EF*(We-(dg-1)/2);Cg++;qb.im();qb.ca(Qa.index,Ac.x,Ac.y+eg);qb.ca(Qa.index+
        1,Zd.x,Zd.y+eg);qb.kj()}}vc=kc}Vb=uc}}}else{for(var pj=0,Mb=new H(fv),Cc,wc,hd=gd.i;hd.next();){var lb=hd.value;if(null!==lb&&lb.ac)for(var Nb=2;Nb<lb.qa-3;Nb++)if(Cc=lb.l(Nb),wc=lb.l(Nb+1),gv(Cc.x,wc.x)&&!gv(Cc.y,wc.y)){var re=new fv;re.layer=Math.floor(Cc.x/2);var ub=lb.l(0),$d=lb.l(lb.qa-1);re.first=ub.x+ub.y*ub.y;re.fe=$d.x+$d.y*$d.y;re.Ze=Math.min(Cc.y,wc.y);re.re=Math.max(Cc.y,wc.y);re.index=Nb;re.link=lb;if(Nb+2<lb.qa){var uh=lb.l(Nb-1),vh=lb.l(Nb+2),Eg=0;uh.x<Cc.x?Eg=vh.x<Cc.x?3:Cc.y<wc.y?
        2:1:uh.x>Cc.x&&(Eg=vh.x>Cc.x?0:wc.y<Cc.y?2:1);re.ui=Eg}Mb.add(re)}}if(1<Mb.count){Mb.sort(this.iG);for(var id=0;id<Mb.count;){for(var Id=Mb.n[id].layer,cc=id+1;cc<Mb.count&&Mb.n[cc].layer===Id;)cc++;if(1<cc-id)for(var vb=id;vb<cc;){for(var vd=Mb.n[vb].re,jb=id+1;jb<cc&&Mb.n[jb].Ze<vd;)vd=Math.max(vd,Mb.n[jb].re),jb++;var dc=jb-vb;if(1<dc){Mb.wq(this.iy,vb,vb+dc);for(var ei=1,Yc=Mb.n[vb].fe,Nb=vb;Nb<jb;Nb++){var Db=Mb.n[Nb];Db.fe!==Yc&&(ei++,Yc=Db.fe)}Mb.wq(this.hG,vb,vb+dc);for(var se=1,Yc=Mb.n[vb].first,
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                               Nb=vb;Nb<jb;Nb++)Db=Mb.n[Nb],Db.first!==Yc&&(se++,Yc=Db.first);var Xe=!0,Zc=se;ei<se?(Xe=!1,Zc=ei,Yc=Mb.n[vb].fe,Mb.wq(this.iy,vb,vb+dc)):Yc=Mb.n[vb].first;for(var Gf=0,Nb=vb;Nb<jb;Nb++){Db=Mb.n[Nb];(Xe?Db.first:Db.fe)!==Yc&&(Gf++,Yc=Xe?Db.first:Db.fe);lb=Db.link;Cc=lb.l(Db.index);wc=lb.l(Db.index+1);var Fg=this.EF*(Gf-(Zc-1)/2);pj++;lb.im();lb.ca(Db.index,Cc.x+Fg,Cc.y);lb.ca(Db.index+1,wc.x+Fg,wc.y);lb.kj()}}vb=jb}id=cc}}}};
    ju.prototype.iG=function(a,b){return a instanceof fv&&b instanceof fv&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.Ze<b.Ze?-1:a.Ze>b.Ze?1:a.re<b.re?-1:a.re>b.re?1:0:0};ju.prototype.hG=function(a,b){return a instanceof fv&&b instanceof fv&&a!==b?a.first<b.first?-1:a.first>b.first||a.ui<b.ui?1:a.ui>b.ui||a.Ze<b.Ze?-1:a.Ze>b.Ze?1:a.re<b.re?-1:a.re>b.re?1:0:0};
    ju.prototype.iy=function(a,b){return a instanceof fv&&b instanceof fv&&a!==b?a.fe<b.fe?-1:a.fe>b.fe||a.ui<b.ui?1:a.ui>b.ui||a.Ze<b.Ze?-1:a.Ze>b.Ze?1:a.re<b.re?-1:a.re>b.re?1:0:0};function gv(a,b){var c=a-b;return-1<c&&1>c}function xu(a,b){var c,d=a.je[b];if(d>=a.jh.length){c=[];for(var e=0;e<a.jh.length;e++)c[e]=a.jh[e];a.jh=c}void 0===a.jh[d]||null===a.jh[d]?c=[]:(c=a.jh[d],a.jh[d]=null);d=a.rs[b];for(e=0;e<d.length;e++){var f=d[e];c[f.index]=f}return c}function yu(a,b,c){a.jh[a.je[b]]=c}
    w.defineProperty(ju,{layerSpacing:"layerSpacing"},function(){return this.Lm},function(a){this.Lm!==a&&(w.j(a,"number",ju,"layerSpacing"),0<=a&&(this.Lm=a,this.J()))});w.defineProperty(ju,{FK:"columnSpacing"},function(){return this.Yd},function(a){this.Yd!==a&&(w.j(a,"number",ju,"columnSpacing"),0<a&&(this.Yd=a,this.J()))});
    w.defineProperty(ju,{direction:"direction"},function(){return this.ba},function(a){this.ba!==a&&(w.j(a,"number",ju,"direction"),0===a||90===a||180===a||270===a?(this.ba=a,this.J()):w.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))});w.defineProperty(ju,{angle:"angle"},function(){return this.direction},function(a){this.direction=a});
    w.defineProperty(ju,{HH:"cycleRemoveOption"},function(){return this.xo},function(a){this.xo!==a&&(w.mb(a,ju,ju,"cycleRemoveOption"),a===qu||a===ku)&&(this.xo=a,this.J())});w.defineProperty(ju,{II:"layeringOption"},function(){return this.Xo},function(a){this.Xo!==a&&(w.mb(a,ju,ju,"layeringOption"),a===lu||a===Iu||a===Ku)&&(this.Xo=a,this.J())});
    w.defineProperty(ju,{tI:"initializeOption"},function(){return this.No},function(a){this.No!==a&&(w.mb(a,ju,ju,"initializeOption"),a===mu||a===Qu||a===Ou)&&(this.No=a,this.J())});w.defineProperty(ju,{jL:"iterations"},function(){return this.Jm},function(a){this.Jm!==a&&(w.wd(a,pu,"iterations"),0<=a&&(this.Jm=a,this.J()))});w.defineProperty(ju,{kH:"aggressiveOption"},function(){return this.lo},function(a){this.lo!==a&&(w.mb(a,ju,ju,"aggressiveOption"),a===Uu||a===nu||a===Vu)&&(this.lo=a,this.J())});
    w.defineProperty(ju,{DL:"packOption"},function(){return this.$i},function(a){this.$i!==a&&(w.j(a,"number",ju,"packOption"),0<=a&&8>a&&(this.$i=a,this.J()))});w.defineProperty(ju,{tq:"setsPortSpots"},function(){return this.ci},function(a){this.ci!==a&&(w.j(a,"boolean",ju,"setsPortSpots"),this.ci=a,this.J())});w.defineProperty(ju,{EF:"linkSpacing"},function(){return this.Zr},function(a){this.Zr!==a&&(w.j(a,"number",ju,"linkSpacing"),0<=a&&(this.Zr=a,this.J()))});w.u(ju,{RI:"maxLayer"},function(){return this.rb});
    w.u(ju,{pL:"maxIndex"},function(){return this.Yv});w.u(ju,{oL:"maxColumn"},function(){return this.Kb});w.u(ju,{uL:"minIndexLayer"},function(){return this.hs});w.u(ju,{qL:"maxIndexLayer"},function(){return this.Sf});var ku;ju.CycleDepthFirst=ku=w.p(ju,"CycleDepthFirst",0);var qu;ju.CycleGreedy=qu=w.p(ju,"CycleGreedy",1);var lu;ju.LayerOptimalLinkLength=lu=w.p(ju,"LayerOptimalLinkLength",0);var Iu;ju.LayerLongestPathSink=Iu=w.p(ju,"LayerLongestPathSink",1);var Ku;
    ju.LayerLongestPathSource=Ku=w.p(ju,"LayerLongestPathSource",2);var mu;ju.InitDepthFirstOut=mu=w.p(ju,"InitDepthFirstOut",0);var Qu;ju.InitDepthFirstIn=Qu=w.p(ju,"InitDepthFirstIn",1);var Ou;ju.InitNaive=Ou=w.p(ju,"InitNaive",2);var Uu;ju.AggressiveNone=Uu=w.p(ju,"AggressiveNone",0);var nu;ju.AggressiveLess=nu=w.p(ju,"AggressiveLess",1);var Vu;ju.AggressiveMore=Vu=w.p(ju,"AggressiveMore",2);ju.PackNone=0;var Wu;ju.PackExpand=Wu=1;var Xu;ju.PackStraighten=Xu=2;var Zu;ju.PackMedian=Zu=4;var ou;
    ju.PackAll=ou=7;function fv(){this.index=this.re=this.Ze=this.fe=this.first=this.layer=0;this.link=null;this.ui=0}w.ce(fv,{layer:!0,first:!0,fe:!0,Ze:!0,re:!0,index:!0,link:!0,ui:!0});function pu(){ug.call(this)}w.Ka(pu,ug);w.ga("LayeredDigraphNetwork",pu);pu.prototype.createVertex=function(){return new hv};pu.prototype.createEdge=function(){return new iv};
    function hv(){ls.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.Op=NaN;this.nn=0;this.TA=this.UA=null}w.Ka(hv,ls);w.ga("LayeredDigraphVertex",hv);function iv(){ms.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}w.Ka(iv,ms);w.ga("LayeredDigraphEdge",iv);
    function Z(){0<arguments.length&&w.kd(Z);tg.call(this);this.ud=new I(Object);this.Bs=jv;this.Of=kv;this.rt=lv;this.Vv=mv;this.UB=null;this.Lh=!0;this.nd=nv;this.og=(new ia(10,10)).freeze();this.va=new ov;this.wa=new ov;this.Iz=[]}w.Ka(Z,tg);w.ga("TreeLayout",Z);Z.prototype.cloneProtected=function(a){tg.prototype.cloneProtected.call(this,a);a.Bs=this.Bs;a.rt=this.rt;a.Vv=this.Vv;a.Lh=this.Lh;a.nd=this.nd;a.og.assign(this.og);a.va.copyInheritedPropertiesFrom(this.va);a.wa.copyInheritedPropertiesFrom(this.wa)};
    Z.prototype.ic=function(a){a.Ee===Z?0===a.name.indexOf("Alignment")?this.alignment=a:0===a.name.indexOf("Arrangement")?this.Wf=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.VJ=a:w.k("Unknown enum value: "+a):tg.prototype.ic.call(this,a)};Z.prototype.createNetwork=function(){return new pv};
    Z.prototype.makeNetwork=function(a){function b(a){if(a instanceof T)return!a.Bf&&"Comment"!==a.vd;if(a instanceof W){var b=a.Y;if(null===b||b.Bf||"Comment"===b.vd)return!1;a=a.$;return null===a||a.Bf||"Comment"===a.vd?!1:!0}return!1}var c=this.createNetwork();c.Tb=this;a instanceof D?(c.sk(a.ig,!0,b),c.sk(a.links,!0,b)):a instanceof V?c.sk(a.Oc,!1,b):c.sk(a.i,!1,b);return c};
    Z.prototype.doLayout=function(a){null===a&&w.k("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.Wf!==qv&&(this.qe=this.initialOrigin(this.qe));var b=this.g;null===b&&a instanceof D&&(b=a);this.Of=this.path===jv&&null!==b?b.Td?kv:rv:this.path===jv?kv:this.path;if(0<this.network.vertexes.count){this.network.gx();for(a=this.network.vertexes.i;a.next();)b=a.value,b.initialized=!1,b.level=
        0,b.parent=null,b.children=[];if(0<this.ud.count){a=new I(ov);for(b=this.ud.i;b.next();){var c=b.value;c instanceof T?(c=this.network.Bn(c),null!==c&&a.add(c)):c instanceof ov&&a.add(c)}this.ud=a}0===this.ud.count&&this.findRoots();for(a=this.ud.copy().i;a.next();)b=a.value,b.initialized||(b.initialized=!0,sv(this,b));b=this.network.vertexes;for(a=null;a=tv(b),0<a.count;)b=uv(this,a),null!==b&&this.ud.add(b),b.initialized=!0,sv(this,b),b=a;for(a=this.ud.i;a.next();)b=a.value,b instanceof ov&&vv(this,
        b);for(a=this.ud.i;a.next();)b=a.value,b instanceof ov&&wv(this,b);for(a=this.ud.i;a.next();)b=a.value,b instanceof ov&&xv(this,b);this.Uz();if(this.HA===yv){c=[];for(a=this.network.vertexes.i;a.next();){var d=a.value,b=d.parent;null===b&&(b=d);var b=0===b.angle||180===b.angle,e=c[d.level];void 0===e&&(e=0);c[d.level]=Math.max(e,b?d.width:d.height)}for(d=0;d<c.length;d++)void 0===c[d]&&(c[d]=0);this.UB=c;for(a=this.network.vertexes.i;a.next();)d=a.value,b=d.parent,null===b&&(b=d),0===b.angle||180===
    b.angle?(180===b.angle&&(d.Ut+=c[d.level]-d.width),d.width=c[d.level]):(270===b.angle&&(d.Vt+=c[d.level]-d.height),d.height=c[d.level])}else if(this.HA===zv)for(a=this.network.vertexes.i;a.next();){c=a.value;b=0===c.angle||180===c.angle;e=-1;for(d=0;d<c.children.length;d++)var f=c.children[d],e=Math.max(e,b?f.width:f.height);if(0<=e)for(d=0;d<c.children.length;d++)f=c.children[d],b?(180===c.angle&&(f.Ut+=e-f.width),f.width=e):(270===c.angle&&(f.Vt+=e-f.height),f.height=e)}for(a=this.ud.i;a.next();)b=
        a.value,b instanceof ov&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.ud=new I(Object);this.Df=!0};function tv(a){var b=new I(ov);for(a=a.i;a.next();){var c=a.value;c.initialized||b.add(c)}return b}
    Z.prototype.findRoots=function(){for(var a=this.network.vertexes,b=a.i;b.next();){var c=b.value;switch(this.Of){case kv:0===c.mc.count&&this.ud.add(c);break;case rv:0===c.kc.count&&this.ud.add(c);break;default:w.k("Unhandled path value "+this.Of.toString())}}0===this.ud.count&&(a=uv(this,a),null!==a&&this.ud.add(a))};
    function uv(a,b){for(var c=999999,d=null,e=b.i;e.next();){var f=e.value;switch(a.Of){case kv:f.mc.count<c&&(c=f.mc.count,d=f);break;case rv:f.kc.count<c&&(c=f.kc.count,d=f);break;default:w.k("Unhandled path value "+a.Of.toString())}}return d}
    function sv(a,b){if(null!==b){switch(a.Of){case kv:if(0<b.kc.count){for(var c=new H(ov),d=b.NH;d.next();){var e=d.value;Av(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.gc())}break;case rv:if(0<b.mc.count){c=new H(ov);for(d=b.JJ;d.next();)e=d.value,Av(a,b,e)&&c.add(e);0<c.count&&(b.children=c.gc())}break;default:w.k("Unhandled path value"+a.Of.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var f=c[e];f.initialized=!0;f.level=b.level+1;f.parent=b;a.ud.remove(f)}for(e=0;e<d;e++)f=c[e],sv(a,f)}}
    function Av(a,b,c){if(c.initialized){var d;if(null===b)d=!1;else{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}Z.prototype.removeChild=function(a,b){if(null!==a&&null!==b){for(var c=a.children,d=0,e=0;e<c.length;e++)c[e]===b&&d++;if(0<d){for(var d=Array(c.length-d),f=0,e=0;e<c.length;e++)c[e]!==b&&(d[f++]=c[e]);a.children=d}}};
    function vv(a,b){if(null!==b){a.initializeTreeVertexValues(b);b.alignment===Bv&&a.sortTreeVertexChildren(b);for(var c=0,d=b.rn,e=0,f=b.children,h=f.length,k=0;k<h;k++){var l=f[k];vv(a,l);c+=l.descendantCount+1;d=Math.max(d,l.maxChildrenCount);e=Math.max(e,l.maxGenerationCount)}b.descendantCount=c;b.maxChildrenCount=d;b.maxGenerationCount=0<d?e+1:0}}
    function Cv(a,b){switch(a.rt){default:case lv:return null!==b.parent?b.parent:a.va;case Dv:return null===b.parent?a.va:null===b.parent.parent?a.wa:b.parent;case Ev:return null!==b.parent?null!==b.parent.parent?b.parent.parent:a.wa:a.va;case Fv:var c=!0;if(0===b.rn)c=!1;else for(var d=b.children,e=d.length,f=0;f<e;f++)if(0<d[f].rn){c=!1;break}return c&&null!==b.parent?a.wa:null!==b.parent?b.parent:a.va}}
    Z.prototype.initializeTreeVertexValues=function(a){var b=Cv(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===Bv){for(var b=a.angle,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};function wv(a,b){if(null!==b){a.assignTreeVertexValues(b);for(var c=b.children,d=c.length,e=0;e<d;e++)wv(a,c[e])}}Z.prototype.assignTreeVertexValues=function(){};
    function xv(a,b){if(null!==b){b.alignment!==Bv&&a.sortTreeVertexChildren(b);for(var c=b.children,d=c.length,e=0;e<d;e++)xv(a,c[e])}}Z.prototype.sortTreeVertexChildren=function(a){switch(a.sorting){case Gv:break;case Hv:a.children.reverse();break;case Iv:a.children.sort(a.comparer);break;case Jv:a.children.sort(a.comparer);a.children.reverse();break;default:w.k("Unhandled sorting value "+a.sorting.toString())}};Z.prototype.Uz=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
    Z.prototype.addComments=function(a){var b=a.angle,c=a.parent,d=0,e=Kv,e=!1;null!==c&&(d=c.angle,e=c.alignment,e=Lv(e));var b=90===b||270===b,d=90===d||270===d,c=0===a.rn,f=0,h=0,k=0,l=a.commentSpacing;if(null!==a.Pc)for(var m=a.Pc.RE();m.next();){var n=m.value;"Comment"===n.vd&&n.canLayout()&&(null===a.comments&&(a.comments=[]),a.comments.push(n),n.Je(),n=n.za,b&&!c||!e&&!d&&c||e&&d&&c?(f=Math.max(f,n.width),h+=n.height+Math.abs(k)):(f+=n.width+Math.abs(k),h=Math.max(h,n.height)),k=l)}null!==a.comments&&
    (b&&!c||!e&&!d&&c||e&&d&&c?(f+=Math.abs(a.commentMargin),h=Math.max(0,h-a.height)):(h+=Math.abs(a.commentMargin),f=Math.max(0,f-a.width)),e=w.mg(0,0,a.M.width+f,a.M.height+h),a.gb=e,w.Db(e))};function Lv(a){return a===Mv||a===Bv||a===Nv||a===Ov}function Pv(a){return a===Mv||a===Bv}function Qv(a){var b=a.parent;if(null!==b){var c=b.alignment;if(Lv(c)){if(Pv(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===Nv)return!0}}return!1}
    Z.prototype.layoutComments=function(a){if(null!==a.comments){var b=a.Pc.za,c=a.parent,d=a.angle,e=0,f=Kv,f=!1;null!==c&&(e=c.angle,f=c.alignment,f=Lv(f));for(var c=90===d||270===d,d=90===e||270===e,h=0===a.rn,k=Qv(a),l=0,m=a.comments,n=m.length,p=w.K(),q=0;q<n;q++){var r=m[q],s=r.za;if(c&&!h||!f&&!d&&h||f&&d&&h){if(135<e&&!f||d&&k)if(0<=a.commentMargin)for(p.m(a.M.x-a.commentMargin-s.width,a.M.y+l),r.move(p),r=r.Og();r.next();){var u=r.value;u.Ab=Hc;u.Bb=Ic}else for(p.m(a.M.x+2*a.T.x-a.commentMargin,
        a.M.y+l),r.move(p),r=r.Og();r.next();)u=r.value,u.Ab=Ic,u.Bb=Hc;else if(0<=a.commentMargin)for(p.m(a.M.x+2*a.T.x+a.commentMargin,a.M.y+l),r.move(p),r=r.Og();r.next();)u=r.value,u.Ab=Ic,u.Bb=Hc;else for(p.m(a.M.x+a.commentMargin-s.width,a.M.y+l),r.move(p),r=r.Og();r.next();)u=r.value,u.Ab=Hc,u.Bb=Ic;l=0<=a.commentSpacing?l+(s.height+a.commentSpacing):l+(a.commentSpacing-s.height)}else{if(135<e&&!f||!d&&k)if(0<=a.commentMargin)for(p.m(a.M.x+l,a.M.y-a.commentMargin-s.height),r.move(p),r=r.Og();r.next();)u=
        r.value,u.Ab=Gc,u.Bb=Jc;else for(p.m(a.M.x+l,a.M.y+2*a.T.y-a.commentMargin),r.move(p),r=r.Og();r.next();)u=r.value,u.Ab=Jc,u.Bb=Gc;else if(0<=a.commentMargin)for(p.m(a.M.x+l,a.M.y+2*a.T.y+a.commentMargin),r.move(p),r=r.Og();r.next();)u=r.value,u.Ab=Jc,u.Bb=Gc;else for(p.m(a.M.x+l,a.M.y+a.commentMargin-s.height),r.move(p),r=r.Og();r.next();)u=r.value,u.Ab=Gc,u.Bb=Jc;l=0<=a.commentSpacing?l+(s.width+a.commentSpacing):l+(a.commentSpacing-s.width)}}w.v(p);b=l-a.commentSpacing-(c?b.height:b.width);if(this.Of===
        kv)for(e=a.kc;e.next();)a=e.value.link,null===a||a.$l||(a.Vl=0<b?b:NaN);else for(e=a.mc;e.next();)a=e.value.link,null===a||a.$l||(a.nm=0<b?b:NaN)}};
    Z.prototype.layoutTree=function(a){if(null!==a){for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case Rv:Sv(this,a);break;case Tv:if(a.alignment===Bv)Sv(this,a);else if(0===a.rn){var d=a.parent,b=!1,c=0,e=Kv;null!==d&&(c=d.angle,e=d.alignment,b=Lv(e));d=Qv(a);a.pa.m(0,0);a.kb.m(a.width,a.height);null===a.parent||null===a.comments||(180!==c&&270!==c||b)&&!d?a.Na.m(0,0):180===c&&!b||(90===c||270===c)&&d?a.Na.m(a.width-2*a.T.x,0):a.Na.m(0,a.height-2*a.T.y);a.lu=
        null;a.Fu=null}else{for(var f=Uv(a),b=90===f||270===f,h=0,k=a.children,l=k.length,m=0;m<l;m++)var n=k[m],h=Math.max(h,b?n.kb.width:n.kb.height);var p=a.alignment,d=p===Vv,q=p===Wv,r=Lv(p),s=Math.max(0,a.breadthLimit),c=Xv(a),u=a.nodeSpacing,t=Yv(a),x=a.rowSpacing,v=0;if(d||q||a.nq||a.oq&&1===a.maxGenerationCount)v=Math.max(0,a.rowIndent);var d=a.width,e=a.height,A=0,y=0,K=0,E=null,P=null,$=0,S=0,ba=0,ga=0,ya=0,Fa=0,eb=0,wa=0,n=0;r&&!Pv(p)&&135<f&&k.reverse();if(Pv(p))if(1<l)for(m=0;m<l;m++)0===m%
    2&&m!==l-1?wa=Math.max(wa,b?k[m].kb.width:k[m].kb.height):0!==m%2&&(n=Math.max(n,b?k[m].kb.width:k[m].kb.height));else 1===l&&(wa=b?k[0].kb.width:k[0].kb.height);if(r){switch(p){case Mv:y=135>f?Zv(a,k,wa,A,y):$v(a,k,wa,A,y);wa=y.x;A=y.width;y=y.height;break;case Nv:for(m=0;m<l;m++){var n=k[m],U=n.kb,E=0===Fa?0:x;b?(n.pa.m(h-U.width,ga+E),A=Math.max(A,U.width),y=Math.max(y,ga+E+U.height),ga+=E+U.height):(n.pa.m(ba+E,h-U.height),A=Math.max(A,ba+E+U.width),y=Math.max(y,U.height),ba+=E+U.width);Fa++}break;
        case Ov:for(m=0;m<l;m++)n=k[m],U=n.kb,E=0===Fa?0:x,b?(n.pa.m(u/2+a.T.x,ga+E),A=Math.max(A,U.width),y=Math.max(y,ga+E+U.height),ga+=E+U.height):(n.pa.m(ba+E,u/2+a.T.y),A=Math.max(A,ba+E+U.width),y=Math.max(y,U.height),ba+=E+U.width),Fa++}E=aw(this,2);P=aw(this,2);b?(E[0].m(0,0),E[1].m(0,y),P[0].m(A,0)):(E[0].m(0,0),E[1].m(A,0),P[0].m(0,y));P[1].m(A,y)}else for(m=0;m<l;m++){n=k[m];U=n.kb;if(b){0<s&&0<Fa&&ba+u+U.width>s&&(ba<h&&Gw(a,p,h-ba,0,eb,m-1),ya++,Fa=0,eb=m,K=y,ba=0,ga=135<f?-y-x:y+x);Hw(this,
        n,0,ga);var sb=0;if(0===Fa){if(E=n.lu,P=n.Fu,$=U.width,S=U.height,null===E||null===P||f!==Uv(n))E=aw(this,2),P=aw(this,2),E[0].m(0,0),E[1].m(0,S),P[0].m($,0),P[1].m($,S)}else{var Kb=w.cb(),S=Iw(this,a,n,E,P,$,S,Kb),sb=S.x,E=Kb[0],P=Kb[1],$=S.width,S=S.height;w.ta(Kb);ba<U.width&&0>sb&&(Jw(a,-sb,0,eb,m-1),Kw(E,-sb,0),Kw(P,-sb,0),sb=0)}n.pa.m(sb,ga);A=Math.max(A,$);y=Math.max(y,K+(0===ya?0:x)+U.height);ba=$}else{0<s&&0<Fa&&ga+u+U.height>s&&(ga<h&&Gw(a,p,0,h-ga,eb,m-1),ya++,Fa=0,eb=m,K=A,ga=0,ba=135<
    f?-A-x:A+x);Hw(this,n,ba,0);sb=0;if(0===Fa){if(E=n.lu,P=n.Fu,$=U.width,S=U.height,null===E||null===P||f!==Uv(n))E=aw(this,2),P=aw(this,2),E[0].m(0,0),E[1].m($,0),P[0].m(0,S),P[1].m($,S)}else Kb=w.cb(),S=Iw(this,a,n,E,P,$,S,Kb),sb=S.x,E=Kb[0],P=Kb[1],$=S.width,S=S.height,w.ta(Kb),ga<U.height&&0>sb&&(Jw(a,0,-sb,eb,m-1),Kw(E,0,-sb),Kw(P,0,-sb),sb=0);n.pa.m(ba,sb);y=Math.max(y,S);A=Math.max(A,K+(0===ya?0:x)+U.width);ga=S}Fa++}0<ya&&(b?(y+=Math.max(0,c),ba<A&&Gw(a,p,A-ba,0,eb,l-1),0<v&&(q||Jw(a,v,0,0,
        l-1),A+=v)):(A+=Math.max(0,c),ga<y&&Gw(a,p,0,y-ga,eb,l-1),0<v&&(q||Jw(a,0,v,0,l-1),y+=v)));v=q=0;switch(p){case Lw:b?q+=A/2-a.T.x-t/2:v+=y/2-a.T.y-t/2;break;case Kv:0<ya?b?q+=A/2-a.T.x-t/2:v+=y/2-a.T.y-t/2:b?(wa=k[0].pa.x+k[0].Na.x,m=k[l-1].pa.x+k[l-1].Na.x+2*k[l-1].T.x,q+=wa+(m-wa)/2-a.T.x-t/2):(wa=k[0].pa.y+k[0].Na.y,m=k[l-1].pa.y+k[l-1].Na.y+2*k[l-1].T.y,v+=wa+(m-wa)/2-a.T.y-t/2);break;case Vv:b?(q-=t,A+=t):(v-=t,y+=t);break;case Wv:b?(q+=A-a.width+t,A+=t):(v+=y-a.height+t,y+=t);break;case Mv:b?
        q=1<l?q+(wa+u/2-a.T.x):q+(k[0].T.x-a.T.x+k[0].Na.x):v=1<l?v+(wa+u/2-a.T.y):v+(k[0].T.y-a.T.y+k[0].Na.y);break;case Nv:b?q+=A+u/2-a.T.x:v+=y+u/2-a.T.y;break;case Ov:break;default:w.k("Unhandled alignment value "+p.toString())}for(m=0;m<l;m++)n=k[m],b?n.pa.m(n.pa.x+n.Na.x-q,n.pa.y+(135<f?(r?-y:-n.kb.height)+n.Na.y-c:e+c+n.Na.y)):n.pa.m(n.pa.x+(135<f?(r?-A:-n.kb.width)+n.Na.x-c:d+c+n.Na.x),n.pa.y+n.Na.y-v);l=k=0;r?b?(A=Mw(a,A,q),0>q&&(q=0),135<f&&(v+=y+c),y+=e+c,p===Ov&&(k+=u/2+a.T.x),l+=e+c):(135<f&&
    (q+=A+c),A+=d+c,y=Nw(a,y,v),0>v&&(v=0),p===Ov&&(l+=u/2+a.T.y),k+=d+c):b?(null===a.comments?d>A&&(p=Ow(p,d-A,0),k=p.x,l=p.y,A=d,q=0):A=Mw(a,A,q),0>q&&(k-=q,q=0),135<f&&(v+=y+c),y=Math.max(Math.max(y,e),y+e+c),l+=e+c):(135<f&&(q+=A+c),A=Math.max(Math.max(A,d),A+d+c),null===a.comments?e>y&&(p=Ow(p,0,e-y),k=p.x,l=p.y,y=e,v=0):y=Nw(a,y,v),0>v&&(l-=v,v=0),k+=d+c);if(0<ya)f=aw(this,4),p=aw(this,4),b?(f[2].m(0,e+c),f[3].m(f[2].x,y),p[2].m(A,f[2].y),p[3].m(p[2].x,f[3].y)):(f[2].m(d+c,0),f[3].m(A,f[2].y),p[2].m(f[2].x,
        y),p[3].m(f[3].x,p[2].y));else{f=aw(this,E.length+2);p=aw(this,P.length+2);for(m=0;m<E.length;m++)r=E[m],f[m+2].m(r.x+k,r.y+l);for(m=0;m<P.length;m++)r=P[m],p[m+2].m(r.x+k,r.y+l)}b?(f[0].m(q,0),f[1].m(f[0].x,e),f[2].y<f[1].y&&(f[2].x>f[0].x?f[2].assign(f[1]):f[1].assign(f[2])),f[3].y<f[2].y&&(f[3].x>f[0].x?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(q+d,0),p[1].m(p[0].x,e),p[2].y<p[1].y&&(p[2].x<p[0].x?p[2].assign(p[1]):p[1].assign(p[2])),p[3].y<p[2].y&&(p[3].x<p[0].x?p[3].assign(p[2]):p[2].assign(p[3])),
        f[2].y-=c/2,p[2].y-=c/2):(f[0].m(0,v),f[1].m(d,f[0].y),f[2].x<f[1].x&&(f[2].y>f[0].y?f[2].assign(f[1]):f[1].assign(f[2])),f[3].x<f[2].x&&(f[3].y>f[0].y?f[3].assign(f[2]):f[2].assign(f[3])),p[0].m(0,v+e),p[1].m(d,p[0].y),p[2].x<p[1].x&&(p[2].y<p[0].y?p[2].assign(p[1]):p[1].assign(p[2])),p[3].x<p[2].x&&(p[3].y<p[0].y?p[3].assign(p[2]):p[2].assign(p[3])),f[2].x-=c/2,p[2].x-=c/2);Pw(this,E);Pw(this,P);a.lu=f;a.Fu=p;a.Na.m(q,v);a.kb.m(A,y)}break;default:w.k("Unhandled compaction value "+a.compaction.toString())}}};
    function Sv(a,b){if(0===b.rn){var c=!1,d=0,e=Kv;null!==b.parent&&(d=b.parent.angle,e=b.parent.alignment,c=Lv(e));e=Qv(b);b.pa.m(0,0);b.kb.m(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.Na.m(0,0):180===d&&!c||(90===d||270===d)&&e?b.Na.m(b.width-2*b.T.x,0):b.Na.m(0,b.height-2*b.T.y)}else{for(var c=Uv(b),d=90===c||270===c,f=0,e=b.children,h=e.length,k=0;k<h;k++)var l=e[k],f=Math.max(f,d?l.kb.width:l.kb.height);var m=b.alignment,n=m===Vv,p=m===Wv,q=Lv(m),r=Math.max(0,
        b.breadthLimit),s=Xv(b),u=b.nodeSpacing,t=Yv(b),x=n||p?0:t/2,v=b.rowSpacing,A=0;if(n||p||b.nq||b.oq&&1===b.maxGenerationCount)A=Math.max(0,b.rowIndent);var n=b.width,y=b.height,K=0,E=0,P=0,$=0,S=0,ba=0,ga=0,ya=0,Fa=0,eb=0;q&&!Pv(m)&&135<c&&e.reverse();if(Pv(m))if(1<h)for(k=0;k<h;k++){var l=e[k],wa=l.kb;0===k%2&&k!==h-1?Fa=Math.max(Fa,(d?wa.width:wa.height)+Qw(l)-u):0!==k%2&&(eb=Math.max(eb,(d?wa.width:wa.height)+Qw(l)-u))}else 1===h&&(Fa=d?e[0].kb.width:e[0].kb.height);if(q)switch(m){case Mv:case Bv:E=
        135>c?Zv(b,e,Fa,K,E):$v(b,e,Fa,K,E);Fa=E.x;K=E.width;E=E.height;break;case Nv:for(k=0;k<h;k++)l=e[k],wa=l.kb,r=0===ga?0:v,d?(l.pa.m(f-wa.width,S+r),K=Math.max(K,wa.width),E=Math.max(E,S+r+wa.height),S+=r+wa.height):(l.pa.m($+r,f-wa.height),K=Math.max(K,$+r+wa.width),E=Math.max(E,wa.height),$+=r+wa.width),ga++;break;case Ov:for(f=0;f<h;f++)l=e[f],wa=l.kb,r=0===ga?0:v,d?(l.pa.m(u/2+b.T.x,S+r),K=Math.max(K,wa.width),E=Math.max(E,S+r+wa.height),S+=r+wa.height):(l.pa.m($+r,u/2+b.T.y),K=Math.max(K,$+r+
        wa.width),E=Math.max(E,wa.height),$+=r+wa.width),ga++}else for(k=0;k<h;k++)l=e[k],wa=l.kb,d?(0<r&&0<ga&&$+u+wa.width>r&&($<f&&Gw(b,m,f-$,0,ya,k-1),ba++,ga=0,ya=k,P=E,$=0,S=135<c?-E-v:E+v),eb=0===ga?x:u,Hw(a,l,0,S),l.pa.m($+eb,S),K=Math.max(K,$+eb+wa.width),E=Math.max(E,P+(0===ba?0:v)+wa.height),$+=eb+wa.width):(0<r&&0<ga&&S+u+wa.height>r&&(S<f&&Gw(b,m,0,f-S,ya,k-1),ba++,ga=0,ya=k,P=K,S=0,$=135<c?-K-v:K+v),eb=0===ga?x:u,Hw(a,l,$,0),l.pa.m($,S+eb),E=Math.max(E,S+eb+wa.height),K=Math.max(K,P+(0===ba?
            0:v)+wa.width),S+=eb+wa.height),ga++;0<ba&&(d?(E+=Math.max(0,s),$<K&&Gw(b,m,K-$,0,ya,h-1),0<A&&(p||Jw(b,A,0,0,h-1),K+=A)):(K+=Math.max(0,s),S<E&&Gw(b,m,0,E-S,ya,h-1),0<A&&(p||Jw(b,0,A,0,h-1),E+=A)));A=p=0;switch(m){case Lw:d?p+=K/2-b.T.x-t/2:A+=E/2-b.T.y-t/2;break;case Kv:0<ba?d?p+=K/2-b.T.x-t/2:A+=E/2-b.T.y-t/2:d?(m=e[0].pa.x+e[0].Na.x,u=e[h-1].pa.x+e[h-1].Na.x+2*e[h-1].T.x,p+=m+(u-m)/2-b.T.x-t/2):(m=e[0].pa.y+e[0].Na.y,u=e[h-1].pa.y+e[h-1].Na.y+2*e[h-1].T.y,A+=m+(u-m)/2-b.T.y-t/2);break;case Vv:d?
        (p-=t,K+=t):(A-=t,E+=t);break;case Wv:d?(p+=K-b.width+t,K+=t):(A+=E-b.height+t,E+=t);break;case Mv:case Bv:d?p=1<h?p+(Fa+u/2-b.T.x):p+(e[0].T.x-b.T.x+e[0].Na.x):A=1<h?A+(Fa+u/2-b.T.y):A+(e[0].T.y-b.T.y+e[0].Na.y);break;case Nv:d?p+=K+u/2-b.T.x:A+=E+u/2-b.T.y;break;case Ov:break;default:w.k("Unhandled alignment value "+m.toString())}for(k=0;k<h;k++)l=e[k],d?l.pa.m(l.pa.x+l.Na.x-p,l.pa.y+(135<c?(q?-E:-l.kb.height)+l.Na.y-s:y+s+l.Na.y)):l.pa.m(l.pa.x+(135<c?(q?-K:-l.kb.width)+l.Na.x-s:n+s+l.Na.x),l.pa.y+
        l.Na.y-A);d?(K=Mw(b,K,p),0>p&&(p=0),135<c&&(A+=E+s),E+=y+s):(135<c&&(p+=K+s),K+=n+s,E=Nw(b,E,A),0>A&&(A=0));b.Na.m(p,A);b.kb.m(K,E)}}
    function Zv(a,b,c,d,e){var f=b.length;if(0===f)return new B(c,0,d,e);if(1===f){var h=b[0];d=h.kb.width;e=h.kb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===Uv(a),n=0,p=0,q=0,r=0;r<f;r++)if(!(0!==r%2||1<f&&r===f-1)){var h=b[r],s=h.kb,u=0===n?0:l;if(m){var t=Qw(h)-k;h.pa.m(c-(s.width+t),q+u);d=Math.max(d,s.width+t);e=Math.max(e,q+u+s.height);q+=u+s.height}else t=Qw(h)-k,h.pa.m(p+u,c-(s.height+t)),e=Math.max(e,s.height+t),d=Math.max(d,p+u+s.width),p+=u+s.width;n++}var n=
        0,x=p,v=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<f;r++)0!==r%2&&(h=b[r],s=h.kb,u=0===n?0:l,m?(t=Qw(h)-k,h.pa.m(p+t,q+u),d=Math.max(d,p+s.width+t),e=Math.max(e,q+u+s.height),q+=u+s.height):(t=Qw(h)-k,h.pa.m(p+u,q+t),d=Math.max(d,p+u+s.width),e=Math.max(e,q+s.height+t),p+=u+s.width),n++);1<f&&1===f%2&&(h=b[f-1],s=h.kb,b=Rw(h,m?Math.max(Math.abs(v),Math.abs(q)):Math.max(Math.abs(x),Math.abs(p))),m?(h.pa.m(c+k/2-h.T.x-h.Na.x,e+b),m=c+k/2-h.T.x-h.Na.x,d=Math.max(d,m+s.width),0>m&&(d-=m),e=Math.max(e,Math.max(v,
            q)+b+s.height),0>h.pa.x&&(c=Sw(a,h.pa.x,!1,c,k))):(h.pa.m(d+b,c+k/2-h.T.y-h.Na.y),d=Math.max(d,Math.max(x,p)+b+s.width),m=c+k/2-h.T.y-h.Na.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.pa.y&&(c=Sw(a,h.pa.y,!0,c,k))));return new B(c,0,d,e)}
    function $v(a,b,c,d,e){var f=b.length;if(0===f)return new B(c,0,d,e);if(1===f){var h=b[0];d=h.kb.width;e=h.kb.height;return new B(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===Uv(a),n=0,p=0,q=0,r=0;r<f;r++)if(!(0!==r%2||1<f&&r===f-1)){var h=b[r],s=h.kb,u=0===n?0:l;if(m){var t=Qw(h)-k,q=q-(u+s.height);h.pa.m(c-(s.width+t),q);d=Math.max(d,s.width+t);e=Math.max(e,Math.abs(q))}else t=Qw(h)-k,p-=u+s.width,h.pa.m(p,c-(s.height+t)),e=Math.max(e,s.height+t),d=Math.max(d,Math.abs(p));n++}var n=0,
        x=p,v=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<f;r++)0!==r%2&&(h=b[r],s=h.kb,u=0===n?0:l,m?(t=Qw(h)-k,q-=u+s.height,h.pa.m(p+t,q),d=Math.max(d,p+s.width+t),e=Math.max(e,Math.abs(q))):(t=Qw(h)-k,p-=u+s.width,h.pa.m(p,q+t),e=Math.max(e,q+s.height+t),d=Math.max(d,Math.abs(p))),n++);1<f&&1===f%2&&(h=b[f-1],s=h.kb,l=Rw(h,m?Math.max(Math.abs(v),Math.abs(q)):Math.max(Math.abs(x),Math.abs(p))),m?(h.pa.m(c+k/2-h.T.x-h.Na.x,-e-s.height-l),p=c+k/2-h.T.x-h.Na.x,d=Math.max(d,p+s.width),0>p&&(d-=p),e=Math.max(e,Math.abs(Math.min(v,
            q))+l+s.height),0>h.pa.x&&(c=Sw(a,h.pa.x,!1,c,k))):(h.pa.m(-d-s.width-l,c+k/2-h.T.y-h.Na.y),d=Math.max(d,Math.abs(Math.min(x,p))+l+s.width),p=c+k/2-h.T.y-h.Na.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.pa.y&&(c=Sw(a,h.pa.y,!0,c,k))));for(r=0;r<f;r++)h=b[r],m?h.pa.m(h.pa.x,h.pa.y+e):h.pa.m(h.pa.x+d,h.pa.y);return new B(c,0,d,e)}function Qw(a){return null===a.parent?0:a.parent.nodeSpacing}function Rw(a){return null===a.parent?0:a.parent.rowSpacing}
    function Sw(a,b,c,d,e){a=a.children;for(var f=a.length,h=0;h<f;h++)c?a[h].pa.m(a[h].pa.x,a[h].pa.y-b):a[h].pa.m(a[h].pa.x-b,a[h].pa.y);b=a[f-1];return Math.max(d,c?b.Na.y+b.T.y-e/2:b.Na.x+b.T.x-e/2)}
    function Mw(a,b,c){switch(a.alignment){case Kv:case Lw:var d=b;c+a.width>d&&(d=c+a.width);0>c&&(d-=c);return d;case Vv:return a.width>b?a.width:b;case Wv:return 2*a.T.x>b?a.width:b+a.width-2*a.T.x;case Mv:case Bv:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Nv:return a.width-a.T.x+a.nodeSpacing/2+b;case Ov:return Math.max(a.width,a.T.x+a.nodeSpacing/2+b);default:return b}}
    function Nw(a,b,c){switch(a.alignment){case Kv:case Lw:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case Vv:return a.height>b?a.height:b;case Wv:return 2*a.T.y>b?a.height:b+a.height-2*a.T.y;case Mv:case Bv:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Nv:return a.height-a.T.y+a.nodeSpacing/2+b;case Ov:return Math.max(a.height,a.T.y+a.nodeSpacing/2+b);default:return b}}
    function Ow(a,b,c){switch(a){case Lw:b/=2;c/=2;break;case Kv:b/=2;c/=2;break;case Vv:c=b=0;break;case Wv:break;default:w.k("Unhandled alignment value "+a.toString())}return new z(b,c)}function Gw(a,b,c,d,e,f){b=Ow(b,c,d);Jw(a,b.x,b.y,e,f)}function Jw(a,b,c,d,e){if(0!==b||0!==c)for(a=a.children;d<=e;d++){var f=a[d].pa;f.x+=b;f.y+=c}}
    function Hw(a,b,c,d){var e=b.parent;switch(a.Of){case kv:for(a=b.mc;a.next();)b=a.value,b.fromVertex===e&&b.Is.m(c,d);break;case rv:for(a=b.kc;a.next();)b=a.value,b.toVertex===e&&b.Is.m(c,d);break;default:w.k("Unhandled path value "+a.Of.toString())}}function Kw(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
    function Iw(a,b,c,d,e,f,h,k){var l=Uv(b),m=90===l||270===l,n=b.nodeSpacing;b=d;var p=e;d=f;e=h;var q=c.lu,r=c.Fu;h=c.kb;var s=m?Math.max(e,h.height):Math.max(d,h.width);if(null===q||l!==Uv(c))q=aw(a,2),r=aw(a,2),m?(q[0].m(0,0),q[1].m(0,h.height),r[0].m(h.width,0),r[1].m(r[0].x,q[1].y)):(q[0].m(0,0),q[1].m(h.width,0),r[0].m(0,h.height),r[1].m(q[1].x,r[0].y));if(m){c=d;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=l=0;l<p.length&&m<q.length;){e=p[l];var u=q[m];f=u.x;var t=u.y;f+=
        c;var x=e;l+1<p.length&&(x=p[l+1]);var v=u,u=v.x,v=v.y;m+1<q.length&&(v=q[m+1],u=v.x,v=v.y,u+=c);var A=d;e.y===t?A=f-e.x:e.y>t&&e.y<v?A=f+(e.y-t)/(v-t)*(u-f)-e.x:t>e.y&&t<x.y&&(A=f-(e.x+(t-e.y)/(x.y-e.y)*(x.x-e.x)));A<d&&(d=A);x.y<=e.y?l++:v<=t?m++:(x.y<=v&&l++,v<=x.y&&m++)}c-=d;c+=n;l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=aw(a,b.length+l.length);for(d=f=e=0;f<l.length&&l[f].y<b[0].y;)t=l[f++],n[d++].m(t.x+m,t.y);for(;e<b.length;)t=b[e++],n[d++].m(t.x,t.y);for(e=b[b.length-
    1].y;f<l.length&&l[f].y<=e;)f++;for(;f<l.length&&l[f].y>e;)t=l[f++],n[d++].m(t.x+m,t.y);l=aw(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);Pw(a,n);d=l}f=r;t=c;if(null===p||2>p.length||null===f||2>f.length)e=null;else{n=aw(a,p.length+f.length);for(m=x=l=0;l<p.length&&p[l].y<f[0].y;)e=p[l++],n[m++].m(e.x,e.y);for(;x<f.length;)e=f[x++],n[m++].m(e.x+t,e.y);for(f=f[f.length-1].y;l<p.length&&p[l].y<=f;)l++;for(;l<p.length&&p[l].y>f;)e=p[l++],n[m++].m(e.x,e.y);e=aw(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);Pw(a,n)}f=
        Math.max(0,c)+h.width;h=s}else{c=e;d=9999999;if(!(null===p||2>p.length||null===q||2>q.length))for(m=l=0;l<p.length&&m<q.length;)e=p[l],u=q[m],f=u.x,t=u.y,t+=c,x=e,l+1<p.length&&(x=p[l+1]),v=u,u=v.x,v=v.y,m+1<q.length&&(v=q[m+1],u=v.x,v=v.y,v+=c),A=d,e.x===f?A=t-e.y:e.x>f&&e.x<u?A=t+(e.x-f)/(u-f)*(v-t)-e.y:f>e.x&&f<x.x&&(A=t-(e.y+(f-e.x)/(x.x-e.x)*(x.y-e.y))),A<d&&(d=A),x.x<=e.x?l++:u<=f?m++:(x.x<=u&&l++,u<=x.x&&m++);c-=d;c+=n;l=q;m=c;if(null===b||2>b.length||null===l||2>l.length)d=null;else{n=aw(a,
        b.length+l.length);for(d=f=e=0;f<l.length&&l[f].x<b[0].x;)t=l[f++],n[d++].m(t.x,t.y+m);for(;e<b.length;)t=b[e++],n[d++].m(t.x,t.y);for(e=b[b.length-1].x;f<l.length&&l[f].x<=e;)f++;for(;f<l.length&&l[f].x>e;)t=l[f++],n[d++].m(t.x,t.y+m);l=aw(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);Pw(a,n);d=l}f=r;t=c;if(null===p||2>p.length||null===f||2>f.length)e=null;else{n=aw(a,p.length+f.length);for(m=x=l=0;l<p.length&&p[l].x<f[0].x;)e=p[l++],n[m++].m(e.x,e.y);for(;x<f.length;)e=f[x++],n[m++].m(e.x,e.y+t);for(f=
                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                f[f.length-1].x;l<p.length&&p[l].x<=f;)l++;for(;l<p.length&&p[l].x>f;)e=p[l++],n[m++].m(e.x,e.y);e=aw(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);Pw(a,n)}f=s;h=Math.max(0,c)+h.height}Pw(a,b);Pw(a,q);Pw(a,p);Pw(a,r);k[0]=d;k[1]=e;return new B(c,0,f,h)}function aw(a,b){var c=a.Iz[b];if(void 0!==c&&(c=c.pop(),void 0!==c))return c;for(var c=[],d=0;d<b;d++)c[d]=new z;return c}function Pw(a,b){var c=b.length,d=a.Iz[c];void 0===d&&(d=[],a.Iz[c]=d);d.push(b)}
    Z.prototype.arrangeTrees=function(){if(this.nd===qv)for(var a=this.ud.i;a.next();){var b=a.value;if(b instanceof ov){var c=b.Pc;if(null!==c){var d=c.position,c=d.x,d=d.y;isFinite(c)||(c=0);isFinite(d)||(d=0);Tw(this,b,c,d)}}}else{c=[];for(a=this.ud.i;a.next();)b=a.value,b instanceof ov&&c.push(b);switch(this.sorting){case Gv:break;case Hv:c.reverse();break;case Iv:c.sort(this.comparer);break;case Jv:c.sort(this.comparer);c.reverse();break;default:w.k("Unhandled sorting value "+this.sorting.toString())}b=
        this.qe;a=b.x;b=b.y;for(d=0;d<c.length;d++){var e=c[d];Tw(this,e,a+e.Na.x,b+e.Na.y);switch(this.nd){case nv:b+=e.kb.height+this.og.height;break;case Uw:a+=e.kb.width+this.og.width;break;default:w.k("Unhandled arrangement value "+this.nd.toString())}}}};function Tw(a,b,c,d){if(null!==b){b.x=c;b.y=d;b=b.children;for(var e=b.length,f=0;f<e;f++){var h=b[f];Tw(a,h,c+h.pa.x,d+h.pa.y)}}}Z.prototype.commitLayout=function(){this.nB();this.commitNodes();this.Zz();this.ju&&this.commitLinks()};
    Z.prototype.commitNodes=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)};
    Z.prototype.Zz=function(){if(this.HA===yv){for(var a=this.UB,b=[],c=null,d=this.network.vertexes.i;d.next();){var e=d.value;null===c?c=e.gb.copy():c.Jh(e.gb);var f=b[e.level],f=void 0===f?Xv(e):Math.max(f,Xv(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.Af(this.nodeSpacing/2,this.layerSpacing),e=new z(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.Af(this.layerSpacing,this.nodeSpacing/2),e=new z(-this.layerSpacing/2,-this.nodeSpacing/2));var f=
        [],c=90===this.angle||270===this.angle?c.width:c.height,h=0;if(180===this.angle||270===this.angle)for(d=0;d<a.length;d++)h+=a[d]+b[d];for(d=0;d<a.length;d++){var k=a[d]+b[d];270===this.angle?(h-=k,f.push(new B(0,h,c,k))):90===this.angle?(f.push(new B(0,h,c,k)),h+=k):180===this.angle?(h-=k,f.push(new B(h,0,k,c))):(f.push(new B(h,0,k,c)),h+=k)}this.commitLayers(f,e)}};Z.prototype.commitLayers=function(){};Z.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
    Z.prototype.nB=function(){for(var a=this.ud.i;a.next();){var b=a.value;b instanceof ov&&Vw(this,b)}};function Vw(a,b){if(null!==b){a.setPortSpots(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Vw(a,c[e])}}
    Z.prototype.setPortSpots=function(a){var b=a.alignment;if(Lv(b)){var c=this.Of===kv,d=Uv(a),e;switch(d){case 0:e=Ic;break;case 90:e=Jc;break;case 180:e=Hc;break;default:e=Gc}var f=a.children,h=f.length;switch(b){case Mv:case Bv:for(b=0;b<h;b++){var k=f[b],k=(c?k.mc:k.kc).first();if(null!==k&&(k=k.link,null!==k)){var l=90===d||270===d?Hc:Gc;if(1===h||b===h-1&&1===h%2)switch(d){case 0:l=Hc;break;case 90:l=Gc;break;case 180:l=Ic;break;default:l=Jc}else 0===b%2&&(l=90===d||270===d?Ic:Jc);c?(a.setsPortSpot&&
    (k.Ab=e),a.setsChildPortSpot&&(k.Bb=l)):(a.setsPortSpot&&(k.Ab=l),a.setsChildPortSpot&&(k.Bb=e))}}break;case Nv:l=90===d||270===d?Ic:Jc;for(d=c?a.kc:a.mc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.Ab=e),a.setsChildPortSpot&&(k.Bb=l)):(a.setsPortSpot&&(k.Ab=l),a.setsChildPortSpot&&(k.Bb=e)));break;case Ov:for(l=90===d||270===d?Hc:Gc,d=c?a.kc:a.mc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.Ab=e),a.setsChildPortSpot&&(k.Bb=l)):(a.setsPortSpot&&(k.Ab=l),a.setsChildPortSpot&&
    (k.Bb=e)))}}else if(c=Uv(a),this.Of===kv)for(e=a.kc;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Xc())switch(c){case 0:d.Ab=Ic;break;case 90:d.Ab=Jc;break;case 180:d.Ab=Hc;break;default:d.Ab=Gc}else d.Ab=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xc())switch(c){case 0:d.Bb=Hc;break;case 90:d.Bb=Gc;break;case 180:d.Bb=Ic;break;default:d.Bb=Jc}else d.Bb=a.childPortSpot}}else for(e=a.mc;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.Xc())switch(c){case 0:d.Bb=
        Ic;break;case 90:d.Bb=Jc;break;case 180:d.Bb=Hc;break;default:d.Bb=Gc}else d.Bb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.Xc())switch(c){case 0:d.Ab=Hc;break;case 90:d.Ab=Gc;break;case 180:d.Ab=Ic;break;default:d.Ab=Jc}else d.Ab=a.childPortSpot}};function Uv(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}
    function Xv(a){var b=Uv(a),b=90===b||270===b,c=a.layerSpacing;if(0<a.layerSpacingParentOverlap)var d=Math.min(1,a.layerSpacingParentOverlap),c=c-(b?a.height*d:a.width*d);c<(b?-a.height:-a.width)&&(c=b?-a.height:-a.width);return c}function Yv(a){var b=Uv(a),b=90===b||270===b,c=a.nodeIndent;if(0<a.nodeIndentPastParent)var d=Math.min(1,a.nodeIndentPastParent),c=c+(b?a.width*d:a.height*d);return c=Math.max(0,c)}
    w.defineProperty(Z,{KL:"roots"},function(){return this.ud},function(a){this.ud!==a&&(w.G(a,I,Z,"roots"),this.ud=a,this.J())});w.defineProperty(Z,{path:"path"},function(){return this.Bs},function(a){this.Bs!==a&&(w.mb(a,Z,Z,"path"),this.Bs=a,this.J())});w.defineProperty(Z,{VJ:"treeStyle"},function(){return this.rt},function(a){this.nd!==a&&(w.mb(a,Z,Z,"treeStyle"),a===lv||a===Ev||a===Fv||a===Dv)&&(this.rt=a,this.J())});
    w.defineProperty(Z,{HA:"layerStyle"},function(){return this.Vv},function(a){this.nd!==a&&(w.mb(a,Z,Z,"layerStyle"),a===mv||a===zv||a===yv)&&(this.Vv=a,this.J())});w.defineProperty(Z,{comments:"comments"},function(){return this.Lh},function(a){this.Lh!==a&&(w.j(a,"boolean",Z,"comments"),this.Lh=a,this.J())});w.defineProperty(Z,{Wf:"arrangement"},function(){return this.nd},function(a){this.nd!==a&&(w.mb(a,Z,Z,"arrangement"),a===nv||a===Uw||a===qv)&&(this.nd=a,this.J())});
    w.defineProperty(Z,{tE:"arrangementSpacing"},function(){return this.og},function(a){w.G(a,ia,Z,"arrangementSpacing");this.og.L(a)||(this.og.assign(a),this.J())});w.defineProperty(Z,{JL:"rootDefaults"},function(){return this.va},function(a){this.va!==a&&(w.G(a,ov,Z,"rootDefaults"),this.va=a,this.J())});w.defineProperty(Z,{nK:"alternateDefaults"},function(){return this.wa},function(a){this.wa!==a&&(w.G(a,ov,Z,"alternateDefaults"),this.wa=a,this.J())});
    w.defineProperty(Z,{sorting:"sorting"},function(){return this.va.sorting},function(a){this.va.sorting!==a&&(w.mb(a,Z,Z,"sorting"),a===Gv||a===Hv||a===Iv||Jv)&&(this.va.sorting=a,this.J())});w.defineProperty(Z,{comparer:"comparer"},function(){return this.va.comparer},function(a){this.va.comparer!==a&&(w.j(a,"function",Z,"comparer"),this.va.comparer=a,this.J())});
    w.defineProperty(Z,{angle:"angle"},function(){return this.va.angle},function(a){this.va.angle!==a&&(w.j(a,"number",Z,"angle"),0===a||90===a||180===a||270===a?(this.va.angle=a,this.J()):w.k("TreeLayout.angle must be 0, 90, 180, or 270"))});w.defineProperty(Z,{alignment:"alignment"},function(){return this.va.alignment},function(a){this.va.alignment!==a&&(w.mb(a,Z,Z,"alignment"),this.va.alignment=a,this.J())});
    w.defineProperty(Z,{nodeIndent:"nodeIndent"},function(){return this.va.nodeIndent},function(a){this.va.nodeIndent!==a&&(w.j(a,"number",Z,"nodeIndent"),0<=a&&(this.va.nodeIndent=a,this.J()))});w.defineProperty(Z,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.va.nodeIndentPastParent},function(a){this.va.nodeIndentPastParent!==a&&(w.j(a,"number",Z,"nodeIndentPastParent"),0<=a&&1>=a&&(this.va.nodeIndentPastParent=a,this.J()))});
    w.defineProperty(Z,{nodeSpacing:"nodeSpacing"},function(){return this.va.nodeSpacing},function(a){this.va.nodeSpacing!==a&&(w.j(a,"number",Z,"nodeSpacing"),this.va.nodeSpacing=a,this.J())});w.defineProperty(Z,{layerSpacing:"layerSpacing"},function(){return this.va.layerSpacing},function(a){this.va.layerSpacing!==a&&(w.j(a,"number",Z,"layerSpacing"),this.va.layerSpacing=a,this.J())});
    w.defineProperty(Z,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.va.layerSpacingParentOverlap},function(a){this.va.layerSpacingParentOverlap!==a&&(w.j(a,"number",Z,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.va.layerSpacingParentOverlap=a,this.J()))});w.defineProperty(Z,{compaction:"compaction"},function(){return this.va.compaction},function(a){this.va.compaction!==a&&(w.mb(a,Z,Z,"compaction"),a===Rv||a===Tv)&&(this.va.compaction=a,this.J())});
    w.defineProperty(Z,{breadthLimit:"breadthLimit"},function(){return this.va.breadthLimit},function(a){this.va.breadthLimit!==a&&(w.j(a,"number",Z,"breadthLimit"),0<=a&&(this.va.breadthLimit=a,this.J()))});w.defineProperty(Z,{rowSpacing:"rowSpacing"},function(){return this.va.rowSpacing},function(a){this.va.rowSpacing!==a&&(w.j(a,"number",Z,"rowSpacing"),this.va.rowSpacing=a,this.J())});
    w.defineProperty(Z,{rowIndent:"rowIndent"},function(){return this.va.rowIndent},function(a){this.va.rowIndent!==a&&(w.j(a,"number",Z,"rowIndent"),0<=a&&(this.va.rowIndent=a,this.J()))});w.defineProperty(Z,{commentSpacing:"commentSpacing"},function(){return this.va.commentSpacing},function(a){this.va.commentSpacing!==a&&(w.j(a,"number",Z,"commentSpacing"),this.va.commentSpacing=a,this.J())});
    w.defineProperty(Z,{commentMargin:"commentMargin"},function(){return this.va.commentMargin},function(a){this.va.commentMargin!==a&&(w.j(a,"number",Z,"commentMargin"),this.va.commentMargin=a,this.J())});w.defineProperty(Z,{setsPortSpot:"setsPortSpot"},function(){return this.va.setsPortSpot},function(a){this.va.setsPortSpot!==a&&(w.j(a,"boolean",Z,"setsPortSpot"),this.va.setsPortSpot=a,this.J())});
    w.defineProperty(Z,{portSpot:"portSpot"},function(){return this.va.portSpot},function(a){w.G(a,L,Z,"portSpot");this.va.portSpot.L(a)||(this.va.portSpot=a,this.J())});w.defineProperty(Z,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.va.setsChildPortSpot},function(a){this.va.setsChildPortSpot!==a&&(w.j(a,"boolean",Z,"setsChildPortSpot"),this.va.setsChildPortSpot=a,this.J())});
    w.defineProperty(Z,{childPortSpot:"childPortSpot"},function(){return this.va.childPortSpot},function(a){w.G(a,L,Z,"childPortSpot");this.va.childPortSpot.L(a)||(this.va.childPortSpot=a,this.J())});w.defineProperty(Z,{yK:"alternateSorting"},function(){return this.wa.sorting},function(a){this.wa.sorting!==a&&(w.mb(a,Z,Z,"alternateSorting"),a===Gv||a===Hv||a===Iv||Jv)&&(this.wa.sorting=a,this.J())});
    w.defineProperty(Z,{mK:"alternateComparer"},function(){return this.wa.comparer},function(a){this.wa.comparer!==a&&(w.j(a,"function",Z,"alternateComparer"),this.wa.comparer=a,this.J())});w.defineProperty(Z,{gK:"alternateAngle"},function(){return this.wa.angle},function(a){this.wa.angle!==a&&(w.j(a,"number",Z,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.wa.angle=a,this.J())});
    w.defineProperty(Z,{fK:"alternateAlignment"},function(){return this.wa.alignment},function(a){this.wa.alignment!==a&&(w.mb(a,Z,Z,"alternateAlignment"),this.wa.alignment=a,this.J())});w.defineProperty(Z,{qK:"alternateNodeIndent"},function(){return this.wa.nodeIndent},function(a){this.wa.nodeIndent!==a&&(w.j(a,"number",Z,"alternateNodeIndent"),0<=a&&(this.wa.nodeIndent=a,this.J()))});
    w.defineProperty(Z,{rK:"alternateNodeIndentPastParent"},function(){return this.wa.nodeIndentPastParent},function(a){this.wa.nodeIndentPastParent!==a&&(w.j(a,"number",Z,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.wa.nodeIndentPastParent=a,this.J()))});w.defineProperty(Z,{sK:"alternateNodeSpacing"},function(){return this.wa.nodeSpacing},function(a){this.wa.nodeSpacing!==a&&(w.j(a,"number",Z,"alternateNodeSpacing"),this.wa.nodeSpacing=a,this.J())});
    w.defineProperty(Z,{oK:"alternateLayerSpacing"},function(){return this.wa.layerSpacing},function(a){this.wa.layerSpacing!==a&&(w.j(a,"number",Z,"alternateLayerSpacing"),this.wa.layerSpacing=a,this.J())});w.defineProperty(Z,{pK:"alternateLayerSpacingParentOverlap"},function(){return this.wa.layerSpacingParentOverlap},function(a){this.wa.layerSpacingParentOverlap!==a&&(w.j(a,"number",Z,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.wa.layerSpacingParentOverlap=a,this.J()))});
    w.defineProperty(Z,{lK:"alternateCompaction"},function(){return this.wa.compaction},function(a){this.wa.compaction!==a&&(w.mb(a,Z,Z,"alternateCompaction"),a===Rv||a===Tv)&&(this.wa.compaction=a,this.J())});w.defineProperty(Z,{hK:"alternateBreadthLimit"},function(){return this.wa.breadthLimit},function(a){this.wa.breadthLimit!==a&&(w.j(a,"number",Z,"alternateBreadthLimit"),0<=a&&(this.wa.breadthLimit=a,this.J()))});
    w.defineProperty(Z,{vK:"alternateRowSpacing"},function(){return this.wa.rowSpacing},function(a){this.wa.rowSpacing!==a&&(w.j(a,"number",Z,"alternateRowSpacing"),this.wa.rowSpacing=a,this.J())});w.defineProperty(Z,{uK:"alternateRowIndent"},function(){return this.wa.rowIndent},function(a){this.wa.rowIndent!==a&&(w.j(a,"number",Z,"alternateRowIndent"),0<=a&&(this.wa.rowIndent=a,this.J()))});
    w.defineProperty(Z,{kK:"alternateCommentSpacing"},function(){return this.wa.commentSpacing},function(a){this.wa.commentSpacing!==a&&(w.j(a,"number",Z,"alternateCommentSpacing"),this.wa.commentSpacing=a,this.J())});w.defineProperty(Z,{jK:"alternateCommentMargin"},function(){return this.wa.commentMargin},function(a){this.wa.commentMargin!==a&&(w.j(a,"number",Z,"alternateCommentMargin"),this.wa.commentMargin=a,this.J())});
    w.defineProperty(Z,{xK:"alternateSetsPortSpot"},function(){return this.wa.setsPortSpot},function(a){this.wa.setsPortSpot!==a&&(w.j(a,"boolean",Z,"alternateSetsPortSpot"),this.wa.setsPortSpot=a,this.J())});w.defineProperty(Z,{tK:"alternatePortSpot"},function(){return this.wa.portSpot},function(a){w.G(a,L,Z,"alternatePortSpot");this.wa.portSpot.L(a)||(this.wa.portSpot=a,this.J())});
    w.defineProperty(Z,{wK:"alternateSetsChildPortSpot"},function(){return this.wa.setsChildPortSpot},function(a){this.wa.setsChildPortSpot!==a&&(w.j(a,"boolean",Z,"alternateSetsChildPortSpot"),this.wa.setsChildPortSpot=a,this.J())});w.defineProperty(Z,{iK:"alternateChildPortSpot"},function(){return this.wa.childPortSpot},function(a){w.G(a,L,Z,"alternateChildPortSpot");this.wa.childPortSpot.L(a)||(this.wa.childPortSpot=a,this.J())});var jv;Z.PathDefault=jv=w.p(Z,"PathDefault",-1);var kv;
    Z.PathDestination=kv=w.p(Z,"PathDestination",0);var rv;Z.PathSource=rv=w.p(Z,"PathSource",1);var Gv;Z.SortingForwards=Gv=w.p(Z,"SortingForwards",10);var Hv;Z.SortingReverse=Hv=w.p(Z,"SortingReverse",11);var Iv;Z.SortingAscending=Iv=w.p(Z,"SortingAscending",12);var Jv;Z.SortingDescending=Jv=w.p(Z,"SortingDescending",13);var Lw;Z.AlignmentCenterSubtrees=Lw=w.p(Z,"AlignmentCenterSubtrees",20);var Kv;Z.AlignmentCenterChildren=Kv=w.p(Z,"AlignmentCenterChildren",21);var Vv;
    Z.AlignmentStart=Vv=w.p(Z,"AlignmentStart",22);var Wv;Z.AlignmentEnd=Wv=w.p(Z,"AlignmentEnd",23);var Mv;Z.AlignmentBus=Mv=w.p(Z,"AlignmentBus",24);var Bv;Z.AlignmentBusBranching=Bv=w.p(Z,"AlignmentBusBranching",25);var Nv;Z.AlignmentTopLeftBus=Nv=w.p(Z,"AlignmentTopLeftBus",26);var Ov;Z.AlignmentBottomRightBus=Ov=w.p(Z,"AlignmentBottomRightBus",27);var Rv;Z.CompactionNone=Rv=w.p(Z,"CompactionNone",30);var Tv;Z.CompactionBlock=Tv=w.p(Z,"CompactionBlock",31);var lv;
    Z.StyleLayered=lv=w.p(Z,"StyleLayered",40);var Fv;Z.StyleLastParents=Fv=w.p(Z,"StyleLastParents",41);var Ev;Z.StyleAlternating=Ev=w.p(Z,"StyleAlternating",42);var Dv;Z.StyleRootOnly=Dv=w.p(Z,"StyleRootOnly",43);var nv;Z.ArrangementVertical=nv=w.p(Z,"ArrangementVertical",50);var Uw;Z.ArrangementHorizontal=Uw=w.p(Z,"ArrangementHorizontal",51);var qv;Z.ArrangementFixedRoots=qv=w.p(Z,"ArrangementFixedRoots",52);var mv;Z.LayerIndividual=mv=w.p(Z,"LayerIndividual",60);var zv;
    Z.LayerSiblings=zv=w.p(Z,"LayerSiblings",61);var yv;Z.LayerUniform=yv=w.p(Z,"LayerUniform",62);function pv(){ug.call(this)}w.Ka(pv,ug);w.ga("TreeNetwork",pv);pv.prototype.createVertex=function(){return new ov};pv.prototype.createEdge=function(){return new Ww};
    function ov(){ls.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.pa=new z(0,0);this.kb=new ia(0,0);this.Na=new z(0,0);this.oq=this.nq=this.yJ=!1;this.Fu=this.lu=null;this.sorting=Gv;this.comparer=rs;this.angle=0;this.alignment=Kv;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=Tv;this.breadthLimit=
        0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=qc;this.setsChildPortSpot=!0;this.childPortSpot=qc}w.Ka(ov,ls);w.ga("TreeVertex",ov);
    ov.prototype.copyInheritedPropertiesFrom=function(a){null!==a&&(this.sorting=a.sorting,this.comparer=a.comparer,this.angle=a.angle,this.alignment=a.alignment,this.nodeIndent=a.nodeIndent,this.nodeIndentPastParent=a.nodeIndentPastParent,this.nodeSpacing=a.nodeSpacing,this.layerSpacing=a.layerSpacing,this.layerSpacingParentOverlap=a.layerSpacingParentOverlap,this.compaction=a.compaction,this.breadthLimit=a.breadthLimit,this.rowSpacing=a.rowSpacing,this.rowIndent=a.rowIndent,this.commentSpacing=a.commentSpacing,
        this.commentMargin=a.commentMargin,this.setsPortSpot=a.setsPortSpot,this.portSpot=a.portSpot,this.setsChildPortSpot=a.setsChildPortSpot,this.childPortSpot=a.childPortSpot)};w.u(ov,{rn:"childrenCount"},function(){return this.children.length});w.defineProperty(ov,{IL:"relativePosition"},function(){return this.pa},function(a){this.pa.set(a)});w.defineProperty(ov,{VL:"subtreeSize"},function(){return this.kb},function(a){this.kb.set(a)});
    w.defineProperty(ov,{UL:"subtreeOffset"},function(){return this.Na},function(a){this.Na.set(a)});function Ww(){ms.call(this);this.Is=new z(0,0)}w.Ka(Ww,ms);w.ga("TreeEdge",Ww);
    Ww.prototype.commit=function(){var a=this.link;if(null!==a&&!a.$l){var b=this.network.Tb,c=null,d=null;switch(b.Of){case kv:c=this.fromVertex;d=this.toVertex;break;case rv:c=this.toVertex;d=this.fromVertex;break;default:w.k("Unhandled path value "+b.Of.toString())}if(null!==c&&null!==d)if(b=this.Is,0!==b.x||0!==b.y||c.yJ){var d=c.gb,e=Uv(c),f=Xv(c),h=c.rowSpacing;a.eo();var k=a.af===Jj,l=a.ac,m=0,n,p;a.im();if(l||k){for(m=2;4<a.qa;)a.YF(2);n=a.l(1);p=a.l(2)}else{for(m=1;3<a.qa;)a.YF(1);n=a.l(0);p=
        a.l(a.qa-1)}var q=a.l(a.qa-1),r=0;0===e?(c.alignment===Wv?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Yv(c))))):c.alignment===Vv?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+Yv(c))))):r=c.nq||c.oq&&1===c.maxGenerationCount?d.top-c.Na.y+b.y:d.y+d.height/2+b.y,k?(a.w(m,n.x,r),m++,a.w(m,d.right+f,r),m++,a.w(m,d.right+f+(b.x-h)/3,r),m++,a.w(m,d.right+f+2*(b.x-h)/3,r),m++,a.w(m,d.right+f+(b.x-h),r),m++,a.w(m,p.x,r)):(l&&(a.w(m,d.right+f/2,n.y),
        m++),a.w(m,d.right+f/2,r),m++,a.w(m,d.right+f+b.x-(l?h/2:h),r),m++,l&&a.w(m,a.l(m-1).x,p.y))):90===e?(c.alignment===Wv?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Yv(c))))):c.alignment===Vv?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+Yv(c))))):r=c.nq||c.oq&&1===c.maxGenerationCount?d.left-c.Na.x+b.x:d.x+d.width/2+b.x,k?(a.w(m,r,n.y),m++,a.w(m,r,d.bottom+f),m++,a.w(m,r,d.bottom+f+(b.y-h)/3),m++,a.w(m,r,d.bottom+f+2*(b.y-h)/3),m++,a.w(m,r,d.bottom+
        f+(b.y-h)),m++,a.w(m,r,p.y)):(l&&(a.w(m,n.x,d.bottom+f/2),m++),a.w(m,r,d.bottom+f/2),m++,a.w(m,r,d.bottom+f+b.y-(l?h/2:h)),m++,l&&a.w(m,p.x,a.l(m-1).y))):180===e?(c.alignment===Wv?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-Yv(c))))):c.alignment===Vv?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+Yv(c))))):r=c.nq||c.oq&&1===c.maxGenerationCount?d.top-c.Na.y+b.y:d.y+d.height/2+b.y,k?(a.w(m,n.x,r),m++,a.w(m,d.left-f,r),m++,a.w(m,d.left-f+(b.x+
        h)/3,r),m++,a.w(m,d.left-f+2*(b.x+h)/3,r),m++,a.w(m,d.left-f+(b.x+h),r),m++,a.w(m,p.x,r)):(l&&(a.w(m,d.left-f/2,n.y),m++),a.w(m,d.left-f/2,r),m++,a.w(m,d.left-f+b.x+(l?h/2:h),r),m++,l&&a.w(m,a.l(m-1).x,p.y))):270===e?(c.alignment===Wv?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-Yv(c))))):c.alignment===Vv?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+Yv(c))))):r=c.nq||c.oq&&1===c.maxGenerationCount?d.left-c.Na.x+b.x:d.x+d.width/2+b.x,k?(a.w(m,
        r,n.y),m++,a.w(m,r,d.top-f),m++,a.w(m,r,d.top-f+(b.y+h)/3),m++,a.w(m,r,d.top-f+2*(b.y+h)/3),m++,a.w(m,r,d.top-f+(b.y+h)),m++,a.w(m,r,p.y)):(l&&(a.w(m,n.x,d.top-f/2),m++),a.w(m,r,d.top-f/2),m++,a.w(m,r,d.top-f+b.y+(l?h/2:h)),m++,l&&a.w(m,p.x,a.l(m-1).y))):w.k("Invalid angle "+e);a.kj()}else e=c,f=d,a=this.link,c=Uv(e),c!==Uv(f)&&(b=Xv(e),d=e.gb,e=f.gb,0===c&&e.left-d.right<b+1||90===c&&e.top-d.bottom<b+1||180===c&&d.left-e.right<b+1||270===c&&d.top-e.bottom<b+1||(a.eo(),e=a.af===Jj,f=a.ac,h=Lv(this.fromVertex.alignment),
        a.im(),0===c?(c=d.right+b/2,e?4===a.qa&&(b=a.l(3).y,a.ca(1,c-20,a.l(1).y),a.w(2,c-20,b),a.w(3,c,b),a.w(4,c+20,b),a.ca(5,a.l(5).x,b)):f?h?a.ca(3,a.l(2).x,a.l(4).y):6===a.qa&&(a.ca(2,c,a.l(2).y),a.ca(3,c,a.l(3).y)):4===a.qa?a.w(2,c,a.l(2).y):3===a.qa?a.ca(1,c,a.l(2).y):2===a.qa&&a.w(1,c,a.l(1).y)):90===c?(b=d.bottom+b/2,e?4===a.qa&&(c=a.l(3).x,a.ca(1,a.l(1).x,b-20),a.w(2,c,b-20),a.w(3,c,b),a.w(4,c,b+20),a.ca(5,c,a.l(5).y)):f?h?a.ca(3,a.l(2).x,a.l(4).y):6===a.qa&&(a.ca(2,a.l(2).x,b),a.ca(3,a.l(3).x,
            b)):4===a.qa?a.w(2,a.l(2).x,b):3===a.qa?a.ca(1,a.l(2).x,b):2===a.qa&&a.w(1,a.l(1).x,b)):180===c?(c=d.left-b/2,e?4===a.qa&&(b=a.l(3).y,a.ca(1,c+20,a.l(1).y),a.w(2,c+20,b),a.w(3,c,b),a.w(4,c-20,b),a.ca(5,a.l(5).x,b)):f?h?a.ca(3,a.l(2).x,a.l(4).y):6===a.qa&&(a.ca(2,c,a.l(2).y),a.ca(3,c,a.l(3).y)):4===a.qa?a.w(2,c,a.l(2).y):3===a.qa?a.ca(1,c,a.l(2).y):2===a.qa&&a.w(1,c,a.l(1).y)):270===c&&(b=d.top-b/2,e?4===a.qa&&(c=a.l(3).x,a.ca(1,a.l(1).x,b+20),a.w(2,c,b+20),a.w(3,c,b),a.w(4,c,b-20),a.ca(5,c,a.l(5).y)):
            f?h?a.ca(3,a.l(2).x,a.l(4).y):6===a.qa&&(a.ca(2,a.l(2).x,b),a.ca(3,a.l(3).x,b)):4===a.qa?a.w(2,a.l(2).x,b):3===a.qa?a.ca(1,a.l(2).x,b):2===a.qa&&a.w(1,a.l(1).x,b)),a.kj()))}};w.defineProperty(Ww,{HL:"relativePoint"},function(){return this.Is},function(a){this.Is.set(a)});function Xw(){G.call(this);this.Ue=null}w.Ka(Xw,G);Xw.prototype.cloneProtected=function(a){G.prototype.cloneProtected.call(this,a);a.element=this.Ue.cloneNode(!0)};
    Xw.prototype.toString=function(){return"HTMLHost("+this.Ue.toString()+")#"+w.Od(this)};Xw.prototype.zk=function(a,b){var c=this.Ue;if(null!==c){var d=this.Wa(Jb);d.x-=this.W.width/2;d.y-=this.W.height/2;d.x-=this.W.x;d.y-=this.W.y;var d=b.BG(d),e=b.nj;null===e||e.contains(c)||e.appendChild(c);e=this.transform;c.style.transform="matrix("+e.m11+","+e.m12+","+e.m21+","+e.m22+","+e.dx+","+e.dy+")";c.style.transformOrigin="0 0";e=d.y;c.style.left=d.x+"px";c.style.top=e+"px"}};
    Xw.prototype.Pn=function(a,b,c,d){var e=this.Ca;isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);var e=this.Gf,f=this.si;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);c=this.Ue;null!==c&&(b=c.getBoundingClientRect(),a=b.width,b=b.height);Ua(this.Uc,a,b);Bo(this,0,0,a,b)};Xw.prototype.jj=function(a,b,c,d){Go(this,a,b,c,d)};w.u(Xw,{Ja:"naturalBounds"},function(){return this.Uc});
    w.defineProperty(Xw,{element:"element"},function(){return this.Ue},function(a){var b=this.Ue;b!==a&&(a instanceof HTMLElement||w.k("HTMLHost.element must be an instance of Element."),this.Ue=a,a.className="HTMLHost",this.h("element",b,a),this.oa())});ca.version="1.7.24";
    window&&(window.module&&"object"===typeof window.module&&"object"===typeof window.module.exports?window.module.exports=ca:window.define&&"function"===typeof window.define&&window.define.amd?(window.go=ca,window.define(ca)):window.go=ca);"undefined"!==typeof module&&"object"===typeof module.exports&&(module.exports=ca); })(window);