text: /*
   * GoJS v1.6.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.6.24/doc/license.html.
   */
  (function(window) { var f,aa={};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 g.apply(a,e.concat(d.call(arguments)))}function c(){}var d=Array.prototype.slice,e=d.call(arguments,1),g=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(),g=Math.max(8,16-(c-a)),h=window.setTimeout(function(){b(c+g)},g);a=c+g;return h});window.cancelAnimationFrame||(window.cancelAnimationFrame=
  function(a){window.clearTimeout(a)})})();
  var u={cj:!1,Sz:!1,lE:!1,AH:!1,eF:!1,DE:!1,ut:null,enableBoundsInfo:function(a){u.cj=!0;a&&a.Sp()},disableBoundsInfo:function(a){u.cj=!1;a&&(ca(a.gd,!0),a.Sp())},iE:function(a,b){void 0===a&&(a=u.ut);void 0===b&&(b=a.Gl("").mb);var c=b.length,d=a.gd;d.fillStyle="rgba(255,255,0,.3)";for(var e=0;e<c;e++){var g=b.ea(e),h=g.W;if(null!==g.va)u.iE(a,g.va);else{var k=g.Ak.copy();k.vA(g.Jd);d.save();d.transform(k.m11,k.m12,k.m21,k.m22,k.dx,k.dy);d.fillRect(h.x,h.y,h.width,h.height);d.restore()}}},jE:function(a,
  b){a||(a=u.ut);b||(b=a.Gl("").mb);var c=a.gd,d=b.length;c.fillStyle="rgba(0,0,255,.3)";for(var e=0;e<d;e++){var g=b.ea(e),h=g.Ga,k=g.Ak;null!==g.va?u.jE(a,g.va):(c.save(),c.transform(k.m11,k.m12,k.m21,k.m22,k.dx,k.dy),c.fillRect(h.x,h.y,h.width,h.height),c.restore())}},vH:function(a,b){a||(a=u.ut);b||(b=a.Gl("").mb);var c=a.gd,d=b.length;c.fillStyle="rgba(0,0,255,.3)";for(var e=0;e<d;e++){var g=b.ea(e),h=g.Ia,k=g.Ak;null!==g.va?u.vH(a,g.va):(c.save(),c.transform(k.m11,k.m12,k.m21,k.m22,k.dx,k.dy),
  c.fillRect(h.x||0,h.y||0,h.width,h.height),c.restore())}},vK:function(){u.jE();u.iE()},wK:function(a){a||(a=u.ut);var b=a.ad;a=a.gd;a.strokeStyle="rgba(0,255,0,.9)";a.rect(b.x,b.y,b.width,b.height);a.stroke()},kE:function(a,b){b.fillStyle="red";b.fillRect(0,0,8,8);b.lineWidth=8;b.strokeStyle="rgba(255,255,0,.6)";var c=a.xb;b.rect(c.x,c.y,c.width,c.height);b.stroke();b.fillStyle="rgba(0,255,0,.2)";b.fillRect(a.ad.x,a.ad.y,a.ad.width,a.ad.height)},wH:function(a,b){b instanceof da||(a.lineWidth=2,a.strokeStyle=
  "rgba(255,0,0,.5)",a.rect(b.Xb.x,b.Xb.y,b.Xb.width,b.Xb.height),a.stroke(),void 0!==b.stroke&&(a.strokeStyle=b.stroke),void 0!==b.Oe&&(a.lineWidth=b.Oe),null!==b.T&&b.T.type===ga&&(a.lineWidth=1,a.strokeStyle="rgba(10,200,10,.6)",void 0!==b.stroke&&(a.strokeStyle=b.stroke),void 0!==b.Oe&&(a.lineWidth=b.Oe)))},xH:function(a,b){a.lineWidth=1;a.strokeStyle="rgba(0,0,255,.5)";a.rect(b.Ga.x,b.Ga.y,b.Ga.width,b.Ga.height);a.stroke();void 0!==b.stroke&&(a.strokeStyle=b.stroke);void 0!==b.Oe&&(a.lineWidth=
  b.Oe)},Rz:function(a,b,c){a.setTransform(1,0,0,1,0,0);a.scale(b.jd,b.jd);a.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);c=b.Yb.length;for(var d=0;d<c;d++)for(var e=b.Yb.ea(d),g=e.mb.length,h=0;h<g;h++){var k=e.mb.ea(h);if(void 0!==k.location&&null!==k.location){if(k.location.F()){var l=k.location.x,m=k.location.y;a.beginPath();a.strokeStyle="limegreen";a.lineWidth=2;a.moveTo(l,m+6);a.lineTo(l,m);a.lineTo(l+6,m);a.moveTo(l,m);a.lineTo(l+10,m+20);a.stroke()}l=k.position.x;m=k.position.y;a.beginPath();
  a.strokeStyle="red";a.lineWidth=2;a.moveTo(l,m+6);a.lineTo(l,m);a.lineTo(l+6,m);a.moveTo(l,m);a.lineTo(l+20,m+10);a.stroke()}}a.setTransform(1,0,0,1,0,0)},xK:function(a,b,c){var d=a.length;b.fillStyle="rgba(255,0,0,.1)";for(var e=0;e<d;e++){var g,h=a[e];g=c.Jd;var k=h.x,l=h.y,m=k+h.width,n=l+h.height,p=g.m11,q=g.m12,r=g.m21,s=g.m22,t=g.dx,v=g.dy,x=k*p+l*r+t,h=k*q+l*s+v;g=m*p+l*r+t;var l=m*q+l*s+v,y=k*p+n*r+t,k=k*q+n*s+v,p=m*p+n*r+t,m=m*q+n*s+v,n=x,q=h,n=Math.min(n,g),x=Math.max(x,g),q=Math.min(q,
  l),h=Math.max(h,l),n=Math.min(n,y),x=Math.max(x,y),q=Math.min(q,k),h=Math.max(h,k),n=Math.min(n,p),x=Math.max(x,p),q=Math.min(q,m),h=Math.max(h,m);g=new w(n,q,x-n,h-q);b.fillRect(g.x,g.y,g.width,g.height)}},yH:function(a,b,c,d,e){a.fillStyle="rgba(0,255,0,.2)";a.fillRect(b,c,d,e)},zH:function(a,b,c){a.save();var d=b.Jd;d.reset();1!==b.scale&&d.scale(b.scale);b=b.position;0===b.x&&0===b.y||d.translate(-b.x,-b.y);a.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);c=c.Yc.o;d=c.length;for(b=0;b<d;b++){var e=
  c[b];a.beginPath();a.moveTo(e.x-4,e.y);a.lineTo(e.x+4,e.y);a.moveTo(e.x,e.y-4);a.lineTo(e.x,e.y+4);a.lineWidth=2;a.strokeStyle="rgba(255,0,0,.9)";a.stroke()}a.restore()},tK:function(a){a||(a=u.ut);for(a=a.ln;a.next();)z.trace(a.value.toString())},nL:function(a,b){var c=b.ko(a),d=b.Qb;d.ue=b.aB(c);d.ga=c;return ha(b,d,a)},iL:function(a,b){b.pe(a.ga)&&(b.gd.fillStyle="lime",b.gd.fillRect(a.ue.x,a.ue.y,1*b.scale,1*b.scale))},jL:function(a){var b=ja(a,!1,null,null);if(!b.yp){a=a.gd;for(var c=0;c<=b.Nm;c++)for(var d=
  0;d<=b.Om;d++){var e=b.lc[c][d];if(0!==e){var g=c*b.Rd+b.Sf,h=d*b.Ad+b.Tf;0!==e&&(a.fillStyle="rgba(255, 0, 0, .2)",a.fillRect(g,h,b.Rd,b.Ad));999999<=e||(e%=10,a.fillStyle="blue",a.fillText(e.toString(),g,h+b.Ad))}}}},dumpReferences:function(a){if(a instanceof B)for(a=a.ln;a.next();){var b=a.value;z.trace(b.toString());for(b=b.oi;b.next();)u.dumpReferences(b.value)}else if(a instanceof D){z.trace("References for "+a);null!==a.layer&&z.trace("  "+a.layer.toString()+' LayerName: "'+a.If+'"');a.un!==
  a&&z.trace("  SelectionObject: "+a.un.toString()+' SelectionObjectName: "'+a.Kx+'"');a.Zb!==a&&z.trace("  LocationObject: "+a.Zb.toString()+' LocationObjectName: "'+a.ux+'"');if(a.Xg){for(var c="",b=a.Xg.i;b.next();)c+=b.key+" ";z.trace("  Adornments: "+c)}null!==a.Qa&&z.trace("  ContainingGroup: "+a.Qa.toString());if(a instanceof E){if(a.Ed)for(b=a.Ed.i;b.next(););if(0<a.ee.count){c="";for(b=a.ee;b.next();)c+=b.value.toString()+", ";z.trace("  Links: "+c)}null!==a.od&&z.trace("  LabeledLink: "+a.od.toString());
  if(a instanceof F){z.trace("  Placeholder: "+a.placeholder);c="";for(b=a.Hc;b.next();)c+=b.value.toString()+", ";z.trace("  Members: "+c);c="";for(b=a.vm.i;b.next();)c+=b.value.toString()+", ";z.trace("  NestedGroups: "+c);z.trace("  Layout: "+a.Sb)}}else if(a instanceof G){z.trace("  Path: "+a.path);z.trace("  From: "+a.Y+" "+a.md+' "'+a.ag+'"');z.trace("  To: "+a.da+" "+a.Qd+' "'+a.Vg+'"');c="";for(b=a.Hf;b.next();)c+=b.value.toString()+", ";z.trace("  LabelNodes: "+c)}}},dumpVisualTree:function(a){if(a instanceof
  B)for(a=a.ln;a.next();){var b=a.value;z.trace(b.toString());for(b=b.oi;b.next();)u.dumpVisualTree(b.value)}else a instanceof D&&(b=" ",a.ZD&&(b+="c"),a.cE&&(b+="d"),a.BE&&(b+="g"),a.cF&&(b+="m"),a.rF&&(b+="h"),a.sF&&(b+="z"),a.xF&&(b+="o"),a.wk&&(b+="s"),a.QF&&(b+="t"),a.FF&&(b+="A"),a.lx&&(b+="B"),a.jA&&(b+="L"),a.jb&&(b+="S"),a.tk&&(b+="H"),u.bC(a,1,b))},bC:function(a,b,c){for(var d="",e=0;e<b;e++)d+="  ";d+=a.toString();c&&(d+=c);c=" ";c=a.visible?c+"v":c+"~";a.jg&&(c+="p");a.Ff&&(c+="m");a.Mt&&
  (c+="a");d+=c;if(0!==a.Vb||0!==a.column)d+=" ["+a.Vb+","+a.column+"]";d+=" "+a.W.toString();a.Aa.F()&&(d+=" d:"+a.Aa.toString());a.Ga.F()&&(d+=" n:"+a.Ga.toString());1!==a.scale&&(d+=" s:"+a.scale);0!==a.angle&&(d+=" a:"+a.angle);null!==a.background&&(d+=" b:"+a.background.toString());null!==a.wl&&(d+=" a:"+a.background.toString());a instanceof I&&(d+=" elts:"+a.va.count,0!==a.VF&&(d+=" top:"+a.VF),0!==a.WE&&(d+=" left:"+a.WE),null!==a.Tt&&(d+=" itemArray#:"+z.ab(a.Tt)),a.kI&&(d+=" cat:"+a.kI),null!==
  a.data&&(d+=" data:"+a.data));null!==a.zd&&(d+=' portId: "'+a.zd+'"');z.trace(d);if(a instanceof I)for(a=a.elements;a.next();)u.bC(a.value,b+1,"")},zK:function(a){z.trace("DelayedReferences ("+a.og.count+")");for(a=a.og.i;a.next();){for(var b="",c=a.value.i;c.next();)b+=ka(c.value)+", ";z.trace("  "+a.key+": "+b)}},OD:function(a,b){if(!z.Za(b)||b instanceof Element||b instanceof CanvasRenderingContext2D||b instanceof la||b instanceof ma)return"";var c="",d;for(d in b)if("string"!==typeof d)""===c&&
  (c=b+"\n"),c+="  "+d+" is not a string property\n";else if("_"!==d.charAt(0)&&!(2>=d.length)){var e=z.tb(b,d);if(null!==e&&"function"!==typeof e){if(b.hasOwnProperty(d)){var g=Object.getPrototypeOf(b);if(g&&g.Zv&&g.Zv[d])continue}else if(z.hx(b,d))continue;""===c&&(c=b+"\n");c+='  unknown property "'+d+'" has value: '+e+" at "+a+"\n"}}return c},Mw:function(a,b){if(null!==b&&void 0!==b&&"number"!==typeof b&&"string"!==typeof b&&"boolean"!==typeof b&&"function"!==typeof b)if(void 0!==z.nd(b)){if(!u.nw.contains(b))if(u.nw.add(b),
  u.Nv.add(u.OD(a,b)),b instanceof J||b instanceof K||b instanceof na)for(var c=b.i;c.next();)u.Mw(a+"["+c.key+"]",c.value);else for(c in b){var d=z.tb(b,c);if(void 0!==d&&null!==d&&z.Za(d)&&d!==b.Zv){if(b instanceof qa){if(d===b.Oj)continue}else if(b instanceof I){if("data"===c||d===b.fe)continue;if("itemArray"===c||d===b.Ji)continue;if(b instanceof D&&d===b.jl)continue}else if(!(b instanceof B))if(b instanceof ra){if("archetypeGroupData"===c||d===b.ky)continue}else if(b instanceof ta){if("archetypeLinkData"===
  c||d===b.my)continue;if("archetypeLabelNodeData"===c||d===b.ly)continue}else if(b instanceof va){if("archetypeNodeData"===c||d===b.Nk)continue}else if(b instanceof M){if("nodeDataArray"===c||d===b.wf)continue;if("linkDataArray"===c||d===b.vf||d===b.rm)continue;if(d===b.vc)continue;if(d===b.og)continue}else if(b instanceof wa||b instanceof xa||b instanceof ya)continue;u.Mw(a+"."+c,d)}}}else if(Array.isArray(b))for(c=0;c<b.length;c++)u.Mw(a+"["+c+"]",b[c]);else u.Nv.add(u.OD(a,b))},checkProperties:function(a){void 0===
  u.nw?u.nw=new K(Object):u.nw.clear();u.Nv=new za;u.Mw("",a);a=u.Nv.toString();u.Nv=null;return a}};aa.Debug=u;
  var z={qd:1,Tc:2,fd:4,ed:8,hn:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("534.30")&&0<window.navigator.userAgent.indexOf("Android"),ME:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("MSIE 10.0"),NE:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Trident/7"),GK:void 0!==window.navigator&&0<window.navigator.userAgent.indexOf("Edge/"),sk:void 0!==window.navigator&&void 0!==window.navigator.platform&&0<=window.navigator.platform.toUpperCase().indexOf("MAC"),
  OE:void 0!==window.navigator&&void 0!==window.navigator.platform&&null!==window.navigator.platform.match(/(iPhone|iPod|iPad)/i),$D:function(a,b,c){var d=-1;return function(){var e=this,g=arguments;-1!==d&&z.clearTimeout(d);d=z.setTimeout(function(){d=-1;c||a.apply(e,g)},b);c&&!d&&a.apply(e,g)}},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);},oa:function(a,
  b){var c="The object is frozen, so its properties cannot be set: "+a.toString();void 0!==b&&(c+="  to value: "+b);z.k(c)},l:function(a,b,c,d){a instanceof b||(c=z.getTypeName(c),void 0!==d&&(c+="."+d),z.ic(a,b,c))},g:function(a,b,c,d){typeof a!==b&&(c=z.getTypeName(c),void 0!==d&&(c+="."+d),z.ic(a,b,c))},p:function(a,b,c){"number"===typeof a&&isFinite(a)||(b=z.getTypeName(b),void 0!==c&&(b+="."+c),z.k(b+" must be a real number type, and not NaN or Infinity: "+a))},Ba:function(a,b,c,d){a instanceof
  Ba&&a.Ae===b||(c=z.getTypeName(c),void 0!==d&&(c+="."+d),z.ic(a,"a constant of class "+z.kf(b),c))},ot:function(a,b){"string"===typeof a?Ca(a)||z.k('Color "'+a+'" is not a valid color string for '+b):a instanceof Da||z.k("Value for "+b+" must be a color string or a Brush, not "+a)},ic:function(a,b,c,d){b=z.getTypeName(b);c=z.getTypeName(c);void 0!==d&&(c+="."+d);"string"===typeof a?z.k(c+" value is not an instance of "+b+': "'+a+'"'):z.k(c+" value is not an instance of "+b+": "+a)},ka:function(a,
  b,c,d){c=z.getTypeName(c);void 0!==d&&(c+="."+d);z.k(c+" is not in the range "+b+": "+a)},pd:function(a){z.k(z.kf(a)+" constructor cannot take any arguments.")},Ta:function(a){z.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.")},trace:function(a){window.console&&window.console.log(a)},Za:function(a){return"object"===typeof a&&null!==a},isArray:function(a){return Array.isArray(a)||
  a instanceof NodeList||a instanceof HTMLCollection},fI:function(a){return Array.isArray(a)},nt:function(a,b,c){z.isArray(a)||z.ic(a,"Array or NodeList or HTMLCollection",b,c)},ab:function(a){return a.length},Al:function(a){return Array.prototype.slice.call(a)},Ya:function(a,b){Array.isArray(a);return a[b]},LD:function(a,b,c){Array.isArray(a)?a[b]=c:z.k("Cannot replace an object in an HTMLCollection or NodeList at "+b)},Fz: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},bj:function(a,b,c){Array.isArray(a)?b>=a.length?a.push(c):a.splice(b,0,c):z.k("Cannot insert an object into an HTMLCollection or NodeList: "+c+" at "+b)},ii:function(a,b){Array.isArray(a)?b>=a.length?a.pop():a.splice(b,1):z.k("Cannot remove an object from an HTMLCollection or NodeList at "+b)},$x:[],O:function(){var a=z.$x.pop();return void 0===a?new N:a},Tb:function(a,b){var c=z.$x.pop();if(void 0===c)return new N(a,b);c.x=a;c.y=b;return c},A:function(a){z.$x.push(a)},
  nB:[],Xl:function(){var a=z.nB.pop();return void 0===a?new Ea:a},qk:function(a){z.nB.push(a)},ay:[],lg:function(){var a=z.ay.pop();return void 0===a?new w:a},zk:function(a,b,c,d){var e=z.ay.pop();if(void 0===e)return new w(a,b,c,d);e.x=a;e.y=b;e.width=c;e.height=d;return e},dc:function(a){z.ay.push(a)},oB:[],Hh:function(){var a=z.oB.pop();return void 0===a?new Fa:a},jf:function(a){z.oB.push(a)},by:null,v:function(){var a=z.by;return null!==a?(z.by=null,a):new Ga},u:function(a){a.reset();z.by=a},mB:[],
  rb:function(){var a=z.mB.pop();return void 0===a?[]:a},xa:function(a){a.length=0;z.mB.push(a)},yj:Object.freeze([]),am:1,kc:function(a){a.__gohashid=z.am++},It:function(a){var b=a.__gohashid;void 0===b&&(b=z.am++,a.__gohashid=b);return b},nd:function(a){return a.__gohashid},ia:function(a,b){b.sy=a;aa[a]=b},Ra:function(a,b){function c(){}c.prototype=b.prototype;a.prototype=new c;a.prototype.constructor=a},ji:function(a){a.BG=!0},defineProperty:function(a,b,c,d,e){z.g(a,"function","Util.defineProperty:classfunc");
  z.g(b,"object","Util.defineProperty:propobj");z.g(c,"function","Util.defineProperty:getter");z.g(d,"function","Util.defineProperty:setter");for(var g in b){b=b[g];c={get:c,set:d,enumerable:!0};if(void 0!==e)for(var h in e)c[h]=e[h];Object.defineProperty(a.prototype,g,c);e=Object.getOwnPropertyDescriptor(a.prototype,g);b&&e&&Object.defineProperty(a.prototype,b,e);break}},FJ:!1,w:function(a,b,c,d){z.g(a,"function","Util.defineReadOnlyProperty:classfunc");z.g(b,"object","Util.defineReadOnlyProperty:propobj");
  z.g(c,"function","Util.defineReadOnlyProperty:getter");for(var e in b){var g=b[e];b={get:c,set:function(a){z.k('The property "'+g+'" 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);g&&d&&Object.defineProperty(a.prototype,g,d);break}},Yd:function(a,b){for(var c in b)b[c]=!0;a.prototype.Zv=b},getTypeName:function(a){return void 0===a?"":"string"===typeof a?a:"function"===
  typeof a?z.kf(a):null===a?"*":""},kf:function(a){if("function"===typeof a){if(a.sy)return a.sy;if(a.name)return a.name;var b=a.toString(),c=b.indexOf("("),b=b.substring(9,c).trim();if(""!==b)return a.sy=b}else if("object"===typeof a&&a.constructor)return z.kf(a.constructor);return typeof a},s:function(a,b,c){z.g(a,"function","Util.defineEnumValue:classfunc");z.g(b,"string","Util.defineEnumValue:name");z.g(c,"number","Util.defineEnumValue:num");c=new Ba(a,b,c);Object.freeze(c);a[b]=c;var d=a.Fu;d instanceof
  na||(d=new na("string",Ba),a.Fu=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){u&&z.trace("property get error: "+d.toString())}return c},Sa: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){u&&z.trace("property set error: "+d.toString())}},qu:function(a,b){z.g(a,"object",
  "Setting properties requires Objects as arguments");z.g(b,"object","Setting properties requires Objects as arguments");var c=a instanceof I,d=a instanceof B,e;for(e in b){""===e&&z.k("Setting properties requires non-empty property names");var g=a,h=e;if(c||d){var k=e.indexOf(".");if(0<k){var l=e.substring(0,k);if(c)g=a.oe(l);else if(g=a[l],void 0===g||null===g)g=a.gb[l];z.Za(g)?h=e.substr(k+1):z.k("Unable to find object named: "+l+" in "+a.toString()+" when trying to set property: "+e)}}if("_"!==
  h[0]&&!z.hx(g,h))if(d&&"ModelChanged"===h){a.PG(b[h]);continue}else if(d&&"Changed"===h){a.Qm(b[h]);continue}else if(d&&z.hx(a.gb,h))g=a.gb;else if(d&&Ia(a,h)){a.Az(h,b[h]);continue}else if(a instanceof M&&"Changed"===h){a.Qm(b[h]);continue}else z.k('Trying to set undefined property "'+h+'" on object: '+g.toString());g[h]=b[e];"_"===h[0]&&g instanceof O&&g.MG(h)}},hx: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.Zv;if(d&&d[b])return!0;c=Object.getPrototypeOf(c)}return!1},UI: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,g="",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,g+=String.fromCharCode(a.charCodeAt(h)^b[(b[c]+b[d])%256]);return g},UH: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},Gg:function(a){return z.UI(z.UH(a))},Zl:null,adym:"7da71ca0ad381e90",vfo:"2be640fdb162",aH:"@COLOR1",bH:"@COLOR2"};
  z.Zl=function(){var a=window.document.createElement("canvas"),b=a.getContext("2d");b[z.Gg("7ca11abfd022028846")]=z.Gg("398c3597c01238");for(var c=["5da73c80a3330d854f9e5e671d6633","32ab5ff3b26f42dc0ed90f22422913b54ae6247590da4bb21c324ba3a84e385776","54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387","74bf19bce72555874c86"],d=1;5>d;d++)b[z.Gg("7ca11abfd7330390")](z.Gg(c[d-1]),10,15*d+0);b[z.Gg("7ca11abfd022028846")]=z.Gg("39f046ebb36e4b");for(d=1;5>d;d++)b[z.Gg("7ca11abfd7330390")](z.Gg(c[d-
  1]),10,15*d+0);if(4!==c.length||"5"!==c[0][0]||"7"!==c[3][0])z.s=function(a,b){var c=new Ba(a,b,2);Object.freeze(c);a[b]=c;var d=a.Fu;d instanceof na||(d=new na("string",Ba),a.Fu=d);d.add(b,c);return c};return a}();function Ba(a,b,c){z.kc(this);this.yB=a;this.Ub=b;this.GG=c}z.ia("EnumValue",Ba);Ba.prototype.toString=function(){return z.kf(this.yB)+"."+this.Ub};z.w(Ba,{Ae:"classType"},function(){return this.yB});z.w(Ba,{name:"name"},function(){return this.Ub});z.w(Ba,{value:"value"},function(){return this.GG});
  var Ja;Ba.findName=Ja=function(a,b){if(void 0===b||null===b||""===b)return null;z.g(a,"function","findName:classfunc");z.g(b,"string","EnumValue.findName:name");var c=a.Fu;return c instanceof na?c.na(b):null};function za(){this.xB=[]}za.prototype.toString=function(){return this.xB.join("")};za.prototype.add=function(a){""!==a&&this.xB.push(a)};function ma(){}
  function Ka(a){void 0===a&&(a=42);this.seed=a;this.Wx=48271;this.Eu=2147483647;this.lB=this.Eu/this.Wx;this.kG=this.Eu%this.Wx;this.jG=1/this.Eu;this.random()}Ka.prototype.random=function(){var a=this.seed%this.lB*this.Wx-this.seed/this.lB*this.kG;this.seed=0<a?a:a+this.Eu;return this.seed*this.jG};function Ma(){}z.w(Ma,{i:"iterator"},function(){return this});Ma.prototype.reset=Ma.prototype.reset=function(){};Ma.prototype.next=Ma.prototype.hasNext=Ma.prototype.next=function(){return!1};
  Ma.prototype.first=Ma.prototype.first=function(){return null};Ma.prototype.any=function(){return!1};Ma.prototype.all=function(){return!0};Ma.prototype.each=function(){return this};Ma.prototype.map=function(){return this};Ma.prototype.filter=function(){return this};Ma.prototype.concat=function(a){return a.i};z.w(Ma,{count:"count"},function(){return 0});Ma.prototype.Nf=function(){};Ma.prototype.toString=function(){return"EmptyIterator"};var Pa=new Ma;function Ra(a){this.key=-1;this.value=a}
  z.Yd(Ra,{key:!0,value:!0});z.w(Ra,{i:"iterator"},function(){return this});Ra.prototype.reset=Ra.prototype.reset=function(){this.key=-1};Ra.prototype.next=Ra.prototype.hasNext=Ra.prototype.next=function(){return-1===this.key?(this.key=0,!0):!1};Ra.prototype.first=Ra.prototype.first=function(){this.key=0;return this.value};Ra.prototype.any=function(a){this.key=-1;return a(this.value)};Ra.prototype.all=function(a){this.key=-1;return a(this.value)};
  Ra.prototype.each=function(a){this.key=-1;a(this.value);return this};Ra.prototype.map=function(a){return new Ra(a(this.value))};Ra.prototype.filter=function(a){return a(this.value)?new Ra(this.value):Pa};Ra.prototype.concat=function(a){return new Sa(this,a.i)};z.w(Ra,{count:"count"},function(){return 1});Ra.prototype.Nf=function(){this.value=null};Ra.prototype.toString=function(){return"SingletonIterator("+this.value+")"};function Sa(a,b){this.al=a;this.bl=b;this.Gu=!1}z.Yd(Sa,{key:!0,value:!0});
  z.w(Sa,{i:"iterator"},function(){return this});Sa.prototype.reset=Sa.prototype.reset=function(){this.al.reset();this.bl.reset();this.Gu=!1};Sa.prototype.next=Sa.prototype.hasNext=Sa.prototype.next=function(){if(!this.Gu){var a=this.al;if(a.next())return this.key=a.key,this.value=a.value,!0;this.Gu=!0}return this.Gu&&(a=this.bl,a.next())?(this.key=a.key,this.value=a.value,!0):!1};Sa.prototype.first=Sa.prototype.first=function(){this.reset();return this.next()?this.value:null};
  Sa.prototype.any=function(a){return this.al.any(a)||this.bl.any(a)?!0:!1};Sa.prototype.all=function(a){return this.al.all(a)&&this.bl.all(a)?!0:!1};Sa.prototype.each=function(a){this.al.each(a);this.bl.each(a);return this};Sa.prototype.map=function(a){return new Sa(this.al.map(a),this.bl.map(a))};Sa.prototype.filter=function(a){return new Sa(this.al.filter(a),this.bl.filter(a))};Sa.prototype.concat=function(a){return new Sa(this,a.i)};z.w(Sa,{count:"count"},function(){return this.al.count+this.bl.count});
  Sa.prototype.Nf=function(){this.value=this.key=null};Sa.prototype.toString=function(){return"ConcatIterator()"};function Ta(a){this.Bc=a;this.Xh=null;this.reset()}z.Yd(Ta,{key:!0,value:!0});z.w(Ta,{i:"iterator"},function(){return this});z.defineProperty(Ta,{qn:"predicate"},function(){return this.Xh},function(a){this.Xh=a});Ta.prototype.reset=Ta.prototype.reset=function(){var a=this.Bc;a.ec=null;this.nb=a.H;this.Uc=-1};
  Ta.prototype.next=Ta.prototype.hasNext=Ta.prototype.next=function(){var a=this.Bc;if(a.H!==this.nb){if(0>this.key)return!1;z.Ta(a)}var a=a.o,b=a.length,c=++this.Uc,d=this.Xh;if(null!==d)for(;c<b;){var e=a[c];if(d(e))return this.key=this.Uc=c,this.value=e,!0;c++}else{if(c<b)return this.key=c,this.value=a[c],!0;this.Nf()}return!1};
  Ta.prototype.first=Ta.prototype.first=function(){var a=this.Bc;this.nb=a.H;this.Uc=0;var a=a.o,b=a.length,c=this.Xh;if(null!==c){for(var d=0;d<b;){var e=a[d];if(c(e))return this.key=this.Uc=d,this.value=e;d++}return null}return 0<b?(e=a[0],this.key=0,this.value=e):null};Ta.prototype.any=function(a){var b=this.Bc;b.ec=null;var c=b.H;this.Uc=-1;for(var d=b.o,e=d.length,g=this.Xh,h=0;h<e;h++){var k=d[h];if(null===g||g(k)){if(a(k))return!0;b.H!==c&&z.Ta(b)}}return!1};
  Ta.prototype.all=function(a){var b=this.Bc;b.ec=null;var c=b.H;this.Uc=-1;for(var d=b.o,e=d.length,g=this.Xh,h=0;h<e;h++){var k=d[h];if(null===g||g(k)){if(!a(k))return!1;b.H!==c&&z.Ta(b)}}return!0};Ta.prototype.each=function(a){var b=this.Bc;b.ec=null;var c=b.H;this.Uc=-1;for(var d=b.o,e=d.length,g=this.Xh,h=0;h<e;h++){var k=d[h];if(null===g||g(k))a(k),b.H!==c&&z.Ta(b)}return this};
  Ta.prototype.map=function(a){var b=this.Bc;b.ec=null;var c=b.H;this.Uc=-1;for(var d=[],e=b.o,g=e.length,h=this.Xh,k=0;k<g;k++){var l=e[k];if(null===h||h(l))d.push(a(l)),b.H!==c&&z.Ta(b)}a=new J;a.o=d;a.Jc();return a.i};Ta.prototype.filter=function(a){var b=this.Bc;b.ec=null;var c=b.H;this.Uc=-1;for(var d=[],e=b.o,g=e.length,h=this.Xh,k=0;k<g;k++){var l=e[k];if(null===h||h(l))a(l)&&d.push(l),b.H!==c&&z.Ta(b)}a=new J(b.ba);a.o=d;a.Jc();return a.i};
  Ta.prototype.concat=function(a){this.Bc.ec=null;return new Sa(this,a.i)};z.w(Ta,{count:"count"},function(){var a=this.Xh;if(null!==a){for(var b=0,c=this.Bc.o,d=c.length,e=0;e<d;e++)a(c[e])&&b++;return b}return this.Bc.o.length});Ta.prototype.Nf=function(){this.key=-1;this.value=null;this.nb=-1;this.Xh=null;this.Bc.ec=this};Ta.prototype.toString=function(){return"ListIterator@"+this.Uc+"/"+this.Bc.count};function Ua(a){this.Bc=a;this.reset()}z.Yd(Ua,{key:!0,value:!0});z.w(Ua,{i:"iterator"},function(){return this});
  Ua.prototype.reset=Ua.prototype.reset=function(){var a=this.Bc;a.Mj=null;this.nb=a.H;this.Uc=a.o.length};Ua.prototype.next=Ua.prototype.hasNext=Ua.prototype.next=function(){var a=this.Bc;if(a.H!==this.nb){if(0>this.key)return!1;z.Ta(a)}var b=--this.Uc;if(0<=b)return this.key=b,this.value=a.o[b],!0;this.Nf();return!1};Ua.prototype.first=Ua.prototype.first=function(){var a=this.Bc;this.nb=a.H;var b=a.o;this.Uc=a=b.length-1;return 0<=a?(b=b[a],this.key=a,this.value=b):null};
  Ua.prototype.any=function(a){var b=this.Bc;b.Mj=null;var c=b.H,d=b.o,e=d.length;this.Uc=e;for(e-=1;0<=e;e--){if(a(d[e]))return!0;b.H!==c&&z.Ta(b)}return!1};Ua.prototype.all=function(a){var b=this.Bc;b.Mj=null;var c=b.H,d=b.o,e=d.length;this.Uc=e;for(e-=1;0<=e;e--){if(!a(d[e]))return!1;b.H!==c&&z.Ta(b)}return!0};Ua.prototype.each=function(a){var b=this.Bc;b.Mj=null;var c=b.H,d=b.o,e=d.length;this.Uc=e;for(e-=1;0<=e;e--)a(d[e]),b.H!==c&&z.Ta(b);return this};
  Ua.prototype.map=function(a){var b=this.Bc;b.Mj=null;var c=b.H,d=[],e=b.o,g=e.length;this.Uc=g;for(g-=1;0<=g;g--)d.push(a(e[g])),b.H!==c&&z.Ta(b);a=new J;a.o=d;a.Jc();return a.i};Ua.prototype.filter=function(a){var b=this.Bc;b.Mj=null;var c=b.H,d=[],e=b.o,g=e.length;this.Uc=g;for(g-=1;0<=g;g--){var h=e[g];a(h)&&d.push(h);b.H!==c&&z.Ta(b)}a=new J(b.ba);a.o=d;a.Jc();return a.i};Ua.prototype.concat=function(a){this.Bc.Mj=null;return new Sa(this,a.i)};z.w(Ua,{count:"count"},function(){return this.Bc.o.length});
  Ua.prototype.Nf=function(){this.key=-1;this.value=null;this.nb=-1;this.Bc.Mj=this};Ua.prototype.toString=function(){return"ListIteratorBackwards("+this.Uc+"/"+this.Bc.count+")"};
  function J(a){z.kc(this);this.G=!1;this.o=[];this.H=0;this.Mj=this.ec=null;void 0===a||null===a?this.ba=null:"string"===typeof a?"object"===a||"string"===a||"number"===a||"boolean"===a||"function"===a?this.ba=a:z.ka(a,"the string 'object', 'number', 'string', 'boolean', or 'function'","List constructor: type"):"function"===typeof a?this.ba=a===Object?"object":a===String?"string":a===Number?"number":a===Boolean?"boolean":a===Function?"function":a:z.ka(a,"null, a primitive type name, or a class type",
  "List constructor: type")}z.ia("List",J);J.prototype.Zg=function(a){null!==this.ba&&("string"===typeof this.ba?typeof a===this.ba&&null!==a||z.ic(a,this.ba):a instanceof this.ba||z.ic(a,this.ba))};J.prototype.Jc=function(){var a=this.H;a++;999999999<a&&(a=0);this.H=a};J.prototype.freeze=J.prototype.freeze=function(){this.G=!0;return this};J.prototype.thaw=J.prototype.Wa=function(){this.G=!1;return this};J.prototype.toString=function(){return"List("+z.getTypeName(this.ba)+")#"+z.nd(this)};
  J.prototype.add=J.prototype.push=J.prototype.add=function(a){null!==a&&(u&&this.Zg(a),this.G&&z.oa(this,a),this.o.push(a),this.Jc())};J.prototype.addAll=J.prototype.$c=function(a){if(null===a)return this;this.G&&z.oa(this);var b=this.o;if(z.isArray(a))for(var c=z.ab(a),d=0;d<c;d++){var e=z.Ya(a,d);u&&this.Zg(e);b.push(e)}else for(a=a.i;a.next();)e=a.value,u&&this.Zg(e),b.push(e);this.Jc();return this};J.prototype.clear=J.prototype.clear=function(){this.G&&z.oa(this);this.o.length=0;this.Jc()};
  J.prototype.contains=J.prototype.has=J.prototype.contains=function(a){if(null===a)return!1;u&&this.Zg(a);return-1!==this.o.indexOf(a)};J.prototype.indexOf=J.prototype.indexOf=function(a){if(null===a)return-1;u&&this.Zg(a);return this.o.indexOf(a)};J.prototype.elt=J.prototype.get=J.prototype.ea=function(a){u&&z.p(a,J,"elt:i");var b=this.o;(0>a||a>=b.length)&&z.ka(a,"0 <= i < length",J,"elt:i");return b[a]};
  J.prototype.setElt=J.prototype.set=J.prototype.Sg=function(a,b){u&&(this.Zg(b),z.p(a,J,"setElt:i"));var c=this.o;(0>a||a>=c.length)&&z.ka(a,"0 <= i < length",J,"setElt:i");this.G&&z.oa(this,a);c[a]=b};J.prototype.first=J.prototype.first=function(){var a=this.o;return 0===a.length?null:a[0]};J.prototype.last=J.prototype.de=function(){var a=this.o,b=a.length;return 0<b?a[b-1]:null};J.prototype.pop=J.prototype.pop=function(){this.G&&z.oa(this);var a=this.o;return 0<a.length?a.pop():null};
  J.prototype.any=function(a){for(var b=this.o,c=this.H,d=b.length,e=0;e<d;e++){if(a(b[e]))return!0;this.H!==c&&z.Ta(this)}return!1};J.prototype.all=function(a){for(var b=this.o,c=this.H,d=b.length,e=0;e<d;e++){if(!a(b[e]))return!1;this.H!==c&&z.Ta(this)}return!0};J.prototype.each=function(a){for(var b=this.o,c=this.H,d=b.length,e=0;e<d;e++)a(b[e]),this.H!==c&&z.Ta(this);return this};
  J.prototype.map=function(a){for(var b=new J,c=[],d=this.o,e=this.H,g=d.length,h=0;h<g;h++)c.push(a(d[h])),this.H!==e&&z.Ta(this);b.o=c;b.Jc();return b};J.prototype.filter=function(a){for(var b=new J(this.ba),c=[],d=this.o,e=this.H,g=d.length,h=0;h<g;h++){var k=d[h];a(k)&&c.push(k);this.H!==e&&z.Ta(this)}b.o=c;b.Jc();return b};J.prototype.concat=function(a){return this.copy().$c(a)};
  J.prototype.insertAt=J.prototype.Md=function(a,b){u&&(this.Zg(b),z.p(a,J,"insertAt:i"));0>a&&z.ka(a,">= 0",J,"insertAt:i");this.G&&z.oa(this,a);var c=this.o;a>=c.length?c.push(b):c.splice(a,0,b);this.Jc();return!0};J.prototype.remove=J.prototype["delete"]=J.prototype.remove=function(a){if(null===a)return!1;u&&this.Zg(a);this.G&&z.oa(this,a);var b=this.o;a=b.indexOf(a);if(-1===a)return!1;a===b.length-1?b.pop():b.splice(a,1);this.Jc();return!0};
  J.prototype.removeAt=J.prototype.dd=function(a){u&&z.p(a,J,"removeAt:i");var b=this.o;(0>a||a>=b.length)&&z.ka(a,"0 <= i < length",J,"removeAt:i");this.G&&z.oa(this,a);a===b.length-1?b.pop():b.splice(a,1);this.Jc()};
  J.prototype.removeRange=J.prototype.removeRange=function(a,b){u&&(z.p(a,J,"removeRange:from"),z.p(b,J,"removeRange:to"));var c=this.o;(0>a||a>=c.length)&&z.ka(a,"0 <= from < length",J,"elt:from");(0>b||b>=c.length)&&z.ka(b,"0 <= to < length",J,"elt:to");this.G&&z.oa(this,a);var d=c.slice((b||a)+1||c.length);c.length=0>a?c.length+a:a;c.push.apply(c,d);this.Jc()};J.prototype.copy=function(){var a=new J(this.ba),b=this.o;0<b.length&&(a.o=Array.prototype.slice.call(b));return a};
  J.prototype.toArray=J.prototype.jc=function(){for(var a=this.o,b=this.count,c=Array(b),d=0;d<b;d++)c[d]=a[d];return c};J.prototype.toSet=J.prototype.UF=function(){for(var a=new K(this.ba),b=this.o,c=this.count,d=0;d<c;d++)a.add(b[d]);return a};J.prototype.sort=J.prototype.sort=function(a){u&&z.g(a,"function",J,"sort:sortfunc");this.G&&z.oa(this);this.o.sort(a);this.Jc();return this};
  J.prototype.sortRange=J.prototype.dq=function(a,b,c){var d=this.o,e=d.length;void 0===b&&(b=0);void 0===c&&(c=e);u&&(z.g(a,"function",J,"sortRange:sortfunc"),z.p(b,J,"sortRange:from"),z.p(c,J,"sortRange:to"));this.G&&z.oa(this);var g=c-b;if(1>=g)return this;(0>b||b>=e-1)&&z.ka(b,"0 <= from < length",J,"sortRange:from");if(2===g)return c=d[b],e=d[b+1],0<a(c,e)&&(d[b]=e,d[b+1]=c,this.Jc()),this;if(0===b)if(c>=e)d.sort(a);else for(g=d.slice(0,c),g.sort(a),a=0;a<c;a++)d[a]=g[a];else if(c>=e)for(g=d.slice(b),
  g.sort(a),a=b;a<e;a++)d[a]=g[a-b];else for(g=d.slice(b,c),g.sort(a),a=b;a<c;a++)d[a]=g[a-b];this.Jc();return this};J.prototype.reverse=J.prototype.reverse=function(){this.G&&z.oa(this);this.o.reverse();this.Jc();return this};z.w(J,{count:"count"},function(){return this.o.length});z.w(J,{size:"size"},function(){return this.o.length});z.w(J,{length:"length"},function(){return this.o.length});z.w(J,{i:"iterator"},function(){if(0>=this.o.length)return Pa;var a=this.ec;return null!==a?(a.reset(),a):new Ta(this)});
  z.w(J,{kn:"iteratorBackwards"},function(){if(0>=this.o.length)return Pa;var a=this.Mj;return null!==a?(a.reset(),a):new Ua(this)});function Wa(a){this.Zh=a;this.reset()}z.Yd(Wa,{key:!0,value:!0});z.w(Wa,{i:"iterator"},function(){return this});Wa.prototype.reset=Wa.prototype.reset=function(){var a=this.Zh;a.ec=null;this.nb=a.H;this.lb=null};
  Wa.prototype.next=Wa.prototype.hasNext=Wa.prototype.next=function(){var a=this.Zh;if(a.H!==this.nb){if(null===this.key)return!1;z.Ta(a)}var b=this.lb,b=null===b?a.Ka:b.bb;if(null!==b)return this.lb=b,this.value=b.value,this.key=b.key,!0;this.Nf();return!1};Wa.prototype.first=Wa.prototype.first=function(){var a=this.Zh;this.nb=a.H;a=a.Ka;if(null!==a){this.lb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
  Wa.prototype.any=function(a){var b=this.Zh;b.ec=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(a(d.value))return!0;b.H!==c&&z.Ta(b);d=d.bb}return!1};Wa.prototype.all=function(a){var b=this.Zh;b.ec=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(!a(d.value))return!1;b.H!==c&&z.Ta(b);d=d.bb}return!0};Wa.prototype.each=function(a){var b=this.Zh;b.ec=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;)a(d.value),b.H!==c&&z.Ta(b),d=d.bb;return this};
  Wa.prototype.map=function(a){var b=this.Zh;b.ec=null;for(var c=new J,d=b.H,e=b.Ka;null!==e;)c.add(a(e.value)),b.H!==d&&z.Ta(b),e=e.bb;return c.i};Wa.prototype.filter=function(a){var b=this.Zh;b.ec=null;for(var c=new J(b.ba),d=b.H,e=b.Ka;null!==e;){var g=e.value;a(g)&&c.add(g);b.H!==d&&z.Ta(b);e=e.bb}return c.i};Wa.prototype.concat=function(a){this.Zh.ec=null;return new Sa(this,a.i)};z.w(Wa,{count:"count"},function(){return this.Zh.sd});
  Wa.prototype.Nf=function(){this.value=this.key=null;this.nb=-1;this.Zh.ec=this};Wa.prototype.toString=function(){return null!==this.lb?"SetIterator@"+this.lb.value:"SetIterator"};
  function K(a){z.kc(this);this.G=!1;void 0===a||null===a?this.ba=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.ba=a:z.ka(a,"the string 'object', 'number' or 'string'","Set constructor: type"):"function"===typeof a?this.ba=a===Object?"object":a===String?"string":a===Number?"number":a:z.ka(a,"null, a primitive type name, or a class type","Set constructor: type");this.td={};this.sd=0;this.ec=null;this.H=0;this.Uh=this.Ka=null}z.ia("Set",K);
  K.prototype.Zg=function(a){null!==this.ba&&("string"===typeof this.ba?typeof a===this.ba&&null!==a||z.ic(a,this.ba):a instanceof this.ba||z.ic(a,this.ba))};K.prototype.Jc=function(){var a=this.H;a++;999999999<a&&(a=0);this.H=a};K.prototype.freeze=K.prototype.freeze=function(){this.G=!0;return this};K.prototype.thaw=K.prototype.Wa=function(){this.G=!1;return this};K.prototype.toString=function(){return"Set("+z.getTypeName(this.ba)+")#"+z.nd(this)};
  K.prototype.add=K.prototype.add=function(a){if(null===a)return!1;u&&this.Zg(a);this.G&&z.oa(this,a);var b=a;z.Za(a)&&(b=z.It(a));return void 0===this.td[b]?(this.sd++,a=new Ya(a,a),this.td[b]=a,b=this.Uh,null===b?this.Ka=a:(a.Go=b,b.bb=a),this.Uh=a,this.Jc(),!0):!1};K.prototype.addAll=K.prototype.$c=function(a){if(null===a)return this;this.G&&z.oa(this);if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++)this.add(z.Ya(a,c));else for(a=a.i;a.next();)this.add(a.value);return this};
  K.prototype.contains=K.prototype.has=K.prototype.contains=function(a){if(null===a)return!1;u&&this.Zg(a);var b=a;return z.Za(a)&&(b=z.nd(a),void 0===b)?!1:void 0!==this.td[b]};K.prototype.containsAll=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(!this.contains(a.value))return!1;return!0};K.prototype.containsAny=function(a){if(null===a)return!0;for(a=a.i;a.next();)if(this.contains(a.value))return!0;return!1};
  K.prototype.first=K.prototype.first=function(){var a=this.Ka;return null===a?null:a.value};K.prototype.any=function(a){for(var b=this.H,c=this.Ka;null!==c;){if(a(c.value))return!0;this.H!==b&&z.Ta(this);c=c.bb}return!1};K.prototype.all=function(a){for(var b=this.H,c=this.Ka;null!==c;){if(!a(c.value))return!1;this.H!==b&&z.Ta(this);c=c.bb}return!0};K.prototype.each=function(a){for(var b=this.H,c=this.Ka;null!==c;)a(c.value),this.H!==b&&z.Ta(this),c=c.bb;return this};
  K.prototype.map=function(a){for(var b=new K,c=this.H,d=this.Ka;null!==d;)b.add(a(d.value)),this.H!==c&&z.Ta(this),d=d.bb;return b};K.prototype.filter=function(a){for(var b=new K(this.ba),c=this.H,d=this.Ka;null!==d;){var e=d.value;a(e)&&b.add(e);this.H!==c&&z.Ta(this);d=d.bb}return b};K.prototype.concat=function(a){return this.copy().$c(a)};
  K.prototype.remove=K.prototype["delete"]=K.prototype.remove=function(a){if(null===a)return!1;u&&this.Zg(a);this.G&&z.oa(this,a);var b=a;if(z.Za(a)&&(b=z.nd(a),void 0===b))return!1;a=this.td[b];if(void 0===a)return!1;var c=a.bb,d=a.Go;null!==c&&(c.Go=d);null!==d&&(d.bb=c);this.Ka===a&&(this.Ka=c);this.Uh===a&&(this.Uh=d);delete this.td[b];this.sd--;this.Jc();return!0};
  K.prototype.removeAll=K.prototype.IA=function(a){if(null===a)return this;this.G&&z.oa(this);if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++)this.remove(z.Ya(a,c));else for(a=a.i;a.next();)this.remove(a.value);return this};K.prototype.retainAll=function(a){if(null===a||0===this.count)return this;this.G&&z.oa(this);var b=new K(this.ba);b.$c(a);a=[];for(var c=this.i;c.next();){var d=c.value;b.contains(d)||a.push(d)}this.IA(a);return this};
  K.prototype.clear=K.prototype.clear=function(){this.G&&z.oa(this);this.td={};this.sd=0;this.Uh=this.Ka=null;this.Jc()};K.prototype.copy=function(){var a=new K(this.ba),b=this.td,c;for(c in b)a.add(b[c].value);return a};K.prototype.toArray=K.prototype.jc=function(){var a=Array(this.sd),b=this.td,c=0,d;for(d in b)a[c]=b[d].value,c++;return a};K.prototype.toList=function(){var a=new J(this.ba),b=this.td,c;for(c in b)a.add(b[c].value);return a};z.w(K,{count:"count"},function(){return this.sd});
  z.w(K,{size:"size"},function(){return this.sd});z.w(K,{i:"iterator"},function(){if(0>=this.sd)return Pa;var a=this.ec;return null!==a?(a.reset(),a):new Wa(this)});function Za(a){this.Na=a;this.reset()}z.Yd(Za,{key:!0,value:!0});z.w(Za,{i:"iterator"},function(){return this});Za.prototype.reset=Za.prototype.reset=function(){this.nb=this.Na.H;this.lb=null};
  Za.prototype.next=Za.prototype.hasNext=Za.prototype.next=function(){var a=this.Na;if(a.H!==this.nb){if(null===this.key)return!1;z.Ta(a)}var b=this.lb,b=null===b?a.Ka:b.bb;if(null!==b)return this.lb=b,this.value=this.key=a=b.key,!0;this.Nf();return!1};Za.prototype.first=Za.prototype.first=function(){var a=this.Na;this.nb=a.H;a=a.Ka;return null!==a?(this.lb=a,this.value=this.key=a=a.key):null};
  Za.prototype.any=function(a){var b=this.Na,c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(a(d.key))return!0;b.H!==c&&z.Ta(b);d=d.bb}return!1};Za.prototype.all=function(a){var b=this.Na,c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(!a(d.key))return!1;b.H!==c&&z.Ta(b);d=d.bb}return!0};Za.prototype.each=function(a){var b=this.Na,c=b.H;this.lb=null;for(var d=b.Ka;null!==d;)a(d.key),b.H!==c&&z.Ta(b),d=d.bb;return this};
  Za.prototype.map=function(a){var b=this.Na,c=b.H;this.lb=null;for(var d=new J,e=b.Ka;null!==e;)d.add(a(e.key)),b.H!==c&&z.Ta(b),e=e.bb;return d.i};Za.prototype.filter=function(a){var b=this.Na,c=b.H;this.lb=null;for(var d=new J(b.bf),e=b.Ka;null!==e;){var g=e.key;a(g)&&d.add(g);b.H!==c&&z.Ta(b);e=e.bb}return d.i};Za.prototype.concat=function(a){return new Sa(this,a.i)};z.w(Za,{count:"count"},function(){return this.Na.sd});Za.prototype.Nf=function(){this.value=this.key=null;this.nb=-1};
  Za.prototype.toString=function(){return null!==this.lb?"MapKeySetIterator@"+this.lb.value:"MapKeySetIterator"};function $a(a){z.kc(this);this.G=!0;this.Na=a}z.Ra($a,K);$a.prototype.freeze=function(){return this};$a.prototype.Wa=function(){return this};$a.prototype.toString=function(){return"MapKeySet("+this.Na.toString()+")"};$a.prototype.add=$a.prototype.set=$a.prototype.add=function(){z.k("This Set is read-only: "+this.toString());return!1};
  $a.prototype.contains=$a.prototype.has=$a.prototype.contains=function(a){return this.Na.contains(a)};$a.prototype.remove=$a.prototype["delete"]=$a.prototype.remove=function(){z.k("This Set is read-only: "+this.toString());return!1};$a.prototype.clear=$a.prototype.clear=function(){z.k("This Set is read-only: "+this.toString())};$a.prototype.first=$a.prototype.first=function(){var a=this.Na.Ka;return null!==a?a.key:null};
  $a.prototype.any=function(a){for(var b=this.Na.Ka;null!==b;){if(a(b.key))return!0;b=b.bb}return!1};$a.prototype.all=function(a){for(var b=this.Na.Ka;null!==b;){if(!a(b.key))return!1;b=b.bb}return!0};$a.prototype.each=function(a){for(var b=this.Na.Ka;null!==b;)a(b.key),b=b.bb;return this};$a.prototype.map=function(a){for(var b=new K,c=this.Na.Ka;null!==c;)b.add(a(c.key)),c=c.bb;return b};
  $a.prototype.filter=function(a){for(var b=new K(this.Na.bf),c=this.Na.Ka;null!==c;){var d=c.key;a(d)&&b.add(d);c=c.bb}return b};$a.prototype.concat=function(a){return this.UF().$c(a)};$a.prototype.copy=function(){return new $a(this.Na)};$a.prototype.toSet=$a.prototype.UF=function(){var a=new K(this.Na.bf),b=this.Na.td,c;for(c in b)a.add(b[c].key);return a};$a.prototype.toArray=$a.prototype.jc=function(){var a=this.Na.td,b=Array(this.Na.sd),c=0,d;for(d in a)b[c]=a[d].key,c++;return b};
  $a.prototype.toList=function(){var a=new J(this.ba),b=this.Na.td,c;for(c in b)a.add(b[c].key);return a};z.w($a,{count:"count"},function(){return this.Na.sd});z.w($a,{size:"size"},function(){return this.Na.sd});z.w($a,{i:"iterator"},function(){return 0>=this.Na.sd?Pa:new Za(this.Na)});function ab(a){this.Na=a;this.reset()}z.Yd(ab,{key:!0,value:!0});z.w(ab,{i:"iterator"},function(){return this});ab.prototype.reset=ab.prototype.reset=function(){var a=this.Na;a.Nj=null;this.nb=a.H;this.lb=null};
  ab.prototype.next=ab.prototype.hasNext=ab.prototype.next=function(){var a=this.Na;if(a.H!==this.nb){if(null===this.key)return!1;z.Ta(a)}var b=this.lb,b=null===b?a.Ka:b.bb;if(null!==b)return this.lb=b,this.value=b.value,this.key=b.key,!0;this.Nf();return!1};ab.prototype.first=ab.prototype.first=function(){var a=this.Na;this.nb=a.H;a=a.Ka;if(null!==a){this.lb=a;var b=a.value;this.key=a.key;return this.value=b}return null};
  ab.prototype.any=function(a){var b=this.Na;b.Nj=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(a(d.value))return!0;b.H!==c&&z.Ta(b);d=d.bb}return!1};ab.prototype.all=function(a){var b=this.Na;b.Nj=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(!a(d.value))return!1;b.H!==c&&z.Ta(b);d=d.bb}return!0};ab.prototype.each=function(a){var b=this.Na;b.Nj=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;)a(d.value),b.H!==c&&z.Ta(b),d=d.bb;return this};
  ab.prototype.map=function(a){var b=this.Na;b.Nj=null;var c=b.H;this.lb=null;for(var d=new J,e=b.Ka;null!==e;)d.add(a(e.value)),b.H!==c&&z.Ta(b),e=e.bb;return d.i};ab.prototype.filter=function(a){var b=this.Na;b.Nj=null;var c=b.H;this.lb=null;for(var d=new J(b.bf),e=b.Ka;null!==e;){var g=e.value;a(g)&&d.add(g);b.H!==c&&z.Ta(b);e=e.bb}return d.i};ab.prototype.concat=function(a){this.Na.Nj=null;return new Sa(this,a.i)};z.w(ab,{count:"count"},function(){return this.Na.sd});
  ab.prototype.Nf=function(){this.value=this.key=null;this.nb=-1;this.Na.Nj=this};ab.prototype.toString=function(){return null!==this.lb?"MapValueSetIterator@"+this.lb.value:"MapValueSetIterator"};function Ya(a,b){this.key=a;this.value=b;this.Go=this.bb=null}z.Yd(Ya,{key:!0,value:!0});Ya.prototype.toString=function(){return"{"+this.key+":"+this.value+"}"};function bb(a){this.Na=a;this.reset()}z.Yd(bb,{key:!0,value:!0});z.w(bb,{i:"iterator"},function(){return this});
  bb.prototype.reset=bb.prototype.reset=function(){var a=this.Na;a.ec=null;this.nb=a.H;this.lb=null};bb.prototype.next=bb.prototype.hasNext=bb.prototype.next=function(){var a=this.Na;if(a.H!==this.nb){if(null===this.key)return!1;z.Ta(a)}var b=this.lb,b=null===b?a.Ka:b.bb;if(null!==b)return this.lb=b,this.key=b.key,this.value=b.value,!0;this.Nf();return!1};
  bb.prototype.first=bb.prototype.first=function(){var a=this.Na;this.nb=a.H;a=a.Ka;return null!==a?(this.lb=a,this.key=a.key,this.value=a.value,a):null};bb.prototype.any=function(a){var b=this.Na;b.ec=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(a(d))return!0;b.H!==c&&z.Ta(b);d=d.bb}return!1};bb.prototype.all=function(a){var b=this.Na;b.ec=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;){if(!a(d))return!1;b.H!==c&&z.Ta(b);d=d.bb}return!0};
  bb.prototype.each=function(a){var b=this.Na;b.ec=null;var c=b.H;this.lb=null;for(var d=b.Ka;null!==d;)a(d),b.H!==c&&z.Ta(b),d=d.bb;return this};bb.prototype.map=function(a){var b=this.Na;b.ec=null;var c=b.H;this.lb=null;for(var d=new J,e=b.Ka;null!==e;)d.add(a(e)),b.H!==c&&z.Ta(b),e=e.bb;return d.i};bb.prototype.filter=function(a){var b=this.Na;b.ec=null;var c=b.H;this.lb=null;for(var d=new J,e=b.Ka;null!==e;)a(e)&&d.add(e),b.H!==c&&z.Ta(b),e=e.bb;return d.i};
  bb.prototype.concat=function(a){this.Na.ec=null;return new Sa(this,a.i)};z.w(bb,{count:"count"},function(){return this.Na.sd});bb.prototype.Nf=function(){this.value=this.key=null;this.nb=-1;this.Na.ec=this};bb.prototype.toString=function(){return null!==this.lb?"MapIterator@"+this.lb:"MapIterator"};
  function na(a,b){z.kc(this);this.G=!1;void 0===a||null===a?this.bf=null:"string"===typeof a?"object"===a||"string"===a||"number"===a?this.bf=a:z.ka(a,"the string 'object', 'number' or 'string'","Map constructor: keytype"):"function"===typeof a?this.bf=a===Object?"object":a===String?"string":a===Number?"number":a:z.ka(a,"null, a primitive type name, or a class type","Map constructor: keytype");void 0===b||null===b?this.gi=null:"string"===typeof b?"object"===b||"string"===b||"boolean"===b||"number"===
  b||"function"===b?this.gi=b:z.ka(b,"the string 'object', 'number', 'string', 'boolean', or 'function'","Map constructor: valtype"):"function"===typeof b?this.gi=b===Object?"object":b===String?"string":b===Number?"number":b===Boolean?"boolean":b===Function?"function":b:z.ka(b,"null, a primitive type name, or a class type","Map constructor: valtype");this.td={};this.sd=0;this.Nj=this.ec=null;this.H=0;this.Uh=this.Ka=null}z.ia("Map",na);
  function cb(a,b){null!==a.bf&&("string"===typeof a.bf?typeof b===a.bf&&null!==b||z.ic(b,a.bf):b instanceof a.bf||z.ic(b,a.bf))}na.prototype.Jc=function(){var a=this.H;a++;999999999<a&&(a=0);this.H=a};na.prototype.freeze=na.prototype.freeze=function(){this.G=!0;return this};na.prototype.thaw=na.prototype.Wa=function(){this.G=!1;return this};na.prototype.toString=function(){return"Map("+z.getTypeName(this.bf)+","+z.getTypeName(this.gi)+")#"+z.nd(this)};
  na.prototype.add=na.prototype.set=na.prototype.add=function(a,b){u&&(cb(this,a),null!==this.gi&&("string"===typeof this.gi?typeof b===this.gi&&null!==b||z.ic(b,this.gi):b instanceof this.gi||z.ic(b,this.gi)));this.G&&z.oa(this,a);var c=a;z.Za(a)&&(c=z.It(a));var d=this.td[c];if(void 0===d)return this.sd++,d=new Ya(a,b),this.td[c]=d,c=this.Uh,null===c?this.Ka=d:(d.Go=c,c.bb=d),this.Uh=d,this.Jc(),!0;d.value=b;return!1};
  na.prototype.addAll=na.prototype.$c=function(a){if(null===a)return this;if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++){var d=z.Ya(a,c);this.add(d.key,d.value)}else for(a=a.i;a.next();)this.add(a.key,a.value);return this};na.prototype.first=na.prototype.first=function(){return this.Ka};na.prototype.any=function(a){for(var b=this.H,c=this.Ka;null!==c;){if(a(c))return!0;this.H!==b&&z.Ta(this);c=c.bb}return!1};
  na.prototype.all=function(a){for(var b=this.H,c=this.Ka;null!==c;){if(!a(c))return!1;this.H!==b&&z.Ta(this);c=c.bb}return!0};na.prototype.each=function(a){for(var b=this.H,c=this.Ka;null!==c;)a(c),this.H!==b&&z.Ta(this),c=c.bb;return this};na.prototype.map=function(a){for(var b=new na(this.bf),c=this.H,d=this.Ka;null!==d;)b.add(d.key,a(d)),this.H!==c&&z.Ta(this),d=d.bb;return b};
  na.prototype.filter=function(a){for(var b=new na(this.bf,this.gi),c=this.H,d=this.Ka;null!==d;)a(d)&&b.add(d.key,d.value),this.H!==c&&z.Ta(this),d=d.bb;return b};na.prototype.concat=function(a){return this.copy().$c(a)};na.prototype.contains=na.prototype.has=na.prototype.contains=function(a){u&&cb(this,a);var b=a;return z.Za(a)&&(b=z.nd(a),void 0===b)?!1:void 0!==this.td[b]};
  na.prototype.getValue=na.prototype.get=na.prototype.na=function(a){u&&cb(this,a);var b=a;if(z.Za(a)&&(b=z.nd(a),void 0===b))return null;a=this.td[b];return void 0===a?null:a.value};
  na.prototype.remove=na.prototype["delete"]=na.prototype.remove=function(a){if(null===a)return!1;u&&cb(this,a);this.G&&z.oa(this,a);var b=a;if(z.Za(a)&&(b=z.nd(a),void 0===b))return!1;a=this.td[b];if(void 0===a)return!1;var c=a.bb,d=a.Go;null!==c&&(c.Go=d);null!==d&&(d.bb=c);this.Ka===a&&(this.Ka=c);this.Uh===a&&(this.Uh=d);delete this.td[b];this.sd--;this.Jc();return!0};na.prototype.clear=na.prototype.clear=function(){this.G&&z.oa(this);this.td={};this.sd=0;this.Uh=this.Ka=null;this.Jc()};
  na.prototype.copy=function(){var a=new na(this.bf,this.gi),b=this.td,c;for(c in b){var d=b[c];a.add(d.key,d.value)}return a};na.prototype.toArray=na.prototype.jc=function(){var a=this.td,b=Array(this.sd),c=0,d;for(d in a){var e=a[d];b[c]=new Ya(e.key,e.value);c++}return b};na.prototype.toKeySet=na.prototype.vj=function(){return new $a(this)};z.w(na,{count:"count"},function(){return this.sd});z.w(na,{size:"size"},function(){return this.sd});
  z.w(na,{i:"iterator"},function(){if(0>=this.count)return Pa;var a=this.ec;return null!==a?(a.reset(),a):new bb(this)});z.w(na,{TE:"iteratorKeys"},function(){return 0>=this.count?Pa:new Za(this)});z.w(na,{UE:"iteratorValues"},function(){if(0>=this.count)return Pa;var a=this.Nj;return null!==a?(a.reset(),a):new ab(this)});function N(a,b){void 0===a?this.K=this.J=0:"number"===typeof a&&"number"===typeof b?(this.J=a,this.K=b):z.k("Invalid arguments to Point constructor: "+a+", "+b);this.G=!1}
  z.ia("Point",N);z.ji(N);z.Yd(N,{x:!0,y:!0});N.prototype.assign=function(a){this.J=a.J;this.K=a.K};N.prototype.setTo=N.prototype.n=function(a,b){u&&(z.g(a,"number",N,"setTo:x"),z.g(b,"number",N,"setTo:y"));this.J=a;this.K=b;return this};N.prototype.set=N.prototype.set=function(a){u&&z.l(a,N,N,"set:p");this.Pa();this.J=a.J;this.K=a.K;return this};N.prototype.copy=function(){var a=new N;a.J=this.J;a.K=this.K;return a};f=N.prototype;f.La=function(){this.G=!0;Object.freeze(this);return this};
  f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.G=!0;return this};f.Wa=function(){Object.isFrozen(this)&&z.k("cannot thaw constant: "+this);this.G=!1;return this};f.Pa=function(a){if(this.G){var b="The Point is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);z.k(b)}};
  N.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 N(c,e)}return new N};N.stringify=function(a){return a instanceof N?a.x.toString()+" "+a.y.toString():a.toString()};N.prototype.toString=function(){return"Point("+this.x+","+this.y+")"};N.prototype.equals=N.prototype.N=function(a){return a instanceof N?this.J===a.x&&this.K===a.y:!1};
  N.prototype.equalTo=N.prototype.Xw=function(a,b){return this.J===a&&this.K===b};N.prototype.equalsApprox=N.prototype.Mc=function(a){return eb(this.J,a.x)&&eb(this.K,a.y)};N.prototype.add=N.prototype.add=function(a){u&&z.l(a,N,N,"add:p");this.Pa();this.J+=a.x;this.K+=a.y;return this};N.prototype.subtract=N.prototype.xu=function(a){u&&z.l(a,N,N,"subtract:p");this.Pa();this.J-=a.x;this.K-=a.y;return this};
  N.prototype.offset=N.prototype.offset=function(a,b){u&&(z.p(a,N,"offset:dx"),z.p(b,N,"offset:dy"));this.Pa();this.J+=a;this.K+=b;return this};N.prototype.rotate=N.prototype.rotate=function(a){u&&z.p(a,N,"rotate:angle");this.Pa();if(0===a)return this;var b=this.J,c=this.K;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.J=d*b-e*c;this.K=e*b+d*c;return this};
  N.prototype.scale=N.prototype.scale=function(a,b){u&&(z.p(a,N,"scale:sx"),z.p(b,N,"scale:sy"));this.J*=a;this.K*=b;return this};N.prototype.distanceSquaredPoint=N.prototype.Af=function(a){u&&z.l(a,N,N,"distanceSquaredPoint:p");var b=a.x-this.J;a=a.y-this.K;return b*b+a*a};N.prototype.distanceSquared=N.prototype.jp=function(a,b){u&&(z.p(a,N,"distanceSquared:px"),z.p(b,N,"distanceSquared:py"));var c=a-this.J,d=b-this.K;return c*c+d*d};
  N.prototype.normalize=N.prototype.normalize=function(){this.Pa();var a=this.J,b=this.K,c=Math.sqrt(a*a+b*b);0<c&&(this.J=a/c,this.K=b/c);return this};N.prototype.directionPoint=N.prototype.Ec=function(a){u&&z.l(a,N,N,"directionPoint:p");return fb(a.x-this.J,a.y-this.K)};N.prototype.direction=N.prototype.direction=function(a,b){u&&(z.p(a,N,"direction:px"),z.p(b,N,"direction:py"));return fb(a-this.J,b-this.K)};
  function fb(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}N.prototype.projectOntoLineSegment=function(a,b,c,d){u&&(z.p(a,N,"projectOntoLineSegment:px"),z.p(b,N,"projectOntoLineSegment:py"),z.p(c,N,"projectOntoLineSegment:qx"),z.p(d,N,"projectOntoLineSegment:qy"));ib(a,b,c,d,this.J,this.K,this);return this};
  N.prototype.projectOntoLineSegmentPoint=function(a,b){u&&(z.l(a,N,N,"projectOntoLineSegmentPoint:p"),z.l(b,N,N,"projectOntoLineSegmentPoint:q"));ib(a.x,a.y,b.x,b.y,this.J,this.K,this);return this};N.prototype.snapToGrid=function(a,b,c,d){u&&(z.p(a,N,"snapToGrid:originx"),z.p(b,N,"snapToGrid:originy"),z.p(c,N,"snapToGrid:cellwidth"),z.p(d,N,"snapToGrid:cellheight"));jb(this.J,this.K,a,b,c,d,this);return this};
  N.prototype.snapToGridPoint=function(a,b){u&&(z.l(a,N,N,"snapToGridPoint:p"),z.l(b,Ea,N,"snapToGridPoint:q"));jb(this.J,this.K,a.x,a.y,b.width,b.height,this);return this};N.prototype.setRectSpot=N.prototype.ru=function(a,b){u&&(z.l(a,w,N,"setRectSpot:r"),z.l(b,Q,N,"setRectSpot:spot"));this.Pa();this.J=a.x+b.x*a.width+b.offsetX;this.K=a.y+b.y*a.height+b.offsetY;return this};
  N.prototype.setSpot=N.prototype.tu=function(a,b,c,d,e){u&&(z.p(a,N,"setSpot:x"),z.p(b,N,"setSpot:y"),z.p(c,N,"setSpot:w"),z.p(d,N,"setSpot:h"),(0>c||0>d)&&z.k("Point.setSpot:Width and height cannot be negative"),z.l(e,Q,N,"setSpot:spot"));this.Pa();this.J=a+e.x*c+e.offsetX;this.K=b+e.y*d+e.offsetY;return this};N.prototype.transform=function(a){u&&z.l(a,Fa,N,"transform:t");a.Cb(this);return this};function tb(a,b){u&&z.l(b,Fa,N,"transformInverted:t");b.li(a);return a}var ub;
  N.distanceLineSegmentSquared=ub=function(a,b,c,d,e,g){u&&(z.p(a,N,"distanceLineSegmentSquared:px"),z.p(b,N,"distanceLineSegmentSquared:py"),z.p(c,N,"distanceLineSegmentSquared:ax"),z.p(d,N,"distanceLineSegmentSquared:ay"),z.p(e,N,"distanceLineSegmentSquared:bx"),z.p(g,N,"distanceLineSegmentSquared:by"));var h=e-c,k=g-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=g-b,Math.min(c*c+d*d,h*h+k*k);a=h*d-k*c;return a*a/l};var vb;
  N.distanceSquared=vb=function(a,b,c,d){u&&(z.p(a,N,"distanceSquared:px"),z.p(b,N,"distanceSquared:py"),z.p(c,N,"distanceSquared:qx"),z.p(d,N,"distanceSquared:qy"));a=c-a;b=d-b;return a*a+b*b};var wb;
  N.direction=wb=function(a,b,c,d){u&&(z.p(a,N,"direction:px"),z.p(b,N,"direction:py"),z.p(c,N,"direction:qx"),z.p(d,N,"direction:qy"));a=c-a;b=d-b;if(0===a)return 0<b?90:0>b?270:0;if(0===b)return 0<a?0:180;if(isNaN(a)||isNaN(b))return 0;d=180*Math.atan(Math.abs(b/a))/Math.PI;0>a?d=0>b?d+180:180-d:0>b&&(d=360-d);return d};z.defineProperty(N,{x:"x"},function(){return this.J},function(a){this.Pa(a);u&&z.g(a,"number",N,"x");this.J=a});
  z.defineProperty(N,{y:"y"},function(){return this.K},function(a){this.Pa(a);u&&z.g(a,"number",N,"y");this.K=a});N.prototype.isReal=N.prototype.F=function(){return isFinite(this.x)&&isFinite(this.y)};function Ea(a,b){void 0===a?this.Ea=this.Fa=0:"number"===typeof a&&(0<=a||isNaN(a))&&"number"===typeof b&&(0<=b||isNaN(b))?(this.Fa=a,this.Ea=b):z.k("Invalid arguments to Size constructor: "+a+", "+b);this.G=!1}z.ia("Size",Ea);z.ji(Ea);z.Yd(Ea,{width:!0,height:!0});
  Ea.prototype.assign=function(a){this.Fa=a.Fa;this.Ea=a.Ea};Ea.prototype.setTo=Ea.prototype.n=function(a,b){u&&(z.g(a,"number",Ea,"setTo:w"),z.g(b,"number",Ea,"setTo:h"),0>a&&z.ka(a,">= 0",Ea,"setTo:w"),0>b&&z.ka(b,">= 0",Ea,"setTo:h"));this.Fa=a;this.Ea=b;return this};Ea.prototype.set=Ea.prototype.set=function(a){u&&z.l(a,Ea,Ea,"set:s");this.Pa();this.Fa=a.Fa;this.Ea=a.Ea;return this};Ea.prototype.copy=function(){var a=new Ea;a.Fa=this.Fa;a.Ea=this.Ea;return a};f=Ea.prototype;
  f.La=function(){this.G=!0;Object.freeze(this);return this};f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.G=!0;return this};f.Wa=function(){Object.isFrozen(this)&&z.k("cannot thaw constant: "+this);this.G=!1;return this};f.Pa=function(a){if(this.G){var b="The Size is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);z.k(b)}};
  Ea.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 Ea(c,e)}return new Ea};Ea.stringify=function(a){return a instanceof Ea?a.width.toString()+" "+a.height.toString():a.toString()};Ea.prototype.toString=function(){return"Size("+this.width+","+this.height+")"};
  Ea.prototype.equals=Ea.prototype.N=function(a){return a instanceof Ea?this.Fa===a.width&&this.Ea===a.height:!1};Ea.prototype.equalTo=Ea.prototype.Xw=function(a,b){return this.Fa===a&&this.Ea===b};Ea.prototype.equalsApprox=Ea.prototype.Mc=function(a){return eb(this.Fa,a.width)&&eb(this.Ea,a.height)};z.defineProperty(Ea,{width:"width"},function(){return this.Fa},function(a){this.Pa(a);u&&z.g(a,"number",Ea,"width");0>a&&z.ka(a,">= 0",Ea,"width");this.Fa=a});
  z.defineProperty(Ea,{height:"height"},function(){return this.Ea},function(a){this.Pa(a);u&&z.g(a,"number",Ea,"height");0>a&&z.ka(a,">= 0",Ea,"height");this.Ea=a});Ea.prototype.isReal=Ea.prototype.F=function(){return isFinite(this.width)&&isFinite(this.height)};
  function w(a,b,c,d){void 0===a?this.Ea=this.Fa=this.K=this.J=0:a instanceof N?b instanceof N?(this.J=Math.min(a.J,b.J),this.K=Math.min(a.K,b.K),this.Fa=Math.abs(a.J-b.J),this.Ea=Math.abs(a.K-b.K)):b instanceof Ea?(this.J=a.J,this.K=a.K,this.Fa=b.Fa,this.Ea=b.Ea):z.k("Incorrect arguments supplied to Rect constructor"):"number"===typeof a&&"number"===typeof b&&"number"===typeof c&&(0<=c||isNaN(c))&&"number"===typeof d&&(0<=d||isNaN(d))?(this.J=a,this.K=b,this.Fa=c,this.Ea=d):z.k("Invalid arguments to Rect constructor: "+
  a+", "+b+", "+c+", "+d);this.G=!1}z.ia("Rect",w);z.ji(w);z.Yd(w,{x:!0,y:!0,width:!0,height:!0});w.prototype.assign=function(a){this.J=a.J;this.K=a.K;this.Fa=a.Fa;this.Ea=a.Ea};function yb(a,b,c){a.Fa=b;a.Ea=c}w.prototype.setTo=w.prototype.n=function(a,b,c,d){u&&(z.g(a,"number",w,"setTo:x"),z.g(b,"number",w,"setTo:y"),z.g(c,"number",w,"setTo:w"),z.g(d,"number",w,"setTo:h"),0>c&&z.ka(c,">= 0",w,"setTo:w"),0>d&&z.ka(d,">= 0",w,"setTo:h"));this.J=a;this.K=b;this.Fa=c;this.Ea=d;return this};
  w.prototype.set=w.prototype.set=function(a){u&&z.l(a,w,w,"set:r");this.Pa();this.J=a.J;this.K=a.K;this.Fa=a.Fa;this.Ea=a.Ea;return this};w.prototype.setPoint=w.prototype.Kf=function(a){u&&z.l(a,N,w,"setPoint:p");this.Pa();this.J=a.J;this.K=a.K;return this};w.prototype.setSize=function(a){u&&z.l(a,Ea,w,"setSize:s");this.Pa();this.Fa=a.Fa;this.Ea=a.Ea;return this};w.prototype.copy=function(){var a=new w;a.J=this.J;a.K=this.K;a.Fa=this.Fa;a.Ea=this.Ea;return a};f=w.prototype;
  f.La=function(){this.G=!0;Object.freeze(this);return this};f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.G=!0;return this};f.Wa=function(){Object.isFrozen(this)&&z.k("cannot thaw constant: "+this);this.G=!1;return this};f.Pa=function(a){if(this.G){var b="The Rect is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);z.k(b)}};
  w.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 g=0;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return new w(c,e,g,h)}return new w};w.stringify=function(a){return a instanceof w?a.x.toString()+" "+a.y.toString()+" "+a.width.toString()+" "+a.height.toString():a.toString()};
  w.prototype.toString=function(){return"Rect("+this.x+","+this.y+","+this.width+","+this.height+")"};w.prototype.equals=w.prototype.N=function(a){return a instanceof w?this.J===a.x&&this.K===a.y&&this.Fa===a.width&&this.Ea===a.height:!1};w.prototype.equalTo=w.prototype.Xw=function(a,b,c,d){return this.J===a&&this.K===b&&this.Fa===c&&this.Ea===d};w.prototype.equalsApprox=w.prototype.Mc=function(a){return eb(this.J,a.x)&&eb(this.K,a.y)&&eb(this.Fa,a.width)&&eb(this.Ea,a.height)};
  w.prototype.containsPoint=w.prototype.Ma=function(a){u&&z.l(a,N,w,"containsPoint:p");return this.J<=a.x&&this.J+this.Fa>=a.x&&this.K<=a.y&&this.K+this.Ea>=a.y};w.prototype.containsRect=w.prototype.nk=function(a){u&&z.l(a,w,w,"containsRect:r");return this.J<=a.x&&a.x+a.width<=this.J+this.Fa&&this.K<=a.y&&a.y+a.height<=this.K+this.Ea};
  w.prototype.contains=w.prototype.contains=function(a,b,c,d){u?(z.p(a,w,"contains:x"),z.p(b,w,"contains:y"),void 0===c?c=0:z.p(c,w,"contains:w"),void 0===d?d=0:z.p(d,w,"contains:h"),(0>c||0>d)&&z.k("Rect.contains:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return this.J<=a&&a+c<=this.J+this.Fa&&this.K<=b&&b+d<=this.K+this.Ea};w.prototype.reset=function(){this.Pa();this.Ea=this.Fa=this.K=this.J=0};
  w.prototype.offset=w.prototype.offset=function(a,b){u&&(z.p(a,w,"offset:dx"),z.p(b,w,"offset:dy"));this.Pa();this.J+=a;this.K+=b;return this};w.prototype.inflate=w.prototype.bg=function(a,b){u&&(z.p(a,w,"inflate:w"),z.p(b,w,"inflate:h"));return zb(this,b,a,b,a)};w.prototype.addMargin=w.prototype.Dw=function(a){u&&z.l(a,Db,w,"addMargin:m");return zb(this,a.top,a.right,a.bottom,a.left)};
  w.prototype.subtractMargin=w.prototype.qJ=function(a){u&&z.l(a,Db,w,"subtractMargin:m");return zb(this,-a.top,-a.right,-a.bottom,-a.left)};w.prototype.grow=function(a,b,c,d){u&&(z.p(a,w,"grow:t"),z.p(b,w,"grow:r"),z.p(c,w,"grow:b"),z.p(d,w,"grow:l"));return zb(this,a,b,c,d)};function zb(a,b,c,d,e){a.Pa();var g=a.Fa;c+e<=-g?(a.J+=g/2,a.Fa=0):(a.J-=e,a.Fa+=c+e);c=a.Ea;b+d<=-c?(a.K+=c/2,a.Ea=0):(a.K-=b,a.Ea+=b+d);return a}
  w.prototype.intersectRect=function(a){u&&z.l(a,w,w,"intersectRect:r");return Eb(this,a.x,a.y,a.width,a.height)};w.prototype.intersect=function(a,b,c,d){u&&(z.p(a,w,"intersect:x"),z.p(b,w,"intersect:y"),z.p(c,w,"intersect:w"),z.p(d,w,"intersect:h"),(0>c||0>d)&&z.k("Rect.intersect:Width and height cannot be negative"));return Eb(this,a,b,c,d)};
  function Eb(a,b,c,d,e){a.Pa();var g=Math.max(a.J,b),h=Math.max(a.K,c);b=Math.min(a.J+a.Fa,b+d);c=Math.min(a.K+a.Ea,c+e);a.J=g;a.K=h;a.Fa=Math.max(0,b-g);a.Ea=Math.max(0,c-h);return a}w.prototype.intersectsRect=w.prototype.Jg=function(a){u&&z.l(a,w,w,"intersectsRect:r");return this.FE(a.x,a.y,a.width,a.height)};
  w.prototype.intersects=w.prototype.FE=function(a,b,c,d){u&&(z.p(a,w,"intersects:x"),z.p(b,w,"intersects:y"),z.p(a,w,"intersects:w"),z.p(b,w,"intersects:h"),(0>c||0>d)&&z.k("Rect.intersects:Width and height cannot be negative"));var e=this.Fa,g=this.J;if(Infinity!==e&&Infinity!==c&&(e+=g,c+=a,isNaN(c)||isNaN(e)||g>c||a>e))return!1;a=this.Ea;c=this.K;return Infinity!==a&&Infinity!==d&&(a+=c,d+=b,isNaN(d)||isNaN(a)||c>d||b>a)?!1:!0};
  function Gb(a,b){var c=a.Fa,d=b.width+10+10,e=a.J,g=b.x-10;if(e>d+g||g>c+e)return!1;c=a.Ea;d=b.height+10+10;e=a.K;g=b.y-10;return e>d+g||g>c+e?!1:!0}w.prototype.unionPoint=w.prototype.wj=function(a){u&&z.l(a,N,w,"unionPoint:p");return Hb(this,a.x,a.y,0,0)};w.prototype.unionRect=w.prototype.ri=function(a){u&&z.l(a,w,w,"unionRect:r");return Hb(this,a.J,a.K,a.Fa,a.Ea)};
  w.prototype.union=w.prototype.cG=function(a,b,c,d){this.Pa();u?(z.p(a,w,"union:x"),z.p(b,w,"union:y"),void 0===c?c=0:z.p(c,w,"union:w"),void 0===d?d=0:z.p(d,w,"union:h"),(0>c||0>d)&&z.k("Rect.union:Width and height cannot be negative")):(void 0===c&&(c=0),void 0===d&&(d=0));return Hb(this,a,b,c,d)};function Hb(a,b,c,d,e){var g=Math.min(a.J,b),h=Math.min(a.K,c);b=Math.max(a.J+a.Fa,b+d);c=Math.max(a.K+a.Ea,c+e);a.J=g;a.K=h;a.Fa=b-g;a.Ea=c-h;return a}
  w.prototype.setSpot=w.prototype.tu=function(a,b,c){u&&(z.p(a,w,"setSpot:x"),z.p(b,w,"setSpot:y"),z.l(c,Q,w,"setSpot:spot"));this.Pa();this.J=a-c.offsetX-c.x*this.Fa;this.K=b-c.offsetY-c.y*this.Ea;return this};var Ib;
  w.contains=Ib=function(a,b,c,d,e,g,h,k){u?(z.p(a,w,"contains:rx"),z.p(b,w,"contains:ry"),z.p(c,w,"contains:rw"),z.p(d,w,"contains:rh"),z.p(e,w,"contains:x"),z.p(g,w,"contains:y"),void 0===h?h=0:z.p(h,w,"contains:w"),void 0===k?k=0:z.p(k,w,"contains:h"),(0>c||0>d||0>h||0>k)&&z.k("Rect.contains:Width and height cannot be negative")):(void 0===h&&(h=0),void 0===k&&(k=0));return a<=e&&e+h<=a+c&&b<=g&&g+k<=b+d};
  w.intersects=function(a,b,c,d,e,g,h,k){u&&(z.p(a,w,"intersects:rx"),z.p(b,w,"intersects:ry"),z.p(c,w,"intersects:rw"),z.p(d,w,"intersects:rh"),z.p(e,w,"intersects:x"),z.p(g,w,"intersects:y"),z.p(h,w,"intersects:w"),z.p(k,w,"intersects:h"),(0>c||0>d||0>h||0>k)&&z.k("Rect.intersects:Width and height cannot be negative"));c+=a;h+=e;if(a>h||e>c)return!1;a=d+b;k+=g;return b>k||g>a?!1:!0};z.defineProperty(w,{x:"x"},function(){return this.J},function(a){this.Pa(a);u&&z.g(a,"number",w,"x");this.J=a});
  z.defineProperty(w,{y:"y"},function(){return this.K},function(a){this.Pa(a);u&&z.g(a,"number",w,"y");this.K=a});z.defineProperty(w,{width:"width"},function(){return this.Fa},function(a){this.Pa(a);u&&z.g(a,"number",w,"width");0>a&&z.ka(a,">= 0",w,"width");this.Fa=a});z.defineProperty(w,{height:"height"},function(){return this.Ea},function(a){this.Pa(a);u&&z.g(a,"number",w,"height");0>a&&z.ka(a,">= 0",w,"height");this.Ea=a});
  z.defineProperty(w,{left:"left"},function(){return this.J},function(a){this.Pa(a);u&&z.g(a,"number",w,"left");this.J=a});z.defineProperty(w,{top:"top"},function(){return this.K},function(a){this.Pa(a);u&&z.g(a,"number",w,"top");this.K=a});z.defineProperty(w,{right:"right"},function(){return this.J+this.Fa},function(a){this.Pa(a);u&&z.p(a,w,"right");this.J+=a-(this.J+this.Fa)});
  z.defineProperty(w,{bottom:"bottom"},function(){return this.K+this.Ea},function(a){this.Pa(a);u&&z.p(a,w,"top");this.K+=a-(this.K+this.Ea)});z.defineProperty(w,{position:"position"},function(){return new N(this.J,this.K)},function(a){this.Pa(a);u&&z.l(a,N,w,"position");this.J=a.x;this.K=a.y});z.defineProperty(w,{size:"size"},function(){return new Ea(this.Fa,this.Ea)},function(a){this.Pa(a);u&&z.l(a,Ea,w,"size");this.Fa=a.width;this.Ea=a.height});
  z.defineProperty(w,{yl:"center"},function(){return new N(this.J+this.Fa/2,this.K+this.Ea/2)},function(a){this.Pa(a);u&&z.l(a,N,w,"center");this.J=a.x-this.Fa/2;this.K=a.y-this.Ea/2});z.defineProperty(w,{ra:"centerX"},function(){return this.J+this.Fa/2},function(a){this.Pa(a);u&&z.p(a,w,"centerX");this.J=a-this.Fa/2});z.defineProperty(w,{za:"centerY"},function(){return this.K+this.Ea/2},function(a){this.Pa(a);u&&z.p(a,w,"centerY");this.K=a-this.Ea/2});
  w.prototype.isReal=w.prototype.F=function(){return isFinite(this.x)&&isFinite(this.y)&&isFinite(this.width)&&isFinite(this.height)};w.prototype.isEmpty=function(){return 0===this.width&&0===this.height};
  function Db(a,b,c,d){void 0===a?this.gh=this.Yg=this.oh=this.ph=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):z.k("Invalid arguments to Margin constructor: "+a+", "+b+", "+c+", "+d);this.G=!1}z.ia("Margin",Db);z.ji(Db);z.Yd(Db,{top:!0,right:!0,bottom:!0,left:!0});Db.prototype.assign=function(a){this.ph=a.ph;this.oh=a.oh;this.Yg=a.Yg;this.gh=a.gh};
  Db.prototype.setTo=Db.prototype.n=function(a,b,c,d){u&&(z.g(a,"number",Db,"setTo:t"),z.g(b,"number",Db,"setTo:r"),z.g(c,"number",Db,"setTo:b"),z.g(d,"number",Db,"setTo:l"));this.Pa();this.ph=a;this.oh=b;this.Yg=c;this.gh=d;return this};Db.prototype.set=Db.prototype.set=function(a){u&&z.l(a,Db,Db,"assign:m");this.Pa();this.ph=a.ph;this.oh=a.oh;this.Yg=a.Yg;this.gh=a.gh;return this};Db.prototype.copy=function(){var a=new Db;a.ph=this.ph;a.oh=this.oh;a.Yg=this.Yg;a.gh=this.gh;return a};f=Db.prototype;
  f.La=function(){this.G=!0;Object.freeze(this);return this};f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.G=!0;return this};f.Wa=function(){Object.isFrozen(this)&&z.k("cannot thaw constant: "+this);this.G=!1;return this};f.Pa=function(a){if(this.G){var b="The Margin is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);z.k(b)}};
  Db.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 Db;for(var e=NaN;""===a[b];)b++;(d=a[b++])&&(e=parseFloat(d));if(isNaN(e))return new Db(c);for(var g=NaN;""===a[b];)b++;(d=a[b++])&&(g=parseFloat(d));if(isNaN(g))return new Db(c,e);for(var h=NaN;""===a[b];)b++;(d=a[b++])&&(h=parseFloat(d));return isNaN(h)?new Db(c,e):new Db(c,e,g,h)}return new Db};
  Db.stringify=function(a){return a instanceof Db?a.top.toString()+" "+a.right.toString()+" "+a.bottom.toString()+" "+a.left.toString():a.toString()};Db.prototype.toString=function(){return"Margin("+this.top+","+this.right+","+this.bottom+","+this.left+")"};Db.prototype.equals=Db.prototype.N=function(a){return a instanceof Db?this.ph===a.top&&this.oh===a.right&&this.Yg===a.bottom&&this.gh===a.left:!1};
  Db.prototype.equalTo=Db.prototype.Xw=function(a,b,c,d){return this.ph===a&&this.oh===b&&this.Yg===c&&this.gh===d};Db.prototype.equalsApprox=Db.prototype.Mc=function(a){return eb(this.ph,a.top)&&eb(this.oh,a.right)&&eb(this.Yg,a.bottom)&&eb(this.gh,a.left)};z.defineProperty(Db,{top:"top"},function(){return this.ph},function(a){this.Pa(a);u&&z.p(a,Db,"top");this.ph=a});z.defineProperty(Db,{right:"right"},function(){return this.oh},function(a){this.Pa(a);u&&z.p(a,Db,"right");this.oh=a});
  z.defineProperty(Db,{bottom:"bottom"},function(){return this.Yg},function(a){this.Pa(a);u&&z.p(a,Db,"bottom");this.Yg=a});z.defineProperty(Db,{left:"left"},function(){return this.gh},function(a){this.Pa(a);u&&z.p(a,Db,"left");this.gh=a});Db.prototype.isReal=Db.prototype.F=function(){return isFinite(this.top)&&isFinite(this.right)&&isFinite(this.bottom)&&isFinite(this.left)};function Fa(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0}z.ji(Fa);
  z.Yd(Fa,{m11:!0,m12:!0,m21:!0,m22:!0,dx:!0,dy:!0});Fa.prototype.set=Fa.prototype.set=function(a){u&&z.l(a,Fa,Fa,"set:t");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};Fa.prototype.copy=function(){var a=new Fa;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};Fa.prototype.toString=function(){return"Transform("+this.m11+","+this.m12+","+this.m21+","+this.m22+","+this.dx+","+this.dy+")"};
  Fa.prototype.equals=Fa.prototype.N=function(a){return a instanceof Fa?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};Fa.prototype.isIdentity=Fa.prototype.Pt=function(){return 1===this.m11&&0===this.m12&&0===this.m21&&1===this.m22&&0===this.dx&&0===this.dy};Fa.prototype.reset=Fa.prototype.reset=function(){this.m11=1;this.m21=this.m12=0;this.m22=1;this.dy=this.dx=0;return this};
  Fa.prototype.multiply=Fa.prototype.multiply=function(a){u&&z.l(a,Fa,Fa,"multiply:matrix");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,g=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=g;return this};
  Fa.prototype.multiplyInverted=Fa.prototype.vA=function(a){u&&z.l(a,Fa,Fa,"multiplyInverted:matrix");var b=1/(a.m11*a.m22-a.m12*a.m21),c=a.m22*b,d=-a.m12*b,e=-a.m21*b,g=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*g;e=this.m12*e+this.m22*g;g=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=g;this.dy=h;return this};
  Fa.prototype.invert=Fa.prototype.fA=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),g=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=g;return this};
  Fa.prototype.rotate=Fa.prototype.rotate=function(a,b,c){u&&(z.p(a,Fa,"rotate:angle"),z.p(b,Fa,"rotate:rx"),z.p(c,Fa,"rotate:ry"));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 g=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=g;this.m22=h;this.translate(-b,-c);return this};
  Fa.prototype.translate=Fa.prototype.translate=function(a,b){u&&(z.p(a,Fa,"translate:x"),z.p(b,Fa,"translate:y"));this.dx+=this.m11*a+this.m21*b;this.dy+=this.m12*a+this.m22*b;return this};Fa.prototype.scale=Fa.prototype.scale=function(a,b){void 0===b&&(b=a);u&&(z.p(a,Fa,"translate:sx"),z.p(b,Fa,"translate:sy"));this.m11*=a;this.m12*=a;this.m21*=b;this.m22*=b;return this};
  Fa.prototype.transformPoint=Fa.prototype.Cb=function(a){u&&z.l(a,N,Fa,"transformPoint:p");var b=a.J,c=a.K;a.J=b*this.m11+c*this.m21+this.dx;a.K=b*this.m12+c*this.m22+this.dy;return a};Fa.prototype.invertedTransformPoint=Fa.prototype.li=function(a){u&&z.l(a,N,Fa,"invertedTransformPoint:p");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),g=a.J,h=a.K;a.J=g*this.m22*b+h*-this.m21*b+b*(this.m21*this.dy-this.m22*this.dx);a.K=g*c+h*d+e;return a};
  Fa.prototype.transformRect=Fa.prototype.aG=function(a){u&&z.l(a,w,Fa,"transformRect:rect");var b=a.J,c=a.K,d=b+a.Fa,e=c+a.Ea,g=this.m11,h=this.m12,k=this.m21,l=this.m22,m=this.dx,n=this.dy,p=b*g+c*k+m,q=b*h+c*l+n,r=d*g+c*k+m,c=d*h+c*l+n,s=b*g+e*k+m,b=b*h+e*l+n,g=d*g+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,g),e=Math.max(e,g),h=Math.min(h,d),q=Math.max(q,d);a.J=p;a.K=h;a.Fa=
  e-p;a.Ea=q-h;return a};function Q(a,b,c,d){void 0===a?this.yg=this.xg=this.K=this.J=0:(void 0===b&&(b=0),void 0===c&&(c=0),void 0===d&&(d=0),this.x=a,this.y=b,this.offsetX=c,this.offsetY=d);this.G=!1}z.ia("Spot",Q);z.ji(Q);z.Yd(Q,{x:!0,y:!0,offsetX:!0,offsetY:!0});Q.prototype.assign=function(a){this.J=a.J;this.K=a.K;this.xg=a.xg;this.yg=a.yg};
  Q.prototype.setTo=Q.prototype.n=function(a,b,c,d){u&&(Kb(a,"setTo:x"),Kb(b,"setTo:y"),Pb(c,"setTo:offx"),Pb(d,"setTo:offy"));this.Pa();this.J=a;this.K=b;this.xg=c;this.yg=d;return this};Q.prototype.set=Q.prototype.set=function(a){u&&z.l(a,Q,Q,"set:s");this.Pa();this.J=a.J;this.K=a.K;this.xg=a.xg;this.yg=a.yg;return this};Q.prototype.copy=function(){var a=new Q;a.J=this.J;a.K=this.K;a.xg=this.xg;a.yg=this.yg;return a};f=Q.prototype;f.La=function(){this.G=!0;Object.freeze(this);return this};
  f.V=function(){return Object.isFrozen(this)?this:this.copy().freeze()};f.freeze=function(){this.G=!0;return this};f.Wa=function(){Object.isFrozen(this)&&z.k("cannot thaw constant: "+this);this.G=!1;return this};f.Pa=function(a){if(this.G){var b="The Spot is frozen, so its properties cannot be set: "+this.toString();void 0!==a&&(b+="  to value: "+a);z.k(b)}};function Tb(a,b){a.J=NaN;a.K=NaN;a.xg=b;return a}function Kb(a,b){(isNaN(a)||1<a||0>a)&&z.ka(a,"0 <= "+b+" <= 1",Q,b)}
  function Pb(a,b){(isNaN(a)||Infinity===a||-Infinity===a)&&z.ka(a,"real number, not NaN or Infinity",Q,b)}var Ub;
  Q.parse=Ub=function(a){if("string"===typeof a){a=a.trim();if("None"===a)return Yb;if("TopLeft"===a)return Zb;if("Top"===a||"TopCenter"===a||"MiddleTop"===a)return $b;if("TopRight"===a)return cc;if("Left"===a||"LeftCenter"===a||"MiddleLeft"===a)return dc;if("Center"===a)return ec;if("Right"===a||"RightCenter"===a||"MiddleRight"===a)return fc;if("BottomLeft"===a)return gc;if("Bottom"===a||"BottomCenter"===a||"MiddleBottom"===a)return hc;if("BottomRight"===a)return ic;if("TopSide"===a)return pc;if("LeftSide"===
  a)return qc;if("RightSide"===a)return sc;if("BottomSide"===a)return tc;if("TopBottomSides"===a)return uc;if("LeftRightSides"===a)return vc;if("TopLeftSides"===a)return wc;if("TopRightSides"===a)return xc;if("BottomLeftSides"===a)return Cc;if("BottomRightSides"===a)return Dc;if("NotTopSide"===a)return Ec;if("NotLeftSide"===a)return Fc;if("NotRightSide"===a)return Gc;if("NotBottomSide"===a)return Hc;if("AllSides"===a)return Ic;if("Default"===a)return Pc;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 g=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(g=parseFloat(d));for(var h=0;""===a[b];)b++;d=a[b++];void 0!==d&&0<d.length&&(h=parseFloat(d));return new Q(c,e,g,h)}return new Q};Q.stringify=function(a){return a instanceof Q?a.cd()?a.x.toString()+" "+a.y.toString()+" "+a.offsetX.toString()+" "+a.offsetY.toString():a.toString():a.toString()};
  Q.prototype.toString=function(){return this.cd()?0===this.xg&&0===this.yg?"Spot("+this.x+","+this.y+")":"Spot("+this.x+","+this.y+","+this.offsetX+","+this.offsetY+")":this.N(Yb)?"None":this.N(Zb)?"TopLeft":this.N($b)?"Top":this.N(cc)?"TopRight":this.N(dc)?"Left":this.N(ec)?"Center":this.N(fc)?"Right":this.N(gc)?"BottomLeft":this.N(hc)?"Bottom":this.N(ic)?"BottomRight":this.N(pc)?"TopSide":this.N(qc)?"LeftSide":this.N(sc)?"RightSide":this.N(tc)?"BottomSide":this.N(uc)?"TopBottomSides":this.N(vc)?
  "LeftRightSides":this.N(wc)?"TopLeftSides":this.N(xc)?"TopRightSides":this.N(Cc)?"BottomLeftSides":this.N(Dc)?"BottomRightSides":this.N(Ec)?"NotTopSide":this.N(Fc)?"NotLeftSide":this.N(Gc)?"NotRightSide":this.N(Hc)?"NotBottomSide":this.N(Ic)?"AllSides":this.N(Pc)?"Default":"None"};Q.prototype.equals=Q.prototype.N=function(a){return a instanceof Q?(this.J===a.x||isNaN(this.J)&&isNaN(a.x))&&(this.K===a.y||isNaN(this.K)&&isNaN(a.y))&&this.xg===a.offsetX&&this.yg===a.offsetY:!1};
  Q.prototype.opposite=function(){return new Q(.5-(this.J-.5),.5-(this.K-.5),-this.xg,-this.yg)};Q.prototype.includesSide=Q.prototype.vp=function(a){if(!this.lj())return!1;if(!a.lj())if(a.N(Qc))a=qc;else if(a.N(Rc))a=sc;else if(a.N(Sc))a=pc;else if(a.N(Tc))a=tc;else return!1;a=a.offsetY;return(this.yg&a)===a};z.defineProperty(Q,{x:"x"},function(){return this.J},function(a){this.Pa(a);u&&Kb(a,"x");this.J=a});
  z.defineProperty(Q,{y:"y"},function(){return this.K},function(a){this.Pa(a);u&&Kb(a,"y");this.K=a});z.defineProperty(Q,{offsetX:"offsetX"},function(){return this.xg},function(a){this.Pa(a);u&&Pb(a,"offsetX");this.xg=a});z.defineProperty(Q,{offsetY:"offsetY"},function(){return this.yg},function(a){this.Pa(a);u&&Pb(a,"offsetY");this.yg=a});Q.prototype.isSpot=Q.prototype.cd=function(){return!isNaN(this.x)&&!isNaN(this.y)};Q.prototype.isNoSpot=Q.prototype.Be=function(){return isNaN(this.x)||isNaN(this.y)};
  Q.prototype.isSide=Q.prototype.lj=function(){return this.Be()&&1===this.offsetX&&0!==this.offsetY};Q.prototype.isDefault=Q.prototype.bd=function(){return isNaN(this.x)&&isNaN(this.y)&&-1===this.offsetX&&0===this.offsetY};var Yb;Q.None=Yb=Tb(new Q(0,0,0,0),0).La();var Pc;Q.Default=Pc=Tb(new Q(0,0,-1,0),-1).La();var Zb;Q.TopLeft=Zb=(new Q(0,0,0,0)).La();var $b;Q.TopCenter=$b=(new Q(.5,0,0,0)).La();var cc;Q.TopRight=cc=(new Q(1,0,0,0)).La();var dc;Q.LeftCenter=dc=(new Q(0,.5,0,0)).La();var ec;
  Q.Center=ec=(new Q(.5,.5,0,0)).La();var fc;Q.RightCenter=fc=(new Q(1,.5,0,0)).La();var gc;Q.BottomLeft=gc=(new Q(0,1,0,0)).La();var hc;Q.BottomCenter=hc=(new Q(.5,1,0,0)).La();var ic;Q.BottomRight=ic=(new Q(1,1,0,0)).La();var Zc;Q.MiddleTop=Zc=$b;var $c;Q.MiddleLeft=$c=dc;var ad;Q.MiddleRight=ad=fc;var bd;Q.MiddleBottom=bd=hc;var Sc;Q.Top=Sc=$b;var Qc;Q.Left=Qc=dc;var Rc;Q.Right=Rc=fc;var Tc;Q.Bottom=Tc=hc;var pc;Q.TopSide=pc=Tb(new Q(0,0,1,z.qd),1).La();var qc;
  Q.LeftSide=qc=Tb(new Q(0,0,1,z.Tc),1).La();var sc;Q.RightSide=sc=Tb(new Q(0,0,1,z.fd),1).La();var tc;Q.BottomSide=tc=Tb(new Q(0,0,1,z.ed),1).La();var uc;Q.TopBottomSides=uc=Tb(new Q(0,0,1,z.qd|z.ed),1).La();var vc;Q.LeftRightSides=vc=Tb(new Q(0,0,1,z.Tc|z.fd),1).La();var wc;Q.TopLeftSides=wc=Tb(new Q(0,0,1,z.qd|z.Tc),1).La();var xc;Q.TopRightSides=xc=Tb(new Q(0,0,1,z.qd|z.fd),1).La();var Cc;Q.BottomLeftSides=Cc=Tb(new Q(0,0,1,z.ed|z.Tc),1).La();var Dc;
  Q.BottomRightSides=Dc=Tb(new Q(0,0,1,z.ed|z.fd),1).La();var Ec;Q.NotTopSide=Ec=Tb(new Q(0,0,1,z.Tc|z.fd|z.ed),1).La();var Fc;Q.NotLeftSide=Fc=Tb(new Q(0,0,1,z.qd|z.fd|z.ed),1).La();var Gc;Q.NotRightSide=Gc=Tb(new Q(0,0,1,z.qd|z.Tc|z.ed),1).La();var Hc;Q.NotBottomSide=Hc=Tb(new Q(0,0,1,z.qd|z.Tc|z.fd),1).La();var Ic;Q.AllSides=Ic=Tb(new Q(0,0,1,z.qd|z.Tc|z.fd|z.ed),1).La();function cd(){this.pf=[1,0,0,1,0,0]}
  cd.prototype.copy=function(){var a=new cd;a.pf[0]=this.pf[0];a.pf[1]=this.pf[1];a.pf[2]=this.pf[2];a.pf[3]=this.pf[3];a.pf[4]=this.pf[4];a.pf[5]=this.pf[5];return a};function dd(a){this.type=a;this.r2=this.y2=this.x2=this.r1=this.y1=this.x1=0;this.RD=[];this.pattern=null}dd.prototype.addColorStop=function(a,b){this.RD.push({offset:a,color:b})};
  function ed(a,b,c){this.fillStyle="#000000";this.font="10px sans-serif";this.globalAlpha=1;this.lineCap="butt";this.mn=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.Ow=!1;this.Ag=this.Is=this.Hs=0;this.document=b||document;this.mE=c;this.px=null;this.path=[];this.fj=new cd;this.stack=[];this.Cf=[];this.Vw=a;this.MI="http://www.w3.org/2000/svg";
  this.width=this.Vw.width;this.height=this.Vw.height;this.Vl=pd(this,"svg",{width:this.width+"px",height:this.height+"px",EL:"0 0 "+this.Vw.width+" "+this.Vw.height});this.Vl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns","http://www.w3.org/2000/svg");this.Vl.setAttributeNS("http://www.w3.org/2000/xmlns/","xmlns:xlink","http://www.w3.org/1999/xlink");qd(this,1,0,0,1,0,0);a=z.am++;b=pd(this,"clipPath",{id:"mainClip"+a});b.appendChild(pd(this,"rect",{x:0,y:0,width:this.width,height:this.height}));
  this.Vl.appendChild(b);this.Cf[0].setAttributeNS(null,"clip-path","url(#mainClip"+a+")")}f=ed.prototype;f.arc=function(a,b,c,d,e,g){rd(this,a,b,c,d,e,g)};f.beginPath=function(){this.path=[]};f.bezierCurveTo=function(a,b,c,d,e,g){this.path.push(["C",a,b,c,d,e,g])};f.clearRect=function(){};f.clip=function(){sd(this,"clipPath",this.path,new cd)};f.closePath=function(){this.path.push(["z"])};f.createLinearGradient=function(a,b,c,d){var e=new dd("linear");e.x1=a;e.y1=b;e.x2=c;e.y2=d;return e};
  f.createPattern=function(a){var b=new dd("pattern");b.pattern=a;return b};f.createRadialGradient=function(a,b,c,d,e,g){var h=new dd("radial");h.x1=a;h.y1=b;h.r1=c;h.x2=d;h.y2=e;h.r2=g;return h};
  f.drawImage=function(a,b,c,d,e,g,h,k,l){var m="";a instanceof HTMLCanvasElement&&(m=a.toDataURL());a instanceof HTMLImageElement&&(m=a.src);m={x:0,y:0,width:a.naturalWidth,height:a.naturalHeight,href:m};m.preserveAspectRatio=td(d,k)&&td(e,l)?"xMidYMid slice":"none";var n="";k/=d;l/=e;if(0!==g||0!==h)n+=" translate("+g+", "+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"+z.am++,g=pd(this,
  "clipPath",{id:a}),g.appendChild(pd(this,"rect",{x:b,y:c,width:d,height:e})),this.Vl.appendChild(g),m["clip-path"]="url(#"+a+")";ud(this,"image",m,this.fj,n);this.addElement("image",m)};f.fill=function(){sd(this,"fill",this.path,this.fj)};f.Hg=function(){this.Ow?this.clip():this.fill()};f.fillRect=function(a,b,c,d){vd(this,"fill",[a,b,c,d],this.fj)};
  f.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};ud(this,"fill",b,this.fj);this.addElement("text",b,a[0])};f.lineTo=function(a,b){this.path.push(["L",a,b])};f.moveTo=function(a,b){this.path.push(["M",a,b])};f.quadraticCurveTo=function(a,b,c,d){this.path.push(["Q",a,b,c,d])};f.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"])};
  f.restore=function(){this.fj=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.mn=a.mn;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};
  f.save=function(){this.stack.push({fillStyle:this.fillStyle,font:this.font,globalAlpha:this.globalAlpha,lineCap:this.lineCap,mn:this.mn,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.fj.copy())};
  f.setTransform=function(a,b,c,d,e,g){1===a&&0===b&&0===c&&1===d&&0===e&&0===g||qd(this,a,b,c,d,e,g)};f.scale=function(){};f.stroke=function(){sd(this,"stroke",this.path,this.fj)};f.uj=function(){this.Kn||this.stroke()};f.strokeRect=function(a,b,c,d){vd(this,"stroke",[a,b,c,d],this.fj)};function pd(a,b,c,d){a=a.document.createElementNS(a.MI,b);if(z.Za(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}
  f.addElement=function(a,b,c){a=pd(this,a,b,c);0<this.Cf.length?this.Cf[this.Cf.length-1].appendChild(a):this.Vl.appendChild(a);return this.px=a};
  function ud(a,b,c,d,e){1!==a.globalAlpha&&(c.opacity=a.globalAlpha);"fill"===b?(/^rgba\(/.test(a.fillStyle)?(a=/^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle),c.fill="rgb("+a[1]+","+a[2]+","+a[3]+")",c["fill-opacity"]=a[4]):c.fill=a.fillStyle instanceof dd?wd(a,a.fillStyle):a.fillStyle,c.stroke="none"):"stroke"===b&&(c.fill="none",/^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 instanceof dd?wd(a,a.strokeStyle):a.strokeStyle,c["stroke-width"]=a.lineWidth,c["stroke-linecap"]=a.lineCap,c["stroke-linejoin"]=a.lineJoin,c["stroke-miterlimit"]=a.miterLimit);d=d.pf;d="matrix("+d[0]+", "+d[1]+", "+d[2]+", "+d[3]+", "+d[4]+", "+d[5]+")";void 0!==e&&(d+=e);c.transform=d}
  function wd(a,b){var c="GRAD"+z.am++,d;if("linear"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,id:c,gradientUnits:"userSpaceOnUse"},d=pd(a,"linearGradient",d);else if("radial"===b.type)d={x1:b.x1,x2:b.x2,y1:b.y1,y2:b.y2,r1:b.r1,r2:b.r2,id:c},d=pd(a,"radialGradient",d);else if("pattern"===b.type){var e=b.pattern;d={width:e.width,height:e.height,id:c,patternUnits:"userSpaceOnUse"};var g="";e instanceof HTMLCanvasElement&&(g=e.toDataURL());e instanceof HTMLImageElement&&(g=e.src);e={x:0,y:0,width:e.width,
  height:e.height,href:g};d=pd(a,"pattern",d);d.appendChild(pd(a,"image",e))}else throw Error("invalid gradient");for(var e=b.RD,g=e.length,h=[],k=0;k<g;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<g;k++)d.appendChild(pd(a,"stop",
  h[k]));a.Vl.appendChild(d);return"url(#"+c+")"}function vd(a,b,c,d){c={x:c[0],y:c[1],width:c[2],height:c[3]};ud(a,b,c,d);a.addElement("rect",c)}
  function sd(a,b,c,d){for(var e=[],g=0;g<c.length;g++){var h=z.Al(c[g]),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(" ")};ud(a,b,c,d);"clipPath"===b?(b="CLIP"+z.am++,d=pd(a,"clipPath",{id:b}),d.appendChild(pd(a,"path",c)),a.Vl.appendChild(d),0<a.Cf.length&&a.Cf[a.Cf.length-1].setAttributeNS(null,"clip-path","url(#"+b+")")):a.addElement("path",
  c)}function rd(a,b,c,d,e,g,h){var k=Math.abs(e-g);if(e!==g){var l=b+d*Math.cos(g);g=c+d*Math.sin(g);k>=2*Math.PI?(rd(a,b,c,d,e,e+Math.PI,h),rd(a,b,c,d,e+Math.PI,e+2*Math.PI,h),a.path.push(["M",l,g])):(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,g]))}}function qd(a,b,c,d,e,g,h){var k=new cd;k.pf=[b,c,d,e,g,h];b={};ud(a,"g",b,k);k=a.addElement("g",b);a.Cf.push(k)}
  f.fb=function(){if(0!==this.shadowOffsetX||0!==this.shadowOffsetY||0!==this.shadowBlur){var a="SHADOW"+z.am++,b=this.addElement("filter",{id:a,x:"-100%",y:"-100%",width:"300%",height:"300%"},null),c,d,e,g,h;c=pd(this,"feGaussianBlur",{"in":"SourceAlpha",result:"blur",vL:this.shadowBlur/2});d=pd(this,"feFlood",{"in":"blur",result:"flood","flood-color":this.shadowColor});e=pd(this,"feComposite",{"in":"flood",in2:"blur",operator:"in",result:"comp"});g=pd(this,"feOffset",{"in":"comp",result:"offsetBlur",
  dx:this.shadowOffsetX,dy:this.shadowOffsetY});h=pd(this,"feMerge",{});h.appendChild(pd(this,"feMergeNode",{"in":"offsetBlur"}));h.appendChild(pd(this,"feMergeNode",{"in":"SourceGraphic"}));b.appendChild(c);b.appendChild(d);b.appendChild(e);b.appendChild(g);b.appendChild(h);0<this.Cf.length&&this.Cf[this.Cf.length-1].setAttributeNS(null,"filter","url(#"+a+")")}};f.TA=function(a,b,c){this.Hs=a;this.Is=b;this.Ag=c};f.vn=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};
  f.wn=function(){this.shadowOffsetX=this.Hs;this.shadowOffsetY=this.Is;this.shadowBlur=this.Ag};f.Uz=function(){return!1};f.Qz=function(){};function la(a,b){this.ownerDocument=void 0===b?document:b;var c=this.ownerDocument.createElement("canvas");c.tabIndex=0;this.Ld=c;this.zl=new xd(c);c.Z=a;Object.seal(this)}f=la.prototype;f.toDataURL=function(a,b){return this.Ld.toDataURL(a,b)};f.getBoundingClientRect=function(){return this.Ld.getBoundingClientRect()};f.focus=function(){return this.Ld.focus()};
  f.addEventListener=function(a,b,c){this.Ld.addEventListener(a,b,c)};f.removeEventListener=function(a,b,c){this.Ld.removeEventListener(a,b,c)};z.defineProperty(la,{width:"width"},function(){return this.Ld.width},function(a){this.Ld.width=a});z.defineProperty(la,{height:"height"},function(){return this.Ld.height},function(a){this.Ld.height=a});z.defineProperty(la,{style:"style"},function(){return this.Ld.style},function(a){this.Ld.style=a});
  function xd(a){a.getContext&&a.getContext("2d")||z.k("Browser does not support HTML Canvas Element");this.Ca=a.getContext("2d");this.ny=this.py=this.oy="";this.Kn=!1;this.Ag=this.Is=this.Hs=0;Object.seal(this)}z.defineProperty(xd,{fillStyle:"fillStyle"},function(){return this.Ca.fillStyle},function(a){this.ny!==a&&(this.ny=this.Ca.fillStyle=a)});z.defineProperty(xd,{font:"font"},function(){return this.Ca.font},function(a){this.oy!==a&&(this.oy=this.Ca.font=a)});
  z.defineProperty(xd,{globalAlpha:"globalAlpha"},function(){return this.Ca.globalAlpha},function(a){this.Ca.globalAlpha=a});z.defineProperty(xd,{lineCap:"lineCap"},function(){return this.Ca.lineCap},function(a){this.Ca.lineCap=a});z.defineProperty(xd,{mn:"lineDashOffset"},function(){return this.Ca.mn},function(a){this.Ca.mn=a});z.defineProperty(xd,{lineJoin:"lineJoin"},function(){return this.Ca.lineJoin},function(a){this.Ca.lineJoin=a});
  z.defineProperty(xd,{lineWidth:"lineWidth"},function(){return this.Ca.lineWidth},function(a){this.Ca.lineWidth=a});z.defineProperty(xd,{miterLimit:"miterLimit"},function(){return this.Ca.miterLimit},function(a){this.Ca.miterLimit=a});z.defineProperty(xd,{shadowBlur:"shadowBlur"},function(){return this.Ca.shadowBlur},function(a){this.Ca.shadowBlur=a});z.defineProperty(xd,{shadowColor:"shadowColor"},function(){return this.Ca.shadowColor},function(a){this.Ca.shadowColor=a});
  z.defineProperty(xd,{shadowOffsetX:"shadowOffsetX"},function(){return this.Ca.shadowOffsetX},function(a){this.Ca.shadowOffsetX=a});z.defineProperty(xd,{shadowOffsetY:"shadowOffsetY"},function(){return this.Ca.shadowOffsetY},function(a){this.Ca.shadowOffsetY=a});z.defineProperty(xd,{strokeStyle:"strokeStyle"},function(){return this.Ca.strokeStyle},function(a){this.py!==a&&(this.py=this.Ca.strokeStyle=a)});
  z.defineProperty(xd,{textAlign:"textAlign"},function(){return this.Ca.textAlign},function(a){this.Ca.textAlign=a});z.defineProperty(xd,{Jt:"imageSmoothingEnabled"},function(){return this.Ca.Jt},function(a){this.Ca.Jt=a});f=xd.prototype;f.arc=function(a,b,c,d,e,g){this.Ca.arc(a,b,c,d,e,g)};f.beginPath=function(){this.Ca.beginPath()};f.bezierCurveTo=function(a,b,c,d,e,g){this.Ca.bezierCurveTo(a,b,c,d,e,g)};f.clearRect=function(a,b,c,d){this.Ca.clearRect(a,b,c,d)};f.clip=function(){this.Ca.clip()};
  f.closePath=function(){this.Ca.closePath()};f.createLinearGradient=function(a,b,c,d){return this.Ca.createLinearGradient(a,b,c,d)};f.createPattern=function(a,b){return this.Ca.createPattern(a,b)};f.createRadialGradient=function(a,b,c,d,e,g){return this.Ca.createRadialGradient(a,b,c,d,e,g)};f.drawImage=function(a,b,c,d,e,g,h,k,l){void 0===d?this.Ca.drawImage(a,b,c):this.Ca.drawImage(a,b,c,d,e,g,h,k,l)};f.fill=function(){this.Ca.fill()};f.fillRect=function(a,b,c,d){this.Ca.fillRect(a,b,c,d)};
  f.fillText=function(a,b,c){this.Ca.fillText(a,b,c)};f.getImageData=function(a,b,c,d){return this.Ca.getImageData(a,b,c,d)};f.lineTo=function(a,b){this.Ca.lineTo(a,b)};f.measureText=function(a){return this.Ca.measureText(a)};f.moveTo=function(a,b){this.Ca.moveTo(a,b)};f.quadraticCurveTo=function(a,b,c,d){this.Ca.quadraticCurveTo(a,b,c,d)};f.rect=function(a,b,c,d){this.Ca.rect(a,b,c,d)};f.restore=function(){this.Ca.restore()};xd.prototype.rotate=function(a){this.Ca.rotate(a)};f=xd.prototype;
  f.save=function(){this.Ca.save()};f.setTransform=function(a,b,c,d,e,g){this.Ca.setTransform(a,b,c,d,e,g)};f.scale=function(a,b){this.Ca.scale(a,b)};f.stroke=function(){this.Ca.stroke()};f.transform=function(a,b,c,d,e,g){1===a&&0===b&&0===c&&1===d&&0===e&&0===g||this.Ca.transform(a,b,c,d,e,g)};f.translate=function(a,b){this.Ca.translate(a,b)};
  f.Hg=function(a){if(a instanceof Da&&a.type===yd){var b=a.Nn;a=a.vy;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.Kn?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.Kn?this.clip():this.fill()};f.uj=function(){this.Kn||this.stroke()};z.defineProperty(xd,{Ow:"clipInsteadOfFill"},function(){return this.Kn},function(a){this.Kn=a});f=xd.prototype;
  f.TA=function(a,b,c){this.Hs=a;this.Is=b;this.Ag=c};f.vn=function(){this.shadowBlur=this.shadowOffsetY=this.shadowOffsetX=0};f.wn=function(){this.shadowOffsetX=this.Hs;this.shadowOffsetY=this.Is;this.shadowBlur=this.Ag};f.Uz=function(a,b){var c=this.Ca;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};
  f.Qz=function(){var a=this.Ca;void 0!==a.setLineDash?(a.setLineDash(z.yj),a.lineDashOffset=0):void 0!==a.webkitLineDash?(a.webkitLineDash=z.yj,a.webkitLineDashOffset=0):void 0!==a.mozDash&&(a.mozDash=null,a.mozDashOffset=0)};function ca(a,b){b&&(a.oy="");a.py="";a.ny=""}
  var Hd=(Math.sqrt(2)-1)/3*4,Id=(new N(0,0)).La(),Jd=(new w(0,0,0,0)).La(),Kd=(new Db(0,0,0,0)).La(),Ld=(new Db(2,2,2,2)).La(),Md=(new N(6,6)).La(),Nd=(new N(-Infinity,-Infinity)).La(),Od=(new N(Infinity,Infinity)).La(),Pd=(new Ea(0,0)).La(),Qd=(new Ea(1,1)).La(),ae=(new Ea(6,6)).La(),be=(new Ea(8,8)).La(),ce=(new Ea(10,10)).La(),de=(new Ea(Infinity,Infinity)).La(),ee=(new N(NaN,NaN)).La(),fe=(new Ea(NaN,NaN)).La(),ge=(new w(NaN,NaN,NaN,NaN)).La(),he=(new Q(.156,.156)).La(),ie=(new Q(.844,.844)).La(),
  je=new ma,ke=new ma,le=null;function se(a){if(0>=a)return 0;var b=le;if(null===b){for(var b=[],c=0;2E3>=c;c++)b[c]=Math.sqrt(c);le=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 eb(a,b){var c=a-b;return.5>c&&-.5<c}function td(a,b){var c=a-b;return 5E-8>c&&-5E-8<c}
  function te(a,b,c,d,e,g,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<=g&&g<=a+e;if(b===d)return l<=g&&g<=k&&b-e<=h&&h<=b+e;k+=e;l-=e;if(l<=g&&g<=k&&(m+=e,n-=e,n<=h&&h<=m))if(k-l>m-n)if(a-c>e||c-a>e){if(g=(d-b)/(c-a)*(g-a)+b,g-e<=h&&h<=g+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<=g&&g<=h+e)return!0}else return!0;return!1}
  function ue(a,b,c,d,e,g,h,k,l,m,n,p){if(te(a,b,h,k,p,c,d)&&te(a,b,h,k,p,e,g))return te(a,b,h,k,p,m,n);var q=(a+c)/2,r=(b+d)/2,s=(c+e)/2,t=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(q+s)/2;c=(r+t)/2;var s=(s+e)/2,t=(t+g)/2,v=(d+s)/2,x=(c+t)/2;return ue(a,b,q,r,d,c,v,x,l,m,n,p)||ue(v,x,s,t,e,g,h,k,l,m,n,p)}
  function ve(a,b,c,d,e,g,h,k,l,m){if(te(a,b,h,k,l,c,d)&&te(a,b,h,k,l,e,g))Hb(m,a,b,0,0),Hb(m,h,k,0,0);else{var n=(a+c)/2,p=(b+d)/2,q=(c+e)/2,r=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,t=(c+r)/2;ve(a,b,n,p,d,c,s,t,l,m);ve(s,t,q,r,e,g,h,k,l,m)}}
  function we(a,b,c,d,e,g,h,k,l,m){if(te(a,b,h,k,l,c,d)&&te(a,b,h,k,l,e,g))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+g)/2;e=(e+h)/2;g=(g+k)/2;d=(n+q)/2;c=(p+r)/2;var q=(q+e)/2,r=(r+g)/2,s=(d+q)/2,t=(c+r)/2;we(a,b,n,p,d,c,s,t,l,m);we(s,t,q,r,e,g,h,k,l,m)}}
  function xe(a,b,c,d,e,g,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+g*l;e=e*s+h*l;g=g*s+k*l;k=a*s+c*l;h=b*s+d*l;c=c*s+e*l;d=d*s+g*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=g}function ye(a,b,c,d,e,g,h,k,l,m){if(te(a,b,e,g,m,c,d))return te(a,b,e,g,m,k,l);var n=(a+c)/2,p=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var q=(n+c)/2,r=(p+d)/2;return ye(a,b,n,p,q,r,h,k,l,m)||ye(q,r,c,d,e,g,h,k,l,m)}
  function ze(a,b,c,d,e,g,h,k){if(te(a,b,e,g,h,c,d))Hb(k,a,b,0,0),Hb(k,e,g,0,0);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;ze(a,b,l,m,n,p,h,k);ze(n,p,c,d,e,g,h,k)}}function Je(a,b,c,d,e,g,h,k){if(te(a,b,e,g,h,c,d))0===k.length&&(k.push(a),k.push(b)),k.push(e),k.push(g);else{var l=(a+c)/2,m=(b+d)/2;c=(c+e)/2;d=(d+g)/2;var n=(l+c)/2,p=(m+d)/2;Je(a,b,l,m,n,p,h,k);Je(n,p,c,d,e,g,h,k)}}
  function Ke(a,b,c,d,e,g,h,k,l,m,n,p,q,r){0>=q&&(q=1E-6);if(te(a,b,h,k,q,c,d)&&te(a,b,h,k,q,e,g)){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,t=(b+d)/2;c=(c+e)/2;d=(d+g)/2;e=(e+h)/2;g=(g+k)/2;var v=(s+c)/2,x=(t+d)/2;c=(c+e)/2;d=(d+g)/2;var y=(v+c)/2,A=(x+d)/2,
  C=(n-l)*(n-l)+(p-m)*(p-m),L=!1;Ke(a,b,s,t,v,x,y,A,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<C&&(C=b,L=!0));a=r.x;s=r.y;Ke(y,A,c,d,e,g,h,k,l,m,n,p,q,r)&&(b=(r.x-l)*(r.x-l)+(r.y-m)*(r.y-m),b<C?L=!0:(r.x=a,r.y=s));return L}
  function Le(a,b,c,d,e,g,h,k,l,m,n,p,q){var r=0;0>=q&&(q=1E-6);if(te(a,b,h,k,q,c,d)&&te(a,b,h,k,q,e,g)){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,t=((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),t<l||t>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,t=(b+d)/2,v=(c+e)/2,x=(d+g)/2;e=(e+h)/2;g=(g+k)/2;d=(s+v)/2;c=(t+x)/2;var v=(v+e)/2,x=(x+g)/2,
  y=(d+v)/2,A=(c+x)/2,r=r+Le(a,b,s,t,d,c,y,A,l,m,n,p,q),r=r+Le(y,A,v,x,e,g,h,k,l,m,n,p,q)}return r}
  function ib(a,b,c,d,e,g,h){if(td(a,c)){var k=0;c=0;b<d?(k=b,c=d):(k=d,c=b);d=g;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(td(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-g)*(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 Me(a,b,c,d,e,g,h,k,l){if(eb(a,c)&&eb(b,d))return l.x=a,l.y=b,!1;if(td(e,h)){if(td(a,c))return ib(a,b,c,d,e,g,l),!1;g=(d-b)/(c-a)*(e-a)+b;return ib(a,b,c,d,e,g,l)}k=(k-g)/(h-e);if(td(a,c)){g=k*(a-e)+g;c=h=0;b<d?(h=b,c=d):(h=d,c=b);if(g<h)return l.x=a,l.y=h,!1;if(g>c)return l.x=a,l.y=c,!1;l.x=a;l.y=g;return!0}h=(d-b)/(c-a);if(td(k,h))return ib(a,b,c,d,e,g,l),!1;e=(h*a-k*e+g-b)/(h-k);if(td(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}g=
  h*(e-a)+b;return ib(a,b,c,d,e,g,l)}function Ne(a,b,c,d,e,g,h,k,l){var m=1E21,n=a,p=b;if(Me(a,b,a,d,e,g,h,k,l)){var q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g);q<m&&(m=q,n=l.x,p=l.y)}Me(c,b,c,d,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));Me(a,b,c,b,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));Me(a,d,c,d,e,g,h,k,l)&&(q=(l.x-e)*(l.x-e)+(l.y-g)*(l.y-g),q<m&&(m=q,n=l.x,p=l.y));l.x=n;l.y=p;return 1E21>m}
  function Oe(a,b,c,d,e,g,h,k,l){c=a-c;var m=e-h,n=h=0;0===c||0===m?0===c?(k=(g-k)/m,h=a,n=k*h+(g-k*e)):(d=(b-d)/c,h=e,n=d*h+(b-d*a)):(d=(b-d)/c,k=(g-k)/m,a=b-d*a,h=(g-k*e-a)/(d-k),n=d*h+a);l.n(h,n);return l}
  function Pe(a,b,c){var d=b.x,e=b.y,g=c.x,h=c.y,k=a.left,l=a.right,m=a.top,n=a.bottom;return d===g?(g=a=0,e<h?(a=e,g=h):(a=h,g=e),k<=d&&d<=l&&a<=n&&g>=m):e===h?(d<g?a=d:(a=g,g=d),m<=e&&e<=n&&a<=l&&g>=k):a.Ma(b)||a.Ma(c)||bf(k,m,l,m,d,e,g,h)||bf(l,m,l,n,d,e,g,h)||bf(l,n,k,n,d,e,g,h)||bf(k,n,k,m,d,e,g,h)?!0:!1}function bf(a,b,c,d,e,g,h,k){return 0>=cf(a,b,c,d,e,g)*cf(a,b,c,d,h,k)&&0>=cf(e,g,h,k,a,b)*cf(e,g,h,k,c,d)}
  function cf(a,b,c,d,e,g){c-=a;d-=b;a=e-a;b=g-b;g=a*d-b*c;0===g&&(g=a*c+b*d,0<g&&(g=(a-c)*c+(b-d)*d,0>g&&(g=0)));return 0>g?-1:0<g?1:0}function df(a){0>a&&(a+=360);360<=a&&(a-=360);return a}
  function ef(a,b,c,d){var e=Math.PI;d||(b*=e/180,c*=e/180);d=b<c?1:-1;var g=[],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);g.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 g}
  function jb(a,b,c,d,e,g,h){c=Math.floor((a-c)/e)*e+c;d=Math.floor((b-d)/g)*g+d;var k=c;c+e-a<e/2&&(k=c+e);a=d;d+g-b<g/2&&(a=d+g);h.n(k,a)}function ff(a,b){var c=Math.max(a,b),d=Math.min(a,b),e=1,g=1;do e=c%d,c=g=d,d=e;while(0<e);return g}
  function gf(a,b,c,d){var e=0>c,g=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:g)n=-n;h=k;m=0===h?a:b;p=0===h?c:d;if(0===h?e:g)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(g=0;9999999999>g;++g){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 hf(a){1<arguments.length&&z.k("Geometry constructor can take at most one optional argument, the Geometry type.");z.kc(this);this.G=!1;void 0===a?a=jf:u&&z.Ba(a,hf,hf,"constructor:type");this.ba=a;this.Gb=this.zb=this.Cc=this.xc=0;this.Dj=new J(kf);this.nv=this.Dj.H;this.Xu=(new w).freeze();this.hb=!0;this.ci=Zb;this.di=ic;this.oo=this.qo=NaN;this.Ci=lf}z.ia("Geometry",hf);z.ji(hf);
  hf.prototype.copy=function(){var a=new hf;a.ba=this.ba;a.xc=this.xc;a.Cc=this.Cc;a.zb=this.zb;a.Gb=this.Gb;for(var b=this.Dj.o,c=b.length,d=a.Dj,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.nv=this.nv;a.Xu.assign(this.Xu);a.hb=this.hb;a.ci=this.ci.V();a.di=this.di.V();a.qo=this.qo;a.oo=this.oo;a.Ci=this.Ci;return a};var mf;hf.Line=mf=z.s(hf,"Line",0);var nf;hf.Rectangle=nf=z.s(hf,"Rectangle",1);var of;hf.Ellipse=of=z.s(hf,"Ellipse",2);var jf;hf.Path=jf=z.s(hf,"Path",3);
  hf.prototype.La=function(){this.freeze();Object.freeze(this);return this};hf.prototype.freeze=function(){this.G=!0;var a=this.cc;a.freeze();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].freeze();return this};hf.prototype.Wa=function(){Object.isFrozen(this)&&z.k("cannot thaw constant: "+this);this.G=!1;var a=this.cc;a.Wa();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].Wa();return this};
  hf.prototype.equalsApprox=hf.prototype.Mc=function(a){if(!(a instanceof hf))return!1;if(this.type!==a.type)return this.type===mf&&a.type===jf?pf(this,a):a.type===mf&&this.type===jf?pf(a,this):!1;if(this.type===jf){var b=this.cc.o;a=a.cc.o;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Mc(a[d]))return!1;return!0}return eb(this.Ha,a.Ha)&&eb(this.Da,a.Da)&&eb(this.L,a.L)&&eb(this.M,a.M)};
  function pf(a,b){if(a.type!==mf||b.type!==jf)return!1;if(1===b.cc.count){var c=b.cc.ea(0);if(1===c.Ab.count&&eb(a.Ha,c.Ha)&&eb(a.Da,c.Da)&&(c=c.Ab.ea(0),c.type===qf&&eb(a.L,c.L)&&eb(a.M,c.M)))return!0}return!1}var rf;hf.stringify=rf=function(a){return a.toString()};
  hf.prototype.toString=function(a){void 0===a&&(a=-1);switch(this.type){case mf:return 0>a?"M"+this.Ha.toString()+" "+this.Da.toString()+"L"+this.L.toString()+" "+this.M.toString():"M"+this.Ha.toFixed(a)+" "+this.Da.toFixed(a)+"L"+this.L.toFixed(a)+" "+this.M.toFixed(a);case nf:var b=new w(this.Ha,this.Da,0,0);b.cG(this.L,this.M,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 of:b=new w(this.Ha,this.Da,0,0);b.cG(this.L,this.M,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 jf:for(var b="",c=this.cc.o,d=c.length,e=0;e<d;e++){var g=c[e];0<e&&(b+=" x ");g.Ot&&(b+="F ");b+=g.toString(a)}return b;default:return this.type.toString()}};
  hf.fillPath=function(a){"string"!==typeof a&&z.ic(a,"string",hf,"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 sf;
  hf.parse=sf=function(a,b){function c(){return m>=t-1?!0:null!==l[m+1].match(/[A-Za-z]/)}function d(){m++;return l[m]}function e(){var a=new N(parseFloat(d()),parseFloat(d()));n===n.toLowerCase()&&(a.x=s.x+a.x,a.y=s.y+a.y);return a}function g(){return s=e()}function h(){return r=e()}function k(){return"c"!==p.toLowerCase()&&"s"!==p.toLowerCase()?s:new N(2*s.x-r.x,2*s.y-r.y)}void 0===b&&(b=!1);"string"!==typeof a&&z.ic(a,"string",hf,"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 N(0,0),r=new N(0,0),s=new N(0,
  0),t=l.length,v=z.v(),x=!1,y=!1,A=!0;!(m>=t-1);)if(p=n,n=d(),""!==n)switch(n.toUpperCase()){case "X":A=!0;y=x=!1;break;case "M":var C=g();null===v.$b||!0===A?(R(v,C.x,C.y,x,!1,!y),A=!1):v.moveTo(C.x,C.y);for(q=s;!c();)C=g(),v.lineTo(C.x,C.y);break;case "L":for(;!c();)C=g(),v.lineTo(C.x,C.y);break;case "H":for(;!c();)s=C=new N((n===n.toLowerCase()?s.x:0)+parseFloat(d()),s.y),v.lineTo(s.x,s.y);break;case "V":for(;!c();)s=C=new N(s.x,(n===n.toLowerCase()?s.y:0)+parseFloat(d())),v.lineTo(s.x,s.y);break;
  case "C":for(;!c();){var L=e(),H=h(),C=g();S(v,L.x,L.y,H.x,H.y,C.x,C.y)}break;case "S":for(;!c();)L=k(),H=h(),C=g(),S(v,L.x,L.y,H.x,H.y,C.x,C.y);break;case "Q":for(;!c();)H=h(),C=g(),zf(v,H.x,H.y,C.x,C.y);break;case "T":for(;!c();)r=H=k(),C=g(),zf(v,H.x,H.y,C.x,C.y);break;case "B":for(;!c();){var C=parseFloat(d()),L=parseFloat(d()),H=parseFloat(d()),U=parseFloat(d()),ea=parseFloat(d()),W=ea,P=!1;c()||(W=parseFloat(d()),c()||(P=0!==parseFloat(d())));n===n.toLowerCase()&&(H+=s.x,U+=s.y);v.arcTo(C,L,
  H,U,ea,W,P)}break;case "A":for(;!c();)L=Math.abs(parseFloat(d())),H=Math.abs(parseFloat(d())),U=parseFloat(d()),ea=!!parseFloat(d()),W=!!parseFloat(d()),C=g(),Af(v,L,H,U,ea,W,C.x,C.y);break;case "Z":C=v.q.cc.o[v.q.cc.length-1];T(v);s=q;break;case "F":C="";for(L=1;l[m+L];)if(null!==l[m+L].match(/[Uu]/))L++;else if(null===l[m+L].match(/[A-Za-z]/))L++;else{C=l[m+L];break}C.match(/[Mm]/)?x=!0:Bf(v);break;case "U":C="";for(L=1;l[m+L];)if(null!==l[m+L].match(/[Ff]/))L++;else if(null===l[m+L].match(/[A-Za-z]/))L++;
  else{C=l[m+L];break}C.match(/[Mm]/)?y=!0:v.fb(!1)}q=v.q;z.u(v);if(b)for(v=q.cc.i;v.next();)C=v.value,C.Ot=!0;return q};function Cf(a,b){for(var c=a.length,d=z.O(),e=0;e<c;e++){var g=a[e];d.x=g[0];d.y=g[1];b.Cb(d);g[0]=d.x;g[1]=d.y;d.x=g[2];d.y=g[3];b.Cb(d);g[2]=d.x;g[3]=d.y;d.x=g[4];d.y=g[5];b.Cb(d);g[4]=d.x;g[5]=d.y;d.x=g[6];d.y=g[7];b.Cb(d);g[6]=d.x;g[7]=d.y}z.A(d)}
  hf.prototype.iA=function(){if(this.hb||this.nv!==this.cc.H)return!0;for(var a=this.cc.o,b=a.length,c=0;c<b;c++)if(a[c].iA())return!0;return!1};hf.prototype.eB=function(){this.hb=!1;this.nv=this.cc.H;for(var a=this.cc.o,b=a.length,c=0;c<b;c++)a[c].eB()};hf.prototype.sh=function(){var a=this.Xu;a.Wa();isNaN(this.qo)||isNaN(this.oo)?a.n(0,0,0,0):a.n(0,0,this.qo,this.oo);Df(this,a,!1);Hb(a,0,0,0,0);a.freeze()};
  hf.prototype.computeBoundsWithoutOrigin=hf.prototype.eH=function(){var a=new w;Df(this,a,!0);return a};
  function Df(a,b,c){switch(a.type){case mf:case nf:case of:c?b.n(a.xc,a.Cc,0,0):Hb(b,a.xc,a.Cc,0,0);Hb(b,a.zb,a.Gb,0,0);break;case jf:var d=a.cc;a=d.o;for(var d=d.length,e=0;e<d;e++){var g=a[e];c&&0===e?b.n(g.Ha,g.Da,0,0):Hb(b,g.Ha,g.Da,0,0);for(var h=g.Ab.o,k=h.length,l=g.Ha,m=g.Da,n=0;n<k;n++){var p=h[n];switch(p.type){case qf:case Ef:l=p.L;m=p.M;Hb(b,l,m,0,0);break;case Ff:ve(l,m,p.zc,p.Qc,p.Ch,p.Dh,p.L,p.M,.5,b);l=p.L;m=p.M;break;case Gf:ze(l,m,p.zc,p.Qc,p.L,p.M,.5,b);l=p.L;m=p.M;break;case Hf:case If:var q=
  p.type===Hf?Jf(p,g):Kf(p,g,l,m),r=q.length;if(0===r){l=p.ra;m=p.za;Hb(b,l,m,0,0);break}for(var p=null,s=0;s<r;s++)p=q[s],ve(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:z.k("Unknown Segment type: "+p.type)}}}break;default:z.k("Unknown Geometry type: "+a.type)}}hf.prototype.normalize=hf.prototype.normalize=function(){this.G&&z.oa(this);var a=this.eH();this.offset(-a.x,-a.y);return new N(-a.x,-a.y)};
  hf.prototype.offset=hf.prototype.offset=function(a,b){this.G&&z.oa(this);u&&(z.p(a,hf,"offset"),z.p(b,hf,"offset"));this.transform(1,0,0,1,a,b);return this};hf.prototype.scale=hf.prototype.scale=function(a,b){this.G&&z.oa(this);u&&(z.p(a,hf,"scale:x"),z.p(b,hf,"scale:y"),0===a&&z.ka(a,"scale must be non-zero",hf,"scale:x"),0===b&&z.ka(b,"scale must be non-zero",hf,"scale:y"));this.transform(a,0,0,b,0,0);return this};
  hf.prototype.rotate=hf.prototype.rotate=function(a,b,c){this.G&&z.oa(this);void 0===b&&(b=0);void 0===c&&(c=0);u&&(z.p(a,hf,"rotate:angle"),z.p(b,hf,"rotate:x"),z.p(c,hf,"rotate:y"));var d=z.Hh();d.reset();d.rotate(a,b,c);this.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);z.jf(d);return this};
  hf.prototype.transform=hf.prototype.transform=function(a,b,c,d,e,g){var h=0,k=0;switch(this.type){case mf:case nf:case of:h=this.xc;k=this.Cc;this.xc=h*a+k*c+e;this.Cc=h*b+k*d+g;h=this.zb;k=this.Gb;this.zb=h*a+k*c+e;this.Gb=h*b+k*d+g;break;case jf:for(var l=this.cc.o,m=l.length,n=0;n<m;n++){var p=l[n],h=p.Ha,k=p.Da;p.Ha=h*a+k*c+e;p.Da=h*b+k*d+g;for(var p=p.Ab.o,q=p.length,r=0;r<q;r++){var s=p[r];switch(s.type){case qf:case Ef:h=s.L;k=s.M;s.L=h*a+k*c+e;s.M=h*b+k*d+g;break;case Ff:h=s.zc;k=s.Qc;s.zc=
  h*a+k*c+e;s.Qc=h*b+k*d+g;h=s.Ch;k=s.Dh;s.Ch=h*a+k*c+e;s.Dh=h*b+k*d+g;h=s.L;k=s.M;s.L=h*a+k*c+e;s.M=h*b+k*d+g;break;case Gf:h=s.zc;k=s.Qc;s.zc=h*a+k*c+e;s.Qc=h*b+k*d+g;h=s.L;k=s.M;s.L=h*a+k*c+e;s.M=h*b+k*d+g;break;case Hf:h=s.ra;k=s.za;s.ra=h*a+k*c+e;s.za=h*b+k*d+g;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.Fe+=h);0>a&&(s.Fe=180-s.Fe,s.Lf=-s.Lf);0>d&&(s.Fe=-s.Fe,s.Lf=-s.Lf);s.radiusX*=Math.sqrt(a*a+c*c);void 0!==s.radiusY&&(s.radiusY*=Math.sqrt(b*b+d*d));break;case If:h=s.L;k=s.M;s.L=h*
  a+k*c+e;s.M=h*b+k*d+g;0!==b&&(h=180*Math.atan2(b,a)/Math.PI,0>h&&(h+=360),s.xj+=h);0>a&&(s.xj=180-s.xj,s.Ol=!s.Ol);0>d&&(s.xj=-s.xj,s.Ol=!s.Ol);s.radiusX*=Math.sqrt(a*a+c*c);s.radiusY*=Math.sqrt(b*b+d*d);break;default:z.k("Unknown Segment type: "+s.type)}}}}this.hb=!0;return this};
  hf.prototype.Ma=function(a,b,c,d){var e=a.x,g=a.y,h=this.vb.x-20;a=a.y;for(var k=0,l=0,m=0,n=0,p=0,q=0,r=this.cc.o,s=r.length,t=0;t<s;t++){var v=r[t];if(v.Ot){if(c&&v.Ma(e,g,b))return!0;for(var x=v.Ab,l=v.Ha,m=v.Da,y=l,A=m,C=x.o,L=0;L<=x.length;L++){var H,U;L!==x.length?(H=C[L],U=H.type,p=H.L,q=H.M):(U=qf,p=y,q=A);switch(U){case Ef:n=Lf(e,g,h,a,l,m,y,A);if(isNaN(n))return!0;k+=n;y=p;A=q;break;case qf:n=Lf(e,g,h,a,l,m,p,q);if(isNaN(n))return!0;k+=n;break;case Ff:n=Le(l,m,H.zc,H.Qc,H.Ch,H.Dh,p,q,h,
  a,e,g,.5);k+=n;break;case Gf:n=Le(l,m,(l+2*H.zc)/3,(m+2*H.Qc)/3,(2*H.zc+p)/3,(2*H.Qc+q)/3,p,q,h,a,e,g,.5);k+=n;break;case Hf:case If:U=H.type===Hf?Jf(H,v):Kf(H,v,l,m);var ea=U.length;if(0===ea){n=Lf(e,g,h,a,l,m,H.ra,H.za);if(isNaN(n))return!0;k+=n;break}for(var W=null,P=0;P<ea;P++){W=U[P];if(0===P){n=Lf(e,g,h,a,l,m,W[0],W[1]);if(isNaN(n))return!0;k+=n}n=Le(W[0],W[1],W[2],W[3],W[4],W[5],W[6],W[7],h,a,e,g,.5);k+=n}null!==W&&(p=W[6],q=W[7]);break;default:z.k("Unknown Segment type: "+H.type)}l=p;m=q}if(0!==
  k)return!0;k=0}else if(v.Ma(e,g,d?b:b+2))return!0}return 0!==k};function Lf(a,b,c,d,e,g,h,k){if(te(e,g,h,k,.05,a,b))return NaN;var l=(a-c)*(g-k);if(0===l)return 0;var m=((a*d-b*c)*(e-h)-(a-c)*(e*k-g*h))/l;b=(a*d-b*c)*(g-k)/l;if(m>=a)return 0;if((e>h?e-h:h-e)<(g>k?g-k:k-g)){if(e=a=0,g<k?(a=g,e=k):(a=k,e=g),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 Pf(a,b,c,d){a=a.cc.o;for(var e=a.length,g=0;g<e;g++)if(a[g].Ma(b,c,d))return!0;return!1}
  hf.prototype.getPointAlongPath=function(a){(0>a||1<a)&&z.ka(a,"0 <= fraction <= 1",hf,"getPointAlongPath:fraction");var b=this.cc.first(),c=z.rb(),d=[];d.push(b.Ha);d.push(b.Da);for(var e=b.Ha,g=b.Da,h=e,k=g,l=b.Ab.o,m=l.length,n=0;n<m;n++){var p=l[n];switch(p.ba){case Ef:c.push(d);d=[];d.push(p.L);d.push(p.M);e=p.L;g=p.M;h=e;k=g;break;case qf:d.push(p.L);d.push(p.M);e=p.L;g=p.M;break;case Ff:we(e,g,p.Dd,p.Ne,p.nh,p.zg,p.zb,p.Gb,.5,d);e=p.L;g=p.M;break;case Gf:Je(e,g,p.Dd,p.Ne,p.zb,p.Gb,.5,d);e=p.L;
  g=p.M;break;case Hf:var q=Jf(p,b),r=q.length;if(0===r){d.push(p.ra);d.push(p.za);e=p.ra;g=p.za;break}for(var s=0;s<r;s++){var t=q[s];we(e,g,t[2],t[3],t[4],t[5],t[6],t[7],.5,d);e=t[6];g=t[7]}break;case If:q=Kf(p,b,e,g);r=q.length;for(s=0;s<r;s++)t=q[s],we(e,g,t[2],t[3],t[4],t[5],t[6],t[7],.5,d),e=t[6],g=t[7];break;default:z.k("Segment not of valid type")}p.Th&&(d.push(h),d.push(k))}c.push(d);q=0;h=c.length;for(k=d=b=0;k<h;k++)for(l=c[k],m=l.length,n=0;n<m;n+=2)e=l[n],g=l[n+1],0!==n&&(p=Math.sqrt(vb(b,
  d,e,g)),q+=p),b=e,d=g;a*=q;for(k=q=0;k<h;k++)for(l=c[k],m=l.length,n=0;n<m;n++){e=l[n];g=l[n+1];if(0!==n){p=Math.sqrt(vb(b,d,e,g));if(q+p>a)return n=(a-q)/p,z.xa(c),new N(b+(e-b)*n,d+(g-d)*n);q+=p}b=e;d=g}z.xa(c);return null};z.defineProperty(hf,{type:"type"},function(){return this.ba},function(a){this.ba!==a&&(u&&z.Ba(a,hf,hf,"type"),this.G&&z.oa(this,a),this.ba=a,this.hb=!0)});
  z.defineProperty(hf,{Ha:"startX"},function(){return this.xc},function(a){this.xc!==a&&(u&&z.p(a,hf,"startX"),this.G&&z.oa(this,a),this.xc=a,this.hb=!0)});z.defineProperty(hf,{Da:"startY"},function(){return this.Cc},function(a){this.Cc!==a&&(u&&z.p(a,hf,"startY"),this.G&&z.oa(this,a),this.Cc=a,this.hb=!0)});z.defineProperty(hf,{L:"endX"},function(){return this.zb},function(a){this.zb!==a&&(u&&z.p(a,hf,"endX"),this.G&&z.oa(this,a),this.zb=a,this.hb=!0)});
  z.defineProperty(hf,{M:"endY"},function(){return this.Gb},function(a){this.Gb!==a&&(u&&z.p(a,hf,"endY"),this.G&&z.oa(this,a),this.Gb=a,this.hb=!0)});z.defineProperty(hf,{cc:"figures"},function(){return this.Dj},function(a){this.Dj!==a&&(u&&z.l(a,J,hf,"figures"),this.G&&z.oa(this,a),this.Dj=a,this.hb=!0)});hf.prototype.add=hf.prototype.add=function(a){this.Dj.add(a);return this};
  hf.prototype.setSpots=function(a,b,c,d,e,g,h,k){this.G&&z.oa(this);this.ci=(new Q(a,b,e,g)).freeze();this.di=(new Q(c,d,h,k)).freeze();return this};z.defineProperty(hf,{C:"spot1"},function(){return this.ci},function(a){u&&z.l(a,Q,hf,"spot1");this.G&&z.oa(this,a);this.ci=a.V()});z.defineProperty(hf,{D:"spot2"},function(){return this.di},function(a){u&&z.l(a,Q,hf,"spot2");this.G&&z.oa(this,a);this.di=a.V()});
  z.defineProperty(hf,{Xd:"defaultStretch"},function(){return this.Ci},function(a){u&&z.Ba(a,O,hf,"stretch");this.G&&z.oa(this,a);this.Ci=a});z.w(hf,{vb:"bounds"},function(){this.iA()&&(this.eB(),this.sh());return this.Xu});function kf(a,b,c,d){z.kc(this);this.G=!1;void 0===c&&(c=!0);this.im=c;void 0===d&&(d=!0);this.ro=d;void 0!==a?(u&&z.p(a,kf,"sx"),this.xc=a):this.xc=0;void 0!==b?(u&&z.p(b,kf,"sy"),this.Cc=b):this.Cc=0;this.Ko=new J(Qf);this.ow=this.Ko.H;this.hb=!0}z.ia("PathFigure",kf);z.ji(kf);
  kf.prototype.copy=function(){var a=new kf;a.im=this.im;a.ro=this.ro;a.xc=this.xc;a.Cc=this.Cc;for(var b=this.Ko.o,c=b.length,d=a.Ko,e=0;e<c;e++){var g=b[e].copy();d.add(g)}a.ow=this.ow;a.hb=this.hb;return a};kf.prototype.equalsApprox=kf.prototype.Mc=function(a){if(!(a instanceof kf&&eb(this.Ha,a.Ha)&&eb(this.Da,a.Da)))return!1;var b=this.Ab.o;a=a.Ab.o;var c=b.length;if(c!==a.length)return!1;for(var d=0;d<c;d++)if(!b[d].Mc(a[d]))return!1;return!0};f=kf.prototype;
  f.toString=function(a){void 0===a&&(a=-1);for(var b=0>a?"M"+this.Ha.toString()+" "+this.Da.toString():"M"+this.Ha.toFixed(a)+" "+this.Da.toFixed(a),c=this.Ab.o,d=c.length,e=0;e<d;e++)b+=" "+c[e].toString(a);return b};f.freeze=function(){this.G=!0;var a=this.Ab;a.freeze();for(var b=a.o,a=a.length,c=0;c<a;c++)b[c].freeze();return this};f.Wa=function(){this.G=!1;var a=this.Ab;a.Wa();for(var a=a.o,b=a.length,c=0;c<b;c++)a[c].Wa();return this};
  f.iA=function(){if(this.hb)return!0;var a=this.Ab;if(this.ow!==a.H)return!0;for(var a=a.o,b=a.length,c=0;c<b;c++)if(a[c].hb)return!0;return!1};f.eB=function(){this.hb=!1;var a=this.Ab;this.ow=a.H;for(var a=a.o,b=a.length,c=0;c<b;c++){var d=a[c];d.hb=!1;d.ng=null}};z.defineProperty(kf,{Ot:"isFilled"},function(){return this.im},function(a){u&&z.g(a,"boolean",kf,"isFilled");this.G&&z.oa(this,a);this.im=a});
  z.defineProperty(kf,{tk:"isShadowed"},function(){return this.ro},function(a){u&&z.g(a,"boolean",kf,"isShadowed");this.G&&z.oa(this,a);this.ro=a});z.defineProperty(kf,{Ha:"startX"},function(){return this.xc},function(a){u&&z.p(a,kf,"startX");this.G&&z.oa(this,a);this.xc=a;this.hb=!0});z.defineProperty(kf,{Da:"startY"},function(){return this.Cc},function(a){u&&z.p(a,kf,"startY");this.G&&z.oa(this,a);this.Cc=a;this.hb=!0});
  z.defineProperty(kf,{Ab:"segments"},function(){return this.Ko},function(a){u&&z.l(a,J,kf,"segments");this.G&&z.oa(this,a);this.Ko=a;this.hb=!0});kf.prototype.add=kf.prototype.add=function(a){this.Ko.add(a);return this};
  kf.prototype.Ma=function(a,b,c){for(var d=this.Ha,e=this.Da,g=d,h=e,k=this.Ab.o,l=k.length,m=0;m<l;m++){var n=k[m];switch(n.type){case Ef:g=n.L;h=n.M;d=n.L;e=n.M;break;case qf:if(te(d,e,n.L,n.M,c,a,b))return!0;d=n.L;e=n.M;break;case Ff:if(ue(d,e,n.zc,n.Qc,n.Ch,n.Dh,n.L,n.M,.5,a,b,c))return!0;d=n.L;e=n.M;break;case Gf:if(ye(d,e,n.zc,n.Qc,n.L,n.M,.5,a,b,c))return!0;d=n.L;e=n.M;break;case Hf:case If:var p=n.type===Hf?Jf(n,this):Kf(n,this,d,e),q=p.length;if(0===q){if(te(d,e,n.ra,n.za,c,a,b))return!0;
  d=n.ra;e=n.za;break}for(var r=null,s=0;s<q;s++)if(r=p[s],0===s&&te(d,e,r[0],r[1],c,a,b)||ue(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:z.k("Unknown Segment type: "+n.type)}if(n.ix&&(d!==g||e!==h)&&te(d,e,g,h,c,a,b))return!0}return!1};
  function Qf(a,b,c,d,e,g,h,k){z.kc(this);this.G=!1;void 0===a?a=qf:u&&z.Ba(a,Qf,Qf,"constructor:type");this.ba=a;void 0!==b?(u&&z.p(b,Qf,"ex"),this.zb=b):this.zb=0;void 0!==c?(u&&z.p(c,Qf,"ey"),this.Gb=c):this.Gb=0;void 0===d&&(d=0);void 0===e&&(e=0);void 0===g&&(g=0);void 0===h&&(h=0);a===If?(a=g%360,0>a&&(a+=360),this.Dd=a,this.Ne=0,u&&z.p(d,Qf,"x1"),this.nh=Math.max(d,0),u&&z.p(e,Qf,"y1"),this.zg=Math.max(e,0),this.wo="boolean"===typeof h?!!h:!1,this.Ln=!!k):(u&&z.p(d,Qf,"x1"),this.Dd=d,u&&z.p(e,
  Qf,"y1"),this.Ne=e,u&&z.p(g,Qf,"x2"),a===Hf&&(g=Math.max(g,0)),this.nh=g,"number"===typeof h?(a===Hf&&(h=Math.max(h,0)),this.zg=h):this.zg=0,this.Ln=this.wo=!1);this.Th=!1;this.hb=!0;this.ng=null}z.ia("PathSegment",Qf);z.ji(Qf);Qf.prototype.copy=function(){var a=new Qf;a.ba=this.ba;a.zb=this.zb;a.Gb=this.Gb;a.Dd=this.Dd;a.Ne=this.Ne;a.nh=this.nh;a.zg=this.zg;a.wo=this.wo;a.Ln=this.Ln;a.Th=this.Th;a.hb=this.hb;return a};
  Qf.prototype.equalsApprox=Qf.prototype.Mc=function(a){if(!(a instanceof Qf)||this.type!==a.type||this.ix!==a.ix)return!1;switch(this.type){case Ef:case qf:return eb(this.L,a.L)&&eb(this.M,a.M);case Ff:return eb(this.L,a.L)&&eb(this.M,a.M)&&eb(this.zc,a.zc)&&eb(this.Qc,a.Qc)&&eb(this.Ch,a.Ch)&&eb(this.Dh,a.Dh);case Gf:return eb(this.L,a.L)&&eb(this.M,a.M)&&eb(this.zc,a.zc)&&eb(this.Qc,a.Qc);case Hf:return eb(this.Fe,a.Fe)&&eb(this.Lf,a.Lf)&&eb(this.ra,a.ra)&&eb(this.za,a.za)&&eb(this.radiusX,a.radiusX)&&
  eb(this.radiusY,a.radiusY);case If:return this.Ol===a.Ol&&this.mx===a.mx&&eb(this.xj,a.xj)&&eb(this.L,a.L)&&eb(this.M,a.M)&&eb(this.radiusX,a.radiusX)&&eb(this.radiusY,a.radiusY);default:return!1}};
  Qf.prototype.toString=function(a){void 0===a&&(a=-1);var b="";switch(this.type){case Ef:b=0>a?"M"+this.L.toString()+" "+this.M.toString():"M"+this.L.toFixed(a)+" "+this.M.toFixed(a);break;case qf:b=0>a?"L"+this.L.toString()+" "+this.M.toString():"L"+this.L.toFixed(a)+" "+this.M.toFixed(a);break;case Ff:b=0>a?"C"+this.zc.toString()+" "+this.Qc.toString()+" "+this.Ch.toString()+" "+this.Dh.toString()+" "+this.L.toString()+" "+this.M.toString():"C"+this.zc.toFixed(a)+" "+this.Qc.toFixed(a)+" "+this.Ch.toFixed(a)+
  " "+this.Dh.toFixed(a)+" "+this.L.toFixed(a)+" "+this.M.toFixed(a);break;case Gf:b=0>a?"Q"+this.zc.toString()+" "+this.Qc.toString()+" "+this.L.toString()+" "+this.M.toString():"Q"+this.zc.toFixed(a)+" "+this.Qc.toFixed(a)+" "+this.L.toFixed(a)+" "+this.M.toFixed(a);break;case Hf:b=0>a?"B"+this.Fe.toString()+" "+this.Lf.toString()+" "+this.ra.toString()+" "+this.za.toString()+" "+this.radiusX:"B"+this.Fe.toFixed(a)+" "+this.Lf.toFixed(a)+" "+this.ra.toFixed(a)+" "+this.za.toFixed(a)+" "+this.radiusX;
  break;case If:b=0>a?"A"+this.radiusX.toString()+" "+this.radiusY.toString()+" "+this.xj.toString()+" "+(this.mx?1:0)+" "+(this.Ol?1:0)+" "+this.L.toString()+" "+this.M.toString():"A"+this.radiusX.toFixed(a)+" "+this.radiusY.toFixed(a)+" "+this.xj.toFixed(a)+" "+(this.mx?1:0)+" "+(this.Ol?1:0)+" "+this.L.toFixed(a)+" "+this.M.toFixed(a);break;default:b=this.type.toString()}return b+(this.Th?"z":"")};var Ef;Qf.Move=Ef=z.s(Qf,"Move",0);var qf;Qf.Line=qf=z.s(Qf,"Line",1);var Ff;
  Qf.Bezier=Ff=z.s(Qf,"Bezier",2);var Gf;Qf.QuadraticBezier=Gf=z.s(Qf,"QuadraticBezier",3);var Hf;Qf.Arc=Hf=z.s(Qf,"Arc",4);var If;Qf.SvgArc=If=z.s(Qf,"SvgArc",4);Qf.prototype.freeze=function(){this.G=!0;return this};Qf.prototype.Wa=function(){this.G=!1;return this};Qf.prototype.close=Qf.prototype.close=function(){this.Th=!0;return this};
  function Jf(a,b){if(null!==a.ng&&!1===b.hb)return a.ng;var c=a.radiusX,d=a.radiusY;void 0===d&&(d=c);if(0===c||0===d)return a.ng=[],a.ng;var e=a.Dd,g=a.Ne,h=ef(c<d?c:d,a.Fe,a.Fe+a.Lf,!1);if(c!==d){var k=z.Hh();k.reset();c<d?k.scale(1,d/c):k.scale(c/d,1);Cf(h,k);z.jf(k)}c=h.length;for(d=0;d<c;d++)k=h[d],k[0]+=e,k[1]+=g,k[2]+=e,k[3]+=g,k[4]+=e,k[5]+=g,k[6]+=e,k[7]+=g;a.ng=h;return a.ng}
  function Kf(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.ng&&!1===b.hb)return a.ng;b=a.nh;var g=a.zg;if(0===b||0===g)return a.ng=[],a.ng;var h=Math.PI/180*a.Dd,k=a.wo,l=a.Ln,m=a.zb,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/(g*g);1<s&&(b*=Math.sqrt(s),g*=Math.sqrt(s));s=(k===l?-1:1)*Math.sqrt((b*b*g*g-b*b*h*h-g*g*r*r)/(b*b*h*h+g*g*r*r));isNaN(s)&&(s=0);k=s*b*h/g;s=s*-g*
  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)/g);p=(r-k)/b;m=(h-s)/g;r=(-r-k)/b;k=(-h-s)/g;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>g?1:b/g;r=b>g?g/b:1;b=ef(b>g?b:g,n,n+h,!0);g=z.Hh();g.reset();g.translate(c,d);g.rotate(a.Dd,0,0);g.scale(l,r);Cf(b,g);z.jf(g);a.ng=b;return a.ng}
  z.defineProperty(Qf,{ix:"isClosed"},function(){return this.Th},function(a){this.Th!==a&&(this.Th=a,this.hb=!0)});z.defineProperty(Qf,{type:"type"},function(){return this.ba},function(a){u&&z.Ba(a,Qf,Qf,"type");this.G&&z.oa(this,a);this.ba=a;this.hb=!0});z.defineProperty(Qf,{L:"endX"},function(){return this.zb},function(a){u&&z.p(a,Qf,"endX");this.G&&z.oa(this,a);this.zb=a;this.hb=!0});
  z.defineProperty(Qf,{M:"endY"},function(){return this.Gb},function(a){u&&z.p(a,Qf,"endY");this.G&&z.oa(this,a);this.Gb=a;this.hb=!0});z.defineProperty(Qf,{zc:"point1X"},function(){return this.Dd},function(a){u&&z.p(a,Qf,"point1X");this.G&&z.oa(this,a);this.Dd=a;this.hb=!0});z.defineProperty(Qf,{Qc:"point1Y"},function(){return this.Ne},function(a){u&&z.p(a,Qf,"point1Y");this.G&&z.oa(this,a);this.Ne=a;this.hb=!0});
  z.defineProperty(Qf,{Ch:"point2X"},function(){return this.nh},function(a){u&&z.p(a,Qf,"point2X");this.G&&z.oa(this,a);this.nh=a;this.hb=!0});z.defineProperty(Qf,{Dh:"point2Y"},function(){return this.zg},function(a){u&&z.p(a,Qf,"point2Y");this.G&&z.oa(this,a);this.zg=a;this.hb=!0});z.defineProperty(Qf,{ra:"centerX"},function(){return this.Dd},function(a){u&&z.p(a,Qf,"centerX");this.G&&z.oa(this,a);this.Dd=a;this.hb=!0});
  z.defineProperty(Qf,{za:"centerY"},function(){return this.Ne},function(a){u&&z.p(a,Qf,"centerY");this.G&&z.oa(this,a);this.Ne=a;this.hb=!0});z.defineProperty(Qf,{radiusX:"radiusX"},function(){return this.nh},function(a){u&&z.p(a,Qf,"radiusX");0>a&&z.ka(a,">= zero",Qf,"radiusX");this.G&&z.oa(this,a);this.nh=a;this.hb=!0});z.defineProperty(Qf,{radiusY:"radiusY"},function(){return this.zg},function(a){u&&z.p(a,Qf,"radiusY");0>a&&z.ka(a,">= zero",Qf,"radiusY");this.G&&z.oa(this,a);this.zg=a;this.hb=!0});
  z.defineProperty(Qf,{Fe:"startAngle"},function(){return this.zb},function(a){this.zb!==a&&(this.G&&z.oa(this,a),u&&z.p(a,Qf,"startAngle"),a%=360,0>a&&(a+=360),this.zb=a,this.hb=!0)});z.defineProperty(Qf,{Lf:"sweepAngle"},function(){return this.Gb},function(a){u&&z.p(a,Qf,"sweepAngle");this.G&&z.oa(this,a);360<a&&(a=360);-360>a&&(a=-360);this.Gb=a;this.hb=!0});z.defineProperty(Qf,{Ol:"isClockwiseArc"},function(){return this.Ln},function(a){this.G&&z.oa(this,a);this.Ln=a;this.hb=!0});
  z.defineProperty(Qf,{mx:"isLargeArc"},function(){return this.wo},function(a){this.G&&z.oa(this,a);this.wo=a;this.hb=!0});z.defineProperty(Qf,{xj:"xAxisRotation"},function(){return this.Dd},function(a){u&&z.p(a,Qf,"xAxisRotation");a%=360;0>a&&(a+=360);this.G&&z.oa(this,a);this.Dd=a;this.hb=!0});
  function Rf(){this.Z=null;this.wz=(new N(0,0)).freeze();this.Dy=(new N(0,0)).freeze();this.Tu=this.Qv=0;this.Uu=1;this.Ev="";this.yw=this.kv=!1;this.gv=this.Wu=0;this.zj=this.rv=this.Bv=!1;this.Yq=null;this.ww=0;this.Bg=this.vw=null}z.ia("InputEvent",Rf);
  Rf.prototype.copy=function(){var a=new Rf;a.Z=this.Z;a.wz.assign(this.ue);a.Dy.assign(this.ga);a.Qv=this.Qv;a.Tu=this.Tu;a.Uu=this.Uu;a.Ev=this.Ev;a.kv=this.kv;a.yw=this.yw;a.Wu=this.Wu;a.gv=this.gv;a.Bv=this.Bv;a.rv=this.rv;a.zj=this.zj;a.Yq=this.Yq;a.ww=this.ww;a.vw=this.vw;a.Bg=this.Bg;return a};
  Rf.prototype.toString=function(){var a="^";0!==this.yd&&(a+="M:"+this.yd);0!==this.button&&(a+="B:"+this.button);""!==this.key&&(a+="K:"+this.key);0!==this.Pe&&(a+="C:"+this.Pe);0!==this.Dl&&(a+="D:"+this.Dl);this.Gc&&(a+="h");this.bubbles&&(a+="b");null!==this.ga&&(a+="@"+this.ga.toString());return a};z.defineProperty(Rf,{h:"diagram"},function(){return this.Z},function(a){this.Z=a});z.defineProperty(Rf,{ue:"viewPoint"},function(){return this.wz},function(a){z.l(a,N,Rf,"viewPoint");this.wz.assign(a)});
  z.defineProperty(Rf,{ga:"documentPoint"},function(){return this.Dy},function(a){z.l(a,N,Rf,"documentPoint");this.Dy.assign(a)});z.defineProperty(Rf,{yd:"modifiers"},function(){return this.Qv},function(a){this.Qv=a});z.defineProperty(Rf,{button:"button"},function(){return this.Tu},function(a){this.Tu=a;if(null===this.event)switch(a){case 0:this.buttons=1;break;case 1:this.buttons=4;break;case 2:this.buttons=2}});
  z.defineProperty(Rf,{buttons:"buttons"},function(){return this.Uu},function(a){this.Uu=a});z.defineProperty(Rf,{key:"key"},function(){return this.Ev},function(a){this.Ev=a});z.defineProperty(Rf,{Fl:"down"},function(){return this.kv},function(a){this.kv=a});z.defineProperty(Rf,{up:"up"},function(){return this.yw},function(a){this.yw=a});z.defineProperty(Rf,{Pe:"clickCount"},function(){return this.Wu},function(a){this.Wu=a});
  z.defineProperty(Rf,{Dl:"delta"},function(){return this.gv},function(a){this.gv=a});z.defineProperty(Rf,{Qt:"isMultiTouch"},function(){return this.Bv},function(a){this.Bv=a});z.defineProperty(Rf,{Gc:"handled"},function(){return this.rv},function(a){this.rv=a});z.defineProperty(Rf,{bubbles:"bubbles"},function(){return this.zj},function(a){this.zj=a});z.defineProperty(Rf,{event:"event"},function(){return this.Yq},function(a){this.Yq=a});
  z.w(Rf,{mj:"isTouchEvent"},function(){var a=window.TouchEvent;return a&&this.event instanceof a?!0:(a=window.PointerEvent)&&this.event instanceof a&&"touch"===this.event.pointerType});z.w(Rf,{sk:"isMac"},function(){return z.sk});z.defineProperty(Rf,{timestamp:"timestamp"},function(){return this.ww},function(a){this.ww=a});z.defineProperty(Rf,{Tg:"targetDiagram"},function(){return this.vw},function(a){this.vw=a});
  z.defineProperty(Rf,{Ge:"targetObject"},function(){return this.Bg},function(a){this.Bg=a});z.defineProperty(Rf,{control:"control"},function(){return 0!==(this.yd&1)},function(a){this.yd=a?this.yd|1:this.yd&-2});z.defineProperty(Rf,{shift:"shift"},function(){return 0!==(this.yd&4)},function(a){this.yd=a?this.yd|4:this.yd&-5});z.defineProperty(Rf,{alt:"alt"},function(){return 0!==(this.yd&2)},function(a){this.yd=a?this.yd|2:this.yd&-3});
  z.defineProperty(Rf,{$t:"meta"},function(){return 0!==(this.yd&8)},function(a){this.yd=a?this.yd|8:this.yd&-9});z.defineProperty(Rf,{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});
  z.defineProperty(Rf,{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});z.defineProperty(Rf,{VK:"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 Sf(){this.Z=null;this.Ub="";this.$v=this.tw=null;this.Vu=!1}z.ia("DiagramEvent",Sf);Sf.prototype.copy=function(){var a=new Sf;a.Z=this.Z;a.Ub=this.Ub;a.tw=this.tw;a.$v=this.$v;a.Vu=this.Vu;return a};Sf.prototype.toString=function(){var a="*"+this.name;this.cancel&&(a+="x");null!==this.WA&&(a+=":"+this.WA.toString());null!==this.CA&&(a+="("+this.CA.toString()+")");return a};z.defineProperty(Sf,{h:"diagram"},function(){return this.Z},function(a){this.Z=a});
  z.defineProperty(Sf,{name:"name"},function(){return this.Ub},function(a){this.Ub=a});z.defineProperty(Sf,{WA:"subject"},function(){return this.tw},function(a){this.tw=a});z.defineProperty(Sf,{CA:"parameter"},function(){return this.$v},function(a){this.$v=a});z.defineProperty(Sf,{cancel:"cancel"},function(){return this.Vu},function(a){this.Vu=a});function Tf(){this.vq=Uf;this.Bm=this.Pv="";this.Wr=this.Xr=this.$r=this.as=this.Zr=this.Z=this.ie=null}z.ia("ChangedEvent",Tf);var Vf;
  Tf.Transaction=Vf=z.s(Tf,"Transaction",-1);var Uf;Tf.Property=Uf=z.s(Tf,"Property",0);var Wf;Tf.Insert=Wf=z.s(Tf,"Insert",1);var Xf;Tf.Remove=Xf=z.s(Tf,"Remove",2);Tf.prototype.clear=Tf.prototype.clear=function(){this.Wr=this.Xr=this.$r=this.as=this.Zr=this.Z=this.ie=null};
  Tf.prototype.copy=function(){var a=new Tf;a.vq=this.vq;a.Pv=this.Pv;a.Bm=this.Bm;a.ie=this.ie;a.Z=this.Z;a.Zr=this.Zr;var b=this.as;a.as=z.Za(b)&&"function"===typeof b.V?b.V():b;b=this.$r;a.$r=z.Za(b)&&"function"===typeof b.V?b.V():b;b=this.Xr;a.Xr=z.Za(b)&&"function"===typeof b.V?b.V():b;b=this.Wr;a.Wr=z.Za(b)&&"function"===typeof b.V?b.V():b;return a};
  Tf.prototype.toString=function(){var a="",a=this.Dc===Vf?a+"* ":this.Dc===Uf?a+(null!==this.ha?"!m":"!d"):a+((null!==this.ha?"!m":"!d")+this.Dc);this.propertyName&&"string"===typeof this.propertyName&&(a+=" "+this.propertyName);this.rf&&this.rf!==this.propertyName&&(a+=" "+this.rf);a+=": ";this.Dc===Vf?null!==this.oldValue&&(a+=" "+this.oldValue):(null!==this.object&&(a+=ka(this.object)),null!==this.oldValue&&(a+="  old: "+ka(this.oldValue)),null!==this.Ng&&(a+=" "+this.Ng),null!==this.newValue&&
  (a+="  new: "+ka(this.newValue)),null!==this.Lg&&(a+=" "+this.Lg));return a};Tf.prototype.getValue=Tf.prototype.na=function(a){return a?this.oldValue:this.newValue};Tf.prototype.getParam=function(a){return a?this.Ng:this.Lg};Tf.prototype.canUndo=Tf.prototype.canUndo=function(){return null!==this.ha||null!==this.h?!0:!1};Tf.prototype.undo=Tf.prototype.undo=function(){this.canUndo()&&(null!==this.ha?this.ha.Um(this,!0):null!==this.h&&this.h.Um(this,!0))};
  Tf.prototype.canRedo=Tf.prototype.canRedo=function(){return null!==this.ha||null!==this.h?!0:!1};Tf.prototype.redo=Tf.prototype.redo=function(){this.canRedo()&&(null!==this.ha?this.ha.Um(this,!1):null!==this.h&&this.h.Um(this,!1))};z.defineProperty(Tf,{ha:"model"},function(){return this.ie},function(a){this.ie=a});z.defineProperty(Tf,{h:"diagram"},function(){return this.Z},function(a){this.Z=a});
  z.defineProperty(Tf,{Dc:"change"},function(){return this.vq},function(a){u&&z.Ba(a,Tf,Tf,"change");this.vq=a});z.defineProperty(Tf,{rf:"modelChange"},function(){return this.Pv},function(a){u&&z.g(a,"string",Tf,"modelChange");this.Pv=a});z.defineProperty(Tf,{propertyName:"propertyName"},function(){return this.Bm},function(a){u&&"string"!==typeof a&&z.g(a,"function",Tf,"propertyName");this.Bm=a});
  z.w(Tf,{SE:"isTransactionFinished"},function(){return this.vq===Vf&&("CommittedTransaction"===this.Bm||"FinishedUndo"===this.Bm||"FinishedRedo"===this.Bm)});z.defineProperty(Tf,{object:"object"},function(){return this.Zr},function(a){this.Zr=a});z.defineProperty(Tf,{oldValue:"oldValue"},function(){return this.as},function(a){this.as=a});z.defineProperty(Tf,{Ng:"oldParam"},function(){return this.$r},function(a){this.$r=a});
  z.defineProperty(Tf,{newValue:"newValue"},function(){return this.Xr},function(a){this.Xr=a});z.defineProperty(Tf,{Lg:"newParam"},function(){return this.Wr},function(a){this.Wr=a});
  function M(a){1<arguments.length&&z.k("Model constructor can only take one optional argument, the Array of node data.");z.kc(this);this.Kq=this.Ub="";this.Hi=!1;this.cz={};this.wf=[];this.vc=new na(null,Object);this.Wj="key";this.Qn=this.zo=null;this.Cq=this.Zu=!1;this.nq=null;this.wm="category";this.og=new na(null,K);this.Qj=null;this.Wi=!1;this.vz=null;this.pa=new Yf;void 0!==a&&(this.hg=a)}z.ia("Model",M);
  M.prototype.cloneProtected=function(a){a.Ub=this.Ub;a.Kq=this.Kq;a.Hi=this.Hi;a.Wj=this.Wj;a.zo=this.zo;a.Qn=this.Qn;a.EJ=this.Zu;a.Cq=this.Cq;a.nq=this.nq;a.wm=this.wm};M.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};M.prototype.clear=M.prototype.clear=function(){this.wf=[];this.vc.clear();this.og.clear();this.pa.clear()};f=M.prototype;
  f.toString=function(a){void 0===a&&(a=0);if(1<a)return this.ZA();var b=(""!==this.name?this.name:"")+" Model";if(0<a){b+="\n node data:";a=this.hg;for(var c=z.ab(a),d=0;d<c;d++)var e=z.Ya(a,d),b=b+(" "+this.pb(e)+":"+ka(e))}return b};
  f.Bn=function(){var a="";""!==this.name&&(a+=',\n  "name": '+this.quote(this.name));""!==this.Bl&&(a+=',\n  "dataFormat": '+this.quote(this.Bl));this.ib&&(a+=',\n  "isReadOnly": '+this.ib);"key"!==this.rj&&"string"===typeof this.rj&&(a+=',\n  "nodeKeyProperty": '+this.quote(this.rj));this.Lz&&(a+=',\n  "copiesArrays": true');this.Kz&&(a+=',\n  "copiesArrayObjects": true');"category"!==this.pn&&"string"===typeof this.pn&&(a+=',\n  "nodeCategoryProperty": '+this.quote(this.pn));return a};
  f.hu=function(a){a.name&&(this.name=a.name);a.dataFormat&&(this.Bl=a.dataFormat);a.isReadOnly&&(this.ib=a.isReadOnly);a.nodeKeyProperty&&(this.rj=a.nodeKeyProperty);a.copiesArrays&&(this.Lz=a.copiesArrays);a.copiesArrayObjects&&(this.Kz=a.copiesArrayObjects);a.nodeCategoryProperty&&(this.pn=a.nodeCategoryProperty)};function Zf(a){return',\n  "modelData": '+$f(a,a.uk)}function ag(a,b){var c=b.modelData;z.Za(c)&&(a.ku(c),a.uk=c)}
  f.hB=function(){var a=this.uk,b=!1,c;for(c in a)if(!bg(c,a[c])){b=!0;break}a="";b&&(a=Zf(this));return a+',\n  "nodeDataArray": '+cg(this,this.hg,!0)};f.FA=function(a){ag(this,a);a=a.nodeDataArray;z.isArray(a)&&(this.ku(a),this.hg=a)};
  function dg(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.na(b)===c)return!0;d.add(b,c);if(b.length!==c.length)return!1;for(var e=0;e<b.length;e++)if(!dg(a,b[e],c[e],d))return!1;return!0}if(z.Za(b)&&z.Za(c)){if(d.na(b)===c)return!0;d.add(b,c);for(e in b){var g=b[e];if(!bg(e,g)){var h=c[e];if(void 0===h||!dg(a,g,h,d))return!1}}for(var k in c)if(h=c[k],!bg(k,h)&&(g=b[k],void 0===g||!dg(a,g,h,d)))return!1;
  return!0}return!1}function pg(a,b,c){a[c]!==b[c]&&z.k("Model.computeJsonDifference: Model."+c+' is not the same in both models: "'+a[c]+'" and "'+b[c]+'"')}
  f.iB=function(a){pg(this,a,"nodeKeyProperty");this instanceof qg&&pg(this,a,"nodeParentKeyProperty");for(var b=new K,c=new K,d=(new K).$c(this.vc.TE),e=new na,g=a.hg,h=0;h<g.length;h++){var k=g[h],l=a.pb(k);if(void 0!==l){d.remove(l);var m=this.ne(l);null===m?(b.add(l),c.add(k)):dg(this,m,k,e)||c.add(k)}else this.oA(k),l=this.pb(k),b.add(l),c.add(k)}g="";dg(this,this.uk,a.uk,e)||(g+=Zf(this));0<b.count&&(g+=this.gy+cg(this,b.jc(),!0));0<c.count&&(g+=this.qB+cg(this,c.jc(),!0));0<d.count&&(g+=this.iy+
  cg(this,d.jc(),!0));return g};M.prototype.computeJsonDifference=M.prototype.computeJSONDifference=function(a,b){z.l(a,M,M,"computeJsonDifference:newmodel");void 0===b&&(b=this.constructor===M?"go.Model":this.constructor===V?"go.GraphLinksModel":this.constructor===qg?"go.TreeModel":z.kf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.Bn()+this.iB(a)+"}"};f=M.prototype;f.gy=',\n  "insertedNodeKeys": ';f.qB=',\n  "modifiedNodeData": ';f.iy=',\n  "removedNodeKeys": ';
  f.gB=function(a,b){var c=this,d=!1,e=new K,g=new K,h=new K;a.Zf.each(function(a){a.ha===c&&("nodeDataArray"===a.rf?a.Dc===Wf?e.add(a.newValue):a.Dc===Xf&&h.add(a.oldValue):c.le(a.object)?g.add(a.object):c.uk===a.object&&a.Dc===Uf&&(d=!0))});var k=new K;e.each(function(a){k.add(c.pb(a));b||g.add(a)});var l=new K;h.each(function(a){l.add(c.pb(a));b&&g.add(a)});var m="";d&&(m+=Zf(this));0<k.count&&(m+=(b?this.iy:this.gy)+cg(this,k.jc(),!0));0<g.count&&(m+=this.qB+cg(this,g.jc(),!0));0<l.count&&(m+=(b?
  this.gy:this.iy)+cg(this,l.jc(),!0));return m};
  f.EA=function(a){ag(this,a);var b=a.insertedNodeKeys;if(z.isArray(b))for(var c=z.ab(b),d=0;d<c;d++){var e=z.Ya(b,d),g=this.ne(e);null===g&&(g=this.copyNodeData({}),this.Ox(g,e),this.sl(g))}b=a.modifiedNodeData;if(z.isArray(b))for(c=z.ab(b),d=0;d<c;d++){var h=z.Ya(b,d),e=this.pb(h),g=this.ne(e);if(null!==g)for(var k in h)"__gohashid"!==k&&k!==this.rj&&this.setDataProperty(g,k,h[k])}a=a.removedNodeKeys;if(z.isArray(a))for(c=z.ab(a),d=0;d<c;d++)e=z.Ya(a,d),g=this.ne(e),null!==g&&this.Gx(g)};
  M.prototype.toIncrementalJson=M.prototype.toIncrementalJSON=function(a,b){z.l(a,Tf,M,"toIncrementalJson:e");a.Dc!==Vf&&z.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:"+a.toString());var c=a.object;if(!(a.SE&&c instanceof rg))return'{ "incremental": 0 }';void 0===b&&(b=this.constructor===M?"go.Model":this.constructor===V?"go.GraphLinksModel":this.constructor===qg?"go.TreeModel":z.kf(this));return'{ "class": '+this.quote(b)+', "incremental": 1'+this.Bn()+this.gB(c,"FinishedUndo"===
  a.propertyName)+"}"};M.prototype.toJson=M.prototype.toJSON=M.prototype.ZA=function(a){void 0===a&&(a=this.constructor===M?"go.Model":this.constructor===V?"go.GraphLinksModel":this.constructor===qg?"go.TreeModel":z.kf(this));return'{ "class": '+this.quote(a)+this.Bn()+this.hB()+"}"};
  M.prototype.applyIncrementalJson=M.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){u&&z.trace("JSON.parse error: "+c.toString())}else z.trace("WARNING: no JSON.parse available");else"object"===typeof a?b=a:z.k("Unable to modify a Model from: "+a);var d=b.incremental;"number"!==typeof d&&z.k("Unable to apply non-incremental changes to Model: "+a);0!==d&&(this.Wb("applyIncrementalJson"),this.EA(b),this.Kd("applyIncrementalJson"))};
  M.fromJson=M.fromJSON=function(a,b){void 0===b&&(b=null);null!==b&&z.l(b,M,M,"fromJson:model");var c=null;if("string"===typeof a)if(window.JSON&&window.JSON.parse)try{c=window.JSON.parse(a)}catch(d){u&&z.trace("JSON.parse error: "+d.toString())}else z.trace("WARNING: no JSON.parse available");else"object"===typeof a?c=a:z.k("Unable to construct a Model from: "+a);if(null===b){var e;e=null;var g=c["class"];if("string"===typeof g)try{var h=null;0===g.indexOf("go.")?(g=g.substr(3),h=aa[g]):(h=aa[g],
  void 0===h&&(h=window[g]));"function"===typeof h&&(e=new h)}catch(k){}null===e||e instanceof M?b=e:z.k("Unable to construct a Model of declared class: "+c["class"])}null===b&&(b=new V);b.hu(c);b.FA(c);return b};
  M.prototype.replaceJsonObjects=M.prototype.ku=function(a){if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++){var d=z.Ya(a,c);z.Za(d)&&z.LD(a,c,this.ku(d))}else if(z.Za(a)){for(c in a)if(d=a[c],z.Za(d)&&(d=this.ku(d),a[c]=d,"points"===c&&Array.isArray(d))){for(var e=0===d.length%2,g=0;g<d.length;g++)if("number"!==typeof d[g]){e=!1;break}if(e){e=new J(N);for(g=0;g<d.length/2;g++){var h=new N(d[2*g],d[2*g+1]);e.add(h)}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 N(sg(a.x),sg(a.y));else if("go.Size"===d)c=new Ea(sg(a.width),sg(a.height));else if("go.Rect"===d)c=new w(sg(a.x),sg(a.y),sg(a.width),sg(a.height));else if("go.Margin"===d)c=new Db(sg(a.top),sg(a.right),sg(a.bottom),sg(a.left));else if("go.Spot"===d)c="string"===typeof a["enum"]?Ub(a["enum"]):new Q(sg(a.x),sg(a.y),sg(a.offsetX),sg(a.offsetY));else if("go.Brush"===d){if(c=new Da,c.type=Ja(Da,a.type),"string"===typeof a.color&&(c.color=a.color),a.start instanceof
  Q&&(c.start=a.start),a.end instanceof Q&&(c.end=a.end),"number"===typeof a.startRadius&&(c.wu=sg(a.startRadius)),"number"===typeof a.endRadius&&(c.xt=sg(a.endRadius)),a=a.colorStops,z.Za(a))for(b in a)c.addColorStop(parseFloat(b),a[b])}else"go.Geometry"===d?(b=null,b="string"===typeof a.path?sf(a.path):new hf,b.type=Ja(hf,a.type),"number"===typeof a.startX&&(b.Ha=sg(a.startX)),"number"===typeof a.startY&&(b.Da=sg(a.startY)),"number"===typeof a.endX&&(b.L=sg(a.endX)),"number"===typeof a.endY&&(b.M=
  sg(a.endY)),a.spot1 instanceof Q&&(b.C=a.spot1),a.spot2 instanceof Q&&(b.D=a.spot2),c=b):"go.EnumValue"===d&&(b=a.classType,0===b.indexOf("go.")&&(b=b.substr(3)),c=Ja(aa[b],a.name));a=c}}return a};
  M.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 g=a.charCodeAt(d),b=16>g?b+("\\u000"+a.charCodeAt(d).toString(16)):32>g?b+("\\u00"+a.charCodeAt(d).toString(16)):8232===g?b+"\\u2028":8233===g?b+"\\u2029":b+e}return'"'+b+'"'};
  M.prototype.writeJsonValue=M.prototype.Du=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.Du(a.valueOf()):z.isArray(a)?cg(this,a):z.Za(a)?$f(this,a):"function"===typeof a?"null":a.toString()};
  function cg(a,b,c){void 0===c&&(c=!1);var d=z.ab(b);if(0>=d)return"[]";var e=new za;e.add("[ ");c&&1<d&&e.add("\n");for(var g=0;g<d;g++){var h=z.Ya(b,g);void 0!==h&&(0<g&&(e.add(","),c&&e.add("\n")),e.add(a.Du(h)))}c&&1<d&&e.add("\n");e.add(" ]");return e.toString()}function bg(a,b){return void 0===b||"__gohashid"===a||"_"===a[0]||"function"===typeof b?!0:!1}function tg(a){return isNaN(a)?"NaN":Infinity===a?"9e9999":-Infinity===a?"-9e9999":a}
  function $f(a,b){var c=b;if(c instanceof N){var d=c;b={"class":"go.Point",x:tg(d.x),y:tg(d.y)}}else if(c instanceof Ea){var e=c;b={"class":"go.Size",width:tg(e.width),height:tg(e.height)}}else if(c instanceof w)b={"class":"go.Rect",x:tg(c.x),y:tg(c.y),width:tg(c.width),height:tg(c.height)};else if(c instanceof Db)b={"class":"go.Margin",top:tg(c.top),right:tg(c.right),bottom:tg(c.bottom),left:tg(c.left)};else if(c instanceof Q)e=c,b=e.cd()?{"class":"go.Spot",x:tg(e.x),y:tg(e.y),offsetX:tg(e.offsetX),
  offsetY:tg(e.offsetY)}:{"class":"go.Spot","enum":e.toString()};else if(c instanceof Da){b={"class":"go.Brush",type:c.type.name};if(c.type===ug)b.color=c.color;else if(c.type===vg||c.type===yd)b.start=c.start,b.end=c.end,c.type===yd&&(0!==c.wu&&(b.startRadius=tg(c.wu)),isNaN(c.xt)||(b.endRadius=tg(c.xt)));if(null!==c.st){for(var g={},h=c.st.i;h.next();)g[h.key]=h.value;b.colorStops=g}}else if(c instanceof hf)b={"class":"go.Geometry",type:c.type.name},0!==c.Ha&&(b.startX=tg(c.Ha)),0!==c.Da&&(b.startY=
  tg(c.Da)),0!==c.L&&(b.endX=tg(c.L)),0!==c.M&&(b.endY=tg(c.M)),c.C.N(Zb)||(b.spot1=c.C),c.D.N(ic)||(b.spot2=c.D),c.type===jf&&(b.path=rf(c));else if(c instanceof Ba)b={"class":"go.EnumValue",classType:z.kf(c.Ae),name:c.name};else if(c instanceof O||c instanceof B||c instanceof wg||c instanceof M||c instanceof xg||c instanceof ra||c instanceof yg||c instanceof wa||c instanceof Yf||c instanceof rg)return z.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: "+
  c.toString()),"{}";g="{";c=!0;for(d in b)if(e=z.tb(b,d),!bg(d,e))if(c?c=!1:g+=", ",g+='"'+d+'":',"points"===d&&e instanceof J&&e.ba===N){h=e;e="[";for(h=h.i;h.next();){var k=h.value;1<e.length&&(e+=",");e+=a.Du(k.x);e+=",";e+=a.Du(k.y)}e+="]";g+=e}else g+=a.Du(e);return g+"}"}function sg(a){return"number"===typeof a?a:"NaN"===a?NaN:"9e9999"===a?Infinity:"-9e9999"===a?-Infinity:parseFloat(a)}
  z.defineProperty(M,{name:"name"},function(){return this.Ub},function(a){var b=this.Ub;b!==a&&(z.g(a,"string",M,"name"),this.Ub=a,this.j("name",b,a))});z.defineProperty(M,{Bl:"dataFormat"},function(){return this.Kq},function(a){var b=this.Kq;b!==a&&(z.g(a,"string",M,"dataFormat"),this.Kq=a,this.j("dataFormat",b,a))});z.defineProperty(M,{ib:"isReadOnly"},function(){return this.Hi},function(a){var b=this.Hi;b!==a&&(z.g(a,"boolean",M,"isReadOnly"),this.Hi=a,this.j("isReadOnly",b,a))});
  z.defineProperty(M,{uk:"modelData"},function(){return this.cz},function(a){var b=this.cz;b!==a&&(z.g(a,"object",M,"modelData"),this.cz=a,this.j("modelData",b,a),this.Mb(a))});M.prototype.addChangedListener=M.prototype.Qm=function(a){z.g(a,"function",M,"addChangedListener:listener");null===this.Qj&&(this.Qj=new J("function"));this.Qj.add(a)};
  M.prototype.removeChangedListener=M.prototype.iu=function(a){z.g(a,"function",M,"removeChangedListener:listener");null!==this.Qj&&(this.Qj.remove(a),0===this.Qj.count&&(this.Qj=null))};M.prototype.Lw=function(a){this.Bb||this.pa.CE(a);if(null!==this.Qj){var b=this.Qj,c=b.length;if(1===c)b=b.ea(0),b(a);else if(0!==c)for(var d=b.jc(),e=0;e<c;e++)b=d[e],b(a)}};M.prototype.raiseChangedEvent=M.prototype.Rc=function(a,b,c,d,e,g,h){zg(this,"",a,b,c,d,e,g,h)};
  M.prototype.raiseChanged=M.prototype.j=function(a,b,c,d,e){zg(this,"",Uf,a,this,b,c,d,e)};M.prototype.raiseDataChanged=M.prototype.DA=function(a,b,c,d,e,g){zg(this,"",Uf,b,a,c,d,e,g)};function zg(a,b,c,d,e,g,h,k,l){void 0===k&&(k=null);void 0===l&&(l=null);var m=new Tf;m.ha=a;m.Dc=c;m.rf=b;m.propertyName=d;m.object=e;m.oldValue=g;m.Ng=k;m.newValue=h;m.Lg=l;a.Lw(m)}
  z.defineProperty(M,{pa:"undoManager"},function(){return this.vz},function(a){var b=this.vz;b!==a&&(z.l(a,Yf,M,"undoManager"),null!==b&&b.XI(this),this.vz=a,null!==a&&a.OG(this))});z.defineProperty(M,{Bb:"skipsUndoManager"},function(){return this.Wi},function(a){z.g(a,"boolean",M,"skipsUndoManager");this.Wi=a});
  M.prototype.Um=function(a,b){if(null!==a&&a.ha===this)if(a.Dc===Uf){var c=a.object,d=a.propertyName,e=a.na(b);z.Sa(c,d,e)}else a.Dc===Wf?"nodeDataArray"===a.rf?(c=a.newValue,z.Za(c)&&(d=this.pb(c),void 0!==d&&(b?(z.ii(this.wf,a.Lg),this.vc.remove(d)):(z.bj(this.wf,a.Lg,c),this.vc.add(d,c))))):""===a.rf?(c=a.object,!z.isArray(c)&&a.propertyName&&(c=z.tb(a.object,a.propertyName)),z.isArray(c)&&(d=a.newValue,e=a.Lg,b?z.ii(c,e):z.bj(c,e,d))):z.k("unknown ChangedEvent.Insert object: "+a.toString()):a.Dc===
  Xf?"nodeDataArray"===a.rf?(c=a.oldValue,z.Za(c)&&(d=this.pb(c),void 0!==d&&(b?(z.bj(this.wf,a.Ng,c),this.vc.add(d,c)):(z.ii(this.wf,a.Ng),this.vc.remove(d))))):""===a.rf?(c=a.object,!z.isArray(c)&&a.propertyName&&(c=z.tb(a.object,a.propertyName)),z.isArray(c)&&(d=a.oldValue,e=a.Ng,b?z.bj(c,e,d):z.ii(c,e))):z.k("unknown ChangedEvent.Remove object: "+a.toString()):a.Dc!==Vf&&z.k("unknown ChangedEvent: "+a.toString())};M.prototype.startTransaction=M.prototype.Wb=function(a){return this.pa.Wb(a)};
  M.prototype.commitTransaction=M.prototype.Kd=function(a){return this.pa.Kd(a)};M.prototype.rollbackTransaction=M.prototype.Vp=function(){return this.pa.Vp()};M.prototype.updateTargetBindings=M.prototype.Mb=function(a,b){void 0===b&&(b="");zg(this,"SourceChanged",Vf,b,a,null,null)};
  z.defineProperty(M,{rj:"nodeKeyProperty"},function(){return this.Wj},function(a){var b=this.Wj;b!==a&&(Ag(a,M,"nodeKeyProperty"),""===a&&z.k("Model.nodeKeyProperty may not be the empty string"),0<this.vc.count&&z.k("Cannot set Model.nodeKeyProperty when there is existing node data"),this.Wj=a,this.j("nodeKeyProperty",b,a))});function Ag(a,b,c){"string"!==typeof a&&"function"!==typeof a&&z.ic(a,"string or function",b,c)}
  M.prototype.getKeyForNodeData=M.prototype.pb=function(a){if(null!==a){var b=this.Wj;if(""!==b&&(b=z.tb(a,b),void 0!==b)){if(Bg(b))return b;z.k("Key value for node data "+a+" is not a number or a string: "+b)}}};
  M.prototype.setKeyForNodeData=M.prototype.Ox=function(a,b){void 0!==b&&null!==b&&Bg(b)||z.ic(b,"number or string",M,"setKeyForNodeData:key");if(null!==a){var c=this.Wj;if(""!==c)if(this.le(a)){var d=z.tb(a,c);d!==b&&null===this.ne(b)&&(z.Sa(a,c,b),this.vc.remove(d),this.vc.add(b,a),zg(this,"nodeKey",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c),this.ju(d,b))}else z.Sa(a,c,b)}};
  z.defineProperty(M,{OK:"makeUniqueKeyFunction"},function(){return this.zo},function(a){var b=this.zo;b!==a&&(null!==a&&z.g(a,"function",M,"makeUniqueKeyFunction"),this.zo=a,this.j("makeUniqueKeyFunction",b,a))});function Bg(a){return"number"===typeof a||"string"===typeof a}M.prototype.containsNodeData=M.prototype.le=function(a){var b=this.pb(a);return void 0===b?!1:this.vc.na(b)===a};
  M.prototype.findNodeDataForKey=M.prototype.ne=function(a){null===a&&z.k("Model.findNodeDataForKey:key must not be null");return void 0!==a&&Bg(a)?this.vc.na(a):null};
  z.defineProperty(M,{hg:"nodeDataArray"},function(){return this.wf},function(a){var b=this.wf;if(b!==a){z.nt(a,M,"nodeDataArray");this.vc.clear();this.cB();for(var c=z.ab(a),d=0;d<c;d++){var e=z.Ya(a,d);if(!z.Za(e)){z.k("Model.nodeDataArray must only contain Objects, not: "+e);return}z.It(e)}this.wf=a;for(var g=new J(Object),d=0;d<c;d++){var e=z.Ya(a,d),h=this.pb(e);void 0===h?g.add(e):null!==this.vc.na(h)?g.add(e):this.vc.add(h,e)}for(d=g.i;d.next();)e=d.value,this.oA(e),g=this.pb(e),void 0!==g&&
  this.vc.add(g,e);zg(this,"nodeDataArray",Uf,"nodeDataArray",this,b,a);for(d=0;d<c;d++)e=z.Ya(a,d),this.Up(e),this.Tp(e);this.QD();z.fI(a)||(this.ib=!0)}});
  M.prototype.makeNodeDataKeyUnique=M.prototype.oA=function(a){if(null!==a){var b=this.Wj;if(""!==b){var c=this.pb(a);if(void 0===c||this.vc.contains(c)){var d=this.zo;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.vc.contains(c))){z.Sa(a,b,c);return}if("string"===typeof c){for(d=2;this.vc.contains(c+d);)d++;z.Sa(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.vc.count-1;this.vc.contains(d);)d--;z.Sa(a,b,d)}else z.k("Model.getKeyForNodeData returned something other than a string or a number: "+
  c)}}}};M.prototype.addNodeData=M.prototype.sl=function(a){null!==a&&(z.It(a),Cg(this,a,!0))};function Cg(a,b,c){var d=a.pb(b);if(void 0===d||a.vc.na(d)!==b)if(a.oA(b),d=a.pb(b),void 0===d)z.k("Model.makeNodeDataKeyUnique failed on "+b+".  Data not added to Model.");else{a.vc.add(d,b);if(c){var e=z.ab(a.wf);z.bj(a.wf,e,b)}zg(a,"nodeDataArray",Wf,"nodeDataArray",a,null,b,null,e);a.Up(b);a.Tp(b)}}
  M.prototype.addNodeDataCollection=function(a){if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++)this.sl(z.Ya(a,c));else for(a=a.i;a.next();)this.sl(a.value)};M.prototype.removeNodeData=M.prototype.Gx=function(a){null!==a&&Dg(this,a,!0)};function Dg(a,b,c){var d=a.pb(b);if(void 0!==d&&a.vc.contains(d)){a.vc.remove(d);if(c){var e=z.Fz(a.wf,b);if(0>e)return;z.ii(a.wf,e)}zg(a,"nodeDataArray",Xf,"nodeDataArray",a,b,null,e,null);a.Bu(b)}}
  M.prototype.removeNodeDataCollection=function(a){if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++)this.Gx(z.Ya(a,c));else for(a=a.i;a.next();)this.Gx(a.value)};f=M.prototype;f.ju=function(a,b){var c=Eg(this,a);c instanceof K&&this.og.add(b,c)};f.cB=function(){};f.Up=function(){};f.Tp=function(){};f.Bu=function(){};function Fg(a,b,c){if(void 0!==b){var d=a.og.na(b);null===d&&(d=new K(Object),a.og.add(b,d));d.add(c)}}
  function Gg(a,b,c){if(void 0!==b){var d=a.og.na(b);d instanceof K&&(void 0===c||null===c?a.og.remove(b):(d.remove(c),0===d.count&&a.og.remove(b)))}}function Eg(a,b){if(void 0===b)return null;var c=a.og.na(b);return c instanceof K?c:null}M.prototype.clearUnresolvedReferences=M.prototype.QD=function(a){void 0===a?this.og.clear():this.og.remove(a)};
  z.defineProperty(M,{fK:"copyNodeDataFunction"},function(){return this.Qn},function(a){var b=this.Qn;b!==a&&(null!==a&&z.g(a,"function",M,"copyNodeDataFunction"),this.Qn=a,this.j("copyNodeDataFunction",b,a))});z.defineProperty(M,{Lz:"copiesArrays"},function(){return this.Zu},function(a){var b=this.Zu;b!==a&&(null!==a&&z.g(a,"boolean",M,"copiesArrays"),this.Zu=a,this.j("copiesArrays",b,a))});
  z.defineProperty(M,{Kz:"copiesArrayObjects"},function(){return this.Cq},function(a){var b=this.Cq;b!==a&&(null!==a&&z.g(a,"boolean",M,"copiesArrayObjects"),this.Cq=a,this.j("copiesArrayObjects",b,a))});M.prototype.copyNodeData=function(a){if(null===a)return null;var b=null,b=this.Qn,b=null!==b?b(a,this):Hg(this,a,!0);z.Za(b)&&z.kc(b);return b};
  function Hg(a,b,c){if(a.Lz&&Array.isArray(b)){var d=[];for(c=0;c<b.length;c++){var e=Hg(a,b[c],a.Kz);d.push(e)}z.kc(d);return d}if(c&&z.Za(b)){c=(c=b.constructor)?new c:{};for(d in b)if("__gohashid"!==d){var e=z.tb(b,d),g;g=e;g instanceof O||g instanceof B||g instanceof wg||g instanceof Ig||g instanceof Jg||g instanceof xg||g instanceof ra||g instanceof yg||g instanceof Rf||g instanceof Sf?("_"!==d[0]&&z.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: "+g.toString()),g=!0):g=g instanceof M||g instanceof Yf||g instanceof rg||g instanceof Tf?!0:!1;g||(e=Hg(a,e,!1));z.Sa(c,d,e)}z.kc(c);return c}return b instanceof N?b.copy():b instanceof Ea?b.copy():b instanceof w?b.copy():b instanceof Q?b.copy():b instanceof Db?b.copy():b}
  z.defineProperty(M,{QG:"afterCopyFunction"},function(){return this.nq},function(a){var b=this.nq;b!==a&&(null!==a&&z.g(a,"function",M,"afterCopyFunction"),this.nq=a,this.j("afterCopyFunction",b,a))});var Kg=!1;
  M.prototype.setDataProperty=function(a,b,c){u&&(z.g(a,"object",M,"setDataProperty:data"),z.g(b,"string",M,"setDataProperty:propname"),""===b&&z.k("Model.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.le(a))if(b===this.rj)this.Ox(a,c);else{if(b===this.pn){this.Lx(a,c);return}}else!Kg&&a instanceof O&&(Kg=!0,z.trace('Model.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),z.trace("  Is that really your intent?"));var d=z.tb(a,b);d!==c&&
  (z.Sa(a,b,c),this.DA(a,b,d,c))};M.prototype.addArrayItem=function(a,b){this.bI(a,-1,b)};M.prototype.insertArrayItem=M.prototype.bI=function(a,b,c){u&&(z.nt(a,M,"insertArrayItem:arr"),z.p(b,M,"insertArrayItem:idx"));a===this.wf&&z.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");0>b&&(b=z.ab(a));z.bj(a,b,c);zg(this,"",Wf,"",a,null,c,null,b)};
  M.prototype.removeArrayItem=function(a,b){void 0===b&&(b=-1);u&&(z.nt(a,M,"removeArrayItem:arr"),z.p(b,M,"removeArrayItem:idx"));a===this.wf&&z.k("Model.removeArrayItem should not be called on the Model.nodeDataArray");-1===b&&(b=z.ab(a)-1);var c=z.Ya(a,b);z.ii(a,b);zg(this,"",Xf,"",a,c,null,b,null)};z.defineProperty(M,{pn:"nodeCategoryProperty"},function(){return this.wm},function(a){var b=this.wm;b!==a&&(Ag(a,M,"nodeCategoryProperty"),this.wm=a,this.j("nodeCategoryProperty",b,a))});
  M.prototype.getCategoryForNodeData=M.prototype.$z=function(a){if(null===a)return"";var b=this.wm;if(""===b)return"";b=z.tb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;z.k("getCategoryForNodeData found a non-string category for "+a+": "+b);return""};
  M.prototype.setCategoryForNodeData=M.prototype.Lx=function(a,b){z.g(b,"string",M,"setCategoryForNodeData:cat");if(null!==a){var c=this.wm;if(""!==c)if(this.le(a)){var d=z.tb(a,c);void 0===d&&(d="");d!==b&&(z.Sa(a,c,b),zg(this,"nodeCategory",Uf,c,a,d,b))}else z.Sa(a,c,b)}};
  function V(a,b){2<arguments.length&&z.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");M.call(this);this.vf=[];this.rm=new K(Object);this.hd=new na(null,Object);this.el="";this.Nk=this.Pn=this.Ao=null;this.Vh="from";this.Wh="to";this.tm=this.sm="";this.qm="category";this.vg="";this.Do="isGroup";this.kh="group";this.Dq=!1;void 0!==a&&(this.hg=a);void 0!==b&&(this.Kg=b)}z.Ra(V,M);z.ia("GraphLinksModel",V);
  V.prototype.cloneProtected=function(a){M.prototype.cloneProtected.call(this,a);a.el=this.el;a.Ao=this.Ao;a.Pn=this.Pn;a.Vh=this.Vh;a.Wh=this.Wh;a.sm=this.sm;a.tm=this.tm;a.qm=this.qm;a.vg=this.vg;a.Do=this.Do;a.kh=this.kh;a.Dq=this.Dq};V.prototype.clear=V.prototype.clear=function(){M.prototype.clear.call(this);this.vf=[];this.hd.clear();this.rm.clear()};f=V.prototype;
  f.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.ZA();var b=(""!==this.name?this.name:"")+" GraphLinksModel";if(0<a){b+="\n node data:";a=this.hg;for(var c=z.ab(a),d=0,d=0;d<c;d++)var e=z.Ya(a,d),b=b+(" "+this.pb(e)+":"+ka(e));b+="\n link data:";a=this.Kg;c=z.ab(a);for(d=0;d<c;d++)e=z.Ya(a,d),b+=" "+this.Ll(e)+"--\x3e"+this.Ml(e)}return b};
  f.Bn=function(){var a=M.prototype.Bn.call(this),b="";"category"!==this.Wt&&"string"===typeof this.Wt&&(b+=',\n  "linkCategoryProperty": '+this.quote(this.Wt));""!==this.pj&&"string"===typeof this.pj&&(b+=',\n  "linkKeyProperty": '+this.quote(this.pj));"from"!==this.Ep&&"string"===typeof this.Ep&&(b+=',\n  "linkFromKeyProperty": '+this.quote(this.Ep));"to"!==this.Gp&&"string"===typeof this.Gp&&(b+=',\n  "linkToKeyProperty": '+this.quote(this.Gp));""!==this.Xt&&"string"===typeof this.Xt&&(b+=',\n  "linkFromPortIdProperty": '+
  this.quote(this.Xt));""!==this.Zt&&"string"===typeof this.Zt&&(b+=',\n  "linkToPortIdProperty": '+this.quote(this.Zt));""!==this.Yt&&"string"===typeof this.Yt&&(b+=',\n  "linkLabelKeysProperty": '+this.quote(this.Yt));"isGroup"!==this.eu&&"string"===typeof this.eu&&(b+=',\n  "nodeIsGroupProperty": '+this.quote(this.eu));"group"!==this.Pp&&"string"===typeof this.Pp&&(b+=',\n  "nodeGroupKeyProperty": '+this.quote(this.Pp));return a+b};
  f.hu=function(a){M.prototype.hu.call(this,a);a.linkKeyProperty&&(this.pj=a.linkKeyProperty);a.linkFromKeyProperty&&(this.Ep=a.linkFromKeyProperty);a.linkToKeyProperty&&(this.Gp=a.linkToKeyProperty);a.linkFromPortIdProperty&&(this.Xt=a.linkFromPortIdProperty);a.linkToPortIdProperty&&(this.Zt=a.linkToPortIdProperty);a.linkCategoryProperty&&(this.Wt=a.linkCategoryProperty);a.linkLabelKeysProperty&&(this.Yt=a.linkLabelKeysProperty);a.nodeIsGroupProperty&&(this.eu=a.nodeIsGroupProperty);a.nodeGroupKeyProperty&&
  (this.Pp=a.nodeGroupKeyProperty)};f.hB=function(){var a=M.prototype.hB.call(this),b=',\n  "linkDataArray": '+cg(this,this.Kg,!0);return a+b};f.FA=function(a){M.prototype.FA.call(this,a);a=a.linkDataArray;z.isArray(a)&&(this.ku(a),this.Kg=a)};
  f.iB=function(a){a instanceof V||z.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel");""===this.pj&&z.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");var b=M.prototype.iB.call(this,a);pg(this,a,"linkKeyProperty");pg(this,a,"linkFromKeyProperty");pg(this,a,"linkToKeyProperty");pg(this,a,"linkLabelKeysProperty");pg(this,a,"nodeIsGroupProperty");pg(this,a,"nodeGroupKeyProperty");for(var c=new K,d=new K,e=(new K).$c(this.hd.TE),
  g=new na,h=a.Kg,k=0;k<h.length;k++){var l=h[k],m=a.lf(l);if(void 0!==m){e.remove(m);var n=this.At(m);null===n?(c.add(m),d.add(l)):dg(this,n,l,g)||d.add(l)}else this.nA(l),m=this.lf(l),c.add(m),d.add(l)}a=b;0<c.count&&(a+=this.ey+cg(this,c.jc(),!0));0<d.count&&(a+=this.pB+cg(this,d.jc(),!0));0<e.count&&(a+=this.hy+cg(this,e.jc(),!0));return a};f.ey=',\n  "insertedLinkKeys": ';f.pB=',\n  "modifiedLinkData": ';f.hy=',\n  "removedLinkKeys": ';
  f.gB=function(a,b){""===this.pj&&z.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");var c=M.prototype.gB.call(this,a,b),d=this,e=new K,g=new K,h=new K;a.Zf.each(function(a){a.ha===d&&("linkDataArray"===a.rf?a.Dc===Wf?e.add(a.newValue):a.Dc===Xf&&h.add(a.oldValue):d.th(a.object)&&g.add(a.object))});var k=new K;e.each(function(a){k.add(d.lf(a));b||g.add(a)});var l=new K;h.each(function(a){l.add(d.lf(a));b&&g.add(a)});0<k.count&&(c+=(b?this.hy:this.ey)+
  cg(this,k.jc(),!0));0<g.count&&(c+=this.pB+cg(this,g.jc(),!0));0<l.count&&(c+=(b?this.ey:this.hy)+cg(this,l.jc(),!0));return c};
  f.EA=function(a){M.prototype.EA.call(this,a);var b=a.insertedLinkKeys;if(z.isArray(b))for(var c=z.ab(b),d=0;d<c;d++){var e=z.Ya(b,d),g=this.At(e);null===g&&(g=this.Qw({}),this.IF(g,e),this.gt(g))}b=a.modifiedLinkData;if(z.isArray(b))for(c=z.ab(b),d=0;d<c;d++){var h=z.Ya(b,d),e=this.lf(h),g=this.At(e);if(null!==g)for(var k in h)"__gohashid"!==k&&k!==this.pj&&this.setDataProperty(g,k,h[k])}a=a.removedLinkKeys;if(z.isArray(a))for(c=z.ab(a),d=0;d<c;d++)e=z.Ya(a,d),g=this.At(e),null!==g&&this.Fx(g)};
  f.Um=function(a,b){var c=null;if(a.Dc===Wf){if("linkDataArray"===a.rf?c=this.vf:"linkLabelKeys"===a.rf&&(c=this.rk(a.object)),z.isArray(c)){if(b)z.ii(c,a.Lg),c===this.vf&&(c=this.lf(a.newValue),void 0!==c&&this.hd.remove(c));else if(z.bj(c,a.Lg,a.newValue),c===this.vf){var d=a.newValue,c=this.lf(d);void 0!==c&&this.hd.add(c,d)}return}}else if(a.Dc===Xf&&("linkDataArray"===a.rf?c=this.vf:"linkLabelKeys"===a.rf&&(c=this.rk(a.object)),z.isArray(c))){b?(z.bj(c,a.Ng,a.oldValue),c===this.vf&&(d=a.newValue,
  c=this.lf(d),void 0!==c&&this.hd.add(c,d))):(z.ii(c,a.Ng),c===this.vf&&(c=this.lf(a.newValue),void 0!==c&&this.hd.remove(c)));return}M.prototype.Um.call(this,a,b)};z.defineProperty(V,{Ez:"archetypeNodeData"},function(){return this.Nk},function(a){var b=this.Nk;b!==a&&(null!==a&&z.l(a,Object,V,"archetypeNodeData"),this.Nk=a,this.j("archetypeNodeData",b,a))});V.prototype.on=function(a){if(void 0!==a){var b=this.Nk;if(null!==b){var c=this.ne(a);null===c&&(c=this.copyNodeData(b),z.Sa(c,this.Wj,a),this.sl(c))}return a}};
  z.defineProperty(V,{Ep:"linkFromKeyProperty"},function(){return this.Vh},function(a){var b=this.Vh;b!==a&&(Ag(a,V,"linkFromKeyProperty"),this.Vh=a,this.j("linkFromKeyProperty",b,a))});V.prototype.getFromKeyForLinkData=V.prototype.Ll=function(a){if(null!==a){var b=this.Vh;if(""!==b&&(b=z.tb(a,b),void 0!==b)){if(Bg(b))return b;z.k("FromKey value for link data "+a+" is not a number or a string: "+b)}}};
  V.prototype.setFromKeyForLinkData=V.prototype.Mx=function(a,b){null===b&&(b=void 0);void 0===b||Bg(b)||z.ic(b,"number or string",V,"setFromKeyForLinkData:key");if(null!==a){var c=this.Vh;if(""!==c)if(b=this.on(b),this.th(a)){var d=z.tb(a,c);d!==b&&(Gg(this,d,a),z.Sa(a,c,b),null===this.ne(b)&&Fg(this,b,a),zg(this,"linkFromKey",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  z.defineProperty(V,{Gp:"linkToKeyProperty"},function(){return this.Wh},function(a){var b=this.Wh;b!==a&&(Ag(a,V,"linkToKeyProperty"),this.Wh=a,this.j("linkToKeyProperty",b,a))});V.prototype.getToKeyForLinkData=V.prototype.Ml=function(a){if(null!==a){var b=this.Wh;if(""!==b&&(b=z.tb(a,b),void 0!==b)){if(Bg(b))return b;z.k("ToKey value for link data "+a+" is not a number or a string: "+b)}}};
  V.prototype.setToKeyForLinkData=V.prototype.Qx=function(a,b){null===b&&(b=void 0);void 0===b||Bg(b)||z.ic(b,"number or string",V,"setToKeyForLinkData:key");if(null!==a){var c=this.Wh;if(""!==c)if(b=this.on(b),this.th(a)){var d=z.tb(a,c);d!==b&&(Gg(this,d,a),z.Sa(a,c,b),null===this.ne(b)&&Fg(this,b,a),zg(this,"linkToKey",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  z.defineProperty(V,{Xt:"linkFromPortIdProperty"},function(){return this.sm},function(a){var b=this.sm;b!==a&&(Ag(a,V,"linkFromPortIdProperty"),this.sm=a,this.j("linkFromPortIdProperty",b,a))});V.prototype.getFromPortIdForLinkData=V.prototype.LH=function(a){if(null===a)return"";var b=this.sm;if(""===b)return"";a=z.tb(a,b);return void 0===a?"":a};
  V.prototype.setFromPortIdForLinkData=V.prototype.PA=function(a,b){z.g(b,"string",V,"setFromPortIdForLinkData:portname");if(null!==a){var c=this.sm;if(""!==c)if(this.th(a)){var d=z.tb(a,c);void 0===d&&(d="");d!==b&&(z.Sa(a,c,b),zg(this,"linkFromPortId",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};z.defineProperty(V,{Zt:"linkToPortIdProperty"},function(){return this.tm},function(a){var b=this.tm;b!==a&&(Ag(a,V,"linkToPortIdProperty"),this.tm=a,this.j("linkToPortIdProperty",b,a))});
  V.prototype.getToPortIdForLinkData=V.prototype.OH=function(a){if(null===a)return"";var b=this.tm;if(""===b)return"";a=z.tb(a,b);return void 0===a?"":a};V.prototype.setToPortIdForLinkData=V.prototype.SA=function(a,b){z.g(b,"string",V,"setToPortIdForLinkData:portname");if(null!==a){var c=this.tm;if(""!==c)if(this.th(a)){var d=z.tb(a,c);void 0===d&&(d="");d!==b&&(z.Sa(a,c,b),zg(this,"linkToPortId",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  z.defineProperty(V,{Yt:"linkLabelKeysProperty"},function(){return this.vg},function(a){var b=this.vg;b!==a&&(Ag(a,V,"linkLabelKeysProperty"),this.vg=a,this.j("linkLabelKeysProperty",b,a))});V.prototype.getLabelKeysForLinkData=V.prototype.rk=function(a){if(null===a)return z.yj;var b=this.vg;if(""===b)return z.yj;a=z.tb(a,b);return void 0===a?z.yj:a};
  V.prototype.setLabelKeysForLinkData=V.prototype.JF=function(a,b){z.nt(b,V,"setLabelKeysForLinkData:arr");if(null!==a){var c=this.vg;if(""!==c)if(this.th(a)){var d=z.tb(a,c);void 0===d&&(d=z.yj);if(d!==b){for(var e=z.ab(d),g=0;g<e;g++){var h=z.Ya(d,g);Gg(this,h,a)}z.Sa(a,c,b);e=z.ab(b);for(g=0;g<e;g++)h=z.Ya(b,g),null===this.ne(h)&&Fg(this,h,a);zg(this,"linkLabelKeys",Uf,c,a,d,b);"string"===typeof c&&this.Mb(a,c)}}else z.Sa(a,c,b)}};
  V.prototype.addLabelKeyForLinkData=V.prototype.Bz=function(a,b){if(null!==b&&void 0!==b&&(Bg(b)||z.ic(b,"number or string",V,"addLabelKeyForLinkData:key"),null!==a)){var c=this.vg;if(""!==c){var d=z.tb(a,c);void 0===d?(c=[],c.push(b),this.JF(a,c)):z.isArray(d)?0<=z.Fz(d,b)||(z.bj(d,Infinity,b),this.th(a)&&(null===this.ne(b)&&Fg(this,b,a),zg(this,"linkLabelKeys",Wf,c,a,null,b))):z.k(c+" property is not an Array; cannot addLabelKeyForLinkData: "+a)}}};
  V.prototype.removeLabelKeyForLinkData=V.prototype.mF=function(a,b){if(null!==b&&void 0!==b&&(Bg(b)||z.ic(b,"number or string",V,"removeLabelKeyForLinkData:key"),null!==a)){var c=this.vg;if(""!==c){var d=z.tb(a,c);if(z.isArray(d)){var e=z.Fz(d,b);0>e||(z.ii(d,e),this.th(a)&&(Gg(this,b,a),zg(this,"linkLabelKeys",Xf,c,a,b,null)))}else void 0!==d&&z.k(c+" property is not an Array; cannot removeLabelKeyforLinkData: "+a)}}};
  z.defineProperty(V,{Kg:"linkDataArray"},function(){return this.vf},function(a){var b=this.vf;if(b!==a){z.nt(a,V,"linkDataArray");this.hd.clear();for(var c=z.ab(a),d=0;d<c;d++){var e=z.Ya(a,d);if(!z.Za(e)){z.k("GraphLinksModel.linkDataArray must only contain Objects, not: "+e);return}z.It(e)}this.vf=a;if(""!==this.pj){for(var g=new J(Object),d=0;d<c;d++){var e=z.Ya(a,d),h=this.lf(e);void 0===h?g.add(e):null!==this.hd.na(h)?g.add(e):this.hd.add(h,e)}for(d=g.i;d.next();)e=d.value,this.nA(e),g=this.lf(e),
  void 0!==g&&this.hd.add(g,e)}g=new K(Object);for(d=0;d<c;d++)e=z.Ya(a,d),g.add(e);this.rm=g;zg(this,"linkDataArray",Uf,"linkDataArray",this,b,a);for(d=0;d<c;d++)e=z.Ya(a,d),Lg(this,e)}});z.defineProperty(V,{pj:"linkKeyProperty"},function(){return this.el},function(a){var b=this.el;if(b!==a){Ag(a,V,"linkKeyProperty");this.el=a;this.hd.clear();for(var c=z.ab(this.Kg),d=0;d<c;d++){var e=z.Ya(this.Kg,d),g=this.lf(e);void 0!==g&&this.hd.add(g,e)}this.j("linkKeyProperty",b,a)}});
  V.prototype.getKeyForLinkData=V.prototype.lf=function(a){if(null!==a){var b=this.el;if(""!==b&&(b=z.tb(a,b),void 0!==b)){if(Bg(b))return b;z.k("Key value for link data "+a+" is not a number or a string: "+b)}}};
  V.prototype.setKeyForLinkData=V.prototype.IF=function(a,b){void 0!==b&&null!==b&&Bg(b)||z.ic(b,"number or string",V,"setKeyForLinkData:key");if(null!==a){var c=this.el;if(""!==c)if(this.th(a)){var d=z.tb(a,c);d!==b&&null===this.At(b)&&(z.Sa(a,c,b),this.hd.remove(d),this.hd.add(b,a),zg(this,"linkKey",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  z.defineProperty(V,{PK:"makeUniqueLinkKeyFunction"},function(){return this.Ao},function(a){var b=this.Ao;b!==a&&(null!==a&&z.g(a,"function",V,"makeUniqueLinkKeyFunction"),this.Ao=a,this.j("makeUniqueLinkKeyFunction",b,a))});V.prototype.findLinkDataForKey=V.prototype.At=function(a){null===a&&z.k("GraphLinksModel.findLinkDataForKey:key must not be null");return void 0!==a&&Bg(a)?this.hd.na(a):null};
  V.prototype.makeLinkDataKeyUnique=V.prototype.nA=function(a){if(null!==a){var b=this.el;if(""!==b){var c=this.lf(a);if(void 0===c||this.hd.contains(c)){var d=this.Ao;if(null!==d&&(c=d(this,a),void 0!==c&&null!==c&&!this.hd.contains(c))){z.Sa(a,b,c);return}if("string"===typeof c){for(d=2;this.hd.contains(c+d);)d++;z.Sa(a,b,c+d)}else if(void 0===c||"number"===typeof c){for(d=-this.hd.count-1;this.hd.contains(d);)d--;z.Sa(a,b,d)}else z.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: "+
  c)}}}};V.prototype.containsLinkData=V.prototype.th=function(a){return null===a?!1:this.rm.contains(a)};V.prototype.addLinkData=V.prototype.gt=function(a){if(null!==a){if(void 0===z.nd(a))z.kc(a);else if(this.th(a))return;Mg(this,a,!0)}};
  function Mg(a,b,c){if(""!==a.pj){var d=a.lf(b);if(void 0!==d&&a.hd.na(d)===b)return;a.nA(b);d=a.lf(b);if(void 0===d){z.k("GraphLinksModel.makeLinkDataKeyUnique failed on "+b+". Data not added to model.");return}a.hd.add(d,b)}a.rm.add(b);if(c){var e=z.ab(a.vf);z.bj(a.vf,e,b)}zg(a,"linkDataArray",Wf,"linkDataArray",a,null,b,null,e);Lg(a,b)}V.prototype.addLinkDataCollection=function(a){if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++)this.gt(z.Ya(a,c));else for(a=a.i;a.next();)this.gt(a.value)};
  V.prototype.removeLinkData=V.prototype.Fx=function(a){null!==a&&Zg(this,a,!0)};function Zg(a,b,c){a.rm.remove(b);var d=a.lf(b);void 0!==d&&a.hd.remove(d);if(c){var e=a.vf.indexOf(b);if(0>e)return;z.ii(a.vf,e)}zg(a,"linkDataArray",Xf,"linkDataArray",a,b,null,e,null);c=a.Ll(b);Gg(a,c,b);c=a.Ml(b);Gg(a,c,b);d=a.rk(b);if(z.isArray(d))for(var e=z.ab(d),g=0;g<e;g++)c=z.Ya(d,g),Gg(a,c,b)}
  V.prototype.removeLinkDataCollection=function(a){if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++)this.Fx(z.Ya(a,c));else for(a=a.i;a.next();)this.Fx(a.value)};function Lg(a,b){var c=a.Ll(b),c=a.on(c);null===a.ne(c)&&Fg(a,c,b);c=a.Ml(b);c=a.on(c);null===a.ne(c)&&Fg(a,c,b);var d=a.rk(b);if(z.isArray(d))for(var e=z.ab(d),g=0;g<e;g++)c=z.Ya(d,g),null===a.ne(c)&&Fg(a,c,b)}
  z.defineProperty(V,{eK:"copyLinkDataFunction"},function(){return this.Pn},function(a){var b=this.Pn;b!==a&&(null!==a&&z.g(a,"function",V,"copyLinkDataFunction"),this.Pn=a,this.j("copyLinkDataFunction",b,a))});V.prototype.copyLinkData=V.prototype.Qw=function(a){if(null===a)return null;var b=null,b=this.Pn,b=null!==b?b(a,this):Hg(this,a,!0);z.Za(b)&&(z.kc(b),""!==this.Vh&&z.Sa(b,this.Vh,void 0),""!==this.Wh&&z.Sa(b,this.Wh,void 0),""!==this.vg&&z.Sa(b,this.vg,[]));return b};
  z.defineProperty(V,{eu:"nodeIsGroupProperty"},function(){return this.Do},function(a){var b=this.Do;b!==a&&(Ag(a,V,"nodeIsGroupProperty"),this.Do=a,this.j("nodeIsGroupProperty",b,a))});V.prototype.isGroupForNodeData=V.prototype.hA=function(a){if(null===a)return!1;var b=this.Do;return""===b?!1:z.tb(a,b)?!0:!1};z.defineProperty(V,{Pp:"nodeGroupKeyProperty"},function(){return this.kh},function(a){var b=this.kh;b!==a&&(Ag(a,V,"nodeGroupKeyProperty"),this.kh=a,this.j("nodeGroupKeyProperty",b,a))});
  z.defineProperty(V,{Ym:"copiesGroupKeyOfNodeData"},function(){return this.Dq},function(a){this.Dq!==a&&(z.g(a,"boolean",V,"copiesGroupKeyOfNodeData"),this.Dq=a)});V.prototype.getGroupKeyForNodeData=V.prototype.en=function(a){if(null!==a){var b=this.kh;if(""!==b&&(b=z.tb(a,b),void 0!==b)){if(Bg(b))return b;z.k("GroupKey value for node data "+a+" is not a number or a string: "+b)}}};
  V.prototype.setGroupKeyForNodeData=V.prototype.Nx=function(a,b){null===b&&(b=void 0);void 0===b||Bg(b)||z.ic(b,"number or string",V,"setGroupKeyForNodeData:key");if(null!==a){var c=this.kh;if(""!==c)if(this.le(a)){var d=z.tb(a,c);d!==b&&(Gg(this,d,a),z.Sa(a,c,b),null===this.ne(b)&&Fg(this,b,a),zg(this,"nodeGroupKey",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  V.prototype.copyNodeData=function(a){if(null===a)return null;a=M.prototype.copyNodeData.call(this,a);this.Ym||""===this.kh||void 0===z.tb(a,this.kh)||z.Sa(a,this.kh,void 0);return a};
  V.prototype.setDataProperty=function(a,b,c){u&&(z.g(a,"object",V,"setDataProperty:data"),z.g(b,"string",V,"setDataProperty:propname"),""===b&&z.k("GraphLinksModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.le(a))if(b===this.rj)this.Ox(a,c);else{if(b===this.pn){this.Lx(a,c);return}if(b===this.Pp){this.Nx(a,c);return}b===this.eu&&z.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: "+b)}else if(this.th(a)){if(b===
  this.Ep){this.Mx(a,c);return}if(b===this.Gp){this.Qx(a,c);return}if(b===this.Xt){this.PA(a,c);return}if(b===this.Zt){this.SA(a,c);return}if(b===this.pj){this.IF(a,c);return}if(b===this.Wt){this.HF(a,c);return}if(b===this.Yt){this.JF(a,c);return}}else!Kg&&a instanceof O&&(Kg=!0,z.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),z.trace("  Is that really your intent?"));var d=z.tb(a,b);d!==c&&(z.Sa(a,b,c),this.DA(a,b,d,c))};f=V.prototype;
  f.ju=function(a,b){M.prototype.ju.call(this,a,b);for(var c=this.vc.i;c.next();)this.KA(c.value,a,b);for(c=this.rm.i;c.next();){var d=c.value,e=a,g=b;if(this.Ll(d)===e){var h=this.Vh;z.Sa(d,h,g);zg(this,"linkFromKey",Uf,h,d,e,g);"string"===typeof h&&this.Mb(d,h)}this.Ml(d)===e&&(h=this.Wh,z.Sa(d,h,g),zg(this,"linkToKey",Uf,h,d,e,g),"string"===typeof h&&this.Mb(d,h));var k=this.rk(d);if(z.isArray(k))for(var l=z.ab(k),h=this.vg,m=0;m<l;m++)z.Ya(k,m)===e&&(z.LD(k,m,g),zg(this,"linkLabelKeys",Wf,h,d,e,
  g))}};f.KA=function(a,b,c){if(this.en(a)===b){var d=this.kh;z.Sa(a,d,c);zg(this,"nodeGroupKey",Uf,d,a,b,c);"string"===typeof d&&this.Mb(a,d)}};f.cB=function(){M.prototype.cB.call(this);for(var a=this.Kg,b=z.ab(a),c=0;c<b;c++){var d=z.Ya(a,c);Lg(this,d)}};
  f.Up=function(a){M.prototype.Up.call(this,a);a=this.pb(a);var b=Eg(this,a);if(null!==b){for(var c=new J(Object),b=b.i;b.next();){var d=b.value;if(this.le(d)){if(this.en(d)===a){var e=this.kh;zg(this,"nodeGroupKey",Uf,e,d,a,a);"string"===typeof e&&this.Mb(d,e);c.add(d)}}else{this.Ll(d)===a&&(e=this.Vh,zg(this,"linkFromKey",Uf,e,d,a,a),"string"===typeof e&&this.Mb(d,e),c.add(d));this.Ml(d)===a&&(e=this.Wh,zg(this,"linkToKey",Uf,e,d,a,a),"string"===typeof e&&this.Mb(d,e),c.add(d));var g=this.rk(d);if(z.isArray(g))for(var h=
  z.ab(g),e=this.vg,k=0;k<h;k++)z.Ya(g,k)===a&&(zg(this,"linkLabelKeys",Wf,e,d,a,a),c.add(d))}}for(c=c.i;c.next();)Gg(this,a,c.value)}};f.Tp=function(a){M.prototype.Tp.call(this,a);var b=this.en(a);null===this.ne(b)&&Fg(this,b,a)};f.Bu=function(a){M.prototype.Bu.call(this,a);var b=this.en(a);Gg(this,b,a)};z.defineProperty(V,{Wt:"linkCategoryProperty"},function(){return this.qm},function(a){var b=this.qm;b!==a&&(Ag(a,V,"linkCategoryProperty"),this.qm=a,this.j("linkCategoryProperty",b,a))});
  V.prototype.getCategoryForLinkData=V.prototype.ex=function(a){if(null===a)return"";var b=this.qm;if(""===b)return"";b=z.tb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;z.k("getCategoryForLinkData found a non-string category for "+a+": "+b);return""};
  V.prototype.setCategoryForLinkData=V.prototype.HF=function(a,b){z.g(b,"string",V,"setCategoryForLinkData:cat");if(null!==a){var c=this.qm;if(""!==c)if(this.th(a)){var d=z.tb(a,c);void 0===d&&(d="");d!==b&&(z.Sa(a,c,b),zg(this,"linkCategory",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  function qg(a){1<arguments.length&&z.k("TreeModel constructor can only take one optional argument, the Array of node data.");M.call(this);this.lh="parent";this.Eq=!1;this.zm="parentLinkCategory";void 0!==a&&(this.hg=a)}z.Ra(qg,M);z.ia("TreeModel",qg);qg.prototype.cloneProtected=function(a){M.prototype.cloneProtected.call(this,a);a.lh=this.lh;a.Eq=this.Eq;a.zm=this.zm};
  qg.prototype.toString=function(a){void 0===a&&(a=0);if(2<=a)return this.ZA();var b=(""!==this.name?this.name:"")+" TreeModel";if(0<a){b+="\n node data:";a=this.hg;for(var c=z.ab(a),d=0;d<c;d++)var e=z.Ya(a,d),b=b+(" "+this.pb(e)+":"+ka(e))}return b};qg.prototype.Bn=function(){var a=M.prototype.Bn.call(this),b="";"parent"!==this.Qp&&"string"===typeof this.Qp&&(b+=',\n  "nodeParentKeyProperty": '+this.quote(this.Qp));return a+b};
  qg.prototype.hu=function(a){M.prototype.hu.call(this,a);a.nodeParentKeyProperty&&(this.Qp=a.nodeParentKeyProperty)};qg.prototype.on=function(a){return a};z.defineProperty(qg,{Qp:"nodeParentKeyProperty"},function(){return this.lh},function(a){var b=this.lh;b!==a&&(Ag(a,qg,"nodeParentKeyProperty"),this.lh=a,this.j("nodeParentKeyProperty",b,a))});
  z.defineProperty(qg,{Zm:"copiesParentKeyOfNodeData"},function(){return this.Eq},function(a){this.Eq!==a&&(z.g(a,"boolean",qg,"copiesParentKeyOfNodeData"),this.Eq=a)});qg.prototype.getParentKeyForNodeData=qg.prototype.fn=function(a){if(null!==a){var b=this.lh;if(""!==b&&(b=z.tb(a,b),void 0!==b)){if(Bg(b))return b;z.k("ParentKey value for node data "+a+" is not a number or a string: "+b)}}};
  qg.prototype.setParentKeyForNodeData=qg.prototype.Gh=function(a,b){null===b&&(b=void 0);void 0===b||Bg(b)||z.ic(b,"number or string",qg,"setParentKeyForNodeData:key");if(null!==a){var c=this.lh;if(""!==c)if(b=this.on(b),this.le(a)){var d=z.tb(a,c);d!==b&&(Gg(this,d,a),z.Sa(a,c,b),null===this.ne(b)&&Fg(this,b,a),zg(this,"nodeParentKey",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  z.defineProperty(qg,{kL:"parentLinkCategoryProperty"},function(){return this.zm},function(a){var b=this.zm;b!==a&&(Ag(a,qg,"parentLinkCategoryProperty"),this.zm=a,this.j("parentLinkCategoryProperty",b,a))});qg.prototype.getParentLinkCategoryForNodeData=qg.prototype.NH=function(a){if(null===a)return"";var b=this.zm;if(""===b)return"";b=z.tb(a,b);if(void 0===b)return"";if("string"===typeof b)return b;z.k("getParentLinkCategoryForNodeData found a non-string category for "+a+": "+b);return""};
  qg.prototype.setParentLinkCategoryForNodeData=qg.prototype.iJ=function(a,b){z.g(b,"string",qg,"setParentLinkCategoryForNodeData:cat");if(null!==a){var c=this.zm;if(""!==c)if(this.le(a)){var d=z.tb(a,c);void 0===d&&(d="");d!==b&&(z.Sa(a,c,b),zg(this,"parentLinkCategory",Uf,c,a,d,b),"string"===typeof c&&this.Mb(a,c))}else z.Sa(a,c,b)}};
  qg.prototype.copyNodeData=function(a){if(null===a)return null;a=M.prototype.copyNodeData.call(this,a);this.Zm||""===this.lh||void 0===z.tb(a,this.lh)||z.Sa(a,this.lh,void 0);return a};
  qg.prototype.setDataProperty=function(a,b,c){u&&(z.g(a,"object",qg,"setDataProperty:data"),z.g(b,"string",qg,"setDataProperty:propname"),""===b&&z.k("TreeModel.setDataProperty: property name must not be an empty string when setting "+a+" to "+c));if(this.le(a))if(b===this.rj)this.Ox(a,c);else{if(b===this.pn){this.Lx(a,c);return}if(b===this.Qp){this.Gh(a,c);return}}else!Kg&&a instanceof O&&(Kg=!0,z.trace('TreeModel.setDataProperty is modifying a GraphObject, "'+a.toString()+'"'),z.trace("  Is that really your intent?"));
  var d=z.tb(a,b);d!==c&&(z.Sa(a,b,c),this.DA(a,b,d,c))};f=qg.prototype;f.ju=function(a,b){M.prototype.ju.call(this,a,b);for(var c=this.vc.i;c.next();)this.KA(c.value,a,b)};f.KA=function(a,b,c){if(this.fn(a)===b){var d=this.lh;z.Sa(a,d,c);zg(this,"nodeParentKey",Uf,d,a,b,c);"string"===typeof d&&this.Mb(a,d)}};
  f.Up=function(a){M.prototype.Up.call(this,a);a=this.pb(a);var b=Eg(this,a);if(null!==b){for(var c=new J(Object),b=b.i;b.next();){var d=b.value;if(this.le(d)&&this.fn(d)===a){var e=this.lh;zg(this,"nodeParentKey",Uf,e,d,a,a);"string"===typeof e&&this.Mb(d,e);c.add(d)}}for(c=c.i;c.next();)Gg(this,a,c.value)}};f.Tp=function(a){M.prototype.Tp.call(this,a);var b=this.fn(a),b=this.on(b);null===this.ne(b)&&Fg(this,b,a)};f.Bu=function(a){M.prototype.Bu.call(this,a);var b=this.fn(a);Gg(this,b,a)};
  function $g(a,b,c){z.kc(this);this.G=!1;void 0===a?a="":z.g(a,"string",$g,"constructor:targetprop");void 0===b?b=a:z.g(b,"string",$g,"constructor:sourceprop");void 0===c?c=null:null!==c&&z.g(c,"function",$g,"constructor:conv");this.fD=-1;this.Bg=null;this.Wo=a;this.Vo=this.Ts=0;this.qw=null;this.qr=!1;this.Mo=b;this.Bq=c;this.Nr=ah;this.uq=null}z.ia("Binding",$g);
  $g.prototype.copy=function(){var a=new $g;a.Wo=this.Wo;a.Ts=this.Ts;a.Vo=this.Vo;a.qw=this.qw;a.qr=this.qr;a.Mo=this.Mo;a.Bq=this.Bq;a.Nr=this.Nr;a.uq=this.uq;return a};var ah;$g.OneWay=ah=z.s($g,"OneWay",1);var bh;$g.TwoWay=bh=z.s($g,"TwoWay",2);$g.parseEnum=function(a,b){z.g(a,"function",$g,"parseEnum:ctor");z.Ba(b,a,$g,"parseEnum:defval");return function(c){c=Ja(a,c);return null===c?b:c}};var ka;
  $g.toString=ka=function(a){var b=a;z.Za(a)&&(a.text?b=a.text:a.name?b=a.name:void 0!==a.key?b=a.key:void 0!==a.id?b=a.id:a.constructor===Object&&(a.Text?b=a.Text:a.Name?b=a.Name:void 0!==a.Key?b=a.Key:void 0!==a.Id?b=a.Id:void 0!==a.ID&&(b=a.ID)));return void 0===b?"undefined":null===b?"null":b.toString()};$g.prototype.toString=function(){return"Binding("+this.yu+":"+this.NF+(-1!==this.Wl?" "+this.Wl:"")+" "+this.mode.name+")"};$g.prototype.freeze=function(){this.G=!0;return this};
  $g.prototype.Wa=function(){this.G=!1;return this};z.defineProperty($g,{Wl:null},function(){return this.fD},function(a){this.G&&z.oa(this);z.g(a,"number",$g,"targetId");this.fD=a});z.defineProperty($g,{yu:"targetProperty"},function(){return this.Wo},function(a){this.G&&z.oa(this);z.g(a,"string",$g,"targetProperty");this.Wo=a});z.defineProperty($g,{xn:"sourceName"},function(){return this.qw},function(a){this.G&&z.oa(this);null!==a&&z.g(a,"string",$g,"sourceName");this.qw=a;null!==a&&(this.qr=!1)});
  z.defineProperty($g,{St:"isToModel"},function(){return this.qr},function(a){this.G&&z.oa(this);z.g(a,"boolean",$g,"isToModel");this.qr=a});z.defineProperty($g,{NF:"sourceProperty"},function(){return this.Mo},function(a){this.G&&z.oa(this);z.g(a,"string",$g,"sourceProperty");this.Mo=a});z.defineProperty($g,{gH:"converter"},function(){return this.Bq},function(a){this.G&&z.oa(this);null!==a&&z.g(a,"function",$g,"converter");this.Bq=a});
  z.defineProperty($g,{WG:"backConverter"},function(){return this.uq},function(a){this.G&&z.oa(this);null!==a&&z.g(a,"function",$g,"backConverter");this.uq=a});z.defineProperty($g,{mode:"mode"},function(){return this.Nr},function(a){this.G&&z.oa(this);z.Ba(a,$g,$g,"mode");this.Nr=a});$g.prototype.makeTwoWay=$g.prototype.xI=function(a){void 0===a&&(a=null);null!==a&&z.g(a,"function",$g,"makeTwoWay");this.mode=bh;this.WG=a;return this};
  $g.prototype.ofObject=$g.prototype.wx=function(a){void 0===a&&(a="");u&&z.g(a,"string",$g,"ofObject:srcname");this.xn=a;this.St=!1;return this};$g.prototype.ofModel=function(){this.xn=null;this.St=!0;return this};$g.prototype.ofData=function(){this.xn=null;this.St=!1;return this};function ch(a,b,c){a=a.xn;var d=null;return d=null===a||""===a?b:"."===a?c:".."===a?c.T:b.oe(a)}
  $g.prototype.updateTarget=$g.prototype.eG=function(a,b,c){var d=this.Mo;if(void 0===c||""===d||d===c){c=this.Wo;var e=this.Bq;if(null===e&&""===c)z.trace("Binding error: target property is the empty string: "+this.toString());else{u&&"string"===typeof c&&("function"!==typeof a.setAttribute&&0<c.length&&"_"!==c[0]&&!z.hx(a,c)?z.trace("Binding error: undefined target property: "+c+" on "+a.toString()):"name"===c&&a instanceof O&&z.trace("Binding error: cannot modify GraphObject.name on "+a.toString()));
  var g=b;""!==d&&(g=z.tb(b,d));if(void 0!==g)if(null===e)""!==c&&z.Sa(a,c,g);else try{if(""!==c){var h=e(g,a);u&&void 0===h&&z.trace('Binding warning: conversion function returned undefined when setting target property "'+c+'" on '+a.toString()+", function is: "+e);z.Sa(a,c,h)}else e(g,a)}catch(k){u&&z.trace("Binding error: "+k.toString()+' setting target property "'+c+'" on '+a.toString()+" with conversion function: "+e)}}}};
  $g.prototype.updateSource=$g.prototype.Tx=function(a,b,c,d){void 0===d&&(d=null);if(this.Nr===bh){var e=this.Wo;if(void 0===c||e===c){c=this.Mo;var g=this.uq;if(null!==g||""!==c){var h=a;""!==e&&(h=z.tb(a,e));if(void 0!==h)if(a=null!==d?d.ha:null,null===g)null!==a?(u&&a.rj===c&&a.le(b)&&z.trace("Binding error: cannot have TwoWay Binding on node data key property: "+this.toString()),a.setDataProperty(b,c,h)):z.Sa(b,c,h);else try{if(""!==c){var k=g(h,b,a);null!==a?(u&&(a.rj===c&&a.le(b)&&z.trace("Binding error: cannot have TwoWay Binding on node data key property: "+
  this.toString()),void 0===k&&z.trace('Binding warning: conversion function returned undefined when setting source property "'+c+'" on '+b.toString()+", function is: "+g)),a.setDataProperty(b,c,k)):z.Sa(b,c,k)}else g(h,b,a)}catch(l){u&&z.trace("Binding error: "+l.toString()+' setting source property "'+c+'" on '+b.toString()+" with conversion function: "+g)}}}}};function rg(){this.lG=(new J(Tf)).freeze();this.Ub="";this.mC=!1}z.ia("Transaction",rg);
  rg.prototype.toString=function(a){var b="Transaction: "+this.name+" "+this.Zf.count.toString()+(this.Nt?"":", incomplete");if(void 0!==a&&0<a){a=this.Zf.count;for(var c=0;c<a;c++){var d=this.Zf.ea(c);null!==d&&(b+="\n  "+d.toString())}}return b};rg.prototype.clear=rg.prototype.clear=function(){var a=this.Zf;a.Wa();for(var b=a.count-1;0<=b;b--){var c=a.ea(b);null!==c&&c.clear()}a.clear();a.freeze()};rg.prototype.canUndo=rg.prototype.canUndo=function(){return this.Nt};
  rg.prototype.undo=rg.prototype.undo=function(){if(this.canUndo())for(var a=this.Zf.count-1;0<=a;a--){var b=this.Zf.ea(a);null!==b&&b.undo()}};rg.prototype.canRedo=rg.prototype.canRedo=function(){return this.Nt};rg.prototype.redo=rg.prototype.redo=function(){if(this.canRedo())for(var a=this.Zf.count,b=0;b<a;b++){var c=this.Zf.ea(b);null!==c&&c.redo()}};z.w(rg,{Zf:"changes"},function(){return this.lG});z.defineProperty(rg,{name:"name"},function(){return this.Ub},function(a){this.Ub=a});
  z.defineProperty(rg,{Nt:"isComplete"},function(){return this.mC},function(a){this.mC=a});function Yf(){this.dz=new K(M);this.af=!1;this.pG=(new J(rg)).freeze();this.dh=-1;this.BC=999;this.Ii=!1;this.fv=null;this.ql=0;this.qy=!1;u&&(this.qy=!0);this.jh=(new J("string")).freeze();this.Co=new J("number");this.My=!0;this.Yy=!1}z.ia("UndoManager",Yf);
  Yf.prototype.toString=function(a){for(var b="UndoManager "+this.jj+"<"+this.history.count+"<="+this.ZE,b=b+"[",c=this.dF.count,d=0;d<c;d++)0<d&&(b+=" "),b+=this.dF.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};
  Yf.prototype.clear=Yf.prototype.clear=function(){var a=this.history;a.Wa();for(var b=a.count-1;0<=b;b--){var c=a.ea(b);null!==c&&c.clear()}a.clear();this.dh=-1;a.freeze();this.Ii=!1;this.fv=null;this.ql=0;this.jh.Wa();this.jh.clear();this.jh.freeze();this.Co.clear()};Yf.prototype.addModel=Yf.prototype.OG=function(a){this.dz.add(a)};Yf.prototype.removeModel=Yf.prototype.XI=function(a){this.dz.remove(a)};
  Yf.prototype.startTransaction=Yf.prototype.Wb=function(a){void 0===a&&(a="");null===a&&(a="");if(this.qb)return!1;!0===this.My&&(this.My=!1,this.ql++,this.kd("StartingFirstTransaction",a,this.ej),0<this.ql&&this.ql--);this.isEnabled&&(this.jh.Wa(),this.jh.add(a),this.jh.freeze(),null===this.ej?this.Co.add(0):this.Co.add(this.ej.Zf.count));this.ql++;var b=1===this.Ih;b&&this.kd("StartedTransaction",a,this.ej);return b};
  Yf.prototype.commitTransaction=Yf.prototype.Kd=function(a){void 0===a&&(a="");return dh(this,!0,a)};Yf.prototype.rollbackTransaction=Yf.prototype.Vp=function(){return dh(this,!1,"")};
  function dh(a,b,c){if(a.qb)return!1;a.Gz&&1>a.Ih&&z.trace("Ending transaction without having started a transaction: "+c);var d=1===a.Ih;d&&b&&a.isEnabled&&a.kd("CommittingTransaction",c,a.ej);var e=0;if(0<a.Ih&&(a.ql--,a.isEnabled)){var g=a.jh.count;0<g&&(""===c&&(c=a.jh.ea(0)),a.jh.Wa(),a.jh.dd(g-1),a.jh.freeze());g=a.Co.count;0<g&&(e=a.Co.ea(g-1),a.Co.dd(g-1))}g=a.ej;if(d){if(b){a.Yy=!1;if(a.isEnabled&&null!==g){b=g;b.Nt=!0;b.name=c;d=a.history;d.Wa();for(e=d.count-1;e>a.jj;e--)g=d.ea(e),null!==
  g&&g.clear(),d.dd(e),a.Yy=!0;e=a.ZE;0===e&&(e=1);0<e&&d.count>=e&&(g=d.ea(0),null!==g&&g.clear(),d.dd(0),a.dh--);d.add(b);a.dh++;d.freeze();g=b}a.kd("CommittedTransaction",c,g)}else{a.Ii=!0;try{a.isEnabled&&null!==g&&(g.Nt=!0,g.undo())}finally{a.kd("RolledBackTransaction",c,g),a.Ii=!1}null!==g&&g.clear()}a.fv=null;return!0}if(a.isEnabled&&!b&&null!==g){a=e;c=g.Zf;for(b=c.count-1;b>=a;b--)d=c.ea(b),null!==d&&d.undo(),c.Wa(),c.dd(b);c.freeze()}return!1}
  Yf.prototype.canUndo=Yf.prototype.canUndo=function(){if(!this.isEnabled||0<this.Ih||this.qb)return!1;var a=this.$F;return null!==a&&a.canUndo()?!0:!1};Yf.prototype.undo=Yf.prototype.undo=function(){if(this.canUndo()){var a=this.$F;try{this.kd("StartingUndo","Undo",a),this.Ii=!0,this.dh--,a.undo()}catch(b){z.trace("undo error: "+b.toString())}finally{this.Ii=!1,this.kd("FinishedUndo","Undo",a)}}};
  Yf.prototype.canRedo=Yf.prototype.canRedo=function(){if(!this.isEnabled||0<this.Ih||this.qb)return!1;var a=this.ZF;return null!==a&&a.canRedo()?!0:!1};Yf.prototype.redo=Yf.prototype.redo=function(){if(this.canRedo()){var a=this.ZF;try{this.kd("StartingRedo","Redo",a),this.Ii=!0,this.dh++,a.redo()}catch(b){z.trace("redo error: "+b.toString())}finally{this.Ii=!1,this.kd("FinishedRedo","Redo",a)}}};
  Yf.prototype.kd=function(a,b,c){void 0===c&&(c=null);var d=new Tf;d.Dc=Vf;d.propertyName=a;d.object=c;d.oldValue=b;for(a=this.GI;a.next();)b=a.value,d.ha=b,b.Lw(d)};Yf.prototype.handleChanged=Yf.prototype.CE=function(a){if(this.isEnabled&&!this.qb&&!this.skipsEvent(a)){var b=this.ej;null===b&&(this.fv=b=new rg);var c=a.copy(),b=b.Zf;b.Wa();b.add(c);b.freeze();this.Gz&&0>=this.Ih&&!this.My&&(a=a.h,null!==a&&!1===a.jn||z.trace("Change not within a transaction: "+c.toString()))}};
  Yf.prototype.skipsEvent=function(a){if(null===a||0>a.Dc.value)return!0;a=a.object;if(a instanceof O){if(a=a.layer,null!==a&&a.Nc)return!0}else if(a instanceof wg&&a.Nc)return!0;return!1};z.w(Yf,{GI:"models"},function(){return this.dz.i});z.defineProperty(Yf,{isEnabled:"isEnabled"},function(){return this.af},function(a){this.af=a});z.w(Yf,{$F:"transactionToUndo"},function(){return 0<=this.jj&&this.jj<=this.history.count-1?this.history.ea(this.jj):null});
  z.w(Yf,{ZF:"transactionToRedo"},function(){return this.jj<this.history.count-1?this.history.ea(this.jj+1):null});z.w(Yf,{qb:"isUndoingRedoing"},function(){return this.Ii});z.w(Yf,{history:"history"},function(){return this.pG});z.defineProperty(Yf,{ZE:"maxHistoryLength"},function(){return this.BC},function(a){this.BC=a});z.w(Yf,{jj:"historyIndex"},function(){return this.dh});z.w(Yf,{ej:"currentTransaction"},function(){return this.fv});z.w(Yf,{Ih:"transactionLevel"},function(){return this.ql});
  z.w(Yf,{PE:"isInTransaction"},function(){return 0<this.ql});z.defineProperty(Yf,{Gz:"checksTransactionLevel"},function(){return this.qy},function(a){this.qy=a});z.w(Yf,{dF:"nestedTransactionNames"},function(){return this.jh});function ra(){0<arguments.length&&z.pd(ra);z.kc(this);this.Z=null;this.AB=!1;this.TB=this.BB=!0;this.DB=this.EB=this.UB=this.FB=!1;this.il=this.ky=null;this.yD=1.05;this.RB=1;this.Zy=NaN;this.yC=null;this.zz=NaN;this.yz=Jd;this.Vi=null}z.ia("CommandHandler",ra);
  var eh=null,fh="";ra.prototype.toString=function(){return"CommandHandler"};z.w(ra,{h:"diagram"},function(){return this.Z});ra.prototype.Sc=function(a){u&&null!==a&&z.l(a,B,ra,"setDiagram");this.Z=a};
  ra.prototype.doKeyDown=function(){var a=this.h;if(null!==a){var b=a.R,c=z.sk?b.$t:b.control,d=b.shift,e=b.alt,g=b.key;!c||"C"!==g&&"Insert"!==g?c&&"X"===g||d&&"Del"===g?this.canCutSelection()&&this.cutSelection():c&&"V"===g||d&&"Insert"===g?this.canPasteSelection()&&this.pasteSelection():c&&"Y"===g||e&&d&&"Backspace"===g?this.canRedo()&&this.redo():c&&"Z"===g||e&&"Backspace"===g?this.canUndo()&&this.undo():"Del"===g||"Backspace"===g?this.canDeleteSelection()&&this.deleteSelection():c&&"A"===g?this.canSelectAll()&&
  this.selectAll():"Esc"===g?this.canStopCommand()&&this.stopCommand():"Up"===g?a.ze&&(c?a.scroll("pixel","up"):a.scroll("line","up")):"Down"===g?a.ze&&(c?a.scroll("pixel","down"):a.scroll("line","down")):"Left"===g?a.ye&&(c?a.scroll("pixel","left"):a.scroll("line","left")):"Right"===g?a.ye&&(c?a.scroll("pixel","right"):a.scroll("line","right")):"PageUp"===g?d&&a.ye?a.scroll("page","left"):a.ze&&a.scroll("page","up"):"PageDown"===g?d&&a.ye?a.scroll("page","right"):a.ze&&a.scroll("page","down"):"Home"===
  g?c&&a.ze?a.scroll("document","up"):!c&&a.ye&&a.scroll("document","left"):"End"===g?c&&a.ze?a.scroll("document","down"):!c&&a.ye&&a.scroll("document","right"):" "===g?this.canScrollToPart()&&this.scrollToPart():"Subtract"===g?this.canDecreaseZoom()&&this.decreaseZoom():"Add"===g?this.canIncreaseZoom()&&this.increaseZoom():c&&"0"===g?this.canResetZoom()&&this.resetZoom():d&&"Z"===g?this.canZoomToFit()&&this.zoomToFit():c&&!d&&"G"===g?this.canGroupSelection()&&this.groupSelection():c&&d&&"G"===g?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()}};ra.prototype.doKeyUp=function(){var a=this.h;null!==a&&(a.R.bubbles=!0)};ra.prototype.stopCommand=function(){var a=this.h;if(null!==a){var b=a.cb;b instanceof gh&&a.xf&&a.Nw();null!==b&&b.doCancel()}};ra.prototype.canStopCommand=function(){return!0};
  ra.prototype.selectAll=function(){var a=this.h;if(null!==a){a.ta();try{a.gc="wait";a.Ja("ChangingSelection");for(var b=a.oi;b.next();)b.value.jb=!0;for(var c=a.Mg;c.next();)c.value.jb=!0;for(var d=a.links;d.next();)d.value.jb=!0}finally{a.Ja("ChangedSelection"),a.gc=""}}};ra.prototype.canSelectAll=function(){var a=this.h;return null!==a&&a.xf};
  ra.prototype.deleteSelection=function(){var a=this.h;if(null!==a&&!a.Ja("SelectionDeleting",a.selection))try{a.gc="wait";a.Wb("Delete");a.Ja("ChangingSelection");for(var b=new K(D),c=a.selection.i;c.next();)hh(b,c.value,!0,this.pH?Infinity:0,this.gE,function(a){return a.canDelete()});a.JA(b,!0);a.Ja("SelectionDeleted",b)}finally{a.Ja("ChangedSelection"),a.Kd("Delete"),a.gc=""}};ra.prototype.canDeleteSelection=function(){var a=this.h;return null===a||a.ib||a.Ef||!a.Rm||0===a.selection.count?!1:!0};
  function hh(a,b,c,d,e,g){void 0===g&&(g=null);if(!(a.contains(b)||null!==g&&!g(b)||b instanceof da))if(a.add(b),b instanceof E){if(c&&b instanceof F)for(var h=b.Hc;h.next();)hh(a,h.value,c,d,e,g);if(e)for(h=b.ee;h.next();){var k=h.value;if(!a.contains(k)){var l=k.Y,m=k.da;null!==l&&a.contains(l)&&null!==m&&a.contains(m)?hh(a,k,c,d,e,g):null!==l&&null!==m||hh(a,k,c,d,e,g)}}if(1<d)for(b=b.sE();b.next();)hh(a,b.value,c,d-1,e,g)}else if(b instanceof G)for(h=b.Hf;h.next();)hh(a,h.value,c,d,e,g)}
  ra.prototype.gp=function(a,b,c){var d=new na(D,D);for(a=a.i;a.next();)ih(this,a.value,b,d,c);if(null!==b){c=b.ha;a=!1;null!==b.gb.me&&(a=b.gb.me.gj);for(var e=new K(G),g=new na(G,G),h=d.i;h.next();){var k=h.value;if(k instanceof G){var l=k;a||null!==l.Y&&null!==l.da||e.add(l)}else if(c instanceof qg&&k instanceof E&&null!==k.data){var l=c,m=k,k=h.key,n=k.Il();null!==n&&(n=d.na(n),null!==n?(l.Gh(m.data,l.pb(n.data)),l=b.$f(m.data),k=k.op(),null!==k&&null!==l&&g.add(k,l)):l.Gh(m.data,void 0))}}0<e.count&&
  b.JA(e,!1);if(0<g.count)for(c=g.i;c.next();)d.add(c.key,c.value)}if(null!==b&&(b=b.ha,c=b.QG,null!==c)){var p=new na;d.each(function(a){null!==a.key.data&&p.add(a.key.data,a.value.data)});c(p,b,this.h.ha)}for(b=d.i;b.next();)b.value.Mb();return d};
  function ih(a,b,c,d,e){if(null===b||e&&!b.canCopy())return null;if(d.contains(b))return d.na(b);var g=null,h=b.data;if(null!==h&&null!==c){var k=c.ha;b instanceof G?k instanceof V&&(h=k.Qw(h),z.Za(h)&&(k.gt(h),g=c.$f(h))):(h=k.copyNodeData(h),z.Za(h)&&(k.sl(h),g=c.vh(h)))}else jh(b),g=b.copy(),null!==g&&(null!==c?c.add(g):null!==h&&a.hH&&(k=a.h.ha,h=g instanceof G&&k instanceof V?k.Qw(h):k.copyNodeData(h),z.Za(h)&&(g.data=h)));if(!(g instanceof D))return null;g.jb=!1;g.yh=!1;d.add(b,g);if(b instanceof
  E){for(h=b.ee;h.next();){k=h.value;if(k.Y===b){var l=d.na(k);null!==l&&(l.Y=g)}k.da===b&&(l=d.na(k),null!==l&&(l.da=g))}if(b instanceof F&&g instanceof F)for(h=g,b=b.Hc;b.next();)k=ih(a,b.value,c,d,e),k instanceof G||null===k||(k.Qa=h)}else if(b instanceof G)for(h=b.Y,null!==h&&(h=d.na(h),null!==h&&(g.Y=h)),h=b.da,null!==h&&(h=d.na(h),null!==h&&(g.da=h)),b=b.Hf;b.next();)h=ih(a,b.value,c,d,e),null!==h&&(h.od=g);return g}
  ra.prototype.copySelection=function(){var a=this.h;if(null!==a){for(var b=new K(D),a=a.selection.i;a.next();)hh(b,a.value,!0,this.kH?Infinity:0,this.iH,function(a){return a.canCopy()});this.copyToClipboard(b)}};ra.prototype.canCopySelection=function(){var a=this.h;return null!==a&&a.lk&&a.Cz&&0!==a.selection.count?!0:!1};ra.prototype.cutSelection=function(){this.copySelection();this.deleteSelection()};
  ra.prototype.canCutSelection=function(){var a=this.h;return null!==a&&!a.ib&&!a.Ef&&a.lk&&a.Rm&&a.Cz&&0!==a.selection.count?!0:!1};ra.prototype.copyToClipboard=function(a){var b=this.h;if(null!==b){var c=null;if(null===a)eh=null,fh="";else{var c=b.ha,d=!1,e=!1,g=null;try{if(c instanceof qg){var h=c,d=h.Zm;h.Zm=this.YD}c instanceof V&&(h=c,e=h.Ym,h.Ym=this.XD);g=b.gp(a,null,!0)}finally{c instanceof qg&&(c.Zm=d),c instanceof V&&(c.Ym=e),c=new J(D),c.$c(g),eh=c,fh=b.ha.Bl}}b.Ja("ClipboardChanged",c)}};
  ra.prototype.pasteFromClipboard=function(){var a=new K(D),b=eh;if(null===b)return a;var c=this.h;if(null===c||fh!==c.ha.Bl)return a;var d=c.ha,e=!1,g=!1,h=null;try{if(d instanceof qg){var k=d,e=k.Zm;k.Zm=this.YD}d instanceof V&&(k=d,g=k.Ym,k.Ym=this.XD);h=c.gp(b,c,!1)}finally{for(d instanceof qg&&(d.Zm=e),d instanceof V&&(d.Ym=g),b=h.i;b.next();)c=b.value,d=b.key,c.location.F()||(d.location.F()?c.location=d.location:!c.position.F()&&d.position.F()&&(c.position=d.position)),a.add(c)}return a};
  ra.prototype.pasteSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b)try{b.gc="wait";b.Wb("Paste");b.Ja("ChangingSelection");var c=this.pasteFromClipboard();0<c.count&&kh(b);for(var d=c.i;d.next();)d.value.jb=!0;b.Ja("ChangedSelection");if(null!==a){var e=b.computePartsBounds(b.selection);if(e){var g=b.gb.me;null===g&&(g=new lh,g.Sc(b));var h=g.computeEffectiveCollection(b.selection);g.moveParts(h,new N(a.x-e.ra,a.y-e.za),!1)}}b.Ja("ClipboardPasted",c)}finally{b.Kd("Paste"),b.gc=
  ""}};ra.prototype.canPasteSelection=function(){var a=this.h;return null===a||a.ib||a.Ef||!a.$o||!a.Cz||null===eh||fh!==a.ha.Bl?!1:!0};ra.prototype.undo=function(){var a=this.h;null!==a&&a.pa.undo()};ra.prototype.canUndo=function(){var a=this.h;return null===a||a.ib||a.Ef?!1:a.GD&&a.pa.canUndo()};ra.prototype.redo=function(){var a=this.h;null!==a&&a.pa.redo()};ra.prototype.canRedo=function(){var a=this.h;return null===a||a.ib||a.Ef?!1:a.GD&&a.pa.canRedo()};
  ra.prototype.decreaseZoom=function(a){void 0===a&&(a=1/this.Vx);z.p(a,ra,"decreaseZoom:factor");var b=this.h;null!==b&&b.xl===mh&&(a*=b.scale,a<b.Ah||a>b.zh||(b.scale=a))};ra.prototype.canDecreaseZoom=function(a){void 0===a&&(a=1/this.Vx);z.p(a,ra,"canDecreaseZoom:factor");var b=this.h;if(null===b||b.xl!==mh)return!1;a*=b.scale;return a<b.Ah||a>b.zh?!1:b.Kw};
  ra.prototype.increaseZoom=function(a){void 0===a&&(a=this.Vx);z.p(a,ra,"increaseZoom:factor");var b=this.h;null!==b&&b.xl===mh&&(a*=b.scale,a<b.Ah||a>b.zh||(b.scale=a))};ra.prototype.canIncreaseZoom=function(a){void 0===a&&(a=this.Vx);z.p(a,ra,"canIncreaseZoom:factor");var b=this.h;if(null===b||b.xl!==mh)return!1;a*=b.scale;return a<b.Ah||a>b.zh?!1:b.Kw};ra.prototype.resetZoom=function(a){void 0===a&&(a=this.Tw);z.p(a,ra,"resetZoom:newscale");var b=this.h;null===b||a<b.Ah||a>b.zh||(b.scale=a)};
  ra.prototype.canResetZoom=function(a){void 0===a&&(a=this.Tw);z.p(a,ra,"canResetZoom:newscale");var b=this.h;return null===b||a<b.Ah||a>b.zh?!1:b.Kw};ra.prototype.zoomToFit=function(){var a=this.h;if(null!==a){var b=a.scale,c=a.position;b===this.zz&&!isNaN(this.Zy)&&a.ad.N(this.yz)?(a.scale=this.Zy,a.position=this.yC,this.zz=NaN,this.yz=Jd):(this.Zy=b,this.yC=c.copy(),a.zoomToFit(),this.zz=a.scale,this.yz=a.ad.copy())}};ra.prototype.canZoomToFit=function(){var a=this.h;return null===a?!1:a.Kw};
  ra.prototype.scrollToPart=function(a){void 0===a&&(a=null);null!==a&&z.l(a,D,ra,"part");var b=this.h;if(null!==b){if(null===a){try{null!==this.Vi&&(this.Vi.next()?a=this.Vi.value:this.Vi=null)}catch(c){this.Vi=null}null===a&&(0<b.gn.count?this.Vi=b.gn.i:0<b.selection.count&&(this.Vi=b.selection.i),null!==this.Vi&&this.Vi.next()&&(a=this.Vi.value))}if(null!==a){var d=b.Va;d.rn("Scroll To Part");var e=b.position.copy();b.XG(a.W);e.Mc(b.position)&&d.pi()}}};
  ra.prototype.canScrollToPart=function(a){void 0===a&&(a=null);null!==a&&z.l(a,D,ra,"part");a=this.h;return null===a||0===a.selection.count&&0===a.gn.count?!1:a.ye&&a.ze};ra.prototype.collapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b)try{b.Wb("Collapse Tree");b.Va.rn("Collapse Tree");var c=new J(E);if(null!==a&&a.wd)a.collapseTree(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof E&&(a=e,a.wd&&(a.collapseTree(),c.add(a)))}b.Ja("TreeCollapsed",c)}finally{b.Kd("Collapse Tree")}};
  ra.prototype.canCollapseTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.ib)return!1;if(null!==a){if(!a.wd)return!1;if(0<a.bx().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof E&&b.wd&&0<b.bx().count)return!0;return!1};
  ra.prototype.expandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b)try{b.Wb("Expand Tree");b.Va.rn("Expand Tree");var c=new J(E);if(null===a||a.wd)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof E&&(a=e,a.wd||(a.expandTree(),c.add(a)))}else a.expandTree(),c.add(a);b.Ja("TreeExpanded",c)}finally{b.Kd("Expand Tree")}};
  ra.prototype.canExpandTree=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.ib)return!1;if(null!==a){if(a.wd)return!1;if(0<a.bx().count)return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof E&&!b.wd&&0<b.bx().count)return!0;return!1};
  ra.prototype.groupSelection=function(){var a=this.h;if(null!==a){var b=a.ha;if(b instanceof V){var c=this.HD;if(null!==c){var d=null;try{a.gc="wait";a.Wb("Group");a.Ja("ChangingSelection");for(var e=new J(D),g=a.selection.i;g.next();){var h=g.value;h.be()&&h.canGroup()&&e.add(h)}for(var k=new J(D),l=e.i;l.next();){for(var m=l.value,g=!1,n=e.i;n.next();)if(m.mi(n.value)){g=!0;break}g||k.add(m)}if(0<k.count){var p=k.first().Qa;if(null!==p)for(;null!==p;){for(var e=!1,q=k.i;q.next();)if(!q.value.mi(p)){e=
  !0;break}if(e)p=p.Qa;else break}if(c instanceof F)jh(c),d=c.copy(),null!==d&&a.add(d);else if(b.hA(c)){var r=b.copyNodeData(c);z.Za(r)&&(b.sl(r),d=a.ax(r))}if(null!==d){null!==p&&this.isValidMember(p,d)&&(d.Qa=p);for(var s=k.i;s.next();){var t=s.value;this.isValidMember(d,t)&&(t.Qa=d)}a.select(d)}}a.Ja("ChangedSelection");a.Ja("SelectionGrouped",d)}finally{a.Kd("Group"),a.gc=""}}}}};
  ra.prototype.canGroupSelection=function(){var a=this.h;if(null===a||a.ib||a.Ef||!a.$o||!a.Fw||!(a.ha instanceof V)||null===this.HD)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.be()&&b.canGroup())return!0}return!1};function nh(a){var b=z.rb();for(a=a.i;a.next();){var c=a.value;c instanceof G||b.push(c)}a=new K(D);for(var c=b.length,d=0;d<c;d++){for(var e=b[d],g=!0,h=0;h<c;h++)if(e.mi(b[h])){g=!1;break}g&&a.add(e)}z.xa(b);return a}
  ra.prototype.isValidMember=function(a,b){if(null===b||a===b||b instanceof G)return!1;if(null!==a){if(a===b||a.mi(b))return!1;var c=a.qA;if(null!==c&&!c(a,b)||null===a.data&&null!==b.data||null!==a.data&&null===b.data)return!1}c=this.qA;return null!==c?c(a,b):!0};
  ra.prototype.ungroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b){var c=b.ha;if(c instanceof V)try{b.gc="wait";b.Wb("Ungroup");b.Ja("ChangingSelection");var d=new J(F);if(null!==a)d.add(a);else for(var e=b.selection.i;e.next();){var g=e.value;g instanceof F&&(a=g,a.canUngroup()&&d.add(a))}if(0<d.count){b.Nw();for(var h=d.i;h.next();){var k=h.value;k.expandSubGraph();var l=k.Qa,m=null!==l&&null!==l.data?c.pb(l.data):void 0,n=new J(D);n.$c(k.Hc);for(var p=n.i;p.next();){var q=
  p.value;q.jb=!0;if(!(q instanceof G)){var r=q.data;null!==r?c.Nx(r,m):q.Qa=l}}b.remove(k)}}b.Ja("ChangedSelection");b.Ja("SelectionUngrouped",d,n)}finally{b.Kd("Ungroup"),b.gc=""}}};ra.prototype.canUngroupSelection=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.ib||b.Ef||!b.Rm||!b.Jw||!(b.ha instanceof V))return!1;if(null!==a){if(a.canUngroup())return!0}else for(a=b.selection.i;a.next();)if(b=a.value,b instanceof F&&b.canUngroup())return!0;return!1};
  ra.prototype.addTopLevelParts=function(a,b){for(var c=!0,d=nh(a).i;d.next();){var e=d.value;null!==e.Qa&&(!b||this.isValidMember(null,e)?e.Qa=null:c=!1)}return c};
  ra.prototype.collapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b)try{b.Wb("Collapse SubGraph");b.Va.rn("Collapse SubGraph");var c=new J(F);if(null!==a&&a.se)a.collapseSubGraph(),c.add(a);else for(var d=b.selection.i;d.next();){var e=d.value;e instanceof F&&(a=e,a.se&&(a.collapseSubGraph(),c.add(a)))}b.Ja("SubGraphCollapsed",c)}finally{b.Kd("Collapse SubGraph")}};
  ra.prototype.canCollapseSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.ib)return!1;if(null!==a)return a.se?!0:!1;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof F&&b.se)return!0;return!1};
  ra.prototype.expandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null!==b)try{b.Wb("Expand SubGraph");b.Va.rn("Expand SubGraph");var c=new J(F);if(null===a||a.se)for(var d=b.selection.i;d.next();){var e=d.value;e instanceof F&&(a=e,a.se||(a.expandSubGraph(),c.add(a)))}else a.expandSubGraph(),c.add(a);b.Ja("SubGraphExpanded",c)}finally{b.Kd("Expand SubGraph")}};
  ra.prototype.canExpandSubGraph=function(a){void 0===a&&(a=null);var b=this.h;if(null===b||b.ib)return!1;if(null!==a)return a.se?!1:!0;for(a=b.selection.i;a.next();)if(b=a.value,b instanceof F&&!b.se)return!0;return!1};
  ra.prototype.editTextBlock=function(a){void 0===a&&(a=null);null!==a&&z.l(a,qa,ra,"editTextBlock");var b=this.h;if(null!==b){var c=b.gb.XA;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.zt(function(a){return a instanceof qa&&a.Tz})}null!==a&&(b.cb=null,c.He=a,b.cb=c)}}};
  ra.prototype.canEditTextBlock=function(a){void 0===a&&(a=null);null!==a&&z.l(a,qa,ra,"canEditTextBlock");var b=this.h;if(null===b||b.ib||b.Ef||!b.Iw||null===b.gb.XA)return!1;if(null!==a){if(a=a.ca,null!==a&&a.canEdit())return!0}else for(b=b.selection.i;b.next();)if(a=b.value,a.canEdit()&&(a=a.zt(function(a){return a instanceof qa&&a.Tz}),null!==a))return!0;return!1};
  ra.prototype.showContextMenu=function(a){var b=this.h;if(null!==b){var c=b.gb.Jz;if(null!==c&&(void 0===a&&(a=0<b.selection.count?b.selection.first():b),a=c.findObjectWithContextMenu(a),null!==a)){var d=new Rf,e=null;a instanceof O?e=a.eb(ec):b.gI||(e=b.xb,e=new N(e.x+e.width/2,e.y+e.height/2));null!==e&&(d.h=b,d.ue=b.aB(e),d.ga=e,d.left=!1,d.right=!0,d.up=!0,b.R=d);b.cb=c;oh(c,!1,a)}}};
  ra.prototype.canShowContextMenu=function(a){var b=this.h;if(null===b)return!1;var c=b.gb.Jz;if(null===c)return!1;void 0===a&&(a=0<b.selection.count?b.selection.first():b);return null===c.findObjectWithContextMenu(a)?!1:!0};z.defineProperty(ra,{hH:"copiesClipboardData"},function(){return this.AB},function(a){z.g(a,"boolean",ra,"copiesClipboardData");this.AB=a});
  z.defineProperty(ra,{iH:"copiesConnectedLinks"},function(){return this.BB},function(a){z.g(a,"boolean",ra,"copiesConnectedLinks");this.BB=a});z.defineProperty(ra,{gE:"deletesConnectedLinks"},function(){return this.TB},function(a){z.g(a,"boolean",ra,"deletesConnectedLinks");this.TB=a});z.defineProperty(ra,{kH:"copiesTree"},function(){return this.FB},function(a){z.g(a,"boolean",ra,"copiesTree");this.FB=a});
  z.defineProperty(ra,{pH:"deletesTree"},function(){return this.UB},function(a){z.g(a,"boolean",ra,"deletesTree");this.UB=a});z.defineProperty(ra,{YD:"copiesParentKey"},function(){return this.EB},function(a){z.g(a,"boolean",ra,"copiesParentKey");this.EB=a});z.defineProperty(ra,{XD:"copiesGroupKey"},function(){return this.DB},function(a){z.g(a,"boolean",ra,"copiesGroupKey");this.DB=a});
  z.defineProperty(ra,{HD:"archetypeGroupData"},function(){return this.ky},function(a){null!==a&&z.l(a,Object,ra,"archetypeGroupData");var b=this.h;null!==b&&(b=b.ha,b instanceof V&&(a instanceof F||b.hA(a)||z.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: "+a)));this.ky=a});z.defineProperty(ra,{qA:"memberValidation"},function(){return this.il},function(a){null!==a&&z.g(a,"function",ra,"memberValidation");this.il=a});
  z.defineProperty(ra,{Tw:"defaultScale"},function(){return this.RB},function(a){z.p(a,ra,"defaultScale");0<a||z.k("defaultScale must be larger than zero, not: "+a);this.RB=a});z.defineProperty(ra,{Vx:"zoomFactor"},function(){return this.yD},function(a){z.p(a,ra,"zoomFactor");1<a||z.k("zoomFactor must be larger than 1.0, not: "+a);this.yD=a});function xg(){0<arguments.length&&z.pd(xg);z.kc(this);this.Z=null;this.Ub="";this.af=!0;this.kC=!1;this.uD=null;this.Bw=-1}z.ia("Tool",xg);
  xg.prototype.Sc=function(a){u&&null!==a&&z.l(a,B,xg,"setDiagram");this.Z=a};xg.prototype.toString=function(){return""!==this.name?this.name+" Tool":z.kf(Object.getPrototypeOf(this))};xg.prototype.updateAdornments=function(){};xg.prototype.canStart=function(){return this.isEnabled};xg.prototype.doStart=function(){};xg.prototype.doActivate=function(){this.ua=!0};xg.prototype.doDeactivate=function(){this.ua=!1};xg.prototype.doStop=function(){};xg.prototype.doCancel=function(){this.stopTool()};
  xg.prototype.stopTool=function(){var a=this.h;null!==a&&a.cb===this&&(a.cb=null,a.gc="")};xg.prototype.doMouseDown=function(){!this.ua&&this.canStart()&&this.doActivate()};xg.prototype.doMouseMove=function(){};xg.prototype.doMouseUp=function(){this.stopTool()};xg.prototype.doMouseWheel=function(){};xg.prototype.canStartMultiTouch=function(){return!0};
  xg.prototype.standardPinchZoomStart=function(){var a=this.h;if(null!==a){var b=a.R.event,c=null,d=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;c=b.targetTouches[0];d=b.targetTouches[1]}else if(null!==a.Uf[0])c=a.Uf[0],d=a.Uf[1];else return;this.doCancel();if(a.rp("hasGestureZoom")){a.Ny=!0;a.KC=a.scale;var e=ph(a),g=c,h=g.clientX-e.x,c=g.clientY-e.y,g=d,d=g.clientX-e.x,g=g.clientY-e.y;z.A(e);e=d-h;c=g-c;a.cD=Math.sqrt(e*e+c*c);b.preventDefault();b.cancelBubble=!0}}};
  xg.prototype.standardPinchZoomMove=function(){var a=this.h;if(null!==a){var b=a.R.event;this.doCancel();var c=null,d=null;if(void 0!==b.targetTouches){if(2>b.targetTouches.length)return;c=b.targetTouches[0];d=b.targetTouches[1]}else if(null!==a.Uf[0])c=a.Uf[0],d=a.Uf[1];else return;if(a.rp("hasGestureZoom")&&a.Ny){var e=ph(a),g=c,c=g.clientX-e.x,h=g.clientY-e.y,g=d,d=g.clientX-e.x,g=g.clientY-e.y;z.A(e);var e=d-c,k=g-h,e=Math.sqrt(e*e+k*k)/a.cD,c=new N((Math.min(d,c)+Math.max(d,c))/2,(Math.min(g,
  h)+Math.max(g,h))/2),h=a.KC*e,d=a.wb;h!==a.scale&&d.canResetZoom(h)&&(e=a.$l,a.$l=c,d.resetZoom(h),a.$l=e);b.preventDefault();b.cancelBubble=!0}}};xg.prototype.doKeyDown=function(){var a=this.h;null!==a&&"Esc"===a.R.key&&this.doCancel()};xg.prototype.doKeyUp=function(){};xg.prototype.startTransaction=xg.prototype.Wb=function(a){void 0===a&&(a=this.name);this.Mf=null;var b=this.h;return null===b?!1:b.Wb(a)};
  xg.prototype.stopTransaction=xg.prototype.yk=function(){var a=this.h;return null===a?!1:null===this.Mf?a.Vp():a.Kd(this.Mf)};
  xg.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.xf){var b=a.R,c=a.Bt(b.ga,!1);if(null!==c)if(z.sk?b.$t:b.control){a.Ja("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Qa;null!==b&&(b.jb=!b.jb);a.Ja("ChangedSelection")}else if(b.shift){if(!c.jb){a.Ja("ChangingSelection");for(b=c;null!==b&&!b.canSelect();)b=b.Qa;null!==b&&(b.jb=!0);a.Ja("ChangedSelection")}}else{if(!c.jb){for(b=c;null!==b&&!b.canSelect();)b=b.Qa;null!==b&&a.select(b)}}else!b.left||(z.sk?b.$t:b.control)||
  b.shift||a.Nw()}};xg.prototype.standardMouseClick=function(a,b){void 0===a&&(a=null);void 0===b&&(b=function(a){return!a.layer.Nc});var c=this.h;if(null===c)return!1;var d=c.R,e=c.pe(d.ga,a,b);d.Ge=e;zh(e,d,c);return d.Gc};
  function zh(a,b,c){b.Gc=!1;var d=0;b.left?d=1===b.Pe?1:2===b.Pe?2:1:b.right&&1===b.Pe&&(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.Ja(e,a)}else{switch(d){case 1:e="BackgroundSingleClicked";break;case 2:e="BackgroundDoubleClicked";break;case 3:e="BackgroundContextClicked"}0!==d&&c.Ja(e)}if(null!==a)for(;null!==a;){c=null;switch(d){case 1:c=a.click;break;case 2:c=a.wt?a.wt:a.click;break;case 3:c=
  a.Iz}if(null!==c&&(c(b,a),b.Gc))break;a=a.T}else{a=null;switch(d){case 1:a=c.click;break;case 2:a=c.wt?c.wt:c.click;break;case 3:a=c.Iz}null!==a&&a(b)}}
  xg.prototype.standardMouseOver=function(){var a=this.h;if(null!==a){var b=a.R;if(null!==b.h&&!0!==a.Va.wc){var c=a.Bb;a.Bb=!0;var d=a.pe(b.ga,null,null);b.Ge=d;var e=!1;if(d!==a.Rn){var g=a.Rn,h=g;a.Rn=d;this.doCurrentObjectChanged(g,d);for(b.Gc=!1;null!==g;){var k=g.bu;if(null!==k){if(d===g)break;if(null!==d&&d.Pl(g))break;k(b,g,d);e=!0;if(b.Gc)break}g=g.T}g=h;for(b.Gc=!1;null!==d;){k=d.au;if(null!==k){if(g===d)break;if(null!==g&&g.Pl(d))break;k(b,d,g);e=!0;if(b.Gc)break}d=d.T}d=a.Rn}if(null!==d){g=
  d;for(k="";null!==g;){k=g.cursor;if(""!==k)break;g=g.T}a.gc=k;b.Gc=!1;for(g=d;null!==g;){k=g.uA;if(null!==k&&(k(b,g),e=!0,b.Gc))break;g=g.T}}else a.gc="",k=a.uA,null!==k&&(k(b),e=!0);e&&a.Ce();a.Bb=c}}};xg.prototype.doCurrentObjectChanged=function(){};
  xg.prototype.standardMouseWheel=function(){var a=this.h;if(null!==a){var b=a.R,c=b.Dl;if(0!==c&&a.ad.F()){var d=a.wb,e=a.gb.cu;if((e===Hh&&!b.shift||e===Ih&&b.control)&&(0<c?d.canIncreaseZoom():d.canDecreaseZoom()))e=a.$l,a.$l=b.ue,0<c?d.increaseZoom():d.decreaseZoom(),a.$l=e,b.bubbles=!1;else if(e===Hh&&b.shift||e===Ih&&!b.control){var d=a.position.copy(),e=0<c?c:-c,g=b.event.deltaX,h=b.event.deltaY;void 0===g||void 0===h||0===g&&0===h||b.shift?!b.shift&&a.ze?(g=a.ou,e=e/40*g,0<c?a.scroll("pixel",
  "up",e):a.scroll("pixel","down",e)):b.shift&&a.ye&&(g=a.nu,e=e/40*g,0<c?a.scroll("pixel","left",e):a.scroll("pixel","right",e)):(0!==g&&a.ye&&(0<g?a.scroll("pixel","left",-g):a.scroll("pixel","right",g)),0!==h&&a.ze&&(0<h?a.scroll("pixel","up",-h):a.scroll("pixel","down",h)));a.position.N(d)||(b.bubbles=!1)}}}};xg.prototype.standardWaitAfter=function(a,b){z.g(a,"number",xg,"standardWaitAfter:delay");this.cancelWaitAfter();var c=this,d=b.copy();this.Bw=z.setTimeout(function(){c.doWaitAfter(d)},a)};
  xg.prototype.cancelWaitAfter=function(){-1!==this.Bw&&z.clearTimeout(this.Bw);this.Bw=-1};xg.prototype.doWaitAfter=function(){};xg.prototype.findToolHandleAt=function(a,b){var c=this.h;if(null===c)return null;c=c.pe(a,function(a){for(;null!==a&&!(a.T instanceof da);)a=a.T;return a});return null===c?null:c.T.nc===b?c:null};
  xg.prototype.isBeyondDragSize=function(a,b){var c=this.h;if(null===c)return!1;void 0===a&&(a=c.Fc.ue);void 0===b&&(b=c.R.ue);var d=c.gb.tH,e=d.width,d=d.height;c.Fc.mj&&(e+=6,d+=6);return Math.abs(b.x-a.x)>e||Math.abs(b.y-a.y)>d};z.w(xg,{h:"diagram"},function(){return this.Z});z.defineProperty(xg,{name:"name"},function(){return this.Ub},function(a){z.g(a,"string",xg,"name");this.Ub=a});
  z.defineProperty(xg,{isEnabled:"isEnabled"},function(){return this.af},function(a){z.g(a,"boolean",xg,"isEnabled");this.af=a});z.defineProperty(xg,{ua:"isActive"},function(){return this.kC},function(a){z.g(a,"boolean",xg,"isActive");this.kC=a});z.defineProperty(xg,{Mf:"transactionResult"},function(){return this.uD},function(a){null!==a&&z.g(a,"string",xg,"transactionResult");this.uD=a});
  function lh(){0<arguments.length&&z.pd(lh);xg.call(this);this.name="Dragging";this.CB=this.oC=!0;this.jr=this.$B=!1;this.tC=!0;this.Oy=(new Ea(NaN,NaN)).freeze();this.Py=Zb;this.Qy=(new N(NaN,NaN)).freeze();this.ZB=!1;this.XB=this.zB=this.YB=this.KB=this.Ti=null;this.Uq=this.rC=!1;this.Po=new N(NaN,NaN);this.rw=new N;this.uw=!1;this.nC=!0;this.$n=100;this.Cj=[];this.oG=(new K(D)).freeze()}z.Ra(lh,xg);z.ia("DraggingTool",lh);
  z.defineProperty(lh,{KE:"isCopyEnabled"},function(){return this.oC},function(a){z.g(a,"boolean",lh,"isCopyEnabled");this.oC=a});z.defineProperty(lh,{jH:"copiesEffectiveCollection"},function(){return this.CB},function(a){z.g(a,"boolean",lh,"copiesEffectiveCollection");this.CB=a});z.defineProperty(lh,{uH:"dragsTree"},function(){return this.$B},function(a){z.g(a,"boolean",lh,"dragsTree");this.$B=a});
  z.defineProperty(lh,{kx:"isGridSnapEnabled"},function(){return this.jr},function(a){z.g(a,"boolean",lh,"isGridSnapEnabled");this.jr=a});z.defineProperty(lh,{cI:"isComplexRoutingRealtime"},function(){return this.nC},function(a){z.g(a,"boolean",lh,"isComplexRoutingRealtime");this.nC=a});z.defineProperty(lh,{eI:"isGridSnapRealtime"},function(){return this.tC},function(a){z.g(a,"boolean",lh,"isGridSnapRealtime");this.tC=a});
  z.defineProperty(lh,{AE:"gridSnapCellSize"},function(){return this.Oy},function(a){z.l(a,Ea,lh,"gridSnapCellSize");this.Oy.N(a)||(this.Oy=a=a.V())});z.defineProperty(lh,{PH:"gridSnapCellSpot"},function(){return this.Py},function(a){z.l(a,Q,lh,"gridSnapCellSpot");this.Py.N(a)||(this.Py=a=a.V())});z.defineProperty(lh,{QH:"gridSnapOrigin"},function(){return this.Qy},function(a){z.l(a,N,lh,"gridSnapOrigin");this.Qy.N(a)||(this.Qy=a=a.V())});
  z.defineProperty(lh,{gj:"dragsLink"},function(){return this.ZB},function(a){z.g(a,"boolean",lh,"dragsLink");this.ZB=a});z.defineProperty(lh,{an:"currentPart"},function(){return this.KB},function(a){null!==a&&z.l(a,D,lh,"currentPart");this.KB=a});z.defineProperty(lh,{oc:"copiedParts"},function(){return this.zB},function(a){this.zB=a});z.defineProperty(lh,{hc:"draggedParts"},function(){return this.YB},function(a){this.YB=a});
  z.w(lh,{uK:"draggingParts"},function(){return null!==this.oc?this.oc.vj():null!==this.hc?this.hc.vj():this.oG});z.defineProperty(lh,{ld:"draggedLink"},function(){return this.XB},function(a){null!==a&&z.l(a,G,lh,"draggedLink");this.XB=a});z.defineProperty(lh,{jx:"isDragOutStarted"},function(){return this.rC},function(a){this.rC=a});z.defineProperty(lh,{xk:"startPoint"},function(){return this.rw},function(a){z.l(a,N,lh,"startPoint");this.rw.N(a)||(this.rw=a=a.V())});
  z.defineProperty(lh,{bE:"delay"},function(){return this.$n},function(a){z.g(a,"number",lh,"delay");this.$n=a});lh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.ib&&!a.kt||!a.vl&&!a.lk&&!a.kt||!a.xf)return!1;var b=a.R;return!b.left||a.cb!==this&&(!this.isBeyondDragSize()||b.mj&&b.timestamp-a.Fc.timestamp<this.$n)?!1:null!==this.findDraggablePart()};
  lh.prototype.findDraggablePart=function(){var a=this.h;if(null===a)return null;a=a.Bt(a.Fc.ga,!1);if(null===a)return null;for(;null!==a&&!a.canSelect();)a=a.Qa;return null!==a&&(a.canMove()||a.canCopy())?a:null};lh.prototype.standardMouseSelect=function(){var a=this.h;if(null!==a&&a.xf){var b=a.Bt(a.Fc.ga,!1);if(null!==b){for(;null!==b&&!b.canSelect();)b=b.Qa;this.an=b;this.an.jb||(a.Ja("ChangingSelection"),b=a.R,(z.sk?b.$t:b.control)||b.shift||kh(a),this.an.jb=!0,a.Ja("ChangedSelection"))}}};
  lh.prototype.doActivate=function(){var a=this.h;if(null!==a){null===this.an&&this.standardMouseSelect();var b=this.an;null!==b&&(b.canMove()||b.canCopy())&&(this.ua=!0,this.Po.set(a.position),Jh(this,a.selection),this.Cj.length=0,this.hc=this.computeEffectiveCollection(a.selection),a.vu=!0,Kh(this,this.hc),this.Wb("Drag"),this.xk=a.Fc.ga,a.We=!0,a.kt&&(this.jx=!0,this.Uq=!1,Lh=this,Mh=this.h,this.doSimulatedDragOut()))}};
  function Jh(a,b){if(a.gj){var c=a.h;null!==c&&c.Sm&&(c.ha instanceof V&&1===b.count&&b.first()instanceof G?(a.ld=b.first(),a.ld.canRelinkFrom()&&a.ld.canRelinkTo()&&a.ld.pt(),a.Ti=c.gb.jF,null===a.Ti&&(a.Ti=new Nh,a.Ti.Sc(c))):(a.ld=null,a.Ti=null))}}
  lh.prototype.computeEffectiveCollection=function(a){var b=null!==this.h&&this.h.cb===this,c=new na(D);if(null===a)return c;for(var d=a.i;d.next();)Oh(this,c,d.value,b);if(null!==this.ld&&this.gj)return c;for(d=a.i;d.next();)a=d.value,a instanceof G&&(b=a.Y,null===b||c.contains(b)?(b=a.da,null===b||c.contains(b)||c.remove(a)):c.remove(a));return c};function Ph(a){return void 0===a?new Qh(Id):new Qh(a.copy())}
  function Oh(a,b,c,d){if(!b.contains(c)&&(!d||c.canMove()||c.canCopy()))if(c instanceof E){b.add(c,Ph(c.location));if(c instanceof F)for(var e=c.Hc;e.next();)Oh(a,b,e.value,d);for(e=c.ee;e.next();){var g=e.value;if(!b.contains(g)){var h=g.Y,k=g.da;null!==h&&b.contains(h)&&null!==k&&b.contains(k)&&Oh(a,b,g,d)}}if(a.uH)for(c=c.sE();c.next();)Oh(a,b,c.value,d)}else if(c instanceof G)for(g=c,b.add(g,Ph()),e=g.Hf;e.next();)Oh(a,b,e.value,d);else c instanceof da||b.add(c,Ph(c.location))}
  lh.prototype.doDeactivate=function(){this.ua=!1;var a=this.h;null!==a&&Rh(a);Sh(this);Th(this,this.hc);this.hc=this.an=null;this.Uq=this.jx=!1;if(0<Uh.count){for(var b=Uh.length,c=0;c<b;c++){var d=Uh.ea(c);Vh(d);Wh(d);Sh(d);null!==d.h&&Rh(d.h)}Uh.clear()}Vh(this);this.Po.n(NaN,NaN);Lh=Mh=null;Wh(this);a.We=!1;a.gc="";a.vu=!1;this.yk()};function Sh(a){var b=a.h;if(null!==b){var c=b.Bb;b.Bb=!0;Xh(a,b.R,null);b.Bb=c}a.Cj.length=0}
  function Yh(){var a=Lh;Wh(a);Zh(a);var b=a.h;null!==b&&a.Po.F()&&(b.position=a.Po);null!==b&&Rh(b)}lh.prototype.doCancel=function(){Wh(this);Zh(this);var a=this.h;null!==a&&this.Po.F()&&(a.position=this.Po);this.stopTool()};function Kh(a,b){if(null!==b){a.uw=!0;for(var c=b.i;c.next();){var d=c.key;d instanceof G&&(d.eq=!0)}}}function Th(a,b){if(null!==b){for(var c=b.i;c.next();){var d=c.key;d instanceof G&&(d.eq=!1,d.kj&&$h(d)&&d.qc())}a.uw=!1}}
  lh.prototype.doKeyDown=function(){var a=this.h;null!==a&&(a=a.R,null!==a&&this.ua&&("Esc"===a.key?this.doCancel():this.doMouseMove()))};lh.prototype.doKeyUp=function(){var a=this.h;null!==a&&null!==a.R&&this.ua&&this.doMouseMove()};function ai(a,b){for(var c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=a.i;h.next();){var k=h.value;if(k.be()&&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>g&&(g=l))}}Infinity===c?b.n(0,0,0,0):b.n(c,d,e-c,g-d)}
  function bi(a,b){if(null===a.oc){var c=a.h;if(!(null===c||b&&(c.ib||c.Ef))&&null!==a.hc){var d=c.pa;d.isEnabled&&d.PE?null!==d.ej&&0<d.ej.Zf.count&&(c.pa.Vp(),c.Wb("Drag")):Zh(a);c.Bb=!b;c.lq=!b;a.xk=c.Fc.ga;d=a.jH?a.hc.vj():c.selection;d=c.gp(d,c,!0);for(c=d.i;c.next();)c.value.location=c.key.location;c=z.lg();ai(d,c);z.dc(c);for(var c=new na(D),e=a.hc.i;e.next();){var g=e.key;g.be()&&g.canCopy()&&(g=d.na(g),null!==g&&(g.Bf(),c.add(g,Ph(g.location))))}for(d=d.i;d.next();)e=d.value,e instanceof G&&
  e.canCopy()&&c.add(e,Ph());a.oc=c;Jh(a,c.vj());null!==a.ld&&(c=a.ld,d=c.tn,c.Rl(a.xk.x-(d.x+d.width/2),a.xk.y-(d.y+d.height/2)))}}}function Wh(a){var b=a.h;if(null!==b){if(null!==a.oc&&(b.JA(a.oc.vj(),!1),a.oc=null,null!==a.hc))for(var c=a.hc.i;c.next();)c.key instanceof G&&(c.value.point=new N(0,0));b.Bb=!1;b.lq=!1;a.xk=b.Fc.ga}}function Vh(a){if(null!==a.ld){if(a.gj&&null!==a.Ti){var b=a.Ti;b.h.remove(b.Od);b.h.remove(b.Pd)}a.ld=null;a.Ti=null}}
  function ci(a,b,c){var d=a.h;if(null!==d){var e=a.xk,g=z.O();g.assign(d.R.ga);a.moveParts(b,g.xu(e),c);z.A(g)}}
  lh.prototype.moveParts=function(a,b,c){if(null!==a&&(z.l(a,na,lh,"moveParts:parts"),0!==a.count)){var d=z.O(),e=z.O();e.assign(b);isNaN(e.x)&&(e.x=0);isNaN(e.y)&&(e.y=0);(b=this.uw)||Kh(this,a);for(var g=new J(di),h=new J(Ya),k=a.i;k.next();){var l=k.key;if(l.be()){var m=ei(this,l,a);if(null!==m)g.add(new di(l,k.value,m));else if(!c||l.canMove()){m=k.value.point;d.assign(m);var n=z.O(),p=this.computeMove(l,d.add(e),a,n);l.location=p;k.value.KF=n.xu(m);z.A(n)}}else k.key instanceof G&&h.add(k.lb)}for(c=
  g.i;c.next();)g=c.value,m=g.info.point,d.assign(m),g.Pc.location=d.add(g.RH.KF);c=z.O();m=z.O();for(h=h.i;h.next();)if(k=h.value,g=k.key,g instanceof G)if(g.eq)l=g.Y,n=g.da,null!==this.ld&&this.gj?(k=k.value.point,a.add(g,Ph(e)),l=e.x-k.x,k=e.y-k.y,g.Rl(l,k)):(null!==l&&(c.assign(l.location),p=a.na(l),null!==p&&c.xu(p.point)),null!==n&&(m.assign(n.location),p=a.na(n),null!==p&&m.xu(p.point)),null!==l&&null!==n?c.Mc(m)?(k=k.value.point,l=d,l.assign(c),l.xu(k),a.add(g,Ph(c)),g.Rl(l.x,l.y)):(g.eq=!1,
  g.qc()):(k=k.value.point,n=null!==l?c:null!==n?m:e,a.add(g,Ph(n)),l=n.x-k.x,k=n.y-k.y,g.Rl(l,k)));else if(null===g.Y||null===g.da)k=k.value.point,a.add(g,Ph(e)),l=e.x-k.x,k=e.y-k.y,g.Rl(l,k);z.A(d);z.A(e);z.A(c);z.A(m);b||Th(this,a)}};function ei(a,b,c){b=b.Qa;if(null!==b){a=ei(a,b,c);if(null!==a)return a;a=c.na(b);if(null!==a)return a}return null}
  function Zh(a){if(null!==a.hc){for(var b=a.h,c=a.hc.i;c.next();){var d=c.key;d.be()&&(d.location=c.value.point)}for(c=a.hc.i;c.next();)if(d=c.key,d instanceof G&&d.eq){var e=c.value.point;a.hc.add(d,Ph());d.Rl(-e.x,-e.y)}b.cg()}}
  lh.prototype.computeMove=function(a,b,c,d){void 0===d&&(d=new N);d.assign(b);if(null===a)return d;void 0===c&&(c=null);var e=b;if(this.kx&&(this.eI||null===c||this.h.R.up)&&(e=z.O(),c=e,c.assign(b),null!==a)){var g=this.h;if(null!==g){var h=g.tp,k=this.AE,g=k.width,k=k.height,l=this.QH,m=l.x,l=l.y,n=this.PH;if(null!==h){var p=h.gx;isNaN(g)&&(g=p.width);isNaN(k)&&(k=p.height);h=h.zE;isNaN(m)&&(m=h.x);isNaN(l)&&(l=h.y)}h=z.Tb(0,0);h.tu(0,0,g,k,n);jb(b.x,b.y,m+h.x,l+h.y,g,k,c);z.A(h)}}c=null!==a.hE?
  a.hE(a,b,e):e;k=a.FI;g=k.x;isNaN(g)&&(g=a.location.x);k=k.y;isNaN(k)&&(k=a.location.y);h=a.AI;m=h.x;isNaN(m)&&(m=a.location.x);h=h.y;isNaN(h)&&(h=a.location.y);d.n(Math.max(g,Math.min(c.x,m)),Math.max(k,Math.min(c.y,h)));e!==b&&z.A(e);return d};function fi(a,b){if(null===b)return!0;var c=b.ca;return null===c||c instanceof da||c.layer.Nc||a.hc&&a.hc.contains(c)||a.oc&&a.oc.contains(c)?!0:!1}
  function gi(a,b,c,d){var e=a.h;if(null!==e){a.gj&&(null!==a.ld&&(a.ld.Y=null,a.ld.da=null),hi(a,!1));var g=ii(e,b,null,function(b){return!fi(a,b)}),h=e.R;h.Ge=g;var k=e.Bb,l=!1;try{e.Bb=!0;l=Xh(a,h,g);if(!a.ua&&null===Lh)return;if(null===g){var m=e.JI;null!==m&&(m(h),l=!0)}if(!a.ua&&null===Lh)return;a.doDragOver(b,g);if(!a.ua&&null===Lh)return}finally{e.Bb=k,l&&e.cg()}(e.ye||e.ze)&&(c||d)&&ji(e,h.ue)}}
  function Xh(a,b,c){var d=!1,e=a.Cj.length,g=0<e?a.Cj[0]:null;if(c===g)return!1;b.Gc=!1;for(var h=0;h<e;h++){var k=a.Cj[h],l=k.II;if(null!==l&&(l(b,k,c),d=!0,b.Gc))break}a.Cj.length=0;if(!a.ua&&null===Lh||null===c)return d;for(b.Gc=!1;null!==c;)a.Cj.push(c),c=ki(c);e=a.Cj.length;for(h=0;h<e&&(k=a.Cj[h],l=k.HI,null===l||(l(b,k,g),d=!0,!b.Gc));h++);return d}function ki(a){var b=a.T;return null!==b?b:a instanceof D&&!(a instanceof F)&&(a=a.Qa,null!==a&&a.TH)?a:null}
  function li(a,b,c){var d=a.Ti;if(null===d)return null;var e=a.h.cn(b,d.hF,function(a){return d.findValidLinkablePort(a,c)});a=z.O();for(var g=Infinity,h=null,e=e.i;e.next();){var k=e.value;if(null!==k.ca){var l=k.eb(ec,a),l=b.Af(l);l<g&&(h=k,g=l)}}z.A(a);return h}
  function hi(a,b){var c=a.ld;if(null!==c&&!(2>c.sa)){var d=a.h;if(null!==d&&!d.ib&&(d=a.Ti,null!==d)){var e=null,g=null;null===c.Y&&(e=li(a,c.m(0),!1),null!==e&&(g=e.ca));var h=null,k=null;null===c.da&&(h=li(a,c.m(c.sa-1),!0),null!==h&&(k=h.ca));d.isValidLink(g,e,k,h)?b?(c.Un=c.m(0).copy(),c.Yn=c.m(c.sa-1).copy(),c.eq=!1,c.Y=g,null!==e&&(c.ag=e.zd),c.da=k,null!==h&&(c.Vg=h.zd)):mi(d,g,e,k,h):mi(d,null,null,null,null)}}}lh.prototype.doDragOver=function(){};
  function ni(a,b){var c=a.h;if(null!==c){a.gj&&hi(a,!0);Sh(a);var d=ii(c,b,null,function(b){return!fi(a,b)}),e=c.R;e.Ge=d;if(null!==d){e.Gc=!1;for(var g=d;null!==g;){var h=g.rA;if(null!==h&&(h(e,g),e.Gc))break;g=ki(g)}}else h=c.rA,null!==h&&h(e);if(a.ua||null!==Lh)if(a.doDropOnto(b,d),a.ua||null!==Lh)for(d=c.selection.i;d.next();)e=d.value,e instanceof E&&oi(c,e.W)}}lh.prototype.doDropOnto=function(){};
  lh.prototype.doMouseMove=function(){if(this.ua){var a=this.h;if(null!==a&&null!==this.an&&null!==this.hc){var b=!1,c=!1;this.mayCopy()?(b=!0,a.gc="copy",bi(this,!1),Kh(this,this.oc),ci(this,this.oc,!1),Th(this,this.oc)):this.mayMove()?(c=!0,a.gc="default",Wh(this),ci(this,this.hc,!0)):this.mayDragOut()?(a.gc="no-drop",bi(this,!1),ci(this,this.oc,!1)):Wh(this);gi(this,a.R.ga,c,b)}}};
  lh.prototype.doMouseUp=function(){if(this.ua){var a=this.h;if(null!==a){var b=!1,c=this.mayCopy();c&&null!==this.oc?(Wh(this),bi(this,!0),Kh(this,this.oc),ci(this,this.oc,!1),Th(this,this.oc),null!==this.oc&&a.EF(this.oc.vj())):(b=!0,Wh(this),this.mayMove()&&(ci(this,this.hc,!0),gi(this,a.R.ga,!0,!1)));this.Uq=!0;ni(this,a.R.ga);if(this.ua){this.oc=null;if(b&&null!==this.hc)for(b=this.hc.i;b.next();){var d=b.key;d instanceof E&&(d=d.Qa,null===d||null===d.placeholder||this.hc.contains(d)||d.UD&&d.Q())}a.yc();
  Th(this,this.hc);this.Mf=c?"Copy":"Move";a.Ja(c?"SelectionCopied":"SelectionMoved",a.selection)}this.stopTool()}}};lh.prototype.mayCopy=function(){if(!this.KE)return!1;var a=this.h;if(null===a||a.ib||a.Ef||!a.$o||!a.lk||(z.sk?!a.R.alt:!a.R.control))return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.be()&&b.canCopy())return!0}return null!==this.ld&&this.gj&&this.ld.canCopy()?!0:!1};
  lh.prototype.mayDragOut=function(){if(!this.KE)return!1;var a=this.h;if(null===a||!a.kt||!a.lk||a.vl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.be()&&b.canCopy())return!0}return null!==this.ld&&this.gj&&this.ld.canCopy()?!0:!1};lh.prototype.mayMove=function(){var a=this.h;if(null===a||a.ib||!a.vl)return!1;for(a=a.selection.i;a.next();){var b=a.value;if(b.be()&&b.canMove())return!0}return null!==this.ld&&this.gj&&this.ld.canMove()?!0:!1};var Uh=new J(lh),Lh=null,Mh=null;
  lh.prototype.getDraggingSource=function(){return Lh};lh.prototype.mayDragIn=function(){var a=this.h;if(null===a||!a.FD||a.ib||a.Ef||!a.$o)return!1;var b=Lh;return null===b||b.h.ha.Bl!==a.ha.Bl?!1:!0};lh.prototype.doSimulatedDragEnter=function(){if(this.mayDragIn()){var a=this.h;a.Va.pi();pi(a);a=Lh;null!==a&&(a.h.gc="copy")}};lh.prototype.doSimulatedDragLeave=function(){var a=Lh;null!==a&&a.doSimulatedDragOut();this.doCancel()};
  lh.prototype.doSimulatedDragOver=function(){var a=this.h;if(null!==a){var b=Lh;null!==b&&null!==b.hc&&this.mayDragIn()&&(a.gc="copy",qi(this,b.hc.vj(),!1),ci(this,this.oc,!1),gi(this,a.R.ga,!1,!0))}};
  lh.prototype.doSimulatedDrop=function(){var a=this.h;if(null!==a){var b=Lh;if(null!==b){var c=b.h;b.Uq=!0;Wh(this);this.mayDragIn()&&(this.Wb("Drop"),qi(this,b.hc.vj(),!0),ci(this,this.oc,!1),null!==this.oc&&a.EF(this.oc.vj()),ni(this,a.R.ga),a.yc(),b=a.selection,null!==this.oc?this.Mf="ExternalCopy":b=new K(D),this.oc=null,a.focus(),a.Ja("ExternalObjectsDropped",b,c),this.yk())}}};
  function qi(a,b,c){if(null===a.oc){var d=a.h;if(null!==d&&!d.ib&&!d.Ef){d.Bb=!c;d.lq=!c;a.xk=d.R.ga;d=d.gp(b,d,!0);c=z.lg();ai(b,c);var e=c.x+c.width/2,g=c.y+c.height/2;z.dc(c);var h=a.rw;c=new na(D);var k=z.O();for(b=b.i;b.next();){var l=b.value;if(l.be()&&l.canCopy()){var m=l.location,l=d.na(l);k.n(h.x-(e-m.x),h.y-(g-m.y));l.location=k;l.Bf();c.add(l,Ph(k))}}z.A(k);for(d=d.i;d.next();)e=d.value,e instanceof G&&e.canCopy()&&c.add(e,Ph());a.oc=c;Jh(a,c.vj());null!==a.ld&&(c=a.ld,d=c.tn,c.Rl(a.xk.x-
  (d.x+d.width/2),a.xk.y-(d.y+d.height/2)))}}}lh.prototype.doSimulatedDragOut=function(){var a=this.h;null!==a&&(this.mayCopy()||this.mayMove()?a.gc="":a.gc="no-drop")};function Qh(a){this.point=a;this.KF=Id}z.ia("DraggingInfo",Qh);function di(a,b,c){this.Pc=a;this.info=b;this.RH=c}
  function ri(){0<arguments.length&&z.pd(ri);xg.call(this);this.UC=100;this.wC=!1;var a=new G,b=new X;b.Ff=!0;b.stroke="blue";a.add(b);b=new X;b.fq="Standard";b.fill="blue";b.stroke="blue";a.add(b);a.If="Tool";this.mD=a;a=new E;b=new X;b.zd="";b.Hb="Rectangle";b.fill=null;b.stroke="magenta";b.ub=2;b.Aa=Qd;a.add(b);a.wk=!1;a.If="Tool";this.kD=a;this.lD=b;a=new E;b=new X;b.zd="";b.Hb="Rectangle";b.fill=null;b.stroke="magenta";b.ub=2;b.Aa=Qd;a.add(b);a.wk=!1;a.If="Tool";this.nD=a;this.oD=b;this.RC=this.QC=
  this.MC=this.LC=this.NC=null;this.sC=!0;this.FG=new na(O,"boolean");this.VC=this.fl=this.gD=null}z.Ra(ri,xg);z.ia("LinkingBaseTool",ri);ri.prototype.doStop=function(){var a=this.h;null!==a&&Rh(a);this.Rg=this.Qg=this.Pg=this.Og=this.sc=null;this.Ux.clear();this.kg=null};z.defineProperty(ri,{hF:"portGravity"},function(){return this.UC},function(a){z.g(a,"number",ri,"portGravity");0<=a&&(this.UC=a)});
  z.defineProperty(ri,{Cp:"isUnconnectedLinkValid"},function(){return this.wC},function(a){z.g(a,"boolean",ri,"isUnconnectedLinkValid");this.wC=a});z.defineProperty(ri,{Ug:"temporaryLink"},function(){return this.mD},function(a){z.l(a,G,ri,"temporaryLink");this.mD=a});z.defineProperty(ri,{Od:"temporaryFromNode"},function(){return this.kD},function(a){z.l(a,E,ri,"temporaryFromNode");this.kD=a});
  z.defineProperty(ri,{yn:"temporaryFromPort"},function(){return this.lD},function(a){z.l(a,O,ri,"temporaryFromPort");this.lD=a});z.defineProperty(ri,{Pd:"temporaryToNode"},function(){return this.nD},function(a){z.l(a,E,ri,"temporaryToNode");this.nD=a});z.defineProperty(ri,{zn:"temporaryToPort"},function(){return this.oD},function(a){z.l(a,O,ri,"temporaryToPort");this.oD=a});z.defineProperty(ri,{sc:"originalLink"},function(){return this.NC},function(a){null!==a&&z.l(a,G,ri,"originalLink");this.NC=a});
  z.defineProperty(ri,{Og:"originalFromNode"},function(){return this.LC},function(a){null!==a&&z.l(a,E,ri,"originalFromNode");this.LC=a});z.defineProperty(ri,{Pg:"originalFromPort"},function(){return this.MC},function(a){null!==a&&z.l(a,O,ri,"originalFromPort");this.MC=a});z.defineProperty(ri,{Qg:"originalToNode"},function(){return this.QC},function(a){null!==a&&z.l(a,E,ri,"originalToNode");this.QC=a});
  z.defineProperty(ri,{Rg:"originalToPort"},function(){return this.RC},function(a){null!==a&&z.l(a,O,ri,"originalToPort");this.RC=a});z.defineProperty(ri,{Nd:"isForwards"},function(){return this.sC},function(a){z.g(a,"boolean",ri,"isForwards");this.sC=a});z.w(ri,{Ux:"validPortsCache"},function(){return this.FG});z.defineProperty(ri,{kg:"targetPort"},function(){return this.gD},function(a){null!==a&&z.l(a,O,ri,"targetPort");this.gD=a});
  ri.prototype.copyPortProperties=function(a,b,c,d,e){if(null!==a&&null!==b&&null!==c&&null!==d){d.Aa=b.W.size;e?(d.Eb=b.Eb,d.Yl=b.Yl):(d.Db=b.Db,d.Jl=b.Jl);c.of=ec;var g=z.O();c.location=b.eb(ec,g);z.A(g);d.angle=b.Kl();null!==this.Cx&&this.Cx(a,b,c,d,e)}};ri.prototype.setNoTargetPortProperties=function(a,b,c){null!==b&&(b.Aa=Qd,b.Db=Yb,b.Eb=Yb);null!==a&&(a.location=this.h.R.ga);null!==this.Cx&&this.Cx(null,null,a,b,c)};ri.prototype.doMouseDown=function(){this.ua&&this.doMouseMove()};
  ri.prototype.doMouseMove=function(){if(this.ua){var a=this.h;if(null!==a){this.kg=this.findTargetPort(this.Nd);if(null!==this.kg){var b=this.kg.ca;if(b instanceof E){this.Nd?this.copyPortProperties(b,this.kg,this.Pd,this.zn,!0):this.copyPortProperties(b,this.kg,this.Od,this.yn,!1);return}}this.Nd?this.setNoTargetPortProperties(this.Pd,this.zn,!0):this.setNoTargetPortProperties(this.Od,this.yn,!1);(a.ye||a.ze)&&ji(a,a.R.ue)}}};
  ri.prototype.findValidLinkablePort=function(a,b){if(null===a)return null;var c=a.ca;if(!(c instanceof E))return null;for(;null!==a;){var d=b?a.SF:a.uE;if(!0===d&&(null!==a.zd||a instanceof E)&&(b?this.isValidTo(c,a):this.isValidFrom(c,a)))return a;if(!1===d)break;a=a.T}return null};
  ri.prototype.findTargetPort=function(a){var b=this.h,c=b.R.ga,d=this.hF;0>=d&&(d=.1);for(var e=this,g=b.cn(c,d,function(b){return e.findValidLinkablePort(b,a)},null,!0),d=Infinity,b=null,g=g.i;g.next();){var h=g.value,k=h.ca;if(k instanceof E){var l=h.eb(ec,z.O()),m=c.x-l.x,n=c.y-l.y;z.A(l);l=m*m+n*n;l<d&&(m=this.Ux.na(h),null!==m?m&&(b=h,d=l):a&&this.isValidLink(this.Og,this.Pg,k,h)||!a&&this.isValidLink(k,h,this.Qg,this.Rg)?(this.Ux.add(h,!0),b=h,d=l):this.Ux.add(h,!1))}}return null!==b&&(c=b.ca,
  c instanceof E&&(null===c.layer||c.layer.lt))?b:null};ri.prototype.isValidFrom=function(a,b){if(null===a||null===b)return this.Cp;if(this.h.cb===this&&(null!==a.layer&&!a.layer.lt||!0!==b.uE))return!1;var c=b.Yz;if(Infinity>c){if(null!==this.sc&&a===this.Og&&b===this.Pg)return!0;var d=b.zd;null===d&&(d="");if(a.$w(d).count>=c)return!1}return!0};
  ri.prototype.isValidTo=function(a,b){if(null===a||null===b)return this.Cp;if(this.h.cb===this&&(null!==a.layer&&!a.layer.lt||!0!==b.SF))return!1;var c=b.vJ;if(Infinity>c){if(null!==this.sc&&a===this.Qg&&b===this.Rg)return!0;var d=b.zd;null===d&&(d="");if(a.Ig(d).count>=c)return!1}return!0};ri.prototype.isInSameNode=function(a,b){if(null===a||null===b)return!1;if(a===b)return!0;var c=a.ca,d=b.ca;return null!==c&&c===d};
  ri.prototype.isLinked=function(a,b){if(null===a||null===b)return!1;var c=a.ca;if(!(c instanceof E))return!1;var d=a.zd;null===d&&(d="");var e=b.ca;if(!(e instanceof E))return!1;var g=b.zd;null===g&&(g="");for(e=e.Ig(g);e.next();)if(g=e.value,g.Y===c&&g.ag===d)return!0;return!1};
  ri.prototype.isValidLink=function(a,b,c,d){if(!this.isValidFrom(a,b)||!this.isValidTo(c,d)||!(null===b||null===d||(b.JH&&d.uJ||!this.isInSameNode(b,d))&&(b.IH&&d.tJ||!this.isLinked(b,d)))||null!==this.sc&&(null!==a&&this.isLabelDependentOnLink(a,this.sc)||null!==c&&this.isLabelDependentOnLink(c,this.sc))||null!==a&&null!==c&&(null===a.data&&null!==c.data||null!==a.data&&null===c.data)||!this.isValidCycle(a,c,this.sc))return!1;if(null!==a){var e=a.sx;if(null!==e&&!e(a,b,c,d,this.sc))return!1}if(null!==
  c&&(e=c.sx,null!==e&&!e(a,b,c,d,this.sc)))return!1;e=this.sx;return null!==e?e(a,b,c,d,this.sc):!0};ri.prototype.isLabelDependentOnLink=function(a,b){if(null===a)return!1;var c=a.od;if(null===c)return!1;if(c===b)return!0;var d=new K(E);d.add(a);return si(this,c,b,d)};function si(a,b,c,d){if(b===c)return!0;var e=b.Y;if(null!==e&&e.Df&&(d.add(e),si(a,e.od,c,d)))return!0;b=b.da;return null!==b&&b.Df&&(d.add(b),si(a,b.od,c,d))?!0:!1}
  ri.prototype.isValidCycle=function(a,b,c){void 0===c&&(c=null);if(null===a||null===b)return this.Cp;var d=this.h.BJ;if(d!==Bi){if(d===Ci){if(null!==c&&!c.Oc)return!0;for(d=b.ee;d.next();){var e=d.value;if(e!==c&&e.Oc&&e.da===b)return!1}return!Di(this,a,b,c,!0)}if(d===Ei){if(null!==c&&!c.Oc)return!0;for(d=a.ee;d.next();)if(e=d.value,e!==c&&e.Oc&&e.Y===a)return!1;return!Di(this,a,b,c,!0)}if(d===Fi)return a===b?a=!0:(d=new K(E),d.add(b),a=Gi(this,d,a,b,c)),!a;if(d===Hi)return!Di(this,a,b,c,!1);if(d===
  Ii)return a===b?a=!0:(d=new K(E),d.add(b),a=Ji(this,d,a,b,c)),!a}return!0};function Di(a,b,c,d,e){if(b===c)return!0;if(null===b||null===c)return!1;for(var g=b.ee;g.next();){var h=g.value;if(h!==d&&(!e||h.Oc)&&h.da===b&&(h=h.Y,h!==b&&Di(a,h,c,d,e)))return!0}return!1}function Gi(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 g=c.ee;g.next();){var h=g.value;if(h!==e&&h.da===c&&(h=h.Y,h!==c&&Gi(a,b,h,d,e)))return!0}return!1}
  function Ji(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 g=c.ee;g.next();){var h=g.value;if(h!==e){var k=h.Y,h=h.da,k=k===c?h:k;if(k!==c&&Ji(a,b,k,d,e))return!0}}return!1}z.defineProperty(ri,{sx:"linkValidation"},function(){return this.fl},function(a){null!==a&&z.g(a,"function",ri,"linkValidation");this.fl=a});z.defineProperty(ri,{Cx:"portTargeted"},function(){return this.VC},function(a){null!==a&&z.g(a,"function",ri,"portTargeted");this.VC=a});
  function ta(){0<arguments.length&&z.pd(ta);ri.call(this);this.name="Linking";this.my={};this.ly=null;this.fa=Ki;this.dD=null}z.Ra(ta,ri);z.ia("LinkingTool",ta);var Ki;ta.Either=Ki=z.s(ta,"Either",0);var Li;ta.ForwardsOnly=Li=z.s(ta,"ForwardsOnly",0);var Mi;ta.BackwardsOnly=Mi=z.s(ta,"BackwardsOnly",0);z.defineProperty(ta,{SG:"archetypeLinkData"},function(){return this.my},function(a){null!==a&&z.l(a,Object,ta,"archetypeLinkData");a instanceof O&&z.l(a,G,ta,"archetypeLinkData");this.my=a});
  z.defineProperty(ta,{JD:"archetypeLabelNodeData"},function(){return this.ly},function(a){null!==a&&z.l(a,Object,ta,"archetypeLabelNodeData");a instanceof O&&z.l(a,E,ta,"archetypeLabelNodeData");this.ly=a});z.defineProperty(ta,{direction:"direction"},function(){return this.fa},function(a){z.Ba(a,ta,ta,"direction");this.fa=a});z.defineProperty(ta,{OF:"startObject"},function(){return this.dD},function(a){null!==a&&z.l(a,O,ta,"startObject");this.dD=a});
  ta.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.ib||a.Ef||!a.lt)return!1;var b=a.ha;return(b instanceof V||b instanceof qg)&&a.R.left&&(a.cb===this||this.isBeyondDragSize())?null!==this.findLinkablePort():!1};
  ta.prototype.findLinkablePort=function(){var a=this.h;if(null===a)return null;var b=this.OF;null===b&&(b=a.pe(a.Fc.ga,null,null));if(null===b||!(b.ca instanceof E))return null;a=this.direction;if(a===Ki||a===Li){var c=this.findValidLinkablePort(b,!1);if(null!==c)return this.Nd=!0,c}if(a===Ki||a===Mi)if(c=this.findValidLinkablePort(b,!0),null!==c)return this.Nd=!1,c;return null};
  ta.prototype.doActivate=function(){var a=this.h;if(null!==a){var b=this.findLinkablePort();null!==b&&(this.Wb(this.name),a.We=!0,a.gc="pointer",this.Nd?(null===this.Pd||this.Pd.location.F()||(this.Pd.location=a.R.ga),this.Pg=b,b=this.Pg.ca,b instanceof E&&(this.Og=b),this.copyPortProperties(this.Og,this.Pg,this.Od,this.yn,!1)):(null===this.Od||this.Od.location.F()||(this.Od.location=a.R.ga),this.Rg=b,b=this.Rg.ca,b instanceof E&&(this.Qg=b),this.copyPortProperties(this.Qg,this.Rg,this.Pd,this.zn,
  !0)),a.add(this.Od),a.add(this.Pd),null!==this.Ug&&(null!==this.Od&&(this.Ug.Y=this.Od),null!==this.Pd&&(this.Ug.da=this.Pd),this.Ug.qc(),a.add(this.Ug)),this.ua=!0)}};ta.prototype.doDeactivate=function(){this.ua=!1;var a=this.h;null!==a&&(a.remove(this.Ug),a.remove(this.Od),a.remove(this.Pd),a.We=!1,a.gc="",this.yk())};ta.prototype.doStop=function(){ri.prototype.doStop.call(this);this.OF=null};
  ta.prototype.doMouseUp=function(){if(this.ua){var a=this.h;if(null===a)return;var b=this.Mf=null,c=null,d=null,e=null,g=this.kg=this.findTargetPort(this.Nd);if(null!==g){var h=g.ca;h instanceof E&&(this.Nd?(null!==this.Og&&(b=this.Og,c=this.Pg),d=h,e=g):(b=h,c=g,null!==this.Qg&&(d=this.Qg,e=this.Rg)))}else this.Nd?null!==this.Og&&this.Cp&&(b=this.Og,c=this.Pg):null!==this.Qg&&this.Cp&&(d=this.Qg,e=this.Rg);null!==b||null!==d?(h=this.insertLink(b,c,d,e),null!==h?(null===g&&(this.Nd?h.Yn=a.R.ga.copy():
  h.Un=a.R.ga.copy()),a.xf&&a.select(h),this.Mf=this.name,a.Ja("LinkDrawn",h)):(a.ha.QD(),this.doNoLink(b,c,d,e))):this.Nd?this.doNoLink(this.Og,this.Pg,null,null):this.doNoLink(null,null,this.Qg,this.Rg)}this.stopTool()};
  ta.prototype.insertLink=function(a,b,c,d){var e=this.h;if(null===e)return null;var g=e.ha;if(g instanceof qg){var h=a;b=c;e.ce||(h=c,b=a);if(null!==h&&null!==b)return g.Gh(b.data,g.pb(h.data)),b.op()}else if(g instanceof V)if(h="",null!==a&&(null===b&&(b=a),h=b.zd,null===h&&(h="")),b="",null!==c&&(null===d&&(d=c),b=d.zd,null===b&&(b="")),d=this.SG,d instanceof G){if(jh(d),g=d.copy(),null!==g)return g.Y=a,g.ag=h,g.da=c,g.Vg=b,e.add(g),a=this.JD,a instanceof E&&(jh(a),a=a.copy(),null!==a&&(a.od=g,e.add(a))),
  g}else if(null!==d&&(d=g.Qw(d),z.Za(d)))return null!==a&&g.Mx(d,g.pb(a.data)),g.PA(d,h),null!==c&&g.Qx(d,g.pb(c.data)),g.SA(d,b),g.gt(d),a=this.JD,null===a||a instanceof E||(a=g.copyNodeData(a),z.Za(a)&&(g.sl(a),a=g.pb(a),void 0!==a&&g.Bz(d,a))),g=e.$f(d);return null};ta.prototype.doNoLink=function(){};
  function Nh(){0<arguments.length&&z.pd(Nh);ri.call(this);this.name="Relinking";var a=new X;a.Hb="Diamond";a.Aa=be;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.De=0;this.eC=a;a=new X;a.Hb="Diamond";a.Aa=be;a.fill="lightblue";a.stroke="dodgerblue";a.cursor="pointer";a.De=-1;this.pD=a;this.ac=null;this.OC=new w}z.Ra(Nh,ri);z.ia("RelinkingTool",Nh);
  Nh.prototype.updateAdornments=function(a){if(null!==a&&a instanceof G){var b="RelinkFrom",c=null;if(a.jb&&!this.h.ib){var d=a.un;null!==d&&a.canRelinkFrom()&&a.W.F()&&a.isVisible()&&d.W.F()&&d.oj()&&(c=a.kp(b),null===c&&(c=this.makeAdornment(d,!1),null!==c&&(c.nc=b),a.rl(b,c)))}null===c&&a.sj(b);b="RelinkTo";c=null;a.jb&&!this.h.ib&&(d=a.un,null!==d&&a.canRelinkTo()&&a.W.F()&&a.isVisible()&&d.W.F()&&d.oj()&&(c=a.kp(b),null===c&&(c=this.makeAdornment(d,!0),null!==c&&(c.nc=b),a.rl(b,c))));null===c&&
  a.sj(b)}};Nh.prototype.makeAdornment=function(a,b){var c=new da;c.type=Ni;var d=b?this.sJ:this.HH;null!==d&&c.add(d.copy());c.fc=a;return c};z.defineProperty(Nh,{HH:"fromHandleArchetype"},function(){return this.eC},function(a){null!==a&&z.l(a,O,Nh,"fromHandleArchetype");this.eC=a});z.defineProperty(Nh,{sJ:"toHandleArchetype"},function(){return this.pD},function(a){null!==a&&z.l(a,O,Nh,"toHandleArchetype");this.pD=a});z.w(Nh,{handle:"handle"},function(){return this.ac});
  Nh.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.ib||a.Ef||!a.Sm)return!1;var b=a.ha;if(!(b instanceof V||b instanceof qg)||!a.R.left)return!1;b=this.findToolHandleAt(a.Fc.ga,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Fc.ga,"RelinkTo"));return null!==b};
  Nh.prototype.doActivate=function(){var a=this.h;if(null!==a){if(null===this.sc){var b=this.findToolHandleAt(a.Fc.ga,"RelinkFrom");null===b&&(b=this.findToolHandleAt(a.Fc.ga,"RelinkTo"));if(null===b)return;var c=b.ca;if(!(c instanceof da&&c.Xf instanceof G))return;this.ac=b;this.Nd=null===c||"RelinkTo"===c.nc;this.sc=c.Xf}this.Wb(this.name);a.We=!0;a.gc="pointer";this.Pg=this.sc.md;this.Og=this.sc.Y;this.Rg=this.sc.Qd;this.Qg=this.sc.da;this.OC.set(this.sc.W);null!==this.sc&&0<this.sc.sa&&(null===
  this.sc.Y&&(null!==this.yn&&(this.yn.Aa=Pd),null!==this.Od&&(this.Od.location=this.sc.m(0))),null===this.sc.da&&(null!==this.zn&&(this.zn.Aa=Pd),null!==this.Pd&&(this.Pd.location=this.sc.m(this.sc.sa-1))));this.copyPortProperties(this.Og,this.Pg,this.Od,this.yn,!1);this.copyPortProperties(this.Qg,this.Rg,this.Pd,this.zn,!0);a.add(this.Od);a.add(this.Pd);null!==this.Ug&&(null!==this.Od&&(this.Ug.Y=this.Od),null!==this.Pd&&(this.Ug.da=this.Pd),this.copyLinkProperties(this.sc,this.Ug),this.Ug.qc(),a.add(this.Ug));
  this.ua=!0}};Nh.prototype.copyLinkProperties=function(a,b){if(null!==a&&null!==b){b.it=a.it;b.Mz=a.Mz;var c=a.Se;if(c===Oi||c===Pi)c=Qi;b.Se=c;b.Sw=a.Sw;b.Ix=a.Ix;b.cq=a.cq;b.Db=a.Db;b.Jl=a.Jl;b.Ft=a.Ft;b.Gt=a.Gt;b.Eb=a.Eb;b.Yl=a.Yl;b.zu=a.zu;b.Au=a.Au}};Nh.prototype.doDeactivate=function(){this.ua=!1;var a=this.h;null!==a&&(a.remove(this.Ug),a.remove(this.Od),a.remove(this.Pd),a.We=!1,a.gc="",this.yk())};Nh.prototype.doStop=function(){ri.prototype.doStop.call(this);this.ac=null};
  Nh.prototype.doMouseUp=function(){if(this.ua){var a=this.h;if(null===a)return;this.Mf=null;var b=this.Og,c=this.Pg,d=this.Qg,e=this.Rg,g=this.sc;this.kg=this.findTargetPort(this.Nd);if(null!==this.kg){var h=this.kg.ca;h instanceof E&&(this.Nd?(d=h,e=this.kg):(b=h,c=this.kg))}else this.Cp?this.Nd?e=d=null:c=b=null:g=null;null!==g?(this.reconnectLink(g,this.Nd?d:b,this.Nd?e:c,this.Nd),null===this.kg&&(this.Nd?g.Yn=a.R.ga.copy():g.Un=a.R.ga.copy(),g.qc()),a.xf&&(g.jb=!0),this.Mf=this.name,a.Ja("LinkRelinked",
  g,this.Nd?this.Rg:this.Pg)):this.doNoRelink(this.sc,this.Nd);Ri(this.sc,this.OC)}this.stopTool()};Nh.prototype.reconnectLink=function(a,b,c,d){if(null===this.h)return!1;c=null!==c&&null!==c.zd?c.zd:"";d?(a.da=b,a.Vg=c):(a.Y=b,a.ag=c);return!0};Nh.prototype.doNoRelink=function(){};function mi(a,b,c,d,e){null!==b?(a.copyPortProperties(b,c,a.Od,a.yn,!1),a.h.add(a.Od)):a.h.remove(a.Od);null!==d?(a.copyPortProperties(d,e,a.Pd,a.zn,!0),a.h.add(a.Pd)):a.h.remove(a.Pd)}
  function Si(){0<arguments.length&&z.pd(Si);xg.call(this);this.name="LinkReshaping";var a=new X;a.Hb="Rectangle";a.Aa=ae;a.fill="lightblue";a.stroke="dodgerblue";this.Vk=a;a=new X;a.Hb="Diamond";a.Aa=ae;a.fill="lightblue";a.stroke="dodgerblue";this.CC=a;this.WC=3;this.jy=this.ac=null;this.PC=new N;this.Wv=null}z.Ra(Si,xg);z.ia("LinkReshapingTool",Si);var Ti;Si.None=Ti=z.s(Si,"None",0);var Ui;Si.Horizontal=Ui=z.s(Si,"Horizontal",1);var Vi;Si.Vertical=Vi=z.s(Si,"Vertical",2);var Wi;
  Si.All=Wi=z.s(Si,"All",3);Si.prototype.getReshapingBehavior=Si.prototype.yE=function(a){return a&&a.XC?a.XC:Ti};Si.prototype.setReshapingBehavior=Si.prototype.su=function(a,b){z.l(a,O,Si,"setReshapingBehavior:obj");z.Ba(b,Si,Si,"setReshapingBehavior:behavior");a.XC=b};
  Si.prototype.updateAdornments=function(a){if(null!==a&&a instanceof G){if(a.jb&&!this.h.ib){var b=a.path;if(null!==b&&a.canReshape()&&a.W.F()&&a.isVisible()&&b.W.F()&&b.oj()){var c=a.kp(this.name);if(null===c||c.vG!==a.sa||c.HG!==a.lu)c=this.makeAdornment(b),null!==c&&(c.vG=a.sa,c.HG=a.lu,a.rl(this.name,c));if(null!==c){c.location=a.position;return}}}a.sj(this.name)}};
  Si.prototype.makeAdornment=function(a){var b=a.ca,c=b.sa,d=b.rc,e=null;if(null!==b.points&&1<c){e=new da;e.type=Ni;var c=b.Ct,g=b.qx,h=d?1:0;if(b.lu&&b.Se!==Xi)for(var k=c+h;k<g-h;k++){var l=this.makeResegmentHandle(a,k);null!==l&&(l.De=k,l.NA=.5,l.Yz=999,e.add(l))}for(k=c+1;k<g;k++)if(l=this.makeHandle(a,k),null!==l){l.De=k;if(k!==c)if(k===c+1&&d){var h=b.m(c),m=b.m(c+1);eb(h.x,m.x)&&eb(h.y,m.y)&&(m=b.m(c-1));eb(h.x,m.x)?(this.su(l,Vi),l.cursor="n-resize"):eb(h.y,m.y)&&(this.su(l,Ui),l.cursor="w-resize")}else k===
  g-1&&d?(h=b.m(g-1),m=b.m(g),eb(h.x,m.x)&&eb(h.y,m.y)&&(h=b.m(g+1)),eb(h.x,m.x)?(this.su(l,Vi),l.cursor="n-resize"):eb(h.y,m.y)&&(this.su(l,Ui),l.cursor="w-resize")):k!==g&&(this.su(l,Wi),l.cursor="move");e.add(l)}e.nc=this.name;e.fc=a}return e};Si.prototype.makeHandle=function(){var a=this.Ht;return null===a?null:a.copy()};z.defineProperty(Si,{Ht:"handleArchetype"},function(){return this.Vk},function(a){null!==a&&z.l(a,O,Si,"handleArchetype");this.Vk=a});
  Si.prototype.makeResegmentHandle=function(){var a=this.EI;return null===a?null:a.copy()};z.defineProperty(Si,{EI:"midHandleArchetype"},function(){return this.CC},function(a){null!==a&&z.l(a,O,Si,"midHandleArchetype");this.CC=a});z.w(Si,{handle:"handle"},function(){return this.ac});z.w(Si,{jt:"adornedLink"},function(){return this.jy});Si.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.ib&&a.Gw&&a.R.left?null!==this.findToolHandleAt(a.Fc.ga,this.name):!1};
  Si.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.ac=this.findToolHandleAt(a.Fc.ga,this.name),null!==this.ac)){var b=this.ac.ca.Xf;if(b instanceof G){this.jy=b;a.We=!0;this.Wb(this.name);if(b.lu&&999===this.ac.Yz){var c=b.points.copy(),d=this.ac.eb(ec);c.Md(this.ac.De+1,d);b.rc&&c.Md(this.ac.De+1,d);b.points=c;b.ae();this.ac=this.findToolHandleAt(a.Fc.ga,this.name);if(null===this.ac){this.doDeactivate();return}}this.PC=b.m(this.ac.De);this.Wv=b.points.copy();this.ua=!0}}};
  Si.prototype.doDeactivate=function(){this.yk();this.jy=this.ac=null;var a=this.h;null!==a&&(a.We=!1);this.ua=!1};Si.prototype.doCancel=function(){var a=this.jt;null!==a&&(a.points=this.Wv);this.stopTool()};Si.prototype.doMouseMove=function(){var a=this.h;this.ua&&null!==a&&(a=this.computeReshape(a.R.ga),this.reshape(a))};
  Si.prototype.doMouseUp=function(){var a=this.h;if(this.ua&&null!==a){var b=this.computeReshape(a.R.ga);this.reshape(b);b=this.jt;if(null!==b&&b.lu){var c=this.handle.De,d=b.m(c-1),e=b.m(c),g=b.m(c+1);if(b.rc){if(c>b.Ct+1&&c<b.qx-1){var h=b.m(c-2);if(Math.abs(d.x-e.x)<this.Eh&&Math.abs(d.y-e.y)<this.Eh&&(Yi(this,h,d,e,g,!0)||Yi(this,h,d,e,g,!1))){var k=b.points.copy();Yi(this,h,d,e,g,!0)?(k.Sg(c-2,new N(h.x,(g.y+h.y)/2)),k.Sg(c+1,new N(g.x,(g.y+h.y)/2))):(k.Sg(c-2,new N((g.x+h.x)/2,h.y)),k.Sg(c+1,
  new N((g.x+h.x)/2,g.y)));k.dd(c);k.dd(c-1);b.points=k;b.ae()}else h=b.m(c+2),Math.abs(e.x-g.x)<this.Eh&&Math.abs(e.y-g.y)<this.Eh&&(Yi(this,d,e,g,h,!0)||Yi(this,d,e,g,h,!1))&&(k=b.points.copy(),Yi(this,d,e,g,h,!0)?(k.Sg(c-1,new N(d.x,(d.y+h.y)/2)),k.Sg(c+2,new N(h.x,(d.y+h.y)/2))):(k.Sg(c-1,new N((d.x+h.x)/2,d.y)),k.Sg(c+2,new N((d.x+h.x)/2,h.y))),k.dd(c+1),k.dd(c),b.points=k,b.ae())}}else h=z.O(),ib(d.x,d.y,g.x,g.y,e.x,e.y,h)&&h.Af(e)<this.Eh*this.Eh&&(k=b.points.copy(),k.dd(c),b.points=k,b.ae()),
  z.A(h)}a.yc();this.Mf=this.name;a.Ja("LinkReshaped",this.jt,this.Wv)}this.stopTool()};function Yi(a,b,c,d,e,g){return g?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}z.defineProperty(Si,{Eh:"resegmentingDistance"},function(){return this.WC},function(a){z.g(a,"number",Si,"resegmentingDistance");this.WC=a});
  Si.prototype.reshape=function(a){var b=this.jt;b.Ul();var c=this.handle.De,d=this.yE(this.handle);if(b.rc)if(c===b.Ct+1)c=b.Ct+1,d===Vi?(b.aa(c,b.m(c-1).x,a.y),b.aa(c+1,b.m(c+2).x,a.y)):d===Ui&&(b.aa(c,a.x,b.m(c-1).y),b.aa(c+1,a.x,b.m(c+2).y));else if(c===b.qx-1)c=b.qx-1,d===Vi?(b.aa(c-1,b.m(c-2).x,a.y),b.aa(c,b.m(c+1).x,a.y)):d===Ui&&(b.aa(c-1,a.x,b.m(c-2).y),b.aa(c,a.x,b.m(c+1).y));else{var d=c,e=b.m(d),g=b.m(d-1),h=b.m(d+1);eb(g.x,e.x)&&eb(e.y,h.y)?(eb(g.x,b.m(d-2).x)&&!eb(g.y,b.m(d-2).y)?(b.B(d,
  a.x,g.y),c++,d++):b.aa(d-1,a.x,g.y),eb(h.y,b.m(d+2).y)&&!eb(h.x,b.m(d+2).x)?b.B(d+1,h.x,a.y):b.aa(d+1,h.x,a.y)):eb(g.y,e.y)&&eb(e.x,h.x)?(eb(g.y,b.m(d-2).y)&&!eb(g.x,b.m(d-2).x)?(b.B(d,g.x,a.y),c++,d++):b.aa(d-1,g.x,a.y),eb(h.x,b.m(d+2).x)&&!eb(h.y,b.m(d+2).y)?b.B(d+1,a.x,h.y):b.aa(d+1,a.x,h.y)):eb(g.x,e.x)&&eb(e.x,h.x)?(eb(g.x,b.m(d-2).x)&&!eb(g.y,b.m(d-2).y)?(b.B(d,a.x,g.y),c++,d++):b.aa(d-1,a.x,g.y),eb(h.x,b.m(d+2).x)&&!eb(h.y,b.m(d+2).y)?b.B(d+1,a.x,h.y):b.aa(d+1,a.x,h.y)):eb(g.y,e.y)&&eb(e.y,
  h.y)&&(eb(g.y,b.m(d-2).y)&&!eb(g.x,b.m(d-2).x)?(b.B(d,g.x,a.y),c++,d++):b.aa(d-1,g.x,a.y),eb(h.y,b.m(d+2).y)&&!eb(h.x,b.m(d+2).x)?b.B(d+1,h.x,a.y):b.aa(d+1,h.x,a.y));b.aa(c,a.x,a.y)}else b.aa(c,a.x,a.y),1===c&&b.computeSpot(!0).Be()&&(e=b.Y,g=b.md,null===e||e.isVisible()||(e=e.findVisibleNode(),e!==b.Y&&(g=e.Hl(""))),d=g.eb(ec,z.O()),e=b.getLinkPointFromPoint(e,g,d,a,!0,z.O()),b.aa(0,e.x,e.y),z.A(d),z.A(e)),c===b.sa-2&&b.computeSpot(!1).Be()&&(c=b.da,e=b.Qd,null===c||c.isVisible()||(c=c.findVisibleNode(),
  c!==b.da&&(e=c.Hl(""))),d=e.eb(ec,z.O()),e=b.getLinkPointFromPoint(c,e,d,a,!1,z.O()),b.aa(b.sa-1,e.x,e.y),z.A(d),z.A(e));b.dj()};Si.prototype.computeReshape=function(a){var b=this.jt,c=this.handle.De;switch(this.yE(this.handle)){case Wi:return a;case Vi:return b=b.m(c),new N(b.x,a.y);case Ui:return b=b.m(c),new N(a.x,b.y);default:case Ti:return b.m(c)}};z.w(Si,{eL:"originalPoint"},function(){return this.PC});z.w(Si,{fL:"originalPoints"},function(){return this.Wv});
  function Zi(){0<arguments.length&&z.pd(Zi);xg.call(this);this.name="Resizing";this.Uj=(new Ea(1,1)).freeze();this.Sj=(new Ea(9999,9999)).freeze();this.Aj=(new Ea(NaN,NaN)).freeze();this.jr=!1;this.Ib=null;var a=new X;a.kk=ec;a.Hb="Rectangle";a.Aa=ae;a.fill="lightblue";a.stroke="dodgerblue";a.ub=1;a.cursor="pointer";this.Vk=a;this.ac=null;this.Vv=new Ea;this.hz=new N;this.Ly=new Ea(0,0);this.Ky=new Ea(Infinity,Infinity);this.Jy=new Ea(1,1);this.IC=!0}z.Ra(Zi,xg);z.ia("ResizingTool",Zi);
  Zi.prototype.updateAdornments=function(a){if(!(null===a||a instanceof G)){if(a.jb&&!this.h.ib){var b=a.uF;if(null!==b&&a.canResize()&&a.W.F()&&a.isVisible()&&b.W.F()&&b.oj()){var c=a.kp(this.name);if(null===c||c.fc!==b)c=this.makeAdornment(b);if(null!==c){var d=b.Kl();c.angle=d;var e=b.eb(c.of,z.O()),g=b.hj();c.location=e;z.A(e);e=c.placeholder;if(null!==e){var b=b.Ga,h=z.Xl();h.n(b.width*g,b.height*g);e.Aa=h;z.qk(h)}this.updateResizeHandles(c,d);a.rl(this.name,c);return}}}a.sj(this.name)}};
  Zi.prototype.makeAdornment=function(a){var b=null,b=a.ca.tF;if(null===b){b=new da;b.type=$i;b.of=ec;var c=new aj;c.Ff=!0;b.add(c);b.add(this.makeHandle(a,Zb));b.add(this.makeHandle(a,cc));b.add(this.makeHandle(a,ic));b.add(this.makeHandle(a,gc));b.add(this.makeHandle(a,Zc));b.add(this.makeHandle(a,ad));b.add(this.makeHandle(a,bd));b.add(this.makeHandle(a,$c))}else if(jh(b),b=b.copy(),null===b)return null;b.nc=this.name;b.fc=a;return b};
  Zi.prototype.makeHandle=function(a,b){var c=this.Ht;if(null===c)return null;c=c.copy();c.alignment=b;return c};
  Zi.prototype.updateResizeHandles=function(a,b){if(null!==a)if(!a.alignment.bd()&&("pointer"===a.cursor||0<a.cursor.indexOf("resize")))a:{var c=a.alignment;c.Be()&&(c=ec);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 I)for(c=a.elements;c.next();)this.updateResizeHandles(c.value,b)};z.defineProperty(Zi,{Ht:"handleArchetype"},function(){return this.Vk},function(a){null!==a&&z.l(a,O,Zi,"handleArchetype");this.Vk=a});z.w(Zi,{handle:"handle"},function(){return this.ac});z.defineProperty(Zi,{fc:"adornedObject"},function(){return this.Ib},function(a){null!==a&&z.l(a,O,Zi,"adornedObject");this.Ib=a});
  Zi.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.ib&&a.mt&&a.R.left?null!==this.findToolHandleAt(a.Fc.ga,this.name)?!0:!1:!1};
  Zi.prototype.doActivate=function(){var a=this.h;null!==a&&(this.ac=this.findToolHandleAt(a.Fc.ga,this.name),null!==this.ac&&(this.Ib=this.ac.ca.fc,this.hz.set(this.Ib.ca.location),this.Vv.set(this.Ib.Aa),this.Jy=this.computeCellSize(),this.Ly=this.computeMinSize(),this.Ky=this.computeMaxSize(),a.We=!0,this.IC=a.Va.isEnabled,a.Va.isEnabled=!1,this.Wb(this.name),this.ua=!0))};Zi.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.yk(),this.Ib=this.ac=null,this.ua=a.We=!1,a.Va.isEnabled=this.IC)};
  Zi.prototype.doCancel=function(){this.Ib.Aa=this.Vv;this.Ib.ca.location=this.hz;this.stopTool()};Zi.prototype.doMouseMove=function(){var a=this.h;if(this.ua&&null!==a){var b=this.Ly,c=this.Ky,d=this.Jy,e=this.Ib.wE(a.R.ga,z.O()),g=bj;this.Ib instanceof X&&(g=cj(this.Ib));b=this.computeResize(e,this.ac.alignment,b,c,d,!(g===dj||g===ej||a.R.shift));this.resize(b);a.cg();z.A(e)}};
  Zi.prototype.doMouseUp=function(){var a=this.h;if(this.ua&&null!==a){var b=this.Ly,c=this.Ky,d=this.Jy,e=this.Ib.wE(a.R.ga,z.O()),g=bj;this.Ib instanceof X&&(g=cj(this.Ib));b=this.computeResize(e,this.ac.alignment,b,c,d,!(g===dj||g===ej||a.R.shift));this.resize(b);z.A(e);a.yc();this.Mf=this.name;a.Ja("PartResized",this.Ib,this.Vv)}this.stopTool()};
  Zi.prototype.resize=function(a){if(null!==this.h){var b=this.fc,c=b.ca,d=b.Kl(),e=b.hj(),g=Math.PI*d/180,h=Math.cos(g),g=Math.sin(g),k=0<d&&180>d?1:0,l=90<d&&270>d?1:0,d=180<d&&360>d?1:0,m=b.Ga.width,n=b.Ga.height;b.Aa=a.size;var p=c.position.copy();c.Bf();m=b.Ga.width-m;n=b.Ga.height-n;if(0!==m||0!==n)0!==m&&(p.x+=e*((a.x+m*l)*h-(a.y+n*k)*g)),0!==n&&(p.y+=e*((a.x+m*d)*g+(a.y+n*l)*h)),c.move(p),c instanceof E&&c.mf()}};
  Zi.prototype.computeResize=function(a,b,c,d,e,g){b.Be()&&(b=ec);var h=this.fc.Ga,k=h.x,l=h.y,m=h.x+h.width,n=h.y+h.height,p=1;if(!g){var p=h.width,q=h.height;0>=p&&(p=1);0>=q&&(q=1);p=q/p}q=z.O();jb(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),g||(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),g||(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,g||(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),g||(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),g||(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),g||(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,g||(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),g||(a.width=a.height/p,a.x=k+.5*(m-k-a.width)));z.A(q);return a};Zi.prototype.computeMinSize=function(){var a=this.fc.dg.copy(),b=this.dg;!isNaN(b.width)&&b.width>a.width&&(a.width=b.width);!isNaN(b.height)&&b.height>a.height&&(a.height=b.height);return a};
  Zi.prototype.computeMaxSize=function(){var a=this.fc.Xe.copy(),b=this.Xe;!isNaN(b.width)&&b.width<a.width&&(a.width=b.width);!isNaN(b.height)&&b.height<a.height&&(a.height=b.height);return a};
  Zi.prototype.computeCellSize=function(){var a=new Ea(NaN,NaN),b=this.fc.ca;if(null!==b){var c=b.YI;!isNaN(c.width)&&0<c.width&&(a.width=c.width);!isNaN(c.height)&&0<c.height&&(a.height=c.height)}c=this.cp;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.h;(isNaN(a.width)||isNaN(a.height))&&b&&(c=b.gb.me,null!==c&&c.kx&&(c=c.AE,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.tp,null!==b&&b.visible&&this.kx&&(c=b.gx,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};
  z.defineProperty(Zi,{dg:"minSize"},function(){return this.Uj},function(a){z.l(a,Ea,Zi,"minSize");if(!this.Uj.N(a)){var b=a.width;isNaN(b)&&(b=0);a=a.height;isNaN(a)&&(a=0);this.Uj.n(b,a)}});z.defineProperty(Zi,{Xe:"maxSize"},function(){return this.Sj},function(a){z.l(a,Ea,Zi,"maxSize");if(!this.Sj.N(a)){var b=a.width;isNaN(b)&&(b=Infinity);a=a.height;isNaN(a)&&(a=Infinity);this.Sj.n(b,a)}});
  z.defineProperty(Zi,{cp:"cellSize"},function(){return this.Aj},function(a){z.l(a,Ea,Zi,"cellSize");this.Aj.N(a)||this.Aj.assign(a)});z.defineProperty(Zi,{kx:"isGridSnapEnabled"},function(){return this.jr},function(a){z.g(a,"boolean",Zi,"isGridSnapEnabled");this.jr=a});z.w(Zi,{cL:"originalDesiredSize"},function(){return this.Vv});z.w(Zi,{dL:"originalLocation"},function(){return this.hz});
  function fj(){0<arguments.length&&z.pd(fj);xg.call(this);this.name="Rotating";this.bD=45;this.aD=2;this.Ib=null;var a=new X;a.Hb="Ellipse";a.Aa=be;a.fill="lightblue";a.stroke="dodgerblue";a.ub=1;a.cursor="pointer";this.Vk=a;this.ac=null;this.Uv=0;this.YC=new N}z.Ra(fj,xg);z.ia("RotatingTool",fj);
  fj.prototype.updateAdornments=function(a){if(!(null===a||a instanceof G)){if(a.jb&&!this.h.ib){var b=a.yF;if(null!==b&&a.canRotate()&&a.W.F()&&a.isVisible()&&b.W.F()&&b.oj()){var c=a.kp(this.name);if(null===c||c.fc!==b)c=this.makeAdornment(b);if(null!==c){c.angle=b.Kl();var d=null,e=null;b===a||b===a.Zb?(d=a.Zb,e=a.of):(d=b,e=ec);for(var g=d.Ga,e=z.Tb(g.width*e.x+e.offsetX,g.height*e.y+e.offsetY);null!==d&&d!==b;)d.transform.Cb(e),d=d.T;var d=e.y,g=Math.max(e.x-b.Ga.width,0),h=z.O();c.location=b.eb(new Q(1,
  0,50+g,d),h);z.A(h);z.A(e);a.rl(this.name,c);return}}}a.sj(this.name)}};fj.prototype.makeAdornment=function(a){var b=null,b=a.ca.$I;if(null===b){b=new da;b.type=gj;b.of=ec;var c=this.Ht;null!==c&&b.add(c.copy())}else if(jh(b),b=b.copy(),null===b)return null;b.nc=this.name;b.fc=a;return b};z.defineProperty(fj,{Ht:"handleArchetype"},function(){return this.Vk},function(a){null!==a&&z.l(a,O,fj,"handleArchetype");this.Vk=a});z.w(fj,{handle:"handle"},function(){return this.ac});
  z.defineProperty(fj,{fc:"adornedObject"},function(){return this.Ib},function(a){null!==a&&z.l(a,O,fj,"adornedObject");this.Ib=a});fj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null!==a&&!a.ib&&a.Hw&&a.R.left?null!==this.findToolHandleAt(a.Fc.ga,this.name)?!0:!1:!1};
  fj.prototype.doActivate=function(){var a=this.h;if(null!==a&&(this.ac=this.findToolHandleAt(a.Fc.ga,this.name),null!==this.ac)){this.Ib=this.ac.ca.fc;var b=this.Ib.ca,c=b.Zb;this.YC=this.Ib===b||this.Ib===c?c.eb(b.of):this.Ib.eb(ec);this.Uv=this.Ib.angle;a.We=!0;a.Pz=!0;this.Wb(this.name);this.ua=!0}};fj.prototype.doDeactivate=function(){var a=this.h;null!==a&&(this.yk(),this.Ib=this.ac=null,this.ua=a.We=!1)};fj.prototype.doCancel=function(){var a=this.h;null!==a&&(a.Pz=!1);this.rotate(this.Uv);this.stopTool()};
  fj.prototype.doMouseMove=function(){var a=this.h;this.ua&&null!==a&&(a=this.computeRotate(a.R.ga),this.rotate(a))};fj.prototype.doMouseUp=function(){var a=this.h;if(this.ua&&null!==a){a.Pz=!1;var b=this.computeRotate(a.R.ga);this.rotate(b);a.yc();this.Mf=this.name;a.Ja("PartRotated",this.Ib,this.Uv)}this.stopTool()};fj.prototype.rotate=function(a){u&&z.p(a,fj,"rotate:newangle");null!==this.Ib&&(this.Ib.angle=a)};
  fj.prototype.computeRotate=function(a){a=this.YC.Ec(a);var b=this.Ib.T;null!==b&&(a-=b.Kl(),360<=a?a-=360:0>a&&(a+=360));var b=Math.min(Math.abs(this.mJ),180),c=Math.min(Math.abs(this.lJ),b/2);!this.h.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};z.defineProperty(fj,{mJ:"snapAngleMultiple"},function(){return this.bD},function(a){z.g(a,"number",fj,"snapAngleMultiple");this.bD=a});
  z.defineProperty(fj,{lJ:"snapAngleEpsilon"},function(){return this.aD},function(a){z.g(a,"number",fj,"snapAngleEpsilon");this.aD=a});z.w(fj,{bL:"originalAngle"},function(){return this.Uv});function hj(){0<arguments.length&&z.pd(hj);xg.call(this);this.name="ClickSelecting"}z.Ra(hj,xg);z.ia("ClickSelectingTool",hj);hj.prototype.canStart=function(){return!this.isEnabled||null===this.h||this.isBeyondDragSize()?!1:!0};
  hj.prototype.doMouseUp=function(){this.ua&&(this.standardMouseSelect(),!this.standardMouseClick()&&this.h.R.mj&&this.h.gb.doToolTip());this.stopTool()};function ij(){0<arguments.length&&z.pd(ij);xg.call(this);this.name="Action";this.En=null}z.Ra(ij,xg);z.ia("ActionTool",ij);
  ij.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a)return!1;var b=a.R,c=a.pe(b.ga,function(a){for(;null!==a.T&&!a.Mt;)a=a.T;return a});if(null!==c){if(!c.Mt)return!1;this.En=c;a.Rn=a.pe(b.ga,null,null);return!0}return!1};ij.prototype.doMouseDown=function(){if(this.ua){var a=this.h.R,b=this.En;null!==b&&(a.Ge=b,null!==b.AD&&b.AD(a,b))}else this.canStart()&&this.doActivate()};
  ij.prototype.doMouseMove=function(){if(this.ua){var a=this.h.R,b=this.En;null!==b&&(a.Ge=b,null!==b.BD&&b.BD(a,b))}};ij.prototype.doMouseUp=function(){if(this.ua){var a=this.h,b=a.R,c=this.En;if(null===c)return;b.Ge=c;null!==c.CD&&c.CD(b,c);this.isBeyondDragSize()||zh(c,b,a)}this.stopTool()};ij.prototype.doCancel=function(){var a=this.h;if(null!==a){var a=a.R,b=this.En;if(null===b)return;a.Ge=b;null!==b.zD&&b.zD(a,b)}this.stopTool()};ij.prototype.doStop=function(){this.En=null};
  function va(){0<arguments.length&&z.pd(va);xg.call(this);this.name="ClickCreating";this.Nk=null;this.qC=!0;this.dC=new N(0,0)}z.Ra(va,xg);z.ia("ClickCreatingTool",va);
  va.prototype.canStart=function(){if(!this.isEnabled||null===this.Ez)return!1;var a=this.h;if(null===a||a.ib||a.Ef||!a.$o||!a.R.left||this.isBeyondDragSize())return!1;if(this.dI){if(1===a.R.Pe&&(this.dC=a.R.ue.copy()),2!==a.R.Pe||this.isBeyondDragSize(this.dC))return!1}else if(1!==a.R.Pe)return!1;return a.cb!==this&&null!==a.Bt(a.R.ga,!0)?!1:!0};va.prototype.doMouseUp=function(){var a=this.h;this.ua&&null!==a&&this.insertPart(a.R.ga);this.stopTool()};
  va.prototype.insertPart=function(a){var b=this.h;if(null===b)return null;var c=this.Ez;if(null===c)return null;this.Wb(this.name);var d=null;c instanceof D?c.be()&&(jh(c),d=c.copy(),null!==d&&b.add(d)):null!==c&&(c=b.ha.copyNodeData(c),z.Za(c)&&(b.ha.sl(c),d=b.vh(c)));null!==d&&(d.location=a,b.xf&&b.select(d));b.yc();this.Mf=this.name;b.Ja("PartCreated",d);this.yk();return d};
  z.defineProperty(va,{Ez:"archetypeNodeData"},function(){return this.Nk},function(a){null!==a&&z.l(a,Object,va,"archetypeNodeData");this.Nk=a});z.defineProperty(va,{dI:"isDoubleClick"},function(){return this.qC},function(a){z.g(a,"boolean",va,"isDoubleClick");this.qC=a});function jj(a,b,c){this.text=a;this.SD=b;this.visible=c}function kj(){0<arguments.length&&z.pd(kj);xg.call(this);this.name="ContextMenu";this.JB=this.wy=this.GB=null;this.GC=new N;this.yy=this.Zn=null;lj(this)}z.Ra(kj,xg);
  z.ia("ContextMenuTool",kj);z.aE=!1;z.qt=null;z.rt=null;
  function lj(a){a.Zn=new da;a.qD=function(){a.stopTool()};if(!1===z.aE){var b=z.createElement("div"),c=z.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;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);";var d=
  z.createElement("style");window.document.getElementsByTagName("head")[0].appendChild(d);d.sheet.insertRule(".defaultCXul { list-style: none; }",0);d.sheet.insertRule(".defaultCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }",0);d.sheet.insertRule(".defaultCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }",0);b.addEventListener("contextmenu",function(a){a.preventDefault();return!1},
  !1);b.addEventListener("selectstart",function(a){a.preventDefault();return!1},!1);c.addEventListener("contextmenu",function(a){a.preventDefault();return!1},!1);window.document.body&&(window.document.body.appendChild(b),window.document.body.appendChild(c));z.rt=b;z.qt=c;z.aE=!0}}kj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||this.isBeyondDragSize()||!a.R.right?!1:null!==this.Zn&&a.R.mj||null!==this.findObjectWithContextMenu()?!0:!1};
  kj.prototype.doStart=function(){var a=this.h;null!==a&&this.GC.set(a.Fc.ga)};kj.prototype.doStop=function(){this.hideDefaultContextMenu();this.hideContextMenu();this.Oz=null};
  kj.prototype.findObjectWithContextMenu=function(a){void 0===a&&(a=null);var b=this.h;if(null===b)return null;var c=b.R,d=null;a instanceof B||(d=a instanceof O?a:b.pe(c.ga,null,function(a){return!a.layer.Nc}));if(null!==d){for(a=d;null!==a;){if(null!==a.contextMenu)return a;a=a.T}if(null!==this.Zn&&b.R.mj)return d.ca}else if(null!==b.contextMenu)return b;return null};kj.prototype.doActivate=function(){};
  kj.prototype.doMouseDown=function(){xg.prototype.doMouseDown.call(this);null!==this.h&&this.h.gb.Ye.contains(this)&&mj(this)};kj.prototype.doMouseUp=function(){mj(this)};function mj(a){var b=a.h;if(null!==b)if(!a.ua)a.canStart()&&(oh(a,!0),a.ua||a.stopTool());else if(null!==a.yf){var c=b.pe(b.R.ga,null,null);null!==c&&c.Pl(a.yf)&&a.standardMouseClick(null,null);a.stopTool();a.canStart()&&(b.cb=a,a.doMouseUp())}}
  function oh(a,b,c){void 0===c&&(c=null);b&&a.standardMouseSelect();a.standardMouseClick()||(a.ua=!0,null===c&&(c=a.findObjectWithContextMenu()),null!==c?(b=c.contextMenu,null!==b?(a.Oz=c instanceof O?c:null,a.showContextMenu(b,a.Oz)):a.showDefaultContextMenu()):a.showDefaultContextMenu())}kj.prototype.doMouseMove=function(){this.ua&&this.h.gb.doMouseMove()};
  kj.prototype.showContextMenu=function(a,b){z.l(a,da,kj,"showContextMenu:contextmenu");null!==b&&z.l(b,O,kj,"showContextMenu:obj");var c=this.h;if(null!==c){a!==this.yf&&this.hideContextMenu();a.If="Tool";a.wk=!1;a.scale=1/c.scale;a.nc=this.name;null!==a.placeholder&&(a.placeholder.scale=c.scale);c.add(a);if(null!==b){var c=null,d=b.np();null!==d&&(c=d.data);a.fc=b;a.data=c}else a.data=c.ha;a.Bf();this.positionContextMenu(a,b);this.yf=a}};
  kj.prototype.positionContextMenu=function(a){if(null===a.placeholder){var b=this.h;if(null!==b){var c=b.R.ga.copy(),d=a.Ia,e=b.xb;b.R.mj&&(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}}};kj.prototype.hideContextMenu=function(){var a=this.h;null!==a&&null!==this.yf&&(a.remove(this.yf),null!==this.wy&&this.wy.sj(this.yf.nc),this.yf.data=null,this.yf=this.yf.fc=null,this.standardMouseOver())};
  function nj(a){if(null===a.h)return null;a=new J(jj);a.add(new jj("Copy",function(a){a.wb.copySelection()},function(a){return a.wb.canCopySelection()}));a.add(new jj("Cut",function(a){a.wb.cutSelection()},function(a){return a.wb.canCutSelection()}));a.add(new jj("Delete",function(a){a.wb.deleteSelection()},function(a){return a.wb.canDeleteSelection()}));a.add(new jj("Paste",function(a){a.wb.pasteSelection(a.R.ga)},function(a){return a.wb.canPasteSelection()}));a.add(new jj("Select All",function(a){a.wb.selectAll()},
  function(a){return a.wb.canSelectAll()}));a.add(new jj("Undo",function(a){a.wb.undo()},function(a){return a.wb.canUndo()}));a.add(new jj("Redo",function(a){a.wb.redo()},function(a){return a.wb.canRedo()}));a.add(new jj("Scroll To Part",function(a){a.wb.scrollToPart()},function(a){return a.wb.canScrollToPart()}));a.add(new jj("Zoom To Fit",function(a){a.wb.zoomToFit()},function(a){return a.wb.canZoomToFit()}));a.add(new jj("Reset Zoom",function(a){a.wb.resetZoom()},function(a){return a.wb.canResetZoom()}));
  a.add(new jj("Group Selection",function(a){a.wb.groupSelection()},function(a){return a.wb.canGroupSelection()}));a.add(new jj("Ungroup Selection",function(a){a.wb.ungroupSelection()},function(a){return a.wb.canUngroupSelection()}));a.add(new jj("Edit Text",function(a){a.wb.editTextBlock()},function(a){return a.wb.canEditTextBlock()}));return a}
  kj.prototype.showDefaultContextMenu=function(){var a=this.h;if(null!==a){null===this.yy&&(this.yy=nj(this));this.Zn!==this.yf&&this.hideContextMenu();z.rt.innerHTML="";z.qt.addEventListener("click",this.qD,!1);var b=this,c=z.createElement("ul");c.className="defaultCXul";z.rt.appendChild(c);c.innerHTML="";for(var d=this.yy.i;d.next();){var e=d.value,g=e.text,h=e.visible;if("function"===typeof e.SD&&("function"!==typeof h||h(a))){h=z.createElement("li");h.className="defaultCXli";var k=z.createElement("a");
  k.className="defaultCXa";k.href="#";k.mG=e.SD;k.addEventListener("click",function(c){this.mG(a);b.stopTool();c.preventDefault();return!1},!1);k.textContent=g;h.appendChild(k);c.appendChild(h)}}z.rt.style.display="block";z.qt.style.display="block";this.yf=this.Zn}};kj.prototype.hideDefaultContextMenu=function(){null!==this.yf&&this.yf===this.Zn&&(z.rt.style.display="none",z.qt.style.display="none",z.qt.removeEventListener("click",this.qD,!1),this.yf=null)};
  z.defineProperty(kj,{yf:"currentContextMenu"},function(){return this.GB},function(a){null!==a&&z.l(a,da,kj,"currentContextMenu");this.GB=a;this.wy=null!==a?a.Xf:null});z.defineProperty(kj,{Oz:"currentObject"},function(){return this.JB},function(a){null!==a&&z.l(a,O,kj,"currentObject");this.JB=a});z.w(kj,{XK:"mouseDownPoint"},function(){return this.GC});
  function oj(){0<arguments.length&&z.pd(oj);xg.call(this);this.name="DragSelecting";this.$n=175;this.vC=!1;var a=new D;a.If="Tool";a.wk=!1;var b=new X;b.name="SHAPE";b.Hb="Rectangle";b.fill=null;b.stroke="magenta";a.add(b);this.dm=a}z.Ra(oj,xg);z.ia("DragSelectingTool",oj);
  oj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.xf)return!1;var b=a.R;return!b.left||a.cb!==this&&(!this.isBeyondDragSize()||b.timestamp-a.Fc.timestamp<this.bE||null!==a.Bt(b.ga,!0))?!1:!0};oj.prototype.doActivate=function(){var a=this.h;null!==a&&(this.ua=!0,a.We=!0,a.Bb=!0,a.add(this.rh),this.doMouseMove())};oj.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.remove(this.rh),a.Bb=!1,this.ua=a.We=!1)};
  oj.prototype.doMouseMove=function(){if(null!==this.h&&this.ua&&null!==this.rh){var a=this.computeBoxBounds(),b=this.rh.oe("SHAPE");null===b&&(b=this.rh.gf());b.Aa=a.size;this.rh.position=a.position}};oj.prototype.doMouseUp=function(){if(this.ua){var a=this.h;a.remove(this.rh);try{a.gc="wait",this.selectInRect(this.computeBoxBounds())}finally{a.gc=""}}this.stopTool()};oj.prototype.computeBoxBounds=function(){var a=this.h;return null===a?new w(0,0,0,0):new w(a.Fc.ga,a.R.ga)};
  oj.prototype.selectInRect=function(a){var b=this.h;if(null!==b){var c=b.R;b.Ja("ChangingSelection");a=b.pk(a,null,function(a){return a instanceof D?a.canSelect():!1},this.iI);if(z.sk?c.$t:c.control)if(c.shift)for(a=a.i;a.next();)c=a.value,c.jb&&(c.jb=!1);else for(a=a.i;a.next();)c=a.value,c.jb=!c.jb;else{if(!c.shift){for(var c=new J(D),d=b.selection.i;d.next();){var e=d.value;a.contains(e)||c.add(e)}for(c=c.i;c.next();)c.value.jb=!1}for(a=a.i;a.next();)c=a.value,c.jb||(c.jb=!0)}b.Ja("ChangedSelection")}};
  z.defineProperty(oj,{bE:"delay"},function(){return this.$n},function(a){z.g(a,"number",oj,"delay");this.$n=a});z.defineProperty(oj,{iI:"isPartialInclusion"},function(){return this.vC},function(a){z.g(a,"boolean",oj,"isPartialInclusion");this.vC=a});z.defineProperty(oj,{rh:"box"},function(){return this.dm},function(a){null!==a&&z.l(a,D,oj,"box");this.dm=a});
  function pj(){0<arguments.length&&z.pd(pj);xg.call(this);this.name="Panning";this.iz=new N;this.zj=!1;var a=this;this.eD=function(){window.document.removeEventListener("scroll",a.eD,!1);a.stopTool()}}z.Ra(pj,xg);z.ia("PanningTool",pj);pj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;return null===a||!a.ye&&!a.ze||!a.R.left||a.cb!==this&&!this.isBeyondDragSize()?!1:!0};
  pj.prototype.doActivate=function(){var a=this.h;null!==a&&(this.zj?(a.R.bubbles=!0,window.document.addEventListener("scroll",this.eD,!1)):(a.gc="move",a.We=!0,this.iz=a.position.copy()),this.ua=!0)};pj.prototype.doDeactivate=function(){var a=this.h;null!==a&&(a.gc="",this.ua=a.We=!1)};pj.prototype.doCancel=function(){var a=this.h;null!==a&&(a.position=this.iz,a.We=!1);this.stopTool()};pj.prototype.doMouseMove=function(){this.move()};pj.prototype.doMouseUp=function(){this.move();this.stopTool()};
  pj.prototype.move=function(){var a=this.h;if(this.ua&&a)if(this.zj)a.R.bubbles=!0;else{var b=a.position,c=a.Fc.ga,d=a.R.ga,e=b.x+c.x-d.x,c=b.y+c.y-d.y;a.ye||(e=b.x);a.ze||(c=b.y);a.position=new N(e,c)}};z.defineProperty(pj,{bubbles:"bubbles"},function(){return this.zj},function(a){z.g(a,"boolean",pj,"bubbles");this.zj=a});z.w(pj,{gL:"originalPosition"},function(){return this.iz});
  function qj(){0<arguments.length&&z.pd(qj);xg.call(this);this.name="TextEditing";this.LB=this.sz=this.iD=null;this.Qo=rj;this.ol=null;this.nb=sj;this.ll=null;this.DC=1;this.ZC=!0;var a=z.createElement("textarea");a.pC=!0;this.SB=a;a.addEventListener("input",function(){var a=this.textEditingTool;if(null!==a&&void 0!==a&&null!==a.He){var c=a.iD;c.text=this.value;var d=this.rJ;tj(c,a.He.Fv,Infinity);this.style.width=20+c.Ia.width*d+"px";this.style.height=10+c.Ia.height*d+"px";this.rows=c.rI}},!1);a.addEventListener("keydown",
  function(a){var c=a.which,d=this.textEditingTool;null!==d&&void 0!==d&&null!==d.He&&(13===c?(!1===d.He.nx&&a.preventDefault(),d.acceptText(uj)):9===c?(d.acceptText(vj),a.preventDefault()):27===c&&(d.doCancel(),null!==d.h&&d.h.focus()))},!1);a.addEventListener("focus",function(a){var c=this.textEditingTool;null!==c&&void 0!==c&&c.doFocus(a)},!1);a.addEventListener("blur",function(a){var c=this.textEditingTool;null!==c&&void 0!==c&&c.doBlur(a)},!1)}z.ia("TextEditingTool",qj);z.Ra(qj,xg);var wj;
  qj.LostFocus=wj=z.s(qj,"LostFocus",0);var xj;qj.MouseDown=xj=z.s(qj,"MouseDown",1);var vj;qj.Tab=vj=z.s(qj,"Tab",2);var uj;qj.Enter=uj=z.s(qj,"Enter",3);qj.SingleClick=z.s(qj,"SingleClick",0);var rj;qj.SingleClickSelected=rj=z.s(qj,"SingleClickSelected",1);var sj=z.s(qj,"StateNone",0),Gj=z.s(qj,"StateActive",1),Hj=z.s(qj,"StateEditing",2),Ij=z.s(qj,"StateEditing2",3),Jj=z.s(qj,"StateValidating",4),Kj=z.s(qj,"StateValidated",5);
  z.defineProperty(qj,{He:"textBlock"},function(){return this.sz},function(a){null!==a&&z.l(a,qa,qj,"textBlock");this.sz=a});z.defineProperty(qj,{zf:"currentTextEditor"},function(){return this.LB},function(a){this.LB=a});z.defineProperty(qj,{oH:"defaultTextEditor"},function(){return this.SB},function(a){z.l(a,Element,qj,"defaultTextEditor");this.SB=a});z.defineProperty(qj,{VA:"starting"},function(){return this.Qo},function(a){z.Ba(a,qj,qj,"starting");this.Qo=a});
  qj.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||a.ib||!a.R.left||this.isBeyondDragSize())return!1;a=a.pe(a.R.ga,null,function(a){return a instanceof qa});if(null===a||!a.Tz||!a.ca.canEdit())return!1;a=a.ca;return null===a||this.VA===rj&&!a.jb?!1:!0};qj.prototype.doStart=function(){this.ua||null===this.He||this.doActivate()};
  qj.prototype.doActivate=function(){if(!this.ua){var a=this.h;if(null!==a){var b=this.He;null===b&&(b=a.pe(a.R.ga,function(a){return a instanceof qa?a:null}));if(null!==b&&(this.He=b,null!==b.ca)){this.ua=!0;this.nb=Gj;var c=this.oH,d=!1;null!==b.RF&&(c=b.RF);null===c||c.pC||(d=!0);this.iD=this.He.copy();var e=new w(this.He.eb(Zb),this.He.eb(ic));a.eJ(e);if(c.pC){var g=b.eb(ec),h=a.position,k=a.scale,l=b.hj()*k;l<this.bF&&(l=this.bF);var e=b.Ga.width*l,m=b.Ga.height*l,n=(g.x-h.x)*k,g=(g.y-h.y)*k;c.value=
  b.text;a.El.style.font=b.font;c.style.font="inherit";c.style.fontSize=100*l+"%";c.style.lineHeight="normal";c.style.width=e+6+"px";c.style.height=m+2+"px";c.style.left=(n-e/2|0)-1+"px";c.style.top=(g-m/2|0)-1+"px";c.style.textAlign=b.textAlign;c.style.margin="0";c.style.padding="1px";c.style.border="0";c.style.outline="none";c.style["white-space"]="pre-wrap";c.style.overflow="hidden"}a.El.appendChild(c);c.style.position="absolute";c.style.zIndex=100;c.className="start";c.textEditingTool=this;c.rJ=
  l;if(d&&"function"===typeof c.onActivate)c.onActivate();this.zf=c;"function"===typeof c.focus&&c.focus();"function"===typeof c.select&&this.OA&&(c.select(),c.setSelectionRange(0,9999))}}}};qj.prototype.doCancel=function(){null!==this.ll&&(this.zf.style.border=this.ll,this.ll=null);this.stopTool()};qj.prototype.doMouseUp=function(){!this.ua&&this.canStart()&&this.doActivate()};qj.prototype.doMouseDown=function(){this.ua&&this.acceptText(xj)};
  qj.prototype.acceptText=function(a){switch(a){case xj:if(this.nb===Kj||this.nb===Ij)"function"===typeof this.zf.focus&&this.zf.focus();else if(this.nb===Gj||this.nb===Hj)this.nb=Jj,Lj(this);break;case wj:case uj:case vj:if(uj===a&&!0===this.sz.nx)break;if(this.nb===Gj||this.nb===Hj)this.nb=Jj,Lj(this)}};
  function Lj(a){if(null!==a.He&&null!==a.zf){var b=a.He,c=a.He.text,d=a.zf.value,e="",e="function"===typeof d?d():d;if(!a.isValidText(a.He,c,e)){a.nb=Hj;null!==b.Vz&&b.Vz(a,c,e);null===a.ll&&(a.ll=a.zf.style.border,a.zf.style.border="3px solid red");"function"===typeof a.zf.focus&&a.zf.focus();return}a.Wb(a.name);a.nb=Kj;c!==e&&(a.He.text=e);a.Mf=a.name;b=a.h;null!==b&&b.Ja("TextEdited",a.He,c);a.yk();a.stopTool();null!==b&&b.focus()}null!==a.ll&&(a.zf.style.border=a.ll,a.ll=null)}
  qj.prototype.doDeactivate=function(){var a=this.h;if(null!==a){this.nb=sj;this.He=null;if(null!==this.zf){var b=this.zf;if("function"===typeof b.onDeactivate)b.onDeactivate();null!==b&&a.El.removeChild(b)}this.ua=!1}};qj.prototype.doFocus=function(){var a=this.zf;null!==a&&(this.nb===Gj?this.nb=Hj:this.nb===Kj?this.nb=Ij:this.nb===Ij&&(this.nb=Hj),"function"===typeof a.select&&this.OA&&(a.select(),a.setSelectionRange(0,9999)))};
  qj.prototype.doBlur=function(){var a=this.zf;null!==a&&("function"===typeof a.focus&&a.focus(),"function"===typeof a.select&&this.OA&&(a.select(),a.setSelectionRange(0,9999)))};qj.prototype.isValidText=function(a,b,c){z.l(a,qa,qj,"isValidText:textblock");var d=this.YA;if(null!==d&&!d(a,b,c))return!1;d=a.YA;return null===d||d(a,b,c)?!0:!1};z.defineProperty(qj,{YA:"textValidation"},function(){return this.ol},function(a){null!==a&&z.g(a,"function",qj,"textValidation");this.ol=a});
  z.defineProperty(qj,{bF:"minimumEditorScale"},function(){return this.DC},function(a){null!==a&&z.g(a,"number",qj,"minimumEditorScale");this.DC=a});z.defineProperty(qj,{OA:"selectsTextOnActivate"},function(){return this.ZC},function(a){null!==a&&z.g(a,"boolean",qj,"selectsTextOnActivate");this.ZC=a});
  function gh(){xg.call(this);this.name="ToolManager";this.rG=new J(xg);this.sG=new J(xg);this.tG=new J(xg);this.hC=this.iC=850;this.WB=(new Ea(2,2)).La();this.rD=5E3;this.HC=Ih;this.fC=Mj;this.ev=this.MB=null;this.Mm=-1}z.Ra(gh,xg);z.ia("ToolManager",gh);var Ih;gh.WheelScroll=Ih=z.s(gh,"WheelScroll",0);var Hh;gh.WheelZoom=Hh=z.s(gh,"WheelZoom",1);gh.WheelNone=z.s(gh,"WheelNone",2);var Mj;gh.GestureZoom=Mj=z.s(gh,"GestureZoom",3);var Nj;gh.GestureCancel=Nj=z.s(gh,"GestureCancel",4);var Oj;
  gh.GestureNone=Oj=z.s(gh,"GestureNone",5);z.defineProperty(gh,{cu:"mouseWheelBehavior"},function(){return this.HC},function(a){z.Ba(a,gh,gh,"mouseWheelBehavior");this.HC=a});z.defineProperty(gh,{qp:"gestureBehavior"},function(){return this.fC},function(a){z.Ba(a,gh,gh,"gestureBehavior");this.fC=a});
  gh.prototype.initializeStandardTools=function(){this.IG=new ij;this.jF=new Nh;this.uI=new Si;this.wF=new Zi;this.bJ=new fj;this.YE=new ta;this.me=new lh;this.sH=new oj;this.NI=new pj;this.Jz=new kj;this.XA=new qj;this.YG=new va;this.ZG=new hj};gh.prototype.updateAdornments=function(a){var b=this.uh;if(null!==b&&this.ev===a){var c=b.fc;(null!==a?c.ca===a:null===c)?this.showToolTip(b,c):this.hideToolTip()}};
  gh.prototype.doMouseDown=function(){var a=this.h;if(null!==a){var b=a.R;b.mj&&this.qp===Nj&&(b.bubbles=!1);if(b.Qt){if(this.qp===Oj){b.bubbles=!0;return}if(this.qp===Nj)return;if(a.cb.canStartMultiTouch()){a.cb.standardPinchZoomStart();return}}var c=a.pa;c.Gz&&0!==c.Ih&&z.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");for(var c=this.Ye.length,d=0;d<c;d++){var e=this.Ye.ea(d);null===e.h&&e.Sc(this.h);if(e.canStart()){a.doFocus();a.cb=e;a.cb===e&&(e.ua||e.doActivate(),
  e.doMouseDown());return}}1===a.R.button&&(this.cu===Ih?this.cu=Hh:this.cu===Hh&&(this.cu=Ih));this.doActivate();this.standardWaitAfter(this.EE,b)}};
  gh.prototype.doMouseMove=function(){var a=this.h;if(null!==a){var b=a.R;if(b.Qt){if(this.qp===Oj){b.bubbles=!0;return}if(this.qp===Nj)return;if(a.cb.canStartMultiTouch()){a.cb.standardPinchZoomMove();return}}if(this.ua)for(var c=this.eg.length,d=0;d<c;d++){var e=this.eg.ea(d);null===e.h&&e.Sc(this.h);if(e.canStart()){a.doFocus();a.cb=e;a.cb===e&&(e.ua||e.doActivate(),e.doMouseMove());return}}Pj(this,a);null===b.event||"mousemove"!==b.event.type&&b.event.cancelable||(b.bubbles=!0)}};
  function Pj(a,b){a.standardMouseOver();a.isBeyondDragSize()&&a.standardWaitAfter(a.ua?a.EE:a.VH,b.R)}gh.prototype.doCurrentObjectChanged=function(a,b){var c=this.uh;null===c||null!==b&&(b===c||b.Pl(c))||this.hideToolTip()};gh.prototype.doWaitAfter=function(a){var b=this.h;null!==b&&b.Fb&&(this.doMouseHover(),this.ua||this.doToolTip(),a.mj&&!b.R.Gc&&(a=a.copy(),a.button=2,a.buttons=2,b.R=a,b.Ss=!0,b.doMouseUp()))};
  gh.prototype.doMouseHover=function(){var a=this.h;if(null!==a){var b=a.R;null===b.Ge&&(b.Ge=a.pe(b.ga,null,null));var c=b.Ge;if(null!==c)for(b.Gc=!1;null!==c;){a=this.ua?c.sA:c.tA;if(null!==a&&(a(b,c),b.Gc))break;c=c.T}else a=this.ua?a.sA:a.tA,null!==a&&a(b)}};
  gh.prototype.doToolTip=function(){var a=this.h;if(null!==a){var b=a.R;null===b.Ge&&(b.Ge=a.pe(b.ga,null,null));b=b.Ge;if(null!==b){if(b!==this.uh&&!b.Pl(this.uh)){for(;null!==b;){a=b.$A;if(null!==a){this.showToolTip(a,b);return}b=b.T}this.hideToolTip()}}else a=a.$A,null!==a?this.showToolTip(a,null):this.hideToolTip()}};
  gh.prototype.showToolTip=function(a,b){z.l(a,da,gh,"showToolTip:tooltip");null!==b&&z.l(b,O,gh,"showToolTip:obj");var c=this.h;if(null!==c){a!==this.uh&&this.hideToolTip();a.If="Tool";a.wk=!1;a.scale=1/c.scale;a.nc="ToolTip";null!==a.placeholder&&(a.placeholder.scale=c.scale);c.add(a);if(null!==b){var c=null,d=b.np();null!==d&&(c=d.data);a.fc=b;a.data=c}else a.data=c.ha;a.Bf();this.positionToolTip(a,b);this.uh=a;-1!==this.Mm&&(z.clearTimeout(this.Mm),this.Mm=-1);c=this.wJ;if(0<c&&Infinity!==c){var e=
  this;this.Mm=z.setTimeout(function(){e.hideToolTip()},c)}}};gh.prototype.positionToolTip=function(a){if(null===a.placeholder){var b=this.h;if(null!==b){var c=b.R.ga.copy(),d=a.Ia,e=b.xb;b.R.mj&&(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}}};
  gh.prototype.hideToolTip=function(){-1!==this.Mm&&(z.clearTimeout(this.Mm),this.Mm=-1);var a=this.h;null!==a&&null!==this.uh&&(a.remove(this.uh),null!==this.ev&&this.ev.sj(this.uh.nc),this.uh.data=null,this.uh=this.uh.fc=null)};z.defineProperty(gh,{uh:"currentToolTip"},function(){return this.MB},function(a){null!==a&&z.l(a,da,gh,"currentToolTip");this.MB=a;this.ev=null!==a?a.Xf:null});
  gh.prototype.doMouseUp=function(){this.cancelWaitAfter();var a=this.h;if(null!==a){if(this.ua)for(var b=this.fg.length,c=0;c<b;c++){var d=this.fg.ea(c);null===d.h&&d.Sc(this.h);if(d.canStart()){a.doFocus();a.cb=d;a.cb===d&&(d.ua||d.doActivate(),d.doMouseUp());return}}a.doFocus();this.doDeactivate()}};gh.prototype.doMouseWheel=function(){this.standardMouseWheel()};gh.prototype.doKeyDown=function(){var a=this.h;null!==a&&a.wb.doKeyDown()};gh.prototype.doKeyUp=function(){var a=this.h;null!==a&&a.wb.doKeyUp()};
  gh.prototype.doCancel=function(){null!==Lh&&Lh.doCancel();xg.prototype.doCancel.call(this)};gh.prototype.findTool=function(a){z.g(a,"string",gh,"findTool:name");for(var b=this.Ye.length,c=0;c<b;c++){var d=this.Ye.ea(c);if(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;b=this.fg.length;for(c=0;c<b;c++)if(d=this.fg.ea(c),d.name===a)return d;return null};
  gh.prototype.replaceTool=function(a,b){z.g(a,"string",gh,"replaceTool:name");null!==b&&(z.l(b,xg,gh,"replaceTool:newtool"),b.h&&b.h!==this.h&&z.k("Cannot share tools between Diagrams: "+b.toString()),b.Sc(this.h));for(var c=this.Ye.length,d=0;d<c;d++){var e=this.Ye.ea(d);if(e.name===a)return null!==b?this.Ye.Sg(d,b):this.Ye.dd(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.Sg(d,b):this.eg.dd(d),e;c=this.fg.length;for(d=0;d<c;d++)if(e=this.fg.ea(d),e.name===
  a)return null!==b?this.fg.Sg(d,b):this.fg.dd(d),e;return null};function Qj(a,b,c,d){z.g(b,"string",gh,"replaceStandardTool:name");z.l(d,J,gh,"replaceStandardTool:list");null!==c&&(z.l(c,xg,gh,"replaceStandardTool:newtool"),c.h&&c.h!==a.h&&z.k("Cannot share tools between Diagrams: "+c.toString()),c.name=b,c.Sc(a.h));a.findTool(b)?a.replaceTool(b,c):null!==c&&d.add(c)}z.w(gh,{Ye:"mouseDownTools"},function(){return this.rG});z.w(gh,{eg:"mouseMoveTools"},function(){return this.sG});
  z.w(gh,{fg:"mouseUpTools"},function(){return this.tG});z.defineProperty(gh,{VH:"hoverDelay"},function(){return this.iC},function(a){z.g(a,"number",gh,"hoverDelay");this.iC=a});z.defineProperty(gh,{EE:"holdDelay"},function(){return this.hC},function(a){z.g(a,"number",gh,"holdDelay");this.hC=a});z.defineProperty(gh,{tH:"dragSize"},function(){return this.WB},function(a){z.l(a,Ea,gh,"dragSize");this.WB=a.V()});
  z.defineProperty(gh,{wJ:"toolTipDuration"},function(){return this.rD},function(a){z.g(a,"number",gh,"toolTipDuration");this.rD=a});z.defineProperty(gh,{IG:"actionTool"},function(){return this.findTool("Action")},function(a){Qj(this,"Action",a,this.Ye)});z.defineProperty(gh,{jF:"relinkingTool"},function(){return this.findTool("Relinking")},function(a){Qj(this,"Relinking",a,this.Ye)});
  z.defineProperty(gh,{uI:"linkReshapingTool"},function(){return this.findTool("LinkReshaping")},function(a){Qj(this,"LinkReshaping",a,this.Ye)});z.defineProperty(gh,{wF:"resizingTool"},function(){return this.findTool("Resizing")},function(a){Qj(this,"Resizing",a,this.Ye)});z.defineProperty(gh,{bJ:"rotatingTool"},function(){return this.findTool("Rotating")},function(a){Qj(this,"Rotating",a,this.Ye)});
  z.defineProperty(gh,{YE:"linkingTool"},function(){return this.findTool("Linking")},function(a){Qj(this,"Linking",a,this.eg)});z.defineProperty(gh,{me:"draggingTool"},function(){return this.findTool("Dragging")},function(a){Qj(this,"Dragging",a,this.eg)});z.defineProperty(gh,{sH:"dragSelectingTool"},function(){return this.findTool("DragSelecting")},function(a){Qj(this,"DragSelecting",a,this.eg)});
  z.defineProperty(gh,{NI:"panningTool"},function(){return this.findTool("Panning")},function(a){Qj(this,"Panning",a,this.eg)});z.defineProperty(gh,{Jz:"contextMenuTool"},function(){return this.findTool("ContextMenu")},function(a){Qj(this,"ContextMenu",a,this.fg)});z.defineProperty(gh,{XA:"textEditingTool"},function(){return this.findTool("TextEditing")},function(a){Qj(this,"TextEditing",a,this.fg)});
  z.defineProperty(gh,{YG:"clickCreatingTool"},function(){return this.findTool("ClickCreating")},function(a){Qj(this,"ClickCreating",a,this.fg)});z.defineProperty(gh,{ZG:"clickSelectingTool"},function(){return this.findTool("ClickSelecting")},function(a){Qj(this,"ClickSelecting",a,this.fg)});
  function Jg(){this.NB=Rj;this.Pq=this.Qq=this.Z=null;this.Gn=this.Rq=this.Sq=0;this.Hn=this.wc=this.so=this.Kj=!1;this.Lj=this.af=!0;this.cv=this.bv=this.IB=null;this.HB=0;this.Qo=this.dv=null;this.Pu=new K("string");this.Gy=600;this.xG=new N(0,0);this.wB=this.vB=this.vD=!1;this.xm=new na(O,Sj)}z.ia("AnimationManager",Jg);Jg.prototype.Sc=function(a){this.Z=a};function Rj(a,b,c,d){a/=d/2;return 1>a?c/2*a*a+b:-c/2*(--a*(a-2)-1)+b}
  z.defineProperty(Jg,{VA:"starting"},function(){return this.Qo},function(a){this.Qo!==a&&(null!==a&&z.g(a,"function",Jg,"starting"),this.Qo=a)});z.w(Jg,{aK:"animationReasons"},function(){return this.Pu});Jg.prototype.prepareAutomaticAnimation=Jg.prototype.rn=function(a){if(this.af&&(this.Lj||this.Z.jn)){this.Pu.add(a);var b=this.VA;if(null===b||b(this,a))this.Kj&&this.pi(),this.wc=!0}};
  function Tj(a){if(a.af&&(a.Pu.clear(),a.wc))if(!a.Hn)a.wc=!1;else if(0===a.Gn){var b=+new Date;a.Gn=b;requestAnimationFrame(function(){if(!1!==a.wc&&!a.Kj&&a.Gn===b){var c=a.Z;c.ij("temporaryPixelRatio")&&(c.dk=1);Uj(c);a.wc=!1;c.Ja("AnimationStarting");Vj(a,b)}})}}
  function Wj(a,b,c,d,e,g){if(a.wc&&(u&&z.l(b,O,Jg,"addPropToAnimation:obj"),!("position"===c&&d.N(e)||b instanceof D&&!b.HE))){var h=a.xm;if(h.contains(b)){var h=h.na(b),k=h.start,l=h.end;void 0===k[c]&&(k[c]=Xj(d));h.Rw&&void 0!==l[c]?h.yt[c]=Xj(e):(g||(h.yt[c]=Xj(e)),l[c]=Xj(e));g&&0===c.indexOf("position:")&&(h.yt.location=Xj(b.location))}else k=new ma,l=new ma,k[c]=Xj(d),l[c]=Xj(e),d=l,e=k.position,e instanceof N&&!e.F()&&a.Pu.contains("Expand SubGraph")&&e.assign(d.position),k=new Sj(k,l,g),g&&
  0===c.indexOf("position:")&&(k.yt.location=Xj(b.location)),h.add(b,k);a.Hn=!0}}function Xj(a){return a instanceof N?a.copy():a instanceof Ea?a.copy():a}
  function Vj(a,b){var c;function d(){if(!1!==g.Kj&&g.Gn===b){var a=+new Date,c=a>s?m:a-r;Yj(g);Zj(g,e,q,h,c,m);g.bv&&g.bv();pi(e);ak(g);a>s?bk(g):requestAnimationFrame(d)}}void 0===c&&(c=new ma);var e=a.Z;if(null!==e){a.Kj=!0;var g=a,h=c.AK||a.NB,k=c.$K||null,l=c.aL||null,m=c.duration||a.Gy,n=a.xG;for(c=a.xm.i;c.next();){var p=c.value.start.position;p instanceof N&&(p.F()||p.assign(n))}a.IB=h;a.bv=k;a.cv=l;a.HB=m;a.dv=a.xm;var q=a.dv;for(c=q.i;c.next();)k=c.value.end,k["position:placeholder"]&&(l=
  k["position:placeholder"],n=l.eb(Zb),n.x+=l.padding.left,n.y+=l.padding.top,k["position:placeholder"]=n);Yj(a);Zj(a,e,q,h,0,m);pi(a.Z);ak(a);var r=+new Date,s=r+m;g.Gn===b&&requestAnimationFrame(function(){d()})}}
  var ck={opacity:function(a,b,c,d,e,g){a.opacity=d(e,b,c-b,g)},position:function(a,b,c,d,e,g){e!==g?a.Px(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):a.position=new N(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},"position:node":function(a,b,c,d,e,g){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!==g?a.Px(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g)):a.position=new N(d(e,b.x,c-b.x,g),d(e,b.y,h-b.y,g))},"position:placeholder":function(a,b,c,d,e,g){e!==g?a.Px(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g)):
  a.position=new N(d(e,b.x,c.x-b.x,g),d(e,b.y,c.y-b.y,g))},scale:function(a,b,c,d,e,g){a.scale=d(e,b,c-b,g)},visible:function(a,b,c,d,e,g){a.visible=e!==g?b:c}};function Yj(a){if(!a.so){var b=a.Z;a.vD=b.Bb;a.vB=b.Ee;a.wB=b.vu;b.Bb=!0;b.Ee=!0;b.vu=!0;a.so=!0}}function ak(a){var b=a.Z;b.Bb=a.vD;b.Ee=a.vB;b.vu=a.wB;a.so=!1}
  function Zj(a,b,c,d,e,g){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!==ck[m])ck[m](h,l[m],k[m],d,e,g)}d=b.gA;b.gA=!0;m=a.NB;0!==a.Sq&&0!==a.Rq&&(c=a.Sq,b.bc=m(e,c,a.Rq-c,g));null!==a.Qq&&null!==a.Pq&&(c=a.Qq,a=a.Pq,b.sb=new N(m(e,c.x,a.x-c.x,g),m(e,c.y,a.y-c.y,g)));b.gA=d}Jg.prototype.stopAnimation=Jg.prototype.pi=function(){!0===this.wc&&(this.wc=!1,this.Hn&&this.Z.Ce());this.Kj&&this.af&&bk(this)};
  function bk(a){a.Kj=!1;a.Gn=0;a.Hn=!1;a.Qq=null;a.Pq=null;a.Sq=0;a.Rq=0;Yj(a);for(var b=a.Z,c=a.IB,d=a.HB,e=a.dv.i;e.next();){var g=e.key,h=e.value,k=h.start,l=h.end,m=h.yt,n;for(n in l)if(void 0!==ck[n]){var p=n;!h.Rw||"position:node"!==p&&"position:placeholder"!==p||(p="position");ck[p](g,k[n],void 0!==m[n]?m[n]:h.Rw?k[n]:l[n],c,d,d)}h.Rw&&void 0!==m.location&&(g.location=m.location);h.Ex&&g.xd(!1)}for(c=a.Z.links;c.next();)d=c.value,null!==d.Jo&&(d.points=d.Jo,d.Jo=null);b.tx.clear();b.dk=null;
  b.yc();b.ta();b.cg();dk(b);ak(a);a.dv=null;a.xm=new na(O,Sj);a.cv&&a.cv();a.cv=null;a.bv=null;b.Ja("AnimationFinished");b.Ce()}function ek(a,b,c){var d=b.W,e=c.W,g=null;c instanceof F&&(g=c.placeholder);null!==g?(d=g.eb(Zb),d.x+=g.padding.left,d.y+=g.padding.top,Wj(a,b,"position",d,b.position,!1)):Wj(a,b,"position",new N(e.x+e.width/2-d.width/2,e.y+e.height/2-d.height/2),b.position,!1);Wj(a,b,"scale",.01,b.scale,!1);if(b instanceof F)for(b=b.Hc;b.next();)g=b.value,g instanceof E&&ek(a,g,c)}
  function fk(a,b,c){if(b.isVisible()){var d=null;c instanceof F&&(d=c.placeholder);null!==d?Wj(a,b,"position:placeholder",b.position,d,!0):Wj(a,b,"position:node",b.position,c,!0);Wj(a,b,"scale",b.scale,.01,!0);a.wc&&(d=a.xm,d.contains(b)&&(d.na(b).Ex=!0));if(b instanceof F)for(b=b.Hc;b.next();)d=b.value,d instanceof E&&fk(a,d,c)}}function gk(a,b,c){a.wc&&(null===a.Qq&&b.F()&&null===a.Pq&&(a.Qq=b.copy()),a.Pq=c.copy(),a.Hn=!0)}
  function hk(a,b,c){a.wc&&a.Z.jn&&(0===a.Sq&&0===a.Rq&&(a.Sq=b),a.Rq=c,a.Hn=!0)}z.defineProperty(Jg,{isEnabled:"isEnabled"},function(){return this.af},function(a){z.g(a,"boolean",Jg,"isEnabled");this.af=a});z.defineProperty(Jg,{duration:"duration"},function(){return this.Gy},function(a){z.g(a,"number",Jg,"duration");1>a&&z.ka(a,">= 1",Jg,"duration");this.Gy=a});z.w(Jg,{nf:"isAnimating"},function(){return this.Kj});z.w(Jg,{jI:"isTicking"},function(){return this.so});
  z.defineProperty(Jg,{QE:"isInitial"},function(){return this.Lj},function(a){z.g(a,"boolean",Jg,"isInitial");this.Lj=a});function Sj(a,b,c){this.start=a;this.end=b;this.yt=new ma;this.Rw=c;this.Ex=!1}function wg(){0<arguments.length&&z.pd(wg);z.kc(this);this.Z=null;this.mb=new J(D);this.Ub="";this.Xc=1;this.Xy=!1;this.nl=this.xz=this.Kk=this.Jk=this.Ik=this.Hk=this.Fk=this.Gk=this.Ek=this.Mk=this.Dk=this.Lk=this.Ck=this.Bk=!0;this.Sy=!1;this.Xv=[]}z.ia("Layer",wg);
  wg.prototype.Sc=function(a){this.Z=a};
  wg.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,g=0,h=0,k=this.mb.i;k.next();){var l=k.value;l instanceof F?e++:l instanceof E?d++:l instanceof G?g++:l instanceof da?h++:c++}k="";0<c&&(k+=c+" Parts ");0<d&&(k+=d+" Nodes ");0<e&&(k+=e+" Groups ");0<g&&(k+=g+" Links ");0<h&&(k+=h+" Adornments ");if(1<a)for(a=this.mb.i;a.next();)c=a.value,k+="\n    "+c.toString(),d=c.data,null!==d&&z.nd(d)&&(k+=" #"+z.nd(d)),c instanceof E?k+=" "+
  ka(d):c instanceof G&&(k+=" "+ka(c.Y)+" "+ka(c.da));return b+" "+this.mb.count+": "+k};
  wg.prototype.findObjectAt=wg.prototype.pe=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);if(!1===this.nl)return null;u&&!a.F()&&z.k("findObjectAt: Point must have a real value, not: "+a.toString());var d=!1;this.h.xb.Ma(a)&&(d=!0);for(var e=z.O(),g=this.mb.o,h=g.length;h--;){var k=g[h];if((!0!==d||!1!==ik(k))&&k.isVisible()&&(e.assign(a),tb(e,k.qh),k=k.pe(e,b,c),null!==k&&(null!==b&&(k=b(k)),null!==k&&(null===c||c(k)))))return z.A(e),k}z.A(e);return null};
  wg.prototype.findObjectsAt=wg.prototype.lp=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof J||d instanceof K||(d=new K(O));if(!1===this.nl)return d;u&&!a.F()&&z.k("findObjectsAt: Point must have a real value, not: "+a.toString());var e=!1;this.h.xb.Ma(a)&&(e=!0);for(var g=z.O(),h=this.mb.o,k=h.length;k--;){var l=h[k];!0===e&&!1===ik(l)||!l.isVisible()||(g.assign(a),tb(g,l.qh),l.lp(g,b,c,d)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||d.add(l)))}z.A(g);return d};
  wg.prototype.findObjectsIn=wg.prototype.pk=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof J||e instanceof K||(e=new K(O));if(!1===this.nl)return e;u&&!a.F()&&z.k("findObjectsIn: Rect must have a real value, not: "+a.toString());var g=!1;this.h.xb.nk(a)&&(g=!0);for(var h=this.mb.o,k=h.length;k--;){var l=h[k];(!0!==g||!1!==ik(l))&&l.isVisible()&&l.pk(a,b,c,d,e)&&(null!==b&&(l=b(l)),null===l||null!==c&&!c(l)||e.add(l))}return e};
  wg.prototype.Wz=function(a,b,c,d,e,g,h){if(!1===this.nl)return e;for(var k=this.mb.o,l=k.length;l--;){var m=k[l];(!0!==h||!1!==ik(m))&&g(m)&&m.isVisible()&&m.pk(a,b,c,d,e)&&(null!==b&&(m=b(m)),null===m||null!==c&&!c(m)||e.add(m))}return e};
  wg.prototype.findObjectsNear=wg.prototype.cn=function(a,b,c,d,e,g){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof J||e instanceof K)g=e;e=!0}g instanceof J||g instanceof K||(g=new K(O));if(!1===this.nl)return g;u&&!a.F()&&z.k("findObjectsNear: Point must have a real value, not: "+a.toString());var h=!1;this.h.xb.Ma(a)&&(h=!0);for(var k=z.O(),l=z.O(),m=this.mb.o,n=m.length;n--;){var p=m[n];!0===h&&!1===ik(p)||!p.isVisible()||(k.assign(a),tb(k,p.qh),
  l.n(a.x+b,a.y),tb(l,p.qh),p.cn(k,l,c,d,e,g)&&(null!==c&&(p=c(p)),null===p||null!==d&&!d(p)||g.add(p)))}z.A(k);z.A(l);return g};f=wg.prototype;f.Jf=function(a,b){if(this.visible){var c;c=void 0===b?a.xb:b;for(var d=this.mb.o,e=d.length,g=0;g<e;g++){var h=d[g];h.AC=g;if(!(h instanceof G&&!1===h.Dg)){if(h instanceof da){var k=h;if(null!==k.Xf)continue}if(Gb(h.W,c))for(h.Jf(!0),jk(h),h=h.Ew;h.next();)k=h.value,tj(k,Infinity,Infinity),k.Lc(),k.Jf(!0);else h.Jf(!1),null!==h.Ew&&0<h.Ew.count&&jk(h)}}}};
  f.ff=function(a,b,c){if(this.visible&&0!==this.Xc&&(void 0===c&&(c=!0),c||!this.Nc)){c=this.mb.o;var d=c.length;if(0!==d){1!==this.Xc&&(a.globalAlpha=this.Xc);var e=this.Xv;e.length=0;for(var g=b.scale,h=0;h<d;h++){var k=c[h];if(ik(k)){if(k instanceof G){var l=k;l.rc&&e.push(l);if(!1===l.Dg)continue}l=k.W;1<l.width*g||1<l.height*g?k.ff(a,b):kk(k,a)}}a.globalAlpha=1}}};
  function lk(a,b,c,d){if(a.visible&&0!==a.Xc){1!==a.Xc&&(b.globalAlpha=a.Xc);var e=a.Xv;e.length=0;var g=c.scale;a=a.mb.o;for(var h=a.length,k=d.length,l=0;l<h;l++){var m=a[l];if(ik(m)){if(m instanceof G){var n=m;n.rc&&e.push(n);if(!1===n.Dg)continue}var n=mk(m,m.W),p;a:{p=n;for(var q=d,r=k,s=2/g,t=4/g,v=0;v<r;v++){var x=q[v];if(0!==x.width&&0!==x.height&&p.FE(x.x-s,x.y-s,x.width+t,x.height+t)){p=!0;break a}}p=!1}p&&(1<n.width*g||1<n.height*g?m.ff(b,c):kk(m,b))}}b.globalAlpha=1}}
  f.j=function(a,b,c,d,e){var g=this.h;null!==g&&g.Rc(Uf,a,this,b,c,d,e)};f.xp=function(a,b,c){var d=this.mb;b.Gv=this;if(a>=d.count)a=d.count;else if(d.ea(a)===b)return-1;d.Md(a,b);b.Kt(c);d=this.h;null!==d&&(c?d.ta():d.xp(b));nk(this,a,b);return a};
  f.Ve=function(a,b,c){if(!c&&b.layer!==this&&null!==b.layer)return b.layer.Ve(a,b,c);var d=this.mb;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.Lt(c);d.dd(a);d=this.h;null!==d&&(c?d.ta():d.Ve(b));b.Gv=null;return a};
  function nk(a,b,c){b=ok(a,b,c);if(c instanceof F&&null!==c&&isNaN(c.Dn)){if(0!==c.Hc.count){for(var d=-1,e=a.mb.o,g=e.length,h=0;h<g;h++){var k=e[h];if(k===c&&(b=h,0<=d))break;if(0>d&&k.Qa===c&&(d=h,0<=b))break}!(0>d)&&d<b&&(e=a.mb,e.dd(b),e.Md(d,c))}c=c.Qa;null!==c&&nk(a,-1,c)}}
  function ok(a,b,c){var d=c.Dn;if(isNaN(d))return b;a=a.mb;var e=a.count;if(1>=e)return b;0>b&&(b=a.indexOf(c));if(0>b)return-1;for(var g=b-1,h=NaN;0<=g;){h=a.ea(g).Dn;if(!isNaN(h))break;g--}for(var k=b+1,l=NaN;k<e;){l=a.ea(k).Dn;if(!isNaN(l))break;k++}if(!isNaN(h)&&h>d)for(;;){if(-1===g||h<=d){g++;if(g===b)break;a.dd(b);a.Md(g,c);return g}for(h=NaN;0<=--g&&(h=a.ea(g).Dn,isNaN(h)););}else if(!isNaN(l)&&l<d)for(;;){if(k===e||l>=d){k--;if(k===b)break;a.dd(b);a.Md(k,c);return k}for(l=NaN;++k<e&&(l=a.ea(k).Dn,
  isNaN(l)););}return b}f.clear=function(){for(var a=this.mb.jc(),b=a.length,c=0;c<b;c++)a[c].Jf(!1),this.Ve(-1,a[c],!1)};z.w(wg,{oi:"parts"},function(){return this.mb.i});z.w(wg,{lL:"partsBackwards"},function(){return this.mb.kn});z.w(wg,{h:"diagram"},function(){return this.Z});
  z.defineProperty(wg,{name:"name"},function(){return this.Ub},function(a){z.g(a,"string",wg,"name");var b=this.Ub;if(b!==a){var c=this.h;if(null!==c)for(""===b&&z.k("Cannot rename default Layer to: "+a),c=c.ln;c.next();)c.value.name===a&&z.k("Layer.name is already present in this diagram: "+a);this.Ub=a;this.j("name",b,a);for(a=this.mb.i;a.next();)a.value.If=this.Ub}});
  z.defineProperty(wg,{opacity:"opacity"},function(){return this.Xc},function(a){var b=this.Xc;b!==a&&(z.g(a,"number",wg,"opacity"),(0>a||1<a)&&z.ka(a,"0 <= value <= 1",wg,"opacity"),this.Xc=a,this.j("opacity",b,a),a=this.h,null!==a&&a.ta())});z.defineProperty(wg,{Nc:"isTemporary"},function(){return this.Xy},function(a){var b=this.Xy;b!==a&&(z.g(a,"boolean",wg,"isTemporary"),this.Xy=a,this.j("isTemporary",b,a))});
  z.defineProperty(wg,{visible:"visible"},function(){return this.xz},function(a){var b=this.xz;if(b!==a){z.g(a,"boolean",wg,"visible");this.xz=a;this.j("visible",b,a);for(b=this.mb.i;b.next();)b.value.xd(a);a=this.h;null!==a&&a.ta()}});z.defineProperty(wg,{jg:"pickable"},function(){return this.nl},function(a){var b=this.nl;b!==a&&(z.g(a,"boolean",wg,"pickable"),this.nl=a,this.j("pickable",b,a))});
  z.defineProperty(wg,{IE:"isBoundsIncluded"},function(){return this.Sy},function(a){this.Sy!==a&&(this.Sy=a,null!==this.h&&this.h.yc())});z.defineProperty(wg,{lk:"allowCopy"},function(){return this.Bk},function(a){var b=this.Bk;b!==a&&(z.g(a,"boolean",wg,"allowCopy"),this.Bk=a,this.j("allowCopy",b,a))});z.defineProperty(wg,{Rm:"allowDelete"},function(){return this.Ck},function(a){var b=this.Ck;b!==a&&(z.g(a,"boolean",wg,"allowDelete"),this.Ck=a,this.j("allowDelete",b,a))});
  z.defineProperty(wg,{Iw:"allowTextEdit"},function(){return this.Lk},function(a){var b=this.Lk;b!==a&&(z.g(a,"boolean",wg,"allowTextEdit"),this.Lk=a,this.j("allowTextEdit",b,a))});z.defineProperty(wg,{Fw:"allowGroup"},function(){return this.Dk},function(a){var b=this.Dk;b!==a&&(z.g(a,"boolean",wg,"allowGroup"),this.Dk=a,this.j("allowGroup",b,a))});
  z.defineProperty(wg,{Jw:"allowUngroup"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(z.g(a,"boolean",wg,"allowUngroup"),this.Mk=a,this.j("allowUngroup",b,a))});z.defineProperty(wg,{lt:"allowLink"},function(){return this.Ek},function(a){var b=this.Ek;b!==a&&(z.g(a,"boolean",wg,"allowLink"),this.Ek=a,this.j("allowLink",b,a))});
  z.defineProperty(wg,{Sm:"allowRelink"},function(){return this.Gk},function(a){var b=this.Gk;b!==a&&(z.g(a,"boolean",wg,"allowRelink"),this.Gk=a,this.j("allowRelink",b,a))});z.defineProperty(wg,{vl:"allowMove"},function(){return this.Fk},function(a){var b=this.Fk;b!==a&&(z.g(a,"boolean",wg,"allowMove"),this.Fk=a,this.j("allowMove",b,a))});
  z.defineProperty(wg,{Gw:"allowReshape"},function(){return this.Hk},function(a){var b=this.Hk;b!==a&&(z.g(a,"boolean",wg,"allowReshape"),this.Hk=a,this.j("allowReshape",b,a))});z.defineProperty(wg,{mt:"allowResize"},function(){return this.Ik},function(a){var b=this.Ik;b!==a&&(z.g(a,"boolean",wg,"allowResize"),this.Ik=a,this.j("allowResize",b,a))});
  z.defineProperty(wg,{Hw:"allowRotate"},function(){return this.Jk},function(a){var b=this.Jk;b!==a&&(z.g(a,"boolean",wg,"allowRotate"),this.Jk=a,this.j("allowRotate",b,a))});z.defineProperty(wg,{xf:"allowSelect"},function(){return this.Kk},function(a){var b=this.Kk;b!==a&&(z.g(a,"boolean",wg,"allowSelect"),this.Kk=a,this.j("allowSelect",b,a))});
  function B(a){function b(){window.document.removeEventListener("DOMContentLoaded",b,!1);pk(c)}1<arguments.length&&z.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");z.kc(this);qk=[];this.Vc=!0;this.sB=new Jg;this.sB.Sc(this);this.Hd=17;this.mr=!1;this.jz="default";var c=this;null!==window.document.body?pk(this):window.document.addEventListener("DOMContentLoaded",b,!1);this.Yb=new J(wg);this.Ob=this.Jb=0;this.Yj=this.Pb=this.gd=this.Fb=null;this.qF();this.po=
  null;this.pF();this.sb=(new N(NaN,NaN)).freeze();this.bc=1;this.xv=(new N(NaN,NaN)).freeze();this.yv=NaN;this.Ov=1E-4;this.Lv=100;this.Jd=new Fa;this.Cw=(new N(NaN,NaN)).freeze();this.ov=(new w(NaN,NaN,NaN,NaN)).freeze();this.jw=(new Db(0,0,0,0)).freeze();this.kw=rk;this.gw=this.cw=null;this.cm=mh;this.On=Pc;this.Yk=mh;this.mo=Pc;this.zv=this.wv=Zb;this.ve=!0;this.gr=!1;this.rg=new K(O);this.Sk=new na(G,w);this.ao=!0;this.uB=250;this.In=-1;this.Su=(new Db(16,16,16,16)).freeze();this.hv=this.Wf=!1;
  this.ho=!0;this.Fi=new Rf;this.Zc=new Rf;this.Qb=new Rf;this.hh=this.ui=null;this.Ss=!1;this.By=this.Cy=null;sk(this);this.Eo=new K(E);this.pl=new K(F);this.yo=new K(G);this.mb=new K(D);this.Dv=!0;this.xw=tk;this.lC=!1;this.zw=Bi;this.xy=this.zy=this.uz=null;this.av="";this.Oq="auto";this.zi=this.Xi=this.Ni=this.Rv=this.Oi=this.Pi=this.Qi=this.yi=this.Di=this.vi=null;this.ez=!1;this.TC={};this.bw=0;this.Uf=[null,null];this.ty=null;this.lq=this.Ay=this.nz=this.$C=this.Wi=!1;this.xC=!0;this.Uy=this.Vd=
  !1;this.ie=null;var d=this;this.EC=function(a){if(a.ha===d.ha&&d.$a){d.$a=!1;try{var b=a.Dc;""===a.rf&&b===Uf&&uk(d,a.object,a.propertyName)}finally{d.$a=!0}}};this.FC=function(a){vk(d,a)};this.xD=!0;this.dh=-2;this.Ai=new na(Object,D);this.Rk=new na(Object,G);this.mm=new na(Object,Array);this.Fo=new na("string",Array);this.SC=new J(wk);this.Hi=!1;this.Ck=this.Bk=this.Hu=this.af=!0;this.Ju=this.Iu=!1;this.Ou=this.Mu=this.Kk=this.Jk=this.Ik=this.Hk=this.Fk=this.Gk=this.Ek=this.Lu=this.Mk=this.Dk=this.Lk=
  !0;this.jm=this.uC=!1;this.Nu=this.Ku=this.uv=this.tv=!0;this.mw=this.iw=16;this.kz=this.hw=!1;this.xs=this.lw=null;this.lz=this.mz=0;this.df=(new Db(5)).freeze();this.pw=(new K(D)).freeze();this.Mv=999999999;this.vv=(new K(D)).freeze();this.Zk=this.hm=this.Jj=!0;this.Wk=this.Ij=!1;this.he=null;this.Qu=!0;this.fh=!1;this.qG=new K(G);this.jC=new K(xk);this.Fd=null;this.KC=1;this.Ny=!1;this.cD=0;this.wD=(new w(NaN,NaN,NaN,NaN)).freeze();this.iv=(new w(NaN,NaN,NaN,NaN)).freeze();this.Yv=new K(yk);zk(this);
  this.Iv=this.qv=this.Sv=this.PB=this.OB=this.QB=this.Pj=this.Uk=this.Ri=null;Ak(this);this.ud=null;this.pv=!1;this.Rn=null;this.gb=new gh;this.gb.initializeStandardTools();this.cb=this.vt=this.gb;this.wb=new ra;this.ha=new V;this.Wi=!0;this.Sb=new yg;this.Wi=!1;this.aC=this.Ey=null;this.jd=1;this.dk=null;this.Xk=new Bk;void 0!==a&&Ck(this,a);this.cl=1;this.om=0;this.zC=new N;this.tD=500;this.Ru=new N;this.Ks=null;this.Vc=this.$k=!1}z.ia("Diagram",B);
  function Ak(a){a.Ri=new na("string",D);var b=new E,c=new qa;c.bind(new $g("text","",ka));b.add(c);a.QB=b;a.Ri.add("",b);b=new E;c=new qa;c.stroke="brown";c.bind(new $g("text","",ka));b.add(c);a.Ri.add("Comment",b);b=new E;b.wk=!1;b.ND=!1;c=new X;c.Hb="Ellipse";c.fill="black";c.stroke=null;c.Aa=(new Ea(3,3)).La();b.add(c);a.Ri.add("LinkLabel",b);a.Uk=new na("string",F);b=new F;b.Kx="GROUPPANEL";b.type=Dk;c=new qa;c.font="bold 12pt sans-serif";c.bind(new $g("text","",ka));b.add(c);c=new I(Ek);c.name=
  "GROUPPANEL";var d=new X;d.Hb="Rectangle";d.fill="rgba(128,128,128,0.2)";d.stroke="black";c.add(d);d=new aj;d.padding=(new Db(5,5,5,5)).La();c.add(d);b.add(c);a.OB=b;a.Uk.add("",b);a.Pj=new na("string",G);b=new G;c=new X;c.Ff=!0;b.add(c);c=new X;c.fq="Standard";c.fill="black";c.stroke=null;c.ub=0;b.add(c);a.PB=b;a.Pj.add("",b);b=new G;c=new X;c.Ff=!0;c.stroke="brown";b.add(c);a.Pj.add("Comment",b);b=new da;b.type=Ek;c=new X;c.fill=null;c.stroke="dodgerblue";c.ub=3;b.add(c);c=new aj;c.margin=(new Db(1.5,
  1.5,1.5,1.5)).La();b.add(c);a.Sv=b;a.qv=b;b=new da;b.type=Ni;c=new X;c.Ff=!0;c.fill=null;c.stroke="dodgerblue";c.ub=3;b.add(c);a.Iv=b}
  function pk(a){var b=z.createElement("p");b.style.width="100%";b.style.height="200px";b.style.boxSizing="content-box";var c=z.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||z.OE||
  (c=11);a.Hd=c;c=z.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.jz=d}
  B.prototype.toString=function(a){void 0===a&&(a=0);var b="";this.id&&(b=this.id);this.El&&this.El.id&&(b=this.El.id);b='Diagram "'+b+'"';if(0>=a)return b;for(var c=this.Yb.i;c.next();)b+="\n  "+c.value.toString(a-1);return b};B.fromDiv=function(a){var b=a;"string"===typeof a&&(b=window.document.getElementById(a));return b instanceof HTMLDivElement&&b.Z instanceof B?b.Z:null};
  z.defineProperty(B,{El:"div"},function(){return this.Pb},function(a){null!==a&&z.l(a,HTMLDivElement,B,"div");if(this.Pb!==a){qk=[];var b=this.Pb;null!==b?(b.Z=void 0,b.innerHTML="",null!==this.Fb&&(this.Fb.removeEventListener("touchstart",this.YF,!1),this.Fb.removeEventListener("touchmove",this.XF,!1),this.Fb.removeEventListener("touchend",this.WF,!1),this.Fb.Ld.Z=null),b=this.gb,null!==b&&(b.Ye.each(function(a){a.cancelWaitAfter()}),b.eg.each(function(a){a.cancelWaitAfter()}),b.fg.each(function(a){a.cancelWaitAfter()})),
  b.cancelWaitAfter(),this.cb.doCancel(),this.gd=this.Fb=null,window.removeEventListener("resize",this.gG,!1),window.removeEventListener("mousemove",this.Kp,!0),window.removeEventListener("mousedown",this.Jp,!0),window.removeEventListener("mouseup",this.Mp,!0),window.removeEventListener("mousewheel",this.Bh,!0),window.removeEventListener("DOMMouseScroll",this.Bh,!0),window.removeEventListener("mouseout",this.Lp,!0)):this.fh=!1;this.Pb=null;if(null!==a){if(b=a.Z)b.El=null;Ck(this,a);this.Sp()}}});
  function Fk(a){var b=a.Fb;b.addEventListener("touchstart",a.YF,!1);b.addEventListener("touchmove",a.XF,!1);b.addEventListener("touchend",a.WF,!1);b.addEventListener("mousemove",a.Kp,!1);b.addEventListener("mousedown",a.Jp,!1);b.addEventListener("mouseup",a.Mp,!1);b.addEventListener("mousewheel",a.Bh,!1);b.addEventListener("DOMMouseScroll",a.Bh,!1);b.addEventListener("mouseout",a.Lp,!1);b.addEventListener("keydown",a.nI,!1);b.addEventListener("keyup",a.oI,!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.gb.qp===Nj&&b.preventDefault()},!1);b.addEventListener("pointerdown",a.OI,!1);b.addEventListener("pointermove",a.RI,!1);b.addEventListener("pointerleave",a.QI,!1);window.addEventListener("resize",a.gG,!1)}B.prototype.computePixelRatio=function(){return null!==this.dk?this.dk:this.uG};B.prototype.doMouseMove=function(){this.cb.doMouseMove()};
  B.prototype.doMouseDown=function(){this.cb.doMouseDown()};B.prototype.doMouseUp=function(){this.cb.doMouseUp()};B.prototype.doMouseWheel=function(){this.cb.doMouseWheel()};B.prototype.doKeyDown=function(){this.cb.doKeyDown()};B.prototype.doKeyUp=function(){this.cb.doKeyUp()};B.prototype.doFocus=function(){this.focus()};B.prototype.focus=B.prototype.focus=function(){this.Fb&&this.Fb.focus()};
  function Uj(a){if(null!==a.Fb){var b=a.Pb;if(0!==b.clientWidth&&0!==b.clientHeight){var c=a.Wk?a.Hd:0,d=a.Ij?a.Hd:0,e=a.jd;a.jd=a.computePixelRatio();a.jd!==e&&(a.gr=!0,a.Ce());if(b.clientWidth!==a.Jb+c||b.clientHeight!==a.Ob+d)a.hm=!0,a.ve=!0,b=a.Sb,null!==b&&b.ox&&a.xl===mh&&b.I(),a.Vd||a.Ce()}}}
  function zk(a){var b=new wg;b.name="Background";a.ft(b);b=new wg;b.name="";a.ft(b);b=new wg;b.name="Foreground";a.ft(b);b=new wg;b.name="Adornment";b.Nc=!0;a.ft(b);b=new wg;b.name="Tool";b.Nc=!0;b.IE=!0;a.ft(b);b=new wg;b.name="Grid";b.xf=!1;b.jg=!1;b.Nc=!0;a.NG(b,a.Gl("Background"))}
  function Gk(a){a.ud=new I(Hk);a.ud.name="GRID";var b=new X;b.Hb="LineH";b.stroke="lightgray";b.ub=.5;b.interval=1;a.ud.add(b);b=new X;b.Hb="LineH";b.stroke="gray";b.ub=.5;b.interval=5;a.ud.add(b);b=new X;b.Hb="LineH";b.stroke="gray";b.ub=1;b.interval=10;a.ud.add(b);b=new X;b.Hb="LineV";b.stroke="lightgray";b.ub=.5;b.interval=1;a.ud.add(b);b=new X;b.Hb="LineV";b.stroke="gray";b.ub=.5;b.interval=5;a.ud.add(b);b=new X;b.Hb="LineV";b.stroke="gray";b.ub=1;b.interval=10;a.ud.add(b);b=new D;b.add(a.ud);
  b.If="Grid";b.Dn=0;b.lx=!1;b.HE=!1;b.jg=!1;b.ux="GRID";a.add(b);a.mb.remove(b);a.ud.visible=!1}B.prototype.wG=function(){this.Z.isEnabled?this.Z.rH(this):Ik(this.Z)};B.prototype.JC=function(a){this.Z.isEnabled?(this.Z.kz=!0,this.Z.mz=a.target.scrollTop,this.Z.lz=a.target.scrollLeft):Ik(this.Z)};
  B.prototype.diagramScroll=B.prototype.rH=function(a){if(this.kz&&null!==this.Fb){this.hw=!0;var b=this.ad,c=this.xb,d=b.width,e=c.width,g=b.height,h=c.height,k=b.right,l=c.right,m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,r=this.scale,s;s=a.scrollLeft;if(this.mr)switch(this.jz){case "negative":s=s+a.scrollWidth-a.clientWidth;break;case "reverse":s=a.scrollWidth-s-a.clientWidth}var t=s;e<d||h<g?(s=z.Tb(this.position.x,this.position.y),this.ye&&this.lz!==t&&(s.x=t/r+p,this.lz=t),this.ze&&this.mz!==
  a.scrollTop&&(s.y=a.scrollTop/r+b,this.mz=a.scrollTop),this.position=s,z.A(s),this.hm=this.hw=!1):(s=z.O(),a.zG&&this.ye&&(p<q&&(this.position=s.n(t+p,this.position.y)),k>l&&(this.position=s.n(-(this.lw.scrollWidth-this.Jb)+t-this.Jb/r+k,this.position.y))),a.AG&&this.ze&&(b<c&&(this.position=s.n(this.position.x,a.scrollTop+b)),m>n&&(this.position=s.n(this.position.x,-(this.lw.scrollHeight-this.Ob)+a.scrollTop-this.Ob/r+m))),z.A(s),Jk(this),this.hm=this.hw=!1,b=this.ad,c=this.xb,k=b.right,l=c.right,
  m=b.bottom,n=c.bottom,p=b.x,q=c.x,b=b.y,c=c.y,e>=d&&p>=q&&k<=l&&(this.xs.style.width="1px"),h>=g&&b>=c&&m<=n&&(this.xs.style.height="1px"))}};B.prototype.computeBounds=B.prototype.sh=function(){0<this.rg.count&&Kk(this);return Lk(this)};
  function Lk(a){if(a.tE.F()){var b=a.tE.copy();b.Dw(a.padding);return b}for(var c=!0,d=a.Yb.o,e=d.length,g=0;g<e;g++){var h=d[g];if(h.visible&&(!h.Nc||h.IE))for(var h=h.mb.o,k=h.length,l=0;l<k;l++){var m=h[l];m.lx&&m.isVisible()&&(m=m.W,m.F()&&(c?(c=!1,b=m.copy()):b.ri(m)))}}c&&(b=new w(0,0,0,0));b.Dw(a.padding);return b}
  B.prototype.computePartsBounds=function(a){var b=null;for(a=a.i;a.next();){var c=a.value;c instanceof G||(c.Bf(),null===b?b=c.W.copy():b.ri(c.W))}return null===b?new w(NaN,NaN,0,0):b};
  function Mk(a,b){if((b||a.fh)&&!a.Vc&&null!==a.Fb&&!a.Va.nf&&a.ad.F()){a.Vc=!0;var c=a.cm;b&&a.Yk!==mh&&(c=a.Yk);var d=c!==mh?Nk(a,c):a.scale,c=a.xb.copy(),e=a.Jb/d,g=a.Ob/d,h=null,k=a.Va;k.wc&&(h=a.sb.copy());a.position.Wa();var l=a.On;b&&!l.cd()&&a.mo.cd()&&(l=a.mo);Ok(a,a.sb,a.ad,e,g,l,b);a.position.freeze();null!==h&&gk(k,h,a.sb);a.scale=d;a.Vc=!1;d=a.xb;d.Mc(c)||a.fu(c,d)}}
  function Nk(a,b){var c=a.wb.Tw;if(null===a.Fb)return c;a.Jj&&Pk(a,a.sh());var d=a.ad;if(!d.F())return c;var e=d.width,d=d.height,g=a.Jb,h=a.Ob,k=g/e,l=h/d;return b===Qk?(e=Math.min(l,k),e>c&&(e=c),e<a.Ah&&(e=a.Ah),e>a.zh&&(e=a.zh),e):b===Rk?(e=l>k?(h-a.Hd)/d:(g-a.Hd)/e,e>c&&(e=c),e<a.Ah&&(e=a.Ah),e>a.zh&&(e=a.zh),e):a.scale}B.prototype.zoomToFit=B.prototype.zoomToFit=function(){this.scale=Nk(this,Qk)};
  B.prototype.zoomToRect=function(a,b){void 0===b&&(b=Qk);var c=a.width,d=a.height;if(!(0===c||0===d||isNaN(c)&&isNaN(d))){var e=1;if(b===Qk||b===Rk)if(isNaN(c))e=this.xb.height*this.scale/d;else if(isNaN(d))e=this.xb.width*this.scale/c;else var e=this.Jb,g=this.Ob,e=b===Rk?g/d>e/c?(g-(this.Ij?this.Hd:0))/d:(e-(this.Wk?this.Hd:0))/c:Math.min(g/d,e/c);this.scale=e;this.position=new N(a.x,a.y)}};z.defineProperty(B,{gA:null},function(){return this.Vc},function(a){this.Vc=a});
  B.prototype.alignDocument=function(a,b){this.Jj&&Pk(this,this.sh());var c=this.ad,d=this.xb;this.position=new N(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 Ok(a,b,c,d,e,g,h){var k=b.x,l=b.y;if(h||a.MA===rk)g.cd()&&(d>c.width&&(k=c.x+(g.x*c.width+g.offsetX)-(g.x*d-g.offsetX)),e>c.height&&(l=c.y+(g.y*c.height+g.offsetY)-(g.y*e-g.offsetY))),g=a.AF,h=d-c.width,d<c.width+g.left+g.right?(k=Math.min(k+d/2,c.right+Math.max(h,g.right)-d/2),k=Math.max(k,c.left-Math.max(h,g.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+g.top+g.bottom?(l=Math.min(l+e/2,c.bottom+Math.max(d,g.bottom)-e/2),l=Math.max(l,c.top-Math.max(d,
  g.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.iF&&(a=a.iF(a,b),b.x=a.x,b.y=a.y)}B.prototype.findPartAt=B.prototype.Bt=function(a,b){var c=b?ii(this,a,function(a){return a.ca},function(a){return a.canSelect()}):ii(this,a,function(a){return a.ca});return c instanceof D?c:null};
  B.prototype.findObjectAt=B.prototype.pe=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);Kk(this);for(var d=this.Yb.kn;d.next();){var e=d.value;if(e.visible&&(e=e.pe(a,b,c),null!==e))return e}return null};function ii(a,b,c,d){void 0===c&&(c=null);void 0===d&&(d=null);Kk(a);for(a=a.Yb.kn;a.next();){var e=a.value;if(e.visible&&!e.Nc&&(e=e.pe(b,c,d),null!==e))return e}return null}
  B.prototype.findObjectsAt=B.prototype.lp=function(a,b,c,d){void 0===b&&(b=null);void 0===c&&(c=null);d instanceof J||d instanceof K||(d=new K(O));Kk(this);for(var e=this.Yb.kn;e.next();){var g=e.value;g.visible&&g.lp(a,b,c,d)}return d};B.prototype.findObjectsIn=B.prototype.pk=function(a,b,c,d,e){void 0===b&&(b=null);void 0===c&&(c=null);void 0===d&&(d=!1);e instanceof J||e instanceof K||(e=new K(O));Kk(this);for(var g=this.Yb.kn;g.next();){var h=g.value;h.visible&&h.pk(a,b,c,d,e)}return e};
  B.prototype.Wz=function(a,b,c,d,e,g){var h=new K(O);Kk(this);for(var k=this.Yb.kn;k.next();){var l=k.value;l.visible&&l.Wz(a,b,c,d,h,e,g)}return h};B.prototype.findObjectsNear=B.prototype.cn=function(a,b,c,d,e,g){void 0===c&&(c=null);void 0===d&&(d=null);void 0===e&&(e=!0);if(!1!==e&&!0!==e){if(e instanceof J||e instanceof K)g=e;e=!0}g instanceof J||g instanceof K||(g=new K(O));Kk(this);for(var h=this.Yb.kn;h.next();){var k=h.value;k.visible&&k.cn(a,b,c,d,e,g)}return g};
  B.prototype.acceptEvent=function(a){var b=this.Zc;this.Zc=this.Qb;this.Qb=b;Sk(this,this,a,b,a instanceof MouseEvent);return b};
  function Sk(a,b,c,d,e){d.h=b;d.event=c;e?Tk(a,c,d):(d.ue=b.Qb.ue,d.ga=b.Qb.ga);a=0;c.ctrlKey&&(a+=1);c.altKey&&(a+=2);c.shiftKey&&(a+=4);c.metaKey&&(a+=8);d.yd=a;d.button=c.button;c.buttons&&(d.buttons=c.buttons);z.sk&&0===c.button&&c.ctrlKey&&(d.button=2);d.Fl=!1;d.up=!1;d.Pe=1;d.Dl=0;d.Gc=!1;d.bubbles=!1;d.timestamp=Date.now();d.Qt=!1;d.Tg=c.target.Z?c.target.Z:null;d.Ge=null}
  function Uk(a,b,c,d,e){d.h=a;Tk(a,c,d);d.yd=0;d.button=0;d.buttons=1;d.Fl=!0;d.up=!1;d.Pe=1;d.Dl=0;d.Gc=!1;d.bubbles=!0;d.event=b;d.timestamp=Date.now();d.Qt=e;d.Tg=b.target.Z?b.target.Z:null;d.Ge=null;a.Fi=d.copy();Lh=null}
  function Vk(a,b,c,d,e){var g=null;d.h=a;null!==c?((g=window.document.elementFromPoint(c.clientX,c.clientY))&&g.Z?g=g.Z:(c=b.changedTouches[0],g=a),d.Tg=g,Tk(a,c,d)):null!==a.Zc?(d.ga=a.Zc.ga,d.ue=a.Zc.ue,d.Tg=a.Zc.Tg):null!==a.Fi&&(d.ga=a.Fi.ga,d.ue=a.Fi.ue,d.Tg=a.Fi.Tg);d.yd=0;d.button=0;d.buttons=1;d.Fl=!1;d.up=!1;d.Pe=1;d.Dl=0;d.Gc=!1;d.bubbles=!1;d.event=b;d.timestamp=Date.now();d.Qt=e;d.Ge=null}
  function ha(a,b,c){if(b.bubbles)return u&&u.DE&&z.trace("NOT handled "+c.type+" "+b.toString()),!0;u&&u.DE&&z.trace("handled "+c.type+" "+a.cb.name+" "+b.toString());void 0!==c.stopPropagation&&c.stopPropagation();(void 0===c.touches||2>c.touches.length)&&c.preventDefault();c.cancelBubble=!0;return!1}
  B.prototype.nI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Qb;Sk(this.Z,this.Z,a,b,!1);b.key=String.fromCharCode(a.which);b.Fl=!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 187!==a.which&&189!==a.which&&48!==a.which&&107!==a.which&&109!==a.which&&61!==a.which&&173!==a.which||!0!==a.ctrlKey?ha(this.Z,b,a):(a.cancelBubble=!0,a.preventDefault(),a.stopPropagation(),!1)};
  B.prototype.oI=function(a){if(!this.Z.isEnabled)return!1;var b=this.Z.Qb;Sk(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";break;case 93:a.preventDefault()}this.Z.doKeyUp();
  return ha(this.Z,b,a)};B.prototype.ko=function(a){var b=this.Fb;if(null===b)return new N(0,0);var c=this.Jb,d=this.Ob,b=b.getBoundingClientRect(),c=a.clientX-c/b.width*b.left;a=a.clientY-d/b.height*b.top;return null!==this.Jd?(a=new N(c,a),tb(a,this.Jd),a):new N(c,a)};
  function Tk(a,b,c){var d=a.Fb,e=a.Jb,g=a.Ob,h=0,k=0;null!==d&&(d=d.getBoundingClientRect(),h=b.clientX-e/d.width*d.left,k=b.clientY-g/d.height*d.top);c.ue.n(h,k);null!==a.Jd?(b=z.Tb(h,k),a.Jd.li(b),c.ga.assign(b),z.A(b)):c.ga.n(h,k)}B.prototype.invalidateDocumentBounds=B.prototype.yc=function(){this.Jj||(this.Jj=!0,this.Ce(!0))};function dk(a){a.Vd||Kk(a);a.Jj&&Pk(a,a.sh())}B.prototype.redraw=B.prototype.Sp=function(){this.Vc||this.Vd||(this.ta(),Wk(this),Jk(this),this.yc(),this.cg())};
  B.prototype.isUpdateRequested=function(){return this.Wf};B.prototype.delayInitialization=function(a){void 0===a&&(a=null);var b=this.Va,c=b.isEnabled;b.pi();b.isEnabled=!1;pi(this);this.fh=!1;b.isEnabled=c;null!==a&&z.setTimeout(a,1)};B.prototype.requestUpdate=B.prototype.Ce=function(a){void 0===a&&(a=!1);if(!0!==this.Wf&&!(this.Vc||!1===a&&this.Vd)){this.Wf=!0;var b=this;requestAnimationFrame(function(){b.Wf&&b.cg()})}};
  B.prototype.maybeUpdate=B.prototype.cg=function(){if(!this.ho||this.Wf)this.ho&&(this.ho=!1),pi(this)};function Xk(a,b){a.Va.nf||a.Vc||!a.hm||Ik(a)||(b&&Kk(a),Mk(a,!1))}
  function pi(a){if(!a.Vd&&(a.Wf=!1,null!==a.Pb)){a.Vd=!0;var b=a.Va,c=a.SC;if(!b.so&&0!==c.length){for(var d=c.o,e=d.length,g=0;g<e;g++){var h=d[g];Yk(h,!1);h.Q()}c.clear()}c=a.jC;0<c.count&&(c.each(function(a){a.dB()}),c.clear());d=c=!1;b.nf&&(d=!0,c=a.Bb,a.Bb=!0);b.wc||Uj(a);Xk(a,!1);null!==a.ud&&(a.ud.visible&&!a.pv&&($k(a),a.pv=!0),!a.ud.visible&&a.pv&&(a.pv=!1));Kk(a);e=!1;if(!a.fh||a.Qu)a.fh?hl(a,!a.hv):(a.Wb("Initial Layout"),!1===b.isEnabled&&b.pi(),hl(a,!1)),e=!0;a.hv=!1;Kk(a);a.nz||b.nf||
  dk(a);Xk(a,!0);e&&(a.fh||il(a),a.Ja("LayoutCompleted"));Kk(a);e&&!a.fh&&(a.fh=!0,a.Kd("Initial Layout"),a.Bb||a.pa.clear(),z.setTimeout(function(){a.ni=!1},1));jl(a);Tj(b);a.ff();d&&(a.Bb=c);a.Vd=!1}}z.w(B,{jn:null},function(){return this.fh});
  function il(a){var b=a.Yb.o;a.Jf(b,b.length,a);a.Yk!==mh?a.scale=Nk(a,a.Yk):a.cm!==mh?a.scale=Nk(a,a.cm):(b=a.ZH,isFinite(b)&&0<b&&(a.scale=b));b=a.YH;if(b.F())a.position=b;else{b=z.O();b.ru(a.ad,a.XH);var c=a.xb,c=z.zk(0,0,c.width,c.height),d=z.O();d.ru(c,a.$H);d.n(b.x-d.x,b.y-d.y);a.position=d;z.dc(c);z.A(d);z.A(b);Wk(a);Xk(a,!0);Mk(a,!0)}a.Ja("InitialLayoutCompleted");$k(a)}
  function Kk(a){if((a.Vd||!a.Va.nf)&&0!==a.rg.count)for(var b=0;23>b;b++){var c=a.rg.i;if(null===c||0===a.rg.count)break;a.rg=new K(O);a.dB(c,a.rg);u&&22===b&&z.trace("failure to validate parts")}}
  B.prototype.dB=function(a,b){for(a.reset();a.next();){var c=a.value;!c.be()||c instanceof F||!c.isVisible()||(c.Ql()?(tj(c,Infinity,Infinity),c.Lc()):b.add(c))}for(a.reset();a.next();)c=a.value,c instanceof F&&c.isVisible()&&kl(this,c);for(a.reset();a.next();)c=a.value,c instanceof G&&c.isVisible()&&(c.Ql()?(tj(c,Infinity,Infinity),c.Lc()):b.add(c));for(a.reset();a.next();)c=a.value,c instanceof da&&c.isVisible()&&(c.Ql()?(tj(c,Infinity,Infinity),c.Lc()):b.add(c))};
  function kl(a,b){for(var c=z.rb(),d=z.rb(),e=b.Hc;e.next();){var g=e.value;g.isVisible()&&(g instanceof F?(ml(g)||nl(g)||ol(g))&&kl(a,g):g instanceof G?g.Y===b||g.da===b?d.push(g):c.push(g):(tj(g,Infinity,Infinity),g.Lc()))}for(var e=c.length,h=0;h<e;h++)g=c[h],tj(g,Infinity,Infinity),g.Lc();z.xa(c);tj(b,Infinity,Infinity);b.Lc();e=d.length;for(h=0;h<e;h++)g=d[h],tj(g,Infinity,Infinity),g.Lc();z.xa(d)}B.prototype.Jf=function(a,b,c,d){var e=this.Va;if(this.Zk||e.nf)for(e=0;e<b;e++)a[e].Jf(c,d)};
  B.prototype.ff=function(a,b){void 0===a&&(a=this.gd);void 0===b&&(b=null);null===this.Pb&&z.k("No div specified");var c=this.Fb;null===c&&z.k("No canvas specified");var d=this.Va;if(!d.wc&&(pl(this),"0"!==this.Pb.style.opacity)){var e=a!==this.gd,g=this.Yb.o,h=g.length,k=this;this.Jf(g,h,k);if(e)ca(a,!0),Jk(this);else if(!this.ve&&null===b&&!d.Kj)return;var h=this.sb,l=this.bc,m=Math.round(h.x*l)/l,n=Math.round(h.y*l)/l,d=this.Jd;d.reset();1!==l&&d.scale(l);0===h.x&&0===h.y||d.translate(-m,-n);l=
  this.jd;z.hn?(c.width=c.width,ca(a,!0),a.scale(l,l)):(a.setTransform(1,0,0,1,0,0),a.scale(l,l),a.clearRect(0,0,this.Jb,this.Ob));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);u&&u.cj&&u.kE(this,a);c=null!==b?function(c){var d=a,e=b;if(c.visible&&0!==c.Xc){var g=c.mb.o,h=g.length;if(0!==h){1!==c.Xc&&(d.globalAlpha=c.Xc);c=c.Xv;c.length=0;for(var l=k.scale,m=0;m<h;m++){var n=g[m];if(ik(n)&&!e.contains(n)){if(n instanceof G){var A=n;A.rc&&c.push(A);if(!1===A.Dg)continue}A=
  n.W;1<A.width*l||1<A.height*l?n.ff(d,k):kk(n,d)}}d.globalAlpha=1}}}:function(b){b.ff(a,k)};ql(this,a);h=g.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(g[m]);this.Xk?this.Xk.Zl(this)&&this.Fy():this.ko=function(){return new N(0,0)};u&&(u.Sz||u.cj)&&u.Rz(a,this,d);e?(ca(this.gd,!0),Jk(this)):this.ve=this.Zk=!1}};
  function rl(a,b,c,d,e){null===a.Pb&&z.k("No div specified");var g=a.Fb;null===g&&z.k("No canvas specified");if(!a.Va.wc){var h=a.gd;if(a.ve){pl(a);var k=a.jd;z.hn?(g.width=g.width,ca(h,!0)):(h.setTransform(1,0,0,1,0,0),h.clearRect(0,0,a.Jb*k,a.Ob*k));h.Jt=!1;h.drawImage(a.Ey.Ld,0<d?0:Math.round(-d),0<e?0:Math.round(-e));e=a.sb;var g=a.bc,l=Math.round(e.x*g)/g,m=Math.round(e.y*g)/g;d=a.Jd;d.reset();1!==g&&d.scale(g);0===e.x&&0===e.y||d.translate(-l,-m);h.save();h.beginPath();e=c.length;for(g=0;g<e;g++)l=
  c[g],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);u&&u.cj&&u.kE(a,h);c=a.Yb.o;e=c.length;a.Jf(c,e,a);ql(a,h);for(g=0;g<e;g++)lk(c[g],h,a,b);h.restore();ca(h,!0);u&&(u.Sz||u.cj)&&u.Rz(h,a,d);a.Xk?a.Xk.Zl(a)&&a.Fy():a.ko=function(){return new N(0,0)};a.Zk=!1;a.ve=!1;a.HA()}}}
  function sl(a,b,c,d,e,g,h,k,l,m){null===a.Pb&&z.k("No div specified");null===a.Fb&&z.k("No canvas specified");void 0===h&&(h=null);void 0===k&&(k=null);void 0===l&&(l=!1);void 0===m&&(m=!1);pl(a);ca(a.gd,!0);Jk(a);a.Uy=!0;var n=new w(g.x,g.y,d.width/e,d.height/e),p=n.copy();p.Dw(c);$k(a,p);Kk(a);var p=a.Yb.o,q=p.length;a.Jf(p,q,a,n);n=a.jd;b.setTransform(1,0,0,1,0,0);b.scale(n,n);b.clearRect(0,0,d.width,d.height);null!==k&&""!==k&&(b.fillStyle=k,b.fillRect(0,0,d.width,d.height));d=z.Hh();d.reset();
  d.translate(c.left,c.top);d.scale(e);0===g.x&&0===g.y||d.translate(-g.x,-g.y);b.setTransform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy);z.jf(d);ql(a,b);if(null!==h){var r=new K(O);c=h.i;for(c.reset();c.next();)e=c.value,!1===m&&"Grid"===e.layer.name||null===e||r.add(e);c=function(c){var d=l;if(c.visible&&0!==c.Xc&&(void 0===d&&(d=!0),d||!c.Nc)){var d=c.mb.o,e=d.length;if(0!==e){1!==c.Xc&&(b.globalAlpha=c.Xc);c=c.Xv;c.length=0;for(var g=a.scale,h=0;h<e;h++){var k=d[h];if(ik(k)&&r.contains(k)){if(k instanceof
  G){var m=k;m.rc&&c.push(m);if(!1===m.Dg)continue}m=k.W;1<m.width*g||1<m.height*g?k.ff(b,a):kk(k,b)}}b.globalAlpha=1}}}}else if(!l&&m){var s=a.tp.ca,t=s.layer;c=function(c){c===t?s.ff(b,a):c.ff(b,a,l,m)}}else c=function(c){c.ff(b,a,l,m)};for(e=0;e<q;e++)c(p[e]);a.Uy=!1;a.Xk?a.Xk.Zl(a)&&a.Fy():a.ko=function(){return new N(0,0)};ca(a.gd,!0);Jk(a);a.Jf(p,q,a);$k(a)}B.prototype.getRenderingHint=B.prototype.ij=function(a){return this.Yj[a]};
  B.prototype.setRenderingHint=B.prototype.jJ=function(a,b){this.Yj[a]=b;this.Sp()};B.prototype.resetRenderingHints=B.prototype.qF=function(){this.Yj=new ma;this.Yj.drawShadows=!0;this.Yj.textGreeking=!0;this.Yj.viewportOptimizations=z.OE?!1:!0;this.Yj.temporaryPixelRatio=!0;this.Yj.pictureRatioOptimization=!0};function ql(a,b){var c=a.Yj;if(null!==c){if(void 0!==c.imageSmoothingEnabled){var d=!!c.imageSmoothingEnabled;b.Jt=d;b.YK=d}c=c.defaultFont;void 0!==c&&null!==c&&(b.font=c)}}
  B.prototype.getInputOption=B.prototype.rp=function(a){return this.po[a]};B.prototype.setInputOption=function(a,b){this.po[a]=b};B.prototype.resetInputOptions=B.prototype.pF=function(){this.po=new ma;this.po.extraTouchArea=10;this.po.extraTouchThreshold=10;this.po.hasGestureZoom=!0};B.prototype.setProperties=function(a){z.qu(this,a)};function jl(a){if(0===a.pa.Ih&&0!==a.Sk.count){for(;0<a.Sk.count;){var b=a.Sk;a.Sk=new na(G,w);for(b=b.i;b.next();){var c=b.key;Ri(c,b.value);c.qe()}}a.ta()}}
  B.prototype.ta=function(a){void 0===a&&(a=null);if(null===a)this.ve=!0,this.Ce();else{var b=this.xb;null!==a&&a.F()&&b.Jg(a)&&(this.ve=!0,this.Ce())}for(b=this.Yv.i;b.next();)b.value.ta(a)};
  B.prototype.GE=function(a,b){if(!0!==this.ve){this.ve=!0;var c=!0===this.ij("temporaryPixelRatio");if(!0===this.ij("viewportOptimizations")&&this.MA!==tl&&this.AF.Xw(0,0,0,0)&&b.width===a.width&&b.height===a.height){var d=this.scale,e=z.lg(),g=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=g;e.y=h;e.width=Math.max(0,k-g)*d;e.height=Math.max(0,l-h)*d;if(0<e.width&&0<e.height){if(!this.Vd&&(this.Wf=!1,null!==this.Pb)){this.Vd=!0;jl(this);
  this.ad.F()||Pk(this,this.sh());var m=this.Fb;if(null!==m){var n=this.jd,h=this.Jb*n,k=this.Ob*n,g=this.scale*n,d=Math.round(Math.round(b.x*g)-Math.round(a.x*g)),g=Math.round(Math.round(b.y*g)-Math.round(a.y*g)),l=this.Ey,p=this.aC;l.width!==h&&(l.width=h);l.height!==k&&(l.height=k);p.clearRect(0,0,h,k);var l=190*this.jd,q=70*this.jd,r=Math.max(d,0),s=Math.max(g,0),t=Math.floor(h-r),v=Math.floor(k-s);p.Jt=!1;p.drawImage(m.Ld,r,s,t,v,0,0,t,v);this.Xk.Zl(this)&&p.clearRect(0,0,l,q);var m=z.rb(),p=z.rb(),
  v=Math.abs(d),t=Math.abs(g),x=0===r?0:h-v,r=z.Tb(x,0),v=z.Tb(v+x,k);p.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));var y=this.Jd;y.reset();y.scale(n,n);1!==this.bc&&y.scale(this.bc);n=this.sb;(0!==n.x||0!==n.y)&&isFinite(n.x)&&isFinite(n.y)&&y.translate(-n.x,-n.y);tb(r,y);tb(v,y);m.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));x=0===s?0:k-t;r.n(0,x);v.n(h,t+x);p.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-
  v.x),Math.abs(r.y-v.y)));tb(r,y);tb(v,y);m.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y)));this.Xk.Zl(this)&&(h=0<d?0:-d,k=0<g?0:-g,r.n(h,k),v.n(l+h,q+k),p.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))),tb(r,y),tb(v,y),m.push(new w(Math.min(r.x,v.x),Math.min(r.y,v.y),Math.abs(r.x-v.x),Math.abs(r.y-v.y))));z.A(r);z.A(v);Xk(this,!1);rl(this,m,p,d,g);z.xa(m);z.xa(p);this.Vd=!1}}}else this.cg();z.dc(e);c&&(this.dk=1,this.cg(),
  this.dk=null,this.HA())}else c?(this.dk=1,this.cg(),this.dk=null,this.HA()):this.cg()}};function Wk(a){!1===a.hm&&(a.hm=!0)}function Jk(a){!1===a.Zk&&(a.Zk=!0)}function pl(a){!1!==a.gr&&(a.gr=!1,ul(a,a.Jb,a.Ob))}function ul(a,b,c){var d=a.Fb,e=a.jd,g=b*e,e=c*e;if(d.width!==g||d.height!==e)d.width=g,d.height=e,d.style.width=b+"px",d.style.height=c+"px",a.ve=!0,ca(a.gd,!0)}function ph(a){var b=a.Jb,c=a.Ob;a=a.Fb.getBoundingClientRect();return z.Tb(b/a.width*a.left,c/a.height*a.top)}
  function Ik(a){var b=a.Fb;if(null===b)return!0;var c=a.Pb,d=a.Jb,e=a.Ob,g=a.wD.copy();if(!g.F())return!0;var h=!1,k=a.Wk?a.Hd:0,l=a.Ij?a.Hd:0,m=c.clientWidth||d+k,c=c.clientHeight||e+l;if(m!==d+k||c!==e+l)a.Wk=!1,a.Ij=!1,l=k=0,a.Jb=m,a.Ob=c,h=a.gr=!0;a.hm=!1;var n=a.xb,p=a.ad,m=p.width,c=p.height,q=n.width,r=n.height,s=p.x,t=n.x,v=p.right,x=n.right+k,y=p.y,A=n.y,p=p.bottom,n=n.bottom+l,C="1px",L="1px",H=a.scale;a.MA===rk&&m<q+k&&c<r+l||(a.cA&&a.ye&&(C=1,s+1<t&&(C=Math.max((t-s)*H+a.Jb,C)),v>x+1&&
  (C=Math.max((v-x)*H+a.Jb,C)),q+k+1<m&&(C=Math.max((m-q+k)*H+a.Jb,C)),C+="px"),a.dA&&a.ze&&(L=1,y+1<A&&(L=Math.max((A-y)*H+a.Ob,L)),p>n+1&&(L=Math.max((p-n)*H+a.Ob,L)),r+l+1<c&&(L=Math.max((c-r+l)*H+a.Ob,L)),L+="px"));k="1px"!==C;l="1px"!==L;k&&l||!k&&!l||(l&&(x-=a.Hd),k&&(n-=a.Hd),a.cA&&a.ye&&(C=1,s+1<t&&(C=Math.max((t-s)*H+a.Jb,C)),v>x+1&&(C=Math.max((v-x)*H+a.Jb,C)),q+1<m&&(C=Math.max((m-q)*H+a.Jb,C)),C+="px"),k="1px"!==C,l=k!==a.Ij?a.Ob-a.Hd:a.Ob,a.dA&&a.ze&&(L=1,y+1<A&&(L=Math.max((A-y)*H+l,L)),
  p>n+1&&(L=Math.max((p-n)*H+l,L)),r+1<c&&(L=Math.max((c-r)*H+l,L)),L+="px"),l="1px"!==L);if(a.hw&&k===a.Ij&&l===a.Wk)return d===a.Jb&&e===a.Ob||a.cg(),!1;k!==a.Ij&&(a.Ob="1px"===C?a.Ob+a.Hd:Math.max(a.Ob-a.Hd,1),h=!0);a.Ij=k;a.xs.style.width=C;l!==a.Wk&&(a.Jb="1px"===L?a.Jb+a.Hd:Math.max(a.Jb-a.Hd,1),h=!0,a.mr&&(k=z.O(),l?(b.style.left=a.Hd+"px",a.position=k.n(a.sb.x+a.Hd/a.scale,a.sb.y)):(b.style.left="0px",a.position=k.n(a.sb.x-a.Hd/a.scale,a.sb.y)),z.A(k)));a.Wk=l;a.xs.style.height=L;b=a.lw;k=b.scrollLeft;
  a.cA&&a.ye&&(q+1<m?k=(a.position.x-s)*H:s+1<t?k=b.scrollWidth-b.clientWidth:v>x+1&&(k=a.position.x*H));if(a.mr)switch(a.jz){case "negative":k=-(b.scrollWidth-k-b.clientWidth);break;case "reverse":k=b.scrollWidth-k-b.clientWidth}b.scrollLeft=k;a.dA&&a.ze&&(r+1<c?b.scrollTop=(a.position.y-y)*H:y+1<A?b.scrollTop=b.scrollHeight-b.clientHeight:p>n+1&&(b.scrollTop=a.position.y*H));h&&(a.gr=!0);m=a.Jb;c=a.Ob;b.style.width=m+(a.Wk?a.Hd:0)+"px";b.style.height=c+(a.Ij?a.Hd:0)+"px";a.kz=!1;return d!==m||e!==
  c||a.Va.wc?(n=a.xb,a.fu(g,n,h),!1):!0}
  B.prototype.add=B.prototype.add=function(a){z.l(a,D,B,"add:part");var b=a.h;if(b!==this){null!==b&&z.k("Cannot add part "+a.toString()+" to "+this.toString()+". It is already a part of "+b.toString());this.lq&&(a.dl="Tool");var c=a.If,b=this.Gl(c);null===b&&(b=this.Gl(""));null===b&&z.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.h===this),0<=c&&this.Rc(Wf,"parts",b,null,a,null,c),b.Nc||this.yc(),a.I(vl),c=a.Ut,null!==
  c&&c(a,null,b))}};
  B.prototype.xp=function(a){if(a instanceof E){if(this.Eo.add(a),a instanceof F){var b=a.Qa;null===b?this.pl.add(a):b.vm.add(a);b=a.Sb;null!==b&&(b.h=this)}}else a instanceof G?this.yo.add(a):a instanceof da||this.mb.add(a);var c=this;wl(a,function(a){xl(c,a)});a.Lb&&a.Q();b=a.data;null!==b&&(a instanceof da||(a instanceof G?this.Rk.add(b,a):this.Ai.add(b,a)),wl(a,function(a){yl(c,a)}));!0!==nl(a)&&!0!==ol(a)||this.rg.add(a);zl(a,!0,this);Al(a)?(a.W.F()&&this.ta(mk(a,a.W)),this.yc()):a.isVisible()&&
  a.W.F()&&this.ta(mk(a,a.W));this.Ce()};
  B.prototype.Ve=function(a){a.pt();if(a instanceof E){if(this.Eo.remove(a),a instanceof F){var b=a.Qa;null===b?this.pl.remove(a):b.vm.remove(a);b=a.Sb;null!==b&&(b.h=null)}}else a instanceof G?this.yo.remove(a):a instanceof da||this.mb.remove(a);var c=this;wl(a,function(a){Bl(c,a)});b=a.data;null!==b&&(a instanceof da||(a instanceof G?this.Rk.remove(b):this.Ai.remove(b)),wl(a,function(a){Cl(c,a)}));this.rg.remove(a);Al(a)?(a.W.F()&&this.ta(mk(a,a.W)),this.yc()):a.isVisible()&&a.W.F()&&this.ta(mk(a,
  a.W));this.Ce()};B.prototype.remove=B.prototype.remove=function(a){z.l(a,D,B,"remove:part");a.jb=!1;a.yh=!1;var b=a.layer;if(null!==b&&b.h===this){a.I(Dl);a.bn();var c=b.Ve(-1,a,!1);0<=c&&this.Rc(Xf,"parts",b,a,null,c,null);c=a.Ut;null!==c&&c(a,b,null)}};B.prototype.removeParts=B.prototype.JA=function(a,b){if(z.isArray(a))for(var c=z.ab(a),d=0;d<c;d++){var e=z.Ya(a,d);b&&!e.canDelete()||this.remove(e)}else for(e=new K(D),e.$c(a),c=e.i;c.next();)e=c.value,b&&!e.canDelete()||this.remove(e)};
  B.prototype.copyParts=B.prototype.gp=function(a,b,c){return this.wb.gp(a,b,c)};B.prototype.moveParts=B.prototype.moveParts=function(a,b,c){z.l(b,N,B,"moveParts:offset");var d=this.gb;if(null!==d){d=d.me;null===d&&(d=new lh,d.Sc(this));var e=new na(D,Object);if(null!==a)a=a.i;else{for(a=this.oi;a.next();)Oh(d,e,a.value,c);for(a=this.Mg;a.next();)Oh(d,e,a.value,c);a=this.links}for(;a.next();)Oh(d,e,a.value,c);d.moveParts(e,b,c)}};
  function El(a,b,c){z.l(b,wg,B,"addLayer:layer");null!==b.h&&b.h!==a&&z.k("Cannot share a Layer with another Diagram: "+b+" of "+b.h);null===c?null!==b.h&&z.k("Cannot add an existing Layer to this Diagram again: "+b):(z.l(c,wg,B,"addLayer:existingLayer"),c.h!==a&&z.k("Existing Layer must be in this Diagram: "+c+" not in "+c.h),b===c&&z.k("Cannot move a Layer before or after itself: "+b));if(b.h!==a){b=b.name;a=a.Yb;c=a.count;for(var d=0;d<c;d++)a.ea(d).name===b&&z.k("Cannot add Layer with the name '"+
  b+"'; a Layer with the same name is already present in this Diagram.")}}B.prototype.addLayer=B.prototype.ft=function(a){El(this,a,null);a.Sc(this);var b=this.Yb,c=b.count-1;if(!a.Nc)for(;0<=c&&b.ea(c).Nc;)c--;b.Md(c+1,a);null!==this.ie&&this.Rc(Wf,"layers",this,null,a,null,c+1);this.ta();this.yc()};
  B.prototype.addLayerBefore=B.prototype.NG=function(a,b){El(this,a,b);a.Sc(this);var c=this.Yb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ie&&this.Rc(Xf,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.ea(g)===b){c.Md(g,a);break}null!==this.ie&&this.Rc(Wf,"layers",this,null,a,null,g);this.ta();0>d&&this.yc()};
  B.prototype.addLayerAfter=function(a,b){El(this,a,b);a.Sc(this);var c=this.Yb,d=c.indexOf(a);0<=d&&(c.remove(a),null!==this.ie&&this.Rc(Xf,"layers",this,a,null,d,null));for(var e=c.count,g=0;g<e;g++)if(c.ea(g)===b){c.Md(g+1,a);break}null!==this.ie&&this.Rc(Wf,"layers",this,null,a,null,g+1);this.ta();0>d&&this.yc()};
  B.prototype.removeLayer=function(a){z.l(a,wg,B,"removeLayer:layer");a.h!==this&&z.k("Cannot remove a Layer from another Diagram: "+a+" of "+a.h);if(""!==a.name){var b=this.Yb,c=b.indexOf(a);if(b.remove(a)){for(b=a.mb.copy().i;b.next();){var d=b.value,e=d.If;d.If=e!==a.name?e:""}null!==this.ie&&this.Rc(Xf,"layers",this,a,null,c,null);this.ta();this.yc()}}};B.prototype.findLayer=B.prototype.Gl=function(a){for(var b=this.ln;b.next();){var c=b.value;if(c.name===a)return c}return null};
  B.prototype.addModelChangedListener=B.prototype.PG=function(a){z.g(a,"function",B,"addModelChangedListener:listener");null===this.hh&&(this.hh=new J("function"));this.hh.add(a);this.ha.Qm(a)};B.prototype.removeModelChangedListener=function(a){z.g(a,"function",B,"removeModelChangedListener:listener");null!==this.hh&&(this.hh.remove(a),0===this.hh.count&&(this.hh=null));this.ha.iu(a)};
  B.prototype.addChangedListener=B.prototype.Qm=function(a){z.g(a,"function",B,"addChangedListener:listener");null===this.ui&&(this.ui=new J("function"));this.ui.add(a)};B.prototype.removeChangedListener=B.prototype.iu=function(a){z.g(a,"function",B,"removeChangedListener:listener");null!==this.ui&&(this.ui.remove(a),0===this.ui.count&&(this.ui=null))};
  B.prototype.Lw=function(a){this.Bb||this.pa.CE(a);a.Dc!==Vf&&(this.ni=!0);if(null!==this.ui){var b=this.ui,c=b.length;if(1===c)b=b.ea(0),b(a);else if(0!==c)for(var d=b.jc(),e=0;e<c;e++)b=d[e],b(a)}};B.prototype.raiseChangedEvent=B.prototype.Rc=function(a,b,c,d,e,g,h){void 0===g&&(g=null);void 0===h&&(h=null);var k=new Tf;k.h=this;k.Dc=a;k.propertyName=b;k.object=c;k.oldValue=d;k.Ng=g;k.newValue=e;k.Lg=h;this.Lw(k)};
  B.prototype.raiseChanged=B.prototype.j=function(a,b,c,d,e){this.Rc(Uf,a,this,b,c,d,e)};z.w(B,{Va:"animationManager"},function(){return this.sB});z.w(B,{pa:"undoManager"},function(){return this.ie.pa});z.defineProperty(B,{Bb:"skipsUndoManager"},function(){return this.Wi},function(a){z.g(a,"boolean",B,"skipsUndoManager");this.Wi=a;this.ie.Wi=a});z.defineProperty(B,{Pz:"delaysLayout"},function(){return this.Ay},function(a){this.Ay=a});
  B.prototype.Um=function(a,b){if(null!==a&&a.h===this){var c=this.Ee;try{this.Ee=!0;var d=a.Dc,e;if(d===Uf){var g=a.object,h=a.propertyName,k=a.na(b);z.Sa(g,h,k);if(g instanceof O){var l,m=g.ca;null!==m&&m.ae()}this.ni=!0}else if(d===Wf){var n=a.object,p=a.Lg,g=a.newValue;if(n instanceof I)if("number"===typeof p&&g instanceof O){l=g;var q=n;b?q.Ve(p):q.Md(p,l);m=n.ca;null!==m&&m.ae()}else{if("number"===typeof p&&g instanceof Ig){var r=g,q=n;b?r.re?q.oF(p):q.kF(p):(e=r.re?q.$d(r.index):q.Zd(r.index),
  e.tt(r))}}else if(n instanceof wg){var s=!0===a.Ng;if("number"===typeof p&&g instanceof D){var m=g,t=n;b?(m.ae(),t.Ve(s?p:-1,m,s)):t.xp(p,m,s)}}else if(n instanceof B){if("number"===typeof p&&g instanceof wg){var v=g;b?this.Yb.dd(p):(d=v,d.Sc(this),this.Yb.Md(p,d))}}else z.k("unknown ChangedEvent.Insert object: "+a.toString());this.ni=!0}else d===Xf?(n=a.object,p=a.Ng,g=a.oldValue,n instanceof I?"number"===typeof p&&g instanceof O?(q=n,b?q.Md(p,g):q.Ve(p)):"number"===typeof p&&g instanceof Ig&&(r=
  g,q=n,b?(e=r.re?q.$d(r.index):q.Zd(r.index),e.tt(r)):r.re?q.oF(p):q.kF(p)):n instanceof wg?(s=!0===a.Lg,"number"===typeof p&&g instanceof D&&(m=g,t=n,b?t.xp(p,m,s):(m.ae(),t.Ve(s?p:-1,m,s)))):n instanceof B?"number"===typeof p&&g instanceof wg&&(v=g,b?(d=v,d.Sc(this),this.Yb.Md(p,d)):this.Yb.dd(p)):z.k("unknown ChangedEvent.Remove object: "+a.toString()),this.ni=!0):d!==Vf&&z.k("unknown ChangedEvent: "+a.toString())}finally{this.Ee=c}}};B.prototype.startTransaction=B.prototype.Wb=function(a){return this.pa.Wb(a)};
  B.prototype.commitTransaction=B.prototype.Kd=function(a){return this.pa.Kd(a)};B.prototype.rollbackTransaction=B.prototype.Vp=function(){return this.pa.Vp()};B.prototype.updateAllTargetBindings=B.prototype.dG=function(a){void 0===a&&(a="");for(var b=this.oi;b.next();)b.value.Mb(a);for(b=this.Mg;b.next();)b.value.Mb(a);for(b=this.links;b.next();)b.value.Mb(a)};
  B.prototype.updateAllRelationshipsFromData=B.prototype.AJ=function(){if(0<arguments.length){for(var a=this.ha,b=new K,c=a.hg,d=0;d<c.length;d++){var e=c[d];b.add(e)}var g=[];this.Mg.each(function(a){null===a.data||b.contains(a.data)||g.push(a.data)});this.oi.each(function(a){null===a.data||b.contains(a.data)||g.push(a.data)});g.forEach(function(b){Dg(a,b,!1)});for(d=0;d<c.length;d++){var e=c[d],h=this.vh(e);null===h&&Cg(a,e,!1)}if(a instanceof V){for(var k=new K,c=a.Kg,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){Zg(a,b,!1)});for(d=0;d<c.length;d++)e=c[d],h=this.$f(e),null===h&&Mg(a,e,!1)}}for(d=this.oi;d.next();)h=d.value,h.updateRelationshipsFromData();for(d=this.Mg;d.next();)d.value.updateRelationshipsFromData();for(d=this.links;d.next();)h=d.value,h.updateRelationshipsFromData()};
  function Fl(a,b,c){if(a.Vc||a.Vd)a.bc=c,c=a.Va,c.wc&&hk(c,b,a.bc);else if(a.Vc=!0,null===a.Fb)a.bc=c;else{var d=a.xb.copy(),e=a.Jb,g=a.Ob;d.width=a.Jb/b;d.height=a.Ob/b;var h=a.$l.x,k=a.$l.y,l=a.WD;isNaN(h)&&(l.lj()?l.vp(qc)?h=0:l.vp(sc)&&(h=e-1):h=l.cd()?l.x*(e-1):e/2);isNaN(k)&&(l.lj()?l.vp(pc)?k=0:l.vp(tc)&&(k=g-1):k=l.cd()?l.y*(g-1):g/2);null!==a.zF&&(c=a.zF(a,c));c<a.Ah&&(c=a.Ah);c>a.zh&&(c=a.zh);e=z.Tb(a.sb.x+h/b-h/c,a.sb.y+k/b-k/c);a.position=e;z.A(e);a.bc=c;a.fu(d,a.xb);a.Vc=!1;Mk(a,!1);c=
  a.Va;c.wc&&hk(c,b,a.bc);a.ta();Wk(a)}}B.prototype.fu=function(a,b,c){if(!a.N(b)){void 0===c&&(c=!1);c||Wk(this);Jk(this);var d=this.Sb;null===d||!d.ox||this.xl!==mh||c||a.width===b.width&&a.height===b.height||d.I();d=this.cb;!0===this.jm&&d instanceof gh&&(this.R.ga=this.bG(this.R.ue),Pj(d,this));this.Vc||this.GE(a,b);$k(this);this.Ja("ViewportBoundsChanged",c?z.yj:null,a)}};
  function $k(a,b){void 0===b&&(b=null);var c=a.ud;if(null!==c&&c.visible){for(var d=z.Xl(),e=1,g=1,h=c.va.o,k=h.length,l=0;l<k;l++){var m=h[l],n=m.interval;2>n||(Gl(m.Hb)?g=g*n/ff(g,n):e=e*n/ff(e,n))}h=c.gx;d.n(g*h.width,e*h.height);h=g=l=k=0;if(null!==b)k=b.width,l=b.height,g=b.x,h=b.y;else{e=z.lg();g=a.xb;e.n(g.x,g.y,g.width,g.height);for(h=a.Yv.i;h.next();)g=h.value.xb,g.F()&&Hb(e,g.x,g.y,g.width,g.height);if(!e.F()){z.dc(e);return}k=e.width;l=e.height;g=e.x;h=e.y;z.dc(e)}c.width=k+2*d.width;c.height=
  l+2*d.height;e=z.O();jb(g,h,0,0,d.width,d.height,e);e.offset(-d.width,-d.height);z.qk(d);c.ca.location=e;z.A(e)}}B.prototype.clearSelection=B.prototype.Nw=function(){var a=0<this.selection.count;a&&this.Ja("ChangingSelection");kh(this);a&&this.Ja("ChangedSelection")};function kh(a){a=a.selection;if(0<a.count){for(var b=a.jc(),c=b.length,d=0;d<c;d++)b[d].jb=!1;a.Wa();a.clear();a.freeze()}}
  B.prototype.select=B.prototype.select=function(a){null!==a&&(z.l(a,D,B,"select:part"),a.layer.h===this&&(!a.jb||1<this.selection.count)&&(this.Ja("ChangingSelection"),kh(this),a.jb=!0,this.Ja("ChangedSelection")))};
  B.prototype.selectCollection=B.prototype.EF=function(a){this.Ja("ChangingSelection");kh(this);if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++){var d=z.Ya(a,c);d instanceof D||z.k("Diagram.selectCollection given something that is not a Part: "+d);d.jb=!0}else for(a=a.i;a.next();)d=a.value,d instanceof D||z.k("Diagram.selectCollection given something that is not a Part: "+d),d.jb=!0;this.Ja("ChangedSelection")};
  B.prototype.clearHighlighteds=B.prototype.PD=function(){var a=this.gn;if(0<a.count){for(var b=a.jc(),c=b.length,d=0;d<c;d++)b[d].yh=!1;a.Wa();a.clear();a.freeze()}};B.prototype.highlight=function(a){null!==a&&a.layer.h===this&&(z.l(a,D,B,"highlight:part"),!a.yh||1<this.gn.count)&&(this.PD(),a.yh=!0)};
  B.prototype.highlightCollection=function(a){this.PD();if(z.isArray(a))for(var b=z.ab(a),c=0;c<b;c++){var d=z.Ya(a,c);d instanceof D||z.k("Diagram.highlightCollection given something that is not a Part: "+d);d.yh=!0}else for(a=a.i;a.next();)d=a.value,d instanceof D||z.k("Diagram.highlightCollection given something that is not a Part: "+d),d.yh=!0};
  B.prototype.scroll=B.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.ou:this.nu);else if("page"===a)a=d?this.xb.height:this.xb.width,a*=this.scale,0!==a&&(e=Math.max(a-(d?this.ou:this.nu),0),e*=c);else{if("document"===a){e=this.ad;d=this.xb;c=z.O();"up"===b?this.position=c.n(d.x,e.y):"left"===b?this.position=c.n(e.x,d.y):"down"===b?this.position=c.n(d.x,e.bottom-d.height):"right"===b&&(this.position=c.n(e.right-d.width,
  d.y));z.A(c);return}z.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:z.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: "+b);this.position=c};B.prototype.scrollToRect=B.prototype.eJ=function(a){var b=this.xb;b.nk(a)||(a=a.yl,a.x-=b.width/2,a.y-=b.height/2,this.position=a)};
  B.prototype.centerRect=B.prototype.XG=function(a){var b=this.xb;a=a.yl;a.x-=b.width/2;a.y-=b.height/2;this.position=a};B.prototype.transformDocToView=B.prototype.aB=function(a){var b=this.Jd;b.reset();1!==this.bc&&b.scale(this.bc);var c=this.sb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return a.copy().transform(this.Jd)};
  B.prototype.transformViewToDoc=B.prototype.bG=function(a){var b=this.Jd;b.reset();1!==this.bc&&b.scale(this.bc);var c=this.sb;(0!==c.x||0!==c.y)&&isFinite(c.x)&&isFinite(c.y)&&b.translate(-c.x,-c.y);return tb(a.copy(),this.Jd)};var mh;B.None=mh=z.s(B,"None",0);var Qk;B.Uniform=Qk=z.s(B,"Uniform",1);var Rk;B.UniformToFill=Rk=z.s(B,"UniformToFill",2);var Bi;B.CycleAll=Bi=z.s(B,"CycleAll",10);var Fi;B.CycleNotDirected=Fi=z.s(B,"CycleNotDirected",11);var Hi;
  B.CycleNotDirectedFast=Hi=z.s(B,"CycleNotDirectedFast",12);var Ii;B.CycleNotUndirected=Ii=z.s(B,"CycleNotUndirected",13);var Ci;B.CycleDestinationTree=Ci=z.s(B,"CycleDestinationTree",14);var Ei;B.CycleSourceTree=Ei=z.s(B,"CycleSourceTree",15);var rk;B.DocumentScroll=rk=z.s(B,"DocumentScroll",1);var tl;B.InfiniteScroll=tl=z.s(B,"InfiniteScroll",2);var tk;B.TreeParentCollapsed=tk=z.s(B,"TreeParentCollapsed",1);B.AllParentsCollapsed=z.s(B,"AllParentsCollapsed",2);
  z.defineProperty(B,{BJ:"validCycle"},function(){return this.zw},function(a){var b=this.zw;b!==a&&(z.Ba(a,B,B,"validCycle"),this.zw=a,this.j("validCycle",b,a))});z.w(B,{ln:"layers"},function(){return this.Yb.i});z.defineProperty(B,{Ef:"isModelReadOnly"},function(){var a=this.ie;return null===a?!1:a.ib},function(a){var b=this.ie;null!==b&&(b.ib=a)});
  z.defineProperty(B,{ib:"isReadOnly"},function(){return this.Hi},function(a){var b=this.Hi;b!==a&&(z.g(a,"boolean",B,"isReadOnly"),this.Hi=a,this.j("isReadOnly",b,a))});z.defineProperty(B,{isEnabled:"isEnabled"},function(){return this.af},function(a){var b=this.af;b!==a&&(z.g(a,"boolean",B,"isEnabled"),this.af=a,this.j("isEnabled",b,a))});
  z.defineProperty(B,{Cz:"allowClipboard"},function(){return this.Hu},function(a){var b=this.Hu;b!==a&&(z.g(a,"boolean",B,"allowClipboard"),this.Hu=a,this.j("allowClipboard",b,a))});z.defineProperty(B,{lk:"allowCopy"},function(){return this.Bk},function(a){var b=this.Bk;b!==a&&(z.g(a,"boolean",B,"allowCopy"),this.Bk=a,this.j("allowCopy",b,a))});
  z.defineProperty(B,{Rm:"allowDelete"},function(){return this.Ck},function(a){var b=this.Ck;b!==a&&(z.g(a,"boolean",B,"allowDelete"),this.Ck=a,this.j("allowDelete",b,a))});z.defineProperty(B,{kt:"allowDragOut"},function(){return this.Iu},function(a){var b=this.Iu;b!==a&&(z.g(a,"boolean",B,"allowDragOut"),this.Iu=a,this.j("allowDragOut",b,a))});
  z.defineProperty(B,{FD:"allowDrop"},function(){return this.Ju},function(a){var b=this.Ju;b!==a&&(z.g(a,"boolean",B,"allowDrop"),this.Ju=a,this.j("allowDrop",b,a))});z.defineProperty(B,{Iw:"allowTextEdit"},function(){return this.Lk},function(a){var b=this.Lk;b!==a&&(z.g(a,"boolean",B,"allowTextEdit"),this.Lk=a,this.j("allowTextEdit",b,a))});
  z.defineProperty(B,{Fw:"allowGroup"},function(){return this.Dk},function(a){var b=this.Dk;b!==a&&(z.g(a,"boolean",B,"allowGroup"),this.Dk=a,this.j("allowGroup",b,a))});z.defineProperty(B,{Jw:"allowUngroup"},function(){return this.Mk},function(a){var b=this.Mk;b!==a&&(z.g(a,"boolean",B,"allowUngroup"),this.Mk=a,this.j("allowUngroup",b,a))});
  z.defineProperty(B,{$o:"allowInsert"},function(){return this.Lu},function(a){var b=this.Lu;b!==a&&(z.g(a,"boolean",B,"allowInsert"),this.Lu=a,this.j("allowInsert",b,a))});z.defineProperty(B,{lt:"allowLink"},function(){return this.Ek},function(a){var b=this.Ek;b!==a&&(z.g(a,"boolean",B,"allowLink"),this.Ek=a,this.j("allowLink",b,a))});
  z.defineProperty(B,{Sm:"allowRelink"},function(){return this.Gk},function(a){var b=this.Gk;b!==a&&(z.g(a,"boolean",B,"allowRelink"),this.Gk=a,this.j("allowRelink",b,a))});z.defineProperty(B,{vl:"allowMove"},function(){return this.Fk},function(a){var b=this.Fk;b!==a&&(z.g(a,"boolean",B,"allowMove"),this.Fk=a,this.j("allowMove",b,a))});
  z.defineProperty(B,{Gw:"allowReshape"},function(){return this.Hk},function(a){var b=this.Hk;b!==a&&(z.g(a,"boolean",B,"allowReshape"),this.Hk=a,this.j("allowReshape",b,a))});z.defineProperty(B,{mt:"allowResize"},function(){return this.Ik},function(a){var b=this.Ik;b!==a&&(z.g(a,"boolean",B,"allowResize"),this.Ik=a,this.j("allowResize",b,a))});
  z.defineProperty(B,{Hw:"allowRotate"},function(){return this.Jk},function(a){var b=this.Jk;b!==a&&(z.g(a,"boolean",B,"allowRotate"),this.Jk=a,this.j("allowRotate",b,a))});z.defineProperty(B,{xf:"allowSelect"},function(){return this.Kk},function(a){var b=this.Kk;b!==a&&(z.g(a,"boolean",B,"allowSelect"),this.Kk=a,this.j("allowSelect",b,a))});
  z.defineProperty(B,{GD:"allowUndo"},function(){return this.Mu},function(a){var b=this.Mu;b!==a&&(z.g(a,"boolean",B,"allowUndo"),this.Mu=a,this.j("allowUndo",b,a))});z.defineProperty(B,{Kw:"allowZoom"},function(){return this.Ou},function(a){var b=this.Ou;b!==a&&(z.g(a,"boolean",B,"allowZoom"),this.Ou=a,this.j("allowZoom",b,a))});
  z.defineProperty(B,{dA:"hasVerticalScrollbar"},function(){return this.uv},function(a){var b=this.uv;b!==a&&(z.g(a,"boolean",B,"hasVerticalScrollbar"),this.uv=a,Wk(this),this.ta(),this.j("hasVerticalScrollbar",b,a),Mk(this,!1))});z.defineProperty(B,{cA:"hasHorizontalScrollbar"},function(){return this.tv},function(a){var b=this.tv;b!==a&&(z.g(a,"boolean",B,"hasHorizontalScrollbar"),this.tv=a,Wk(this),this.ta(),this.j("hasHorizontalScrollbar",b,a),Mk(this,!1))});
  z.defineProperty(B,{ye:"allowHorizontalScroll"},function(){return this.Ku},function(a){var b=this.Ku;b!==a&&(z.g(a,"boolean",B,"allowHorizontalScroll"),this.Ku=a,this.j("allowHorizontalScroll",b,a),Mk(this,!1))});z.defineProperty(B,{ze:"allowVerticalScroll"},function(){return this.Nu},function(a){var b=this.Nu;b!==a&&(z.g(a,"boolean",B,"allowVerticalScroll"),this.Nu=a,this.j("allowVerticalScroll",b,a),Mk(this,!1))});
  z.defineProperty(B,{nu:"scrollHorizontalLineChange"},function(){return this.iw},function(a){var b=this.iw;b!==a&&(z.g(a,"number",B,"scrollHorizontalLineChange"),0>a&&z.ka(a,">= 0",B,"scrollHorizontalLineChange"),this.iw=a,this.j("scrollHorizontalLineChange",b,a))});
  z.defineProperty(B,{ou:"scrollVerticalLineChange"},function(){return this.mw},function(a){var b=this.mw;b!==a&&(z.g(a,"number",B,"scrollVerticalLineChange"),0>a&&z.ka(a,">= 0",B,"scrollVerticalLineChange"),this.mw=a,this.j("scrollVerticalLineChange",b,a))});z.defineProperty(B,{R:"lastInput"},function(){return this.Qb},function(a){u&&z.l(a,Rf,B,"lastInput");this.Qb=a});z.defineProperty(B,{Fc:"firstInput"},function(){return this.Fi},function(a){u&&z.l(a,Rf,B,"firstInput");this.Fi=a});
  z.defineProperty(B,{gc:"currentCursor"},function(){return this.av},function(a){""===a&&(a=this.Oq);this.av!==a&&(z.g(a,"string",B,"currentCursor"),null!==this.Fb&&(this.av=a,this.Fb.style.cursor=a,this.Pb.style.cursor=a))});z.defineProperty(B,{kK:"defaultCursor"},function(){return this.Oq},function(a){""===a&&(a="auto");var b=this.Oq;b!==a&&(z.g(a,"string",B,"defaultCursor"),this.Oq=a,this.j("defaultCursor",b,a))});
  z.defineProperty(B,{click:"click"},function(){return this.vi},function(a){var b=this.vi;b!==a&&(null!==a&&z.g(a,"function",B,"click"),this.vi=a,this.j("click",b,a))});z.defineProperty(B,{wt:"doubleClick"},function(){return this.Di},function(a){var b=this.Di;b!==a&&(null!==a&&z.g(a,"function",B,"doubleClick"),this.Di=a,this.j("doubleClick",b,a))});
  z.defineProperty(B,{Iz:"contextClick"},function(){return this.yi},function(a){var b=this.yi;b!==a&&(null!==a&&z.g(a,"function",B,"contextClick"),this.yi=a,this.j("contextClick",b,a))});z.defineProperty(B,{uA:"mouseOver"},function(){return this.Qi},function(a){var b=this.Qi;b!==a&&(null!==a&&z.g(a,"function",B,"mouseOver"),this.Qi=a,this.j("mouseOver",b,a))});
  z.defineProperty(B,{tA:"mouseHover"},function(){return this.Pi},function(a){var b=this.Pi;b!==a&&(null!==a&&z.g(a,"function",B,"mouseHover"),this.Pi=a,this.j("mouseHover",b,a))});z.defineProperty(B,{sA:"mouseHold"},function(){return this.Oi},function(a){var b=this.Oi;b!==a&&(null!==a&&z.g(a,"function",B,"mouseHold"),this.Oi=a,this.j("mouseHold",b,a))});
  z.defineProperty(B,{JI:"mouseDragOver"},function(){return this.Rv},function(a){var b=this.Rv;b!==a&&(null!==a&&z.g(a,"function",B,"mouseDragOver"),this.Rv=a,this.j("mouseDragOver",b,a))});z.defineProperty(B,{rA:"mouseDrop"},function(){return this.Ni},function(a){var b=this.Ni;b!==a&&(null!==a&&z.g(a,"function",B,"mouseDrop"),this.Ni=a,this.j("mouseDrop",b,a))});
  z.defineProperty(B,{$A:"toolTip"},function(){return this.Xi},function(a){var b=this.Xi;b!==a&&(null!==a&&z.l(a,da,B,"toolTip"),this.Xi=a,this.j("toolTip",b,a))});z.defineProperty(B,{contextMenu:"contextMenu"},function(){return this.zi},function(a){var b=this.zi;b!==a&&(null!==a&&z.l(a,da,B,"contextMenu"),this.zi=a,this.j("contextMenu",b,a))});
  z.defineProperty(B,{wb:"commandHandler"},function(){return this.ty},function(a){var b=this.ty;b!==a&&(z.l(a,ra,B,"commandHandler"),null!==a.h&&z.k("Cannot share CommandHandlers between Diagrams: "+a.toString()),null!==b&&b.Sc(null),this.ty=a,a.Sc(this))});z.defineProperty(B,{gb:"toolManager"},function(){return this.uz},function(a){var b=this.uz;b!==a&&(z.l(a,gh,B,"toolManager"),null!==a.h&&z.k("Cannot share ToolManagers between Diagrams: "+a.toString()),null!==b&&b.Sc(null),this.uz=a,a.Sc(this))});
  z.defineProperty(B,{vt:"defaultTool"},function(){return this.zy},function(a){var b=this.zy;b!==a&&(z.l(a,xg,B,"defaultTool"),this.zy=a,this.cb===b&&(this.cb=a))});z.defineProperty(B,{cb:"currentTool"},function(){return this.xy},function(a){var b=this.xy;null!==b&&(b.ua&&b.doDeactivate(),b.cancelWaitAfter(),b.doStop());null===a&&(a=this.vt);null!==a&&(z.l(a,xg,B,"currentTool"),this.xy=a,a.Sc(this),a.doStart())});z.w(B,{selection:"selection"},function(){return this.pw});
  z.defineProperty(B,{BI:"maxSelectionCount"},function(){return this.Mv},function(a){var b=this.Mv;if(b!==a)if(z.g(a,"number",B,"maxSelectionCount"),0<=a&&!isNaN(a)){if(this.Mv=a,this.j("maxSelectionCount",b,a),!this.pa.qb&&(a=this.selection.count-a,0<a)){this.Ja("ChangingSelection");for(var b=this.selection.jc(),c=0;c<a;c++)b[c].jb=!1;this.Ja("ChangedSelection")}}else z.ka(a,">= 0",B,"maxSelectionCount")});
  z.defineProperty(B,{LI:"nodeSelectionAdornmentTemplate"},function(){return this.Sv},function(a){var b=this.Sv;b!==a&&(z.l(a,da,B,"nodeSelectionAdornmentTemplate"),this.Sv=a,this.j("nodeSelectionAdornmentTemplate",b,a))});z.defineProperty(B,{SH:"groupSelectionAdornmentTemplate"},function(){return this.qv},function(a){var b=this.qv;b!==a&&(z.l(a,da,B,"groupSelectionAdornmentTemplate"),this.qv=a,this.j("groupSelectionAdornmentTemplate",b,a))});
  z.defineProperty(B,{vI:"linkSelectionAdornmentTemplate"},function(){return this.Iv},function(a){var b=this.Iv;b!==a&&(z.l(a,da,B,"linkSelectionAdornmentTemplate"),this.Iv=a,this.j("linkSelectionAdornmentTemplate",b,a))});z.w(B,{gn:"highlighteds"},function(){return this.vv});
  z.defineProperty(B,{ni:"isModified"},function(){var a=this.pa;return a.isEnabled?null!==a.ej?!0:this.Wy&&this.dh!==a.jj:this.Wy},function(a){if(this.Wy!==a){z.g(a,"boolean",B,"isModified");this.Wy=a;var b=this.pa;!a&&b.isEnabled&&(this.dh=b.jj);a||Hl(this)}});function Hl(a){var b=a.ni;a.xD!==b&&(a.xD=b,a.Ja("Modified"))}
  z.defineProperty(B,{ha:"model"},function(){return this.ie},function(a){var b=this.ie;if(b!==a){z.l(a,M,B,"model");this.cb.doCancel();null!==b&&b.pa!==a.pa&&b.pa.PE&&z.k("Do not replace a Diagram.model while a transaction is in progress.");this.Va.pi();this.Nw();this.fh=!1;this.ho=!0;this.dh=-2;this.Wf=!1;var c=this.Vd;this.Vd=!0;this.Va.rn("Model");null!==b&&(null!==this.hh&&this.hh.each(function(a){b.iu(a)}),b.iu(this.FC),b instanceof V&&Il(this,b.Kg),Il(this,b.hg));this.ie=a;a.Qm(this.EC);Jl(this,
  a.hg);a instanceof V&&Kl(this,a.Kg);a.iu(this.EC);a.Qm(this.FC);null!==this.hh&&this.hh.each(function(b){a.Qm(b)});this.Vd=c;this.Vc||this.ta();null!==b&&(a.pa.isEnabled=b.pa.isEnabled)}});z.defineProperty(B,{$a:null},function(){return this.xC},function(a){this.xC=a});z.w(B,{tx:null},function(){return this.qG});
  function vk(a,b){if(b.ha===a.ha){var c=b.Dc,d=b.propertyName;if(c===Vf&&"S"===d[0])if("StartingFirstTransaction"===d)c=a.gb,c.Ye.each(function(b){b.Sc(a)}),c.eg.each(function(b){b.Sc(a)}),c.fg.each(function(b){b.Sc(a)}),a.Vd||a.fh||(a.hv=!0,a.ho&&(a.Wf=!0));else if("StartingUndo"===d||"StartingRedo"===d){var e=a.Va;e.nf&&!a.Bb&&e.pi();a.Ja("ChangingSelection")}else"StartedTransaction"===d&&(e=a.Va,e.nf&&!a.Bb&&e.pi());else if(a.$a){a.$a=!1;try{var g=b.rf;if(""!==g)if(c===Uf){if("linkFromKey"===g){var h=
  b.object,k=a.$f(h);if(null!==k){var l=b.newValue,m=a.hf(l);k.Y=m}}else if("linkToKey"===g)h=b.object,k=a.$f(h),null!==k&&(l=b.newValue,m=a.hf(l),k.da=m);else if("linkFromPortId"===g){if(h=b.object,k=a.$f(h),null!==k){var n=b.newValue;"string"===typeof n&&(k.ag=n)}}else if("linkToPortId"===g)h=b.object,k=a.$f(h),null!==k&&(n=b.newValue,"string"===typeof n&&(k.Vg=n));else if("nodeGroupKey"===g){var h=b.object,p=a.vh(h);if(null!==p){var q=b.newValue;if(void 0!==q){var r=a.hf(q);p.Qa=r instanceof F?r:
  null}else p.Qa=null}}else if("linkLabelKeys"===g){if(h=b.object,k=a.$f(h),null!==k){var s=b.oldValue,t=b.newValue;if(z.isArray(s))for(var v=z.ab(s),x=0;x<v;x++){var y=z.Ya(s,x),m=a.hf(y);null!==m&&(m.od=null)}if(z.isArray(t))for(v=z.ab(t),x=0;x<v;x++)y=z.Ya(t,x),m=a.hf(y),null!==m&&(m.od=k)}}else if("nodeParentKey"===g){var A=b.object,C=a.hf(b.newValue),L=a.ax(A);if(null!==L){var H=L.op();null!==H?null===C?a.remove(H):a.ce?H.Y=C:H.da=C:Ll(a,C,L)}}else if("parentLinkCategory"===g){var A=b.object,L=
  a.ax(A),U=b.newValue;null!==L&&"string"===typeof U&&(H=L.op(),null!==H&&(H.nc=U))}else if("nodeCategory"===g){var h=b.object,ea=a.vh(h),U=b.newValue;null!==ea&&"string"===typeof U&&(ea.nc=U)}else if("linkCategory"===g){var h=b.object,W=a.$f(h),U=b.newValue;null!==W&&"string"===typeof U&&(W.nc=U)}else if("nodeDataArray"===g){var P=b.oldValue;Il(a,P);var ba=b.newValue;Jl(a,ba)}else"linkDataArray"===g&&(P=b.oldValue,Il(a,P),ba=b.newValue,Kl(a,ba));a.ni=!0}else c===Wf?(ba=b.newValue,"nodeDataArray"===
  g&&z.Za(ba)?Ml(a,ba):"linkDataArray"===g&&z.Za(ba)?Nl(a,ba):"linkLabelKeys"===g&&Bg(ba)&&(k=a.$f(b.object),m=a.hf(ba),null!==k&&null!==m&&(m.od=k)),a.ni=!0):c===Xf?(P=b.oldValue,"nodeDataArray"===g&&z.Za(P)?Ol(a,P):"linkDataArray"===g&&z.Za(P)?Ol(a,P):"linkLabelKeys"===g&&Bg(P)&&(m=a.hf(P),null!==m&&(m.od=null)),a.ni=!0):c===Vf&&("SourceChanged"===g?null!==b.object?uk(a,b.object,b.propertyName):(a.AJ(),a.dG()):"ModelDisplaced"===g&&a.Sl());else if(c===Uf){var Oa=b.propertyName,h=b.object;if(h===a.ha){if("nodeKeyProperty"===
  Oa||"nodeCategoryProperty"===Oa||"linkFromKeyProperty"===Oa||"linkToKeyProperty"===Oa||"linkFromPortIdProperty"===Oa||"linkToPortIdProperty"===Oa||"linkLabelKeysProperty"===Oa||"nodeIsGroupProperty"===Oa||"nodeGroupKeyProperty"===Oa||"nodeParentKeyProperty"===Oa||"linkCategoryProperty"===Oa)a.pa.qb||a.Sl()}else uk(a,h,Oa);a.ni=!0}else if(c===Wf||c===Xf)Pl(a,b),a.ni=!0;else if(c===Vf){if("FinishedUndo"===d||"FinishedRedo"===d)a.pa.Ii=!0,a.Ja("ChangedSelection"),Kk(a),a.pa.Ii=!1;e=a.Va;"RolledBackTransaction"===
  d&&e.pi();a.hv=!0;a.cg();0===a.pa.Ih&&Tj(e);"CommittedTransaction"===d&&a.pa.Yy&&(a.dh=Math.min(a.dh,a.pa.jj-1));var sa=b.SE;sa&&(Hl(a),a.tx.clear());!a.ez&&sa&&(a.ez=!0,z.setTimeout(function(){a.cb.standardMouseOver();a.ez=!1},10))}}finally{a.$a=!0}}}}
  function uk(a,b,c){if("string"===typeof c){var d=a.vh(b);if(null!==d)d.Mb(c),a.ha instanceof qg&&(d=a.$f(b),null!==d&&d.Mb(c));else{for(var d=null,e=a.mm.i;e.next();){for(var g=e.value,h=0;h<g.length;h++){var k=g[h].DH(b);null!==k&&(null===d&&(d=z.rb()),d.push(k))}if(null!==d)break}if(null!==d){for(e=0;e<d.length;e++)d[e].Mb(c);z.xa(d)}}b===a.ha.uk&&a.dG(c)}}z.defineProperty(B,{Ee:"skipsModelSourceBindings"},function(){return this.$C},function(a){this.$C=a});
  z.defineProperty(B,{vu:null},function(){return this.nz},function(a){this.nz=a});function Pl(a,b){var c=b.Dc===Wf,d=c?b.Lg:b.Ng,e=c?b.newValue:b.oldValue,g=a.mm.na(b.object);if(Array.isArray(g))for(var h=0;h<g.length;h++){var k=g[h];if(c)Ql(k,e,d);else{var l=d;if(!(0>l)){var m=l;Rl(k)&&m++;k.Ve(m);Sl(k,m,l)}}}}function yl(a,b){var c=b.Ji;if(z.isArray(c)){var d=a.mm.na(c);if(null===d)d=[],d.push(b),a.mm.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
  function Cl(a,b){var c=b.Ji;if(z.isArray(c)){var d=a.mm.na(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.mm.remove(c);break}}}function xl(a,b){for(var c=b.va.o,d=c.length,e=0;e<d;e++){var g=c[e];g instanceof wk&&Tl(a,g)}}function Tl(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var c=c.src,d=a.Fo.na(c);if(null===d)d=[],d.push(b),a.Fo.add(c,d);else{for(c=0;c<d.length;c++)if(d[c]===b)return;d.push(b)}}}
  function Bl(a,b){for(var c=b.va.o,d=c.length,e=0;e<d;e++){var g=c[e];g instanceof wk&&Ul(a,g)}}function Ul(a,b){var c=b.element;if(null!==c&&c instanceof HTMLImageElement){var c=c.src,d=a.Fo.na(c);if(null!==d)for(var e=0;e<d.length;e++)if(d[e]===b){d.splice(e,1);0===d.length&&a.Fo.remove(c);break}}}
  B.prototype.clear=B.prototype.clear=function(){var a=null;null!==this.ud&&(a=this.ud.ca);this.ha.clear();for(var b=this.Yb.length,c=0;c<b;c++)this.Yb.o[c].clear();this.rg.clear();this.Sk.clear();this.Eo.clear();this.pl.clear();this.yo.clear();this.mb.clear();this.Ai.clear();this.Rk.clear();this.mm.clear();this.pw.Wa();this.pw.clear();this.pw.freeze();this.vv.Wa();this.vv.clear();this.vv.freeze();eh=this.Rn=null;fh="";this.iv=(new w(NaN,NaN,NaN,NaN)).freeze();null!==a&&(this.add(a),this.mb.remove(a));
  this.ta()};
  B.prototype.reset=B.prototype.reset=function(){this.Vc=!0;this.clear();this.Yb=new J(wg);this.qF();this.pF();this.sb=(new N(NaN,NaN)).freeze();this.bc=1;this.xv=(new N(NaN,NaN)).freeze();this.yv=NaN;this.Ov=1E-4;this.Lv=100;this.Cw=(new N(NaN,NaN)).freeze();this.ov=(new w(NaN,NaN,NaN,NaN)).freeze();this.jw=(new Db(0,0,0,0)).freeze();this.kw=rk;this.gw=this.cw=null;this.cm=mh;this.On=Pc;this.Yk=mh;this.mo=Pc;this.zv=this.wv=Zb;this.uB=250;this.Su=(new Db(16,16,16,16)).freeze();this.Dv=!0;this.xw=tk;
  this.zw=Bi;this.Oq="auto";this.zi=this.Xi=this.Ni=this.Rv=this.Oi=this.Pi=this.Qi=this.yi=this.Di=this.vi=null;this.Hi=!1;this.Ck=this.Bk=this.Hu=this.af=!0;this.Ju=this.Iu=!1;this.Nu=this.Ku=this.uv=this.tv=this.Ou=this.Mu=this.Kk=this.Jk=this.Ik=this.Hk=this.Fk=this.Gk=this.Ek=this.Lu=this.Mk=this.Dk=this.Lk=!0;this.mw=this.iw=16;this.df=(new Db(5)).freeze();this.Mv=999999999;this.he=null;Ak(this);this.ud=null;this.gb=new gh;this.gb.initializeStandardTools();this.cb=this.vt=this.gb;this.wb=new ra;
  this.Wi=!0;zk(this);this.Sb=new yg;this.Wi=!1;this.ha=new V;this.fh=!1;this.ho=!0;this.Vc=this.Wf=!1;this.ta();this.hh=this.ui=null;sk(this);this.av=""};
  B.prototype.rebuildParts=B.prototype.Sl=function(){for(var a=this.zA.i;a.next();){var b=a.value,c=a.key;(!b.be()||b instanceof F)&&z.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.bA.i;a.next();)b=a.value,c=a.key,b instanceof F||z.k('Invalid group template in Diagram.groupTemplateMap: template for "'+c+'" must be a Group, not a normal Node or Link: '+b);for(a=this.lA.i;a.next();)b=a.value,c=a.key,b instanceof
  G||z.k('Invalid link template in Diagram.linkTemplateMap: template for "'+c+'" must be a Link, not a normal Node or simple Part: '+b);a=z.rb();for(b=this.selection.i;b.next();)(c=b.value.data)&&a.push(c);for(var b=z.rb(),d=this.gn.i;d.next();)(c=d.value.data)&&b.push(c);c=z.rb();for(d=this.Mg.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.oi.i;d.next();)e=d.value,null!==
  e.data&&(c.push(e.data),c.push(e.location));d=this.ha;d instanceof V&&Il(this,d.Kg);Il(this,d.hg);Jl(this,d.hg);d instanceof V&&Kl(this,d.Kg);for(d=0;d<a.length;d++)e=this.vh(a[d]),null!==e&&(e.jb=!0);for(d=0;d<b.length;d++)e=this.vh(b[d]),null!==e&&(e.yh=!0);for(d=0;d<c.length;d+=2)e=this.vh(c[d]),null!==e&&(e.location=c[d+1]);z.xa(a);z.xa(b);z.xa(c)};
  function Jl(a,b){if(null!==b){for(var c=a.ha,d=z.ab(b),e=0;e<d;e++){var g=z.Ya(b,e);c.le(g)?Ml(a,g,!1):c instanceof V&&Nl(a,g)}if(c instanceof V||c instanceof qg){for(e=0;e<d;e++)g=z.Ya(b,e),c.le(g)&&Vl(a,g);if(c instanceof V)for(c=a.links;c.next();)Wl(c.value)}Xl(a,!1)}}
  function Ml(a,b,c){if(void 0!==b&&null!==b&&!a.pa.qb&&!a.Ai.contains(b)){void 0===c&&(c=!0);var d=a.$z(b),e=Yl(a,b,d);if(null!==e&&(jh(e),e=e.copy(),null!==e)){var g=a.Ee;a.Ee=!0;e.ti=d;e.fe=b;a.add(e);e.fe=null;e.data=b;c&&Vl(a,b);a.Ee=g}}}B.prototype.$z=function(a){return this.ha.$z(a)};var Zl=!1,$l=!1;
  function Yl(a,b,c){var d=!1,e=a.ha;e instanceof V&&(d=e.hA(b));d?(b=a.bA.na(c),null===b&&(b=a.bA.na(""),null===b&&($l||($l=!0,z.trace('No Group template found for category "'+c+'"'),z.trace("  Using default group template")),b=a.OB))):(b=a.zA.na(c),null===b&&(b=a.zA.na(""),null===b&&(Zl||(Zl=!0,z.trace('No Node template found for category "'+c+'"'),z.trace("  Using default node template")),b=a.QB)));return b}
  function Vl(a,b){var c=a.ha;if(c instanceof V||c instanceof qg){var d=c.pb(b);if(void 0!==d){var e=Eg(c,d),g=a.vh(b);if(null!==e&&null!==g){for(e=e.i;e.next();){var h=e.value;if(c instanceof V){var k=c;if(k.le(h)){if(g instanceof F&&k.en(h)===d){var l=g,h=a.vh(h);null!==h&&(h.Qa=l)}}else{var m=a.$f(h);if(null!==m&&g instanceof E&&(l=g,k.Ll(h)===d&&(m.Y=l),k.Ml(h)===d&&(m.da=l),h=k.rk(h),z.isArray(h)))for(k=0;k<z.ab(h);k++)if(z.Ya(h,k)===d){l.od=m;break}}}else c instanceof qg&&(m=c,m.le(h)&&g instanceof
  E&&(l=g,m.fn(h)===d&&(h=a.ax(h),Ll(a,l,h))))}Gg(c,d)}c instanceof V?(c=c.en(b),void 0!==c&&(c=a.hf(c),c instanceof F&&(g.Qa=c))):c instanceof qg&&(c=c.fn(b),void 0!==c&&g instanceof E&&(l=g,g=a.hf(c),Ll(a,g,l)))}}}
  function Ll(a,b,c){if(null!==b&&null!==c){var d=a.gb.YE,e=b,g=c;if(a.ce)for(b=g.ee;b.next();){if(b.value.da===g)return}else for(e=c,g=b,b=e.ee;b.next();)if(b.value.Y===e)return;if(null===d||!Di(d,e,g,null,!0))if(d=a.ex(c.data),b=am(a,d),null!==b&&(jh(b),b=b.copy(),null!==b)){var h=a.Ee;a.Ee=!0;b.ti=d;b.fe=c.data;b.Y=e;b.da=g;a.add(b);b.fe=null;b.data=c.data;a.Ee=h}}}function Kl(a,b){if(null!==b){for(var c=z.ab(b),d=0;d<c;d++){var e=z.Ya(b,d);Nl(a,e)}Xl(a,!1)}}
  function Nl(a,b){if(void 0!==b&&null!==b&&!a.pa.qb&&!a.Rk.contains(b)){var c=a.ex(b),d=am(a,c);if(null!==d&&(jh(d),d=d.copy(),null!==d)){var e=a.Ee;a.Ee=!0;d.ti=c;d.fe=b;var c=a.ha,g=c.LH(b);""!==g&&(d.ag=g);g=c.Ll(b);void 0!==g&&(g=a.hf(g),g instanceof E&&(d.Y=g));g=c.OH(b);""!==g&&(d.Vg=g);g=c.Ml(b);void 0!==g&&(g=a.hf(g),g instanceof E&&(d.da=g));c=c.rk(b);if(z.isArray(c))for(var g=z.ab(c),h=0;h<g;h++){var k=z.Ya(c,h),k=a.hf(k);null!==k&&(k.od=d)}a.add(d);d.fe=null;d.data=b;a.Ee=e}}}
  B.prototype.ex=function(a){var b=this.ha,c="";b instanceof V?c=b.ex(a):b instanceof qg&&(c=b.NH(a));return c};var bm=!1;function am(a,b){var c=a.lA.na(b);null===c&&(c=a.lA.na(""),null===c&&(bm||(bm=!0,z.trace('No Link template found for category "'+b+'"'),z.trace("  Using default link template")),c=a.PB));return c}function Il(a,b){for(var c=z.ab(b),d=0;d<c;d++){var e=z.Ya(b,d);Ol(a,e)}}
  function Ol(a,b){if(void 0!==b&&null!==b){var c=a.vh(b);if(null!==c){c.jb=!1;c.yh=!1;var d=c.layer;if(null!==d&&d.h===a){var e=a.ha;if(e instanceof V&&c instanceof E){var g=c,h=e.pb(g.data);if(void 0!==h){for(var k=g.ee;k.next();)Fg(e,h,k.value.data);g.Df&&(k=g.od,null!==k&&Fg(e,h,k.data));if(g instanceof F)for(g=g.Hc;g.next();)k=g.value.data,e.le(k)&&Fg(e,h,k)}}else if(e instanceof qg&&c instanceof E){g=c;k=a.$f(g.data);if(null!==k){k.jb=!1;k.yh=!1;var l=k.layer;if(null!==l){var m=l.Ve(-1,k,!1);
  0<=m&&a.Rc(Xf,"parts",l,k,null,m,null);m=k.Ut;null!==m&&m(k,l,null)}}k=a.ce;for(g=g.ee;g.next();)l=g.value,l=(k?l.da:l.Y).data,e.le(l)&&Fg(e,h,l)}e=d.Ve(-1,c,!1);0<=e&&a.Rc(Xf,"parts",d,c,null,e,null);e=c.Ut;null!==e&&e(c,d,null)}}}}B.prototype.findPartForKey=B.prototype.GH=function(a){if(null===a||void 0===a)return null;a=this.ha.ne(a);return null===a?null:this.Ai.na(a)};
  B.prototype.findNodeForKey=B.prototype.hf=function(a){if(null===a||void 0===a)return null;a=this.ha.ne(a);if(null===a)return null;a=this.Ai.na(a);return a instanceof E?a:null};B.prototype.findPartForData=B.prototype.vh=function(a){if(null===a)return null;var b=this.Ai.na(a);return null!==b?b:b=this.Rk.na(a)};B.prototype.findNodeForData=B.prototype.ax=function(a){if(null===a)return null;a=this.Ai.na(a);return a instanceof E?a:null};
  B.prototype.findLinkForData=B.prototype.$f=function(a){return null===a?null:this.Rk.na(a)};B.prototype.findNodesByExample=function(a){for(var b=new K,c=this.Eo.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var g=0;g<arguments.length;g++){var h=arguments[g];if(z.Za(h)&&cm(this,e,h)){b.add(d);break}}}return b.i};
  B.prototype.findLinksByExample=function(a){for(var b=new K,c=this.yo.i;c.next();){var d=c.value,e=d.data;if(null!==e)for(var g=0;g<arguments.length;g++){var h=arguments[g];if(z.Za(h)&&cm(this,e,h)){b.add(d);break}}}return b.i};function cm(a,b,c){for(var d in c){var e=b[d],g=c[d];if(z.isArray(g)){if(!z.isArray(e)||e.length<g.length)return!1;for(var h=0;h<e.length;h++){var k=e[h],l=g[h];if(void 0!==l&&!dm(a,k,l))return!1}}else if(!dm(a,e,g))return!1}return!0}
  function dm(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(z.Za(b)&&z.Za(c)){if(!cm(a,b,c))return!1}else if(b!==c)return!1;return!0}z.defineProperty(B,{ZK:"nodeTemplate"},function(){return this.Ri.na("")},function(a){var b=this.Ri.na("");b!==a&&(z.l(a,D,B,"nodeTemplate"),this.Ri.add("",a),this.j("nodeTemplate",b,a),this.pa.qb||this.Sl())});
  z.defineProperty(B,{zA:"nodeTemplateMap"},function(){return this.Ri},function(a){var b=this.Ri;b!==a&&(z.l(a,na,B,"nodeTemplateMap"),this.Ri=a,this.j("nodeTemplateMap",b,a),this.pa.qb||this.Sl())});z.defineProperty(B,{BK:"groupTemplate"},function(){return this.Uk.na("")},function(a){var b=this.Uk.na("");b!==a&&(z.l(a,F,B,"groupTemplate"),this.Uk.add("",a),this.j("groupTemplate",b,a),this.pa.qb||this.Sl())});
  z.defineProperty(B,{bA:"groupTemplateMap"},function(){return this.Uk},function(a){var b=this.Uk;b!==a&&(z.l(a,na,B,"groupTemplateMap"),this.Uk=a,this.j("groupTemplateMap",b,a),this.pa.qb||this.Sl())});z.defineProperty(B,{NK:"linkTemplate"},function(){return this.Pj.na("")},function(a){var b=this.Pj.na("");b!==a&&(z.l(a,G,B,"linkTemplate"),this.Pj.add("",a),this.j("linkTemplate",b,a),this.pa.qb||this.Sl())});
  z.defineProperty(B,{lA:"linkTemplateMap"},function(){return this.Pj},function(a){var b=this.Pj;b!==a&&(z.l(a,na,B,"linkTemplateMap"),this.Pj=a,this.j("linkTemplateMap",b,a),this.pa.qb||this.Sl())});z.defineProperty(B,{gI:null},function(){return this.jm},function(a){this.jm=a});
  z.defineProperty(B,{We:"isMouseCaptured"},function(){return this.uC},function(a){var b=this.Fb;null!==b&&(a?(this.R.bubbles=!1,b.removeEventListener("mousemove",this.Kp,!1),b.removeEventListener("mousedown",this.Jp,!1),b.removeEventListener("mouseup",this.Mp,!1),b.removeEventListener("mousewheel",this.Bh,!1),b.removeEventListener("DOMMouseScroll",this.Bh,!1),b.removeEventListener("mouseout",this.Lp,!1),window.addEventListener("mousemove",this.Kp,!0),window.addEventListener("mousedown",this.Jp,!0),
  window.addEventListener("mouseup",this.Mp,!0),window.addEventListener("mousewheel",this.Bh,!0),window.addEventListener("DOMMouseScroll",this.Bh,!0),window.addEventListener("mouseout",this.Lp,!0),window.addEventListener("selectstart",this.preventDefault,!1)):(window.removeEventListener("mousemove",this.Kp,!0),window.removeEventListener("mousedown",this.Jp,!0),window.removeEventListener("mouseup",this.Mp,!0),window.removeEventListener("mousewheel",this.Bh,!0),window.removeEventListener("DOMMouseScroll",
  this.Bh,!0),window.removeEventListener("mouseout",this.Lp,!0),window.removeEventListener("selectstart",this.preventDefault,!1),b.addEventListener("mousemove",this.Kp,!1),b.addEventListener("mousedown",this.Jp,!1),b.addEventListener("mouseup",this.Mp,!1),b.addEventListener("mousewheel",this.Bh,!1),b.addEventListener("DOMMouseScroll",this.Bh,!1),b.addEventListener("mouseout",this.Lp,!1)),this.uC=a)});
  z.defineProperty(B,{position:"position"},function(){return this.sb},function(a){var b=this.sb;if(!b.N(a)){z.l(a,N,B,"position");var c=this.xb.copy();a=a.copy();if(!this.Vc&&null!==this.Fb){this.Vc=!0;var d=this.scale;Ok(this,a,this.ad,this.Jb/d,this.Ob/d,this.On,!1);this.Vc=!1}this.sb=a.V();a=this.Va;a.wc&&gk(a,b,this.sb);this.Vc||this.fu(c,this.xb)}});z.defineProperty(B,{YH:"initialPosition"},function(){return this.xv},function(a){this.xv.N(a)||(z.l(a,N,B,"initialPosition"),this.xv=a.V())});
  z.defineProperty(B,{ZH:"initialScale"},function(){return this.yv},function(a){this.yv!==a&&(z.g(a,"number",B,"initialScale"),this.yv=a)});z.defineProperty(B,{tp:"grid"},function(){null===this.ud&&Gk(this);return this.ud},function(a){var b=this.ud;if(b!==a){null===b&&(Gk(this),b=this.ud);z.l(a,I,B,"grid");a.type!==Hk&&z.k("Diagram.grid must be a Panel of type Panel.Grid");var c=b.T;null!==c&&c.remove(b);this.ud=a;a.name="GRID";null!==c&&c.add(a);$k(this);this.ta();this.j("grid",b,a)}});
  z.w(B,{xb:"viewportBounds"},function(){var a=this.wD;if(null===this.Fb)return a;var b=this.sb,c=this.bc;a.n(b.x,b.y,Math.max(this.Jb,0)/c,Math.max(this.Ob,0)/c);return a});z.defineProperty(B,{tE:"fixedBounds"},function(){return this.ov},function(a){var b=this.ov;b.N(a)||(z.l(a,w,B,"fixedBounds"),(u&&Infinity===a.width||-Infinity===a.width||Infinity===a.height||-Infinity===a.height)&&z.k("fixedBounds width/height must not be Infinity"),this.ov=a=a.V(),this.yc(),this.j("fixedBounds",b,a))});
  z.defineProperty(B,{AF:"scrollMargin"},function(){return this.jw},function(a){"number"===typeof a?a=new Db(a):z.l(a,Db,B,"scrollMargin");var b=this.jw;b.N(a)||(this.jw=a=a.V(),this.yc(),this.j("scrollMargin",b,a))});z.defineProperty(B,{MA:"scrollMode"},function(){return this.kw},function(a){var b=this.kw;b!==a&&(z.Ba(a,B,B,"scrollMode"),this.kw=a,a===rk&&Mk(this,!1),this.j("scrollMode",b,a))});
  z.defineProperty(B,{iF:"positionComputation"},function(){return this.cw},function(a){var b=this.cw;b!==a&&(null!==a&&z.g(a,"function",B,"positionComputation"),this.cw=a,Mk(this,!1),this.j("positionComputation",b,a))});z.defineProperty(B,{zF:"scaleComputation"},function(){return this.gw},function(a){var b=this.gw;b!==a&&(null!==a&&z.g(a,"function",B,"scaleComputation"),this.gw=a,Fl(this,this.scale,this.scale),this.j("scaleComputation",b,a))});z.w(B,{ad:"documentBounds"},function(){return this.iv});
  function Pk(a,b){a.Jj=!1;var c=a.iv;c.N(b)||(b=b.V(),a.iv=b,Mk(a,!1),a.Ja("DocumentBoundsChanged",null,c.copy()),Wk(a))}z.defineProperty(B,{scale:"scale"},function(){return this.bc},function(a){var b=this.bc;z.p(a,B,"scale");b!==a&&Fl(this,b,a)});z.defineProperty(B,{xl:"autoScale"},function(){return this.cm},function(a){var b=this.cm;b!==a&&(z.Ba(a,B,B,"autoScale"),this.cm=a,this.j("autoScale",b,a),a!==mh&&Mk(this,!1))});
  z.defineProperty(B,{DK:"initialAutoScale"},function(){return this.Yk},function(a){var b=this.Yk;b!==a&&(z.Ba(a,B,B,"initialAutoScale"),this.Yk=a,this.j("initialAutoScale",b,a))});z.defineProperty(B,{$H:"initialViewportSpot"},function(){return this.zv},function(a){var b=this.zv;b!==a&&(z.l(a,Q,B,"initialViewportSpot"),a.cd()||z.k("initialViewportSpot must be a specific Spot: "+a),this.zv=a,this.j("initialViewportSpot",b,a))});
  z.defineProperty(B,{XH:"initialDocumentSpot"},function(){return this.wv},function(a){var b=this.wv;b!==a&&(z.l(a,Q,B,"initialDocumentSpot"),a.cd()||z.k("initialViewportSpot must be a specific Spot: "+a),this.wv=a,this.j("initialDocumentSpot",b,a))});z.defineProperty(B,{Ah:"minScale"},function(){return this.Ov},function(a){z.p(a,B,"minScale");var b=this.Ov;b!==a&&(0<a?(this.Ov=a,this.j("minScale",b,a),a>this.scale&&(this.scale=a)):z.ka(a,"> 0",B,"minScale"))});
  z.defineProperty(B,{zh:"maxScale"},function(){return this.Lv},function(a){z.p(a,B,"maxScale");var b=this.Lv;b!==a&&(0<a?(this.Lv=a,this.j("maxScale",b,a),a<this.scale&&(this.scale=a)):z.ka(a,"> 0",B,"maxScale"))});z.defineProperty(B,{$l:"zoomPoint"},function(){return this.Cw},function(a){this.Cw.N(a)||(z.l(a,N,B,"zoomPoint"),this.Cw=a=a.V())});
  z.defineProperty(B,{WD:"contentAlignment"},function(){return this.On},function(a){var b=this.On;b.N(a)||(z.l(a,Q,B,"contentAlignment"),this.On=a=a.V(),this.j("contentAlignment",b,a),Mk(this,!1))});z.defineProperty(B,{EK:"initialContentAlignment"},function(){return this.mo},function(a){var b=this.mo;b.N(a)||(z.l(a,Q,B,"initialContentAlignment"),this.mo=a=a.V(),this.j("initialContentAlignment",b,a))});
  z.defineProperty(B,{padding:"padding"},function(){return this.df},function(a){"number"===typeof a?a=new Db(a):z.l(a,Db,B,"padding");var b=this.df;b.N(a)||(this.df=a=a.V(),this.yc(),this.j("padding",b,a))});z.w(B,{Mg:"nodes"},function(){return this.Eo.i});z.w(B,{links:"links"},function(){return this.yo.i});z.w(B,{oi:"parts"},function(){return this.mb.i});
  B.prototype.findTopLevelNodesAndLinks=function(){for(var a=new K(D),b=this.Eo.i;b.next();){var c=b.value;c.Bp&&a.add(c)}for(b=this.yo.i;b.next();)c=b.value,c.Bp&&a.add(c);return a.i};B.prototype.findTopLevelGroups=function(){return this.pl.i};z.defineProperty(B,{Sb:"layout"},function(){return this.he},function(a){var b=this.he;b!==a&&(z.l(a,yg,B,"layout"),null!==b&&(b.h=null,b.group=null),this.he=a,a.h=this,a.group=null,this.Qu=!0,this.j("layout",b,a),this.Ce())});
  B.prototype.layoutDiagram=function(a){Kk(this);a&&Xl(this,!0);hl(this,!1)};function Xl(a,b){for(var c=a.pl.i;c.next();)em(a,c.value,b);null!==a.Sb&&(b?a.Sb.Gf=!1:a.Sb.I())}function em(a,b,c){if(null!==b){for(var d=b.vm.i;d.next();)em(a,d.value,c);null!==b.Sb&&(c?b.Sb.Gf=!1:b.Sb.I())}}
  function hl(a,b){if(!a.Ay){var c=a.Sb,d=a.$a;a.$a=!0;try{a.Wb("Layout");var e=a.Va;1!==a.pa.Ih||e.nf||e.wc||e.rn("Layout");for(var g=a.pl.i;g.next();)fm(a,g.value,b);c.Gf||b&&!c.RE&&1!==a.pa.Ih||(c.doLayout(a),Kk(a),c.Gf=!0)}finally{a.Kd("Layout"),a.Qu=!c.Gf,a.$a=d}}}function fm(a,b,c){if(null!==b){for(var d=b.vm.i;d.next();)fm(a,d.value,c);d=b.Sb;null===d||d.Gf||c&&!d.RE||(b.fz=!b.location.F(),d.doLayout(b),b.I(gm),d.Gf=!0,kl(a,b))}}
  z.defineProperty(B,{ce:"isTreePathToChildren"},function(){return this.Dv},function(a){var b=this.Dv;if(b!==a&&(z.g(a,"boolean",B,"isTreePathToChildren"),this.Dv=a,this.j("isTreePathToChildren",b,a),!this.pa.qb))for(a=this.Mg;a.next();)hm(a.value)});B.prototype.findTreeRoots=function(){for(var a=new J(E),b=this.Mg;b.next();){var c=b.value;c.Bp&&null===c.op()&&a.add(c)}return a.i};
  z.defineProperty(B,{bB:"treeCollapsePolicy"},function(){return this.xw},function(a){var b=this.xw;b!==a&&(z.Ba(a,B,B,"treeCollapsePolicy"),this.xw=a,this.j("treeCollapsePolicy",b,a))});z.defineProperty(B,{xh:null},function(){return this.lC},function(a){this.lC=a});
  function sk(a){function b(a){var b=a.toLowerCase(),h=new J("function");c.add(a,h);c.add(b,h);d.add(a,a);d.add(b,a)}var c=new na("string",J),d=new na("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.Cy=c;a.By=d}
  function Ia(a,b){var c=a.By.na(b);return null!==c?c:a.By.na(b.toLowerCase())}function im(a,b){var c=a.Cy.na(b);if(null!==c)return c;c=a.Cy.na(b.toLowerCase());if(null!==c)return c;z.k("Unknown DiagramEvent name: "+b);return null}B.prototype.addDiagramListener=B.prototype.Az=function(a,b){z.g(a,"string",B,"addDiagramListener:name");z.g(b,"function",B,"addDiagramListener:listener");var c=im(this,a);null!==c&&c.add(b)};
  B.prototype.removeDiagramListener=B.prototype.lF=function(a,b){z.g(a,"string",B,"removeDiagramListener:name");z.g(b,"function",B,"addDiagramListener:listener");var c=im(this,a);null!==c&&c.remove(b)};B.prototype.raiseDiagramEvent=B.prototype.Ja=function(a,b,c){u&&z.g(a,"string",B,"raiseDiagramEvent:name");var d=im(this,a),e=new Sf;e.h=this;e.name=Ia(this,a);void 0!==b&&(e.WA=b);void 0!==c&&(e.CA=c);a=d.length;if(1===a)d=d.ea(0),d(e);else if(0!==a)for(b=d.jc(),c=0;c<a;c++)d=b[c],d(e);return e.cancel};
  function oi(a,b){var c=!1;a.xb.nk(b)&&(c=!0);c=a.Wz(b,function(a){return a.ca},function(a){return a instanceof G},!0,function(a){return a instanceof G},c);if(0!==c.count)for(c=c.i;c.next();){var d=c.value;d.kj&&d.qc()}}B.prototype.isUnoccupied=B.prototype.Dp=function(a,b){void 0===b&&(b=null);return ja(this,!1,null,b).Dp(a.x,a.y,a.width,a.height)};
  function ja(a,b,c,d){null===a.Fd&&(a.Fd=new jm);if(a.Fd.yp||a.Fd.group!==c||a.Fd.UA!==d){if(null===c){b=a.Jj?Lk(a):a.ad.copy();b.bg(100,100);a.Fd.initialize(b);b=z.lg();for(var e=a.Mg;e.next();){var g=e.value,h=g.layer;null!==h&&h.visible&&!h.Nc&&km(a,g,d,b)}}else for(c.W.F()||c.Bf(),b=c.W.copy(),b.bg(20,20),a.Fd.initialize(b),b=z.lg(),e=c.Hc;e.next();)g=e.value,g instanceof E&&km(a,g,d,b);z.dc(b);a.Fd.group=c;a.Fd.UA=d;a.Fd.yp=!1}else b&&lm(a.Fd);return a.Fd}
  function km(a,b,c,d){if(b!==c)if(b.isVisible()&&b.canAvoid()){c=b.getAvoidableRect(d);d=a.Fd.dp;b=a.Fd.bp;for(var e=c.x+c.width,g=c.y+c.height,h=c.x;h<e;h+=d){for(var k=c.y;k<g;k+=b)mm(a.Fd,h,k);mm(a.Fd,h,g)}for(k=c.y;k<g;k+=b)mm(a.Fd,e,k);mm(a.Fd,e,g)}else if(b instanceof F)for(b=b.Hc;b.next();)e=b.value,e instanceof E&&km(a,e,c,d)}function nm(a,b){null===a.Fd||a.Fd.yp||null!==b&&!b.canAvoid()||(a.Fd.yp=!0)}
  B.prototype.simulatedMouseMove=B.prototype.Rx=function(a,b,c){if(null!==Lh){var d=Lh.h;c instanceof B||(c=null);var e=Mh;c!==e&&(null!==e&&e!==d&&null!==e.gb.me&&(Rh(e),Lh.jx=!1,e.gb.me.doSimulatedDragLeave()),Mh=c,null!==c&&c!==d&&null!==c.gb.me&&(Yh(),e=c.gb.me,Uh.contains(e)||Uh.add(e),c.gb.me.doSimulatedDragEnter()));if(null===c||c===d||!c.FD||c.ib||!c.$o)return!1;d=c.gb.me;null!==d&&(null!==a?b=c.ko(a):null===b&&(b=new N),c.Qb.ga=b,c.Qb.Fl=!1,c.Qb.up=!1,d.doSimulatedDragOver());return!0}return!1};
  B.prototype.simulatedMouseUp=B.prototype.LF=function(a,b,c,d){if(null!==Lh){null===d&&(d=b);b=Mh;var e=Lh.h;if(d!==b){if(null!==b&&b!==e&&null!==b.gb.me)return Rh(b),Lh.jx=!1,b.gb.me.doSimulatedDragLeave(),!1;Mh=d;null!==d&&null!==d.gb.me&&(Yh(),b=d.gb.me,Uh.contains(b)||Uh.add(b),d.gb.me.doSimulatedDragEnter())}if(null===d)return Lh.doCancel(),!0;if(d!==this)return null!==a&&(c=d.ko(a)),d.Qb.ga=c,d.Qb.Fl=!1,d.Qb.up=!0,a=d.gb.me,null!==a&&a.doSimulatedDrop(),a=Lh,null!==a&&(d=a.mayCopy(),a.Mf=d?"Copy":
  "Move",a.stopTool()),!0}return!1};z.defineProperty(B,{MD:"autoScrollRegion"},function(){return this.Su},function(a){"number"===typeof a?a=new Db(a):z.l(a,Db,B,"autoScrollRegion");var b=this.Su;b.N(a)||(this.Su=a=a.V(),this.yc(),this.j("autoScrollRegion",b,a))});function ji(a,b){a.Ru.assign(b);om(a,a.Ru).Mc(a.position)?Rh(a):pm(a)}
  function pm(a){-1===a.In&&(a.In=z.setTimeout(function(){if(-1!==a.In){Rh(a);var b=a.R.event;if(null!==b){var c=om(a,a.Ru);c.Mc(a.position)||(a.position=c,a.R.ga=a.bG(a.Ru),a.Rx(b,null,b.target.Z)||a.doMouseMove(),a.Jj=!0,Pk(a,a.sh()),a.ve=!0,a.cg(),pm(a))}}},a.uB))}function Rh(a){-1!==a.In&&(z.clearTimeout(a.In),a.In=-1)}
  function om(a,b){var c=a.position,d=a.MD;if(0>=d.top&&0>=d.left&&0>=d.right&&0>=d.bottom)return c;var e=a.xb,g=a.scale,e=z.zk(0,0,e.width*g,e.height*g),h=z.Tb(0,0);if(b.x>=e.x&&b.x<e.x+d.left){var k=Math.max(a.nu,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.nu,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.ou,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.ou,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.Mc(Id)||(c=new N(c.x+h.x/g,c.y+h.y/g));z.dc(e);z.A(h);return c}B.prototype.makeSVG=B.prototype.makeSvg=function(a){void 0===a&&(a=new ma);a.context="svg";a=qm(this,a);return null!==a?a.Vl:null};
  B.prototype.makeImage=function(a){void 0===a&&(a=new ma);var b=(a.document||document).createElement("img");b.src=this.wI(a);return b};B.prototype.makeImageData=B.prototype.wI=function(a){void 0===a&&(a=new ma);var b=qm(this,a);return null!==b?b.toDataURL(a.type,a.details):""};var rm=!1;
  function qm(a,b){a.Va.pi();a.cg();if(null===a.Fb)return null;"object"!==typeof b&&z.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 g=b.maxSize;void 0===b.maxSize&&(c=!0,g="svg"===b.context?new Ea(Infinity,Infinity):new Ea(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 Db(l):l instanceof Db||(l=new Db(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.ao=!1;ca(a.gd,!0);var s=new la(null,p),t=s.zl,v=s;if(!(d||e||k||h))return s.width=a.Jb+Math.ceil(l.left+l.right),s.height=a.Ob+Math.ceil(l.top+l.bottom),"svg"===b.context&&(t=v=new ed(s.Ld,p,q),t instanceof ed&&
  (a.ao=!0)),sl(a,t,l,new Ea(s.width,s.height),a.bc,a.sb,k,m,r,n),a.ao=!0,v;var x=a.wb.Tw,y=new N(0,0),A=a.ad.copy();A.qJ(a.padding);if(r)for(var C=!0,C=a.Yb.o,L=C.length,H=0;H<L;H++){var U=C[H];if(U.visible&&U.Nc)for(var ea=U.mb.o,U=ea.length,W=0;W<U;W++){var P=ea[W];P.lx&&P.isVisible()&&(P=P.W,P.F()&&A.ri(P))}}y.x=A.x;y.y=A.y;if(null!==k){var ba,C=!0,ea=k.i;for(ea.reset();ea.next();)L=ea.value,L instanceof D&&(P=L,U=P.layer,null!==U&&!U.visible||null!==U&&!r&&U.Nc||!P.isVisible()||(P=P.W,P.F()&&(C?
  (C=!1,ba=P.copy()):ba.ri(P))));C&&(ba=new w(0,0,0,0));A.width=ba.width;A.height=ba.height;y.x=ba.x;y.y=ba.y}null!==h&&h.F()&&(y=h,e||(e=x));C=ea=0;null!==l&&(ea=l.left+l.right,C=l.top+l.bottom);H=L=0;null!==d&&(L=d.width,H=d.height,isFinite(L)&&(L=Math.max(0,L-ea)),isFinite(H)&&(H=Math.max(0,H-C)));ba=h=0;null!==d&&null!==e?("NaN"===e&&(e=x),d.F()?(h=L,ba=H):isNaN(H)?(h=L,ba=A.height*e):(h=A.width*e,ba=H)):null!==d?d.F()?(e=Math.min(L/A.width,H/A.height),h=L,ba=H):isNaN(H)?(e=L/A.width,h=L,ba=A.height*
  e):(e=H/A.height,h=A.width*e,ba=H):null!==e?"NaN"===e&&g.F()?(e=Math.min((g.width-ea)/A.width,(g.height-C)/A.height),e>x?(e=x,h=A.width,ba=A.height):(h=g.width,ba=g.height)):(h=A.width*e,ba=A.height*e):(e=x,h=A.width,ba=A.height);null!==l?(h+=ea,ba+=C):l=new Db(0);null!==g&&(d=g.width,g=g.height,"svg"!==b.context&&c&&!rm&&(h>d||ba>g)&&(z.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."),
  rm=!0),isNaN(d)&&(d=2E3),isNaN(g)&&(g=2E3),isFinite(d)&&(h=Math.min(h,d)),isFinite(g)&&(ba=Math.min(ba,g)));s.width=Math.ceil(h);s.height=Math.ceil(ba);"svg"===b.context&&(t=v=new ed(s.Ld,p,q),t instanceof ed&&(a.ao=!0));sl(a,t,l,new Ea(Math.ceil(h),Math.ceil(ba)),e,y,k,m,r,n);a.ao=!0;return v}B.inherit=function(a,b){z.g(a,"function",B,"inherit");z.g(b,"function",B,"inherit");b.BG&&z.k("Cannot inherit from "+z.kf(b));z.Ra(a,b)};
  function Bk(){this.EG="63ad05bbe23a1786468a4c741b6d2";this.pg=this.EG===this._tk?!0:null}
  Bk.prototype.Zl=function(a){a.gd.setTransform(a.jd,0,0,a.jd,0,0);if(null===this.pg)a:{var b="f",c=window[z.Gg("76a715b2f73f148a")][z.Gg("72ba13b5")];a=z.Gg;if(window[a("7da7")]&&window[a("7da7")][a("76a115b6ed251eaf4692")]){this.pg=!0;var d=window[a("7da7")][a("76a115b6ed251eaf4692")],d=a(d).split(a("39e9")),e=a(d[1]).split("."),g=z[a("6cae19")].split(".");if(e[0]>g[0]||e[0]===g[0]&&e[1]>=g[1]){e=c[a("76ad18b4f73e")];for(g=c[a("73a612b6fb191d")](a("35e7"))+2;g<e;g++)b+=c[g];c=b[a("73a612b6fb191d")](a(d[2]));
  0>c&&a(d[2])!==a("7da71ca0ad381e90")&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));0>c&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));this.pg=!(0<=c&&c<b[a("73a612b6fb191d")](a("35")))}}else{if(a("77bb5bb2f32603de")===window[a("76a715b2f73f148a")][a("6aba19a7ec351488")])try{this.pg=!window[a("4da118b7ec2108")]([a("5bb806bfea351a904a84515e1b6d38b6")])([a("49bc19a1e6")])([a("59bd04a1e6380fa5539b")])([a("7bb8069ae7")]===a(z.adym));if(!1===this.pg)break a;this.pg=!window[a("4da118b7ec2108")]([a("5bb806bfea351a904a84515e1b6d38b6")])([a("49bc19a1e6")])([a("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([a("7bb8069ae7")]===
  a(z.adym));if(!1===this.pg)break a}catch(h){}e=c[a("76ad18b4f73e")];for(g=c[a("73a612b6fb191d")](a("35e7"))+2;g<e;g++)b+=c[g];c=b[a("73a612b6fb191d")](a(z.adym));0>c&&a(z.adym)!==a("7da71ca0ad381e90")&&(c=b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));if(this.pg=!(0<=c&&c<b[a("73a612b6fb191d")](a("35"))))b=window.document[a("79ba13b2f7333e8846865a7d00")]("div"),c=a("02cncncn"),"."===c[0]&&(c=c[a("69bd14a0f724128a44")](1)),b[a("79a417a0f0181a8946")]=c,window.document[a("78a712aa")]?(window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](b),
  c=window[a("7dad0290ec3b0b91578e5b40007031bf")](b)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")),window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](b),c&&-1!==c.indexOf(a(z.aH))&&-1!==c.indexOf(a(z.bH))&&(this.pg=!1)):(this.pg=null,this.pg=!1)}}return 0<this.pg&&this!==this.CG?!0:!1};Bk.prototype.t=function(){this.CG=null};
  function Ck(a,b){void 0!==b&&null!==b||z.k("Diagram setup requires an argument DIV.");null!==a.Pb&&z.k("Diagram has already completed setup.");"string"===typeof b?a.Pb=window.document.getElementById(b):b instanceof HTMLDivElement?a.Pb=b:z.k("No DIV or DIV id supplied: "+b);null===a.Pb&&z.k("Invalid DIV id; could not get element with id: "+b);void 0!==a.Pb.Z&&z.k("Invalid div id; div already has a Diagram associated with it.");"static"===window.getComputedStyle(a.Pb,null).position&&(a.Pb.style.position=
  "relative");a.Pb.style["-webkit-tap-highlight-color"]="rgba(255, 255, 255, 0)";a.Pb.style["-ms-touch-action"]="none";a.Pb.innerHTML="";a.Pb.Z=a;var c=new la(a);c.Ld.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.Pb,null).getPropertyValue("direction")&&(a.mr=!0),c.style.zIndex="2",c.style.DL="none",c.style.webkitUserSelect="none",c.style.MozUserSelect=
  "none");a.Jb=a.Pb.clientWidth||1;a.Ob=a.Pb.clientHeight||1;a.Fb=c;a.gd=c.zl;var d=a.gd;a.uG=(window.devicePixelRatio||1)/(d.webkitBackingStorePixelRatio||d.mozBackingStorePixelRatio||d.msBackingStorePixelRatio||d.oBackingStorePixelRatio||d.backingStorePixelRatio||1);a.jd=a.computePixelRatio();ul(a,a.Jb,a.Ob);a.Fy=d[z.Gg("7eba17a4ca3b1a8346")][z.Gg("78a118b7")](d,z.Zl,4,4);a.Pb.insertBefore(c.Ld,a.Pb.firstChild);c=new la(null);c.width=1;c.height=1;a.Ey=c;a.aC=c.zl;var c=z.createElement("div"),e=z.createElement("div");
  c.style.position="absolute";c.style.overflow="auto";c.style.width=a.Jb+"px";c.style.height=a.Ob+"px";c.style.zIndex="1";e.style.position="absolute";e.style.width="1px";e.style.height="1px";a.Pb.appendChild(c);c.appendChild(e);c.onscroll=a.wG;c.onmousedown=a.JC;c.ontouchstart=a.JC;c.Z=a;c.zG=!0;c.AG=!0;a.lw=c;a.xs=e;a.HA=z.$D(function(){a.dk=null;a.ta()},300,!1);a.gG=z.$D(function(){Uj(a)},250,!1);a.preventDefault=function(a){a.preventDefault();return!1};a.Kp=function(b){if(a.isEnabled){a.jm=!0;var c=
  a.Zc;z.hn&&c.mj?(b.preventDefault(),b.simulated=!0,a.Ks=b):(a.Zc=a.Qb,a.Qb=c,Sk(a,a,b,c,!0),a.Rx(b,null,b.target.Z)||(a.doMouseMove(),a.cb.isBeyondDragSize()&&(a.cl=0),ha(a,c,b)))}};a.Jp=function(b){if(a.isEnabled){a.jm=!0;var c=a.Zc;if(z.hn&&null!==a.Ks)a.Ks=b,b.preventDefault();else if(z.hn&&400>b.timeStamp-a.om)b.preventDefault();else if(a.$k)b.preventDefault();else{a.Zc=a.Qb;a.Qb=c;Sk(a,a,b,c,!0);c.Fl=!0;c.Pe=b.detail;if(z.ME||z.NE)b.timeStamp-a.om<a.tD&&!a.cb.isBeyondDragSize()?a.cl++:a.cl=1,
  a.om=b.timeStamp,c.Pe=a.cl;a.Fi=c;!0===c.Yq.simulated?(b.preventDefault(),b.simulated=!0):(u&&u.eF&&(window.eF=a.lp(c.ga)),Lh=null,a.doMouseDown(),a.Fi=a.Fi.copy(),1===b.button?b.preventDefault():ha(a,c,b))}}};a.Mp=function(b){if(a.isEnabled)if(a.$k&&2===b.button)b.preventDefault();else if(a.$k&&0===b.button&&(a.$k=!1),a.Ss)b.preventDefault();else{a.jm=!0;var c=a.Zc;if(z.hn){if(400>b.timeStamp-a.om){b.preventDefault();return}a.om=b.timeStamp}if(z.hn&&null!==a.Ks)a.Ks=null,b.preventDefault();else{a.Zc=
  a.Qb;a.Qb=c;Sk(a,a,b,c,!0);c.up=!0;c.Pe=b.detail;if(z.ME||z.NE)c.Pe=a.cl;c.bubbles=b.bubbles;b.target.Z&&(c.Tg=b.target.Z);a.LF(b,null,new N,c.Tg)||(a.doMouseUp(),Rh(a),ha(a,c,b))}}};a.Bh=function(b){if(a.isEnabled){var c=a.Zc;a.Zc=a.Qb;a.Qb=c;Sk(a,a,b,c,!0);c.bubbles=!0;c.Dl=void 0!==b.wheelDelta?b.wheelDelta:-40*b.detail;a.doMouseWheel();ha(a,c,b)}};a.Lp=function(){if(a.isEnabled){a.jm=!1;var b=a.cb;b.cancelWaitAfter();b instanceof gh&&b.hideToolTip()}};a.YF=function(b){if(a.isEnabled){a.Ss=!1;
  a.$k=!0;var c=a.Zc;a.Zc=a.Qb;a.Qb=c;Uk(a,b,b.targetTouches[0],c,1<b.touches.length);a.doMouseDown();ha(a,c,b)}};a.XF=function(b){if(a.isEnabled){var c=a.Zc;a.Zc=a.Qb;a.Qb=c;var d=null;0<b.changedTouches.length?d=b.changedTouches[0]:0<b.targetTouches.length&&(d=b.targetTouches[0]);Vk(a,b,d,c,1<b.touches.length);a.Rx(d?d:b,null,c.Tg)||a.doMouseMove();ha(a,c,b)}};a.WF=function(b){if(a.isEnabled)if(a.Ss)b.preventDefault();else{var c=a.Zc;a.Zc=a.Qb;a.Qb=c;if(1<b.touches.length)a.rp("hasGestureZoom")&&
  (a.Ny=!1);else{var d=null,e=null;0<b.changedTouches.length?e=b.changedTouches[0]:0<b.targetTouches.length&&(e=b.targetTouches[0]);c.h=a;c.Pe=1;if(null!==e){d=window.document.elementFromPoint(e.clientX,e.clientY);null!==d&&d.Z instanceof B&&d.Z!==a&&Tk(d.Z,e,c);Tk(a,b.changedTouches[0],c);var m=e.screenX,n=e.screenY,p=a.zC;b.timeStamp-a.om<a.tD&&!(25<Math.abs(p.x-m)||25<Math.abs(p.y-n))?a.cl++:a.cl=1;c.Pe=a.cl;a.om=b.timeStamp;a.zC.n(m,n)}c.yd=0;c.button=0;c.buttons=1;c.Fl=!1;c.up=!0;c.Dl=0;c.Gc=!1;
  c.bubbles=!1;c.event=b;c.timestamp=Date.now();c.Tg=null===d?b.target.Z:d.Z?d.Z:null;c.Ge=null;a.LF(e?e:b,null,new N,c.Tg)||a.doMouseUp();ha(a,c,b);a.$k=!1}}};a.OI=function(b){if("touch"===b.pointerType){var c=a.TC;void 0===c[b.pointerId]&&(a.bw++,c[b.pointerId]=b);a.Uf[0]=null;a.Uf[1]=null;for(var d in c)if(null===a.Uf[0])a.Uf[0]=c[d];else if(null===a.Uf[1]){a.Uf[1]=c[d];break}a.isEnabled&&(a.Ss=!1,a.$k=!0,c=a.Zc,a.Zc=a.Qb,a.Qb=c,Uk(a,b,b,c,1<a.bw),a.doMouseDown(),ha(a,c,b))}};a.RI=function(b){if("touch"===
  b.pointerType&&!(2>a.bw)){var c=a.Uf;c[0].pointerId===b.pointerId&&(c[0]=b);c[1].pointerId===b.pointerId&&(c[1]=b);a.isEnabled&&(c=a.Zc,a.Zc=a.Qb,a.Qb=c,Vk(a,b,b,c,!0),a.Rx(b,null,c.Tg)||(a.doMouseMove(),ha(a,c,b)))}};a.QI=function(b){if("touch"===b.pointerType){var c=a.TC;void 0!==c[b.pointerId]&&(a.bw--,delete c[b.pointerId],c=a.Uf,null!==c[0]&&c[0].pointerId===b.pointerId&&(c[0]=null),null!==c[1]&&c[1].pointerId===b.pointerId&&(c[1]=null))}};ca(d,!0);Fk(a)}
  function sm(a){1<arguments.length&&z.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");B.call(this,a);this.kt=!0;this.vl=!1;this.ib=!0;this.WD=$b;this.Sb=new tm}z.Ra(sm,B);z.ia("Palette",sm);
  function yk(a){1<arguments.length&&z.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");B.call(this,a);this.Va.isEnabled=!1;this.Vc=!0;this.Xj=null;this.lv=!0;this.jJ("drawShadows",!1);var b=new D,c=new X;c.stroke="magenta";c.ub=2;c.fill="transparent";c.name="BOXSHAPE";b.wk=!0;b.Kx="BOXSHAPE";b.ux="BOXSHAPE";b.vF="BOXSHAPE";b.cursor="move";b.add(c);this.dm=b;c=new da;c.type=$i;c.of=ec;var d=new aj;d.Ff=!0;c.add(d);d=new X;d.kk=ec;d.Hb="Rectangle";d.Aa=new Ea(64,
  64);d.cursor="se-resize";d.alignment=ic;c.add(d);b.tF=c;this.Rm=this.lk=!1;this.xf=this.mt=!0;this.MD=0;this.qz=new la(null);this.DG=this.qz.zl;this.gb.me=new um;this.gb.wF=new vm;var e=this;this.click=function(){var a=e.Xj;if(null!==a){var b=a.xb,c=e.R.ga;a.position=new N(c.x-b.width/2,c.y-b.height/2)}};this.gF=function(){wm(e)};this.fF=function(){null!==e.Xj&&(e.yc(),e.ta())};this.xl=Qk;this.Vc=!1}z.Ra(yk,B);z.ia("Overview",yk);
  function xm(a){a.Vc||a.Vd||!1!==a.Wf||(a.Wf=!0,requestAnimationFrame(function(){if(a.Wf&&!a.Vd&&(a.Wf=!1,null!==a.Pb)){a.Vd=!0;Kk(a);a.ad.F()||Pk(a,a.sh());null===a.Pb&&z.k("No div specified");null===a.Fb&&z.k("No canvas specified");if(a.ve){var b=a.Xj;if(null!==b&&!b.Va.nf&&!b.Va.wc){var b=a.gd,c=a.qz;b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,a.Fb.width,a.Fb.height);b.drawImage(c.Ld,0,0);c=a.Jd;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.jd,a.jd);b.transform(c.m11,c.m12,c.m21,c.m22,c.dx,c.dy);for(var c=a.Yb.o,d=c.length,e=0;e<d;e++)c[e].ff(b,a);a.Zk=!1;a.ve=!1}}a.Vd=!1}}))}yk.prototype.computePixelRatio=function(){return 1};
  yk.prototype.ff=function(){null===this.Pb&&z.k("No div specified");null===this.Fb&&z.k("No canvas specified");if(this.ve){var a=this.Xj;if(null!==a&&!a.Va.nf){pl(this);var b=a.tp;(null!==b&&b.visible&&isNaN(b.width)||isNaN(b.height))&&$k(a);var c=this.Fb,b=this.gd,d=this.qz,e=this.DG;d.width=c.width;d.height=c.height;ca(b,!0);b.setTransform(1,0,0,1,0,0);b.clearRect(0,0,c.width,c.height);var g=this.Jd;g.reset();1!==this.scale&&g.scale(this.scale);0===this.position.x&&0===this.position.y||g.translate(-this.position.x,
  -this.position.y);b.scale(this.jd,this.jd);b.transform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);for(var h=this.lv,k=this.xb,l=a.Yb.o,m=l.length,a=0;a<m;a++){var n=l[a],p=b,q=k,r=h;if(n.visible&&0!==n.Xc&&(void 0===r&&(r=!0),r||!n.Nc)){1!==n.Xc&&(p.globalAlpha=n.Xc);for(var r=this.scale,n=n.mb.o,s=n.length,t=0;t<s;t++){var v=n[t],x=v.W;x.Jg(q)&&(1<x.width*r||1<x.height*r?v.ff(p,this):kk(v,p))}p.globalAlpha=1}}e.drawImage(c.Ld,0,0);u&&u.cj&&(e.fillStyle="red",e.fillRect(0,d.height/2,d.width,4));c=this.Yb.o;
  d=c.length;for(a=0;a<d;a++)c[a].ff(b,this);u&&(u.Sz||u.cj)&&u.Rz(b,this,g);this.ve=this.Zk=!1}}};
  z.defineProperty(yk,{BA:"observed"},function(){return this.Xj},function(a){var b=this.Xj;null!==a&&z.l(a,B,yk,"observed");a instanceof yk&&z.k("Overview.observed Diagram may not be an Overview itself: "+a);b!==a&&(null!==b&&(this.remove(this.rh),b.lF("ViewportBoundsChanged",this.gF),b.lF("DocumentBoundsChanged",this.fF),b.Yv.remove(this)),this.Xj=a,null!==a&&(a.Az("ViewportBoundsChanged",this.gF),a.Az("DocumentBoundsChanged",this.fF),a.Yv.add(this),this.add(this.rh),wm(this)),this.yc(),this.j("observed",
  b,a))});z.defineProperty(yk,{rh:"box"},function(){return this.dm},function(a){var b=this.dm;b!==a&&(this.dm=a,this.remove(b),this.add(this.dm),wm(this),this.j("box",b,a))});z.defineProperty(yk,{yK:"drawsTemporaryLayers"},function(){return this.lv},function(a){this.lv!==a&&(this.lv=a,this.Sp())});
  function wm(a){var b=a.rh;if(null!==b){var c=a.Xj;if(null!==c){a.ve=!0;var c=c.xb,d=b.un,e=z.Xl();e.n(c.width,c.height);d.Aa=e;z.qk(e);a=2/a.scale;d instanceof X&&(d.ub=a);b.location=new N(c.x-a/2,c.y-a/2)}}}yk.prototype.sh=function(){var a=this.Xj;return null===a?Jd:a.ad};yk.prototype.GE=function(){!0!==this.ve&&(this.ve=!0,xm(this))};yk.prototype.fu=function(a){this.Vc||(Jk(this),this.ta(),Wk(this),this.yc(),wm(this),this.Ja("ViewportBoundsChanged",null,a))};
  function um(){lh.call(this);this.kl=null}z.Ra(um,lh);um.prototype.canStart=function(){if(!this.isEnabled)return!1;var a=this.h;if(null===a||!a.vl||!a.xf)return!1;var b=a.BA;if(null===b)return!1;if(null===this.findDraggablePart()){var c=b.xb;this.kl=new N(c.width/2,c.height/2);a=a.Fc.ga;b.position=new N(a.x-this.kl.x,a.y-this.kl.y)}return!0};um.prototype.doActivate=function(){this.kl=null;lh.prototype.doActivate.call(this)};
  um.prototype.moveParts=function(){var a=this.h,b=a.BA;if(null!==b){var c=a.rh;if(null!==c){if(null===this.kl){var d=a.Fc.ga,c=c.location;this.kl=new N(d.x-c.x,d.y-c.y)}a=a.R.ga;b.position=new N(a.x-this.kl.x,a.y-this.kl.y)}}};function vm(){Zi.call(this)}z.Ra(vm,Zi);vm.prototype.resize=function(a){var b=this.h.BA;if(null!==b){var c=b.xb.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 Da(a){1<arguments.length&&z.k("Brush constructor can take at most one optional argument, the Brush type.");z.kc(this);this.G=!1;void 0===a?(this.ba=ug,this.Mn="black"):"string"===typeof a?(this.ba=ug,u&&!Ca(a)&&z.k('Color "'+a+'" is not a valid color string for Brush constructor'),this.Mn=a):(u&&z.Ba(a,Da,Da,"constructor:type"),this.ba=a,this.Mn="black");var b=this.ba;b===vg?(this.Oo=$b,this.co=hc):this.co=b===yd?this.Oo=ec:this.Oo=Yb;this.sw=0;this.mv=NaN;this.bh=this.aw=this.ah=null;this.vy=
  this.Nn=0}z.ia("Brush",Da);var ug;Da.Solid=ug=z.s(Da,"Solid",0);var vg;Da.Linear=vg=z.s(Da,"Linear",1);var yd;Da.Radial=yd=z.s(Da,"Radial",2);var ym;Da.Pattern=ym=z.s(Da,"Pattern",4);Da.prototype.copy=function(){var a=new Da;a.ba=this.ba;a.Mn=this.Mn;a.Oo=this.Oo.V();a.co=this.co.V();a.sw=this.sw;a.mv=this.mv;null!==this.ah&&(a.ah=this.ah.copy());a.aw=this.aw;return a};Da.prototype.La=function(){this.freeze();Object.freeze(this);return this};
  Da.prototype.freeze=function(){this.G=!0;null!==this.ah&&this.ah.freeze();return this};Da.prototype.Wa=function(){Object.isFrozen(this)&&z.k("cannot thaw constant: "+this);this.G=!1;null!==this.ah&&this.ah.Wa();return this};
  Da.prototype.toString=function(){var a="Brush(";if(this.type===ug)a+=this.color;else if(a=this.type===vg?a+"Linear ":this.type===yd?a+"Radial ":this.type===ym?a+"Pattern ":a+"(unknown) ",a+=this.start+" "+this.end,null!==this.st)for(var b=this.st.i;b.next();)a+=" "+b.key+":"+b.value;return a+")"};
  Da.prototype.addColorStop=Da.prototype.addColorStop=function(a,b){this.G&&z.oa(this);("number"!==typeof a||!isFinite(a)||1<a||0>a)&&z.ka(a,"0 <= loc <= 1",Da,"addColorStop:loc");z.g(b,"string",Da,"addColorStop:color");u&&!Ca(b)&&z.k('Color "'+b+'" is not a valid color string for Brush.addColorStop');null===this.ah&&(this.ah=new na("number","string"));this.ah.add(a,b);this.ba===ug&&(this.type=vg);this.bh=null};
  z.defineProperty(Da,{type:"type"},function(){return this.ba},function(a){this.G&&z.oa(this,a);z.Ba(a,Da,Da,"type");this.ba=a;this.start.Be()&&(a===vg?this.start=$b:a===yd&&(this.start=ec));this.end.Be()&&(a===vg?this.end=hc:a===yd&&(this.end=ec));this.bh=null});z.defineProperty(Da,{color:"color"},function(){return this.Mn},function(a){this.G&&z.oa(this,a);u&&!Ca(a)&&z.k('Color "'+a+'" is not a valid color string for Brush.color');this.Mn=a;this.bh=null});
  z.defineProperty(Da,{start:"start"},function(){return this.Oo},function(a){this.G&&z.oa(this,a);z.l(a,Q,Da,"start");this.Oo=a.V();this.bh=null});z.defineProperty(Da,{end:"end"},function(){return this.co},function(a){this.G&&z.oa(this,a);z.l(a,Q,Da,"end");this.co=a.V();this.bh=null});z.defineProperty(Da,{wu:"startRadius"},function(){return this.sw},function(a){this.G&&z.oa(this,a);z.p(a,Da,"startRadius");0>a&&z.ka(a,">= zero",Da,"startRadius");this.sw=a;this.bh=null});
  z.defineProperty(Da,{xt:"endRadius"},function(){return this.mv},function(a){this.G&&z.oa(this,a);z.p(a,Da,"endRadius");0>a&&z.ka(a,">= zero",Da,"endRadius");this.mv=a;this.bh=null});z.defineProperty(Da,{st:"colorStops"},function(){return this.ah},function(a){this.G&&z.oa(this,a);u&&z.l(a,na,Da,"colorStops");this.ah=a;this.bh=null});z.defineProperty(Da,{pattern:"pattern"},function(){return this.aw},function(a){this.G&&z.oa(this,a);this.aw=a;this.bh=null});
  Da.randomColor=function(a,b){void 0===a&&(a=128);u&&(z.p(a,Da,"randomColor:min"),(0>a||255<a)&&z.ka(a,"0 <= min <= 255",Da,"randomColor:min"));void 0===b&&(b=Math.max(a,255));u&&(z.p(b,Da,"randomColor:max"),(b<a||255<b)&&z.ka(b,"min <= max <= 255",Da,"randomColor:max"));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 zm=(new la(null)).zl,Ca;Da.isValidColor=Ca=function(a){if("black"===a)return!0;if(""===a)return!1;u&&z.g(a,"string",Da,"isValidColor");zm.fillStyle="#000000";var b=zm.fillStyle;zm.fillStyle=a;if(zm.fillStyle!==b)return!0;zm.fillStyle="#FFFFFF";b=zm.fillStyle;zm.fillStyle=a;return zm.fillStyle!==b};
  function O(){z.kc(this);this.ja=30723;this.Xc=1;this.mh=null;this.Ub="";this.uc=this.Nb=null;this.sb=(new N(NaN,NaN)).freeze();this.tf=fe;this.Uj=Pd;this.Sj=de;this.Jd=new Fa;this.Ak=new Fa;this.gl=new Fa;this.bc=this.jv=1;this.bm=0;this.ei=Am;this.Er=Kd;this.vd=(new w(NaN,NaN,NaN,NaN)).freeze();this.Xb=(new w(NaN,NaN,NaN,NaN)).freeze();this.Wc=(new w(0,0,NaN,NaN)).freeze();this.Vs=this.Zq=this.la=this.fs=this.gs=null;this.Ws=this.$q=Infinity;this.oq=this.Ie=Pc;this.us=0;this.Ui=1;this.wq=0;this.xi=
  1;this.Os=null;this.zs=-Infinity;this.ys=0;this.As=Id;this.Bs=Qi;this.Hq="";this.Ac=this.ma=null;this.Jn=-1;this.Am=this.Js=this.wi=this.Qk=this.No=null}z.ji(O);z.ia("GraphObject",O);
  O.prototype.cloneProtected=function(a){a.ja=this.ja|6144;a.Xc=this.Xc;a.Ub=this.Ub;a.Nb=this.Nb;a.uc=this.uc;a.sb.assign(this.sb);a.tf=this.tf.V();a.Uj=this.Uj.V();a.Sj=this.Sj.V();a.gl=this.gl.copy();a.bc=this.bc;a.bm=this.bm;a.ei=this.ei;a.Er=this.Er.V();a.vd.assign(this.vd);a.Xb.assign(this.Xb);a.Wc.assign(this.Wc);a.fs=this.fs;null!==this.la&&(a.la=this.la.copy());a.Zq=this.Zq;a.Vs=this.Vs;a.$q=this.$q;a.Ws=this.Ws;a.Ie=this.Ie.V();a.oq=this.oq.V();a.us=this.us;a.Ui=this.Ui;a.wq=this.wq;a.xi=
  this.xi;a.Os=this.Os;a.zs=this.zs;a.ys=this.ys;a.As=this.As.V();a.Bs=this.Bs;a.Hq=this.Hq;null!==this.ma&&(a.ma=this.ma.copy());a.Ac=this.Ac;a.Jn=this.Jn;null!==this.Qk&&(a.Qk=z.Al(this.Qk));null!==this.wi&&(a.wi=this.wi.copy());a.Js=this.Js};O.prototype.addCopyProperty=O.prototype.MG=function(a){var b=this.Qk;if(z.isArray(b))for(var c=0;c<b.length;c++){if(b[c]===a)return}else this.Qk=b=[];b.push(a)};O.prototype.ki=function(a){a.gs=null;a.Am=null;a.Q()};
  O.prototype.clone=function(){var a=new this.constructor;this.cloneProtected(a);if(null!==this.Qk)for(var b=0;b<this.Qk.length;b++){var c=this.Qk[b];a[c]=this[c]}return a};O.prototype.copy=function(){return this.clone()};O.prototype.toString=function(){return z.kf(Object.getPrototypeOf(this))+"#"+z.nd(this)};var bj;O.None=bj=z.s(O,"None",0);var Am;O.Default=Am=z.s(O,"Default",0);var Bm;O.Vertical=Bm=z.s(O,"Vertical",4);var Cm;O.Horizontal=Cm=z.s(O,"Horizontal",5);var lf;O.Fill=lf=z.s(O,"Fill",3);var dj;
  O.Uniform=dj=z.s(O,"Uniform",1);var ej;O.UniformToFill=ej=z.s(O,"UniformToFill",2);function Dm(a){null===a.ma&&(a.ma=new Em)}O.prototype.Ue=function(){if(null===this.la){var a=new Fm;a.Hj=Yb;a.hk=Yb;a.Fj=10;a.fk=10;a.Ej=Gm;a.ek=Gm;a.Gj=0;a.gk=0;this.la=a}};
  function Hm(a,b,c,d,e,g,h){var k=.001,l=g.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=g[n++%l];for(k-=h;0>k;)k+=g[n++%l],p=!p;q=!1}else k=g[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}}O.prototype.raiseChangedEvent=O.prototype.Rc=function(a,b,c,d,e,g,h){var k=this.ca;null!==k&&(k.sn(a,b,c,d,e,g,h),0!==(this.ja&1024)&&c===this&&a===Uf&&Im(this,k,b))};
  function Im(a,b,c){var d=a.np();if(null!==d)for(var e=a.Ac.i;e.next();){var g=e.value,h=null;if(null!==g.xn){h=ch(g,d,a);if(null===h)continue;g.Tx(a,h,c,null)}else if(g.St){var k=b.h;null===k||k.Ee||g.Tx(a,k.ha.uk,c,k)}else{var l=d.data;if(null===l)continue;k=b.h;null===k||k.Ee||g.Tx(a,l,c,k)}null!==h&&(k=d.Zw(g.Wl),null!==k&&g.eG(k,h,c))}}O.prototype.Zw=function(a){return this.Jn===a?this:null};O.prototype.raiseChanged=O.prototype.j=function(a,b,c){this.Rc(Uf,a,this,b,c)};
  function Jm(a,b,c,d,e){var g=a.vd,h=a.gl;h.reset();Km(a,h,b,c,d,e);a.gl=h;g.x=b;g.y=c;g.width=d;g.height=e;h.Pt()||h.aG(g)}function Lm(a,b,c,d){if(!1===a.jg)return!1;d.multiply(a.transform);return c?a.Jg(b,d):a.Xm(b,d)}
  O.prototype.rE=function(a,b,c){if(!1===this.jg)return!1;var d=this.Ga;b=a.Af(b);var e=!1;c&&(e=ub(a.x,a.y,0,0,0,d.height)<b||ub(a.x,a.y,0,d.height,d.width,d.height)<b||ub(a.x,a.y,d.width,d.height,d.width,0)<b||ub(a.x,a.y,d.width,0,0,0)<b);c||(e=ub(a.x,a.y,0,0,0,d.height)<b&&ub(a.x,a.y,0,d.height,d.width,d.height)<b&&ub(a.x,a.y,d.width,d.height,d.width,0)<b&&ub(a.x,a.y,d.width,0,0,0)<b);return e};O.prototype.Wg=function(){return!0};
  O.prototype.containsPoint=O.prototype.Ma=function(a){u&&z.l(a,N,O,"containsPoint:p");var b=z.O();b.assign(a);this.transform.Cb(b);var c=this.W;if(!c.F())return z.A(b),!1;var d=this.h;if(null!==d&&d.$k){var e=d.rp("extraTouchThreshold"),g=d.rp("extraTouchArea"),h=g/2,k=this.Ga,d=this.hj()*d.scale,l=1/d;if(k.width*d<e&&k.height*d<e)return a=Ib(c.x-h*l,c.y-h*l,c.width+g*l,c.height+g*l,b.x,b.y),z.A(b),a}if(this instanceof da||this instanceof X?Ib(c.x-5,c.y-5,c.width+10,c.height+10,b.x,b.y):c.Ma(b))return e=
  !1,e=this.wi&&!this.wi.Ma(b)?!1:null!==this.uc&&c.Ma(b)?!0:null!==this.Nb&&this.Wc.Ma(a)?!0:this.mk(a),z.A(b),e;z.A(b);return!1};O.prototype.mk=function(a){var b=this.Ga;return Ib(0,0,b.width,b.height,a.x,a.y)};
  O.prototype.containsRect=O.prototype.nk=function(a){u&&z.l(a,w,O,"containsRect:r");if(0===this.angle)return this.W.nk(a);var b=this.Ga,b=z.zk(0,0,b.width,b.height),c=this.transform,d=!1,e=z.Tb(a.x,a.y);b.Ma(c.li(e))&&(e.n(a.x,a.bottom),b.Ma(c.li(e))&&(e.n(a.right,a.bottom),b.Ma(c.li(e))&&(e.n(a.right,a.y),b.Ma(c.li(e))&&(d=!0))));z.A(e);z.dc(b);return d};
  O.prototype.containedInRect=O.prototype.Xm=function(a,b){u&&z.l(a,w,O,"containedInRect:r");if(void 0===b)return a.nk(this.W);var c=this.Ga,d=!1,e=z.Tb(0,0);a.Ma(b.Cb(e))&&(e.n(0,c.height),a.Ma(b.Cb(e))&&(e.n(c.width,c.height),a.Ma(b.Cb(e))&&(e.n(c.width,0),a.Ma(b.Cb(e))&&(d=!0))));z.A(e);return d};
  O.prototype.intersectsRect=O.prototype.Jg=function(a,b){u&&z.l(a,w,O,"intersectsRect:r");if(void 0===b&&(b=this.transform,0===this.angle))return a.Jg(this.W);var c=this.Ga,d=b,e=z.Tb(0,0),g=z.Tb(0,c.height),h=z.Tb(c.width,c.height),k=z.Tb(c.width,0),l=!1;if(a.Ma(d.Cb(e))||a.Ma(d.Cb(g))||a.Ma(d.Cb(h))||a.Ma(d.Cb(k)))l=!0;else{var c=z.zk(0,0,c.width,c.height),m=z.Tb(a.x,a.y);c.Ma(d.li(m))?l=!0:(m.n(a.x,a.bottom),c.Ma(d.li(m))?l=!0:(m.n(a.right,a.bottom),c.Ma(d.li(m))?l=!0:(m.n(a.right,a.y),c.Ma(d.li(m))&&
  (l=!0))));z.A(m);z.dc(c);!l&&(Pe(a,e,g)||Pe(a,g,h)||Pe(a,h,k)||Pe(a,k,e))&&(l=!0)}z.A(e);z.A(g);z.A(h);z.A(k);return l};O.prototype.getDocumentPoint=O.prototype.eb=function(a,b){void 0===b&&(b=new N);a.Be()&&z.k("getDocumentPoint:s Spot must be specific: "+a.toString());var c=this.Ga;b.n(a.x*c.width+a.offsetX,a.y*c.height+a.offsetY);this.qh.Cb(b);return b};
  O.prototype.getDocumentAngle=O.prototype.Kl=function(){var a;a=this.qh;1===a.m11&&0===a.m12?a=0:(a=180*Math.atan2(a.m12,a.m11)/Math.PI,0>a&&(a+=360));return a};O.prototype.getDocumentScale=O.prototype.hj=function(){if(0!==(this.ja&4096)===!1)return this.jv;var a=this.bc;return null!==this.T?a*this.T.hj():a};O.prototype.getLocalPoint=O.prototype.wE=function(a,b){void 0===b&&(b=new N);b.assign(a);this.qh.li(b);return b};
  O.prototype.getNearestIntersectionPoint=O.prototype.xE=function(a,b,c){return this.sp(a.x,a.y,b.x,b.y,c)};f=O.prototype;f.sp=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy);if(null!==this.wl)return g=this.W,Ne(g.left,g.top,g.right,g.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.n(0,0);d=this.Ga;c=Ne(0,0,d.width,d.height,h,a,b,c,e);e.transform(g);return c};
  function tj(a,b,c,d,e){if(!1!==ml(a)){var g=a.margin,h=g.right+g.left,g=g.top+g.bottom;b=Math.max(b-h,0);c=Math.max(c-g,0);e=e||0;d=Math.max((d||0)-h,0);e=Math.max(e-g,0);var h=a.angle,g=0,g=a.Aa,k=0;a.ub&&(k=a.ub);90===h||270===h?(b=isFinite(g.height)?g.height+k:b,c=isFinite(g.width)?g.width+k:c):(b=isFinite(g.width)?g.width+k:b,c=isFinite(g.height)?g.height+k:c);var g=d||0,k=e||0,l=a instanceof I;switch(Mm(a,!0)){case bj:k=g=0;l&&(c=b=Infinity);break;case lf:isFinite(b)&&b>d&&(g=b);isFinite(c)&&
  c>e&&(k=c);break;case Cm:isFinite(b)&&b>d&&(g=b);k=0;l&&(c=Infinity);break;case Bm:isFinite(c)&&c>e&&(k=c),g=0,l&&(b=Infinity)}var l=a.Xe,m=a.dg;g>l.width&&m.width<l.width&&(g=l.width);k>l.height&&m.height<l.height&&(k=l.height);d=Math.max(g/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)g=b,b=c,c=g,g=d,d=e,e=g;a.vd.Wa();a.Ip(b,c,
  d,e);a.vd.freeze();a.vd.F()||z.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.vd.toString());Yk(a,!1)}}
  f.Lc=function(a,b,c,d,e){this.Gi();var g=z.lg();g.assign(this.Xb);this.Xb.Wa();if(!1===nl(this)){var h=this.Xb;h.x=a;h.y=b;h.width=c;h.height=d}else this.aj(a,b,c,d);this.Xb.freeze();this.wi=void 0===e?null:e;c=!1;void 0!==e?c=!0:null!==this.T&&(e=this.T.Wc,d=this.Ia,null!==this.wl&&(d=this.Xb),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 qa&&(a=this.Wc,this.Kv>a.height||this.Oj.cf>a.width))&&(c=!0);this.ja=c?this.ja|256:this.ja&-257;this.Xb.F()||
  z.k("Non-real actualBounds has been set. Object "+this+", actualBounds: "+this.Xb.toString());this.xx(g,this.Xb);z.dc(g)};f.aj=function(){};
  function Nm(a,b,c,d,e){var g=a.W;g.x=b;g.y=c;g.width=d;g.height=e;if(!a.Aa.F()){g=a.vd;c=a.margin;b=c.right+c.left;var h=c.top+c.bottom;c=g.width+b;g=g.height+h;d+=b;e+=h;b=Mm(a,!0);c===d&&g===e&&(b=bj);switch(b){case bj:if(c>d||g>e)Yk(a,!0),tj(a,c>d?d:c,g>e?e:g);break;case lf:Yk(a,!0);tj(a,d,e,0,0);break;case Cm:Yk(a,!0);tj(a,d,g,0,0);break;case Bm:Yk(a,!0),tj(a,c,e,0,0)}}}
  f.xx=function(a,b){Om(this,!1);var c=this.ca;if(null!==c&&null!==c.h){var d=this.ca;null!==d&&(d.un!==this&&d.uF!==this&&d.yF!==this||Pm(d,!0));this.ta();a.N(b)||(c.Nl(),this.Tv(c))}};f.Tv=function(a){null!==this.zd&&Pm(a,!0)};z.defineProperty(O,{bq:"shadowVisible"},function(){return this.Js},function(a){var b=this.Js;b!==a&&(u&&null!==a&&z.g(a,"boolean",O,"shadowVisible"),this.Js=a,this.j("shadowVisible",b,a))});
  O.prototype.ff=function(a,b){if(this.visible){var c=this.Xb;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 ed)a:{if(this.visible){var g=null,h=a.px;if(this instanceof I&&(this.type===Qm||this.type===Rm))Sm(this,a,b);else{var k=this.Xb;if(0!==k.width&&0!==k.height&&!isNaN(k.x)&&!isNaN(k.y)){var l=this.transform,m=this.T;0!==(this.ja&4096)===!0&&Tm(this);var c=0!==(this.ja&256),n=!1;this instanceof
  qa&&(a.font=this.font);if(c){n=m.Wg()?m.Ga:m.W;if(null!==this.wi)var p=this.wi,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;qd(a,1,0,0,1,0,0);a.save();a.beginPath();a.rect(q,r,s,p);a.clip()}q=!1;if(this instanceof D){var t=this,q=!0;if(!t.isVisible())break a}a.fj.pf=[1,0,0,1,0,0];r=!1;q&&this.tk&&b.ij("drawShadows")&&(s=this.Im,
  a.TA(s.x*b.scale*b.jd,s.y*b.scale*b.jd,t.Ag),a.wn(),a.shadowColor=t.Hm);t=!1;this.ca&&b.ij("drawShadows")&&(t=this.ca.tk);!0===this.bq?(a.wn(),!1===r&&t&&(qd(a,1,0,0,1,0,0),a.fb(),r=!0)):!1===this.bq&&a.vn();null!==this.uc&&(Um(this,a,this.uc,!0,!0),!1===r&&t&&(qd(a,1,0,0,1,0,0),a.fb(),r=!0),this.uc instanceof Da&&this.uc.type===yd?(a.beginPath(),a.rect(k.x,k.y,k.width,k.height),a.Hg(this.uc)):a.fillRect(k.x,k.y,k.width,k.height));this instanceof I?qd(a,l.m11,l.m12,l.m21,l.m22,l.dx,l.dy):a.fj.pf=
  [l.m11,l.m12,l.m21,l.m22,l.dx,l.dy];if(null!==this.Nb){!1===r&&t&&(qd(a,1,0,0,1,0,0),a.fb(),r=!0);var p=this.Ga,l=k=0,s=p.width,p=p.height,v=0;this instanceof X&&(p=this.kb.vb,k=p.x,l=p.y,s=p.width,p=p.height,v=this.Oe);Um(this,a,this.Nb,!0,!1);this.Nb instanceof Da&&this.Nb.type===yd?(a.beginPath(),a.rect(k-v/2,l-v/2,s+v,p+v),a.Hg(this.Nb)):a.fillRect(k-v/2,l-v/2,s+v,p+v)}t&&(null!==this.Nb||null!==this.uc||null!==m&&0!==(m.ja&512)||null!==m&&(m.type===Ek||m.type===$i)&&m.gf()!==this)?(Vm(this,!0),
  null===this.bq&&a.vn()):Vm(this,!1);this.ok(a,b);t&&0!==(this.ja&512)===!0&&a.wn();q&&t&&a.vn();c&&(a.restore(),n&&a.Cf.pop());this instanceof I&&(g=a.Cf.pop());!0===r&&a.Cf.pop();null!==a.mE&&(null===g&&(h===a.px?(qd(a,1,0,0,1,0,0),g=a.Cf.pop()):g=a.px),a.mE(this,g))}}}}else{if(this instanceof I&&(this.type===Qm||this.type===Rm)){Sm(this,a,b);1!==d&&(a.globalAlpha=e);return}this instanceof G&&this.nn(!1);u&&u.cj&&u.wH(a,this);g=this.transform;h=this.T;0!==(this.ja&4096)===!0&&Tm(this);m=0!==(this.ja&
  256);this instanceof qa&&(a.font=this.font);if(m){u&&u.lE&&z.trace("clip"+this.toString());n=h.Wg()?h.Ga:h.W;null!==this.wi?(t=this.wi,k=t.x,l=t.y,q=t.width,t=t.height):(k=Math.max(c.x,n.x),l=Math.max(c.y,n.y),q=Math.min(c.right,n.right)-k,t=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}u&&u.lE&&u.yH(a,k,l,q,t);a.save();a.beginPath();a.rect(k,l,q,t);a.clip()}n=!1;if(this instanceof D){n=!0;if(!this.isVisible()){1!==
  d&&(a.globalAlpha=e);return}this.tk&&b.ij("drawShadows")&&(k=this.Im,a.TA(k.x*b.scale*b.jd,k.y*b.scale*b.jd,this.Ag),a.wn(),a.shadowColor=this.Hm)}k=!1;this.ca&&b.ij("drawShadows")&&(k=this.ca.tk);!0===this.bq?a.wn():!1===this.bq&&a.vn();null!==this.uc&&(Um(this,a,this.uc,!0,!0),this.uc instanceof Da&&this.uc.type===yd?(a.beginPath(),a.rect(c.x,c.y,c.width,c.height),a.Hg(this.uc)):a.fillRect(c.x,c.y,c.width,c.height));g.Pt()||a.transform(g.m11,g.m12,g.m21,g.m22,g.dx,g.dy);null!==this.Nb&&(t=this.Ga,
  l=c=0,q=t.width,t=t.height,r=0,this instanceof X&&(t=this.kb.vb,c=t.x,l=t.y,q=t.width,t=t.height,r=this.Oe),Um(this,a,this.Nb,!0,!1),this.Nb instanceof Da&&this.Nb.type===yd?(a.beginPath(),a.rect(c-r/2,l-r/2,q+r,t+r),a.Hg(this.Nb)):a.fillRect(c-r/2,l-r/2,q+r,t+r));u&&u.cj&&u.xH(a,this);k&&(null!==this.Nb||null!==this.uc||null!==h&&0!==(h.ja&512)||null!==h&&(h.type===Ek||h.type===$i)&&h.gf()!==this)?(Vm(this,!0),null===this.bq&&a.vn()):Vm(this,!1);this.ok(a,b);k&&0!==(this.ja&512)===!0&&a.wn();n&&
  k&&a.vn();m?(a.restore(),this instanceof I?ca(a,!0):ca(a,!1)):g.Pt()||(h=1/(g.m11*g.m22-g.m12*g.m21),a.transform(g.m22*h,-g.m12*h,-g.m21*h,g.m11*h,h*(g.m21*g.dy-g.m22*g.dx),h*(g.m12*g.dx-g.m11*g.dy)))}1!==d&&(a.globalAlpha=e)}}};
  function Sm(a,b,c){var d=a.Xb;0===d.width||0===d.height||isNaN(d.x)||isNaN(d.y)||(null!==a.uc&&(Um(a,b,a.uc,!0,!0),a.uc instanceof Da&&a.uc.type===yd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Hg(a.uc)):b.fillRect(d.x,d.y,d.width,d.height)),null!==a.Nb&&(Um(a,b,a.Nb,!0,!1),a.Nb instanceof Da&&a.Nb.type===yd?(b.beginPath(),b.rect(d.x,d.y,d.width,d.height),b.Hg(a.Nb)):b.fillRect(d.x,d.y,d.width,d.height)),a.ok(b,c))}O.prototype.ok=function(){};
  function Um(a,b,c,d,e){if(null!==c){var g=1,h=1;if("string"===typeof c)d?b.fillStyle=c:b.strokeStyle=c;else if(c.type===ug)d?b.fillStyle=c.color:b.strokeStyle=c.color;else{var k,h=a.Ga,g=h.width,h=h.height;if(e)var l=a.W,g=l.width,h=l.height;var m=b instanceof xd;if(m&&c.bh&&(c.type===ym||c.Nn===g&&c.vy===h))k=c.bh;else{var n=l=0,p=0,q=0,r=0,s=0,s=r=0;e&&(l=a.W,g=l.width,h=l.height,r=l.x,s=l.y);l=c.start.x*g+c.start.offsetX;n=c.start.y*h+c.start.offsetY;p=c.end.x*g+c.end.offsetX;q=c.end.y*h+c.end.offsetY;
  l+=r;p+=r;n+=s;q+=s;if(c.type===vg)k=b.createLinearGradient(l,n,p,q);else if(c.type===yd)s=isNaN(c.xt)?Math.max(g,h)/2:c.xt,isNaN(c.wu)?(r=0,s=Math.max(g,h)/2):r=c.wu,k=b.createRadialGradient(l,n,r,p,q,s);else if(c.type===ym)try{k=b.createPattern(c.pattern,"repeat")}catch(t){k=null}else z.ic(c.type,"Brush type");if(c.type!==ym&&(e=c.st,null!==e))for(e=e.i;e.next();)k.addColorStop(e.key,e.value);if(m&&(c.bh=k,null!==k&&(c.Nn=g,c.vy=h),null===k&&c.type===ym&&-1!==c.Nn)){c.Nn=-1;var v=a.h;null!==v&&
  -1===c.Nn&&z.setTimeout(function(){v.Sp()},600)}}d?b.fillStyle=k:b.strokeStyle=k}}}O.prototype.isContainedBy=O.prototype.Pl=function(a){if(a instanceof I)a:{if(this!==a&&null!==a)for(var b=this.T;null!==b;){if(b===a){a=!0;break a}b=b.T}a=!1}else a=!1;return a};O.prototype.isVisibleObject=O.prototype.oj=function(){if(!this.visible)return!1;var a=this.T;return null!==a?a.oj():!0};
  function Tm(a){if(0!==(a.ja&2048)===!0){var b=a.Jd;b.reset();if(!a.Xb.F()||!a.vd.F()){Wm(a,!1);return}b.translate(a.Xb.x,a.Xb.y);b.translate(-a.Ia.x,-a.Ia.y);var c=a.Ga;Km(a,b,c.x,c.y,c.width,c.height);Wm(a,!1);Xm(a,!0)}0!==(a.ja&4096)===!0&&(b=a.T,null===b?(a.Ak.set(a.Jd),a.jv=a.scale,Xm(a,!1)):null!==b.qh&&(c=a.Ak,c.reset(),b.Wg()?c.multiply(b.Ak):null!==b.T&&c.multiply(b.T.Ak),c.multiply(a.Jd),a.jv=a.scale*b.jv,Xm(a,!1)))}
  function Km(a,b,c,d,e,g){1!==a.scale&&b.scale(a.scale);if(0!==a.angle){var h=ec;a.of&&a.of.cd()&&(h=a.of);var k=z.O();if(a instanceof D&&a.Zb!==a)for(c=a.Zb,d=c.Ga,k.tu(d.x,d.y,d.width,d.height,h),c.gl.Cb(k),k.offset(-c.Ia.x,-c.Ia.y),h=c.T;null!==h&&h!==a;)h.gl.Cb(k),k.offset(-h.Ia.x,-h.Ia.y),h=h.T;else k.tu(c,d,e,g,h);b.rotate(a.angle,k.x,k.y);z.A(k)}}f=O.prototype;
  f.Q=function(a){void 0===a&&(a=!1);if(!0!==ml(this)){Yk(this,!0);Om(this,!0);var b=this.T;null!==b?a||b.Q():(a=this.h,null!==a&&(a.rg.add(this),this instanceof E&&(a.pa.qb||this.mf(),null!==this.od&&Ym(this.od)),a.Ce(!0)));if(this instanceof I){if(this.ba===Ek||this.ba===Ni)a=this.gf(),null!==a&&a.Q(!0);a=this.va.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==ml(d)&&(d.Aa.F()||(d instanceof aj||d instanceof I||d instanceof qa||Mm(d,!1)!==bj)&&d.Q(!0))}}}};
  f.Ap=function(){!1===ml(this)&&(Yk(this,!0),Om(this,!0))};function Ym(a){if(!1===nl(a)){if(null!==a.T)a.T.Q();else{var b=a.h;null!==b&&(b.rg.add(a),a instanceof E&&a.mf(),b.Ce())}Om(a,!0)}}f.Gi=function(){0!==(this.ja&2048)===!1&&(Wm(this,!0),Xm(this,!0))};f.eA=function(){Xm(this,!0)};f.ta=function(){var a=this.ca;null!==a&&a.ta()};
  function Mm(a,b){var c=a.stretch,d=a.T;if(null!==d&&d.ba===ga)return Zm(a,d.$d(a.Vb),d.Zd(a.column),b);if(null!==d&&d.ba===Ek&&d.gf()===a)return $m(a,lf,b);if(c===Am){if(null!==d){if(d.ba===$i&&d.gf()===a)return $m(a,lf,b);c=d.Xd;return c===Am?$m(a,bj,b):$m(a,c,b)}return $m(a,bj,b)}return $m(a,c,b)}
  function Zm(a,b,c,d){var e=a.stretch;if(e!==Am)return $m(a,e,d);var g=e=null;switch(b.stretch){case Bm:g=!0;break;case lf:g=!0}switch(c.stretch){case Cm:e=!0;break;case lf:e=!0}b=a.T.Xd;null===e&&(e=b===Cm||b===lf);null===g&&(g=b===Bm||b===lf);return!0===e&&!0===g?$m(a,lf,d):!0===e?$m(a,Cm,d):!0===g?$m(a,Bm,d):$m(a,bj,d)}
  function $m(a,b,c){if(c)return b;if(b===bj)return bj;c=a.Aa;if(c.F())return bj;a=a.angle;if(!isNaN(c.width))if(90!==a&&270!==a){if(b===Cm)return bj;if(b===lf)return Bm}else{if(b===Bm)return bj;if(b===lf)return Cm}if(!isNaN(c.height))if(90!==a&&270!==a){if(b===Bm)return bj;if(b===lf)return Cm}else{if(b===Cm)return bj;if(b===lf)return Bm}return b}
  z.defineProperty(O,{pu:"segmentOrientation"},function(){return this.Bs},function(a){var b=this.Bs;b!==a&&(u&&z.Ba(a,G,O,"segmentOrientation"),this.Bs=a,this.Q(),this.j("segmentOrientation",b,a),a===Qi&&(this.angle=0))});z.defineProperty(O,{De:"segmentIndex"},function(){return this.zs},function(a){u&&z.g(a,"number",O,"segmentIndex");a=Math.round(a);var b=this.zs;b!==a&&(this.zs=a,this.Q(),this.j("segmentIndex",b,a))});
  z.defineProperty(O,{NA:"segmentFraction"},function(){return this.ys},function(a){u&&z.g(a,"number",O,"segmentFraction");isNaN(a)?a=0:0>a?a=0:1<a&&(a=1);var b=this.ys;b!==a&&(this.ys=a,this.Q(),this.j("segmentFraction",b,a))});z.defineProperty(O,{DF:"segmentOffset"},function(){return this.As},function(a){var b=this.As;b.N(a)||(u&&z.l(a,N,O,"segmentOffset"),this.As=a=a.V(),this.Q(),this.j("segmentOffset",b,a))});
  z.defineProperty(O,{stretch:"stretch"},function(){return this.ei},function(a){var b=this.ei;b!==a&&(u&&z.Ba(a,O,O,"stretch"),this.ei=a,this.Q(),this.j("stretch",b,a))});z.defineProperty(O,{name:"name"},function(){return this.Ub},function(a){var b=this.Ub;b!==a&&(u&&z.g(a,"string",O,"name"),this.Ub=a,null!==this.ca&&(this.ca.jl=null),this.j("name",b,a))});
  z.defineProperty(O,{opacity:"opacity"},function(){return this.Xc},function(a){var b=this.Xc;b!==a&&(z.g(a,"number",O,"opacity"),(0>a||1<a)&&z.ka(a,"0 <= value <= 1",O,"opacity"),this.Xc=a,this.j("opacity",b,a),a=this.h,b=this.ca,null!==a&&null!==b&&a.ta(mk(b,b.W)))});
  z.defineProperty(O,{visible:"visible"},function(){return 0!==(this.ja&1)},function(a){var b=0!==(this.ja&1);b!==a&&(u&&z.g(a,"boolean",O,"visible"),this.ja^=1,this.j("visible",b,a),b=this.T,null!==b?b.Q():this instanceof D&&this.xd(a),this.ta(),an(this))});z.defineProperty(O,{jg:"pickable"},function(){return 0!==(this.ja&2)},function(a){var b=0!==(this.ja&2);b!==a&&(u&&z.g(a,"boolean",O,"pickable"),this.ja^=2,this.j("pickable",b,a))});
  z.defineProperty(O,{IH:"fromLinkableDuplicates"},function(){return 0!==(this.ja&4)},function(a){var b=0!==(this.ja&4);b!==a&&(u&&z.g(a,"boolean",O,"fromLinkableDuplicates"),this.ja^=4,this.j("fromLinkableDuplicates",b,a))});z.defineProperty(O,{JH:"fromLinkableSelfNode"},function(){return 0!==(this.ja&8)},function(a){var b=0!==(this.ja&8);b!==a&&(u&&z.g(a,"boolean",O,"fromLinkableSelfNode"),this.ja^=8,this.j("fromLinkableSelfNode",b,a))});
  z.defineProperty(O,{tJ:"toLinkableDuplicates"},function(){return 0!==(this.ja&16)},function(a){var b=0!==(this.ja&16);b!==a&&(u&&z.g(a,"boolean",O,"toLinkableDuplicates"),this.ja^=16,this.j("toLinkableDuplicates",b,a))});z.defineProperty(O,{uJ:"toLinkableSelfNode"},function(){return 0!==(this.ja&32)},function(a){var b=0!==(this.ja&32);b!==a&&(u&&z.g(a,"boolean",O,"toLinkableSelfNode"),this.ja^=32,this.j("toLinkableSelfNode",b,a))});
  z.defineProperty(O,{Ff:"isPanelMain"},function(){return 0!==(this.ja&64)},function(a){var b=0!==(this.ja&64);b!==a&&(u&&z.g(a,"boolean",O,"isPanelMain"),this.ja^=64,this.Q(),this.j("isPanelMain",b,a))});z.defineProperty(O,{Mt:"isActionable"},function(){return 0!==(this.ja&128)},function(a){var b=0!==(this.ja&128);b!==a&&(u&&z.g(a,"boolean",O,"isActionable"),this.ja^=128,this.j("isActionable",b,a))});
  z.defineProperty(O,{wl:"areaBackground"},function(){return this.uc},function(a){var b=this.uc;b!==a&&(u&&null!==a&&z.ot(a,"GraphObject.areaBackground"),a instanceof Da&&a.freeze(),this.uc=a,this.ta(),this.j("areaBackground",b,a))});z.defineProperty(O,{background:"background"},function(){return this.Nb},function(a){var b=this.Nb;b!==a&&(u&&null!==a&&z.ot(a,"GraphObject.background"),a instanceof Da&&a.freeze(),this.Nb=a,this.ta(),this.j("background",b,a))});
  function Vm(a,b){a.ja=b?a.ja|512:a.ja&-513}function bn(a,b){a.ja=b?a.ja|1024:a.ja&-1025}function Wm(a,b){a.ja=b?a.ja|2048:a.ja&-2049}function Xm(a,b){a.ja=b?a.ja|4096:a.ja&-4097}function ml(a){return 0!==(a.ja&8192)}function Yk(a,b){a.ja=b?a.ja|8192:a.ja&-8193}function nl(a){return 0!==(a.ja&16384)}function Om(a,b){a.ja=b?a.ja|16384:a.ja&-16385}
  z.w(O,{ca:"part"},function(){if(this instanceof D)return this;if(null!==this.Am)return this.Am;var a;for(a=this.T;a;){if(a instanceof D)return this.Am=a;a=a.T}return null});z.w(O,{T:"panel"},function(){return this.mh});O.prototype.Tl=function(a){this.mh=a};z.w(O,{layer:"layer"},function(){var a=this.ca;return null!==a?a.layer:null},{configurable:!0});z.w(O,{h:"diagram"},function(){var a=this.ca;return null!==a?a.h:null},{configurable:!0});
  z.defineProperty(O,{position:"position"},function(){return this.sb},function(a){var b=this.sb;b.N(a)||(u&&z.l(a,N,O,"position"),a=a.V(),this.RA(a,b)&&this.j("position",b,a))});O.prototype.RA=function(a){this.sb=a;Ym(this);this.Gi();return!0};O.prototype.Px=function(a,b){this.sb.n(a,b);cn(this);this.Gi()};z.w(O,{W:"actualBounds"},function(){return this.Xb});
  z.defineProperty(O,{scale:"scale"},function(){return this.bc},function(a){var b=this.bc;b!==a&&(u&&z.p(a,O,"scale"),0>=a&&z.k("GraphObject.scale for "+this+" must be greater than zero, not: "+a),this.bc=a,this.Gi(),this.Q(),this.j("scale",b,a))});z.defineProperty(O,{angle:"angle"},function(){return this.bm},function(a){var b=this.bm;b!==a&&(u&&z.p(a,O,"angle"),a%=360,0>a&&(a+=360),b!==a&&(this.bm=a,this.Q(),this.Gi(),this.j("angle",b,a)))});
  z.defineProperty(O,{Aa:"desiredSize"},function(){return this.tf},function(a){u&&z.l(a,Ea,O,"desiredSize");var b=a.width,c=a.height,d=this.tf,e=d.width,g=d.height;(e===b||isNaN(e)&&isNaN(b))&&(g===c||isNaN(g)&&isNaN(c))||(this.tf=a=a.V(),this.Q(),this instanceof X&&this.qe(),this.j("desiredSize",d,a),0!==(this.ja&1024)&&(a=this.ca,null!==a&&(Im(this,a,"width"),Im(this,a,"height"))))});
  z.defineProperty(O,{width:"width"},function(){return this.tf.width},function(a){if(this.tf.width!==a){u&&z.g(a,"number",O,"width");var b=this.tf;this.tf=a=(new Ea(a,this.tf.height)).freeze();this.Q();this instanceof X&&this.qe();this.j("desiredSize",b,a);b=this.ca;null!==b&&0!==(this.ja&1024)&&Im(this,b,"width")}});
  z.defineProperty(O,{height:"height"},function(){return this.tf.height},function(a){if(this.tf.height!==a){u&&z.g(a,"number",O,"height");var b=this.tf;this.tf=a=(new Ea(this.tf.width,a)).freeze();this.Q();this instanceof X&&this.qe();this.j("desiredSize",b,a);b=this.ca;null!==b&&0!==(this.ja&1024)&&Im(this,b,"height")}});
  z.defineProperty(O,{dg:"minSize"},function(){return this.Uj},function(a){var b=this.Uj;b.N(a)||(u&&z.l(a,Ea,O,"minSize"),a=a.copy(),isNaN(a.width)&&(a.width=0),isNaN(a.height)&&(a.height=0),a.freeze(),this.Uj=a,this.Q(),this.j("minSize",b,a))});z.defineProperty(O,{Xe:"maxSize"},function(){return this.Sj},function(a){var b=this.Sj;b.N(a)||(u&&z.l(a,Ea,O,"maxSize"),a=a.copy(),isNaN(a.width)&&(a.width=Infinity),isNaN(a.height)&&(a.height=Infinity),a.freeze(),this.Sj=a,this.Q(),this.j("maxSize",b,a))});
  z.w(O,{Ia:"measuredBounds"},function(){return this.vd});z.w(O,{Ga:"naturalBounds"},function(){return this.Wc},{configurable:!0});z.defineProperty(O,{margin:"margin"},function(){return this.Er},function(a){"number"===typeof a?a=new Db(a):u&&z.l(a,Db,O,"margin");var b=this.Er;b.N(a)||(this.Er=a=a.V(),this.Q(),this.j("margin",b,a))});z.w(O,{transform:null},function(){0!==(this.ja&2048)===!0&&Tm(this);return this.Jd});z.w(O,{qh:null},function(){0!==(this.ja&4096)===!0&&Tm(this);return this.Ak});
  z.defineProperty(O,{alignment:"alignment"},function(){return this.Ie},function(a){var b=this.Ie;b.N(a)||(u&&z.l(a,Q,O,"alignment"),a.Be()&&!a.bd()&&z.k("GraphObject.alignment for "+this+" must be a real Spot or Spot.Default, not: "+a),this.Ie=a=a.V(),Ym(this),this.j("alignment",b,a))});z.defineProperty(O,{column:"column"},function(){return this.wq},function(a){u&&z.p(a,O,"column");a=Math.round(a);var b=this.wq;b!==a&&(0>a&&z.ka(a,">= 0",O,"column"),this.wq=a,this.Q(),this.j("column",b,a))});
  z.defineProperty(O,{dH:"columnSpan"},function(){return this.xi},function(a){u&&z.g(a,"number",O,"columnSpan");a=Math.round(a);var b=this.xi;b!==a&&(1>a&&z.ka(a,">= 1",O,"columnSpan"),this.xi=a,this.Q(),this.j("columnSpan",b,a))});z.defineProperty(O,{Vb:"row"},function(){return this.us},function(a){u&&z.p(a,O,"row");a=Math.round(a);var b=this.us;b!==a&&(0>a&&z.ka(a,">= 0",O,"row"),this.us=a,this.Q(),this.j("row",b,a))});
  z.defineProperty(O,{rowSpan:"rowSpan"},function(){return this.Ui},function(a){u&&z.g(a,"number",O,"rowSpan");a=Math.round(a);var b=this.Ui;b!==a&&(1>a&&z.ka(a,">= 1",O,"rowSpan"),this.Ui=a,this.Q(),this.j("rowSpan",b,a))});z.defineProperty(O,{Sx:"spanAllocation"},function(){return this.Os},function(a){var b=this.Os;b!==a&&(null!==a&&z.g(a,"function",O,"spanAllocation"),this.Os=a,this.j("spanAllocation",b,a))});
  z.defineProperty(O,{kk:"alignmentFocus"},function(){return this.oq},function(a){var b=this.oq;b.N(a)||(u&&z.l(a,Q,O,"alignmentFocus"),!a.Be()||a.bd()||a.N(Yb)&&this instanceof E||z.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: "+a),this.oq=a=a.V(),this.Q(),this.j("alignmentFocus",b,a))});
  z.defineProperty(O,{zd:"portId"},function(){return this.fs},function(a){var b=this.fs;if(b!==a){u&&null!==a&&z.g(a,"string",O,"portId");var c=this.ca;null===c||c instanceof E||(z.k("Cannot set portID on a Link: "+a),c=null);null!==b&&null!==c&&dn(c,this);this.fs=a;if(null!==a&&c){c.Rh=!0;null===c.Ed&&en(c);var d=this.zd;null!==d&&c.Ed.add(d,this)}this.j("portId",b,a)}});function an(a){var b=a.ca;b instanceof E&&(a=a.h,null===a||a.pa.qb||b.mf())}
  z.defineProperty(O,{Eb:"toSpot"},function(){return null!==this.la?this.la.hk:Yb},function(a){this.Ue();var b=this.la.hk;b.N(a)||(u&&z.l(a,Q,O,"toSpot"),a=a.V(),this.la.hk=a,this.j("toSpot",b,a),an(this))});z.defineProperty(O,{Yl:"toEndSegmentLength"},function(){return null!==this.la?this.la.fk:10},function(a){this.Ue();var b=this.la.fk;b!==a&&(u&&z.g(a,"number",O,"toEndSegmentLength"),0>a&&z.ka(a,">= 0",O,"toEndSegmentLength"),this.la.fk=a,this.j("toEndSegmentLength",b,a),an(this))});
  z.defineProperty(O,{zu:"toEndSegmentDirection"},function(){return null!==this.la?this.la.ek:Gm},function(a){this.Ue();var b=this.la.ek;b!==a&&(u&&z.Ba(a,E,O,"toEndSegmentDirection"),this.la.ek=a,this.j("toEndSegmentDirection",b,a),an(this))});z.defineProperty(O,{Au:"toShortLength"},function(){return null!==this.la?this.la.gk:0},function(a){this.Ue();var b=this.la.gk;b!==a&&(u&&z.g(a,"number",O,"toShortLength"),this.la.gk=a,this.j("toShortLength",b,a),an(this))});
  z.defineProperty(O,{SF:"toLinkable"},function(){return this.Vs},function(a){var b=this.Vs;b!==a&&(u&&null!==a&&z.g(a,"boolean",O,"toLinkable"),this.Vs=a,this.j("toLinkable",b,a))});z.defineProperty(O,{vJ:"toMaxLinks"},function(){return this.Ws},function(a){var b=this.Ws;b!==a&&(u&&z.g(a,"number",O,"toMaxLinks"),0>a&&z.ka(a,">= 0",O,"toMaxLinks"),this.Ws=a,this.j("toMaxLinks",b,a))});
  z.defineProperty(O,{Db:"fromSpot"},function(){return null!==this.la?this.la.Hj:Yb},function(a){this.Ue();var b=this.la.Hj;b.N(a)||(u&&z.l(a,Q,O,"fromSpot"),a=a.V(),this.la.Hj=a,this.j("fromSpot",b,a),an(this))});z.defineProperty(O,{Jl:"fromEndSegmentLength"},function(){return null!==this.la?this.la.Fj:10},function(a){this.Ue();var b=this.la.Fj;b!==a&&(u&&z.g(a,"number",O,"fromEndSegmentLength"),0>a&&z.ka(a,">= 0",O,"fromEndSegmentLength"),this.la.Fj=a,this.j("fromEndSegmentLength",b,a),an(this))});
  z.defineProperty(O,{Ft:"fromEndSegmentDirection"},function(){return null!==this.la?this.la.Ej:Gm},function(a){this.Ue();var b=this.la.Ej;b!==a&&(u&&z.Ba(a,E,O,"fromEndSegmentDirection"),this.la.Ej=a,this.j("fromEndSegmentDirection",b,a),an(this))});z.defineProperty(O,{Gt:"fromShortLength"},function(){return null!==this.la?this.la.Gj:0},function(a){this.Ue();var b=this.la.Gj;b!==a&&(u&&z.g(a,"number",O,"fromShortLength"),this.la.Gj=a,this.j("fromShortLength",b,a),an(this))});
  z.defineProperty(O,{uE:"fromLinkable"},function(){return this.Zq},function(a){var b=this.Zq;b!==a&&(u&&null!==a&&z.g(a,"boolean",O,"fromLinkable"),this.Zq=a,this.j("fromLinkable",b,a))});z.defineProperty(O,{Yz:"fromMaxLinks"},function(){return this.$q},function(a){var b=this.$q;b!==a&&(u&&z.g(a,"number",O,"fromMaxLinks"),0>a&&z.ka(a,">= 0",O,"fromMaxLinks"),this.$q=a,this.j("fromMaxLinks",b,a))});
  z.defineProperty(O,{cursor:"cursor"},function(){return this.Hq},function(a){var b=this.Hq;b!==a&&(z.g(a,"string",O,"cursor"),this.Hq=a,this.j("cursor",b,a))});z.defineProperty(O,{click:"click"},function(){return null!==this.ma?this.ma.vi:null},function(a){Dm(this);var b=this.ma.vi;b!==a&&(null!==a&&z.g(a,"function",O,"click"),this.ma.vi=a,this.j("click",b,a))});
  z.defineProperty(O,{wt:"doubleClick"},function(){return null!==this.ma?this.ma.Di:null},function(a){Dm(this);var b=this.ma.Di;b!==a&&(null!==a&&z.g(a,"function",O,"doubleClick"),this.ma.Di=a,this.j("doubleClick",b,a))});z.defineProperty(O,{Iz:"contextClick"},function(){return null!==this.ma?this.ma.yi:null},function(a){Dm(this);var b=this.ma.yi;b!==a&&(null!==a&&z.g(a,"function",O,"contextClick"),this.ma.yi=a,this.j("contextClick",b,a))});
  z.defineProperty(O,{au:"mouseEnter"},function(){return null!==this.ma?this.ma.Rr:null},function(a){Dm(this);var b=this.ma.Rr;b!==a&&(null!==a&&z.g(a,"function",O,"mouseEnter"),this.ma.Rr=a,this.j("mouseEnter",b,a))});z.defineProperty(O,{bu:"mouseLeave"},function(){return null!==this.ma?this.ma.Sr:null},function(a){Dm(this);var b=this.ma.Sr;b!==a&&(null!==a&&z.g(a,"function",O,"mouseLeave"),this.ma.Sr=a,this.j("mouseLeave",b,a))});
  z.defineProperty(O,{uA:"mouseOver"},function(){return null!==this.ma?this.ma.Qi:null},function(a){Dm(this);var b=this.ma.Qi;b!==a&&(null!==a&&z.g(a,"function",O,"mouseOver"),this.ma.Qi=a,this.j("mouseOver",b,a))});z.defineProperty(O,{tA:"mouseHover"},function(){return null!==this.ma?this.ma.Pi:null},function(a){Dm(this);var b=this.ma.Pi;b!==a&&(null!==a&&z.g(a,"function",O,"mouseHover"),this.ma.Pi=a,this.j("mouseHover",b,a))});
  z.defineProperty(O,{sA:"mouseHold"},function(){return null!==this.ma?this.ma.Oi:null},function(a){Dm(this);var b=this.ma.Oi;b!==a&&(null!==a&&z.g(a,"function",O,"mouseHold"),this.ma.Oi=a,this.j("mouseHold",b,a))});z.defineProperty(O,{HI:"mouseDragEnter"},function(){return null!==this.ma?this.ma.Pr:null},function(a){Dm(this);var b=this.ma.Pr;b!==a&&(null!==a&&z.g(a,"function",O,"mouseDragEnter"),this.ma.Pr=a,this.j("mouseDragEnter",b,a))});
  z.defineProperty(O,{II:"mouseDragLeave"},function(){return null!==this.ma?this.ma.Qr:null},function(a){Dm(this);var b=this.ma.Qr;b!==a&&(null!==a&&z.g(a,"function",O,"mouseDragLeave"),this.ma.Qr=a,this.j("mouseDragLeave",b,a))});z.defineProperty(O,{rA:"mouseDrop"},function(){return null!==this.ma?this.ma.Ni:null},function(a){Dm(this);var b=this.ma.Ni;b!==a&&(null!==a&&z.g(a,"function",O,"mouseDrop"),this.ma.Ni=a,this.j("mouseDrop",b,a))});
  z.defineProperty(O,{AD:"actionDown"},function(){return null!==this.ma?this.ma.iq:null},function(a){Dm(this);var b=this.ma.iq;b!==a&&(null!==a&&z.g(a,"function",O,"actionDown"),this.ma.iq=a,this.j("actionDown",b,a))});z.defineProperty(O,{BD:"actionMove"},function(){return null!==this.ma?this.ma.jq:null},function(a){Dm(this);var b=this.ma.jq;b!==a&&(null!==a&&z.g(a,"function",O,"actionMove"),this.ma.jq=a,this.j("actionMove",b,a))});
  z.defineProperty(O,{CD:"actionUp"},function(){return null!==this.ma?this.ma.kq:null},function(a){Dm(this);var b=this.ma.kq;b!==a&&(null!==a&&z.g(a,"function",O,"actionUp"),this.ma.kq=a,this.j("actionUp",b,a))});z.defineProperty(O,{zD:"actionCancel"},function(){return null!==this.ma?this.ma.hq:null},function(a){Dm(this);var b=this.ma.hq;b!==a&&(null!==a&&z.g(a,"function",O,"actionCancel"),this.ma.hq=a,this.j("actionCancel",b,a))});
  z.defineProperty(O,{$A:"toolTip"},function(){return null!==this.ma?this.ma.Xi:null},function(a){Dm(this);var b=this.ma.Xi;b!==a&&(null!==a&&z.l(a,da,O,"toolTip"),this.ma.Xi=a,this.j("toolTip",b,a))});z.defineProperty(O,{contextMenu:"contextMenu"},function(){return null!==this.ma?this.ma.zi:null},function(a){Dm(this);var b=this.ma.zi;b!==a&&(null!==a&&z.l(a,da,O,"contextMenu"),this.ma.zi=a,this.j("contextMenu",b,a))});
  O.prototype.bind=O.prototype.bind=function(a){a.Bg=this;var b=this.np();null!==b&&fn(b)&&z.k("Cannot add a Binding to a template that has already been copied: "+a);null===this.Ac&&(this.Ac=new J($g));this.Ac.add(a)};O.prototype.findTemplateBinder=O.prototype.np=function(){for(var a=this instanceof I?this:this.T;null!==a;){if(null!==a.Ok)return a;a=a.T}return null};O.prototype.setProperties=function(a){z.qu(this,a)};var gn;
  O.make=gn=function(a,b){var c=arguments,d=null,e=null;if("function"===typeof a)e=a;else if("string"===typeof a){var g=hn.na(a);"function"===typeof g?(c=z.Al(arguments),d=g(c)):e=aa[a]}null===d&&(void 0===e&&(d=window.$,void 0!==d&&void 0!==d.noop&&z.k("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"),z.k("GraphObject.make failed to complete, it may be conflicting with another var.")),null!==e&&e.constructor||z.k("GraphObject.make requires a class function or class name, not: "+
  a),d=new e);g=1;if(d instanceof B&&1<c.length){var h=d,e=c[1];if("string"===typeof e||e instanceof HTMLDivElement)Ck(h,e),g++}for(;g<c.length;g++)e=c[g],void 0===e?z.k("Undefined value at argument "+g+" for object being constructed by GraphObject.make: "+d):jn(d,e);return d};
  function jn(a,b){if("string"===typeof b)if(a instanceof qa)a.text=b;else if(a instanceof X)a.Hb=b;else if(a instanceof wk)a.source=b;else if(a instanceof I){var c=Ja(I,b);null!==c?a.type=c:z.k("Unknown Panel type as an argument to GraphObject.make: "+b)}else a instanceof Da?(c=Ja(Da,b),null!==c?a.type=c:z.k("Unknown Brush type as an argument to GraphObject.make: "+b)):a instanceof hf?(c=Ja(hf,b),null!==c?a.type=c:z.k("Unknown Geometry type as an argument to GraphObject.make: "+b)):a instanceof Qf?
  (c=Ja(Qf,b),null!==c?a.type=c:z.k("Unknown PathSegment type as an argument to GraphObject.make: "+b)):z.k("Unable to use a string as an argument to GraphObject.make: "+b);else if(b instanceof O)c=b,a instanceof I||z.k("A GraphObject can only be added to a Panel, not to: "+a),a.add(c);else if(b instanceof Ig){var d=b,c=a,e;d.re&&c.getRowDefinition?e=c.getRowDefinition(d.index):!d.re&&c.getColumnDefinition?e=c.getColumnDefinition(d.index):z.k("A RowColumnDefinition can only be added to a Panel, not to: "+
  a);e.tt(d)}else if(b instanceof Ba)a instanceof G&&b.Ae===G?2===(b.value&2)?a.Ix=b:b===Xi||b===Pi||b===Oi?a.Se=b:b===kn||b===ln||b===mn?a.it=b:b!==nn&&b!==Qi&&z.k("Unknown Link enum value for a Link property: "+b):a instanceof I&&b.Ae===I?a.type=b:a instanceof qa&&b.Ae===qa?a.hG=b:a instanceof X&&(b===bj||b===dj||b===ej||b===Am)?a.Zz=b:a instanceof wk&&(b===bj||b===dj||b===ej)?a.WH=b:a instanceof O&&b.Ae===G?(c=a,0===b.name.indexOf("Orient")?c.pu=b:z.k("Unknown Link enum value for GraphObject.segmentOrientation property: "+
  b)):a instanceof O&&b.Ae===O?a.stretch=b:a instanceof Ig&&b.Ae===Ig?a.uu=b:a instanceof B&&b.Ae===B?a.xl=b:a instanceof Da&&b.Ae===Da?a.type=b:a instanceof hf&&b.Ae===hf?a.type=b:a instanceof Qf&&b.Ae===Qf?a.type=b:a instanceof $g&&b.Ae===$g?a.mode=b:a instanceof Tf&&b.Ae===Tf?a.Dc=b:a instanceof Y&&b.Ae===Y?0===b.name.indexOf("Alignment")?a.alignment=b:0===b.name.indexOf("Arrangement")?a.Yf=b:0===b.name.indexOf("Compaction")?a.compaction=b:0===b.name.indexOf("Path")?a.path=b:0===b.name.indexOf("Sorting")?
  a.sorting=b:0===b.name.indexOf("Style")?a.yJ=b:z.k("Unknown enum value: "+b):a instanceof on&&b.Ae===on?0===b.name.indexOf("Aggressive")?a.RG=b:0===b.name.indexOf("Cycle")?a.lH=b:0===b.name.indexOf("Init")?a.aI=b:0===b.name.indexOf("Layer")?a.pI=b:z.k("Unknown enum value: "+b):a instanceof tm&&b.Ae===tm?b===pn||b===qn||b===rn||b===sn?a.sorting=b:b===tn||b===un?a.Yf=b:b===vn||b===wn?a.alignment=b:z.k("Unknown enum value: "+b):a instanceof xn&&b.Ae===xn?b===yn||b===Cn||b===En||b===Fn||b===Gn?a.sorting=
  b:b===Hn||b===In||b===Jn||b===Kn?a.direction=b:b===Ln||b===Mn||b===Nn||b===On?a.Yf=b:b===Pn||b===Qn?a.vx=b:z.k("Unknown enum value: "+b):z.k("No property to set for this enum value: "+b);else if(b instanceof $g)a instanceof O?a.bind(b):a instanceof Ig?a.bind(b):z.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: "+a);else if(b instanceof kf)a instanceof hf?a.cc.add(b):z.k("A PathFigure can only be added to a Geometry, not to: "+a);else if(b instanceof Qf)a instanceof
  kf?a.Ab.add(b):z.k("A PathSegment can only be added to a PathFigure, not to: "+a);else if(b instanceof yg)a instanceof B?a.Sb=b:a instanceof F?a.Sb=b:z.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++)jn(a,b[c]);else if("object"===typeof b&&null!==b)if(a instanceof Da){e=new ma;for(c in b)d=parseFloat(c),isNaN(d)?e[c]=b[c]:a.addColorStop(d,b[c]);z.qu(a,e)}else if(a instanceof Ig){void 0!==b.row?(e=b.row,(void 0===e||null===e||Infinity===
  e||isNaN(e)||0>e)&&z.k("Must specify non-negative integer row for RowColumnDefinition "+b+", not: "+e),a.re=!0,a.index=e):void 0!==b.column&&(e=b.column,(void 0===e||null===e||Infinity===e||isNaN(e)||0>e)&&z.k("Must specify non-negative integer column for RowColumnDefinition "+b+", not: "+e),a.re=!1,a.index=e);e=new ma;for(c in b)"row"!==c&&"column"!==c&&(e[c]=b[c]);z.qu(a,e)}else z.qu(a,b);else z.k('Unknown initializer "'+b+'" for object being constructed by GraphObject.make: '+a)}
  var hn=new na("string","function");O.getBuilders=function(){var a=new na("string","function"),b;for(b in hn)if(b!==b.toLowerCase()){var c=hn[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};var Rn;O.defineBuilder=Rn=function(a,b){z.g(a,"string",O,"defineBuilder:name");z.g(b,"function",O,"defineBuilder:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||z.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);hn.add(a,b)};var Sn;
  O.takeBuilderArgument=Sn=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};
  Rn("Button",function(){var a=new Da(vg);a.addColorStop(0,"white");a.addColorStop(1,"lightgray");var b=new Da(vg);b.addColorStop(0,"white");b.addColorStop(1,"dodgerblue");a=gn(I,Ek,{Mt:!0},{_buttonFillNormal:a,_buttonStrokeNormal:"gray",_buttonFillOver:b,_buttonStrokeOver:"blue"},gn(X,{name:"ButtonBorder",Hb:"Rectangle",C:new Q(0,0,2.761423749153968,2.761423749153968),D:new Q(1,1,-2.761423749153968,-2.761423749153968),fill:a,stroke:"gray"}));a.au=function(a,b){var e=b.oe("ButtonBorder");if(e instanceof
  X){var g=b._buttonFillOver;b._buttonFillNormal=e.fill;e.fill=g;g=b._buttonStrokeOver;b._buttonStrokeNormal=e.stroke;e.stroke=g}};a.bu=function(a,b){var e=b.oe("ButtonBorder");e instanceof X&&(e.fill=b._buttonFillNormal,e.stroke=b._buttonStrokeNormal)};return a});
  Rn("TreeExpanderButton",function(){var a=gn("Button",{_treeExpandedFigure:"MinusLine",_treeCollapsedFigure:"PlusLine"},gn(X,{name:"ButtonIcon",Hb:"MinusLine",Aa:ae},(new $g("figure","isTreeExpanded",function(a,c){var d=c.T;return a?d._treeExpandedFigure:d._treeCollapsedFigure})).wx()),{visible:!1},(new $g("visible","isTreeLeaf",function(a){return!a})).wx());a.click=function(a,c){var d=c.ca;d instanceof da&&(d=d.Xf);if(d instanceof E){var e=d.h;if(null!==e){e=e.wb;if(d.wd){if(!e.canCollapseTree(d))return}else if(!e.canExpandTree(d))return;
  a.Gc=!0;d.wd?e.collapseTree(d):e.expandTree(d)}}};return a});
  Rn("SubGraphExpanderButton",function(){var a=gn("Button",{_subGraphExpandedFigure:"MinusLine",_subGraphCollapsedFigure:"PlusLine"},gn(X,{name:"ButtonIcon",Hb:"MinusLine",Aa:ae},(new $g("figure","isSubGraphExpanded",function(a,c){var d=c.T;return a?d._subGraphExpandedFigure:d._subGraphCollapsedFigure})).wx()));a.click=function(a,c){var d=c.ca;d instanceof da&&(d=d.Xf);if(d instanceof F){var e=d.h;if(null!==e){e=e.wb;if(d.se){if(!e.canCollapseSubGraph(d))return}else if(!e.canExpandSubGraph(d))return;a.Gc=
  !0;d.se?e.collapseSubGraph(d):e.expandSubGraph(d)}}};return a});Rn("ContextMenuButton",function(){var a=gn("Button");a.stretch=Cm;var b=a.oe("ButtonBorder");b instanceof X&&(b.Hb="Rectangle",b.C=new Q(0,0,2,3),b.D=new Q(1,1,-2,-2));return a});
  Rn("PanelExpanderButton",function(a){var b=Sn(a,"COLLAPSIBLE");a=gn("Button",gn(X,"TriangleUp",{Aa:new Ea(6,4)},(new $g("figure","visible",function(a){return a?"TriangleUp":"TriangleDown"})).wx(b)));var c=a.oe("ButtonBorder");c instanceof X&&(c.stroke=null,c.fill="transparent");a.click=function(a,c){var g=c.h;if(null!==g&&!g.ib){var h=c.ca.oe(b);null!==h&&(g.Wb("Collapse/Expand Panel"),h.visible=!h.visible,g.Kd("Collapse/Expand Panel"))}};return a});
  Rn("CheckBoxButton",function(a){var b=Sn(a);a=gn("Button",{"ButtonBorder.fill":"white","ButtonBorder.stroke":"gray",width:14,height:14},gn(X,{name:"ButtonIcon",KH:"M0 4 L3 9 9 0",ub:2,stretch:lf,Zz:dj,visible:!1},""!==b?(new $g("visible",b)).xI():[]));a.click=function(a,d){if(!(a.h.ib||""!==b&&a.h.ha.ib)){a.Gc=!0;var e=d.oe("ButtonIcon");e.h.Wb("checkbox");e.visible=!e.visible;"function"===typeof d._doClick&&d._doClick(a,d);e.h.Kd("checkbox")}};return a});
  Rn("CheckBox",function(a){a=Sn(a);a=gn("CheckBoxButton",a,{name:"Button",margin:new Db(0,1,0,0)});var b=gn(I,"Horizontal",a,{Mt:!0,margin:1,_buttonFillNormal:a._buttonFillNormal,_buttonStrokeNormal:a._buttonStrokeNormal,_buttonFillOver:a._buttonFillOver,_buttonStrokeOver:a._buttonStrokeOver,au:a.au,bu:a.bu,click:a.click,_buttonClick:a.click});a.au=null;a.bu=null;a.click=null;return b});
  function Em(){this.zi=this.Xi=this.hq=this.kq=this.jq=this.iq=this.Ni=this.Qr=this.Pr=this.Oi=this.Pi=this.Qi=this.Sr=this.Rr=this.yi=this.Di=this.vi=null}Em.prototype.copy=function(){var a=new Em;a.vi=this.vi;a.Di=this.Di;a.yi=this.yi;a.Rr=this.Rr;a.Sr=this.Sr;a.Qi=this.Qi;a.Pi=this.Pi;a.Oi=this.Oi;a.Pr=this.Pr;a.Qr=this.Qr;a.Ni=this.Ni;a.iq=this.iq;a.jq=this.jq;a.kq=this.kq;a.hq=this.hq;a.Xi=this.Xi;a.zi=this.zi;return a};
  function I(a){O.call(this);void 0===a?0===arguments.length?this.ba=gj:z.k("invalid argument to Panel constructor: undefined"):(z.Ba(a,I,I,"type"),this.ba=a);this.va=new J(O);this.df=Kd;this.eh=!1;this.ba===Hk&&(this.eh=!0);this.hr=!1;this.Lq=Pc;this.Ci=Am;this.ba===ga&&Tn(this);this.Yo=dj;this.cr=ce;this.dr=Id;this.Ok=this.fe=null;this.vr=NaN;this.tg=this.Ji=null;this.uo="category";this.sg=null;this.Zi=new w(NaN,NaN,NaN,NaN);this.Km=null;this.Rh=!1;this.vs=null}z.Ra(I,O);z.ji(I);z.ia("Panel",I);
  function Tn(a){a.Bj=Kd;a.Oh=1;a.Bi=null;a.gm=null;a.Nh=1;a.Mh=null;a.fm=null;a.Wd=[];a.Sd=[];a.Fm=Un;a.em=Un;a.Yi=0;a.Ki=0}
  I.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.ba=this.ba;a.df=this.df.V();a.eh=this.eh;a.hr=this.hr;a.Lq=this.Lq.V();a.Ci=this.Ci;if(a.ba===ga){a.Bj=this.Bj.V();a.Oh=this.Oh;a.Bi=this.Bi;a.gm=this.gm;a.Nh=this.Nh;a.Mh=this.Mh;a.fm=this.fm;var b=[];if(0<this.Wd.length)for(var c=this.Wd,d=c.length,e=0;e<d;e++)if(void 0!==c[e]){var g=c[e].copy();g.Tl(a);b[e]=g}a.Wd=b;b=[];if(0<this.Sd.length)for(c=this.Sd,d=c.length,e=0;e<d;e++)void 0!==c[e]&&(g=c[e].copy(),g.Tl(a),
  b[e]=g);a.Sd=b;a.Fm=this.Fm;a.em=this.em;a.Yi=this.Yi;a.Ki=this.Ki}a.Yo=this.Yo;a.cr=this.cr.V();a.dr=this.dr.V();a.fe=this.fe;a.Ok=this.Ok;a.vr=this.vr;a.Ji=this.Ji;a.tg=this.tg;a.uo=this.uo;a.Zi.assign(this.Zi);a.Rh=this.Rh;null!==this.vs&&(a.vs=this.vs)};I.prototype.ki=function(a){O.prototype.ki.call(this,a);a.va=this.va;for(var b=a.va.o,c=b.length,d=0;d<c;d++)b[d].mh=a;a.Km=null};
  I.prototype.copy=function(){var a=O.prototype.copy.call(this);if(null!==a){for(var b=this.va.o,c=b.length,d=0;d<c;d++){var e=b[d].copy(),g=a;e.Tl(g);e.Am=null;var h=g.va,k=h.count;h.Md(k,e);h=g.ca;if(null!==h){h.jl=null;null!==e.zd&&h instanceof E&&(h.Rh=!0);var l=g.h;null!==l&&l.pa.qb||h.Rc(Wf,"elements",g,null,e,null,k)}}return a}return null};I.prototype.toString=function(){return"Panel("+this.type+")#"+z.nd(this)};var gj;I.Position=gj=z.s(I,"Position",0);I.Horizontal=z.s(I,"Horizontal",1);var Dk;
  I.Vertical=Dk=z.s(I,"Vertical",2);var $i;I.Spot=$i=z.s(I,"Spot",3);var Ek;I.Auto=Ek=z.s(I,"Auto",4);var ga;I.Table=ga=z.s(I,"Table",5);I.Viewbox=z.s(I,"Viewbox",6);var Qm;I.TableRow=Qm=z.s(I,"TableRow",7);var Rm;I.TableColumn=Rm=z.s(I,"TableColumn",8);var Ni;I.Link=Ni=z.s(I,"Link",9);var Hk;I.Grid=Hk=z.s(I,"Grid",10);
  z.defineProperty(I,{type:"type"},function(){return this.ba},function(a){var b=this.ba;b!==a&&(u&&z.Ba(a,I,I,"type"),b!==Qm&&b!==Rm||z.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: "+a),this.ba=a,this.ba===Hk?this.eh=!0:this.ba===ga&&Tn(this),this.Q(),this.j("type",b,a))});z.w(I,{elements:"elements"},function(){return this.va.i});z.w(I,{Ga:"naturalBounds"},function(){return this.Wc});
  z.defineProperty(I,{padding:"padding"},function(){return this.df},function(a){"number"===typeof a?(0>a&&z.ka(a,">= 0",I,"padding"),a=new Db(a)):(z.l(a,Db,I,"padding"),0>a.left&&z.ka(a.left,">= 0",I,"padding:value.left"),0>a.right&&z.ka(a.right,">= 0",I,"padding:value.right"),0>a.top&&z.ka(a.top,">= 0",I,"padding:value.top"),0>a.bottom&&z.ka(a.bottom,">= 0",I,"padding:value.bottom"));var b=this.df;b.N(a)||(this.df=a=a.V(),this.Q(),this.j("padding",b,a))});
  z.defineProperty(I,{Cl:"defaultAlignment"},function(){return this.Lq},function(a){var b=this.Lq;b.N(a)||(u&&z.l(a,Q,I,"defaultAlignment"),this.Lq=a=a.V(),this.Q(),this.j("defaultAlignment",b,a))});z.defineProperty(I,{Xd:"defaultStretch"},function(){return this.Ci},function(a){var b=this.Ci;b!==a&&(z.Ba(a,O,I,"defaultStretch"),this.Ci=a,this.Q(),this.j("defaultStretch",b,a))});
  z.defineProperty(I,{qK:"defaultSeparatorPadding"},function(){return void 0===this.Bj?Kd:this.Bj},function(a){if(void 0!==this.Bj){"number"===typeof a?a=new Db(a):u&&z.l(a,Db,I,"defaultSeparatorPadding");var b=this.Bj;b.N(a)||(this.Bj=a=a.V(),this.j("defaultSeparatorPadding",b,a))}});
  z.defineProperty(I,{oK:"defaultRowSeparatorStroke"},function(){return void 0===this.Bi?null:this.Bi},function(a){var b=this.Bi;b!==a&&(null===a||"string"===typeof a||a instanceof Da)&&(a instanceof Da&&a.freeze(),this.Bi=a,this.j("defaultRowSeparatorStroke",b,a))});z.defineProperty(I,{pK:"defaultRowSeparatorStrokeWidth"},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.j("defaultRowSeparatorStrokeWidth",b,a))}});
  z.defineProperty(I,{nK:"defaultRowSeparatorDashArray"},function(){return void 0===this.gm?null:this.gm},function(a){if(void 0!==this.gm){var b=this.gm;if(b!==a){null===a||Array.isArray(a)||z.ic(a,"Array",I,"defaultRowSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||z.k("defaultRowSeparatorDashArray value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.gm=a;this.ta();
  this.j("defaultRowSeparatorDashArray",b,a)}}});z.defineProperty(I,{iK:"defaultColumnSeparatorStroke"},function(){return void 0===this.Mh?null:this.Mh},function(a){if(void 0!==this.Mh){var b=this.Mh;b!==a&&(null===a||"string"===typeof a||a instanceof Da)&&(a instanceof Da&&a.freeze(),this.Mh=a,this.j("defaultColumnSeparatorStroke",b,a))}});
  z.defineProperty(I,{jK:"defaultColumnSeparatorStrokeWidth"},function(){return void 0===this.Nh?1:this.Nh},function(a){if(void 0!==this.Nh){var b=this.Nh;b!==a&&isFinite(a)&&0<=a&&(this.Nh=a,this.j("defaultColumnSeparatorStrokeWidth",b,a))}});
  z.defineProperty(I,{hK:"defaultColumnSeparatorDashArray"},function(){return void 0===this.fm?null:this.fm},function(a){if(void 0!==this.fm){var b=this.fm;if(b!==a){null===a||Array.isArray(a)||z.ic(a,"Array",I,"defaultColumnSeparatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||z.k("defaultColumnSeparatorDashArray value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.fm=
  a;this.ta();this.j("defaultColumnSeparatorDashArray",b,a)}}});z.defineProperty(I,{FL:"viewboxStretch"},function(){return this.Yo},function(a){var b=this.Yo;b!==a&&(z.Ba(a,O,I,"viewboxStretch"),this.Yo=a,this.j("viewboxStretch",b,a))});
  z.defineProperty(I,{gx:"gridCellSize"},function(){return this.cr},function(a){var b=this.cr;b.N(a)||(z.l(a,Ea,I,"gridCellSize"),a.F()&&0!==a.width&&0!==a.height||z.k("Invalid Panel.gridCellSize: "+a),this.cr=a.V(),null!==this.h&&this===this.h.tp&&$k(this.h),this.ta(),this.j("gridCellSize",b,a))});
  z.defineProperty(I,{zE:"gridOrigin"},function(){return this.dr},function(a){var b=this.dr;b.N(a)||(z.l(a,N,I,"gridOrigin"),a.F()||z.k("Invalid Panel.gridOrigin: "+a),this.dr=a.V(),null!==this.h&&$k(this.h),this.ta(),this.j("gridOrigin",b,a))});f=I.prototype;f.Tv=function(a){O.prototype.Tv.call(this,a);for(var b=this.va.o,c=b.length,d=0;d<c;d++)b[d].Tv(a)};
  f.ok=function(a,b){if(this.ba===Hk){var c=this.hj()*b.scale;0>=c&&(c=1);var d=this.gx,e=d.width,d=d.height,g=this.Ga,h=g.width,g=g.height,k=Math.ceil(h/e),l=Math.ceil(g/d),m=this.zE;a.save();a.beginPath();a.rect(0,0,h,g);a.clip();for(var n=[],p=this.va.o,q=p.length,r=0;r<q;r++){var s=p[r],t=[];n.push(t);if(s.visible)for(var s=Gl(s.Hb),v=r+1;v<q;v++){var x=p[v];x.visible&&Gl(x.Hb)===s&&(x=x.interval,2<=x&&t.push(x))}}p=this.va.o;q=p.length;for(r=0;r<q;r++){var y=p[r];if(y.visible&&(t=y.interval,!(2>
  e*t*c))){var s=n[r],v=!1,A=!0,C=y.PF;null!==C&&(v=!0,A=a.Uz(C,y.we));if("LineV"===y.Hb){a.lineWidth=y.ub;Um(this,a,y.stroke,!1,!1);a.beginPath();for(var L=x=Math.floor(-m.x/e);L<=x+k;L++){var H=L*e+m.x;0<=H&&H<h&&Vn(L,t,s)&&(v&&!A?Hm(a,H,0,H,g,C,y.we):(a.moveTo(H,0),a.lineTo(H,g)))}a.stroke()}else if("LineH"===y.Hb){a.lineWidth=y.ub;Um(this,a,y.stroke,!1,!1);a.beginPath();for(L=x=Math.floor(-m.y/d);L<=x+l;L++)H=L*d+m.y,0<=H&&H<=g&&Vn(L,t,s)&&(v&&!A?Hm(a,0,H,h,H,C,y.we):(a.moveTo(0,H),a.lineTo(h,H)));
  a.stroke()}else if("BarV"===y.Hb)for(Um(this,a,y.fill,!0,!1),y=y.width,isNaN(y)&&(y=e),L=x=Math.floor(-m.x/e);L<=x+k;L++)H=L*e+m.x,0<=H&&H<h&&Vn(L,t,s)&&a.fillRect(H,0,y,g);else if("BarH"===y.Hb)for(Um(this,a,y.fill,!0,!1),y=y.height,isNaN(y)&&(y=d),L=x=Math.floor(-m.y/d);L<=x+l;L++)H=L*d+m.y,0<=H&&H<=g&&Vn(L,t,s)&&a.fillRect(0,H,h,y);v&&a.Qz()}}a.restore();ca(a,!1)}else{this.ba===ga&&(a.lineCap="butt",Wn(this,a,!0,this.Wd,!0),Wn(this,a,!1,this.Sd,!0),Xn(this,a,!0,this.Wd),Xn(this,a,!1,this.Sd),Wn(this,
  a,!0,this.Wd,!1),Wn(this,a,!1,this.Sd,!1));(c=this.JE)&&a.save();e=this.gf();d=this.va.o;h=d.length;for(g=0;g<h;g++)k=d[g],c&&k===e&&(a.Ow=!0),k.ff(a,b),c&&k===e&&(a.Ow=!1);c&&(a.restore(),ca(a,!0));u&&u.AH&&this instanceof G&&u.zH(a,b,this)}};
  function Xn(a,b,c,d){for(var e=d.length,g=a.W,h=c?a.$d(0):a.Zd(0),k=0;k<e;k++){var l=d[k];if(void 0!==l&&l!==h&&0!==l.Oa){if(c){if(l.position>g.height)continue}else if(l.position>g.width)continue;var m=l.$p;isNaN(m)&&(m=c?a.Oh:a.Nh);var n=l.Zp;null===n&&(n=c?a.Bi:a.Mh);if(0!==m&&null!==n){Um(a,b,n,!1,!1);var n=!1,p=!0,q=l.hJ;null!==q&&(n=!0,void 0!==b.setLineDash?(b.setLineDash(q),b.lineDashOffset=a.we):void 0!==b.webkitLineDash?(b.webkitLineDash=q,b.webkitLineDashOffset=a.we):void 0!==b.mozDash?
  (b.mozDash=q,b.mozDashOffset=a.we):p=!1);b.beginPath();var r=l.position+m;c?r>g.height&&(m-=r-g.height):r>g.width&&(m-=r-g.width);l=l.position+m/2;b.lineWidth=m;r=a.padding;c?(l+=r.top,m=r.left,r=g.width-r.right,n&&!p?Hm(b,m,l,r,l,q,0):(b.moveTo(m,l),b.lineTo(r,l))):(l+=r.left,m=r.top,r=g.height-r.bottom,n&&!p?Hm(b,l,m,l,r,q,0):(b.moveTo(l,m),b.lineTo(l,r)));b.stroke();n&&(void 0!==b.setLineDash?(b.setLineDash(z.yj),b.lineDashOffset=0):void 0!==b.webkitLineDash?(b.webkitLineDash=z.yj,b.webkitLineDashOffset=
  0):void 0!==b.mozDash&&(b.mozDash=null,b.mozDashOffset=0))}}}}
  function Wn(a,b,c,d,e){for(var g=d.length,h=a.W,k=0;k<g;k++){var l=d[k];if(void 0!==l&&null!==l.background&&l.Nz!==e&&0!==l.Oa){var m=c?h.height:h.width;if(!(l.position>m)){var n=l.Re(),p=l.$p;isNaN(p)&&(p=c?a.Oh:a.Nh);var q=l.Zp;null===q&&(q=c?a.Bi:a.Mh);null===q&&(p=0);n-=p;p=l.position+p;n+=l.Oa;p+n>m&&(n=m-p);0>=n||(m=a.padding,Um(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 Vn(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 Gl(a){return"LineV"===a||"BarV"===a}
  f.sp=function(a,b,c,d,e){var g=this.Wg(),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.wl)return h=this.W,Ne(h.left,h.top,h.right,h.bottom,a,b,c,d,e);if(null!==this.background)g=a*l+b*n+q,k=a*m+b*p+r,a=c*l+d*n+q,c=c*m+d*p+r,e.n(0,0),d=this.Ga,c=Ne(0,0,d.width,d.height,g,k,a,c,e),e.transform(h);else{g||(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.n(l,d);m=(l-
  k)*(l-k)+(d-a)*(d-a);c=!1;p=this.va.o;r=p.length;n=z.O();for(q=0;q<r;q++)b=p[q],b.visible&&b.sp(k,a,l,d,n)&&(c=!0,b=(k-n.x)*(k-n.x)+(a-n.y)*(a-n.y),b<m&&(m=b,e.set(n)));z.A(n);g&&e.transform(h)}return c};f.Q=function(a){O.prototype.Q.call(this,a);this.ba===Ek&&(a=this.gf(),null!==a&&a.Q(!0));a=this.va.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];!0!==ml(d)&&(d.Aa.F()||(d instanceof aj||d instanceof I||d instanceof qa||Mm(d,!1)!==bj)&&d.Q(!0))}};
  f.Ap=function(){if(!1===ml(this)){Yk(this,!0);Om(this,!0);for(var a=this.va.o,b=a.length,c=0;c<b;c++)a[c].Ap()}};f.Gi=function(){if(0!==(this.ja&2048)===!1){Wm(this,!0);Xm(this,!0);for(var a=this.va.o,b=a.length,c=0;c<b;c++)a[c].eA()}};f.eA=function(){Xm(this,!0);for(var a=this.va.o,b=a.length,c=0;c<b;c++)a[c].eA()};
  f.Ip=function(a,b,c,d){var e=this.Zi;e.width=0;e.height=0;var g=this.Aa,h=this.dg;void 0===c&&(c=h.width,d=h.height);c=Math.max(c,h.width);d=Math.max(d,h.height);var k=this.Xe;isNaN(g.width)||(a=Math.min(g.width,k.width));isNaN(g.height)||(b=Math.min(g.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.va.o;if(0!==m.length){var n=this.ba.Ub;switch(n){case "Position":var p=a,q=b,r=c,s=d,t=m.length;e.x=0;e.y=
  0;e.width=0;for(var v=e.height=0;v<t;v++){var x=m[v];if(x.visible||x===this.Zb){var y=x.margin,A=y.right+y.left,C=y.top+y.bottom;tj(x,p,q,r,s);var L=x.Ia,H=Math.max(L.width+A,0),U=Math.max(L.height+C,0),ea=x.position.x,W=x.position.y;isFinite(ea)||(ea=0);isFinite(W)||(W=0);if(x instanceof X){var P=x;if(P.LE)var ba=P.ub/2,ea=ea-ba,W=W-ba}Hb(e,ea,W,H,U)}}break;case "Vertical":for(var Oa=a,sa=c,Na=m.length,ua=z.rb(),Ha=0;Ha<Na;Ha++){var Aa=m[Ha];if(Aa.visible||Aa===this.Zb){var jc=Mm(Aa,!1);if(jc!==
  bj&&jc!==Bm)ua.push(Aa);else{var zd=Aa.margin,Ad=zd.right+zd.left,Qe=zd.top+zd.bottom;tj(Aa,Oa,Infinity,sa,0);var ac=Aa.Ia,Ng=Math.max(ac.width+Ad,0),Bd=Math.max(ac.height+Qe,0);e.width=Math.max(e.width,Ng);e.height+=Bd}}}var rb=ua.length;if(0!==rb){this.Aa.width?Oa=Math.min(this.Aa.width,this.Xe.width):0!==e.width&&(Oa=Math.min(e.width,this.Xe.width));for(Ha=0;Ha<rb;Ha++)if(Aa=ua[Ha],Aa.visible||Aa===this.Zb)zd=Aa.margin,Ad=zd.right+zd.left,Qe=zd.top+zd.bottom,tj(Aa,Oa,Infinity,sa,0),ac=Aa.Ia,Ng=
  Math.max(ac.width+Ad,0),Bd=Math.max(ac.height+Qe,0),e.width=Math.max(e.width,Ng),e.height+=Bd;z.xa(ua)}break;case "Horizontal":for(var gb=b,oa=d,pa=m.length,sb=z.rb(),Xa=0;Xa<pa;Xa++){var Va=m[Xa];if(Va.visible||Va===this.Zb){var Ae=Mm(Va,!1);if(Ae!==bj&&Ae!==Cm)sb.push(Va);else{var Cd=Va.margin,me=Cd.right+Cd.left,Rd=Cd.top+Cd.bottom;tj(Va,Infinity,gb,0,oa);var ne=Va.Ia,Og=Math.max(ne.width+me,0),fd=Math.max(ne.height+Rd,0);e.width+=Og;e.height=Math.max(e.height,fd)}}}var ti=sb.length;if(0!==ti){this.Aa.height?
  gb=Math.min(this.Aa.height,this.Xe.height):0!==e.height&&(gb=Math.min(e.height,this.Xe.height));for(Xa=0;Xa<ti;Xa++)if(Va=sb[Xa],Va.visible||Va===this.Zb)Cd=Va.margin,me=Cd.right+Cd.left,Rd=Cd.top+Cd.bottom,tj(Va,Infinity,gb,0,oa),ne=Va.Ia,Og=Math.max(ne.width+me,0),fd=Math.max(ne.height+Rd,0),e.width+=Og,e.height=Math.max(e.height,fd);z.xa(sb)}break;case "Spot":a:{var Ab=a,Qb=b,gd=c,qh=d,Lb=m.length,kb=this.gf(),db=kb.margin,Re=0,Sd=0,Pg=db.right+db.left,Qg=db.top+db.bottom;tj(kb,Ab,Qb,gd,qh);var kc=
  kb.Ia,lc=kc.width,oe=kc.height,hd=Math.max(lc+Pg,0),mb=Math.max(oe+Qg,0);e.x=-db.left;e.y=-db.top;e.width=hd;e.height=mb;for(var Uc=0;Uc<Lb;Uc++){var Qa=m[Uc];if(Qa!==kb&&(Qa.visible||Qa===this.Zb)){db=Qa.margin;Re=db.right+db.left;Sd=db.top+db.bottom;tj(Qa,Ab,Qb,0,0);var kc=Qa.Ia,hd=Math.max(kc.width+Re,0),mb=Math.max(kc.height+Sd,0),nb=Qa.alignment;nb.bd()&&(nb=this.Cl);nb.cd()||(nb=ec);var yc=Qa.kk;yc.bd()&&(yc=ec);Hb(e,nb.x*lc+nb.offsetX-(yc.x*kc.width-yc.offsetX)-db.left,nb.y*oe+nb.offsetY-(yc.y*
  kc.height-yc.offsetY)-db.top,hd,mb)}}var Dd=kb.stretch;Dd===Am&&(Dd=Mm(kb,!1));switch(Dd){case bj:break a;case lf:if(!isFinite(Ab)&&!isFinite(Qb))break a;break;case Cm:if(!isFinite(Ab))break a;break;case Bm:if(!isFinite(Qb))break a}kc=kb.Ia;lc=kc.width;oe=kc.height;hd=Math.max(lc+Pg,0);mb=Math.max(oe+Qg,0);db=kb.margin;e.x=-db.left;e.y=-db.top;e.width=hd;e.height=mb;for(Uc=0;Uc<Lb;Uc++)Qa=m[Uc],Qa===kb||!Qa.visible&&Qa!==this.Zb||(db=Qa.margin,Re=db.right+db.left,Sd=db.top+db.bottom,kc=Qa.Ia,hd=Math.max(kc.width+
  Re,0),mb=Math.max(kc.height+Sd,0),nb=Qa.alignment,nb.bd()&&(nb=this.Cl),nb.cd()||(nb=ec),yc=Qa.kk,yc.bd()&&(yc=ec),Hb(e,nb.x*lc+nb.offsetX-(yc.x*kc.width-yc.offsetX)-db.left,nb.y*oe+nb.offsetY-(yc.y*kc.height-yc.offsetY)-db.top,hd,mb))}break;case "Auto":var Mb=a,pe=b,tf=c,Se=d,Mf=m.length,Jb=this.gf(),Be=Jb.margin,Rb=Be.right+Be.left,Vb=Be.top+Be.bottom;tj(Jb,Mb,pe,tf,Se);var Nb=Jb.Ia,Jc=0;if(Jb instanceof X)var xb=Jb,Jc=xb.ub*xb.scale;var Fb=Math.max(Nb.width+Rb,0),Ob=Math.max(Nb.height+Vb,0),Td=
  Yn(Jb),Rg=Td.x*Fb+Td.offsetX,rh=Td.y*Ob+Td.offsetY,Td=Zn(Jb),sh=Td.x*Fb+Td.offsetX,Ce=Td.y*Ob+Td.offsetY,Kc=Mb,De=pe;isFinite(Mb)&&(Kc=Math.max(Math.abs(Rg-sh)-Jc,0));isFinite(pe)&&(De=Math.max(Math.abs(rh-Ce)-Jc,0));var mc=z.Xl();mc.n(0,0);for(var Bb=0;Bb<Mf;Bb++){var Cb=m[Bb];if(Cb!==Jb&&(Cb.visible||Cb===this.Zb)){var Be=Cb.margin,Lc=Be.right+Be.left,Sg=Be.top+Be.bottom;tj(Cb,Kc,De,0,0);Nb=Cb.Ia;Fb=Math.max(Nb.width+Lc,0);Ob=Math.max(Nb.height+Sg,0);mc.n(Math.max(Fb,mc.width),Math.max(Ob,mc.height))}}if(1===
  Mf)e.width=Fb,e.height=Ob,z.qk(mc);else{var Vc=Yn(Jb),Wc=Zn(Jb),lb=0,Mc=0;Wc.x!==Vc.x&&Wc.y!==Vc.y&&(lb=mc.width/Math.abs(Wc.x-Vc.x),Mc=mc.height/Math.abs(Wc.y-Vc.y));z.qk(mc);Jc=0;Jb instanceof X&&(xb=Jb,Jc=xb.ub*xb.scale,cj(xb)===dj&&(lb=Mc=Math.max(lb,Mc)));var lb=lb+(Math.abs(Vc.offsetX)+Math.abs(Wc.offsetX)+Jc),Mc=Mc+(Math.abs(Vc.offsetY)+Math.abs(Wc.offsetY)+Jc),Ud=Jb.stretch;Ud===Am&&(Ud=Mm(Jb,!1));switch(Ud){case bj:Se=tf=0;break;case lf:isFinite(Mb)&&(lb=Mb);isFinite(pe)&&(Mc=pe);break;case Cm:isFinite(Mb)&&
  (lb=Mb);Se=0;break;case Bm:tf=0,isFinite(pe)&&(Mc=pe)}Jb instanceof X&&!Jb.Aa.F()&&xb.qe();Jb.Ap();tj(Jb,lb,Mc,tf,Se);e.width=Jb.Ia.width+Rb;e.height=Jb.Ia.height+Vb}break;case "Table":for(var Vd=a,uf=b,Tg=c,yj=d,La=m.length,Te=z.rb(),qe=z.rb(),ia=0;ia<La;ia++){var fa=m[ia],id=fa instanceof I?fa:null;if(null===id||id.type!==Qm&&id.type!==Rm||!fa.visible)Te.push(fa);else{u&&(id.Aa.F()&&z.k(id.toString()+" TableRow/TableColumn Panels cannot set a desiredSize: "+id.Aa.toString()),id.dg.N(Pd)||z.k(id.toString()+
  " TableRow/TableColumn Panels cannot set a minSize: "+id.dg.toString()),id.Xe.N(de)||z.k(id.toString()+" TableRow/TableColumn Panels cannot set a maxSize: "+id.Xe.toString()));qe.push(fa);for(var th=id.va.o,ui=th.length,zc=0;zc<ui;zc++){var vi=th[zc];id.type===Qm?vi.Vb=fa.Vb:id.type===Rm&&(vi.column=fa.column);Te.push(vi)}}}La=Te.length;0===La&&(this.$d(0),this.Zd(0));for(var bc=[],ia=0;ia<La;ia++)fa=Te[ia],Yk(fa,!0),Om(fa,!0),bc[fa.Vb]||(bc[fa.Vb]=[]),bc[fa.Vb][fa.column]||(bc[fa.Vb][fa.column]=
  []),bc[fa.Vb][fa.column].push(fa);z.xa(Te);for(var uh=z.rb(),jd=z.rb(),Ee=z.rb(),Nc={count:0},kd={count:0},Ac=Vd,ld=uf,eg=this.Wd,La=eg.length,ia=0;ia<La;ia++){var Z=eg[ia];void 0!==Z&&(Z.Oa=0)}eg=this.Sd;La=eg.length;for(ia=0;ia<La;ia++)Z=eg[ia],void 0!==Z&&(Z.Oa=0);for(var Fe=bc.length,Ue=0,ia=0;ia<Fe;ia++)bc[ia]&&(Ue=Math.max(Ue,bc[ia].length));for(var wi=Math.min(this.Yi,Fe-1),xi=Math.min(this.Ki,Ue-1),Oc=0,Fe=bc.length,ia=0;ia<Fe;ia++)if(bc[ia])for(var Ue=bc[ia].length,ob=this.$d(ia),zc=ob.Oa=
  0;zc<Ue;zc++)if(bc[ia][zc]){var pb=this.Zd(zc);void 0===uh[zc]&&(pb.Oa=0,uh[zc]=!0);for(var Zk=bc[ia][zc],fg=Zk.length,Ug=0;Ug<fg;Ug++)if(fa=Zk[Ug],fa.visible||fa===this.Zb){var Vg=1<fa.Ui||1<fa.xi;Vg&&(ia<wi||zc<xi||jd.push(fa));var Wb=fa.margin,gg=Wb.right+Wb.left,hg=Wb.top+Wb.bottom,Xc=Zm(fa,ob,pb,!1),Ge=fa.Aa,zn=!isNaN(Ge.height),yi=!isNaN(Ge.width)&&zn;Vg||Xc===bj||yi||ia<wi||zc<xi||(void 0!==Nc[zc]||Xc!==lf&&Xc!==Cm||(Nc[zc]=-1,Nc.count++),void 0!==kd[ia]||Xc!==lf&&Xc!==Bm||(kd[ia]=-1,kd.count++),
  Ee.push(fa));tj(fa,Infinity,Infinity,0,0);if(!(ia<wi||zc<xi)){var Ve=fa.Ia,We=Math.max(Ve.width+gg,0),Ed=Math.max(Ve.height+hg,0);if(1===fa.Ui&&(Xc===bj||Xc===Cm)){var Z=this.$d(ia),md=Z.Re(),Oc=Math.max(Ed-Z.Oa,0);Oc+md>ld&&(Oc=Math.max(ld-md,0));var vh=0===Z.Oa;Z.Oa+=Oc;ld=Math.max(ld-(Oc+(vh?md:0)),0)}1!==fa.xi||Xc!==bj&&Xc!==Bm||(Z=this.Zd(zc),md=Z.Re(),Oc=Math.max(We-Z.Oa,0),Oc+md>Ac&&(Oc=Math.max(Ac-md,0)),vh=0===Z.Oa,Z.Oa+=Oc,Ac=Math.max(Ac-(Oc+(vh?md:0)),0));Vg&&fa.Ap()}}}z.xa(uh);for(var Wd=
  0,Xd=0,La=this.fp,ia=0;ia<La;ia++){var wh=this.Sd[ia];void 0!==wh&&(Wd+=wh.Xa,0!==wh.Xa&&(Wd+=wh.Re()))}La=this.Yp;for(ia=0;ia<La;ia++){var xh=this.Wd[ia];void 0!==xh&&(Xd+=xh.Xa,0!==xh.Xa&&(Xd+=xh.Re()))}for(var Ac=Math.max(Vd-Wd,0),nd=ld=Math.max(uf-Xd,0),Wg=Ac,La=Ee.length,ia=0;ia<La;ia++){var fa=Ee[ia],ob=this.$d(fa.Vb),pb=this.Zd(fa.column),vf=fa.Ia,Wb=fa.margin,gg=Wb.right+Wb.left,hg=Wb.top+Wb.bottom;Nc[fa.column]=0===pb.Oa&&void 0!==Nc[fa.column]?Math.max(vf.width+gg,Nc[fa.column]):null;kd[fa.Vb]=
  0===ob.Oa&&void 0!==kd[fa.Vb]?Math.max(vf.height+hg,kd[fa.Vb]):null}var nc=0,yh=0;for(ia in kd)"count"!==ia&&(nc+=kd[ia]);for(ia in Nc)"count"!==ia&&(yh+=Nc[ia]);for(var qb=z.Xl(),ia=0;ia<La;ia++)if(fa=Ee[ia],fa.visible||fa===this.Zb){var ob=this.$d(fa.Vb),pb=this.Zd(fa.column),He=0;isFinite(pb.width)?He=pb.width:(He=isFinite(Ac)&&null!==Nc[fa.column]?0===yh?pb.Oa+Ac:Nc[fa.column]/yh*Wg:null!==Nc[fa.column]?Ac:pb.Oa||Ac,He=Math.max(0,He-pb.Re()));var Nf=0;isFinite(ob.height)?Nf=ob.height:(Nf=isFinite(ld)&&
  null!==kd[fa.Vb]?0===nc?ob.Oa+ld:kd[fa.Vb]/nc*nd:null!==kd[fa.Vb]?ld:ob.Oa||ld,Nf=Math.max(0,Nf-ob.Re()));qb.n(Math.max(pb.qj,Math.min(He,pb.qf)),Math.max(ob.qj,Math.min(Nf,ob.qf)));Xc=Zm(fa,ob,pb,!1);switch(Xc){case Cm:qb.height=Math.max(qb.height,ob.Oa+ld);break;case Bm:qb.width=Math.max(qb.width,pb.Oa+Ac)}Wb=fa.margin;gg=Wb.right+Wb.left;hg=Wb.top+Wb.bottom;fa.Ap();tj(fa,qb.width,qb.height,pb.qj,ob.qj);Ve=fa.Ia;We=Math.max(Ve.width+gg,0);Ed=Math.max(Ve.height+hg,0);isFinite(Ac)&&(We=Math.min(We,
  qb.width));isFinite(ld)&&(Ed=Math.min(Ed,qb.height));var wf=0,wf=ob.Oa;ob.Oa=Math.max(ob.Oa,Ed);Oc=ob.Oa-wf;ld=Math.max(ld-Oc,0);wf=pb.Oa;pb.Oa=Math.max(pb.Oa,We);Oc=pb.Oa-wf;Ac=Math.max(Ac-Oc,0)}z.xa(Ee);for(var Yd=z.Xl(),La=jd.length,ia=0;ia<La;ia++)if(fa=jd[ia],fa.visible||fa===this.Zb){ob=this.$d(fa.Vb);pb=this.Zd(fa.column);qb.n(Math.max(pb.qj,Math.min(Vd,pb.qf)),Math.max(ob.qj,Math.min(uf,ob.qf)));Xc=Zm(fa,ob,pb,!1);switch(Xc){case lf:0!==pb.Oa&&(qb.width=Math.min(qb.width,pb.Oa));0!==ob.Oa&&
  (qb.height=Math.min(qb.height,ob.Oa));break;case Cm:0!==pb.Oa&&(qb.width=Math.min(qb.width,pb.Oa));break;case Bm:0!==ob.Oa&&(qb.height=Math.min(qb.height,ob.Oa))}isFinite(pb.width)&&(qb.width=pb.width);isFinite(ob.height)&&(qb.height=ob.height);Yd.n(0,0);for(var hb=1;hb<fa.Ui&&!(fa.Vb+hb>=this.Yp);hb++)Z=this.$d(fa.Vb+hb),Yd.height+=Math.max(Z.qj,isNaN(Z.ef)?Z.qf:Math.min(Z.ef,Z.qf));for(hb=1;hb<fa.xi&&!(fa.column+hb>=this.fp);hb++)Z=this.Zd(fa.column+hb),Yd.width+=Math.max(Z.qj,isNaN(Z.ef)?Z.qf:
  Math.min(Z.ef,Z.qf));qb.width+=Yd.width;qb.height+=Yd.height;Wb=fa.margin;gg=Wb.right+Wb.left;hg=Wb.top+Wb.bottom;tj(fa,qb.width,qb.height,Tg,yj);for(var Ve=fa.Ia,We=Math.max(Ve.width+gg,0),Ed=Math.max(Ve.height+hg,0),Xg=0,hb=0;hb<fa.Ui&&!(fa.Vb+hb>=this.Yp);hb++)Z=this.$d(fa.Vb+hb),Xg+=Z.total||0;if(Xg<Ed){var rc=Ed-Xg,Bc=Ed-Xg;if(null!==fa.Sx)for(var Fd=fa.Sx,hb=0;hb<fa.Ui&&!(0>=rc)&&!(fa.Vb+hb>=this.Yp);hb++){var Z=this.$d(fa.Vb+hb),Sb=Z.Xa||0,Zd=Fd(fa,Z,Bc);u&&"number"!==typeof Zd&&z.k(fa+" spanAllocation does not return a number: "+
  Zd);Z.Oa=Math.min(Z.qf,Sb+Zd);Z.Xa!==Sb&&(rc-=Z.Xa-Sb)}for(;0<rc;){Sb=Z.Xa||0;isNaN(Z.height)&&Z.qf>Sb&&(Z.Oa=Math.min(Z.qf,Sb+rc),Z.Xa!==Sb&&(rc-=Z.Xa-Sb));if(0===Z.index)break;Z=this.$d(Z.index-1)}}for(var Ie=0,hb=0;hb<fa.xi&&!(fa.column+hb>=this.fp);hb++)Z=this.Zd(fa.column+hb),Ie+=Z.total||0;if(Ie<We){rc=We-Ie;Bc=We-Ie;if(null!==fa.Sx)for(Fd=fa.Sx,hb=0;hb<fa.xi&&!(0>=rc)&&!(fa.column+hb>=this.fp);hb++)Z=this.Zd(fa.column+hb),Sb=Z.Xa||0,Zd=Fd(fa,Z,Bc),u&&"number"!==typeof Zd&&z.k(fa+" spanAllocation does not return a number: "+
  Zd),Z.Oa=Math.min(Z.qf,Sb+Zd),Z.Xa!==Sb&&(rc-=Z.Xa-Sb);for(;0<rc;){Sb=Z.Xa||0;isNaN(Z.width)&&Z.qf>Sb&&(Z.Oa=Math.min(Z.qf,Sb+rc),Z.Xa!==Sb&&(rc-=Z.Xa-Sb));if(0===Z.index)break;Z=this.Zd(Z.index-1)}}}z.xa(jd);z.qk(Yd);z.qk(qb);for(var ig=0,jg=0,Xc=Mm(this,!0),xf=this.Aa,zj=this.Xe,$d=Xd=Wd=0,Yc=0,La=this.fp,ia=0;ia<La;ia++)void 0!==this.Sd[ia]&&(Z=this.Zd(ia),isFinite(Z.width)?($d+=Z.width,$d+=Z.Re()):$n(Z)===ao?($d+=Z.Xa,$d+=Z.Re()):0!==Z.Xa&&(Wd+=Z.Xa,Wd+=Z.Re()));var ig=isFinite(xf.width)?Math.min(xf.width,
  zj.width):Xc!==bj&&isFinite(Vd)?Vd:Wd,ig=Math.max(ig,this.dg.width),ig=Math.max(ig-$d,0),Ah=Math.max(ig/Wd,1);isFinite(Ah)||(Ah=1);for(ia=0;ia<La;ia++)void 0!==this.Sd[ia]&&(Z=this.Zd(ia),isFinite(Z.width)||$n(Z)===ao||(Z.Oa=Z.Xa*Ah),Z.position=e.width,0!==Z.Xa&&(e.width+=Z.Xa,e.width+=Z.Re()));La=this.Yp;for(ia=0;ia<La;ia++)void 0!==this.Wd[ia]&&(Z=this.$d(ia),isFinite(Z.height)?(Yc+=Z.height,Yc+=Z.Re()):$n(Z)===ao?(Yc+=Z.Xa,Yc+=Z.Re()):0!==Z.Xa&&(Xd+=Z.Xa,0!==Z.Xa&&(Xd+=Z.Re())));var jg=isFinite(xf.height)?
  Math.min(xf.height,zj.height):Xc!==bj&&isFinite(uf)?uf:Xd,jg=Math.max(jg,this.dg.height),jg=Math.max(jg-Yc,0),Bh=Math.max(jg/Xd,1);isFinite(Bh)||(Bh=1);for(ia=0;ia<La;ia++)void 0!==this.Wd[ia]&&(Z=this.$d(ia),isFinite(Z.height)||$n(Z)===ao||(Z.Oa=Z.Xa*Bh),Z.position=e.height,0!==Z.Xa&&(e.height+=Z.Xa,0!==Z.Xa&&(e.height+=Z.Re())));La=qe.length;for(ia=0;ia<La;ia++){var oc=qe[ia];oc.type===Qm?(He=e.width,Z=this.$d(oc.Vb),Nf=Z.Oa):(Z=this.Zd(oc.column),He=Z.Oa,Nf=e.height);oc.vd.n(0,0,He,Nf);Yk(oc,!1);
  bc[oc.Vb]||(bc[oc.Vb]=[]);bc[oc.Vb][oc.column]||(bc[oc.Vb][oc.column]=[]);bc[oc.Vb][oc.column].push(oc)}z.xa(qe);this.vs=bc;break;case "Viewbox":var Ch=a,al=b,Xq=c,Yq=d;1<m.length&&z.k("Viewbox Panel cannot contain more than one GraphObject.");var Xe=m[0];Xe.bc=1;Xe.Ap();tj(Xe,Infinity,Infinity,Xq,Yq);var Aj=Xe.Ia,bl=Xe.margin,Zq=bl.right+bl.left,$q=bl.top+bl.bottom;if(isFinite(Ch)||isFinite(al)){var jt=Xe.scale,cl=Aj.width,dl=Aj.height,ar=Math.max(Ch-Zq,0),br=Math.max(al-$q,0),Bj=1;this.Yo===dj?
  0!==cl&&0!==dl&&(Bj=Math.min(ar/cl,br/dl)):0!==cl&&0!==dl&&(Bj=Math.max(ar/cl,br/dl));0===Bj&&(Bj=1E-4);Xe.bc*=Bj;jt!==Xe.scale&&(Yk(Xe,!0),tj(Xe,Infinity,Infinity,Xq,Yq))}Aj=Xe.Ia;e.width=isFinite(Ch)?Ch:Math.max(Aj.width+Zq,0);e.height=isFinite(al)?al:Math.max(Aj.height+$q,0);break;case "Link":var cr=m.length,kg=this instanceof da?this.Xf:this;if(kg instanceof G)if(0===cr){var el=this.Wc;yb(el,0,0);var re=this.Ia;re.n(0,0,0,0)}else{var fl=this instanceof da?null:kg.path,lg=kg.tn,Ye=this.Zi;Ye.assign(lg);
  Ye.x=0;var Yg=Ye.y=0,mg=kg.points,Yg=void 0!==this.sa?this.sa:mg.count;this instanceof da?this.nn(!1):kg.nn(!1);var dr=lg.width,er=lg.height;this.Li.n(lg.x,lg.y);null===this.$g&&(this.$g=new J(w));this.$g.clear();null!==fl&&(bo(fl,dr,er,this),re=fl.Ia,Ye.ri(re),this.$g.add(re));for(var ng=z.Hh(),Cj=z.O(),og=z.O(),An=0;An<cr;An++){var Xb=m[An];if(Xb!==fl)if(Xb.Ff&&Xb instanceof X)bo(Xb,dr,er,this),re=Xb.Ia,Ye.ri(re),this.$g.add(re);else if(2>Yg)tj(Xb,Infinity,Infinity),re=Xb.Ia,Ye.ri(re),this.$g.add(re);
  else{var od=Xb.De,gr=Xb.NA,Bn=Xb.kk;Bn.Be()&&(Bn=ec);var Of=Xb.pu,kt=Xb.DF,Dj=0,Ej=0,gl=0;if(od<-Yg||od>=Yg){var hr=kg.aF,yf=kg.$E;Of!==Qi&&(gl=kg.computeAngle(Xb,Of,yf),Xb.bm=gl);Dj=hr.x-lg.x;Ej=hr.y-lg.y}else{var Gd,Ze;if(0<=od)Gd=mg.ea(od),Ze=od<Yg-1?mg.ea(od+1):Gd;else{var Dh=Yg+od;Gd=mg.ea(Dh);Ze=0<Dh?mg.ea(Dh-1):Gd}if(Gd.Mc(Ze)){var Eh,Fh;0<=od?(Eh=0<od?mg.ea(od-1):Gd,Fh=od<Yg-2?mg.ea(od+2):Ze):(Eh=Dh<Yg-1?mg.ea(Dh+1):Gd,Fh=1<Dh?mg.ea(Dh-2):Ze);var ir=Eh.Af(Gd),jr=Ze.Af(Fh),yf=ir>jr+10?0<=od?
  Eh.Ec(Gd):Gd.Ec(Eh):jr>ir+10?0<=od?Ze.Ec(Fh):Fh.Ec(Ze):0<=od?Eh.Ec(Fh):Fh.Ec(Eh)}else yf=0<=od?Gd.Ec(Ze):Ze.Ec(Gd);Of!==Qi&&(gl=kg.computeAngle(Xb,Of,yf),Xb.bm=gl);Dj=Gd.x+(Ze.x-Gd.x)*gr-lg.x;Ej=Gd.y+(Ze.y-Gd.y)*gr-lg.y}tj(Xb,Infinity,Infinity);var re=Xb.Ia,el=Xb.Ga,Fj=0;Xb instanceof X&&(Fj=Xb.ub);var Gh=el.width+Fj,zi=el.height+Fj;ng.reset();ng.translate(-re.x,-re.y);ng.scale(Xb.scale,Xb.scale);ng.rotate(Of===Qi?Xb.angle:yf,Gh/2,zi/2);Of!==co&&Of!==eo||ng.rotate(90,Gh/2,zi/2);Of!==fo&&Of!==ho||
  ng.rotate(-90,Gh/2,zi/2);Of===io&&(45<yf&&135>yf||225<yf&&315>yf)&&ng.rotate(-yf,Gh/2,zi/2);var Ai=new w(0,0,Gh,zi);Cj.ru(Ai,Bn);ng.Cb(Cj);var lt=-Cj.x+Fj/2,mt=-Cj.y+Fj/2;og.assign(kt);isNaN(og.x)&&(og.x=0<=od?Gh/2+3:-(Gh/2+3));isNaN(og.y)&&(og.y=-(zi/2+3));og.rotate(yf);Dj+=og.x;Ej+=og.y;Ai.set(re);Ai.x=Dj+lt;Ai.y=Ej+mt;this.$g.add(Ai);Ye.ri(Ai)}}if(this.Ke)for(var kr=this.Hf;kr.next();)tj(kr.value,Infinity,Infinity);this.Zi=Ye;var Dn=this.Li;Dn.n(Dn.x+Ye.x,Dn.y+Ye.y);yb(e,Ye.width||0,Ye.height||
  0);z.jf(ng);z.A(Cj);z.A(og)}break;case "Grid":break;case "TableRow":case "TableColumn":z.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:z.k("Unknown panel type: "+n)}}var $e=e.width,af=e.height,ll=this.padding,nt=ll.top+ll.bottom,$e=$e+(ll.left+ll.right),af=af+nt;isFinite(g.width)&&($e=g.width);isFinite(g.height)&&(af=g.height);$e=Math.min(k.width,$e);af=Math.min(k.height,af);$e=Math.max(h.width,$e);af=
  Math.max(h.height,af);$e=Math.max(c,$e);af=Math.max(d,af);e.width=$e;e.height=af;yb(this.Wc,$e,af);Jm(this,0,0,$e,af)};I.prototype.findMainElement=I.prototype.gf=function(){if(null===this.Km){var a=this.va.o,b=a.length;if(0===b)return null;for(var c=0;c<b;c++){var d=a[c];if(!0===d.Ff)return this.Km=d}this.Km=a[0]}return this.Km};
  I.prototype.aj=function(a,b,c,d){var e=this.Zi,g=this.va.o,h=z.zk(0,0,0,0);if(0===g.length){var k=this.W;k.x=a;k.y=b;k.width=c;k.height=d}else{if(!this.Aa.F()){var l=Mm(this,!0),m=this.vd,n=m.width,p=m.height,q=this.margin,r=q.left+q.right,s=q.top+q.bottom;n===c&&p===d&&(l=bj);switch(l){case bj:if(n>c||p>d)this.Q(),tj(this,n>c?c:n,p>d?d:p);break;case lf:this.Q(!0);tj(this,c+r,d+s,0,0);break;case Cm:this.Q(!0);tj(this,c+r,p+s,0,0);break;case Bm:this.Q(!0),tj(this,n+r,d+s,0,0)}}k=this.W;k.x=a;k.y=b;
  k.width=c;k.height=d;var t=this.ba.Ub;switch(t){case "Position":for(var v=g.length,x=e.x-this.padding.left,y=e.y-this.padding.top,A=0;A<v;A++){var C=g[A],L=C.Ia,H=C.margin,U=C.position.x,ea=C.position.y;h.x=isNaN(U)?-x:U-x;h.y=isNaN(ea)?-y:ea-y;if(C instanceof X){var W=C;if(W.LE){var P=W.ub/2;h.x-=P;h.y-=P}}h.x+=H.left;h.y+=H.top;h.width=L.width;h.height=L.height;C.visible&&C.Lc(h.x,h.y,h.width,h.height)}break;case "Vertical":for(var ba=g.length,Oa=this.padding.left,sa=this.padding.top,Na=0;Na<ba;Na++){var ua=
  Oa,Ha=g[Na];if(Ha.visible){var Aa=Ha.Ia,jc=Ha.margin,zd=jc.left+jc.right,Ad=Oa+this.padding.right,Qe=Aa.width,ac=Mm(Ha,!1);if(isNaN(Ha.Aa.width)&&ac===lf||ac===Cm)Qe=Math.max(e.width-zd-Ad,0);var Ng=Qe+zd+Ad,Bd=Ha.alignment;Bd.bd()&&(Bd=this.Cl);Bd.cd()||(Bd=ec);Ha.Lc(ua+Bd.offsetX+jc.left+(e.width*Bd.x-Ng*Bd.x),sa+Bd.offsetY+jc.top,Qe,Aa.height);sa+=Aa.height+jc.bottom+jc.top}}break;case "Horizontal":for(var rb=g.length,gb=this.padding.top,oa=this.padding.left,pa=0;pa<rb;pa++){var sb=gb,Xa=g[pa];
  if(Xa.visible){var Va=Xa.Ia,Ae=Xa.margin,Cd=Ae.top+Ae.bottom,me=gb+this.padding.bottom,Rd=Va.height,ne=Mm(Xa,!1);if(isNaN(Xa.Aa.height)&&ne===lf||ne===Bm)Rd=Math.max(e.height-Cd-me,0);var Og=Rd+Cd+me,fd=Xa.alignment;fd.bd()&&(fd=this.Cl);fd.cd()||(fd=ec);Xa.Lc(oa+fd.offsetX+Ae.left,sb+fd.offsetY+Ae.top+(e.height*fd.y-Og*fd.y),Va.width,Rd);oa+=Va.width+Ae.left+Ae.right}}break;case "Spot":var ti=g.length,Ab=this.gf(),Qb=Ab.Ia,gd=Qb.width,qh=Qb.height,Lb=this.padding,kb=Lb.left,db=Lb.top;h.x=kb-e.x;
  h.y=db-e.y;Ab.Lc(h.x,h.y,gd,qh);for(var Re=0;Re<ti;Re++){var Sd=g[Re];if(Sd!==Ab){var Pg=Sd.Ia,Qg=Pg.width,kc=Pg.height,lc=Sd.alignment;lc.bd()&&(lc=this.Cl);lc.cd()||(lc=ec);var oe=Sd.kk;oe.bd()&&(oe=ec);h.x=lc.x*gd+lc.offsetX-(oe.x*Qg-oe.offsetX);h.y=lc.y*qh+lc.offsetY-(oe.y*kc-oe.offsetY);h.x-=e.x;h.y-=e.y;Sd.visible&&Sd.Lc(kb+h.x,db+h.y,Qg,kc)}}break;case "Auto":var hd=g.length,mb=this.gf(),Uc=mb.Ia,Qa=z.lg();Qa.n(0,0,1,1);var nb=mb.margin,yc=nb.left,Dd=nb.top,Mb=this.padding,pe=Mb.left,tf=Mb.top;
  h.x=yc;h.y=Dd;h.width=Uc.width;h.height=Uc.height;mb.Lc(pe+h.x,tf+h.y,h.width,h.height);var Se=Yn(mb),Mf=Zn(mb),Jb=0+Se.y*Uc.height+Se.offsetY,Be=0+Mf.x*Uc.width+Mf.offsetX,Rb=0+Mf.y*Uc.height+Mf.offsetY;Qa.x=0+Se.x*Uc.width+Se.offsetX;Qa.y=Jb;Hb(Qa,Be,Rb,0,0);Qa.x+=yc+pe;Qa.y+=Dd+tf;for(var Vb=0;Vb<hd;Vb++){var Nb=g[Vb];if(Nb!==mb){var Jc=Nb.Ia,nb=Nb.margin,xb=Math.max(Jc.width+nb.right+nb.left,0),Fb=Math.max(Jc.height+nb.top+nb.bottom,0),Ob=Nb.alignment;Ob.bd()&&(Ob=this.Cl);Ob.cd()||(Ob=ec);h.x=
  Qa.width*Ob.x+Ob.offsetX-xb*Ob.x+nb.left+Qa.x;h.y=Qa.height*Ob.y+Ob.offsetY-Fb*Ob.y+nb.top+Qa.y;h.width=Qa.width;h.height=Qa.height;Nb.visible&&(Ib(Qa.x,Qa.y,Qa.width,Qa.height,h.x,h.y,Jc.width,Jc.height)?Nb.Lc(h.x,h.y,Jc.width,Jc.height):Nb.Lc(h.x,h.y,Jc.width,Jc.height,new w(Qa.x,Qa.y,Qa.width,Qa.height)))}}z.dc(Qa);break;case "Table":for(var Td=g.length,Rg=this.padding,rh=Rg.left,sh=Rg.top,Ce=this.vs,Kc=0,De=0,mc=Ce.length,Bb=0,Cb=0;Cb<mc;Cb++)Ce[Cb]&&(Bb=Math.max(Bb,Ce[Cb].length));for(var Lc=
  Math.min(this.Yi,mc-1);Lc!==mc&&(void 0===this.Wd[Lc]||0===this.Wd[Lc].Xa);)Lc++;for(var Lc=Math.min(Lc,mc-1),Sg=-this.Wd[Lc].sb,Vc=Math.min(this.Ki,Bb-1);Vc!==Bb&&(void 0===this.Sd[Vc]||0===this.Sd[Vc].Xa);)Vc++;for(var Vc=Math.min(Vc,Bb-1),Wc=-this.Sd[Vc].sb,lb=z.Xl(),Cb=0;Cb<mc;Cb++)if(Ce[Cb]){var Bb=Ce[Cb].length,Mc=this.$d(Cb),De=Mc.sb+Sg+sh;0!==Mc.Xa&&(De+=Mc.TD());for(var Ud=0;Ud<Bb;Ud++)if(Ce[Cb][Ud]){var Vd=this.Zd(Ud),Kc=Vd.sb+Wc+rh;0!==Vd.Xa&&(Kc+=Vd.TD());for(var uf=Ce[Cb][Ud],Tg=uf.length,
  yj=0;yj<Tg;yj++){var La=uf[yj],Te=La.Ia,qe=La instanceof I?La:null;if(null===qe||qe.type!==Qm&&qe.type!==Rm){lb.n(0,0);for(var ia=1;ia<La.rowSpan&&!(Cb+ia>=this.Yp);ia++){var fa=this.$d(Cb+ia);lb.height+=fa.total}for(ia=1;ia<La.dH&&!(Ud+ia>=this.fp);ia++){var id=this.Zd(Ud+ia);lb.width+=id.total}var th=Vd.Xa+lb.width,ui=Mc.Xa+lb.height;h.x=Kc;h.y=De;h.width=th;h.height=ui;var zc=Kc,vi=De,bc=th,uh=ui;Kc+th>e.width&&(bc=Math.max(e.width-Kc,0));De+ui>e.height&&(uh=Math.max(e.height-De,0));var jd=La.alignment,
  Ee=0,Nc=0,kd=0,Ac=0;if(jd.bd()){jd=this.Cl;jd.cd()||(jd=ec);var Ee=jd.x,Nc=jd.y,kd=jd.offsetX,Ac=jd.offsetY,ld=Vd.alignment,eg=Mc.alignment;ld.cd()&&(Ee=ld.x,kd=ld.offsetX);eg.cd()&&(Nc=eg.y,Ac=eg.offsetY)}else Ee=jd.x,Nc=jd.y,kd=jd.offsetX,Ac=jd.offsetY;if(isNaN(Ee)||isNaN(Nc))Nc=Ee=.5,Ac=kd=0;var Z=Te.width,Fe=Te.height,Ue=La.margin,wi=Ue.left+Ue.right,xi=Ue.top+Ue.bottom,Oc=Zm(La,Mc,Vd,!1);!isNaN(La.Aa.width)||Oc!==lf&&Oc!==Cm||(Z=Math.max(th-wi,0));!isNaN(La.Aa.height)||Oc!==lf&&Oc!==Bm||(Fe=
  Math.max(ui-xi,0));var ob=La.Xe,pb=La.dg,Z=Math.min(ob.width,Z),Fe=Math.min(ob.height,Fe),Z=Math.max(pb.width,Z),Fe=Math.max(pb.height,Fe),Zk=Fe+xi;h.x+=h.width*Ee-(Z+wi)*Ee+kd+Ue.left;h.y+=h.height*Nc-Zk*Nc+Ac+Ue.top;La.visible&&(Ib(zc,vi,bc,uh,h.x,h.y,Te.width,Te.height)?La.Lc(h.x,h.y,Z,Fe):La.Lc(h.x,h.y,Z,Fe,new w(zc,vi,bc,uh)))}else{La.Gi();La.Xb.Wa();var fg=La.Xb;fg.x=qe.type===Qm?rh:Kc;fg.y=qe.type===Rm?sh:De;fg.width=Te.width;fg.height=Te.height;La.Xb.freeze();Om(La,!1)}}}}z.qk(lb);for(Cb=
  0;Cb<Td;Cb++)La=g[Cb],qe=La instanceof I?La:null,null===qe||qe.type!==Qm&&qe.type!==Rm||(fg=La.Xb,La.Wc.Wa(),La.Wc.n(0,0,fg.width,fg.height),La.Wc.freeze());break;case "Viewbox":var Ug=g[0],Vg=Ug.Ia,Wb=Ug.margin,gg=Wb.top+Wb.bottom,hg=Math.max(Vg.width+(Wb.right+Wb.left),0),Xc=Math.max(Vg.height+gg,0),Ge=Ug.alignment;Ge.bd()&&(Ge=this.Cl);Ge.cd()||(Ge=ec);h.x=e.width*Ge.x-hg*Ge.x+Ge.offsetX;h.y=e.height*Ge.y-Xc*Ge.y+Ge.offsetY;h.width=Vg.width;h.height=Vg.height;Ug.Lc(h.x,h.y,h.width,h.height);break;
  case "Link":var zn=g.length,yi=this instanceof da?this.Xf:this;if(yi instanceof G){var Ve=this instanceof da?null:yi.path;if(null!==this.$g){var We=this.$g.o,Ed=0;if(null!==Ve&&Ed<this.$g.count){var md=We[Ed];Ed++;Ve.Lc(md.x-this.Zi.x,md.y-this.Zi.y,md.width,md.height)}for(var vh=0;vh<zn;vh++){var Wd=g[vh];Wd!==Ve&&Ed<this.$g.count&&(md=We[Ed],Ed++,Wd.Lc(md.x-this.Zi.x,md.y-this.Zi.y,md.width,md.height))}}var Xd=yi.points,wh=Xd.count;if(2<=wh&&this.Ke)for(var xh=this.Hf;xh.next();){var nd=xh.value,
  Wg=wh,vf=Xd,nc=nd.De,yh=nd.NA,qb=nd.kk,He=nd.pu,Nf=nd.DF,wf=0,Yd=0,hb=0;if(nc<-Wg||nc>=Wg){var Xg=this.aF,rc=this.$E;He!==Qi&&(hb=this.computeAngle(nd,He,rc),nd.angle=hb);wf=Xg.x;Yd=Xg.y}else{var Bc=void 0,Fd=void 0;if(0<=nc)Bc=vf.o[nc],Fd=nc<Wg-1?vf.o[nc+1]:Bc;else var Sb=Wg+nc,Bc=vf.o[Sb],Fd=0<Sb?vf.o[Sb-1]:Bc;if(Bc.Mc(Fd)){var Zd=void 0,Ie=void 0;0<=nc?(Zd=0<nc?vf.o[nc-1]:Bc,Ie=nc<Wg-2?vf.o[nc+2]:Fd):(Zd=Sb<Wg-1?vf.o[Sb+1]:Bc,Ie=1<Sb?vf.o[Sb-2]:Fd);var ig=Zd.Af(Bc),jg=Fd.Af(Ie),rc=ig>jg+10?0<=
  nc?Zd.Ec(Bc):Bc.Ec(Zd):jg>ig+10?0<=nc?Fd.Ec(Ie):Ie.Ec(Fd):0<=nc?Zd.Ec(Ie):Ie.Ec(Zd)}else rc=0<=nc?Bc.Ec(Fd):Fd.Ec(Bc);He!==Qi&&(hb=this.computeAngle(nd,He,rc),nd.angle=hb);wf=Bc.x+(Fd.x-Bc.x)*yh;Yd=Bc.y+(Fd.y-Bc.y)*yh}if(qb.N(Yb))nd.location=new N(wf,Yd);else{qb.Be()&&(qb=ec);var xf=z.Hh();xf.reset();xf.scale(nd.scale,nd.scale);xf.rotate(nd.angle,0,0);var zj=nd.Ga,$d=z.zk(0,0,zj.width,zj.height),Yc=z.O();Yc.ru($d,qb);xf.Cb(Yc);var Ah=-Yc.x,Bh=-Yc.y,oc=Nf.copy();isNaN(oc.x)&&(oc.x=0<=nc?Yc.x+3:-(Yc.x+
  3));isNaN(oc.y)&&(oc.y=-(Yc.y+3));oc.rotate(rc);wf+=oc.x;Yd+=oc.y;xf.aG($d);var Ah=Ah+$d.x,Bh=Bh+$d.y,Ch=z.Tb(wf+Ah,Yd+Bh);nd.move(Ch);z.A(Ch);z.A(Yc);z.dc($d);z.jf(xf)}}this instanceof da?this.nn(!1):yi.nn(!1)}break;case "Grid":break;case "TableRow":case "TableColumn":z.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:z.k("Unknown panel type: "+t)}z.dc(h)}};
  I.prototype.mk=function(a){var b=this.Ga;if(Ib(0,0,b.width,b.height,a.x,a.y)){for(var b=this.va.o,c=b.length,d=z.Tb(0,0);c--;){var e=b[c];if(e.visible||e===this.Zb)if(tb(d.set(a),e.transform),e.Ma(d))return z.A(d),!0}z.A(d);return null===this.Nb&&null===this.uc?!1:!0}return!1};I.prototype.Zw=function(a){if(this.Jn===a)return this;for(var b=this.va.o,c=b.length,d=0;d<c;d++){var e=b[d].Zw(a);if(null!==e)return e}return null};
  function jo(a,b,c){c(a,b);if(b instanceof I){b=b.va.o;for(var d=b.length,e=0;e<d;e++)jo(a,b[e],c)}}function wl(a,b){ko(a,a,b)}function ko(a,b,c){c(b);b=b.va.o;for(var d=b.length,e=0;e<d;e++){var g=b[e];g instanceof I&&ko(a,g,c)}}I.prototype.walkVisualTree=I.prototype.CJ=function(a){lo(this,this,a)};function lo(a,b,c){c(b);if(b instanceof I){b=b.va.o;for(var d=b.length,e=0;e<d;e++)lo(a,b[e],c)}}I.prototype.findInVisualTree=I.prototype.zt=function(a){return mo(this,this,a)};
  function mo(a,b,c){if(c(b))return b;if(b instanceof I){b=b.va.o;for(var d=b.length,e=0;e<d;e++){var g=mo(a,b[e],c);if(null!==g)return g}}return null}I.prototype.findObject=I.prototype.oe=function(a){if(this.name===a)return this;for(var b=this.va.o,c=b.length,d=0;d<c;d++){var e=b[d];if(e.name===a)return e;if(e instanceof I)if(null===e.Ji&&null===e.tg){if(e=e.oe(a),null!==e)return e}else if(Rl(e)&&(e=e.va.first(),null!==e&&(e=e.oe(a),null!==e)))return e}return null};
  function no(a){a=a.va.o;for(var b=a.length,c=0,d=0;d<b;d++){var e=a[d];if(e instanceof I)c=Math.max(c,no(e));else if(e instanceof X){a:{if(null!==!e.Vf)switch(e.eo){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.Oe/2*e.Jm*e.hj()}c=Math.max(c,e)}}return c}f=I.prototype;f.Wg=function(){return!(this.type===Qm||this.type===Rm)};
  f.pe=function(a,b,c){if(!1===this.jg)return null;void 0===b&&(b=null);void 0===c&&(c=null);if(nl(this))return null;var d=this.Ga,e=1/this.hj(),g=this.Wg(),h=g?a:tb(z.Tb(a.x,a.y),this.transform),k=this.h,l=10,m=5;null!==k&&(l=k.rp("extraTouchArea"),m=l/2);if(Ib(-(m*e),-(m*e),d.width+l*e,d.height+l*e,h.x,h.y)){if(!this.eh){var e=this.va.o,n=e.length,k=z.O(),m=(l=this.JE)?this.gf():null;if(l&&(m.Wg()?tb(k.set(a),m.transform):k.set(a),!m.Ma(k)))return z.A(k),g||z.A(h),null;for(;n--;){var p=e[n];if(p.visible||
  p===this.Zb)if(p.Wg()?tb(k.set(a),p.transform):k.set(a),!l||p!==m){var q=null;p instanceof I?q=p.pe(k,b,c):!0===p.jg&&p.Ma(k)&&(q=p);if(null!==q&&(null!==b&&(q=b(q)),null!==q&&(null===c||c(q))))return z.A(k),g||z.A(h),q}}z.A(k)}if(null===this.background&&null===this.wl)return g||z.A(h),null;a=Ib(0,0,d.width,d.height,h.x,h.y)?this:null;g||z.A(h);return a}g||z.A(h);return null};
  f.lp=function(a,b,c,d){if(!1===this.jg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);d instanceof J||d instanceof K||(d=new J(O));var e=this.Ga,g=this.Wg(),h=g?a:tb(z.Tb(a.x,a.y),this.transform);if(Ib(0,0,e.width,e.height,h.x,h.y)){if(!this.eh){for(var e=this.va.o,k=e.length,l=z.O();k--;){var m=e[k];if(m.visible||m===this.Zb){m.Wg()?tb(l.set(a),m.transform):l.set(a);var n=m,m=m instanceof I?m:null;(null!==m?m.lp(l,b,c,d):n.Ma(l))&&!1!==n.jg&&(null!==b&&(n=b(n)),null===n||null!==c&&!c(n)||d.add(n))}}z.A(l)}g||
  z.A(h);return null!==this.background||null!==this.wl}g||z.A(h);return!1};
  f.pk=function(a,b,c,d,e,g){if(!1===this.jg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=z.Hh(),h.reset());h.multiply(this.transform);if(this.Xm(a,h))return oo(this,b,c,e),void 0===g&&z.jf(h),!0;if(this.Jg(a,h)){if(!this.eh)for(var k=this.va.o,l=k.length;l--;){var m=k[l];if(m.visible||m===this.Zb){var n=m.W,p=this.Ga;if(!(n.x>p.width||n.y>p.height||0>n.x+n.width||0>n.y+n.height)){n=m;m=m instanceof I?m:null;p=z.Hh();p.set(h);if(null!==m?m.pk(a,b,c,d,e,p):Lm(n,a,d,p))null!==
  b&&(n=b(n)),null===n||null!==c&&!c(n)||e.add(n);z.jf(p)}}}void 0===g&&z.jf(h);return d}void 0===g&&z.jf(h);return!1};function oo(a,b,c,d){for(var e=a.va.o,g=e.length;g--;){var h=e[g];if(h.visible){var k=h.W,l=a.Ga;k.x>l.width||k.y>l.height||0>k.x+k.width||0>k.y+k.height||(h instanceof I&&oo(h,b,c,d),null!==b&&(h=b(h)),null===h||null!==c&&!c(h)||d.add(h))}}}
  f.cn=function(a,b,c,d,e,g){if(!1===this.jg)return!1;void 0===c&&(c=null);void 0===d&&(d=null);var h=this.Ga,k=this.Wg(),l=k?a:tb(z.Tb(a.x,a.y),this.transform),m=k?b:tb(z.Tb(b.x,b.y),this.transform),n=l.Af(m),p=0<l.x&&l.x<h.width&&0<l.y&&l.y<h.height||ub(l.x,l.y,0,0,0,h.height)<n||ub(l.x,l.y,0,h.height,h.width,h.height)<n||ub(l.x,l.y,h.width,h.height,h.width,0)<n||ub(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&&ub(l.x,l.y,0,0,0,h.height)<n&&ub(l.x,l.y,0,h.height,h.width,h.height)<
  n&&ub(l.x,l.y,h.width,h.height,h.width,0)<n&&ub(l.x,l.y,h.width,0,0,0)<n;k||(z.A(l),z.A(m));if(p){if(!this.eh){k=z.O();l=z.O();m=this.va.o;for(n=m.length;n--;){var q=m[n];if(q.visible||q===this.Zb){var r=q.W,s=this.Ga;r.x>s.width||r.y>s.height||0>r.x+r.width||0>r.y+r.height||(q.Wg()?(r=q.transform,tb(k.set(a),r),tb(l.set(b),r)):(k.set(a),l.set(b)),r=q,q=q instanceof I?q:null,null!==q?!q.cn(k,l,c,d,e,g):!r.rE(k,l,e))||(null!==c&&(r=c(r)),null===r||null!==d&&!d(r)||g.add(r))}}z.A(k);z.A(l)}return e?
  p:h}return!1};function Yn(a){var b=a.C;if(void 0===b||b===Pc)b=null;null===b&&a instanceof X&&(a=a.wh,null!==a&&(b=a.C));null===b&&(b=Zb);return b}function Zn(a){var b=a.D;if(void 0===b||b===Pc)b=null;null===b&&a instanceof X&&(a=a.wh,null!==a&&(b=a.D));null===b&&(b=ic);return b}I.prototype.add=I.prototype.add=function(a){z.l(a,O,I,"add:element");this.Md(this.va.count,a)};I.prototype.elt=I.prototype.ea=function(a){return this.va.ea(a)};
  I.prototype.insertAt=I.prototype.Md=function(a,b){b instanceof D&&z.k("Cannot add a Part to a Panel: "+b);if(this===b||this.Pl(b))this===b&&z.k("Cannot make a Panel contain itself: "+this.toString()),z.k("Cannot make a Panel indirectly contain itself: "+this.toString()+" already contains "+b.toString());var c=b.T;null!==c&&c!==this&&z.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.ba!==Hk||b instanceof X||z.k("Can only add Shapes to a Grid Panel, not: "+b);b.Tl(this);b.Am=null;if(null!==this.Tt){var d=b.data;null!==d&&"object"===typeof d&&(null===this.sg&&(this.sg=new na(Object,I)),this.sg.add(d,b))}var e=this.va,d=-1;if(c===this){for(var g=-1,h=this.va.o,k=h.length,l=0;l<k;l++)if(h[l]===b){g=l;break}if(-1!==g){if(g===a||g+1>=e.count&&a>=e.count)return;e.dd(g);d=g}else z.k("element "+b.toString()+" has panel "+c.toString()+" but is not contained by it.")}if(0>
  a||a>e.count)a=e.count;e.Md(a,b);this.Q();b.Q();null!==b.zd?this.Rh=!0:b instanceof I&&!0===b.Rh&&(this.Rh=!0);c=this.ca;null!==c&&(c.jl=null,c.Rj=NaN,this.Rh&&c instanceof E&&(c.Rh=!0),c.Rh&&(c.Ed=null),e=this.h,null!==e&&e.pa.qb||(-1!==d&&c.Rc(Xf,"elements",this,b,null,d,null),c.Rc(Wf,"elements",this,null,b,null,a)))};I.prototype.remove=I.prototype.remove=function(a){z.l(a,O,I,"remove:element");for(var b=this.va.o,c=b.length,d=-1,e=0;e<c;e++)if(b[e]===a){d=e;break}-1!==d&&this.Ve(d)};
  I.prototype.removeAt=I.prototype.dd=function(a){u&&z.p(a,I,"removeAt:idx");0<=a&&this.Ve(a)};I.prototype.Ve=function(a){var b=this.va,c=b.ea(a);c.Am=null;c.Tl(null);if(null!==this.sg){var d=c.data;"object"===typeof d&&this.sg.remove(d)}b.dd(a);Yk(this,!1);this.Q();this.Km===c&&(this.Km=null);b=this.ca;null!==b&&(b.jl=null,b.Rj=NaN,b.ae(),d=this.h,null!==d&&d.pa.qb||b.Rc(Xf,"elements",this,c,null,a,null))};z.w(I,{Yp:"rowCount"},function(){return void 0===this.Wd?0:this.Wd.length});
  I.prototype.getRowDefinition=I.prototype.$d=function(a){u&&z.p(a,I,"getRowDefinition:idx");0>a&&z.ka(a,">= 0",I,"getRowDefinition:idx");a=Math.round(a);var b=this.Wd;if(void 0===b[a]){var c=new Ig;c.Tl(this);c.re=!0;c.index=a;b[a]=c}return b[a]};I.prototype.removeRowDefinition=I.prototype.oF=function(a){u&&z.p(a,I,"removeRowDefinition:idx");0>a&&z.ka(a,">= 0",I,"removeRowDefinition:idx");a=Math.round(a);var b=this.Wd;this.Rc(Xf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.Q()};
  z.w(I,{fp:"columnCount"},function(){return void 0===this.Sd?0:this.Sd.length});I.prototype.getColumnDefinition=I.prototype.Zd=function(a){u&&z.p(a,I,"getColumnDefinition:idx");0>a&&z.ka(a,">= 0",I,"getColumnDefinition:idx");a=Math.round(a);var b=this.Sd;if(void 0===b[a]){var c=new Ig;c.Tl(this);c.re=!1;c.index=a;b[a]=c}return b[a]};
  I.prototype.removeColumnDefinition=I.prototype.kF=function(a){u&&z.p(a,I,"removeColumnDefinition:idx");0>a&&z.ka(a,">= 0",I,"removeColumnDefinition:idx");a=Math.round(a);var b=this.Sd;this.Rc(Xf,"coldefs",this,b[a],null,a,null);b[a]&&delete b[a];this.Q()};
  z.defineProperty(I,{dJ:"rowSizing"},function(){return void 0===this.Fm?Un:this.Fm},function(a){if(void 0!==this.Fm){var b=this.Fm;b!==a&&(a!==Un&&a!==ao&&z.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.Fm=a,this.Q(),this.j("rowSizing",b,a))}});
  z.defineProperty(I,{cH:"columnSizing"},function(){return void 0===this.em?Un:this.em},function(a){if(void 0!==this.em){var b=this.em;b!==a&&(a!==Un&&a!==ao&&z.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: "+a),this.em=a,this.Q(),this.j("columnSizing",b,a))}});
  z.defineProperty(I,{VF:"topIndex"},function(){return void 0===this.Yi?0:this.Yi},function(a){if(void 0!==this.Yi){var b=this.Yi;b!==a&&((!isFinite(a)||0>a)&&z.k("Panel.topIndex must be greater than zero and a real number, not: "+a),this.Yi=a,this.Q(),this.j("topIndex",b,a))}});
  z.defineProperty(I,{WE:"leftIndex"},function(){return void 0===this.Ki?0:this.Ki},function(a){if(void 0!==this.Ki){var b=this.Ki;b!==a&&((!isFinite(a)||0>a)&&z.k("Panel.leftIndex must be greater than zero and a real number, not: "+a),this.Ki=a,this.Q(),this.j("leftIndex",b,a))}});I.prototype.findRowForLocalY=function(a){if(0>a)return-1;if(this.type!==ga)return NaN;for(var b=0,c=this.Wd,d=c.length,e=this.Yi;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))return e}return-1};
  I.prototype.findColumnForLocalX=function(a){if(0>a)return-1;if(this.type!==ga)return NaN;for(var b=0,c=this.Sd,d=c.length,e=this.Ki;e<d;e++){var g=c[e];if(void 0!==g&&(b+=g.total,a<b))return e}return-1};
  z.defineProperty(I,{data:"data"},function(){return this.fe},function(a){var b=this.fe;if(b!==a){var c=this instanceof D&&!(this instanceof da);c&&z.g(a,"object",I,"data");jh(this);this.fe=a;var d=this.h;null!==d&&(c?this instanceof G?(null!==b&&d.Rk.remove(b),null!==a&&d.Rk.add(a,this)):this instanceof D&&(null!==b&&d.Ai.remove(b),null!==a&&d.Ai.add(a,this)):(c=this.T,null!==c&&null!==c.sg&&(null!==b&&c.sg.remove(b),null!==a&&c.sg.add(a,this))));this.j("data",b,a);null!==d&&d.pa.qb||null!==a&&this.Mb()}});
  z.defineProperty(I,{lI:"itemIndex"},function(){return this.vr},function(a){var b=this.vr;b!==a&&(this.vr=a,this.j("itemIndex",b,a))});function fn(a){a=a.Ok;return null!==a&&a.G}
  function jh(a){var b=a.Ok;if(null===b)null!==a.data&&z.k("Template cannot have .data be non-null: "+a),a.Ok=b=new J($g);else if(b.G)return;var c=new J(O);jo(a,a,function(a,d){var e=d.Ac;if(null!==e)for(bn(d,!1),e=e.i;e.next();){var g=e.value;g.mode===bh&&bn(d,!0);if(null!==g.xn){var h=ch(g,a,d);null!==h&&(c.add(h),null===h.No&&(h.No=new J($g)),h.No.add(g))}b.add(g)}if(d instanceof I&&d.type===ga){if(0<d.Wd.length)for(e=d.Wd,g=e.length,h=0;h<g;h++){var k=e[h];if(void 0!==k&&null!==k.Ac)for(var l=k.Ac.i;l.next();){var v=
  l.value;v.Bg=k;v.Ts=2;v.Vo=k.index;b.add(v)}}if(0<d.Sd.length)for(e=d.Sd,g=e.length,h=0;h<g;h++)if(k=e[h],void 0!==k&&null!==k.Ac)for(l=k.Ac.i;l.next();)v=l.value,v.Bg=k,v.Ts=1,v.Vo=k.index,b.add(v)}});for(var d=c.i;d.next();){var e=d.value;if(null!==e.No){bn(e,!0);for(var g=e.No.i;g.next();){var h=g.value;null===e.Ac&&(e.Ac=new J($g));e.Ac.add(h)}}e.No=null}for(d=b.i;d.next();)if(e=d.value,g=e.Bg,null!==g){e.Bg=null;var k=e.yu,l=k.indexOf(".");0<l&&g instanceof I&&(h=k.substring(0,l),k=k.substr(l+
  1),l=g.oe(h),null!==l?(g=l,e.yu=k):z.trace('Warning: unable to find GraphObject named "'+h+'" for Binding: '+e.toString()));g instanceof Ig?(e.Wl=z.nd(g.T),g.T.Jn=e.Wl):(e.Wl=z.nd(g),g.Jn=e.Wl)}b.freeze();a instanceof D&&(a.be()&&(tj(a,Infinity,Infinity),a.Lc()),u&&!po&&jo(a,a,function(a,c){if(c instanceof I&&(c.type===Ek||c.type===$i)&&1>=c.elements.count&&!(c instanceof D)){if(1===c.elements.count){var d=null!==c.Tt;if(!d)for(var e=b.i;e.next();)if("itemArray"===e.value.yu){d=!0;break}}d||(z.trace("Auto or Spot Panel should not have zero or one elements: "+
  c.toString()+" in "+a.toString()),po=!0)}}))}var po=!1;I.prototype.copyTemplate=function(){var a=this.copy();a.CJ(function(a){a instanceof I&&(a.Ok=null,a.fe=null);var c=a.Ac;null!==c&&(a.Ac=null,c.each(function(c){a.bind(c.copy())}))});return a};
  I.prototype.updateTargetBindings=I.prototype.Mb=function(a){var b=this.Ok;if(null!==b)for(void 0===a&&(a=""),b=b.i;b.next();){var c=b.value,d=c.NF;if(""===a||""===d||d===a)if(d=c.yu,null!==c.gH||""!==d){var d=this.data,e=c.xn;if(null!==e)d=""===e?this:"."===e?this:".."===e?this:this.oe(e);else{var g=this.h;null!==g&&c.St&&(d=g.ha.uk)}if(null===d)u&&z.trace("Binding error: missing GraphObject named "+e+" in "+this.toString());else{var g=this,h=c.Wl;if(-1!==h){if(g=this.Zw(h),null===g)continue}else null!==
  c.Bg&&(g=c.Bg);"."===e?d=g:".."===e&&(d=g.T);e=c.Ts;if(0!==e){if(!(g instanceof I))continue;h=g;1===e?g=h.Zd(c.Vo):2===e&&(g=h.$d(c.Vo))}void 0!==g&&c.eG(g,d)}}}};z.defineProperty(I,{Tt:"itemArray"},function(){return this.Ji},function(a){var b=this.Ji;if(b!==a){u&&null!==a&&!z.isArray(a)&&z.k("Panel.itemArray must be an Array-like object or null, not: "+a);var c=this.h;null!==c&&null!==b&&Cl(c,this);this.Ji=a;null!==c&&null!==a&&yl(c,this);this.j("itemArray",b,a);null!==c&&c.pa.qb||this.GA()}});
  function Rl(a){return a.type===$i||a.type===Ek||a.type===Ni||a.type===ga&&0<a.va.length&&(a=a.va.ea(0),a.Ff&&a instanceof I&&(a.type===Qm||a.type===Rm))?!0:!1}I.prototype.rebuildItemElements=I.prototype.GA=function(){var a=0;for(Rl(this)&&(a=1);this.va.length>a;)this.Ve(this.va.length-1);a=this.Tt;if(null!==a)for(var b=z.ab(a),c=0;c<b;c++)Ql(this,z.Ya(a,c),c)};
  I.prototype.findItemPanelForData=I.prototype.DH=function(a){if(void 0===a||null===a||null===this.sg)return null;z.g(a,"object",I,"findItemPanelForData");return this.sg.na(a)};
  function Ql(a,b,c){if(!(void 0===b||null===b||0>c)){var d;d=qo(a,b);var e=a.mI,g=null;null!==e&&(g=e.na(d));null===g&&(ro||(ro=!0,z.trace('No item template Panel found for category "'+d+'" on '+a),z.trace("  Using default item template."),d=new I,e=new qa,e.bind(new $g("text","",ka)),d.add(e),so=d),g=so);d=g;null!==d&&(jh(d),d=d.copy(),"object"===typeof b&&(null===a.sg&&(a.sg=new na(Object,I)),a.sg.add(b,d)),e=c,Rl(a)&&e++,a.Md(e,d),Sl(a,e,c),d.fe=null,d.data=b)}}
  function Sl(a,b,c){for(a=a.va;b<a.length;){var d=a.ea(b);if(d instanceof I){var e=b,g=c;d.type===Qm?d.Vb=e:d.type===Rm&&(d.column=e);d.lI=g}b++;c++}}
  z.defineProperty(I,{LK:"itemTemplate"},function(){return null===this.tg?null:this.tg.na("")},function(a){if(null===this.tg){if(null===a)return;this.tg=new na("string",I)}var b=this.tg.na("");b!==a&&(z.l(a,I,I,"itemTemplate"),(a instanceof D||a.Ff)&&z.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: "+a),this.tg.add("",a),this.j("itemTemplate",b,a),a=this.h,null!==a&&a.pa.qb||this.GA())});
  z.defineProperty(I,{mI:"itemTemplateMap"},function(){return this.tg},function(a){var b=this.tg;if(b!==a){z.l(a,na,I,"itemTemplateMap");for(var c=a.i;c.next();){var d=c.value;(d instanceof D||d.Ff)&&z.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: "+d)}this.tg=a;this.j("itemTemplateMap",b,a);a=this.h;null!==a&&a.pa.qb||this.GA()}});
  z.defineProperty(I,{KK:"itemCategoryProperty"},function(){return this.uo},function(a){var b=this.uo;b!==a&&("string"!==typeof a&&"function"!==typeof a&&z.ic(a,"string or function",I,"itemCategoryProperty"),this.uo=a,this.j("itemCategoryProperty",b,a))});
  function qo(a,b){if(null===b)return"";var c=a.uo,d="";if("function"===typeof c)d=c(b);else if("string"===typeof c&&"object"===typeof b){if(""===c)return"";d=z.tb(b,c)}else return"";if(void 0===d)return"";if("string"===typeof d)return d;z.k("Panel.getCategoryForItemData found a non-string category for "+b+": "+d);return""}var ro=!1,so=null;z.defineProperty(I,{FK:"isAtomic"},function(){return this.eh},function(a){var b=this.eh;b!==a&&(z.g(a,"boolean",I,"isAtomic"),this.eh=a,this.j("isAtomic",b,a))});
  z.defineProperty(I,{JE:"isClipping"},function(){return this.hr},function(a){var b=this.hr;b!==a&&(z.g(a,"boolean",I,"isClipping"),this.hr=a,this.j("isClipping",b,a))});function Ig(){z.kc(this);this.mh=null;this.Cv=!0;this.Uc=0;this.ef=NaN;this.Vj=0;this.Tj=Infinity;this.Ie=Pc;this.sb=this.Xa=0;this.Ac=null;this.Ls=to;this.ei=Am;this.Fs=this.Zj=null;this.Gs=NaN;this.Nb=this.Yh=null;this.Gq=!1}z.ia("RowColumnDefinition",Ig);
  Ig.prototype.copy=function(){var a=new Ig;a.Cv=this.Cv;a.Uc=this.Uc;a.ef=this.ef;a.Vj=this.Vj;a.Tj=this.Tj;a.Ie=this.Ie;a.Xa=this.Xa;a.sb=this.sb;a.ei=this.ei;a.Ls=this.Ls;a.Zj=null===this.Zj?null:this.Zj.V();a.Fs=this.Fs;a.Gs=this.Gs;a.Yh=null;null!==this.Yh&&(a.Yh=z.Al(this.Yh));a.Nb=this.Nb;a.Gq=this.Gq;a.Ac=this.Ac;return a};
  Ig.prototype.tt=function(a){z.l(a,Ig,Ig,"copyFrom:pd");a.re?this.height=a.height:this.width=a.width;this.qj=a.qj;this.qf=a.qf;this.alignment=a.alignment;this.stretch=a.stretch;this.uu=a.uu;this.Zj=null===a.Zj?null:a.Zj.V();this.Zp=a.Zp;this.$p=a.$p;this.Yh=null;a.Yh&&(this.Yh=z.Al(a.Yh));this.background=a.background;this.Nz=a.Nz;this.Ac=a.Ac};Ig.prototype.toString=function(){return"RowColumnDefinition "+(this.re?"(Row ":"(Column ")+this.index+") #"+z.nd(this)};var to;
  Ig.Default=to=z.s(Ig,"Default",0);var ao;Ig.None=ao=z.s(Ig,"None",1);var Un;Ig.ProportionalExtra=Un=z.s(Ig,"ProportionalExtra",2);Ig.prototype.Tl=function(a){this.mh=a};Ig.prototype.computeEffectiveSpacingTop=Ig.prototype.TD=function(){var a=0;if(0!==this.index){var b=this.mh,c=this.Zp;null===c&&null!==b&&(c=this.re?b.Bi:b.Mh);null!==c&&(a=this.$p,isNaN(a)&&(a=null!==b?this.re?b.Oh:b.Nh:0))}b=this.GF;if(null===b)if(b=this.mh,null!==b)b=b.Bj;else return a;return a+(this.re?b.top:b.left)};
  Ig.prototype.computeEffectiveSpacing=Ig.prototype.Re=function(){var a=0;if(0!==this.index){var b=this.mh,c=this.Zp;null===c&&null!==b&&(c=this.re?b.Bi:b.Mh);null!==c&&(a=this.$p,isNaN(a)&&(a=null!==b?this.re?b.Oh:b.Nh:0))}b=this.GF;if(null===b)if(b=this.mh,null!==b)b=b.Bj;else return a;return a+(this.re?b.top+b.bottom:b.left+b.right)};
  Ig.prototype.kd=function(a,b,c,d,e){var g=this.mh;if(null!==g&&(g.Rc(Uf,a,this,b,c,d,e),null!==this.Ac&&(b=g.h,null!==b&&!b.Ee&&(g=g.np(),null!==g&&(g=g.data,null!==g)))))for(c=this.Ac.i;c.next();)c.value.Tx(this,g,a,b)};z.w(Ig,{T:"panel"},function(){return this.mh});z.defineProperty(Ig,{re:"isRow"},function(){return this.Cv},function(a){this.Cv=a});z.defineProperty(Ig,{index:"index"},function(){return this.Uc},function(a){this.Uc=a});
  z.defineProperty(Ig,{height:"height"},function(){return this.ef},function(a){var b=this.ef;b!==a&&(u&&z.g(a,"number",Ig,"height"),0>a&&z.ka(a,">= 0",Ig,"height"),this.ef=a,this.Oa=this.Xa,null!==this.T&&this.T.Q(),this.kd("height",b,a))});z.defineProperty(Ig,{width:"width"},function(){return this.ef},function(a){var b=this.ef;b!==a&&(u&&z.g(a,"number",Ig,"width"),0>a&&z.ka(a,">= 0",Ig,"width"),this.ef=a,this.Oa=this.Xa,null!==this.T&&this.T.Q(),this.kd("width",b,a))});
  z.defineProperty(Ig,{qj:"minimum"},function(){return this.Vj},function(a){var b=this.Vj;b!==a&&(u&&z.g(a,"number",Ig,"minimum"),(0>a||!isFinite(a))&&z.ka(a,">= 0",Ig,"minimum"),this.Vj=a,this.Oa=this.Xa,null!==this.T&&this.T.Q(),this.kd("minimum",b,a))});z.defineProperty(Ig,{qf:"maximum"},function(){return this.Tj},function(a){var b=this.Tj;b!==a&&(u&&z.g(a,"number",Ig,"maximum"),0>a&&z.ka(a,">= 0",Ig,"maximum"),this.Tj=a,this.Oa=this.Xa,null!==this.T&&this.T.Q(),this.kd("maximum",b,a))});
  z.defineProperty(Ig,{alignment:"alignment"},function(){return this.Ie},function(a){var b=this.Ie;b.N(a)||(u&&z.l(a,Q,Ig,"alignment"),this.Ie=a.V(),null!==this.T&&this.T.Q(),this.kd("alignment",b,a))});z.defineProperty(Ig,{stretch:"stretch"},function(){return this.ei},function(a){var b=this.ei;b!==a&&(u&&z.Ba(a,O,Ig,"stretch"),this.ei=a,null!==this.T&&this.T.Q(),this.kd("stretch",b,a))});
  z.defineProperty(Ig,{GF:"separatorPadding"},function(){return this.Zj},function(a){"number"===typeof a?a=new Db(a):null!==a&&u&&z.l(a,Db,Ig,"separatorPadding");var b=this.Zj;null!==a&&null!==b&&b.N(a)||(null!==a&&(a=a.V()),this.Zj=a,null!==this.T&&this.T.Q(),this.kd("separatorPadding",b,a))});
  z.defineProperty(Ig,{Zp:"separatorStroke"},function(){return this.Fs},function(a){var b=this.Fs;b!==a&&(null===a||"string"===typeof a||a instanceof Da)&&(a instanceof Da&&a.freeze(),this.Fs=a,null!==this.T&&this.T.Q(),this.kd("separatorStroke",b,a))});z.defineProperty(Ig,{$p:"separatorStrokeWidth"},function(){return this.Gs},function(a){var b=this.Gs;b!==a&&(this.Gs=a,null!==this.T&&this.T.Q(),this.kd("separatorStrokeWidth",b,a))});
  z.defineProperty(Ig,{hJ:"separatorDashArray"},function(){return this.Yh},function(a){var b=this.Yh;if(b!==a){null===a||Array.isArray(a)||z.ic(a,"Array",Ig,"separatorDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||z.k("separatorDashArray value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.Yh=a;null!==this.T&&this.T.ta();this.kd("separatorDashArray",b,a)}});
  z.defineProperty(Ig,{background:"background"},function(){return this.Nb},function(a){var b=this.Nb;b!==a&&(null===a||"string"===typeof a||a instanceof Da)&&(a instanceof Da&&a.freeze(),this.Nb=a,null!==this.T&&this.T.ta(),this.kd("background",b,a))});z.defineProperty(Ig,{Nz:"coversSeparators"},function(){return this.Gq},function(a){var b=this.Gq;b!==a&&(z.g(a,"boolean",Ig,"coversSeparators"),this.Gq=a,null!==this.T&&this.T.ta(),this.kd("coversSeparators",b,a))});
  z.defineProperty(Ig,{uu:"sizing"},function(){return this.Ls},function(a){var b=this.Ls;b!==a&&(u&&z.Ba(a,Ig,Ig,"sizing"),this.Ls=a,null!==this.T&&this.T.Q(),this.kd("sizing",b,a))});function $n(a){if(a.uu===to){var b=a.mh;return a.re?b.dJ:b.cH}return a.uu}z.defineProperty(Ig,{Oa:"actual"},function(){return this.Xa},function(a){this.Xa=isNaN(this.ef)?Math.max(Math.min(this.Tj,a),this.Vj):Math.max(Math.min(this.Tj,this.ef),this.Vj)});
  z.defineProperty(Ig,{total:"total"},function(){return this.Xa+this.Re()},function(a){this.Xa=isNaN(this.ef)?Math.max(Math.min(this.Tj,a),this.Vj):Math.max(Math.min(this.Tj,this.ef),this.Vj);this.Xa=Math.max(0,this.Xa-this.Re())});z.defineProperty(Ig,{position:"position"},function(){return this.sb},function(a){this.sb=a});
  Ig.prototype.bind=Ig.prototype.bind=function(a){a.Bg=this;var b=this.T;if(null!==b){var c=b.np();null!==c&&fn(c)&&z.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: "+a+" on "+b)}null===this.Ac&&(this.Ac=new J($g));this.Ac.add(a)};
  function X(){O.call(this);this.Vf=this.kb=null;this.eo="None";this.br=Am;this.Kc=this.Bd="black";this.Oe=1;this.Ro="butt";this.To="miter";this.Jm=10;this.So=null;this.we=0;this.di=this.ci=Pc;this.cs=this.bs=NaN;this.ir=!1;this.es=null;this.jo=this.Xo="None";this.fr=1}z.Ra(X,O);z.ia("Shape",X);
  X.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.kb=this.kb;a.eo=this.eo;a.br=this.br;a.Vf=this.Vf;a.Bd=this.Bd;a.Kc=this.Kc;a.Oe=this.Oe;a.Ro=this.Ro;a.To=this.To;a.Jm=this.Jm;null!==this.So&&(a.So=z.Al(this.So));a.we=this.we;a.ci=this.ci.V();a.di=this.di.V();a.bs=this.bs;a.cs=this.cs;a.ir=this.ir;a.es=this.es;a.Xo=this.Xo;a.jo=this.jo;a.fr=this.fr};X.prototype.toString=function(){return"Shape("+("None"!==this.Hb?this.Hb:"None"!==this.fq?this.fq:this.Xz)+")#"+z.nd(this)};
  function uo(a,b,c,d){var e=c.length;if(!(4>e)){for(var g=d.Ia,h=Math.max(1,g.width),g=g.height,k=c[0],l=c[1],m=0,n=0,p=0,q=0,r=0,s=0,t=q=0,v=z.rb(),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),v.push([p,s,r,q]),t+=q,k=m,l=n;k=c[0];l=c[1];p=d.Ia.width;d instanceof X&&(p-=d.ub);1>p&&(p=1);for(var e=c=p,m=h/2,n=0===m?!1:!0,x=0,q=v[x],p=q[0],s=q[1],r=q[2],q=q[3],y=0;.1<=t;){0===y&&(n?(e=c,e-=m,t-=m,n=!1):e=c,0===e&&(e=1));if(e>t){z.xa(v);return}e>
  q?(y=e-q,e=q):y=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),-(g/2));0===y&&d.ok(a,b);a.translate(h/2,g/2);a.rotate(-s);a.translate(-k,-l);t-=e;q-=e;if(0!==y){x++;if(x===v.length){z.xa(v);return}q=v[x];p=q[0];s=q[1];r=q[2];q=q[3];e=y}}z.xa(v)}}
  X.prototype.ok=function(a,b){if(null!==this.Kc||null!==this.Bd){null!==this.Bd&&Um(this,a,this.Bd,!0,!1);null!==this.Kc&&Um(this,a,this.Kc,!1,!1);var c=this.Oe;if(0===c){var d=this.ca;d instanceof da&&d.type===Ni&&"Selection"===d.nc&&d.fc instanceof X&&d.Xf.gf()===d.fc&&(c=d.fc.ub)}a.lineWidth=c;a.lineJoin=this.To;a.lineCap=this.Ro;a.miterLimit=this.Jm;var e=!1;this.ca&&b.ij("drawShadows")&&(e=this.ca.tk);var g=!0;null!==this.Kc&&null===this.Bd&&(g=!1);var d=!1,h=!0,k=this.PF;null!==k&&(d=!0,h=a.Uz(k,
  this.we));var l=this.kb;if(null!==l){if(l.ba===mf)a.beginPath(),d&&!h?Hm(a,l.xc,l.Cc,l.zb,l.Gb,k,this.we):(a.moveTo(l.xc,l.Cc),a.lineTo(l.zb,l.Gb)),null!==this.Bd&&a.Hg(this.Bd),0!==c&&null!==this.Kc&&a.uj();else if(l.ba===nf){var m=l.xc,n=l.Cc,p=l.zb,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.Bd&&(a.beginPath(),a.rect(l,r,m,n),a.Hg(this.Bd));if(null!==this.Kc){var s=p=0,t=0;g&&e&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
  0,a.shadowBlur=0);d&&!h?(h=z.rb(),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(),vo(a,h,k,this.we),a.uj(),z.xa(h)):0!==c&&(a.beginPath(),a.rect(l,r,m,n),a.uj());g&&e&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t)}}else if(l.ba===of)m=l.xc,n=l.Cc,p=l.zb,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+Hd*l,n-r,m+l,n-Hd*r,m+l,n),a.bezierCurveTo(m+
  l,n+Hd*r,m+Hd*l,n+r,m,n+r),a.bezierCurveTo(m-Hd*l,n+r,m-l,n+Hd*r,m-l,n),a.bezierCurveTo(m-l,n-Hd*r,m-Hd*l,n-r,m,n-r),a.closePath(),null!==this.Bd&&a.Hg(this.Bd),d&&!h&&(h=z.rb(),we(m,n-r,m+Hd*l,n-r,m+l,n-Hd*r,m+l,n,.5,h),we(m+l,n,m+l,n+Hd*r,m+Hd*l,n+r,m,n+r,.5,h),we(m,n+r,m-Hd*l,n+r,m-l,n+Hd*r,m-l,n,.5,h),we(m-l,n,m-l,n-Hd*r,m-Hd*l,n-r,m,n-r,.5,h),a.beginPath(),vo(a,h,k,this.we),z.xa(h)),0!==c&&null!==this.Kc&&(g&&e?(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=
  0,a.shadowBlur=0,a.uj(),a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t):a.uj());else if(l.ba===jf){r=l.Dj;n=r.length;for(q=0;q<n;q++){m=r.o[q];a.beginPath();a.moveTo(m.Ha,m.Da);for(var p=m.Ab.o,s=p.length,v=null,t=0;t<s;t++){var x=p[t];switch(x.ba){case Ef:a.moveTo(x.L,x.M);break;case qf:a.lineTo(x.L,x.M);break;case Ff:a.bezierCurveTo(x.Dd,x.Ne,x.nh,x.zg,x.zb,x.Gb);break;case Gf:a.quadraticCurveTo(x.Dd,x.Ne,x.zb,x.Gb);break;case Hf:if(x.radiusX===x.radiusY)v=Math.PI/180,a.arc(x.Dd,x.Ne,x.radiusX,
  x.Fe*v,(x.Fe+x.Lf)*v,0>x.Lf);else{var v=Jf(x,m),y=v.length;if(0===y){a.lineTo(x.ra,x.za);break}for(var A=0;A<y;A++){var C=v[A];0===A&&a.lineTo(C[0],C[1]);a.bezierCurveTo(C[2],C[3],C[4],C[5],C[6],C[7])}}break;case If:A=y=0;if(null!==v&&v.type===Hf){v=Jf(v,m);C=v.length;if(0===C){a.lineTo(x.ra,x.za);break}v=v[C-1]||null;null!==v&&(y=v[6],A=v[7])}else y=null!==v?v.L:m.Ha,A=null!==v?v.M:m.Da;v=Kf(x,m,y,A);y=v.length;if(0===y){a.lineTo(x.ra,x.za);break}for(A=0;A<y;A++)C=v[A],a.bezierCurveTo(C[2],C[3],
  C[4],C[5],C[6],C[7]);break;default:z.k("Segment not of valid type: "+x.ba)}x.Th&&a.closePath();v=x}e?(t=s=p=0,m.ro?(!0===m.im&&null!==this.Bd?(a.Hg(this.Bd),g=!0):g=!1,0!==c&&null!==this.Kc&&(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),d&&!h||a.uj(),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(g&&(p=a.shadowOffsetX,s=a.shadowOffsetY,t=a.shadowBlur,a.shadowOffsetX=0,a.shadowOffsetY=0,a.shadowBlur=0),!0===m.im&&null!==this.Bd&&
  a.Hg(this.Bd),0!==c&&null!==this.Kc&&(d&&!h||a.uj()),g&&(a.shadowOffsetX=p,a.shadowOffsetY=s,a.shadowBlur=t))):(!0===m.im&&null!==this.Bd&&a.Hg(this.Bd),0===c||null===this.Kc||d&&!h||a.uj())}if(d&&!h)for(c=g,g=l.Dj,h=g.length,l=0;l<h;l++){r=g.o[l];a.beginPath();n=z.rb();n.push(r.Ha);n.push(r.Da);q=r.Ha;m=r.Da;p=q;s=m;t=r.Ab.o;x=t.length;for(v=0;v<x;v++){y=t[v];switch(y.ba){case Ef:vo(a,n,k,this.we);n.length=0;n.push(y.L);n.push(y.M);q=y.L;m=y.M;p=q;s=m;break;case qf:n.push(y.L);n.push(y.M);q=y.L;
  m=y.M;break;case Ff:we(q,m,y.Dd,y.Ne,y.nh,y.zg,y.zb,y.Gb,.5,n);q=y.L;m=y.M;break;case Gf:Je(q,m,y.Dd,y.Ne,y.zb,y.Gb,.5,n);q=y.L;m=y.M;break;case Hf:A=Jf(y,r);C=A.length;if(0===C){n.push(y.ra);n.push(y.za);q=y.ra;m=y.za;break}for(var L=0;L<C;L++){var H=A[L];we(q,m,H[2],H[3],H[4],H[5],H[6],H[7],.5,n);q=H[6];m=H[7]}break;case If:A=Kf(y,r,q,m);C=A.length;if(0===C){n.push(y.ra);n.push(y.za);q=y.ra;m=y.za;break}for(L=0;L<C;L++)H=A[L],we(q,m,H[2],H[3],H[4],H[5],H[6],H[7],.5,n),q=H[6],m=H[7];break;default:z.k("Segment not of valid type: "+
  y.ba)}y.Th&&(n.push(p),n.push(s),vo(a,n,k,this.we))}vo(a,n,k,this.we);z.xa(n);null!==this.Kc&&(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.uj(),c&&e&&(a.shadowOffsetX=r,a.shadowOffsetY=n,a.shadowBlur=q))}}d&&a.Qz();if(null!==this.zx){d=this.zx;tj(d,Infinity,Infinity);k=d.Ia;d.Lc(0,0,k.width,k.height);c=this.wh;a.save();a.beginPath();k=z.rb();if(c.type===mf)k.push(c.Ha),k.push(c.Da),k.push(c.L),k.push(c.M),uo(a,b,k,d);else if(c.type===
  jf)for(h=c.cc.i;h.next();){l=h.value;k.length=0;k.push(l.Ha);k.push(l.Da);g=l.Ha;r=l.Da;n=g;q=r;m=l.Ab.o;p=m.length;for(s=0;s<p;s++){t=m[s];switch(t.ba){case Ef:uo(a,b,k,d);k.length=0;k.push(t.L);k.push(t.M);g=t.L;r=t.M;n=g;q=r;break;case qf:k.push(t.L);k.push(t.M);g=t.L;r=t.M;break;case Ff:we(g,r,t.Dd,t.Ne,t.nh,t.zg,t.zb,t.Gb,.5,k);g=t.L;r=t.M;break;case Gf:Je(g,r,t.Dd,t.Ne,t.zb,t.Gb,.5,k);g=t.L;r=t.M;break;case Hf:c=Jf(t,l);e=c.length;if(0===e){k.push(t.ra);k.push(t.za);g=t.ra;r=t.za;break}for(x=
  0;x<e;x++)v=c[x],we(g,r,v[2],v[3],v[4],v[5],v[6],v[7],.5,k),g=v[6],r=v[7];break;case If:c=Kf(t,l,g,r);e=c.length;if(0===e){k.push(t.ra);k.push(t.za);g=t.ra;r=t.za;break}for(x=0;x<e;x++)v=c[x],we(g,r,v[2],v[3],v[4],v[5],v[6],v[7],.5,k),g=v[6],r=v[7];break;default:z.k("Segment not of valid type: "+t.ba)}t.Th&&(k.push(n),k.push(q),uo(a,b,k,d))}uo(a,b,k,d)}else if(c.type===nf)k.push(c.Ha),k.push(c.Da),k.push(c.L),k.push(c.Da),k.push(c.L),k.push(c.M),k.push(c.Ha),k.push(c.M),k.push(c.Ha),k.push(c.Da),
  uo(a,b,k,d);else if(c.type===of){h=new kf;h.Ha=c.L;h.Da=(c.Da+c.M)/2;g=new Qf(Hf);g.Fe=0;g.Lf=360;g.ra=(c.Ha+c.L)/2;g.za=(c.Da+c.M)/2;g.radiusX=Math.abs(c.Ha-c.L)/2;g.radiusY=Math.abs(c.Da-c.M)/2;h.add(g);c=Jf(g,h);e=c.length;if(0===e)k.push(g.ra),k.push(g.za);else for(g=h.Ha,r=h.Da,x=0;x<e;x++)v=c[x],we(g,r,v[2],v[3],v[4],v[5],v[6],v[7],.5,k),g=v[6],r=v[7];uo(a,b,k,d)}z.xa(k);a.restore();ca(a,!1)}}}};
  function vo(a,b,c,d){var e=b.length;if(!(4>e)){var g=.001,h=c.length,k=b[0],l=b[1];if(4===e)Hm(a,k,l,b[2],b[3],c,d);else{a.moveTo(k,l);for(var m=g=0,n=0,p=0,q=0,r=p=0,s=z.rb(),t=2;t<e;t+=2)g=b[t],m=b[t+1],n=g-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=g,l=m;k=b[0];l=b[1];b=0;for(var e=!0,g=c[b%h],m=0!==d,t=0,p=s[t],n=p[0],q=p[1],p=p[2],v=0;.1<=r;){0===v&&(g=c[b%h],b++,m&&(d%=g,g-=d,m=!1));g>r&&(g=r);g>p?(v=g-p,g=p):v=0;var x=Math.sqrt(g*g/(1+q*q));0>n&&(x=-x);k+=x;l+=
  q*x;e?a.lineTo(k,l):a.moveTo(k,l);r-=g;p-=g;if(0!==v){t++;if(t===s.length){z.xa(s);return}p=s[t];n=p[0];q=p[1];p=p[2];g=v}else e=!e}z.xa(s)}}}X.prototype.getDocumentPoint=X.prototype.eb=function(a,b){void 0===b&&(b=new N);a.Be()&&z.k("getDocumentPoint Spot must be a real, specific Spot, not: "+a.toString());var c=this.Ga,d=this.ub;b.n(a.x*(c.width+d)-d/2+c.x+a.offsetX,a.y*(c.height+d)-d/2+c.y+a.offsetY);this.qh.Cb(b);return b};
  X.prototype.mk=function(a,b){var c=this.wh;if(null===c||null===this.fill&&null===this.stroke)return!1;var d=c.vb,e=this.ub/2;c.type!==mf||b||(e+=2);var g=z.lg();g.assign(d);g.bg(e+2,e+2);if(!g.Ma(a))return z.dc(g),!1;d=e+1E-4;if(c.type===mf){if(null===this.stroke)return!1;d=(c.L-c.Ha)*(a.x-c.Ha)+(c.M-c.Da)*(a.y-c.Da);if(0>(c.Ha-c.L)*(a.x-c.L)+(c.Da-c.M)*(a.y-c.M)||0>d)return!1;z.dc(g);return te(c.Ha,c.Da,c.L,c.M,e,a.x,a.y)}if(c.type===nf){var h=c.Ha,k=c.Da,l=c.L,m=c.M;g.x=Math.min(h,l);g.y=Math.min(k,
  m);g.width=Math.abs(l-h);g.height=Math.abs(m-k);if(null===this.fill){g.bg(-d,-d);if(g.Ma(a))return z.dc(g),!1;g.bg(d,d)}null!==this.stroke&&g.bg(e,e);e=g.Ma(a);z.dc(g);return e}if(c.type===of){var h=c.Ha,k=c.Da,l=c.L,m=c.M,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 z.dc(g),!1;h+=d;k+=d}null!==this.stroke&&(h+=e,k+=e);z.dc(g);return 0>=h||0>=k?!1:1>=c*c/(h*h)+n*n/(k*k)}if(c.type===
  jf)return z.dc(g),null===this.fill?Pf(c,a.x,a.y,e):c.Ma(a,e,1<this.ub,b);z.k("Unknown Geometry type: "+c.type);return!1};
  X.prototype.Ip=function(a,b,c,d){var e=this.Aa,g=this.Oe;a=Math.max(a,0);b=Math.max(b,0);var h;if(null!==this.Vf)h=this.wh.vb;else{var k=this.Hb,l=je[k];if(void 0===l){var m=wo[k];"string"===typeof m&&(m=wo[m]);"function"===typeof m?(l=m(null,100,100),je[k]=l):z.k("Unsupported Figure: "+k)}h=l.vb}var k=h.width,l=h.height,m=h.width,n=h.height;switch(Mm(this,!0)){case bj:d=c=0;break;case lf:m=Math.max(a-g,0);n=Math.max(b-g,0);break;case Cm:m=Math.max(a-g,0);d=0;break;case Bm:c=0,n=Math.max(b-g,0)}isFinite(e.width)&&
  (m=e.width);isFinite(e.height)&&(n=e.height);e=this.Xe;h=this.dg;c=Math.max(c,h.width)-g;d=Math.max(d,h.height)-g;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=cj(this);switch(c){case bj:break;case lf:k=m;l=n;break;case dj:c=Math.min(m/k,n/l);isFinite(c)||(c=1);k*=c;l*=c;break;default:z.k(c+" is not a valid geometryStretch.")}if(null!==this.Vf)k=Math.max(k,.01),l=Math.max(l,.01),h=null!==this.Vf?this.Vf:this.kb,e=
  k,d=l,c=h.copy(),h=h.vb,e/=h.width,d/=h.height,isFinite(e)||(e=1),isFinite(d)||(d=1),1===e&&1===d||c.scale(e,d),u&&c.freeze(),this.kb=c;else if(null===this.kb||this.kb.qo!==a-g||this.kb.oo!==b-g)this.kb=X.makeGeometry(this,k,l);h=this.kb.vb;Infinity===a||Infinity===b?Jm(this,h.x-g/2,h.y-g/2,0===a&&0===k?0:h.width+g,0===b&&0===l?0:h.height+g):Jm(this,-(g/2),-(g/2),m+g,n+g)};
  function bo(a,b,c,d){if(!1!==ml(a)){a.vd.Wa();var e=a.Oe;0===e&&d instanceof da&&d.type===Ni&&d.fc instanceof X&&(e=d.fc.ub);e*=a.bc;d instanceof G&&null!==d.kb?(b=d.kb.vb,Jm(a,b.x-e/2,b.y-e/2,b.width+e,b.height+e)):Jm(a,-(e/2),-(e/2),b+e,c+e);a.vd.freeze();a.vd.F()||z.k("Non-real measuredBounds has been set. Object "+a+", measuredBounds: "+a.vd.toString());Yk(a,!1)}}function cj(a){var b=a.Zz;return null!==a.Vf?b===Am?lf:b:b===Am?je[a.Hb].Xd:b}X.prototype.aj=function(a,b,c,d){Nm(this,a,b,c,d)};
  X.prototype.getNearestIntersectionPoint=X.prototype.xE=function(a,b,c){return this.sp(a.x,a.y,b.x,b.y,c)};
  X.prototype.sp=function(a,b,c,d,e){var g=this.transform,h=1/(g.m11*g.m22-g.m12*g.m21),k=g.m22*h,l=-g.m12*h,m=-g.m21*h,n=g.m11*h,p=h*(g.m21*g.dy-g.m22*g.dx),q=h*(g.m12*g.dx-g.m11*g.dy),g=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.ub/2,p=this.kb;null===p&&(tj(this,Infinity,Infinity),p=this.kb);q=p.vb;n=!1;if(p.type===mf)if(1.5>=this.ub)n=Me(p.xc,p.Cc,p.zb,p.Gb,g,h,k,l,e);else{var r=0,s=0;p.xc===p.zb?(r=m,s=0):(b=(p.Gb-p.Cc)/(p.zb-p.xc),s=m/Math.sqrt(1+b*b),r=s*b);d=z.rb();b=new N;Me(p.xc+
  r,p.Cc+s,p.zb+r,p.Gb+s,g,h,k,l,b)&&d.push(b);b=new N;Me(p.xc-r,p.Cc-s,p.zb-r,p.Gb-s,g,h,k,l,b)&&d.push(b);b=new N;Me(p.xc+r,p.Cc+s,p.xc-r,p.Cc-s,g,h,k,l,b)&&d.push(b);b=new N;Me(p.zb+r,p.Gb+s,p.zb-r,p.Gb-s,g,h,k,l,b)&&d.push(b);b=d.length;if(0===b)return z.xa(d),!1;n=!0;s=Infinity;for(r=0;r<b;r++){var k=d[r],t=(k.x-g)*(k.x-g)+(k.y-h)*(k.y-h);t<s&&(s=t,e.x=k.x,e.y=k.y)}z.xa(d)}else if(p.type===nf)b=q.x-m,n=Ne(b,q.y-m,q.x+q.width+m,q.y+q.height+m,g,h,k,l,e);else if(p.type===of)a:if(b=q.copy().bg(m,
  m),0===b.width)n=Me(b.x,b.y,b.x,b.y+b.height,g,h,k,l,e);else if(0===b.height)n=Me(b.x,b.y,b.x+b.width,b.y,g,h,k,l,e);else{a=b.width/2;var v=b.height/2;d=b.x+a;b=b.y+v;c=9999;g!==k&&(c=(h-l)/(g-k));if(9999>Math.abs(c)){n=h-b-c*(g-d);if(0>a*a*c*c+v*v-n*n){e.x=NaN;e.y=NaN;n=!1;break a}m=Math.sqrt(a*a*c*c+v*v-n*n);k=(-(a*a*c*n)+a*v*m)/(v*v+a*a*c*c)+d;a=(-(a*a*c*n)-a*v*m)/(v*v+a*a*c*c)+d;l=c*(k-d)+n+b;b=c*(a-d)+n+b;d=Math.abs((g-k)*(g-k))+Math.abs((h-l)*(h-l));h=Math.abs((g-a)*(g-a))+Math.abs((h-b)*(h-
  b));d<h?(e.x=k,e.y=l):(e.x=a,e.y=b)}else{k=v*v;l=g-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=g,e.y=l):(e.x=g,e.y=b)}n=!0}else if(p.type===jf){var x=0,y=0,A=t=0,q=z.O(),r=k-g,s=l-h,s=r*r+s*s;e.x=k;e.y=l;for(r=0;r<p.cc.count;r++)for(var C=p.cc.o[r],L=C.Ab,x=C.Ha,y=C.Da,H=x,U=y,ea=0;ea<L.count;ea++){var W=L.o[ea],P=W.type,t=W.L,A=W.M,ba=!1;switch(P){case Ef:H=t;U=A;break;case qf:ba=xo(x,y,t,A,g,h,k,l,q);break;case Ff:var ba=
  W.zc,P=W.Qc,Oa=W.Ch,sa=W.Dh,ba=Ke(x,y,ba,P,Oa,sa,t,A,g,h,k,l,.5,q);break;case Gf:ba=(x+2*W.zc)/3;P=(y+2*W.Qc)/3;Oa=(2*W.zc+t)/3;sa=(2*W.zc+t)/3;ba=Ke(x,y,ba,P,Oa,sa,t,A,g,h,k,l,.5,q);break;case Hf:case If:P=W.type===Hf?Jf(W,C):Kf(W,C,x,y);Oa=P.length;if(0===Oa){ba=xo(x,y,W.ra,W.za,g,h,k,l,q);break}for(A=0;A<Oa;A++)v=P[A],0===A&&xo(x,y,v[0],v[1],g,h,k,l,q)&&(t=yo(g,h,q,s,e),t<s&&(s=t,n=!0)),Ke(v[0],v[1],v[2],v[3],v[4],v[5],v[6],v[7],g,h,k,l,.5,q)&&(t=yo(g,h,q,s,e),t<s&&(s=t,n=!0));t=v[6];A=v[7];break;
  default:z.k("Unknown Segment type: "+P)}x=t;y=A;ba&&(t=yo(g,h,q,s,e),t<s&&(s=t,n=!0));W.ix&&(t=H,A=U,xo(x,y,t,A,g,h,k,l,q)&&(t=yo(g,h,q,s,e),t<s&&(s=t,n=!0)))}g=c-a;h=d-b;b=Math.sqrt(g*g+h*h);0!==b&&(g/=b,h/=b);e.x-=g*m;e.y-=h*m;z.A(q)}else z.k("Unknown Geometry type: "+p.type);if(!n)return!1;this.transform.Cb(e);return!0};function yo(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 xo(a,b,c,d,e,g,h,k,l){var m=!1,n=(e-h)*(b-d)-(g-k)*(a-c);if(0===n)return!1;l.x=((e*k-g*h)*(a-c)-(e-h)*(a*d-b*c))/n;l.y=((e*k-g*h)*(b-d)-(g-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||td(l.y,e))&&(l.y<a||td(l.y,a))&&(m=!0)):(e=a<c?a:c,a=a<c?c:a,(l.x>e||td(l.x,e))&&(l.x<a||td(l.x,a))&&(m=!0));return m}
  X.prototype.containedInRect=X.prototype.Xm=function(a,b){if(void 0===b)return a.nk(this.W);var c=this.kb;null===c&&(tj(this,Infinity,Infinity),c=this.kb);var c=c.vb,d=this.ub/2,e=!1,g=z.O();g.n(c.x-d,c.y-d);a.Ma(b.Cb(g))&&(g.n(c.x-d,c.bottom+d),a.Ma(b.Cb(g))&&(g.n(c.right+d,c.bottom+d),a.Ma(b.Cb(g))&&(g.n(c.right+d,c.y-d),a.Ma(b.Cb(g))&&(e=!0))));z.A(g);return e};
  X.prototype.intersectsRect=X.prototype.Jg=function(a,b){if(this.Xm(a,b)||void 0===b&&(b=this.transform,a.nk(this.W)))return!0;var c=z.Hh();c.set(b);c.fA();var d=a.left,e=a.right,g=a.top,h=a.bottom,k=z.O();k.n(d,g);c.Cb(k);if(this.mk(k,!0))return z.A(k),!0;k.n(e,g);c.Cb(k);if(this.mk(k,!0))return z.A(k),!0;k.n(d,h);c.Cb(k);if(this.mk(k,!0))return z.A(k),!0;k.n(e,h);c.Cb(k);if(this.mk(k,!0))return z.A(k),!0;var l=z.O(),m=z.O();c.set(b);c.vA(this.transform);c.fA();l.x=e;l.y=g;l.transform(c);k.x=d;k.y=
  g;k.transform(c);var n=!1;zo(this,k,l,m)?n=!0:(k.x=e,k.y=h,k.transform(c),zo(this,k,l,m)?n=!0:(l.x=d,l.y=h,l.transform(c),zo(this,k,l,m)?n=!0:(k.x=d,k.y=g,k.transform(c),zo(this,k,l,m)&&(n=!0))));z.A(k);z.jf(c);z.A(l);z.A(m);return n};function zo(a,b,c,d){if(!a.xE(b,c,d))return!1;a=b.x;b=b.y;var e=c.x;c=c.y;var g=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 g>=h&&g<=a}
  X.prototype.rE=function(a,b,c){function d(a,b){for(var c=a.length,d=0;d<c;d+=2)if(b.jp(a[d],a[d+1])>e)return!0;return!1}if(c&&null!==this.fill&&this.mk(a,!0))return!0;var e=a.Af(b);b=e;1.5<this.ub&&(e=this.ub/2+Math.sqrt(e),e*=e);var g=this.kb;if(null===g&&(tj(this,Infinity,Infinity),g=this.kb,null===g))return!1;if(!c){var h=g.vb,k=h.x,l=h.y,m=h.x+h.width,h=h.y+h.height;if(vb(a.x,a.y,k,l)<=e&&vb(a.x,a.y,m,l)<=e&&vb(a.x,a.y,k,h)<=e&&vb(a.x,a.y,m,h)<=e)return!0}k=g.xc;l=g.Cc;m=g.zb;h=g.Gb;if(g.type===
  mf){if(c=ub(a.x,a.y,k,l,m,h),g=(k-m)*(a.x-m)+(l-h)*(a.y-h),c<=(0<=(m-k)*(a.x-k)+(h-l)*(a.y-l)&&0<=g?e:b))return!0}else{if(g.type===nf)return b=!1,c&&(b=ub(a.x,a.y,k,l,k,h)<=e||ub(a.x,a.y,k,l,m,l)<=e||ub(a.x,a.y,m,l,m,h)<=e||ub(a.x,a.y,k,h,m,h)<=e),b;if(g.type===of){b=a.x-(k+m)/2;var g=a.y-(l+h)/2,n=Math.abs(m-k)/2,p=Math.abs(h-l)/2;if(0===n||0===p)return c=ub(a.x,a.y,k,l,m,h),c<=e?!0:!1;if(c){if(a=gf(n,p,b,g),a*a<=e)return!0}else return vb(b,g,-n,0)>=e||vb(b,g,0,-p)>=e||vb(b,g,0,p)>=e||vb(b,g,n,0)>=
  e?!1:!0}else if(g.type===jf){h=g.vb;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&&ub(a.x,a.y,k,l,k,h)>e&&ub(a.x,a.y,k,l,m,l)>e&&ub(a.x,a.y,m,h,k,h)>e&&ub(a.x,a.y,m,h,m,l)>e)return!1;b=Math.sqrt(e);if(c){if(null===this.fill?Pf(g,a.x,a.y,b):g.Ma(a,b,!0))return!0}else{c=g.cc;for(b=0;b<c.count;b++){k=c.o[b];n=k.Ha;p=k.Da;if(a.jp(n,p)>e)return!1;l=k.Ab.o;m=l.length;for(h=0;h<m;h++){var q=l[h];switch(q.type){case Ef:case qf:n=q.L;p=q.M;if(a.jp(n,p)>e)return!1;break;case Ff:g=z.rb();
  we(n,p,q.zc,q.Qc,q.Ch,q.Dh,q.L,q.M,.8,g);n=d(g,a);z.xa(g);if(n)return!1;n=q.L;p=q.M;if(a.jp(n,p)>e)return!1;break;case Gf:g=z.rb();Je(n,p,q.zc,q.Qc,q.L,q.M,.8,g);n=d(g,a);z.xa(g);if(n)return!1;n=q.L;p=q.M;if(a.jp(n,p)>e)return!1;break;case Hf:case If:var r=q.type===Hf?Jf(q,k):Kf(q,k,n,p),s=r.length;if(0===s){n=q.ra;p=q.za;if(a.jp(n,p)>e)return!1;break}q=null;g=z.rb();for(b=0;b<s;b++)if(q=r[b],g.length=0,we(q[0],q[1],q[2],q[3],q[4],q[5],q[6],q[7],.8,g),d(g,a))return z.xa(g),!1;z.xa(g);null!==q&&(n=
  q[6],p=q[7]);break;default:z.k("Unknown Segment type: "+q.type)}}}return!0}}}return!1};z.defineProperty(X,{wh:"geometry"},function(){return null!==this.kb?this.kb:this.Vf},function(a){var b=this.kb;if(b!==a){null!==a?(u&&z.l(a,hf,X,"geometry"),this.Vf=this.kb=a.freeze()):this.Vf=this.kb=null;var c=this.ca;null!==c&&(c.Rj=NaN);this.Q();this.j("geometry",b,a);0!==(this.ja&1024)&&(a=this.ca,null!==a&&Im(this,a,"geometryString"))}});
  z.defineProperty(X,{KH:"geometryString"},function(){return null===this.wh?"":this.wh.toString()},function(a){a=sf(a);var b=a.normalize();this.wh=a;this.position=a=z.Tb(-b.x,-b.y);z.A(a)});z.defineProperty(X,{LE:"isGeometryPositioned"},function(){return this.ir},function(a){u&&z.g(a,"boolean",X,"isGeometryPositioned");var b=this.ir;b!==a&&(this.ir=a,this.Q(),this.j("isGeometryPositioned",b,a))});X.prototype.qe=function(){this.kb=null};
  z.defineProperty(X,{fill:"fill"},function(){return this.Bd},function(a){var b=this.Bd;b!==a&&(u&&null!==a&&z.ot(a,"Shape.fill"),a instanceof Da&&a.freeze(),this.Bd=a,this.ta(),this.j("fill",b,a))});z.defineProperty(X,{stroke:"stroke"},function(){return this.Kc},function(a){var b=this.Kc;b!==a&&(u&&null!==a&&z.ot(a,"Shape.stroke"),a instanceof Da&&a.freeze(),this.Kc=a,this.ta(),this.j("stroke",b,a))});
  z.defineProperty(X,{ub:"strokeWidth"},function(){return this.Oe},function(a){var b=this.Oe;if(b!==a)if(u&&z.p(a,X,"strokeWidth"),0<=a){this.Oe=a;this.Q();var c=this.ca;null!==c&&(c.Rj=NaN);this.j("strokeWidth",b,a)}else z.ka(a,"value >= 0",X,"strokeWidth:value")});
  z.defineProperty(X,{wL:"strokeCap"},function(){return this.Ro},function(a){var b=this.Ro;b!==a&&("string"!==typeof a||"butt"!==a&&"round"!==a&&"square"!==a?z.ka(a,'"butt", "round", or "square"',X,"strokeCap"):(this.Ro=a,this.ta(),this.j("strokeCap",b,a)))});
  z.defineProperty(X,{yL:"strokeJoin"},function(){return this.To},function(a){var b=this.To;b!==a&&("string"!==typeof a||"miter"!==a&&"bevel"!==a&&"round"!==a?z.ka(a,'"miter", "bevel", or "round"',X,"strokeJoin"):(this.To=a,this.ta(),this.j("strokeJoin",b,a)))});
  z.defineProperty(X,{zL:"strokeMiterLimit"},function(){return this.Jm},function(a){var b=this.Jm;if(b!==a)if(u&&z.p(a,X,"strokeMiterLimit"),1<=a){this.Jm=a;this.ta();var c=this.ca;null!==c&&(c.Rj=NaN);this.j("strokeMiterLimit",b,a)}else z.ka(a,"value >= 1",X,"strokeWidth:value")});
  z.defineProperty(X,{PF:"strokeDashArray"},function(){return this.So},function(a){var b=this.So;if(b!==a){null===a||Array.isArray(a)||z.ic(a,"Array",X,"strokeDashArray:value");if(null!==a){for(var c=a.length,d=0,e=0;e<c;e++){var g=a[e];"number"===typeof g&&0<=g&&isFinite(g)||z.k("strokeDashArray:value "+g+" at index "+e+" must be a positive number or zero.");d+=g}if(0===d){if(null===b)return;a=null}}this.So=a;this.ta();this.j("strokeDashArray",b,a)}});
  z.defineProperty(X,{xL:"strokeDashOffset"},function(){return this.we},function(a){var b=this.we;b!==a&&(u&&z.p(a,X,"strokeDashOffset"),0<=a&&(this.we=a,this.ta(),this.j("strokeDashOffset",b,a)))});
  z.defineProperty(X,{Hb:"figure"},function(){return this.eo},function(a){var b=this.eo;if(b!==a){u&&z.g(a,"string",X,"figure");var c=wo[a];"function"===typeof c?c=a:(c=wo[a.toLowerCase()])||z.k("Unknown Shape.figure: "+a);b!==c&&(a=this.ca,null!==a&&(a.Rj=NaN),this.eo=c,this.Vf=null,this.qe(),this.Q(),this.j("figure",b,c))}});
  z.defineProperty(X,{fq:"toArrow"},function(){return this.Xo},function(a){var b=this.Xo;!0===a?a="Standard":!1===a&&(a="");if(b!==a){u&&z.g(a,"string",X,"toArrow");var c=Ao(a);null===c?z.k("Unknown Shape.toArrow: "+a):b!==c&&(this.Xo=c,this.Vf=null,this.qe(),this.Q(),Bo(this),this.j("toArrow",b,c))}});
  z.defineProperty(X,{Xz:"fromArrow"},function(){return this.jo},function(a){var b=this.jo;!0===a?a="Standard":!1===a&&(a="");if(b!==a){u&&z.g(a,"string",X,"fromArrow");var c=Ao(a);null===c?z.k("Unknown Shape.fromArrow: "+a):b!==c&&(this.jo=c,this.Vf=null,this.qe(),this.Q(),Bo(this),this.j("fromArrow",b,c))}});function Bo(a){var b=a.h;null!==b&&b.pa.qb||(a.pu=Co,"None"!==a.Xo?(a.De=-1,a.kk=ad):"None"!==a.jo&&(a.De=0,a.kk=new Q(1-ad.x,ad.y)))}
  z.defineProperty(X,{C:"spot1"},function(){return this.ci},function(a){z.l(a,Q,X,"spot1");var b=this.ci;b.N(a)||(this.ci=a=a.V(),this.Q(),this.j("spot1",b,a))});z.defineProperty(X,{D:"spot2"},function(){return this.di},function(a){z.l(a,Q,X,"spot2");var b=this.di;b.N(a)||(this.di=a=a.V(),this.Q(),this.j("spot2",b,a))});z.defineProperty(X,{Ic:"parameter1"},function(){return this.bs},function(a){var b=this.bs;b!==a&&(this.bs=a,this.qe(),this.Q(),this.j("parameter1",b,a))});
  z.defineProperty(X,{gu:"parameter2"},function(){return this.cs},function(a){var b=this.cs;b!==a&&(this.cs=a,this.qe(),this.Q(),this.j("parameter2",b,a))});z.w(X,{Ga:"naturalBounds"},function(){if(null!==this.kb)return this.Wc.assign(this.kb.vb),this.Wc;var a=this.Aa;return new w(0,0,a.width,a.height)});z.defineProperty(X,{zx:"pathPattern"},function(){return this.es},function(a){var b=this.es;b!==a&&(u&&z.l(a,O,X,"pathPattern"),this.es=a,this.ta(),this.j("pathPattern",b,a))});
  z.defineProperty(X,{mL:"pathObject"},function(){return this.zx},function(a){this.zx=a});z.defineProperty(X,{Zz:"geometryStretch"},function(){return this.br},function(a){var b=this.br;b!==a&&(z.Ba(a,O,X,"geometryStretch"),this.br=a,this.j("geometryStretch",b,a))});z.defineProperty(X,{interval:"interval"},function(){return this.fr},function(a){var b=this.fr;u&&z.p(a,X,"interval");a=Math.floor(a);if(b!==a&&0<=a){this.fr=a;var c=this.h;null!==c&&this.T===c.tp&&$k(c);this.Q();this.j("interval",b,a)}});
  X.makeGeometry=function(a,b,c){var d=null;if("None"!==a.fq)d=ke[a.fq];else if("None"!==a.Xz)d=ke[a.Xz];else{var e=wo[a.Hb];"string"===typeof e&&(e=wo[e]);void 0===e&&z.k("Unknown Shape.figure: "+a.Hb);d=e(a,b,c);d.qo=b;d.oo=c}null===d&&(e=wo.Rectangle,"function"===typeof e&&(d=e(a,b,c)));return d};X.getFigureGenerators=function(){var a=new na("string","function"),b;for(b in wo)if(b!==b.toLowerCase()){var c=wo[b];"function"===typeof c&&a.add(b,c)}a.freeze();return a};
  X.defineFigureGenerator=function(a,b){z.g(a,"string",X,"defineFigureGenerator:name");"string"===typeof b?""!==b&&wo[b]||z.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: "+b):z.g(b,"function",X,"defineFigureGenerator:func");var c=a.toLowerCase();""!==a&&"none"!==c&&a!==c||z.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: "+a);wo[a]=b;wo[c]=a};
  X.getArrowheadGeometries=function(){var a=new na("string",hf),b;for(b in ke)if(b!==b.toLowerCase()){var c=ke[b];c instanceof hf&&a.add(b,c)}a.freeze();return a};
  X.defineArrowheadGeometry=function(a,b){z.g(a,"string",X,"defineArrowheadGeometry:name");var c=null;"string"===typeof b?(z.g(b,"string",X,"defineArrowheadGeometry:pathstr"),c=sf(b,!1)):(z.l(b,hf,X,"defineArrowheadGeometry:pathstr"),c=b);var d=a.toLowerCase();""!==a&&"none"!==d&&a!==d||z.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: "+a);ke[a]=c;ke[d]=a};
  function qa(){O.call(this);this.xe="";this.Kc="black";this.Ph="13px sans-serif";this.Lm="start";this.kr=!0;this.km=this.lm=!1;this.ml=Do;this.Pm=Eo;this.Kv=this.Le=0;this.io=this.az=this.bz=null;this.Oj=new Fo;this.Wq=!1;this.uf=this.ol=this.Us=null;this.bk=this.ak=0;this.Mi=Infinity;this.Fv=0}z.Ra(qa,O);z.ia("TextBlock",qa);var Go=new ma,Ho=0,Io=new ma,Jo=0,Ko="...",Lo="",Mo=(new la(null)).zl;qa.getEllipsis=function(){return Ko};qa.setEllipsis=function(a){Ko=a;Io=new ma;Jo=0};
  qa.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.xe=this.xe;a.Kc=this.Kc;a.Ph=this.Ph;a.Lm=this.Lm;a.kr=this.kr;a.lm=this.lm;a.km=this.km;a.ml=this.ml;a.Pm=this.Pm;a.Le=this.Le;a.Kv=this.Kv;a.bz=this.bz;a.az=this.az;a.io=this.io;a.Oj.tt(this.Oj);a.Wq=this.Wq;a.Us=this.Us;a.ol=this.ol;a.uf=this.uf;a.ak=this.ak;a.bk=this.bk;a.Mi=this.Mi;a.Fv=this.Fv};
  qa.prototype.toString=function(){return 22<this.xe.length?'TextBlock("'+this.xe.substring(0,20)+'"...)':'TextBlock("'+this.xe+'")'};var No;qa.None=No=z.s(qa,"None",0);var Oo;qa.WrapFit=Oo=z.s(qa,"WrapFit",1);var Eo;qa.WrapDesiredSize=Eo=z.s(qa,"WrapDesiredSize",2);var Do;qa.OverflowClip=Do=z.s(qa,"OverflowClip",0);var Po;qa.OverflowEllipsis=Po=z.s(qa,"OverflowEllipsis",1);qa.prototype.Q=function(){O.prototype.Q.call(this);this.az=this.bz=null};
  z.defineProperty(qa,{font:"font"},function(){return this.Ph},function(a){var b=this.Ph;b!==a&&(u&&(z.g(a,"string",qa,"font"),Qo(a)||z.k('Not a valid font: "'+a+'"')),this.Ph=a,this.io=null,this.Q(),this.j("font",b,a))});var Qo;qa.isValidFont=Qo=function(a){var b=Mo.font;if(a===b||"10px sans-serif"===a)return!0;Mo.font="10px sans-serif";var c;Mo.font=a;var d=Mo.font;if("10px sans-serif"!==d)return Mo.font=b,!0;Mo.font="19px serif";c=Mo.font;Mo.font=a;d=Mo.font;Mo.font=b;return d!==c};
  z.defineProperty(qa,{text:"text"},function(){return this.xe},function(a){var b=this.xe;a=null!==a&&void 0!==a?a.toString():"";b!==a&&(this.xe=a,this.Q(),this.j("text",b,a))});z.defineProperty(qa,{textAlign:"textAlign"},function(){return this.Lm},function(a){var b=this.Lm;b!==a&&(u&&z.g(a,"string",qa,"textAlign"),"start"===a||"end"===a||"left"===a||"right"===a||"center"===a?(this.Lm=a,this.ta(),this.j("textAlign",b,a)):z.ka(a,'"start", "end", "left", "right", or "center"',qa,"textAlign"))});
  z.w(qa,{Ga:"naturalBounds"},function(){if(!this.Wc.F()){var a=Ro(this,this.xe,this.Oj,999999).width,b=So(this,a,this.Oj),c=this.Aa;isNaN(c.width)||(a=c.width);isNaN(c.height)||(b=c.height);yb(this.Wc,a,b)}return this.Wc});z.defineProperty(qa,{nx:"isMultiline"},function(){return this.kr},function(a){var b=this.kr;b!==a&&(u&&z.g(a,"boolean",qa,"isMultiline"),this.kr=a,this.Q(),this.j("isMultiline",b,a))});
  z.defineProperty(qa,{JK:"isUnderline"},function(){return this.lm},function(a){var b=this.lm;b!==a&&(u&&z.g(a,"boolean",qa,"isUnderline"),this.lm=a,this.ta(),this.j("isUnderline",b,a))});z.defineProperty(qa,{IK:"isStrikethrough"},function(){return this.km},function(a){var b=this.km;b!==a&&(u&&z.g(a,"boolean",qa,"isStrikethrough"),this.km=a,this.ta(),this.j("isStrikethrough",b,a))});
  z.defineProperty(qa,{hG:"wrap"},function(){return this.Pm},function(a){var b=this.Pm;b!==a&&(u&&z.Ba(a,qa,qa,"wrap"),this.Pm=a,this.Q(),this.j("wrap",b,a))});z.defineProperty(qa,{overflow:"overflow"},function(){return this.ml},function(a){var b=this.ml;b!==a&&(u&&z.Ba(a,qa,qa,"overflow"),this.ml=a,this.Q(),this.j("overflow",b,a))});
  z.defineProperty(qa,{stroke:"stroke"},function(){return this.Kc},function(a){var b=this.Kc;b!==a&&(u&&null!==a&&z.ot(a,"TextBlock.stroke"),a instanceof Da&&a.freeze(),this.Kc=a,this.ta(),this.j("stroke",b,a))});z.w(qa,{rI:"lineCount"},function(){return this.Le});z.defineProperty(qa,{Tz:"editable"},function(){return this.Wq},function(a){var b=this.Wq;b!==a&&(u&&z.g(a,"boolean",qa,"editable"),this.Wq=a,this.j("editable",b,a))});
  z.defineProperty(qa,{RF:"textEditor"},function(){return this.Us},function(a){var b=this.Us;b!==a&&(a instanceof HTMLElement||z.k("textEditor must be an HTMLElement, not: "+a),this.Us=a,this.j("textEditor",b,a))});z.defineProperty(qa,{Vz:"errorFunction"},function(){return this.uf},function(a){var b=this.uf;b!==a&&(null!==a&&z.g(a,"function",qa,"errorFunction"),this.uf=a,this.j("errorFunction",b,a))});
  qa.prototype.ok=function(a,b){if(null!==this.Kc&&0!==this.xe.length&&null!==this.Ph){var c=this.Ga.width,d=To(this);a.textAlign=this.Lm;Um(this,a,this.Kc,!0,!1);(this.lm||this.km)&&Um(this,a,this.Kc,!1,!1);var e=this.Oj,g=0,h=!1,k=z.Tb(0,0);this.qh.Cb(k);var l=z.Tb(0,d);this.qh.Cb(l);var m=k.Af(l);z.A(k);z.A(l);k=b.scale;8>m*k*k&&(h=!0);b.gd!==a&&(h=!1);!1===b.ij("textGreeking")&&(h=!1);for(var m=b.mr,k=this.ak,l=this.bk,n=this.Le,p=0;p<n;p++){var q=e.sf[p],r=e.Je[p];q>c&&(q=c);var g=g+k,s=r,r=a,
  t=g,v=c,x=d,y=0,A=this.Lm;"start"===A&&(A=m?"right":"left");"end"===A&&(A=m?"left":"right");h?("left"===A?y=0:"right"===A?y=v-q:"center"===A&&(y=(v-q)/2),r.fillRect(0+y,t+.25*x,q,1)):("left"===A?y=0:"right"===A?y=v:"center"===A&&(y=v/2),r.fillText(s,0+y,t+x-.25*x),s=x/20|0,0===s&&(s=1),"right"===A?y-=q:"center"===A&&(y-=q/2),this.lm&&(r.beginPath(),r.lineWidth=s,r.moveTo(0+y,t+x-.2*x),r.lineTo(0+y+q,t+x-.2*x),r.stroke()),this.km&&(r.beginPath(),r.lineWidth=s,t=t+x-x/2.2|0,0!==s%2&&(t+=.5),r.moveTo(0+
  y,t),r.lineTo(0+y+q,t),r.stroke()));g+=d+l}}};
  qa.prototype.Ip=function(a,b,c,d){this.Fv=a;var e=this.Oj;e.reset();var g=0,h=0;if(isNaN(this.Aa.width)){g=this.xe.replace(/\r\n/g,"\n").replace(/\r/g,"\n");if(0===g.length)g=0;else if(this.nx){for(var k=h=0,l=!1;!l;){var m=g.indexOf("\n",k);-1===m&&(m=g.length,l=!0);k=Uo(g.substr(k,m-k).replace(/^\s+|\s+$/g,""),this.Ph);k>h&&(h=k);k=m+1}g=h}else h=g.indexOf("\n",0),0<=h&&(g=g.substr(0,h)),g=k=Uo(g,this.Ph);g=Math.min(g,a/this.scale);g=Math.max(8,g)}else g=this.Aa.width;null!==this.T&&(g=Math.min(g,
  this.T.Xe.width),g=Math.max(g,this.T.dg.width));h=So(this,g,e);m=h=isNaN(this.Aa.height)?Math.min(h,b/this.scale):this.Aa.height;if(0!==e.cf&&1!==e.Je.length&&this.ml===Po&&(b=this.Ph,l=this.ml===Po?Vo(b):0,k=this.ak+this.bk,k=Math.max(0,To(this)+k),m=Math.min(this.zI-1,Math.max(Math.floor(m/k+.01)-1,0)),!(m+1>=e.Je.length))){k=e.Je[m];for(a=Math.max(1,a-l);Uo(k,b)>a&&1<k.length;)k=k.substr(0,k.length-1);k+=Ko;a=Uo(k,b);e.Je[m]=k;e.Je=e.Je.slice(0,m+1);e.sf[m]=a;e.sf=e.sf.slice(0,m+1);e.$i=e.Je.length;
  e.cf=Math.max(e.cf,a);this.Le=e.$i}if(this.hG===Oo||isNaN(this.Aa.width))g=e.cf,isNaN(this.Aa.width)&&(g=Math.max(8,g));g=Math.max(c,g);h=Math.max(d,h);yb(this.Wc,g,h);Jm(this,0,0,g,h)};qa.prototype.aj=function(a,b,c,d){Nm(this,a,b,c,d)};
  function Ro(a,b,c,d){b=b.replace(/^\s+|\s+$/g,"");var e=0,g=0,h=0,k=a.Ph,g=a.ak+a.bk,l=Math.max(0,To(a)+g),h=a.ml===Po?Vo(k):0;if(a.Le>=a.Mi)return new Ea(0,l);if(a.Pm===No){c.$i=1;g=Uo(b,k);if(0===h||g<=d)return c.cf=g,c.sf.push(c.cf),c.Je.push(b),new Ea(g,l);var m=Wo(b);b=b.substr(m.length);for(var n=Wo(b),g=Uo(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),n=Wo(b),g=Uo((m+n).replace(/^\s+|\s+$/g,""),k);m+=n.replace(/^\s+|\s+$/g,"");for(d=Math.max(1,d-h);Uo(m,k)>d&&1<m.length;)m=m.substr(0,
  m.length-1);m+=Ko;h=Uo(m,k);c.sf.push(h);c.cf=h;c.Je.push(m);return new Ea(h,l)}var p=0;0===b.length&&(p=1,c.sf.push(0),c.Je.push(b));for(;0<b.length;){m=Wo(b);for(b=b.substr(m.length);Uo(m,k)>d;){n=1;g=Uo(m.substr(0,n),k);for(h=0;g<=d;)n++,h=g,g=Uo(m.substr(0,n),k);1===n?(c.sf[a.Le+p]=g,e=Math.max(e,g)):(c.sf[a.Le+p]=h,e=Math.max(e,h));n--;1>n&&(n=1);c.Je[a.Le+p]=m.substr(0,n);p++;m=m.substr(n);if(a.Le+p>a.Mi)break}n=Wo(b);for(g=Uo(m+n,k);0<n.length&&g<=d;)m+=n,b=b.substr(n.length),n=Wo(b),g=Uo((m+
  n).replace(/^\s+|\s+$/g,""),k);m=m.replace(/^\s+|\s+$/g,"");if(""!==m&&(0===n.length?(c.sf.push(g),e=Math.max(e,g)):(h=Uo(m,k),c.sf.push(h),e=Math.max(e,h)),c.Je.push(m),p++,a.Le+p>a.Mi))break}c.$i=Math.min(a.Mi,p);c.cf=Math.max(c.cf,e);return new Ea(c.cf,l*c.$i)}function Wo(a){for(var b=a.length,c=0;c<b&&" "!==a.charAt(c);)c++;for(;c<b&&" "===a.charAt(c);)c++;return c>=b?a:a.substr(0,c)}function Uo(a,b){Lo!==b&&(Lo=Mo.font=b);return Mo.measureText(a).width}
  function To(a){if(null!==a.io)return a.io;var b=a.Ph;Lo!==b&&(Lo=Mo.font=b);var c=0;void 0!==Go[b]&&5E3>Ho?c=Go[b]:(c=1.3*Mo.measureText("M").width,Go[b]=c,Ho++);return a.io=c}function Vo(a){Lo!==a&&(Lo=Mo.font=a);var b=0;void 0!==Io[a]&&5E3>Jo?b=Io[a]:(b=Mo.measureText(Ko).width,Io[a]=b,Jo++);return b}
  function So(a,b,c){var d=a.xe.replace(/\r\n/g,"\n").replace(/\r/g,"\n"),e=a.ak+a.bk,e=Math.max(0,To(a)+e);if(0===d.length)return c.cf=0,a.Le=1,e;if(!a.nx){var g=d.indexOf("\n",0);0<=g&&(d=d.substr(0,g))}for(var g=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.Pm!==No?(c.$i=0,h=Ro(a,h,c,b),g+=h.height,a.Le+=c.$i):(Ro(a,h,c,b),g+=e,a.Le++),a.Le===a.Mi&&(l=!0)),h=k+1;return a.Kv=g}
  z.defineProperty(qa,{YA:"textValidation"},function(){return this.ol},function(a){var b=this.ol;b!==a&&(null!==a&&z.g(a,"function",qa,"textValidation"),this.ol=a,this.j("textValidation",b,a))});z.defineProperty(qa,{tL:"spacingAbove"},function(){return this.ak},function(a){var b=this.ak;b!==a&&(u&&z.g(a,"number",qa,"spacingAbove"),this.ak=a,this.j("spacingAbove",b,a))});
  z.defineProperty(qa,{uL:"spacingBelow"},function(){return this.bk},function(a){var b=this.bk;b!==a&&(u&&z.g(a,"number",qa,"spacingBelow"),this.bk=a,this.j("spacingBelow",b,a))});z.defineProperty(qa,{zI:"maxLines"},function(){return this.Mi},function(a){var b=this.Mi;b!==a&&(u&&z.g(a,"number",qa,"maxLines"),a=Math.floor(a),0>=a&&z.ka(a,"> 0",qa,"maxLines"),this.Mi=a,this.j("maxLines",b,a),this.Q())});z.w(qa,{UK:"metrics"},function(){return this.Oj});
  function Fo(){this.cf=this.$i=0;this.sf=[];this.Je=[]}Fo.prototype.reset=function(){this.cf=this.$i=0;this.sf=[];this.Je=[]};Fo.prototype.tt=function(a){this.$i=a.$i;this.cf=a.cf;this.sf=z.Al(a.sf);this.Je=z.Al(a.Je)};z.w(Fo,{bK:"arrSize"},function(){return this.sf});z.w(Fo,{cK:"arrText"},function(){return this.Je});z.w(Fo,{TK:"maxLineWidth"},function(){return this.cf});
  function wk(){O.call(this);this.$e=null;this.Ns="";this.$j=ge;this.lo=lf;this.Uo=this.ck=this.uf=null;this.Ty=!1;this.fo=!0;this.Lo=null}z.Ra(wk,O);z.ia("Picture",wk);wk.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.$e;a.Ns=this.Ns;a.$j=this.$j.V();a.lo=this.lo;a.uf=this.uf;a.ck=this.ck;a.fo=this.fo;a.Lo=this.Lo};var Xo=new ma,Yo=0,qk=[];
  function Zo(){var a=qk;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 $o;wk.clearCache=$o=function(a){void 0===a&&(a="");z.g(a,"string",wk,"clearCache:url");""!==a?Xo[a]&&(delete Xo[a],Yo--):(Xo=new ma,Yo=0)};wk.prototype.toString=function(){return"Picture("+this.source+")#"+z.nd(this)};
  z.defineProperty(wk,{element:"element"},function(){return this.$e},function(a){var b=this.$e;if(b!==a){null===a||a instanceof HTMLImageElement||a instanceof HTMLVideoElement||a instanceof HTMLCanvasElement||z.k("Picture.element must be an instance of Image, Canvas, or Video, not: "+a);this.Ty=a instanceof HTMLCanvasElement;this.$e=a;if(null!==a)if(!0===a.complete||void 0===a.complete)a.sv instanceof Event&&null!==this.uf&&this.uf(this,a.sv),!0===a.Vy&&null!==this.ck&&this.ck(this,null),a.Vy=!0,this.Aa.F()||
  (Yk(this,!1),this.Q());else{var c=this;a.gC||(a.addEventListener("load",function(b){ap(a,b);c.Aa.F()||(Yk(c,!1),c.Q())}),a.addEventListener("error",function(b){bp(a,b)}),a.gC=!0)}this.j("element",b,a);this.ta()}});
  z.defineProperty(wk,{source:"source"},function(){return this.Ns},function(a){var b=this.Ns;if(b!==a){z.g(a,"string",wk,"source");this.Ns=a;var c=Xo,d=this.h;if(void 0!==c[a])var e=c[a].ap[0].source;else{30<Yo&&($o(),c=Xo);var e=z.createElement("img"),g=this;e.addEventListener("load",function(a){ap(e,a);g.Aa.F()||(Yk(g,!1),g.Q())});e.addEventListener("error",function(a){bp(e,a)});e.gC=!0;var h=this.Lo;null!==h&&(e.crossOrigin=h(this));e.src=a;c[a]=new cp(e);Yo++}null!==d&&Ul(d,this);this.element=e;
  null!==d&&Tl(d,this);this.Q();this.ta();this.j("source",b,a)}});function ap(a,b){a.Vy=!0;a.sv=!1;for(var c=null,d=Zo(),e=d.length,g=0;g<e;g++){var h=d[g],k=h.Fo.na(a.src);if(null!==k)for(e=k.length,g=0;g<e;g++)c=k[g],h.SC.add(c),h.Ce(),null!==c.ck&&c.ck(c,b)}}function bp(a,b){a.sv=b;for(var c=null,d=Zo(),e=d.length,g=0;g<e;g++)if(c=d[g].Fo.na(a.src),null!==c){for(var e=c.length,h=z.rb(),g=0;g<e;g++)h.push(c[g]);for(g=0;g<e;g++)c=h[g],null!==c.uf&&c.uf(c,b);z.xa(h)}}
  z.defineProperty(wk,{sL:"sourceCrossOrigin"},function(){return this.Lo},function(a){if(this.Lo!==a&&(null!==a&&z.g(a,"function",wk,"sourceCrossOrigin"),this.Lo=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}});
  z.defineProperty(wk,{tj:"sourceRect"},function(){return this.$j},function(a){var b=this.$j;b.N(a)||(z.l(a,w,wk,"sourceRect"),this.$j=a=a.V(),this.ta(),this.j("sourceRect",b,a))});z.defineProperty(wk,{WH:"imageStretch"},function(){return this.lo},function(a){var b=this.lo;b!==a&&(z.Ba(a,O,wk,"imageStretch"),this.lo=a,this.ta(),this.j("imageStretch",b,a))});
  z.defineProperty(wk,{Vz:"errorFunction"},function(){return this.uf},function(a){var b=this.uf;b!==a&&(null!==a&&z.g(a,"function",wk,"errorFunction"),this.uf=a,this.j("errorFunction",b,a))});z.defineProperty(wk,{CL:"successFunction"},function(){return this.ck},function(a){var b=this.ck;b!==a&&(null!==a&&z.g(a,"function",wk,"successFunction"),this.ck=a,this.j("successFunction",b,a))});
  wk.prototype.ok=function(a,b){var c=this.$e;if(null!==c){var d=c.src;null!==d&&""!==d||z.k('Element has no source ("src") attribute: '+c);if(!(c.sv instanceof Event)&&!0===c.Vy){var d=this.Ga,e=0,g=0,h=this.Ty,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.tj.F()&&(e=this.$j.x,g=this.$j.y,k=this.$j.width,h=this.$j.height);var n=k,p=h,q=this.lo;
  switch(q){case bj:if(this.tj.F())break;e+=Math.max((n-d.width)/2,0);g+=Math.max((p-d.height)/2,0);k=Math.min(d.width,n);h=Math.min(d.height,p);break;case lf:n=d.width;p=d.height;break;case dj:case ej:var r=0;q===dj?(r=Math.min(d.height/p,d.width/n),n*=r,p*=r):q===ej&&(r=Math.max(d.height/p,d.width/n),n*=r,p*=r,e+=(n-d.width)/2/n*k,g+=(p-d.height)/2/p*h,k*=1/(n/d.width),h*=1/(p/d.height),n=d.width,p=d.height)}var q=this.hj()*b.scale,s=k*h/(n*q*p*q),r=Xo[this.source],q=null;if(void 0!==r&&16<s){2>r.ap.length&&
  (dp(r,4,l,m),dp(r,16,l,m));for(var l=r.ap,m=l.length,q=l[0],t=0;t<m;t++)if(l[t].Rp*l[t].Rp<s)q=l[t];else break}if(!b.ao){if(null===this.Uo)if(null===this.$e)this.Uo=!1;else{l=(new la(null)).zl;l.drawImage(this.$e,0,0);try{l.getImageData(0,0,1,1).data[3]&&(this.Uo=!1),this.Uo=!1}catch(v){this.Uo=!0}}if(this.Uo)return}if(b.ij("pictureRatioOptimization")&&!b.Uy&&void 0!==r&&null!==q&&1!==q.Rp){a.save();r=q.Rp;try{a.drawImage(q.source,e/r,g/r,Math.min(q.source.width,k/r),Math.min(q.source.height,h/r),
  Math.max((d.width-n)/2,0),Math.max((d.height-p)/2,0),Math.min(d.width,n),Math.min(d.height,p))}catch(x){u&&this.fo&&z.trace(x.toString()),this.fo=!1}a.restore()}else try{a.drawImage(c,e,g,k,h,Math.max((d.width-n)/2,0),Math.max((d.height-p)/2,0),Math.min(d.width,n),Math.min(d.height,p))}catch(y){u&&this.fo&&z.trace(y.toString()),this.fo=!1}}}}};z.w(wk,{Ga:"naturalBounds"},function(){return this.Wc});
  wk.prototype.Ip=function(a,b,c,d){var e=this.Aa,g=Mm(this,!0),h=this.$e,k=this.Ty;if(k||!this.$y&&h&&h.complete)this.$y=!0;null===h&&(isFinite(a)||(a=0),isFinite(b)||(b=0));isFinite(e.width)||g===lf||g===Cm?(isFinite(a)||(a=this.tj.F()?this.tj.width:k?+h.width:h.naturalWidth),c=0):null!==h&&!1!==this.$y&&(a=this.tj.F()?this.tj.width:k?+h.width:h.naturalWidth);isFinite(e.height)||g===lf||g===Bm?(isFinite(b)||(b=this.tj.F()?this.tj.height:k?+h.height:h.naturalHeight),d=0):null!==h&&!1!==this.$y&&(b=
  this.tj.F()?this.tj.height:k?+h.height:h.naturalHeight);isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);e=this.Xe;g=this.dg;c=Math.max(c,g.width);d=Math.max(d,g.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));yb(this.Wc,a,b);Jm(this,0,0,a,b)};wk.prototype.aj=function(a,b,c,d){Nm(this,a,b,c,d)};function cp(a){this.ap=[new ep(a,1)]}
  function dp(a,b,c,d){var e=new la(null),g=e.zl,h=1/b;e.width=c/b;e.height=d/b;b=new ep(e.Ld,b);c=a.ap[a.ap.length-1];g.setTransform(h*c.Rp,0,0,h*c.Rp,0,0);g.drawImage(c.source,0,0);a.ap.push(b)}function ep(a,b){this.source=a;this.Rp=b}function Ga(){this.q=new hf;this.$b=null}f=Ga.prototype;f.reset=function(){this.q=new hf;this.$b=null};
  function R(a,b,c,d,e,g){null===a.q&&z.k("StreamGeometryContext has been closed");void 0!==e&&!0===e?(null===a.$b&&z.k("Need to call beginFigure first"),d=new Qf(Ef),d.L=b,d.M=c,a.$b.Ab.add(d)):(a.$b=new kf,a.$b.Ha=b,a.$b.Da=c,a.$b.Ot=d,a.q.cc.add(a.$b));void 0!==g&&(a.$b.ro=g)}function T(a){null===a.q&&z.k("StreamGeometryContext has been closed");null===a.$b&&z.k("Need to call beginFigure first");var b=a.$b.Ab.length;0<b&&a.$b.Ab.ea(b-1).close()}
  function Bf(a){null===a.q&&z.k("StreamGeometryContext has been closed");null===a.$b&&z.k("Need to call beginFigure first");0<a.$b.Ab.length&&(a.$b.Ot=!0)}f.fb=function(a){null===this.q&&z.k("StreamGeometryContext has been closed");null===this.$b&&z.k("Need to call beginFigure first");this.$b.tk=a};f.moveTo=function(a,b,c){void 0===c&&(c=!1);null===this.q&&z.k("StreamGeometryContext has been closed");null===this.$b&&z.k("Need to call beginFigure first");var d=new Qf(Ef);d.L=a;d.M=b;c&&d.close();this.$b.Ab.add(d)};
  f.lineTo=function(a,b,c){void 0===c&&(c=!1);null===this.q&&z.k("StreamGeometryContext has been closed");null===this.$b&&z.k("Need to call beginFigure first");var d=new Qf(qf);d.L=a;d.M=b;c&&d.close();this.$b.Ab.add(d)};function S(a,b,c,d,e,g,h,k){void 0===k&&(k=!1);null===a.q&&z.k("StreamGeometryContext has been closed");null===a.$b&&z.k("Need to call beginFigure first");var l=new Qf(Ff);l.zc=b;l.Qc=c;l.Ch=d;l.Dh=e;l.L=g;l.M=h;k&&l.close();a.$b.Ab.add(l)}
  function zf(a,b,c,d,e){var g;void 0===g&&(g=!1);null===a.q&&z.k("StreamGeometryContext has been closed");null===a.$b&&z.k("Need to call beginFigure first");var h=new Qf(Gf);h.zc=b;h.Qc=c;h.L=d;h.M=e;g&&h.close();a.$b.Ab.add(h)}f.arcTo=function(a,b,c,d,e,g,h){void 0===g&&(g=0);void 0===h&&(h=!1);null===this.q&&z.k("StreamGeometryContext has been closed");null===this.$b&&z.k("Need to call beginFigure first");var k=new Qf(Hf);k.Fe=a;k.Lf=b;k.ra=c;k.za=d;k.radiusX=e;k.radiusY=0!==g?g:e;h&&k.close();this.$b.Ab.add(k)};
  function Af(a,b,c,d,e,g,h,k){var l;void 0===l&&(l=!1);null===a.q&&z.k("StreamGeometryContext has been closed");null===a.$b&&z.k("Need to call beginFigure first");b=new Qf(If,h,k,b,c,d,e,g);l&&b.close();a.$b.Ab.add(b)}function fp(a){a=gp(a);var b=z.rb();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;z.xa(a);return b}
  function gp(a){var b=hp(a),c=z.rb(),d=Math.floor(b.length/2),e=b.length-1;a=0===a%2?2:1;for(var g=0;g<e;g++){var h=b[g],k=b[g+1],l=b[(d+g-1)%e],m=b[(d+g+a)%e];c[2*g]=h;c[2*g+1]=Oe(h.x,h.y,l.x,l.y,k.x,k.y,m.x,m.y,new N)}c[c.length]=c[0];z.xa(b);return c}function hp(a){for(var b=z.rb(),c=1.5*Math.PI,d=0,e=0;e<a;e++)d=2*Math.PI/a*e+c,b[e]=new N(.5+.5*Math.cos(d),.5+.5*Math.sin(d));b.push(b[0]);return b}
  var wo={None:"Rectangle",Rectangle:function(a,b,c){a=new hf;a.type=nf;a.Ha=0;a.Da=0;a.L=b;a.M=c;return a},Square:function(a,b,c){a=new hf;a.Xd=dj;a.type=nf;a.Ha=0;a.Da=0;a.L=Math.min(b,c);a.M=Math.min(b,c);return a},Ellipse:function(a,b,c){a=new hf;a.type=of;a.Ha=0;a.Da=0;a.L=b;a.M=c;a.C=he;a.D=ie;return a},Circle:function(a,b,c){a=new hf;a.Xd=dj;a.type=of;a.Ha=0;a.Da=0;a.L=Math.min(b,c);a.M=Math.min(b,c);a.C=he;a.D=ie;return a},Connector:"Ellipse",TriangleRight:function(a,b,c){a=new hf;var d=new kf,
  e=new Qf;e.L=b;e.M=.5*c;d.Ab.add(e);b=new Qf;b.L=0;b.M=c;d.Ab.add(b.close());a.cc.add(d);a.C=new Q(0,.25);a.D=new Q(.5,.75);return a},TriangleDown:function(a,b,c){a=new hf;var d=new kf,e=new Qf;e.L=b;e.M=0;d.Ab.add(e);e=new Qf;e.L=.5*b;e.M=c;d.Ab.add(e.close());a.cc.add(d);a.C=new Q(.25,0);a.D=new Q(.75,.5);return a},TriangleLeft:function(a,b,c){a=new hf;var d=new kf;d.Ha=b;d.Da=c;var e=new Qf;e.L=0;e.M=.5*c;d.Ab.add(e);c=new Qf;c.L=b;c.M=0;d.Ab.add(c.close());a.cc.add(d);a.C=new Q(.5,.25);a.D=new Q(1,
  .75);return a},TriangleUp:function(a,b,c){a=new hf;var d=new kf;d.Ha=b;d.Da=c;var e=new Qf;e.L=0;e.M=c;d.Ab.add(e);c=new Qf;c.L=.5*b;c.M=0;d.Ab.add(c.close());a.cc.add(d);a.C=new Q(.25,.5);a.D=new Q(.75,1);return a},Line1:function(a,b,c){a=new hf;a.type=mf;a.Ha=0;a.Da=0;a.L=b;a.M=c;return a},Line2:function(a,b,c){a=new hf;a.type=mf;a.Ha=b;a.Da=0;a.L=0;a.M=c;return a},MinusLine:"LineH",LineH:function(a,b,c){a=new hf;a.type=mf;a.Ha=0;a.Da=c/2;a.L=b;a.M=c/2;return a},LineV:function(a,b,c){a=new hf;a.type=
  mf;a.Ha=b/2;a.Da=0;a.L=b/2;a.M=c;return a},BarH:"Rectangle",BarV:"Rectangle",Curve1:function(a,b,c){a=z.v();R(a,0,0,!1);S(a,Hd*b,0,1*b,(1-Hd)*c,b,c);b=a.q;z.u(a);return b},Curve2:function(a,b,c){a=z.v();R(a,0,0,!1);S(a,0,Hd*c,(1-Hd)*b,c,b,c);b=a.q;z.u(a);return b},Curve3:function(a,b,c){a=z.v();R(a,1*b,0,!1);S(a,1*b,Hd*c,Hd*b,1*c,0,1*c);b=a.q;z.u(a);return b},Curve4:function(a,b,c){a=z.v();R(a,1*b,0,!1);S(a,(1-Hd)*b,0,0,(1-Hd)*c,0,1*c);b=a.q;z.u(a);return b},Alternative:"Triangle",Merge:"Triangle",
  Triangle:function(a,b,c){a=z.v();R(a,.5*b,0*c,!0);a.lineTo(0*b,1*c);a.lineTo(1*b,1*c,!0);b=a.q;b.C=new Q(.25,.5);b.D=new Q(.75,1);z.u(a);return b},Decision:"Diamond",Diamond:function(a,b,c){a=z.v();R(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.q;b.C=new Q(.25,.25);b.D=new Q(.75,.75);z.u(a);return b},Pentagon:function(a,b,c){var d=hp(5);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.2,.22);b.D=new Q(.8,
  .9);z.u(a);return b},DataTransmission:"Hexagon",Hexagon:function(a,b,c){var d=hp(6);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.07,.25);b.D=new Q(.93,.75);z.u(a);return b},Heptagon:function(a,b,c){var d=hp(7);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.2,.15);b.D=new Q(.8,.85);z.u(a);return b},Octagon:function(a,b,c){var d=hp(8);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.15,.15);b.D=new Q(.85,.85);z.u(a);return b},Nonagon:function(a,b,c){var d=hp(9);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.17,.13);b.D=new Q(.82,.82);z.u(a);return b},Decagon:function(a,b,c){var d=hp(10);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.16,.16);b.D=new Q(.84,.84);z.u(a);return b},
  Dodecagon:function(a,b,c){var d=hp(12);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.16,.16);b.D=new Q(.84,.84);z.u(a);return b},FivePointedStar:function(a,b,c){var d=gp(5);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.312,.383);b.D=new Q(.693,.765);z.u(a);return b},SixPointedStar:function(a,b,c){var d=gp(6);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.17,.251);b.D=new Q(.833,.755);z.u(a);return b},SevenPointedStar:function(a,b,c){var d=gp(7);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.363,.361);b.D=new Q(.641,.709);z.u(a);return b},EightPointedStar:function(a,b,c){var d=gp(8);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.252,.255);b.D=new Q(.75,.75);z.u(a);return b},NinePointedStar:function(a,
  b,c){var d=gp(9);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.355,.361);b.D=new Q(.645,.651);z.u(a);return b},TenPointedStar:function(a,b,c){var d=gp(10);a=z.v();R(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);z.xa(d);T(a);b=a.q;b.C=new Q(.281,.261);b.D=new Q(.723,.748);z.u(a);return b},FivePointedBurst:function(a,b,c){var d=fp(5);a=z.v();R(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)S(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);z.xa(d);T(a);b=a.q;b.C=new Q(.312,.383);b.D=new Q(.693,.765);z.u(a);return b},SixPointedBurst:function(a,b,c){var d=fp(6);a=z.v();R(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)S(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);z.xa(d);T(a);b=a.q;b.C=new Q(.17,.251);b.D=new Q(.833,.755);z.u(a);return b},SevenPointedBurst:function(a,b,c){var d=fp(7);a=z.v();R(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)S(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);z.xa(d);T(a);b=a.q;b.C=new Q(.363,.361);b.D=new Q(.641,.709);z.u(a);return b},EightPointedBurst:function(a,b,c){var d=fp(8);a=z.v();R(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)S(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);z.xa(d);T(a);b=a.q;b.C=new Q(.252,.255);b.D=new Q(.75,.75);z.u(a);return b},NinePointedBurst:function(a,b,c){var d=fp(9);a=z.v();R(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)S(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);z.xa(d);T(a);b=a.q;b.C=new Q(.355,.361);b.D=new Q(.645,.651);z.u(a);return b},TenPointedBurst:function(a,b,c){var d=fp(10);a=z.v();R(a,d[0].x*b,d[0].y*c,!0);for(var e=1;e<d.length;e+=3)S(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);z.xa(d);T(a);b=a.q;b.C=new Q(.281,.261);b.D=new Q(.723,.748);z.u(a);return b},Cloud:function(a,b,c){a=z.v();R(a,.08034461*b,.1944299*c,!0);S(a,-.09239631*b,.07836421*c,.1406031*b,-.0542823*c,.2008615*
  b,.05349299*c);S(a,.2450511*b,-.00697547*c,.3776197*b,-.01112067*c,.4338609*b,.074219*c);S(a,.4539471*b,0,.6066018*b,-.02526587*c,.6558228*b,.07004196*c);S(a,.6914277*b,-.01904177*c,.8921095*b,-.01220843*c,.8921095*b,.08370865*c);S(a,1.036446*b,.04105738*c,1.020377*b,.3022052*c,.9147671*b,.3194596*c);S(a,1.04448*b,.360238*c,.992256*b,.5219009*c,.9082935*b,.562044*c);S(a,1.032337*b,.5771781*c,1.018411*b,.8120651*c,.9212406*b,.8217117*c);S(a,1.028411*b,.9571472*c,.8556702*b,1.052487*c,.7592566*b,.9156953*
  c);S(a,.7431877*b,1.009325*c,.5624123*b,1.021761*c,.5101666*b,.9310455*c);S(a,.4820677*b,1.031761*c,.3030112*b,1.002796*c,.2609328*b,.9344623*c);S(a,.2329994*b,1.01518*c,.03213784*b,1.01518*c,.08034461*b,.870098*c);S(a,-.02812061*b,.9032597*c,-.01205169*b,.6835638*c,.06829292*b,.6545475*c);S(a,-.01812061*b,.6089503*c,-.00606892*b,.4555777*c,.06427569*b,.4265613*c);S(a,-.01606892*b,.3892545*c,-.01205169*b,.1944299*c,.08034461*b,.1944299*c);T(a);b=a.q;b.C=new Q(.1,.1);b.D=new Q(.9,.9);z.u(a);return b},
  Gate:"Crescent",Crescent:function(a,b,c){a=z.v();R(a,0,0,!0);S(a,1*b,0,1*b,1*c,0,1*c);S(a,.5*b,.75*c,.5*b,.25*c,0,0);T(a);b=a.q;b.C=new Q(.511,.19);b.D=new Q(.776,.76);z.u(a);return b},FramedRectangle:function(a,b,c){var d=z.v(),e=a?a.Ic:NaN;a=a?a.gu:NaN;isNaN(e)&&(e=.1);isNaN(a)&&(a=.1);R(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c,!0);R(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.q;b.C=new Q(e,a);b.D=new Q(1-e,1-a);z.u(d);return b},
  Delay:"HalfEllipse",HalfEllipse:function(a,b,c){a=z.v();R(a,0,0,!0);S(a,Hd*b,0,1*b,(.5-Hd/2)*c,1*b,.5*c);S(a,1*b,(.5+Hd/2)*c,Hd*b,1*c,0,1*c);T(a);b=a.q;b.C=new Q(0,.2);b.D=new Q(.75,.8);z.u(a);return b},Heart:function(a,b,c){a=z.v();R(a,.5*b,1*c,!0);S(a,.1*b,.8*c,0,.5*c,0*b,.3*c);S(a,0*b,0,.45*b,0,.5*b,.3*c);S(a,.55*b,0,1*b,0,1*b,.3*c);S(a,b,.5*c,.9*b,.8*c,.5*b,1*c);T(a);b=a.q;b.C=new Q(.15,.29);b.D=new Q(.86,.68);z.u(a);return b},Spade:function(a,b,c){a=z.v();R(a,.5*b,0,!0);a.lineTo(.51*b,.01*c);
  S(a,.6*b,.2*c,b,.25*c,b,.5*c);S(a,b,.8*c,.6*b,.8*c,.55*b,.7*c);S(a,.5*b,.75*c,.55*b,.95*c,.75*b,c);a.lineTo(.25*b,c);S(a,.45*b,.95*c,.5*b,.75*c,.45*b,.7*c);S(a,.4*b,.8*c,0,.8*c,0,.5*c);S(a,0,.25*c,.4*b,.2*c,.49*b,.01*c);T(a);b=a.q;b.C=new Q(.19,.26);b.D=new Q(.8,.68);z.u(a);return b},Club:function(a,b,c){a=z.v();R(a,.4*b,.6*c,!0);S(a,.5*b,.75*c,.45*b,.95*c,.15*b,1*c);a.lineTo(.85*b,c);S(a,.55*b,.95*c,.5*b,.75*c,.6*b,.6*c);var d=.2,e=.3,g=0,h=4*(Math.SQRT2-1)/3*d;S(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*
  b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);S(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);S(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e+.05)*b,(.5-h+g-.02)*c,.65*b,.36771243*c);d=.2;e=0;g=-.3;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);S(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);S(a,(.5-d+
  e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,.35*b,.36771243*c);d=.2;e=-.3;g=0;h=4*(Math.SQRT2-1)/3*d;S(a,(.5+d+e-.05)*b,(.5-h+g-.02)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);S(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);S(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,.4*b,.6*c);T(a);b=a.q;b.C=new Q(.06,.39);b.D=new Q(.93,.58);z.u(a);return b},Ring:function(a,b,c){a=z.v();var d=4*(Math.SQRT2-1)/3*.5;R(a,b,.5*
  c,!0);S(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);S(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);S(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);S(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;R(a,.5*b,.1*c,!0,!0);S(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);S(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);S(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);S(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);b=a.q;b.C=new Q(.146,.146);b.D=new Q(.853,.853);b.Xd=dj;z.u(a);return b},YinYang:function(a,b,c){var d=.5;a=z.v();d=.5;R(a,.5*b,0,!0);a.arcTo(270,
  180,.5*b,.5*b,.5*b);S(a,1*b,d*c,0,d*c,d*b,0,!0);var d=.1,e=.25;R(a,(.5+d)*b,e*c,!0,!0);a.arcTo(0,-360,.5*b,c*e,d*b);T(a);R(a,.5*b,0,!1);a.arcTo(270,-180,.5*b,.5*b,.5*b);a.fb(!1);e=.75;R(a,(.5+d)*b,e*c,!0);a.arcTo(0,360,.5*b,c*e,d*b);T(a);b=a.q;b.Xd=dj;z.u(a);return b},Peace:function(a,b,c){a=z.v();var d=4*(Math.SQRT2-1)/3*.5;R(a,b,.5*c,!0);S(a,b,(.5-d)*c,(.5+d)*b,0,.5*b,0);S(a,(.5-d)*b,0,0,(.5-d)*c,0,.5*c);S(a,0,(.5+d)*c,(.5-d)*b,c,.5*b,c);S(a,(.5+d)*b,c,b,(.5+d)*c,b,.5*c);d=4*(Math.SQRT2-1)/3*.4;
  R(a,.5*b,.1*c,!0,!0);S(a,(.5+d)*b,.1*c,.9*b,(.5-d)*c,.9*b,.5*c);S(a,.9*b,(.5+d)*c,(.5+d)*b,.9*c,.5*b,.9*c);S(a,(.5-d)*b,.9*c,.1*b,(.5+d)*c,.1*b,.5*c);S(a,.1*b,(.5-d)*c,(.5-d)*b,.1*c,.5*b,.1*c);var d=.07,e=0,g=-.707*.11,h=4*(Math.SQRT2-1)/3*d;R(a,(.5+d+e)*b,(.5+g)*c,!0);S(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);S(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);S(a,(.5+h+e)*b,(.5+d+g)*
  c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);d=.07;e=-.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;R(a,(.5+d+e)*b,(.5+g)*c,!0);S(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);S(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);S(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);d=.07;e=.707*.11;g=.707*.11;h=4*(Math.SQRT2-1)/3*d;R(a,(.5+d+e)*b,(.5+g)*c,!0);S(a,(.5+d+e)*b,(.5-h+
  g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);S(a,(.5-d+e)*b,(.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);S(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);b=a.q;b.C=new Q(.146,.146);b.D=new Q(.853,.853);b.Xd=dj;z.u(a);return b},NotAllowed:function(a,b,c){var d=.5*Hd,e=.5;a=z.v();R(a,.5*b,(.5-e)*c,!0);S(a,(.5-d)*b,(.5-e)*c,(.5-e)*b,(.5-d)*c,(.5-e)*b,.5*c);S(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,
  (.5+e)*c);S(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+e)*b,.5*c);S(a,(.5+e)*b,(.5-d)*c,(.5+d)*b,(.5-e)*c,.5*b,(.5-e)*c);var e=.4,d=.4*Hd,g=z.O(),h=z.O(),k=z.O(),l=z.O();xe(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.42,g,h,k,l,l);var m=z.O(),n=z.O(),p=z.O();xe(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.58,l,l,p,m,n);var q=z.O(),r=z.O(),s=z.O();xe(.5,.5+e,.5-d,.5+e,.5-e,.5+d,.5-e,.5,.42,q,r,s,l,l);var t=z.O(),v=z.O(),x=z.O();xe(.5,.5+e,.5-d,.5+e,.5-e,.5+d,.5-e,.5,.58,l,l,x,t,v);R(a,x.x*b,x.y*c,!0,!0);S(a,t.x*b,
  t.y*c,v.x*b,v.y*c,(.5-e)*b,.5*c);S(a,(.5-e)*b,(.5-d)*c,(.5-d)*b,(.5-e)*c,.5*b,(.5-e)*c);S(a,g.x*b,g.y*c,h.x*b,h.y*c,k.x*b,k.y*c);a.lineTo(x.x*b,x.y*c);T(a);R(a,s.x*b,s.y*c,!0,!0);a.lineTo(p.x*b,p.y*c);S(a,m.x*b,m.y*c,n.x*b,n.y*c,(.5+e)*b,.5*c);S(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);S(a,q.x*b,q.y*c,r.x*b,r.y*c,s.x*b,s.y*c);T(a);z.A(g);z.A(h);z.A(k);z.A(l);z.A(m);z.A(n);z.A(p);z.A(q);z.A(r);z.A(s);z.A(t);z.A(v);z.A(x);b=a.q;z.u(a);b.Xd=dj;return b},Fragile:function(a,b,c){a=z.v();R(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);S(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);S(a,.25*b,.5*c,0,.25*c,0,0);T(a);b=a.q;b.C=new Q(.25,0);b.D=new Q(.75,.4);z.u(a);return b},HourGlass:function(a,b,c){a=z.v();R(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);T(a);b=a.q;z.u(a);return b},Lightning:function(a,b,c){a=z.v();R(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);T(a);b=a.q;z.u(a);return b},Parallelogram1:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.1);var d=z.v();R(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);T(d);b=d.q;b.C=new Q(a,0);b.D=new Q(1-a,1);z.u(d);return b},Input:"Output",Output:function(a,
  b,c){a=z.v();R(a,0,1*c,!0);a.lineTo(.1*b,0);a.lineTo(1*b,0);a.lineTo(.9*b,1*c);T(a);b=a.q;b.C=new Q(.1,0);b.D=new Q(.9,1);z.u(a);return b},Parallelogram2:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.25);var d=z.v();R(d,a*b,0,!0);d.lineTo(1*b,0);d.lineTo((1-a)*b,1*c);d.lineTo(0,1*c);T(d);b=d.q;b.C=new Q(a,0);b.D=new Q(1-a,1);z.u(d);return b},ThickCross:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.25);var d=z.v();R(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);T(d);b=d.q;b.C=new Q(.5-a/2,.5-a/2);b.D=new Q(.5+a/2,.5+a/2);z.u(d);return b},ThickX:function(a,b,c){a=.25/Math.SQRT2;var d=z.v();R(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);T(d);b=d.q;b.C=new Q(.5-a,.5-a);b.D=new Q(.5+a,.5+a);z.u(d);return b},ThinCross:function(a,b,c){var d=a?a.Ic:NaN;isNaN(d)&&(d=.1);a=z.v();R(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);T(a);b=a.q;z.u(a);return b},ThinX:function(a,b,c){a=z.v();R(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);T(a);b=a.q;z.u(a);return b},RightTriangle:function(a,b,c){a=z.v();R(a,0,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);T(a);b=a.q;b.C=new Q(0,.5);b.D=new Q(.5,1);z.u(a);return b},RoundedIBeam:function(a,b,c){a=
  z.v();R(a,0,0,!0);a.lineTo(1*b,0);S(a,.5*b,.25*c,.5*b,.75*c,1*b,1*c);a.lineTo(0,1*c);S(a,.5*b,.75*c,.5*b,.25*c,0,0);T(a);b=a.q;z.u(a);return b},RoundedRectangle:function(a,b,c){var d=a?a.Ic:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=d*Hd;var e=z.v();R(e,d,0,!0);e.lineTo(b-d,0);S(e,b-a,0,b,a,b,d);e.lineTo(b,c-d);S(e,b,c-a,b-a,c,b-d,c);e.lineTo(d,c);S(e,a,c,0,c-a,0,c-d);e.lineTo(0,d);S(e,0,a,a,0,d,0);T(e);b=e.q;1<a?(b.C=new Q(0,0,a,a),b.D=new Q(1,1,-a,-a)):(b.C=Zb,b.D=ic);z.u(e);return b},
  Border:function(a,b,c){var d=a?a.Ic:NaN;isNaN(d)&&(d=5);d=Math.min(d,b/3);d=Math.min(d,c/3);a=z.v();R(a,d,0,!0);a.lineTo(b-d,0);S(a,b-0,0,b,0,b,d);a.lineTo(b,c-d);S(a,b,c-0,b-0,c,b-d,c);a.lineTo(d,c);S(a,0,c,0,c-0,0,c-d);a.lineTo(0,d);S(a,0,0,0,0,d,0);T(a);b=a.q;b.C=Zb;b.D=ic;z.u(a);return b},SquareIBeam:function(a,b,c){var d=a?a.Ic:NaN;isNaN(d)&&(d=.2);a=z.v();R(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);T(a);b=a.q;z.u(a);return b},Trapezoid:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.2);var d=z.v();R(d,a*b,0,!0);d.lineTo((1-a)*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);T(d);b=d.q;b.C=new Q(a,0);b.D=new Q(1-a,1);z.u(d);return b},ManualLoop:"ManualOperation",ManualOperation:function(a,b,c){var d=a?a.Ic:NaN;isNaN(d)&&(d=0);a=z.v();R(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);T(a);b=a.q;b.C=new Q(.1,0);b.D=new Q(.9,1);z.u(a);return b},GenderMale:function(a,b,c){a=z.v();var d=.4*Hd,e=.4,g=z.O(),h=z.O(),k=z.O(),l=z.O();R(a,(.5-e)*b,.5*c,!0);S(a,(.5-e)*b,(.5-d)*c,(.5-d)*b,(.5-e)*c,.5*b,(.5-e)*c);xe(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.44,k,l,h,g,g);S(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);var m=z.Tb(h.x,h.y);xe(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.56,g,g,h,k,l);var n=z.Tb(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);S(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);S(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);S(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);e=.35;d=.35*Hd;R(a,.5*b,(.5-e)*c,!0,!0);S(a,(.5-d)*b,(.5-e)*c,(.5-e)*b,(.5-d)*c,(.5-e)*b,.5*c);S(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);S(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+e)*b,.5*c);S(a,(.5+e)*b,(.5-d)*c,(.5+
  d)*b,(.5-e)*c,.5*b,(.5-e)*c);R(a,(.5-e)*b,.5*c,!0);z.A(g);z.A(h);z.A(k);z.A(l);z.A(m);z.A(n);b=a.q;b.C=new Q(.202,.257);b.D=new Q(.692,.839);b.Xd=dj;z.u(a);return b},GenderFemale:function(a,b,c){a=z.v();var d=.375,e=0,g=-.125,h=4*(Math.SQRT2-1)/3*d;R(a,(.525+e)*b,(.5+d+g)*c,!0);S(a,(.5+h+e)*b,(.5+d+g)*c,(.5+d+e)*b,(.5+h+g)*c,(.5+d+e)*b,(.5+g)*c);S(a,(.5+d+e)*b,(.5-h+g)*c,(.5+h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5-h+e)*b,(.5-d+g)*c,(.5-d+e)*b,(.5-h+g)*c,(.5-d+e)*b,(.5+g)*c);S(a,(.5-d+e)*b,
  (.5+h+g)*c,(.5-h+e)*b,(.5+d+g)*c,(.475+e)*b,(.5+d+g)*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);T(a);d=.325;e=0;g=-.125;h=4*(Math.SQRT2-1)/3*d;R(a,(.5+d+e)*b,(.5+g)*c,!0,!0);S(a,(.5+d+e)*b,(.5+h+g)*c,(.5+h+e)*b,(.5+d+g)*c,(.5+e)*b,(.5+d+g)*c);S(a,(.5-h+e)*b,(.5+d+g)*c,(.5-d+e)*b,(.5+h+g)*c,(.5-d+e)*b,(.5+g)*c);S(a,(.5-
  d+e)*b,(.5-h+g)*c,(.5-h+e)*b,(.5-d+g)*c,(.5+e)*b,(.5-d+g)*c);S(a,(.5+h+e)*b,(.5-d+g)*c,(.5+d+e)*b,(.5-h+g)*c,(.5+d+e)*b,(.5+g)*c);R(a,(.525+e)*b,(.5+d+g)*c,!0);b=a.q;b.C=new Q(.232,.136);b.D=new Q(.782,.611);b.Xd=dj;z.u(a);return b},PlusLine:function(a,b,c){a=z.v();R(a,0,.5*c,!1);a.lineTo(1*b,.5*c);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);b=a.q;z.u(a);return b},XLine:function(a,b,c){a=z.v();R(a,0,1*c,!1);a.lineTo(1*b,0);a.moveTo(0,0);a.lineTo(1*b,1*c);b=a.q;z.u(a);return b},AsteriskLine:function(a,b,c){a=
  z.v();var d=.2/Math.SQRT2;R(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.q;z.u(a);return b},CircleLine:function(a,b,c){var d=.5*Hd;a=z.v();R(a,1*b,.5*c,!1);S(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);S(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new Q(.146,.146);b.D=new Q(.853,.853);b.Xd=dj;z.u(a);return b},Pie:function(a,
  b,c){a=z.v();var d=4*(Math.SQRT2-1)/3*.5;R(a,(.5*Math.SQRT2/2+.5)*b,(.5-.5*Math.SQRT2/2)*c,!0);S(a,.7*b,0*c,.5*b,0*c,.5*b,0*c);S(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);S(a,0*b,(.5+d+0)*c,(.5-d+0)*b,1*c,.5*b,1*c);S(a,(.5+d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);a.lineTo(.5*b,.5*c);T(a);b=a.q;z.u(a);return b},PiePiece:function(a,b,c){var d=Hd/Math.SQRT2*.5,e=Math.SQRT2/2,g=1-Math.SQRT2/2;a=z.v();R(a,b,c,!0);S(a,b,(1-d)*c,(e+d)*b,(g+d)*c,e*b,g*c);a.lineTo(0,c);T(a);b=a.q;z.u(a);return b},StopSign:function(a,
  b,c){a=1/(Math.SQRT2+2);var d=z.v();R(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);T(d);b=d.q;b.C=new Q(a/2,a/2);b.D=new Q(1-a/2,1-a/2);z.u(d);return b},LogicImplies:function(a,b,c){var d=a?a.Ic:NaN;isNaN(d)&&(d=.2);a=z.v();R(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.q;b.C=Zb;b.D=new Q(.8,.5);z.u(a);return b},LogicIff:function(a,b,c){var d=a?a.Ic:
  NaN;isNaN(d)&&(d=.2);a=z.v();R(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.q;b.C=new Q(.2,0);b.D=new Q(.8,.5);z.u(a);return b},LogicNot:function(a,b,c){a=z.v();R(a,0,0,!1);a.lineTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;z.u(a);return b},LogicAnd:function(a,b,c){a=z.v();R(a,0,1*c,!1);a.lineTo(.5*b,0);a.lineTo(1*b,1*c);b=a.q;b.C=new Q(.25,.5);b.D=new Q(.75,1);z.u(a);return b},LogicOr:function(a,b,c){a=z.v();
  R(a,0,0,!1);a.lineTo(.5*b,1*c);a.lineTo(1*b,0);b=a.q;b.C=new Q(.219,0);b.D=new Q(.78,.409);z.u(a);return b},LogicXor:function(a,b,c){a=z.v();R(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*Hd;S(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);S(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.Xd=dj;z.u(a);return b},LogicTruth:function(a,b,c){a=z.v();R(a,0,0,!1);a.lineTo(1*b,0);a.moveTo(.5*b,0);a.lineTo(.5*b,1*c);
  b=a.q;z.u(a);return b},LogicFalsity:function(a,b,c){a=z.v();R(a,0,1*c,!1);a.lineTo(1*b,1*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);b=a.q;z.u(a);return b},LogicThereExists:function(a,b,c){a=z.v();R(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.q;z.u(a);return b},LogicForAll:function(a,b,c){a=z.v();R(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.q;b.C=new Q(.25,0);b.D=new Q(.75,.5);z.u(a);
  return b},LogicIsDefinedAs:function(a,b,c){a=z.v();R(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.q;b.C=new Q(.01,.01);b.D=new Q(.99,.49);z.u(a);return b},LogicIntersect:function(a,b,c){var d=.5*Hd;a=z.v();R(a,0,1*c,!1);a.lineTo(0,.5*c);S(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);a.lineTo(1*b,1*c);b=a.q;b.C=new Q(0,.5);b.D=ic;z.u(a);return b},LogicUnion:function(a,b,c){var d=.5*Hd;a=z.v();R(a,1*b,0,!1);a.lineTo(1*b,.5*c);S(a,
  1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);a.lineTo(0,0);b=a.q;b.C=Zb;b.D=new Q(1,.5);z.u(a);return b},Arrow:function(a,b,c){var d=a?a.Ic:NaN,e=a?a.gu:NaN;isNaN(d)&&(d=.3);isNaN(e)&&(e=.3);a=z.v();R(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);T(a);b=a.q;b.C=new Q(0,.5-e/2);d=Oe(0,.5+e/2,1,.5+e/2,1-d,1,1,.5,z.O());b.D=new Q(d.x,d.y);z.A(d);z.u(a);return b},
  ISOProcess:"Chevron",Chevron:function(a,b,c){a=z.v();R(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);T(a);b=a.q;z.u(a);return b},DoubleArrow:function(a,b,c){a=z.v();R(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);T(a);R(a,.3*b,.214*c,!1);a.lineTo(.3*b,.786*c);a.fb(!1);b=a.q;z.u(a);return b},DoubleEndArrow:function(a,b,c){a=z.v();R(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);T(a);b=a.q;c=Oe(0,.5,.3,0,0,.3,.3,.3,z.O());b.C=new Q(c.x,c.y);c=Oe(.7,1,1,.5,.7,.7,1,.7,c);b.D=new Q(c.x,c.y);z.A(c);z.u(a);return b},IBeamArrow:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=new Q(0,.3);c=Oe(.7,1,1,.5,.7,.7,1,.7,z.O());b.D=new Q(c.x,c.y);z.A(c);z.u(a);return b},Pointer:function(a,b,c){a=z.v();R(a,1*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(.2*b,.5*c);a.lineTo(0,0);T(a);b=a.q;b.C=new Q(.2,.35);c=Oe(.2,.65,1,.65,0,1,1,.5,z.O());b.D=new Q(c.x,c.y);z.A(c);z.u(a);return b},RoundedPointer:function(a,b,c){a=z.v();R(a,1*b,.5*c,!0);a.lineTo(0,1*c);S(a,.5*b,.75*c,.5*b,.25*c,0,0);T(a);b=a.q;b.C=new Q(.4,.35);c=Oe(.2,.65,1,.65,0,1,1,.5,z.O());b.D=new Q(c.x,
  c.y);z.A(c);z.u(a);return b},SplitEndArrow:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=new Q(.2,.3);c=Oe(.7,1,1,.5,.7,.7,1,.7,z.O());b.D=new Q(c.x,c.y);z.A(c);z.u(a);return b},MessageToUser:"SquareArrow",SquareArrow:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=Zb;b.D=new Q(.7,1);z.u(a);
  return b},Cone1:function(a,b,c){var d=.5*Hd,e=.1*Hd;a=z.v();R(a,0,.9*c,!0);a.lineTo(.5*b,0);a.lineTo(1*b,.9*c);S(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);T(a);b=a.q;b.C=new Q(.25,.5);b.D=new Q(.75,.97);z.u(a);return b},Cone2:function(a,b,c){a=z.v();R(a,0,.9*c,!0);S(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);T(a);R(a,0,.9*c,!1);S(a,(1-.85/.9)*b,.8*c,.85/.9*b,.8*c,1*b,.9*c);a.fb(!1);b=a.q;b.C=new Q(.25,.5);b.D=new Q(.75,.82);z.u(a);return b},
  Cube1:function(a,b,c){a=z.v();R(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);T(a);R(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.fb(!1);b=a.q;b.C=new Q(0,.3);b.D=new Q(.5,.85);z.u(a);return b},Cube2:function(a,b,c){a=z.v();R(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);T(a);R(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.fb(!1);b=a.q;b.C=new Q(0,.3);b.D=new Q(.7,1);z.u(a);return b},MagneticData:"Cylinder1",Cylinder1:function(a,b,c){var d=.5*Hd,e=.1*Hd;a=z.v();R(a,0,.1*c,!0);S(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);a.lineTo(b,.9*c);S(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);R(a,0,.1*c,!1);S(a,0,(.1+e)*c,(.5-d)*b,.2*c,.5*b,.2*c);S(a,(.5+d)*b,.2*c,1*b,(.1+e)*c,1*b,.1*c);a.fb(!1);b=a.q;b.C=new Q(0,
  .2);b.D=new Q(1,.9);z.u(a);return b},Cylinder2:function(a,b,c){var d=.5*Hd,e=.1*Hd;a=z.v();R(a,0,.9*c,!0);a.lineTo(0,.1*c);S(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);a.lineTo(1*b,.9*c);S(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);R(a,0,.9*c,!1);S(a,0,(.9-e)*c,(.5-d)*b,.8*c,.5*b,.8*c);S(a,(.5+d)*b,.8*c,1*b,(.9-e)*c,1*b,.9*c);a.fb(!1);b=a.q;b.C=new Q(0,.1);b.D=new Q(1,.8);z.u(a);return b},Cylinder3:function(a,b,c){var d=.1*Hd,e=.5*Hd;a=z.v();
  R(a,.1*b,0,!0);a.lineTo(.9*b,0);S(a,(.9+d)*b,0,1*b,(.5-e)*c,1*b,.5*c);S(a,1*b,(.5+e)*c,(.9+d)*b,1*c,.9*b,1*c);a.lineTo(.1*b,1*c);S(a,(.1-d)*b,1*c,0,(.5+e)*c,0,.5*c);S(a,0,(.5-e)*c,(.1-d)*b,0,.1*b,0);R(a,.1*b,0,!1);S(a,(.1+d)*b,0,.2*b,(.5-e)*c,.2*b,.5*c);S(a,.2*b,(.5+e)*c,(.1+d)*b,1*c,.1*b,1*c);a.fb(!1);b=a.q;b.C=new Q(.2,0);b.D=new Q(.9,1);z.u(a);return b},DirectData:"Cylinder4",Cylinder4:function(a,b,c){var d=.1*Hd,e=.5*Hd;a=z.v();R(a,.9*b,0,!0);S(a,(.9+d)*b,0,1*b,(.5-e)*c,1*b,.5*c);S(a,1*b,(.5+
  e)*c,(.9+d)*b,1*c,.9*b,1*c);a.lineTo(.1*b,1*c);S(a,(.1-d)*b,1*c,0,(.5+e)*c,0,.5*c);S(a,0,(.5-e)*c,(.1-d)*b,0,.1*b,0);a.lineTo(.9*b,0);R(a,.9*b,0,!1);S(a,(.9-d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);S(a,.8*b,(.5+e)*c,(.9-d)*b,1*c,.9*b,1*c);a.fb(!1);b=a.q;b.C=new Q(.1,0);b.D=new Q(.8,1);z.u(a);return b},Prism1:function(a,b,c){a=z.v();R(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);T(a);R(a,.25*b,.25*c,!1);a.lineTo(.5*b,c);a.fb(!1);b=a.q;b.C=new Q(.408,.172);b.D=new Q(.833,
  .662);z.u(a);return b},Prism2:function(a,b,c){a=z.v();R(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);T(a);R(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.fb(!1);b=a.q;b.C=new Q(.25,.5);b.D=new Q(.75,.75);z.u(a);return b},Pyramid1:function(a,b,c){a=z.v();R(a,.5*b,0,!0);a.lineTo(b,.75*c);a.lineTo(.5*b,1*c);a.lineTo(0,.75*c);T(a);R(a,.5*b,0,!1);a.lineTo(.5*b,1*c);a.fb(!1);b=a.q;b.C=new Q(.25,.367);b.D=new Q(.75,
  .875);z.u(a);return b},Pyramid2:function(a,b,c){a=z.v();R(a,.5*b,0,!0);a.lineTo(b,.85*c);a.lineTo(.5*b,1*c);a.lineTo(0,.85*c);T(a);R(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.fb(!1);b=a.q;b.C=new Q(.25,.367);b.D=new Q(.75,.875);z.u(a);return b},Actor:function(a,b,c){var d=.2*Hd,e=.1*Hd,g=.5,h=.1;a=z.v();R(a,g*b,(h+.1)*c,!0);S(a,(g-d)*b,(h+.1)*c,(g-.2)*b,(h+e)*c,(g-.2)*b,h*c);S(a,(g-.2)*b,(h-e)*c,(g-d)*b,(h-.1)*c,g*b,(h-.1)*c);S(a,(g+d)*b,(h-.1)*c,
  (g+.2)*b,(h-e)*c,(g+.2)*b,h*c);S(a,(g+.2)*b,(h+e)*c,(g+d)*b,(h+.1)*c,g*b,(h+.1)*c);d=.05;e=Hd*d;R(a,.5*b,.2*c,!0);a.lineTo(.95*b,.2*c);g=.95;h=.25;S(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+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=Hd*d;g=.825;h=.35;S(a,(g+d)*b,(h-e)*c,(g+e)*b,(h-d)*c,g*b,(h-d)*c);S(a,(g-e)*b,(h-d)*c,(g-d)*b,(h-e)*c,(g-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=Hd*d;g=.5;h=.7;S(a,(g+d)*b,(h-e)*c,(g+e)*b,(h-d)*c,
  g*b,(h-d)*c);S(a,(g-e)*b,(h-d)*c,(g-d)*b,(h-e)*c,(g-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=Hd*d;g=.175;h=.35;S(a,(g+d)*b,(h-e)*c,(g+e)*b,(h-d)*c,g*b,(h-d)*c);S(a,(g-e)*b,(h-d)*c,(g-d)*b,(h-e)*c,(g-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=Hd*d;g=.05;h=.25;S(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);a.lineTo(.5*b,.2*c);b=a.q;b.C=new Q(.2,.2);b.D=new Q(.8,.65);z.u(a);return b},Card:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=new Q(0,.2);b.D=ic;z.u(a);return b},Collate:function(a,b,c){a=z.v();R(a,.5*b,.5*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(.5*b,.5*c);R(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.q;b.C=new Q(.25,0);b.D=new Q(.75,.25);z.u(a);return b},CreateRequest:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.1);var d=z.v();R(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);T(d);R(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.fb(!1);b=d.q;b.C=new Q(0,a);b.D=new Q(1,1-a);z.u(d);return b},Database:function(a,b,c){a=z.v();var d=.5*Hd,e=.1*Hd;R(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);S(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);S(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);R(a,1*b,.1*c,!1);S(a,1*b,(.1+e)*c,(.5+d)*b,.2*c,.5*b,.2*c);S(a,(.5-d)*b,.2*c,0,(.1+e)*c,0,.1*c);a.moveTo(1*b,.2*c);
  S(a,1*b,(.2+e)*c,(.5+d)*b,.3*c,.5*b,.3*c);S(a,(.5-d)*b,.3*c,0,(.2+e)*c,0,.2*c);a.moveTo(1*b,.3*c);S(a,1*b,(.3+e)*c,(.5+d)*b,.4*c,.5*b,.4*c);S(a,(.5-d)*b,.4*c,0,(.3+e)*c,0,.3*c);a.fb(!1);b=a.q;b.C=new Q(0,.4);b.D=new Q(1,.9);z.u(a);return b},StoredData:"DataStorage",DataStorage:function(a,b,c){a=z.v();R(a,0,0,!0);a.lineTo(.75*b,0);S(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(0,1*c);S(a,.25*b,.9*c,.25*b,.1*c,0,0);T(a);b=a.q;b.C=new Q(.226,0);b.D=new Q(.81,1);z.u(a);return b},DiskStorage:function(a,b,c){a=
  z.v();var d=.5*Hd,e=.1*Hd;R(a,1*b,.1*c,!0);a.lineTo(1*b,.9*c);S(a,1*b,(.9+e)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.9+e)*c,0,.9*c);a.lineTo(0,.1*c);S(a,0,(.1-e)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.1-e)*c,1*b,.1*c);R(a,1*b,.1*c,!1);S(a,1*b,(.1+e)*c,(.5+d)*b,.2*c,.5*b,.2*c);S(a,(.5-d)*b,.2*c,0,(.1+e)*c,0,.1*c);a.moveTo(1*b,.2*c);S(a,1*b,(.2+e)*c,(.5+d)*b,.3*c,.5*b,.3*c);S(a,(.5-d)*b,.3*c,0,(.2+e)*c,0,.2*c);a.fb(!1);b=a.q;b.C=new Q(0,.3);b.D=new Q(1,.9);z.u(a);return b},Display:function(a,
  b,c){a=z.v();R(a,.25*b,0,!0);a.lineTo(.75*b,0);S(a,1*b,0,1*b,1*c,.75*b,1*c);a.lineTo(.25*b,1*c);a.lineTo(0,.5*c);T(a);b=a.q;b.C=new Q(.25,0);b.D=new Q(.75,1);z.u(a);return b},DividedEvent:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)?a=.2:.15>a&&(a=.15);var d=z.v(),e=.2*Hd;R(d,0,.2*c,!0);S(d,0,(.2-e)*c,(.2-e)*b,0,.2*b,0);d.lineTo(.8*b,0);S(d,(.8+e)*b,0,1*b,(.2-e)*c,1*b,.2*c);d.lineTo(1*b,.8*c);S(d,1*b,(.8+e)*c,(.8+e)*b,1*c,.8*b,1*c);d.lineTo(.2*b,1*c);S(d,(.2-e)*b,1*c,0,(.8+e)*c,0,.8*c);d.lineTo(0,.2*c);
  R(d,0,a*c,!1);d.lineTo(1*b,a*c);d.fb(!1);b=d.q;b.C=new Q(0,a);b.D=new Q(1,1-a);z.u(d);return b},DividedProcess:function(a,b,c){a=a?a.Ic:NaN;if(isNaN(a)||.1>a)a=.1;var d=z.v();R(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);T(d);R(d,0,a*c,!1);d.lineTo(1*b,a*c);d.fb(!1);b=d.q;b.C=new Q(0,a);b.D=ic;z.u(d);return b},Document:function(a,b,c){c/=.8;a=z.v();R(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);S(a,.5*b,.4*c,.5*b,1*c,0,.7*c);T(a);b=a.q;b.C=Zb;b.D=new Q(1,.6);z.u(a);
  return b},ExternalOrganization:function(a,b,c){a=a?a.Ic:NaN;if(isNaN(a)||.2>a)a=.2;var d=z.v();R(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);T(d);R(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.fb(!1);b=d.q;b.C=new Q(a/2,a/2);b.D=new Q(1-a/2,1-a/2);z.u(d);return b},ExternalProcess:function(a,b,c){a=z.v();R(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);T(a);
  R(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.fb(!1);b=a.q;b.C=new Q(.25,.25);b.D=new Q(.75,.75);z.u(a);return b},File:function(a,b,c){a=z.v();R(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);T(a);R(a,.75*b,0,!1);a.lineTo(.75*b,.25*c);a.lineTo(1*b,.25*c);a.fb(!1);b=a.q;b.C=new Q(0,.25);b.D=ic;z.u(a);return b},Interrupt:function(a,b,c){a=z.v();R(a,1*b,
  .5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(1*b,.5*c);R(a,1*b,.5*c,!1);a.lineTo(1*b,1*c);R(a,1*b,.5*c,!1);a.lineTo(1*b,0);b=a.q;b.C=new Q(0,.25);b.D=new Q(.5,.75);z.u(a);return b},InternalStorage:function(a,b,c){var d=a?a.Ic:NaN;a=a?a.gu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.1);var e=z.v();R(e,0,0,!0);e.lineTo(1*b,0);e.lineTo(1*b,1*c);e.lineTo(0,1*c);T(e);R(e,d*b,0,!1);e.lineTo(d*b,1*c);e.moveTo(0,a*c);e.lineTo(1*b,a*c);e.fb(!1);b=e.q;b.C=new Q(d,a);b.D=ic;z.u(e);return b},Junction:function(a,b,
  c){a=z.v();var d=1/Math.SQRT2,e=(1-1/Math.SQRT2)/2,g=.5*Hd;R(a,1*b,.5*c,!0);S(a,1*b,(.5+g)*c,(.5+g)*b,1*c,.5*b,1*c);S(a,(.5-g)*b,1*c,0,(.5+g)*c,0,.5*c);S(a,0,(.5-g)*c,(.5-g)*b,0,.5*b,0);S(a,(.5+g)*b,0,1*b,(.5-g)*c,1*b,.5*c);R(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.fb(!1);b=a.q;b.Xd=dj;z.u(a);return b},LinedDocument:function(a,b,c){c/=.8;a=z.v();R(a,0,.7*c,!0);a.lineTo(0,0);a.lineTo(1*b,0);a.lineTo(1*b,.7*c);S(a,.5*b,.4*c,.5*b,1*c,0,.7*c);T(a);R(a,.1*
  b,0,!1);a.lineTo(.1*b,.75*c);a.fb(!1);b=a.q;b.C=new Q(.1,0);b.D=new Q(1,.6);z.u(a);return b},LoopLimit:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=new Q(0,.25);b.D=ic;z.u(a);return b},SequentialData:"MagneticTape",MagneticTape:function(a,b,c){a=z.v();var d=.5*Hd;R(a,.5*b,1*c,!0);S(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);S(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(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.q;b.C=new Q(.15,.15);b.D=new Q(.85,.8);z.u(a);return b},ManualInput:function(a,b,c){a=z.v();R(a,1*b,0,!0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,.25*c);T(a);b=a.q;b.C=new Q(0,.25);b.D=ic;z.u(a);return b},MessageFromUser:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.7);var d=z.v();R(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);T(d);b=d.q;b.C=Zb;b.D=new Q(a,1);z.u(d);return b},
  MicroformProcessing:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.25);var d=z.v();R(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);T(d);b=d.q;b.C=new Q(0,a);b.D=new Q(1,1-a);z.u(d);return b},MicroformRecording:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=new Q(0,.25);b.D=new Q(1,.75);z.u(a);return b},MultiDocument:function(a,b,c){c/=.8;a=z.v();
  R(a,b,0,!0);a.lineTo(b,.5*c);S(a,.96*b,.47*c,.93*b,.45*c,.9*b,.44*c);a.lineTo(.9*b,.6*c);S(a,.86*b,.57*c,.83*b,.55*c,.8*b,.54*c);a.lineTo(.8*b,.7*c);S(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);T(a);R(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.fb(!1);b=a.q;b.C=new Q(0,.25);b.D=new Q(.8,.77);z.u(a);return b},MultiProcess:function(a,b,c){a=z.v();
  R(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);T(a);R(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.fb(!1);b=a.q;b.C=new Q(0,.2);b.D=new Q(.8,1);z.u(a);return b},OfflineStorage:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.1);var d=1-a,e=z.v();R(e,0,0,!0);e.lineTo(1*
  b,0);e.lineTo(.5*b,1*c);T(e);R(e,.5*a*b,a*c,!1);e.lineTo((1-.5*a)*b,a*c);e.fb(!1);b=e.q;b.C=new Q(d/4+.5*a,a);b.D=new Q(3*d/4+.5*a,a+.5*d);z.u(e);return b},OffPageConnector:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=Zb;b.D=new Q(.75,1);z.u(a);return b},Or:function(a,b,c){a=z.v();var d=.5*Hd;R(a,1*b,.5*c,!0);S(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);S(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);S(a,
  (.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);R(a,1*b,.5*c,!1);a.lineTo(0,.5*c);a.moveTo(.5*b,1*c);a.lineTo(.5*b,0);a.fb(!1);b=a.q;b.Xd=dj;z.u(a);return b},PaperTape:function(a,b,c){c/=.8;a=z.v();R(a,0,.7*c,!0);a.lineTo(0,.3*c);S(a,.5*b,.6*c,.5*b,0,1*b,.3*c);a.lineTo(1*b,.7*c);S(a,.5*b,.4*c,.5*b,1*c,0,.7*c);T(a);b=a.q;b.C=new Q(0,.49);b.D=new Q(1,.75);z.u(a);return b},PrimitiveFromCall:function(a,b,c){var d=a?a.Ic:NaN;a=a?a.gu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=z.v();R(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);T(e);b=e.q;b.C=new Q(d,0);b.D=new Q(1-a,1);z.u(e);return b},PrimitiveToCall:function(a,b,c){var d=a?a.Ic:NaN;a=a?a.gu:NaN;isNaN(d)&&(d=.1);isNaN(a)&&(a=.3);var e=z.v();R(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);T(e);b=e.q;b.C=new Q(d,0);b.D=new Q(1-a,1);z.u(e);return b},Subroutine:"Procedure",Procedure:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.1);var d=z.v();R(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,
  1*c);T(d);R(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.fb(!1);b=d.q;b.C=new Q(a,0);b.D=new Q(1-a,1);z.u(d);return b},Process:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.1);var d=z.v();R(d,0,0,!0);d.lineTo(1*b,0);d.lineTo(1*b,1*c);d.lineTo(0,1*c);T(d);R(d,a*b,0,!1);d.lineTo(a*b,1*c);d.fb(!1);b=d.q;b.C=new Q(a,0);b.D=ic;z.u(d);return b},Sort:function(a,b,c){a=z.v();R(a,.5*b,0,!0);a.lineTo(1*b,.5*c);a.lineTo(.5*b,1*c);a.lineTo(0,.5*c);T(a);R(a,0,.5*c,!1);a.lineTo(1*b,.5*
  c);a.fb(!1);b=a.q;b.C=new Q(.25,.25);b.D=new Q(.75,.5);z.u(a);return b},Start:function(a,b,c){a=z.v();R(a,.25*b,0,!0);R(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);R(a,.25*b,0,!1);a.lineTo(.25*b,1*c);a.moveTo(.75*b,0);a.lineTo(.75*b,1*c);a.fb(!1);b=a.q;b.C=new Q(.25,0);b.D=new Q(.75,1);z.u(a);return b},Terminator:function(a,b,c){a=z.v();R(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.q;b.C=new Q(.23,0);
  b.D=new Q(.77,1);z.u(a);return b},TransmittalTape:function(a,b,c){a=a?a.Ic:NaN;isNaN(a)&&(a=.1);var d=z.v();R(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);T(d);b=d.q;b.C=Zb;b.D=new Q(1,1-a);z.u(d);return b},AndGate:function(a,b,c){a=z.v();var d=.5*Hd;R(a,0,0,!0);a.lineTo(.5*b,0);S(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);a.lineTo(0,1*c);T(a);b=a.q;b.C=Zb;b.D=new Q(.55,1);z.u(a);return b},Buffer:function(a,b,c){a=z.v();R(a,
  0,0,!0);a.lineTo(1*b,.5*c);a.lineTo(0,1*c);T(a);b=a.q;b.C=new Q(0,.25);b.D=new Q(.5,.75);z.u(a);return b},Clock:function(a,b,c){a=z.v();var d=.5*Hd;R(a,1*b,.5*c,!0);S(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);S(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);R(a,1*b,.5*c,!1);a.lineTo(1*b,.5*c);R(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.fb(!1);b=a.q;b.Xd=dj;z.u(a);return b},Ground:function(a,b,c){a=z.v();R(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.q;z.u(a);return b},Inverter:function(a,b,c){a=z.v();var d=.1*Hd;R(a,.8*b,.5*c,!0);a.lineTo(0,1*c);a.lineTo(0,0);a.lineTo(.8*b,.5*c);R(a,1*b,.5*c,!0);S(a,1*b,(.5+d)*c,(.9+d)*b,.6*c,.9*b,.6*c);S(a,(.9-d)*b,.6*c,.8*b,(.5+d)*c,.8*b,.5*c);S(a,.8*b,(.5-d)*c,(.9-d)*b,.4*
  c,.9*b,.4*c);S(a,(.9+d)*b,.4*c,1*b,(.5-d)*c,1*b,.5*c);b=a.q;b.C=new Q(0,.25);b.D=new Q(.4,.75);z.u(a);return b},NandGate:function(a,b,c){a=z.v();var d=.5*Hd,e=.4*Hd,g=.1*Hd;R(a,.8*b,.5*c,!0);S(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);S(a,(.4+d)*b,0,.8*b,(.5-e)*c,.8*b,.5*c);R(a,1*b,.5*c,!0);S(a,1*b,(.5+g)*c,(.9+g)*b,.6*c,.9*b,.6*c);S(a,(.9-g)*b,.6*c,.8*b,(.5+g)*c,.8*b,.5*c);S(a,.8*b,(.5-g)*c,(.9-g)*b,.4*c,.9*b,.4*c);S(a,(.9+g)*b,.4*c,1*b,(.5-g)*c,1*b,.5*
  c);b=a.q;b.C=new Q(0,.05);b.D=new Q(.55,.95);z.u(a);return b},NorGate:function(a,b,c){a=z.v();var d=.5,e=Hd*d,g=0,h=.5;R(a,.8*b,.5*c,!0);S(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,0,1*c);S(a,.25*b,.75*c,.25*b,.25*c,0,0);S(a,(g+e)*b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Hd;g=.9;h=.5;R(a,(g-d)*b,h*c,!0);S(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);S(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);S(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);S(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C=
  new Q(.2,.25);b.D=new Q(.6,.75);z.u(a);return b},OrGate:function(a,b,c){a=z.v();var d=.5*Hd;R(a,0,0,!0);S(a,(0+d+d)*b,0*c,.8*b,(.5-d)*c,1*b,.5*c);S(a,.8*b,(.5+d)*c,(0+d+d)*b,1*c,0,1*c);S(a,.25*b,.75*c,.25*b,.25*c,0,0);T(a);b=a.q;b.C=new Q(.2,.25);b.D=new Q(.75,.75);z.u(a);return b},XnorGate:function(a,b,c){a=z.v();var d=.5,e=Hd*d,g=.2,h=.5;R(a,.1*b,0,!1);S(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);R(a,.8*b,.5*c,!0);S(a,.7*b,(h+e)*c,(g+e)*b,(h+d)*c,.2*b,1*c);S(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);S(a,(g+e)*
  b,(h-d)*c,.7*b,(h-e)*c,.8*b,.5*c);d=.1;e=.1*Hd;g=.9;h=.5;R(a,(g-d)*b,h*c,!0);S(a,(g-d)*b,(h-e)*c,(g-e)*b,(h-d)*c,g*b,(h-d)*c);S(a,(g+e)*b,(h-d)*c,(g+d)*b,(h-e)*c,(g+d)*b,h*c);S(a,(g+d)*b,(h+e)*c,(g+e)*b,(h+d)*c,g*b,(h+d)*c);S(a,(g-e)*b,(h+d)*c,(g-d)*b,(h+e)*c,(g-d)*b,h*c);b=a.q;b.C=new Q(.4,.25);b.D=new Q(.65,.75);z.u(a);return b},XorGate:function(a,b,c){a=z.v();var d=.5*Hd;R(a,.1*b,0,!1);S(a,.35*b,.25*c,.35*b,.75*c,.1*b,1*c);R(a,.2*b,0,!0);S(a,(.2+d)*b,0*c,.9*b,(.5-d)*c,1*b,.5*c);S(a,.9*b,(.5+d)*
  c,(.2+d)*b,1*c,.2*b,1*c);S(a,.45*b,.75*c,.45*b,.25*c,.2*b,0);T(a);b=a.q;b.C=new Q(.4,.25);b.D=new Q(.8,.75);z.u(a);return b},Capacitor:function(a,b,c){a=z.v();R(a,0,0,!1);a.lineTo(0,1*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;z.u(a);return b},Resistor:function(a,b,c){a=z.v();R(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.q;z.u(a);return b},Inductor:function(a,b,c){a=z.v();var d=.1*Hd,e=.1;R(a,(e-.5*
  d)*b,c,!1);S(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.3;S(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);S(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.5;S(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);S(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.7;S(a,(e+.1)*b,0,(e+d)*b,c,e*b,c);S(a,(e-d)*b,c,(e-.1)*b,0,(e+.1)*b,0);e=.9;S(a,(e+.1)*b,0,(e+d)*b,c,(e+.5*d)*b,c);b=a.q;z.u(a);return b},ACvoltageSource:function(a,b,c){a=z.v();var d=.5*Hd;R(a,0*b,.5*c,!1);S(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);S(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,(.5+d)*
  c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,.5*c);a.moveTo(.1*b,.5*c);S(a,.5*b,0*c,.5*b,1*c,.9*b,.5*c);b=a.q;b.Xd=dj;z.u(a);return b},DCvoltageSource:function(a,b,c){a=z.v();R(a,0,.75*c,!1);a.lineTo(0,.25*c);a.moveTo(1*b,0);a.lineTo(1*b,1*c);b=a.q;z.u(a);return b},Diode:function(a,b,c){a=z.v();R(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.q;b.C=new Q(0,.25);b.D=new Q(.5,.75);z.u(a);return b},Wifi:function(a,b,c){var d=b,e=c;
  b*=.38;c*=.6;a=z.v();var g=.8*Hd,h=.8,k=0,l=.5,d=(d-b)/2,e=(e-c)/2;R(a,k*b+d,(l+h)*c+e,!0);S(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);S(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);S(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);S(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a);g=.4*Hd;h=.4;k=.2;l=.5;R(a,k*b+d,(l+h)*c+e,!0);S(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);S(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*
  b+d,(l-h)*c+e);S(a,k*b+d,(l-h)*c+e,(k-h+.5*g)*b+d,(l-g)*c+e,(k-h+.5*g)*b+d,l*c+e);S(a,(k-h+.5*g)*b+d,(l+g)*c+e,k*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);T(a);g=.2*Hd;h=.2;l=k=.5;R(a,(k-h)*b+d,l*c+e,!0);S(a,(k-h)*b+d,(l-g)*c+e,(k-g)*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);S(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);S(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);S(a,(k-g)*b+d,(l+h)*c+e,(k-h)*b+d,(l+g)*c+e,(k-h)*b+d,l*c+e);g=.4*Hd;h=.4;k=.8;l=.5;R(a,k*b+d,(l-h)*c+e,!0);S(a,(k+g)*b+d,(l-
  h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);S(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);S(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);S(a,(k+h-.5*g)*b+d,(l-g)*c+e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);T(a);g=.8*Hd;h=.8;k=1;l=.5;R(a,k*b+d,(l-h)*c+e,!0);S(a,(k+g)*b+d,(l-h)*c+e,(k+h)*b+d,(l-g)*c+e,(k+h)*b+d,l*c+e);S(a,(k+h)*b+d,(l+g)*c+e,(k+g)*b+d,(l+h)*c+e,k*b+d,(l+h)*c+e);S(a,k*b+d,(l+h)*c+e,(k+h-.5*g)*b+d,(l+g)*c+e,(k+h-.5*g)*b+d,l*c+e);S(a,(k+h-.5*g)*b+d,(l-g)*c+
  e,k*b+d,(l-h)*c+e,k*b+d,(l-h)*c+e);T(a);b=a.q;z.u(a);return b},Email:function(a,b,c){a=z.v();R(a,0,0,!0);a.lineTo(1*b,0);a.lineTo(1*b,1*c);a.lineTo(0,1*c);a.lineTo(0,0);T(a);R(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.fb(!1);b=a.q;z.u(a);return b},Ethernet:function(a,b,c){a=z.v();R(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);T(a);R(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);T(a);R(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);T(a);R(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.fb(!1);b=a.q;z.u(a);return b},Power:function(a,b,c){a=z.v();var d=.4*Hd,e=.4,g=z.O(),h=z.O(),k=z.O(),l=z.O();xe(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);var m=z.Tb(h.x,
  h.y);R(a,h.x*b,h.y*c,!0);S(a,k.x*b,k.y*c,l.x*b,l.y*c,(.5+e)*b,.5*c);S(a,(.5+e)*b,(.5+d)*c,(.5+d)*b,(.5+e)*c,.5*b,(.5+e)*c);S(a,(.5-d)*b,(.5+e)*c,(.5-e)*b,(.5+d)*c,(.5-e)*b,.5*c);xe(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);S(a,k.x*b,k.y*c,l.x*b,l.y*c,h.x*b,h.y*c);d=.3*Hd;e=.3;xe(.5-e,.5,.5-e,.5-d,.5-d,.5-e,.5,.5-e,.5,k,l,h,g,g);a.lineTo(h.x*b,h.y*c);S(a,l.x*b,l.y*c,k.x*b,k.y*c,(.5-e)*b,.5*c);S(a,(.5-e)*b,(.5+d)*c,(.5-d)*b,(.5+e)*c,.5*b,(.5+e)*c);S(a,(.5+d)*b,(.5+e)*c,(.5+e)*b,(.5+d)*c,(.5+
  e)*b,.5*c);xe(.5,.5-e,.5+d,.5-e,.5+e,.5-d,.5+e,.5,.5,g,g,h,k,l);S(a,l.x*b,l.y*c,k.x*b,k.y*c,h.x*b,h.y*c);T(a);R(a,.45*b,0,!0);a.lineTo(.45*b,.5*c);a.lineTo(.55*b,.5*c);a.lineTo(.55*b,0);T(a);z.A(g);z.A(h);z.A(k);z.A(l);z.A(m);b=a.q;b.C=new Q(.25,.55);b.D=new Q(.75,.8);z.u(a);return b},Fallout:function(a,b,c){a=z.v();var d=.5*Hd;R(a,0*b,.5*c,!0);S(a,0*b,(.5-d)*c,(.5-d)*b,0*c,.5*b,0*c);S(a,(.5+d)*b,0*c,1*b,(.5-d)*c,1*b,.5*c);S(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0*b,(.5+d)*c,0*b,
  .5*c);var e=d=0;R(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;T(a);R(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;T(a);R(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);T(a);b=a.q;b.Xd=dj;z.u(a);return b},IrritationHazard:function(a,b,c){a=z.v();R(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);T(a);b=a.q;b.C=new Q(.3,.3);b.D=new Q(.7,.7);z.u(a);return b},ElectricalHazard:function(a,b,c){a=z.v();R(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);T(a);b=a.q;z.u(a);return b},FireHazard:function(a,b,c){a=z.v();R(a,.1*b,1*c,!0);S(a,-.25*b,.63*c,.45*b,.44*c,.29*b,0*c);S(a,.48*b,.17*c,.54*b,.35*c,.51*b,.42*c);S(a,.59*b,.29*c,.58*b,.28*c,.59*b,.18*c);S(a,.8*b,.34*c,.88*b,.43*c,.75*b,.6*c);S(a,.87*b,.48*c,.88*b,.43*c,.88*b,.31*c);S(a,1.17*b,.76*c,.82*b,.8*c,.9*b,1*c);T(a);b=a.q;b.C=new Q(.05,.645);b.D=new Q(.884,.908);z.u(a);return b},BpmnActivityLoop:function(a,b,c){a=z.v();var d=4*(Math.SQRT2-1)/3*.5;R(a,.65*b,1*c,
  !1);S(a,(1-d+0)*b,1*c,1*b,(.5+d+0)*c,1*b,.5*c);S(a,1*b,(.5-d+0)*c,(.5+d+0)*b,0*c,.5*b,0*c);S(a,(.5-d+0)*b,0*c,0*b,(.5-d+0)*c,0*b,.5*c);S(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.q;z.u(a);return b},BpmnActivityParallel:function(a,b,c){a=z.v();R(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.q;z.u(a);return b},BpmnActivitySequential:function(a,b,c){a=z.v();R(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.q;z.u(a);return b},BpmnActivityAdHoc:function(a,b,c){a=z.v();R(a,0,0,!1);R(a,1*b,1*c,!1);R(a,0,.5*c,!1);S(a,.2*b,.35*c,.3*b,.35*c,.5*b,.5*c);S(a,.7*b,.65*c,.8*b,.65*c,1*b,.5*c);b=a.q;z.u(a);return b},BpmnActivityCompensation:function(a,b,c){a=z.v();R(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);T(a);b=a.q;z.u(a);return b},BpmnTaskMessage:function(a,
  b,c){a=z.v();R(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);T(a);R(a,0,.2*c,!1);a.lineTo(.5*b,.5*c);a.lineTo(1*b,.2*c);a.fb(!1);b=a.q;z.u(a);return b},BpmnTaskScript:function(a,b,c){a=z.v();R(a,.7*b,1*c,!0);a.lineTo(.3*b,1*c);S(a,.6*b,.5*c,0,.5*c,.3*b,0);a.lineTo(.7*b,0);S(a,.4*b,.5*c,1*b,.5*c,.7*b,1*c);T(a);R(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.fb(!1);b=a.q;z.u(a);return b},
  BpmnTaskUser:function(a,b,c){a=z.v();R(a,0,0,!1);R(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);S(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);S(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,g=4*(1-Math.cos(e))/(3*Math.sin(e)),e=g*d,g=g*d;S(a,(.5-(e+d)/2)*b,(d+(d+g)/2)*c,(.5-d)*b,(d+g)*c,(.5-d)*b,d*c);S(a,(.5-d)*b,(d-g)*c,(.5-e)*b,(d-d)*c,.5*b,(d-d)*c);
  S(a,(.5+e)*b,(d-d)*c,(.5+d)*b,(d-g)*c,(.5+d)*b,d*c);S(a,(.5+d)*b,(d+g)*c,(.5+(e+d)/2)*b,(d+(d+g)/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);R(a,.2*b,1*c,!1);a.lineTo(.2*b,.8*c);R(a,.8*b,1*c,!1);a.lineTo(.8*b,.8*c);b=a.q;z.u(a);return b},BpmnEventConditional:function(a,b,c){a=z.v();R(a,.1*b,0,!0);a.lineTo(.9*b,0);a.lineTo(.9*b,1*c);a.lineTo(.1*b,1*c);T(a);R(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.fb(!1);b=a.q;z.u(a);return b},BpmnEventError:function(a,b,c){a=z.v();R(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);T(a);b=a.q;z.u(a);return b},BpmnEventEscalation:function(a,b,c){a=z.v();R(a,0,0,!1);R(a,1*b,1*c,!1);R(a,.1*b,1*c,!0);a.lineTo(.5*b,0);a.lineTo(.9*b,1*c);a.lineTo(.5*b,.5*c);T(a);b=a.q;z.u(a);return b},BpmnEventTimer:function(a,b,c){a=
  z.v();var d=.5*Hd;R(a,1*b,.5*c,!0);S(a,1*b,(.5+d)*c,(.5+d)*b,1*c,.5*b,1*c);S(a,(.5-d)*b,1*c,0,(.5+d)*c,0,.5*c);S(a,0,(.5-d)*c,(.5-d)*b,0,.5*b,0);S(a,(.5+d)*b,0,1*b,(.5-d)*c,1*b,.5*c);R(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.fb(!1);b=a.q;b.Xd=dj;z.u(a);return b}},ip;for(ip in wo)wo[ip.toLowerCase()]=ip;
  var jp={"":"",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 Ao(a){if(null!==jp){for(var b in jp){var c=sf(jp[b],!1);ke[b]=c;b.toLowerCase()!==b&&(ke[b.toLowerCase()]=b)}jp=null}b=ke[a];if(void 0===b){b=a.toLowerCase();if("none"===b)return"None";b=ke[b]}return"string"===typeof b?b:b instanceof hf?a:null}
  function D(a){0===arguments.length?I.call(this):I.call(this,a);this.U=311807;this.dl=this.ti="";this.ss=this.ps=this.Cs=this.xr=null;this.Es="";this.Xg=this.Ds=this.Gm=null;this.rs="";this.Ho=null;this.qs=fe;this.ts="";this.Io=null;this.xe="";this.Gv=this.Aq=this.Pk=null;this.Li=(new N(NaN,NaN)).freeze();this.Cr="";this.hl=null;this.Dr=Zb;this.Mr=Nd;this.Fr=Od;this.Tq=null;this.yr=kp;this.Im=Md;this.Hm="gray";this.Ag=4;this.AC=-1;this.et=NaN;this.nG=new w;this.jl=null;this.Rj=NaN}z.Ra(D,I);
  z.ia("Part",D);D.prototype.cloneProtected=function(a){I.prototype.cloneProtected.call(this,a);a.U=this.U&-4097|49152;a.ti=this.ti;a.dl=this.dl;a.xr=this.xr;a.Cs=this.Cs;a.ps=this.ps;a.ss=this.ss;a.Es=this.Es;a.Ds=this.Ds;a.Xg=null;a.rs=this.rs;a.qs=this.qs.V();a.ts=this.ts;a.xe=this.xe;a.Aq=this.Aq;a.Li.assign(this.Li);a.Cr=this.Cr;a.Dr=this.Dr.V();a.Mr=this.Mr.V();a.Fr=this.Fr.V();a.Tq=this.Tq;a.yr=this.yr;a.Im=this.Im.V();a.Hm=this.Hm;a.Ag=this.Ag;a.et=this.et};
  D.prototype.ki=function(a){I.prototype.ki.call(this,a);a.Nl();a.Gm=null;a.Ho=null;a.Io=null;a.hl=null;a.jl=null};D.prototype.toString=function(){var a=z.kf(Object.getPrototypeOf(this))+"#"+z.nd(this);null!==this.data&&(a+="("+ka(this.data)+")");return a};D.LayoutNone=0;var vl;D.LayoutAdded=vl=1;var Dl;D.LayoutRemoved=Dl=2;D.LayoutShown=4;D.LayoutHidden=8;D.LayoutNodeSized=16;var gm;D.LayoutGroupLayout=gm=32;D.LayoutNodeReplaced=64;var kp;D.LayoutStandard=kp=vl|Dl|28|gm|64;D.LayoutAll=16777215;
  D.prototype.sn=function(a,b,c,d,e,g,h){var k=this.h;null!==k&&(a===Wf&&"elements"===b?e instanceof I?wl(e,function(a){yl(k,a);xl(k,a)}):e instanceof wk&&Tl(k,e):a===Xf&&"elements"===b&&(e instanceof I?wl(e,function(a){Cl(k,a);Bl(k,a)}):e instanceof wk&&Ul(k,e)),k.Rc(a,b,c,d,e,g,h))};D.prototype.updateTargetBindings=D.prototype.Mb=function(a){I.prototype.Mb.call(this,a);if(null!==this.data){a=this.va.o;for(var b=a.length,c=0;c<b;c++){var d=a[c];d instanceof I&&wl(d,function(a){null!==a.data&&a.Mb()})}}};
  D.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.ha;if(c instanceof V){var d=c.en(a),b=b.GH(d),e=this.Qa;b!==e&&(b=null!==e?c.pb(e.data):void 0,e=c.Pp,"function"===typeof e?e(a,b):a[e]=b,c.Nx(a,d))}}}};z.w(D,{Ew:"adornments"},function(){return null===this.Xg?Pa:this.Xg.UE});D.prototype.findAdornment=D.prototype.kp=function(a){u&&z.g(a,"string",D,"findAdornment:category");var b=this.Xg;return null===b?null:b.na(a)};
  D.prototype.addAdornment=D.prototype.rl=function(a,b){if(null!==b){u&&(z.g(a,"string",D,"addAdornment:category"),z.l(b,da,D,"addAdornment:ad"));var c=null,d=this.Xg;null!==d&&(c=d.na(a));if(c!==b){if(null!==c){var e=c.h;null!==e&&e.remove(c)}null===d&&(this.Xg=d=new na("string",da));b.ti!==a&&(b.nc=a);d.add(a,b);c=this.h;null!==c&&(c.add(b),b.data=this.data)}}};
  D.prototype.removeAdornment=D.prototype.sj=function(a){u&&z.g(a,"string",D,"removeAdornment:category");var b=this.Xg;if(null!==b){var c=b.na(a);if(null!==c){var d=c.h;null!==d&&d.remove(c)}b.remove(a);0===b.count&&(this.Xg=null)}};D.prototype.clearAdornments=D.prototype.pt=function(){var a=this.Xg;if(null!==a){for(var b=z.rb(),a=a.i;a.next();)b.push(a.key);for(var a=b.length,c=0;c<a;c++)this.sj(b[c]);z.xa(b)}};
  D.prototype.updateAdornments=function(){var a=this.h;if(null!==a){a:{if(this.jb&&this.FF){var b=this.un;if(!(null!==b&&this.W.F()&&this.isVisible()&&b.oj()&&b.W.F()))break a;var c=this.kp("Selection");if(null===c){c=this.fJ;null===c&&(c=this instanceof G?a.vI:this instanceof F?a.SH:a.LI);if(!(c instanceof da))break a;jh(c);c=c.copy();null!==c&&(c.nc="Selection",c.fc=b)}if(null!==c){var d=c.placeholder;if(null!==d){var e=b.hj(),g=0;b instanceof X&&(g=b.ub);var h=z.Xl();h.n((b.Ga.width+g)*e,(b.Ga.height+
  g)*e);d.Aa=h;z.qk(h)}c.angle=b.Kl();c.type!==Ni&&(d=z.O(),c.location=b.eb(Zb,d),z.A(d));this.rl("Selection",c);break a}}this.sj("Selection")}lp(this,a);for(a=this.Ew;a.next();)b=a.value,b.Mb(),b.Q()}};function lp(a,b){b.gb.Ye.each(function(b){b.isEnabled&&b.updateAdornments(a)});b.gb.updateAdornments(a)}z.w(D,{layer:"layer"},function(){return this.Gv});z.w(D,{h:"diagram"},function(){var a=this.Gv;return null!==a?a.h:null});
  z.defineProperty(D,{If:"layerName"},function(){return this.dl},function(a){var b=this.dl;if(b!==a){z.g(a,"string",D,"layerName");var c=this.h;if(null===c||null!==c.Gl(a)&&!c.lq)if(this.dl=a,null!==c&&c.yc(),this.j("layerName",b,a),b=this.layer,null!==b&&b.name!==a&&(c=b.h,null!==c&&(a=c.Gl(a),null!==a&&a!==b))){var d=b.Ve(-1,this,!0);0<=d&&c.Rc(Xf,"parts",b,this,null,d,!0);b.visible!==a.visible&&this.xd(a.visible);d=a.xp(99999999,this,!0);0<=d&&c.Rc(Wf,"parts",a,null,this,!0,d);d=this.Ut;if(null!==
  d){var e=c.$a;c.$a=!0;d(this,b,a);c.$a=e}}}});z.defineProperty(D,{Ut:"layerChanged"},function(){return this.xr},function(a){var b=this.xr;b!==a&&(null!==a&&z.g(a,"function",D,"layerChanged"),this.xr=a,this.j("layerChanged",b,a))});z.defineProperty(D,{Dn:"zOrder"},function(){return this.et},function(a){var b=this.et;if(b!==a){z.g(a,"number",D,"zOrder");this.et=a;var c=this.layer;null!==c&&nk(c,-1,this);this.j("zOrder",b,a);a=this.h;null!==a&&a.ta()}});
  D.prototype.invalidateAdornments=D.prototype.ae=function(){var a=this.h;null!==a&&(Jk(a),0!==(this.U&16384)!==!0&&(this.U|=16384,a.Ce()))};function jk(a){0!==(a.U&16384)!==!1&&(a.updateAdornments(),a.U&=-16385)}function cn(a){if(!1===ol(a)){var b=a.h;null!==b&&(b.rg.add(a),a instanceof E&&!b.pa.qb&&a.mf(),b.Ce());mp(a,!0);a.Gi()}}function np(a){if(!1!==ol(a)){var b=a.position,c=a.location;c.F()&&b.F()||op(a,b,c);var c=a.Xb,d=c.copy();c.Wa();c.x=b.x;c.y=b.y;c.freeze();a.xx(d,c);mp(a,!1)}}
  z.w(D,{Zb:"locationObject"},function(){if(null===this.hl){var a=this.ux;""!==a?(a=this.oe(a),this.hl=null!==a?a:this):this.hl=this instanceof da?this.type!==Ni&&null!==this.placeholder?this.placeholder:this:this}return this.hl.visible?this.hl:this});z.defineProperty(D,{FI:"minLocation"},function(){return this.Mr},function(a){var b=this.Mr;b.N(a)||(u&&z.l(a,N,D,"minLocation"),this.Mr=a=a.V(),this.j("minLocation",b,a))});
  z.defineProperty(D,{AI:"maxLocation"},function(){return this.Fr},function(a){var b=this.Fr;b.N(a)||(u&&z.l(a,N,D,"maxLocation"),this.Fr=a=a.V(),this.j("maxLocation",b,a))});z.defineProperty(D,{ux:"locationObjectName"},function(){return this.Cr},function(a){var b=this.Cr;b!==a&&(u&&z.g(a,"string",D,"locationObjectName"),this.Cr=a,this.hl=null,Ym(this),this.j("locationObjectName",b,a))});
  z.defineProperty(D,{of:"locationSpot"},function(){return this.Dr},function(a){var b=this.Dr;b.N(a)||(u&&(z.l(a,Q,D,"locationSpot"),a.cd()||z.k("Part.locationSpot must be a specific Spot value, not: "+a)),this.Dr=a=a.V(),Ym(this),this.j("locationSpot",b,a))});D.prototype.move=function(a){this.position=a};D.prototype.moveTo=D.prototype.moveTo=function(a,b){var c=z.Tb(a,b);this.move(c);z.A(c)};
  D.prototype.isVisible=function(){if(!this.visible)return!1;var a=this.layer;if(null!==a&&!a.visible)return!1;a=this.h;if(null!==a&&(a=a.Va,a.nf&&(a=a.xm.na(this),null!==a&&a.Ex)))return!0;a=this.Qa;return null===a||a.se&&a.isVisible()?!0:!1};D.prototype.xd=function(a){var b=this.h;a?(this.I(4),this.ae(),null!==b&&b.rg.add(this)):(this.I(8),this.pt());this.Nl();null!==b&&(b.yc(),b.ta())};
  D.prototype.findObject=D.prototype.oe=function(a){if(this.name===a)return this;var b=this.jl;null===b&&(this.jl=b=new ma);if(void 0!==b[a])return b[a];for(var c=this.va.o,d=c.length,e=0;e<d;e++){var g=c[e];if(g.name===a)return b[a]=g;if(g instanceof I)if(null===g.Ji&&null===g.tg){if(g=g.oe(a),null!==g)return b[a]=g}else if(Rl(g)&&(g=g.va.first(),null!==g&&g.name===a))return b[a]=g}return b[a]=null};
  function pp(a,b,c,d){void 0===d&&(d=new N);c=c.Be()?ec:c;var e=b.Ga;d.n(e.width*c.x+c.offsetX,e.height*c.y+c.offsetY);if(null===b||b===a)return d;b.transform.Cb(d);for(b=b.T;null!==b&&b!==a;)b.transform.Cb(d),b=b.T;a.gl.Cb(d);d.offset(-a.vd.x,-a.vd.y);return d}D.prototype.ensureBounds=D.prototype.Bf=function(){tj(this,Infinity,Infinity);this.Lc()};
  function mk(a,b){var c=a.nG,d;isNaN(a.Rj)&&(a.Rj=no(a));d=a.Rj;var e=2*d;if(!a.tk)return c.n(b.x-1-d,b.y-1-d,b.width+2+e,b.height+2+e),c;d=b.x;var e=b.y,g=b.width,h=b.height,k=a.shadowBlur,l=a.kJ,g=g+k,h=h+k;d-=k/2;e-=k/2;0<l.x?g+=l.x:(d+=l.x,g-=l.x);0<l.y?h+=l.y:(e+=l.y,h-=l.y);c.n(d-1,e-1,g+2,h+2);return c}
  D.prototype.Lc=function(){this.Gi();if(!1===nl(this))np(this);else{var a=this.Xb,b=z.lg();b.assign(a);a.Wa();var c=ik(this);this.aj(0,0,this.vd.width,this.vd.height);var d=this.position;op(this,d,this.location);a.x=d.x;a.y=d.y;a.freeze();this.xx(b,a);Om(this,!1);b.N(a)?this.Jf(c):!this.be()||eb(b.width,a.width)&&eb(b.height,a.height)||0<=this.AC&&this.I(16);z.dc(b);mp(this,!1)}};
  D.prototype.xx=function(a,b){var c=this.h;if(null!==c){var d=!1;if(!1===c.Jj&&a.F()){var e=c.ad,g=c.padding,h=e.x+g.left,k=e.y+g.top,l=e.width-2*g.right,e=e.height-2*g.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.U&65536)!==!0&&a.N(b)||zl(this,d,c);c.ta();a.N(b)||this.Nl()}};
  z.defineProperty(D,{location:"location"},function(){return this.Li},function(a){var b=this.Li;if(!b.N(a)){u&&z.l(a,N,D,"location");a=a.V();var c;c=a;if(this instanceof G)c=!1;else{this.Li=c;if(!1===nl(this)){cn(this);var d=this.sb;if(d.F()){var e=d.copy();d.n(d.x+(c.x-b.x),d.y+(c.y-b.y));qp(this,this.h,d,e);this.j("position",e,d)}}c=!0}c&&this.j("location",b,a)}});
  D.prototype.RA=function(a,b){if(this instanceof G||!a.F())return!1;var c=this.h;if(null!==c&&(qp(this,c,a,b),!0===c.pa.qb))return!0;this.sb=a;c=this.Li;if(c.F()){var d=c.copy();c.n(c.x+(a.x-b.x),c.y+(a.y-b.y));this.j("location",d,c)}!1===ol(this)&&!1===nl(this)&&(cn(this),np(this));return!0};function qp(a,b,c,d){null===b||a instanceof da||(b=b.Va,b.wc&&Wj(b,a,"position",d.copy(),c.copy(),!1))}
  D.prototype.Px=function(a,b){var c=this.Li,d=this.sb;ol(this)||nl(this)?c.n(NaN,NaN):c.n(c.x+a-d.x,c.y+b-d.y);d.n(a,b);cn(this)};
  function op(a,b,c){var d=z.O(),e=a.of,g=a.Zb;e.Be()&&z.k("determineOffset: Part's locationSpot must be real: "+e.toString());var h=g.Ga,k=g instanceof X?g.ub:0;d.tu(0,0,h.width+k,h.height+k,e);if(g!==a)for(d.offset(-k/2,-k/2),g.transform.Cb(d),e=g.T;null!==e&&e!==a;)e.transform.Cb(d),e=e.T;a.gl.Cb(d);d.offset(-a.vd.x,-a.vd.y);e=a.h;c.F()?(g=b.x,h=b.y,b.n(c.x-d.x,c.y-d.y),null!==e&&(c=e.Va,(k=c.Kj)||!c.wc||a instanceof da||Wj(c,a,"position",new N(g,h),b,!1),k||b.x===g&&b.y===h||(k=e.Bb,e.Bb=!0,a.j("position",
  new N(g,h),b),e.Bb=k))):b.F()&&(g=c.copy(),c.n(b.x+d.x,b.y+d.y),c.N(g)||null===e||(k=e.Bb,e.Bb=!0,a.j("location",g,c),e.Bb=k));z.A(d);a.Gi()}function zl(a,b,c){Pm(a,!1);a instanceof E&&nm(c,a);a.layer.Nc||b||c.yc();b=a.Xb;var d=c.xb;d.F()?(ik(a)?Gb(b,d)||a.Jf(!1):b.Jg(d)&&a.Jf(!0),a.updateAdornments()):c.Zk=!0}D.prototype.Ql=function(){return!0};
  function kk(a,b){var c=a.Xb;if(0!==c.width&&0!==c.height&&!isNaN(c.x)&&!isNaN(c.y)&&a.isVisible()){var d=a.transform;null!==a.uc&&(Um(a,b,a.uc,!0,!0),b.fillRect(c.x,c.y,c.width,c.height));null===a.uc&&null===a.Nb&&(Um(a,b,"rgba(0,0,0,0.4)",!0,!1),b.fillRect(c.x,c.y,c.width,c.height));null!==a.Nb&&(d.Pt()||b.transform(d.m11,d.m12,d.m21,d.m22,d.dx,d.dy),c=a.Ga,Um(a,b,a.Nb,!0,!1),b.fillRect(0,0,c.width,c.height),d.Pt()||(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))))}}D.prototype.be=function(){return!0};
  z.defineProperty(D,{nc:"category"},function(){return this.ti},function(a){var b=this.ti;if(b!==a){z.g(a,"string",D,"category");var c=this.h,d=this.data,e=null;if(null!==c&&null!==d&&!(this instanceof da)){var g=c.ha.pa;g.isEnabled&&!g.qb&&(e=this.clone(),e.va.$c(this.va))}this.ti=a;this.j("category",b,a);null===c||null===d||this instanceof da?(e=this.Xf,null!==e&&(a=e.Xg,null!==a&&a.remove(b),e.rl(this.nc,this))):(g=c.ha,g.pa.qb||(this instanceof G?(g instanceof V?g.HF(d,a):g instanceof qg&&g.iJ(d,
  a),c=am(c,a),null!==c&&(jh(c),c=c.copy(),null!==c&&rp(this,c,b,a))):(null!==g&&g.Lx(d,a),c=Yl(c,d,a),null!==c&&(jh(c),c=c.copy(),null===c||c instanceof G||(c.location=this.location,rp(this,c,b,a)))),null!==e&&(b=this.clone(),b.va.$c(this.va),this.j("self",e,b))))}});z.defineProperty(D,{self:"self"},function(){return this},function(a){rp(this,a,this.nc,a.nc)});var sp=!1;
  function rp(a,b,c,d){b.constructor===a.constructor||sp||(sp=!0,z.trace('Should not change the class of the Part when changing category from "'+c+'" to "'+d+'"'),z.trace("  Old class: "+z.kf(a)+", new class: "+z.kf(b)+", part: "+a.toString()));a.pt();var e=a.data;c=a.If;var g=a.jb,h=a.yh,k=!0,l=!0,m=!1;if(a instanceof E)var n=a,k=n.nj,l=n.wd,m=n.Cu;b.ki(a);b.cloneProtected(a);a.ti=d;a.Q();a.ta();b=a.h;d=!0;null!==b&&(d=b.Bb,b.Bb=!0);a.fe=e;null!==e&&a.Mb();null!==b&&(b.Bb=d);e=a.If;e!==c&&(a.dl=c,
  a.If=e);a instanceof E&&(n=a,n.nj=k,n.wd=l,n.Cu=m,n.be()&&n.I(64));a.jb=g;a.yh=h}D.prototype.canCopy=function(){if(!this.ZD)return!1;var a=this.layer;if(null===a)return!0;if(!a.lk)return!1;a=a.h;return null===a?!0:a.lk?!0:!1};D.prototype.canDelete=function(){if(!this.cE)return!1;var a=this.layer;if(null===a)return!0;if(!a.Rm)return!1;a=a.h;return null===a?!0:a.Rm?!0:!1};
  D.prototype.canEdit=function(){if(!this.QF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Iw)return!1;a=a.h;return null===a?!0:a.Iw?!0:!1};D.prototype.canGroup=function(){if(!this.BE)return!1;var a=this.layer;if(null===a)return!0;if(!a.Fw)return!1;a=a.h;return null===a?!0:a.Fw?!0:!1};D.prototype.canMove=function(){if(!this.cF)return!1;var a=this.layer;if(null===a)return!0;if(!a.vl)return!1;a=a.h;return null===a?!0:a.vl?!0:!1};
  D.prototype.canReshape=function(){if(!this.rF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Gw)return!1;a=a.h;return null===a?!0:a.Gw?!0:!1};D.prototype.canResize=function(){if(!this.sF)return!1;var a=this.layer;if(null===a)return!0;if(!a.mt)return!1;a=a.h;return null===a?!0:a.mt?!0:!1};D.prototype.canRotate=function(){if(!this.xF)return!1;var a=this.layer;if(null===a)return!0;if(!a.Hw)return!1;a=a.h;return null===a?!0:a.Hw?!0:!1};
  D.prototype.canSelect=function(){if(!this.wk)return!1;var a=this.layer;if(null===a)return!0;if(!a.xf)return!1;a=a.h;return null===a?!0:a.xf?!0:!1};z.defineProperty(D,{ZD:"copyable"},function(){return 0!==(this.U&1)},function(a){var b=0!==(this.U&1);b!==a&&(u&&z.g(a,"boolean",D,"copyable"),this.U^=1,this.j("copyable",b,a))});
  z.defineProperty(D,{cE:"deletable"},function(){return 0!==(this.U&2)},function(a){var b=0!==(this.U&2);b!==a&&(u&&z.g(a,"boolean",D,"deletable"),this.U^=2,this.j("deletable",b,a))});z.defineProperty(D,{QF:"textEditable"},function(){return 0!==(this.U&4)},function(a){var b=0!==(this.U&4);b!==a&&(u&&z.g(a,"boolean",D,"textEditable"),this.U^=4,this.j("textEditable",b,a),this.ae())});
  z.defineProperty(D,{BE:"groupable"},function(){return 0!==(this.U&8)},function(a){var b=0!==(this.U&8);b!==a&&(u&&z.g(a,"boolean",D,"groupable"),this.U^=8,this.j("groupable",b,a))});z.defineProperty(D,{cF:"movable"},function(){return 0!==(this.U&16)},function(a){var b=0!==(this.U&16);b!==a&&(u&&z.g(a,"boolean",D,"movable"),this.U^=16,this.j("movable",b,a))});
  z.defineProperty(D,{FF:"selectionAdorned"},function(){return 0!==(this.U&32)},function(a){var b=0!==(this.U&32);b!==a&&(u&&z.g(a,"boolean",D,"selectionAdorned"),this.U^=32,this.j("selectionAdorned",b,a),this.ae())});z.defineProperty(D,{lx:"isInDocumentBounds"},function(){return 0!==(this.U&64)},function(a){var b=0!==(this.U&64);if(b!==a){u&&z.g(a,"boolean",D,"isInDocumentBounds");this.U^=64;var c=this.h;null!==c&&c.yc();this.j("isInDocumentBounds",b,a)}});
  z.defineProperty(D,{jA:"isLayoutPositioned"},function(){return 0!==(this.U&128)},function(a){var b=0!==(this.U&128);b!==a&&(u&&z.g(a,"boolean",D,"isLayoutPositioned"),this.U^=128,this.j("isLayoutPositioned",b,a),this.I(a?4:8))});z.defineProperty(D,{wk:"selectable"},function(){return 0!==(this.U&256)},function(a){var b=0!==(this.U&256);b!==a&&(u&&z.g(a,"boolean",D,"selectable"),this.U^=256,this.j("selectable",b,a),this.ae())});
  z.defineProperty(D,{rF:"reshapable"},function(){return 0!==(this.U&512)},function(a){var b=0!==(this.U&512);b!==a&&(u&&z.g(a,"boolean",D,"reshapable"),this.U^=512,this.j("reshapable",b,a),this.ae())});z.defineProperty(D,{sF:"resizable"},function(){return 0!==(this.U&1024)},function(a){var b=0!==(this.U&1024);b!==a&&(u&&z.g(a,"boolean",D,"resizable"),this.U^=1024,this.j("resizable",b,a),this.ae())});
  z.defineProperty(D,{xF:"rotatable"},function(){return 0!==(this.U&2048)},function(a){var b=0!==(this.U&2048);b!==a&&(u&&z.g(a,"boolean",D,"rotatable"),this.U^=2048,this.j("rotatable",b,a),this.ae())});
  z.defineProperty(D,{jb:"isSelected"},function(){return 0!==(this.U&4096)},function(a){var b=0!==(this.U&4096);if(b!==a){u&&z.g(a,"boolean",D,"isSelected");var c=this.h;if(!a||this.canSelect()&&!(null!==c&&c.selection.count>=c.BI)){this.U^=4096;var d=!1;if(null!==c){d=c.Bb;c.Bb=!0;var e=c.selection;e.Wa();a?e.add(this):e.remove(this);e.freeze()}this.j("isSelected",b,a);this.ae();a=this.gJ;null!==a&&a(this);null!==c&&(c.Ce(),c.Bb=d)}}});
  z.defineProperty(D,{yh:"isHighlighted"},function(){return 0!==(this.U&524288)},function(a){var b=0!==(this.U&524288);if(b!==a){u&&z.g(a,"boolean",D,"isHighlighted");this.U^=524288;var c=this.h;null!==c&&(c=c.gn,c.Wa(),a?c.add(this):c.remove(this),c.freeze());this.j("isHighlighted",b,a);this.ta()}});z.defineProperty(D,{tk:"isShadowed"},function(){return 0!==(this.U&8192)},function(a){var b=0!==(this.U&8192);b!==a&&(u&&z.g(a,"boolean",D,"isShadowed"),this.U^=8192,this.j("isShadowed",b,a),this.ta())});
  function ol(a){return 0!==(a.U&32768)}function mp(a,b){a.U=b?a.U|32768:a.U&-32769}function Pm(a,b){a.U=b?a.U|65536:a.U&-65537}function ik(a){return 0!==(a.U&131072)}D.prototype.Jf=function(a){this.U=a?this.U|131072:this.U&-131073};function tp(a,b){a.U=b?a.U|1048576:a.U&-1048577}z.defineProperty(D,{HE:"isAnimated"},function(){return 0!==(this.U&262144)},function(a){var b=0!==(this.U&262144);b!==a&&(u&&z.g(a,"boolean",D,"isAnimated"),this.U^=262144,this.j("isAnimated",b,a))});
  z.defineProperty(D,{Kx:"selectionObjectName"},function(){return this.Es},function(a){var b=this.Es;b!==a&&(u&&z.g(a,"string",D,"selectionObjectName"),this.Es=a,this.Gm=null,this.j("selectionObjectName",b,a))});z.defineProperty(D,{fJ:"selectionAdornmentTemplate"},function(){return this.Cs},function(a){var b=this.Cs;b!==a&&(u&&z.l(a,da,D,"selectionAdornmentTemplate"),this instanceof G&&(a.type=Ni),this.Cs=a,this.j("selectionAdornmentTemplate",b,a))});
  z.w(D,{un:"selectionObject"},function(){if(null===this.Gm){var a=this.Kx;null!==a&&""!==a?(a=this.oe(a),this.Gm=null!==a?a:this):this instanceof G?(a=this.path,this.Gm=null!==a?a:this):this.Gm=this}return this.Gm});z.defineProperty(D,{gJ:"selectionChanged"},function(){return this.Ds},function(a){var b=this.Ds;b!==a&&(null!==a&&z.g(a,"function",D,"selectionChanged"),this.Ds=a,this.j("selectionChanged",b,a))});
  z.defineProperty(D,{tF:"resizeAdornmentTemplate"},function(){return this.ps},function(a){var b=this.ps;b!==a&&(u&&z.l(a,da,D,"resizeAdornmentTemplate"),this.ps=a,this.j("resizeAdornmentTemplate",b,a))});z.defineProperty(D,{vF:"resizeObjectName"},function(){return this.rs},function(a){var b=this.rs;b!==a&&(u&&z.g(a,"string",D,"resizeObjectName"),this.rs=a,this.Ho=null,this.j("resizeObjectName",b,a))});
  z.w(D,{uF:"resizeObject"},function(){if(null===this.Ho){var a=this.vF;null!==a&&""!==a?(a=this.oe(a),this.Ho=null!==a?a:this):this.Ho=this}return this.Ho});z.defineProperty(D,{YI:"resizeCellSize"},function(){return this.qs},function(a){var b=this.qs;b.N(a)||(u&&z.l(a,Ea,D,"resizeCellSize"),this.qs=a=a.V(),this.j("resizeCellSize",b,a))});
  z.defineProperty(D,{$I:"rotateAdornmentTemplate"},function(){return this.ss},function(a){var b=this.ss;b!==a&&(u&&z.l(a,da,D,"rotateAdornmentTemplate"),this.ss=a,this.j("rotateAdornmentTemplate",b,a))});z.defineProperty(D,{aJ:"rotateObjectName"},function(){return this.ts},function(a){var b=this.ts;b!==a&&(u&&z.g(a,"string",D,"rotateObjectName"),this.ts=a,this.Io=null,this.j("rotateObjectName",b,a))});
  z.w(D,{yF:"rotateObject"},function(){if(null===this.Io){var a=this.aJ;null!==a&&""!==a?(a=this.oe(a),this.Io=null!==a?a:this):this.Io=this}return this.Io});z.defineProperty(D,{text:"text"},function(){return this.xe},function(a){var b=this.xe;b!==a&&(u&&z.g(a,"string",D,"text"),this.xe=a,this.j("text",b,a))});
  z.defineProperty(D,{Qa:"containingGroup"},function(){return this.Pk},function(a){if(this.be()){var b=this.Pk;if(b!==a){u&&null!==a&&z.l(a,F,D,"containingGroup");null===a||this!==a&&!a.mi(this)||(this===a&&z.k("Cannot make a Group a member of itself: "+this.toString()),z.k("Cannot make a Group indirectly contain itself: "+this.toString()+" already contains "+a.toString()));this.I(Dl);var c=this.h;null!==b?up(b,this):this instanceof F&&null!==c&&c.pl.remove(this);this.Pk=a;null!==a?vp(a,this):this instanceof
  F&&null!==c&&c.pl.add(this);this.I(vl);if(null!==c){var d=this.data,e=c.ha;null!==d&&e instanceof V&&e.Nx(d,e.pb(null!==a?a.data:null))}d=this.VD;null!==d&&(e=!0,null!==c&&(e=c.$a,c.$a=!0),d(this,b,a),null!==c&&(c.$a=e));if(this instanceof F)for(c=new K(D),hh(c,this,!0,0,!0),c=c.i;c.next();)if(d=c.value,d instanceof E)for(d=d.ee;d.next();)Wl(d.value);if(this instanceof E)for(d=this.ee;d.next();)Wl(d.value);this.j("containingGroup",b,a);null!==a&&(b=a.layer,null!==b&&nk(b,-1,a))}}else z.k("cannot set the Part.containingGroup of a Link or Adornment")});
  f=D.prototype;f.Nl=function(){var a=this.Qa;null!==a&&(a.Q(),null!==a.Lb&&a.Lb.Q(),a.mf())};f.ta=function(){var a=this.h;null!==a&&!nl(this)&&!ol(this)&&this.isVisible()&&this.Xb.F()&&a.ta(mk(this,this.Xb))};f.Kt=function(a){a||(a=this.Pk,null!==a&&vp(a,this))};f.Lt=function(a){a||(a=this.Pk,null!==a&&up(a,this))};f.bn=function(){var a=this.data;if(null!==a){var b=this.h;null!==b&&(b=b.ha,null!==b&&b.Gx(a))}};
  z.defineProperty(D,{VD:"containingGroupChanged"},function(){return this.Aq},function(a){var b=this.Aq;b!==a&&(null!==a&&z.g(a,"function",D,"containingGroupChanged"),this.Aq=a,this.j("containingGroupChanged",b,a))});D.prototype.findSubGraphLevel=function(){return wp(this,this)};function wp(a,b){var c=b.Qa;return null!==c?1+wp(a,c):b instanceof E&&(c=b.od,null!==c)?wp(a,c):0}D.prototype.findTopLevelPart=function(){return xp(this,this)};
  function xp(a,b){var c=b.Qa;return null!==c?xp(a,c):b instanceof E&&(c=b.od,null!==c)?xp(a,c):b}z.w(D,{Bp:"isTopLevel"},function(){return null!==this.Qa||this instanceof E&&this.Df?!1:!0});D.prototype.isMemberOf=D.prototype.mi=function(a){return a instanceof F?yp(this,this,a):!1};function yp(a,b,c){if(b===c||null===c)return!1;var d=b.Qa;return null===d||d!==c&&!yp(a,d,c)?b instanceof E&&(b=b.od,null!==b)?yp(a,b,c):!1:!0}
  D.prototype.findCommonContainingGroup=D.prototype.CH=function(a){if(null===a)return null;u&&z.l(a,D,D,"findCommonContainingGroup:other");if(this===a)return this.Qa;for(var b=this;null!==b;)b instanceof F&&tp(b,!0),b=b.Qa;for(var c=null,b=a;null!==b;){if(0!==(b.U&1048576)){c=b;break}b=b.Qa}for(b=this;null!==b;)b instanceof F&&tp(b,!1),b=b.Qa;return c};
  z.defineProperty(D,{qI:"layoutConditions"},function(){return this.yr},function(a){var b=this.yr;b!==a&&(u&&z.g(a,"number",D,"layoutConditions"),this.yr=a,this.j("layoutConditions",b,a))});D.prototype.canLayout=function(){if(!this.jA||!this.isVisible())return!1;var a=this.layer;return null!==a&&a.Nc||this instanceof E&&this.Df?!1:!0};
  D.prototype.invalidateLayout=D.prototype.I=function(a){void 0===a&&(a=16777215);var b;this.jA&&0!==(a&this.qI)?(b=this.layer,null!==b&&b.Nc||this instanceof E&&this.Df?b=!1:(b=this.h,b=null!==b&&b.pa.qb?!1:!0)):b=!1;if(b)if(b=this.Pk,null!==b){var c=b.Sb;null!==c?c.I():b.I(a)}else a=this.h,null!==a&&(c=a.Sb,null!==c&&c.I())};function Al(a){if(!a.isVisible())return!1;a=a.layer;return null!==a&&a.Nc?!1:!0}
  z.defineProperty(D,{hE:"dragComputation"},function(){return this.Tq},function(a){var b=this.Tq;b!==a&&(null!==a&&z.g(a,"function",D,"dragComputation"),this.Tq=a,this.j("dragComputation",b,a))});z.defineProperty(D,{kJ:"shadowOffset"},function(){return this.Im},function(a){var b=this.Im;b.N(a)||(u&&z.l(a,N,D,"shadowOffset"),this.Im=a=a.V(),this.ta(),this.j("shadowOffset",b,a))});
  z.defineProperty(D,{shadowColor:"shadowColor"},function(){return this.Hm},function(a){var b=this.Hm;b!==a&&(u&&z.g(a,"string",D,"shadowColor"),this.Hm=a,this.ta(),this.j("shadowColor",b,a))});z.defineProperty(D,{shadowBlur:"shadowBlur"},function(){return this.Ag},function(a){var b=this.Ag;b!==a&&(u&&z.g(a,"number",D,"shadowBlur"),this.Ag=a,this.ta(),this.j("shadowBlur",b,a))});
  function da(a){0===arguments.length?D.call(this,gj):D.call(this,a);this.U&=-257;this.dl="Adornment";this.Lb=this.$g=this.Ib=null}z.Ra(da,D);z.ia("Adornment",da);da.prototype.toString=function(){var a=this.Xf;return"Adornment("+this.nc+")"+(null!==a?a.toString():"")};da.prototype.updateRelationshipsFromData=function(){};
  da.prototype.nn=function(a){var b=this.fc.ca,c=this.fc;if(b instanceof G&&c instanceof X){var d=b.path,c=d.wh;b.nn(a);c=d.wh;a=this.va.o;b=a.length;for(d=0;d<b;d++){var e=a[d];e.Ff&&e instanceof X&&(e.kb=c)}}};z.w(da,{placeholder:"placeholder"},function(){return this.Lb});
  z.defineProperty(da,{fc:"adornedObject"},function(){return this.Ib},function(a){u&&null!==a&&z.l(a,O,D,"adornedObject:value");var b=this.Xf,c=null;null!==a&&(c=a.ca);null===b||null!==a&&b===c||b.sj(this.nc);this.Ib=a;null!==c&&c.rl(this.nc,this)});z.w(da,{Xf:"adornedPart"},function(){var a=this.Ib;return null!==a?a.ca:null});da.prototype.Ql=function(){var a=this.Ib;if(null===a)return!0;a=a.ca;return null===a||!nl(a)};da.prototype.be=function(){return!1};z.w(da,{Qa:"containingGroup"},function(){return null});
  da.prototype.sn=function(a,b,c,d,e,g,h){if(a===Wf&&"elements"===b)if(e instanceof aj){var k=e;null===this.Lb?this.Lb=k:this.Lb!==k&&z.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")}else e instanceof I&&(k=e.zt(function(a){return a instanceof aj}),k instanceof aj&&(null===this.Lb?this.Lb=k:this.Lb!==k&&z.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));else a===Xf&&"elements"===b&&null!==this.Lb&&(d===this.Lb?this.Lb=null:d instanceof I&&
  this.Lb.Pl(d)&&(this.Lb=null));D.prototype.sn.call(this,a,b,c,d,e,g,h)};da.prototype.updateAdornments=function(){};da.prototype.bn=function(){};function E(a){0===arguments.length?D.call(this,gj):D.call(this,a);this.mc=new J(G);this.vo=this.fl=this.Ar=this.zr=null;this.rr=!0;this.bt=!1;this.Ys=null;this.sq=this.sr=!0;this.tq=Ld;this.Ed=this.Jh=null;this.hs=zp;this.ik=!1}z.Ra(E,D);z.ia("Node",E);
  E.prototype.cloneProtected=function(a){D.prototype.cloneProtected.call(this,a);a.zr=this.zr;a.Ar=this.Ar;a.fl=this.fl;a.rr=this.rr;a.bt=this.bt;a.Ys=this.Ys;a.sr=this.sr;a.sq=this.sq;a.tq=this.tq.V();a.hs=this.hs};E.prototype.ki=function(a){D.prototype.ki.call(this,a);a.mf();a.Jh=this.Jh;a.Ed=null};var Ap;E.DirectionDefault=Ap=z.s(E,"DirectionDefault",0);E.DirectionAbsolute=z.s(E,"DirectionAbsolute",1);var Bp;E.DirectionRotatedNode=Bp=z.s(E,"DirectionRotatedNode",2);var Gm;
  E.DirectionRotatedNodeOrthogonal=Gm=z.s(E,"DirectionRotatedNodeOrthogonal",3);E.SpreadingNone=z.s(E,"SpreadingNone",10);var zp;E.SpreadingEvenly=zp=z.s(E,"SpreadingEvenly",11);var Cp;E.SpreadingPacked=Cp=z.s(E,"SpreadingPacked",12);function Dp(a,b){null!==b&&(null===a.Jh&&(a.Jh=new K(xk)),a.Jh.add(b))}
  function Ep(a,b,c,d){if(null===b||null===a.Jh)return null;for(var e=a.Jh.i;e.next();){var g=e.value;if(g.Op===a&&g.du===b&&g.Ax===c&&g.Bx===d||g.Op===b&&g.du===a&&g.Ax===d&&g.Bx===c)return g}return null}E.prototype.invalidateLinkBundle=function(a,b,c){if(void 0===b||null===b)b="";if(void 0===c||null===c)c="";a=Ep(this,a,b,c);null!==a&&a.zp()};
  E.prototype.sn=function(a,b,c,d,e,g,h){a===Wf&&"elements"===b?this.Ed=null:a===Xf&&"elements"===b&&(null===this.h?this.Ed=null:d instanceof O&&jo(this,d,function(a,b){dn(a,b,!0)}));D.prototype.sn.call(this,a,b,c,d,e,g,h)};E.prototype.invalidateConnectedLinks=E.prototype.mf=function(a){void 0===a&&(a=null);for(var b=this.ee;b.next();){var c=b.value;null!==a&&a.contains(c)||(Fp(this,c.md),Fp(this,c.Qd),c.qc())}};
  function Fp(a,b){if(null!==b){var c=b.gs;null!==c&&c.zp();c=a.Qa;null===c||c.se||Fp(c,c.Hl(""))}}E.prototype.Ql=function(){return!0};z.defineProperty(E,{SI:"portSpreading"},function(){return this.hs},function(a){var b=this.hs;b!==a&&(u&&z.Ba(a,E,E,"portSpreading"),this.hs=a,this.j("portSpreading",b,a),a=this.h,null!==a&&a.pa.qb||this.mf())});
  z.defineProperty(E,{ND:"avoidable"},function(){return this.sq},function(a){var b=this.sq;if(b!==a){u&&z.g(a,"boolean",E,"avoidable");this.sq=a;var c=this.h;null!==c&&nm(c,this);this.j("avoidable",b,a)}});z.defineProperty(E,{VG:"avoidableMargin"},function(){return this.tq},function(a){"number"===typeof a?a=new Db(a):z.l(a,Db,E,"avoidableMargin");var b=this.tq;if(!b.N(a)){this.tq=a=a.V();var c=this.h;null!==c&&nm(c,this);this.j("avoidableMargin",b,a)}});
  E.prototype.canAvoid=function(){return this.ND&&!this.Df};E.prototype.getAvoidableRect=function(a){a.set(this.W);a.Dw(this.VG);return a};E.prototype.findVisibleNode=function(){for(var a=this;null!==a&&!a.isVisible();)a=a.Qa;return a};
  E.prototype.isVisible=function(){if(!D.prototype.isVisible.call(this))return!1;var a=!0,b=!0,c=this.h;if(null!==c){a=c.Va;if(a.nf&&(a=a.xm.na(this),null!==a&&a.Ex))return!0;a=c.ce;b=c.bB===tk}if(b){if(c=this.Il(),null!==c&&!c.wd)return!1}else if(c=a?this.EH():this.FH(),0<c.count&&c.all(function(a){return!a.wd}))return!1;c=this.od;return null!==c?c.isVisible():!0};E.prototype.xd=function(a){D.prototype.xd.call(this,a);for(var b=this.ee;b.next();)b.value.xd(a)};z.w(E,{ee:"linksConnected"},function(){return this.mc.i});
  E.prototype.findLinksConnected=E.prototype.pE=function(a){void 0===a&&(a=null);if(null===a)return this.mc.i;u&&z.g(a,"string",E,"findLinksConnected:pid");var b=new Ta(this.mc),c=this;b.qn=function(b){return b.Y===c&&b.ag===a||b.da===c&&b.Vg===a};return b};E.prototype.findLinksOutOf=E.prototype.$w=function(a){void 0===a&&(a=null);u&&null!==a&&z.g(a,"string",E,"findLinksOutOf:pid");var b=new Ta(this.mc),c=this;b.qn=function(b){return b.Y!==c?!1:null===a?!0:b.ag===a};return b};
  E.prototype.findLinksInto=E.prototype.Ig=function(a){void 0===a&&(a=null);u&&null!==a&&z.g(a,"string",E,"findLinksInto:pid");var b=new Ta(this.mc),c=this;b.qn=function(b){return b.da!==c?!1:null===a?!0:b.Vg===a};return b};
  E.prototype.findNodesConnected=E.prototype.qE=function(a){void 0===a&&(a=null);u&&null!==a&&z.g(a,"string",E,"findNodesConnected:pid");for(var b=null,c=null,d=this.mc.i;d.next();){var e=d.value;if(e.Y===this){if(null===a||e.ag===a)e=e.da,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e}else e.da!==this||null!==a&&e.Vg!==a||(e=e.Y,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Ra(c):Pa};
  E.prototype.findNodesOutOf=E.prototype.FH=function(a){void 0===a&&(a=null);u&&null!==a&&z.g(a,"string",E,"findNodesOutOf:pid");for(var b=null,c=null,d=this.mc.i;d.next();){var e=d.value;e.Y!==this||null!==a&&e.ag!==a||(e=e.da,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Ra(c):Pa};
  E.prototype.findNodesInto=E.prototype.EH=function(a){void 0===a&&(a=null);u&&null!==a&&z.g(a,"string",E,"findNodesInto:pid");for(var b=null,c=null,d=this.mc.i;d.next();){var e=d.value;e.da!==this||null!==a&&e.Vg!==a||(e=e.Y,null!==b?b.add(e):null!==c&&c!==e?(b=new K(E),b.add(c),b.add(e)):c=e)}return null!==b?b.i:null!==c?new Ra(c):Pa};
  E.prototype.findLinksBetween=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);u&&(z.l(a,E,E,"findLinksBetween:othernode"),null!==b&&z.g(b,"string",E,"findLinksBetween:pid"),null!==c&&z.g(c,"string",E,"findLinksBetween:otherpid"));var d=new Ta(this.mc),e=this;d.qn=function(d){return(d.Y!==e||d.da!==a||null!==b&&d.ag!==b||null!==c&&d.Vg!==c)&&(d.Y!==a||d.da!==e||null!==c&&d.ag!==c||null!==b&&d.Vg!==b)?!1:!0};return d};
  E.prototype.findLinksTo=function(a,b,c){void 0===b&&(b=null);void 0===c&&(c=null);u&&(z.l(a,E,E,"findLinksTo:othernode"),null!==b&&z.g(b,"string",E,"findLinksTo:pid"),null!==c&&z.g(c,"string",E,"findLinksTo:otherpid"));var d=new Ta(this.mc),e=this;d.qn=function(d){return d.Y!==e||d.da!==a||null!==b&&d.ag!==b||null!==c&&d.Vg===c?!1:!0};return d};
  z.defineProperty(E,{sI:"linkConnected"},function(){return this.zr},function(a){var b=this.zr;b!==a&&(null!==a&&z.g(a,"function",E,"linkConnected"),this.zr=a,this.j("linkConnected",b,a))});z.defineProperty(E,{tI:"linkDisconnected"},function(){return this.Ar},function(a){var b=this.Ar;b!==a&&(null!==a&&z.g(a,"function",E,"linkDisconnected"),this.Ar=a,this.j("linkDisconnected",b,a))});
  z.defineProperty(E,{sx:"linkValidation"},function(){return this.fl},function(a){var b=this.fl;b!==a&&(null!==a&&z.g(a,"function",E,"linkValidation"),this.fl=a,this.j("linkValidation",b,a))});
  function Gp(a,b,c){Fp(a,c);if(!a.mc.contains(b)){a.mc.add(b);var d=a.sI;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.$a,g.$a=!0);d(a,b,c);null!==g&&(g.$a=e)}b.Oc&&(c=b.Y,b=b.da,null!==c&&null!==b&&c!==b&&(d=!0,g=a.h,null!==g&&(d=g.ce),a=d?b:c,e=d?c:b,a.ik||(a.ik=e),!e.nj||null!==g&&g.pa.qb||(d?c===e&&(e.nj=!1):b===e&&(e.nj=!1))))}}
  function Hp(a,b,c){Fp(a,c);if(a.mc.remove(b)){var d=a.tI,e=a.h;if(null!==d){var g=!0;null!==e&&(g=e.$a,e.$a=!0);d(a,b,c);null!==e&&(e.$a=g)}b.Oc&&(c=!0,null!==e&&(c=e.ce),a=c?b.da:b.Y,b=c?b.Y:b.da,null!==a&&(a.ik=!1),null===b||b.nj||(0===b.mc.count?(b.ik=null,null!==e&&e.pa.qb||(b.nj=!0)):hm(b)))}}
  function hm(a){a.ik=!1;if(0!==a.mc.count){var b=!0,c=a.h;if(null===c||!c.pa.qb){null!==c&&(b=c.ce);for(c=a.mc.i;c.next();){var d=c.value;if(d.Oc)if(b){if(d.Y===a){a.nj=!1;return}}else if(d.da===a){a.nj=!1;return}}a.nj=!0}}}
  E.prototype.updateRelationshipsFromData=function(){D.prototype.updateRelationshipsFromData.call(this);var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.ha;if(c instanceof qg){var d=c.fn(a),b=b.hf(d),e=this.Il();b!==e&&(b=null!==e?c.pb(e.data):void 0,e=c.Qp,"function"===typeof e?e(a,b):a[e]=b,c.Gh(a,d))}}}};E.prototype.Kt=function(a){D.prototype.Kt.call(this,a);a||(hm(this),a=this.vo,null!==a&&Ip(a,this))};
  E.prototype.Lt=function(a){D.prototype.Lt.call(this,a);a||(a=this.vo,null!==a&&null!==a.Ke&&(a.Ke.remove(this),a.Q()))};E.prototype.bn=function(){if(0<this.mc.count){var a=this.h;if(null!==a)for(var b=a.wb.gE,c=this.mc.copy().i;c.next();){var d=c.value;b?a.remove(d):(d.Y===this&&(d.Y=null),d.da===this&&(d.da=null))}}this.od=null;D.prototype.bn.call(this)};z.w(E,{Df:"isLinkLabel"},function(){return null!==this.vo});
  z.defineProperty(E,{od:"labeledLink"},function(){return this.vo},function(a){var b=this.vo;if(b!==a){u&&null!==a&&z.l(a,G,E,"labeledLink");var c=this.h,d=this.data;if(null!==b&&(null!==b.Ke&&(b.Ke.remove(this),b.Q()),null!==c&&null!==d&&!c.pa.qb)){var e=b.data,g=c.ha;if(null!==e&&g instanceof V){var h=g.pb(d);void 0!==h&&g.mF(e,h)}}this.vo=a;null!==a&&(Ip(a,this),null===c||null===d||c.pa.qb||(e=a.data,g=c.ha,null!==e&&g instanceof V&&(h=g.pb(d),void 0!==h&&g.Bz(e,h))));Ym(this);this.j("labeledLink",
  b,a)}});E.prototype.findPort=E.prototype.Hl=function(a){u&&z.g(a,"string",E,"findPort:pid");if(null===this.Ed){if(""===a&&!1===this.Rh)return this;en(this)}var b=this.Ed.na(a);return null!==b||""!==a&&(b=this.Ed.na(""),null!==b)?b:this};z.w(E,{port:"port"},function(){return this.Hl("")});z.w(E,{ports:"ports"},function(){null===this.Ed&&en(this);return this.Ed.UE});
  function en(a){null===a.Ed?a.Ed=new na("string",O):a.Ed.clear();jo(a,a,function(a,c){var d=c.zd;null!==d&&a.Ed.add(d,c)});0===a.Ed.count&&a.Ed.add("",a)}function dn(a,b,c){var d=b.zd;if(null!==d&&(null!==a.Ed&&a.Ed.remove(d),b=a.h,null!==b&&c)){c=null;for(d=a.pE(d);d.next();)a=d.value,null===c&&(c=z.rb()),c.push(a);if(null!==c){for(d=0;d<c.length;d++)a=c[d],b.remove(a);z.xa(c)}}}
  E.prototype.isInTreeOf=function(a){if(null===a||a===this)return!1;var b=!0,c=this.h;null!==c&&(b=c.ce);c=this;if(b)for(;c!==a;){for(var b=null,d=c.mc.i;d.next();){var e=d.value;if(e.Oc&&(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.mc.i;d.next()&&(e=d.value,!e.Oc||(b=e.da,b===c||b===this)););if(b===this||null===b||b===c)return!1;c=b}return!0};
  E.prototype.findTreeRoot=function(){var a=!0,b=this.h;null!==b&&(a=b.ce);b=this;if(a)for(;;){for(var a=null,c=b.mc.i;c.next();){var d=c.value;if(d.Oc&&(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.mc.i;c.next()&&(d=c.value,!d.Oc||(a=d.da,a===b||a===this)););if(a===this)return this;if(null===a||a===b)return b;b=a}};
  E.prototype.findCommonTreeParent=function(a){if(null===a)return null;u&&z.l(a,E,E,"findCommonTreeParent:other");if(this===a)return this;for(var b=this;null!==b;)tp(b,!0),b=b.Il();for(var c=null,b=a;null!==b;){if(0!==(b.U&1048576)){c=b;break}b=b.Il()}for(b=this;null!==b;)tp(b,!1),b=b.Il();return c};
  E.prototype.findTreeParentLink=E.prototype.op=function(){var a=!0,b=this.h;null!==b&&(a=b.ce);b=this.mc.i;if(a)for(;b.next();){if(a=b.value,a.Oc&&a.Y!==this)return a}else for(;b.next();)if(a=b.value,a.Oc&&a.da!==this)return a;return null};
  E.prototype.findTreeParentNode=E.prototype.Il=function(){var a=this.ik;if(null===a)return null;if(a instanceof E)return a;var b=!0,a=this.h;null!==a&&(b=a.ce);a=this.mc.i;if(b)for(;a.next();){if(b=a.value,b.Oc&&(b=b.Y,b!==this))return this.ik=b}else for(;a.next();)if(b=a.value,b.Oc&&(b=b.da,b!==this))return this.ik=b;return this.ik=null};E.prototype.findTreeParentChain=function(){function a(b,d){if(null!==b){d.add(b);var e=b.op();null!==e&&(d.add(e),a(b.Il(),d))}}var b=new K(D);a(this,b);return b};
  E.prototype.findTreeLevel=function(){return Jp(this,this)};function Jp(a,b){var c=b.Il();return null===c?0:1+Jp(a,c)}E.prototype.findTreeChildrenLinks=E.prototype.bx=function(){var a=!0,b=this.h;null!==b&&(a=b.ce);if(a){var a=new Ta(this.mc),c=this;a.qn=function(a){return a.Oc&&a.Y===c?!0:!1}}else a=new Ta(this.mc),c=this,a.qn=function(a){return a.Oc&&a.da===c?!0:!1};return a};
  E.prototype.findTreeChildrenNodes=E.prototype.sE=function(){var a=!0,b=this.h;null!==b&&(a=b.ce);var c=b=null,d=this.mc.i;if(a)for(;d.next();)a=d.value,a.Oc&&a.Y===this&&(a=a.da,null!==b?b.add(a):null!==c&&c!==a?(b=new J(E),b.add(c),b.add(a)):c=a);else for(;d.next();)a=d.value,a.Oc&&a.da===this&&(a=a.Y,null!==b?b.add(a):null!==c&&c!==a?(b=new J(E),b.add(c),b.add(a)):c=a);return null!==b?b.i:null!==c?new Ra(c):Pa};
  E.prototype.findTreeParts=function(a){void 0===a&&(a=Infinity);z.g(a,"number",E,"collapseTree:level");var b=new K(D);hh(b,this,!1,a,!0);return b};E.prototype.collapseTree=E.prototype.collapseTree=function(a){void 0===a&&(a=1);z.p(a,E,"collapseTree:level");1>a&&(a=1);var b=this.h;if(null!==b&&!b.xh){b.xh=!0;var c=new K(E);c.add(this);Kp(this,c,b.ce,a,b.Va,this,b.bB===tk);b.xh=!1}};
  function Kp(a,b,c,d,e,g,h){if(1<d)for(var k=c?a.$w():a.Ig();k.next();){var l=k.value;l.Oc&&(l=l.aA(a),null===l||l===a||b.contains(l)||(b.add(l),Kp(l,b,c,d-1,e,g,h)))}else Lp(a,b,c,e,g,h)}function Lp(a,b,c,d,e,g){for(var h=e===a?!0:a.wd,k=c?a.$w():a.Ig();k.next();){var l=k.value;l.Oc&&(l=l.aA(a),null===l||l===a||b.contains(l)||(b.add(l),h&&(g&&fk(d,l,e),l.Nl(),l.xd(!1)),l.wd&&(l.Cu=l.wd,Lp(l,b,c,d,e,g))))}a.wd=!1}
  E.prototype.expandTree=E.prototype.expandTree=function(a){void 0===a&&(a=2);z.p(a,E,"expandTree:level");2>a&&(a=2);var b=this.h;if(null!==b&&!b.xh){b.xh=!0;var c=new K(E);c.add(this);Mp(this,c,b.ce,a,b.Va,this,b.bB===tk);b.xh=!1}};function Mp(a,b,c,d,e,g,h){for(var k=g===a?!1:a.wd,l=c?a.$w():a.Ig();l.next();){var m=l.value;m.Oc&&(k||m.Dg||m.qc(),m=m.aA(a),null!==m&&m!==a&&!b.contains(m)&&(b.add(m),k||(m.xd(!0),m.Nl(),h&&ek(e,m,g)),2<d||m.Cu))&&(m.Cu=!1,Mp(m,b,c,d-1,e,g,h))}a.wd=!0}
  z.defineProperty(E,{wd:"isTreeExpanded"},function(){return this.rr},function(a){var b=this.rr;if(b!==a){u&&z.g(a,"boolean",E,"isTreeExpanded");this.rr=a;var c=this.h;this.j("isTreeExpanded",b,a);b=this.xJ;if(null!==b){var d=!0;null!==c&&(d=c.$a,c.$a=!0);b(this);null!==c&&(c.$a=d)}null!==c&&c.pa.qb?this.xd(a):a?this.expandTree():this.collapseTree()}});
  z.defineProperty(E,{Cu:"wasTreeExpanded"},function(){return this.bt},function(a){var b=this.bt;b!==a&&(u&&z.g(a,"boolean",E,"wasTreeExpanded"),this.bt=a,this.j("wasTreeExpanded",b,a))});z.defineProperty(E,{xJ:"treeExpandedChanged"},function(){return this.Ys},function(a){var b=this.Ys;b!==a&&(null!==a&&z.g(a,"function",E,"treeExpandedChanged"),this.Ys=a,this.j("treeExpandedChanged",b,a))});
  z.defineProperty(E,{nj:"isTreeLeaf"},function(){return this.sr},function(a){var b=this.sr;b!==a&&(u&&z.g(a,"boolean",E,"isTreeLeaf"),this.sr=a,this.j("isTreeLeaf",b,a))});
  function G(){D.call(this,Ni);this.qg=null;this.Qh="";this.Cg=this.ar=null;this.fi="";this.Xs=null;this.os=this.ns=this.ms=!1;this.tr=!0;this.mq=Qi;this.Fq=0;this.Iq=Qi;this.Jq=NaN;this.Cm=nn;this.Ms=.5;this.Ke=null;this.Yc=(new J(N)).freeze();this.Jo=this.Me=null;this.Dg=!1;this.dw=null;this.oz=!1;this.$g=this.Yn=this.Un=this.si=this.Ei=this.kb=null;this.rz=new N;this.jD=this.hD=null;this.uy=!1;this.la=null}z.Ra(G,D);z.ia("Link",G);
  G.prototype.cloneProtected=function(a){D.prototype.cloneProtected.call(this,a);a.Qh=this.Qh;a.ar=this.ar;a.fi=this.fi;a.Xs=this.Xs;a.ms=this.ms;a.ns=this.ns;a.os=this.os;a.tr=this.tr;a.mq=this.mq;a.Fq=this.Fq;a.Iq=this.Iq;a.Jq=this.Jq;a.Cm=this.Cm;a.Ms=this.Ms;null!==this.la&&(a.la=this.la.copy())};G.prototype.ki=function(a){D.prototype.ki.call(this,a);this.Qh=a.Qh;this.fi=a.fi;a.Me=null;a.qc();a.si=this.si};var nn;G.Normal=nn=z.s(G,"Normal",1);G.Orthogonal=z.s(G,"Orthogonal",2);
  G.AvoidsNodes=z.s(G,"AvoidsNodes",6);var Np;G.AvoidsNodesStraight=Np=z.s(G,"AvoidsNodesStraight",7);var Qi;G.None=Qi=z.s(G,"None",0);var Xi;G.Bezier=Xi=z.s(G,"Bezier",9);var Pi;G.JumpGap=Pi=z.s(G,"JumpGap",10);var Oi;G.JumpOver=Oi=z.s(G,"JumpOver",11);var kn;G.End=kn=z.s(G,"End",17);var ln;G.Scale=ln=z.s(G,"Scale",18);var mn;G.Stretch=mn=z.s(G,"Stretch",19);var Co;G.OrientAlong=Co=z.s(G,"OrientAlong",21);var co;G.OrientPlus90=co=z.s(G,"OrientPlus90",22);var fo;
  G.OrientMinus90=fo=z.s(G,"OrientMinus90",23);var Op;G.OrientOpposite=Op=z.s(G,"OrientOpposite",24);var Pp;G.OrientUpright=Pp=z.s(G,"OrientUpright",25);var eo;G.OrientPlus90Upright=eo=z.s(G,"OrientPlus90Upright",26);var ho;G.OrientMinus90Upright=ho=z.s(G,"OrientMinus90Upright",27);var io;G.OrientUpright45=io=z.s(G,"OrientUpright45",28);G.prototype.Ue=function(){null===this.la&&(this.la=new Fm)};
  G.prototype.Ql=function(){var a=this.Y;if(null!==a){var b=a.findVisibleNode();null!==b&&(a=b);if(nl(a)||ol(a))return!1}a=this.da;return null!==a&&(b=a.findVisibleNode(),null!==b&&(a=b),nl(a)||ol(a))?!1:!0};G.prototype.RA=function(){return!1};G.prototype.be=function(){return!1};
  G.prototype.computeAngle=function(a,b,c){a=0;switch(b){default:case Qi:a=0;break;case Co:a=c;break;case co:a=c+90;break;case fo:a=c-90;break;case Op:a=c+180;break;case Pp:a=df(c);90<a&&270>a&&(a-=180);break;case eo:a=df(c+90);90<a&&270>a&&(a-=180);break;case ho:a=df(c-90);90<a&&270>a&&(a-=180);break;case io:a=df(c);if(45<a&&135>a||225<a&&315>a)return 0;90<a&&270>a&&(a-=180)}return df(a)};
  z.defineProperty(G,{Y:"fromNode"},function(){return this.qg},function(a){var b=this.qg;if(b!==a){u&&null!==a&&z.l(a,E,G,"fromNode");var c=this.md;null!==b&&(this.Cg!==b&&Hp(b,this,c),Qp(this),this.I(Dl));this.qg=a;null!==a&&this.xd(a.isVisible());this.Ei=null;this.qc();var d=this.h;if(null!==d){var e=this.data,g=d.ha;if(null!==e)if(g instanceof V){var h=null!==a?a.data:null;g.Mx(e,g.pb(h))}else g instanceof qg&&(h=null!==a?a.data:null,d.ce?g.Gh(e,g.pb(h)):(null!==b&&g.Gh(b.data,void 0),g.Gh(h,g.pb(null!==
  this.Cg?this.Cg.data:null))))}e=this.md;g=this.vE;null!==g&&(h=!0,null!==d&&(h=d.$a,d.$a=!0),g(this,c,e),null!==d&&(d.$a=h));null!==a&&(this.Cg!==a&&Gp(a,this,e),Rp(this),this.I(vl));this.j("fromNode",b,a);Wl(this)}});
  z.defineProperty(G,{ag:"fromPortId"},function(){return this.Qh},function(a){var b=this.Qh;if(b!==a){u&&z.g(a,"string",G,"fromPortId");var c=this.md;null!==c&&Fp(this.Y,c);Qp(this);this.Qh=a;var d=this.md;null!==d&&Fp(this.Y,d);var e=this.h;if(null!==e){var g=this.data,h=e.ha;null!==g&&h instanceof V&&h.PA(g,a)}c!==d&&(this.Ei=null,this.qc(),g=this.vE,null!==g&&(h=!0,null!==e&&(h=e.$a,e.$a=!0),g(this,c,d),null!==e&&(e.$a=h)));Rp(this);this.j("fromPortId",b,a)}});
  z.w(G,{md:"fromPort"},function(){var a=this.qg;return null===a?null:a.Hl(this.Qh)});z.defineProperty(G,{vE:"fromPortChanged"},function(){return this.ar},function(a){var b=this.ar;b!==a&&(null!==a&&z.g(a,"function",G,"fromPortChanged"),this.ar=a,this.j("fromPortChanged",b,a))});
  z.defineProperty(G,{da:"toNode"},function(){return this.Cg},function(a){var b=this.Cg;if(b!==a){u&&null!==a&&z.l(a,E,G,"toNode");var c=this.Qd;null!==b&&(this.qg!==b&&Hp(b,this,c),Qp(this),this.I(Dl));this.Cg=a;null!==a&&this.xd(a.isVisible());this.Ei=null;this.qc();var d=this.h;if(null!==d){var e=this.data,g=d.ha;if(null!==e)if(g instanceof V){var h=null!==a?a.data:null;g.Qx(e,g.pb(h))}else g instanceof qg&&(h=null!==a?a.data:null,d.ce?(null!==b&&g.Gh(b.data,void 0),g.Gh(h,g.pb(null!==this.qg?this.qg.data:
  null))):g.Gh(e,g.pb(h)))}e=this.Qd;g=this.TF;null!==g&&(h=!0,null!==d&&(h=d.$a,d.$a=!0),g(this,c,e),null!==d&&(d.$a=h));null!==a&&(this.qg!==a&&Gp(a,this,e),Rp(this),this.I(vl));this.j("toNode",b,a);Wl(this)}});
  z.defineProperty(G,{Vg:"toPortId"},function(){return this.fi},function(a){var b=this.fi;if(b!==a){u&&z.g(a,"string",G,"toPortId");var c=this.Qd;null!==c&&Fp(this.da,c);Qp(this);this.fi=a;var d=this.Qd;null!==d&&Fp(this.da,d);var e=this.h;if(null!==e){var g=this.data,h=e.ha;null!==g&&h instanceof V&&h.SA(g,a)}c!==d&&(this.Ei=null,this.qc(),g=this.TF,null!==g&&(h=!0,null!==e&&(h=e.$a,e.$a=!0),g(this,c,d),null!==e&&(e.$a=h)));Rp(this);this.j("toPortId",b,a)}});
  z.w(G,{Qd:"toPort"},function(){var a=this.Cg;return null===a?null:a.Hl(this.fi)});z.defineProperty(G,{TF:"toPortChanged"},function(){return this.Xs},function(a){var b=this.Xs;b!==a&&(null!==a&&z.g(a,"function",G,"toPortChanged"),this.Xs=a,this.j("toPortChanged",b,a))});z.defineProperty(G,{Db:"fromSpot"},function(){return null!==this.la?this.la.Hj:Pc},function(a){this.Ue();var b=this.la.Hj;b.N(a)||(u&&z.l(a,Q,G,"fromSpot"),a=a.V(),this.la.Hj=a,this.j("fromSpot",b,a),this.qc())});
  z.defineProperty(G,{Jl:"fromEndSegmentLength"},function(){return null!==this.la?this.la.Fj:NaN},function(a){this.Ue();var b=this.la.Fj;b!==a&&(u&&z.g(a,"number",G,"fromEndSegmentLength"),0>a&&z.ka(a,">= 0",G,"fromEndSegmentLength"),this.la.Fj=a,this.j("fromEndSegmentLength",b,a),this.qc())});
  z.defineProperty(G,{Ft:"fromEndSegmentDirection"},function(){return null!==this.la?this.la.Ej:Ap},function(a){this.Ue();var b=this.la.Ej;b!==a&&(u&&z.Ba(a,E,G,"fromEndSegmentDirection"),this.la.Ej=a,this.j("fromEndSegmentDirection",b,a),this.qc())});z.defineProperty(G,{Gt:"fromShortLength"},function(){return null!==this.la?this.la.Gj:NaN},function(a){this.Ue();var b=this.la.Gj;b!==a&&(u&&z.g(a,"number",G,"fromShortLength"),this.la.Gj=a,this.j("fromShortLength",b,a),this.qc())});
  z.defineProperty(G,{Eb:"toSpot"},function(){return null!==this.la?this.la.hk:Pc},function(a){this.Ue();var b=this.la.hk;b.N(a)||(u&&z.l(a,Q,G,"toSpot"),a=a.V(),this.la.hk=a,this.j("toSpot",b,a),this.qc())});z.defineProperty(G,{Yl:"toEndSegmentLength"},function(){return null!==this.la?this.la.fk:NaN},function(a){this.Ue();var b=this.la.fk;b!==a&&(u&&z.g(a,"number",G,"toEndSegmentLength"),0>a&&z.ka(a,">= 0",G,"toEndSegmentLength"),this.la.fk=a,this.j("toEndSegmentLength",b,a),this.qc())});
  z.defineProperty(G,{zu:"toEndSegmentDirection"},function(){return null!==this.la?this.la.ek:Ap},function(a){this.Ue();var b=this.la.ek;b!==a&&(u&&z.Ba(a,E,G,"toEndSegmentDirection"),this.la.ek=a,this.j("toEndSegmentDirection",b,a),this.qc())});z.defineProperty(G,{Au:"toShortLength"},function(){return null!==this.la?this.la.gk:NaN},function(a){this.Ue();var b=this.la.gk;b!==a&&(u&&z.g(a,"number",G,"toShortLength"),this.la.gk=a,this.j("toShortLength",b,a),this.qc())});
  function Wl(a){var b=a.Y,c=a.da;null!==b?null!==c?Sp(a,b.CH(c)):Sp(a,null):Sp(a,null)}function Sp(a,b){var c=a.Pk;if(c!==b){null!==c&&up(c,a);a.Pk=b;null!==b&&vp(b,a);var d=a.VD;if(null!==d){var e=!0,g=a.h;null!==g&&(e=g.$a,g.$a=!0);d(a,c,b);null!==g&&(g.$a=e)}!a.Dg||a.hD!==c&&a.jD!==c||a.qc()}}G.prototype.Nl=function(){var a=this.Qa;null!==a&&this.Y!==a&&this.da!==a&&a.Pw&&D.prototype.Nl.call(this)};
  G.prototype.getOtherNode=G.prototype.aA=function(a){u&&z.l(a,E,G,"getOtherNode:node");var b=this.Y;return a===b?this.da:b};G.prototype.getOtherPort=function(a){u&&z.l(a,O,G,"getOtherPort:port");var b=this.md;return a===b?this.Qd:b};z.w(G,{HK:"isLabeledLink"},function(){return null===this.Ke?!1:0<this.Ke.count});z.w(G,{Hf:"labelNodes"},function(){return null===this.Ke?Pa:this.Ke.i});function Ip(a,b){null===a.Ke&&(a.Ke=new K(E));a.Ke.add(b);a.Q()}
  G.prototype.Kt=function(a){D.prototype.Kt.call(this,a);Tp(this)&&Ri(this,this.W);a||(a=this.qg,null!==a&&Gp(a,this,this.md),a=this.Cg,null!==a&&Gp(a,this,this.Qd),Rp(this))};G.prototype.Lt=function(a){D.prototype.Lt.call(this,a);Tp(this)&&Ri(this,this.W);a||(a=this.qg,null!==a&&Hp(a,this,this.md),a=this.Cg,null!==a&&Hp(a,this,this.Qd),Qp(this))};
  G.prototype.bn=function(){this.Dg=!0;if(null!==this.Ke){var a=this.h;if(null!==a)for(var b=this.Ke.copy().i;b.next();)a.remove(b.value)}b=this.data;null!==b&&(a=this.h,null!==a&&(a=a.ha,a instanceof V?a.Fx(b):a instanceof qg&&a.Gh(b,void 0)))};
  G.prototype.updateRelationshipsFromData=function(){var a=this.data;if(null!==a){var b=this.h;if(null!==b){var c=b.ha;if(c instanceof V){var d=c.Ll(a),e=b.hf(d),g=this.Y;e!==g&&(e=null!==g?c.pb(g.data):void 0,g=c.Ep,"function"===typeof g?g(a,e):a[g]=e,c.Mx(a,d));d=c.Ml(a);e=b.hf(d);g=this.da;e!==g&&(e=null!==g?c.pb(g.data):void 0,g=c.Gp,"function"===typeof g?g(a,e):a[g]=e,c.Qx(a,d));var h=c.rk(a);if(0<h.length||0<this.Hf.count){if(1===h.length&&1===this.Hf.count&&(b=h[0],d=this.Hf.first(),c.pb(d.data)===
  b))return;var d=(new K).$c(h),k=new K;this.Hf.each(function(a){null!==a.data&&(a=c.pb(a.data),void 0!==a&&k.add(a))});b=k.copy();b.IA(d);d=d.copy();d.IA(k);if(0<b.count||0<d.count)h.length=0,k.each(function(a){h.push(a)}),b.each(function(b){c.mF(a,b)}),d.each(function(b){c.Bz(a,b)})}}}}};
  G.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;D.prototype.move.call(this,a);this.Rl(c,b);for(a=this.Hf;a.next();){var d=a.value,e=d.position;d.moveTo(e.x+c,e.y+b)}};z.defineProperty(G,{VI:"relinkableFrom"},function(){return this.ms},function(a){var b=this.ms;b!==a&&(u&&z.g(a,"boolean",G,"relinkableFrom"),this.ms=a,this.j("relinkableFrom",b,a),this.ae())});
  z.defineProperty(G,{WI:"relinkableTo"},function(){return this.ns},function(a){var b=this.ns;b!==a&&(u&&z.g(a,"boolean",G,"relinkableTo"),this.ns=a,this.j("relinkableTo",b,a),this.ae())});G.prototype.canRelinkFrom=function(){if(!this.VI)return!1;var a=this.layer;if(null===a)return!0;if(!a.Sm)return!1;a=a.h;return null===a||a.Sm?!0:!1};G.prototype.canRelinkTo=function(){if(!this.WI)return!1;var a=this.layer;if(null===a)return!0;if(!a.Sm)return!1;a=a.h;return null===a||a.Sm?!0:!1};
  z.defineProperty(G,{lu:"resegmentable"},function(){return this.os},function(a){var b=this.os;b!==a&&(u&&z.g(a,"boolean",G,"resegmentable"),this.os=a,this.j("resegmentable",b,a),this.ae())});z.defineProperty(G,{Oc:"isTreeLink"},function(){return this.tr},function(a){var b=this.tr;b!==a&&(u&&z.g(a,"boolean",G,"isTreeLink"),this.tr=a,this.j("isTreeLink",b,a),null!==this.Y&&hm(this.Y),null!==this.da&&hm(this.da))});z.w(G,{path:"path"},function(){var a=this.gf();return a instanceof X?a:null});
  z.w(G,{tn:"routeBounds"},function(){this.An();var a=new w;var b=Infinity,c=Infinity,d=this.sa;if(0===d)a.n(NaN,NaN,0,0);else{if(1===d)d=this.m(0),b=Math.min(d.x,b),c=Math.min(d.y,c),a.n(d.x,d.y,0,0);else if(2===d){var e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y);a.n(e.x,e.y,0,0);a.wj(g)}else if(this.computeCurve()===Xi&&3<=d&&!this.rc)if(e=this.m(0),b=e.x,c=e.y,a.n(b,c,0,0),3===d)d=this.m(1),b=Math.min(d.x,b),c=Math.min(d.y,c),g=this.m(2),b=Math.min(g.x,b),c=Math.min(g.y,c),ve(e.x,
  e.y,d.x,d.y,d.x,d.y,g.x,g.y,.5,a);else for(var h=3;h<d;h+=3){var k=this.m(h-2);h+3>=d&&(h=d-1);var l=this.m(h-1),g=this.m(h);ve(e.x,e.y,k.x,k.y,l.x,l.y,g.x,g.y,.5,a);b=Math.min(g.x,b);c=Math.min(g.y,c);e=g}else for(e=this.m(0),g=this.m(1),b=Math.min(e.x,g.x),c=Math.min(e.y,g.y),a.n(e.x,e.y,0,0),a.wj(g),h=2;h<d;h++)e=this.m(h),b=Math.min(e.x,b),c=Math.min(e.y,c),a.wj(e);this.rz.n(b-a.x,c-a.y)}return this.dw=a});z.w(G,{aF:"midPoint"},function(){this.An();return this.computeMidPoint(new N)});
  G.prototype.computeMidPoint=function(a){var b=this.sa;if(0===b)return a.assign(ee),a;if(1===b)return a.assign(this.m(0)),a;if(2===b){var c=this.m(0),d=this.m(1);a.n((c.x+d.x)/2,(c.y+d.y)/2);return a}if(this.computeCurve()===Xi&&3<=b&&!this.rc){if(3===b)return this.m(1);var c=(b-1)/3|0,e=3*(c/2|0);if(1===c%2){var c=this.m(e),d=this.m(e+1),g=this.m(e+2),e=this.m(e+3),b=d.x,h=d.y,d=g.x,k=g.y,g=(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+g)/2+(g+(d+e.x)/2)/2)/2;a.y=(h+k)/2}else a.assign(this.m(e));
  return a}e=0;g=z.rb();for(h=0;h<b-1;h++)c=0,c=this.m(h),d=this.m(h+1),td(c.x,d.x)?(c=d.y-c.y,0>c&&(c=-c)):td(c.y,d.y)?(c=d.x-c.x,0>c&&(c=-c)):c=Math.sqrt(c.Af(d)),g.push(c),e+=c;for(d=h=c=0;c<e/2&&h<b;){d=g[h];if(c+d>e/2)break;c+=d;h++}z.xa(g);b=this.m(h);g=this.m(h+1);b.x===g.x?b.y>g.y?a.n(b.x,b.y-(e/2-c)):a.n(b.x,b.y+(e/2-c)):b.y===g.y?b.x>g.x?a.n(b.x-(e/2-c),b.y):a.n(b.x+(e/2-c),b.y):(c=(e/2-c)/d,a.n(b.x+c*(g.x-b.x),b.y+c*(g.y-b.y)));return a};z.w(G,{$E:"midAngle"},function(){this.An();return this.computeMidAngle()});
  G.prototype.computeMidAngle=function(){var a=this.sa;if(2>a)return NaN;if(this.computeCurve()===Xi&&4<=a&&!this.rc){var b=(a-1)/3|0,c=3*(b/2|0);if(1===b%2){var c=Math.floor(c),b=this.m(c),d=this.m(c+1),a=this.m(c+2),c=this.m(c+3),e=d.x,d=d.y,g=a.x,a=a.y,h=(e+g)/2,k=(d+a)/2;return wb(((b.x+e)/2+h)/2,((b.y+d)/2+k)/2,(h+(g+c.x)/2)/2,(k+(a+c.y)/2)/2)}if(0<c&&c+1<a)return b=this.m(c-1),d=this.m(c+1),b.Ec(d)}c=a/2|0;if(0===a%2)return b=this.m(c-1),d=this.m(c),4<=a&&b.Mc(d)&&(b=this.m(c-2),a=this.m(c+1),
  c=b.Af(d),e=d.Af(a),!(c>e+10))?e>c+10?d.Ec(a):b.Ec(a):b.Ec(d);b=this.m(c-1);d=this.m(c);a=this.m(c+1);c=b.Af(d);e=d.Af(a);return c>e+10?b.Ec(d):e>c+10?d.Ec(a):b.Ec(a)};
  z.defineProperty(G,{points:"points"},function(){return this.Yc},function(a){var b=this.Yc;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 J(N),d=0;d<a.length/2;d++)e=(new N(a[2*d],a[2*d+1])).freeze(),c.add(e);else{for(var g=!0,d=0;d<a.length;d++)if(e=a[d],!z.Za(e)||"number"!==typeof e.x||isNaN(e.x)||"number"!==typeof e.y||isNaN(e.y)){g=!1;break}if(g)for(c=new J(N),d=0;d<a.length;d++)e=
  a[d],c.add((new N(e.x,e.y)).freeze());else z.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 J)for(c=a.copy(),a=c.i;a.next();)a.value.freeze();else z.k("Link.points value is not an instance of List or Array: "+a);c.freeze();this.Yc=c;this.qe();this.Q();Up(this);a=this.h;null!==a&&(a.jn||a.pa.qb||a.tx.add(this),a.Va.wc&&(this.Jo=c));this.j("points",b,c)}});z.w(G,{sa:"pointsCount"},function(){return this.Yc.count});
  G.prototype.getPoint=G.prototype.m=function(a){return this.Yc.o[a]};G.prototype.setPoint=G.prototype.Kf=function(a,b){u&&(z.l(b,N,G,"setPoint"),b.F()||z.k("Link.setPoint called with a Point that does not have real numbers: "+b.toString()));null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Sg(a,b)};
  G.prototype.setPointAt=G.prototype.aa=function(a,b,c){u&&(z.p(b,G,"setPointAt:x"),z.p(c,G,"setPointAt:y"));null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Sg(a,new N(b,c))};G.prototype.insertPoint=function(a,b){u&&(z.l(b,N,G,"insertPoint"),b.F()||z.k("Link.insertPoint called with a Point that does not have real numbers: "+b.toString()));null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Md(a,b)};
  G.prototype.insertPointAt=G.prototype.B=function(a,b,c){u&&(z.p(b,G,"insertPointAt:x"),z.p(c,G,"insertPointAt:y"));null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.Md(a,new N(b,c))};G.prototype.addPoint=G.prototype.hi=function(a){u&&(z.l(a,N,G,"addPoint"),a.F()||z.k("Link.addPoint called with a Point that does not have real numbers: "+a.toString()));null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.add(a)};
  G.prototype.addPointAt=G.prototype.tl=function(a,b){u&&(z.p(a,G,"insertPointAt:x"),z.p(b,G,"insertPointAt:y"));null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.add(new N(a,b))};G.prototype.removePoint=G.prototype.nF=function(a){null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.dd(a)};
  G.prototype.clearPoints=G.prototype.ep=function(){null===this.Me&&z.k("Call Link.startRoute before modifying the points of the route.");this.Yc.clear()};G.prototype.movePoints=G.prototype.Rl=function(a,b){for(var c=new J(N),d=this.Yc.i;d.next();){var e=d.value;c.add((new N(e.x+a,e.y+b)).freeze())}c.freeze();d=this.Yc;this.Yc=c;this.Q();Up(this);e=this.h;null!==e&&e.Va.wc&&(this.Jo=c);this.j("points",d,c)};G.prototype.startRoute=G.prototype.Ul=function(){null===this.Me&&(this.Me=this.Yc,this.Yc=this.Yc.copy())};
  G.prototype.commitRoute=G.prototype.dj=function(){if(null!==this.Me){for(var a=this.Me,b=this.Yc,c=Infinity,d=Infinity,e=a.o,g=e.length,h=0;h<g;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.o,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===g)for(h=0;h<p;h++){if(g=e[h],k=n[h],g.x-c!==k.x-l||g.y-d!==k.y-m){this.Q();this.qe();break}}else this.Q(),this.qe();this.Me=null;c=this.h;null!==c&&c.Va.wc&&(this.Jo=b);Up(this);
  this.j("points",a,b)}};G.prototype.rollbackRoute=G.prototype.ZI=function(){null!==this.Me&&(this.Yc=this.Me,this.Me=null)};function Up(a){0===a.Yc.count?a.Dg=!1:(a.Dg=!0,a.Un=a.m(0).copy(),a.Yn=a.m(a.sa-1).copy(),Vp(a,!1))}G.prototype.invalidateRoute=G.prototype.qc=function(){if(!this.oz){var a=this.h;a&&(a.tx.contains(this)||a.pa.qb||a.Va.jI&&!a.Va.nf)||(a=this.path,null!==a&&(this.Dg=!1,this.Q(),a.Q()))}};z.defineProperty(G,{eq:"suspendsRouting"},function(){return this.oz},function(a){this.oz=a});
  G.prototype.updateRoute=G.prototype.An=function(){if(!this.Dg&&!this.uy){var a=!0;try{this.uy=!0,this.Ul(),a=this.computePoints()}finally{this.uy=!1,a?this.dj():this.ZI()}}};
  G.prototype.computePoints=function(){var a=this.h;if(null===a)return!1;var b=this.Y,c=null;null===b?(a.Dm||(a.ew=new X,a.ew.Aa=Pd,a.ew.ub=0,a.Dm=new E,a.Dm.add(a.ew),a.Dm.Bf()),this.Un&&(a.Dm.position=a.Dm.location=this.Un,a.Dm.Bf(),b=a.Dm,c=a.ew)):c=this.md;if(null!==c&&!b.isVisible()){var d=b.findVisibleNode();null!==d&&d!==b?(b=d,c=d.Hl("")):b=d}this.hD=b;if(null===b||!b.location.F())return!1;for(;!(null===c||c.W.F()&&c.oj());)c=c.T;if(null===c)return!1;var d=this.da,e=null;null===d?(a.Em||(a.fw=
  new X,a.fw.Aa=Pd,a.fw.ub=0,a.Em=new E,a.Em.add(a.fw),a.Em.Bf()),this.Yn&&(a.Em.position=a.Em.location=this.Yn,a.Em.Bf(),d=a.Em,e=a.fw)):e=this.Qd;null===e||d.isVisible()||(a=d.findVisibleNode(),null!==a&&a!==d?(d=a,e=a.Hl("")):d=a);this.jD=d;if(null===d||!d.location.F())return!1;for(;!(null===e||e.W.F()&&e.oj());)e=e.T;if(null===e)return!1;var a=this.sa,g=Wp(this,c),h=Xp(this,e),k=c===e&&null!==c,l=this.rc,m=this.Se===Xi;this.Ei=k&&!l?m=!0:!1;var n=this.it===Qi||k;if(l||g!==Yb||h!==Yb||k){m=this.kj;
  n&&(l&&m||k)&&this.ep();var p=k?this.computeCurviness():0,q=this.getLinkPoint(b,c,g,!0,l,d,e),r=0,s=0,t=0;if(l||g!==Yb||k){var v=this.computeEndSegmentLength(b,c,g,!0),t=this.getLinkDirection(b,c,q,g,!0,l,d,e);k&&(t-=l?90:30,0>p&&(t-=180));0>t?t+=360:360<=t&&(t-=360);k&&(v+=Math.abs(p));0===t?r=v:90===t?s=v:180===t?r=-v:270===t?s=-v:(r=v*Math.cos(t*Math.PI/180),s=v*Math.sin(t*Math.PI/180));if(g.Be()&&k){var x=c.eb(ec,z.O()),y=z.Tb(x.x+1E3*r,x.y+1E3*s);this.getLinkPointFromPoint(b,c,x,y,!0,q);z.A(x);
  z.A(y)}}var v=this.getLinkPoint(d,e,h,!1,l,b,c),A=0,C=0,L=0;if(l||h!==Yb||k)x=this.computeEndSegmentLength(d,e,h,!1),L=this.getLinkDirection(d,e,v,h,!1,l,b,c),k&&(L+=l?0:30,0>p&&(L+=180)),0>L?L+=360:360<=L&&(L-=360),k&&(x+=Math.abs(p)),0===L?A=x:90===L?C=x:180===L?A=-x:270===L?C=-x:(A=x*Math.cos(L*Math.PI/180),C=x*Math.sin(L*Math.PI/180)),h.Be()&&k&&(x=e.eb(ec,z.O()),y=z.Tb(x.x+1E3*A,x.y+1E3*C),this.getLinkPointFromPoint(d,e,x,y,!1,v),z.A(x),z.A(y));e=q;if(l||g!==Yb||k)e=new N(q.x+r,q.y+s);c=v;if(l||
  h!==Yb||k)c=new N(v.x+A,v.y+C);!n&&!l&&g===Yb&&3<a&&this.adjustPoints(0,q,a-2,c)?this.Kf(a-1,v):!n&&!l&&h===Yb&&3<a&&this.adjustPoints(1,e,a-1,v)?this.Kf(0,q):!n&&!l&&4<a&&this.adjustPoints(1,e,a-2,c)?(this.Kf(0,q),this.Kf(a-1,v)):!n&&l&&6<=a&&!m&&this.adjustPoints(1,e,a-2,c)?(this.Kf(0,q),this.Kf(a-1,v)):(this.ep(),this.hi(q),(l||g!==Yb||k)&&this.hi(e),l&&this.addOrthoPoints(e,t,c,L,b,d),(l||h!==Yb||k)&&this.hi(c),this.hi(v))}else g=!1,!n&&3<=a&&(n=this.getLinkPoint(b,c,Yb,!0,!1,d,e),h=this.getLinkPoint(d,
  e,Yb,!1,!1,b,c),g=this.adjustPoints(0,n,a-1,h))&&(n=this.getLinkPoint(b,c,Yb,!0,!1,d,e),h=this.getLinkPoint(d,e,Yb,!1,!1,b,c),this.adjustPoints(0,n,a-1,h)),g||(this.ep(),m?(a=this.getLinkPoint(b,c,Yb,!0,!1,d,e),n=this.getLinkPoint(d,e,Yb,!1,!1,b,c),g=n.x-a.x,h=n.y-a.y,k=this.computeCurviness(),m=l=0,q=a.x+g/3,t=a.y+h/3,r=q,s=t,eb(h,0)?s=0<g?s-k:s+k:(l=-g/h,m=Math.sqrt(k*k/(l*l+1)),0>k&&(m=-m),r=(0>h?-1:1)*m+q,s=l*(r-q)+t),q=a.x+2*g/3,t=a.y+2*h/3,v=q,A=t,eb(h,0)?A=0<g?A-k:A+k:(v=(0>h?-1:1)*m+q,A=l*
  (v-q)+t),this.ep(),this.hi(a),this.tl(r,s),this.tl(v,A),this.hi(n),this.Kf(0,this.getLinkPoint(b,c,Yb,!0,!1,d,e)),this.Kf(3,this.getLinkPoint(d,e,Yb,!1,!1,b,c))):(a=d,d=this.getLinkPoint(b,c,Yb,!0,!1,a,e),e=this.getLinkPoint(a,e,Yb,!1,!1,b,c),this.hasCurviness()?(h=e.x-d.x,b=e.y-d.y,c=this.computeCurviness(),a=d.x+h/2,n=d.y+b/2,g=a,k=n,eb(b,0)?k=0<h?k-c:k+c:(h=-h/b,g=Math.sqrt(c*c/(h*h+1)),0>c&&(g=-g),g=(0>b?-1:1)*g+a,k=h*(g-a)+n),this.hi(d),this.tl(g,k)):this.hi(d),this.hi(e)));return!0};
  function Yp(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}
  G.prototype.getLinkPointFromPoint=function(a,b,c,d,e,g){void 0===g&&(g=new N);if(null===a||null===b)return g.assign(c),g;a.isVisible()||(e=a.findVisibleNode(),null!==e&&e!==a&&(b=e.port));var h=e=0,k=0,l=0;a=null;e=b.T;null===e||e.Wg()||(e=e.T);if(null===e)e=d.x,h=d.y,k=c.x,l=c.y;else{a=e.qh;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.sp(e,h,k,l,
  g);null!==a&&g.transform(a);return g};function Zp(a,b){var c=b.gs;null===c&&(c=new $p,c.port=b,c.Pc=b.ca,b.gs=c);return aq(c,a)}
  G.prototype.getLinkPoint=function(a,b,c,d,e,g,h,k){void 0===k&&(k=new N);if(c.cd())return b.eb(c,k),k;if(c.lj()&&(c=Zp(this,b),null!==c)){k.assign(c.Fp);if(e&&this.Ix===Np){var l=Zp(this,h);if(null!==l&&c.$m<l.$m){c=z.O();var l=z.O(),m=new w(b.eb(Zb,c),b.eb(ic,l)),n=this.computeSpot(!d);a=this.getLinkPoint(g,h,n,!d,e,a,b,l);a.x>=m.x&&a.x<=m.x+m.width?k.x=a.x:a.y>=m.y&&a.y<=m.y+m.height&&(k.y=a.y);z.A(c);z.A(l)}}return k}g=b.eb(ec,z.O());l=c=null;this.sa>(e?6:2)?(l=d?this.m(1):this.m(this.sa-2),e&&
  (l=Yp(g,l.copy()))):(c=z.O(),l=h.eb(ec,c),e&&(l=Yp(g,l)),z.A(c));this.getLinkPointFromPoint(a,b,g,l,d,k);z.A(g);return k};
  G.prototype.getLinkDirection=function(a,b,c,d,e,g,h,k){a:if(d.cd())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.lj()){var l=Zp(this,b);if(null!==l)switch(l.te){case z.qd:c=270;break a;case z.Tc:c=180;break a;default:case z.fd:c=0;break a;case z.ed:c=90;break a}}var l=b.eb(ec,z.O()),m=null,n=null;this.sa>(g?6:2)?(n=e?this.m(1):this.m(this.sa-2),n=g?Yp(l,n.copy()):c):(m=z.O(),n=k.eb(ec,m),z.A(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;z.A(l)}d.Be()&&h.mi(a)&&(c+=180,360<=c&&(c-=360));a=Ap;a=e?this.Ft:this.zu;a===Ap&&(a=e?b.Ft:b.zu);switch(a){case Bp:b=b.Kl();c+=b;360<=c&&(c-=360);break;case Ap:case Gm:b=b.Kl();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};
  G.prototype.computeEndSegmentLength=function(a,b,c,d){if(null!==b&&c.lj()&&(a=Zp(this,b),null!==a))return a.Ww;a=NaN;a=d?this.Jl:this.Yl;null!==b&&isNaN(a)&&(a=d?b.Jl:b.Yl);isNaN(a)&&(a=10);return a};G.prototype.computeSpot=function(a){return a?Wp(this,this.md):Xp(this,this.Qd)};function Wp(a,b){if(null===b)return ec;var c=a.Db;c.bd()&&(void 0===b&&(b=a.md),null!==b&&(c=b.Db));return c===Pc?Yb:c}
  function Xp(a,b){if(null===b)return ec;var c=a.Eb;c.bd()&&(void 0===b&&(b=a.Qd),null!==b&&(c=b.Eb));return c===Pc?Yb:c}G.prototype.computeOtherPoint=function(a,b){var c=b.eb(ec),d;d=b.gs;d=null!==d?aq(d,this):null;null!==d&&(c=d.Fp);return c};G.prototype.computeShortLength=function(a){return a?bq(this):cq(this)};function bq(a){var b=a.Gt;isNaN(b)&&(a=a.md,null!==a&&(b=a.Gt));return isNaN(b)?0:b}function cq(a){var b=a.Au;isNaN(b)&&(a=a.Qd,null!==a&&(b=a.Au));return isNaN(b)?0:b}
  G.prototype.pk=function(a,b,c,d,e,g){if(!1===this.jg)return!1;void 0===b&&(b=null);void 0===c&&(c=null);var h=g;void 0===g&&(h=z.Hh(),h.reset());h.multiply(this.transform);if(this.Xm(a,h))return oo(this,b,c,e),void 0===g&&z.jf(h),!0;if(this.Jg(a,h)){var k=!1;if(!this.eh)for(var l=this.va.o,m=l.length;m--;){var n=l[m];if(n.visible||n===this.Zb){var p=n.W,q=this.Ga;if(!(p.x>q.width||p.y>q.height||0>p.x+p.width||0>p.y+p.height)){p=z.Hh();p.set(h);if(n instanceof I)k=n.pk(a,b,c,d,e,p);else if(this.path===
  n){var k=n,r=a,s=d,q=p;if(!1===k.jg)k=!1;else if(q.multiply(k.transform),s)b:{var t=r,v=q;if(k.Xm(t,v))k=!0;else{if(void 0===v&&(v=k.transform,t.nk(k.W))){k=!0;break b}var q=t.left,r=t.right,s=t.top,t=t.bottom,x=z.O(),y=z.O(),A=z.O(),C=z.Hh();C.set(v);C.vA(k.transform);C.fA();y.x=r;y.y=s;y.transform(C);x.x=q;x.y=s;x.transform(C);v=!1;zo(k,x,y,A)?v=!0:(x.x=r,x.y=t,x.transform(C),zo(k,x,y,A)?v=!0:(y.x=q,y.y=t,y.transform(C),zo(k,x,y,A)?v=!0:(x.x=q,x.y=s,x.transform(C),zo(k,x,y,A)&&(v=!0))));z.jf(C);
  z.A(x);z.A(y);z.A(A);k=v}}else k=k.Xm(r,q)}else k=Lm(n,a,d,p);k&&(null!==b&&(n=b(n)),n&&(null===c||c(n))&&e.add(n));z.jf(p)}}}void 0===g&&z.jf(h);return k||null!==this.background||null!==this.wl}void 0===g&&z.jf(h);return!1};z.w(G,{rc:"isOrthogonal"},function(){return 2===(this.Cm.value&2)});z.w(G,{kj:"isAvoiding"},function(){return 4===(this.Cm.value&4)});G.prototype.computeCurve=function(){if(null===this.Ei){var a=this.md,b=this.rc;this.Ei=null!==a&&a===this.Qd&&!b}return this.Ei?Xi:this.Se};
  G.prototype.computeCorner=function(){if(this.Se===Xi)return 0;var a=this.Mz;if(isNaN(a)||0>a)a=10;return a};G.prototype.findMidLabel=function(){for(var a=this.path,b=this.va.o,c=b.length,d=0;d<c;d++){var e=b[d];if(e!==a&&!e.Ff&&(-Infinity===e.De||isNaN(e.De)))return e}for(a=this.Hf;a.next();)if(b=a.value,-Infinity===b.De||isNaN(b.De))return b;return null};
  G.prototype.computeSpacing=function(){if(!this.isVisible())return 0;var a;a=Math.max(14,this.computeThickness());var b=this.md,c=this.Qd;if(null!==b&&null!==c){var d=this.findMidLabel();if(null!==d){var e=d.Ga,g=d.margin,h=isNaN(e.width)?30:e.width*d.scale+g.left+g.right,e=isNaN(e.height)?14:e.height*d.scale+g.top+g.bottom,d=d.pu;d===Co||d===Pp||d===Op?a=Math.max(a,e):d===fo||d===ho||d===co||d===eo?a=Math.max(a,h):(b=b.eb(ec).Ec(c.eb(ec))/180*Math.PI,a=Math.max(a,Math.abs(Math.sin(b)*h)+Math.abs(Math.cos(b)*
  e)+1));this.Se===Xi&&(a*=1.333)}}return a};G.prototype.arrangeBundledLinks=function(a,b){if(b)for(var c=0;c<a.length;c++)a[c].qc()};G.prototype.computeCurviness=function(){var a=this.Sw;if(isNaN(a)){var a=16,b=this.si;if(null!==b){for(var c=z.rb(),d=0,e=b.links,g=0;g<e.length;g++){var h=e[g],h=h.computeSpacing();c.push(h);d+=h}d=-d/2;for(g=0;g<e.length;g++){h=e[g];if(h===this){a=d+c[g]/2;break}d+=c[g]}b.Op===this.Y&&(a=-a);z.xa(c)}}return a};
  G.prototype.computeThickness=function(){if(!this.isVisible())return 0;var a=this.path;return null!==a?Math.max(a.ub,1):1};G.prototype.hasCurviness=function(){return!isNaN(this.Sw)||null!==this.si};
  G.prototype.adjustPoints=function(a,b,c,d){var e=this.it;if(this.rc){if(e===ln)return!1;e===mn&&(e=kn)}switch(e){case ln:var g=this.m(a),h=this.m(c);if(!g.Mc(b)||!h.Mc(d)){var e=g.x,g=g.y,k=h.x-e,l=h.y-g,m=Math.sqrt(k*k+l*l);if(!td(m,0)){var n=0;td(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;td(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.Kf(a,b);for(a+=
  1;a<c;a++)b=this.m(a),k=b.x-e,l=b.y-g,b=Math.sqrt(k*k+l*l),td(b,0)||(q=0,td(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.aa(a,h+b*Math.cos(k),p+b*Math.sin(k)));this.Kf(c,d)}}return!0;case mn:g=this.m(a);p=this.m(c);if(!g.Mc(b)||!p.Mc(d)){var e=g.x,g=g.y,h=p.x,p=p.y,m=(h-e)*(h-e)+(p-g)*(p-g),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.Kf(a,b);for(a+=1;a<c;a++){b=this.m(a);var t=b.x,v=b.y,x=.5;0!==m&&(x=
  ((e-t)*(e-h)+(g-v)*(g-p))/m);var y=e+x*(h-e),A=g+x*(p-g);b=Math.sqrt((t-y)*(t-y)+(v-A)*(v-A));v<r*(t-y)+A&&(b=-b);0<r&&(b=-b);t=k+x*(l-k);x=n+x*(q-n);0!==r?(b=t+b/s,this.aa(a,b,x-(b-t)/r)):this.aa(a,t,x+b)}this.Kf(c,d)}return!0;case kn:return this.rc&&(e=this.m(a),g=this.m(a+1),h=this.m(a+2),eb(e.y,g.y)?eb(g.x,h.x)?this.aa(a+1,g.x,b.y):eb(g.y,h.y)&&this.aa(a+1,b.x,g.y):eb(e.x,g.x)&&(eb(g.y,h.y)?this.aa(a+1,b.x,g.y):eb(g.x,h.x)&&this.aa(a+1,g.x,b.y)),e=this.m(c),g=this.m(c-1),h=this.m(c-2),eb(e.y,
  g.y)?eb(g.x,h.x)?this.aa(c-1,g.x,d.y):eb(g.y,h.y)&&this.aa(c-1,d.x,g.y):eb(e.x,g.x)&&(eb(g.y,h.y)?this.aa(c-1,d.x,g.y):eb(g.x,h.x)&&this.aa(c-1,g.x,d.y))),this.Kf(a,b),this.Kf(c,d),!0;default:return!1}};
  G.prototype.addOrthoPoints=function(a,b,c,d,e,g){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=g.W.copy();if(h.F()&&k.F()){h.bg(8,8);k.bg(8,8);h.wj(a);k.wj(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 N(c.x,a.y),m=new N(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 N(a.x,c.y);m=new N((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.Ma(a)||h.Ma(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 N(Math.max((a.x+c.x)/2,a.x),a.y),m=new N(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 N(c.x,a.y),m=new N(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 N(a.x,c.y);m=new N((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.Ma(a)||h.Ma(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 N(Math.min((a.x+c.x)/2,a.x),a.y),m=new N(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 N(a.x,c.y),m=new N((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 N(c.x,a.y);m=new N(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.Ma(a)||h.Ma(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 N(a.x,Math.max((a.y+c.y)/2,a.y)),m=new N(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 N(a.x,c.y),m=new N((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 N(c.x,a.y);m=new N(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.Ma(a)||h.Ma(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 N(a.x,Math.min((a.y+c.y)/2,a.y)),m=new N(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.kj){var q=this.h,r;(r=null===q)||(q.Va.nf?r=!1:(r=q.cb,r=r instanceof lh?!r.uw||r.cI:!0),r=!r);if(r||h.Ma(c)&&!g.mi(e)||k.Ma(a)&&!e.mi(g)||e===g||this.layer.Nc)a=!1;else if(e=ja(q,!0,this.Qa,null),e.Dp(Math.min(a.x,n.x),Math.min(a.y,n.y),Math.abs(a.x-n.x),Math.abs(a.y-n.y))&&e.Dp(Math.min(n.x,p.x),Math.min(n.y,p.y),Math.abs(n.x-p.x),Math.abs(n.y-p.y))&&e.Dp(Math.min(p.x,c.x),Math.min(p.y,c.y),Math.abs(p.x-c.x),Math.abs(p.y-c.y)))a=!1;else if(h=h.copy().ri(k),
  h.bg(2*e.dp,2*e.bp),dq(e,a,b,c,d,h),k=eq(e,c.x,c.y),e.abort||999999!==k||(lm(e),k=e.MF,h.bg(e.dp*k,e.bp*k),dq(e,a,b,c,d,h),k=eq(e,c.x,c.y)),e.abort||999999!==k||(lm(e),k=e.VE,h.bg(e.dp*k,e.bp*k),dq(e,a,b,c,d,h),k=eq(e,c.x,c.y)),!e.abort&&999999===k&&e.fG&&(lm(e),dq(e,a,b,c,d,e.vb),k=eq(e,c.x,c.y)),!e.abort&&999999>k&&0!==eq(e,c.x,c.y)){fq(this,e,c.x,c.y,d,!0);d=this.m(2);if(4>this.sa)0===b||180===b?(d.x=a.x,d.y=c.y):(d.x=c.x,d.y=a.y),this.aa(2,d.x,d.y),this.B(3,d.x,d.y);else if(c=this.m(3),0===b||
  180===b)eb(d.x,c.x)?(b=0===b?Math.max(d.x,a.x):Math.min(d.x,a.x),this.aa(2,b,a.y),this.aa(3,b,c.y)):eb(d.y,c.y)?(Math.abs(a.y-d.y)<=e.bp/2&&(this.aa(2,d.x,a.y),this.aa(3,c.x,a.y)),this.B(2,d.x,a.y)):this.aa(2,a.x,d.y);else if(90===b||270===b)eb(d.y,c.y)?(b=90===b?Math.max(d.y,a.y):Math.min(d.y,a.y),this.aa(2,a.x,b),this.aa(3,c.x,b)):eb(d.x,c.x)?(Math.abs(a.x-d.x)<=e.dp/2&&(this.aa(2,a.x,d.y),this.aa(3,a.x,c.y)),this.B(2,a.x,d.y)):this.aa(2,d.x,a.y);a=!0}else a=!1}else a=!1;a||(this.hi(l),this.hi(m))}};
  G.prototype.computeMidOrthoPosition=function(a,b){if(this.hasCurviness()){var c=this.computeCurviness();return(a+b)/2+c}return(a+b)/2};function $h(a){if(null===a.h||!a.kj)return!1;var b=a.points.o,c=b.length;if(4>c)return!1;a=ja(a.h,!0,a.Qa,null);for(var d=1;d<c-2;d++){var e=b[d],g=b[d+1];if(!a.Dp(Math.min(e.x,g.x),Math.min(e.y,g.y),Math.abs(e.x-g.x),Math.abs(e.y-g.y)))return!0}return!1}
  function fq(a,b,c,d,e,g){var h=b.dp,k=b.bp,l=eq(b,c,d),m=c,n=d;for(0===e?m+=h:90===e?n+=k:180===e?m-=h:n-=k;1<l&&eq(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(g){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&&(g=e,m=c,n=d,0===e?(g=90,n+=k):90===e?(g=180,m-=h):180===e?(g=270,n-=k):270===e&&(g=0,m+=h),eq(b,m,n)===l-1?fq(a,b,m,n,g,!1):(m=c,n=d,0===e?(g=270,n-=k):90===
  e?(g=0,m+=h):180===e?(g=90,n+=k):270===e&&(g=180,m-=h),eq(b,m,n)===l-1&&fq(a,b,m,n,g,!1)));a.tl(c,d)}G.prototype.findClosestSegment=function(a){u&&z.l(a,N,G,"findClosestSegment:p");var b=a.x;a=a.y;for(var c=this.m(0),d=this.m(1),e=ub(b,a,c.x,c.y,d.x,d.y),g=0,h=1;h<this.sa-1;h++){var c=this.m(h+1),k=ub(b,a,d.x,d.y,c.x,c.y),d=c;k<e&&(g=h,e=k)}return g};G.prototype.invalidateGeometry=G.prototype.qe=function(){this.kb=null};
  z.w(G,{wh:"geometry"},function(){null===this.kb&&(this.An(),this.kb=this.makeGeometry());return this.kb});G.prototype.nn=function(a){if(!a){if(!1===this.Dg)return;a=this.gf();if(null!==this.kb&&(null===a||null!==a.wh))return}this.kb=this.makeGeometry();a=this.path;if(null!==a){a.kb=this.kb;for(var b=this.va.o,c=b.length,d=0;d<c;d++){var e=b[d];e!==a&&e.Ff&&e instanceof X&&(e.kb=this.kb)}}};
  G.prototype.makeGeometry=function(){var a=this.sa;if(2>a){var b=new hf(jf),c=new kf(0,0);b.cc.add(c);return b}var d=!1,b=this.h;null!==b&&Tp(this)&&b.Sk.contains(this)&&null!==this.dw&&(d=!0);var c=b=0,e=this.m(0).copy(),g=e.copy(),b=this.Yc.o,h=this.computeCurve();if(h===Xi&&3<=a&&!td(this.cq,0))if(3===a)var k=this.m(1),b=Math.min(e.x,k.x),c=Math.min(e.y,k.y),k=this.m(2),b=Math.min(b,k.x),c=Math.min(c,k.y);else{if(this.rc)for(k=0;k<a;k++)c=b[k],g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);else for(k=
  3;k<a;k+=3)k+3>=a&&(k=a-1),b=this.m(k),g.x=Math.min(b.x,g.x),g.y=Math.min(b.y,g.y);b=g.x;c=g.y}else{for(k=0;k<a;k++)c=b[k],g.x=Math.min(c.x,g.x),g.y=Math.min(c.y,g.y);b=g.x;c=g.y}b-=this.rz.x;c-=this.rz.y;e.x-=b;e.y-=c;if(2!==a||Tp(this)){var l=z.v();0!==bq(this)&&gq(this,e,!0,g);R(l,e.x,e.y,!1,!1);if(h===Xi&&3<=a&&!td(this.cq,0))if(3===a)k=this.m(1),a=k.x-b,d=k.y-c,k=this.m(2).copy(),k.x-=b,k.y-=c,0!==cq(this)&&gq(this,k,!1,g),S(l,a,d,a,d,k.x,k.y);else if(this.rc){for(var g=new N(b,c),e=this.m(1).copy(),
  h=new N(b,c),a=new N(b,c),d=this.m(0),m=null,n=this.cq/3,k=1;k<this.sa-1;k++){var m=this.m(k),p=d,q=m,r=this.m(hq(this,m,k,!1));if(!td(p.x,q.x)||!td(q.x,r.x))if(!td(p.y,q.y)||!td(q.y,r.y)){var s=n,t=h,v=a;isNaN(s)&&(s=this.cq/3);var x=p.x,p=p.y,y=q.x,q=q.y,A=r.x,r=r.y,C=s*iq(x,p,y,q),s=s*iq(y,q,A,r);td(p,q)&&td(y,A)&&(y>x?r>q?(t.x=y-C,t.y=q-C,v.x=y+s,v.y=q+s):(t.x=y-C,t.y=q+C,v.x=y+s,v.y=q-s):r>q?(t.x=y+C,t.y=q-C,v.x=y-s,v.y=q+s):(t.x=y+C,t.y=q+C,v.x=y-s,v.y=q-s));td(x,y)&&td(q,r)&&(q>p?(A>y?(t.x=
  y-C,t.y=q-C,v.x=y+s):(t.x=y+C,t.y=q-C,v.x=y-s),v.y=q+s):(A>y?(t.x=y-C,t.y=q+C,v.x=y+s):(t.x=y+C,t.y=q+C,v.x=y-s),v.y=q-s));if(td(x,y)&&td(y,A)||td(p,q)&&td(q,r))x=.5*(x+A),p=.5*(p+r),t.x=x,t.y=p,v.x=x,v.y=p;1===k?(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y)):2===k&&td(d.x,this.m(0).x)&&td(d.y,this.m(0).y)&&(e.x=.5*(d.x+m.x),e.y=.5*(d.y+m.y));S(l,e.x-b,e.y-c,h.x-b,h.y-c,m.x-b,m.y-c);g.set(h);e.set(a);d=m}}k=d.x;d=d.y;g=this.m(this.sa-1);k=.5*(k+g.x);d=.5*(d+g.y);S(l,a.x-b,a.y-c,k-b,d-c,g.x-b,g.y-c)}else for(k=
  3;k<a;k+=3)d=this.m(k-2),k+3>=a&&(k=a-1),g=this.m(k-1),e=this.m(k),k===a-1&&0!==cq(this)&&(e=e.copy(),gq(this,e,!1,Id)),S(l,d.x-b,d.y-c,g.x-b,g.y-c,e.x-b,e.y-c);else{g=z.O();g.assign(this.m(0));for(k=1;k<a;){k=hq(this,g,k,1<k);t=this.m(k);if(k>=a-1){g!==t&&(0!==cq(this)&&(t=t.copy(),gq(this,t,!1,Id)),jq(this,l,-b,-c,g,t,d));break}k=hq(this,t,k+1,k<a-3);e=l;h=-b;m=-c;n=g;v=this.m(k);x=g;p=d;eb(n.y,t.y)&&eb(t.x,v.x)?(s=this.computeCorner(),s=Math.min(s,Math.abs(t.x-n.x)/2),s=y=Math.min(s,Math.abs(v.y-
  t.y)/2),eb(s,0)?(jq(this,e,h,m,n,t,p),x.assign(t)):(q=t.x,A=t.y,r=q,C=A,q=t.x>n.x?t.x-s:t.x+s,C=v.y>t.y?t.y+y:t.y-y,jq(this,e,h,m,n,new N(q,A),p),zf(e,t.x+h,t.y+m,r+h,C+m),x.n(r,C))):eb(n.x,t.x)&&eb(t.y,v.y)?(s=this.computeCorner(),y=Math.min(s,Math.abs(t.y-n.y)/2),y=s=Math.min(y,Math.abs(v.x-t.x)/2),eb(s,0)?(jq(this,e,h,m,n,t,p),x.assign(t)):(q=t.x,C=A=t.y,A=t.y>n.y?t.y-y:t.y+y,r=v.x>t.x?t.x+s:t.x-s,jq(this,e,h,m,n,new N(q,A),p),zf(e,t.x+h,t.y+m,r+h,C+m),x.n(r,C))):(jq(this,e,h,m,n,t,p),x.assign(t))}z.A(g)}b=
  l.q;z.u(l)}else l=this.m(1).copy(),l.x-=b,l.y-=c,0!==bq(this)&&gq(this,e,!0,g),0!==cq(this)&&gq(this,l,!1,g),b=new hf(mf),b.Ha=e.x,b.Da=e.y,b.L=l.x,b.M=l.y;return b};function iq(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 td(a,0)?b:td(b,0)?a:Math.sqrt(a*a+b*b)}
  function gq(a,b,c,d){var e=a.sa;if(!(2>e))if(c){var g=a.m(1);c=g.x-d.x;d=g.y-d.y;g=iq(b.x,b.y,c,d);0!==g&&(e=2===e?.5*g:g,a=bq(a),a>e&&(a=e),c=a*(c-b.x)/g,a=a*(d-b.y)/g,b.x+=c,b.y+=a)}else g=a.m(e-2),c=g.x-d.x,d=g.y-d.y,g=iq(b.x,b.y,c,d),0!==g&&(e=2===e?.5*g:g,a=cq(a),a>e&&(a=e),c=a*(b.x-c)/g,a=a*(b.y-d)/g,b.x-=c,b.y-=a)}
  function hq(a,b,c,d){for(var e=a.sa,g=b;td(b.x,g.x)&&td(b.y,g.y);){if(c>=e)return e-1;g=a.m(c++)}if(!td(b.x,g.x)&&!td(b.y,g.y))return c-1;for(var h=g;td(b.x,g.x)&&td(g.x,h.x)&&(!d||(b.y>=g.y?g.y>=h.y:g.y<=h.y))||td(b.y,g.y)&&td(g.y,h.y)&&(!d||(b.x>=g.x?g.x>=h.x:g.x<=h.x));){if(c>=e)return e-1;h=a.m(c++)}return c-2}
  function jq(a,b,c,d,e,g,h){if(!h&&Tp(a)){h=[];var k=0;a.isVisible()&&(k=kq(a,e,g,h));var l=e.x,l=e.y;if(0<k)if(eb(e.y,g.y))if(e.x<g.x)for(var m=0;m<k;){var n=Math.max(e.x,Math.min(h[m++]-5,g.x-10));b.lineTo(n+c,g.y+d);for(var l=n+c,p=Math.min(n+10,g.x);m<k;){var q=h[m];if(q<p+10)m++,p=Math.min(q+5,g.x);else break}q=(n+p)/2+c;q=g.y-10+d;n=p+c;p=g.y+d;a.Se===Pi?R(b,n,p,!1,!1):S(b,l,q,n,q,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.x,Math.max(h[m--]+5,g.x+10));b.lineTo(n+c,g.y+d);l=n+c;for(p=Math.max(n-
  10,g.x);0<=m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,g.x);else break;q=g.y-10+d;n=p+c;p=g.y+d;a.Se===Pi?R(b,n,p,!1,!1):S(b,l,q,n,q,n,p)}else if(eb(e.x,g.x))if(e.y<g.y)for(m=0;m<k;){n=Math.max(e.y,Math.min(h[m++]-5,g.y-10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.min(n+10,g.y);m<k;)if(q=h[m],q<p+10)m++,p=Math.min(q+5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.Se===Pi?R(b,n,p,!1,!1):S(b,q,l,q,p,n,p)}else for(m=k-1;0<=m;){n=Math.min(e.y,Math.max(h[m--]+5,g.y+10));b.lineTo(g.x+c,n+d);l=n+d;for(p=Math.max(n-
  10,g.y);0<=m;)if(q=h[m],q>p-10)m--,p=Math.max(q-5,g.y);else break;q=g.x-10+c;n=g.x+c;p+=d;a.Se===Pi?R(b,n,p,!1,!1):S(b,q,l,q,p,n,p)}}b.lineTo(g.x+c,g.y+d)}
  function kq(a,b,c,d){var e=a.h;if(null===e||b.N(c))return 0;for(e=e.ln;e.next();){var g=e.value;if(null!==g&&g.visible)for(var g=g.mb.o,h=g.length,k=0;k<h;k++){var l=g[k];if(l instanceof G){if(l===a)return 0<d.length&&d.sort(function(a,b){return a-b}),d.length;if(l.isVisible()&&Tp(l)){var m=l.tn;m.F()&&a.tn.Jg(m)&&!a.usesSamePort(l)&&(m=l.path,null!==m&&m.oj()&&lq(b,c,d,l))}}}}0<d.length&&d.sort(function(a,b){return a-b});return d.length}
  function lq(a,b,c,d){for(var e=eb(a.y,b.y),g=d.sa,h=d.m(0),k=z.O(),l=1;l<g;l++){var m=d.m(l);if(l<g-1){var n=d.m(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,t=h.x,h=h.y,v=m.x,x=m.y;if(!eb(p,r)){if(eb(q,s)&&eb(t,v)&&Math.min(p,r)<t&&Math.max(p,r)>t&&Math.min(h,x)<q&&Math.max(h,x)>q&&!eb(h,x)){n.x=t;n.y=q;n=!0;break a}}else if(!eb(q,s)&&eb(h,x)&&Math.min(q,s)<
  h&&Math.max(q,s)>h&&Math.min(t,v)<p&&Math.max(t,v)>p&&!eb(t,v)){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}z.A(k)}z.w(G,{Ct:"firstPickIndex"},function(){return 2>=this.sa?0:this.rc||Wp(this)!==Yb?1:0});z.w(G,{qx:"lastPickIndex"},function(){var a=this.sa;return 0===a?0:2>=a?a-1:this.rc||Xp(this)!==Yb?a-2:a-1});function Tp(a){a=a.Se;return a===Oi||a===Pi}function Vp(a,b){if(b||Tp(a)){var c=a.h;null===c||c.Sk.contains(a)||null===a.dw||c.Sk.add(a,a.dw)}}
  function Ri(a,b){var c=a.layer;if(null!==c&&c.visible&&!c.Nc){var d=c.h;if(null!==d)for(var e=!1,d=d.ln;d.next();){var g=d.value;if(g.visible)if(g===c)for(var e=!0,h=!1,g=g.mb.o,k=g.length,l=0;l<k;l++){var m=g[l];m instanceof G&&(m===a?h=!0:h&&mq(a,m,b))}else if(e)for(g=g.mb.o,k=g.length,l=0;l<k;l++)m=g[l],m instanceof G&&mq(a,m,b)}}}function mq(a,b,c){if(null!==b&&null!==b.kb&&Tp(b)){var d=b.tn;d.F()&&(a.tn.Jg(d)||c.Jg(d))&&(a.usesSamePort(b)||b.qe())}}
  G.prototype.usesSamePort=function(a){var b=this.sa,c=a.sa;if(0<b&&0<c){var d=this.m(0),e=a.m(0);if(d.Mc(e))return!0;b=this.m(b-1);a=a.m(c-1);if(b.Mc(a)||d.Mc(a)||b.Mc(e))return!0}else if(this.Y===a.Y||this.da===a.da||this.Y===a.da||this.da===a.Y)return!0;return!1};
  G.prototype.isVisible=function(){if(!D.prototype.isVisible.call(this))return!1;var a=this.Qa,b=!0,c=this.h;null!==c&&(b=c.ce);var d=this.Y;if(null!==d){if(this.Oc&&b&&!d.wd)return!1;if(d===a)return!0;for(c=d;null!==c;){if(c.od===this)return!0;c=c.Qa}c=d.findVisibleNode();if(null===c||c===a)return!1}d=this.da;if(null!==d){if(this.Oc&&!b&&!d.wd)return!1;if(d===a)return!0;for(c=d;null!==c;){if(c.od===this)return!0;c=c.Qa}b=d.findVisibleNode();if(null===b||b===a)return!1}return!0};
  G.prototype.xd=function(a){D.prototype.xd.call(this,a);null!==this.si&&this.si.zp();if(null!==this.Ke)for(var b=this.Ke.i;b.next();)b.value.xd(a)};z.defineProperty(G,{it:"adjusting"},function(){return this.mq},function(a){var b=this.mq;b!==a&&(u&&z.Ba(a,G,G,"adjusting"),this.mq=a,this.j("adjusting",b,a))});z.defineProperty(G,{Mz:"corner"},function(){return this.Fq},function(a){var b=this.Fq;b!==a&&(u&&z.g(a,"number",G,"corner"),this.Fq=a,this.qe(),this.j("corner",b,a))});
  z.defineProperty(G,{Se:"curve"},function(){return this.Iq},function(a){var b=this.Iq;b!==a&&(u&&z.Ba(a,G,G,"curve"),this.Iq=a,this.qc(),this.qe(),Vp(this,b===Pi||b===Oi||a===Pi||a===Oi),this.j("curve",b,a))});z.defineProperty(G,{Sw:"curviness"},function(){return this.Jq},function(a){var b=this.Jq;b!==a&&(u&&z.g(a,"number",G,"curviness"),this.Jq=a,this.qc(),this.qe(),this.j("curviness",b,a))});
  z.defineProperty(G,{Ix:"routing"},function(){return this.Cm},function(a){var b=this.Cm;b!==a&&(u&&z.Ba(a,G,G,"routing"),this.Cm=a,this.Ei=null,this.qc(),Vp(this,2===(b.value&2)||2===(a.value&2)),this.j("routing",b,a))});z.defineProperty(G,{cq:"smoothness"},function(){return this.Ms},function(a){var b=this.Ms;b!==a&&(u&&z.g(a,"number",G,"smoothness"),this.Ms=a,this.qe(),this.j("smoothness",b,a))});
  function Rp(a){var b=a.qg;if(null!==b){var c=a.Cg;if(null!==c){var d=a.Qh;a=a.fi;for(var e=null,g=null,h=b.mc.o,k=h.length,l=0;l<k;l++){var m=h[l];if(m.qg===b&&m.Qh===d&&m.Cg===c&&m.fi===a||m.qg===c&&m.Qh===a&&m.Cg===b&&m.fi===d)null===g?g=m:(null===e&&(e=[],e.push(g)),e.push(m))}if(null!==e){g=Ep(b,c,d,a);null===g&&(g=new xk,g.Op=b,g.Ax=d,g.du=c,g.Bx=a,Dp(b,g),Dp(c,g));g.links=e;for(l=0;l<e.length;l++)m=e[l],m.si=g;g.zp()}}}}
  function Qp(a){var b=a.si;null!==b&&(a.si=null,a=b.links.indexOf(a),0<=a&&(z.ii(b.links,a),b.zp()))}function xk(){z.kc(this);this.Av=!1;this.Bx=this.du=this.Ax=this.Op=null;this.links=[]}xk.prototype.zp=function(){if(!this.Av){var a=this.links;0<a.length&&(a=a[0].h,null!==a&&a.jC.add(this))}this.Av=!0};
  xk.prototype.dB=function(){if(this.Av){this.Av=!1;var a=this.links;if(0<a.length){var b=a[0],c=b.h;b.arrangeBundledLinks(a,null===c||c.jn);1===a.length&&(b.si=null,a.length=0)}0===a.length&&(a=this.Op,null!==this&&null!==a.Jh&&a.Jh.remove(this),a=this.du,null!==this&&null!==a.Jh&&a.Jh.remove(this))}};z.Yd(xk,{Op:!0,Ax:!0,du:!0,Bx:!0,links:!0,spacing:!0});
  function jm(){z.kc(this);this.UA=this.group=null;this.yp=!0;this.abort=!1;this.Tf=this.Sf=1;this.Hr=this.Gr=-1;this.Ad=this.Rd=8;this.lc=null;this.fG=!1;this.MF=22;this.VE=111}z.Yd(jm,{group:!0,UA:!0,yp:!0,abort:!0,fG:!0,MF:!0,VE:!0});
  jm.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.Sf=Math.floor((a.x-this.Rd)/this.Rd)*this.Rd;this.Tf=Math.floor((b-this.Ad)/this.Ad)*this.Ad;this.Gr=Math.ceil((c+2*this.Rd)/this.Rd)*this.Rd;this.Hr=Math.ceil((d+2*this.Ad)/this.Ad)*this.Ad;a=1+(Math.ceil((this.Gr-this.Sf)/this.Rd)|0);b=1+(Math.ceil((this.Hr-this.Tf)/this.Ad)|0);if(null===this.lc||this.Nm<a-1||this.Om<b-1){c=[];for(d=0;d<=a;d++){for(var e=[],g=0;g<=b;g++)e[g]=0;c[d]=e}this.lc=
  c;this.Nm=a-1;this.Om=b-1}if(null!==this.lc)for(a=0;a<=this.Nm;a++)for(b=0;b<=this.Om;b++)this.lc[a][b]=999999}};z.w(jm,{vb:null},function(){return new w(this.Sf,this.Tf,this.Gr-this.Sf,this.Hr-this.Tf)});z.defineProperty(jm,{dp:null},function(){return this.Rd},function(a){0<a&&a!==this.Rd&&(this.Rd=a,this.initialize(this.vb))});z.defineProperty(jm,{bp:null},function(){return this.Ad},function(a){0<a&&a!==this.Ad&&(this.Ad=a,this.initialize(this.vb))});
  function nq(a,b,c){return a.Sf<=b&&b<=a.Gr&&a.Tf<=c&&c<=a.Hr}function eq(a,b,c){if(!nq(a,b,c))return 0;b-=a.Sf;b/=a.Rd;c-=a.Tf;c/=a.Ad;return a.lc[b|0][c|0]}function mm(a,b,c){nq(a,b,c)&&(b-=a.Sf,b/=a.Rd,c-=a.Tf,c/=a.Ad,a.lc[b|0][c|0]=0)}function lm(a){if(null!==a.lc)for(var b=0;b<=a.Nm;b++)for(var c=0;c<=a.Om;c++)1<=a.lc[b][c]&&(a.lc[b][c]|=999999)}
  jm.prototype.Dp=function(a,b,c,d){if(a>this.Gr||a+c<this.Sf||b>this.Hr||b+d<this.Tf)return!0;a=(a-this.Sf)/this.Rd|0;b=(b-this.Tf)/this.Ad|0;c=Math.max(0,c)/this.Rd+1|0;var e=Math.max(0,d)/this.Ad+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.Nm)|0;for(c=Math.min(b+e-1,this.Om)|0;a<=d;a++)for(e=b;e<=c;e++)if(0===this.lc[a][e])return!1;return!0};
  function oq(a,b,c,d,e,g,h,k,l){if(!(b<g||b>h||c<k||c>l)){var m,n;m=b|0;n=c|0;var p=a.lc[m][n];if(1<=p&&999999>p)for(e?n+=d:m+=d,p+=1;g<=m&&m<=h&&k<=n&&n<=l&&!(p>=a.lc[m][n]);)a.lc[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)oq(a,b,c,1,!e,g,h,k,l),oq(a,b,c,-1,!e,g,h,k,l);else for(c+=d;c>m;c+=d)oq(a,b,c,1,!e,g,h,k,l),oq(a,b,c,-1,!e,g,h,k,l);else if(0<d)for(b+=d;b<m;b+=d)oq(a,b,c,1,!e,g,h,k,l),oq(a,b,c,-1,!e,g,h,k,l);else for(b+=d;b>m;b+=d)oq(a,b,c,1,!e,g,h,k,l),oq(a,b,c,-1,!e,g,h,
  k,l)}}function pq(a,b,c,d,e,g,h,k,l,m,n){for(var p=b|0,q=c|0,r=a.lc[p][q];0===r&&p>k&&p<l&&q>m&&q<n;)if(h?q+=g:p+=g,r=a.lc[p][q],1>=Math.abs(p-d)&&1>=Math.abs(q-e))return a.abort=!0,0;p=b|0;q=c|0;r=a.lc[p][q];b=1;for(a.lc[p][q]=b;0===r&&p>k&&p<l&&q>m&&q<n;)h?q+=g:p+=g,r=a.lc[p][q],a.lc[p][q]=b,b+=1;return h?q:p}
  function dq(a,b,c,d,e,g){if(null!==a.lc){a.abort=!1;var h=b.x,k=b.y;if(nq(a,h,k)){var h=h-a.Sf,h=h/a.Rd,k=k-a.Tf,k=k/a.Ad,l=d.x,m=d.y;if(nq(a,l,m))if(l-=a.Sf,l/=a.Rd,m-=a.Tf,m/=a.Ad,1>=Math.abs(h-l)&&1>=Math.abs(k-m))a.abort=!0;else{var n=g.x;b=g.y;d=g.x+g.width;var p=g.y+g.height,n=n-a.Sf,n=n/a.Rd;b-=a.Tf;b/=a.Ad;d-=a.Sf;d/=a.Rd;p-=a.Tf;p/=a.Ad;g=Math.max(0,Math.min(a.Nm,n|0));d=Math.min(a.Nm,Math.max(0,d|0));b=Math.max(0,Math.min(a.Om,b|0));var p=Math.min(a.Om,Math.max(0,p|0)),h=h|0,k=k|0,l=l|0,
  m=m|0,n=h,q=k,r=0===c||90===c?1:-1;(c=90===c||270===c)?q=pq(a,h,k,l,m,r,c,g,d,b,p):n=pq(a,h,k,l,m,r,c,g,d,b,p);if(!a.abort){a:{c=0===e||90===e?1:-1;e=90===e||270===e;for(var r=l|0,s=m|0,t=a.lc[r][s];0===t&&r>g&&r<d&&s>b&&s<p;)if(e?s+=c:r+=c,t=a.lc[r][s],1>=Math.abs(r-h)&&1>=Math.abs(s-k)){a.abort=!0;break a}r=l|0;s=m|0;t=a.lc[r][s];for(a.lc[r][s]=999999;0===t&&r>g&&r<d&&s>b&&s<p;)e?s+=c:r+=c,t=a.lc[r][s],a.lc[r][s]=999999}a.abort||(oq(a,n,q,1,!1,g,d,b,p),oq(a,n,q,-1,!1,g,d,b,p),oq(a,n,q,1,!0,g,d,
  b,p),oq(a,n,q,-1,!0,g,d,b,p))}}}}}function $p(){z.kc(this);this.port=this.Pc=null;this.gg=[];this.Np=!1}z.Yd($p,{Pc:!0,port:!0,gg:!0,Np:!0});$p.prototype.toString=function(){for(var a=this.gg,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 qq(a,b,c,d){b=b.offsetY;switch(b){case z.ed:return 90;case z.Tc:return 180;case z.qd:return 270;case z.fd:return 0}switch(b){case z.ed|z.qd:return 180<c?270:90;case z.Tc|z.fd:return 90<c&&270>=c?180:0}a=180*Math.atan2(a.height,a.width)/Math.PI;switch(b){case z.Tc|z.qd:return c>a&&c<=180+a?180:270;case z.qd|z.fd:return c>180-a&&c<=360-a?270:0;case z.fd|z.ed:return c>a&&c<=180+a?90:0;case z.ed|z.Tc:return c>180-a&&c<=360-a?180:90;case z.Tc|z.qd|z.fd:return 90<c&&c<=180+a?180:c>180+a&&c<=360-
  a?270:0;case z.qd|z.fd|z.ed:return 180<c&&c<=360-a?270:c>a&&180>=c?90:0;case z.fd|z.ed|z.Tc:return c>a&&c<=180-a?90:c>180-a&&270>=c?180:0;case z.ed|z.Tc|z.qd:return c>180-a&&c<=180+a?180:c>180+a?270:90}d&&b!==(z.Tc|z.qd|z.fd|z.ed)&&(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}$p.prototype.zp=function(){this.gg.length=0};
  function aq(a,b){var c=a.gg;if(0===c.length){a:if(!a.Np){c=a.Np;a.Np=!0;var d,e=null,g=a.Pc,g=g instanceof F?g:null;if(null===g||g.se)d=a.Pc.pE(a.port.zd);else{if(!g.W.F()){a.Np=c;break a}e=g;d=e.oE()}var h=a.gg.length=0,k=a.port.eb(Zb,z.O()),l=a.port.eb(ic,z.O()),g=z.zk(k.x,k.y,0,0);g.wj(l);z.A(k);z.A(l);k=z.Tb(g.x+g.width/2,g.y+g.height/2);for(d=d.i;d.next();)if(l=d.value,l.isVisible()){var m=Yb,n=l.md===a.port||l.Y.mi(e),m=n?Wp(l,a.port):Xp(l,a.port);if(m.lj()&&(n=n?l.Qd:l.md,null!==n)){var p=
  n.ca;if(null!==p){var n=l.computeOtherPoint(p,n),p=k.Ec(n),m=qq(g,m,p,l.rc),q=0;0===m?(q=z.fd,180<p&&(p-=360)):q=90===m?z.ed:180===m?z.Tc:z.qd;m=a.gg[h];void 0===m?(m=new rq(l,p,q),a.gg[h]=m):(m.link=l,m.angle=p,m.te=q);m.yx.set(n);h++}}}z.A(k);a.gg.sort($p.prototype.KI);e=a.gg.length;k=-1;for(h=d=0;h<e;h++)m=a.gg[h],void 0!==m&&(m.te!==k&&(k=m.te,d=0),m.wp=d,d++);k=-1;d=0;for(h=e-1;0<=h;h--)m=a.gg[h],void 0!==m&&(m.te!==k&&(k=m.te,d=m.wp+1),m.$m=d);h=a.gg;n=a.port;e=a.Pc.SI;k=z.O();d=z.O();l=z.O();
  m=z.O();n.eb(Zb,k);n.eb(cc,d);n.eb(ic,l);n.eb(gc,m);var r=q=p=n=0;if(e===Cp)for(var s=0;s<h.length;s++){var t=h[s];if(null!==t){var v=t.link.computeThickness();switch(t.te){case z.ed:q+=v;break;case z.Tc:r+=v;break;case z.qd:n+=v;break;default:case z.fd:p+=v}}}for(var x=0,y=0,A=1,s=0;s<h.length;s++)if(t=h[s],null!==t){var C,L;if(x!==t.te){x=t.te;switch(x){case z.ed:C=l;L=m;break;case z.Tc:C=m;L=k;break;case z.qd:C=k;L=d;break;default:case z.fd:C=d,L=l}var H=L.x-C.x;L=L.y-C.y;switch(x){case z.ed:q>
  Math.abs(H)?(A=Math.abs(H)/q,q=Math.abs(H)):A=1;break;case z.Tc:r>Math.abs(L)?(A=Math.abs(L)/r,r=Math.abs(L)):A=1;break;case z.qd:n>Math.abs(H)?(A=Math.abs(H)/n,n=Math.abs(H)):A=1;break;default:case z.fd:p>Math.abs(L)?(A=Math.abs(L)/p,p=Math.abs(L)):A=1}y=0}var U=t.Fp;if(e===Cp){v=t.link.computeThickness();v*=A;U.set(C);switch(x){case z.ed:U.x=C.x+H/2+q/2-y-v/2;break;case z.Tc:U.y=C.y+L/2+r/2-y-v/2;break;case z.qd:U.x=C.x+H/2-n/2+y+v/2;break;default:case z.fd:U.y=C.y+L/2-p/2+y+v/2}y+=v}else v=.5,
  e===zp&&(v=(t.wp+1)/(t.$m+1)),U.x=C.x+H*v,U.y=C.y+L*v}z.A(k);z.A(d);z.A(l);z.A(m);C=a.gg;for(H=0;H<C.length;H++)L=C[H],null!==L&&(L.Ww=a.computeEndSegmentLength(L));a.Np=c;z.dc(g)}c=a.gg}for(g=0;g<c.length;g++)if(C=c[g],null!==C&&C.link===b)return C;return null}$p.prototype.KI=function(a,b){return a===b?0:null===a?-1:null===b?1:a.te<b.te?-1:a.te>b.te?1:a.angle<b.angle?-1:a.angle>b.angle?1:0};
  $p.prototype.computeEndSegmentLength=function(a){var b=a.link,c=b.computeEndSegmentLength(this.Pc,this.port,Yb,b.md===this.port),d=a.wp;if(0>d)return c;var e=a.$m;if(1>=e||!b.rc)return c;var b=a.yx,g=a.Fp;if(a.te===z.Tc||a.te===z.ed)d=e-1-d;return((a=a.te===z.Tc||a.te===z.fd)?b.y<g.y:b.x<g.x)?c+8*d:(a?b.y===g.y:b.x===g.x)?c:c+8*(e-1-d)};function rq(a,b,c){this.link=a;this.angle=b;this.te=c;this.yx=new N;this.$m=this.wp=0;this.Fp=new N;this.Ww=0}
  z.Yd(rq,{link:!0,angle:!0,te:!0,yx:!0,wp:!0,$m:!0,Fp:!0,Ww:!0});rq.prototype.toString=function(){return this.link.toString()+" "+this.angle.toString()+" "+this.te.toString()+":"+this.wp.toString()+"/"+this.$m.toString()+" "+this.Fp.toString()+" "+this.Ww.toString()+" "+this.yx.toString()};function Fm(){this.hk=this.Hj=Pc;this.fk=this.Fj=NaN;this.ek=this.Ej=Ap;this.gk=this.Gj=NaN}
  Fm.prototype.copy=function(){var a=new Fm;a.Hj=this.Hj.V();a.hk=this.hk.V();a.Fj=this.Fj;a.fk=this.fk;a.Ej=this.Ej;a.ek=this.ek;a.Gj=this.Gj;a.gk=this.gk;return a};function F(a){0===arguments.length?E.call(this,gj):E.call(this,a);this.Jr=new K(D);this.vm=new K(F);this.il=this.Kr=this.Ir=null;this.$s=!1;this.pr=!0;this.at=!1;this.Lb=this.Qs=null;this.xq=!1;this.yq=!0;this.er=this.zq=!1;this.he=new yg;this.he.group=this;this.fz=!1}z.Ra(F,E);z.ia("Group",F);
  F.prototype.cloneProtected=function(a){E.prototype.cloneProtected.call(this,a);a.Ir=this.Ir;a.Kr=this.Kr;a.il=this.il;a.$s=this.$s;a.pr=this.pr;a.at=this.at;a.Qs=this.Qs;var b=a.zt(function(a){return a instanceof aj});a.Lb=b instanceof aj?b:null;a.xq=this.xq;a.yq=this.yq;a.zq=this.zq;a.er=this.er;null!==this.he?(a.he=this.he.copy(),a.he.group=a):(null!==a.he&&(a.he.group=null),a.he=null)};
  F.prototype.ki=function(a){E.prototype.ki.call(this,a);var b=a.mp();for(a=a.Hc;a.next();){var c=a.value;c.Q();c.I(8);c.pt();if(c instanceof E)c.mf(b);else if(c instanceof G)for(c=c.Hf;c.next();)c.value.mf(b)}};
  F.prototype.sn=function(a,b,c,d,e,g,h){if(a===Wf&&"elements"===b)if(e instanceof aj){var k=e;null===this.Lb?this.Lb=k:this.Lb!==k&&z.k("Cannot insert a second Placeholder into the visual tree of a Group.")}else e instanceof I&&(k=e.zt(function(a){return a instanceof aj}),k instanceof aj&&(null===this.Lb?this.Lb=k:this.Lb!==k&&z.k("Cannot insert a second Placeholder into the visual tree of a Group.")));else a===Xf&&"elements"===b&&null!==this.Lb&&(d===this.Lb?this.Lb=null:d instanceof I&&this.Lb.Pl(d)&&
  (this.Lb=null));E.prototype.sn.call(this,a,b,c,d,e,g,h)};F.prototype.aj=function(a,b,c,d){this.hl=this.Lb;I.prototype.aj.call(this,a,b,c,d)};F.prototype.Ql=function(){if(!E.prototype.Ql.call(this))return!1;for(var a=this.Hc;a.next();){var b=a.value;if(b instanceof E){if(b.isVisible()&&nl(b))return!1}else if(b instanceof G&&b.isVisible()&&nl(b)&&b.Y!==this&&b.da!==this)return!1}return!0};z.w(F,{placeholder:"placeholder"},function(){return this.Lb});
  z.defineProperty(F,{UD:"computesBoundsAfterDrag"},function(){return this.xq},function(a){var b=this.xq;b!==a&&(z.g(a,"boolean",F,"computesBoundsAfterDrag"),this.xq=a,this.j("computesBoundsAfterDrag",b,a))});z.defineProperty(F,{Pw:"computesBoundsIncludingLinks"},function(){return this.yq},function(a){z.g(a,"boolean",F,"computesBoundsIncludingLinks");var b=this.yq;b!==a&&(this.yq=a,this.j("computesBoundsIncludingLinks",b,a))});
  z.defineProperty(F,{fH:"computesBoundsIncludingLocation"},function(){return this.zq},function(a){z.g(a,"boolean",F,"computesBoundsIncludingLocation");var b=this.zq;b!==a&&(this.zq=a,this.j("computesBoundsIncludingLocation",b,a))});z.defineProperty(F,{TH:"handlesDragDropForMembers"},function(){return this.er},function(a){z.g(a,"boolean",F,"handlesDragDropForMembers");var b=this.er;b!==a&&(this.er=a,this.j("handlesDragDropForMembers",b,a))});z.w(F,{Hc:"memberParts"},function(){return this.Jr.i});
  function vp(a,b){if(a.Jr.add(b)){b instanceof F&&a.vm.add(b);var c=a.CI;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.$a,e.$a=!0);c(a,b);null!==e&&(e.$a=d)}a.isVisible()&&a.se||b.xd(!1)}b instanceof G&&!a.Pw||(c=a.Lb,null===c&&(c=a),c.Q())}function up(a,b){if(a.Jr.remove(b)){b instanceof F&&a.vm.remove(b);var c=a.DI;if(null!==c){var d=!0,e=a.h;null!==e&&(d=e.$a,e.$a=!0);c(a,b);null!==e&&(e.$a=d)}a.isVisible()&&a.se||b.xd(!0)}b instanceof G&&!a.Pw||(c=a.Lb,null===c&&(c=a),c.Q())}
  F.prototype.bn=function(){if(0<this.Jr.count){var a=this.h;if(null!==a)for(var b=this.Jr.copy().i;b.next();)a.remove(b.value)}E.prototype.bn.call(this)};z.defineProperty(F,{Sb:"layout"},function(){return this.he},function(a){var b=this.he;b!==a&&(null!==a&&z.l(a,yg,F,"layout"),null!==b&&(b.h=null,b.group=null),this.he=a,null!==a&&(a.h=this.h,a.group=this),this.j("layout",b,a))});
  z.defineProperty(F,{CI:"memberAdded"},function(){return this.Ir},function(a){var b=this.Ir;b!==a&&(null!==a&&z.g(a,"function",F,"memberAdded"),this.Ir=a,this.j("memberAdded",b,a))});z.defineProperty(F,{DI:"memberRemoved"},function(){return this.Kr},function(a){var b=this.Kr;b!==a&&(null!==a&&z.g(a,"function",F,"memberRemoved"),this.Kr=a,this.j("memberRemoved",b,a))});
  z.defineProperty(F,{qA:"memberValidation"},function(){return this.il},function(a){var b=this.il;b!==a&&(null!==a&&z.g(a,"function",F,"memberValidation"),this.il=a,this.j("memberValidation",b,a))});F.prototype.canAddMembers=function(a){var b=this.h;if(null===b)return!1;b=b.wb;for(a=nh(a).i;a.next();)if(!b.isValidMember(this,a.value))return!1;return!0};
  F.prototype.addMembers=function(a,b){var c=this.h;if(null===c)return!1;for(var c=c.wb,d=!0,e=nh(a).i;e.next();){var g=e.value;!b||c.isValidMember(this,g)?g.Qa=this:d=!1}return d};z.defineProperty(F,{zJ:"ungroupable"},function(){return this.$s},function(a){var b=this.$s;b!==a&&(z.g(a,"boolean",F,"ungroupable"),this.$s=a,this.j("ungroupable",b,a))});F.prototype.canUngroup=function(){if(!this.zJ)return!1;var a=this.layer;if(null!==a&&!a.Jw)return!1;a=a.h;return null===a||a.Jw?!0:!1};
  F.prototype.mf=function(a){void 0===a&&(a=null);E.prototype.mf.call(this,a);for(var b=this.oE();b.next();){var c=b.value;if(null===a||!a.contains(c)){var d=c.Y;null!==d&&d!==this&&d.mi(this)&&!d.isVisible()?c.qc():(d=c.da,null!==d&&d!==this&&d.mi(this)&&!d.isVisible()&&c.qc())}}};F.prototype.findExternalLinksConnected=F.prototype.oE=function(){var a=this.mp();a.add(this);for(var b=new K(G),c=a.i;c.next();){var d=c.value;if(d instanceof E)for(d=d.ee;d.next();){var e=d.value;a.contains(e)||b.add(e)}}return b.i};
  F.prototype.findExternalNodesConnected=function(){var a=this.mp();a.add(this);for(var b=new K(E),c=a.i;c.next();){var d=c.value;if(d instanceof E)for(d=d.ee;d.next();){var e=d.value,g=e.Y;a.contains(g)&&g!==this||b.add(g);e=e.da;a.contains(e)&&e!==this||b.add(e)}}return b.i};F.prototype.findContainingGroupChain=function(){function a(b,d){null!==b&&(d.add(b),a(b.Qa,d))}var b=new K(D);a(this,b);return b};
  F.prototype.findSubGraphParts=F.prototype.mp=function(){var a=new K(D);hh(a,this,!0,0,!0);a.remove(this);return a};F.prototype.xd=function(a){E.prototype.xd.call(this,a);for(var b=this.Hc;b.next();)b.value.xd(a)};F.prototype.collapseSubGraph=F.prototype.collapseSubGraph=function(){var a=this.h;if(null!==a&&!a.xh){a.xh=!0;var b=this.mp();sq(this,b,a.Va,this);a.xh=!1}};
  function sq(a,b,c,d){for(var e=a.Hc;e.next();){var g=e.value;g.xd(!1);if(g instanceof F){var h=g;h.se&&(h.fB=h.se,sq(h,b,c,d))}if(g instanceof E)g.mf(b),fk(c,g,d);else if(g instanceof G)for(g=g.Hf;g.next();)g.value.mf(b)}a.se=!1}F.prototype.expandSubGraph=F.prototype.expandSubGraph=function(){var a=this.h;if(null!==a&&!a.xh){a.xh=!0;var b=this.mp();tq(this,b,a.Va,this);a.xh=!1}};
  function tq(a,b,c,d){for(var e=a.Hc;e.next();){var g=e.value;g.xd(!0);if(g instanceof F){var h=g;h.fB&&(h.fB=!1,tq(h,b,c,d))}if(g instanceof E)g.mf(b),ek(c,g,d);else if(g instanceof G)for(g=g.Hf;g.next();)g.value.mf(b)}a.se=!0}
  z.defineProperty(F,{se:"isSubGraphExpanded"},function(){return this.pr},function(a){var b=this.pr;if(b!==a){z.g(a,"boolean",F,"isSubGraphExpanded");this.pr=a;var c=this.h;this.j("isSubGraphExpanded",b,a);b=this.pJ;if(null!==b){var d=!0;null!==c&&(d=c.$a,c.$a=!0);b(this);null!==c&&(c.$a=d)}null!==c&&c.pa.qb?null!==this.Lb&&this.Lb.Q():a?this.expandSubGraph():this.collapseSubGraph()}});
  z.defineProperty(F,{fB:"wasSubGraphExpanded"},function(){return this.at},function(a){var b=this.at;b!==a&&(z.g(a,"boolean",F,"wasSubGraphExpanded"),this.at=a,this.j("wasSubGraphExpanded",b,a))});z.defineProperty(F,{pJ:"subGraphExpandedChanged"},function(){return this.Qs},function(a){var b=this.Qs;b!==a&&(null!==a&&z.g(a,"function",F,"subGraphExpandedChanged"),this.Qs=a,this.j("subGraphExpandedChanged",b,a))});
  F.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=z.Tb(c,b);E.prototype.move.call(this,a);for(a=this.mp().i;a.next();){var e=a.value;if(!(e instanceof G||e instanceof E&&e.Df)){var g=e.position,h=e.location;g.F()?(d.x=g.x+c,d.y=g.y+b,e.position=d):h.F()&&(d.x=h.x+c,d.y=h.y+b,e.location=d)}}for(a.reset();a.next();)e=a.value,e instanceof G&&(g=e.position,d.x=g.x+c,d.y=g.y+b,e.move(d));z.A(d)};
  function aj(){O.call(this);this.df=Kd;this.ws=new w(NaN,NaN,NaN,NaN)}z.Ra(aj,O);z.ia("Placeholder",aj);aj.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.df=this.df.V();a.ws=this.ws.copy()};aj.prototype.mk=function(a){if(null===this.background&&null===this.wl)return!1;var b=this.Ga;return Ib(0,0,b.width,b.height,a.x,a.y)};
  aj.prototype.Ip=function(){var a=this.ca;null!==a&&(a instanceof F||a instanceof da)||z.k("Placeholder is not inside a Group or Adornment.");if(a instanceof F){var b=this.computeBorder(this.ws),c=this.Wc;yb(c,b.width||0,b.height||0);Jm(this,0,0,c.width,c.height);for(var c=a.Hc,d=!1;c.next();)if(c.value.isVisible()){d=!0;break}!d||isNaN(b.x)||isNaN(b.y)||(c=new N,c.ru(b,a.of),a.location=new N(c.x,c.y))}else{var b=this.Aa,c=this.Wc,d=this.padding,e=d.left+d.right,g=d.top+d.bottom;if(b.F())yb(c,b.width+
  e||0,b.height+g||0),Jm(this,-d.left,-d.top,c.width,c.height);else{var h=a.fc,k=h.eb(Zb,z.O()),b=z.zk(k.x,k.y,0,0);b.wj(h.eb(ic,k));b.wj(h.eb(cc,k));b.wj(h.eb(gc,k));a.Li.n(b.x,b.y);yb(c,b.width+e||0,b.height+g||0);Jm(this,-d.left,-d.top,c.width,c.height);z.A(k);z.dc(b)}}};aj.prototype.aj=function(a,b,c,d){var e=this.W;e.x=a;e.y=b;e.width=c;e.height=d};
  aj.prototype.computeBorder=function(a){var b=this.ca;if(b instanceof F){var c=b;if(c.UD&&this.ws.F()){var d=c.h;if(null!==d&&(d=d.cb,d instanceof lh&&!d.Uq&&null!==d.hc&&!d.hc.contains(c)))return a.assign(this.ws),a}}var c=z.lg(),d=this.computeMemberBounds(c),e=this.padding;a.n(d.x-e.left,d.y-e.top,d.width+e.left+e.right,d.height+e.top+e.bottom);z.dc(c);b instanceof F&&(c=b,c.fH&&c.location.F()&&a.wj(c.location));return a};
  aj.prototype.computeMemberBounds=function(a){if(!(this.ca instanceof F))return a.n(0,0,0,0),a;for(var b=this.ca,c=Infinity,d=Infinity,e=-Infinity,g=-Infinity,h=b.Hc;h.next();){var k=h.value;if(k.isVisible()){if(k instanceof G){var l=k;if(!b.Pw)continue;if(ml(l))continue;if(l.Y===b||l.da===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>g&&(g=k.bottom)}}isFinite(c)&&isFinite(d)?a.n(c,d,e-c,g-d):(b=b.location,c=this.padding,a.n(b.x+c.left,b.y+c.top,0,0));return a};
  z.defineProperty(aj,{padding:"padding"},function(){return this.df},function(a){"number"===typeof a?((isNaN(a)||0>a)&&z.ka(a,">= 0",aj,"padding"),a=new Db(a)):(z.l(a,Db,aj,"padding"),(isNaN(a.left)||0>a.left)&&z.ka(a.left,">= 0",aj,"padding:value.left"),(isNaN(a.right)||0>a.right)&&z.ka(a.right,">= 0",aj,"padding:value.right"),(isNaN(a.top)||0>a.top)&&z.ka(a.top,">= 0",aj,"padding:value.top"),(isNaN(a.bottom)||0>a.bottom)&&z.ka(a.bottom,">= 0",aj,"padding:value.bottom"));var b=this.df;b.N(a)||(this.df=
  a=a.V(),this.j("padding",b,a))});function yg(){0<arguments.length&&z.pd(yg);z.kc(this);this.Ry=this.Z=null;this.Lj=this.lr=!0;this.ur=!1;this.pq=(new N(0,0)).freeze();this.nr=this.or=!0;this.VB="";this.to=!1;this.gz=null}z.ia("Layout",yg);yg.prototype.cloneProtected=function(a){a.lr=this.lr;a.Lj=this.Lj;a.ur=this.ur;a.pq.assign(this.pq);a.or=this.or;a.nr=this.nr;a.VB=this.VB;this.Lj||(a.to=!0)};yg.prototype.copy=function(){var a=new this.constructor;this.cloneProtected(a);return a};
  yg.prototype.toString=function(){var a=z.kf(Object.getPrototypeOf(this)),a=a+"(";null!==this.group&&(a+=" in "+this.group);null!==this.h&&(a+=" for "+this.h);return a+")"};z.defineProperty(yg,{h:"diagram"},function(){return this.Z},function(a){null!==a&&z.l(a,B,yg,"diagram");this.Z=a});z.defineProperty(yg,{group:"group"},function(){return this.Ry},function(a){this.Ry!==a&&(null!==a&&z.l(a,F,yg,"group"),this.Ry=a,null!==a&&(this.Z=a.h))});
  z.defineProperty(yg,{hI:"isOngoing"},function(){return this.lr},function(a){this.lr!==a&&(z.g(a,"boolean",yg,"isOngoing"),this.lr=a)});z.defineProperty(yg,{QE:"isInitial"},function(){return this.Lj},function(a){z.g(a,"boolean",yg,"isInitial");this.Lj=a;a||(this.to=!0)});z.defineProperty(yg,{ox:"isViewportSized"},function(){return this.ur},function(a){this.ur!==a&&(z.g(a,"boolean",yg,"isViewportSized"),(this.ur=a)&&this.I())});
  z.defineProperty(yg,{Rt:"isRouting"},function(){return this.or},function(a){this.or!==a&&(z.g(a,"boolean",yg,"isRouting"),this.or=a)});z.defineProperty(yg,{RE:"isRealtime"},function(){return this.nr},function(a){this.nr!==a&&(z.g(a,"boolean",yg,"isRealtime"),this.nr=a)});z.defineProperty(yg,{Gf:"isValidLayout"},function(){return this.to},function(a){this.to!==a&&(z.g(a,"boolean",yg,"isValidLayout"),this.to=a,a||(a=this.h,null!==a&&(a.Qu=!0)))});
  yg.prototype.invalidateLayout=yg.prototype.I=function(){if(this.to){var a=this.h;if(null!==a&&!a.pa.qb){var b=a.Va;!b.so&&(b.nf&&b.pi(),this.hI&&a.jn||this.QE&&!a.jn)&&(this.Gf=!1,a.Ce())}}};z.defineProperty(yg,{network:"network"},function(){return this.gz},function(a){var b=this.gz;b!==a&&(null!==a&&z.l(a,wa,yg,"network"),null!==b&&(b.Sb=null),this.gz=a,null!==a&&(a.Sb=this))});yg.prototype.createNetwork=function(){return new wa};
  yg.prototype.makeNetwork=function(a){var b=this.createNetwork();b.Sb=this;a instanceof B?(b.jk(a.Mg,!0),b.jk(a.links,!0)):a instanceof F?b.jk(a.Hc):b.jk(a.i);return b};yg.prototype.updateParts=function(){var a=this.h;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.h,null!==a))break}this.Gf=!0;try{null!==a&&a.Wb("Layout"),this.commitLayout()}finally{null!==a&&a.Kd("Layout")}};
  yg.prototype.commitLayout=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();if(this.Rt)for(a=this.network.edges.i;a.next();)a.value.commit()};
  yg.prototype.doLayout=function(a){null===a&&z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");var b=new K(D);a instanceof B?(uq(this,b,a.Mg,!0,this.wA,!0,!1,!0),uq(this,b,a.oi,!0,this.wA,!0,!1,!0)):a instanceof F?uq(this,b,a.Hc,!1,this.wA,!0,!1,!0):b.$c(a.i);var c=b.count;if(0<c){a=this.h;null!==a&&a.Wb("Layout");for(var c=Math.ceil(Math.sqrt(c)),d=this.je.x,e=d,g=this.je.y,h=0,k=0,b=b.i;b.next();){var l=b.value;l.Bf();var m=l.Ia,n=m.width,
  m=m.height;l.moveTo(e,g);l.fz=!1;e+=Math.max(n,50)+20;k=Math.max(k,Math.max(m,50));h>=c-1?(h=0,e=d,g+=k+20,k=0):h++}null!==a&&a.Kd("Layout")}this.Gf=!0};yg.prototype.wA=function(a){return!a.location.F()||a instanceof F&&a.fz?!0:!1};
  function uq(a,b,c,d,e,g,h,k){for(c=c.i;c.next();){var l=c.value;d&&!l.Bp||null!==e&&!e(l)||!l.canLayout()||(g&&l instanceof E?l.Df||(l instanceof F?null===l.Sb?uq(a,b,l.Hc,!1,e,g,h,k):b.add(l):b.add(l)):h&&l instanceof G?b.add(l):!k||!l.be()||l instanceof E||b.add(l))}}
  yg.prototype.collectParts=yg.prototype.$G=function(a){var b=new K(D);a instanceof B?(uq(this,b,a.Mg,!0,null,!0,!0,!0),uq(this,b,a.links,!0,null,!0,!0,!0),uq(this,b,a.oi,!0,null,!0,!0,!0)):a instanceof F?uq(this,b,a.Hc,!1,null,!0,!0,!0):uq(this,b,a.i,!1,null,!0,!0,!0);return b};z.defineProperty(yg,{je:"arrangementOrigin"},function(){return this.pq},function(a){z.l(a,N,yg,"arrangementOrigin");this.pq.N(a)||(this.pq.assign(a),this.I())});
  yg.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.eb(Zb),(isNaN(c.x)||isNaN(c.y))&&c.set(a),c.x+=b.padding.left,c.y+=b.padding.top);return c}return a};function wa(){z.kc(this);this.he=null;this.clear()}z.ia("LayoutNetwork",wa);
  wa.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 K(xa);this.edges=new K(ya);this.AA=new na(E,xa);this.mA=new na(G,ya)};
  wa.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutNetwork"+(null!==this.Sb?"("+this.Sb.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};z.defineProperty(wa,{Sb:"layout"},function(){return this.he},function(a){u&&null!==a&&z.l(a,yg,wa,"layout");this.he=a});wa.prototype.createVertex=function(){return new xa};
  wa.prototype.createEdge=function(){return new ya};
  wa.prototype.addParts=wa.prototype.jk=function(a,b,c){if(null!==a){void 0===b&&(b=!1);z.g(b,"boolean",wa,"addParts:toplevelonly");void 0===c&&(c=null);null===c&&(c=function(a){if(a instanceof E)return!a.Df;if(a instanceof G){var b=a.Y;if(null===b||b.Df)return!1;a=a.da;return null===a||a.Df?!1:!0}return!1});for(a=a.i;a.next();){var d=a.value;if(d instanceof E&&(!b||d.Bp)&&d.canLayout()&&c(d))if(d instanceof F&&null===d.Sb)this.jk(d.Hc,!1);else if(null===this.dn(d)){var e=this.createVertex();e.Pc=d;
  this.ul(e)}}for(a.reset();a.next();)if(d=a.value,d instanceof G&&(!b||d.Bp)&&d.canLayout()&&c(d)&&null===this.Yw(d)){var g=d.Y,e=d.da;null!==g&&null!==e&&g!==e&&(g=this.findGroupVertex(g),e=this.findGroupVertex(e),null!==g&&null!==e&&this.Hp(g,e,d))}}};wa.prototype.findGroupVertex=function(a){if(null===a)return null;var b=a.findVisibleNode();if(null===b)return null;a=this.dn(b);if(null!==a)return a;for(b=b.Qa;null!==b;){a=this.dn(b);if(null!==a)return a;b=b.Qa}return null};
  wa.prototype.addVertex=wa.prototype.ul=function(a){if(null!==a){u&&z.l(a,xa,wa,"addVertex:vertex");this.vertexes.add(a);var b=a.Pc;null!==b&&this.AA.add(b,a);a.network=this}};wa.prototype.addNode=wa.prototype.ht=function(a){if(null===a)return null;u&&z.l(a,E,wa,"addNode:node");var b=this.dn(a);null===b&&(b=this.createVertex(),b.Pc=a,this.ul(b));return b};
  wa.prototype.deleteVertex=wa.prototype.fE=function(a){if(null!==a&&(u&&z.l(a,xa,wa,"deleteVertex:vertex"),vq(this,a))){for(var b=a.Ze,c=b.count-1;0<=c;c--){var d=b.ea(c);this.hp(d)}b=a.Te;for(c=b.count-1;0<=c;c--)d=b.ea(c),this.hp(d)}};function vq(a,b){if(null===b)return!1;var c=a.vertexes.remove(b);c&&(a.AA.remove(b.Pc),b.network=null);return c}wa.prototype.deleteNode=function(a){null!==a&&(u&&z.l(a,E,wa,"deleteNode:node"),a=this.dn(a),null!==a&&this.fE(a))};
  wa.prototype.findVertex=wa.prototype.dn=function(a){if(null===a)return null;u&&z.l(a,E,wa,"findVertex:node");return this.AA.na(a)};wa.prototype.addEdge=wa.prototype.Zo=function(a){if(null!==a){u&&z.l(a,ya,wa,"addEdge:edge");this.edges.add(a);var b=a.link;null!==b&&null===this.Yw(b)&&this.mA.add(b,a);b=a.toVertex;null!==b&&b.ED(a);b=a.fromVertex;null!==b&&b.DD(a);a.network=this}};
  wa.prototype.addLink=function(a){if(null===a)return null;u&&z.l(a,G,wa,"addLink:link");var b=a.Y,c=a.da,d=this.Yw(a);null===d?(d=this.createEdge(),d.link=a,null!==b&&(d.fromVertex=this.ht(b)),null!==c&&(d.toVertex=this.ht(c)),this.Zo(d)):(d.fromVertex=null!==b?this.ht(b):null,d.toVertex=null!==c?this.ht(c):null);return d};wa.prototype.deleteEdge=wa.prototype.hp=function(a){if(null!==a){u&&z.l(a,ya,wa,"deleteEdge:edge");var b=a.toVertex;null!==b&&b.eE(a);b=a.fromVertex;null!==b&&b.dE(a);wq(this,a)}};
  function wq(a,b){null!==b&&a.edges.remove(b)&&(a.mA.remove(b.link),b.network=null)}wa.prototype.deleteLink=function(a){null!==a&&(u&&z.l(a,G,wa,"deleteLink:link"),a=this.Yw(a),null!==a&&this.hp(a))};wa.prototype.findEdge=wa.prototype.Yw=function(a){if(null===a)return null;u&&z.l(a,G,wa,"findEdge:link");return this.mA.na(a)};
  wa.prototype.linkVertexes=wa.prototype.Hp=function(a,b,c){if(null===a||null===b)return null;u&&(z.l(a,xa,wa,"linkVertexes:fromVertex"),z.l(b,xa,wa,"linkVertexes:toVertex"),null!==c&&z.l(c,G,wa,"linkVertexes:link"));if(a.network===this&&b.network===this){var d=this.createEdge();d.link=c;d.fromVertex=a;d.toVertex=b;this.Zo(d);return d}return null};
  wa.prototype.reverseEdge=wa.prototype.Hx=function(a){if(null!==a){u&&z.l(a,ya,wa,"reverseEdge:edge");var b=a.fromVertex,c=a.toVertex;null!==b&&null!==c&&(b.dE(a),c.eE(a),a.Hx(),b.ED(a),c.DD(a))}};wa.prototype.deleteSelfEdges=wa.prototype.Uw=function(){for(var a=z.rb(),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.hp(a[c]);z.xa(a)};
  wa.prototype.deleteArtificialVertexes=function(){for(var a=z.rb(),b=this.vertexes.i;b.next();){var c=b.value;null===c.Pc&&a.push(c)}c=a.length;for(b=0;b<c;b++)this.fE(a[b]);c=z.rb();for(b=this.edges.i;b.next();){var d=b.value;null===d.link&&c.push(d)}d=c.length;for(b=0;b<d;b++)this.hp(c[b]);z.xa(a);z.xa(c)};function xq(a){for(var b=z.rb(),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.hp(b[d]);z.xa(b)}
  wa.prototype.splitIntoSubNetworks=wa.prototype.oJ=function(){this.deleteArtificialVertexes();xq(this);this.Uw();for(var a=new J(wa),b=!0;b;)for(var b=!1,c=this.vertexes.i;c.next();){var d=c.value;if(0<d.Ze.count||0<d.Te.count){b=this.Sb.createNetwork();a.add(b);yq(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 yq(a,b,c){if(null!==c&&c.network!==b){vq(a,c);b.ul(c);for(var d=c.tc;d.next();){var e=d.value;e.network!==b&&(wq(a,e),b.Zo(e),yq(a,b,e.fromVertex))}for(d=c.pc;d.next();)c=d.value,c.network!==b&&(wq(a,c),b.Zo(c),yq(a,b,c.toVertex))}}wa.prototype.findAllParts=function(){for(var a=new K(D),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 xa(){z.kc(this);this.network=null;this.P=(new w(0,0,10,10)).freeze();this.S=(new N(5,5)).freeze();this.clear()}z.ia("LayoutVertex",xa);xa.prototype.clear=function(){this.Cd=this.fe=null;this.Ze=new J(ya);this.Te=new J(ya)};
  xa.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutVertex#"+z.nd(this);if(0<a&&(b+=null!==this.Pc?"("+this.Pc.toString()+")":"",1<a)){a="";for(var c=!0,d=this.Ze.i;d.next();){var e=d.value;c?c=!1:a+=",";a+=e.toString(0)}e="";c=!0;for(d=this.Te.i;d.next();){var g=d.value;c?c=!1:e+=",";e+=g.toString(0)}b+=" sources: "+a+" destinations: "+e}return b};
  z.defineProperty(xa,{data:"data"},function(){return this.fe},function(a){this.fe=a;if(null!==a){var b=a.bounds;a=b.x;var c=b.y,d=b.width,b=b.height;this.S.n(d/2,b/2);this.P.n(a,c,d,b)}});
  z.defineProperty(xa,{Pc:"node"},function(){return this.Cd},function(a){if(this.Cd!==a){u&&null!==a&&z.l(a,E,xa,"node");this.Cd=a;a.Bf();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.P.n(c,d,e,b);if(!(a instanceof F)&&(a=a.Zb.eb(ec),a.F())){this.S.n(a.x-c,a.y-d);return}this.S.n(e/2,b/2)}});z.defineProperty(xa,{vb:"bounds"},function(){return this.P},function(a){this.P.N(a)||(u&&z.l(a,w,xa,"bounds"),this.P.assign(a))});
  z.defineProperty(xa,{focus:"focus"},function(){return this.S},function(a){this.S.N(a)||(u&&z.l(a,N,xa,"focus"),this.S.assign(a))});z.defineProperty(xa,{ra:"centerX"},function(){return this.P.x+this.S.x},function(a){var b=this.P;b.x+this.S.x!==a&&(u&&z.p(a,xa,"centerX"),b.Wa(),b.x=a-this.S.x,b.freeze())});z.defineProperty(xa,{za:"centerY"},function(){return this.P.y+this.S.y},function(a){var b=this.P;b.y+this.S.y!==a&&(u&&z.p(a,xa,"centerY"),b.Wa(),b.y=a-this.S.y,b.freeze())});
  z.defineProperty(xa,{Dt:"focusX"},function(){return this.S.x},function(a){var b=this.S;b.x!==a&&(b.Wa(),b.x=a,b.freeze())});z.defineProperty(xa,{Et:"focusY"},function(){return this.S.y},function(a){var b=this.S;b.y!==a&&(b.Wa(),b.y=a,b.freeze())});z.defineProperty(xa,{x:"x"},function(){return this.P.x},function(a){var b=this.P;b.x!==a&&(b.Wa(),b.x=a,b.freeze())});z.defineProperty(xa,{y:"y"},function(){return this.P.y},function(a){var b=this.P;b.y!==a&&(b.Wa(),b.y=a,b.freeze())});
  z.defineProperty(xa,{width:"width"},function(){return this.P.width},function(a){var b=this.P;b.width!==a&&(b.Wa(),b.width=a,b.freeze())});z.defineProperty(xa,{height:"height"},function(){return this.P.height},function(a){var b=this.P;b.height!==a&&(b.Wa(),b.height=a,b.freeze())});
  xa.prototype.commit=function(){var a=this.fe;if(null!==a){var b=this.vb,c=a.bounds;z.Za(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.vb;if(!(a instanceof F)){var c=a.W,d=a.Zb.eb(ec);if(c.F()&&d.F()){a.moveTo(b.x+this.Dt-(d.x-c.x),b.y+this.Et-(d.y-c.y));return}}a.moveTo(b.x,b.y)}};xa.prototype.addSourceEdge=xa.prototype.ED=function(a){null!==a&&(u&&z.l(a,ya,xa,"addSourceEdge:edge"),this.Ze.contains(a)||this.Ze.add(a))};
  xa.prototype.deleteSourceEdge=xa.prototype.eE=function(a){null!==a&&(u&&z.l(a,ya,xa,"deleteSourceEdge:edge"),this.Ze.remove(a))};xa.prototype.addDestinationEdge=xa.prototype.DD=function(a){null!==a&&(u&&z.l(a,ya,xa,"addDestinationEdge:edge"),this.Te.contains(a)||this.Te.add(a))};xa.prototype.deleteDestinationEdge=xa.prototype.dE=function(a){null!==a&&(u&&z.l(a,ya,xa,"deleteDestinationEdge:edge"),this.Te.remove(a))};
  z.w(xa,{nJ:"sourceVertexes"},function(){for(var a=new K(xa),b=this.tc;b.next();)a.add(b.value.fromVertex);return a.i});z.w(xa,{qH:"destinationVertexes"},function(){for(var a=new K(xa),b=this.pc;b.next();)a.add(b.value.toVertex);return a.i});z.w(xa,{vertexes:"vertexes"},function(){for(var a=new K(xa),b=this.tc;b.next();)a.add(b.value.fromVertex);for(b=this.pc;b.next();)a.add(b.value.toVertex);return a.i});z.w(xa,{tc:"sourceEdges"},function(){return this.Ze.i});z.w(xa,{pc:"destinationEdges"},function(){return this.Te.i});
  z.w(xa,{edges:"edges"},function(){for(var a=new J(ya),b=this.tc;b.next();)a.add(b.value);for(b=this.pc;b.next();)a.add(b.value);return a.i});z.w(xa,{BH:"edgesCount"},function(){return this.Ze.count+this.Te.count});var zq;xa.standardComparer=zq=function(a,b){u&&z.l(a,xa,xa,"standardComparer:m");u&&z.l(b,xa,xa,"standardComparer:n");var c=a.Cd,d=b.Cd;return c?d?(c=c.text,d=d.text,c<d?-1:c>d?1:0):1:null!==d?-1:0};
  xa.smartComparer=function(a,b){u&&z.l(a,xa,xa,"smartComparer:m");u&&z.l(b,xa,xa,"smartComparer:n");if(null!==a){if(null!==b){var c=a.Cd,d=b.Cd;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 g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){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!==g-h)return g-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 ya(){z.kc(this);this.network=null;this.clear()}z.ia("LayoutEdge",ya);ya.prototype.clear=function(){this.toVertex=this.fromVertex=this.link=this.data=null};
  ya.prototype.toString=function(a){void 0===a&&(a=0);var b="LayoutEdge#"+z.nd(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};ya.prototype.Hx=function(){var a=this.fromVertex;this.fromVertex=this.toVertex;this.toVertex=a};ya.prototype.commit=function(){};
  ya.prototype.getOtherVertex=ya.prototype.MH=function(a){u&&z.l(a,xa,ya,"getOtherVertex:v");return this.toVertex===a?this.fromVertex:this.fromVertex===a?this.toVertex:null};function tm(){0<arguments.length&&z.pd(tm);yg.call(this);this.ox=!0;this.ct=this.dt=NaN;this.Aj=(new Ea(NaN,NaN)).freeze();this.bi=(new Ea(10,10)).freeze();this.Ie=vn;this.rd=tn;this.ai=pn;this.Lh=Aq}z.Ra(tm,yg);z.ia("GridLayout",tm);
  tm.prototype.cloneProtected=function(a){yg.prototype.cloneProtected.call(this,a);a.dt=this.dt;a.ct=this.ct;a.Aj.assign(this.Aj);a.bi.assign(this.bi);a.Ie=this.Ie;a.rd=this.rd;a.ai=this.ai;a.Lh=this.Lh};
  tm.prototype.doLayout=function(a){null===a&&z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");this.je=this.initialOrigin(this.je);var b=this.h;a=this.$G(a);for(var c=a.copy().i;c.next();){var d=c.value;if(d instanceof G){var e=d;if(null!==e.Y||null!==e.da){a.remove(e);continue}}d.Bf();if(d instanceof F)for(d=d.Hc;d.next();)a.remove(d.value)}e=a.jc();if(0!==e.length){switch(this.sorting){case sn:e.reverse();break;case pn:e.sort(this.comparer);
  break;case qn:e.sort(this.comparer),e.reverse()}var g=this.DJ;isNaN(g)&&(g=0);var h=this.iG,h=isNaN(h)&&null!==b?Math.max(b.xb.width-b.padding.left-b.padding.right,0):Math.max(this.iG,0);0>=g&&0>=h&&(g=1);a=this.spacing.width;isFinite(a)||(a=0);c=this.spacing.height;isFinite(c)||(c=0);null!==b&&b.Wb("Layout");d=[];switch(this.alignment){case wn:var k=a,l=c,m=Math.max(this.cp.width,1);if(!isFinite(m))for(var n=m=0;n<e.length;n++)var p=e[n],q=p.Ia,m=Math.max(m,q.width);var m=Math.max(m+k,1),r=Math.max(this.cp.height,
  1);if(!isFinite(r))for(n=r=0;n<e.length;n++)p=e[n],q=p.Ia,r=Math.max(r,q.height);for(var r=Math.max(r+l,1),s=this.Yf,t=this.je.x,v=t,x=this.je.y,y=0,A=0,n=0;n<e.length;n++){var p=e[n],q=p.Ia,C=Math.ceil((q.width+k)/m)*m,L=Math.ceil((q.height+l)/r)*r,H=0;switch(s){case un:H=Math.abs(v-q.width);break;default:H=v+q.width}if(0<g&&y>g-1||0<h&&0<y&&H>h)d.push(new w(0,x,h+k,A)),y=0,v=t,x+=A,A=0;A=Math.max(A,L);L=0;switch(s){case un:L=-q.width;break;default:L=0}p.moveTo(v+L,x);switch(s){case un:v-=C;break;
  default:v+=C}y++}d.push(new w(0,x,h+k,A));break;case vn:k=g;l=a;m=c;n=Math.max(this.cp.width,1);p=x=C=0;q=z.O();for(g=0;g<e.length;g++)r=e[g],s=r.Ia,t=pp(r,r.Zb,r.of,q),C=Math.max(C,t.x),x=Math.max(x,s.width-t.x),p=Math.max(p,t.y);v=this.Yf;switch(v){case un:C+=l;break;default:x+=l}var n=isFinite(n)?Math.max(n+l,1):Math.max(C+x,1),U=x=this.je.x,y=this.je.y,A=0;h>=C&&(h-=C);for(var C=L=0,H=Math.max(this.cp.height,1),ea=p=0,W=!0,P=z.O(),g=0;g<e.length;g++){r=e[g];s=r.Ia;t=pp(r,r.Zb,r.of,q);if(0<A)switch(v){case un:U=
  (U-x-(s.width-t.x))/n;U=td(Math.round(U),U)?Math.round(U):Math.floor(U);U=U*n+x;break;default:U=(U-x+t.x)/n,U=td(Math.round(U),U)?Math.round(U):Math.ceil(U),U=U*n+x}else switch(v){case un:L=U+t.x+s.width;break;default:L=U-t.x}var ba=0;switch(v){case un:ba=-(U+t.x)+L;break;default:ba=U+s.width-t.x-L}if(0<k&&A>k-1||0<h&&0<A&&ba>h){d.push(new w(0,W?y-p:y,h+l,ea+p+m));for(U=0;U<A&&g!==A;U++){var ba=e[g-A+U],Oa=pp(ba,ba.Zb,ba.of,P);ba.moveTo(ba.position.x,ba.position.y+p-Oa.y)}ea+=m;y=W?y+ea:y+(ea+p);
  A=ea=p=0;U=x;W=!1}U===x&&(C=v===un?Math.max(C,s.width-t.x):Math.min(C,-t.x));p=Math.max(p,t.y);ea=Math.max(ea,s.height-t.y);isFinite(H)&&(ea=Math.max(ea,Math.max(s.height,H)-t.y));W?r.moveTo(U-t.x,y-t.y):r.moveTo(U-t.x,y);switch(v){case un:U-=t.x+l;break;default:U+=s.width-t.x+l}A++}d.push(new w(0,y,h+l,(W?ea:ea+p)+m));for(U=0;U<A&&g!==A;U++)ba=e[g-A+U],Oa=pp(ba,ba.Zb,ba.of,q),ba.moveTo(ba.position.x,ba.position.y+p-Oa.y);z.A(q);z.A(P);if(v===un)for(g=0;g<d.length;g++)e=d[g],e.width+=C,e.x-=C;else for(g=
  0;g<d.length;g++)e=d[g],e.x>C&&(e.width+=e.x-C,e.x=C)}for(k=g=h=e=0;k<d.length;k++)l=d[k],e=Math.min(e,l.x),h=Math.min(h,l.y),g=Math.max(g,l.x+l.width);this.Yf===un?this.commitLayers(d,new N(e+a/2-(g+e),h-c/2)):this.commitLayers(d,new N(e-a/2,h-c/2));null!==b&&b.Kd("Layout");this.Gf=!0}};tm.prototype.commitLayers=function(){};
  z.defineProperty(tm,{iG:"wrappingWidth"},function(){return this.dt},function(a){this.dt!==a&&(z.g(a,"number",tm,"wrappingWidth"),0<a||isNaN(a))&&(this.dt=a,this.ox=isNaN(a),this.I())});z.defineProperty(tm,{DJ:"wrappingColumn"},function(){return this.ct},function(a){this.ct!==a&&(z.g(a,"number",tm,"wrappingColumn"),0<a||isNaN(a))&&(this.ct=a,this.I())});z.defineProperty(tm,{cp:"cellSize"},function(){return this.Aj},function(a){z.l(a,Ea,tm,"cellSize");this.Aj.N(a)||(this.Aj.assign(a),this.I())});
  z.defineProperty(tm,{spacing:"spacing"},function(){return this.bi},function(a){z.l(a,Ea,tm,"spacing");this.bi.N(a)||(this.bi.assign(a),this.I())});z.defineProperty(tm,{alignment:"alignment"},function(){return this.Ie},function(a){this.Ie!==a&&(z.Ba(a,tm,tm,"alignment"),a===vn||a===wn)&&(this.Ie=a,this.I())});z.defineProperty(tm,{Yf:"arrangement"},function(){return this.rd},function(a){this.rd!==a&&(z.Ba(a,tm,tm,"arrangement"),a===tn||a===un)&&(this.rd=a,this.I())});
  z.defineProperty(tm,{sorting:"sorting"},function(){return this.ai},function(a){this.ai!==a&&(z.Ba(a,tm,tm,"sorting"),a===rn||a===sn||a===pn||a===qn)&&(this.ai=a,this.I())});z.defineProperty(tm,{comparer:"comparer"},function(){return this.Lh},function(a){this.Lh!==a&&(z.g(a,"function",tm,"comparer"),this.Lh=a,this.I())});var Aq;tm.standardComparer=Aq=function(a,b){u&&z.l(a,D,tm,"standardComparer:a");u&&z.l(b,D,tm,"standardComparer:b");var c=a.text,d=b.text;return c<d?-1:c>d?1:0};
  tm.smartComparer=function(a,b){u&&z.l(a,D,tm,"standardComparer:a");u&&z.l(b,D,tm,"standardComparer: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 g=parseFloat(c[e]),h=parseFloat(d[e]);if(isNaN(g)){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!==g-h)return g-h}}else if(""!==c[e])return 1;return""!==d[e]&&void 0!==d[e]?-1:0}return 1}return null!==b?-1:0};var wn;tm.Position=wn=z.s(tm,"Position",0);var vn;tm.Location=vn=z.s(tm,"Location",1);var tn;tm.LeftToRight=tn=z.s(tm,"LeftToRight",2);var un;tm.RightToLeft=un=z.s(tm,"RightToLeft",3);var rn;tm.Forward=rn=z.s(tm,"Forward",4);var sn;tm.Reverse=sn=z.s(tm,"Reverse",5);var pn;tm.Ascending=pn=z.s(tm,"Ascending",6);var qn;tm.Descending=qn=z.s(tm,"Descending",7);
  function xn(){0<arguments.length&&z.pd(xn);yg.call(this);this.Iy=this.bo=this.Ud=0;this.Vq=360;this.Hy=Nn;this.Tk=0;this.cC=Nn;this.Yu=this.Fg=this.sD=0;this.Aw=new Bq;this.$u=this.ym=0;this.yG=600;this.js=NaN;this.rq=1;this.Ps=0;this.Rs=360;this.rd=Nn;this.fa=Jn;this.ai=Gn;this.Lh=zq;this.bi=6;this.Yr=Qn}z.Ra(xn,yg);z.ia("CircularLayout",xn);
  xn.prototype.cloneProtected=function(a){yg.prototype.cloneProtected.call(this,a);a.js=this.js;a.rq=this.rq;a.Ps=this.Ps;a.Rs=this.Rs;a.rd=this.rd;a.fa=this.fa;a.ai=this.ai;a.Lh=this.Lh;a.bi=this.bi;a.Yr=this.Yr};xn.prototype.createNetwork=function(){return new Cq};
  xn.prototype.doLayout=function(a){null===a&&z.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.network.vertexes;if(1>=a.count)1===a.count&&(a=a.first(),a.ra=0,a.za=0);else{var b=new J(Dq);b.$c(a.i);a=new J(Dq);var c=new J(Dq),d;d=this.sort(b);var e=this.Hy,g=this.cC,h=this.Ud,k=this.bo,l=this.Iy,m=this.Vq,b=this.Tk,n=this.sD,p=this.Fg,q=this.Yu,e=this.Yf,g=this.vx,h=this.TI;if(!isFinite(h)||
  0>=h)h=NaN;k=this.UG;if(!isFinite(k)||0>=k)k=1;l=this.Fe;isFinite(l)||(l=0);m=this.Lf;if(!isFinite(m)||360<m||1>m)m=360;b=this.spacing;isFinite(b)||(b=NaN);e===On&&g===Pn?e=Nn:e===On&&g!==Pn&&(g=Pn,e=this.Yf);if((this.direction===Hn||this.direction===In)&&this.sorting!==Gn){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===Hn?(this.Yf===On&&a.reverse(),d=new J(Dq),d.$c(a),d.$c(c)):(this.Yf===On&&c.reverse(),d=new J(Dq),d.$c(c),d.$c(a))}for(var s=
  d.length,t=n=0,r=0;r<d.length;r++){var p=l+m*t*(this.direction===Jn?1:-1)/s,v=d.ea(r).diameter;isNaN(v)&&(v=Eq(d.ea(r),p));360>m&&(0===r||r===d.length-1)&&(v/=2);n+=v;t++}if(isNaN(h)||e===On){isNaN(b)&&(b=6);if(e!==Nn&&e!==On){v=-Infinity;for(r=0;r<s;r++){var q=d.ea(r),x=d.ea(r===s-1?0:r+1);isNaN(q.diameter)&&Eq(q,0);isNaN(x.diameter)&&Eq(x,0);v=Math.max(v,(q.diameter+x.diameter)/2)}q=v+b;e===Ln?(p=2*Math.PI/s,h=(v+b)/p):h=Fq(this,q*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180)}else h=Fq(this,n+(360<=
  m?s:s-1)*(e!==On?b:1.6*b),k,l*Math.PI/180,m*Math.PI/180);p=h*k}else if(p=h*k,t=Gq(this,h,p,l*Math.PI/180,m*Math.PI/180),isNaN(b)){if(e===Nn||e===On)b=(t-n)/(360<=m?s:s-1)}else if(e===Nn||e===On)r=(t-n)/(360<=m?s:s-1),r<b?(h=Fq(this,n+b*(360<=m?s:s-1),k,l*Math.PI/180,m*Math.PI/180),p=h*k):b=r;else{v=-Infinity;for(r=0;r<s;r++)q=d.ea(r),x=d.ea(r===s-1?0:r+1),isNaN(q.diameter)&&Eq(q,0),isNaN(x.diameter)&&Eq(x,0),v=Math.max(v,(q.diameter+x.diameter)/2);q=v+b;r=Fq(this,q*(360<=m?s:s-1),k,l*Math.PI/180,
  m*Math.PI/180);r>h?(h=r,p=h*k):q=t/(360<=m?s:s-1)}this.Hy=e;this.cC=g;this.Ud=h;this.bo=k;this.Iy=l;this.Vq=m;this.Tk=b;this.sD=n;this.Fg=p;this.Yu=q;b=d;d=this.Hy;e=this.Ud;g=this.Iy;k=this.Vq;l=this.Tk;m=this.Fg;n=this.Yu;if(this.direction!==Hn&&this.direction!==In||d!==On)if(this.direction===Hn||this.direction===In){h=0;switch(d){case Mn:h=180*Hq(this,e,m,g,n)/Math.PI;break;case Nn:n=b=0;h=a.first();null!==h&&(b=Eq(h,Math.PI/2));h=c.first();null!==h&&(n=Eq(h,Math.PI/2));h=180*Hq(this,e,m,g,l+(b+
  n)/2)/Math.PI;break;case Ln:h=k/b.length}if(this.direction===Hn){switch(d){case Mn:Iq(this,a,g,Kn);break;case Nn:Jq(this,a,g,Kn);break;case Ln:Kq(this,a,k/2,g,Kn)}switch(d){case Mn:Iq(this,c,g+h,Jn);break;case Nn:Jq(this,c,g+h,Jn);break;case Ln:Kq(this,c,k/2,g+h,Jn)}}else{switch(d){case Mn:Iq(this,c,g,Kn);break;case Nn:Jq(this,c,g,Kn);break;case Ln:Kq(this,c,k/2,g,Kn)}switch(d){case Mn:Iq(this,a,g+h,Jn);break;case Nn:Jq(this,a,g+h,Jn);break;case Ln:Kq(this,a,k/2,g+h,Jn)}}}else switch(d){case Mn:Iq(this,
  b,g,this.direction);break;case Nn:Jq(this,b,g,this.direction);break;case Ln:Kq(this,b,k,g,this.direction);break;case On:Lq(this,b,k,g,this.direction)}else Lq(this,b,k,g-k/2,Jn)}this.updateParts();this.network=null;this.Gf=!0};
  function Kq(a,b,c,d,e){var g=a.Vq,h=a.Ud;a=a.Fg;d=d*Math.PI/180;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=d+(e===Jn?l*c/(360<=g?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.ra=p*Math.cos(m);n.za=p*Math.sin(m);n.actualAngle=180*m/Math.PI}}
  function Jq(a,b,c,d){var e=a.Ud,g=a.Fg,h=a.Tk;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=g*Math.sin(c);m.ra=e*Math.cos(c);m.za=p;m.actualAngle=180*c/Math.PI;isNaN(m.diameter)&&Eq(m,0);isNaN(n.diameter)&&Eq(n,0);m=Hq(a,e,g,d===Jn?c:-c,(m.diameter+n.diameter)/2+h);c+=d===Jn?m:-m}}
  function Iq(a,b,c,d){var e=a.Ud,g=a.Fg,h=a.Yu;c=c*Math.PI/180;for(var k=b.length,l=0;l<k;l++){var m=b.ea(l);m.ra=e*Math.cos(c);m.za=g*Math.sin(c);m.actualAngle=180*c/Math.PI;m=Hq(a,e,g,d===Jn?c:-c,h);c+=d===Jn?m:-m}}function Lq(a,b,c,d,e){var g=a.$u,g=a.Vq;a.ym=0;a.Aw=new Bq;if(360>c){for(g=d+(e===Jn?g:-g);0>g;)g+=360;g%=360;180<g&&(g-=360);g*=Math.PI/180;a.$u=g;Mq(a,b,c,d,e)}else Nq(a,b,c,d,e);a.Aw.commit(b)}
  function Nq(a,b,c,d,e){var g=a.Ud,h=a.Tk,k=a.bo,l=g*Math.cos(d*Math.PI/180),m=a.Fg*Math.sin(d*Math.PI/180),n=b.jc();if(3===n.length)n[0].ra=g,n[0].za=0,n[1].ra=n[0].ra-n[0].width/2-n[1].width/2-h,n[1].y=n[0].y,n[2].ra=(n[0].ra+n[1].ra)/2,n[2].y=n[0].y-n[2].height-h;else if(4===n.length)n[0].ra=g,n[0].za=0,n[2].ra=-n[0].ra,n[2].za=n[0].za,n[1].ra=0,n[1].y=Math.min(n[0].y,n[2].y)-n[1].height-h,n[3].ra=0,n[3].y=Math.max(n[0].y+n[0].height+h,n[2].y+n[2].height+h);else{for(var g=z.O(),p=0;p<n.length;p++){n[p].ra=
  l;n[p].za=m;if(p>=n.length-1)break;Oq(a,l,m,n,p,e,g)||Pq(a,l,m,n,p,e,g);l=g.x;m=g.y}z.A(g);a.ym++;if(!(23<a.ym)){var l=n[0].ra,m=n[0].za,g=n[n.length-1].ra,p=n[n.length-1].za,q=Math.abs(l-g)-((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-g)<(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(g)>Math.abs(p)?0<g!==m>p:0<p!==l<g;if(q=e===Jn?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.Aw.compare(h,n);1<Math.abs(h)&&(a.Ud=8>a.ym?a.Ud-h/(2*Math.PI):5>n.length&&10<h?a.Ud/2:a.Ud-(0<h?1.7:-2.3),a.Fg=a.Ud*k,Nq(a,b,c,d,e))}}}
  function Mq(a,b,c,d,e){for(var g=a.Ud,h=a.Fg,k=a.bo,l=g*Math.cos(d*Math.PI/180),m=h*Math.sin(d*Math.PI/180),n=z.O(),p=b.jc(),q=0;q<p.length;q++){p[q].ra=l;p[q].za=m;if(q>=p.length-1)break;Oq(a,l,m,p,q,e,n)||Pq(a,l,m,p,q,e,n);l=n.x;m=n.y}z.A(n);a.ym++;if(!(23<a.ym)){l=Math.atan2(m,l);l=e===Jn?a.$u-l:l-a.$u;l=Math.abs(l)<Math.abs(l-2*Math.PI)?l:l-2*Math.PI;g=l*(g+h)/2;h=a.Aw;if(Math.abs(g)<Math.abs(h.pp))for(h.pp=g,h.Cn=[],h.gq=[],l=0;l<p.length;l++)h.Cn[l]=p[l].vb.x,h.gq[l]=p[l].vb.y;1<Math.abs(g)&&
  (a.Ud=8>a.ym?a.Ud-g/(2*Math.PI):a.Ud-(0<g?1.7:-2.3),a.Fg=a.Ud*k,Mq(a,b,c,d,e))}}function Oq(a,b,c,d,e,g,h){var k=a.Ud,l=a.Fg,m=0,n=0;a=(d[e].width+d[e+1].width)/2+a.Tk;var p=!1;if(0<=c!==(g===Jn)){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 Pq(a,b,c,d,e,g,h){var k=a.Ud,l=a.Fg,m=0,n=0;a=(d[e].height+d[e+1].height)/2+a.Tk;d=!1;if(0<=b!==(g===Jn)){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}xn.prototype.commitLayout=function(){this.commitNodes();this.Rt&&this.commitLinks()};
  xn.prototype.commitNodes=function(){for(var a=this.JG,b=this.network.vertexes.i;b.next();){var c=b.value;c.x+=a.x;c.y+=a.y;c.commit()}};xn.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
  function Gq(a,b,c,d,e){var g=a.yG;if(.001>Math.abs(a.bo-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/(g+1):Math.PI/(2*(g+1)),l=0,m=0;m<=g;m++)l=void 0!==d&&void 0!==e?d+m*e/g:m*Math.PI/(2*g),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 Fq(a,b,c,d,e){var g=0,g=void 0!==d&&void 0!==e?Gq(a,1,c,d,e):Gq(a,1,c);return b/g}
  function Hq(a,b,c,d,e){if(.001>Math.abs(a.bo-1))return e/b;var g=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-g*g*l*l)*a;if(h>=e)return k*a}}
  xn.prototype.sort=function(a){switch(this.sorting){case En:break;case Fn:a.reverse();break;case yn:a.sort(this.comparer);break;case Cn:a.sort(this.comparer);a.reverse();break;case Gn:for(var b=[],c=0;c<a.length;c++)b.push(0);for(var d=new J(Dq),c=0;c<a.length;c++){var e=-1,g=-1;if(0===c)for(var h=0;h<a.length;h++){var k=a.ea(h).BH;k>e&&(e=k,g=h)}else for(h=0;h<a.length;h++)k=b[h],k>e&&(e=k,g=h);d.add(a.ea(g));b[g]=-1;g=a.ea(g);e=0;for(h=g.tc;h.next();)e=a.indexOf(h.value.fromVertex),0>e||0<=b[e]&&
  b[e]++;for(g=g.pc;g.next();)e=a.indexOf(g.value.toVertex),0>e||0<=b[e]&&b[e]++}a=[];for(b=0;b<d.length;b++){h=d.ea(b);a[b]=[];for(var l=0,c=h.pc;c.next();)l=d.indexOf(c.value.toVertex),l!==b&&0>a[b].indexOf(l)&&a[b].push(l);for(c=h.tc;c.next();)l=d.indexOf(c.value.fromVertex),l!==b&&0>a[b].indexOf(l)&&a[b].push(l)}h=[];for(b=0;b<a.length;b++)h[b]=0;for(var c=[],k=[],m=[],e=[],g=new J(Dq),n=0,b=0;b<a.length;b++){var p=a[b].length;if(1===p)e.push(b);else if(0===p)g.add(d.ea(b));else{if(0===n)c.push(b);
  else{for(var q=Infinity,r=Infinity,s=-1,t=[],p=0;p<c.length;p++)0>a[c[p]].indexOf(c[p===c.length-1?0:p+1])&&t.push(p===c.length-1?0:p+1);if(0===t.length)for(p=0;p<c.length;p++)t.push(p);for(p=0;p<t.length;p++){var v=t[p],x,l=a[b];x=k;for(var y=m,A=h,C=v,L=c,H=0,U=0;U<x.length;U++){var ea=A[x[U]],W=A[y[U]],P=0,ba=0;ea<W?(P=ea,ba=W):(P=W,ba=ea);if(P<C&&C<=ba)for(ea=0;ea<l.length;ea++)W=l[ea],0>L.indexOf(W)||P<A[W]&&A[W]<ba||P===A[W]||ba===A[W]||H++;else for(ea=0;ea<l.length;ea++)W=l[ea],0>L.indexOf(W)||
  P<A[W]&&A[W]<ba&&P!==A[W]&&ba!==A[W]&&H++}x=H;for(A=y=0;A<a[b].length;A++)l=c.indexOf(a[b][A]),0<=l&&(l=Math.abs(v-(l>=v?l+1:l)),y+=l<c.length+1-l?l:c.length+1-l);for(A=0;A<k.length;A++)l=h[k[A]],C=h[m[A]],l>=v&&l++,C>=v&&C++,l>C&&(L=C,C=l,l=L),C-l<(c.length+2)/2===(l<v&&v<=C)&&y++;if(x<q||x===q&&y<r)q=x,r=y,s=v}c.splice(s,0,b);for(p=0;p<c.length;p++)h[c[p]]=p;for(p=0;p<a[b].length;p++)q=a[b][p],0<=c.indexOf(q)&&(k.push(b),m.push(q))}n++}}k=!1;for(m=c.length;;){k=!0;for(h=0;h<e.length;h++)if(b=e[h],
  n=a[b][0],l=c.indexOf(n),0<=l){for(r=p=0;r<a[n].length;r++)q=a[n][r],q=c.indexOf(q),0>q||q===l||(s=q>l?q-l:l-q,p+=q<l!==s>m-s?1:-1);c.splice(0>p?l:l+1,0,b);e.splice(h,1);h--}else k=!1;if(k)break;else c.push(e[0]),e.splice(0,1)}for(b=0;b<c.length;b++)l=c[b],g.add(d.ea(l));return g;default:z.k("Invalid sorting type.")}return a};z.defineProperty(xn,{TI:"radius"},function(){return this.js},function(a){this.js!==a&&(z.g(a,"number",xn,"radius"),0<a||isNaN(a))&&(this.js=a,this.I())});
  z.defineProperty(xn,{UG:"aspectRatio"},function(){return this.rq},function(a){this.rq!==a&&(z.g(a,"number",xn,"aspectRatio"),0<a&&(this.rq=a,this.I()))});z.defineProperty(xn,{Fe:"startAngle"},function(){return this.Ps},function(a){this.Ps!==a&&(z.g(a,"number",xn,"startAngle"),this.Ps=a,this.I())});z.defineProperty(xn,{Lf:"sweepAngle"},function(){return this.Rs},function(a){this.Rs!==a&&(z.g(a,"number",xn,"sweepAngle"),this.Rs=0<a&&360>=a?a:360,this.I())});
  z.defineProperty(xn,{Yf:"arrangement"},function(){return this.rd},function(a){this.rd!==a&&(z.Ba(a,xn,xn,"arrangement"),a===On||a===Nn||a===Mn||a===Ln)&&(this.rd=a,this.I())});z.defineProperty(xn,{direction:"direction"},function(){return this.fa},function(a){this.fa!==a&&(z.Ba(a,xn,xn,"direction"),a===Jn||a===Kn||a===Hn||a===In)&&(this.fa=a,this.I())});
  z.defineProperty(xn,{sorting:"sorting"},function(){return this.ai},function(a){this.ai!==a&&(z.Ba(a,xn,xn,"sorting"),a===En||a===Fn||a===yn||Cn||a===Gn)&&(this.ai=a,this.I())});z.defineProperty(xn,{comparer:"comparer"},function(){return this.Lh},function(a){this.Lh!==a&&(z.g(a,"function",xn,"comparer"),this.Lh=a,this.I())});z.defineProperty(xn,{spacing:"spacing"},function(){return this.bi},function(a){this.bi!==a&&(z.g(a,"number",xn,"spacing"),this.bi=a,this.I())});
  z.defineProperty(xn,{vx:"nodeDiameterFormula"},function(){return this.Yr},function(a){this.Yr!==a&&(z.Ba(a,xn,xn,"nodeDiameterFormula"),a===Qn||a===Pn)&&(this.Yr=a,this.I())});z.w(xn,{KG:"actualXRadius"},function(){return this.Ud});z.w(xn,{LG:"actualYRadius"},function(){return this.Fg});z.w(xn,{GJ:"actualSpacing"},function(){return this.Tk});z.w(xn,{JG:"actualCenter"},function(){return isNaN(this.je.x)||isNaN(this.je.y)?new N(0,0):new N(this.je.x+this.KG,this.je.y+this.LG)});var Nn;
  xn.ConstantSpacing=Nn=z.s(xn,"ConstantSpacing",0);var Mn;xn.ConstantDistance=Mn=z.s(xn,"ConstantDistance",1);var Ln;xn.ConstantAngle=Ln=z.s(xn,"ConstantAngle",2);var On;xn.Packed=On=z.s(xn,"Packed",3);var Jn;xn.Clockwise=Jn=z.s(xn,"Clockwise",4);var Kn;xn.Counterclockwise=Kn=z.s(xn,"Counterclockwise",5);var Hn;xn.BidirectionalLeft=Hn=z.s(xn,"BidirectionalLeft",6);var In;xn.BidirectionalRight=In=z.s(xn,"BidirectionalRight",7);var En;xn.Forwards=En=z.s(xn,"Forwards",8);var Fn;
  xn.Reverse=Fn=z.s(xn,"Reverse",9);var yn;xn.Ascending=yn=z.s(xn,"Ascending",10);var Cn;xn.Descending=Cn=z.s(xn,"Descending",11);var Gn;xn.Optimized=Gn=z.s(xn,"Optimized",12);var Qn;xn.Pythagorean=Qn=z.s(xn,"Pythagorean",13);var Pn;xn.Circular=Pn=z.s(xn,"Circular",14);function Bq(){this.pp=-Infinity;this.gq=this.Cn=null}
  Bq.prototype.compare=function(a,b){if(0<a&&0>this.pp||Math.abs(a)<Math.abs(this.pp)&&!(0>a&&0<this.pp)){this.pp=a;this.Cn=[];this.gq=[];for(var c=0;c<b.length;c++)this.Cn[c]=b[c].vb.x,this.gq[c]=b[c].vb.y}};Bq.prototype.commit=function(a){if(null!==this.Cn&&null!==this.gq)for(var b=0;b<this.Cn.length;b++){var c=a.ea(b);c.x=this.Cn[b];c.y=this.gq[b]}};function Cq(){wa.call(this)}z.Ra(Cq,wa);z.ia("CircularNetwork",Cq);Cq.prototype.createVertex=function(){return new Dq};Cq.prototype.createEdge=function(){return new Qq};
  function Dq(){xa.call(this);this.actualAngle=this.diameter=NaN}z.Ra(Dq,xa);z.ia("CircularVertex",Dq);
  function Eq(a,b){var c=a.network;if(null===c)return NaN;c=c.Sb;if(null===c)return NaN;if(c.Yf===On)if(c.vx===Pn)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.vx===Pn?Math.max(a.width,a.height):Math.sqrt(a.width*a.width+a.height*a.height);return a.diameter}function Qq(){ya.call(this)}z.Ra(Qq,ya);z.ia("CircularEdge",Qq);
  function Rq(){0<arguments.length&&z.pd(Rq);yg.call(this);this.Eg=null;this.wr=0;this.mg=(new Ea(100,100)).freeze();this.qq=!1;this.$h=!0;this.Kh=!1;this.Bo=100;this.Xq=1;this.Sh=1E3;this.ks=Math;this.Xn=.05;this.Wn=50;this.Tn=150;this.Vn=0;this.Nq=10;this.Mq=5}z.Ra(Rq,yg);z.ia("ForceDirectedLayout",Rq);
  Rq.prototype.cloneProtected=function(a){yg.prototype.cloneProtected.call(this,a);a.mg.assign(this.mg);a.qq=this.qq;a.$h=this.$h;a.Kh=this.Kh;a.Bo=this.Bo;a.Xq=this.Xq;a.Sh=this.Sh;a.ks=this.ks;a.Xn=this.Xn;a.Wn=this.Wn;a.Tn=this.Tn;a.Vn=this.Vn;a.Nq=this.Nq;a.Mq=this.Mq};Rq.prototype.createNetwork=function(){return new Sq};
  Rq.prototype.doLayout=function(a){null===a&&z.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.pA;if(0<this.network.vertexes.count){this.network.Uw();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.Dz();this.wr=0;if(this.needsClusterLayout()){b=this.network;for(c=b.oJ().i;c.next();){this.network=c.value;for(var d=this.network.vertexes.i;d.next();){var e=d.value;e.ig=e.vertexes.count;e.vk=1;e.Wm=null;e.Fh=null}Tq(this,0,a)}this.network=b;c.reset();u&&z.l(b,Sq,Rq,"arrangeConnectedGraphs:singletons");for(var d=this.KD,g=c.count,h=!0,k=e=0,l=z.rb(),m=0;m<g+b.vertexes.count+2;m++)l[m]=null;g=0;c.reset();for(var n=z.lg();c.next();)if(m=c.value,this.sh(m,n),h)h=!1,e=n.x+n.width/2,k=n.y+n.height/
  2,l[0]=new N(n.x+n.width+d.width,n.y),l[1]=new N(n.x,n.y+n.height+d.height),g=2;else{var p=Uq(l,g,e,k,n.width,n.height,d),q=l[p],r=new N(q.x+n.width+d.width,q.y),s=new N(q.x,q.y+n.height+d.height);p+1<g&&l.splice(p+1,0,null);l[p]=r;l[p+1]=s;g++;p=q.x-n.x;q=q.y-n.y;for(m=m.vertexes.i;m.next();)r=m.value,r.ra+=p,r.za+=q}z.dc(n);for(m=b.vertexes.i;m.next();)h=m.value,n=h.vb,2>g?(e=n.x+n.width/2,k=n.y+n.height/2,l[0]=new N(n.x+n.width+d.width,n.y),l[1]=new N(n.x,n.y+n.height+d.height),g=2):(p=Uq(l,g,
  e,k,n.width,n.height,d),q=l[p],r=new N(q.x+n.width+d.width,q.y),s=new N(q.x,q.y+n.height+d.height),p+1<g&&l.splice(p+1,0,null),l[p]=r,l[p+1]=s,g++,h.ra=q.x+h.width/2,h.za=q.y+h.height/2);z.xa(l);for(c.reset();c.next();){d=c.value;for(e=d.vertexes.i;e.next();)b.ul(e.value);for(d=d.edges.i;d.next();)b.Zo(d.value)}}Vq(this,a);this.updateParts()}this.Bo=a;this.network=null;this.Gf=!0};
  Rq.prototype.needsClusterLayout=function(){if(3>this.network.vertexes.count)return!1;for(var a=0,b=0,c=this.network.vertexes.first().vb,d=this.network.vertexes.i;d.next();){if(d.value.vb.Jg(c)&&(a++,2<a))return!0;if(10<b)break;b++}return!1};Rq.prototype.sh=function(a,b){for(var c=!0,d=a.vertexes.i;d.next();){var e=d.value;c?(c=!1,b.set(e.vb)):b.ri(e.vb)}return b};
  function Wq(a,b,c){u&&(z.p(b,Rq,"computeClusterLayoutIterations:level"),z.p(c,Rq,"computeClusterLayoutIterations:maxiter"));return Math.max(Math.min(a.network.vertexes.count,c*(b+1)/11),10)}
  function Tq(a,b,c){u&&(z.p(b,Rq,"layoutClusters:level"),z.p(c,Rq,"layoutClusters:maxiter"));if(fr(a,b)){var d=a.Sh;a.Sh*=1+1/(b+1);var e=lr(a,b),g=Math.max(0,Wq(a,b,c));a.pA+=g;Tq(a,b+1,c);Vq(a,g);mr(a,e,b);c=a.Eg;null===c?c=new J(nr):c.clear();c.$c(e.vertexes);c.sort(function(a,b){return null===a||null===b||a===b?0:b.ig-a.ig});for(e=c.i;e.next();)or(a,e.value,b);a.Sh=d}}
  function fr(a,b){u&&z.p(b,Rq,"hasClusters:level");if(10<b||3>a.network.vertexes.count)return!1;null===a.Eg?a.Eg=new J(nr):a.Eg.clear();a.Eg.$c(a.network.vertexes);var c=a.Eg;c.sort(function(a,b){return null===a||null===b||a===b?0:b.ig-a.ig});for(var d=c.count-1;0<=d&&1>=c.ea(d).ig;)d--;return 1<c.count-d}
  function lr(a,b){u&&z.p(b,Rq,"pushSubNetwork:level");for(var c=a.network,d=new Sq,e=a.Eg.i;e.next();){var g=e.value;if(1<g.ig){d.ul(g);var h=new pr;h.Yx=g.ig;h.Zx=g.width;h.Xx=g.height;h.jB=g.S.x;h.kB=g.S.y;null===g.Fh&&(g.Fh=new J(pr));g.Fh.add(h);g.LA=g.Fh.count-1}else break}for(var k=c.edges.i;k.next();)if(e=k.value,e.fromVertex.network===d&&e.toVertex.network===d)d.Zo(e);else if(e.fromVertex.network===d){var l=e.fromVertex.Wm;null===l&&(l=new J(nr),e.fromVertex.Wm=l);l.add(e.toVertex);e.fromVertex.ig--;
  e.fromVertex.vk+=e.toVertex.vk}else e.toVertex.network===d&&(l=e.toVertex.Wm,null===l&&(l=new J(nr),e.toVertex.Wm=l),l.add(e.fromVertex),e.toVertex.ig--,e.toVertex.vk+=e.fromVertex.vk);for(e=d.edges.i;e.next();)g=e.value,g.length*=Math.max(1,se((g.fromVertex.vk+g.toVertex.vk)/(4*b+1)));for(e=d.vertexes.i;e.next();)if(g=e.value,l=g.Wm,null!==l&&0<l.count&&(h=g.Fh.ea(g.Fh.count-1),h=h.Yx-g.ig,!(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.MH(q)===g){r=s;break}}null!==r&&(n+=r.length,m+=q.width*q.height)}l=g.ra;k=g.za;p=g.width;q=g.height;r=g.S;s=p*q;1>s&&(s=1);m=se((m+s+n*n*4/(h*h))/s);h=(m-1)*p/2;m=(m-1)*q/2;g.vb=new w(l-r.x-h,k-r.y-m,p+2*h,q+2*m);g.focus=new N(r.x+h,r.y+m)}a.network=d;return c}
  function mr(a,b,c){u&&(z.l(b,Sq,Rq,"popNetwork:oldnet"),z.p(c,Rq,"popNetwork:level"));for(c=a.network.vertexes.i;c.next();){var d=c.value;d.network=b;if(null!==d.Fh){var e=d.Fh.ea(d.LA);d.ig=e.Yx;var g=e.jB,h=e.kB;d.vb=new w(d.ra-g,d.za-h,e.Zx,e.Xx);d.focus=new N(g,h);d.LA--}}for(c=a.network.edges.i;c.next();)c.value.network=b;a.network=b}
  function or(a,b,c){u&&(z.l(b,nr,Rq,"surroundNode:oldnet"),z.p(c,Rq,"surroundNode:level"));var d=b.Wm;if(null!==d&&0!==d.count){c=b.ra;var e=b.za,g=b.width,h=b.height;null!==b.Fh&&0<b.Fh.count&&(h=b.Fh.ea(0),g=h.Zx,h=h.Xx);for(var g=se(g*g+h*h)/2,k=!1,l=h=0,m=0,n=b.vertexes.i;n.next();){var p=n.value;1>=p.ig?l++:(k=!0,m++,h+=Math.atan2(b.za-p.za,b.ra-p.ra))}if(0!==l)for(0<m&&(h/=m),m=b=0,b=k?2*Math.PI/(l+1):2*Math.PI/l,0===l%2&&(m=b/2),1<d.count&&d.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,d=d.i;d.next();)if(l=d.value,!(1<l.ig||a.isFixed(l))){n=null;for(p=l.edges.i;p.next();){n=p.value;break}var p=l.width,q=l.height,p=se(p*p+q*q)/2,n=g+n.length+p,p=h+(b*(k/2>>1)+m)*(0===k%2?1:-1);l.ra=c+n*Math.cos(p);l.za=e+n*Math.sin(p);k++}}}
  function Uq(a,b,c,d,e,g,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<g+h.height)continue a;l=m;k=p}}return l}Rq.prototype.Dz=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
  Rq.prototype.addComments=function(a){var b=a.Pc;if(null!==b)for(b=b.qE();b.next();){var c=b.value;if("Comment"===c.nc&&c.isVisible()){var d=this.network.dn(c);null===d&&(d=this.network.ht(c));d.charge=this.mH;for(var c=null,e=d.pc;e.next();){var g=e.value;if(g.toVertex===a){c=g;break}}if(null===c)for(e=d.tc;e.next();)if(g=e.value,g.fromVertex===a){c=g;break}null===c&&(c=this.network.Hp(a,d,null));c.length=this.nH}}};
  function qr(a,b){u&&(z.l(a,nr,Rq,"getNodeDistance:vertexA"),z.l(b,nr,Rq,"getNodeDistance:vertexB"));var c=a.P,d=c.x,e=c.y,g=c.width,c=c.height,h=b.P,k=h.x,l=h.y,m=h.width,h=h.height;return d+g<k?e>l+h?(d=d+g-k,e=e-l-h,se(d*d+e*e)):e+c<l?(d=d+g-k,e=e+c-l,se(d*d+e*e)):k-(d+g):d>k+m?e>l+h?(d=d-k-m,e=e-l-h,se(d*d+e*e)):e+c<l?(d=d-k-m,e=e+c-l,se(d*d+e*e)):d-(k+m):e>l+h?e-(l+h):e+c<l?l-(e+c):.1}
  function Vq(a,b){u&&z.p(b,Rq,"performIterations:num");a.Eg=null;for(var c=a.wr+b;a.wr<c&&(a.wr++,rr(a)););a.Eg=null}
  function rr(a){null===a.Eg&&(a.Eg=new J(nr),a.Eg.$c(a.network.vertexes));var b=a.Eg.o;if(0>=b.length)return!1;var c=b[0];c.forceX=0;c.forceY=0;for(var d=c.ra,e=d,g=c.za,h=g,c=1;c<b.length;c++){var k=b[c];k.forceX=0;k.forceY=0;var l=k.ra,k=k.za,d=Math.min(d,l),e=Math.max(e,l),g=Math.min(g,k),h=Math.max(h,k)}(g=e-d>h-g)?b.sort(function(a,b){return null===a||null===b||a===b?0:a.ra-b.ra}):b.sort(function(a,b){return null===a||null===b||a===b?0:a.za-b.za});for(var h=a.Sh,m=0,n=0,p=0,c=0;c<b.length;c++){var k=
  b[c],l=k.P,q=k.S,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.P,n=e.S,p=r.x+n.x,r=r.y+n.y;if(d-p>h||p-d>h){if(g)break}else if(l-r>h||r-l>h){if(!g)break}else{var s=qr(k,e);1>s?(n=a.Dx,null===n&&(a.Dx=n=new Ka(0)),m=n.random(),s=n.random(),d>p?(n=Math.abs(e.P.right-k.P.x),n=(1+n)*m):d<p?(n=Math.abs(e.P.x-k.P.right),
  n=-(1+n)*m):(n=Math.max(e.width,k.width),n=(1+n)*m-n/2),l>r?(p=Math.abs(e.P.bottom-k.P.y),p=(1+p)*s):d<p?(p=Math.abs(e.P.y-k.P.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();)g=c.value,k=g.fromVertex,e=g.toVertex,l=k.P,q=k.S,d=l.x+q.x,l=l.y+q.y,r=e.P,n=e.S,p=r.x+n.x,r=r.y+n.y,s=qr(k,e),1>s?(n=a.Dx,null===n&&(a.Dx=n=new Ka(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=g.stiffness*(s-g.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.Sh/20,50);for(e=0;e<b.length;e++)k=b[e],a.isFixed(k)?a.moveFixedVertex(k):(g=k.forceX,h=k.forceY,g<-d?g=-d:g>d&&(g=d),h<-d?h=-d:h>d&&(h=d),k.ra+=g,k.za+=h,c=Math.max(c,g*g+h*h));return c>a.nE*a.nE}Rq.prototype.moveFixedVertex=function(){};
  Rq.prototype.commitLayout=function(){this.QA();this.commitNodes();this.Rt&&this.commitLinks()};Rq.prototype.QA=function(){if(this.aq)for(var a=this.network.edges.i;a.next();){var b=a.value.link;null!==b&&(b.Db=Pc,b.Eb=Pc)}};Rq.prototype.commitNodes=function(){var a=0,b=0;if(this.TG){var c=z.lg();this.sh(this.network,c);b=this.je;a=b.x-c.x;b=b.y-c.y;z.dc(c)}for(var c=z.lg(),d=this.network.vertexes.i;d.next();){var e=d.value;if(0!==a||0!==b)c.assign(e.vb),c.x+=a,c.y+=b,e.vb=c;e.commit()}z.dc(c)};
  Rq.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};Rq.prototype.springStiffness=function(a){a=a.stiffness;return isNaN(a)?this.Xn:a};Rq.prototype.springLength=function(a){a=a.length;return isNaN(a)?this.Wn:a};Rq.prototype.electricalCharge=function(a){a=a.charge;return isNaN(a)?this.Tn:a};Rq.prototype.electricalFieldX=function(){return 0};Rq.prototype.electricalFieldY=function(){return 0};
  Rq.prototype.gravitationalMass=function(a){a=a.mass;return isNaN(a)?this.Vn:a};Rq.prototype.gravitationalFieldX=function(){return 0};Rq.prototype.gravitationalFieldY=function(){return 0};Rq.prototype.isFixed=function(a){return a.isFixed};z.w(Rq,{gK:"currentIteration"},function(){return this.wr});z.defineProperty(Rq,{KD:"arrangementSpacing"},function(){return this.mg},function(a){z.l(a,Ea,Rq,"arrangementSpacing");this.mg.N(a)||(this.mg.assign(a),this.I())});
  z.defineProperty(Rq,{TG:"arrangesToOrigin"},function(){return this.qq},function(a){this.qq!==a&&(z.g(a,"boolean",Rq,"arrangesToOrigin"),this.qq=a,this.I())});z.defineProperty(Rq,{aq:"setsPortSpots"},function(){return this.$h},function(a){this.$h!==a&&(z.g(a,"boolean",Rq,"setsPortSpots"),this.$h=a,this.I())});z.defineProperty(Rq,{comments:"comments"},function(){return this.Kh},function(a){this.Kh!==a&&(z.g(a,"boolean",Rq,"comments"),this.Kh=a,this.I())});
  z.defineProperty(Rq,{pA:"maxIterations"},function(){return this.Bo},function(a){this.Bo!==a&&(z.g(a,"number",Rq,"maxIterations"),0<=a&&(this.Bo=a,this.I()))});z.defineProperty(Rq,{nE:"epsilonDistance"},function(){return this.Xq},function(a){this.Xq!==a&&(z.g(a,"number",Rq,"epsilonDistance"),0<a&&(this.Xq=a,this.I()))});z.defineProperty(Rq,{CK:"infinityDistance"},function(){return this.Sh},function(a){this.Sh!==a&&(z.g(a,"number",Rq,"infinityDistance"),1<a&&(this.Sh=a,this.I()))});
  z.defineProperty(Rq,{Dx:"randomNumberGenerator"},function(){return this.ks},function(a){this.ks!==a&&(null!==a&&"function"!==typeof a.random&&z.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: '+a),this.ks=a)});z.defineProperty(Rq,{sK:"defaultSpringStiffness"},function(){return this.Xn},function(a){this.Xn!==a&&(z.g(a,"number",Rq,"defaultSpringStiffness"),this.Xn=a,this.I())});
  z.defineProperty(Rq,{rK:"defaultSpringLength"},function(){return this.Wn},function(a){this.Wn!==a&&(z.g(a,"number",Rq,"defaultSpringLength"),this.Wn=a,this.I())});z.defineProperty(Rq,{lK:"defaultElectricalCharge"},function(){return this.Tn},function(a){this.Tn!==a&&(z.g(a,"number",Rq,"defaultElectricalCharge"),this.Tn=a,this.I())});z.defineProperty(Rq,{mK:"defaultGravitationalMass"},function(){return this.Vn},function(a){this.Vn!==a&&(z.g(a,"number",Rq,"defaultGravitationalMass"),this.Vn=a,this.I())});
  z.defineProperty(Rq,{nH:"defaultCommentSpringLength"},function(){return this.Nq},function(a){this.Nq!==a&&(z.g(a,"number",Rq,"defaultCommentSpringLength"),this.Nq=a,this.I())});z.defineProperty(Rq,{mH:"defaultCommentElectricalCharge"},function(){return this.Mq},function(a){this.Mq!==a&&(z.g(a,"number",Rq,"defaultCommentElectricalCharge"),this.Mq=a,this.I())});function pr(){this.kB=this.jB=this.Xx=this.Zx=this.Yx=0}function Sq(){wa.call(this)}z.Ra(Sq,wa);z.ia("ForceDirectedNetwork",Sq);
  Sq.prototype.createVertex=function(){return new nr};Sq.prototype.createEdge=function(){return new sr};function nr(){xa.call(this);this.isFixed=!1;this.mass=this.charge=NaN;this.vk=this.ig=this.forceY=this.forceX=0;this.Fh=this.Wm=null;this.LA=0}z.Ra(nr,xa);z.ia("ForceDirectedVertex",nr);function sr(){ya.call(this);this.length=this.stiffness=NaN}z.Ra(sr,ya);z.ia("ForceDirectedEdge",sr);
  function on(){0<arguments.length&&z.pd(on);yg.call(this);this.Td=this.pm=25;this.fa=0;this.Sn=tr;this.xo=ur;this.no=vr;this.nm=4;this.Fn=wr;this.Si=xr;this.$h=!0;this.Br=4;this.Kb=this.Jv=this.yb=-1;this.Rf=this.Lr=0;this.Rb=this.Pf=this.Qf=this.ug=this.ge=null;this.Ur=0;this.Tr=this.um=null;this.wg=0;this.Vr=null;this.tB=new N;this.ih=[];this.ih.length=100}z.Ra(on,yg);z.ia("LayeredDigraphLayout",on);
  on.prototype.cloneProtected=function(a){yg.prototype.cloneProtected.call(this,a);a.pm=this.pm;a.Td=this.Td;a.fa=this.fa;a.Sn=this.Sn;a.xo=this.xo;a.no=this.no;a.nm=this.nm;a.Fn=this.Fn;a.Si=this.Si;a.$h=this.$h;a.Br=this.Br};on.prototype.createNetwork=function(){return new yr};
  on.prototype.doLayout=function(a){null===a&&z.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.je=this.initialOrigin(this.je);this.Jv=-1;this.Rf=this.Lr=0;this.Vr=this.Tr=this.um=null;for(a=0;a<this.ih.length;a++)this.ih[a]=null;if(0<this.network.vertexes.count){this.network.Uw();for(a=this.network.edges.i;a.next();)a.value.rev=!1;switch(this.Sn){default:case zr:var b=0,c=this.network.vertexes.count-
  1;a=[];a.length=c+1;for(var d=this.network.vertexes.i;d.next();)d.value.valid=!0;for(;null!==Ar(this.network);){for(d=Br(this.network);null!==d;)a[c]=d,c--,d.valid=!1,d=Br(this.network);for(d=Cr(this.network);null!==d;)a[b]=d,b++,d.valid=!1,d=Cr(this.network);for(var d=null,e=0,g=this.network.vertexes.i;g.next();){var h=g.value;if(h.valid){for(var k=0,l=h.pc;l.next();)l.value.toVertex.valid&&k++;for(var l=0,m=h.tc;m.next();)m.value.fromVertex.valid&&l++;if(null===d||e<k-l)d=h,e=k-l}}null!==d&&(a[b]=
  d,b++,d.valid=!1)}for(b=0;b<this.network.vertexes.count;b++)a[b].index=b;for(a=this.network.edges.i;a.next();)b=a.value,b.fromVertex.index>b.toVertex.index&&(this.network.Hx(b),b.rev=!0);break;case tr:for(b=this.network.vertexes.i;b.next();)a=b.value,a.ip=-1,a.finish=-1;for(a=this.network.edges.i;a.next();)a.value.forest=!1;this.Ur=0;for(b.reset();b.next();)c=b.value,0===c.tc.count&&Dr(this,c);for(b.reset();b.next();)c=b.value,-1===c.ip&&Dr(this,c);for(a.reset();a.next();)b=a.value,b.forest||(c=b.fromVertex,
  d=c.finish,e=b.toVertex,g=e.finish,e.ip<c.ip&&d<g&&(this.network.Hx(b),b.rev=!0))}for(a=this.network.vertexes.i;a.next();)a.value.layer=-1;this.yb=-1;this.assignLayers();for(a.reset();a.next();)this.yb=Math.max(this.yb,a.value.layer);a=[];for(c=this.network.edges.i;c.next();)b=c.value,b.valid=!1,a.push(b);for(c=0;c<a.length;c++)if(b=a[c],!b.valid&&(null!==b.fromVertex.Cd&&null!==b.toVertex.Cd||b.fromVertex.layer!==b.toVertex.layer)){l=h=k=g=0;e=b.fromVertex;d=b.toVertex;if(null!==b.link){k=b.link;
  if(null===k)continue;var n=e.Cd,g=d.Cd;if(null===n||null===g)continue;var p=k.Y,h=k.da,q=k.md,l=k.Qd;b.rev&&(k=p,m=q,p=h,q=l,h=k,l=m);var r=e.S,k=b.toVertex.S,s=b.rev?d.P:e.P,m=z.O();s.F()?(pp(p,q,ec,m),m.F()||m.assign(r)):m.assign(r);n!==p&&s.F()&&p.isVisible()&&(n=e.P,n.F()&&(m.x+=s.x-n.x,m.y+=s.y-n.y));p=b.rev?e.P:d.P;n=z.O();p.F()?(pp(h,l,ec,n),n.F()||n.assign(k)):n.assign(k);g!==h&&p.F()&&h.isVisible()&&(g=d.P,g.F()&&(n.x+=p.x-g.x,n.y+=p.y-g.y));90===this.fa||270===this.fa?(g=Math.round((m.x-
  r.x)/this.Td),h=m.x,k=Math.round((n.x-k.x)/this.Td),l=n.x):(g=Math.round((m.y-r.y)/this.Td),h=m.y,k=Math.round((n.y-k.y)/this.Td),l=n.y);z.A(m);z.A(n);b.portFromColOffset=g;b.portFromPos=h;b.portToColOffset=k;b.portToPos=l}else b.portFromColOffset=0,b.portFromPos=0,b.portToColOffset=0,b.portToPos=0;m=e.layer;r=d.layer;a:if(n=b,p=0,s=n.link,null!==s){var t=s.md,v=s.Qd;if(null!==t&&null!==v){var x=s.Y,q=s.da;if(null!==x&&null!==q){var y=t.Db,A=v.Eb;this.aq||(s.Db.bd()||(y=s.Db),s.Eb.bd()||(A=s.Eb));
  var C=s.rc,L=Er(this,!0);if(y.bd()||y===Yb)y=L;var H=Er(this,!1);if(A.bd()||A===Yb)A=H;if(y.lj()&&y.vp(H)&&A.lj()&&A.vp(L)){p=0;break a}L=s.getLinkPoint(x,t,y,!0,C,q,v,z.O());y=s.getLinkDirection(x,t,L,y,!0,C,q,v);z.A(L);y===Fr(this,n,!0)?p+=1:this.aq&&null!==x&&1===x.ports.count&&n.rev&&(p+=1);y=s.getLinkPoint(q,v,A,!1,C,x,t,z.O());s=s.getLinkDirection(q,v,y,A,!1,C,x,t);z.A(y);s===Fr(this,n,!1)?p+=2:this.aq&&null!==q&&1===q.ports.count&&n.rev&&(p+=2)}}}n=1===p||3===p?!0:!1;if(p=2===p||3===p?!0:!1)q=
  this.network.createVertex(),q.Cd=null,q.Tm=1,q.layer=m,q.near=e,this.network.ul(q),e=this.network.Hp(e,q,b.link),e.valid=!1,e.rev=b.rev,e.portFromColOffset=g,e.portToColOffset=0,e.portFromPos=h,e.portToPos=0,e=q;s=1;n&&s--;if(m-r>s&&0<m){b.valid=!1;q=this.network.createVertex();q.Cd=null;q.Tm=2;q.layer=m-1;this.network.ul(q);e=this.network.Hp(e,q,b.link);e.valid=!0;e.rev=b.rev;e.portFromColOffset=p?0:g;e.portToColOffset=0;e.portFromPos=p?0:h;e.portToPos=0;e=q;for(m--;m-r>s&&0<m;)q=this.network.createVertex(),
  q.Cd=null,q.Tm=3,q.layer=m-1,this.network.ul(q),e=this.network.Hp(e,q,b.link),e.valid=!0,e.rev=b.rev,e.portFromColOffset=0,e.portToColOffset=0,e.portFromPos=0,e.portToPos=0,e=q,m--;e=this.network.Hp(q,d,b.link);e.valid=!n;n&&(q.near=d);e.rev=b.rev;e.portFromColOffset=0;e.portToColOffset=k;e.portFromPos=0;e.portToPos=l}else b.valid=!0}b=this.ge=[];for(c=0;c<=this.yb;c++)b[c]=0;for(a=this.network.vertexes.i;a.next();)c=a.value,c.index=-1;this.initializeIndices();this.Jv=-1;for(c=this.Rf=this.Lr=0;c<=
  this.yb;c++)b[c]>b[this.Rf]&&(this.Jv=b[c]-1,this.Rf=c),b[c]<b[this.Lr]&&(this.Lr=c);this.Vr=[];for(c=0;c<b.length;c++)this.Vr[c]=[];for(a.reset();a.next();)b=a.value,c=this.Vr[b.layer],c[b.index]=b;this.Kb=-1;for(a=0;a<=this.yb;a++){b=Gr(this,a);c=0;d=this.ge[a];for(e=0;e<d;e++)g=b[e],c+=this.nodeMinColumnSpace(g,!0),g.column=c,c+=1,c+=this.nodeMinColumnSpace(g,!1);this.Kb=Math.max(this.Kb,c-1);Hr(this,a,b)}this.reduceCrossings();this.straightenAndPack();this.updateParts()}this.network=null;this.Gf=
  !0};on.prototype.linkMinLength=function(){return 1};function Ir(a){var b=a.fromVertex.Cd;a=a.toVertex.Cd;return null===b&&null===a?8:null===b||null===a?4:1}on.prototype.nodeMinLayerSpace=function(a,b){return null===a.Cd?0:90===this.fa||270===this.fa?b?a.S.y+10:a.P.height-a.S.y+10:b?a.S.x+10:a.P.width-a.S.x+10};
  on.prototype.nodeMinColumnSpace=function(a,b){if(null===a.Cd)return 0;var c=b?a.yA:a.xA;if(null!==c)return c;c=this.fa;return 90===c||270===c?b?a.yA=a.S.x/this.Td+1|0:a.xA=(a.P.width-a.S.x)/this.Td+1|0:b?a.yA=a.S.y/this.Td+1|0:a.xA=(a.P.height-a.S.y)/this.Td+1|0};function Jr(a){null===a.um&&(a.um=[]);for(var b=0,c=a.network.vertexes.i;c.next();){var d=c.value;a.um[b]=d.layer;b++;a.um[b]=d.column;b++;a.um[b]=d.index;b++}return a.um}
  function Kr(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 Lr(a,b,c){u&&(z.p(b,on,"crossingMatrix:unfixedLayer"),z.p(c,on,"crossingMatrix:direction"));var d=Gr(a,b),e=a.ge[b];if(null===a.Tr||a.Tr.length<e*e)a.Tr=[];for(var g=a.Tr,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.Tm===m.Tm||k++;else for(p=h-1;p>n;p--)l=d[p],l.near===m&&l.Tm===m.Tm||k++;var m=0,q,r=q=p=l=0,s,t=0,v=0;s=0;var x;if(0<=c)for(n=d[h].Ze,m=0;m<n.count;m++)if(q=n.o[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.o[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,v=s.portToPos,s=s.portFromPos,p<v&&(l>t||l===t&&q>s)&&k++,v<p&&(t>l||t===l&&s>q)&&k++);if(0>=c)for(n=d[h].Te,m=0;m<n.count;m++)if(q=n.o[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.o[r],s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,v=s.portToPos,s=s.portFromPos,q<s&&(l>t||l===t&&p>v)&&k++,
  s<q&&(t>l||t===l&&v>p)&&k++);g[h*e+h]=k;for(n=h+1;n<e;n++){var y=0,A=0;if(0<=c)for(k=d[h].Ze,x=d[n].Ze,m=0;m<k.count;m++)if(q=k.o[m],q.valid&&q.fromVertex.layer!==b)for(l=q.fromVertex.index,q=q.portFromPos,r=0;r<x.count;r++)s=x.o[r],s.valid&&s.fromVertex.layer!==b&&(t=s.fromVertex.index,s=s.portFromPos,(l<t||l===t&&q<s)&&A++,(t<l||t===l&&s<q)&&y++);if(0>=c)for(k=d[h].Te,x=d[n].Te,m=0;m<k.count;m++)if(q=k.o[m],q.valid&&q.toVertex.layer!==b)for(l=q.toVertex.index,p=q.portToPos,r=0;r<x.count;r++)s=x.o[r],
  s.valid&&s.toVertex.layer!==b&&(t=s.toVertex.index,v=s.portToPos,(l<t||l===t&&p<v)&&A++,(t<l||t===l&&v<p)&&y++);g[h*e+n]=y;g[n*e+h]=A}}Hr(a,b,d);return g}on.prototype.countCrossings=function(){for(var a=0,b=0;b<=this.yb;b++)for(var c=Lr(this,b,1),d=this.ge[b],e=0;e<d;e++)for(var g=e;g<d;g++)a+=c[e*d+g];return a};
  function Mr(a){for(var b=0,c=0;c<=a.yb;c++){for(var d=a,e=c,g=Gr(d,e),h=d.ge[e],k=0,l=0;l<h;l++){var m=null,m=g[l].Te,n,p=0,q=0;if(null!==m)for(var r=0;r<m.count;r++)n=m.o[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)*Ir(n))}Hr(d,e,g);b+=k}return b}
  on.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 Nr(a,b,c){u&&(z.p(b,on,"barycenters:unfixedLayer"),z.p(c,on,"barycenters:direction"));for(var d=Gr(a,b),e=a.ge[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ze);var m=null;0<=c&&(m=k.Te);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.o[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.o[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(n+=q.column,p++);g[h]=0===p?-1:n/
  p}Hr(a,b,d);return g}
  function Or(a,b,c){u&&(z.p(b,on,"medians:unfixedLayer"),z.p(c,on,"medians:direction"));for(var d=Gr(a,b),e=a.ge[b],g=[],h=0;h<e;h++){var k=d[h],l=null;0>=c&&(l=k.Ze);var m=null;0<=c&&(m=k.Te);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.o[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.o[l],q=k.toVertex,k.valid&&!k.rev&&q.layer!==b&&(p[n]=q.column+k.portToColOffset,
  n++);0===n?g[h]=-1:(p.sort(function(a,b){return a-b}),m=n>>1,g[h]=n&1?p[m]:p[m-1]+p[m]>>1)}Hr(a,b,d);return g}function Pr(a,b,c,d,e,g){if(b.component===d){b.component=c;var h=0,k=0;if(e)for(var l=b.pc;l.next();){var k=l.value,m=k.toVertex,h=b.layer-m.layer,k=a.linkMinLength(k);h===k&&Pr(a,m,c,d,e,g)}if(g)for(l=b.tc;l.next();)k=l.value,m=k.fromVertex,h=m.layer-b.layer,k=a.linkMinLength(k),h===k&&Pr(a,m,c,d,e,g)}}
  function Qr(a,b,c,d,e,g){if(b.component===d){b.component=c;if(e)for(var h=b.pc;h.next();)Qr(a,h.value.toVertex,c,d,e,g);if(g)for(b=b.tc;b.next();)Qr(a,b.value.fromVertex,c,d,e,g)}}function Ar(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid)return b}return null}function Br(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.pc;d.next();)if(d.value.toVertex.valid){c=!1;break}if(c)return b}}return null}
  function Cr(a){for(a=a.vertexes.i;a.next();){var b=a.value;if(b.valid){for(var c=!0,d=b.tc;d.next();)if(d.value.fromVertex.valid){c=!1;break}if(c)return b}}return null}function Dr(a,b){b.ip=a.Ur;a.Ur++;for(var c=b.pc;c.next();){var d=c.value,e=d.toVertex;-1===e.ip&&(d.forest=!0,Dr(a,e))}b.finish=a.Ur;a.Ur++}
  on.prototype.assignLayers=function(){switch(this.xo){case Rr:Sr(this);break;case Tr:for(var a=0,b=this.network.vertexes.i;b.next();)a=Ur(this,b.value),this.yb=Math.max(a,this.yb);for(b.reset();b.next();)a=b.value,a.layer=this.yb-a.layer;break;default:case ur:Sr(this);for(b=this.network.vertexes.i;b.next();)b.value.valid=!1;for(b.reset();b.next();)a=b.value,0===a.tc.count&&Vr(this,a);a=Infinity;for(b.reset();b.next();)a=Math.min(a,b.value.layer);this.yb=-1;for(b.reset();b.next();){var c=b.value;c.layer-=
  a;this.yb=Math.max(this.yb,c.layer)}}};function Sr(a){for(var b=a.network.vertexes.i;b.next();){var c=Wr(a,b.value);a.yb=Math.max(c,a.yb)}}function Wr(a,b){var c=0;if(-1===b.layer){for(var d=b.pc;d.next();)var e=d.value,g=e.toVertex,e=a.linkMinLength(e),c=Math.max(c,Wr(a,g)+e);b.layer=c}else c=b.layer;return c}function Ur(a,b){var c=0;if(-1===b.layer){for(var d=b.tc;d.next();)var e=d.value,g=e.fromVertex,e=a.linkMinLength(e),c=Math.max(c,Ur(a,g)+e);b.layer=c}else c=b.layer;return c}
  function Vr(a,b){if(!b.valid){b.valid=!0;for(var c=b.pc;c.next();)Vr(a,c.value.toVertex);for(c=a.network.vertexes.i;c.next();)c.value.component=-1;for(var d=b.Ze.o,e=d.length,g=0;g<e;g++){var h=d[g],k=a.linkMinLength(h);h.fromVertex.layer-h.toVertex.layer>k&&Pr(a,h.fromVertex,0,-1,!0,!1)}for(Pr(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.Ze.o,e=s.length,g=0;g<e;g++){var h=s[g],t=h.fromVertex,
  q=q+1;1!==t.component&&(k+=1,t=t.layer-p.layer,h=a.linkMinLength(h),d=Math.min(d,t-h))}h=p.Te.o;e=h.length;for(g=0;g<e;g++)s=h[g].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(Pr(a,b,1,-1,!0,!1);0!==b.component;){g=0;e=Infinity;d=0;k=null;for(l=a.network.vertexes.i;l.next();)if(m=l.value,1===m.component){n=
  0;p=!1;h=m.Ze.o;q=h.length;for(r=0;r<q;r++)s=h[r].fromVertex,n+=1,1!==s.component?g+=1:p=!0;h=m.Te.o;q=h.length;for(r=0;r<q;r++)s=h[r],t=s.toVertex,n-=1,1!==t.component&&(g-=1,t=m.layer-t.layer,s=a.linkMinLength(s),e=Math.min(e,t-s));(null===k||n>d)&&!p&&(k=m,d=n)}if(0>g){for(c.reset();c.next();)g=c.value,1===g.component&&(g.layer-=e);b.component=0}else k.component=0}}}
  function Fr(a,b,c){return 90===a.fa?c&&!b.rev||!c&&b.rev?270:90:180===a.fa?c&&!b.rev||!c&&b.rev?0:180:270===a.fa?c&&!b.rev||!c&&b.rev?90:270:c&&!b.rev||!c&&b.rev?180:0}
  on.prototype.initializeIndices=function(){switch(this.no){default:case Xr:for(var a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;b.index=this.ge[c];this.ge[c]++}break;case vr:a=this.network.vertexes.i;for(b=this.yb;0<=b;b--)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&Yr(this,c);break;case Zr:for(a=this.network.vertexes.i,b=0;b<=this.yb;b++)for(a.reset();a.next();)c=a.value,c.layer===b&&-1===c.index&&$r(this,c)}};
  function Yr(a,b){var c=b.layer;b.index=a.ge[c];a.ge[c]++;for(var c=b.Te.jc(),d=!0;d;)for(var d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portFromColOffset>h.portFromColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.toVertex,-1===d.index&&Yr(a,d))}
  function $r(a,b){var c=b.layer;b.index=a.ge[c];a.ge[c]++;for(var c=b.Ze.jc(),d=!0,e=0;d;)for(d=!1,e=0;e<c.length-1;e++){var g=c[e],h=c[e+1];g.portToColOffset>h.portToColOffset&&(d=!0,c[e]=h,c[e+1]=g)}for(e=0;e<c.length;e++)d=c[e],d.valid&&(d=d.fromVertex,-1===d.index&&$r(a,d))}
  on.prototype.reduceCrossings=function(){for(var a=this.countCrossings(),b=Jr(this),c=0,d=0,e=0,c=0;c<this.nm;c++){for(d=0;d<=this.yb;d++)as(this,d,1),bs(this,d,1);e=this.countCrossings();e<a&&(a=e,b=Jr(this));for(d=this.yb;0<=d;d--)as(this,d,-1),bs(this,d,-1);e=this.countCrossings();e<a&&(a=e,b=Jr(this))}Kr(this,b);for(c=0;c<this.nm;c++){for(d=0;d<=this.yb;d++)as(this,d,0),bs(this,d,0);e=this.countCrossings();e<a&&(a=e,b=Jr(this));for(d=this.yb;0<=d;d--)as(this,d,0),bs(this,d,0);e=this.countCrossings();
  e<a&&(a=e,b=Jr(this))}Kr(this,b);var g=!1,h=c=0,k=0,d=0;switch(this.Fn){case cs:break;case ds:for(k=a+1;(d=this.countCrossings())<k;)for(k=d,c=this.yb;0<=c;c--)for(h=0;h<=c;h++){for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=bs(this,d,-1)||g;e=this.countCrossings();e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=bs(this,d,1)||g;e=this.countCrossings();e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=bs(this,d,1)||g;e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,
  d=h;d<=c;d++)g=bs(this,d,-1)||g;e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=bs(this,d,0)||g;e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=bs(this,d,0)||g;e>=a?Kr(this,b):(a=e,b=Jr(this))}break;default:case wr:for(c=this.yb,h=0,k=a+1;(d=this.countCrossings())<k;){k=d;for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=bs(this,d,-1)||g;e=this.countCrossings();e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=bs(this,d,1)||g;e=this.countCrossings();
  e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=bs(this,d,1)||g;e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=bs(this,d,-1)||g;e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=c;d>=h;d--)g=bs(this,d,0)||g;e>=a?Kr(this,b):(a=e,b=Jr(this));for(g=!0;g;)for(g=!1,d=h;d<=c;d++)g=bs(this,d,0)||g;e>=a?Kr(this,b):(a=e,b=Jr(this))}}Kr(this,b)};
  function as(a,b,c){u&&(z.p(b,on,"medianBarycenterCrossingReduction:unfixedLayer"),z.p(c,on,"medianBarycenterCrossingReduction:direction"));var d=0,e=Gr(a,b),g=a.ge[b],h=Or(a,b,c);c=Nr(a,b,c);for(d=0;d<g;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<g-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<g;d++)l=e[d],l.index=d,h+=a.nodeMinColumnSpace(l,
  !0),l.column=h,h+=1,h+=a.nodeMinColumnSpace(l,!1);Hr(a,b,e)}
  function bs(a,b,c){var d=Gr(a,b),e=a.ge[b];c=Lr(a,b,c);var g=0,h;h=[];for(g=0;g<e;g++)h[g]=-1;var k;k=[];for(g=0;g<e;g++)k[g]=-1;for(var l=!1,m=!0;m;)for(m=!1,g=0;g<e-1;g++){var n=c[d[g].index*e+d[g+1].index],p=c[d[g+1].index*e+d[g].index],q=0,r=0,s=d[g].column,t=d[g+1].column,v=a.nodeMinColumnSpace(d[g],!0),x=a.nodeMinColumnSpace(d[g],!1),y=a.nodeMinColumnSpace(d[g+1],!0),A=a.nodeMinColumnSpace(d[g+1],!1),v=s-v+y,x=t-x+A,y=y=0,C=d[g].tc.i;for(C.reset();C.next();)if(A=C.value,A.valid&&A.fromVertex.layer===
  b){A=A.fromVertex;for(y=0;d[y]!==A;)y++;y<g&&(q+=2*(g-y),r+=2*(g+1-y));y===g+1&&(q+=1);y>g+1&&(q+=4*(y-g),r+=4*(y-(g+1)))}C=d[g].pc.i;for(C.reset();C.next();)if(A=C.value,A.valid&&A.toVertex.layer===b){A=A.toVertex;for(y=0;d[y]!==A;)y++;y===g+1&&(r+=1)}C=d[g+1].tc.i;for(C.reset();C.next();)if(A=C.value,A.valid&&A.fromVertex.layer===b){A=A.fromVertex;for(y=0;d[y]!==A;)y++;y<g&&(q+=2*(g+1-y),r+=2*(g-y));y===g&&(r+=1);y>g+1&&(q+=4*(y-(g+1)),r+=4*(y-g))}C=d[g+1].pc.i;for(C.reset();C.next();)if(A=C.value,
  A.valid&&A.toVertex.layer===b){A=A.toVertex;for(y=0;d[y]!==A;)y++;y===g&&(q+=1)}var y=A=0,C=h[d[g].index],L=k[d[g].index],H=h[d[g+1].index],U=k[d[g+1].index];-1!==C&&(A+=Math.abs(C-s),y+=Math.abs(C-x));-1!==L&&(A+=Math.abs(L-s),y+=Math.abs(L-x));-1!==H&&(A+=Math.abs(H-t),y+=Math.abs(H-v));-1!==U&&(A+=Math.abs(U-t),y+=Math.abs(U-v));if(r<q-.5||r===q&&p<n-.5||r===q&&p===n&&y<A-.5)m=l=!0,d[g].column=x,d[g+1].column=v,n=d[g],d[g]=d[g+1],d[g+1]=n}for(g=0;g<e;g++)d[g].index=g;Hr(a,b,d);return l}
  on.prototype.straightenAndPack=function(){var a=0,b=!1,c=0!==(this.Si&es),a=this.Si===xr;1E3<this.network.edges.count&&!a&&(c=!1);if(c){b=[];for(a=a=0;a<=this.yb;a++)b[a]=0;for(var d=0,e=this.network.vertexes.i;e.next();){var g=e.value,a=g.layer,d=g.column,g=this.nodeMinColumnSpace(g,!1);b[a]=Math.max(b[a],d+g)}for(e.reset();e.next();)g=e.value,a=g.layer,d=g.column,g.column=(8*(this.Kb-b[a])>>1)+8*d;this.Kb*=8}if(0!==(this.Si&fs))for(b=!0;b;){b=!1;for(a=this.Rf+1;a<=this.yb;a++)b=gs(this,a,1)||b;
  for(a=this.Rf-1;0<=a;a--)b=gs(this,a,-1)||b;b=gs(this,this.Rf,0)||b}if(0!==(this.Si&hs)){for(a=this.Rf+1;a<=this.yb;a++)is(this,a,1);for(a=this.Rf-1;0<=a;a--)is(this,a,-1);is(this,this.Rf,0)}c&&(js(this,-1),js(this,1));if(0!==(this.Si&fs))for(b=!0;b;){b=!1;b=gs(this,this.Rf,0)||b;for(a=this.Rf+1;a<=this.yb;a++)b=gs(this,a,0)||b;for(a=this.Rf-1;0<=a;a--)b=gs(this,a,0)||b}};
  function gs(a,b,c){u&&(z.p(b,on,"bendStraighten:unfixedLayer"),z.p(c,on,"bendStraighten:direction"));for(var d=!1;ks(a,b,c);)d=!0;return d}
  function ks(a,b,c){u&&(z.p(b,on,"shiftbendStraighten:unfixedLayer"),z.p(c,on,"shiftbendStraighten:direction"));var d=0,e=Gr(a,b),g=a.ge[b],h=Nr(a,b,-1);if(0<c)for(d=0;d<g;d++)h[d]=-1;var k=Nr(a,b,1);if(0>c)for(d=0;d<g;d++)k[d]=-1;for(var l=!1,m=!0;m;)for(m=!1,d=0;d<g;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>=g||e[d+1].column-n-1>q+a.nodeMinColumnSpace(e[d+1],!0)?n+1:n,s=q=
  0,t=0,v=0,x=0,y=0;if(0>=c)for(var A=e[d].tc.i;A.next();){var C=A.value;C.valid&&C.fromVertex.layer!==b&&(v=Ir(C),x=C.portFromColOffset,y=C.portToColOffset,C=C.fromVertex.column,q+=(Math.abs(n+y-(C+x))+1)*v,s+=(Math.abs(r+y-(C+x))+1)*v,t+=(Math.abs(p+y-(C+x))+1)*v)}if(0<=c)for(A=e[d].pc.i;A.next();)C=A.value,C.valid&&C.toVertex.layer!==b&&(v=Ir(C),x=C.portFromColOffset,y=C.portToColOffset,C=C.toVertex.column,q+=(Math.abs(n+x-(C+y))+1)*v,s+=(Math.abs(r+x-(C+y))+1)*v,t+=(Math.abs(p+x-(C+y))+1)*v);y=
  x=v=0;A=h[e[d].index];C=k[e[d].index];-1!==A&&(v+=Math.abs(A-n),x+=Math.abs(A-r),y+=Math.abs(A-p));-1!==C&&(v+=Math.abs(C-n),x+=Math.abs(C-r),y+=Math.abs(C-p));if(s<q||s===q&&x<v)m=l=!0,e[d].column=r;else if(t<q||t===q&&y<v)m=l=!0,e[d].column=p}Hr(a,b,e);a.normalize();return l}
  function is(a,b,c){u&&(z.p(b,on,"medianStraighten:unfixedLayer"),z.p(c,on,"medianStraighten:direction"));var d=0,e=Gr(a,b),g=a.ge[b],h=Or(a,b,c);c=[];for(d=0;d<g;d++)c[d]=h[d];for(h=!0;h;)for(h=!1,d=0;d<g;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===g-1?n=k:0===d?(p=e[d+1].column,n=p-k===m+a.nodeMinColumnSpace(e[d+1],!0)?k-1:k):d===g-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===g-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===g-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)}Hr(a,b,e);a.normalize()}
  function ls(a,b){u&&(z.p(b,on,"packAux:column"),z.p(1,on,"packAux:direction"));for(var c=!0,d=a.network.vertexes.i;d.next();){var e=d.value,g=a.nodeMinColumnSpace(e,!0),h=a.nodeMinColumnSpace(e,!1);if(e.column-g<=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 ms(a,b){u&&(z.p(b,on,"tightPackAux:column"),z.p(1,on,"tightPackAux:direction"));for(var c=b,c=b+1,d=0,e=[],g=[],d=0;d<=a.yb;d++)e[d]=!1,g[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&&(g[d.layer]=!0)}k=!0;c=!1;for(d=0;d<=a.yb;d++)k=k&&!(e[d]&&g[d]);if(k)for(h.reset();h.next();)e=h.value,e.column>b&&(e.column-=1,c=!0);return c}
  function js(a,b){u&&z.p(b,on,"componentPack:direction");for(var c=0;c<=a.Kb;c++)for(;ls(a,c););a.normalize();for(c=0;c<a.Kb;c++)for(;ms(a,c););a.normalize();var c=0,d,e=0,g=0,h=0;if(0<b)for(c=0;c<=a.Kb;c++)for(d=Jr(a),e=Mr(a),g=e+1;e<g;)g=e,ns(a,c,1),h=Mr(a),h>e?Kr(a,d):h<e&&(e=h,d=Jr(a));if(0>b)for(c=a.Kb;0<=c;c--)for(d=Jr(a),e=Mr(a),g=e+1;e<g;)g=e,ns(a,c,-1),h=Mr(a),h>e?Kr(a,d):h<e&&(e=h,d=Jr(a));a.normalize()}
  function ns(a,b,c){a.wg=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.wg)}if(0>c)for(d.reset();d.next();)e=d.value,e.column+a.nodeMinColumnSpace(e,!1)>=b&&(e.component=a.wg);a.wg++;for(d.reset();d.next();)b=d.value,-1===b.component&&(Qr(a,b,a.wg,-1,!0,!0),a.wg++);var g=0;b=[];for(g=0;g<a.wg*a.wg;g++)b[g]=!1;e=[];for(g=0;g<(a.yb+1)*(a.Kb+1);g++)e[g]=-1;for(d.reset();d.next();)for(var g=
  d.value,h=g.layer,k=Math.max(0,g.column-a.nodeMinColumnSpace(g,!0)),l=Math.min(a.Kb,g.column+a.nodeMinColumnSpace(g,!1));k<=l;k++)e[h*(a.Kb+1)+k]=g.component;for(g=0;g<=a.yb;g++){if(0<c)for(k=0;k<a.Kb;k++)-1!==e[g*(a.Kb+1)+k]&&-1!==e[g*(a.Kb+1)+k+1]&&e[g*(a.Kb+1)+k]!==e[g*(a.Kb+1)+k+1]&&(b[e[g*(a.Kb+1)+k]*a.wg+e[g*(a.Kb+1)+k+1]]=!0);if(0>c)for(k=a.Kb;0<k;k--)-1!==e[g*(a.Kb+1)+k]&&-1!==e[g*(a.Kb+1)+k-1]&&e[g*(a.Kb+1)+k]!==e[g*(a.Kb+1)+k-1]&&(b[e[g*(a.Kb+1)+k]*a.wg+e[g*(a.Kb+1)+k-1]]=!0)}e=[];for(g=
  0;g<a.wg;g++)e[g]=!0;h=new J("number");h.add(0);for(l=0;0!==h.count;)if(l=h.o[h.count-1],h.dd(h.count-1),e[l])for(e[l]=!1,g=0;g<a.wg;g++)b[l*a.wg+g]&&h.Md(0,g);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)}
  on.prototype.commitLayout=function(){if(this.aq)for(var a=Er(this,!0),b=Er(this,!1),c=this.network.edges.i;c.next();){var d=c.value.link;null!==d&&(d.Db=a,d.Eb=b)}this.commitNodes();this.Hz();this.Rt&&this.commitLinks()};function Er(a,b){return 270===a.fa?b?Zc:bd:90===a.fa?b?bd:Zc:180===a.fa?b?$c:ad:b?ad:$c}
  on.prototype.commitNodes=function(){this.ug=[];this.Qf=[];this.Pf=[];this.Rb=[];for(var a=0;a<=this.yb;a++)this.ug[a]=0,this.Qf[a]=0,this.Pf[a]=0,this.Rb[a]=0;for(a=this.network.vertexes.i;a.next();){var b=a.value,c=b.layer;this.ug[c]=Math.max(this.ug[c],this.nodeMinLayerSpace(b,!0));this.Qf[c]=Math.max(this.Qf[c],this.nodeMinLayerSpace(b,!1))}for(var b=0,d=this.pm,c=0;c<=this.yb;c++){var e=d;0>=this.ug[c]+this.Qf[c]&&(e=0);0<c&&(b+=e/2);90===this.fa||0===this.fa?(b+=this.Qf[c],this.Pf[c]=b,b+=this.ug[c]):
  (b+=this.ug[c],this.Pf[c]=b,b+=this.Qf[c]);c<this.yb&&(b+=e/2);this.Rb[c]=b}d=b;b=this.je;for(c=0;c<=this.yb;c++)270===this.fa?this.Pf[c]=b.y+this.Pf[c]:90===this.fa?(this.Pf[c]=b.y+d-this.Pf[c],this.Rb[c]=d-this.Rb[c]):180===this.fa?this.Pf[c]=b.x+this.Pf[c]:(this.Pf[c]=b.x+d-this.Pf[c],this.Rb[c]=d-this.Rb[c]);a.reset();for(d=e=Infinity;a.next();){var c=a.value,g=c.layer,h=c.column|0,k=0,l=0;270===this.fa||90===this.fa?(k=b.x+this.Td*h,l=this.Pf[g]):(k=this.Pf[g],l=b.y+this.Td*h);c.ra=k;c.za=l;
  e=Math.min(c.x,e);d=Math.min(c.y,d)}e=b.x-e;b=b.y-d;this.tB=null!==this.group?new N(e,b):Id;for(a.reset();a.next();)c=a.value,null!==this.group&&(c.x+=e,c.y+=b),c.commit()};
  on.prototype.Hz=function(){for(var a=0,b=this.pm,c=0;c<=this.yb;c++)a+=this.ug[c],a+=this.Qf[c];for(var a=a+this.yb*b,b=[],c=this.Td*this.Kb,d=this.yI;0<=d;d--)270===this.fa?0===d?b.push(new w(0,0,c,Math.abs(this.Rb[0]))):b.push(new w(0,this.Rb[d-1],c,Math.abs(this.Rb[d-1]-this.Rb[d]))):90===this.fa?0===d?b.push(new w(0,this.Rb[0],c,Math.abs(this.Rb[0]-a))):b.push(new w(0,this.Rb[d],c,Math.abs(this.Rb[d-1]-this.Rb[d]))):180===this.fa?0===d?b.push(new w(0,0,Math.abs(this.Rb[0]),c)):b.push(new w(this.Rb[d-
  1],0,Math.abs(this.Rb[d-1]-this.Rb[d]),c)):0===d?b.push(new w(this.Rb[0],0,Math.abs(this.Rb[0]-a),c)):b.push(new w(this.Rb[d],0,Math.abs(this.Rb[d-1]-this.Rb[d]),c));this.commitLayers(b,this.tB)};on.prototype.commitLayers=function(){};
  on.prototype.commitLinks=function(){for(var a=this.network.edges.i,b;a.next();)b=a.value.link,null!==b&&(b.Ul(),b.ep(),b.dj());for(a.reset();a.next();)b=a.value.link,null!==b&&b.An();for(a.reset();a.next();){var c=a.value;b=c.link;if(null!==b){b.Ul();var d=b,e=d.Y,g=d.da,h=d.md,k=d.Qd;if(c.valid){if(b.Se===Xi&&4===b.sa){if(c.rev)var l=e,e=g,g=l,m=h,h=k,k=m;if(c.fromVertex.column===c.toVertex.column){var n=b.getLinkPoint(e,h,b.computeSpot(!0),!0,!1,g,k),p=b.getLinkPoint(g,k,b.computeSpot(!1),!1,!1,
  e,h);n.F()||n.set(e.W.yl);p.F()||p.set(g.W.yl);b.ep();b.tl(n.x,n.y);b.tl((2*n.x+p.x)/3,(2*n.y+p.y)/3);b.tl((n.x+2*p.x)/3,(n.y+2*p.y)/3);b.tl(p.x,p.y)}else{var q=!1,r=!1;null!==h&&b.computeSpot(!0)===Yb&&(q=!0);null!==k&&b.computeSpot(!1)===Yb&&(r=!0);if(q||r){var s=b.m(0).x,t=b.m(0).y,v=b.m(1).x,x=b.m(1).y,y=b.m(2).x,A=b.m(2).y,C=b.m(3).x,L=b.m(3).y;if(q){90===this.fa||270===this.fa?(v=s,x=(t+L)/2):(v=(s+C)/2,x=t);b.aa(1,v,x);var H=b.getLinkPoint(e,h,b.computeSpot(!0),!0,!1,g,k);H.F()||H.set(e.W.yl);
  b.aa(0,H.x,H.y)}r&&(90===this.fa||270===this.fa?(y=C,A=(t+L)/2):(y=(s+C)/2,A=L),b.aa(2,y,A),H=b.getLinkPoint(g,k,b.computeSpot(!1),!1,!1,e,h),H.F()||H.set(g.W.yl),b.aa(3,H.x,H.y))}}}b.dj()}else if(c.fromVertex.layer===c.toVertex.layer)b.dj();else{var U=!1,ea=!1,W=0,P=b.Ct+1;if(b.rc)ea=!0,W=b.sa,4<W&&b.points.removeRange(2,W-3);else if(b.Se===Xi)U=!0,W=b.sa,4<W&&b.points.removeRange(2,W-3),P=2;else{var W=b.sa,ba=b.computeSpot(!0)===Yb,Oa=b.computeSpot(!1)===Yb;2<W&&ba&&Oa?b.points.removeRange(1,W-
  2):3<W&&ba&&!Oa?b.points.removeRange(1,W-3):3<W&&!ba&&Oa?b.points.removeRange(2,W-2):4<W&&!ba&&!Oa&&b.points.removeRange(2,W-3)}var sa=c.fromVertex,Na=c.toVertex,ua,Ha;if(c.rev){for(var Aa=0;null!==Na&&sa!==Na;){Ha=ua=null;for(var jc=Na.tc.i;jc.next();){var zd=jc.value;if(zd.link===c.link&&(ua=zd.fromVertex,Ha=zd.toVertex,null===ua.Cd))break}if(ua!==sa)if(rb=b.m(P-1).x,gb=b.m(P-1).y,oa=ua.ra,pa=ua.za,ea)180===this.fa||0===this.fa?2===P?(b.B(P++,rb,gb),b.B(P++,rb,pa)):(Ae=null!==Ha?Ha.za:gb,Ae!==pa&&
  (sb=this.Rb[ua.layer-1],b.B(P++,sb,gb),b.B(P++,sb,pa))):2===P?(b.B(P++,rb,gb),b.B(P++,oa,gb)):(Cd=null!==Ha?Ha.ra:rb,Cd!==oa&&(sb=this.Rb[ua.layer-1],b.B(P++,rb,sb),b.B(P++,oa,sb)));else if(2===P)if(Xa=Math.max(10,this.ug[Na.layer]),Va=Math.max(10,this.Qf[Na.layer]),U)180===this.fa?oa<=Na.P.x?(Aa=Na.P.x,b.B(P++,Aa-Xa,pa),b.B(P++,Aa,pa),b.B(P++,Aa+Va,pa)):(b.B(P++,oa-Xa,pa),b.B(P++,oa,pa),b.B(P++,oa+Va,pa)):90===this.fa?pa>=Na.P.bottom?(Aa=Na.P.y+Na.P.height,b.B(P++,oa,Aa+Va),b.B(P++,oa,Aa),b.B(P++,
  oa,Aa-Xa)):(b.B(P++,oa,pa+Va),b.B(P++,oa,pa),b.B(P++,oa,pa-Xa)):270===this.fa?pa<=Na.P.y?(Aa=Na.P.y,b.B(P++,oa,Aa-Xa),b.B(P++,oa,Aa),b.B(P++,oa,Aa+Va)):(b.B(P++,oa,pa-Xa),b.B(P++,oa,pa),b.B(P++,oa,pa+Va)):0===this.fa&&(oa>=Na.P.right?(Aa=Na.P.x+Na.P.width,b.B(P++,Aa+Va,pa),b.B(P++,Aa,pa),b.B(P++,Aa-Xa,pa)):(b.B(P++,oa+Va,pa),b.B(P++,oa,pa),b.B(P++,oa-Xa,pa)));else{b.B(P++,rb,gb);var Ad=0;if(180===this.fa||0===this.fa){if(180===this.fa?oa>=Na.P.right:oa<=Na.P.x)Ad=(0===this.fa?-Xa:Va)/2;b.B(P++,rb+
  Ad,pa)}else{if(270===this.fa?pa>=Na.P.bottom:pa<=Na.P.y)Ad=(90===this.fa?-Xa:Va)/2;b.B(P++,oa,gb+Ad)}b.B(P++,oa,pa)}else Xa=Math.max(10,this.ug[ua.layer]),Va=Math.max(10,this.Qf[ua.layer]),180===this.fa?(U&&b.B(P++,oa-Xa,pa),b.B(P++,oa,pa),U&&b.B(P++,oa+Va,pa)):90===this.fa?(U&&b.B(P++,oa,pa+Va),b.B(P++,oa,pa),U&&b.B(P++,oa,pa-Xa)):270===this.fa?(U&&b.B(P++,oa,pa-Xa),b.B(P++,oa,pa),U&&b.B(P++,oa,pa+Va)):(U&&b.B(P++,oa+Va,pa),b.B(P++,oa,pa),U&&b.B(P++,oa-Xa,pa));Na=ua}if(null===k||b.computeSpot(!1)!==
  Yb||ea)if(rb=b.m(P-1).x,gb=b.m(P-1).y,oa=b.m(P).x,pa=b.m(P).y,ea){var Qe=this.Qf[sa.layer],ac=0;180===this.fa||0===this.fa?(ac=gb,ac>=sa.P.y&&ac<=sa.P.bottom&&(180===this.fa?oa>=sa.P.x:oa<=sa.P.right)&&(Aa=sa.ra+(180===this.fa?-Qe:Qe),ac=ac<sa.P.y+sa.P.height/2?sa.P.y-this.Td/2:sa.P.bottom+this.Td/2,b.B(P++,Aa,gb),b.B(P++,Aa,ac)),b.B(P++,oa,ac)):(ac=rb,ac>=sa.P.x&&ac<=sa.P.right&&(270===this.fa?pa>=sa.P.y:pa<=sa.P.bottom)&&(Aa=sa.za+(270===this.fa?-Qe:Qe),ac=ac<sa.P.x+sa.P.width/2?sa.P.x-this.Td/
  2:sa.P.right+this.Td/2,b.B(P++,rb,Aa),b.B(P++,ac,Aa)),b.B(P++,ac,pa));b.B(P++,oa,pa)}else if(U)Xa=Math.max(10,this.ug[sa.layer]),Va=Math.max(10,this.Qf[sa.layer]),180===this.fa&&oa>=sa.P.x?(Aa=sa.P.x+sa.P.width,b.aa(P-2,Aa,gb),b.aa(P-1,Aa+Va,gb)):90===this.fa&&pa<=sa.P.bottom?(Aa=sa.P.y,b.aa(P-2,rb,Aa),b.aa(P-1,rb,Aa-Xa)):270===this.fa&&pa>=sa.P.y?(Aa=sa.P.y+sa.P.height,b.aa(P-2,rb,Aa),b.aa(P-1,rb,Aa+Va)):0===this.fa&&oa<=sa.P.right&&(Aa=sa.P.x,b.aa(P-2,Aa,gb),b.aa(P-1,Aa-Xa,gb));else{Xa=Math.max(10,
  this.ug[sa.layer]);Va=Math.max(10,this.Qf[sa.layer]);Ad=0;if(180===this.fa||0===this.fa){if(180===this.fa?oa<=sa.P.x:oa>=sa.P.right)Ad=(0===this.fa?Va:-Xa)/2;b.B(P++,oa+Ad,gb)}else{if(270===this.fa?pa<=sa.P.y:pa>=sa.P.bottom)Ad=(90===this.fa?Va:-Xa)/2;b.B(P++,rb,pa+Ad)}b.B(P++,oa,pa)}}else{for(;null!==sa&&sa!==Na;){Ha=ua=null;for(var Ng=sa.pc.i;Ng.next();){var Bd=Ng.value;if(Bd.link===c.link&&(ua=Bd.toVertex,Ha=Bd.fromVertex,null!==Ha.Cd&&(Ha=null),null===ua.Cd))break}var rb=0,gb=0,oa=0,pa=0,sb=0,
  Xa=0,Va=0;if(ua!==Na)if(rb=b.m(P-1).x,gb=b.m(P-1).y,oa=ua.ra,pa=ua.za,ea)if(180===this.fa||0===this.fa){var Ae=null!==Ha?Ha.za:gb;Ae!==pa&&(sb=this.Rb[ua.layer],2===P&&(sb=0===this.fa?Math.max(sb,rb):Math.min(sb,rb)),b.B(P++,sb,gb),b.B(P++,sb,pa))}else{var Cd=null!==Ha?Ha.ra:rb;Cd!==oa&&(sb=this.Rb[ua.layer],2===P&&(sb=90===this.fa?Math.max(sb,gb):Math.min(sb,gb)),b.B(P++,rb,sb),b.B(P++,oa,sb))}else Xa=Math.max(10,this.ug[ua.layer]),Va=Math.max(10,this.Qf[ua.layer]),180===this.fa?(b.B(P++,oa+Va,pa),
  U&&b.B(P++,oa,pa),b.B(P++,oa-Xa,pa)):90===this.fa?(b.B(P++,oa,pa-Xa),U&&b.B(P++,oa,pa),b.B(P++,oa,pa+Va)):270===this.fa?(b.B(P++,oa,pa+Va),U&&b.B(P++,oa,pa),b.B(P++,oa,pa-Xa)):(b.B(P++,oa-Xa,pa),U&&b.B(P++,oa,pa),b.B(P++,oa+Va,pa));sa=ua}ea&&(rb=b.m(P-1).x,gb=b.m(P-1).y,oa=b.m(P).x,pa=b.m(P).y,180===this.fa||0===this.fa?gb!==pa&&(sb=0===this.fa?Math.min(Math.max((oa+rb)/2,this.Rb[Na.layer]),oa):Math.max(Math.min((oa+rb)/2,this.Rb[Na.layer]),oa),b.B(P++,sb,gb),b.B(P++,sb,pa)):rb!==oa&&(sb=90===this.fa?
  Math.min(Math.max((pa+gb)/2,this.Rb[Na.layer]),pa):Math.max(Math.min((pa+gb)/2,this.Rb[Na.layer]),pa),b.B(P++,rb,sb),b.B(P++,oa,sb)))}if(null!==d&&U){if(null!==h){if(b.computeSpot(!0)===Yb){var me=b.m(0),Rd=b.m(2);me.N(Rd)||b.aa(1,(me.x+Rd.x)/2,(me.y+Rd.y)/2)}H=b.getLinkPoint(e,h,Yb,!0,!1,g,k);H.F()||H.set(e.W.yl);b.aa(0,H.x,H.y)}null!==k&&(b.computeSpot(!1)===Yb&&(me=b.m(b.sa-1),Rd=b.m(b.sa-3),me.N(Rd)||b.aa(b.sa-2,(me.x+Rd.x)/2,(me.y+Rd.y)/2)),H=b.getLinkPoint(g,k,Yb,!1,!1,e,h),H.F()||H.set(g.W.yl),
  b.aa(b.sa-1,H.x,H.y))}b.dj();c.commit()}}}for(var ne=new J(G),Og=this.network.edges.i;Og.next();){var fd=Og.value.link;null!==fd&&fd.rc&&!ne.contains(fd)&&ne.add(fd)}if(0<ne.count)if(90===this.fa||270===this.fa){for(var ti=0,Ab=new J(os),Qb,gd,qh=ne.i;qh.next();){var Lb=qh.value;if(null!==Lb&&Lb.rc)for(var kb=2;kb<Lb.sa-3;kb++)if(Qb=Lb.m(kb),gd=Lb.m(kb+1),ps(Qb.y,gd.y)&&!ps(Qb.x,gd.x)){var db=new os;db.layer=Math.floor(Qb.y/2);var Re=Lb.m(0),Sd=Lb.m(Lb.sa-1);db.first=Re.x*Re.x+Re.y;db.de=Sd.x*Sd.x+
  Sd.y;db.Qe=Math.min(Qb.x,gd.x);db.ke=Math.max(Qb.x,gd.x);db.index=kb;db.link=Lb;if(kb+2<Lb.sa){var Pg=Lb.m(kb-1),Qg=Lb.m(kb+2),kc=0;Pg.y<Qb.y?kc=Qg.y<Qb.y?3:Qb.x<gd.x?2:1:Pg.y>Qb.y&&(kc=Qg.y>Qb.y?0:gd.x<Qb.x?2:1);db.qi=kc}Ab.add(db)}}if(1<Ab.count){Ab.sort(this.CF);for(var lc=0;lc<Ab.count;){for(var oe=Ab.o[lc].layer,hd=lc+1;hd<Ab.count&&Ab.o[hd].layer===oe;)hd++;if(1<hd-lc)for(var mb=lc;mb<hd;){for(var Uc=Ab.o[mb].ke,Qa=lc+1;Qa<hd&&Ab.o[Qa].Qe<Uc;)Uc=Math.max(Uc,Ab.o[Qa].ke),Qa++;var nb=Qa-mb;if(1<
  nb){Ab.dq(this.Jx,mb,mb+nb);for(var yc=1,Dd=Ab.o[mb].de,kb=mb;kb<Qa;kb++){var Mb=Ab.o[kb];Mb.de!==Dd&&(yc++,Dd=Mb.de)}Ab.dq(this.BF,mb,mb+nb);for(var pe=1,Dd=Ab.o[mb].first,kb=mb;kb<Qa;kb++)Mb=Ab.o[kb],Mb.first!==Dd&&(pe++,Dd=Mb.first);var tf=!0,Se=pe;yc<pe?(tf=!1,Se=yc,Dd=Ab.o[mb].de,Ab.dq(this.Jx,mb,mb+nb)):Dd=Ab.o[mb].first;for(var Mf=0,kb=mb;kb<Qa;kb++){Mb=Ab.o[kb];(tf?Mb.first:Mb.de)!==Dd&&(Mf++,Dd=tf?Mb.first:Mb.de);Lb=Mb.link;Qb=Lb.m(Mb.index);gd=Lb.m(Mb.index+1);var Jb=this.XE*(Mf-(Se-1)/
  2);if(!Lb.kj||qs(Qb.x,Qb.y+Jb,gd.x,gd.y+Jb))ti++,Lb.Ul(),Lb.aa(Mb.index,Qb.x,Qb.y+Jb),Lb.aa(Mb.index+1,gd.x,gd.y+Jb),Lb.dj()}}mb=Qa}lc=hd}}}else{for(var Be=0,Rb=new J(os),Vb,Nb,Jc=ne.i;Jc.next();){var xb=Jc.value;if(null!==xb&&xb.rc)for(var Fb=2;Fb<xb.sa-3;Fb++)if(Vb=xb.m(Fb),Nb=xb.m(Fb+1),ps(Vb.x,Nb.x)&&!ps(Vb.y,Nb.y)){var Ob=new os;Ob.layer=Math.floor(Vb.x/2);var Td=xb.m(0),Rg=xb.m(xb.sa-1);Ob.first=Td.x+Td.y*Td.y;Ob.de=Rg.x+Rg.y*Rg.y;Ob.Qe=Math.min(Vb.y,Nb.y);Ob.ke=Math.max(Vb.y,Nb.y);Ob.index=
  Fb;Ob.link=xb;if(Fb+2<xb.sa){var rh=xb.m(Fb-1),sh=xb.m(Fb+2),Ce=0;rh.x<Vb.x?Ce=sh.x<Vb.x?3:Vb.y<Nb.y?2:1:rh.x>Vb.x&&(Ce=sh.x>Vb.x?0:Nb.y<Vb.y?2:1);Ob.qi=Ce}Rb.add(Ob)}}if(1<Rb.count){Rb.sort(this.CF);for(var Kc=0;Kc<Rb.count;){for(var De=Rb.o[Kc].layer,mc=Kc+1;mc<Rb.count&&Rb.o[mc].layer===De;)mc++;if(1<mc-Kc)for(var Bb=Kc;Bb<mc;){for(var Cb=Rb.o[Bb].ke,Lc=Kc+1;Lc<mc&&Rb.o[Lc].Qe<Cb;)Cb=Math.max(Cb,Rb.o[Lc].ke),Lc++;var Sg=Lc-Bb;if(1<Sg){Rb.dq(this.Jx,Bb,Bb+Sg);for(var Vc=1,Wc=Rb.o[Bb].de,Fb=Bb;Fb<
  Lc;Fb++){var lb=Rb.o[Fb];lb.de!==Wc&&(Vc++,Wc=lb.de)}Rb.dq(this.BF,Bb,Bb+Sg);for(var Mc=1,Wc=Rb.o[Bb].first,Fb=Bb;Fb<Lc;Fb++)lb=Rb.o[Fb],lb.first!==Wc&&(Mc++,Wc=lb.first);var Ud=!0,Vd=Mc;Vc<Mc?(Ud=!1,Vd=Vc,Wc=Rb.o[Bb].de,Rb.dq(this.Jx,Bb,Bb+Sg)):Wc=Rb.o[Bb].first;for(var uf=0,Fb=Bb;Fb<Lc;Fb++){lb=Rb.o[Fb];(Ud?lb.first:lb.de)!==Wc&&(uf++,Wc=Ud?lb.first:lb.de);xb=lb.link;Vb=xb.m(lb.index);Nb=xb.m(lb.index+1);var Tg=this.XE*(uf-(Vd-1)/2);if(!xb.kj||qs(Vb.x+Tg,Vb.y,Nb.x+Tg,Nb.y))Be++,xb.Ul(),xb.aa(lb.index,
  Vb.x+Tg,Vb.y),xb.aa(lb.index+1,Nb.x+Tg,Nb.y),xb.dj()}}Bb=Lc}Kc=mc}}}};on.prototype.CF=function(a,b){return a instanceof os&&b instanceof os&&a!==b?a.layer<b.layer?-1:a.layer>b.layer?1:a.Qe<b.Qe?-1:a.Qe>b.Qe?1:a.ke<b.ke?-1:a.ke>b.ke?1:0:0};on.prototype.BF=function(a,b){return a instanceof os&&b instanceof os&&a!==b?a.first<b.first?-1:a.first>b.first||a.qi<b.qi?1:a.qi>b.qi||a.Qe<b.Qe?-1:a.Qe>b.Qe?1:a.ke<b.ke?-1:a.ke>b.ke?1:0:0};
  on.prototype.Jx=function(a,b){return a instanceof os&&b instanceof os&&a!==b?a.de<b.de?-1:a.de>b.de||a.qi<b.qi?1:a.qi>b.qi||a.Qe<b.Qe?-1:a.Qe>b.Qe?1:a.ke<b.ke?-1:a.ke>b.ke?1:0:0};function ps(a,b){u&&(z.p(a,on,"isApprox:a"),z.p(b,on,"isApprox:b"));var c=a-b;return-1<c&&1>c}function qs(a,b,c,d){u&&(z.p(a,on,"isUnoccupied2:px"),z.p(b,on,"isUnoccupied2:py"),z.p(c,on,"isUnoccupied2:qx"),z.p(d,on,"isUnoccupied2:qy"));return!0}
  function Gr(a,b){var c,d=a.ge[b];if(d>=a.ih.length){c=[];for(var e=0;e<a.ih.length;e++)c[e]=a.ih[e];a.ih=c}void 0===a.ih[d]||null===a.ih[d]?c=[]:(c=a.ih[d],a.ih[d]=null);d=a.Vr[b];for(e=0;e<d.length;e++){var g=d[e];c[g.index]=g}return c}function Hr(a,b,c){a.ih[a.ge[b]]=c}z.defineProperty(on,{layerSpacing:"layerSpacing"},function(){return this.pm},function(a){this.pm!==a&&(z.g(a,"number",on,"layerSpacing"),0<=a&&(this.pm=a,this.I()))});
  z.defineProperty(on,{dK:"columnSpacing"},function(){return this.Td},function(a){this.Td!==a&&(z.g(a,"number",on,"columnSpacing"),0<a&&(this.Td=a,this.I()))});z.defineProperty(on,{direction:"direction"},function(){return this.fa},function(a){this.fa!==a&&(z.g(a,"number",on,"direction"),0===a||90===a||180===a||270===a?(this.fa=a,this.I()):z.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))});
  z.defineProperty(on,{angle:"angle"},function(){return this.direction},function(a){this.direction=a});z.defineProperty(on,{lH:"cycleRemoveOption"},function(){return this.Sn},function(a){this.Sn!==a&&(z.Ba(a,on,on,"cycleRemoveOption"),a===zr||a===tr)&&(this.Sn=a,this.I())});z.defineProperty(on,{pI:"layeringOption"},function(){return this.xo},function(a){this.xo!==a&&(z.Ba(a,on,on,"layeringOption"),a===ur||a===Rr||a===Tr)&&(this.xo=a,this.I())});
  z.defineProperty(on,{aI:"initializeOption"},function(){return this.no},function(a){this.no!==a&&(z.Ba(a,on,on,"initializeOption"),a===vr||a===Zr||a===Xr)&&(this.no=a,this.I())});z.defineProperty(on,{MK:"iterations"},function(){return this.nm},function(a){this.nm!==a&&(z.p(a,yr,"iterations"),0<=a&&(this.nm=a,this.I()))});z.defineProperty(on,{RG:"aggressiveOption"},function(){return this.Fn},function(a){this.Fn!==a&&(z.Ba(a,on,on,"aggressiveOption"),a===cs||a===wr||a===ds)&&(this.Fn=a,this.I())});
  z.defineProperty(on,{hL:"packOption"},function(){return this.Si},function(a){this.Si!==a&&(z.g(a,"number",on,"packOption"),0<=a&&8>a&&(this.Si=a,this.I()))});z.defineProperty(on,{aq:"setsPortSpots"},function(){return this.$h},function(a){this.$h!==a&&(z.g(a,"boolean",on,"setsPortSpots"),this.$h=a,this.I())});z.defineProperty(on,{XE:"linkSpacing"},function(){return this.Br},function(a){this.Br!==a&&(z.g(a,"number",on,"linkSpacing"),0<=a&&(this.Br=a,this.I()))});z.w(on,{yI:"maxLayer"},function(){return this.yb});
  z.w(on,{RK:"maxIndex"},function(){return this.Jv});z.w(on,{QK:"maxColumn"},function(){return this.Kb});z.w(on,{WK:"minIndexLayer"},function(){return this.Lr});z.w(on,{SK:"maxIndexLayer"},function(){return this.Rf});var tr;on.CycleDepthFirst=tr=z.s(on,"CycleDepthFirst",0);var zr;on.CycleGreedy=zr=z.s(on,"CycleGreedy",1);var ur;on.LayerOptimalLinkLength=ur=z.s(on,"LayerOptimalLinkLength",0);var Rr;on.LayerLongestPathSink=Rr=z.s(on,"LayerLongestPathSink",1);var Tr;
  on.LayerLongestPathSource=Tr=z.s(on,"LayerLongestPathSource",2);var vr;on.InitDepthFirstOut=vr=z.s(on,"InitDepthFirstOut",0);var Zr;on.InitDepthFirstIn=Zr=z.s(on,"InitDepthFirstIn",1);var Xr;on.InitNaive=Xr=z.s(on,"InitNaive",2);var cs;on.AggressiveNone=cs=z.s(on,"AggressiveNone",0);var wr;on.AggressiveLess=wr=z.s(on,"AggressiveLess",1);var ds;on.AggressiveMore=ds=z.s(on,"AggressiveMore",2);on.PackNone=0;var es;on.PackExpand=es=1;var fs;on.PackStraighten=fs=2;var hs;on.PackMedian=hs=4;var xr;
  on.PackAll=xr=7;function os(){this.index=this.ke=this.Qe=this.de=this.first=this.layer=0;this.link=null;this.qi=0}z.Yd(os,{layer:!0,first:!0,de:!0,Qe:!0,ke:!0,index:!0,link:!0,qi:!0});function yr(){wa.call(this)}z.Ra(yr,wa);z.ia("LayeredDigraphNetwork",yr);yr.prototype.createVertex=function(){return new rs};yr.prototype.createEdge=function(){return new ss};
  function rs(){xa.call(this);this.index=this.column=this.layer=-1;this.component=NaN;this.near=null;this.valid=!1;this.finish=this.ip=NaN;this.Tm=0;this.xA=this.yA=null}z.Ra(rs,xa);z.ia("LayeredDigraphVertex",rs);function ss(){ya.call(this);this.forest=this.rev=this.valid=!1;this.portToPos=this.portFromPos=NaN;this.portToColOffset=this.portFromColOffset=0}z.Ra(ss,ya);z.ia("LayeredDigraphEdge",ss);
  function Y(){0<arguments.length&&z.pd(Y);yg.call(this);this.Gd=new K(Object);this.ds=ts;this.Of=us;this.Zs=vs;this.Hv=ws;this.rB=null;this.Kh=!0;this.rd=xs;this.mg=(new Ea(10,10)).freeze();this.wa=new ys;this.ya=new ys;this.pz=[]}z.Ra(Y,yg);z.ia("TreeLayout",Y);Y.prototype.cloneProtected=function(a){yg.prototype.cloneProtected.call(this,a);a.ds=this.ds;a.Zs=this.Zs;a.Hv=this.Hv;a.Kh=this.Kh;a.rd=this.rd;a.mg.assign(this.mg);a.wa.copyInheritedPropertiesFrom(this.wa);a.ya.copyInheritedPropertiesFrom(this.ya)};
  Y.prototype.createNetwork=function(){return new zs};Y.prototype.makeNetwork=function(a){function b(a){if(a instanceof E)return!a.Df&&"Comment"!==a.nc;if(a instanceof G){var b=a.Y;if(null===b||b.Df||"Comment"===b.nc)return!1;a=a.da;return null===a||a.Df||"Comment"===a.nc?!1:!0}return!1}var c=this.createNetwork();c.Sb=this;a instanceof B?(c.jk(a.Mg,!0,b),c.jk(a.links,!0,b)):a instanceof F?c.jk(a.Hc,!1,b):c.jk(a.i,!1,b);return c};
  Y.prototype.doLayout=function(a){null===a&&z.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.Yf!==As&&(this.je=this.initialOrigin(this.je));var b=this.h;null===b&&a instanceof B&&(b=a);this.Of=this.path===ts&&null!==b?b.ce?us:Bs:this.path===ts?us:this.path;if(0<this.network.vertexes.count){this.network.Uw();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.Gd.count){a=new K(ys);for(b=this.Gd.i;b.next();){var c=b.value;c instanceof E?(c=this.network.dn(c),null!==c&&a.add(c)):c instanceof ys&&a.add(c)}this.Gd=a}0===this.Gd.count&&this.findRoots();for(a=this.Gd.copy().i;a.next();)b=a.value,b.initialized||(b.initialized=!0,Cs(this,b));for(a=this.Gd.i;a.next();)b=a.value,b instanceof ys&&Ds(this,b);for(a=this.Gd.i;a.next();)b=a.value,b instanceof ys&&Es(this,b);for(a=this.Gd.i;a.next();)b=a.value,b instanceof ys&&
  Fs(this,b);this.Dz();if(this.kA===Gs){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.rB=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.Dt+=c[d.level]-d.width),d.width=c[d.level]):(270===b.angle&&(d.Et+=c[d.level]-d.height),d.height=
  c[d.level])}else if(this.kA===Hs)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 g=c.children[d],e=Math.max(e,b?g.width:g.height);if(0<=e)for(d=0;d<c.children.length;d++)g=c.children[d],b?(180===c.angle&&(g.Dt+=e-g.width),g.width=e):(270===c.angle&&(g.Et+=e-g.height),g.height=e)}for(a=this.Gd.i;a.next();)b=a.value,b instanceof ys&&this.layoutTree(b);this.arrangeTrees();this.updateParts()}this.network=null;this.Gd=new K(Object);
  this.Gf=!0};
  Y.prototype.findRoots=function(){for(var a=this.network.vertexes.i;a.next();){var b=a.value;switch(this.Of){case us:0===b.tc.count&&this.Gd.add(b);break;case Bs:0===b.pc.count&&this.Gd.add(b);break;default:z.k("Unhandled path value "+this.Of.toString())}}if(0===this.Gd.count){for(var a=999999,b=null,c=this.network.vertexes.i;c.next();){var d=c.value;switch(this.Of){case us:d.tc.count<a&&(a=d.tc.count,b=d);break;case Bs:d.pc.count<a&&(a=d.pc.count,b=d);break;default:z.k("Unhandled path value "+this.Of.toString())}}null!==
  b&&this.Gd.add(b)}};
  function Cs(a,b){if(null!==b){u&&z.l(b,ys,Y,"walkTree:v");switch(a.Of){case us:if(0<b.pc.count){for(var c=new J(ys),d=b.qH;d.next();){var e=d.value;Is(a,b,e)&&c.add(e)}0<c.count&&(b.children=c.jc())}break;case Bs:if(0<b.tc.count){c=new J(ys);for(d=b.nJ;d.next();)e=d.value,Is(a,b,e)&&c.add(e);0<c.count&&(b.children=c.jc())}break;default:z.k("Unhandled path value"+a.Of.toString())}c=b.children;d=c.length;for(e=0;e<d;e++){var g=c[e];g.initialized=!0;g.level=b.level+1;g.parent=b;a.Gd.remove(g)}for(e=0;e<
  d;e++)g=c[e],Cs(a,g)}}function Is(a,b,c){u&&z.l(b,ys,Y,"walkOK:v");u&&z.l(c,ys,Y,"walkOK:c");if(c.initialized){var d;if(null===b)d=!1;else{u&&z.l(c,ys,Y,"isAncestor:a");u&&z.l(b,ys,Y,"isAncestor:b");for(d=b.parent;null!==d&&d!==c;)d=d.parent;d=d===c}if(d||c.level>b.level)return!1;a.removeChild(c.parent,c)}return!0}
  Y.prototype.removeChild=function(a,b){if(null!==a&&null!==b){u&&z.l(a,ys,Y,"removeChild:p");u&&z.l(b,ys,Y,"removeChild:c");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),g=0,e=0;e<c.length;e++)c[e]!==b&&(d[g++]=c[e]);a.children=d}}};
  function Ds(a,b){if(null!==b){u&&z.l(b,ys,Y,"initializeTree:v");a.initializeTreeVertexValues(b);b.alignment===Js&&a.sortTreeVertexChildren(b);for(var c=0,d=b.Vm,e=0,g=b.children,h=g.length,k=0;k<h;k++){var l=g[k];Ds(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 Ks(a,b){u&&z.l(b,ys,Y,"mom:v");switch(a.Zs){default:case vs:return null!==b.parent?b.parent:a.wa;case Ls:return null===b.parent?a.wa:null===b.parent.parent?a.ya:b.parent;case Ms:return null!==b.parent?null!==b.parent.parent?b.parent.parent:a.ya:a.wa;case Ns:var c=!0;if(0===b.Vm)c=!1;else for(var d=b.children,e=d.length,g=0;g<e;g++)if(0<d[g].Vm){c=!1;break}return c&&null!==b.parent?a.ya:null!==b.parent?b.parent:a.wa}}
  Y.prototype.initializeTreeVertexValues=function(a){u&&z.l(a,ys,Y,"initializeTreeVertexValues:v");var b=Ks(this,a);a.copyInheritedPropertiesFrom(b);if(null!==a.parent&&a.parent.alignment===Js){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 Es(a,b){if(null!==b){u&&z.l(b,ys,Y,"assignTree:v");a.assignTreeVertexValues(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Es(a,c[e])}}Y.prototype.assignTreeVertexValues=function(){};function Fs(a,b){if(null!==b){u&&z.l(b,ys,Y,"sortTree:v");b.alignment!==Js&&a.sortTreeVertexChildren(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Fs(a,c[e])}}
  Y.prototype.sortTreeVertexChildren=function(a){u&&z.l(a,ys,Y,"sortTreeVertexChildren:v");switch(a.sorting){case Os:break;case Ps:a.children.reverse();break;case Qs:a.children.sort(a.comparer);break;case Rs:a.children.sort(a.comparer);a.children.reverse();break;default:z.k("Unhandled sorting value "+a.sorting.toString())}};Y.prototype.Dz=function(){if(this.comments)for(var a=this.network.vertexes.i;a.next();)this.addComments(a.value)};
  Y.prototype.addComments=function(a){u&&z.l(a,ys,Y,"addComments:v");var b=a.angle,c=a.parent,d=0,e=Ss,e=!1;null!==c&&(d=c.angle,e=c.alignment,e=Ts(e));var b=90===b||270===b,d=90===d||270===d,c=0===a.Vm,g=0,h=0,k=0,l=a.commentSpacing;if(null!==a.Pc)for(var m=a.Pc.qE();m.next();){var n=m.value;"Comment"===n.nc&&n.canLayout()&&(null===a.comments&&(a.comments=[]),a.comments.push(n),n.Bf(),n=n.Ia,b&&!c||!e&&!d&&c||e&&d&&c?(g=Math.max(g,n.width),h+=n.height+Math.abs(k)):(g+=n.width+Math.abs(k),h=Math.max(h,
  n.height)),k=l)}null!==a.comments&&(b&&!c||!e&&!d&&c||e&&d&&c?(g+=Math.abs(a.commentMargin),h=Math.max(0,h-a.height)):(h+=Math.abs(a.commentMargin),g=Math.max(0,g-a.width)),e=z.zk(0,0,a.P.width+g,a.P.height+h),a.vb=e,z.dc(e))};function Ts(a){return a===Us||a===Js||a===Vs||a===Ws}function Xs(a){return a===Us||a===Js}
  function Ys(a){u&&z.l(a,ys,Y,"isLeftSideBus:v");var b=a.parent;if(null!==b){var c=b.alignment;if(Ts(c)){if(Xs(c)){b=b.children;for(c=0;c<b.length&&a!==b[c];)c++;return 0===c%2}if(c===Vs)return!0}}return!1}
  Y.prototype.layoutComments=function(a){u&&z.l(a,ys,Y,"layoutComments:v");if(null!==a.comments){var b=a.Pc.Ia,c=a.parent,d=a.angle,e=0,g=Ss,g=!1;null!==c&&(e=c.angle,g=c.alignment,g=Ts(g));for(var c=90===d||270===d,d=90===e||270===e,h=0===a.Vm,k=Ys(a),l=0,m=a.comments,n=m.length,p=z.O(),q=0;q<n;q++){var r=m[q],s=r.Ia;if(c&&!h||!g&&!d&&h||g&&d&&h){if(135<e&&!g||d&&k)if(0<=a.commentMargin)for(p.n(a.P.x-a.commentMargin-s.width,a.P.y+l),r.move(p),r=r.Ig();r.next();){var t=r.value;t.Db=$c;t.Eb=ad}else for(p.n(a.P.x+
  2*a.S.x-a.commentMargin,a.P.y+l),r.move(p),r=r.Ig();r.next();)t=r.value,t.Db=ad,t.Eb=$c;else if(0<=a.commentMargin)for(p.n(a.P.x+2*a.S.x+a.commentMargin,a.P.y+l),r.move(p),r=r.Ig();r.next();)t=r.value,t.Db=ad,t.Eb=$c;else for(p.n(a.P.x+a.commentMargin-s.width,a.P.y+l),r.move(p),r=r.Ig();r.next();)t=r.value,t.Db=$c,t.Eb=ad;l=0<=a.commentSpacing?l+(s.height+a.commentSpacing):l+(a.commentSpacing-s.height)}else{if(135<e&&!g||!d&&k)if(0<=a.commentMargin)for(p.n(a.P.x+l,a.P.y-a.commentMargin-s.height),
  r.move(p),r=r.Ig();r.next();)t=r.value,t.Db=Zc,t.Eb=bd;else for(p.n(a.P.x+l,a.P.y+2*a.S.y-a.commentMargin),r.move(p),r=r.Ig();r.next();)t=r.value,t.Db=bd,t.Eb=Zc;else if(0<=a.commentMargin)for(p.n(a.P.x+l,a.P.y+2*a.S.y+a.commentMargin),r.move(p),r=r.Ig();r.next();)t=r.value,t.Db=bd,t.Eb=Zc;else for(p.n(a.P.x+l,a.P.y+a.commentMargin-s.height),r.move(p),r=r.Ig();r.next();)t=r.value,t.Db=Zc,t.Eb=bd;l=0<=a.commentSpacing?l+(s.width+a.commentSpacing):l+(a.commentSpacing-s.width)}}z.A(p);b=l-a.commentSpacing-
  (c?b.height:b.width);if(this.Of===us)for(e=a.pc;e.next();)a=e.value.link,null===a||a.kj||(a.Jl=0<b?b:NaN);else for(e=a.tc;e.next();)a=e.value.link,null===a||a.kj||(a.Yl=0<b?b:NaN)}};
  Y.prototype.layoutTree=function(a){if(null!==a){u&&z.l(a,ys,Y,"layoutTree:v");for(var b=a.children,c=b.length,d=0;d<c;d++)this.layoutTree(b[d]);switch(a.compaction){case Zs:$s(this,a);break;case at:if(a.alignment===Js)$s(this,a);else if(u&&z.l(a,ys,Y,"layoutTreeBlock:v"),0===a.Vm){var d=a.parent,b=!1,c=0,e=Ss;null!==d&&(c=d.angle,e=d.alignment,b=Ts(e));d=Ys(a);a.qa.n(0,0);a.ob.n(a.width,a.height);null===a.parent||null===a.comments||(180!==c&&270!==c||b)&&!d?a.Ua.n(0,0):180===c&&!b||(90===c||270===
  c)&&d?a.Ua.n(a.width-2*a.S.x,0):a.Ua.n(0,a.height-2*a.S.y);a.Vt=null;a.mu=null}else{for(var g=bt(a),b=90===g||270===g,h=0,k=a.children,l=k.length,m=0;m<l;m++)var n=k[m],h=Math.max(h,b?n.ob.width:n.ob.height);var p=a.alignment,d=p===ct,q=p===dt,r=Ts(p),s=Math.max(0,a.breadthLimit),c=et(a),t=a.nodeSpacing,v=ft(a),x=a.rowSpacing,y=0;if(d||q||a.Wp||a.Xp&&1===a.maxGenerationCount)y=Math.max(0,a.rowIndent);var d=a.width,e=a.height,A=0,C=0,L=0,H=null,U=null,ea=0,W=0,P=0,ba=0,Oa=0,sa=0,Na=0,ua=0,n=0;r&&!Xs(p)&&
  135<g&&k.reverse();if(Xs(p))if(1<l)for(m=0;m<l;m++)0===m%2&&m!==l-1?ua=Math.max(ua,b?k[m].ob.width:k[m].ob.height):0!==m%2&&(n=Math.max(n,b?k[m].ob.width:k[m].ob.height));else 1===l&&(ua=b?k[0].ob.width:k[0].ob.height);if(r){switch(p){case Us:W=135>g?gt(a,k,ua,A,C):ht(a,k,ua,A,C);ua=W.x;A=W.width;C=W.height;break;case Vs:for(m=0;m<l;m++){var n=k[m],Ha=n.ob,H=0===sa?0:x;b?(n.qa.n(h-Ha.width,ba+H),A=Math.max(A,Ha.width),C=Math.max(C,ba+H+Ha.height),ba+=H+Ha.height):(n.qa.n(P+H,h-Ha.height),A=Math.max(A,
  P+H+Ha.width),C=Math.max(C,Ha.height),P+=H+Ha.width);sa++}break;case Ws:for(m=0;m<l;m++)n=k[m],Ha=n.ob,H=0===sa?0:x,b?(n.qa.n(t/2+a.S.x,ba+H),A=Math.max(A,Ha.width),C=Math.max(C,ba+H+Ha.height),ba+=H+Ha.height):(n.qa.n(P+H,t/2+a.S.y),A=Math.max(A,P+H+Ha.width),C=Math.max(C,Ha.height),P+=H+Ha.width),sa++}H=it(this,2);U=it(this,2);b?(H[0].n(0,0),H[1].n(0,C),U[0].n(A,0)):(H[0].n(0,0),H[1].n(A,0),U[0].n(0,C));U[1].n(A,C)}else for(m=0;m<l;m++){n=k[m];Ha=n.ob;if(b){0<s&&0<sa&&P+t+Ha.width>s&&(P<h&&ot(a,
  p,h-P,0,Na,m-1),Oa++,sa=0,Na=m,L=C,P=0,ba=135<g?-C-x:C+x);pt(this,n,0,ba);var Aa=0;if(0===sa){if(H=n.Vt,U=n.mu,ea=Ha.width,W=Ha.height,null===H||null===U||g!==bt(n))H=it(this,2),U=it(this,2),H[0].n(0,0),H[1].n(0,W),U[0].n(ea,0),U[1].n(ea,W)}else{var jc=z.rb(),W=qt(this,a,n,H,U,ea,W,jc),Aa=W.x,H=jc[0],U=jc[1],ea=W.width,W=W.height;z.xa(jc);P<Ha.width&&0>Aa&&(rt(a,-Aa,0,Na,m-1),st(H,-Aa,0),st(U,-Aa,0),Aa=0)}n.qa.n(Aa,ba);A=Math.max(A,ea);C=Math.max(C,L+(0===Oa?0:x)+Ha.height);P=ea}else{0<s&&0<sa&&ba+
  t+Ha.height>s&&(ba<h&&ot(a,p,0,h-ba,Na,m-1),Oa++,sa=0,Na=m,L=A,ba=0,P=135<g?-A-x:A+x);pt(this,n,P,0);Aa=0;if(0===sa){if(H=n.Vt,U=n.mu,ea=Ha.width,W=Ha.height,null===H||null===U||g!==bt(n))H=it(this,2),U=it(this,2),H[0].n(0,0),H[1].n(ea,0),U[0].n(0,W),U[1].n(ea,W)}else jc=z.rb(),W=qt(this,a,n,H,U,ea,W,jc),Aa=W.x,H=jc[0],U=jc[1],ea=W.width,W=W.height,z.xa(jc),ba<Ha.height&&0>Aa&&(rt(a,0,-Aa,Na,m-1),st(H,0,-Aa),st(U,0,-Aa),Aa=0);n.qa.n(P,Aa);C=Math.max(C,W);A=Math.max(A,L+(0===Oa?0:x)+Ha.width);ba=W}sa++}0<
  Oa&&(b?(C+=Math.max(0,c),P<A&&ot(a,p,A-P,0,Na,l-1),0<y&&(q||rt(a,y,0,0,l-1),A+=y)):(A+=Math.max(0,c),ba<C&&ot(a,p,0,C-ba,Na,l-1),0<y&&(q||rt(a,0,y,0,l-1),C+=y)));q=h=0;switch(p){case tt:b?h+=A/2-a.S.x-v/2:q+=C/2-a.S.y-v/2;break;case Ss:0<Oa?b?h+=A/2-a.S.x-v/2:q+=C/2-a.S.y-v/2:b?(m=k[0].qa.x+k[0].Ua.x,ua=k[l-1].qa.x+k[l-1].Ua.x+2*k[l-1].S.x,h+=m+(ua-m)/2-a.S.x-v/2):(m=k[0].qa.y+k[0].Ua.y,ua=k[l-1].qa.y+k[l-1].Ua.y+2*k[l-1].S.y,q+=m+(ua-m)/2-a.S.y-v/2);break;case ct:b?(h-=v,A+=v):(q-=v,C+=v);break;
  case dt:b?(h+=A-a.width+v,A+=v):(q+=C-a.height+v,C+=v);break;case Us:b?h=1<l?h+(ua+t/2-a.S.x):h+(k[0].S.x-a.S.x+k[0].Ua.x):q=1<l?q+(ua+t/2-a.S.y):q+(k[0].S.y-a.S.y+k[0].Ua.y);break;case Vs:b?h+=A+t/2-a.S.x:q+=C+t/2-a.S.y;break;case Ws:break;default:z.k("Unhandled alignment value "+p.toString())}for(m=0;m<l;m++)n=k[m],b?n.qa.n(n.qa.x+n.Ua.x-h,n.qa.y+(135<g?(r?-C:-n.ob.height)+n.Ua.y-c:e+c+n.Ua.y)):n.qa.n(n.qa.x+(135<g?(r?-A:-n.ob.width)+n.Ua.x-c:d+c+n.Ua.x),n.qa.y+n.Ua.y-q);l=k=0;r?b?(A=ut(a,A,h),
  0>h&&(h=0),135<g&&(q+=C+c),C+=e+c,p===Ws&&(k+=t/2+a.S.x),l+=e+c):(135<g&&(h+=A+c),A+=d+c,C=vt(a,C,q),0>q&&(q=0),p===Ws&&(l+=t/2+a.S.y),k+=d+c):b?(null===a.comments?d>A&&(p=wt(p,d-A,0),k=p.x,l=p.y,A=d,h=0):A=ut(a,A,h),0>h&&(k-=h,h=0),135<g&&(q+=C+c),C=Math.max(Math.max(C,e),C+e+c),l+=e+c):(135<g&&(h+=A+c),A=Math.max(Math.max(A,d),A+d+c),null===a.comments?e>C&&(p=wt(p,0,e-C),k=p.x,l=p.y,C=e,q=0):C=vt(a,C,q),0>q&&(l-=q,q=0),k+=d+c);if(0<Oa)g=it(this,4),p=it(this,4),b?(g[2].n(0,e+c),g[3].n(g[2].x,C),
  p[2].n(A,g[2].y),p[3].n(p[2].x,g[3].y)):(g[2].n(d+c,0),g[3].n(A,g[2].y),p[2].n(g[2].x,C),p[3].n(g[3].x,p[2].y));else{g=it(this,H.length+2);p=it(this,U.length+2);for(m=0;m<H.length;m++)r=H[m],g[m+2].n(r.x+k,r.y+l);for(m=0;m<U.length;m++)r=U[m],p[m+2].n(r.x+k,r.y+l)}b?(g[0].n(h,0),g[1].n(g[0].x,e),g[2].y<g[1].y&&(g[2].x>g[0].x?g[2].assign(g[1]):g[1].assign(g[2])),g[3].y<g[2].y&&(g[3].x>g[0].x?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(h+d,0),p[1].n(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])),g[2].y-=c/2,p[2].y-=c/2):(g[0].n(0,q),g[1].n(d,g[0].y),g[2].x<g[1].x&&(g[2].y>g[0].y?g[2].assign(g[1]):g[1].assign(g[2])),g[3].x<g[2].x&&(g[3].y>g[0].y?g[3].assign(g[2]):g[2].assign(g[3])),p[0].n(0,q+e),p[1].n(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])),g[2].x-=c/2,p[2].x-=c/2);xt(this,H);xt(this,U);a.Vt=g;a.mu=p;
  a.Ua.n(h,q);a.ob.n(A,C)}break;default:z.k("Unhandled compaction value "+a.compaction.toString())}}};
  function $s(a,b){u&&z.l(b,ys,Y,"layoutTreeNone:v");if(0===b.Vm){var c=!1,d=0,e=Ss;null!==b.parent&&(d=b.parent.angle,e=b.parent.alignment,c=Ts(e));e=Ys(b);b.qa.n(0,0);b.ob.n(b.width,b.height);null===b.parent||null===b.comments||(180!==d&&270!==d||c)&&!e?b.Ua.n(0,0):180===d&&!c||(90===d||270===d)&&e?b.Ua.n(b.width-2*b.S.x,0):b.Ua.n(0,b.height-2*b.S.y)}else{for(var c=bt(b),d=90===c||270===c,g=0,e=b.children,h=e.length,k=0;k<h;k++)var l=e[k],g=Math.max(g,d?l.ob.width:l.ob.height);var m=b.alignment,n=
  m===ct,p=m===dt,q=Ts(m),r=Math.max(0,b.breadthLimit),s=et(b),t=b.nodeSpacing,v=ft(b),x=n||p?0:v/2,y=b.rowSpacing,A=0;if(n||p||b.Wp||b.Xp&&1===b.maxGenerationCount)A=Math.max(0,b.rowIndent);var n=b.width,C=b.height,L=0,H=0,U=0,ea=0,W=0,P=0,ba=0,Oa=0,sa=0,Na=0;q&&!Xs(m)&&135<c&&e.reverse();if(Xs(m))if(1<h)for(k=0;k<h;k++){var l=e[k],ua=l.ob;0===k%2&&k!==h-1?sa=Math.max(sa,(d?ua.width:ua.height)+yt(l)-t):0!==k%2&&(Na=Math.max(Na,(d?ua.width:ua.height)+yt(l)-t))}else 1===h&&(sa=d?e[0].ob.width:e[0].ob.height);
  if(q)switch(m){case Us:case Js:H=135>c?gt(b,e,sa,L,H):ht(b,e,sa,L,H);sa=H.x;L=H.width;H=H.height;break;case Vs:for(k=0;k<h;k++)l=e[k],ua=l.ob,r=0===ba?0:y,d?(l.qa.n(g-ua.width,W+r),L=Math.max(L,ua.width),H=Math.max(H,W+r+ua.height),W+=r+ua.height):(l.qa.n(ea+r,g-ua.height),L=Math.max(L,ea+r+ua.width),H=Math.max(H,ua.height),ea+=r+ua.width),ba++;break;case Ws:for(g=0;g<h;g++)l=e[g],ua=l.ob,r=0===ba?0:y,d?(l.qa.n(t/2+b.S.x,W+r),L=Math.max(L,ua.width),H=Math.max(H,W+r+ua.height),W+=r+ua.height):(l.qa.n(ea+
  r,t/2+b.S.y),L=Math.max(L,ea+r+ua.width),H=Math.max(H,ua.height),ea+=r+ua.width),ba++}else for(k=0;k<h;k++)l=e[k],ua=l.ob,d?(0<r&&0<ba&&ea+t+ua.width>r&&(ea<g&&ot(b,m,g-ea,0,Oa,k-1),P++,ba=0,Oa=k,U=H,ea=0,W=135<c?-H-y:H+y),Na=0===ba?x:t,pt(a,l,0,W),l.qa.n(ea+Na,W),L=Math.max(L,ea+Na+ua.width),H=Math.max(H,U+(0===P?0:y)+ua.height),ea+=Na+ua.width):(0<r&&0<ba&&W+t+ua.height>r&&(W<g&&ot(b,m,0,g-W,Oa,k-1),P++,ba=0,Oa=k,U=L,W=0,ea=135<c?-L-y:L+y),Na=0===ba?x:t,pt(a,l,ea,0),l.qa.n(ea,W+Na),H=Math.max(H,
  W+Na+ua.height),L=Math.max(L,U+(0===P?0:y)+ua.width),W+=Na+ua.height),ba++;0<P&&(d?(H+=Math.max(0,s),ea<L&&ot(b,m,L-ea,0,Oa,h-1),0<A&&(p||rt(b,A,0,0,h-1),L+=A)):(L+=Math.max(0,s),W<H&&ot(b,m,0,H-W,Oa,h-1),0<A&&(p||rt(b,0,A,0,h-1),H+=A)));A=p=0;switch(m){case tt:d?p+=L/2-b.S.x-v/2:A+=H/2-b.S.y-v/2;break;case Ss:0<P?d?p+=L/2-b.S.x-v/2:A+=H/2-b.S.y-v/2:d?(m=e[0].qa.x+e[0].Ua.x,t=e[h-1].qa.x+e[h-1].Ua.x+2*e[h-1].S.x,p+=m+(t-m)/2-b.S.x-v/2):(m=e[0].qa.y+e[0].Ua.y,t=e[h-1].qa.y+e[h-1].Ua.y+2*e[h-1].S.y,
  A+=m+(t-m)/2-b.S.y-v/2);break;case ct:d?(p-=v,L+=v):(A-=v,H+=v);break;case dt:d?(p+=L-b.width+v,L+=v):(A+=H-b.height+v,H+=v);break;case Us:case Js:d?p=1<h?p+(sa+t/2-b.S.x):p+(e[0].S.x-b.S.x+e[0].Ua.x):A=1<h?A+(sa+t/2-b.S.y):A+(e[0].S.y-b.S.y+e[0].Ua.y);break;case Vs:d?p+=L+t/2-b.S.x:A+=H+t/2-b.S.y;break;case Ws:break;default:z.k("Unhandled alignment value "+m.toString())}for(k=0;k<h;k++)l=e[k],d?l.qa.n(l.qa.x+l.Ua.x-p,l.qa.y+(135<c?(q?-H:-l.ob.height)+l.Ua.y-s:C+s+l.Ua.y)):l.qa.n(l.qa.x+(135<c?(q?
  -L:-l.ob.width)+l.Ua.x-s:n+s+l.Ua.x),l.qa.y+l.Ua.y-A);d?(L=ut(b,L,p),0>p&&(p=0),135<c&&(A+=H+s),H+=C+s):(135<c&&(p+=L+s),L+=n+s,H=vt(b,H,A),0>A&&(A=0));b.Ua.n(p,A);b.ob.n(L,H)}}
  function gt(a,b,c,d,e){u&&z.l(a,ys,Y,"layoutBusChildrenPosDir:v");var g=b.length;if(0===g)return new w(c,0,d,e);if(1===g){var h=b[0];d=h.ob.width;e=h.ob.height;return new w(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=90===bt(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.ob,t=0===n?0:l;if(m){var v=yt(h)-k;h.qa.n(c-(s.width+v),q+t);d=Math.max(d,s.width+v);e=Math.max(e,q+t+s.height);q+=t+s.height}else v=yt(h)-k,h.qa.n(p+t,c-(s.height+v)),e=Math.max(e,s.height+v),d=Math.max(d,
  p+t+s.width),p+=t+s.width;n++}var n=0,x=p,y=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.ob,t=0===n?0:l,m?(v=yt(h)-k,h.qa.n(p+v,q+t),d=Math.max(d,p+s.width+v),e=Math.max(e,q+t+s.height),q+=t+s.height):(v=yt(h)-k,h.qa.n(p+t,q+v),d=Math.max(d,p+t+s.width),e=Math.max(e,q+s.height+v),p+=t+s.width),n++);1<g&&1===g%2&&(h=b[g-1],s=h.ob,b=zt(h,m?Math.max(Math.abs(y),Math.abs(q)):Math.max(Math.abs(x),Math.abs(p))),m?(h.qa.n(c+k/2-h.S.x-h.Ua.x,e+b),m=c+k/2-h.S.x-h.Ua.x,d=Math.max(d,m+s.width),
  0>m&&(d-=m),e=Math.max(e,Math.max(y,q)+b+s.height),0>h.qa.x&&(c=At(a,h.qa.x,!1,c,k))):(h.qa.n(d+b,c+k/2-h.S.y-h.Ua.y),d=Math.max(d,Math.max(x,p)+b+s.width),m=c+k/2-h.S.y-h.Ua.y,e=Math.max(e,m+s.height),0>m&&(e-=m),0>h.qa.y&&(c=At(a,h.qa.y,!0,c,k))));return new w(c,0,d,e)}
  function ht(a,b,c,d,e){u&&z.l(a,ys,Y,"layoutBusChildrenNegDir:v");var g=b.length;if(0===g)return new w(c,0,d,e);if(1===g){var h=b[0];d=h.ob.width;e=h.ob.height;return new w(c,0,d,e)}for(var k=a.nodeSpacing,l=a.rowSpacing,m=270===bt(a),n=0,p=0,q=0,r=0;r<g;r++)if(!(0!==r%2||1<g&&r===g-1)){var h=b[r],s=h.ob,t=0===n?0:l;if(m){var v=yt(h)-k,q=q-(t+s.height);h.qa.n(c-(s.width+v),q);d=Math.max(d,s.width+v);e=Math.max(e,Math.abs(q))}else v=yt(h)-k,p-=t+s.width,h.qa.n(p,c-(s.height+v)),e=Math.max(e,s.height+
  v),d=Math.max(d,Math.abs(p));n++}var n=0,x=p,y=q;m?(p=c+k,q=0):(p=0,q=c+k);for(r=0;r<g;r++)0!==r%2&&(h=b[r],s=h.ob,t=0===n?0:l,m?(v=yt(h)-k,q-=t+s.height,h.qa.n(p+v,q),d=Math.max(d,p+s.width+v),e=Math.max(e,Math.abs(q))):(v=yt(h)-k,p-=t+s.width,h.qa.n(p,q+v),e=Math.max(e,q+s.height+v),d=Math.max(d,Math.abs(p))),n++);1<g&&1===g%2&&(h=b[g-1],s=h.ob,l=zt(h,m?Math.max(Math.abs(y),Math.abs(q)):Math.max(Math.abs(x),Math.abs(p))),m?(h.qa.n(c+k/2-h.S.x-h.Ua.x,-e-s.height-l),p=c+k/2-h.S.x-h.Ua.x,d=Math.max(d,
  p+s.width),0>p&&(d-=p),e=Math.max(e,Math.abs(Math.min(y,q))+l+s.height),0>h.qa.x&&(c=At(a,h.qa.x,!1,c,k))):(h.qa.n(-d-s.width-l,c+k/2-h.S.y-h.Ua.y),d=Math.max(d,Math.abs(Math.min(x,p))+l+s.width),p=c+k/2-h.S.y-h.Ua.y,e=Math.max(e,p+s.height),0>p&&(e-=p),0>h.qa.y&&(c=At(a,h.qa.y,!0,c,k))));for(r=0;r<g;r++)h=b[r],m?h.qa.n(h.qa.x,h.qa.y+e):h.qa.n(h.qa.x+d,h.qa.y);return new w(c,0,d,e)}function yt(a){u&&z.l(a,ys,Y,"fixRelativePostions:child");return null===a.parent?0:a.parent.nodeSpacing}
  function zt(a){u&&z.l(a,ys,Y,"fixRelativePostions:lastchild");return null===a.parent?0:a.parent.rowSpacing}function At(a,b,c,d,e){u&&z.l(a,ys,Y,"fixRelativePostions:v");a=a.children;for(var g=a.length,h=0;h<g;h++)c?a[h].qa.n(a[h].qa.x,a[h].qa.y-b):a[h].qa.n(a[h].qa.x-b,a[h].qa.y);b=a[g-1];return Math.max(d,c?b.Ua.y+b.S.y-e/2:b.Ua.x+b.S.x-e/2)}
  function ut(a,b,c){u&&z.l(a,ys,Y,"calculateSubwidth:v");switch(a.alignment){case Ss:case tt:var d=b;c+a.width>d&&(d=c+a.width);0>c&&(d-=c);return d;case ct:return a.width>b?a.width:b;case dt:return 2*a.S.x>b?a.width:b+a.width-2*a.S.x;case Us:case Js:return d=Math.min(0,c),c=Math.max(b,c+a.width),Math.max(a.width,c-d);case Vs:return a.width-a.S.x+a.nodeSpacing/2+b;case Ws:return Math.max(a.width,a.S.x+a.nodeSpacing/2+b);default:return b}}
  function vt(a,b,c){u&&z.l(a,ys,Y,"calculateSubheight:v");switch(a.alignment){case Ss:case tt:var d=b;c+a.height>d&&(d=c+a.height);0>c&&(d-=c);return d;case ct:return a.height>b?a.height:b;case dt:return 2*a.S.y>b?a.height:b+a.height-2*a.S.y;case Us:case Js:return d=Math.min(0,c),c=Math.max(b,c+a.height),Math.max(a.height,c-d);case Vs:return a.height-a.S.y+a.nodeSpacing/2+b;case Ws:return Math.max(a.height,a.S.y+a.nodeSpacing/2+b);default:return b}}
  function wt(a,b,c){u&&z.l(a,Ba,Y,"alignOffset:align");switch(a){case tt:b/=2;c/=2;break;case Ss:b/=2;c/=2;break;case ct:c=b=0;break;case dt:break;default:z.k("Unhandled alignment value "+a.toString())}return new N(b,c)}function ot(a,b,c,d,e,g){u&&z.l(a,ys,Y,"shiftRelPosAlign:v");u&&z.l(b,Ba,Y,"shiftRelPosAlign:align");b=wt(b,c,d);rt(a,b.x,b.y,e,g)}function rt(a,b,c,d,e){u&&z.l(a,ys,Y,"shiftRelPos:v");if(0!==b||0!==c)for(a=a.children;d<=e;d++){var g=a[d].qa;g.x+=b;g.y+=c}}
  function pt(a,b,c,d){u&&(z.l(b,ys,Y,"recordMidPoints:v"),z.g(c,"number",Y,"recordMidPoints:x"),z.g(d,"number",Y,"recordMidPoints:y"));var e=b.parent;switch(a.Of){case us:for(a=b.tc;a.next();)b=a.value,b.fromVertex===e&&b.ls.n(c,d);break;case Bs:for(a=b.pc;a.next();)b=a.value,b.toVertex===e&&b.ls.n(c,d);break;default:z.k("Unhandled path value "+a.Of.toString())}}function st(a,b,c){for(var d=0;d<a.length;d++){var e=a[d];e.x+=b;e.y+=c}}
  function qt(a,b,c,d,e,g,h,k){u&&z.l(b,ys,Y,"mergeFringes:parent");u&&z.l(c,ys,Y,"mergeFringes:child");var l=bt(b),m=90===l||270===l,n=b.nodeSpacing;b=d;var p=e;d=g;e=h;var q=c.Vt,r=c.mu;h=c.ob;var s=m?Math.max(e,h.height):Math.max(d,h.width);if(null===q||l!==bt(c))q=it(a,2),r=it(a,2),m?(q[0].n(0,0),q[1].n(0,h.height),r[0].n(h.width,0),r[1].n(r[0].x,q[1].y)):(q[0].n(0,0),q[1].n(h.width,0),r[0].n(0,h.height),r[1].n(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 t=q[m];g=t.x;var v=t.y;g+=c;var x=e;l+1<p.length&&(x=p[l+1]);var y=t,t=y.x,y=y.y;m+1<q.length&&(y=q[m+1],t=y.x,y=y.y,t+=c);var A=d;e.y===v?A=g-e.x:e.y>v&&e.y<y?A=g+(e.y-v)/(y-v)*(t-g)-e.x:v>e.y&&v<x.y&&(A=g-(e.x+(v-e.y)/(x.y-e.y)*(x.x-e.x)));A<d&&(d=A);x.y<=e.y?l++:y<=v?m++:(x.y<=y&&l++,y<=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=it(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].y<b[0].y;)v=l[g++],n[d++].n(v.x+
  m,v.y);for(;e<b.length;)v=b[e++],n[d++].n(v.x,v.y);for(e=b[b.length-1].y;g<l.length&&l[g].y<=e;)g++;for(;g<l.length&&l[g].y>e;)v=l[g++],n[d++].n(v.x+m,v.y);l=it(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);xt(a,n);d=l}g=r;v=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=it(a,p.length+g.length);for(m=x=l=0;l<p.length&&p[l].y<g[0].y;)e=p[l++],n[m++].n(e.x,e.y);for(;x<g.length;)e=g[x++],n[m++].n(e.x+v,e.y);for(g=g[g.length-1].y;l<p.length&&p[l].y<=g;)l++;for(;l<p.length&&p[l].y>g;)e=p[l++],
  n[m++].n(e.x,e.y);e=it(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);xt(a,n)}g=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],t=q[m],g=t.x,v=t.y,v+=c,x=e,l+1<p.length&&(x=p[l+1]),y=t,t=y.x,y=y.y,m+1<q.length&&(y=q[m+1],t=y.x,y=y.y,y+=c),A=d,e.x===g?A=v-e.y:e.x>g&&e.x<t?A=v+(e.x-g)/(t-g)*(y-v)-e.y:g>e.x&&g<x.x&&(A=v-(e.y+(g-e.x)/(x.x-e.x)*(x.y-e.y))),A<d&&(d=A),x.x<=e.x?l++:t<=g?m++:(x.x<=t&&l++,t<=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=it(a,b.length+l.length);for(d=g=e=0;g<l.length&&l[g].x<b[0].x;)v=l[g++],n[d++].n(v.x,v.y+m);for(;e<b.length;)v=b[e++],n[d++].n(v.x,v.y);for(e=b[b.length-1].x;g<l.length&&l[g].x<=e;)g++;for(;g<l.length&&l[g].x>e;)v=l[g++],n[d++].n(v.x,v.y+m);l=it(a,d);for(e=0;e<d;e++)l[e].assign(n[e]);xt(a,n);d=l}g=r;v=c;if(null===p||2>p.length||null===g||2>g.length)e=null;else{n=it(a,p.length+g.length);for(m=x=l=0;l<p.length&&p[l].x<g[0].x;)e=p[l++],
  n[m++].n(e.x,e.y);for(;x<g.length;)e=g[x++],n[m++].n(e.x,e.y+v);for(g=g[g.length-1].x;l<p.length&&p[l].x<=g;)l++;for(;l<p.length&&p[l].x>g;)e=p[l++],n[m++].n(e.x,e.y);e=it(a,m);for(l=0;l<m;l++)e[l].assign(n[l]);xt(a,n)}g=s;h=Math.max(0,c)+h.height}xt(a,b);xt(a,q);xt(a,p);xt(a,r);k[0]=d;k[1]=e;return new w(c,0,g,h)}function it(a,b){var c=a.pz[b];if(void 0!==c&&(c=c.pop(),void 0!==c))return c;for(var c=[],d=0;d<b;d++)c[d]=new N;return c}
  function xt(a,b){var c=b.length,d=a.pz[c];void 0===d&&(d=[],a.pz[c]=d);d.push(b)}
  Y.prototype.arrangeTrees=function(){if(this.rd===As)for(var a=this.Gd.i;a.next();){var b=a.value;if(b instanceof ys){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);Bt(this,b,c,d)}}}else{c=[];for(a=this.Gd.i;a.next();)b=a.value,b instanceof ys&&c.push(b);switch(this.sorting){case Os:break;case Ps:c.reverse();break;case Qs:c.sort(this.comparer);break;case Rs:c.sort(this.comparer);c.reverse();break;default:z.k("Unhandled sorting value "+this.sorting.toString())}b=
  this.je;a=b.x;b=b.y;for(d=0;d<c.length;d++){var e=c[d];Bt(this,e,a+e.Ua.x,b+e.Ua.y);switch(this.rd){case xs:b+=e.ob.height+this.mg.height;break;case Ct:a+=e.ob.width+this.mg.width;break;default:z.k("Unhandled arrangement value "+this.rd.toString())}}}};function Bt(a,b,c,d){if(null!==b){u&&z.l(b,ys,Y,"assignAbsolutePositions:v");b.x=c;b.y=d;b=b.children;for(var e=b.length,g=0;g<e;g++){var h=b[g];Bt(a,h,c+h.qa.x,d+h.qa.y)}}}
  Y.prototype.commitLayout=function(){this.QA();this.commitNodes();this.Hz();this.Rt&&this.commitLinks()};Y.prototype.commitNodes=function(){for(var a=this.network.vertexes.i;a.next();)a.value.commit();for(a.reset();a.next();)this.layoutComments(a.value)};
  Y.prototype.Hz=function(){if(this.kA===Gs){for(var a=this.rB,b=[],c=null,d=this.network.vertexes.i;d.next();){var e=d.value;null===c?c=e.vb.copy():c.ri(e.vb);var g=b[e.level],g=void 0===g?et(e):Math.max(g,et(e));b[e.level]=g}for(d=0;d<b.length;d++)void 0===b[d]&&(b[d]=0);90===this.angle||270===this.angle?(c.bg(this.nodeSpacing/2,this.layerSpacing),e=new N(-this.nodeSpacing/2,-this.layerSpacing/2)):(c.bg(this.layerSpacing,this.nodeSpacing/2),e=new N(-this.layerSpacing/2,-this.nodeSpacing/2));var g=
  [],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,g.push(new w(0,h,c,k))):90===this.angle?(g.push(new w(0,h,c,k)),h+=k):180===this.angle?(h-=k,g.push(new w(h,0,k,c))):(g.push(new w(h,0,k,c)),h+=k)}this.commitLayers(g,e)}};Y.prototype.commitLayers=function(){};Y.prototype.commitLinks=function(){for(var a=this.network.edges.i;a.next();)a.value.commit()};
  Y.prototype.QA=function(){for(var a=this.Gd.i;a.next();){var b=a.value;b instanceof ys&&Dt(this,b)}};function Dt(a,b){if(null!==b){u&&z.l(b,ys,Y,"setPortSpotsTree:v");a.setPortSpots(b);for(var c=b.children,d=c.length,e=0;e<d;e++)Dt(a,c[e])}}
  Y.prototype.setPortSpots=function(a){u&&z.l(a,ys,Y,"setPortSpots:v");var b=a.alignment;if(Ts(b)){u&&z.l(a,ys,Y,"setPortSpotsBus:v");u&&z.l(b,Ba,Y,"setPortSpots:align");var c=this.Of===us,d=bt(a),e;switch(d){case 0:e=ad;break;case 90:e=bd;break;case 180:e=$c;break;default:e=Zc}var g=a.children,h=g.length;switch(b){case Us:case Js:for(b=0;b<h;b++){var k=g[b],k=(c?k.tc:k.pc).first();if(null!==k&&(k=k.link,null!==k)){var l=90===d||270===d?$c:Zc;if(1===h||b===h-1&&1===h%2)switch(d){case 0:l=$c;break;case 90:l=
  Zc;break;case 180:l=ad;break;default:l=bd}else 0===b%2&&(l=90===d||270===d?ad:bd);c?(a.setsPortSpot&&(k.Db=e),a.setsChildPortSpot&&(k.Eb=l)):(a.setsPortSpot&&(k.Db=l),a.setsChildPortSpot&&(k.Eb=e))}}break;case Vs:l=90===d||270===d?ad:bd;for(d=c?a.pc:a.tc;d.next();)k=d.value.link,null!==k&&(c?(a.setsPortSpot&&(k.Db=e),a.setsChildPortSpot&&(k.Eb=l)):(a.setsPortSpot&&(k.Db=l),a.setsChildPortSpot&&(k.Eb=e)));break;case Ws:for(l=90===d||270===d?$c:Zc,d=c?a.pc:a.tc;d.next();)k=d.value.link,null!==k&&(c?
  (a.setsPortSpot&&(k.Db=e),a.setsChildPortSpot&&(k.Eb=l)):(a.setsPortSpot&&(k.Db=l),a.setsChildPortSpot&&(k.Eb=e)))}}else if(c=bt(a),this.Of===us)for(e=a.pc;e.next();){if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.bd())switch(c){case 0:d.Db=ad;break;case 90:d.Db=bd;break;case 180:d.Db=$c;break;default:d.Db=Zc}else d.Db=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.bd())switch(c){case 0:d.Eb=$c;break;case 90:d.Eb=Zc;break;case 180:d.Eb=ad;break;default:d.Eb=bd}else d.Eb=a.childPortSpot}}else for(e=
  a.tc;e.next();)if(d=e.value.link,null!==d){if(a.setsPortSpot)if(a.portSpot.bd())switch(c){case 0:d.Eb=ad;break;case 90:d.Eb=bd;break;case 180:d.Eb=$c;break;default:d.Eb=Zc}else d.Eb=a.portSpot;if(a.setsChildPortSpot)if(a.childPortSpot.bd())switch(c){case 0:d.Db=$c;break;case 90:d.Db=Zc;break;case 180:d.Db=ad;break;default:d.Db=bd}else d.Db=a.childPortSpot}};function bt(a){a=a.angle;return 45>=a?0:135>=a?90:225>=a?180:315>=a?270:0}
  function et(a){u&&z.l(a,ys,Y,"computeLayerSpacing:v");var b=bt(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 ft(a){u&&z.l(a,ys,Y,"computeNodeIndent:v");var b=bt(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)}
  z.defineProperty(Y,{rL:"roots"},function(){return this.Gd},function(a){this.Gd!==a&&(z.l(a,K,Y,"roots"),this.Gd=a,this.I())});z.defineProperty(Y,{path:"path"},function(){return this.ds},function(a){this.ds!==a&&(z.Ba(a,Y,Y,"path"),this.ds=a,this.I())});z.defineProperty(Y,{yJ:"treeStyle"},function(){return this.Zs},function(a){this.rd!==a&&(z.Ba(a,Y,Y,"treeStyle"),a===vs||a===Ms||a===Ns||a===Ls)&&(this.Zs=a,this.I())});
  z.defineProperty(Y,{kA:"layerStyle"},function(){return this.Hv},function(a){this.rd!==a&&(z.Ba(a,Y,Y,"layerStyle"),a===ws||a===Hs||a===Gs)&&(this.Hv=a,this.I())});z.defineProperty(Y,{comments:"comments"},function(){return this.Kh},function(a){this.Kh!==a&&(z.g(a,"boolean",Y,"comments"),this.Kh=a,this.I())});z.defineProperty(Y,{Yf:"arrangement"},function(){return this.rd},function(a){this.rd!==a&&(z.Ba(a,Y,Y,"arrangement"),a===xs||a===Ct||a===As)&&(this.rd=a,this.I())});
  z.defineProperty(Y,{KD:"arrangementSpacing"},function(){return this.mg},function(a){z.l(a,Ea,Y,"arrangementSpacing");this.mg.N(a)||(this.mg.assign(a),this.I())});z.defineProperty(Y,{qL:"rootDefaults"},function(){return this.wa},function(a){this.wa!==a&&(z.l(a,ys,Y,"rootDefaults"),this.wa=a,this.I())});z.defineProperty(Y,{PJ:"alternateDefaults"},function(){return this.ya},function(a){this.ya!==a&&(z.l(a,ys,Y,"alternateDefaults"),this.ya=a,this.I())});
  z.defineProperty(Y,{sorting:"sorting"},function(){return this.wa.sorting},function(a){this.wa.sorting!==a&&(z.Ba(a,Y,Y,"sorting"),a===Os||a===Ps||a===Qs||Rs)&&(this.wa.sorting=a,this.I())});z.defineProperty(Y,{comparer:"comparer"},function(){return this.wa.comparer},function(a){this.wa.comparer!==a&&(z.g(a,"function",Y,"comparer"),this.wa.comparer=a,this.I())});
  z.defineProperty(Y,{angle:"angle"},function(){return this.wa.angle},function(a){this.wa.angle!==a&&(z.g(a,"number",Y,"angle"),0===a||90===a||180===a||270===a?(this.wa.angle=a,this.I()):z.k("TreeLayout.angle must be 0, 90, 180, or 270"))});z.defineProperty(Y,{alignment:"alignment"},function(){return this.wa.alignment},function(a){this.wa.alignment!==a&&(z.Ba(a,Y,Y,"alignment"),this.wa.alignment=a,this.I())});
  z.defineProperty(Y,{nodeIndent:"nodeIndent"},function(){return this.wa.nodeIndent},function(a){this.wa.nodeIndent!==a&&(z.g(a,"number",Y,"nodeIndent"),0<=a&&(this.wa.nodeIndent=a,this.I()))});z.defineProperty(Y,{nodeIndentPastParent:"nodeIndentPastParent"},function(){return this.wa.nodeIndentPastParent},function(a){this.wa.nodeIndentPastParent!==a&&(z.g(a,"number",Y,"nodeIndentPastParent"),0<=a&&1>=a&&(this.wa.nodeIndentPastParent=a,this.I()))});
  z.defineProperty(Y,{nodeSpacing:"nodeSpacing"},function(){return this.wa.nodeSpacing},function(a){this.wa.nodeSpacing!==a&&(z.g(a,"number",Y,"nodeSpacing"),this.wa.nodeSpacing=a,this.I())});z.defineProperty(Y,{layerSpacing:"layerSpacing"},function(){return this.wa.layerSpacing},function(a){this.wa.layerSpacing!==a&&(z.g(a,"number",Y,"layerSpacing"),this.wa.layerSpacing=a,this.I())});
  z.defineProperty(Y,{layerSpacingParentOverlap:"layerSpacingParentOverlap"},function(){return this.wa.layerSpacingParentOverlap},function(a){this.wa.layerSpacingParentOverlap!==a&&(z.g(a,"number",Y,"layerSpacingParentOverlap"),0<=a&&1>=a&&(this.wa.layerSpacingParentOverlap=a,this.I()))});z.defineProperty(Y,{compaction:"compaction"},function(){return this.wa.compaction},function(a){this.wa.compaction!==a&&(z.Ba(a,Y,Y,"compaction"),a===Zs||a===at)&&(this.wa.compaction=a,this.I())});
  z.defineProperty(Y,{breadthLimit:"breadthLimit"},function(){return this.wa.breadthLimit},function(a){this.wa.breadthLimit!==a&&(z.g(a,"number",Y,"breadthLimit"),0<=a&&(this.wa.breadthLimit=a,this.I()))});z.defineProperty(Y,{rowSpacing:"rowSpacing"},function(){return this.wa.rowSpacing},function(a){this.wa.rowSpacing!==a&&(z.g(a,"number",Y,"rowSpacing"),this.wa.rowSpacing=a,this.I())});
  z.defineProperty(Y,{rowIndent:"rowIndent"},function(){return this.wa.rowIndent},function(a){this.wa.rowIndent!==a&&(z.g(a,"number",Y,"rowIndent"),0<=a&&(this.wa.rowIndent=a,this.I()))});z.defineProperty(Y,{commentSpacing:"commentSpacing"},function(){return this.wa.commentSpacing},function(a){this.wa.commentSpacing!==a&&(z.g(a,"number",Y,"commentSpacing"),this.wa.commentSpacing=a,this.I())});
  z.defineProperty(Y,{commentMargin:"commentMargin"},function(){return this.wa.commentMargin},function(a){this.wa.commentMargin!==a&&(z.g(a,"number",Y,"commentMargin"),this.wa.commentMargin=a,this.I())});z.defineProperty(Y,{setsPortSpot:"setsPortSpot"},function(){return this.wa.setsPortSpot},function(a){this.wa.setsPortSpot!==a&&(z.g(a,"boolean",Y,"setsPortSpot"),this.wa.setsPortSpot=a,this.I())});
  z.defineProperty(Y,{portSpot:"portSpot"},function(){return this.wa.portSpot},function(a){z.l(a,Q,Y,"portSpot");this.wa.portSpot.N(a)||(this.wa.portSpot=a,this.I())});z.defineProperty(Y,{setsChildPortSpot:"setsChildPortSpot"},function(){return this.wa.setsChildPortSpot},function(a){this.wa.setsChildPortSpot!==a&&(z.g(a,"boolean",Y,"setsChildPortSpot"),this.wa.setsChildPortSpot=a,this.I())});
  z.defineProperty(Y,{childPortSpot:"childPortSpot"},function(){return this.wa.childPortSpot},function(a){z.l(a,Q,Y,"childPortSpot");this.wa.childPortSpot.N(a)||(this.wa.childPortSpot=a,this.I())});z.defineProperty(Y,{$J:"alternateSorting"},function(){return this.ya.sorting},function(a){this.ya.sorting!==a&&(z.Ba(a,Y,Y,"alternateSorting"),a===Os||a===Ps||a===Qs||Rs)&&(this.ya.sorting=a,this.I())});
  z.defineProperty(Y,{OJ:"alternateComparer"},function(){return this.ya.comparer},function(a){this.ya.comparer!==a&&(z.g(a,"function",Y,"alternateComparer"),this.ya.comparer=a,this.I())});z.defineProperty(Y,{IJ:"alternateAngle"},function(){return this.ya.angle},function(a){this.ya.angle!==a&&(z.g(a,"number",Y,"alternateAngle"),0===a||90===a||180===a||270===a)&&(this.ya.angle=a,this.I())});
  z.defineProperty(Y,{HJ:"alternateAlignment"},function(){return this.ya.alignment},function(a){this.ya.alignment!==a&&(z.Ba(a,Y,Y,"alternateAlignment"),this.ya.alignment=a,this.I())});z.defineProperty(Y,{SJ:"alternateNodeIndent"},function(){return this.ya.nodeIndent},function(a){this.ya.nodeIndent!==a&&(z.g(a,"number",Y,"alternateNodeIndent"),0<=a&&(this.ya.nodeIndent=a,this.I()))});
  z.defineProperty(Y,{TJ:"alternateNodeIndentPastParent"},function(){return this.ya.nodeIndentPastParent},function(a){this.ya.nodeIndentPastParent!==a&&(z.g(a,"number",Y,"alternateNodeIndentPastParent"),0<=a&&1>=a&&(this.ya.nodeIndentPastParent=a,this.I()))});z.defineProperty(Y,{UJ:"alternateNodeSpacing"},function(){return this.ya.nodeSpacing},function(a){this.ya.nodeSpacing!==a&&(z.g(a,"number",Y,"alternateNodeSpacing"),this.ya.nodeSpacing=a,this.I())});
  z.defineProperty(Y,{QJ:"alternateLayerSpacing"},function(){return this.ya.layerSpacing},function(a){this.ya.layerSpacing!==a&&(z.g(a,"number",Y,"alternateLayerSpacing"),this.ya.layerSpacing=a,this.I())});z.defineProperty(Y,{RJ:"alternateLayerSpacingParentOverlap"},function(){return this.ya.layerSpacingParentOverlap},function(a){this.ya.layerSpacingParentOverlap!==a&&(z.g(a,"number",Y,"alternateLayerSpacingParentOverlap"),0<=a&&1>=a&&(this.ya.layerSpacingParentOverlap=a,this.I()))});
  z.defineProperty(Y,{NJ:"alternateCompaction"},function(){return this.ya.compaction},function(a){this.ya.compaction!==a&&(z.Ba(a,Y,Y,"alternateCompaction"),a===Zs||a===at)&&(this.ya.compaction=a,this.I())});z.defineProperty(Y,{JJ:"alternateBreadthLimit"},function(){return this.ya.breadthLimit},function(a){this.ya.breadthLimit!==a&&(z.g(a,"number",Y,"alternateBreadthLimit"),0<=a&&(this.ya.breadthLimit=a,this.I()))});
  z.defineProperty(Y,{XJ:"alternateRowSpacing"},function(){return this.ya.rowSpacing},function(a){this.ya.rowSpacing!==a&&(z.g(a,"number",Y,"alternateRowSpacing"),this.ya.rowSpacing=a,this.I())});z.defineProperty(Y,{WJ:"alternateRowIndent"},function(){return this.ya.rowIndent},function(a){this.ya.rowIndent!==a&&(z.g(a,"number",Y,"alternateRowIndent"),0<=a&&(this.ya.rowIndent=a,this.I()))});
  z.defineProperty(Y,{MJ:"alternateCommentSpacing"},function(){return this.ya.commentSpacing},function(a){this.ya.commentSpacing!==a&&(z.g(a,"number",Y,"alternateCommentSpacing"),this.ya.commentSpacing=a,this.I())});z.defineProperty(Y,{LJ:"alternateCommentMargin"},function(){return this.ya.commentMargin},function(a){this.ya.commentMargin!==a&&(z.g(a,"number",Y,"alternateCommentMargin"),this.ya.commentMargin=a,this.I())});
  z.defineProperty(Y,{ZJ:"alternateSetsPortSpot"},function(){return this.ya.setsPortSpot},function(a){this.ya.setsPortSpot!==a&&(z.g(a,"boolean",Y,"alternateSetsPortSpot"),this.ya.setsPortSpot=a,this.I())});z.defineProperty(Y,{VJ:"alternatePortSpot"},function(){return this.ya.portSpot},function(a){z.l(a,Q,Y,"alternatePortSpot");this.ya.portSpot.N(a)||(this.ya.portSpot=a,this.I())});
  z.defineProperty(Y,{YJ:"alternateSetsChildPortSpot"},function(){return this.ya.setsChildPortSpot},function(a){this.ya.setsChildPortSpot!==a&&(z.g(a,"boolean",Y,"alternateSetsChildPortSpot"),this.ya.setsChildPortSpot=a,this.I())});z.defineProperty(Y,{KJ:"alternateChildPortSpot"},function(){return this.ya.childPortSpot},function(a){z.l(a,Q,Y,"alternateChildPortSpot");this.ya.childPortSpot.N(a)||(this.ya.childPortSpot=a,this.I())});var ts;Y.PathDefault=ts=z.s(Y,"PathDefault",-1);var us;
  Y.PathDestination=us=z.s(Y,"PathDestination",0);var Bs;Y.PathSource=Bs=z.s(Y,"PathSource",1);var Os;Y.SortingForwards=Os=z.s(Y,"SortingForwards",10);var Ps;Y.SortingReverse=Ps=z.s(Y,"SortingReverse",11);var Qs;Y.SortingAscending=Qs=z.s(Y,"SortingAscending",12);var Rs;Y.SortingDescending=Rs=z.s(Y,"SortingDescending",13);var tt;Y.AlignmentCenterSubtrees=tt=z.s(Y,"AlignmentCenterSubtrees",20);var Ss;Y.AlignmentCenterChildren=Ss=z.s(Y,"AlignmentCenterChildren",21);var ct;
  Y.AlignmentStart=ct=z.s(Y,"AlignmentStart",22);var dt;Y.AlignmentEnd=dt=z.s(Y,"AlignmentEnd",23);var Us;Y.AlignmentBus=Us=z.s(Y,"AlignmentBus",24);var Js;Y.AlignmentBusBranching=Js=z.s(Y,"AlignmentBusBranching",25);var Vs;Y.AlignmentTopLeftBus=Vs=z.s(Y,"AlignmentTopLeftBus",26);var Ws;Y.AlignmentBottomRightBus=Ws=z.s(Y,"AlignmentBottomRightBus",27);var Zs;Y.CompactionNone=Zs=z.s(Y,"CompactionNone",30);var at;Y.CompactionBlock=at=z.s(Y,"CompactionBlock",31);var vs;
  Y.StyleLayered=vs=z.s(Y,"StyleLayered",40);var Ns;Y.StyleLastParents=Ns=z.s(Y,"StyleLastParents",41);var Ms;Y.StyleAlternating=Ms=z.s(Y,"StyleAlternating",42);var Ls;Y.StyleRootOnly=Ls=z.s(Y,"StyleRootOnly",43);var xs;Y.ArrangementVertical=xs=z.s(Y,"ArrangementVertical",50);var Ct;Y.ArrangementHorizontal=Ct=z.s(Y,"ArrangementHorizontal",51);var As;Y.ArrangementFixedRoots=As=z.s(Y,"ArrangementFixedRoots",52);var ws;Y.LayerIndividual=ws=z.s(Y,"LayerIndividual",60);var Hs;
  Y.LayerSiblings=Hs=z.s(Y,"LayerSiblings",61);var Gs;Y.LayerUniform=Gs=z.s(Y,"LayerUniform",62);function zs(){wa.call(this)}z.Ra(zs,wa);z.ia("TreeNetwork",zs);zs.prototype.createVertex=function(){return new ys};zs.prototype.createEdge=function(){return new Et};
  function ys(){xa.call(this);this.initialized=!1;this.parent=null;this.children=[];this.maxGenerationCount=this.maxChildrenCount=this.descendantCount=this.level=0;this.comments=null;this.qa=new N(0,0);this.ob=new Ea(0,0);this.Ua=new N(0,0);this.Xp=this.Wp=this.cJ=!1;this.mu=this.Vt=null;this.sorting=Os;this.comparer=zq;this.angle=0;this.alignment=Ss;this.nodeIndentPastParent=this.nodeIndent=0;this.nodeSpacing=20;this.layerSpacing=50;this.layerSpacingParentOverlap=0;this.compaction=at;this.breadthLimit=
  0;this.rowSpacing=25;this.commentSpacing=this.rowIndent=10;this.commentMargin=20;this.setsPortSpot=!0;this.portSpot=Pc;this.setsChildPortSpot=!0;this.childPortSpot=Pc}z.Ra(ys,xa);z.ia("TreeVertex",ys);
  ys.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)};z.w(ys,{Vm:"childrenCount"},function(){return this.children.length});z.defineProperty(ys,{pL:"relativePosition"},function(){return this.qa},function(a){this.qa.set(a)});z.defineProperty(ys,{BL:"subtreeSize"},function(){return this.ob},function(a){this.ob.set(a)});
  z.defineProperty(ys,{AL:"subtreeOffset"},function(){return this.Ua},function(a){this.Ua.set(a)});function Et(){ya.call(this);this.ls=new N(0,0)}z.Ra(Et,ya);z.ia("TreeEdge",Et);
  Et.prototype.commit=function(){var a=this.link;if(null!==a&&!a.kj){var b=this.network.Sb,c=null,d=null;switch(b.Of){case us:c=this.fromVertex;d=this.toVertex;break;case Bs:c=this.toVertex;d=this.fromVertex;break;default:z.k("Unhandled path value "+b.Of.toString())}if(null!==c&&null!==d)if(b=this.ls,0!==b.x||0!==b.y||c.cJ){var d=c.vb,e=bt(c),g=et(c),h=c.rowSpacing;a.An();var k=a.Se===Xi,l=a.rc,m=0,n,p;a.Ul();if(l||k){for(m=2;4<a.sa;)a.nF(2);n=a.m(1);p=a.m(2)}else{for(m=1;3<a.sa;)a.nF(1);n=a.m(0);p=
  a.m(a.sa-1)}var q=a.m(a.sa-1),r=0;0===e?(c.alignment===dt?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-ft(c))))):c.alignment===ct?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+ft(c))))):r=c.Wp||c.Xp&&1===c.maxGenerationCount?d.top-c.Ua.y+b.y:d.y+d.height/2+b.y,k?(a.B(m,n.x,r),m++,a.B(m,d.right+g,r),m++,a.B(m,d.right+g+(b.x-h)/3,r),m++,a.B(m,d.right+g+2*(b.x-h)/3,r),m++,a.B(m,d.right+g+(b.x-h),r),m++,a.B(m,p.x,r)):(l&&(a.B(m,d.right+g/2,n.y),
  m++),a.B(m,d.right+g/2,r),m++,a.B(m,d.right+g+b.x-(l?h/2:h),r),m++,l&&a.B(m,a.m(m-1).x,p.y))):90===e?(c.alignment===dt?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-ft(c))))):c.alignment===ct?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+ft(c))))):r=c.Wp||c.Xp&&1===c.maxGenerationCount?d.left-c.Ua.x+b.x:d.x+d.width/2+b.x,k?(a.B(m,r,n.y),m++,a.B(m,r,d.bottom+g),m++,a.B(m,r,d.bottom+g+(b.y-h)/3),m++,a.B(m,r,d.bottom+g+2*(b.y-h)/3),m++,a.B(m,r,d.bottom+
  g+(b.y-h)),m++,a.B(m,r,p.y)):(l&&(a.B(m,n.x,d.bottom+g/2),m++),a.B(m,r,d.bottom+g/2),m++,a.B(m,r,d.bottom+g+b.y-(l?h/2:h)),m++,l&&a.B(m,p.x,a.m(m-1).y))):180===e?(c.alignment===dt?(r=d.bottom+b.y,0===b.y&&n.y>q.y+c.rowIndent&&(r=Math.min(r,Math.max(n.y,r-ft(c))))):c.alignment===ct?(r=d.top+b.y,0===b.y&&n.y<q.y-c.rowIndent&&(r=Math.max(r,Math.min(n.y,r+ft(c))))):r=c.Wp||c.Xp&&1===c.maxGenerationCount?d.top-c.Ua.y+b.y:d.y+d.height/2+b.y,k?(a.B(m,n.x,r),m++,a.B(m,d.left-g,r),m++,a.B(m,d.left-g+(b.x+
  h)/3,r),m++,a.B(m,d.left-g+2*(b.x+h)/3,r),m++,a.B(m,d.left-g+(b.x+h),r),m++,a.B(m,p.x,r)):(l&&(a.B(m,d.left-g/2,n.y),m++),a.B(m,d.left-g/2,r),m++,a.B(m,d.left-g+b.x+(l?h/2:h),r),m++,l&&a.B(m,a.m(m-1).x,p.y))):270===e?(c.alignment===dt?(r=d.right+b.x,0===b.x&&n.x>q.x+c.rowIndent&&(r=Math.min(r,Math.max(n.x,r-ft(c))))):c.alignment===ct?(r=d.left+b.x,0===b.x&&n.x<q.x-c.rowIndent&&(r=Math.max(r,Math.min(n.x,r+ft(c))))):r=c.Wp||c.Xp&&1===c.maxGenerationCount?d.left-c.Ua.x+b.x:d.x+d.width/2+b.x,k?(a.B(m,
  r,n.y),m++,a.B(m,r,d.top-g),m++,a.B(m,r,d.top-g+(b.y+h)/3),m++,a.B(m,r,d.top-g+2*(b.y+h)/3),m++,a.B(m,r,d.top-g+(b.y+h)),m++,a.B(m,r,p.y)):(l&&(a.B(m,n.x,d.top-g/2),m++),a.B(m,r,d.top-g/2),m++,a.B(m,r,d.top-g+b.y+(l?h/2:h)),m++,l&&a.B(m,p.x,a.m(m-1).y))):z.k("Invalid angle "+e);a.dj()}else e=c,g=d,u&&z.l(e,ys,Et,"adjustRouteForAngleChange:parent"),u&&z.l(g,ys,Et,"adjustRouteForAngleChange:child"),a=this.link,c=bt(e),c!==bt(g)&&(b=et(e),d=e.vb,e=g.vb,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.An(),e=a.Se===Xi,g=a.rc,h=Ts(this.fromVertex.alignment),a.Ul(),0===c?(c=d.right+b/2,e?4===a.sa&&(b=a.m(3).y,a.aa(1,c-20,a.m(1).y),a.B(2,c-20,b),a.B(3,c,b),a.B(4,c+20,b),a.aa(5,a.m(5).x,b)):g?h?a.aa(3,a.m(2).x,a.m(4).y):6===a.sa&&(a.aa(2,c,a.m(2).y),a.aa(3,c,a.m(3).y)):4===a.sa?a.B(2,c,a.m(2).y):3===a.sa?a.aa(1,c,a.m(2).y):2===a.sa&&a.B(1,c,a.m(1).y)):90===c?(b=d.bottom+b/2,e?4===a.sa&&(c=a.m(3).x,a.aa(1,a.m(1).x,b-20),a.B(2,c,b-20),
  a.B(3,c,b),a.B(4,c,b+20),a.aa(5,c,a.m(5).y)):g?h?a.aa(3,a.m(2).x,a.m(4).y):6===a.sa&&(a.aa(2,a.m(2).x,b),a.aa(3,a.m(3).x,b)):4===a.sa?a.B(2,a.m(2).x,b):3===a.sa?a.aa(1,a.m(2).x,b):2===a.sa&&a.B(1,a.m(1).x,b)):180===c?(c=d.left-b/2,e?4===a.sa&&(b=a.m(3).y,a.aa(1,c+20,a.m(1).y),a.B(2,c+20,b),a.B(3,c,b),a.B(4,c-20,b),a.aa(5,a.m(5).x,b)):g?h?a.aa(3,a.m(2).x,a.m(4).y):6===a.sa&&(a.aa(2,c,a.m(2).y),a.aa(3,c,a.m(3).y)):4===a.sa?a.B(2,c,a.m(2).y):3===a.sa?a.aa(1,c,a.m(2).y):2===a.sa&&a.B(1,c,a.m(1).y)):270===
  c&&(b=d.top-b/2,e?4===a.sa&&(c=a.m(3).x,a.aa(1,a.m(1).x,b+20),a.B(2,c,b+20),a.B(3,c,b),a.B(4,c,b-20),a.aa(5,c,a.m(5).y)):g?h?a.aa(3,a.m(2).x,a.m(4).y):6===a.sa&&(a.aa(2,a.m(2).x,b),a.aa(3,a.m(3).x,b)):4===a.sa?a.B(2,a.m(2).x,b):3===a.sa?a.aa(1,a.m(2).x,b):2===a.sa&&a.B(1,a.m(1).x,b)),a.dj()))}};z.defineProperty(Et,{oL:"relativePoint"},function(){return this.ls},function(a){this.ls.set(a)});function Ft(){O.call(this);this.$e=null}z.Ra(Ft,O);
  Ft.prototype.cloneProtected=function(a){O.prototype.cloneProtected.call(this,a);a.element=this.$e.cloneNode(!0)};Ft.prototype.toString=function(){return"HTMLHost("+this.$e.toString()+")#"+z.nd(this)};
  Ft.prototype.ok=function(a,b){var c=this.$e;if(null!==c){var d=this.eb(ec);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.aB(d),e=b.El;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"}};
  Ft.prototype.Ip=function(a,b,c,d){var e=this.Aa;isFinite(e.width)&&(a=e.width);isFinite(e.height)&&(b=e.height);var e=this.Xe,g=this.dg;c=Math.max(c,g.width);d=Math.max(d,g.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.$e;null!==c&&(b=c.getBoundingClientRect(),a=b.width,b=b.height);yb(this.Wc,a,b);Jm(this,0,0,a,b)};Ft.prototype.aj=function(a,b,c,d){Nm(this,a,b,c,d)};z.w(Ft,{Ga:"naturalBounds"},function(){return this.Wc});
  z.defineProperty(Ft,{element:"element"},function(){return this.$e},function(a){var b=this.$e;b!==a&&(a instanceof HTMLElement||z.k("HTMLHost.element must be an instance of HTMLElement."),this.$e=a,a.className="HTMLHost",this.j("element",b,a),this.ta())});aa.version="1.6.24";
  window&&(window.module&&"object"===typeof window.module&&"object"===typeof window.module.exports?window.module.exports=aa:window.define&&"function"===typeof window.define&&window.define.amd?(window.go=aa,window.define(aa)):window.go=aa);"undefined"!==typeof module&&"object"===typeof module.exports&&(module.exports=aa); })(window);
  