control-freak-ide/misc/pocs/GoJS/release__/go-debug.js
plastic-hub-dev-node-saturn 538369cff7 latest
2021-05-12 18:35:18 +02:00

32078 lines
1.3 MiB

/*
* GoJS v1.3.6 JavaScript Library for HTML Canvas Diagrams
* Northwoods Software, http://www.nwoods.com/
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
* Copyright (C) 1998-2014 by Northwoods Software Corporation. All Rights Reserved.
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: http://www.gojs.net/1.3.6/doc/license.html.
*/
(function (window) {
var aa, ba = {};
if (void 0 === 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.prototype.__defineGetter__ && !Object.defineProperty)throw Error("GoJS requires a newer version of JavaScript");
Object.prototype.__defineGetter__ && !Object.defineProperty && (Object.defineProperty = function (a, b, c) {
c.get && a.__defineGetter__(b, c.get);
c.set && a.__defineSetter__(b, c.set)
});
Object.prototype.__lookupGetter__ && !Object.getOwnPropertyDescriptor && (Object.getOwnPropertyDescriptor = function (a, b) {
return{get: a.__lookupGetter__(b), set: a.__lookupSetter__(b)}
});
Object.getPrototypeOf || (Object.getPrototypeOf = function (a) {
return a.__proto__
});
Object.isFrozen || (Object.isFrozen = function (a) {
return!0 === a.AG
});
Object.freeze || (Object.freeze = function (a) {
a.AG = !0
});
Array.isArray || (Array.isArray = function (a) {
return"[object Array]" === Object.prototype.toString.call(a)
});
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) {
clearTimeout(a)
})
})();
var f = {al: !1, Tz: !1, UD: !1, OH: !1, QH: !1, XE: !1, mE: !1, jD: !1, assert: function (a, b) {
if (!a && f.jD)throw window && (t.trace(b), window.alert(b)), Error(b);
}, Ds: null, RD: function (a, b) {
void 0 === a && (a = f.Ds);
void 0 === b && (b = a.il("").cb);
var c = b.length, d = a.Pa.getContext("2d");
d.fillStyle = "rgba(255,255,0,.3)";
for (var e = 0; e < c; e++) {
var g = b.pa(e), h = g.ya;
if (null !== g.za)f.RD(a, g.za); else {
var k = g.Wh.copy();
k.xA(g.ad);
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()
}
}
}, SD: function (a, b) {
a || (a = f.Ds);
b || (b = a.il("").cb);
var c = a.Pa.getContext("2d"), d = b.length;
c.fillStyle = "rgba(0,0,255,.3)";
for (var e = 0; e < d; e++) {
var g = b.pa(e), h = g.Ia, k = g.Wh;
null !== g.za ? f.SD(a, g.za) : (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())
}
}, JH: function (a, b) {
a || (a = f.Ds);
b || (b = a.il("").cb);
var c = a.Pa.getContext("2d"), d = b.length;
c.fillStyle = "rgba(0,0,255,.3)";
for (var e = 0; e < d; e++) {
var g = b.pa(e), h = g.Ea, k = g.Wh;
null !== g.za ? f.JH(a, g.za) : (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())
}
}, rJ: function () {
f.SD();
f.RD()
}, sJ: function (a) {
a || (a = f.Ds);
var b = a.vc;
a = a.Pa.getContext("2d");
a.strokeStyle = "rgba(0,255,0,.9)";
a.strokeRect(b.x, b.y, b.width, b.height)
}, TD: 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.nb;
b.strokeRect(c.x, c.y, c.width, c.height);
b.fillStyle = "rgba(0,255,0,.2)";
b.fillRect(a.vc.x, a.vc.y, a.vc.width, a.vc.height)
}, KH: function (a, b) {
a.lineWidth =
2;
a.strokeStyle = "rgba(255,0,0,.5)";
a.strokeRect(b.Gb.x, b.Gb.y, b.Gb.width, b.Gb.height);
void 0 !== b.stroke && (a.strokeStyle = b.stroke);
void 0 !== b.fe && (a.lineWidth = b.fe);
null !== b.ga && b.ga.type === ca && (a.lineWidth = 1, a.strokeStyle = "rgba(10,200,10,.6)", void 0 !== b.stroke && (a.strokeStyle = b.stroke), void 0 !== b.fe && (a.lineWidth = b.fe))
}, LH: function (a, b) {
a.lineWidth = 1;
a.strokeStyle = "rgba(0,0,255,.5)";
a.strokeRect(b.Ia.x, b.Ia.y, b.Ia.width, b.Ia.height);
void 0 !== b.stroke && (a.strokeStyle = b.stroke);
void 0 !== b.fe && (a.lineWidth =
b.fe)
}, Sz: function (a, b, c) {
a.setTransform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy);
c = b.Bb.length;
for (var d = 0; d < c; d++)for (var e = b.Bb.pa(d), g = e.cb.length, h = 0; h < g; h++) {
var k = e.cb.pa(h);
if (void 0 !== k.location && null !== k.location) {
if (k.location.Q()) {
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)
}, PH: function (a, b, c) {
var d = a.length;
b.fillStyle = "rgba(255,0,0,.1)";
for (var e = 0; e < d; e++) {
var g = da(c, a[e]);
b.fillRect(g[0], g[1], g[2], g[3])
}
}, MH: function (a, b, c, d, e) {
a.fillStyle = "rgba(0,255,0,.2)";
a.fillRect(b, c, d, e)
}, NH: function (a, b, c) {
a.save();
var d = b.ad;
d.reset();
1 !== b.Sb && d.scale(b.Sb);
b = b.rb;
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.mc.p;
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()
}, qJ: function (a) {
a || (a = f.Ds);
for (a = a.Tm; a.next();)t.trace(a.value.toString())
}, HJ: function (a, b) {
var c = b.Hg(a), d = b.cc;
d.Bc = b.gn(c);
d.W = c;
return ga(b, d, a)
}, EJ: function (a, b) {
b.Qd(a.W) && (b.Uf.fillStyle = "lime", b.Uf.Dl = "lime", b.Uf.fillRect(a.Bc.x, a.Bc.y, 1 * b.scale, 1 * b.scale))
}, FJ: function (a) {
var b = ha(a, !1,
null);
if (!b.$o) {
a = a.Uf;
for (var c = 0; c <= b.rm; c++)for (var d = 0; d <= b.sm; d++) {
var e = b.bc[c][d];
if (e !== ia) {
var g = c * b.ud + b.Cf, h = d * b.jd + b.Df;
0 !== e && (a.fillStyle = "rgba(255, 0, 0, .2)", a.fillRect(g, h, b.ud, b.jd));
e >= ja || (e %= 10, a.fillStyle = "blue", a.fillText(e.toString(), g, h + b.jd))
}
}
}
}, SH: function (a) {
if (a instanceof u)for (a = a.Tm; a.next();) {
var b = a.value;
t.trace(b.toString());
for (b = b.rl; b.next();)f.SH(b.value)
} else if (a instanceof w) {
t.trace("References for " + a);
a.layer && t.trace(" " + a.layer.toString() + ' LayerName: "' +
a.Ad + '"');
a.an !== a && t.trace(" SelectionObject: " + a.an.toString() + ' SelectionObjectName: "' + a.ut + '"');
a.Ub !== a && t.trace(" LocationObject: " + a.Ub.toString() + ' LocationObjectName: "' + a.Zs + '"');
if (a.Bg) {
for (var c = "", b = a.Bg.l; b.next();)c += b.key + " ";
t.trace(" Adornments: " + c)
}
a.fb && t.trace(" ContainingGroup: " + a.fb.toString());
if (a instanceof y) {
if (a.xd)for (b = a.xd.l; b.next(););
if (0 < a.Cd.count) {
c = "";
for (b = a.Cd; b.next();)c += b.value.toString() + ", ";
t.trace(" Links: " + c)
}
a.Tc && t.trace(" LabeledLink: " +
a.Tc.toString());
if (a instanceof z) {
t.trace(" Placeholder: " + a.placeholder);
c = "";
for (b = a.Hc; b.next();)c += b.value.toString() + ", ";
t.trace(" Members: " + c);
c = "";
for (b = a.bm.l; b.next();)c += b.value.toString() + ", ";
t.trace(" NestedGroups: " + c);
t.trace(" Layout: " + a.Tb)
}
} else if (a instanceof A) {
t.trace(" Path: " + a.path);
t.trace(" From: " + a.da + " " + a.Rc + ' "' + a.nf + '"');
t.trace(" To: " + a.ja + " " + a.Ed + ' "' + a.Rf + '"');
c = "";
for (b = a.Si; b.next();)c += b.value.toString() + ", ";
t.trace(" LabelNodes: " + c)
}
}
}, TH: function (a) {
if (a instanceof
u)for (a = a.Tm; a.next();) {
var b = a.value;
t.trace(b.toString());
for (b = b.rl; b.next();)f.TH(b.value)
} else a instanceof w && (b = " ", a.Nz && (b += "c"), a.Qz && (b += "d"), a.dA && (b += "g"), a.wA && (b += "m"), a.RA && (b += "h"), a.SA && (b += "z"), a.TA && (b += "o"), a.ik && (b += "s"), a.hB && (b += "t"), a.WA && (b += "A"), a.ow && (b += "B"), a.qw && (b += "L"), a.bb && (b += "S"), a.Kh && (b += "H"), f.YB(a, 1, b))
}, YB: 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.Ze && (c += "p");
a.Ih && (c += "m");
a.Rs && (c += "a");
d =
d + c + (" " + a.ya.toString());
a.Ca.Q() && (d += " d:" + a.Ca.toString());
a.Ia.Q() && (d += " n:" + a.Ia.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.Bi && (d += " a:" + a.background.toString());
a instanceof B && (d += " elts:" + a.za.count, 0 !== a.mB && (d += " top:" + a.mB), 0 !== a.nA && (d += " left:" + a.nA), null !== a.Xs && (d += " itemArray#:" + t.yb(a.Xs)), a.uI && (d += " cat:" + a.uI), null !== a.data && (d += " data:" + a.data));
t.trace(d);
if (a instanceof B)for (a =
a.elements; a.next();)f.YB(a.value, b + 1, "")
}, tJ: function (a) {
t.trace("DelayedReferences (" + a.Vf.count + ")");
for (a = a.Vf.l; a.next();) {
for (var b = "", c = a.value.l; c.next();)b += ka(c.value) + ", ";
t.trace(" " + a.key + ": " + b)
}
}};
ba.Debug = f;
var t = {Vh: Object.freeze([]), Yz: {}, aE: 0, Xz: {}, $D: 0, VD: "...", fA: {}, gA: 0, nB: [], Dw: null, Gp: document.createElement("canvas").getContext("2d"), Hp: "", ND: [], gB: "ontouchstart"in window, LF: "ongesturestart"in window, ED: !1, zs: null, As: null, ys: null, Nv: "", eG: !1, hG: !1, gG: !1, fG: !1, FD: null, Np: !1, cG: !1, dG: !1, m: function (a) {
f && f.jD && alert(a);
throw Error(a);
}, J: function (a, b) {
if (a.jb) {
var c = "The object is frozen, so its properties cannot be set: " + a.toString();
void 0 !== b && (c += " to value: " + b);
t.m(c)
}
}, k: function (a, b, c, d) {
a instanceof b || (c = t.Gh(c), void 0 !== d && (c += "." + d), t.Vb(a, b, c))
}, j: function (a, b, c, d) {
typeof a !== b && (c = t.Gh(c), void 0 !== d && (c += "." + d), t.Vb(a, b, c))
}, o: function (a, b, c) {
"number" === typeof a && isFinite(a) || (b = t.Gh(b), void 0 !== c && (b += "." + c), t.m(b + " must be a real number type, and not NaN or Infinity: " + a))
}, tb: function (a, b, c, d) {
a instanceof la && a.Pe === b || (c = t.Gh(c), void 0 !== d && (c += "." + d), t.Vb(a, "a constant of class " + t.Tg(b), c))
}, Vb: function (a, b, c, d) {
b = t.Gh(b);
c = t.Gh(c);
void 0 !== d && (c += "." + d);
t.m(c + " value is not an instance of " +
b + ": " + a)
}, ha: function (a, b, c, d) {
c = t.Gh(c);
void 0 !== d && (c += "." + d);
t.m(c + " is not in the range " + b + ": " + a)
}, trace: function (a) {
window && window.console && window.console.log(a)
}, pb: function (a) {
return"object" === typeof a && null !== a
}, qc: null, Sm: function (a, b, c, d) {
for (b = 0; b < a.length; b++) {
var e = a[b];
t.pb(e) && (e = t.qf(e, c, d));
a[b] = e
}
return d || t.qc(a) ? a : window.ko.observableArray(a)
}, qf: function (a, b, c) {
if (a)for (var d in a)"__gohashid" !== d && (a[d] = t.AI(a, d, b, c));
return a
}, AI: function (a, b, c, d) {
var e = a[b], g;
g = t.qc(e) ?
e : Array.isArray(e) ? t.Sm(e, b, c, d) : window.ko.observable(e);
if (d) {
if (d = g.EB) {
h = c.__gohashid;
d[h] && (d[h].dispose(), delete d[h]);
var h = !1, k;
for (k in d) {
h = !0;
break
}
}
!h && g.Vt && (g.Vt.dispose(), delete g.Vt)
} else {
g.Vt || (g.Vt = g.subscribe(function (a) {
g.bo = a
}, null, "beforeChange"));
d = g.EB;
d || (g.EB = d = {});
var h = c.__gohashid;
d[h] || (d[h] = g.subscribe(function (d) {
c.Ew(a, b, g.bo, d)
}))
}
return g
}, isArray: function (a) {
return Array.isArray(a) || t.qc && t.qc(a) || a instanceof NodeList || a instanceof HTMLCollection
}, pI: function (a) {
return Array.isArray(a) ||
t.qc && t.qc(a)
}, xs: function (a, b, c) {
t.isArray(a) || t.Vb(a, "Array or NodeList or HTMLCollection", b, c)
}, yb: function (a) {
t.qc && t.qc(a) && (a = a());
return a.length
}, sb: function (a, b) {
t.qc && t.qc(a) && (a = a());
Array.isArray(a);
return a[b]
}, hD: function (a, b, c) {
t.qc && t.qc(a) && (a = a());
Array.isArray(a) ? a[b] = c : t.m("Cannot replace an object in an HTMLCollection or NodeList at " + b)
}, Ez: function (a, b) {
t.qc && t.qc(a) && (a = a());
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
},
Di: function (a, b, c) {
t.qc && t.qc(a) && (a = a());
Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : t.m("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b)
}, Ei: function (a, b) {
t.qc && t.qc(a) && (a = a());
Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : t.m("Cannot remove an object from an HTMLCollection or NodeList at " + b)
}, vx: [], O: function () {
var a = t.vx.pop();
return void 0 === a ? new C : a
}, ic: function (a, b) {
var c = t.vx.pop();
if (void 0 === c)return new C(a, b);
c.x = a;
c.y = b;
return c
}, B: function (a) {
t.vx.push(a)
},
AB: [], xl: function () {
var a = t.AB.pop();
return void 0 === a ? new oa : a
}, ck: function (a) {
t.AB.push(a)
}, wx: [], xf: function () {
var a = t.wx.pop();
return void 0 === a ? new D : a
}, kk: function (a, b, c, d) {
var e = t.wx.pop();
if (void 0 === e)return new D(a, b, c, d);
e.x = a;
e.y = b;
e.width = c;
e.height = d;
return e
}, Qc: function (a) {
t.wx.push(a)
}, BB: [], ah: function () {
var a = t.BB.pop();
return void 0 === a ? new pa : a
}, Te: function (a) {
t.BB.push(a)
}, xx: null, u: function () {
var a = t.xx;
return null !== a ? (t.xx = null, a) : new qa
}, v: function (a) {
a.reset();
t.xx = a
}, zB: [],
Db: function () {
var a = t.zB.pop();
return void 0 === a ? [] : a
}, Da: function (a) {
a.length = 0;
t.zB.push(a)
}, CB: 1, zc: function (a) {
a.__gohashid = t.CB++
}, Os: function (a) {
var b = a.__gohashid;
void 0 === b && (b = t.CB++, a.__gohashid = b);
return b
}, oc: function (a) {
return a.__gohashid
}, g: function (a, b, c) {
"name" !== b && "length" !== b && (a[b] = c)
}, ia: function (a, b) {
b.Ex = a;
ba[a] = b
}, Oa: function (a, b) {
function c() {
}
c.prototype = b.prototype;
a.prototype = new c;
a.prototype.constructor = a
}, Eh: function (a) {
a.FG = !0
}, defineProperty: function (a, b, c, d, e) {
t.j(a,
"function", "Util.defineProperty:classfunc");
t.j(b, "object", "Util.defineProperty:propobj");
t.j(c, "function", "Util.defineProperty:getter");
t.j(d, "function", "Util.defineProperty:setter");
for (var g in b) {
var h = b[g];
b = {get: c, set: d};
if (void 0 !== e)for (var k in e)b[k] = e[k];
Object.defineProperty(a.prototype, g, b);
e = Object.getOwnPropertyDescriptor(a.prototype, g);
h && e && Object.defineProperty(a.prototype, h, e);
if (f && h) {
var l = h.charAt(0).toUpperCase() + h.slice(1);
h == l && t.m('Defining capitalized property "' + l + '"!?');
Object.defineProperty(a.prototype, l, {get: function () {
t.m('Getting the property "' + l + '" is probably not what you intended: it is capitalized but should spelled "' + h + '"')
}, set: function () {
t.m('Setting the property "' + l + '" is probably not what you intended: it is capitalized but should spelled "' + h + '"')
}})
}
break
}
}, A: function (a, b, c, d) {
t.j(a, "function", "Util.defineReadOnlyProperty:classfunc");
t.j(b, "object", "Util.defineReadOnlyProperty:propobj");
t.j(c, "function", "Util.defineReadOnlyProperty:getter");
for (var e in b) {
var g =
b[e];
b = {get: c, set: function (a) {
t.m('The property "' + g + '" is read-only and cannot be set to ' + a)
}};
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);
if (f && g) {
var k = g.charAt(0).toUpperCase() + g.slice(1);
Object.defineProperty(a.prototype, k, {get: function () {
t.m('Getting the property "' + k + '" is probably not what you intended: it is capitalized but should spelled "' + g + '"')
}, set: function () {
t.m('Setting the read-only property "' +
k + '" is probably not what you intended: it is capitalized but should spelled "' + g + '", and cannot be set anyway')
}})
}
break
}
}, je: function (a, b) {
for (var c in b)b[c] = !0;
a.prototype.EC = b
}, Gh: function (a) {
return void 0 === a ? "" : "string" === typeof a ? a : "function" === typeof a ? t.Tg(a) : null === a ? "*" : ""
}, Tg: function (a) {
if ("function" === typeof a) {
if (a.Ex)return a.Ex;
if (a.name)return a.name;
var b = a.toString(), c = b.indexOf("(");
if (b = b.substring(9, c).trim())return a.Ex = b
} else if ("object" === typeof a && a.constructor)return t.Tg(a.constructor);
return typeof a
}, w: function (a, b, c) {
t.j(a, "function", "Util.defineEnumValue:classfunc");
t.j(b, "string", "Util.defineEnumValue:name");
t.j(c, "number", "Util.defineEnumValue:num");
c = new la(a, b, c);
Object.freeze(c);
a[b] = c;
var d = a.Ht;
d || (d = new ra("string", la), a.Ht = d);
d.add(b, c);
return c
}, Km: function (a, b) {
if (!b)return null;
t.j(a, "function", "Util.findEnumValueForName:classfunc");
t.j(b, "string", "Util.findEnumValueForName:name");
var c = a.Ht;
return c ? c.Ba(b) : null
}, rH: function (a, b, c, d) {
var e = {}, g;
for (g in a) {
for (var h =
!1, k = 1; k < arguments.length; k++)if (arguments[k] === g) {
h = !0;
break
}
h || (e[g] = a[g])
}
return e
}, hb: 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], t.qc && t.qc(c) && (c = c()))
} catch (d) {
f && t.trace("property get error: " + d.toString())
}
return c
}, Ua: function (a, b, c) {
if (a && b)try {
if ("function" === typeof b)b(a, c); else if ("function" === typeof a.setAttribute)a.setAttribute(b, c); else if (t.qc) {
var d = a[b];
t.qc(d) ?
d(c) : a[b] = c
} else a[b] = c
} catch (e) {
f && t.trace("property set error: " + e.toString())
}
}, Kw: function (a, b) {
t.j(a, "object", "Setting properties requires Objects as arguments");
t.j(b, "object", "Setting properties requires Objects as arguments");
var c = f;
c || (f = t);
var d = a instanceof B, e = a instanceof u, g;
for (g in b) {
g || t.m("Setting properties requires non-empty property names");
var h = a, k = g;
if (d || e) {
var l = g.indexOf(".");
if (0 < l) {
var m = g.substring(0, l);
d ? h = a.le(m) : (h = a[m]) || (h = a.Eb[m]);
h ? k = g.substr(l + 1) : t.m("Unable to find object named: " +
m + " in " + a.toString() + " when trying to set property: " + g)
}
}
if ("_" !== k[0] && !t.jw(h, k))if (e && t.jw(a.Eb, k))h = a.Eb; else if (e && sa(a, k)) {
a.yz(k, b[k]);
continue
} else t.m('Trying to set undefined property "' + k + '" on object: ' + h.toString());
h[k] = b[g];
"_" === k[0] && (l = h.Il, l || (l = [], h.Il = l), l.push(k))
}
f = c;
return a
}, jw: function (a, b) {
for (var c = Object.getPrototypeOf(a); c && c !== Function;) {
if (c.hasOwnProperty(b))return!0;
var d = c.EC;
if (d && d[b])return!0;
c = Object.getPrototypeOf(c)
}
return!1
}, nD: function (a, b) {
if (!t.pb(b) ||
b instanceof Element || b instanceof CanvasRenderingContext2D)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 = t.hb(b, d);
null === e || "function" === typeof e || t.jw(b, d) || ("" === c && (c = b + "\n"), c += ' unknown property "' + d + '" has value: ' + e + " at " + a + "\n")
}
return c
}, Mv: function (a, b) {
if (b && "number" !== typeof b && "string" !== typeof b && "boolean" !== typeof b && "function" !== typeof b)if (void 0 !== t.oc(b)) {
if (!t.hv.contains(b))if (t.hv.add(b),
t.Iu.add(t.nD(a, b)), b instanceof H || b instanceof ta || b instanceof ra)for (var c = b.l; c.next();)t.Mv(a + "[" + c.key + "]", c.value); else for (c in b) {
var d = t.hb(b, c);
if (void 0 !== d && null !== d && t.pb(d) && d !== b.EC) {
if (b instanceof ua) {
if (d === b.Yn)continue
} else if (b instanceof B) {
if ("data" === c || d === b.Kl)continue;
if ("itemArray" === c || d === b.rj)continue;
if (b instanceof w && d === b.zj)continue
} else if (!(b instanceof u))if (b instanceof va) {
if ("archetypeGroupData" === c || d === b.Ax)continue
} else if (b instanceof wa) {
if ("archetypeLinkData" ===
c || d === b.Tt)continue;
if ("archetypeLabelNodeData" === c || d === b.St)continue
} else if (b instanceof za) {
if ("archetypeNodeData" === c || d === b.aj)continue
} else if (b instanceof I) {
if ("nodeDataArray" === c || d === b.Ke)continue;
if ("linkDataArray" === c || d === b.Lg || d === b.Yl)continue;
if (d === b.uc)continue;
if (d === b.Vf)continue
} else if (b instanceof Aa || b instanceof Ba || b instanceof Da)continue;
t.Mv(a + "." + c, d)
}
}
} else if (Array.isArray(b))for (c = 0; c < b.length; c++)t.Mv(a + "[" + c + "]", b[c]); else t.Iu.add(t.nD(a, b))
}, mH: function (a) {
void 0 ===
t.hv ? t.hv = new ta : t.hv.clear();
t.Iu = new Ea;
t.Mv("", a);
a = t.Iu.toString();
t.Iu = null;
return a
}, UI: function (a) {
for (var b = [], c = 0; 256 > c; c++)b[c] = c;
for (var d = 0, e, 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
}, gI: 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
}, Qa: function (a) {
return t.UI(t.gI(a))
}, Cl: null, Ev: "7da71ca0ad381e90", nH: "@COLOR1", oH: "@COLOR2"};
t.Cl = function () {
var a = document.createElement("canvas"), b = a.getContext("2d");
b[t.Qa("7ca11abfd022028846")] = t.Qa("398c3597c01238");
for (var c = ["5da73c80a3330d854f9e5e671d6633", "32ab5ff3b26f42dc0ed90f22402913b54ae6247590da4bb21c324ba3a84e385776", "54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", "74bf19bce72555874c86"], d = 1; 5 > d; d++)b[t.Qa("7ca11abfd7330390")](t.Qa(c[d - 1]), 10, 15 * d + 0);
b[t.Qa("7ca11abfd022028846")] = t.Qa("39f046ebb36e4b");
for (d = 1; 5 > d; d++)b[t.Qa("7ca11abfd7330390")](t.Qa(c[d -
1]), 10, 15 * d + 0);
if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0])t.w = function (a, b) {
var c = new la(a, b, 2);
Object.freeze(c);
a[b] = c;
var d = a.Ht;
d || (d = new ra("string", la), a.Ht = d);
d.add(b, c);
return c
};
return a
}();
function la(a, b, c) {
t.zc(this);
this.GB = a;
this.Rb = b;
this.KG = c
}
la.prototype.toString = function () {
return t.Tg(this.GB) + "." + this.Rb
};
t.A(la, {Pe: "classType"}, function () {
return this.GB
});
t.A(la, {name: "name"}, function () {
return this.Rb
});
t.A(la, {value: "value"}, function () {
return this.KG
});
function Ea() {
this.FB = []
}
Ea.prototype.toString = function () {
return this.FB.join("")
};
Ea.prototype.add = function (a) {
a && this.FB.push(a)
};
function Fa() {
}
t.A(Fa, {l: "iterator"}, function () {
return this
});
Fa.prototype.reset = Fa.prototype.reset = function () {
};
Fa.prototype.next = Fa.prototype.hasNext = Fa.prototype.next = function () {
return!1
};
Fa.prototype.first = Fa.prototype.eb = function () {
return null
};
t.A(Fa, {count: "count"}, function () {
return 0
});
Fa.prototype.Fg = function () {
};
Fa.prototype.toString = function () {
return"EmptyIterator"
};
t.dh = new Fa;
function Ha(a) {
this.key = -1;
this.value = a
}
t.je(Ha, {key: !0, value: !0});
t.A(Ha, {l: "iterator"}, function () {
return this
});
Ha.prototype.reset = Ha.prototype.reset = function () {
this.key = -1
};
Ha.prototype.next = Ha.prototype.hasNext = Ha.prototype.next = function () {
return-1 === this.key ? (this.key = 0, !0) : !1
};
Ha.prototype.first = Ha.prototype.eb = function () {
this.key = 0;
return this.value
};
t.A(Ha, {count: "count"}, function () {
return 1
});
Ha.prototype.Fg = function () {
this.value = null
};
Ha.prototype.toString = function () {
return"SingletonIterator(" + this.value + ")"
};
function Ia(a) {
this.Af = a;
this.ho = null;
this.reset()
}
t.je(Ia, {key: !0, value: !0});
t.A(Ia, {l: "iterator"}, function () {
return this
});
t.g(Ia, "predicate", Ia.prototype.sl);
t.defineProperty(Ia, {sl: "predicate"}, function () {
return this.ho
}, function (a) {
this.ho = a
});
Ia.prototype.reset = Ia.prototype.reset = function () {
var a = this.Af;
a.qh = null;
this.kb = a.Wb;
this.se = -1
};
Ia.prototype.next = Ia.prototype.hasNext = Ia.prototype.next = function () {
var a = this.Af;
a.Wb !== this.kb && t.m("the List has been modified during iteration");
var a = a.p, b = a.length, c = ++this.se, d = this.ho;
if (null !== d)for (; c < b;) {
var e = a[c];
if (d(e))return this.key = this.se = c, this.value = e, !0;
c++
} else {
if (c < b)return this.key = c, this.value = a[c], !0;
this.Fg()
}
return!1
};
Ia.prototype.first = Ia.prototype.eb = function () {
var a = this.Af;
this.kb = a.Wb;
this.se = 0;
var a = a.p, b = a.length, c = this.ho;
if (null !== c) {
for (var d = 0; d < b;) {
var e = a[d];
if (c(e))return this.key = this.se = d, this.value = e;
d++
}
return null
}
return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null
};
t.A(Ia, {count: "count"}, function () {
var a = this.ho;
if (null !== a) {
for (var b = 0, c = this.Af.p, d = c.length, e = 0; e < d; e++)a(c[e]) && b++;
return b
}
return this.Af.p.length
});
Ia.prototype.Fg = function () {
this.key = -1;
this.value = null;
this.kb = -1;
this.ho = null;
this.Af.qh = this
};
Ia.prototype.toString = function () {
return"ListIterator@" + this.se + "/" + this.Af.count
};
function La(a) {
this.Af = a;
this.reset()
}
t.je(La, {key: !0, value: !0});
t.A(La, {l: "iterator"}, function () {
return this
});
La.prototype.reset = La.prototype.reset = function () {
var a = this.Af;
a.Ay = null;
this.kb = a.Wb;
this.se = a.p.length
};
La.prototype.next = La.prototype.hasNext = La.prototype.next = function () {
var a = this.Af;
a.Wb !== this.kb && t.m("the List has been modified during iteration");
var b = --this.se;
if (0 <= b)return this.key = b, this.value = a.p[b], !0;
this.Fg();
return!1
};
La.prototype.first = La.prototype.eb = function () {
var a = this.Af;
this.kb = a.Wb;
var b = a.p;
this.se = a = b.length - 1;
return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null
};
t.A(La, {count: "count"}, function () {
return this.Af.p.length
});
La.prototype.Fg = function () {
this.key = -1;
this.value = null;
this.kb = -1;
this.Af.Ay = this
};
La.prototype.toString = function () {
return"ListIteratorBackwards(" + this.se + "/" + this.Af.count + ")"
};
function H(a) {
t.zc(this);
this.jb = !1;
this.p = [];
this.Wb = 0;
this.Ay = this.qh = 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 : t.ha(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 : t.ha(a, "null, a primitive type name, or a class type",
"List constructor: type")
}
t.ia("List", H);
H.prototype.Cg = function (a) {
null !== this.ba && ("string" === typeof this.ba ? typeof a === this.ba && null !== a || t.Vb(a, this.ba) : a instanceof this.ba || t.Vb(a, this.ba))
};
H.prototype.Md = function () {
var a = this.Wb;
a++;
999999999 < a && (a = 0);
this.Wb = a
};
H.prototype.freeze = H.prototype.freeze = function () {
this.jb = !0;
return this
};
H.prototype.thaw = H.prototype.Va = function () {
this.jb = !1;
return this
};
H.prototype.toString = function () {
return"List(" + t.Gh(this.ba) + ")#" + t.oc(this)
};
H.prototype.add = H.prototype.add = function (a) {
null !== a && (f && this.Cg(a), t.J(this, a), this.p.push(a), this.Md())
};
H.prototype.addAll = H.prototype.Me = function (a) {
if (null === a)return this;
t.J(this);
var b = this.p;
if (t.isArray(a))for (var c = t.yb(a), d = 0; d < c; d++) {
var e = t.sb(a, d);
f && this.Cg(e);
b.push(e)
} else for (a = a.l; a.next();)e = a.value, f && this.Cg(e), b.push(e);
this.Md();
return this
};
H.prototype.clear = H.prototype.clear = function () {
t.J(this);
this.p.length = 0;
this.Md()
};
H.prototype.contains = H.prototype.has = H.prototype.contains = function (a) {
if (null === a)return!1;
f && this.Cg(a);
return-1 !== this.p.indexOf(a)
};
H.prototype.indexOf = H.prototype.indexOf = function (a) {
if (null === a)return-1;
f && this.Cg(a);
return this.p.indexOf(a)
};
H.prototype.elt = H.prototype.get = H.prototype.pa = function (a) {
f && t.o(a, H, "elt:i");
var b = this.p;
(0 > a || a >= b.length) && t.ha(a, "0 <= i < length", H, "elt:i");
return b[a]
};
H.prototype.setElt = H.prototype.set = H.prototype.xg = function (a, b) {
f && (this.Cg(b), t.o(a, H, "setElt:i"));
var c = this.p;
(0 > a || a >= c.length) && t.ha(a, "0 <= i < length", H, "setElt:i");
t.J(this, a);
c[a] = b
};
H.prototype.first = H.prototype.eb = function () {
var a = this.p;
return 0 === a.length ? null : a[0]
};
H.prototype.insertAt = H.prototype.Rd = function (a, b) {
f && (this.Cg(b), t.o(a, H, "insertAt:i"));
0 > a && t.ha(a, ">= 0", H, "insertAt:i");
t.J(this, a);
var c = this.p;
a >= c.length ? c.push(b) : c.splice(a, 0, b);
this.Md();
return!0
};
H.prototype.remove = H.prototype["delete"] = H.prototype.remove = function (a) {
if (null === a)return!1;
f && this.Cg(a);
t.J(this, a);
var b = this.p;
a = b.indexOf(a);
if (-1 === a)return!1;
a === b.length - 1 ? b.pop() : b.splice(a, 1);
this.Md();
return!0
};
H.prototype.removeAt = H.prototype.Dd = function (a) {
f && t.o(a, H, "removeAt:i");
var b = this.p;
(0 > a || a >= b.length) && t.ha(a, "0 <= i < length", H, "removeAt:i");
t.J(this, a);
a === b.length - 1 ? b.pop() : b.splice(a, 1);
this.Md()
};
H.prototype.removeRange = H.prototype.removeRange = function (a, b) {
f && (t.o(a, H, "removeRange:from"), t.o(b, H, "removeRange:to"));
var c = this.p;
(0 > a || a >= c.length) && t.ha(a, "0 <= from < length", H, "elt:from");
(0 > b || b >= c.length) && t.ha(b, "0 <= to < length", H, "elt:to");
t.J(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.Md()
};
H.prototype.copy = function () {
for (var a = new H(this.ba), b = this.p, c = this.count, d = 0; d < c; d++)a.add(b[d]);
return a
};
H.prototype.toArray = H.prototype.af = function () {
for (var a = this.p, b = this.count, c = Array(b), d = 0; d < b; d++)c[d] = a[d];
return c
};
H.prototype.toSet = function () {
for (var a = new ta(this.ba), b = this.p, c = this.count, d = 0; d < c; d++)a.add(b[d]);
return a
};
H.prototype.sort = H.prototype.sort = function (a) {
f && t.j(a, "function", H, "sort:sortfunc");
t.J(this);
this.p.sort(a);
this.Md();
return this
};
H.prototype.sortRange = H.prototype.Ip = function (a, b, c) {
var d = this.p, e = d.length;
void 0 === b && (b = 0);
void 0 === c && (c = e);
f && (t.j(a, "function", H, "sortRange:sortfunc"), t.o(b, H, "sortRange:from"), t.o(c, H, "sortRange:to"));
t.J(this);
var g = c - b;
if (1 >= g)return this;
(0 > b || b >= e - 1) && t.ha(b, "0 <= from < length", H, "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.Md()), 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.Md();
return this
};
H.prototype.reverse = H.prototype.reverse = function () {
t.J(this);
this.p.reverse();
this.Md();
return this
};
t.A(H, {count: "count"}, function () {
return this.p.length
});
t.A(H, {size: "size"}, function () {
return this.p.length
});
t.A(H, {length: "length"}, function () {
return this.p.length
});
t.A(H, {l: "iterator"}, function () {
if (0 >= this.p.length)return t.dh;
var a = this.qh;
return null !== a ? (a.reset(), a) : new Ia(this)
});
t.A(H, {Rm: "iteratorBackwards"}, function () {
if (0 >= this.p.length)return t.dh;
var a = this.Ay;
return null !== a ? (a.reset(), a) : new La(this)
});
function Oa(a) {
this.q = a;
this.reset()
}
t.je(Oa, {key: !0, value: !0});
t.A(Oa, {l: "iterator"}, function () {
return this
});
Oa.prototype.reset = Oa.prototype.reset = function () {
var a = this.q;
a.qh = null;
this.kb = a.Wb;
this.be = null
};
Oa.prototype.next = Oa.prototype.hasNext = Oa.prototype.next = function () {
var a = this.q;
a.Wb !== this.kb && t.m("the Set has been modified during iteration");
var b = this.be, b = null === b ? a.re : b.Aj;
if (null !== b)return this.be = b, this.value = b.value, this.key = b.key, !0;
this.Fg();
return!1
};
Oa.prototype.first = Oa.prototype.eb = function () {
var a = this.q;
this.kb = a.Wb;
a = a.re;
if (null !== a) {
this.be = a;
var b = a.value;
this.key = a.key;
return this.value = b
}
return null
};
t.A(Oa, {count: "count"}, function () {
return this.q.kd
});
Oa.prototype.Fg = function () {
this.value = null;
this.kb = -1;
this.q.qh = this
};
Oa.prototype.toString = function () {
return null !== this.be ? "SetIterator@" + this.be.value : "SetIterator"
};
function ta(a) {
t.zc(this);
this.jb = !1;
void 0 === a || null === a ? this.ba = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.ba = a : t.ha(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 : t.ha(a, "null, a primitive type name, or a class type", "Set constructor: type");
this.Wc = {};
this.kd = 0;
this.qh = null;
this.Wb = 0;
this.sh = this.re = null
}
t.ia("Set", ta);
ta.prototype.Cg = function (a) {
null !== this.ba && ("string" === typeof this.ba ? typeof a === this.ba && null !== a || t.Vb(a, this.ba) : a instanceof this.ba || t.Vb(a, this.ba))
};
ta.prototype.Md = function () {
var a = this.Wb;
a++;
999999999 < a && (a = 0);
this.Wb = a
};
ta.prototype.freeze = ta.prototype.freeze = function () {
this.jb = !0;
return this
};
ta.prototype.thaw = ta.prototype.Va = function () {
this.jb = !1;
return this
};
ta.prototype.toString = function () {
return"Set(" + t.Gh(this.ba) + ")#" + t.oc(this)
};
ta.prototype.add = ta.prototype.add = function (a) {
if (null === a)return!1;
f && this.Cg(a);
t.J(this, a);
var b = a;
t.pb(a) && (b = t.Os(a));
return void 0 === this.Wc[b] ? (this.kd++, a = new Pa(a, a), this.Wc[b] = a, b = this.sh, null === b ? this.re = a : (a.io = b, b.Aj = a), this.sh = a, this.Md(), !0) : !1
};
ta.prototype.addAll = ta.prototype.Me = function (a) {
if (null === a)return this;
t.J(this);
if (t.isArray(a))for (var b = t.yb(a), c = 0; c < b; c++)this.add(t.sb(a, c)); else for (a = a.l; a.next();)this.add(a.value);
return this
};
ta.prototype.contains = ta.prototype.has = ta.prototype.contains = function (a) {
if (null === a)return!1;
f && this.Cg(a);
var b = a;
return t.pb(a) && (b = t.oc(a), void 0 === b) ? !1 : void 0 !== this.Wc[b]
};
ta.prototype.containsAll = function (a) {
if (null === a)return!0;
for (a = a.l; a.next();)if (!this.contains(a.value))return!1;
return!0
};
ta.prototype.containsAny = function (a) {
if (null === a)return!0;
for (a = a.l; a.next();)if (this.contains(a.value))return!0;
return!1
};
ta.prototype.first = ta.prototype.eb = function () {
var a = this.re;
return null === a ? null : a.value
};
ta.prototype.remove = ta.prototype["delete"] = ta.prototype.remove = function (a) {
if (null === a)return!1;
f && this.Cg(a);
t.J(this, a);
var b = a;
if (t.pb(a) && (b = t.oc(a), void 0 === b))return!1;
a = this.Wc[b];
if (void 0 === a)return!1;
var c = a.Aj, d = a.io;
null !== c && (c.io = d);
null !== d && (d.Aj = c);
this.re === a && (this.re = c);
this.sh === a && (this.sh = d);
delete this.Wc[b];
this.kd--;
this.Md();
return!0
};
ta.prototype.removeAll = function (a) {
if (null === a)return this;
t.J(this);
if (t.isArray(a))for (var b = t.yb(a), c = 0; c < b; c++)this.remove(t.sb(a, c)); else for (a = a.l; a.next();)this.remove(a.value);
return this
};
ta.prototype.retainAll = function (a) {
if (null === a || 0 === this.count)return this;
t.J(this);
var b = new ta(this.ba);
b.Me(a);
a = new H(this.ba);
for (var c = this.l; c.next();)b.contains(c.value) || a.add(c.value);
for (b = a.l; b.next();)this.remove(b.value);
return this
};
ta.prototype.clear = ta.prototype.clear = function () {
t.J(this);
this.Wc = {};
this.kd = 0;
this.sh = this.re = null;
this.Md()
};
ta.prototype.copy = function () {
var a = new ta(this.ba), b = this.Wc, c;
for (c in b)a.add(b[c].value);
return a
};
ta.prototype.toArray = ta.prototype.af = function () {
var a = Array(this.kd), b = this.Wc, c = 0, d;
for (d in b)a[c] = b[d].value, c++;
return a
};
ta.prototype.toList = function () {
var a = new H(this.ba), b = this.Wc, c;
for (c in b)a.add(b[c]);
return a
};
t.A(ta, {count: "count"}, function () {
return this.kd
});
t.A(ta, {size: "size"}, function () {
return this.kd
});
t.A(ta, {l: "iterator"}, function () {
if (0 >= this.kd)return t.dh;
var a = this.qh;
return null !== a ? (a.reset(), a) : new Oa(this)
});
function Qa(a) {
this.Dc = a;
this.reset()
}
t.je(Qa, {key: !0, value: !0});
t.A(Qa, {l: "iterator"}, function () {
return this
});
Qa.prototype.reset = Qa.prototype.reset = function () {
this.kb = this.Dc.Wb;
this.be = null
};
Qa.prototype.next = Qa.prototype.hasNext = Qa.prototype.next = function () {
var a = this.Dc;
a.Wb !== this.kb && t.m("the Map has been modified during iteration");
var b = this.be, b = null === b ? a.re : b.Aj;
if (null !== b)return this.be = b, this.value = this.key = a = b.key, !0;
this.Fg();
return!1
};
Qa.prototype.first = Qa.prototype.eb = function () {
var a = this.Dc;
this.kb = a.Wb;
a = a.re;
return null !== a ? (this.be = a, this.value = this.key = a = a.key) : null
};
t.A(Qa, {count: "count"}, function () {
return this.Dc.kd
});
Qa.prototype.Fg = function () {
this.value = null;
this.kb = -1
};
Qa.prototype.toString = function () {
return null !== this.be ? "MapKeySetIterator@" + this.be.value : "MapKeySetIterator"
};
function Ta(a) {
t.zc(this);
this.jb = !0;
this.Dc = a
}
t.Oa(Ta, ta);
Ta.prototype.freeze = function () {
return this
};
Ta.prototype.Va = function () {
return this
};
Ta.prototype.toString = function () {
return"MapKeySet(" + this.Dc.toString() + ")"
};
Ta.prototype.add = Ta.prototype.set = Ta.prototype.add = function () {
t.m("This Set is read-only: " + this.toString());
return!1
};
Ta.prototype.contains = Ta.prototype.has = Ta.prototype.contains = function (a) {
return this.Dc.contains(a)
};
Ta.prototype.remove = Ta.prototype["delete"] = Ta.prototype.remove = function () {
t.m("This Set is read-only: " + this.toString());
return!1
};
Ta.prototype.clear = Ta.prototype.clear = function () {
t.m("This Set is read-only: " + this.toString())
};
Ta.prototype.first = Ta.prototype.eb = function () {
var a = this.Dc.re;
return null !== a ? a.key : null
};
Ta.prototype.copy = function () {
return new Ta(this.Dc)
};
Ta.prototype.toSet = function () {
var a = new ta(this.Dc.rh), b = this.Dc.Wc, c;
for (c in b)a.add(b[c].key);
return a
};
Ta.prototype.toArray = Ta.prototype.af = function () {
var a = this.Dc.Wc, b = Array(this.Dc.kd), c = 0, d;
for (d in a)b[c] = a[d].key, c++;
return b
};
Ta.prototype.toList = function () {
var a = new H(this.ba), b = this.Dc.Wc, c;
for (c in b)a.add(b[c].key);
return a
};
t.A(Ta, {count: "count"}, function () {
return this.Dc.kd
});
t.A(Ta, {size: "size"}, function () {
return this.Dc.kd
});
t.A(Ta, {l: "iterator"}, function () {
return 0 >= this.Dc.kd ? t.dh : new Qa(this.Dc)
});
function Pa(a, b) {
this.key = a;
this.value = b;
this.io = this.Aj = null
}
t.je(Pa, {key: !0, value: !0});
Pa.prototype.toString = function () {
return"{" + this.key + ":" + this.value + "}"
};
function Ua(a) {
this.Dc = a;
this.reset()
}
t.je(Ua, {key: !0, value: !0});
t.A(Ua, {l: "iterator"}, function () {
return this
});
Ua.prototype.reset = Ua.prototype.reset = function () {
var a = this.Dc;
a.qh = null;
this.kb = a.Wb;
this.be = null
};
Ua.prototype.next = Ua.prototype.hasNext = Ua.prototype.next = function () {
var a = this.Dc;
a.Wb !== this.kb && t.m("the Map has been modified during iteration");
var b = this.be, b = null === b ? a.re : b.Aj;
if (null !== b)return this.be = b, this.key = b.key, this.value = b.value, !0;
this.Fg();
return!1
};
Ua.prototype.first = Ua.prototype.eb = function () {
var a = this.Dc;
this.kb = a.Wb;
a = a.re;
if (null !== a) {
this.be = a;
var b = a.key;
this.key = b;
this.value = a.value;
return b
}
return null
};
t.A(Ua, {count: "count"}, function () {
return this.Dc.kd
});
Ua.prototype.Fg = function () {
this.value = this.key = null;
this.kb = -1;
this.Dc.qh = this
};
Ua.prototype.toString = function () {
return null !== this.be ? "MapIterator@" + this.be : "MapIterator"
};
function ra(a, b) {
t.zc(this);
this.jb = !1;
void 0 === a || null === a ? this.rh = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.rh = a : t.ha(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.rh = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : t.ha(a, "null, a primitive type name, or a class type", "Map constructor: keytype");
void 0 === b || null === b ? this.Ai = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" ===
b || "function" === b ? this.Ai = b : t.ha(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.Ai = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : t.ha(b, "null, a primitive type name, or a class type", "Map constructor: valtype");
this.Wc = {};
this.kd = 0;
this.qh = null;
this.Wb = 0;
this.sh = this.re = null
}
t.ia("Map", ra);
function Va(a, b) {
null !== a.rh && ("string" === typeof a.rh ? typeof b === a.rh && null !== b || t.Vb(b, a.rh) : b instanceof a.rh || t.Vb(b, a.rh))
}
ra.prototype.Md = function () {
var a = this.Wb;
a++;
999999999 < a && (a = 0);
this.Wb = a
};
ra.prototype.freeze = ra.prototype.freeze = function () {
this.jb = !0;
return this
};
ra.prototype.thaw = ra.prototype.Va = function () {
this.jb = !1;
return this
};
ra.prototype.toString = function () {
return"Map(" + t.Gh(this.rh) + "," + t.Gh(this.Ai) + ")#" + t.oc(this)
};
ra.prototype.add = ra.prototype.set = ra.prototype.add = function (a, b) {
f && (Va(this, a), null !== this.Ai && ("string" === typeof this.Ai ? typeof b === this.Ai && null !== b || t.Vb(b, this.Ai) : b instanceof this.Ai || t.Vb(b, this.Ai)));
t.J(this, a);
var c = a;
t.pb(a) && (c = t.Os(a));
var d = this.Wc[c];
if (void 0 === d)return this.kd++, d = new Pa(a, b), this.Wc[c] = d, c = this.sh, null === c ? this.re = d : (d.io = c, c.Aj = d), this.sh = d, this.Md(), !0;
d.value = b;
return!1
};
ra.prototype.addAll = ra.prototype.Me = function (a) {
if (null === a)return this;
f && t.k(a, ra, ra, "addAll:map");
for (a = a.l; a.next();)this.add(a.key, a.value);
return this
};
ra.prototype.contains = ra.prototype.has = ra.prototype.contains = function (a) {
f && Va(this, a);
var b = a;
return t.pb(a) && (b = t.oc(a), void 0 === b) ? !1 : void 0 !== this.Wc[b]
};
ra.prototype.getValue = ra.prototype.get = ra.prototype.Ba = function (a) {
f && Va(this, a);
var b = a;
if (t.pb(a) && (b = t.oc(a), void 0 === b))return null;
a = this.Wc[b];
return void 0 === a ? null : a.value
};
ra.prototype.remove = ra.prototype["delete"] = ra.prototype.remove = function (a) {
if (null === a)return!1;
f && Va(this, a);
t.J(this, a);
var b = a;
if (t.pb(a) && (b = t.oc(a), void 0 === b))return!1;
a = this.Wc[b];
if (void 0 === a)return!1;
var c = a.Aj, d = a.io;
null !== c && (c.io = d);
null !== d && (d.Aj = c);
this.re === a && (this.re = c);
this.sh === a && (this.sh = d);
delete this.Wc[b];
this.kd--;
this.Md();
return!0
};
ra.prototype.clear = ra.prototype.clear = function () {
t.J(this);
this.Wc = {};
this.kd = 0;
this.sh = this.re = null;
this.Md()
};
ra.prototype.copy = function () {
var a = new ra(this.rh, this.Ai), b = this.Wc, c;
for (c in b) {
var d = b[c];
a.add(d.key, d.value)
}
return a
};
ra.prototype.toArray = ra.prototype.af = function () {
var a = this.Wc, b = Array(this.kd), c = 0, d;
for (d in a) {
var e = a[d];
b[c] = new Pa(e.key, e.value);
c++
}
return b
};
ra.prototype.toKeySet = ra.prototype.Al = function () {
return new Ta(this)
};
t.A(ra, {count: "count"}, function () {
return this.kd
});
t.A(ra, {size: "size"}, function () {
return this.kd
});
t.A(ra, {l: "iterator"}, function () {
if (0 >= this.count)return t.dh;
var a = this.qh;
return null !== a ? (a.reset(), a) : new Ua(this)
});
function C(a, b) {
void 0 === a ? this.M = this.L = 0 : "number" === typeof a && "number" === typeof b ? (this.L = a, this.M = b) : t.m("Invalid arguments to Point constructor")
}
t.ia("Point", C);
t.Eh(C);
t.je(C, {x: !0, y: !0});
C.prototype.assign = function (a) {
this.L = a.L;
this.M = a.M
};
C.prototype.q = function (a, b) {
this.L = a;
this.M = b
};
C.prototype.setTo = C.prototype.Fp = function (a, b) {
f && (t.j(a, "number", C, "setTo:x"), t.j(b, "number", C, "setTo:y"));
t.J(this);
this.L = a;
this.M = b;
return this
};
C.prototype.set = C.prototype.set = function (a) {
f && t.k(a, C, C, "set:p");
t.J(this);
this.L = a.L;
this.M = a.M;
return this
};
C.prototype.copy = function () {
var a = new C;
a.L = this.L;
a.M = this.M;
return a
};
C.prototype.Na = function () {
this.jb = !0;
Object.freeze(this);
return this
};
C.prototype.Z = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
C.prototype.freeze = function () {
this.jb = !0;
return this
};
C.prototype.Va = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.jb = !1;
return this
};
C.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 C(c, e)
}
return new C
};
C.stringify = function (a) {
return a instanceof C ? a.x.toString() + " " + a.y.toString() : a.toString()
};
C.prototype.toString = function () {
return"Point(" + this.x + "," + this.y + ")"
};
C.prototype.equals = C.prototype.N = function (a) {
return a instanceof C ? this.L === a.x && this.M === a.y : !1
};
C.prototype.equalTo = function (a, b) {
return this.L === a && this.M === b
};
C.prototype.ak = function (a) {
return J.Ka(this.L, a.x) && J.Ka(this.M, a.y)
};
C.prototype.Mi = function (a) {
return J.I(this.L, a.x) && J.I(this.M, a.y)
};
C.prototype.add = C.prototype.add = function (a) {
f && t.k(a, C, C, "add:p");
t.J(this);
this.L += a.x;
this.M += a.y;
return this
};
C.prototype.subtract = C.prototype.zt = function (a) {
f && t.k(a, C, C, "subtract:p");
t.J(this);
this.L -= a.x;
this.M -= a.y;
return this
};
C.prototype.offset = C.prototype.offset = function (a, b) {
f && (t.o(a, C, "offset:dx"), t.o(b, C, "offset:dy"));
t.J(this);
this.L += a;
this.M += b;
return this
};
C.prototype.rotate = C.prototype.rotate = function (a) {
f && t.o(a, C, "rotate:angle");
t.J(this);
if (0 === a)return this;
var b = this.L, c = this.M;
if (0 === b && 0 === c)return this;
var d;
90 === a ? (a = 0, d = 1) : 180 === a ? (a = -1, d = 0) : 270 === a ? (a = 0, d = -1) : (d = a * Math.PI / 180, a = Math.cos(d), d = Math.sin(d));
this.L = a * b - d * c;
this.M = d * b + a * c;
return this
};
C.prototype.scale = C.prototype.scale = function (a, b) {
f && (t.o(a, C, "scale:sx"), t.o(b, C, "scale:sy"));
this.L *= a;
this.M *= b;
return this
};
C.prototype.distanceSquaredPoint = C.prototype.Zj = function (a) {
f && t.k(a, C, C, "distanceSquaredPoint:p");
var b = a.x - this.L;
a = a.y - this.M;
return b * b + a * a
};
C.prototype.distanceSquared = C.prototype.Es = function (a, b) {
f && (t.o(a, C, "distanceSquared:px"), t.o(b, C, "distanceSquared:py"));
var c = a - this.L, d = b - this.M;
return c * c + d * d
};
C.prototype.normalize = C.prototype.normalize = function () {
t.J(this);
var a = this.L, b = this.M, c = Math.sqrt(a * a + b * b);
0 < c && (this.L = a / c, this.M = b / c);
return this
};
C.prototype.directionPoint = C.prototype.Ji = function (a) {
f && t.k(a, C, C, "directionPoint:p");
return Wa(a.x - this.L, a.y - this.M)
};
C.prototype.direction = C.prototype.direction = function (a, b) {
f && (t.o(a, C, "direction:px"), t.o(b, C, "direction:py"));
return Wa(a - this.L, b - this.M)
};
function Wa(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
}
C.prototype.projectOntoLineSegment = function (a, b, c, d) {
f && (t.o(a, C, "projectOntoLineSegment:px"), t.o(b, C, "projectOntoLineSegment:py"), t.o(c, C, "projectOntoLineSegment:qx"), t.o(d, C, "projectOntoLineSegment:qy"));
J.Ym(a, b, c, d, this.L, this.M, this);
return this
};
C.prototype.projectOntoLineSegmentPoint = function (a, b) {
f && (t.k(a, C, C, "projectOntoLineSegmentPoint:p"), t.k(b, C, C, "projectOntoLineSegmentPoint:q"));
J.Ym(a.x, a.y, b.x, b.y, this.L, this.M, this);
return this
};
C.prototype.snapToGrid = function (a, b, c, d) {
f && (t.o(a, C, "snapToGrid:originx"), t.o(b, C, "snapToGrid:originy"), t.o(c, C, "snapToGrid:cellwidth"), t.o(d, C, "snapToGrid:cellheight"));
J.Gs(this.L, this.M, a, b, c, d, this);
return this
};
C.prototype.snapToGridPoint = function (a, b) {
f && (t.k(a, C, C, "snapToGridPoint:p"), t.k(b, oa, C, "snapToGridPoint:q"));
J.Gs(this.L, this.M, a.x, a.y, b.width, b.height, this);
return this
};
C.prototype.setRectSpot = C.prototype.vt = function (a, b) {
f && (t.k(a, D, C, "setRectSpot:r"), t.k(b, K, C, "setRectSpot:spot"));
t.J(this);
this.L = a.x + b.x * a.width + b.offsetX;
this.M = a.y + b.y * a.height + b.offsetY;
return this
};
C.prototype.setSpot = C.prototype.wt = function (a, b, c, d, e) {
f && (t.o(a, C, "setSpot:x"), t.o(b, C, "setSpot:y"), t.o(c, C, "setSpot:w"), t.o(d, C, "setSpot:h"), (0 > c || 0 > d) && t.m("Point.setSpot:Width and height cannot be negative"), t.k(e, K, C, "setSpot:spot"));
t.J(this);
this.L = a + e.x * c + e.offsetX;
this.M = b + e.y * d + e.offsetY;
return this
};
C.prototype.transform = function (a) {
f && t.k(a, pa, C, "transform:t");
a.Wa(this);
return this
};
function Xa(a, b) {
f && t.k(b, pa, C, "transformInverted:t");
b.Pi(a);
return a
}
var ab;
C.distanceLineSegmentSquared = ab = function (a, b, c, d, e, g) {
f && (t.o(a, C, "distanceLineSegmentSquared:px"), t.o(b, C, "distanceLineSegmentSquared:py"), t.o(c, C, "distanceLineSegmentSquared:ax"), t.o(d, C, "distanceLineSegmentSquared:ay"), t.o(e, C, "distanceLineSegmentSquared:bx"), t.o(g, C, "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 db;
C.distanceSquared = db = function (a, b, c, d) {
f && (t.o(a, C, "distanceSquared:px"), t.o(b, C, "distanceSquared:py"), t.o(c, C, "distanceSquared:qx"), t.o(d, C, "distanceSquared:qy"));
a = c - a;
b = d - b;
return a * a + b * b
};
var eb;
C.direction = eb = function (a, b, c, d) {
f && (t.o(a, C, "direction:px"), t.o(b, C, "direction:py"), t.o(c, C, "direction:qx"), t.o(d, C, "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
};
t.g(C, "x", C.prototype.x);
t.defineProperty(C, {x: "x"}, function () {
return this.L
}, function (a) {
t.J(this, a);
f && t.j(a, "number", C, "x");
this.L = a
});
t.g(C, "y", C.prototype.y);
t.defineProperty(C, {y: "y"}, function () {
return this.M
}, function (a) {
t.J(this, a);
f && t.j(a, "number", C, "y");
this.M = a
});
C.prototype.isReal = C.prototype.Q = function () {
return isFinite(this.x) && isFinite(this.y)
};
function oa(a, b) {
void 0 === a ? this.wa = this.xa = 0 : "number" === typeof a && (0 <= a || isNaN(a)) && "number" === typeof b && (0 <= b || isNaN(b)) ? (this.xa = a, this.wa = b) : t.m("Invalid arguments to Size constructor")
}
t.ia("Size", oa);
t.Eh(oa);
t.je(oa, {width: !0, height: !0});
oa.prototype.assign = function (a) {
this.xa = a.xa;
this.wa = a.wa
};
oa.prototype.q = function (a, b) {
this.xa = a;
this.wa = b
};
oa.prototype.setTo = oa.prototype.Fp = function (a, b) {
f && (t.j(a, "number", oa, "setTo:w"), t.j(b, "number", oa, "setTo:h"));
0 > a && t.ha(a, ">= 0", oa, "setTo:w");
0 > b && t.ha(b, ">= 0", oa, "setTo:h");
t.J(this);
this.xa = a;
this.wa = b;
return this
};
oa.prototype.set = oa.prototype.set = function (a) {
f && t.k(a, oa, oa, "set:s");
t.J(this);
this.xa = a.xa;
this.wa = a.wa;
return this
};
oa.prototype.copy = function () {
var a = new oa;
a.xa = this.xa;
a.wa = this.wa;
return a
};
oa.prototype.Na = function () {
this.jb = !0;
Object.freeze(this);
return this
};
oa.prototype.Z = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
oa.prototype.freeze = function () {
this.jb = !0;
return this
};
oa.prototype.Va = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.jb = !1;
return this
};
oa.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 oa(c, e)
}
return new oa
};
oa.stringify = function (a) {
return a instanceof oa ? a.width.toString() + " " + a.height.toString() : a.toString()
};
oa.prototype.toString = function () {
return"Size(" + this.width + "," + this.height + ")"
};
oa.prototype.equals = oa.prototype.N = function (a) {
return a instanceof oa ? this.xa === a.width && this.wa === a.height : !1
};
oa.prototype.equalTo = function (a, b) {
return this.xa === a && this.wa === b
};
oa.prototype.ak = function (a) {
return J.Ka(this.xa, a.width) && J.Ka(this.wa, a.height)
};
oa.prototype.Mi = function (a) {
return J.I(this.xa, a.width) && J.I(this.wa, a.height)
};
t.g(oa, "width", oa.prototype.width);
t.defineProperty(oa, {width: "width"}, function () {
return this.xa
}, function (a) {
t.J(this, a);
f && t.j(a, "number", oa, "width");
0 > a && t.ha(a, ">= 0", oa, "width");
this.xa = a
});
t.g(oa, "height", oa.prototype.height);
t.defineProperty(oa, {height: "height"}, function () {
return this.wa
}, function (a) {
t.J(this, a);
f && t.j(a, "number", oa, "height");
0 > a && t.ha(a, ">= 0", oa, "height");
this.wa = a
});
oa.prototype.isReal = oa.prototype.Q = function () {
return isFinite(this.width) && isFinite(this.height)
};
function D(a, b, c, d) {
void 0 === a ? this.wa = this.xa = this.M = this.L = 0 : a instanceof C ? b instanceof C ? (this.L = Math.min(a.L, b.L), this.M = Math.min(a.M, b.M), this.xa = Math.abs(a.L - b.L), this.wa = Math.abs(a.M - b.M)) : b instanceof oa ? (this.L = a.L, this.M = a.M, this.xa = b.xa, this.wa = b.wa) : t.m("Incorrect arguments supplied") : "number" === typeof a && "number" === typeof b && "number" === typeof c && (0 <= c || isNaN(c)) && "number" === typeof d && (0 <= d || isNaN(d)) ? (this.L = a, this.M = b, this.xa = c, this.wa = d) : t.m("Invalid arguments to Rect constructor")
}
t.ia("Rect", D);
t.Eh(D);
t.je(D, {x: !0, y: !0, width: !0, height: !0});
D.prototype.assign = function (a) {
this.L = a.L;
this.M = a.M;
this.xa = a.xa;
this.wa = a.wa
};
D.prototype.q = function (a, b, c, d) {
this.L = a;
this.M = b;
this.xa = c;
this.wa = d
};
function nb(a, b, c) {
a.xa = b;
a.wa = c
}
D.prototype.setTo = D.prototype.Fp = function (a, b, c, d) {
f && (t.j(a, "number", D, "setTo:x"), t.j(b, "number", D, "setTo:y"), t.j(c, "number", D, "setTo:w"), t.j(d, "number", D, "setTo:h"));
0 > c && t.ha(c, ">= 0", D, "setTo:w");
0 > d && t.ha(d, ">= 0", D, "setTo:h");
t.J(this);
this.L = a;
this.M = b;
this.xa = c;
this.wa = d;
return this
};
D.prototype.set = D.prototype.set = function (a) {
f && t.k(a, D, D, "set:r");
t.J(this);
this.L = a.L;
this.M = a.M;
this.xa = a.xa;
this.wa = a.wa;
return this
};
D.prototype.setPoint = D.prototype.vf = function (a) {
f && t.k(a, C, D, "setPoint:p");
t.J(this);
this.L = a.L;
this.M = a.M;
return this
};
D.prototype.setSize = function (a) {
f && t.k(a, oa, D, "setSize:s");
t.J(this);
this.xa = a.xa;
this.wa = a.wa;
return this
};
D.prototype.copy = function () {
var a = new D;
a.L = this.L;
a.M = this.M;
a.xa = this.xa;
a.wa = this.wa;
return a
};
D.prototype.Na = function () {
this.jb = !0;
Object.freeze(this);
return this
};
D.prototype.Z = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
D.prototype.freeze = function () {
this.jb = !0;
return this
};
D.prototype.Va = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.jb = !1;
return this
};
D.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 D(c, e, g, h)
}
return new D
};
D.stringify = function (a) {
return a instanceof D ? a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() : a.toString()
};
D.prototype.toString = function () {
return"Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")"
};
D.prototype.equals = D.prototype.N = function (a) {
return a instanceof D ? this.L === a.x && this.M === a.y && this.xa === a.width && this.wa === a.height : !1
};
D.prototype.equalTo = function (a, b, c, d) {
return this.L === a && this.M === b && this.xa === c && this.wa === d
};
D.prototype.ak = function (a) {
return J.Ka(this.L, a.x) && J.Ka(this.M, a.y) && J.Ka(this.xa, a.width) && J.Ka(this.wa, a.height)
};
D.prototype.Mi = function (a) {
return J.I(this.L, a.x) && J.I(this.M, a.y) && J.I(this.xa, a.width) && J.I(this.wa, a.height)
};
D.prototype.containsPoint = D.prototype.Ha = function (a) {
f && t.k(a, C, D, "containsPoint:p");
return this.L <= a.x && this.L + this.xa >= a.x && this.M <= a.y && this.M + this.wa >= a.y
};
D.prototype.containsRect = D.prototype.Vj = function (a) {
f && t.k(a, D, D, "containsRect:r");
return this.L <= a.x && a.x + a.width <= this.L + this.xa && this.M <= a.y && a.y + a.height <= this.M + this.wa
};
D.prototype.contains = D.prototype.contains = function (a, b, c, d) {
f ? (t.o(a, D, "contains:x"), t.o(b, D, "contains:y"), void 0 === c ? c = 0 : t.o(c, D, "contains:w"), void 0 === d ? d = 0 : t.o(d, D, "contains:h"), (0 > c || 0 > d) && t.m("Rect.contains:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
return this.L <= a && a + c <= this.L + this.xa && this.M <= b && b + d <= this.M + this.wa
};
D.prototype.reset = function () {
t.J(this);
this.wa = this.xa = this.M = this.L = 0
};
D.prototype.offset = D.prototype.offset = function (a, b) {
f && (t.o(a, D, "offset:dx"), t.o(b, D, "offset:dy"));
t.J(this);
this.L += a;
this.M += b;
return this
};
D.prototype.inflate = D.prototype.Ug = function (a, b) {
f && (t.o(a, D, "inflate:w"), t.o(b, D, "inflate:h"));
return qb(this, b, a, b, a)
};
D.prototype.addMargin = D.prototype.Cv = function (a) {
f && t.k(a, rb, D, "addMargin:m");
return qb(this, a.top, a.right, a.bottom, a.left)
};
D.prototype.subtractMargin = D.prototype.hJ = function (a) {
f && t.k(a, rb, D, "subtractMargin:m");
return qb(this, -a.top, -a.right, -a.bottom, -a.left)
};
D.prototype.grow = function (a, b, c, d) {
f && (t.o(a, D, "grow:t"), t.o(b, D, "grow:r"), t.o(c, D, "grow:b"), t.o(d, D, "grow:l"));
return qb(this, a, b, c, d)
};
function qb(a, b, c, d, e) {
t.J(a);
var g = a.xa;
c + e <= -g ? (a.L += g / 2, a.xa = 0) : (a.L -= e, a.xa += c + e);
c = a.wa;
b + d <= -c ? (a.M += c / 2, a.wa = 0) : (a.M -= b, a.wa += b + d);
return a
}
D.prototype.intersectRect = function (a) {
f && t.k(a, D, D, "intersectRect:r");
return sb(this, a.x, a.y, a.width, a.height)
};
D.prototype.intersect = function (a, b, c, d) {
f && (t.o(a, D, "intersect:x"), t.o(b, D, "intersect:y"), t.o(c, D, "intersect:w"), t.o(d, D, "intersect:h"), (0 > c || 0 > d) && t.m("Rect.intersect:Width and height cannot be negative"));
return sb(this, a, b, c, d)
};
function sb(a, b, c, d, e) {
t.J(a);
var g = Math.max(a.L, b), h = Math.max(a.M, c);
b = Math.min(a.L + a.xa, b + d);
c = Math.min(a.M + a.wa, c + e);
a.L = g;
a.M = h;
a.xa = Math.max(0, b - g);
a.wa = Math.max(0, c - h);
return a
}
D.prototype.intersectsRect = D.prototype.Jf = function (a) {
f && t.k(a, D, D, "intersectsRect:r");
return this.wE(a.x, a.y, a.width, a.height)
};
D.prototype.intersects = D.prototype.wE = function (a, b, c, d) {
f && (t.o(a, D, "intersects:x"), t.o(b, D, "intersects:y"), t.o(a, D, "intersects:w"), t.o(b, D, "intersects:h"), (0 > c || 0 > d) && t.m("Rect.intersects:Width and height cannot be negative"));
var e = this.xa, g = this.L;
if (Infinity !== e && Infinity !== c && (e += g, c += a, isNaN(c) || isNaN(e) || g > c || a > e))return!1;
a = this.wa;
c = this.M;
return Infinity !== a && Infinity !== d && (a += c, d += b, isNaN(d) || isNaN(a) || c > d || b > a) ? !1 : !0
};
function wb(a, b) {
var c = a.xa, d = b.width + 10 + 10, e = a.L, g = b.x - 10;
if (e > d + g || g > c + e)return!1;
c = a.wa;
d = b.height + 10 + 10;
e = a.M;
g = b.y - 10;
return e > d + g || g > c + e ? !1 : !0
}
D.prototype.unionPoint = D.prototype.Zi = function (a) {
f && t.k(a, C, D, "unionPoint:p");
return xb(this, a.x, a.y, 0, 0)
};
D.prototype.unionRect = D.prototype.mk = function (a) {
f && t.k(a, D, D, "unionRect:r");
return xb(this, a.L, a.M, a.xa, a.wa)
};
D.prototype.union = D.prototype.ZF = function (a, b, c, d) {
t.J(this);
f ? (t.o(a, D, "union:x"), t.o(b, D, "union:y"), void 0 === c ? c = 0 : t.o(c, D, "union:w"), void 0 === d ? d = 0 : t.o(d, D, "union:h"), (0 > c || 0 > d) && t.m("Rect.union:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
return xb(this, a, b, c, d)
};
function xb(a, b, c, d, e) {
var g = Math.min(a.L, b), h = Math.min(a.M, c);
b = Math.max(a.L + a.xa, b + d);
c = Math.max(a.M + a.wa, c + e);
a.L = g;
a.M = h;
a.xa = b - g;
a.wa = c - h;
return a
}
D.prototype.setSpot = D.prototype.wt = function (a, b, c) {
f && (t.o(a, D, "setSpot:x"), t.o(b, D, "setSpot:y"), t.k(c, K, D, "setSpot:spot"));
t.J(this);
this.L = a - c.offsetX - c.x * this.xa;
this.M = b - c.offsetY - c.y * this.wa;
return this
};
var yb;
D.contains = yb = function (a, b, c, d, e, g, h, k) {
f ? (t.o(a, D, "contains:rx"), t.o(b, D, "contains:ry"), t.o(c, D, "contains:rw"), t.o(d, D, "contains:rh"), t.o(e, D, "contains:x"), t.o(g, D, "contains:y"), void 0 === h ? h = 0 : t.o(h, D, "contains:w"), void 0 === k ? k = 0 : t.o(k, D, "contains:h"), (0 > c || 0 > d || 0 > h || 0 > k) && t.m("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
};
D.intersects = function (a, b, c, d, e, g, h, k) {
f && (t.o(a, D, "intersects:rx"), t.o(b, D, "intersects:ry"), t.o(c, D, "intersects:rw"), t.o(d, D, "intersects:rh"), t.o(e, D, "intersects:x"), t.o(g, D, "intersects:y"), t.o(h, D, "intersects:w"), t.o(k, D, "intersects:h"), (0 > c || 0 > d || 0 > h || 0 > k) && t.m("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
};
t.g(D, "x", D.prototype.x);
t.defineProperty(D, {x: "x"}, function () {
return this.L
}, function (a) {
t.J(this, a);
f && t.j(a, "number", D, "x");
this.L = a
});
t.g(D, "y", D.prototype.y);
t.defineProperty(D, {y: "y"}, function () {
return this.M
}, function (a) {
t.J(this, a);
f && t.j(a, "number", D, "y");
this.M = a
});
t.g(D, "width", D.prototype.width);
t.defineProperty(D, {width: "width"}, function () {
return this.xa
}, function (a) {
t.J(this, a);
f && t.j(a, "number", D, "width");
0 > a && t.ha(a, ">= 0", D, "width");
this.xa = a
});
t.g(D, "height", D.prototype.height);
t.defineProperty(D, {height: "height"}, function () {
return this.wa
}, function (a) {
t.J(this, a);
f && t.j(a, "number", D, "height");
0 > a && t.ha(a, ">= 0", D, "height");
this.wa = a
});
t.g(D, "left", D.prototype.left);
t.defineProperty(D, {left: "left"}, function () {
return this.L
}, function (a) {
t.J(this, a);
f && t.j(a, "number", D, "left");
this.L = a
});
t.g(D, "top", D.prototype.top);
t.defineProperty(D, {top: "top"}, function () {
return this.M
}, function (a) {
t.J(this, a);
f && t.j(a, "number", D, "top");
this.M = a
});
t.g(D, "right", D.prototype.right);
t.defineProperty(D, {right: "right"}, function () {
return this.L + this.xa
}, function (a) {
t.J(this, a);
f && t.o(a, D, "right");
this.L += a - (this.L + this.xa)
});
t.g(D, "bottom", D.prototype.bottom);
t.defineProperty(D, {bottom: "bottom"}, function () {
return this.M + this.wa
}, function (a) {
t.J(this, a);
f && t.o(a, D, "top");
this.M += a - (this.M + this.wa)
});
t.g(D, "position", D.prototype.position);
t.defineProperty(D, {position: "position"}, function () {
return new C(this.L, this.M)
}, function (a) {
t.J(this, a);
f && t.k(a, C, D, "position");
this.L = a.x;
this.M = a.y
});
t.g(D, "size", D.prototype.size);
t.defineProperty(D, {size: "size"}, function () {
return new oa(this.xa, this.wa)
}, function (a) {
t.J(this, a);
f && t.k(a, oa, D, "size");
this.xa = a.width;
this.wa = a.height
});
t.g(D, "center", D.prototype.Gz);
t.defineProperty(D, {Gz: "center"}, function () {
return new C(this.L + this.xa / 2, this.M + this.wa / 2)
}, function (a) {
t.J(this, a);
f && t.k(a, C, D, "center");
this.L = a.x - this.xa / 2;
this.M = a.y - this.wa / 2
});
t.g(D, "centerX", D.prototype.Fa);
t.defineProperty(D, {Fa: "centerX"}, function () {
return this.L + this.xa / 2
}, function (a) {
t.J(this, a);
f && t.o(a, D, "centerX");
this.L = a - this.xa / 2
});
t.g(D, "centerY", D.prototype.Sa);
t.defineProperty(D, {Sa: "centerY"}, function () {
return this.M + this.wa / 2
}, function (a) {
t.J(this, a);
f && t.o(a, D, "centerY");
this.M = a - this.wa / 2
});
D.prototype.isReal = D.prototype.Q = function () {
return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height)
};
D.prototype.isEmpty = function () {
return 0 === this.width && 0 === this.height
};
function rb(a, b, c, d) {
void 0 === a ? this.ag = this.Tf = this.eg = this.hg = 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) : t.m("Invalid arguments to Margin constructor")
}
t.ia("Margin", rb);
t.Eh(rb);
t.je(rb, {top: !0, right: !0, bottom: !0, left: !0});
rb.prototype.assign = function (a) {
this.hg = a.hg;
this.eg = a.eg;
this.Tf = a.Tf;
this.ag = a.ag
};
rb.prototype.setTo = rb.prototype.Fp = function (a, b, c, d) {
f && (t.j(a, "number", rb, "setTo:t"), t.j(b, "number", rb, "setTo:r"), t.j(c, "number", rb, "setTo:b"), t.j(d, "number", rb, "setTo:l"));
t.J(this);
this.hg = a;
this.eg = b;
this.Tf = c;
this.ag = d;
return this
};
rb.prototype.set = rb.prototype.set = function (a) {
f && t.k(a, rb, rb, "assign:m");
t.J(this);
this.hg = a.hg;
this.eg = a.eg;
this.Tf = a.Tf;
this.ag = a.ag;
return this
};
rb.prototype.copy = function () {
var a = new rb;
a.hg = this.hg;
a.eg = this.eg;
a.Tf = this.Tf;
a.ag = this.ag;
return a
};
rb.prototype.Na = function () {
this.jb = !0;
Object.freeze(this);
return this
};
rb.prototype.Z = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
rb.prototype.freeze = function () {
this.jb = !0;
return this
};
rb.prototype.Va = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.jb = !1;
return this
};
rb.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 = void 0; "" === a[b];)b++;
(d = a[b++]) && (e = parseFloat(d));
for (var g = void 0; "" === a[b];)b++;
(d = a[b++]) && (g = parseFloat(d));
for (var h = void 0; "" === a[b];)b++;
(d = a[b++]) && (h = parseFloat(d));
return new rb(c, e, g, h)
}
return new rb
};
rb.stringify = function (a) {
return a instanceof rb ? a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() : a.toString()
};
rb.prototype.toString = function () {
return"Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")"
};
rb.prototype.equals = rb.prototype.N = function (a) {
return a instanceof rb ? this.hg === a.top && this.eg === a.right && this.Tf === a.bottom && this.ag === a.left : !1
};
rb.prototype.equalTo = function (a, b, c, d) {
return this.hg === a && this.eg === b && this.Tf === c && this.ag === d
};
rb.prototype.ak = function (a) {
return J.Ka(this.hg, a.top) && J.Ka(this.eg, a.right) && J.Ka(this.Tf, a.bottom) && J.Ka(this.ag, a.left)
};
rb.prototype.Mi = function (a) {
return J.I(this.hg, a.top) && J.I(this.eg, a.right) && J.I(this.Tf, a.bottom) && J.I(this.ag, a.left)
};
t.g(rb, "top", rb.prototype.top);
t.defineProperty(rb, {top: "top"}, function () {
return this.hg
}, function (a) {
t.J(this, a);
f && t.o(a, rb, "top");
this.hg = a
});
t.g(rb, "right", rb.prototype.right);
t.defineProperty(rb, {right: "right"}, function () {
return this.eg
}, function (a) {
t.J(this, a);
f && t.o(a, rb, "right");
this.eg = a
});
t.g(rb, "bottom", rb.prototype.bottom);
t.defineProperty(rb, {bottom: "bottom"}, function () {
return this.Tf
}, function (a) {
t.J(this, a);
f && t.o(a, rb, "bottom");
this.Tf = a
});
t.g(rb, "left", rb.prototype.left);
t.defineProperty(rb, {left: "left"}, function () {
return this.ag
}, function (a) {
t.J(this, a);
f && t.o(a, rb, "left");
this.ag = a
});
rb.prototype.isReal = rb.prototype.Q = function () {
return isFinite(this.top) && isFinite(this.right) && isFinite(this.bottom) && isFinite(this.left)
};
function pa() {
this.m11 = 1;
this.m21 = this.m12 = 0;
this.m22 = 1;
this.dy = this.dx = 0
}
t.Eh(pa);
t.je(pa, {m11: !0, m12: !0, m21: !0, m22: !0, dx: !0, dy: !0});
pa.prototype.set = pa.prototype.set = function (a) {
f && t.k(a, pa, pa, "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
};
pa.prototype.copy = function () {
var a = new pa;
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
};
pa.prototype.toString = function () {
return"Transform(" + this.m11 + "," + this.m12 + "," + this.m21 + "," + this.m22 + "," + this.dx + "," + this.dy + ")"
};
pa.prototype.equals = pa.prototype.N = function (a) {
return a instanceof pa ? 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
};
pa.prototype.reset = pa.prototype.reset = function () {
this.m11 = 1;
this.m21 = this.m12 = 0;
this.m22 = 1;
this.dy = this.dx = 0
};
pa.prototype.multiply = pa.prototype.multiply = function (a) {
f && t.k(a, pa, pa, "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
};
pa.prototype.multiplyInverted = pa.prototype.xA = function (a) {
f && t.k(a, pa, pa, "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
};
pa.prototype.invert = pa.prototype.iA = 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
};
pa.prototype.rotate = pa.prototype.rotate = function (a, b, c) {
f && (t.o(a, pa, "rotate:angle"), t.o(b, pa, "rotate:rx"), t.o(c, pa, "rotate:ry"));
this.translate(b, c);
var d;
0 === a ? (a = 1, d = 0) : 90 === a ? (a = 0, d = 1) : 180 === a ? (a = -1, d = 0) : 270 === a ? (a = 0, d = -1) : (d = a * Math.PI / 180, a = Math.cos(d), d = Math.sin(d));
var e = this.m12 * a + this.m22 * d, g = this.m11 * -d + this.m21 * a, h = this.m12 * -d + this.m22 * a;
this.m11 = this.m11 * a + this.m21 * d;
this.m12 = e;
this.m21 = g;
this.m22 = h;
this.translate(-b, -c)
};
pa.prototype.translate = pa.prototype.translate = function (a, b) {
f && (t.o(a, pa, "translate:x"), t.o(b, pa, "translate:y"));
this.dx += this.m11 * a + this.m21 * b;
this.dy += this.m12 * a + this.m22 * b
};
pa.prototype.scale = pa.prototype.scale = function (a, b) {
void 0 === b && (b = a);
f && (t.o(a, pa, "translate:sx"), t.o(b, pa, "translate:sy"));
this.m11 *= a;
this.m12 *= a;
this.m21 *= b;
this.m22 *= b
};
pa.prototype.transformPoint = pa.prototype.Wa = function (a) {
f && t.k(a, C, pa, "transformPoint:p");
var b = a.L, c = a.M;
a.L = b * this.m11 + c * this.m21 + this.dx;
a.M = b * this.m12 + c * this.m22 + this.dy;
return a
};
pa.prototype.invertedTransformPoint = pa.prototype.Pi = function (a) {
f && t.k(a, C, pa, "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.L, h = a.M;
a.L = g * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx);
a.M = g * c + h * d + e;
return a
};
pa.prototype.transformRect = pa.prototype.UF = function (a) {
f && t.k(a, D, pa, "transformRect:rect");
var b = a.L, c = a.M, d = b + a.xa, e = c + a.wa, 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.L = p;
a.M = h;
a.xa =
e - p;
a.wa = q - h
};
pa.prototype.isIdentity = pa.prototype.Ts = function () {
return 1 === this.m11 && 0 === this.m12 && 0 === this.m21 && 1 === this.m22 && 0 === this.dx && 0 === this.dy
};
function K(a, b, c, d) {
void 0 === a ? this.dg = this.cg = this.M = this.L = 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)
}
t.ia("Spot", K);
t.Eh(K);
t.je(K, {x: !0, y: !0, offsetX: !0, offsetY: !0});
K.prototype.assign = function (a) {
this.L = a.L;
this.M = a.M;
this.cg = a.cg;
this.dg = a.dg
};
K.prototype.setTo = K.prototype.Fp = function (a, b, c, d) {
f && (Eb(a, "setTo:x"), Eb(b, "setTo:y"), Gb(c, "setTo:offx"), Gb(d, "setTo:offy"));
t.J(this);
this.L = a;
this.M = b;
this.cg = c;
this.dg = d;
return this
};
K.prototype.set = K.prototype.set = function (a) {
f && t.k(a, K, K, "set:s");
t.J(this);
this.L = a.L;
this.M = a.M;
this.cg = a.cg;
this.dg = a.dg;
return this
};
K.prototype.copy = function () {
var a = new K;
a.L = this.L;
a.M = this.M;
a.cg = this.cg;
a.dg = this.dg;
return a
};
K.prototype.Na = function () {
this.jb = !0;
Object.freeze(this);
return this
};
K.prototype.Z = function () {
return Object.isFrozen(this) ? this : this.copy().freeze()
};
K.prototype.freeze = function () {
this.jb = !0;
return this
};
K.prototype.Va = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.jb = !1;
return this
};
function Hb(a, b) {
a.L = NaN;
a.M = NaN;
a.cg = b;
return a
}
function Eb(a, b) {
(isNaN(a) || 1 < a || 0 > a) && t.ha(a, "0 <= " + b + " <= 1", K, b)
}
function Gb(a, b) {
(isNaN(a) || Infinity === a || -Infinity === a) && t.ha(a, "real number, not NaN or Infinity", K, b)
}
var Jb;
K.parse = Jb = function (a) {
if ("string" === typeof a) {
a = a.trim();
if ("None" === a)return t.NONE;
if ("TopLeft" === a)return t.px;
if ("Top" === a || "TopCenter" === a || "MiddleTop" === a)return t.Tp;
if ("TopRight" === a)return t.sx;
if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a)return t.Qp;
if ("Center" === a)return t.ax;
if ("Right" === a || "RightCenter" === a || "MiddleRight" === a)return t.Rp;
if ("BottomLeft" === a)return t.Ww;
if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a)return t.Pp;
if ("BottomRight" === a)return t.Yw;
if ("TopSide" ===
a)return t.ux;
if ("LeftSide" === a)return t.hx;
if ("RightSide" === a)return t.nx;
if ("BottomSide" === a)return t.$w;
if ("TopBottomSides" === a)return t.ox;
if ("LeftRightSides" === a)return t.gx;
if ("TopLeftSides" === a)return t.qx;
if ("TopRightSides" === a)return t.tx;
if ("BottomLeftSides" === a)return t.Xw;
if ("BottomRightSides" === a)return t.Zw;
if ("NotTopSide" === a)return t.lx;
if ("NotLeftSide" === a)return t.jx;
if ("NotRightSide" === a)return t.kx;
if ("NotBottomSide" === a)return t.ix;
if ("AllSides" === a)return t.Vw;
if ("Default" ===
a)return t.bx;
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 K(c, e, g, h)
}
return new K
};
K.stringify = function (a) {
return a instanceof K ? a.qd() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() : a.toString()
};
K.prototype.toString = function () {
return this.qd() ? 0 === this.cg && 0 === this.dg ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.N(t.NONE) ? "None" : this.N(t.px) ? "TopLeft" : this.N(t.Tp) ? "Top" : this.N(t.sx) ? "TopRight" : this.N(t.Qp) ? "Left" : this.N(t.ax) ? "Center" : this.N(t.Rp) ? "Right" : this.N(t.Ww) ? "BottomLeft" : this.N(t.Pp) ? "Bottom" : this.N(t.Yw) ? "BottomRight" : this.N(t.ux) ? "TopSide" : this.N(t.hx) ? "LeftSide" : this.N(t.nx) ? "RightSide" : this.N(t.$w) ? "BottomSide" : this.N(t.ox) ?
"TopBottomSides" : this.N(t.gx) ? "LeftRightSides" : this.N(t.qx) ? "TopLeftSides" : this.N(t.tx) ? "TopRightSides" : this.N(t.Xw) ? "BottomLeftSides" : this.N(t.Zw) ? "BottomRightSides" : this.N(t.lx) ? "NotTopSide" : this.N(t.jx) ? "NotLeftSide" : this.N(t.kx) ? "NotRightSide" : this.N(t.ix) ? "NotBottomSide" : this.N(t.Vw) ? "AllSides" : this.N(t.bx) ? "Default" : "None"
};
K.prototype.equals = K.prototype.N = function (a) {
return a instanceof K ? (this.L === a.x || isNaN(this.L) && isNaN(a.x)) && (this.M === a.y || isNaN(this.M) && isNaN(a.y)) && this.cg === a.offsetX && this.dg === a.offsetY : !1
};
K.prototype.opposite = function () {
return new K(0.5 - (this.L - 0.5), 0.5 - (this.M - 0.5), -this.cg, -this.dg)
};
K.prototype.includesSide = function (a) {
if (!this.dp() || !a.dp())return!1;
a = a.offsetY;
return(this.dg & a) === a
};
t.g(K, "x", K.prototype.x);
t.defineProperty(K, {x: "x"}, function () {
return this.L
}, function (a) {
t.J(this, a);
f && Eb(a, "x");
this.L = a
});
t.g(K, "y", K.prototype.y);
t.defineProperty(K, {y: "y"}, function () {
return this.M
}, function (a) {
t.J(this, a);
f && Eb(a, "y");
this.M = a
});
t.g(K, "offsetX", K.prototype.offsetX);
t.defineProperty(K, {offsetX: "offsetX"}, function () {
return this.cg
}, function (a) {
t.J(this, a);
f && Gb(a, "offsetX");
this.cg = a
});
t.g(K, "offsetY", K.prototype.offsetY);
t.defineProperty(K, {offsetY: "offsetY"}, function () {
return this.dg
}, function (a) {
t.J(this, a);
f && Gb(a, "offsetY");
this.dg = a
});
K.prototype.isSpot = K.prototype.qd = function () {
return!isNaN(this.x) && !isNaN(this.y)
};
K.prototype.isNoSpot = K.prototype.pd = function () {
return isNaN(this.x) || isNaN(this.y)
};
K.prototype.isSide = K.prototype.dp = function () {
return this.pd() && 1 === this.offsetX && 0 !== this.offsetY
};
K.prototype.isDefault = K.prototype.Gc = function () {
return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY
};
t.Fd = 1;
t.gd = 2;
t.td = 4;
t.sd = 8;
t.NONE = Hb(new K(0, 0, 0, 0), 0).Na();
t.bx = Hb(new K(0, 0, -1, 0), -1).Na();
t.px = (new K(0, 0, 0, 0)).Na();
t.Tp = (new K(0.5, 0, 0, 0)).Na();
t.sx = (new K(1, 0, 0, 0)).Na();
t.Qp = (new K(0, 0.5, 0, 0)).Na();
t.ax = (new K(0.5, 0.5, 0, 0)).Na();
t.Rp = (new K(1, 0.5, 0, 0)).Na();
t.Ww = (new K(0, 1, 0, 0)).Na();
t.Pp = (new K(0.5, 1, 0, 0)).Na();
t.Yw = (new K(1, 1, 0, 0)).Na();
t.ux = Hb(new K(0, 0, 1, t.Fd), 1).Na();
t.hx = Hb(new K(0, 0, 1, t.gd), 1).Na();
t.nx = Hb(new K(0, 0, 1, t.td), 1).Na();
t.$w = Hb(new K(0, 0, 1, t.sd), 1).Na();
t.ox = Hb(new K(0, 0, 1, t.Fd | t.sd), 1).Na();
t.gx = Hb(new K(0, 0, 1, t.gd | t.td), 1).Na();
t.qx = Hb(new K(0, 0, 1, t.Fd | t.gd), 1).Na();
t.tx = Hb(new K(0, 0, 1, t.Fd | t.td), 1).Na();
t.Xw = Hb(new K(0, 0, 1, t.sd | t.gd), 1).Na();
t.Zw = Hb(new K(0, 0, 1, t.sd | t.td), 1).Na();
t.lx = Hb(new K(0, 0, 1, t.gd | t.td | t.sd), 1).Na();
t.jx = Hb(new K(0, 0, 1, t.Fd | t.td | t.sd), 1).Na();
t.kx = Hb(new K(0, 0, 1, t.Fd | t.gd | t.sd), 1).Na();
t.ix = Hb(new K(0, 0, 1, t.Fd | t.gd | t.td), 1).Na();
t.Vw = Hb(new K(0, 0, 1, t.Fd | t.gd | t.td | t.sd), 1).Na();
var Kb;
K.None = Kb = t.NONE;
var Pb;
K.Default = Pb = t.bx;
var Qb;
K.TopLeft = Qb = t.px;
var Sb;
K.TopCenter = Sb = t.Tp;
var Tb;
K.TopRight = Tb = t.sx;
K.LeftCenter = t.Qp;
var Ub;
K.Center = Ub = t.ax;
K.RightCenter = t.Rp;
var Vb;
K.BottomLeft = Vb = t.Ww;
var Wb;
K.BottomCenter = Wb = t.Pp;
var Zb;
K.BottomRight = Zb = t.Yw;
var $b;
K.MiddleTop = $b = t.Tp;
var ac;
K.MiddleLeft = ac = t.Qp;
var bc;
K.MiddleRight = bc = t.Rp;
var cc;
K.MiddleBottom = cc = t.Pp;
K.Top = t.Tp;
var fc;
K.Left = fc = t.Qp;
var gc;
K.Right = gc = t.Rp;
K.Bottom = t.Pp;
var nc;
K.TopSide = nc = t.ux;
var oc;
K.LeftSide = oc = t.hx;
var pc;
K.RightSide = pc = t.nx;
var vc;
K.BottomSide = vc = t.$w;
K.TopBottomSides = t.ox;
K.LeftRightSides = t.gx;
K.TopLeftSides = t.qx;
K.TopRightSides = t.tx;
K.BottomLeftSides = t.Xw;
K.BottomRightSides = t.Zw;
K.NotTopSide = t.lx;
K.NotLeftSide = t.jx;
K.NotRightSide = t.kx;
K.NotBottomSide = t.ix;
var wc;
K.AllSides = wc = t.Vw;
function xc() {
this.Xe = [1, 0, 0, 1, 0, 0]
}
xc.prototype.copy = function () {
var a = new xc;
a.Xe[0] = this.Xe[0];
a.Xe[1] = this.Xe[1];
a.Xe[2] = this.Xe[2];
a.Xe[3] = this.Xe[3];
a.Xe[4] = this.Xe[4];
a.Xe[5] = this.Xe[5];
return a
};
function zc(a) {
this.type = a;
this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0;
this.rD = []
}
zc.prototype.addColorStop = function (a, b) {
this.rD.push({offset: a, color: b})
};
function Ac(a) {
this.fillStyle = "#000000";
this.font = "10px sans-serif";
this.globalAlpha = 1;
this.lineCap = "butt";
this.uw = 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.path = [];
this.Ii = new xc;
this.stack = [];
this.og = [];
this.BF = this.hE = this.Ov = 0;
this.Zv = a;
this.JI = "http://www.w3.org/2000/svg";
this.At = Bc(this, "svg", {width: this.Zv.width + "px", height: this.Zv.height +
"px", LJ: "0 0 " + this.Zv.width + " " + this.Zv.height})
}
aa = Ac.prototype;
aa.arc = function (a, b, c, d, e, g) {
Cc(this, a, b, c, d, e, g)
};
aa.beginPath = function () {
this.path = []
};
aa.bezierCurveTo = function (a, b, c, d, e, g) {
this.path.push(["C", a, b, c, d, e, g])
};
aa.clearRect = function () {
};
aa.clip = function () {
Fc(this, "clipPath", this.path, new xc)
};
aa.closePath = function () {
this.path.push(["z"])
};
aa.createLinearGradient = function (a, b, c, d) {
var e = new zc("linear");
e.x1 = a;
e.y1 = b;
e.x2 = c;
e.y2 = d;
return e
};
aa.createPattern = function () {
};
aa.createRadialGradient = function (a, b, c, d, e, g) {
var h = new zc("radial");
h.x1 = a;
h.y1 = b;
h.r1 = c;
h.x2 = d;
h.y2 = e;
h.r2 = g;
return h
};
aa.drawImage = function (a, b, c, d, e, g, h, k, l) {
a = [b, c, d, e, g, h, k, l, a];
b = this.Ii;
e = a[8];
c = {x: 0, y: 0, width: e.naturalWidth, height: e.naturalHeight, href: e.src};
d = "";
g = a[6] / a[2];
h = a[7] / a[3];
if (0 !== a[4] || 0 !== a[5])d += " translate(" + a[4] + ", " + a[5] + ")";
if (1 !== g || 1 !== h)d += " scale(" + g + ", " + h + ")";
if (0 !== a[0] || 0 !== a[1])d += " translate(" + -a[0] + ", " + -a[1] + ")";
if (0 !== a[0] || 0 !== a[1] || a[2] !== e.naturalWidth || a[3] !== e.naturalHeight)e = "CLIP" + this.Ov, this.Ov++, g = Bc(this, "clipPath", {id: e}), g.appendChild(Bc(this, "rect", {x: a[0], y: a[1],
width: a[2], height: a[3]})), this.At.appendChild(g), c["clip-path"] = "url(#" + e + ")";
Gc(this, "image", c, b, d);
this.addElement("image", c)
};
aa.fill = function () {
Fc(this, "fill", this.path, this.Ii)
};
aa.fillRect = function (a, b, c, d) {
Hc(this, "fill", [a, b, c, d], this.Ii)
};
aa.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};
Gc(this, "fill", b, this.Ii);
this.addElement("text", b, a[0])
};
aa.lineTo = function (a, b) {
this.path.push(["L", a, b])
};
aa.moveTo = function (a, b) {
this.path.push(["M", a, b])
};
aa.quadraticCurveTo = function (a, b, c, d) {
this.path.push(["Q", a, b, c, d])
};
aa.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"])
};
aa.restore = function () {
this.Ii = 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.uw = a.uw;
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
};
aa.save = function () {
this.stack.push({fillStyle: this.fillStyle, font: this.font, globalAlpha: this.globalAlpha, lineCap: this.lineCap, uw: this.uw, 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.Ii.copy())
};
aa.setTransform = function (a, b, c, d, e, g) {
1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || Ic(this, a, b, c, d, e, g)
};
aa.stroke = function () {
Fc(this, "stroke", this.path, this.Ii)
};
aa.strokeRect = function (a, b, c, d) {
Hc(this, "stroke", [a, b, c, d], this.Ii)
};
function Bc(a, b, c, d) {
a = document.createElementNS(a.JI, b);
if (c)for (var e in c)a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]);
d && (a.textContent = d);
return a
}
aa.addElement = function (a, b, c) {
a = Bc(this, a, b, c);
0 < this.og.length ? this.og[this.og.length - 1].appendChild(a) : this.At.appendChild(a);
return a
};
function Gc(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 zc ? Jc(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 zc ? Jc(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.Xe;
d = "matrix(" + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + ", " + d[4] + ", " + d[5] + ")";
void 0 !== e && (d += e);
c.transform = d
}
function Jc(a, b) {
var c = "GRAD" + a.hE;
a.hE++;
var d;
if ("linear" === b.type)d = {x1: b.x1, x2: b.x2, y1: b.y1, y2: b.y2, id: c, gradientUnits: "userSpaceOnUse"}, d = Bc(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 = Bc(a, "radialGradient", d); 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(Bc(a, "stop", h[k]));
a.At.appendChild(d);
return"url(#" + c + ")"
}
function Hc(a, b, c, d) {
c = {x: c[0], y: c[1], width: c[2], height: c[3]};
Gc(a, b, c, d);
a.addElement("rect", c)
}
function Fc(a, b, c, d) {
for (var e = [], g = 0; g < c.length; g++) {
var h = Array.prototype.slice.call(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(" ")};
Gc(a, b, c, d);
"clipPath" === b ? (b = "CLIP" + a.Ov, a.Ov++, d = Bc(a, "clipPath", {id: b}), d.appendChild(Bc(a, "path", c)), a.At.appendChild(d), 0 < a.og.length && a.og[a.og.length - 1].setAttributeNS(null, "clip-path", "url(#" + b +
")")) : a.addElement("path", c)
}
function Cc(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 ? (Cc(a, b, c, d, e, e + Math.PI, h), Cc(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 Ic(a, b, c, d, e, g, h) {
var k = new xc;
k.Xe = [b, c, d, e, g, h];
b = {};
Gc(a, "g", b, k);
k = a.addElement("g", b);
a.og.push(k)
}
aa.ab = function () {
var a = "SHADOW" + this.BF;
this.BF++;
var b = this.addElement("filter", {id: a, width: "250%", height: "250%"}, null), c, d, e, g, h;
if (0 != this.shadowOffsetX || 0 != this.shadowOffsetY)c = Bc(this, "feGaussianBlur", {"in": "SourceAlpha", result: "blur", JJ: this.shadowBlur / 2}), d = Bc(this, "feFlood", {"in": "blur", result: "flood", "flood-color": this.shadowColor}), e = Bc(this, "feComposite", {"in": "flood", in2: "blur", operator: "in", result: "comp"}), g = Bc(this, "feOffset", {"in": "comp", result: "offsetBlur", dx: this.shadowOffsetX, dy: this.shadowOffsetY}),
h = Bc(this, "feMerge", {}), h.appendChild(Bc(this, "feMergeNode", {"in": "offsetBlur"})), h.appendChild(Bc(this, "feMergeNode", {"in": "SourceGraphic"})), b.appendChild(c), b.appendChild(d), b.appendChild(e), b.appendChild(g), b.appendChild(h);
0 < this.og.length && this.og[this.og.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")")
};
var J = {va: 4 * ((Math.sqrt(2) - 1) / 3), nk: (new C(0, 0)).Na(), sG: (new D(0, 0, 0, 0)).Na(), Up: (new rb(0, 0, 0, 0)).Na(), qG: (new rb(2, 2, 2, 2)).Na(), rG: (new oa(Infinity, Infinity)).Na(), oG: (new C(-Infinity, -Infinity)).Na(), nG: (new C(Infinity, Infinity)).Na(), kn: (new oa(0, 0)).Na(), mx: (new oa(1, 1)).Na(), Sp: (new oa(6, 6)).Na(), ex: (new oa(8, 8)).Na(), pG: (new C(NaN, NaN)).Na(), xB: null, sqrt: function (a) {
if (0 >= a)return 0;
var b = J.xB;
if (null === b) {
for (var b = [], c = 0; 2E3 >= c; c++)b[c] = Math.sqrt(c);
J.xB = b
}
return 1 > a ? (c = 1 / a, 2E3 >= c ? 1 / b[c |
0] : Math.sqrt(a)) : 2E3 >= a ? b[a | 0] : Math.sqrt(a)
}, I: function (a, b) {
var c = a - b;
return 0.5 > c && -0.5 < c
}, Ka: function (a, b) {
var c = a - b;
return 5E-8 > c && -5E-8 < c
}, Bd: function (a, b, c, d, e, g, h) {
0 >= e && (e = 1E-6);
var k, l, m, n;
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
}, Kv: function (a, b, c, d, e, g, h, k, l, m, n, p) {
if (J.Bd(a, b, h, k, p, c, d) && J.Bd(a, b, h, k, p, e, g))return J.Bd(a, b, h, k, p, m, n);
var q = (a + c) / 2, r = (b + d) / 2, s = (c + e) / 2, v = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
d = (q + s) / 2;
c = (r + v) / 2;
var s = (s + e) / 2, v = (v + g) / 2, x = (d + s) / 2, E = (c + v) / 2;
return J.Kv(a, b, q, r, d, c, x, E, l, m, n, p) || J.Kv(x, E, s, v, e, g, h, k, l, m, n, p)
}, lH: function (a, b, c, d, e, g, h, k, l) {
var m = (c + e) / 2, n = (d + g) / 2;
l.x = (((a + c) / 2 + m) / 2 + (m + (e + h) / 2) / 2) / 2;
l.y = (((b + d) / 2 + n) / 2 + (n + (g + k) / 2) / 2) / 2;
return l
},
kH: function (a, b, c, d, e, g, h, k) {
var l = (c + e) / 2, m = (d + g) / 2;
return eb(((a + c) / 2 + l) / 2, ((b + d) / 2 + m) / 2, (l + (e + h) / 2) / 2, (m + (g + k) / 2) / 2)
}, Eo: function (a, b, c, d, e, g, h, k, l, m) {
if (J.Bd(a, b, h, k, l, c, d) && J.Bd(a, b, h, k, l, e, g))xb(m, a, b, 0, 0), xb(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, v = (c + r) / 2;
J.Eo(a, b, n, p, d, c, s, v, l, m);
J.Eo(s, v, q, r, e, g, h, k, l, m)
}
return m
}, ye: function (a, b, c, d, e, g, h, k, l, m) {
if (J.Bd(a, b, h, k, l, c, d) && J.Bd(a, b, h, k, l, e, g))0 ===
m.length && m.push([a, b]), m.push([h, 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, v = (c + r) / 2;
J.ye(a, b, n, p, d, c, s, v, l, m);
J.ye(s, v, q, r, e, g, h, k, l, m)
}
return m
}, IA: function (a, b, c, d, e, g, h, k, l, m) {
if (J.Bd(a, b, e, g, m, c, d))return J.Bd(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 J.IA(a, b, n, p, q, r, h, k, l, m) || J.IA(q, r, c, d, e, g, h, k, l, m)
}, IJ: function (a, b, c, d, e, g, h) {
h.x = ((a + c) / 2 + (c + e) / 2) / 2;
h.y = ((b +
d) / 2 + (d + g) / 2) / 2;
return h
}, HA: function (a, b, c, d, e, g, h, k) {
if (J.Bd(a, b, e, g, h, c, d))xb(k, a, b, 0, 0), xb(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;
J.HA(a, b, l, m, n, p, h, k);
J.HA(n, p, c, d, e, g, h, k)
}
return k
}, xp: function (a, b, c, d, e, g, h, k) {
if (J.Bd(a, b, e, g, h, c, d))0 === k.length && k.push([a, b]), k.push([e, 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;
J.xp(a, b, l, m, n, p, h, k);
J.xp(n, p, c, d, e, g, h, k)
}
return k
}, vs: function (a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
0 >= q &&
(q = 1E-6);
if (J.Bd(a, b, h, k, q, c, d) && J.Bd(a, b, h, k, q, e, g)) {
var s = (a - h) * (m - p) - (b - k) * (l - n);
if (!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 (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, v = (b + d) / 2;
c = (c + e) / 2;
d = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
var x = (s + c) / 2, E = (v + d) / 2;
c = (c + e) / 2;
d = (d + g) / 2;
var F = (x + c) / 2, G = (E + d) / 2, L = (n - l) * (n - l) + (p - m) * (p - m), N = !1;
J.vs(a, b, s, v, x, E, F, G,
l, m, n, p, q, r) && (a = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), a < L && (L = a, N = !0));
b = r.x;
s = r.y;
J.vs(F, G, c, d, e, g, h, k, l, m, n, p, q, r) && (a = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), a < L ? N = !0 : (r.x = b, r.y = s));
return N
}, ws: function (a, b, c, d, e, g, h, k, l, m, n, p, q) {
var r = 0;
0 >= q && (q = 1E-6);
if (J.Bd(a, b, h, k, q, c, d) && J.Bd(a, b, h, k, q, e, g)) {
q = (a - h) * (m - p) - (b - k) * (l - n);
if (!q)return r;
var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q, v = ((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 (b < k ? (l = b, a = k) : (l = k, a = b), v < l || v > 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, v = (b + d) / 2, x = (c + e) / 2, E = (d + g) / 2;
e = (e + h) / 2;
g = (g + k) / 2;
d = (s + x) / 2;
c = (v + E) / 2;
var x = (x + e) / 2, E = (E + g) / 2, F = (d + x) / 2, G = (c + E) / 2, r = r + J.ws(a, b, s, v, d, c, F, G, l, m, n, p, q), r = r + J.ws(F, G, x, E, e, g, h, k, l, m, n, p, q)
}
return r
}, Ym: function (a, b, c, d, e, g, h) {
if (J.Ka(a, c)) {
var k;
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 (J.Ka(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
}, Zg: function (a, b, c, d, e, g, h, k, l) {
if (J.I(a, c) && J.I(b, d))return l.x = a, l.y = b, !1;
if (J.Ka(e, h)) {
if (J.Ka(a, c))return J.Ym(a, b, c, d, e, g, l), !1;
g = (d - b) / (c - a) * (e - a) + b;
return J.Ym(a, b, c, d, e, g, l)
}
k = (k - g) / (h - e);
if (J.Ka(a, c)) {
g = k * (a - e) + g;
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 (J.Ka(k, h))return J.Ym(a, b, c, d, e, g, l), !1;
e = (h * a - k * e + g - b) / (h - k);
if (J.Ka(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 J.Ym(a, b, c, d, e, g, l)
}, wJ: function (a, b, c, d, e) {
return J.Zg(c.x, c.y, d.x, d.y, a.x, a.y, b.x, b.y, e)
}, uJ: function (a, b, c, d, e, g, h, k, l, m) {
function n(c, d) {
var e = (c - a) * (c - a) + (d - b) * (d - b);
e < p && (p = e, l.x = c, l.y = d)
}
var p = Infinity;
n(l.x, l.y);
var q, r, s, v;
e < h ? (q = e, r = h) : (q = h, r = e);
g < k ? (s = e, v = h) : (s = h, v =
e);
q = (r - q) / 2 + m;
m = (v - s) / 2 + m;
e = (e + h) / 2;
g = (g + k) / 2;
if (0 === q || 0 === m)return l;
if (0.5 > (c > a ? c - a : a - c)) {
q = 1 - (c - e) * (c - e) / (q * q);
if (0 > q)return l;
q = Math.sqrt(q);
d = -m * q + g;
n(c, m * q + g);
n(c, d)
} else {
c = (d - b) / (c - a);
d = 1 / (q * q) + c * c / (m * m);
k = 2 * c * (b - c * a) / (m * m) - 2 * c * g / (m * m) - 2 * e / (q * q);
q = k * k - 4 * d * (2 * c * a * g / (m * m) - 2 * b * g / (m * m) + g * g / (m * m) + e * e / (q * q) - 1 + (b - c * a) * (b - c * a) / (m * m));
if (0 > q)return l;
q = Math.sqrt(q);
m = (-k + q) / (2 * d);
n(m, c * m - c * a + b);
q = (-k - q) / (2 * d);
n(q, c * q - c * a + b)
}
return l
}, Wo: function (a, b, c, d, e, g, h, k, l) {
var m = 1E21, n = a, p = b;
if (J.Zg(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)
}
J.Zg(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));
J.Zg(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));
J.Zg(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
}, lw: function (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 ? (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.Ha(b) || a.Ha(c) || J.kw(k, m, l, m, d, e, g, h) || J.kw(l, m, l, n, d, e, g, h) || J.kw(l, n, k, n, d, e, g, h) || J.kw(k, n, k, m, d, e, g, h) ? !0 : !1
}, kw: function (a, b, c, d, e, g, h, k) {
return 0 >= J.Qv(a, b, c, d, e, g) * J.Qv(a, b, c, d, h, k) && 0 >= J.Qv(e, g, h, k, a, b) * J.Qv(e, g, h, k, c, d)
}, Qv: function (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
}, jt: function (a) {
0 > a && (a += 360);
360 <= a && (a -= 360);
return a
}, AD: function (a, b, c, d, e, g) {
var h =
Math.PI;
g || (d *= h / 180, e *= h / 180);
g = d < e ? 1 : -1;
var k = [], l = h / 2, m = d;
for (d = Math.min(2 * h + 1E-5, Math.abs(e - d)); 1E-5 < d;)e = m + g * Math.min(d, l), k.push(J.uH(c, m, e, a, b)), d -= Math.abs(e - m), m = e;
return k
}, uH: function (a, b, c, d, e) {
var g = (c - b) / 2, h = a * Math.cos(g), k = a * Math.sin(g), l = 0.5522847498 * Math.tan(g), m = h + l * k, h = -k + l * h, k = -h, l = g + b, g = Math.cos(l), l = Math.sin(l);
return{x1: d + a * Math.cos(b), y1: e + a * Math.sin(b), x2: d + m * g - h * l, y2: e + m * l + h * g, $d: d + m * g - k * l, ae: e + m * l + k * g, Ob: d + a * Math.cos(c), Pb: e + a * Math.sin(c)}
}, Gs: function (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.q(k, a);
return h
}, eE: function (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
}, HH: function (a, b, c, d) {
var e = 0 > c, g = 0 > d, h, k;
a < b ? (h = 1, k = 0) : (h = 0, k = 1);
var l, m;
l = 0 === h ? a : b;
m = 0 === h ? c : d;
if (0 === h ? e : g)m = -m;
h = k;
c = 0 === h ? c : d;
if (0 === h ? e : g)c = -c;
return J.IH(l, 0 === h ? a : b, m, c, 0, 0)
}, IH: function (a, b, c, d, e, g) {
if (0 < d)if (0 < c) {
g = a * a;
e = b * b;
a *= c;
var h = b * d, k = -e + h, l = -e + Math.sqrt(a * a + h * h);
b = k;
for (var m = 0; 9999999999 > m; ++m) {
b = 0.5 * (k + l);
if (b === k || b === l)break;
var n = a / (b + g), p = h / (b + e), n = n * n + p * p - 1;
if (0 < n)k = b; else if (0 > n)l = b; else break
}
c = g * c / (b + g) - c;
d = e * d / (b + e) - d;
c = Math.sqrt(c * c + d * d)
} else c = Math.abs(d - b); else d = a * a - b * b, e = a * c, e < d ? (d = e / d, e = a * d, g = b * Math.sqrt(Math.abs(1 - d * d)), c = e - c, c = Math.sqrt(c * c + g * g)) : c = Math.abs(c - a);
return c
}};
function M(a) {
1 < arguments.length && t.m("Geometry constructor can take at most one optional argument, the Geometry type.");
t.zc(this);
void 0 === a ? a = Kc : f && t.tb(a, M, M, "constructor:type");
this.ba = a;
this.wd = this.ld = this.nc = this.ec = 0;
this.Ek = new H(Lc);
this.mu = this.Ek.Wb;
this.Zt = (new D).freeze();
this.Za = !0;
this.vi = Qb;
this.wi = Zb;
this.vu = this.wu = NaN;
this.ce = J.kn;
this.kc = Mc
}
t.ia("Geometry", M);
t.Eh(M);
M.prototype.copy = function () {
var a = new M;
a.ba = this.ba;
a.ec = this.ec;
a.nc = this.nc;
a.ld = this.ld;
a.wd = this.wd;
for (var b = this.Ek, c = b.length, d = a.Ek, e = 0; e < c; e++) {
var g = b.p[e].copy();
d.add(g)
}
a.mu = this.mu;
a.Zt.assign(this.Zt);
a.Za = this.Za;
a.vi = this.vi.Z();
a.wi = this.wi.Z();
a.wu = this.wu;
a.vu = this.vu;
a.ce = this.ce.Z();
a.kc = this.kc;
return a
};
var Nc;
M.Line = Nc = t.w(M, "Line", 0);
var Tc;
M.Rectangle = Tc = t.w(M, "Rectangle", 1);
var Uc;
M.Ellipse = Uc = t.w(M, "Ellipse", 2);
var Kc;
M.Path = Kc = t.w(M, "Path", 3);
M.prototype.Na = function () {
this.freeze();
Object.freeze(this);
return this
};
M.prototype.freeze = function () {
this.jb = !0;
var a = this.ub;
a.freeze();
for (var b = a.length, c = 0; c < b; c++)a.p[c].freeze();
return this
};
M.prototype.Va = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.jb = !1;
var a = this.ub;
a.Va();
for (var b = a.length, c = 0; c < b; c++)a.p[c].Va();
return this
};
M.prototype.equalsApprox = M.prototype.ak = function (a) {
if (!(a instanceof M))return!1;
if (this.type !== a.type)return this.type === Nc && a.type === Kc ? Vc(this, a) : a.type === Nc && this.type === Kc ? Vc(a, this) : !1;
if (this.type === Kc) {
var b = this.ub;
a = a.ub;
var c = b.length;
if (c !== a.length)return!1;
for (var d = 0; d < c; d++)if (!b.p[d].ak(a.p[d]))return!1;
return!0
}
return J.I(this.na, a.na) && J.I(this.oa, a.oa) && J.I(this.D, a.D) && J.I(this.F, a.F)
};
function Vc(a, b) {
if (a.type !== Nc || b.type !== Kc)return!1;
if (1 === b.ub.count) {
var c = b.ub.pa(0);
if (1 === c.Ga.count && J.I(a.na, c.na) && J.I(a.oa, c.oa) && (c = c.Ga.pa(0), c.type === Wc && J.I(a.D, c.D) && J.I(a.F, c.F)))return!0
}
return!1
}
var Xc;
M.stringify = Xc = function (a) {
return a.toString()
};
M.prototype.toString = function (a) {
switch (this.type) {
case Nc:
return void 0 === a ? "M" + this.na.toString() + " " + this.oa.toString() + "L" + this.D.toString() + " " + this.F.toString() : "M" + this.na.toFixed(a) + " " + this.oa.toFixed(a) + "L" + this.D.toFixed(a) + " " + this.F.toFixed(a);
case Tc:
var b = new D(this.na, this.oa, 0, 0);
b.ZF(this.D, this.F, 0, 0);
return void 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 Uc:
b = new D(this.na, this.oa, 0, 0);
b.ZF(this.D, this.F, 0, 0);
if (void 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 Kc:
for (var b = "", c = this.ub, d = c.length, e = 0; e < d; e++) {
var g = c.p[e];
0 < e && (b += " x ");
g.bp && (b += "F ");
b += g.toString(a)
}
return b;
default:
return this.type.toString()
}
};
var Yc;
M.fillPath = Yc = function (a) {
"string" !== typeof a && t.Vb(a, "string", M, "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 Zc;
M.parse = Zc = function (a, b) {
function c() {
return n >= x - 1 ? !0 : null !== m[n + 1].match(/[A-Za-z]/)
}
function d() {
n++;
return m[n]
}
function e() {
var a = new C(parseFloat(d()), parseFloat(d()));
p === p.toLowerCase() && (a.x = v.x + a.x, a.y = v.y + a.y);
return a
}
function g() {
return v = e()
}
function h() {
return s = e()
}
function k() {
var a = [parseFloat(d()), parseFloat(d()), parseFloat(d()), parseFloat(d()), parseFloat(d())];
c() || (a.push(parseFloat(d())), c() || a.push(parseFloat(d())));
p === p.toLowerCase() && (a[2] += v.x, a[3] += v.y);
return a
}
function l() {
return"c" !==
q.toLowerCase() && "s" !== q.toLowerCase() ? v : new C(2 * v.x - s.x, 2 * v.y - s.y)
}
void 0 === b && (b = !1);
"string" !== typeof a && t.Vb(a, "string", M, "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 m = a.split(" "), n = -1, p = "", q = "", r = new C(0, 0), s = new C(0, 0), v = new C(0, 0), x = m.length, E = t.u(), F, G = !1, L = !1, N = !0; !(n >= x - 1);)if (q = p, p = d(), "" !== p)switch (p.toUpperCase()) {
case "X":
N = !0;
L = G = !1;
break;
case "M":
F = g();
null === E.Qb || !0 === N ? (O(E, F.x, F.y, G, !1, !L), N = !1) : E.moveTo(F.x, F.y);
for (r = v; !c();)F = g(), E.lineTo(F.x, F.y);
break;
case "L":
for (; !c();)F =
g(), E.lineTo(F.x, F.y);
break;
case "H":
for (; !c();)v = F = new C((p === p.toLowerCase() ? v.x : 0) + parseFloat(d()), v.y), E.lineTo(v.x, v.y);
break;
case "V":
for (; !c();)v = F = new C(v.x, (p === p.toLowerCase() ? v.y : 0) + parseFloat(d())), E.lineTo(v.x, v.y);
break;
case "C":
for (; !c();) {
var V = e(), T = h();
F = g();
P(E, V.x, V.y, T.x, T.y, F.x, F.y)
}
break;
case "S":
for (; !c();)V = l(), T = h(), F = g(), P(E, V.x, V.y, T.x, T.y, F.x, F.y);
break;
case "Q":
for (; !c();)T = h(), F = g(), $c(E, T.x, T.y, F.x, F.y);
break;
case "T":
for (; !c();)s = T = l(), F = g(), $c(E, T.x, T.y, F.x, F.y);
break;
case "B":
for (; !c();)F = k(), E.arcTo(F[0], F[1], F[2], F[3], F[4], F[5], F[6]);
break;
case "A":
for (; !c();) {
var V = Math.abs(parseFloat(d())), T = Math.abs(parseFloat(d())), W = parseFloat(d()), ea = !!parseFloat(d()), R = !!parseFloat(d());
F = g();
ad(E, V, T, W, ea, R, F.x, F.y)
}
break;
case "Z":
Q(E);
v = r;
break;
case "F":
F = null;
for (V = 1; m[n + V];)if (null !== m[n + V].match(/[Uu]/))V++; else if (null === m[n + V].match(/[A-Za-z]/))V++; else {
F = m[n + V];
break
}
F.match(/[Mm]/) ? G = !0 : bd(E);
break;
case "U":
F = null;
for (V = 1; m[n + V];)if (null !== m[n + V].match(/[Ff]/))V++;
else if (null === m[n + V].match(/[A-Za-z]/))V++; else {
F = m[n + V];
break
}
F.match(/[Mm]/) ? L = !0 : E.ab(!1)
}
r = E.s;
t.v(E);
if (b)for (E = r.ub.l; E.next();)E.value.bp = !0;
return r
};
function cd(a, b) {
for (var c = a.length, d = t.O(), e = 0; e < c; e++) {
var g = a[e];
d.x = g.x1;
d.y = g.y1;
b.Wa(d);
g.x1 = d.x;
g.y1 = d.y;
d.x = g.x2;
d.y = g.y2;
b.Wa(d);
g.x2 = d.x;
g.y2 = d.y;
d.x = g.$d;
d.y = g.ae;
b.Wa(d);
g.$d = d.x;
g.ae = d.y;
d.x = g.Ob;
d.y = g.Pb;
b.Wa(d);
g.Ob = d.x;
g.Pb = d.y
}
t.B(d)
}
M.prototype.lA = function () {
if (this.Za)return!0;
var a = this.ub;
if (this.mu !== a.Wb)return!0;
for (var b = a.length, c = 0; c < b; c++)if (a.p[c].lA())return!0;
return!1
};
M.prototype.pB = function () {
this.Za = !1;
var a = this.ub;
this.mu = a.Wb;
for (var b = a.length, c = 0; c < b; c++)a.p[c].pB()
};
M.prototype.kf = function () {
var a = this.Zt;
a.Va();
a.q(0, 0, this.ce.width, this.ce.height);
dd(this, a, !1);
xb(a, 0, 0, 0, 0);
a.freeze()
};
M.prototype.computeBoundsWithoutOrigin = M.prototype.qH = function () {
var a = new D;
dd(this, a, !0);
return a
};
function dd(a, b, c) {
switch (a.type) {
case Nc:
case Tc:
case Uc:
c ? b.q(a.ec, a.nc, 0, 0) : xb(b, a.ec, a.nc, 0, 0);
xb(b, a.ld, a.wd, 0, 0);
break;
case Kc:
a = a.ub;
for (var d = a.length, e = 0; e < d; e++) {
var g = a.p[e];
c && 0 === e ? b.q(g.na, g.oa, 0, 0) : xb(b, g.na, g.oa, 0, 0);
for (var h = g.Ga, k = h.length, l = g.na, m = g.oa, n = 0; n < k; n++) {
var p = h.p[n];
switch (p.type) {
case Wc:
case jd:
l = p.D;
m = p.F;
xb(b, l, m, 0, 0);
break;
case ld:
J.Eo(l, m, p.vb, p.Lb, p.oe, p.pe, p.D, p.F, 0.5, b);
l = p.D;
m = p.F;
break;
case md:
J.HA(l, m, p.vb, p.Lb, p.D, p.F, 0.5, b);
l = p.D;
m = p.F;
break;
case nd:
case od:
for (var p =
p.type === nd ? pd(p, g) : qd(p, g, l, m), q = p.length, r = null, s = 0; s < q; s++)r = p[s], J.Eo(r.x1, r.y1, r.x2, r.y2, r.$d, r.ae, r.Ob, r.Pb, 0.5, b);
null !== r && (l = r.Ob, m = r.Pb);
break;
default:
t.m("Unknown Segment type: " + p.type)
}
}
}
break;
default:
t.m("Unknown Geometry type: " + a.type)
}
}
M.prototype.normalize = M.prototype.normalize = function () {
t.J(this);
var a = this.qH();
this.offset(-a.x, -a.y);
return new C(-a.x, -a.y)
};
M.prototype.offset = M.prototype.offset = function (a, b) {
t.J(this);
f && (t.o(a, M, "offset"), t.o(b, M, "offset"));
this.transform(1, 0, 0, 1, a, b)
};
M.prototype.scale = M.prototype.scale = function (a, b) {
t.J(this);
f && (t.o(a, M, "scale:x"), t.o(b, M, "scale:y"), 0 >= a && t.ha(a, "scale must be greater than zero", M, "scale:x"), 0 >= b && t.ha(b, "scale must be greater than zero", M, "scale:y"));
this.transform(a, 0, 0, b, 0, 0)
};
M.prototype.rotate = M.prototype.rotate = function (a, b, c) {
t.J(this);
void 0 === b && (b = 0);
void 0 === c && (c = 0);
f && (t.o(a, M, "rotate:angle"), t.o(b, M, "rotate:x"), t.o(c, M, "rotate:y"));
var d = t.ah();
d.reset();
d.rotate(a, b, c);
this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
t.Te(d)
};
M.prototype.transform = M.prototype.transform = function (a, b, c, d, e, g) {
var h, k;
switch (this.type) {
case Nc:
case Tc:
case Uc:
h = this.ec;
k = this.nc;
this.ec = h * a + k * c + e;
this.nc = h * b + k * d + g;
h = this.ld;
k = this.wd;
this.ld = h * a + k * c + e;
this.wd = h * b + k * d + g;
break;
case Kc:
for (var l = this.ub, m = l.length, n = 0; n < m; n++) {
var p = l.p[n];
h = p.na;
k = p.oa;
p.na = h * a + k * c + e;
p.oa = h * b + k * d + g;
for (var p = p.Ga, q = p.length, r = 0; r < q; r++) {
var s = p.p[r];
switch (s.type) {
case Wc:
case jd:
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
break;
case ld:
h = s.vb;
k = s.Lb;
s.vb = h * a +
k * c + e;
s.Lb = h * b + k * d + g;
h = s.oe;
k = s.pe;
s.oe = h * a + k * c + e;
s.pe = h * b + k * d + g;
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
break;
case md:
h = s.vb;
k = s.Lb;
s.vb = h * a + k * c + e;
s.Lb = h * b + k * d + g;
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
break;
case nd:
h = s.Fa;
k = s.Sa;
s.Fa = h * a + k * c + e;
s.Sa = h * b + k * d + g;
s.radiusX *= Math.sqrt(a * a + c * c);
void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d));
break;
case od:
h = s.D;
k = s.F;
s.D = h * a + k * c + e;
s.F = h * b + k * d + g;
s.radiusX *= Math.sqrt(a * a + c * c);
s.radiusY *= Math.sqrt(b * b + d * d);
break;
default:
t.m("Unknown Segment type: " + s.type)
}
}
}
}
this.Za = !0
};
M.prototype.ls = function (a, b) {
var c = this.ec, d = this.nc, e = this.ld, g = this.wd, h = Math.min(c, e), k = Math.min(d, g), c = Math.abs(e - c), d = Math.abs(g - d), g = t.O();
g.x = h;
g.y = k;
b.Wa(g);
e = new Lc(g.x, g.y);
g.x = h + c;
g.y = k;
b.Wa(g);
e.Ga.add(new S(Wc, g.x, g.y));
g.x = h + c;
g.y = k + d;
b.Wa(g);
e.Ga.add(new S(Wc, g.x, g.y));
g.x = h;
g.y = k + d;
b.Wa(g);
e.Ga.add((new S(Wc, g.x, g.y)).close());
t.B(g);
a.type = Kc;
a.ub.add(e);
return a
};
M.prototype.Ha = function (a, b, c, d) {
var e = a.x, g = a.y, h = this.Mb.x - 20;
a = a.y;
for (var k = 0, l, m, n, p, q, r, s, v = this.ub.p, x = v.length, E = 0; E < x; E++) {
var F = v[E];
if (F.bp) {
if (c && F.Ha(e, g, b))return!0;
var G = F.Ga;
l = F.na;
m = F.oa;
for (var L = l, N = m, V = 0; V <= G.length; V++) {
V !== G.length ? (n = G.p[V], p = n.type, r = n.D, s = n.F) : (p = Wc, r = L, s = N);
switch (p) {
case jd:
q = rd(e, g, h, a, l, m, L, N);
if (!0 === q)return!0;
k += q;
L = r;
N = s;
break;
case Wc:
q = rd(e, g, h, a, l, m, r, s);
if (!0 === q)return!0;
k += q;
break;
case ld:
q = J.ws(l, m, n.vb, n.Lb, n.oe, n.pe, r, s, h, a, e, g, 0.5);
k += q;
break;
case md:
q = J.ws(l, m, (l + 2 * n.vb) / 3, (m + 2 * n.Lb) / 3, (n.vb + 2 * r) / 3, (n.vb + 2 * r) / 3, r, s, h, a, e, g, 0.5);
k += q;
break;
case nd:
case od:
p = n.type === nd ? pd(n, F) : qd(n, F, l, m);
for (var T = p.length, W = null, ea = 0; ea < T; ea++) {
W = p[ea];
if (0 === ea) {
q = rd(e, g, h, a, l, m, W.x1, W.y1);
if (!0 === q)return!0;
k += q
}
q = J.ws(W.x1, W.y1, W.x2, W.y2, W.$d, W.ae, W.Ob, W.Pb, h, a, e, g, 0.5);
k += q
}
null !== W && (r = W.Ob, s = W.Pb);
break;
default:
t.m("Unknown Segment type: " + n.type)
}
l = r;
m = s
}
if (0 !== k)return!0;
k = 0
} else if (F.Ha(e, g, d ? b : b + 2))return!0
}
return 0 !== k
};
function rd(a, b, c, d, e, g, h, k) {
if (J.Bd(e, g, h, k, 0.05, a, b))return!0;
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 (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 sd(a, b, c, d) {
for (var e = a.ub.length, g = 0; g < e; g++)if (a.ub.p[g].Ha(b, c, d))return!0;
return!1
}
M.prototype.getPointAlongPath = function (a) {
(0 > a || 1 < a) && t.ha(a, "0 <= fraction <= 1", M, "getPointAlongPath:fraction");
var b = this.ub.eb(), c = t.Db(), d = [];
d.push([b.na, b.oa]);
for (var e = b.na, g = b.oa, h = e, k = g, l = b.Ga.p, m = l.length, n = 0; n < m; n++) {
var p = l[n];
switch (p.ba) {
case jd:
c.push(d);
d = [];
d.push([p.D, p.F]);
e = p.D;
g = p.F;
h = e;
k = g;
break;
case Wc:
d.push([p.D, p.F]);
e = p.D;
g = p.F;
break;
case ld:
J.ye(e, g, p.Og, p.Pg, p.Sk, p.Tk, p.ue, p.ve, 0.5, d);
e = p.D;
g = p.F;
break;
case md:
J.xp(e, g, p.Og, p.Pg, p.ue, p.ve, 0.5, d);
e = p.D;
g = p.F;
break;
case nd:
for (var q =
pd(p, b), r = q.length, s = 0; s < r; s++) {
var v = q[s];
J.ye(e, g, v.x2, v.y2, v.$d, v.ae, v.Ob, v.Pb, 0.5, d);
e = v.Ob;
g = v.Pb
}
break;
case od:
q = qd(p, b, e, g);
r = q.length;
for (s = 0; s < r; s++)v = q[s], J.ye(e, g, v.x2, v.y2, v.$d, v.ae, v.Ob, v.Pb, 0.5, d), e = v.Ob, g = v.Pb;
break;
default:
t.m("Segment not of valid type")
}
p.ph && d.push([h, k])
}
c.push(d);
m = 0;
e = c.length;
b = null;
for (g = 0; g < e; g++)for (h = c[g], k = h.length, n = 0; n < k; n++)d = h[n], 0 !== n && (l = Math.sqrt(db(b[0], b[1], d[0], d[1])), m += l), b = d;
a *= m;
for (g = m = 0; g < e; g++)for (h = c[g], k = h.length, n = 0; n < k; n++) {
d = h[n];
if (0 !== n) {
l = Math.sqrt(db(b[0], b[1], d[0], d[1]));
if (m + l > a)return n = (a - m) / l, t.Da(c), new C(b[0] + (d[0] - b[0]) * n, b[1] + (d[1] - b[1]) * n);
m += l
}
b = d
}
t.Da(c);
return null
};
t.g(M, "type", M.prototype.type);
t.defineProperty(M, {type: "type"}, function () {
return this.ba
}, function (a) {
this.ba !== a && (f && t.tb(a, M, M, "type"), t.J(this, a), this.ba = a, this.Za = !0)
});
t.g(M, "startX", M.prototype.na);
t.defineProperty(M, {na: "startX"}, function () {
return this.ec
}, function (a) {
this.ec !== a && (f && t.o(a, M, "startX"), t.J(this, a), this.ec = a, this.Za = !0)
});
t.g(M, "startY", M.prototype.oa);
t.defineProperty(M, {oa: "startY"}, function () {
return this.nc
}, function (a) {
this.nc !== a && (f && t.o(a, M, "startY"), t.J(this, a), this.nc = a, this.Za = !0)
});
t.g(M, "endX", M.prototype.D);
t.defineProperty(M, {D: "endX"}, function () {
return this.ld
}, function (a) {
this.ld !== a && (f && t.o(a, M, "endX"), t.J(this, a), this.ld = a, this.Za = !0)
});
t.g(M, "endY", M.prototype.F);
t.defineProperty(M, {F: "endY"}, function () {
return this.wd
}, function (a) {
this.wd !== a && (f && t.o(a, M, "endY"), t.J(this, a), this.wd = a, this.Za = !0)
});
t.g(M, "figures", M.prototype.ub);
t.defineProperty(M, {ub: "figures"}, function () {
return this.Ek
}, function (a) {
this.Ek !== a && (f && t.k(a, H, M, "figures"), t.J(this, a), this.Ek = a, this.Za = !0)
});
t.defineProperty(M, {G: "spot1"}, function () {
return this.vi
}, function (a) {
f && t.k(a, K, M, "spot1");
t.J(this, a);
this.vi = a.Z()
});
t.defineProperty(M, {H: "spot2"}, function () {
return this.wi
}, function (a) {
f && t.k(a, K, M, "spot2");
t.J(this, a);
this.wi = a.Z()
});
t.A(M, {Mb: "bounds"}, function () {
this.lA() && (this.pB(), this.kf());
return this.Zt
});
t.g(M, "minSize", M.prototype.Ye);
t.defineProperty(M, {Ye: "minSize"}, function () {
return this.ce
}, function (a) {
this.ce.N(a) || (f && t.k(a, oa, M, "minSize"), a = a.Z(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.ce = a)
});
function Lc(a, b, c) {
t.zc(this);
void 0 === c && (c = !0);
this.Pl = c;
this.Qn = !0;
void 0 !== a ? (f && t.o(a, Lc, "sx"), this.ec = a) : this.ec = 0;
void 0 !== b ? (f && t.o(b, Lc, "sy"), this.nc = b) : this.nc = 0;
this.Sr = new H(S);
this.iv = this.Sr.Wb;
this.Za = !0
}
t.ia("PathFigure", Lc);
t.Eh(Lc);
Lc.prototype.copy = function () {
var a = new Lc;
a.Pl = this.Pl;
a.Qn = this.Qn;
a.ec = this.ec;
a.nc = this.nc;
for (var b = this.Sr, c = b.length, d = a.Sr, e = 0; e < c; e++) {
var g = b.p[e].copy();
d.add(g)
}
a.iv = this.iv;
a.Za = this.Za;
return a
};
Lc.prototype.equalsApprox = Lc.prototype.ak = function (a) {
if (!(a instanceof Lc && J.I(this.na, a.na) && J.I(this.oa, a.oa)))return!1;
var b = this.Ga;
a = a.Ga;
var c = b.length;
if (c !== a.length)return!1;
for (var d = 0; d < c; d++)if (!b.p[d].ak(a.p[d]))return!1;
return!0
};
aa = Lc.prototype;
aa.toString = function (a) {
for (var b = void 0 === a ? "M" + this.na.toString() + " " + this.oa.toString() : "M" + this.na.toFixed(a) + " " + this.oa.toFixed(a), c = this.Ga, d = c.length, e = 0; e < d; e++)b += " " + c.p[e].toString(a);
return b
};
aa.freeze = function () {
this.jb = !0;
var a = this.Ga;
a.freeze();
for (var b = a.length, c = 0; c < b; c++)a.p[c].freeze();
return this
};
aa.Va = function () {
this.jb = !1;
var a = this.Ga;
a.Va();
for (var b = a.length, c = 0; c < b; c++)a.p[c].Va();
return this
};
aa.lA = function () {
if (this.Za)return!0;
var a = this.Ga;
if (this.iv !== a.Wb)return!0;
for (var b = a.length, c = 0; c < b; c++)if (a.p[c].Za)return!0;
return!1
};
aa.pB = function () {
this.Za = !1;
var a = this.Ga;
this.iv = a.Wb;
for (var b = a.length, c = 0; c < b; c++) {
var d = a.p[c];
d.Za = !1;
d.bj = null
}
};
t.g(Lc, "isFilled", Lc.prototype.bp);
t.defineProperty(Lc, {bp: "isFilled"}, function () {
return this.Pl
}, function (a) {
f && t.j(a, "boolean", Lc, "isFilled");
t.J(this, a);
this.Pl = a
});
t.g(Lc, "isShadowed", Lc.prototype.Kh);
t.defineProperty(Lc, {Kh: "isShadowed"}, function () {
return this.Qn
}, function (a) {
f && t.j(a, "boolean", Lc, "isShadowed");
t.J(this, a);
this.Qn = a
});
t.g(Lc, "startX", Lc.prototype.na);
t.defineProperty(Lc, {na: "startX"}, function () {
return this.ec
}, function (a) {
f && t.o(a, Lc, "startX");
t.J(this, a);
this.ec = a;
this.Za = !0
});
t.g(Lc, "startY", Lc.prototype.oa);
t.defineProperty(Lc, {oa: "startY"}, function () {
return this.nc
}, function (a) {
f && t.o(a, Lc, "startY");
t.J(this, a);
this.nc = a;
this.Za = !0
});
t.g(Lc, "segments", Lc.prototype.Ga);
t.defineProperty(Lc, {Ga: "segments"}, function () {
return this.Sr
}, function (a) {
f && t.k(a, H, Lc, "segments");
t.J(this, a);
this.Sr = a;
this.Za = !0
});
Lc.prototype.Ha = function (a, b, c) {
for (var d = this.na, e = this.oa, g = d, h = e, k = this.Ga.p, l = k.length, m = 0; m < l; m++) {
var n = k[m];
switch (n.type) {
case jd:
g = n.D;
h = n.F;
d = n.D;
e = n.F;
break;
case Wc:
if (J.Bd(d, e, n.D, n.F, c, a, b))return!0;
d = n.D;
e = n.F;
break;
case ld:
if (J.Kv(d, e, n.vb, n.Lb, n.oe, n.pe, n.D, n.F, 0.5, a, b, c))return!0;
d = n.D;
e = n.F;
break;
case md:
if (J.IA(d, e, n.vb, n.Lb, n.D, n.F, 0.5, a, b, c))return!0;
d = n.D;
e = n.F;
break;
case nd:
case od:
for (var p = n.type === nd ? pd(n, this) : qd(n, this, d, e), q = p.length, r = null, s = 0; s < q; s++)if (r = p[s], 0 === s &&
J.Bd(d, e, r.x1, r.y1, c, a, b) || J.Kv(r.x1, r.y1, r.x2, r.y2, r.$d, r.ae, r.Ob, r.Pb, 0.5, a, b, c))return!0;
null !== r && (d = r.Ob, e = r.Pb);
break;
default:
t.m("Unknown Segment type: " + n.type)
}
if (n.Ss && (d !== g || e !== h) && J.Bd(d, e, g, h, c, a, b))return!0
}
return!1
};
function S(a, b, c, d, e, g, h, k) {
t.zc(this);
void 0 === a ? a = Wc : f && t.tb(a, S, S, "constructor:type");
this.ba = a;
a === nd ? (void 0 !== b ? (f && t.o(b, S, "ex"), this.we = b) : this.we = 0, void 0 !== c ? (f && t.o(c, S, "ey"), this.xe = c) : this.xe = 0, void 0 !== d && (f && t.o(d, S, "x1"), this.rn = d), void 0 !== e && (f && t.o(e, S, "y1"), this.sn = e), void 0 !== g && (f && t.o(g, S, "x2"), this.Dj = Math.max(g || 0, 0)), void 0 !== h && "number" === typeof h ? (f && t.o(h, S, "y2"), this.Ej = Math.max(h || 0, 0)) : this.Ej = this.Dj) : a === od ? (void 0 !== b && f && t.o(b, S, "ex"), void 0 !== c && f && t.o(c, S, "ey"),
void 0 !== d && f && t.o(d, S, "x1"), void 0 !== e && f && t.o(e, S, "y1"), this.ue = b || 0, this.ve = c || 0, this.Dj = Math.max(d || 0, 0), this.Ej = Math.max(e || 0, 0), this.we = h ? 1 : 0, this.xe = k ? 1 : 0, a = (g || 0) % 360, 0 > a && (a += 360), this.to = a) : (void 0 !== b ? (f && t.o(b, S, "ex"), this.ue = b) : this.ue = 0, void 0 !== c ? (f && t.o(c, S, "ey"), this.ve = c) : this.ve = 0, void 0 !== d && (f && t.o(d, S, "x1"), this.Og = d), void 0 !== e && (f && t.o(e, S, "y1"), this.Pg = e), void 0 !== g && (f && t.o(g, S, "x2"), this.Sk = g), void 0 !== h && "number" === typeof h && (f && t.o(h, S, "y2"), this.Tk = h));
this.Za = !0;
this.ph = !1;
this.bj = null
}
t.ia("PathSegment", S);
t.Eh(S);
S.prototype.copy = function () {
var a = new S;
a.ba = this.ba;
this.ba === nd ? (a.we = this.we, a.xe = this.xe, a.rn = this.rn, a.sn = this.sn, a.Dj = this.Dj, a.Ej = this.Ej) : this.ba === od ? (a.we = this.we, a.xe = this.xe, a.ue = this.ue, a.ve = this.ve, a.Dj = this.Dj, a.Ej = this.Ej, a.to = this.to) : (a.ue = this.ue, a.ve = this.ve, a.Og = this.Og, a.Pg = this.Pg, a.Sk = this.Sk, a.Tk = this.Tk);
a.Za = this.Za;
a.ph = this.ph;
return a
};
S.prototype.equalsApprox = S.prototype.ak = function (a) {
if (!(a instanceof S) || this.type !== a.type || this.Ss !== a.Ss)return!1;
switch (this.type) {
case jd:
case Wc:
return J.I(this.D, a.D) && J.I(this.F, a.F);
case ld:
return J.I(this.D, a.D) && J.I(this.F, a.F) && J.I(this.vb, a.vb) && J.I(this.Lb, a.Lb) && J.I(this.oe, a.oe) && J.I(this.pe, a.pe);
case md:
return J.I(this.D, a.D) && J.I(this.F, a.F) && J.I(this.vb, a.vb) && J.I(this.Lb, a.Lb);
case nd:
return J.I(this.yg, a.yg) && J.I(this.Rh, a.Rh) && J.I(this.Fa, a.Fa) && J.I(this.Sa, a.Sa) && J.I(this.radiusX,
a.radiusX) && J.I(this.radiusY, a.radiusY);
case od:
return this.mw === a.mw && this.pw === a.pw && J.I(this.Uw, a.Uw) && J.I(this.D, a.D) && J.I(this.F, a.F) && J.I(this.radiusX, a.radiusX) && J.I(this.radiusY, a.radiusY);
default:
return!1
}
};
S.prototype.toString = function (a) {
switch (this.type) {
case jd:
a = void 0 === a ? "M" + this.D.toString() + " " + this.F.toString() : "M" + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case Wc:
a = void 0 === a ? "L" + this.D.toString() + " " + this.F.toString() : "L" + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case ld:
a = void 0 === a ? "C" + this.vb.toString() + " " + this.Lb.toString() + " " + this.oe.toString() + " " + this.pe.toString() + " " + this.D.toString() + " " + this.F.toString() : "C" + this.vb.toFixed(a) + " " + this.Lb.toFixed(a) + " " + this.oe.toFixed(a) +
" " + this.pe.toFixed(a) + " " + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case md:
a = void 0 === a ? "Q" + this.vb.toString() + " " + this.Lb.toString() + " " + this.D.toString() + " " + this.F.toString() : "Q" + this.vb.toFixed(a) + " " + this.Lb.toFixed(a) + " " + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
case nd:
a = void 0 === a ? "B" + this.yg.toString() + " " + this.Rh.toString() + " " + this.Fa.toString() + " " + this.Sa.toString() + " " + this.radiusX : "B" + this.yg.toFixed(a) + " " + this.Rh.toFixed(a) + " " + this.Fa.toFixed(a) + " " + this.Sa.toFixed(a) +
" " + this.radiusX;
break;
case od:
a = void 0 === a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.Uw.toString() + " " + (this.pw ? 1 : 0) + " " + (this.mw ? 1 : 0) + " " + this.D.toString() + " " + this.F.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.Uw.toFixed(a) + " " + (this.pw ? 1 : 0) + " " + (this.mw ? 1 : 0) + " " + this.D.toFixed(a) + " " + this.F.toFixed(a);
break;
default:
a = this.type.toString()
}
return a + (this.ph ? "z" : "")
};
var jd;
S.Move = jd = t.w(S, "Move", 0);
var Wc;
S.Line = Wc = t.w(S, "Line", 1);
var ld;
S.Bezier = ld = t.w(S, "Bezier", 2);
var md;
S.QuadraticBezier = md = t.w(S, "QuadraticBezier", 3);
var nd;
S.Arc = nd = t.w(S, "Arc", 4);
var od;
S.SvgArc = od = t.w(S, "SvgArc", 4);
S.prototype.freeze = function () {
this.jb = !0;
return this
};
S.prototype.Va = function () {
this.jb = !1;
return this
};
S.prototype.close = S.prototype.close = function () {
this.ph = !0;
return this
};
function pd(a, b) {
if (null !== a.bj && !1 === b.Za)return a.bj;
var c = a.radiusX, d = a.radiusY;
void 0 === d && (d = c);
var e = a.rn, g = a.sn, h = J.AD(0, 0, c < d ? c : d, a.yg, a.yg + a.Rh);
if (c !== d) {
var k = t.ah();
k.reset();
c < d ? k.scale(1, d / c) : k.scale(c / d, 1);
for (var c = h.length, d = t.O(), l = 0; l < c; l++) {
var m = h[l];
d.x = m.x1;
d.y = m.y1;
k.Wa(d);
m.x1 = d.x;
m.y1 = d.y;
d.x = m.x2;
d.y = m.y2;
k.Wa(d);
m.x2 = d.x;
m.y2 = d.y;
d.x = m.$d;
d.y = m.ae;
k.Wa(d);
m.$d = d.x;
m.ae = d.y;
d.x = m.Ob;
d.y = m.Pb;
k.Wa(d);
m.Ob = d.x;
m.Pb = d.y
}
t.B(d);
t.Te(k)
}
k = h.length;
for (c = 0; c < k; c++)d = h[c], d.x1 +=
e, d.y1 += g, d.x2 += e, d.y2 += g, d.$d += e, d.ae += g, d.Ob += e, d.Pb += g;
a.bj = h;
return a.bj
}
function qd(a, b, c, d) {
function e(a, b) {
return(a[0] * b[1] < a[1] * b[0] ? -1 : 1) * Math.acos(g(a, b))
}
function g(a, b) {
return(a[0] * b[0] + a[1] * b[1]) / (Math.sqrt(Math.pow(a[0], 2) + Math.pow(a[1], 2)) * Math.sqrt(Math.pow(b[0], 2) + Math.pow(b[1], 2)))
}
if (null !== a.bj && !1 === b.Za)return a.bj;
b = a.Dj;
var h = a.Ej, k = Math.PI / 180 * a.to, l = a.yg, m = a.xe, n = a.ue, p = a.ve, q = Math.cos(k) * (c - n) / 2 + Math.sin(k) * (d - p) / 2, r = -Math.sin(k) * (c - n) / 2 + Math.cos(k) * (d - p) / 2, s = Math.pow(q, 2) / Math.pow(b, 2) + Math.pow(r, 2) / Math.pow(h, 2);
1 < s && (b *= Math.sqrt(s), h *= Math.sqrt(s));
s = (l === m ? -1 : 1) * Math.sqrt((Math.pow(b, 2) * Math.pow(h, 2) - Math.pow(b, 2) * Math.pow(r, 2) - Math.pow(h, 2) * Math.pow(q, 2)) / (Math.pow(b, 2) * Math.pow(r, 2) + Math.pow(h, 2) * Math.pow(q, 2)));
isNaN(s) && (s = 0);
l = s * b * r / h;
s = s * -h * q / b;
isNaN(l) && (l = 0);
isNaN(s) && (s = 0);
c = (c + n) / 2 + Math.cos(k) * l - Math.sin(k) * s;
d = (d + p) / 2 + Math.sin(k) * l + Math.cos(k) * s;
k = e([1, 0], [(q - l) / b, (r - s) / h]);
p = [(q - l) / b, (r - s) / h];
r = [(-q - l) / b, (-r - s) / h];
q = e(p, r);
-1 >= g(p, r) && (q = Math.PI);
1 <= g(p, r) && (q = 0);
0 === m && 0 < q && (q -= 2 * Math.PI);
1 === m && 0 > q && (q += 2 * Math.PI);
m = b > h ? 1 : b / h;
r = b > h ? h / b : 1;
b = J.AD(0, 0, b > h ? b : h, k, k + q, !0);
h = t.ah();
h.reset();
h.translate(c, d);
h.rotate(a.to, 0, 0);
h.scale(m, r);
cd(b, h);
t.Te(h);
a.bj = b;
return a.bj
}
t.g(S, "isClosed", S.prototype.Ss);
t.defineProperty(S, {Ss: "isClosed"}, function () {
return this.ph
}, function (a) {
this.ph !== a && (this.ph = a, this.Za = !0)
});
t.g(S, "type", S.prototype.type);
t.defineProperty(S, {type: "type"}, function () {
return this.ba
}, function (a) {
f && t.tb(a, S, S, "type");
t.J(this, a);
this.ba = a;
this.Za = !0
});
t.g(S, "endX", S.prototype.D);
t.defineProperty(S, {D: "endX"}, function () {
return this.ue
}, function (a) {
f && t.o(a, S, "endX");
t.J(this, a);
this.ue = a;
this.Za = !0
});
t.g(S, "endY", S.prototype.F);
t.defineProperty(S, {F: "endY"}, function () {
return this.ve
}, function (a) {
f && t.o(a, S, "endY");
t.J(this, a);
this.ve = a;
this.Za = !0
});
t.defineProperty(S, {vb: "point1X"}, function () {
return this.Og
}, function (a) {
f && t.o(a, S, "point1X");
t.J(this, a);
this.Og = a;
this.Za = !0
});
t.defineProperty(S, {Lb: "point1Y"}, function () {
return this.Pg
}, function (a) {
f && t.o(a, S, "point1Y");
t.J(this, a);
this.Pg = a;
this.Za = !0
});
t.defineProperty(S, {oe: "point2X"}, function () {
return this.Sk
}, function (a) {
f && t.o(a, S, "point2X");
t.J(this, a);
this.Sk = a;
this.Za = !0
});
t.defineProperty(S, {pe: "point2Y"}, function () {
return this.Tk
}, function (a) {
f && t.o(a, S, "point2Y");
t.J(this, a);
this.Tk = a;
this.Za = !0
});
t.defineProperty(S, {Fa: "centerX"}, function () {
return this.rn
}, function (a) {
f && t.o(a, S, "centerX");
t.J(this, a);
this.rn = a;
this.Za = !0
});
t.defineProperty(S, {Sa: "centerY"}, function () {
return this.sn
}, function (a) {
f && t.o(a, S, "centerY");
t.J(this, a);
this.sn = a;
this.Za = !0
});
t.defineProperty(S, {radiusX: "radiusX"}, function () {
return this.Dj
}, function (a) {
f && t.o(a, S, "radiusX");
0 > a && t.ha(a, ">= zero", S, "radiusX");
t.J(this, a);
this.Dj = a;
this.Za = !0
});
t.defineProperty(S, {radiusY: "radiusY"}, function () {
return this.Ej
}, function (a) {
f && t.o(a, S, "radiusY");
0 > a && t.ha(a, ">= zero", S, "radiusY");
t.J(this, a);
this.Ej = a;
this.Za = !0
});
t.defineProperty(S, {yg: "startAngle"}, function () {
return this.we
}, function (a) {
this.we !== a && (t.J(this, a), f && t.o(a, S, "startAngle"), a %= 360, 0 > a && (a += 360), this.we = a, this.Za = !0)
});
t.defineProperty(S, {Rh: "sweepAngle"}, function () {
return this.xe
}, function (a) {
f && t.o(a, S, "sweepAngle");
t.J(this, a);
360 < a && (a = 360);
-360 > a && (a = -360);
this.xe = a;
this.Za = !0
});
t.defineProperty(S, {mw: "isClockwiseArc"}, function () {
return!!this.xe
}, function (a) {
t.J(this, a);
this.xe = a ? 1 : 0;
this.Za = !0
});
t.defineProperty(S, {pw: "isLargeArc"}, function () {
return!!this.we
}, function (a) {
t.J(this, a);
this.we = a ? 1 : 0;
this.Za = !0
});
t.defineProperty(S, {Uw: "xAxisRotation"}, function () {
return this.to
}, function (a) {
f && t.o(a, S, "xAxisRotation");
a %= 360;
0 > a && (a += 360);
t.J(this, a);
this.to = a;
this.Za = !0
});
function td() {
this.ea = null;
this.qz = (new C(0, 0)).freeze();
this.Wx = (new C(0, 0)).freeze();
this.Wt = this.Lu = 0;
this.zu = "";
this.wv = this.ju = !1;
this.gu = this.Yt = 0;
this.cj = this.qu = !1;
this.Aq = null;
this.uv = 0;
this.fg = this.sv = null
}
t.ia("InputEvent", td);
td.prototype.copy = function () {
var a = new td;
a.ea = this.ea;
a.qz = this.Bc.copy().freeze();
a.Wx = this.W.copy().freeze();
a.Lu = this.Lu;
a.Wt = this.Wt;
a.zu = this.zu;
a.ju = this.ju;
a.wv = this.wv;
a.Yt = this.Yt;
a.gu = this.gu;
a.qu = this.qu;
a.cj = this.cj;
a.Aq = this.Aq;
a.uv = this.uv;
a.sv = this.sv;
a.fg = this.fg;
return a
};
td.prototype.toString = function () {
var a = "^";
this.Uc && (a += "M:" + this.Uc);
this.button && (a += "B:" + this.button);
this.key && (a += "K:" + this.key);
this.Ae && (a += "C:" + this.Ae);
this.Yj && (a += "D:" + this.Yj);
this.Ee && (a += "h");
this.bubbles && (a += "b");
null !== this.W && (a += "@" + this.W.toString());
return a
};
t.g(td, "diagram", td.prototype.h);
t.defineProperty(td, {h: "diagram"}, function () {
return this.ea
}, function (a) {
this.ea = a
});
t.g(td, "viewPoint", td.prototype.Bc);
t.defineProperty(td, {Bc: "viewPoint"}, function () {
return this.qz
}, function (a) {
t.k(a, C, td, "viewPoint");
this.qz.assign(a)
});
t.g(td, "documentPoint", td.prototype.W);
t.defineProperty(td, {W: "documentPoint"}, function () {
return this.Wx
}, function (a) {
t.k(a, C, td, "documentPoint");
this.Wx.assign(a)
});
t.g(td, "modifiers", td.prototype.Uc);
t.defineProperty(td, {Uc: "modifiers"}, function () {
return this.Lu
}, function (a) {
this.Lu = a
});
t.g(td, "button", td.prototype.button);
t.defineProperty(td, {button: "button"}, function () {
return this.Wt
}, function (a) {
this.Wt = a
});
t.g(td, "key", td.prototype.key);
t.defineProperty(td, {key: "key"}, function () {
return this.zu
}, function (a) {
this.zu = a
});
t.g(td, "down", td.prototype.$j);
t.defineProperty(td, {$j: "down"}, function () {
return this.ju
}, function (a) {
this.ju = a
});
t.g(td, "up", td.prototype.$i);
t.defineProperty(td, {$i: "up"}, function () {
return this.wv
}, function (a) {
this.wv = a
});
t.g(td, "clickCount", td.prototype.Ae);
t.defineProperty(td, {Ae: "clickCount"}, function () {
return this.Yt
}, function (a) {
this.Yt = a
});
t.g(td, "delta", td.prototype.Yj);
t.defineProperty(td, {Yj: "delta"}, function () {
return this.gu
}, function (a) {
this.gu = a
});
t.g(td, "handled", td.prototype.Ee);
t.defineProperty(td, {Ee: "handled"}, function () {
return this.qu
}, function (a) {
this.qu = a
});
t.g(td, "bubbles", td.prototype.bubbles);
t.defineProperty(td, {bubbles: "bubbles"}, function () {
return this.cj
}, function (a) {
this.cj = a
});
t.g(td, "event", td.prototype.event);
t.defineProperty(td, {event: "event"}, function () {
return this.Aq
}, function (a) {
this.Aq = a
});
t.A(td, {sw: "isTouchEvent"}, function () {
var a = window.TouchEvent;
return a && this.event instanceof a
});
t.g(td, "timestamp", td.prototype.timestamp);
t.defineProperty(td, {timestamp: "timestamp"}, function () {
return this.uv
}, function (a) {
this.uv = a
});
t.g(td, "targetDiagram", td.prototype.zg);
t.defineProperty(td, {zg: "targetDiagram"}, function () {
return this.sv
}, function (a) {
this.sv = a
});
t.g(td, "targetObject", td.prototype.Xd);
t.defineProperty(td, {Xd: "targetObject"}, function () {
return this.fg
}, function (a) {
this.fg = a
});
t.g(td, "control", td.prototype.control);
t.defineProperty(td, {control: "control"}, function () {
return 0 !== (this.Uc & 1)
}, function (a) {
this.Uc = a ? this.Uc | 1 : this.Uc & -2
});
t.g(td, "shift", td.prototype.shift);
t.defineProperty(td, {shift: "shift"}, function () {
return 0 !== (this.Uc & 4)
}, function (a) {
this.Uc = a ? this.Uc | 4 : this.Uc & -5
});
t.g(td, "alt", td.prototype.alt);
t.defineProperty(td, {alt: "alt"}, function () {
return 0 !== (this.Uc & 2)
}, function (a) {
this.Uc = a ? this.Uc | 2 : this.Uc & -3
});
t.g(td, "meta", td.prototype.Wm);
t.defineProperty(td, {Wm: "meta"}, function () {
return 0 !== (this.Uc & 8)
}, function (a) {
this.Uc = a ? this.Uc | 8 : this.Uc & -9
});
t.g(td, "left", td.prototype.left);
t.defineProperty(td, {left: "left"}, function () {
return 0 === this.button
}, function (a) {
this.button = a ? 0 : 2
});
t.g(td, "middle", td.prototype.FI);
t.defineProperty(td, {FI: "middle"}, function () {
return 1 === this.button
}, function (a) {
this.button = a ? 1 : 0
});
t.g(td, "right", td.prototype.right);
t.defineProperty(td, {right: "right"}, function () {
return 2 === this.button
}, function (a) {
this.button = a ? 2 : 0
});
function ud() {
this.ea = null;
this.Rb = "";
this.Yu = this.ov = null;
this.Xt = !1
}
t.ia("DiagramEvent", ud);
ud.prototype.copy = function () {
var a = new ud;
a.ea = this.ea;
a.Rb = this.Rb;
a.ov = this.ov;
a.Yu = this.Yu;
a.Xt = this.Xt;
return a
};
ud.prototype.toString = function () {
var a = "*" + this.name;
this.cancel && (a += "x");
null !== this.Pw && (a += ":" + this.Pw.toString());
null !== this.Cw && (a += "(" + this.Cw.toString() + ")");
return a
};
t.g(ud, "diagram", ud.prototype.h);
t.defineProperty(ud, {h: "diagram"}, function () {
return this.ea
}, function (a) {
this.ea = a
});
t.g(ud, "name", ud.prototype.name);
t.defineProperty(ud, {name: "name"}, function () {
return this.Rb
}, function (a) {
this.Rb = a
});
t.g(ud, "subject", ud.prototype.Pw);
t.defineProperty(ud, {Pw: "subject"}, function () {
return this.ov
}, function (a) {
this.ov = a
});
t.g(ud, "parameter", ud.prototype.Cw);
t.defineProperty(ud, {Cw: "parameter"}, function () {
return this.Yu
}, function (a) {
this.Yu = a
});
t.g(ud, "cancel", ud.prototype.cancel);
t.defineProperty(ud, {cancel: "cancel"}, function () {
return this.Xt
}, function (a) {
this.Xt = a
});
function zd() {
this.clear()
}
t.ia("ChangedEvent", zd);
var Ad;
zd.Transaction = Ad = t.w(zd, "Transaction", -1);
var Bd;
zd.Property = Bd = t.w(zd, "Property", 0);
var Cd;
zd.Insert = Cd = t.w(zd, "Insert", 1);
var Dd;
zd.Remove = Dd = t.w(zd, "Remove", 2);
zd.prototype.clear = zd.prototype.clear = function () {
this.gq = Bd;
this.gm = this.Ku = "";
this.Ou = this.Pu = this.Vu = this.bo = this.Uu = this.ea = this.de = null
};
zd.prototype.copy = function () {
var a = new zd;
a.de = this.de;
a.ea = this.ea;
a.gq = this.gq;
a.Ku = this.Ku;
a.gm = this.gm;
a.Uu = this.Uu;
var b = this.bo;
a.bo = t.pb(b) && "function" === typeof b.Z ? b.Z() : b;
b = this.Vu;
a.Vu = t.pb(b) && "function" === typeof b.Z ? b.Z() : b;
b = this.Pu;
a.Pu = t.pb(b) && "function" === typeof b.Z ? b.Z() : b;
b = this.Ou;
a.Ou = t.pb(b) && "function" === typeof b.Z ? b.Z() : b;
return a
};
zd.prototype.toString = function () {
var a = "", a = this.nd === Ad ? a + "* " : this.nd === Bd ? a + (null !== this.fa ? "!m" : "!d") : a + ((null !== this.fa ? "!m" : "!d") + this.nd);
this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName);
this.sf && this.sf !== this.propertyName && (a += " " + this.sf);
a += ": ";
this.nd === Ad ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += ka(this.object)), null !== this.oldValue && (a += " old: " + ka(this.oldValue)), null !== this.Nf && (a += " " + this.Nf), null !== this.newValue &&
(a += " new: " + ka(this.newValue)), null !== this.Lf && (a += " " + this.Lf));
return a
};
zd.prototype.getValue = zd.prototype.Ba = function (a) {
return a ? this.oldValue : this.newValue
};
zd.prototype.getParam = function (a) {
return a ? this.Nf : this.Lf
};
zd.prototype.canUndo = zd.prototype.canUndo = function () {
return null !== this.fa || null !== this.h ? !0 : !1
};
zd.prototype.undo = zd.prototype.undo = function () {
this.canUndo() && (null !== this.fa ? this.fa.changeState(this, !0) : null !== this.h && this.h.changeState(this, !0))
};
zd.prototype.canRedo = zd.prototype.canRedo = function () {
return null !== this.fa || null !== this.h ? !0 : !1
};
zd.prototype.redo = zd.prototype.redo = function () {
this.canRedo() && (null !== this.fa ? this.fa.changeState(this, !1) : null !== this.h && this.h.changeState(this, !1))
};
t.g(zd, "model", zd.prototype.fa);
t.defineProperty(zd, {fa: "model"}, function () {
return this.de
}, function (a) {
this.de = a
});
t.g(zd, "diagram", zd.prototype.h);
t.defineProperty(zd, {h: "diagram"}, function () {
return this.ea
}, function (a) {
this.ea = a
});
t.g(zd, "change", zd.prototype.nd);
t.defineProperty(zd, {nd: "change"}, function () {
return this.gq
}, function (a) {
f && t.tb(a, zd, zd, "change");
this.gq = a
});
t.g(zd, "modelChange", zd.prototype.sf);
t.defineProperty(zd, {sf: "modelChange"}, function () {
return this.Ku
}, function (a) {
f && t.j(a, "string", zd, "modelChange");
this.Ku = a
});
t.g(zd, "propertyName", zd.prototype.propertyName);
t.defineProperty(zd, {propertyName: "propertyName"}, function () {
return this.gm
}, function (a) {
f && "string" !== typeof a && t.k(a, Function, zd, "propertyName");
this.gm = a
});
t.g(zd, "isTransactionFinished", zd.prototype.sI);
t.A(zd, {sI: "isTransactionFinished"}, function () {
return this.gq === Ad && ("CommittedTransaction" === this.gm || "FinishedUndo" === this.gm || "FinishedRedo" === this.gm)
});
t.g(zd, "object", zd.prototype.object);
t.defineProperty(zd, {object: "object"}, function () {
return this.Uu
}, function (a) {
this.Uu = a
});
t.g(zd, "oldValue", zd.prototype.oldValue);
t.defineProperty(zd, {oldValue: "oldValue"}, function () {
return this.bo
}, function (a) {
this.bo = a
});
t.g(zd, "oldParam", zd.prototype.Nf);
t.defineProperty(zd, {Nf: "oldParam"}, function () {
return this.Vu
}, function (a) {
this.Vu = a
});
t.g(zd, "newValue", zd.prototype.newValue);
t.defineProperty(zd, {newValue: "newValue"}, function () {
return this.Pu
}, function (a) {
this.Pu = a
});
t.g(zd, "newParam", zd.prototype.Lf);
t.defineProperty(zd, {Lf: "newParam"}, function () {
return this.Ou
}, function (a) {
this.Ou = a
});
function I(a) {
1 < arguments.length && t.m("Model constructor can only take one optional argument, the Array of node data.");
t.zc(this);
this.Qx = this.Rb = "";
this.Lk = this.nC = !1;
this.Fy = {};
this.Ke = [];
this.uc = new ra(null, Object);
this.cm = "key";
this.bu = this.Du = null;
this.ur = "category";
this.Vf = new ra(null, ta);
this.wj = null;
this.ui = !1;
this.pz = null;
this.Aa = new Md;
void 0 !== a && (this.sg = a)
}
t.ia("Model", I);
I.prototype.clear = I.prototype.clear = function () {
this.Vd && t.Sm(this.Ke, "nodeDataArray", this, !0);
this.Ke = [];
this.uc.clear();
this.Vf.clear();
this.Aa.clear()
};
aa = I.prototype;
aa.Ft = function () {
var a = "";
"" !== this.name && (a += ',\n "name": ' + this.quote(this.name));
"" !== this.Hm && (a += ',\n "dataFormat": ' + this.quote(this.Hm));
this.Ya && (a += ',\n "isReadOnly": ' + this.Ya);
"key" !== this.Wi && "string" === typeof this.Wi && (a += ',\n "nodeKeyProperty": ' + this.quote(this.Wi));
"category" !== this.ql && "string" === typeof this.ql && (a += ',\n "nodeCategoryProperty": ' + this.quote(this.ql));
return a
};
aa.sB = function () {
var a = "", b = this.sA, c = !1, d;
for (d in b)if (!Nd(d, b[d])) {
c = !0;
break
}
c && (a = ',\n "modelData": ' + Od(this, b));
return a + ',\n "nodeDataArray": ' + Pd(this, this.sg, !0)
};
aa.nt = function (a) {
a.name && (this.name = a.name);
a.dataFormat && (this.Hm = a.dataFormat);
a.isReadOnly && (this.Ya = a.isReadOnly);
a.nodeKeyProperty && (this.Wi = a.nodeKeyProperty);
a.nodeCategoryProperty && (this.ql = a.nodeCategoryProperty)
};
aa.JA = function (a) {
var b = a.modelData;
b && (Qd(this, b), this.sA = b);
if (a = a.nodeDataArray)Qd(this, a), this.sg = a
};
aa.toString = function (a) {
void 0 === a && (a = 0);
if (1 < a)return this.jB();
var b = ("" !== this.name ? this.name : "") + " Model";
if (0 < a) {
b += "\n node data:";
a = this.sg;
var c = t.yb(a), d;
for (d = 0; d < c; d++)var e = t.sb(a, d), b = b + (" " + this.Nb(e) + ":" + ka(e))
}
return b
};
I.prototype.toJson = I.prototype.jB = function (a) {
void 0 === a && (a = this.constructor === I ? "go.Model" : this.constructor === U ? "go.GraphLinksModel" : this.constructor === Rd ? "go.TreeModel" : t.Tg(this));
return'{ "class": ' + this.quote(a) + this.Ft() + this.sB() + "}"
};
I.fromJson = function (a, b) {
void 0 === b && (b = null);
b && t.k(b, I, I, "fromJson:model");
var c = null;
if ("string" === typeof a)if (window && window.JSON && window.JSON.parse)try {
c = window.JSON.parse(a)
} catch (d) {
f && t.trace("JSON.parse error: " + d.toString())
} else t.trace("WARNING: no JSON.parse available"); else"object" === typeof a ? c = a : t.m("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 = ba[g]) : (h = ba[g]) || (h = window[g]);
"function" === typeof h && (e = new h)
} catch (k) {
}
null === e || e instanceof I ? b = e : t.m("Unable to construct a Model of declared class: " + c["class"])
}
null === b && (b = new U);
b.nt(c);
b.JA(c);
return b
};
function Qd(a, b) {
if (t.isArray(b))for (var c = t.yb(b), d = 0; d < c; d++) {
var e = t.sb(b, d);
t.pb(e) && t.hD(b, d, Qd(a, e))
} else if (t.pb(b)) {
for (d in b)if (e = b[d], t.pb(e) && (e = Qd(a, e), b[d] = e, "points" === d && Array.isArray(e))) {
for (var g = !0, h = 0; h < e.length; h++)if ("number" !== typeof e[h]) {
g = !1;
break
}
if (g) {
g = new H(C);
for (h = 0; h < e.length / 2; h++) {
var k = new C(e[2 * h], e[2 * h + 1]);
g.add(k)
}
g.freeze();
b[d] = g
}
}
if ("object" !== typeof b)c = b; else {
d = b;
e = b["class"];
if ("NaN" === e)d = NaN; else if ("go.Point" === e)d = new C(Sd(b.x), Sd(b.y)); else if ("go.Size" ===
e)d = new oa(Sd(b.width), Sd(b.height)); else if ("go.Rect" === e)d = new D(Sd(b.x), Sd(b.y), Sd(b.width), Sd(b.height)); else if ("go.Margin" === e)d = new rb(Sd(b.top), Sd(b.right), Sd(b.bottom), Sd(b.left)); else if ("go.Spot" === e)d = "string" === typeof b["enum"] ? Jb(b["enum"]) : new K(Sd(b.x), Sd(b.y), Sd(b.offsetX), Sd(b.offsetY)); else if ("go.Brush" === e) {
if (d = new Td, d.type = t.Km(Td, b.type), b.start instanceof K && (d.start = b.start), b.end instanceof K && (d.end = b.end), "number" === typeof b.startRadius && (d.Jp = Sd(b.startRadius)), "number" === typeof b.endRadius && (d.Mo = Sd(b.endRadius)), e = b.colorStops)for (c in e)d.addColorStop(parseFloat(c), e[c])
} else"go.Geometry" === e && (d = "string" === typeof b.path ? Zc(b.path) : new M, d.type = t.Km(M, b.type), "number" === typeof b.startX && (d.na = Sd(b.startX)), "number" === typeof b.startY && (d.oa = Sd(b.startY)), "number" === typeof b.endX && (d.D = Sd(b.endX)), "number" === typeof b.endY && (d.F = Sd(b.endY)), b.spot1 instanceof K && (d.G = b.spot1), b.spot2 instanceof K && (d.H = b.spot2));
c = d
}
return c
}
return b
}
I.prototype.quote = function (a) {
for (var b = "", c = a.length, d = 0; d < c; d++)var e = a[d], b = '"' === e || "\\" === e ? b + ("\\" + e) : "\b" === e ? b + "\\b" : "\f" === e ? b + "\\f" : "\n" === e ? b + "\\n" : "\r" === e ? b + "\\r" : "\t" === e ? b + "\\t" : b + e;
return'"' + b + '"'
};
I.prototype.writeJsonValue = I.prototype.Tw = 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() : t.isArray(a) ? Pd(this, a) : t.pb(a) ? Od(this, a) : "function" === typeof a ? "null" : a.toString()
};
function Pd(a, b, c) {
var d = t.yb(b), e = "[ ";
c && 1 < d && (e += "\n");
for (var g = 0; g < d; g++) {
var h = t.sb(b, g);
void 0 !== h && (0 < g && (e += ",", c && (e += "\n")), e += a.Tw(h))
}
c && 1 < d && (e += "\n");
return e + " ]"
}
function Nd(a, b) {
return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1
}
function fe(a) {
return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a
}
function Od(a, b) {
var c = b;
if (c instanceof C)b = {"class": "go.Point", x: fe(c.x), y: fe(c.y)}; else if (c instanceof oa)b = {"class": "go.Size", width: fe(c.width), height: fe(c.height)}; else if (c instanceof D)b = {"class": "go.Rect", x: fe(c.x), y: fe(c.y), width: fe(c.width), height: fe(c.height)}; else if (c instanceof rb)b = {"class": "go.Margin", top: fe(c.top), right: fe(c.right), bottom: fe(c.bottom), left: fe(c.left)}; else if (c instanceof K)b = c.qd() ? {"class": "go.Spot", x: fe(c.x), y: fe(c.y), offsetX: fe(c.offsetX), offsetY: fe(c.offsetY)} :
{"class": "go.Spot", "enum": c.toString()}; else if (c instanceof Td) {
b = {"class": "go.Brush", type: c.type.name};
if (c.type === ge)b.color = c.color; else if (c.type === he || c.type === ie)b.start = c.start, b.end = c.end, c.type === ie && (0 !== c.Jp && (b.startRadius = fe(c.Jp)), isNaN(c.Mo) || (b.endRadius = fe(c.Mo)));
if (null !== c.Go) {
for (var d = {}, c = c.Go.l; c.next();)d[c.key.toString()] = c.value;
b.colorStops = d
}
} else if (c instanceof M)b = {"class": "go.Geometry", type: c.type.name}, 0 !== c.na && (b.startX = fe(c.na)), 0 !== c.oa && (b.startY = fe(c.oa)),
0 !== c.D && (b.endX = fe(c.D)), 0 !== c.F && (b.endY = fe(c.F)), c.G.N(Qb) || (b.spot1 = c.G), c.H.N(Zb) || (b.spot2 = c.H), c.type === Kc && (b.path = Xc(c)); else if (c instanceof X || c instanceof u || c instanceof je || c instanceof I || c instanceof ke || c instanceof va || c instanceof le || c instanceof Aa || c instanceof Md || c instanceof ue)return t.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " + c.toString()), "{}";
var d = "{", e = !0, g;
for (g in b)if (c = t.hb(b, g), !Nd(g, c))if (e ?
e = !1 : d += ", ", d += '"' + g + '":', "points" === g && c instanceof H && c.ba === C) {
for (var h = "[", c = c.l; c.next();) {
var k = c.value;
1 < h.length && (h += ",");
h += a.Tw(k.x);
h += ",";
h += a.Tw(k.y)
}
h += "]";
d += h
} else d += a.Tw(c);
return d + "}"
}
function Sd(a) {
return"number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a)
}
t.g(I, "name", I.prototype.name);
t.defineProperty(I, {name: "name"}, function () {
return this.Rb
}, function (a) {
var b = this.Rb;
b !== a && (t.j(a, "string", I, "name"), this.Rb = a, this.i("name", b, a))
});
t.g(I, "dataFormat", I.prototype.Hm);
t.defineProperty(I, {Hm: "dataFormat"}, function () {
return this.Qx
}, function (a) {
var b = this.Qx;
b !== a && (t.j(a, "string", I, "dataFormat"), this.Qx = a, this.i("dataFormat", b, a))
});
t.g(I, "knockoutJS", I.prototype.Vd);
t.defineProperty(I, {Vd: "knockoutJS"}, function () {
return this.nC
}, function (a) {
this.nC = a;
t.qc || (t.qc = "object" === typeof window.ko && "function" === typeof window.ko.isObservable ? window.ko.isObservable : null, a && null === t.qc && t.trace("No value for ko.isObservable: is KnockoutJS library not loaded?"))
});
t.g(I, "isReadOnly", I.prototype.Ya);
t.defineProperty(I, {Ya: "isReadOnly"}, function () {
return this.Lk
}, function (a) {
var b = this.Lk;
b !== a && (t.j(a, "boolean", I, "isReadOnly"), this.Lk = a, this.i("isReadOnly", b, a))
});
t.g(I, "modelData", I.prototype.sA);
t.defineProperty(I, {sA: "modelData"}, function () {
return this.Fy
}, function (a) {
var b = this.Fy;
b !== a && (t.j(a, "object", I, "modelData"), this.Fy = a, this.i("modelData", b, a))
});
I.prototype.addChangedListener = I.prototype.xz = function (a) {
t.j(a, "function", I, "addChangedListener:listener");
null === this.wj && (this.wj = new H("function"));
this.wj.add(a)
};
I.prototype.removeChangedListener = I.prototype.NA = function (a) {
t.j(a, "function", I, "removeChangedListener:listener");
null !== this.wj && (this.wj.remove(a), 0 === this.wj.count && (this.wj = null))
};
I.prototype.Lv = function (a) {
this.Cb || this.Aa.lE(a);
if (null !== this.wj) {
var b = this.wj, c = b.length;
if (1 === c)b = b.pa(0), b(a); else if (0 !== c)for (var d = b.af(), e = 0; e < c; e++)b = d[e], b(a)
}
};
I.prototype.raiseChangedEvent = I.prototype.fd = function (a, b, c, d, e, g, h) {
ve(this, "", a, b, c, d, e, g, h)
};
I.prototype.raiseChanged = I.prototype.i = function (a, b, c, d, e) {
ve(this, "", Bd, a, this, b, c, d, e)
};
I.prototype.raiseDataChanged = I.prototype.Ew = function (a, b, c, d, e, g) {
ve(this, "", Bd, b, a, c, d, e, g)
};
function ve(a, b, c, d, e, g, h, k, l) {
void 0 === k && (k = null);
void 0 === l && (l = null);
var m = new zd;
m.fa = a;
m.nd = c;
m.sf = b;
m.propertyName = d;
m.object = e;
m.oldValue = g;
m.Nf = k;
m.newValue = h;
m.Lf = l;
a.Lv(m)
}
t.g(I, "undoManager", I.prototype.Aa);
t.defineProperty(I, {Aa: "undoManager"}, function () {
return this.pz
}, function (a) {
var b = this.pz;
b !== a && (t.k(a, Md, I, "undoManager"), null !== b && b.YI(this), this.pz = a, null !== a && a.QG(this))
});
t.g(I, "skipsUndoManager", I.prototype.Cb);
t.defineProperty(I, {Cb: "skipsUndoManager"}, function () {
return this.ui
}, function (a) {
t.j(a, "boolean", I, "skipsUndoManager");
this.ui = a
});
I.prototype.changeState = function (a, b) {
if (null !== a && a.fa === this)if (a.nd === Bd) {
var c = a.object, d = a.propertyName, e = a.Ba(b);
t.Ua(c, d, e)
} else a.nd === Cd ? "nodeDataArray" === a.sf ? (c = a.newValue, t.pb(c) && (d = this.Nb(c), void 0 !== d && (b ? (this.Vd && t.qf(c, this, !0), t.Ei(this.Ke, a.Lf), this.uc.remove(d)) : (this.Vd && t.qf(c, this, !1), t.Di(this.Ke, a.Lf, c), this.uc.add(d, c))))) : "" === a.sf ? (c = a.object, !t.isArray(c) && a.propertyName && (c = t.hb(a.object, a.propertyName)), t.isArray(c) && (d = a.newValue, e = a.Lf, b ? t.Ei(c, e) : t.Di(c, e, d))) :
t.m("unknown ChangedEvent.Insert object: " + a.toString()) : a.nd === Dd ? "nodeDataArray" === a.sf ? (c = a.oldValue, t.pb(c) && (d = this.Nb(c), void 0 !== d && (b ? (this.Vd && t.qf(c, this, !1), t.Di(this.Ke, a.Nf, c), this.uc.add(d, c)) : (this.Vd && t.qf(c, this, !0), t.Ei(this.Ke, a.Nf), this.uc.remove(d))))) : "" === a.sf ? (c = a.object, !t.isArray(c) && a.propertyName && (c = t.hb(a.object, a.propertyName)), t.isArray(c) && (d = a.oldValue, e = a.Nf, b ? t.Di(c, e, d) : t.Ei(c, e))) : t.m("unknown ChangedEvent.Remove object: " + a.toString()) : a.nd !== Ad && t.m("unknown ChangedEvent: " +
a.toString())
};
I.prototype.startTransaction = I.prototype.rc = function (a) {
return this.Aa.rc(a)
};
I.prototype.commitTransaction = I.prototype.Ce = function (a) {
return this.Aa.Ce(a)
};
I.prototype.rollbackTransaction = I.prototype.qt = function () {
return this.Aa.qt()
};
I.prototype.updateTargetBindings = I.prototype.Kb = function (a, b) {
void 0 === b && (b = "");
ve(this, "SourceChanged", Ad, b, a, null, null)
};
t.g(I, "nodeKeyProperty", I.prototype.Wi);
t.defineProperty(I, {Wi: "nodeKeyProperty"}, function () {
return this.cm
}, function (a) {
var b = this.cm;
b !== a && (we(a, I, "nodeKeyProperty"), 0 < this.uc.count && t.m("Cannot set Model.nodeKeyProperty when there is existing node data"), this.cm = a, this.i("nodeKeyProperty", b, a))
});
function we(a, b, c) {
"string" !== typeof a && "function" !== typeof a && t.Vb(a, "string or function", b, c)
}
I.prototype.getKeyForNodeData = I.prototype.Nb = function (a) {
if (null !== a) {
var b = this.cm;
if ("" !== b && (b = t.hb(a, b), void 0 !== b)) {
if (xe(b))return b;
t.m("Key value for node data " + a + " is not a number or a string: " + b)
}
}
};
I.prototype.setKeyForNodeData = I.prototype.aB = function (a, b) {
null === b && (b = void 0);
void 0 === b || xe(b) || t.Vb(b, "number or string", I, "setKeyForNodeData:key");
if (null !== a) {
var c = this.cm;
if ("" !== c)if (this.ie(a)) {
var d = t.hb(a, c);
d !== b && null === this.mf(b) && (t.Ua(a, c, b), this.uc.remove(d), this.uc.add(b, a), ve(this, "nodeKey", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c), this.ot(d, b))
} else t.Ua(a, c, b)
}
};
t.g(I, "makeUniqueKeyFunction", I.prototype.DI);
t.defineProperty(I, {DI: "makeUniqueKeyFunction"}, function () {
return this.Du
}, function (a) {
var b = this.Du;
b !== a && (null !== a && t.j(a, "function", I, "makeUniqueKeyFunction"), this.Du = a, this.i("makeUniqueKeyFunction", b, a))
});
function xe(a) {
return"number" === typeof a || "string" === typeof a
}
I.prototype.containsNodeData = I.prototype.ie = function (a) {
a = this.Nb(a);
return void 0 === a ? !1 : this.uc.contains(a)
};
I.prototype.findNodeDataForKey = I.prototype.mf = function (a) {
null === a && t.m("Model.findNodeDataForKey:key must not be null");
return void 0 !== a && xe(a) ? this.uc.Ba(a) : null
};
t.g(I, "nodeDataArray", I.prototype.sg);
t.defineProperty(I, {sg: "nodeDataArray"}, function () {
return this.Ke
}, function (a) {
var b = this.Ke;
if (b !== a) {
t.xs(a, I, "nodeDataArray");
this.Vd && t.qc && (null !== b && t.Sm(b, "nodeDataArray", this, !0), a = t.Sm(a, "nodeDataArray", this, !1));
this.uc.clear();
this.oB();
for (var c = t.yb(a), d = 0; d < c; d++) {
var e = t.sb(a, d);
if (!t.pb(e)) {
t.m("Model.nodeDataArray must only contain Objects, not: " + e);
return
}
t.Os(e)
}
this.Ke = a;
for (var g = new H(Object), d = 0; d < c; d++) {
var e = t.sb(a, d), h = this.Nb(e);
void 0 === h ? g.add(e) : null !== this.uc.Ba(h) ?
g.add(e) : this.uc.add(h, e)
}
for (d = g.l; d.next();)e = d.value, this.ME(e), g = this.Nb(e), this.uc.add(g, e);
ve(this, "nodeDataArray", Bd, "nodeDataArray", this, b, a);
for (d = 0; d < c; d++)e = t.sb(a, d), this.Ap(e), this.zp(e);
this.oD();
t.pI(a) || (this.Ya = !0)
}
});
I.prototype.makeNodeDataKeyUnique = I.prototype.ME = function (a) {
if (null !== a) {
var b = this.cm;
if ("" !== b) {
var c = this.Nb(a);
if (void 0 === c || this.uc.contains(c)) {
var d = this.Du;
if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.uc.contains(c))) {
t.Ua(a, b, c);
return
}
if ("string" === typeof c) {
for (d = 2; this.uc.contains(c + d);)d++;
t.Ua(a, b, c + d)
} else if (void 0 === c || "number" === typeof c) {
for (d = -this.uc.count - 1; this.uc.contains(d);)d--;
t.Ua(a, b, d)
} else t.m("Model.getKeyForNodeData returned something other than a string or a number: " +
c)
}
}
}
};
I.prototype.addNodeData = I.prototype.um = function (a) {
if (null !== a) {
this.Vd && t.qf(a, this, !1);
t.Os(a);
var b = this.Nb(a);
if (void 0 === b || this.uc.Ba(b) !== a)this.ME(a), b = this.Nb(a), this.uc.add(b, a), b = t.yb(this.Ke), t.Di(this.Ke, b, a), ve(this, "nodeDataArray", Cd, "nodeDataArray", this, null, a, null, b), this.Ap(a), this.zp(a)
}
};
I.prototype.addNodeDataCollection = function (a) {
if (t.isArray(a))for (var b = t.yb(a), c = 0; c < b; c++)this.um(t.sb(a, c)); else for (a = a.l; a.next();)this.um(a.value)
};
I.prototype.removeNodeData = I.prototype.Fw = function (a) {
if (null !== a) {
var b = this.Nb(a);
void 0 !== b && this.uc.contains(b) && (this.Vd && t.qf(a, this, !0), this.uc.remove(b), b = t.Ez(this.Ke, a), 0 > b || (t.Ei(this.Ke, b), ve(this, "nodeDataArray", Dd, "nodeDataArray", this, a, null, b, null), this.Et(a)))
}
};
I.prototype.removeNodeDataCollection = function (a) {
if (t.isArray(a))for (var b = t.yb(a), c = 0; c < b; c++)this.Fw(t.sb(a, c)); else for (a = a.l; a.next();)this.Fw(a.value)
};
aa = I.prototype;
aa.ot = function (a, b) {
var c = ye(this, a);
c instanceof ta && this.Vf.add(b, c)
};
aa.oB = function () {
};
aa.Ap = function () {
};
aa.zp = function () {
};
aa.Et = function () {
};
function ze(a, b, c) {
if (void 0 !== b) {
var d = a.Vf.Ba(b);
null === d && (d = new ta, a.Vf.add(b, d));
d.add(c)
}
}
function Ae(a, b, c) {
if (void 0 !== b) {
var d = a.Vf.Ba(b);
d instanceof ta && (void 0 === c || null === c ? a.Vf.remove(b) : (d.remove(c), 0 === d.count && a.Vf.remove(b)))
}
}
function ye(a, b) {
if (void 0 === b)return null;
var c = a.Vf.Ba(b);
return c instanceof ta ? c : null
}
I.prototype.clearUnresolvedReferences = I.prototype.oD = function (a) {
void 0 === a ? this.Vf.clear() : this.Vf.remove(a)
};
t.g(I, "copyNodeDataFunction", I.prototype.tH);
t.defineProperty(I, {tH: "copyNodeDataFunction"}, function () {
return this.bu
}, function (a) {
var b = this.bu;
b !== a && (null !== a && t.j(a, "function", I, "copyNodeDataFunction"), this.bu = a, this.i("copyNodeDataFunction", b, a))
});
I.prototype.copyNodeData = I.prototype.Wj = function (a) {
if (null === a)return null;
var b = null, b = this.bu;
if (null !== b)b = b(a, this); else {
var b = new a.constructor, c;
for (c in a)t.Ua(b, c, t.hb(a, c));
this.Vd && t.qf(b, this, !1)
}
b && t.zc(b);
return b
};
I.prototype.setDataProperty = I.prototype.Lw = function (a, b, c) {
f && (t.j(a, "object", I, "setDataProperty:data"), t.j(b, "string", I, "setDataProperty:propname"), "" === b && t.m("Model.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
if (this.ie(a))if (b === this.Wi)this.aB(a, c); else {
if (b === this.ql) {
this.Jw(a, c);
return
}
} else!t.Np && a instanceof X && (t.Np = !0, t.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), t.trace(" Is that really your intent?"));
var d =
t.hb(a, b);
d !== c && (t.Ua(a, b, c), this.Ew(a, b, d, c))
};
I.prototype.addArrayItem = function (a, b) {
this.lI(a, -1, b)
};
I.prototype.insertArrayItem = I.prototype.lI = function (a, b, c) {
f && (t.xs(a, I, "insertArrayItem:arr"), t.o(b, I, "insertArrayItem:idx"));
a === this.Ke && t.m("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");
0 > b && (b = t.yb(a));
t.Di(a, b, c);
ve(this, "", Cd, "", a, null, c, null, b)
};
I.prototype.removeArrayItem = function (a, b) {
void 0 === b && (b = -1);
f && (t.xs(a, I, "removeArrayItem:arr"), t.o(b, I, "removeArrayItem:idx"));
a === this.Ke && t.m("Model.removeArrayItem should not be called on the Model.nodeDataArray");
-1 === b && (b = t.yb(a) - 1);
var c = t.sb(a, b);
t.Ei(a, b);
ve(this, "", Dd, "", a, c, null, b, null)
};
t.g(I, "nodeCategoryProperty", I.prototype.ql);
t.defineProperty(I, {ql: "nodeCategoryProperty"}, function () {
return this.ur
}, function (a) {
var b = this.ur;
b !== a && (we(a, I, "nodeCategoryProperty"), this.ur = a, this.i("nodeCategoryProperty", b, a))
});
I.prototype.getCategoryForNodeData = I.prototype.getCategoryForNodeData = function (a) {
if (null === a)return"";
var b = this.ur;
if ("" === b)return"";
b = t.hb(a, b);
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("getCategoryForNodeData found a non-string category for " + a + ": " + b);
return""
};
I.prototype.setCategoryForNodeData = I.prototype.Jw = function (a, b) {
t.j(b, "string", I, "setCategoryForNodeData:cat");
if (null !== a) {
var c = this.ur;
if ("" !== c)if (this.ie(a)) {
var d = t.hb(a, c);
void 0 === d && (d = "");
d !== b && (t.Ua(a, c, b), ve(this, "nodeCategory", Bd, c, a, d, b))
} else t.Ua(a, c, b)
}
};
function U(a, b) {
2 < arguments.length && t.m("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");
I.call(this);
this.Lg = [];
this.Yl = new ta(Object);
this.aj = this.au = null;
this.sj = "from";
this.vj = "to";
this.cr = this.br = "";
this.Zq = "category";
this.uh = this.Ru = "";
this.Qu = "isGroup";
this.Bj = "group";
this.Lx = !1;
void 0 !== a && (this.sg = a);
void 0 !== b && (this.Ti = b)
}
t.ia("GraphLinksModel", U);
t.Oa(U, I);
U.prototype.clear = U.prototype.clear = function () {
I.prototype.clear.call(this);
this.Vd && t.Sm(this.Lg, "linkDataArray", this, !0);
this.Lg = [];
this.Yl.clear()
};
aa = U.prototype;
aa.toString = function (a) {
void 0 === a && (a = 0);
if (2 <= a)return this.jB();
var b = ("" !== this.name ? this.name : "") + " GraphLinksModel";
if (0 < a) {
b += "\n node data:";
a = this.sg;
var c = t.yb(a), d;
for (d = 0; d < c; d++)var e = t.sb(a, d), b = b + (" " + this.Nb(e) + ":" + ka(e));
b += "\n link data:";
a = this.Ti;
c = t.yb(a);
for (d = 0; d < c; d++)e = t.sb(a, d), b += " " + this.Nm(e) + "--\x3e" + this.Om(e)
}
return b
};
aa.Ft = function () {
var a = I.prototype.Ft.call(this), b = "";
"category" !== this.gp && "string" === typeof this.gp && (b += ',\n "linkCategoryProperty": ' + this.quote(this.gp));
"from" !== this.hp && "string" === typeof this.hp && (b += ',\n "linkFromKeyProperty": ' + this.quote(this.hp));
"to" !== this.mp && "string" === typeof this.mp && (b += ',\n "linkToKeyProperty": ' + this.quote(this.mp));
"" !== this.ip && "string" === typeof this.ip && (b += ',\n "linkFromPortIdProperty": ' + this.quote(this.ip));
"" !== this.np && "string" === typeof this.np && (b +=
',\n "linkToPortIdProperty": ' + this.quote(this.np));
"" !== this.it && "string" === typeof this.it && (b += ',\n "nodeIsLinkLabelProperty": ' + this.quote(this.it));
"" !== this.jp && "string" === typeof this.jp && (b += ',\n "linkLabelKeysProperty": ' + this.quote(this.jp));
"isGroup" !== this.vp && "string" === typeof this.vp && (b += ',\n "nodeIsGroupProperty": ' + this.quote(this.vp));
"group" !== this.up && "string" === typeof this.up && (b += ',\n "nodeGroupKeyProperty": ' + this.quote(this.up));
return a + b
};
aa.sB = function () {
var a = I.prototype.sB.call(this), b = ',\n "linkDataArray": ' + Pd(this, this.Ti, !0);
return a + b
};
aa.nt = function (a) {
I.prototype.nt.call(this, a);
a.linkFromKeyProperty && (this.hp = a.linkFromKeyProperty);
a.linkToKeyProperty && (this.mp = a.linkToKeyProperty);
a.linkFromPortIdProperty && (this.ip = a.linkFromPortIdProperty);
a.linkToPortIdProperty && (this.np = a.linkToPortIdProperty);
a.linkCategoryProperty && (this.gp = a.linkCategoryProperty);
a.nodeIsLinkLabelProperty && (this.it = a.nodeIsLinkLabelProperty);
a.linkLabelKeysProperty && (this.jp = a.linkLabelKeysProperty);
a.nodeIsGroupProperty && (this.vp = a.nodeIsGroupProperty);
a.nodeGroupKeyProperty && (this.up = a.nodeGroupKeyProperty)
};
aa.JA = function (a) {
I.prototype.JA.call(this, a);
if (a = a.linkDataArray)Qd(this, a), this.Ti = a
};
U.prototype.changeState = function (a, b) {
if (a.nd === Cd) {
var c = null;
"linkDataArray" === a.sf ? c = this.Lg : "linkLabelKeys" === a.sf && (c = this.ll(a.object));
if (t.isArray(c)) {
b ? (this.Vd && t.pb(a.newValue) && t.qf(a.newValue, this, !0), t.Ei(c, a.Lf)) : (this.Vd && t.pb(a.newValue) && t.qf(a.newValue, this, !1), t.Di(c, a.Lf, a.newValue));
return
}
} else if (a.nd === Dd && (c = null, "linkDataArray" === a.sf ? c = this.Lg : "linkLabelKeys" === a.sf && (c = this.ll(a.object)), t.isArray(c))) {
b ? (this.Vd && t.pb(a.oldValue) && t.qf(a.oldValue, this, !1), t.Di(c, a.Nf,
a.oldValue)) : (this.Vd && t.pb(a.oldValue) && t.qf(a.oldValue, this, !0), t.Ei(c, a.Nf));
return
}
I.prototype.changeState.call(this, a, b)
};
t.g(U, "archetypeNodeData", U.prototype.us);
t.defineProperty(U, {us: "archetypeNodeData"}, function () {
return this.aj
}, function (a) {
var b = this.aj;
b !== a && (null !== a && t.k(a, Object, U, "archetypeNodeData"), this.aj = a, this.i("archetypeNodeData", b, a))
});
U.prototype.Vm = function (a) {
if (void 0 !== a) {
var b = this.aj;
if (null !== b) {
var c = this.mf(a);
null === c && (c = this.Wj(b), t.Ua(c, this.cm, a), this.um(c))
}
return a
}
};
t.g(U, "linkFromKeyProperty", U.prototype.hp);
t.defineProperty(U, {hp: "linkFromKeyProperty"}, function () {
return this.sj
}, function (a) {
var b = this.sj;
b !== a && (we(a, U, "linkFromKeyProperty"), this.sj = a, this.i("linkFromKeyProperty", b, a))
});
U.prototype.getFromKeyForLinkData = U.prototype.Nm = function (a) {
if (null !== a) {
var b = this.sj;
if ("" !== b && (b = t.hb(a, b), void 0 !== b)) {
if (xe(b))return b;
t.m("FromKey value for link data " + a + " is not a number or a string: " + b)
}
}
};
U.prototype.setFromKeyForLinkData = U.prototype.YA = function (a, b) {
null === b && (b = void 0);
void 0 === b || xe(b) || t.Vb(b, "number or string", U, "setFromKeyForLinkData:key");
if (null !== a) {
var c = this.sj;
if ("" !== c)if (b = this.Vm(b), this.Hi(a)) {
var d = t.hb(a, c);
d !== b && (Ae(this, d, a), t.Ua(a, c, b), null === this.mf(b) && ze(this, b, a), ve(this, "linkFromKey", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
t.g(U, "linkToKeyProperty", U.prototype.mp);
t.defineProperty(U, {mp: "linkToKeyProperty"}, function () {
return this.vj
}, function (a) {
var b = this.vj;
b !== a && (we(a, U, "linkToKeyProperty"), this.vj = a, this.i("linkToKeyProperty", b, a))
});
U.prototype.getToKeyForLinkData = U.prototype.Om = function (a) {
if (null !== a) {
var b = this.vj;
if ("" !== b && (b = t.hb(a, b), void 0 !== b)) {
if (xe(b))return b;
t.m("ToKey value for link data " + a + " is not a number or a string: " + b)
}
}
};
U.prototype.setToKeyForLinkData = U.prototype.cB = function (a, b) {
null === b && (b = void 0);
void 0 === b || xe(b) || t.Vb(b, "number or string", U, "setToKeyForLinkData:key");
if (null !== a) {
var c = this.vj;
if ("" !== c)if (b = this.Vm(b), this.Hi(a)) {
var d = t.hb(a, c);
d !== b && (Ae(this, d, a), t.Ua(a, c, b), null === this.mf(b) && ze(this, b, a), ve(this, "linkToKey", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
t.g(U, "linkFromPortIdProperty", U.prototype.ip);
t.defineProperty(U, {ip: "linkFromPortIdProperty"}, function () {
return this.br
}, function (a) {
var b = this.br;
b !== a && (we(a, U, "linkFromPortIdProperty"), this.br = a, this.i("linkFromPortIdProperty", b, a))
});
U.prototype.getFromPortIdForLinkData = U.prototype.$H = function (a) {
if (null === a)return"";
var b = this.br;
if ("" === b)return"";
a = t.hb(a, b);
return void 0 === a ? "" : a
};
U.prototype.setFromPortIdForLinkData = U.prototype.ZA = function (a, b) {
t.j(b, "string", U, "setFromPortIdForLinkData:portname");
if (null !== a) {
var c = this.br;
if ("" !== c)if (this.Hi(a)) {
var d = t.hb(a, c);
void 0 === d && (d = "");
d !== b && (t.Ua(a, c, b), ve(this, "linkFromPortId", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
t.g(U, "linkToPortIdProperty", U.prototype.np);
t.defineProperty(U, {np: "linkToPortIdProperty"}, function () {
return this.cr
}, function (a) {
var b = this.cr;
b !== a && (we(a, U, "linkToPortIdProperty"), this.cr = a, this.i("linkToPortIdProperty", b, a))
});
U.prototype.getToPortIdForLinkData = U.prototype.cI = function (a) {
if (null === a)return"";
var b = this.cr;
if ("" === b)return"";
a = t.hb(a, b);
return void 0 === a ? "" : a
};
U.prototype.setToPortIdForLinkData = U.prototype.dB = function (a, b) {
t.j(b, "string", U, "setToPortIdForLinkData:portname");
if (null !== a) {
var c = this.cr;
if ("" !== c)if (this.Hi(a)) {
var d = t.hb(a, c);
void 0 === d && (d = "");
d !== b && (t.Ua(a, c, b), ve(this, "linkToPortId", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
t.g(U, "nodeIsLinkLabelProperty", U.prototype.it);
t.defineProperty(U, {it: "nodeIsLinkLabelProperty"}, function () {
return this.Ru
}, function (a) {
var b = this.Ru;
b !== a && (we(a, U, "nodeIsLinkLabelProperty"), this.Ru = a, this.i("nodeIsLinkLabelProperty", b, a))
});
U.prototype.isLinkLabelForNodeData = U.prototype.oI = function (a) {
if (null === a)return!1;
var b = this.Ru;
return"" === b ? !1 : t.hb(a, b) ? !0 : !1
};
t.g(U, "linkLabelKeysProperty", U.prototype.jp);
t.defineProperty(U, {jp: "linkLabelKeysProperty"}, function () {
return this.uh
}, function (a) {
var b = this.uh;
b !== a && (we(a, U, "linkLabelKeysProperty"), this.uh = a, this.i("linkLabelKeysProperty", b, a))
});
U.prototype.getLabelKeysForLinkData = U.prototype.ll = function (a) {
if (null === a)return t.Vh;
var b = this.uh;
if ("" === b)return t.Vh;
a = t.hb(a, b);
return void 0 === a ? t.Vh : a
};
U.prototype.setLabelKeysForLinkData = U.prototype.zF = function (a, b) {
t.xs(b, U, "setLabelKeysForLinkData:arr");
if (null !== a) {
var c = this.uh;
if ("" !== c)if (this.Hi(a)) {
var d = t.hb(a, c);
void 0 === d && (d = t.Vh);
if (d !== b) {
for (var e = t.yb(d), g = 0; g < e; g++) {
var h = t.sb(d, g);
Ae(this, h, a)
}
t.Ua(a, c, b);
e = t.yb(b);
for (g = 0; g < e; g++)h = t.sb(b, g), null === this.mf(h) && ze(this, h, a);
ve(this, "linkLabelKeys", Bd, c, a, d, b);
"string" === typeof c && this.Kb(a, c)
}
} else t.Ua(a, c, b)
}
};
U.prototype.addLabelKeyForLinkData = U.prototype.cD = function (a, b) {
if (null !== b && void 0 !== b && (xe(b) || t.Vb(b, "number or string", U, "addLabelKeyForLinkData:key"), null !== a)) {
var c = this.uh;
if ("" !== c) {
var d = t.hb(a, c);
void 0 === d ? this.zF(a, [b]) : t.isArray(d) ? 0 <= t.Ez(d, b) || (t.Di(d, Infinity, b), this.Hi(a) && (null === this.mf(b) && ze(this, b, a), ve(this, "linkLabelKeys", Cd, c, a, null, b))) : t.m(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a)
}
}
};
U.prototype.removeLabelKeyForLinkData = U.prototype.XI = function (a, b) {
if (null !== b && void 0 !== b && (xe(b) || t.Vb(b, "number or string", U, "removeLabelKeyForLinkData:key"), null !== a)) {
var c = this.uh;
if ("" !== c) {
var d = t.hb(a, c);
if (t.isArray(d)) {
var e = t.Ez(d, b);
0 > e || (t.Ei(d, e), this.Hi(a) && (Ae(this, b, a), ve(this, "linkLabelKeys", Dd, c, a, b, null)))
} else void 0 !== d && t.m(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a)
}
}
};
t.g(U, "linkDataArray", U.prototype.Ti);
t.defineProperty(U, {Ti: "linkDataArray"}, function () {
return this.Lg
}, function (a) {
var b = this.Lg;
if (b !== a) {
t.xs(a, U, "linkDataArray");
this.Vd && t.qc && (null !== b && t.Sm(b, "linkDataArray", this, !0), a = t.Sm(a, "linkDataArray", this, !1));
for (var c = t.yb(a), d = 0; d < c; d++) {
var e = t.sb(a, d);
if (!t.pb(e)) {
t.m("GraphLinksModel.linkDataArray must only contain Objects, not: " + e);
return
}
t.Os(e)
}
this.Lg = a;
for (var g = new ta(Object), d = 0; d < c; d++)e = t.sb(a, d), g.add(e);
this.Yl = g;
ve(this, "linkDataArray", Bd, "linkDataArray", this, b, a);
for (d =
0; d < c; d++)e = t.sb(a, d), Be(this, e)
}
});
U.prototype.containsLinkData = U.prototype.Hi = function (a) {
return null === a ? !1 : this.Yl.contains(a)
};
U.prototype.addLinkData = U.prototype.Bv = function (a) {
if (null !== a) {
this.Vd && t.qf(a, this, !1);
if (void 0 === t.oc(a))t.zc(a); else if (this.Hi(a))return;
this.Yl.add(a);
var b = t.yb(this.Lg);
t.Di(this.Lg, b, a);
ve(this, "linkDataArray", Cd, "linkDataArray", this, null, a, null, b);
Be(this, a)
}
};
U.prototype.addLinkDataCollection = function (a) {
if (t.isArray(a))for (var b = t.yb(a), c = 0; c < b; c++)this.Bv(t.sb(a, c)); else for (a = a.l; a.next();)this.Bv(a.value)
};
U.prototype.removeLinkData = U.prototype.OA = function (a) {
if (null !== a) {
this.Vd && t.qf(a, this, !0);
this.Yl.remove(a);
var b = this.Lg.indexOf(a);
if (!(0 > b)) {
t.Ei(this.Lg, b);
ve(this, "linkDataArray", Dd, "linkDataArray", this, a, null, b, null);
b = this.Nm(a);
Ae(this, b, a);
b = this.Om(a);
Ae(this, b, a);
var c = this.ll(a);
if (t.isArray(c))for (var d = t.yb(c), e = 0; e < d; e++)b = t.sb(c, e), Ae(this, b, a)
}
}
};
U.prototype.removeLinkDataCollection = function (a) {
if (t.isArray(a))for (var b = t.yb(a), c = 0; c < b; c++)this.OA(t.sb(a, c)); else for (a = a.l; a.next();)this.OA(a.value)
};
function Be(a, b) {
var c = a.Nm(b), c = a.Vm(c);
null === a.mf(c) && ze(a, c, b);
c = a.Om(b);
c = a.Vm(c);
null === a.mf(c) && ze(a, c, b);
var d = a.ll(b);
if (t.isArray(d))for (var e = t.yb(d), g = 0; g < e; g++)c = t.sb(d, g), null === a.mf(c) && ze(a, c, b)
}
t.g(U, "copyLinkDataFunction", U.prototype.sH);
t.defineProperty(U, {sH: "copyLinkDataFunction"}, function () {
return this.au
}, function (a) {
var b = this.au;
b !== a && (null !== a && t.j(a, "function", U, "copyLinkDataFunction"), this.au = a, this.i("copyLinkDataFunction", b, a))
});
U.prototype.copyLinkData = U.prototype.zD = function (a) {
if (null === a)return null;
var b = null, b = this.au;
if (null !== b)b = b(a, this); else {
var b = new a.constructor, c;
for (c in a)t.Ua(b, c, t.hb(a, c));
this.Vd && t.qf(b, this, !1)
}
b && (t.zc(b), "" !== this.sj && t.Ua(b, this.sj, void 0), "" !== this.vj && t.Ua(b, this.vj, void 0), "" !== this.uh && t.Ua(b, this.uh, []));
return b
};
t.g(U, "nodeIsGroupProperty", U.prototype.vp);
t.defineProperty(U, {vp: "nodeIsGroupProperty"}, function () {
return this.Qu
}, function (a) {
var b = this.Qu;
b !== a && (we(a, U, "nodeIsGroupProperty"), this.Qu = a, this.i("nodeIsGroupProperty", b, a))
});
U.prototype.isGroupForNodeData = U.prototype.kA = function (a) {
if (null === a)return!1;
var b = this.Qu;
return"" === b ? !1 : t.hb(a, b) ? !0 : !1
};
t.g(U, "nodeGroupKeyProperty", U.prototype.up);
t.defineProperty(U, {up: "nodeGroupKeyProperty"}, function () {
return this.Bj
}, function (a) {
var b = this.Bj;
b !== a && (we(a, U, "nodeGroupKeyProperty"), this.Bj = a, this.i("nodeGroupKeyProperty", b, a))
});
t.g(U, "copiesGroupKeyOfNodeData", U.prototype.cl);
t.defineProperty(U, {cl: "copiesGroupKeyOfNodeData"}, function () {
return this.Lx
}, function (a) {
this.Lx !== a && (t.j(a, "boolean", U, "copiesGroupKeyOfNodeData"), this.Lx = a)
});
U.prototype.getGroupKeyForNodeData = U.prototype.Vo = function (a) {
if (null !== a) {
var b = this.Bj;
if ("" !== b && (b = t.hb(a, b), void 0 !== b)) {
if (xe(b))return b;
t.m("GroupKey value for node data " + a + " is not a number or a string: " + b)
}
}
};
U.prototype.setGroupKeyForNodeData = U.prototype.$A = function (a, b) {
null === b && (b = void 0);
void 0 === b || xe(b) || t.Vb(b, "number or string", U, "setGroupKeyForNodeData:key");
if (null !== a) {
var c = this.Bj;
if ("" !== c)if (this.ie(a)) {
var d = t.hb(a, c);
d !== b && (Ae(this, d, a), t.Ua(a, c, b), null === this.mf(b) && ze(this, b, a), ve(this, "nodeGroupKey", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
U.prototype.copyNodeData = U.prototype.Wj = function (a) {
if (null === a)return null;
a = I.prototype.Wj.call(this, a);
this.cl || "" === this.Bj || t.Ua(a, this.Bj, void 0);
return a
};
U.prototype.setDataProperty = U.prototype.Lw = function (a, b, c) {
f && (t.j(a, "object", U, "setDataProperty:data"), t.j(b, "string", U, "setDataProperty:propname"), "" === b && t.m("GraphLinksModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
if (this.ie(a))if (b === this.Wi)this.aB(a, c); else {
if (b === this.ql) {
this.Jw(a, c);
return
}
if (b === this.up) {
this.$A(a, c);
return
}
b === this.vp && t.m("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b)
} else if (this.Hi(a)) {
if (b ===
this.hp) {
this.YA(a, c);
return
}
if (b === this.mp) {
this.cB(a, c);
return
}
if (b === this.ip) {
this.ZA(a, c);
return
}
if (b === this.np) {
this.dB(a, c);
return
}
if (b === this.gp) {
this.yF(a, c);
return
}
if (b === this.jp) {
this.zF(a, c);
return
}
} else!t.Np && a instanceof X && (t.Np = !0, t.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), t.trace(" Is that really your intent?"));
var d = t.hb(a, b);
d !== c && (t.Ua(a, b, c), this.Ew(a, b, d, c))
};
aa = U.prototype;
aa.ot = function (a, b) {
I.prototype.ot.call(this, a, b);
for (var c = this.uc.l; c.next();)this.QA(c.value, a, b);
for (c = this.Yl.l; c.next();) {
var d = c.value, e = a, g = b;
if (this.Nm(d) === e) {
var h = this.sj;
t.Ua(d, h, g);
ve(this, "linkFromKey", Bd, h, d, e, g);
"string" === typeof h && this.Kb(d, h)
}
this.Om(d) === e && (h = this.vj, t.Ua(d, h, g), ve(this, "linkToKey", Bd, h, d, e, g), "string" === typeof h && this.Kb(d, h));
var k = this.ll(d);
if (t.isArray(k))for (var l = t.yb(k), h = this.uh, m = 0; m < l; m++)t.sb(k, m) === e && (t.hD(k, m, g), ve(this, "linkLabelKeys", Cd, h, d,
e, g))
}
};
aa.QA = function (a, b, c) {
if (this.Vo(a) === b) {
var d = this.Bj;
t.Ua(a, d, c);
ve(this, "nodeGroupKey", Bd, d, a, b, c);
"string" === typeof d && this.Kb(a, d)
}
};
aa.oB = function () {
I.prototype.oB.call(this);
for (var a = this.Ti, b = t.yb(a), c = 0; c < b; c++) {
var d = t.sb(a, c);
Be(this, d)
}
};
aa.Ap = function (a) {
I.prototype.Ap.call(this, a);
a = this.Nb(a);
var b = ye(this, a);
if (null !== b) {
for (var c = new H(Object), b = b.l; b.next();) {
var d = b.value;
if (this.ie(d)) {
if (this.Vo(d) === a) {
var e = this.Bj;
ve(this, "nodeGroupKey", Bd, e, d, a, a);
"string" === typeof e && this.Kb(d, e);
c.add(d)
}
} else {
this.Nm(d) === a && (e = this.sj, ve(this, "linkFromKey", Bd, e, d, a, a), "string" === typeof e && this.Kb(d, e), c.add(d));
this.Om(d) === a && (e = this.vj, ve(this, "linkToKey", Bd, e, d, a, a), "string" === typeof e && this.Kb(d, e), c.add(d));
var g = this.ll(d);
if (t.isArray(g))for (var h = t.yb(g), e = this.uh, k = 0; k < h; k++)t.sb(g, k) === a && (ve(this, "linkLabelKeys", Cd, e, d, a, a), c.add(d))
}
}
for (c = c.l; c.next();)Ae(this, a, c.value)
}
};
aa.zp = function (a) {
I.prototype.zp.call(this, a);
var b = this.Vo(a);
null === this.mf(b) && ze(this, b, a)
};
aa.Et = function (a) {
I.prototype.Et.call(this, a);
var b = this.Vo(a);
Ae(this, b, a)
};
t.g(U, "linkCategoryProperty", U.prototype.gp);
t.defineProperty(U, {gp: "linkCategoryProperty"}, function () {
return this.Zq
}, function (a) {
var b = this.Zq;
b !== a && (we(a, U, "linkCategoryProperty"), this.Zq = a, this.i("linkCategoryProperty", b, a))
});
U.prototype.getCategoryForLinkData = U.prototype.getCategoryForLinkData = function (a) {
if (null === a)return"";
var b = this.Zq;
if ("" === b)return"";
b = t.hb(a, b);
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("getCategoryForLinkData found a non-string category for " + a + ": " + b);
return""
};
U.prototype.setCategoryForLinkData = U.prototype.yF = function (a, b) {
t.j(b, "string", U, "setCategoryForLinkData:cat");
if (null !== a) {
var c = this.Zq;
if ("" === c)return"";
if (this.Hi(a)) {
var d = t.hb(a, c);
void 0 === d && (d = "");
d !== b && (t.Ua(a, c, b), ve(this, "linkCategory", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
function Rd(a) {
1 < arguments.length && t.m("TreeModel constructor can only take one optional argument, the Array of node data.");
I.call(this);
this.Cj = "parent";
this.Nx = !1;
this.yr = "parentLinkCategory";
void 0 !== a && (this.sg = a)
}
t.ia("TreeModel", Rd);
t.Oa(Rd, I);
Rd.prototype.toString = function (a) {
void 0 === a && (a = 0);
if (2 <= a)return this.jB();
var b = ("" !== this.name ? this.name : "") + " TreeModel";
if (0 < a) {
b += "\n node data:";
a = this.sg;
var c = t.yb(a), d;
for (d = 0; d < c; d++)var e = t.sb(a, d), b = b + (" " + this.Nb(e) + ":" + ka(e))
}
return b
};
Rd.prototype.Ft = function () {
var a = I.prototype.Ft.call(this), b = "";
"parent" !== this.wp && "string" === typeof this.wp && (b += ',\n "nodeParentKeyProperty": ' + this.quote(this.wp));
return a + b
};
Rd.prototype.nt = function (a) {
I.prototype.nt.call(this, a);
a.nodeParentKeyProperty && (this.wp = a.nodeParentKeyProperty)
};
Rd.prototype.Vm = function (a) {
return a
};
t.g(Rd, "nodeParentKeyProperty", Rd.prototype.wp);
t.defineProperty(Rd, {wp: "nodeParentKeyProperty"}, function () {
return this.Cj
}, function (a) {
var b = this.Cj;
b !== a && (we(a, Rd, "nodeParentKeyProperty"), this.Cj = a, this.i("nodeParentKeyProperty", b, a))
});
t.g(Rd, "copiesParentKeyOfNodeData", Rd.prototype.dl);
t.defineProperty(Rd, {dl: "copiesParentKeyOfNodeData"}, function () {
return this.Nx
}, function (a) {
this.Nx !== a && (t.j(a, "boolean", Rd, "copiesParentKeyOfNodeData"), this.Nx = a)
});
Rd.prototype.getParentKeyForNodeData = Rd.prototype.Xo = function (a) {
if (null !== a) {
var b = this.Cj;
if ("" !== b && (b = t.hb(a, b), void 0 !== b)) {
if (xe(b))return b;
t.m("ParentKey value for node data " + a + " is not a number or a string: " + b)
}
}
};
Rd.prototype.setParentKeyForNodeData = Rd.prototype.Oh = function (a, b) {
null === b && (b = void 0);
void 0 === b || xe(b) || t.Vb(b, "number or string", Rd, "setParentKeyForNodeData:key");
if (null !== a) {
var c = this.Cj;
if ("" !== c)if (b = this.Vm(b), this.ie(a)) {
var d = t.hb(a, c);
d !== b && (Ae(this, d, a), t.Ua(a, c, b), null === this.mf(b) && ze(this, b, a), ve(this, "nodeParentKey", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
t.g(Rd, "parentLinkCategoryProperty", Rd.prototype.TI);
t.defineProperty(Rd, {TI: "parentLinkCategoryProperty"}, function () {
return this.yr
}, function (a) {
var b = this.yr;
b !== a && (we(a, Rd, "parentLinkCategoryProperty"), this.yr = a, this.i("parentLinkCategoryProperty", b, a))
});
Rd.prototype.getParentLinkCategoryForNodeData = Rd.prototype.bI = function (a) {
if (null === a)return"";
var b = this.yr;
if ("" === b)return"";
b = t.hb(a, b);
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b);
return""
};
Rd.prototype.setParentLinkCategoryForNodeData = Rd.prototype.cJ = function (a, b) {
t.j(b, "string", Rd, "setParentLinkCategoryForNodeData:cat");
if (null !== a) {
var c = this.yr;
if ("" === c)return"";
if (this.ie(a)) {
var d = t.hb(a, c);
void 0 === d && (d = "");
d !== b && (t.Ua(a, c, b), ve(this, "parentLinkCategory", Bd, c, a, d, b), "string" === typeof c && this.Kb(a, c))
} else t.Ua(a, c, b)
}
};
Rd.prototype.copyNodeData = Rd.prototype.Wj = function (a) {
if (null === a)return null;
a = I.prototype.Wj.call(this, a);
this.dl || "" === this.Cj || t.Ua(a, this.Cj, void 0);
return a
};
Rd.prototype.setDataProperty = Rd.prototype.Lw = function (a, b, c) {
f && (t.j(a, "object", Rd, "setDataProperty:data"), t.j(b, "string", Rd, "setDataProperty:propname"), "" === b && t.m("TreeModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
if (this.ie(a))if (b === this.Wi)this.aB(a, c); else {
if (b === this.ql) {
this.Jw(a, c);
return
}
if (b === this.wp) {
this.Oh(a, c);
return
}
} else!t.Np && a instanceof X && (t.Np = !0, t.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'),
t.trace(" Is that really your intent?"));
var d = t.hb(a, b);
d !== c && (t.Ua(a, b, c), this.Ew(a, b, d, c))
};
aa = Rd.prototype;
aa.ot = function (a, b) {
I.prototype.ot.call(this, a, b);
for (var c = this.uc.l; c.next();)this.QA(c.value, a, b)
};
aa.QA = function (a, b, c) {
if (this.Xo(a) === b) {
var d = this.Cj;
t.Ua(a, d, c);
ve(this, "nodeParentKey", Bd, d, a, b, c);
"string" === typeof d && this.Kb(a, d)
}
};
aa.Ap = function (a) {
I.prototype.Ap.call(this, a);
a = this.Nb(a);
var b = ye(this, a);
if (null !== b) {
for (var c = new H(Object), b = b.l; b.next();) {
var d = b.value;
if (this.ie(d) && this.Xo(d) === a) {
var e = this.Cj;
ve(this, "nodeParentKey", Bd, e, d, a, a);
"string" === typeof e && this.Kb(d, e);
c.add(d)
}
}
for (c = c.l; c.next();)Ae(this, a, c.value)
}
};
aa.zp = function (a) {
I.prototype.zp.call(this, a);
var b = this.Xo(a), b = this.Vm(b);
null === this.mf(b) && ze(this, b, a)
};
aa.Et = function (a) {
I.prototype.Et.call(this, a);
var b = this.Xo(a);
Ae(this, b, a)
};
function Ce(a, b, c) {
t.zc(this);
void 0 === a ? a = "" : t.j(a, "string", Ce, "constructor:targetprop");
void 0 === b ? b = a : t.j(b, "string", Ce, "constructor:sourceprop");
void 0 === c ? c = null : null !== c && t.j(c, "function", Ce, "constructor:conv");
this.OC = "";
this.fg = null;
this.tv = a;
this.rv = this.fz = 0;
this.LC = null;
this.lv = b;
this.Jx = c;
this.Ey = De;
this.Cx = null
}
t.ia("Binding", Ce);
var De;
Ce.OneWay = De = t.w(Ce, "OneWay", 1);
var Ee;
Ce.TwoWay = Ee = t.w(Ce, "TwoWay", 2);
Ce.parseEnum = function (a, b) {
t.j(a, "function", Ce, "parseEnum:ctor");
t.tb(b, a, Ce, "parseEnum:defval");
return function (c) {
return t.Km(a, c) || b
}
};
var ka;
Ce.toString = ka = function (a) {
var b = a;
t.pb(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()
};
Ce.prototype.toString = function () {
return"Binding(" + this.en + " " + this.Bt + ":" + this.eB + ")"
};
Ce.prototype.freeze = function () {
this.jb = !0;
return this
};
Ce.prototype.Va = function () {
this.jb = !1;
return this
};
t.g(Ce, "targetId", Ce.prototype.en);
t.defineProperty(Ce, {en: null}, function () {
return this.OC
}, function (a) {
t.J(this);
t.j(a, "string", Ce, "targetId");
this.OC = a
});
t.g(Ce, "targetProperty", Ce.prototype.Bt);
t.defineProperty(Ce, {Bt: "targetProperty"}, function () {
return this.tv
}, function (a) {
t.J(this);
t.j(a, "string", Ce, "targetProperty");
this.tv = a
});
t.g(Ce, "sourceName", Ce.prototype.yt);
t.defineProperty(Ce, {yt: "sourceName"}, function () {
return this.LC
}, function (a) {
t.J(this);
t.j(a, "string", Ce, "sourceName");
this.LC = a
});
t.g(Ce, "sourceProperty", Ce.prototype.eB);
t.defineProperty(Ce, {eB: "sourceProperty"}, function () {
return this.lv
}, function (a) {
t.J(this);
t.j(a, "string", Ce, "sourceProperty");
this.lv = a
});
t.g(Ce, "converter", Ce.prototype.wD);
t.defineProperty(Ce, {wD: "converter"}, function () {
return this.Jx
}, function (a) {
t.J(this);
null !== a && t.j(a, "function", Ce, "converter");
this.Jx = a
});
t.g(Ce, "backConverter", Ce.prototype.mD);
t.defineProperty(Ce, {mD: "backConverter"}, function () {
return this.Cx
}, function (a) {
t.J(this);
null !== a && t.j(a, "function", Ce, "backConverter");
this.Cx = a
});
t.g(Ce, "mode", Ce.prototype.mode);
t.defineProperty(Ce, {mode: "mode"}, function () {
return this.Ey
}, function (a) {
t.J(this);
t.tb(a, Ce, Ce, "mode");
this.Ey = a
});
Ce.prototype.makeTwoWay = function (a) {
void 0 === a && (a = null);
null !== a && t.j(a, "function", Ce, "makeTwoWay");
this.mode = Ee;
this.mD = a;
return this
};
Ce.prototype.ofObject = Ce.prototype.CA = function (a) {
void 0 === a && (a = "");
f && t.j(a, "string", Ce, "ofObject:srcname");
this.yt = a;
return this
};
Ce.prototype.updateTarget = Ce.prototype.aG = function (a, b, c) {
var d = this.lv;
if (!c || d === c) {
c = this.tv;
var e = this.Jx;
if (null !== e || "" !== c) {
f && "string" === typeof c && ("function" === typeof a.setAttribute || "_" === c[0] || t.jw(a, c) ? "name" === c && a instanceof X && t.trace("Binding error: cannot modify GraphObject.name on " + a.toString()) : t.trace("Binding error: undefined target property: " + c + " on " + a.toString()));
var g = b;
"" !== d && (g = t.hb(b, d));
if (void 0 !== g)if (null === e)"" !== c && t.Ua(a, c, g); else try {
if ("" !== c) {
var h = e(g, a);
f && void 0 === h && t.trace('Binding warning: conversion function returned undefined when setting target property "' + c + '" on ' + a.toString() + ", function is: " + e);
t.Ua(a, c, h)
} else e(g, a)
} catch (k) {
f && t.trace("Binding error: " + k.toString() + ' setting target property "' + c + '" on ' + a.toString() + " with conversion function: " + e)
}
}
}
};
Ce.prototype.updateSource = Ce.prototype.$F = function (a, b, c, d) {
if (this.Ey === Ee) {
var e = this.tv;
if (!c || e === c) {
c = this.lv;
var g = this.Cx;
if (null !== g || "" !== c) {
var h = a;
"" !== e && (h = t.hb(a, e));
if (void 0 !== h)if (null === g)d && d.fa ? (f && d.fa.Wi === c && d.fa.ie(b) && t.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), d.fa.Lw(b, c, h)) : t.Ua(b, c, h); else try {
if ("" !== c) {
var k = g(h, b);
d && d.fa ? (f && (d.fa.Wi === c && d.fa.ie(b) && t.trace("Binding error: cannot have TwoWay Binding on node data key property: " +
this.toString()), void 0 === k && t.trace('Binding warning: conversion function returned undefined when setting source property "' + c + '" on ' + b.toString() + ", function is: " + g)), d.fa.Lw(b, c, k)) : t.Ua(b, c, k)
} else g(h, b)
} catch (l) {
f && t.trace("Binding error: " + l.toString() + ' setting source property "' + c + '" on ' + b.toString() + " with conversion function: " + g)
}
}
}
}
};
function ue() {
this.wG = (new H(zd)).freeze();
this.Rb = "";
this.gC = !1
}
t.ia("Transaction", ue);
ue.prototype.toString = function (a) {
var b = "Transaction: " + this.name + " " + this.Dh.count.toString() + (this.ap ? "" : ", incomplete");
if (void 0 !== a && 0 < a)for (var c = this.Dh.count, d = 0; d < c; d++) {
var e = this.Dh.pa(d);
null !== e && (b += "\n " + e.toString(a - 1))
}
return b
};
ue.prototype.clear = ue.prototype.clear = function () {
var a = this.Dh;
a.Va();
for (var b = a.count - 1; 0 <= b; b--) {
var c = a.pa(b);
null !== c && c.clear()
}
a.clear();
a.freeze()
};
ue.prototype.canUndo = ue.prototype.canUndo = function () {
return this.ap
};
ue.prototype.undo = ue.prototype.undo = function () {
if (this.canUndo())for (var a = this.Dh.count - 1; 0 <= a; a--) {
var b = this.Dh.pa(a);
null !== b && b.undo()
}
};
ue.prototype.canRedo = ue.prototype.canRedo = function () {
return this.ap
};
ue.prototype.redo = ue.prototype.redo = function () {
if (this.canRedo())for (var a = this.Dh.count, b = 0; b < a; b++) {
var c = this.Dh.pa(b);
null !== c && c.redo()
}
};
t.A(ue, {Dh: "changes"}, function () {
return this.wG
});
t.g(ue, "name", ue.prototype.name);
t.defineProperty(ue, {name: "name"}, function () {
return this.Rb
}, function (a) {
this.Rb = a
});
t.g(ue, "isComplete", ue.prototype.ap);
t.defineProperty(ue, {ap: "isComplete"}, function () {
return this.gC
}, function (a) {
this.gC = a
});
function Md() {
this.Gy = new ta(I);
this.gi = !1;
this.zG = (new H(ue)).freeze();
this.Ik = -1;
this.qC = 999;
this.hi = !1;
this.fu = null;
this.Vk = 0;
this.Dx = !1;
f && (this.Dx = !0);
this.Ng = (new H("string")).freeze();
this.ao = new H("number");
this.ey = !0
}
t.ia("UndoManager", Md);
Md.prototype.toString = function (a) {
for (var b = "UndoManager " + this.fk + "<" + this.history.count + "<=" + this.qA, b = b + "[", c = this.WE.count, d = 0; d < c; d++)0 < d && (b += " "), b += this.WE.pa(d);
b += "]";
if (void 0 !== a && 0 < a)for (c = this.history.count, d = 0; d < c; d++)b += "\n " + this.history.pa(d).toString(a - 1);
return b
};
Md.prototype.clear = Md.prototype.clear = function () {
var a = this.history;
a.Va();
for (var b = a.count - 1; 0 <= b; b--) {
var c = a.pa(b);
null !== c && c.clear()
}
a.clear();
this.Ik = -1;
a.freeze();
this.hi = !1;
this.fu = null;
this.Vk = 0;
this.Ng.Va();
this.Ng.clear();
this.Ng.freeze();
this.ao.clear()
};
Md.prototype.addModel = Md.prototype.QG = function (a) {
this.Gy.add(a)
};
Md.prototype.removeModel = Md.prototype.YI = function (a) {
this.Gy.remove(a)
};
Md.prototype.startTransaction = Md.prototype.rc = function (a) {
void 0 === a && (a = "");
null === a && (a = "");
if (this.qb)return!1;
!0 === this.ey && (this.ey = !1, this.Vk++, this.Mc("StartingFirstTransaction", a, this.gl), 0 < this.Vk && this.Vk--);
this.isEnabled && (this.Ng.Va(), this.Ng.add(a), this.Ng.freeze(), null === this.gl ? this.ao.add(0) : this.ao.add(this.gl.Dh.count));
this.Vk++;
var b = 1 === this.Bl;
b && this.Mc("StartedTransaction", a, this.gl);
return b
};
Md.prototype.commitTransaction = Md.prototype.Ce = function (a) {
return Fe(this, !0, a)
};
Md.prototype.rollbackTransaction = Md.prototype.qt = function () {
return Fe(this, !1, "")
};
function Fe(a, b, c) {
if (a.qb)return!1;
a.Hz && 1 > a.Bl && t.trace("Ending transaction without having started a transaction: " + c);
var d = 1 === a.Bl;
d && b && a.isEnabled && a.Mc("CommittingTransaction", c, a.gl);
var e = 0;
if (0 < a.Bl && (a.Vk--, a.isEnabled)) {
var g = a.Ng.count;
0 < g && ("" === c && (c = a.Ng.pa(0)), a.Ng.Va(), a.Ng.Dd(g - 1), a.Ng.freeze());
g = a.ao.count;
0 < g && (e = a.ao.pa(g - 1), a.ao.Dd(g - 1))
}
g = a.gl;
if (d) {
if (b) {
if (a.isEnabled && null !== g) {
b = g;
b.ap = !0;
b.name = c;
d = a.history;
d.Va();
for (e = d.count - 1; e > a.fk; e--)g = d.pa(e), null !== g && g.clear(),
d.Dd(e);
e = a.qA;
0 === e && (e = 1);
0 < e && d.count >= e && (g = d.pa(0), null !== g && g.clear(), d.Dd(0), a.Ik--);
d.add(b);
a.Ik++;
d.freeze();
g = b
}
a.Mc("CommittedTransaction", c, g)
} else {
a.hi = !0;
try {
a.isEnabled && null !== g && (g.ap = !0, g.undo())
} finally {
a.Mc("RolledBackTransaction", c, g), a.hi = !1
}
null !== g && g.clear()
}
a.fu = null;
return!0
}
if (a.isEnabled && !b && null !== g) {
a = e;
c = g.Dh;
for (b = c.count - 1; b >= a; b--)d = c.pa(b), null !== d && d.undo(), c.Va(), c.Dd(b);
c.freeze()
}
return!1
}
Md.prototype.canUndo = Md.prototype.canUndo = function () {
if (!this.isEnabled || 0 < this.Bl || this.qb)return!1;
var a = this.TF;
return null !== a && a.canUndo() ? !0 : !1
};
Md.prototype.undo = Md.prototype.undo = function () {
if (this.canUndo()) {
var a = this.TF;
try {
this.Mc("StartingUndo", "Undo", a), this.hi = !0, this.Ik--, a.undo()
} catch (b) {
t.trace("undo error: " + b.toString())
} finally {
this.hi = !1, this.Mc("FinishedUndo", "Undo", a)
}
}
};
Md.prototype.canRedo = Md.prototype.canRedo = function () {
if (!this.isEnabled || 0 < this.Bl || this.qb)return!1;
var a = this.SF;
return null !== a && a.canRedo() ? !0 : !1
};
Md.prototype.redo = Md.prototype.redo = function () {
if (this.canRedo()) {
var a = this.SF;
try {
this.Mc("StartingRedo", "Redo", a), this.hi = !0, this.Ik++, a.redo()
} catch (b) {
t.trace("redo error: " + b.toString())
} finally {
this.hi = !1, this.Mc("FinishedRedo", "Redo", a)
}
}
};
Md.prototype.Mc = function (a, b, c) {
void 0 === c && (c = null);
var d = new zd;
d.nd = Ad;
d.propertyName = a;
d.object = c;
d.oldValue = b;
for (a = this.GI; a.next();)b = a.value, d.fa = b, b.Lv(d)
};
Md.prototype.handleChanged = Md.prototype.lE = function (a) {
if (this.isEnabled && !this.qb && !this.skipsEvent(a)) {
var b = this.gl;
null === b && (this.fu = b = new ue);
var c = a.copy(), b = b.Dh;
b.Va();
b.add(c);
b.freeze();
this.Hz && 0 >= this.Bl && !this.ey && (a = a.h, null !== a && !1 === a.Yf || t.trace("Change not within a transaction: " + c.toString()))
}
};
Md.prototype.skipsEvent = function (a) {
if (null === a || 0 > a.nd.value)return!0;
a = a.object;
if (a instanceof X) {
if (a = a.layer, null !== a && a.pc)return!0
} else if (a instanceof je && a.pc)return!0;
return!1
};
t.A(Md, {GI: "models"}, function () {
return this.Gy.l
});
t.g(Md, "isEnabled", Md.prototype.isEnabled);
t.defineProperty(Md, {isEnabled: "isEnabled"}, function () {
return this.gi
}, function (a) {
this.gi = a
});
t.A(Md, {TF: "transactionToUndo"}, function () {
return 0 <= this.fk && this.fk <= this.history.count - 1 ? this.history.pa(this.fk) : null
});
t.A(Md, {SF: "transactionToRedo"}, function () {
return this.fk < this.history.count - 1 ? this.history.pa(this.fk + 1) : null
});
t.A(Md, {qb: "isUndoingRedoing"}, function () {
return this.hi
});
t.A(Md, {history: "history"}, function () {
return this.zG
});
t.g(Md, "maxHistoryLength", Md.prototype.qA);
t.defineProperty(Md, {qA: "maxHistoryLength"}, function () {
return this.qC
}, function (a) {
this.qC = a
});
t.A(Md, {fk: "historyIndex"}, function () {
return this.Ik
});
t.A(Md, {gl: "currentTransaction"}, function () {
return this.fu
});
t.A(Md, {Bl: "transactionLevel"}, function () {
return this.Vk
});
t.A(Md, {nI: "isInTransaction"}, function () {
return 0 < this.Vk
});
t.defineProperty(Md, {Hz: "checksTransactionLevel"}, function () {
return this.Dx
}, function (a) {
this.Dx = a
});
t.A(Md, {WE: "nestedTransactionNames"}, function () {
return this.Ng
});
function va() {
0 < arguments.length && t.m("CommandHandler constructor cannot take any arguments.");
this.ea = null;
this.Kx = this.Mx = this.RB = this.JB = !1;
this.Pk = this.Ax = null;
this.ZC = 1.05;
this.QB = 1;
this.By = NaN;
this.oC = null;
this.$C = NaN
}
t.ia("CommandHandler", va);
va.prototype.toString = function () {
return"CommandHandler"
};
t.A(va, {h: "diagram"}, function () {
return this.ea
});
va.prototype.He = function (a) {
f && null !== a && t.k(a, u, va, "setDiagram");
this.ea = a
};
va.prototype.doKeyDown = function () {
var a = this.h;
if (null !== a) {
var b = a.T, c = a.Rl ? b.Wm : 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() : "Del" === g ? this.canDeleteSelection() && this.deleteSelection() : 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() : c && "A" === g ? this.canSelectAll() &&
this.selectAll() : "Esc" === g ? this.canStopCommand() && this.stopCommand() : "Up" === g ? a.jf && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === g ? a.jf && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === g ? a.hf && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === g ? a.hf && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === g ? d && a.hf ? a.scroll("page", "left") : a.jf && a.scroll("page", "up") : "PageDown" === g ? d && a.hf ? a.scroll("page", "right") : a.jf && a.scroll("page", "down") : "Home" ===
g ? (b = a.vc, c && a.jf ? a.position = new C(a.position.x, b.y) : !c && a.hf && (a.position = new C(b.x, a.position.y))) : "End" === g ? (b = a.vc, d = a.nb, c && a.jf ? a.position = new C(d.x, b.bottom - d.height) : !c && a.hf && (a.position = new C(b.right - d.width, d.y))) : "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()
}
};
va.prototype.doKeyUp = function () {
var a = this.h;
null !== a && (a.T.bubbles = !0)
};
va.prototype.stopCommand = function () {
var a = this.h;
if (null !== a) {
var b = a.Ta;
b instanceof Ge && a.Ne && a.Iz();
null !== b && b.doCancel()
}
};
va.prototype.canStopCommand = function () {
return!0
};
va.prototype.selectAll = function () {
var a = this.h;
if (null !== a) {
a.ua();
try {
a.bd = "wait";
a.Ja("ChangingSelection");
for (var b = a.rl; b.next();)b.value.bb = !0;
for (b = a.Xi; b.next();)b.value.bb = !0;
for (b = a.links; b.next();)b.value.bb = !0
} finally {
a.Ja("ChangedSelection"), a.bd = ""
}
}
};
va.prototype.canSelectAll = function () {
var a = this.h;
return null !== a && a.Ne
};
va.prototype.deleteSelection = function () {
var a = this.h;
if (null !== a && !a.Ja("SelectionDeleting", a.selection))try {
a.bd = "wait";
a.rc("Delete");
a.Ja("ChangingSelection");
for (var b = new ta(w), c = a.selection.l; c.next();)He(b, c.value, !0, this.MD ? Infinity : 0, function (a) {
return a.canDelete()
});
a.PA(b, !0);
a.Ja("SelectionDeleted", b)
} finally {
a.Ja("ChangedSelection"), a.Ce("Delete"), a.bd = ""
}
};
va.prototype.canDeleteSelection = function () {
var a = this.h;
return null === a || a.Ya || a.Ve || !a.Zk || 0 === a.selection.count ? !1 : !0
};
function He(a, b, c, d, e) {
if (!(a.contains(b) || (void 0 === e && (e = null), null !== e && !e(b) || b instanceof Ue)))if (a.add(b), b instanceof y) {
if (c && b instanceof z)for (var g = b.Hc; g.next();) {
var h = g.value;
He(a, h, c, d, e)
}
for (h = b.Cd; h.next();)if (g = h.value, !a.contains(g)) {
var k = g.da, l = g.ja;
null !== k && a.contains(k) && null !== l && a.contains(l) ? He(a, g, c, d, e) : null !== k && null !== l || He(a, g, c, d, e)
}
if (1 < d)for (b = b.YD(); b.next();)h = b.value, He(a, h, c, d - 1, e)
} else if (b instanceof A)for (h = b.Si; h.next();)He(a, h.value, c, d, e)
}
va.prototype.copyParts = function (a, b, c) {
var d = new ra(w, w);
for (a = a.l; a.next();) {
var e = a.value;
Ve(this, e, b, d, c)
}
if (null !== b) {
c = b.fa;
a = !1;
null !== b.Eb.ke && (a = b.Eb.ke.Li);
for (var g = new ta(A), h = new ra(A, A), k = d.l; k.next();)if (e = k.value, e instanceof A)a || null !== e.da && null !== e.ja || g.add(e); else if (c instanceof Rd && e instanceof y && null !== e.data) {
var l = e, e = k.key, m = e.ZD();
null !== m && ((m = d.Ba(m)) ? (c.Oh(l.data, c.Nb(m.data)), l = b.If(l.data), e = e.Js(), null !== e && null !== l && h.add(e, l)) : c.Oh(l.data, void 0))
}
0 < g.count && b.PA(g,
!1);
if (0 < h.count)for (b = h.l; b.next();)d.add(b.key, b.value)
}
for (b = d.l; b.next();)b.value.Kb();
return d
};
function Ve(a, b, c, d, e) {
if (null === b || e && !b.canCopy())return null;
if (d.contains(b))return a = d.Ba(b), a instanceof w ? a : null;
var g = null, h = b.data;
if (null !== h && null !== c) {
var k = c.fa;
b instanceof A ? k instanceof U && (h = k.zD(h), t.pb(h) && (k.Bv(h), g = c.If(h))) : (h = k.Wj(h), t.pb(h) && (k.um(h), g = c.Ni(h)))
} else We(b), g = b.copy(), null !== c && g instanceof w && c.add(g);
if (!(g instanceof w))return null;
g.bb = !1;
d.add(b, g);
if (b instanceof y) {
for (k = b.Cd; k.next();) {
h = k.value;
if (h.da === b) {
var l = d.Ba(h);
null !== l && (l.da = g)
}
h.ja === b &&
(l = d.Ba(h), null !== l && (l.ja = g))
}
if (b instanceof z && g instanceof z)for (b = b.Hc; b.next();)k = Ve(a, b.value, c, d, e), k instanceof A || null === k || (k.fb = g)
} else if (b instanceof A)for (k = b.da, null !== k && (k = d.Ba(k), null !== k && (g.da = k)), k = b.ja, null !== k && (k = d.Ba(k), null !== k && (g.ja = k)), b = b.Si; b.next();)k = Ve(a, b.value, c, d, e), null !== k && (k.Tc = g);
return g
}
va.prototype.copySelection = function () {
var a = this.h;
if (null !== a) {
for (var b = new ta(w), a = a.selection.l; a.next();)He(b, a.value, !0, this.yD ? Infinity : 0, function (a) {
return a.canCopy()
});
this.copyToClipboard(b)
}
};
va.prototype.canCopySelection = function () {
var a = this.h;
return null !== a && a.Rj && a.Fv && 0 !== a.selection.count ? !0 : !1
};
va.prototype.cutSelection = function () {
this.copySelection();
this.deleteSelection()
};
va.prototype.canCutSelection = function () {
var a = this.h;
return null !== a && !a.Ya && !a.Ve && a.Rj && a.Zk && a.Fv && 0 !== a.selection.count ? !0 : !1
};
va.prototype.copyToClipboard = function (a) {
var b = this.h;
if (null !== b) {
var c = null;
if (null === a)t.ys = null, t.Nv = ""; else {
var c = b.fa, d = !1, e = !1, g = null;
try {
c instanceof Rd && (d = c.dl, c.dl = this.Mz), c instanceof U && (e = c.cl, c.cl = this.Lz), g = b.copyParts(a, null, !0)
} finally {
c instanceof Rd && (c.dl = d), c instanceof U && (c.cl = e), c = new H(w), c.Me(g), t.ys = c, t.Nv = b.fa.Hm
}
}
b.Ja("ClipboardChanged", c)
}
};
va.prototype.pasteFromClipboard = function () {
var a = new ta(w), b = t.ys;
if (null === b)return a;
var c = this.h;
if (null === c || t.Nv !== c.fa.Hm)return a;
var d = c.fa, e = !1, g = !1, h = null;
try {
d instanceof Rd && (e = d.dl, d.dl = this.Mz), d instanceof U && (g = d.cl, d.cl = this.Lz), h = c.copyParts(b, c, !1)
} finally {
for (d instanceof Rd && (d.dl = e), d instanceof U && (d.cl = g), b = h.l; b.next();)c = b.value, d = b.key, c.location.Q() || (d.location.Q() ? c.location = d.location : !c.position.Q() && d.position.Q() && (c.position = d.position)), a.add(c)
}
return a
};
va.prototype.pasteSelection = function (a) {
var b = this.h;
if (null !== b)try {
b.bd = "wait";
b.rc("Paste");
b.Ja("ChangingSelection");
var c = this.pasteFromClipboard();
0 < c.count && Xe(b);
for (var d = c.l; d.next();)d.value.bb = !0;
b.Ja("ChangedSelection");
if (a instanceof C) {
var e = b.computePartsBounds(b.selection);
if (e) {
var g = b.Eb.ke, h = g.computeEffectiveCollection(b.selection);
g.moveParts(h, new C(a.x - e.Fa, a.y - e.Sa), !1)
}
}
b.Ja("ClipboardPasted", c)
} finally {
b.Ce("Paste"), b.bd = ""
}
};
va.prototype.canPasteSelection = function () {
var a = this.h;
return null === a || a.Ya || a.Ve || !a.vm || !a.Fv || null === t.ys || t.Nv !== a.fa.Hm ? !1 : !0
};
va.prototype.undo = function () {
var a = this.h;
null !== a && a.Aa.undo()
};
va.prototype.canUndo = function () {
var a = this.h;
return null === a || a.Ya || a.Ve ? !1 : a.Az && a.Aa.canUndo()
};
va.prototype.redo = function () {
var a = this.h;
null !== a && a.Aa.redo()
};
va.prototype.canRedo = function () {
var a = this.h;
return null === a || a.Ya || a.Ve ? !1 : a.Az && a.Aa.canRedo()
};
va.prototype.decreaseZoom = function (a) {
void 0 === a && (a = 1 / this.Gt);
t.o(a, va, "decreaseZoom:factor");
var b = this.h;
null !== b && b.zm === Ye && (a *= b.scale, a < b.qg || a > b.pg || (b.scale = a))
};
va.prototype.canDecreaseZoom = function (a) {
void 0 === a && (a = 1 / this.Gt);
t.o(a, va, "canDecreaseZoom:factor");
var b = this.h;
if (null === b || b.zm !== Ye)return!1;
a *= b.scale;
return a < b.qg || a > b.pg ? !1 : b.Do
};
va.prototype.increaseZoom = function (a) {
void 0 === a && (a = this.Gt);
t.o(a, va, "increaseZoom:factor");
var b = this.h;
null !== b && b.zm === Ye && (a *= b.scale, a < b.qg || a > b.pg || (b.scale = a))
};
va.prototype.canIncreaseZoom = function (a) {
void 0 === a && (a = this.Gt);
t.o(a, va, "canIncreaseZoom:factor");
var b = this.h;
if (null === b || b.zm !== Ye)return!1;
a *= b.scale;
return a < b.qg || a > b.pg ? !1 : b.Do
};
va.prototype.resetZoom = function (a) {
void 0 === a && (a = this.GD);
t.o(a, va, "resetZoom:newscale");
var b = this.h;
null === b || a < b.qg || a > b.pg || (b.scale = a)
};
va.prototype.canResetZoom = function (a) {
void 0 === a && (a = 1);
t.o(a, va, "canResetZoom:newscale");
var b = this.h;
return null === b || a < b.qg || a > b.pg ? !1 : b.Do
};
va.prototype.zoomToFit = function () {
var a = this.h;
if (null !== a) {
var b = a.scale, c = a.position;
b !== this.$C || isNaN(this.By) ? (this.By = b, this.oC = c.copy(), a.zoomToFit(), a.Vi(), this.$C = a.scale) : (a.scale = this.By, a.position = this.oC)
}
};
va.prototype.canZoomToFit = function () {
var a = this.h;
return null === a ? !1 : a.Do
};
va.prototype.collapseTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.rc("Collapse Tree");
var c = new H(y);
if (a instanceof y && a.Sc)a.collapseTree(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof y && d.Sc && (d.collapseTree(), c.add(d))
}
b.Ja("TreeCollapsed", c);
b.Ce("Collapse Tree")
};
va.prototype.canCollapseTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ya)return!1;
if (a instanceof y) {
if (!a.Sc)return!1;
if (0 < a.fw().count)return!0
} else for (a = b.selection.l; a.next();)if (b = a.value, b instanceof y && b.Sc && 0 < b.fw().count)return!0;
return!1
};
va.prototype.expandTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.rc("Expand Tree");
var c = new H(y);
if (a instanceof y && !a.Sc)a.expandTree(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof y && !d.Sc && (d.expandTree(), c.add(d))
}
b.Ja("TreeExpanded", c);
b.Ce("Expand Tree")
};
va.prototype.canExpandTree = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ya)return!1;
if (a instanceof y) {
if (a.Sc)return!1;
if (0 < a.fw().count)return!0
} else for (a = b.selection.l; a.next();)if (b = a.value, b instanceof y && !b.Sc && 0 < b.fw().count)return!0;
return!1
};
va.prototype.groupSelection = function () {
var a = this.h;
if (null !== a) {
var b = a.fa;
if (null !== b && b instanceof U) {
var c = this.Cz;
if (null !== c) {
var d = null;
try {
a.bd = "wait";
a.rc("Group");
a.Ja("ChangingSelection");
for (var e = new H(w), g = a.selection.l; g.next();) {
var h = g.value;
h.Ud() && h.canGroup() && e.add(h)
}
for (var k = new H(w), l = e.l; l.next();) {
for (var m = l.value, h = !1, g = e.l; g.next();)if (m.Us(g.value)) {
h = !0;
break
}
h || k.add(m)
}
if (0 < k.count) {
g = k.l;
g.next();
var n = g.value.fb;
if (null !== n)for (; null !== n;) {
g = k.l;
g.next();
for (e = !1; g.next();)if (m = g.value, !m.Us(n)) {
e = !0;
break
}
if (e)n = n.fb; else break
}
if (c instanceof z)We(c), d = c.copy(), d instanceof z && a.add(d); else if (b.kA(c)) {
var p = b.Wj(c);
t.pb(p) && (b.um(p), d = a.ew(p))
}
if (d instanceof z) {
null !== n && this.isValidMember(n, d) && (d.fb = n);
for (g = k.l; g.next();)m = g.value, this.isValidMember(d, m) && (m.fb = d);
a.select(d)
}
}
a.Ja("ChangedSelection");
a.Ja("SelectionGrouped", d)
} finally {
a.Ce("Group"), a.bd = ""
}
}
}
}
};
va.prototype.canGroupSelection = function () {
var a = this.h;
if (null === a || a.Ya || a.Ve || !a.vm || !a.xo)return!1;
var b = a.fa;
if (null === b || !(b instanceof U) || null === this.Cz)return!1;
for (a = a.selection.l; a.next();)if (b = a.value, b.Ud() && b.canGroup())return!0;
return!1
};
function Ze(a) {
var b = t.Db();
for (a = a.l; a.next();) {
var c = a.value;
c instanceof A || b.push(c)
}
a = new ta(w);
for (var c = b.length, d = 0; d < c; d++) {
for (var e = b[d], g = !0, h = 0; h < c; h++)if (e.Us(b[h])) {
g = !1;
break
}
g && a.add(e)
}
t.Da(b);
return a
}
va.prototype.isValidMember = function (a, b) {
if (null === b || a === b || b instanceof A)return!1;
if (null !== a) {
if (a === b || a.Us(b))return!1;
var c = a.at;
if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data)return!1
}
c = this.at;
return null !== c ? c(a, b) : !0
};
va.prototype.ungroupSelection = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null !== b) {
var c = b.fa;
if (null !== c && c instanceof U)try {
b.bd = "wait";
b.rc("Ungroup");
b.Ja("ChangingSelection");
var d = new H(z);
if (a instanceof z)d.add(a); else for (var e = b.selection.l; e.next();) {
var g = e.value;
g instanceof z && g.canUngroup() && d.add(g)
}
if (0 < d.count)for (b.Iz(), e = d.l; e.next();) {
var h = e.value, k = h.data, l = h.fb, m = null !== l && null !== l.data ? c.Nb(l.data) : void 0, n = new H(w);
n.Me(h.Hc);
for (var p = n.l; p.next();) {
var q = p.value;
if (!(q instanceof A)) {
var r = q.data;
null !== r ? c.$A(r, m) : q.fb = l;
q.bb = !0
}
}
null !== k ? c.Fw(k) : b.remove(h)
}
b.Ja("ChangedSelection");
b.Ja("SelectionUngrouped", d, n)
} finally {
b.Ce("Ungroup"), b.bd = ""
}
}
};
va.prototype.canUngroupSelection = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ya || b.Ve || !b.Zk || !b.Co)return!1;
var c = b.fa;
if (null === c || !(c instanceof U))return!1;
if (a instanceof z) {
if (a.canUngroup())return!0
} else for (a = b.selection.l; a.next();)if (b = a.value, b instanceof z && b.canUngroup())return!0;
return!1
};
va.prototype.addTopLevelParts = function (a, b) {
for (var c = !0, d = Ze(a).l; d.next();) {
var e = d.value;
null !== e.fb && (!b || this.isValidMember(null, e) ? e.fb = null : c = !1)
}
return c
};
va.prototype.collapseSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.rc("Collapse SubGraph");
var c = new H(z);
if (a instanceof z && a.of)a.collapseSubGraph(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof z && d.of && (d.collapseSubGraph(), c.add(d))
}
b.Ja("SubGraphCollapsed", c);
b.Ce("Collapse SubGraph")
};
va.prototype.canCollapseSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ya)return!1;
if (a instanceof z)return a.of ? !0 : !1;
for (a = b.selection.l; a.next();)if (b = a.value, b instanceof z && b.of)return!0;
return!1
};
va.prototype.expandSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b)return!1;
b.rc("Expand SubGraph");
var c = new H(z);
if (a instanceof z && !a.of)a.expandSubGraph(), c.add(a); else for (a = b.selection.l; a.next();) {
var d = a.value;
d instanceof z && !d.of && (d.expandSubGraph(), c.add(d))
}
b.Ja("SubGraphExpanded", c);
b.Ce("Expand SubGraph")
};
va.prototype.canExpandSubGraph = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ya)return!1;
if (a instanceof z)return a.of ? !1 : !0;
for (a = b.selection.l; a.next();)if (b = a.value, b instanceof z && !b.of)return!0;
return!1
};
va.prototype.editTextBlock = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null !== b) {
var c = b.Eb.Qw;
if (null !== c) {
if (null === a) {
a = b.selection.l;
for (var d = null; a.next();) {
var e = a.value;
if (e.canEdit()) {
d = e;
break
}
}
if (null === d)return;
a = $e(d, function (a) {
return a instanceof ua && a.Yv
})
}
null !== a && a instanceof ua && (c.Ag = a, b.Ta = c)
}
}
};
va.prototype.canEditTextBlock = function (a) {
void 0 === a && (a = null);
var b = this.h;
if (null === b || b.Ya || b.Ve || !b.Bo || null === b.Eb.Qw)return!1;
if (a instanceof ua) {
if (a = a.U, null !== a && a.canEdit())return!0
} else for (b = b.selection.l; b.next();)if (a = b.value, a.canEdit() && (a = $e(a, function (a) {
return a instanceof ua && a.Yv
}), null !== a))return!0;
return!1
};
va.prototype.showContextMenu = function (a) {
var b = this.h;
if (null !== b) {
var c = b.Eb.Sv;
if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.eb() : b), a = c.findObjectWithContextMenu(a), null !== a)) {
var d = new td, e = null;
a instanceof X ? e = a.gb(Ub) : b.Pn || (e = b.nb, e = new C(e.x + e.width / 2, e.y + e.height / 2));
null !== e && (d.Bc = b.gn(e), d.W = e, b.cc = d);
b.Ta = c;
af(c, !1, a)
}
}
};
va.prototype.canShowContextMenu = function (a) {
var b = this.h;
if (null === b)return!1;
var c = b.Eb.Sv;
if (null === c)return!1;
void 0 === a && (a = 0 < b.selection.count ? b.selection.eb() : b);
return null === c.findObjectWithContextMenu(a) ? !1 : !0
};
t.g(va, "copiesTree", va.prototype.yD);
t.defineProperty(va, {yD: "copiesTree"}, function () {
return this.JB
}, function (a) {
this.JB = a
});
t.g(va, "deletesTree", va.prototype.MD);
t.defineProperty(va, {MD: "deletesTree"}, function () {
return this.RB
}, function (a) {
this.RB = a
});
t.g(va, "copiesParentKey", va.prototype.Mz);
t.defineProperty(va, {Mz: "copiesParentKey"}, function () {
return this.Mx
}, function (a) {
this.Mx !== a && (t.j(a, "boolean", va, "copiesParentKey"), this.Mx = a)
});
t.g(va, "copiesGroupKey", va.prototype.Lz);
t.defineProperty(va, {Lz: "copiesGroupKey"}, function () {
return this.Kx
}, function (a) {
this.Kx !== a && (t.j(a, "boolean", va, "copiesGroupKey"), this.Kx = a)
});
t.g(va, "archetypeGroupData", va.prototype.Cz);
t.defineProperty(va, {Cz: "archetypeGroupData"}, function () {
return this.Ax
}, function (a) {
null !== a && t.k(a, Object, va, "archetypeGroupData");
var b = this.h;
null !== b && (b = b.fa, b instanceof U && (a instanceof z || b.kA(a) || t.m("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a)));
this.Ax = a
});
t.g(va, "memberValidation", va.prototype.at);
t.defineProperty(va, {at: "memberValidation"}, function () {
return this.Pk
}, function (a) {
null !== a && t.j(a, "function", va, "memberValidation");
this.Pk = a
});
t.g(va, "defaultScale", va.prototype.GD);
t.defineProperty(va, {GD: "defaultScale"}, function () {
return this.QB
}, function (a) {
t.o(a, va, "defaultScale");
0 < a || t.m("defaultScale must be larger than zero, not: " + a);
this.QB = a
});
t.g(va, "zoomFactor", va.prototype.Gt);
t.defineProperty(va, {Gt: "zoomFactor"}, function () {
return this.ZC
}, function (a) {
t.o(a, va, "zoomFactor");
1 < a || t.m("zoomFactor must be larger than 1.0, not: " + a);
this.ZC = a
});
function ke() {
0 < arguments.length && t.m("Tool constructor cannot take any arguments.");
t.zc(this);
this.ea = null;
this.Rb = "";
this.gi = !0;
this.eC = !1;
this.WC = null;
this.zv = -1
}
t.ia("Tool", ke);
ke.prototype.He = function (a) {
f && null !== a && t.k(a, u, ke, "setDiagram");
this.ea = a
};
ke.prototype.toString = function () {
return"" !== this.name ? this.name + " Tool" : t.Tg(Object.getPrototypeOf(this))
};
ke.prototype.updateAdornments = function () {
};
ke.prototype.canStart = function () {
return this.isEnabled
};
ke.prototype.doStart = function () {
};
ke.prototype.doActivate = function () {
this.qa = !0
};
ke.prototype.doDeactivate = function () {
this.qa = !1
};
ke.prototype.doStop = function () {
};
ke.prototype.doCancel = function () {
this.stopTool()
};
ke.prototype.stopTool = function () {
var a = this.h;
null !== a && a.Ta === this && (a.Ta = null, a.bd = "")
};
ke.prototype.doMouseDown = function () {
!this.qa && this.canStart() && this.doActivate()
};
ke.prototype.doMouseMove = function () {
};
ke.prototype.doMouseUp = function () {
this.stopTool()
};
ke.prototype.doMouseWheel = function () {
};
ke.prototype.doKeyDown = function () {
var a = this.h;
null !== a && "Esc" === a.T.key && this.doCancel()
};
ke.prototype.doKeyUp = function () {
};
ke.prototype.startTransaction = ke.prototype.rc = function (a) {
this.bf = null;
var b = this.h;
return null === b ? !1 : b.rc(a)
};
ke.prototype.stopTransaction = ke.prototype.jk = function () {
var a = this.h;
return null === a ? !1 : null === this.bf ? a.qt() : a.Ce(this.bf)
};
ke.prototype.standardMouseSelect = function () {
var a = this.h;
if (null !== a && a.Ne) {
var b = a.T, c = a.Hs(b.W, !1);
if (null !== c)if (a.Rl ? b.Wm : b.control) {
a.Ja("ChangingSelection");
for (b = c; null !== b && !b.canSelect();)b = b.fb;
null !== b && (b.bb = !b.bb);
a.Ja("ChangedSelection")
} else if (b.shift) {
if (!c.bb) {
a.Ja("ChangingSelection");
for (b = c; null !== b && !b.canSelect();)b = b.fb;
null !== b && (b.bb = !0);
a.Ja("ChangedSelection")
}
} else {
if (!c.bb) {
for (b = c; null !== b && !b.canSelect();)b = b.fb;
null !== b && a.select(b)
}
} else!b.left || (a.Rl ? b.Wm : b.control) ||
b.shift || a.Iz()
}
};
ke.prototype.standardMouseClick = function (a, b) {
void 0 === a && (a = null);
void 0 === b && (b = function (a) {
return!a.layer.pc
});
var c = this.h;
if (null !== c) {
var d = c.T, e = c.Qd(d.W, a, b);
d.Xd = e;
bf(e, d, c)
}
};
function bf(a, b, c) {
var d = 0;
b.left ? d = 1 === b.Ae ? 1 : 2 === b.Ae ? 2 : 1 : b.right && 1 === b.Ae && (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;) {
e = null;
switch (d) {
case 1:
e = a.click;
break;
case 2:
e = a.Jm ? a.Jm : a.click;
break;
case 3:
e = a.Bs
}
if (null !==
e && (e(b, a), b.Ee))break;
a = a.ga
} else {
e = null;
switch (d) {
case 1:
e = c.click;
break;
case 2:
e = c.Jm ? c.Jm : c.click;
break;
case 3:
e = c.Bs
}
null !== e && e(b)
}
}
ke.prototype.standardMouseOver = function () {
var a = this.h;
if (null !== a) {
var b = a.T;
if (null !== b.h) {
var c = a.Qd(b.W, null, null);
b.Xd = c;
var d = a.Cb;
a.Cb = !0;
var e = !1;
if (c !== a.Io) {
var g = a.Io;
a.GA = g;
a.Io = c;
for (this.doCurrentObjectChanged(g, c); null !== g;) {
var h = g.vA;
if (null !== h) {
if (c === g)break;
if (null !== c && c.Ri(g))break;
h(b, g, c);
e = !0;
if (b.Ee)break
}
g = g.ga
}
for (g = a.GA; null !== c;) {
h = c.uA;
if (null !== h) {
if (g === c)break;
if (null !== g && g.Ri(c))break;
h(b, c, g);
e = !0;
if (b.Ee)break
}
c = c.ga
}
c = a.Io
}
if (null !== c) {
g = c;
for (h = ""; null !== g;) {
h =
g.cursor;
if ("" !== h)break;
g = g.ga
}
a.bd = h;
for (g = c; null !== g;) {
h = g.et;
if (null !== h && (h(b, g), e = !0, b.Ee))break;
g = g.ga
}
} else a.bd = "", h = a.et, null !== h && (h(b), e = !0);
e && a.Of();
a.Cb = d
}
}
};
ke.prototype.doCurrentObjectChanged = function () {
};
ke.prototype.standardMouseWheel = function () {
var a = this.h;
if (null !== a) {
var b = a.T, c = b.Yj;
if (0 !== c && a.vc.Q()) {
var d = a.Eb.Xm;
if (a.Do && (d === cf && !b.shift || d === df && b.control))d = a.Uh, a.Uh = b.Bc, 0 < c ? a.Qe.increaseZoom() : a.Qe.decreaseZoom(), a.Uh = d, b.bubbles = !1; else if (d === cf && b.shift || d === df && !b.control) {
var d = a.position.copy(), e = 0 < c ? c : -c;
if (!b.shift && a.jf) {
var g = a.Ep, e = e / 40 * g;
0 < c ? a.scroll("pixel", "up", e) : a.scroll("pixel", "down", e)
} else b.shift && a.hf && (g = a.Dp, e = e / 40 * g, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel",
"right", e));
a.position.N(d) || (b.bubbles = !1)
}
}
}
};
ke.prototype.standardWaitAfter = function (a) {
t.j(a, "number", ke, "standardWaitAfter:delay");
this.cancelWaitAfter();
var b = this;
this.zv = window.setTimeout(function () {
b.doWaitAfter()
}, a)
};
ke.prototype.cancelWaitAfter = function () {
-1 !== this.zv && window.clearTimeout(this.zv);
this.zv = -1
};
ke.prototype.doWaitAfter = function () {
};
ke.prototype.findToolHandleAt = function (a, b) {
var c = this.h;
if (null === c)return null;
c = c.Qd(a, null, function (a) {
a = a.U;
return null === a ? !1 : null !== a.Oc
});
if (null === c)return null;
var d = c.U;
return null === d || d.Pc !== b ? null : c
};
ke.prototype.isBeyondDragSize = function (a, b) {
var c = this.h;
if (null === c)return!1;
void 0 === a && (a = c.Fc.Bc);
void 0 === b && (b = c.T.Bc);
var d = c.Eb.PD, c = d.width, d = d.height;
t.gB && (c += 6, d += 6);
return Math.abs(b.x - a.x) > c || Math.abs(b.y - a.y) > d
};
t.A(ke, {h: "diagram"}, function () {
return this.ea
});
t.g(ke, "name", ke.prototype.name);
t.defineProperty(ke, {name: "name"}, function () {
return this.Rb
}, function (a) {
this.Rb = a
});
t.g(ke, "isEnabled", ke.prototype.isEnabled);
t.defineProperty(ke, {isEnabled: "isEnabled"}, function () {
return this.gi
}, function (a) {
this.gi = a
});
t.g(ke, "isActive", ke.prototype.qa);
t.defineProperty(ke, {qa: "isActive"}, function () {
return this.eC
}, function (a) {
this.eC = a
});
t.g(ke, "transactionResult", ke.prototype.bf);
t.defineProperty(ke, {bf: "transactionResult"}, function () {
return this.WC
}, function (a) {
this.WC = a
});
function ef() {
0 < arguments.length && t.m("DraggingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "Dragging";
this.IB = !0;
this.Ql = this.Zp = this.WB = !1;
this.sy = !0;
this.iy = (new oa(NaN, NaN)).freeze();
this.jy = Qb;
this.ky = (new C(NaN, NaN)).freeze();
this.VB = !1;
this.TB = this.HB = this.UB = this.LB = this.ti = null;
this.wq = this.hC = !1;
this.no = new C(NaN, NaN);
this.mv = new C;
this.pv = !1;
this.kv = !0;
this.Cn = 100;
this.Jl = this.$u = null
}
t.ia("DraggingTool", ef);
t.Oa(ef, ke);
t.g(ef, "copiesEffectiveCollection", ef.prototype.xD);
t.defineProperty(ef, {xD: "copiesEffectiveCollection"}, function () {
return this.IB
}, function (a) {
this.IB = a
});
t.g(ef, "dragsTree", ef.prototype.QD);
t.defineProperty(ef, {QD: "dragsTree"}, function () {
return this.WB
}, function (a) {
this.WB = a
});
t.g(ef, "isGridSnapEnabled", ef.prototype.cp);
t.defineProperty(ef, {cp: "isGridSnapEnabled"}, function () {
return this.Ql
}, function (a) {
this.Ql !== a && (t.j(a, "boolean", ef, "isGridSnapEnabled"), this.Ql = a)
});
t.g(ef, "isGridSnapRealtime", ef.prototype.yE);
t.defineProperty(ef, {yE: "isGridSnapRealtime"}, function () {
return this.sy
}, function (a) {
this.sy !== a && (t.j(a, "boolean", ef, "isGridSnapRealtime"), this.sy = a)
});
t.g(ef, "gridSnapCellSize", ef.prototype.cA);
t.defineProperty(ef, {cA: "gridSnapCellSize"}, function () {
return this.iy
}, function (a) {
this.iy.N(a) || (t.k(a, oa, ef, "gridSnapCellSize"), this.iy = a = a.Z())
});
t.g(ef, "gridSnapCellSpot", ef.prototype.iE);
t.defineProperty(ef, {iE: "gridSnapCellSpot"}, function () {
return this.jy
}, function (a) {
this.jy.N(a) || (t.k(a, K, ef, "gridSnapCellSpot"), this.jy = a = a.Z())
});
t.g(ef, "gridSnapOrigin", ef.prototype.jE);
t.defineProperty(ef, {jE: "gridSnapOrigin"}, function () {
return this.ky
}, function (a) {
this.ky.N(a) || (t.k(a, C, ef, "gridSnapOrigin"), this.ky = a = a.Z())
});
t.g(ef, "dragsLink", ef.prototype.Li);
t.defineProperty(ef, {Li: "dragsLink"}, function () {
return this.VB
}, function (a) {
this.VB = a
});
t.g(ef, "currentPart", ef.prototype.Jo);
t.defineProperty(ef, {Jo: "currentPart"}, function () {
return this.LB
}, function (a) {
this.LB = a
});
t.g(ef, "copiedParts", ef.prototype.od);
t.defineProperty(ef, {od: "copiedParts"}, function () {
return this.HB
}, function (a) {
this.HB = a
});
t.g(ef, "draggedParts", ef.prototype.wc);
t.defineProperty(ef, {wc: "draggedParts"}, function () {
return this.UB
}, function (a) {
this.UB = a
});
t.g(ef, "draggedLink", ef.prototype.cd);
t.defineProperty(ef, {cd: "draggedLink"}, function () {
return this.TB
}, function (a) {
this.TB = a
});
t.g(ef, "isDragOutStarted", ef.prototype.nw);
t.defineProperty(ef, {nw: "isDragOutStarted"}, function () {
return this.hC
}, function (a) {
this.hC = a
});
t.g(ef, "startPoint", ef.prototype.Yi);
t.defineProperty(ef, {Yi: "startPoint"}, function () {
return this.mv
}, function (a) {
this.mv.N(a) || (t.k(a, C, ef, "startPoint"), this.mv = a = a.Z())
});
t.g(ef, "delay", ef.prototype.Wv);
t.defineProperty(ef, {Wv: "delay"}, function () {
return this.Cn
}, function (a) {
this.Cn = a
});
ef.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || !a.$k && !a.Rj && !a.Gv || !a.Ne)return!1;
var b = a.T;
return!b.left || a.Ta !== this && (!this.isBeyondDragSize() || b.sw && b.timestamp - a.Fc.timestamp < this.Cn) ? !1 : null !== this.findDraggablePart()
};
ef.prototype.findDraggablePart = function () {
var a = this.h;
if (null === a)return null;
a = a.Hs(a.Fc.W, !1);
if (null === a)return null;
for (; null !== a && !a.canSelect();)a = a.fb;
return null !== a && (a.canMove() || a.canCopy()) ? a : null
};
ef.prototype.standardMouseSelect = function () {
var a = this.h;
if (null !== a && a.Ne) {
var b = a.Hs(a.Fc.W, !1);
if (null !== b) {
for (; null !== b && !b.canSelect();)b = b.fb;
this.Jo = b;
this.Jo.bb || (a.Ja("ChangingSelection"), b = a.T, (a.Rl ? b.Wm : b.control) || b.shift || Xe(a), this.Jo.bb = !0, a.Ja("ChangedSelection"))
}
}
};
ef.prototype.doActivate = function () {
var a = this.h;
if (null !== a) {
this.standardMouseSelect();
var b = this.Jo;
null !== b && (b.canMove() || b.canCopy()) && (this.qa = !0, this.no.set(a.position), ff(this, a.selection), this.Jl = this.$u = null, this.wc = this.computeEffectiveCollection(a.selection), a.Yy = !0, gf(this, this.wc), this.rc("Drag"), this.Yi = a.Fc.W, a.zd = !0, a.Gv && (this.nw = !0, this.wq = !1, hf = this, jf = this.h))
}
};
function ff(a, b) {
if (a.Li) {
var c = a.h;
null !== c && c.Sj && (c.fa instanceof U && 1 === b.count && b.eb()instanceof A ? (a.cd = b.eb(), a.cd.canRelinkFrom() && a.cd.canRelinkTo() && a.cd.ze(), a.ti = c.Eb.MA, null === a.ti && (a.ti = new tf, a.ti.h = c)) : (a.cd = null, a.ti = null))
}
}
ef.prototype.computeEffectiveCollection = function (a) {
var b = null !== this.h && this.h.Ta === this, c = new ra(w, Object);
if (null === a)return c;
for (var d = a.l; d.next();) {
var e = d.value;
uf(this, c, e, b)
}
if (null !== this.cd && this.Li)return c;
for (d = a.l; d.next();)e = d.value, e instanceof A && (a = e, b = a.da, null === b || c.contains(b) ? (b = a.ja, null === b || c.contains(b) || c.remove(a)) : c.remove(a));
return c
};
function vf(a) {
return void 0 === a ? {point: J.nk, Xy: J.nk} : {point: a.copy(), Xy: J.nk}
}
function uf(a, b, c, d) {
if (!b.contains(c) && (!d || c.canMove() || c.canCopy()))if (c instanceof y) {
b.add(c, vf(c.location));
if (c instanceof z)for (var e = c.Hc; e.next();) {
var g = e.value;
uf(a, b, g, d)
}
for (g = c.Cd; g.next();)if (e = g.value, !b.contains(e)) {
var h = e.da, k = e.ja;
null !== h && b.contains(h) && null !== k && b.contains(k) && uf(a, b, e, d)
}
if (a.QD)for (c = c.YD(); c.next();)g = c.value, uf(a, b, g, d)
} else if (c instanceof A)for (e = c, b.add(e, vf()), g = e.Si; g.next();)uf(a, b, g.value, d); else c instanceof Ue || b.add(c, vf(c.location))
}
ef.prototype.doDeactivate = function () {
this.qa = !1;
var a = this.h;
null !== a && wf(a);
xf(this);
yf(this, this.wc);
this.wc = null;
this.wq = this.nw = !1;
if (0 < zf.count) {
for (var b = zf.length, c = 0; c < b; c++) {
var d = zf.p[c];
Af(d);
Bf(d);
xf(d);
null !== d.h && wf(d.h)
}
zf.clear()
}
Af(this);
this.no.Fp(NaN, NaN);
hf = jf = null;
Bf(this);
a.zd = !1;
a.Yy = !1;
this.jk()
};
function xf(a) {
var b = a.h;
if (null !== b) {
var c = b.Cb;
b.Cb = !0;
for (var d = b.T, e = a.Jl; null !== e;) {
var g = e.tA;
if (null !== g && (g(d, e, null), d.Ee))break;
e = e.ga
}
b.Cb = c
}
a.$u = null;
a.Jl = null
}
ef.prototype.doCancel = function () {
Bf(this);
Cf(this);
var a = this.h;
null !== a && this.no.Q() && (a.position = this.no);
this.stopTool()
};
function gf(a, b) {
if (null !== b) {
a.pv = !0;
for (var c = b.l; c.next();) {
var d = c.key;
d instanceof A && (d.Kp = !0)
}
}
}
function yf(a, b) {
if (null !== b && a.pv) {
for (var c = b.l; c.next();) {
var d = c.key;
d instanceof A && (d.Kp = !1, d.Qi ? Df(d) && d.$b() : d.aa())
}
a.pv = !1
}
}
ef.prototype.doKeyDown = function () {
var a = this.h;
null !== a && (a = a.T, null !== a && this.qa && ("Esc" === a.key ? this.doCancel() : this.doMouseMove()))
};
ef.prototype.doKeyUp = function () {
var a = this.h;
null !== a && null !== a.T && this.qa && this.doMouseMove()
};
function Ef(a, b) {
for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = a.l; h.next();) {
var k = h.value;
if (k.Ud()) {
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.q(0, 0, 0, 0) : b.q(c, d, e - c, g - d)
}
function Ff(a, b) {
if (null === a.od) {
var c = a.h;
if (null !== c && !c.Ya && !c.Ve && null !== a.wc) {
Cf(a);
c.Cb = !b;
a.Zp = !b;
a.Yi = c.Fc.W;
for (var c = a.xD ? c.copyParts(a.wc.Al(), c, !0) : c.copyParts(c.selection, c, !0), d = c.l; d.next();)d.value.location = d.key.location;
d = t.xf();
Ef(c, d);
t.Qc(d);
for (var d = new ra(w, Object), e = a.wc.l; e.next();) {
var g = e.key;
g.Ud() && g.canCopy() && (g = c.Ba(g), null !== g && (a.Zp && (g.Ad = "Tool"), g.Hf(), d.add(g, vf(g.location))))
}
for (c = c.l; c.next();)e = c.value, e instanceof A && e.canCopy() && d.add(e, vf());
a.od = d;
ff(a,
d.Al());
null !== a.cd && (c = a.cd, d = c.nj(), c.pl(a.Yi.x - (d.x + d.width / 2), a.Yi.y - (d.y + d.height / 2)))
}
}
}
function Bf(a) {
var b = a.h;
null !== b && (null !== a.od && (b.PA(a.od.Al(), !1), a.od = null), b.Cb = !1, a.Zp = !1, a.Yi = b.Fc.W)
}
function Af(a) {
if (null !== a.cd) {
if (a.Li && null !== a.ti) {
var b = a.ti;
b.h.remove(b.Yd);
b.h.remove(b.Zd)
}
a.cd = null;
a.ti = null
}
}
function Gf(a, b, c) {
var d = a.h;
if (null !== d) {
var e = a.Yi, g = t.O();
g.assign(d.T.W);
a.moveParts(b, g.zt(e), c);
t.B(g)
}
}
ef.prototype.moveParts = function (a, b, c) {
if (null !== a && (t.k(a, ra, ef, "moveParts:parts"), 0 !== a.count)) {
var d = t.O(), e = t.O();
e.assign(b);
isNaN(e.x) && (e.x = 0);
isNaN(e.y) && (e.y = 0);
var g = this.pv;
g || gf(this, a);
for (var h = new H, k = new H(Pa), l = a.l; l.next();) {
var m = l.key;
if (m.Ud()) {
var n = Sf(this, m, a);
if (null !== n)h.add({Ic: m, info: l.value, dI: n}); else if (!c || m.canMove()) {
n = l.value.point;
d.assign(n);
var p = this.computeMove(m, d.add(e), a);
m.location = p;
l.value.Xy = p.zt(n)
}
} else l.key instanceof A && k.add(l.be)
}
for (c = h.l; c.next();)h =
c.value, n = h.info.point, d.assign(n), h.Ic.location = d.add(h.dI.Xy);
n = t.O();
c = t.O();
for (k = k.l; k.next();)if (p = k.value, h = p.key, h instanceof A)if (h.Kp)if (l = h.da, m = h.ja, null !== this.cd && this.Li)p = p.value.point, a.add(h, vf(e)), l = b.x - p.x, m = b.y - p.y, h.pl(l, m); else {
if (null !== l) {
n.assign(l.location);
var q = a.Ba(l);
null !== q && n.zt(q.point)
}
null !== m && (c.assign(m.location), q = a.Ba(m), null !== q && c.zt(q.point));
null !== l && null !== m ? n.Mi(c) ? (p = p.value.point, l = d, l.assign(n), l.zt(p), a.add(h, vf(n)), h.pl(l.x, l.y)) : (h.Kp = !1, h.$b()) :
(p = p.value.point, a.add(h, vf(null !== l ? n : null !== m ? c : b)), l = e.x - p.x, m = e.y - p.y, h.pl(l, m))
} else if (null === h.da || null === h.ja)p = p.value.point, a.add(h, vf(b)), l = e.x - p.x, m = e.y - p.y, h.pl(l, m);
t.B(d);
t.B(e);
t.B(n);
t.B(c);
g || yf(this, a)
}
};
function Sf(a, b, c) {
b = b.fb;
if (null !== b) {
a = Sf(a, b, c);
if (null !== a)return a;
a = c.Ba(b);
if (null !== a)return a
}
return null
}
function Cf(a) {
if (null !== a.wc) {
for (var b = a.h, c = a.wc.l; c.next();) {
var d = c.key;
d.Ud() && (d.location = c.value.point)
}
for (c = a.wc.l; c.next();)if (d = c.key, d instanceof A && d.Kp) {
var e = c.value.point;
a.wc.add(d, vf());
d.pl(-e.x, -e.y)
}
b.Ac()
}
}
ef.prototype.computeMove = function (a, b, c, d) {
void 0 === d && (d = new C);
d.assign(b);
if (null === a)return d;
void 0 === c && (c = null);
var e = b;
if (this.cp && (this.yE || null === c || this.h.T.$i) && (e = t.O(), c = e, c.assign(b), null !== a)) {
var g = this.h;
if (null !== g) {
var h = g.Yo, k = this.cA, g = k.width, k = k.height, l = this.jE, m = l.x, l = l.y, n = this.iE;
if (null !== h) {
var p = h.Ms;
isNaN(g) && (g = p.width);
isNaN(k) && (k = p.height);
h = h.bA;
isNaN(m) && (m = h.x);
isNaN(l) && (l = h.y)
}
h = t.ic(0, 0);
h.wt(0, 0, g, k, n);
J.Gs(b.x, b.y, m + h.x, l + h.y, g, k, c);
t.B(h)
}
}
c = null !== a.Rz ?
a.Rz(a, b, e) : e;
k = a.TE;
g = k.x;
isNaN(g) && (g = a.location.x);
k = k.y;
isNaN(k) && (k = a.location.y);
h = a.NE;
m = h.x;
isNaN(m) && (m = a.location.x);
h = h.y;
isNaN(h) && (h = a.location.y);
d.q(Math.max(g, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h)));
e !== b && t.B(e);
return d
};
function Tf(a, b) {
if (null === b)return!0;
var c = b.U;
return null === c || c instanceof Ue || c.layer.pc || a.wc && a.wc.contains(c) || a.od && a.od.contains(c) ? !0 : !1
}
function Uf(a, b, c, d) {
var e = a.h;
if (null !== e) {
a.Li && (null !== a.cd && (a.cd.da = null, a.cd.ja = null), Vf(a, !1));
var g = !1;
!1 === a.kv && (g = e.Cb, e.Cb = !0);
var h = !1, k = Wf(e, b, null, function (b) {
return!Tf(a, b)
}), l = e.T;
l.Xd = k;
var m = e.Cb;
e.Cb = !0;
if (k !== a.Jl) {
var n = a.Jl;
a.$u = n;
for (a.Jl = k; null !== n;) {
var p = n.tA;
if (null !== p) {
if (k === n)break;
if (null !== k && k.Ri(n))break;
p(l, n, k);
h = !0;
if (l.Ee)break
}
n = n.ga
}
for (n = a.$u; null !== k;) {
p = k.UE;
if (null !== p) {
if (n === k)break;
if (null !== n && n.Ri(k))break;
p(l, k, n);
h = !0;
if (l.Ee)break
}
k = k.ga
}
k = a.Jl
}
null ===
k && (p = e.VE, null !== p && (p(l), h = !0));
a.doDragOver(b, k);
e.Cb = m;
h && e.Vi();
!1 === a.kv && (e.Cb = g);
(e.hf || e.jf) && (c || d) && Xf(e, b)
}
}
function Yf(a, b, c) {
var d = a.ti;
if (null === d)return null;
var e = a.h.Lm(b, d.EA, function (a) {
return d.findValidLinkablePort(a, c)
});
a = t.O();
for (var g = Infinity, h = null, e = e.l; e.next();) {
var k = e.value;
if (null !== k.U) {
var l = k.gb(Ub, a), l = b.Zj(l);
l < g && (h = k, g = l)
}
}
t.B(a);
return h
}
function Vf(a, b) {
var c = a.cd;
if (null !== c && !(2 > c.ma)) {
var d = a.h;
if (null !== d && !d.Ya && (d = a.ti, null !== d)) {
var e = null, g = null;
null === c.da && (e = Yf(a, c.n(0), !1), null !== e && (g = e.U));
var h = null, k = null;
null === c.ja && (h = Yf(a, c.n(c.ma - 1), !0), null !== h && (k = h.U));
if ((null === g || g instanceof y) && (null === k || k instanceof y)) {
var l = d.isValidLink(g, e, k, h);
b ? (c.wn = c.n(0).copy(), c.An = c.n(c.ma - 1).copy(), c.Kp = !1, c.da = g, null !== e && (c.nf = e.rd), c.ja = k, null !== h && (c.Rf = h.rd)) : l ? Zf(d, g, e, k, h) : Zf(d, null, null, null, null)
}
}
}
}
ef.prototype.doDragOver = function () {
};
function $f(a, b) {
var c = a.h;
if (null !== c && null !== c.fa) {
a.Li && Vf(a, !0);
xf(a);
var d = Wf(c, b, null, function (b) {
return!Tf(a, b)
}), e = c.T;
e.Xd = d;
if (null !== d)for (var g = d; null !== g;) {
var h = g.bt;
if (null !== h && (h(e, g), e.Ee))break;
g = g.ga
} else h = c.bt, null !== h && h(e);
a.doDropOnto(b, d);
for (d = c.selection.l; d.next();)e = d.value, e instanceof y && ag(c, e.ya)
}
}
ef.prototype.doDropOnto = function () {
};
ef.prototype.doMouseMove = function () {
if (this.qa) {
var a = this.h;
if (null !== a && null !== this.Jo && null !== this.wc) {
var b = !1, c = !1;
this.mayCopy() ? (b = !0, Ff(this, !1), Gf(this, this.od, !0)) : this.mayMove() ? (c = !0, Bf(this), Gf(this, this.wc, !0)) : Bf(this);
Uf(this, a.T.W, c, b)
}
}
};
ef.prototype.doMouseUp = function () {
if (this.qa) {
this.wq = !0;
var a = this.h;
if (null !== a) {
var b = !1, c = this.mayCopy();
c && null !== this.od ? (Cf(this), Bf(this), Ff(this, !0), Gf(this, this.od, !0), null !== this.od && a.uF(this.od.Al())) : (b = !0, Bf(this), this.mayMove() && (Gf(this, this.wc, !0), this.kv = !1, Uf(this, a.T.W, !0, !1), this.kv = !0));
$f(this, a.T.W);
if (this.qa) {
this.od = null;
if (b && null !== this.wc)for (b = this.wc.l; b.next();) {
var d = b.key;
d instanceof y && (d = d.fb, null === d || null === d.placeholder || this.wc.contains(d) || d.Jz && d.aa())
}
a.Ac();
yf(this, this.wc);
this.bf = c ? "Copy" : "Move";
a.Ja(c ? "SelectionCopied" : "SelectionMoved", a.selection)
}
this.stopTool()
}
}
};
ef.prototype.mayCopy = function () {
var a = this.h;
if (null === a || a.Ya || a.Ve || !a.vm || !a.Rj || (a.Rl ? !a.T.Wm : !a.T.control))return!1;
for (a = a.selection.l; a.next();) {
var b = a.value;
if (b.Ud() && b.canCopy())return!0
}
return null !== this.cd && this.Li && this.cd.canCopy() ? !0 : !1
};
ef.prototype.mayMove = function () {
var a = this.h;
if (null === a || a.Ya || !a.$k)return!1;
for (a = a.selection.l; a.next();) {
var b = a.value;
if (b.Ud() && b.canMove())return!0
}
return null !== this.cd && this.Li && this.cd.canMove() ? !0 : !1
};
var zf = new H(ef), hf = null, jf = null;
ef.prototype.mayCopyExternal = function () {
var a = this.h;
return null === a || !a.zz || a.Ya || a.Ve || !a.vm || null === a.fa ? !1 : !0
};
ef.prototype.doSimulatedDragEnter = function () {
if (this.mayCopyExternal()) {
var a = hf;
if (null !== a) {
Bf(a);
Cf(a);
var b = a.h;
null !== b && a.no.Q() && (b.position = a.no);
null !== b && wf(b)
}
zf.contains(this) || zf.add(this)
}
};
ef.prototype.doSimulatedDragLeave = function () {
hf.nw = !1;
this.doCancel()
};
ef.prototype.doSimulatedDragOver = function () {
if (this.mayCopyExternal()) {
var a = this.h;
if (null !== a) {
var b = hf;
null !== b && null !== b.wc && (bg(this, b.wc.Al(), !1), Gf(this, this.od, !1), Uf(this, a.T.W, !1, !0))
}
}
};
ef.prototype.doSimulatedDrop = function () {
var a = hf;
if (null !== a && (a.wq = !0, Bf(this), this.mayCopyExternal())) {
var b = this.h;
null !== b && (this.rc("Drop"), bg(this, a.wc.Al(), !0), Gf(this, this.od, !0), null !== this.od && b.uF(this.od.Al()), this.bf = "ExternalCopy", $f(this, b.T.W), this.od = null, b.Ja("ExternalObjectsDropped", b.selection), this.jk(), b.Ac())
}
};
function bg(a, b, c) {
if (null === a.od) {
var d = a.h;
if (null !== d && !d.Ya && !d.Ve && null !== d.fa) {
d.Cb = !c;
a.Zp = !c;
a.Yi = d.T.W;
d = d.copyParts(b, d, !0);
c = t.xf();
Ef(b, c);
var e = c.x + c.width / 2, g = c.y + c.height / 2;
t.Qc(c);
var h = a.mv;
c = new ra(w, Object);
var k = t.O();
for (b = b.l; b.next();) {
var l = b.value;
if (l.Ud() && l.canCopy()) {
var m = l.location, l = d.Ba(l);
k.q(h.x - (e - m.x), h.y - (g - m.y));
l.location = k;
a.Zp && (l.Ad = "Tool");
l.Hf();
c.add(l, vf(k))
}
}
t.B(k);
for (d = d.l; d.next();)e = d.value, e instanceof A && e.canCopy() && c.add(e, vf());
a.od = c;
ff(a,
c.Al());
null !== a.cd && (c = a.cd, d = c.nj(), c.pl(a.Yi.x - (d.x + d.width / 2), a.Yi.y - (d.y + d.height / 2)))
}
}
}
function cg() {
0 < arguments.length && t.m("LinkingBaseTool constructor cannot take any arguments.");
ke.call(this);
this.Ry = 100;
this.yy = !1;
var a = new A, b = new Y;
b.Ih = !0;
b.stroke = "blue";
a.add(b);
b = new Y;
b.fn = "Standard";
b.fill = "blue";
b.stroke = "blue";
a.add(b);
a.Ad = "Tool";
this.lz = a;
a = new y;
b = new Y;
b.rd = "";
b.Jb = "Rectangle";
b.fill = null;
b.stroke = "magenta";
b.ib = 2;
b.Ca = J.mx;
a.add(b);
a.ik = !1;
a.Ad = "Tool";
this.jz = a;
this.kz = b;
a = new y;
b = new Y;
b.rd = "";
b.Jb = "Rectangle";
b.fill = null;
b.stroke = "magenta";
b.ib = 2;
b.Ca = J.mx;
a.add(b);
a.ik = !1;
a.Ad = "Tool";
this.mz = a;
this.nz = b;
this.Qy = this.Py = this.Ky = this.Jy = this.Ly = null;
this.iC = !0;
this.JG = new ra(X, "boolean");
this.FC = this.Mk = this.gz = null
}
t.ia("LinkingBaseTool", cg);
t.Oa(cg, ke);
cg.prototype.doStop = function () {
var a = this.h;
null !== a && wf(a);
this.wg = this.vg = this.ug = this.tg = this.fc = null;
this.Rw.clear();
this.wf = null
};
t.g(cg, "portGravity", cg.prototype.EA);
t.defineProperty(cg, {EA: "portGravity"}, function () {
return this.Ry
}, function (a) {
this.Ry !== a && (f && t.j(a, "number", cg, "portGravity"), 0 <= a && (this.Ry = a))
});
t.g(cg, "isUnconnectedLinkValid", cg.prototype.Qm);
t.defineProperty(cg, {Qm: "isUnconnectedLinkValid"}, function () {
return this.yy
}, function (a) {
this.yy !== a && (f && t.j(a, "boolean", cg, "isUnconnectedLinkValid"), this.yy = a)
});
t.g(cg, "temporaryLink", cg.prototype.Qf);
t.defineProperty(cg, {Qf: "temporaryLink"}, function () {
return this.lz
}, function (a) {
this.lz !== a && (f && t.k(a, A, cg, "temporaryLink"), this.lz = a)
});
t.g(cg, "temporaryFromNode", cg.prototype.Yd);
t.defineProperty(cg, {Yd: "temporaryFromNode"}, function () {
return this.jz
}, function (a) {
this.jz !== a && (f && t.k(a, y, cg, "temporaryFromNode"), this.jz = a)
});
t.g(cg, "temporaryFromPort", cg.prototype.yl);
t.defineProperty(cg, {yl: "temporaryFromPort"}, function () {
return this.kz
}, function (a) {
this.kz !== a && (f && t.k(a, X, cg, "temporaryFromPort"), this.kz = a)
});
t.g(cg, "temporaryToNode", cg.prototype.Zd);
t.defineProperty(cg, {Zd: "temporaryToNode"}, function () {
return this.mz
}, function (a) {
this.mz !== a && (f && t.k(a, y, cg, "temporaryToNode"), this.mz = a)
});
t.g(cg, "temporaryToPort", cg.prototype.zl);
t.defineProperty(cg, {zl: "temporaryToPort"}, function () {
return this.nz
}, function (a) {
this.nz !== a && (f && t.k(a, X, cg, "temporaryToPort"), this.nz = a)
});
t.g(cg, "originalLink", cg.prototype.fc);
t.defineProperty(cg, {fc: "originalLink"}, function () {
return this.Ly
}, function (a) {
this.Ly !== a && (f && null !== a && t.k(a, A, cg, "originalLink"), this.Ly = a)
});
t.g(cg, "originalFromNode", cg.prototype.tg);
t.defineProperty(cg, {tg: "originalFromNode"}, function () {
return this.Jy
}, function (a) {
this.Jy !== a && (f && null !== a && t.k(a, y, cg, "originalFromNode"), this.Jy = a)
});
t.g(cg, "originalFromPort", cg.prototype.ug);
t.defineProperty(cg, {ug: "originalFromPort"}, function () {
return this.Ky
}, function (a) {
this.Ky !== a && (f && null !== a && t.k(a, X, cg, "originalFromPort"), this.Ky = a)
});
t.g(cg, "originalToNode", cg.prototype.vg);
t.defineProperty(cg, {vg: "originalToNode"}, function () {
return this.Py
}, function (a) {
this.Py !== a && (f && null !== a && t.k(a, y, cg, "originalToNode"), this.Py = a)
});
t.g(cg, "originalToPort", cg.prototype.wg);
t.defineProperty(cg, {wg: "originalToPort"}, function () {
return this.Qy
}, function (a) {
this.Qy !== a && (f && null !== a && t.k(a, X, cg, "originalToPort"), this.Qy = a)
});
t.defineProperty(cg, {Td: "isForwards"}, function () {
return this.iC
}, function (a) {
this.iC = a
});
t.A(cg, {Rw: "validPortsCache"}, function () {
return this.JG
});
t.g(cg, "targetPort", cg.prototype.wf);
t.defineProperty(cg, {wf: "targetPort"}, function () {
return this.gz
}, function (a) {
this.gz !== a && (f && null !== a && t.k(a, X, cg, "targetPort"), this.gz = a)
});
cg.prototype.copyPortProperties = function (a, b, c, d, e) {
if (null !== a && null !== b && null !== c && null !== d) {
d.Ca = b.ya.size;
e ? (d.mb = b.mb, d.lk = b.lk) : (d.lb = b.lb, d.dk = b.dk);
c.We = Ub;
var g = t.O();
c.location = b.gb(Ub, g);
t.B(g);
d.angle = b.jl();
null !== this.mt && this.mt(a, b, c, d, e)
}
};
cg.prototype.setNoTargetPortProperties = function (a, b, c) {
null !== b && (b.Ca = J.mx, b.lb = Kb, b.mb = Kb);
null !== a && (a.location = this.h.T.W);
null !== this.mt && this.mt(null, null, a, b, c)
};
cg.prototype.doMouseDown = function () {
this.qa && this.doMouseMove()
};
cg.prototype.doMouseMove = function () {
if (this.qa) {
var a = this.h;
if (null !== a) {
this.wf = this.findTargetPort(this.Td);
if (null !== this.wf) {
var b = this.wf.U;
if (b instanceof y) {
this.Td ? this.copyPortProperties(b, this.wf, this.Zd, this.zl, !0) : this.copyPortProperties(b, this.wf, this.Yd, this.yl, !1);
return
}
}
this.Td ? this.setNoTargetPortProperties(this.Zd, this.zl, !0) : this.setNoTargetPortProperties(this.Yd, this.yl, !1);
(a.hf || a.jf) && Xf(a, a.T.W)
}
}
};
cg.prototype.findValidLinkablePort = function (a, b) {
if (null === a)return null;
var c = a.U;
if (!(c instanceof y))return null;
for (; null !== a;) {
var d = b ? a.kB : a.Zz;
if (!0 === d && (null !== a.rd || a instanceof y) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a)))return a;
if (!1 === d)break;
a = a.ga
}
return null
};
cg.prototype.findTargetPort = function (a) {
var b = this.h, c = b.T.W, d = this.EA;
0 >= d && (d = 0.1);
for (var e = this, g = b.Lm(c, d, function (b) {
return e.findValidLinkablePort(b, a)
}, null, !0), d = Infinity, b = null, g = g.l; g.next();) {
var h = g.value, k = h.U;
if (k instanceof y) {
var l = h.gb(Ub, t.O()), m = c.x - l.x, n = c.y - l.y;
t.B(l);
l = m * m + n * n;
l < d && (m = this.Rw.Ba(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.tg, this.ug, k, h) || !a && this.isValidLink(k, h, this.vg, this.wg) ? (this.Rw.add(h, !0), b = h, d = l) : this.Rw.add(h, !1))
}
}
return null !== b && (c = b.U,
c instanceof y && (null === c.layer || c.layer.wm)) ? b : null
};
cg.prototype.isValidFrom = function (a, b) {
if (null === a || null === b)return this.Qm;
if (this.h.Ta === this && (null !== a.layer && !a.layer.wm || !0 !== b.Zz))return!1;
var c = b.dE;
if (Infinity > c) {
if (null !== this.fc && a === this.tg && b === this.ug)return!0;
var d = b.rd;
null === d && (d = "");
if (a.cw(d).count >= c)return!1
}
return!0
};
cg.prototype.isValidTo = function (a, b) {
if (null === a || null === b)return this.Qm;
if (this.h.Ta === this && (null !== a.layer && !a.layer.wm || !0 !== b.kB))return!1;
var c = b.OF;
if (Infinity > c) {
if (null !== this.fc && a === this.vg && b === this.wg)return!0;
var d = b.rd;
null === d && (d = "");
if (a.mg(d).count >= c)return!1
}
return!0
};
cg.prototype.isInSameNode = function (a, b) {
if (null === a || null === b)return!1;
if (a === b)return!0;
var c = a.U, d = b.U;
return null !== c && c === d
};
cg.prototype.isLinked = function (a, b) {
if (null === a || null === b)return!1;
var c = a.U;
if (!(c instanceof y))return!1;
var d = a.rd;
null === d && (d = "");
var e = b.U;
if (!(e instanceof y))return!1;
var g = b.rd;
null === g && (g = "");
for (e = e.mg(g); e.next();)if (g = e.value, g.da === c && g.nf === d)return!0;
return!1
};
cg.prototype.isValidLink = function (a, b, c, d) {
if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.cE && d.NF || !this.isInSameNode(b, d)) && (b.bE && d.MF || !this.isLinked(b, d))) || null !== this.fc && (null !== a && dg(this, a, this.fc) || null !== c && dg(this, c, this.fc)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !eg(this, a, c, this.fc))return!1;
if (null !== a) {
var e = a.op;
if (null !== e && !e(a, b, c, d, this.fc))return!1
}
if (null !== c && (e = c.op, null !== e && !e(a, b, c, d, this.fc)))return!1;
e = this.op;
return null !== e ? e(a, b, c, d, this.fc) : !0
};
function dg(a, b, c) {
if (null === b)return!1;
var d = b.Tc;
if (null === d)return!1;
if (d === c)return!0;
var e = new ta(y);
e.add(b);
return og(a, d, c, e)
}
function og(a, b, c, d) {
if (b === c)return!0;
var e = b.da;
if (null !== e && e.Hh && (d.add(e), og(a, e.Tc, c, d)))return!0;
b = b.ja;
return null !== b && b.Hh && (d.add(b), og(a, b.Tc, c, d)) ? !0 : !1
}
function eg(a, b, c, d) {
if (null === b || null === c)return a.Qm;
var e = a.h.bG;
if (e !== pg) {
if (e === qg) {
if (null !== d && !d.xc)return!0;
for (e = c.Cd; e.next();) {
var g = e.value;
if (g !== d && g.xc && g.ja === c)return!1
}
return!rg(a, b, c, d, !0)
}
if (e === sg) {
if (null !== d && !d.xc)return!0;
for (e = b.Cd; e.next();)if (g = e.value, g !== d && g.xc && g.da === b)return!1;
return!rg(a, b, c, d, !0)
}
if (e === tg)return b === c ? a = !0 : (e = new ta(y), e.add(c), a = ug(a, e, b, c, d)), !a;
if (e === vg)return!rg(a, b, c, d, !1);
if (e === wg)return b === c ? a = !0 : (e = new ta(y), e.add(c), a = xg(a, e, b, c,
d)), !a
}
return!0
}
function rg(a, b, c, d, e) {
if (b === c)return!0;
if (null === b || null === c)return!1;
for (var g = b.Cd; g.next();) {
var h = g.value;
if (h !== d && (!e || h.xc) && h.ja === b && (h = h.da, h !== b && rg(a, h, c, d, e)))return!0
}
return!1
}
function ug(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.Cd; g.next();) {
var h = g.value;
if (h !== e && h.ja === c && (h = h.da, h !== c && ug(a, b, h, d, e)))return!0
}
return!1
}
function xg(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.Cd; g.next();) {
var h = g.value;
if (h !== e) {
var k = h.da, h = h.ja, k = k === c ? h : k;
if (k !== c && xg(a, b, k, d, e))return!0
}
}
return!1
}
t.g(cg, "linkValidation", cg.prototype.op);
t.defineProperty(cg, {op: "linkValidation"}, function () {
return this.Mk
}, function (a) {
null !== a && t.j(a, "function", cg, "linkValidation");
this.Mk = a
});
t.g(cg, "portTargeted", cg.prototype.mt);
t.defineProperty(cg, {mt: "portTargeted"}, function () {
return this.FC
}, function (a) {
null !== a && t.j(a, "function", cg, "portTargeted");
this.FC = a
});
function wa() {
0 < arguments.length && t.m("LinkingTool constructor cannot take any arguments.");
cg.call(this);
this.name = "Linking";
this.Tt = {};
this.St = null;
this.ra = yg;
this.bz = this.az = null
}
t.ia("LinkingTool", wa);
t.Oa(wa, cg);
var yg;
wa.Either = yg = t.w(wa, "Either", 0);
var zg;
wa.ForwardsOnly = zg = t.w(wa, "ForwardsOnly", 0);
var Ag;
wa.BackwardsOnly = Ag = t.w(wa, "BackwardsOnly", 0);
t.g(wa, "archetypeLinkData", wa.prototype.fD);
t.defineProperty(wa, {fD: "archetypeLinkData"}, function () {
return this.Tt
}, function (a) {
this.Tt !== a && (null !== a && t.k(a, Object, wa, "archetypeLinkData"), a instanceof X && t.k(a, A, wa, "archetypeLinkData"), this.Tt = a)
});
t.g(wa, "archetypeLabelNodeData", wa.prototype.Dz);
t.defineProperty(wa, {Dz: "archetypeLabelNodeData"}, function () {
return this.St
}, function (a) {
this.St !== a && (null !== a && t.k(a, Object, wa, "archetypeLabelNodeData"), a instanceof X && t.k(a, y, wa, "archetypeLabelNodeData"), this.St = a)
});
t.g(wa, "direction", wa.prototype.direction);
t.defineProperty(wa, {direction: "direction"}, function () {
return this.ra
}, function (a) {
this.ra !== a && (f && t.tb(a, wa, wa, "direction"), this.ra = a)
});
t.g(wa, "startObject", wa.prototype.fB);
t.defineProperty(wa, {fB: "startObject"}, function () {
return this.az
}, function (a) {
this.az !== a && (f && null !== a && t.k(a, X, wa, "startObject"), this.az = a)
});
t.A(wa, {Nw: "startPort"}, function () {
return this.bz
});
wa.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || a.Ya || a.Ve || !a.wm)return!1;
var b = a.fa;
return null !== b && (b instanceof U || b instanceof Rd) && a.T.left && (a.Ta === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1
};
wa.prototype.findLinkablePort = function () {
var a = this.h;
if (null === a)return null;
var b = this.fB;
null === b && (b = a.Qd(a.Fc.W, null, null));
if (null === b || !(b.U instanceof y))return null;
var c = this.direction;
if (c === yg || c === zg)if (a = this.findValidLinkablePort(b, !1), null !== a)return this.Td = !0, a;
if (c === yg || c === Ag)if (a = this.findValidLinkablePort(b, !0), null !== a)return this.Td = !1, a;
return null
};
wa.prototype.doActivate = function () {
var a = this.h;
if (null !== a && (null === this.Nw && (this.bz = this.findLinkablePort()), null !== this.Nw)) {
this.rc(this.name);
a.zd = !0;
a.bd = "pointer";
if (this.Td) {
this.ug = this.Nw;
var b = this.ug.U;
b instanceof y && (this.tg = b);
this.copyPortProperties(this.tg, this.ug, this.Yd, this.yl, !1)
} else this.wg = this.Nw, b = this.wg.U, b instanceof y && (this.vg = b), this.copyPortProperties(this.vg, this.wg, this.Zd, this.zl, !0);
a.add(this.Yd);
a.add(this.Zd);
null !== this.Qf && (null !== this.Yd && (this.Qf.da = this.Yd),
null !== this.Zd && (this.Qf.ja = this.Zd), this.Qf.$b(), a.add(this.Qf));
this.qa = !0
}
};
wa.prototype.doDeactivate = function () {
this.qa = !1;
var a = this.h;
null !== a && (a.remove(this.Qf), a.remove(this.Yd), a.remove(this.Zd), a.zd = !1, a.bd = "", this.jk())
};
wa.prototype.doStop = function () {
cg.prototype.doStop.call(this);
this.fB = this.bz = null
};
wa.prototype.doMouseUp = function () {
if (this.qa) {
var a = this.h;
if (null === a)return;
var b = this.bf = null, c = null, d = null, e = null, g = this.wf = this.findTargetPort(this.Td), h = null;
null !== g ? (h = g.U, h instanceof y && (this.Td ? (null !== this.tg && (b = this.tg, c = this.ug), d = h, e = g) : (b = h, c = g, null !== this.vg && (d = this.vg, e = this.wg)))) : this.Td ? null !== this.tg && this.Qm && (b = this.tg, c = this.ug) : null !== this.vg && this.Qm && (d = this.vg, e = this.wg);
if (null !== b || null !== d)b = this.insertLink(b, c, d, e), null !== b ? (null === g && (this.Td ? b.An = a.T.W.copy() :
b.wn = a.T.W.copy()), a.Ne && a.select(b), this.bf = this.name, a.Ja("LinkDrawn", b)) : a.fa.oD()
}
this.stopTool()
};
wa.prototype.insertLink = function (a, b, c, d) {
var e = this.h;
if (null === e)return null;
var g = e.fa;
if (null === g)return null;
if (g instanceof Rd) {
var h = a;
b = c;
e.ed || (h = c, b = a);
if (null !== h && null !== b)return g.Oh(b.data, g.Nb(h.data)), b.Js()
} else if (g instanceof U)if (h = "", null !== a && (null === b && (b = a), h = b.rd, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.rd, null === b && (b = "")), d = this.fD, d instanceof A) {
if (We(d), g = d.copy(), g instanceof A)return g.da = a, g.nf = h, g.ja = c, g.Rf = b, e.add(g), a = this.Dz, a instanceof y && (We(a),
a = a.copy(), a instanceof y && (a.Tc = g, e.add(a))), g
} else if (null !== d && (d = g.zD(d), t.pb(d)))return null !== a && g.YA(d, g.Nb(a.data)), g.ZA(d, h), null !== c && g.cB(d, g.Nb(c.data)), g.dB(d, b), g.Bv(d), a = this.Dz, null === a || a instanceof y || (a = g.Wj(a), t.pb(a) && (g.um(a), a = g.Nb(a), void 0 !== a && g.cD(d, a))), g = e.If(d);
return null
};
function tf() {
0 < arguments.length && t.m("RelinkingTool constructor cannot take any arguments.");
cg.call(this);
this.name = "Relinking";
var a = new Y;
a.Jb = "Diamond";
a.Ca = J.ex;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.cursor = "pointer";
a.uf = 0;
this.aC = a;
a = new Y;
a.Jb = "Diamond";
a.Ca = J.ex;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.cursor = "pointer";
a.uf = -1;
this.SC = a;
this.Xb = null;
this.CC = new D
}
t.ia("RelinkingTool", tf);
t.Oa(tf, cg);
tf.prototype.updateAdornments = function (a) {
if (null !== a && a instanceof A) {
var b = "RelinkFrom", c = null;
if (a.bb && !this.h.Ya) {
var d = a.an;
null !== d && a.canRelinkFrom() && a.ya.Q() && a.zb() && d.ya.Q() && d.ol() && (c = a.No(b), null === c && (c = this.makeAdornment(d, !1), c.Pc = b, c.nl = !0), null !== c && (c.aa(), a.Wk(b, c)))
}
null === c && a.tl(b);
b = "RelinkTo";
c = null;
a.bb && !this.h.Ya && (d = a.an, null !== d && a.canRelinkTo() && a.ya.Q() && a.zb() && d.ya.Q() && d.ol() && (c = a.No(b), null === c && (c = this.makeAdornment(d, !0), c.Pc = b, c.nl = !0), null !== c && (c.aa(), a.Wk(b,
c))));
null === c && a.tl(b)
}
};
tf.prototype.makeAdornment = function (a, b) {
var c = new Ue;
c.type = Bg;
var d = b ? this.lJ : this.ZH;
null !== d && c.add(d.copy());
c.Oc = a;
return c
};
t.defineProperty(tf, {ZH: "fromHandleArchetype"}, function () {
return this.aC
}, function (a) {
a && t.k(a, X, tf, "fromHandleArchetype");
this.aC = a
});
t.defineProperty(tf, {lJ: "toHandleArchetype"}, function () {
return this.SC
}, function (a) {
a && t.k(a, X, tf, "toHandleArchetype");
this.SC = a
});
t.A(tf, {handle: "handle"}, function () {
return this.Xb
});
tf.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || a.Ya || a.Ve || !a.Sj)return!1;
var b = a.fa;
if (null === b || !(b instanceof U || b instanceof Rd) || !a.T.left)return!1;
b = this.findToolHandleAt(a.Fc.W, "RelinkFrom");
null === b && (b = this.findToolHandleAt(a.Fc.W, "RelinkTo"));
return null !== b
};
tf.prototype.doActivate = function () {
var a = this.h;
if (null !== a) {
if (null === this.fc) {
var b = this.findToolHandleAt(a.Fc.W, "RelinkFrom");
null === b && (b = this.findToolHandleAt(a.Fc.W, "RelinkTo"));
if (null === b)return;
var c = b.U;
if (!(c instanceof Ue && c.Pj instanceof A))return;
this.Xb = b;
this.Td = null === c || "RelinkTo" === c.Pc;
this.fc = c.Pj
}
this.rc(this.name);
a.zd = !0;
a.bd = "pointer";
this.ug = this.fc.Rc;
this.tg = this.fc.da;
this.wg = this.fc.Ed;
this.vg = this.fc.ja;
this.CC.set(this.fc.ya);
null !== this.fc && 0 < this.fc.ma && (null === this.fc.da &&
(null !== this.yl && (this.yl.Ca = J.kn), null !== this.Yd && (this.Yd.location = this.fc.n(0))), null === this.fc.ja && (null !== this.zl && (this.zl.Ca = J.kn), null !== this.Zd && (this.Zd.location = this.fc.n(this.fc.ma - 1))));
this.copyPortProperties(this.tg, this.ug, this.Yd, this.yl, !1);
this.copyPortProperties(this.vg, this.wg, this.Zd, this.zl, !0);
a.add(this.Yd);
a.add(this.Zd);
null !== this.Qf && (null !== this.Yd && (this.Qf.da = this.Yd), null !== this.Zd && (this.Qf.ja = this.Zd), this.copyLinkProperties(this.fc, this.Qf), this.Qf.$b(), a.add(this.Qf));
this.qa = !0
}
};
tf.prototype.copyLinkProperties = function (a, b) {
if (null !== a && null !== b) {
b.wo = a.wo;
b.Tv = a.Tv;
var c = a.De;
if (c === Cg || c === Gg)c = Hg;
b.De = c;
b.Cs = a.Cs;
b.rt = a.rt;
b.dn = a.dn;
b.lb = a.lb;
b.dk = a.dk;
b.So = a.So;
b.To = a.To;
b.mb = a.mb;
b.lk = a.lk;
b.Lp = a.Lp;
b.Mp = a.Mp
}
};
tf.prototype.doDeactivate = function () {
this.qa = !1;
var a = this.h;
null !== a && (a.remove(this.Qf), a.remove(this.Yd), a.remove(this.Zd), a.zd = !1, a.bd = "", this.jk())
};
tf.prototype.doStop = function () {
cg.prototype.doStop.call(this);
this.Xb = null
};
tf.prototype.doMouseUp = function () {
if (this.qa) {
var a = this.h;
if (null === a)return;
this.bf = null;
var b = this.tg, c = this.ug, d = this.vg, e = this.wg, g = this.fc;
this.wf = this.findTargetPort(this.Td);
if (null !== this.wf) {
var h = this.wf.U;
h instanceof y && (this.Td ? (d = h, e = this.wf) : (b = h, c = this.wf))
} else this.Qm ? this.Td ? e = d = null : c = b = null : g = null;
null !== g && (this.reconnectLink(g, this.Td ? d : b, this.Td ? e : c, this.Td), null === this.wf && (this.Td ? g.An = a.T.W.copy() : g.wn = a.T.W.copy(), g.$b()), a.Ne && (g.bb = !0), this.bf = this.name, a.Ja("LinkRelinked",
g, this.Td ? this.wg : this.ug));
Ig(this.fc, this.CC)
}
this.stopTool()
};
tf.prototype.reconnectLink = function (a, b, c, d) {
if (null === this.h)return!1;
c = null !== c && null !== c.rd ? c.rd : "";
d ? (a.ja = b, a.Rf = c) : (a.da = b, a.nf = c);
return!0
};
function Zf(a, b, c, d, e) {
null !== b ? (a.copyPortProperties(b, c, a.Yd, a.yl, !1), a.h.add(a.Yd)) : a.h.remove(a.Yd);
null !== d ? (a.copyPortProperties(d, e, a.Zd, a.zl, !0), a.h.add(a.Zd)) : a.h.remove(a.Zd)
}
function Jg() {
0 < arguments.length && t.m("LinkReshapingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "LinkReshaping";
var a = new Y;
a.Jb = "Rectangle";
a.Ca = J.Sp;
a.fill = "lightblue";
a.stroke = "dodgerblue";
this.Gk = a;
a = new Y;
a.Jb = "Diamond";
a.Ca = J.Sp;
a.fill = "lightblue";
a.stroke = "dodgerblue";
this.rC = a;
this.HC = 3;
this.zx = this.Xb = null;
this.DC = new C;
this.Ny = null
}
t.ia("LinkReshapingTool", Jg);
t.Oa(Jg, ke);
var Kg;
Jg.None = Kg = t.w(Jg, "None", 0);
var Lg;
Jg.Horizontal = Lg = t.w(Jg, "Horizontal", 1);
var Mg;
Jg.Vertical = Mg = t.w(Jg, "Vertical", 2);
var Ng;
Jg.All = Ng = t.w(Jg, "All", 3);
function Og(a, b) {
t.k(a, X, Jg, "setReshapingBehavior:obj");
t.tb(b, Jg, Jg, "setReshapingBehavior:behavior");
a.av = b
}
Jg.prototype.updateAdornments = function (a) {
if (null !== a && a instanceof A) {
if (a.bb && !this.h.Ya) {
var b = a.path;
if (null !== b && a.canReshape() && a.ya.Q() && a.zb() && b.ya.Q() && b.ol()) {
var c = a.No(this.name);
if (null === c || c.CG !== a.ma || c.LG !== a.yp)c = this.makeAdornment(b), c.nl = !0, c.CG = a.ma, c.LG = a.yp;
if (null !== c) {
c.location = a.position;
c.aa();
a.Wk(this.name, c);
return
}
}
}
a.tl(this.name)
}
};
Jg.prototype.makeAdornment = function (a) {
var b = a.U, c = b.ma, d = b.ac, e = null;
if (null !== b.points && 1 < c) {
e = new Ue;
e.type = Bg;
var c = b.Ks, g = b.tw, h = d ? 1 : 0;
if (b.yp && b.De !== Pg)for (var k = c + h; k < g - h; k++) {
var l = this.makeResegmentHandle(a, k);
null !== l && (l.uf = k, l.st = 0.5, e.add(l))
}
for (k = c + 1; k < g; k++)if (l = this.makeHandle(a, k), null !== l) {
l.uf = k;
if (k !== c)if (k === c + 1 && d) {
var h = b.n(c), m = b.n(c + 1);
J.I(h.x, m.x) && J.I(h.y, m.y) && (m = b.n(c - 1));
J.I(h.x, m.x) ? (Og(l, Mg), l.cursor = "n-resize") : J.I(h.y, m.y) && (Og(l, Lg), l.cursor = "w-resize")
} else k ===
g - 1 && d ? (h = b.n(g - 1), m = b.n(g), J.I(h.x, m.x) && J.I(h.y, m.y) && (h = b.n(g + 1)), J.I(h.x, m.x) ? (Og(l, Mg), l.cursor = "n-resize") : J.I(h.y, m.y) && (Og(l, Lg), l.cursor = "w-resize")) : k !== g && (Og(l, Ng), l.cursor = "move");
e.add(l)
}
e.Pc = this.name;
e.Oc = a
}
return e
};
Jg.prototype.makeHandle = function () {
var a = this.Ns;
return null === a ? null : a.copy()
};
t.defineProperty(Jg, {Ns: "handleArchetype"}, function () {
return this.Gk
}, function (a) {
a && t.k(a, X, Jg, "handleArchetype");
this.Gk = a
});
Jg.prototype.makeResegmentHandle = function () {
var a = this.EI;
return null === a ? null : a.copy()
};
t.defineProperty(Jg, {EI: "midHandleArchetype"}, function () {
return this.rC
}, function (a) {
a && t.k(a, X, Jg, "midHandleArchetype");
this.rC = a
});
t.A(Jg, {handle: "handle"}, function () {
return this.Xb
});
t.A(Jg, {ts: "adornedLink"}, function () {
return this.zx
});
Jg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null !== a && !a.Ya && a.yo && a.T.left ? null !== this.findToolHandleAt(a.Fc.W, this.name) : !1
};
Jg.prototype.doActivate = function () {
var a = this.h;
if (null !== a && (this.Xb = this.findToolHandleAt(a.Fc.W, this.name), null !== this.Xb)) {
var b = this.Xb.U.Pj;
if (b instanceof A) {
this.zx = b;
a.zd = !0;
this.rc(this.name);
if (b.yp && 0.5 === this.Xb.st) {
var c = b.points.copy(), d = this.Xb.gb(Ub);
c.Rd(this.Xb.uf + 1, d);
b.ac && c.Rd(this.Xb.uf + 1, d);
b.points = c;
b.ze();
b.updateAdornments();
this.Xb = this.findToolHandleAt(a.Fc.W, this.name)
}
this.DC = b.n(this.Xb.uf);
this.Ny = b.points.copy();
this.qa = !0
}
}
};
Jg.prototype.doDeactivate = function () {
this.jk();
this.zx = this.Xb = null;
var a = this.h;
null !== a && (a.zd = !1);
this.qa = !1
};
Jg.prototype.doCancel = function () {
var a = this.ts;
null !== a && (a.points = this.Ny);
this.stopTool()
};
Jg.prototype.doMouseMove = function () {
var a = this.h;
this.qa && null !== a && (a = this.computeReshape(a.T.W), this.reshape(a))
};
Jg.prototype.doMouseUp = function () {
var a = this.h;
if (this.qa && null !== a) {
var b = this.computeReshape(a.T.W);
this.reshape(b);
b = this.ts;
if (null !== b && b.yp) {
var c = this.handle.uf, d = b.n(c - 1), e = b.n(c), g = b.n(c + 1);
if (b.ac) {
if (c > b.Ks + 1 && c < b.tw - 1) {
var h = b.n(c - 2);
if (Math.abs(d.x - e.x) < this.Nh && Math.abs(d.y - e.y) < this.Nh && (Qg(this, h, d, e, g, !0) || Qg(this, h, d, e, g, !1))) {
var k = b.points.copy();
Qg(this, h, d, e, g, !0) ? (k.xg(c - 2, new C(h.x, (g.y + h.y) / 2)), k.xg(c + 1, new C(g.x, (g.y + h.y) / 2))) : (k.xg(c - 2, new C((g.x + h.x) / 2, h.y)), k.xg(c + 1, new C((g.x +
h.x) / 2, g.y)));
k.Dd(c);
k.Dd(c - 1);
b.points = k;
b.ze();
b.updateAdornments()
} else h = b.n(c + 2), Math.abs(e.x - g.x) < this.Nh && Math.abs(e.y - g.y) < this.Nh && (Qg(this, d, e, g, h, !0) || Qg(this, d, e, g, h, !1)) && (k = b.points.copy(), Qg(this, d, e, g, h, !0) ? (k.xg(c - 1, new C(d.x, (d.y + h.y) / 2)), k.xg(c + 2, new C(h.x, (d.y + h.y) / 2))) : (k.xg(c - 1, new C((d.x + h.x) / 2, d.y)), k.xg(c + 2, new C((d.x + h.x) / 2, h.y))), k.Dd(c + 1), k.Dd(c), b.points = k, b.ze(), b.updateAdornments())
}
} else h = t.O(), J.Ym(d.x, d.y, g.x, g.y, e.x, e.y, h) && 9 > h.Zj(e) && (k = b.points.copy(), k.Dd(c),
b.points = k, b.ze(), b.updateAdornments()), t.B(h)
}
a.Ac();
this.bf = this.name;
a.Ja("LinkReshaped", this.ts)
}
this.stopTool()
};
function Qg(a, b, c, d, e, g) {
return g ? Math.abs(b.y - c.y) < a.Nh && Math.abs(c.y - d.y) < a.Nh && Math.abs(d.y - e.y) < a.Nh : Math.abs(b.x - c.x) < a.Nh && Math.abs(c.x - d.x) < a.Nh && Math.abs(d.x - e.x) < a.Nh
}
t.g(Jg, "resegmentingDistance", Jg.prototype.Nh);
t.defineProperty(Jg, {Nh: "resegmentingDistance"}, function () {
return this.HC
}, function (a) {
this.HC = a
});
Jg.prototype.reshape = function (a) {
var b = this.ts;
b.wl();
var c = this.handle.uf, d = this.handle && this.handle.av ? this.handle.av : Kg;
if (b.ac)if (c === b.Ks + 1)c = b.Ks + 1, d === Mg ? (b.Y(c, b.n(c - 1).x, a.y), b.Y(c + 1, b.n(c + 2).x, a.y)) : d === Lg && (b.Y(c, a.x, b.n(c - 1).y), b.Y(c + 1, a.x, b.n(c + 2).y)); else if (c === b.tw - 1)c = b.tw - 1, d === Mg ? (b.Y(c - 1, b.n(c - 2).x, a.y), b.Y(c, b.n(c + 1).x, a.y)) : d === Lg && (b.Y(c - 1, a.x, b.n(c - 2).y), b.Y(c, a.x, b.n(c + 1).y)); else {
var d = c, e = b.n(d), g = b.n(d - 1), h = b.n(d + 1);
J.I(g.x, e.x) && J.I(e.y, h.y) ? (J.I(g.x, b.n(d - 2).x) && !J.I(g.y,
b.n(d - 2).y) ? (b.C(d, a.x, g.y), c++, d++) : b.Y(d - 1, a.x, g.y), J.I(h.y, b.n(d + 2).y) && !J.I(h.x, b.n(d + 2).x) ? b.C(d + 1, h.x, a.y) : b.Y(d + 1, h.x, a.y)) : J.I(g.y, e.y) && J.I(e.x, h.x) ? (J.I(g.y, b.n(d - 2).y) && !J.I(g.x, b.n(d - 2).x) ? (b.C(d, g.x, a.y), c++, d++) : b.Y(d - 1, g.x, a.y), J.I(h.x, b.n(d + 2).x) && !J.I(h.y, b.n(d + 2).y) ? b.C(d + 1, a.x, h.y) : b.Y(d + 1, a.x, h.y)) : J.I(g.x, e.x) && J.I(e.x, h.x) ? (J.I(g.x, b.n(d - 2).x) && !J.I(g.y, b.n(d - 2).y) ? (b.C(d, a.x, g.y), c++, d++) : b.Y(d - 1, a.x, g.y), J.I(h.x, b.n(d + 2).x) && !J.I(h.y, b.n(d + 2).y) ? b.C(d + 1, a.x, h.y) : b.Y(d + 1, a.x,
h.y)) : J.I(g.y, e.y) && J.I(e.y, h.y) && (J.I(g.y, b.n(d - 2).y) && !J.I(g.x, b.n(d - 2).x) ? (b.C(d, g.x, a.y), c++, d++) : b.Y(d - 1, g.x, a.y), J.I(h.y, b.n(d + 2).y) && !J.I(h.x, b.n(d + 2).x) ? b.C(d + 1, h.x, a.y) : b.Y(d + 1, h.x, a.y));
b.Y(c, a.x, a.y)
} else b.Y(c, a.x, a.y), 1 === c && b.computeSpot(!0).pd() && (e = b.da, g = b.Rc, d = g.gb(Ub, t.O()), e = b.getLinkPointFromPoint(e, g, d, a, !0, t.O()), b.Y(0, e.x, e.y), t.B(d), t.B(e)), c === b.ma - 2 && b.computeSpot(!1).pd() && (c = b.ja, e = b.Ed, d = e.gb(Ub, t.O()), e = b.getLinkPointFromPoint(c, e, d, a, !1, t.O()), b.Y(b.ma - 1, e.x, e.y), t.B(d),
t.B(e));
b.Gi()
};
Jg.prototype.computeReshape = function (a) {
var b = this.ts, c = this.handle.uf;
switch (this.handle && this.handle.av ? this.handle.av : Kg) {
case Ng:
return a;
case Mg:
return b = b.n(c), new C(b.x, a.y);
case Lg:
return b = b.n(c), new C(a.x, b.y);
default:
case Kg:
return b.n(c)
}
};
t.g(Jg, "originalPoint", Jg.prototype.OI);
t.A(Jg, {OI: "originalPoint"}, function () {
return this.DC
});
t.g(Jg, "originalPoints", Jg.prototype.QI);
t.A(Jg, {QI: "originalPoints"}, function () {
return this.Ny
});
function Rg() {
0 < arguments.length && t.m("ResizingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "Resizing";
this.ce = (new oa(1, 1)).freeze();
this.yj = (new oa(9999, 9999)).freeze();
this.dj = (new oa(NaN, NaN)).freeze();
this.Ql = !1;
this.La = null;
var a = new Y;
a.Qj = Ub;
a.Jb = "Rectangle";
a.Ca = J.Sp;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.ib = 1;
a.cursor = "pointer";
this.Gk = a;
this.Xb = null;
this.co = 0;
this.DG = new D;
this.Wu = new oa;
this.My = new C;
this.by = new oa(0, 0);
this.ay = new oa(Infinity, Infinity);
this.$x =
new oa(1, 1)
}
t.ia("ResizingTool", Rg);
t.Oa(Rg, ke);
Rg.prototype.updateAdornments = function (a) {
if (!(null === a || a instanceof A)) {
if (a.bb && !this.h.Ya) {
var b = a.kF;
if (null !== b && a.canResize() && a.ya.Q() && a.zb() && b.ya.Q() && b.ol()) {
var c = a.No(this.name);
null === c && (c = this.makeAdornment(b), c.nl = !0);
if (null !== c) {
var d = b.jl();
c.angle = d;
var e = b.gb(c.We, t.O()), g = b.ek();
c.location = e;
t.B(e);
e = c.placeholder;
if (null !== e) {
var b = b.Ia, h = t.xl();
h.q(b.width * g, b.height * g);
e.Ca = h;
t.ck(h)
}
Sg(this, c, d);
a.Wk(this.name, c);
return
}
}
}
a.tl(this.name)
}
};
Rg.prototype.makeAdornment = function (a) {
var b = null, b = a.U.iF;
if (null === b) {
b = new Ue;
b.type = Tg;
b.We = Ub;
var c = new Ug;
c.Ih = !0;
b.add(c);
b.add(this.makeHandle(a, Qb));
b.add(this.makeHandle(a, Tb));
b.add(this.makeHandle(a, Zb));
b.add(this.makeHandle(a, Vb));
b.add(this.makeHandle(a, $b));
b.add(this.makeHandle(a, bc));
b.add(this.makeHandle(a, cc));
b.add(this.makeHandle(a, ac))
} else if (We(b), b = b.copy(), !(b instanceof Ue))return null;
b.Pc = this.name;
b.Oc = a;
return b
};
Rg.prototype.makeHandle = function (a, b) {
var c = this.Ns;
if (null === c)return null;
c = c.copy();
c.alignment = b;
return c
};
function Sg(a, b, c) {
if (null !== b)if (!b.alignment.Gc() && "" !== b.cursor)a:{
a = b.alignment;
a.pd() && (a = Ub);
if (0 >= a.x)c = 0 >= a.y ? c + 225 : 1 <= a.y ? c + 135 : c + 180; else if (1 <= a.x)0 >= a.y ? c += 315 : 1 <= a.y && (c += 45); else if (0 >= a.y)c += 270; else if (1 <= a.y)c += 90; else break a;
0 > c ? c += 360 : 360 <= c && (c -= 360);
b.cursor = 22.5 > c ? "e-resize" : 67.5 > c ? "se-resize" : 112.5 > c ? "s-resize" : 157.5 > c ? "sw-resize" : 202.5 > c ? "w-resize" : 247.5 > c ? "nw-resize" : 292.5 > c ? "n-resize" : 337.5 > c ? "ne-resize" : "e-resize"
} else if (b instanceof B)for (b = b.elements; b.next();)Sg(a,
b.value, c)
}
t.defineProperty(Rg, {Ns: "handleArchetype"}, function () {
return this.Gk
}, function (a) {
a && t.k(a, X, Rg, "handleArchetype");
this.Gk = a
});
t.A(Rg, {handle: "handle"}, function () {
return this.Xb
});
t.defineProperty(Rg, {Oc: "adornedObject"}, function () {
return this.La
}, function (a) {
a && t.k(a, X, Rg, "adornedObject");
this.La = a
});
Rg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null !== a && !a.Ya && a.zo && a.T.left ? null !== this.findToolHandleAt(a.Fc.W, this.name) ? !0 : !1 : !1
};
Rg.prototype.doActivate = function () {
var a = this.h;
null !== a && (this.Xb = this.findToolHandleAt(a.Fc.W, this.name), null !== this.Xb && (this.La = this.Xb.U.Oc, this.co = this.La.angle, this.DG.set(this.La.Ia), this.My.set(this.La.U.location), this.Wu.set(this.La.Ca), this.$x = this.computeCellSize(), this.by = this.computeMinSize(), this.ay = this.computeMaxSize(), a.zd = !0, this.rc(this.name), this.qa = !0))
};
Rg.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (this.jk(), this.La = this.Xb = null, this.qa = a.zd = !1)
};
Rg.prototype.doCancel = function () {
this.La.Ca = this.Wu;
this.La.U.location = this.My;
this.stopTool()
};
Rg.prototype.doMouseMove = function () {
var a = this.h;
if (this.qa && null !== a) {
var b = this.by, c = this.ay, d = this.$x, e = this.La.gE(a.T.W, t.O()), g = Vg;
this.La instanceof Y && (g = this.La.hw, g === Wg && (g = this.La.Ra.kc));
b = this.computeResize(e, this.Xb.alignment, b, c, d, !(g === Xg || g === Yg || a.T.shift));
this.resize(b);
a.Vi();
t.B(e)
}
};
Rg.prototype.doMouseUp = function () {
var a = this.h;
if (this.qa && null !== a) {
var b = this.by, c = this.ay, d = this.$x, e = this.La.gE(a.T.W, t.O()), g = Vg;
this.La instanceof Y && (g = this.La.hw, g === Wg && (g = this.La.Ra.kc));
b = this.computeResize(e, this.Xb.alignment, b, c, d, !(g === Xg || g === Yg || a.T.shift));
this.resize(b);
t.B(e);
a.Ac();
this.bf = this.name;
a.Ja("PartResized", this.La, this.Wu)
}
this.stopTool()
};
Rg.prototype.resize = function (a) {
if (null !== this.h) {
var b = this.La.U, c = b.position.copy(), d = this.La.Ia.copy(), e = this.La.jl(), g = this.La.ek();
360 <= e ? e -= 360 : 0 > e && (e += 360);
var h = Math.PI * e / 180, k = Math.cos(h), h = Math.sin(h), l = a.width - d.width, d = a.height - d.height, m = 90 < e && 270 > e ? 1 : 0;
c.x += g * ((a.x + l * m) * k - (a.y + d * (0 < e && 180 > e ? 1 : 0)) * h);
c.y += g * ((a.x + l * (180 < e && 360 > e ? 1 : 0)) * h + (a.y + d * m) * k);
this.La.Ca = a.size;
b.Hf();
b.move(c)
}
};
Rg.prototype.computeResize = function (a, b, c, d, e, g) {
b.pd() && (b = Ub);
var h = this.La.Ia, 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 = t.O();
J.Gs(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 + 0.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 + 0.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 + 0.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 + 0.5 * (m - k - a.width)));
t.B(q);
return a
};
Rg.prototype.computeMinSize = function () {
var a = this.La.Ye.copy(), b = this.Ye;
!isNaN(b.width) && b.width > a.width && (a.width = b.width);
!isNaN(b.height) && b.height > a.height && (a.height = b.height);
return a
};
Rg.prototype.computeMaxSize = function () {
var a = this.La.Ge.copy(), b = this.Ge;
!isNaN(b.width) && b.width < a.width && (a.width = b.width);
!isNaN(b.height) && b.height < a.height && (a.height = b.height);
return a
};
Rg.prototype.computeCellSize = function () {
var a = new oa(NaN, NaN), b = this.La.U;
if (b) {
var c = b.jF;
!isNaN(c.width) && 0 < c.width && (a.width = c.width);
!isNaN(c.height) && 0 < c.height && (a.height = c.height)
}
c = this.bl;
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.Eb.ke, null !== c && c.cp && (c = c.cA, 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.Yo, null !== b && b.visible && this.cp && (c = b.Ms, 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
};
t.g(Rg, "minSize", Rg.prototype.Ye);
t.defineProperty(Rg, {Ye: "minSize"}, function () {
return this.ce
}, function (a) {
this.ce.N(a) || (f && t.k(a, oa, Rg, "minSize"), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), this.ce.assign(a))
});
t.g(Rg, "maxSize", Rg.prototype.Ge);
t.defineProperty(Rg, {Ge: "maxSize"}, function () {
return this.yj
}, function (a) {
this.yj.N(a) || (f && t.k(a, oa, Rg, "maxSize"), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), this.yj.assign(a))
});
t.g(Rg, "cellSize", Rg.prototype.bl);
t.defineProperty(Rg, {bl: "cellSize"}, function () {
return this.dj
}, function (a) {
this.dj.N(a) || (f && t.k(a, oa, Rg, "cellSize"), this.dj.assign(a))
});
t.g(Rg, "isGridSnapEnabled", Rg.prototype.cp);
t.defineProperty(Rg, {cp: "isGridSnapEnabled"}, function () {
return this.Ql
}, function (a) {
this.Ql !== a && (t.j(a, "boolean", Rg, "isGridSnapEnabled"), this.Ql = a)
});
t.g(Rg, "originalDesiredSize", Rg.prototype.MI);
t.A(Rg, {MI: "originalDesiredSize"}, function () {
return this.Wu
});
t.g(Rg, "originalLocation", Rg.prototype.NI);
t.A(Rg, {NI: "originalLocation"}, function () {
return this.My
});
function Zg() {
0 < arguments.length && t.m("RotatingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "Rotating";
this.$y = 45;
this.Zy = 2;
this.La = null;
var a = new Y;
a.Jb = "Ellipse";
a.Ca = J.ex;
a.fill = "lightblue";
a.stroke = "dodgerblue";
a.ib = 1;
a.cursor = "pointer";
this.Gk = a;
this.Xb = null;
this.co = 0;
this.IC = new C
}
t.ia("RotatingTool", Zg);
t.Oa(Zg, ke);
Zg.prototype.updateAdornments = function (a) {
if (!(null === a || a instanceof A)) {
if (a.bb && !this.h.Ya) {
var b = a.oF;
if (null !== b && a.canRotate() && a.ya.Q() && a.zb() && b.ya.Q() && b.ol()) {
var c = a.No(this.name);
null === c && (c = this.makeAdornment(b), c.nl = !0);
if (null !== c) {
c.angle = b.jl();
var d = null, e = null;
b === a || b === a.Ub ? (d = a.Ub, e = a.We) : (d = b, e = Ub);
for (var g = d.Ia, e = t.ic(g.width * e.x + e.offsetX, g.height * e.y + e.offsetY); null !== d && d !== b;)d.transform.Wa(e), d = d.ga;
var d = e.y, g = Math.max(e.x - b.Ia.width, 0), h = t.O();
c.location = b.gb(new K(1,
0, 50 + g, d), h);
t.B(h);
t.B(e);
a.Wk(this.name, c);
return
}
}
}
a.tl(this.name)
}
};
Zg.prototype.makeAdornment = function (a) {
var b = null, b = a.U.nF;
if (null === b) {
b = new Ue;
b.type = $g;
b.We = Ub;
var c = this.Ns;
null !== c && b.add(c.copy())
} else if (We(b), b = b.copy(), !(b instanceof Ue))return null;
b.Pc = this.name;
b.Oc = a;
return b
};
t.defineProperty(Zg, {Ns: "handleArchetype"}, function () {
return this.Gk
}, function (a) {
a && t.k(a, X, Zg, "handleArchetype");
this.Gk = a
});
t.A(Zg, {handle: "handle"}, function () {
return this.Xb
});
t.defineProperty(Zg, {Oc: "adornedObject"}, function () {
return this.La
}, function (a) {
a && t.k(a, X, Zg, "adornedObject");
this.La = a
});
Zg.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null !== a && !a.Ya && a.Ao && a.T.left ? null !== this.findToolHandleAt(a.Fc.W, this.name) ? !0 : !1 : !1
};
Zg.prototype.doActivate = function () {
var a = this.h;
if (null !== a && (this.Xb = this.findToolHandleAt(a.Fc.W, this.name), null !== this.Xb)) {
this.La = this.Xb.U.Oc;
var b = this.La.U, c = b.Ub;
this.IC = this.La === b || this.La === c ? c.gb(b.We) : this.La.gb(Ub);
this.co = this.La.angle;
a.zd = !0;
this.rc(this.name);
this.qa = !0
}
};
Zg.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (this.jk(), this.La = this.Xb = null, this.qa = a.zd = !1)
};
Zg.prototype.doCancel = function () {
this.rotate(this.co);
this.stopTool()
};
Zg.prototype.doMouseMove = function () {
var a = this.h;
this.qa && null !== a && (a = this.computeRotate(a.T.W), this.rotate(a))
};
Zg.prototype.doMouseUp = function () {
var a = this.h;
if (this.qa && null !== a) {
var b = this.computeRotate(a.T.W);
this.rotate(b);
a.Ac();
this.bf = this.name;
a.Ja("PartRotated", this.La, this.co)
}
this.stopTool()
};
Zg.prototype.rotate = function (a) {
t.o(a, Zg, "rotate:newangle");
null !== this.La && (this.La.angle = a)
};
Zg.prototype.computeRotate = function (a) {
a = this.IC.Ji(a);
var b = this.La.ga;
b && (a -= b.jl(), 360 <= a ? a -= 360 : 0 > a && (a += 360));
var b = Math.min(Math.abs(this.GF), 180), c = Math.min(Math.abs(this.FF), b / 2);
!this.h.T.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
};
t.g(Zg, "snapAngleMultiple", Zg.prototype.GF);
t.defineProperty(Zg, {GF: "snapAngleMultiple"}, function () {
return this.$y
}, function (a) {
this.$y !== a && (f && t.j(a, "number", Zg, "snapAngleMultiple"), this.$y = a)
});
t.g(Zg, "snapAngleEpsilon", Zg.prototype.FF);
t.defineProperty(Zg, {FF: "snapAngleEpsilon"}, function () {
return this.Zy
}, function (a) {
this.Zy !== a && (f && t.j(a, "number", Zg, "snapAngleEpsilon"), this.Zy = a)
});
t.g(Zg, "originalAngle", Zg.prototype.LI);
t.A(Zg, {LI: "originalAngle"}, function () {
return this.co
});
function ah() {
0 < arguments.length && t.m("ClickSelectingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "ClickSelecting"
}
t.ia("ClickSelectingTool", ah);
t.Oa(ah, ke);
ah.prototype.canStart = function () {
return!this.isEnabled || null === this.h || this.isBeyondDragSize() ? !1 : !0
};
ah.prototype.doMouseUp = function () {
this.qa && (this.standardMouseSelect(), this.standardMouseClick());
this.stopTool()
};
function bh() {
0 < arguments.length && t.m("ActionTool constructor cannot take any arguments.");
ke.call(this);
this.name = "Action";
this.mn = null
}
t.ia("ActionTool", bh);
t.Oa(bh, ke);
bh.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a)return!1;
var b = a.T, c = a.Qd(b.W, function (a) {
for (; null !== a.ga && !a.Rs;)a = a.ga;
return a
}, function (a) {
return a.Rs
});
return null !== c ? (this.mn = c, a.Io = a.Qd(b.W, null, null), !0) : !1
};
bh.prototype.doMouseDown = function () {
if (this.qa) {
var a = this.h.T, b = this.mn;
null !== b && (a.Xd = b, null !== b.uz && b.uz(a, b))
} else this.canStart() && this.doActivate()
};
bh.prototype.doMouseMove = function () {
if (this.qa) {
var a = this.h.T, b = this.mn;
null !== b && (a.Xd = b, null !== b.vz && b.vz(a, b))
}
};
bh.prototype.doMouseUp = function () {
if (this.qa) {
var a = this.h, b = a.T, c = this.mn;
if (null === c)return;
b.Xd = c;
null !== c.wz && c.wz(b, c);
this.isBeyondDragSize() || bf(c, b, a)
}
this.stopTool()
};
bh.prototype.doCancel = function () {
var a = this.h;
if (null !== a) {
var a = a.T, b = this.mn;
if (null === b)return;
a.Xd = b;
null !== b.tz && b.tz(a, b)
}
this.stopTool()
};
bh.prototype.doStop = function () {
this.mn = null
};
function za() {
0 < arguments.length && t.m("ClickCreatingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "ClickCreating";
this.aj = null;
this.qy = !0;
this.$B = new C(0, 0)
}
t.ia("ClickCreatingTool", za);
t.Oa(za, ke);
za.prototype.canStart = function () {
if (!this.isEnabled || null === this.us)return!1;
var a = this.h;
if (null === a || a.Ya || a.Ve || !a.vm || !a.T.left || this.isBeyondDragSize())return!1;
if (this.xE) {
if (1 === a.T.Ae && (this.$B = a.T.Bc.copy()), 2 !== a.T.Ae || this.isBeyondDragSize(this.$B))return!1
} else if (1 !== a.T.Ae)return!1;
return a.Ta !== this && null !== a.Hs(a.T.W, !0) ? !1 : !0
};
za.prototype.doMouseUp = function () {
var a = this.h;
this.qa && null !== a && this.insertPart(a.T.W);
this.stopTool()
};
za.prototype.insertPart = function (a) {
var b = this.h;
if (null === b)return null;
var c = this.us;
if (null === c)return null;
this.rc(this.name);
var d = null;
c instanceof w ? c.Ud() && (We(c), d = c.copy(), d instanceof w && b.add(d)) : null !== c && (c = b.fa.Wj(c), t.pb(c) && (b.fa.um(c), d = b.Ni(c)));
d instanceof w && (d.location = a, b.Ne && b.select(d));
b.Ac();
this.bf = this.name;
b.Ja("PartCreated", d);
this.jk();
return d instanceof w ? d : null
};
t.g(za, "archetypeNodeData", za.prototype.us);
t.defineProperty(za, {us: "archetypeNodeData"}, function () {
return this.aj
}, function (a) {
this.aj !== a && (null !== a && t.k(a, Object, za, "archetypeNodeData"), this.aj = a)
});
t.g(za, "isDoubleClick", za.prototype.xE);
t.defineProperty(za, {xE: "isDoubleClick"}, function () {
return this.qy
}, function (a) {
this.qy !== a && (t.j(a, "boolean", za, "isDoubleClick"), this.qy = a)
});
function ch() {
0 < arguments.length && t.m("ContextMenuTool constructor cannot take any arguments.");
ke.call(this);
this.name = "ContextMenu";
this.KB = null;
this.uC = new C;
this.Bn = null;
if (!0 === t.gB) {
this.Bn = new Ue;
this.Rx = null;
var a = this;
this.TC = function () {
a.stopTool()
};
if (!1 === t.ED) {
var b = document.createElement("div"), c = document.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 = document.createElement("style");
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);
document.body && (document.body.appendChild(b), document.body.appendChild(c));
t.As = b;
t.zs = c;
t.ED = !0
}
}
}
t.ia("ContextMenuTool", ch);
t.Oa(ch, ke);
ch.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null === a || this.isBeyondDragSize() || !a.T.right ? !1 : (null === this.Bn || a.T.event instanceof MouseEvent) && null === this.findObjectWithContextMenu() ? !1 : !0
};
ch.prototype.doStart = function () {
var a = this.h;
null !== a && this.uC.set(a.Fc.W)
};
ch.prototype.doStop = function () {
this.hideDefaultContextMenu();
this.hideContextMenu()
};
ch.prototype.findObjectWithContextMenu = function (a) {
var b = this.h;
if (null === b)return null;
var c = b.T, d = null, d = void 0 !== a ? a : b.Qd(c.W, null, function (a) {
return!a.layer.pc
});
if (null !== d) {
for (a = d; null !== a;) {
c = a.contextMenu;
if (null !== c)return a;
a = a.ga
}
if (null !== this.Bn && !(b.T.event instanceof MouseEvent))return d.U
} else if (c = b.contextMenu, null !== c)return b;
return null
};
ch.prototype.doActivate = function () {
};
ch.prototype.doMouseDown = function () {
if (this.qa) {
var a = this.h;
if (null !== a && null !== this.lf) {
var b = a.Qd(a.T.W, null, null);
null !== b && b.Ri(this.lf) ? (this.standardMouseClick(null, null), this.stopTool()) : (this.stopTool(), a.Ta.doMouseDown())
}
}
};
ch.prototype.doMouseUp = function () {
this.qa || this.canStart() && af(this, !0)
};
function af(a, b, c) {
a.qa = !0;
b && a.standardMouseSelect();
a.standardMouseClick();
void 0 === c && (c = a.findObjectWithContextMenu());
null !== c ? (b = c.contextMenu, null !== b ? a.showContextMenu(b, c instanceof X ? c : null) : a.showDefaultContextMenu()) : a.showDefaultContextMenu()
}
ch.prototype.doMouseMove = function () {
this.qa && this.standardMouseOver()
};
ch.prototype.showContextMenu = function (a, b) {
t.k(a, Ue, ch, "showContextMenu:contextmenu");
null !== b && t.k(b, X, ch, "showContextMenu:obj");
var c = this.h;
if (null !== c) {
a !== this.lf && this.hideContextMenu();
a.Ad = "Tool";
a.ik = !1;
a.scale = 1 / c.scale;
a.Pc = this.name;
c.add(a);
if (null !== b) {
var c = null, d = b.Ro();
null !== d && (c = d.data);
a.Oc = b;
a.data = c
} else a.data = c.fa;
a.Hf();
this.positionContextMenu(a, b);
this.lf = a
}
};
ch.prototype.positionContextMenu = function (a) {
var b = this.h;
if (null !== b) {
var c = b.T.W.copy(), d = a.Ea, e = b.nb;
b.T.sw && (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
}
};
ch.prototype.hideContextMenu = function () {
var a = this.h;
null !== a && null !== this.lf && (this.lf.data = null, this.lf.Oc = null, a.remove(this.lf), this.lf = null, this.standardMouseOver())
};
ch.prototype.initializeDefaultButtons = function () {
if (null === this.h)return null;
var a = new H, b = this.h.Qe;
a.add({text: "Copy", Gf: function () {
b.copySelection()
}, visible: function () {
return b.canCopySelection()
}});
a.add({text: "Cut", Gf: function () {
b.cutSelection()
}, visible: function () {
return b.canCutSelection()
}});
a.add({text: "Delete", Gf: function () {
b.deleteSelection()
}, visible: function () {
return b.canDeleteSelection()
}});
a.add({text: "Paste", Gf: function (a) {
b.pasteSelection(a.T.W)
}, visible: function () {
return b.canPasteSelection()
}});
a.add({text: "Select All", Gf: function () {
b.selectAll()
}, visible: function () {
return b.canSelectAll()
}});
a.add({text: "Undo", Gf: function () {
b.undo()
}, visible: function () {
return b.canUndo()
}});
a.add({text: "Redo", Gf: function () {
b.redo()
}, visible: function () {
return b.canRedo()
}});
a.add({text: "Zoom Out", Gf: function () {
b.decreaseZoom()
}, visible: function () {
return b.canDecreaseZoom()
}});
a.add({text: "Zoom In", Gf: function () {
b.increaseZoom()
}, visible: function () {
return b.canIncreaseZoom()
}});
a.add({text: "Zoom To Fit",
Gf: function () {
b.zoomToFit()
}, visible: function () {
return b.canZoomToFit()
}});
a.add({text: "Reset Zoom", Gf: function () {
b.resetZoom()
}, visible: function () {
return b.canResetZoom()
}});
a.add({text: "Group Selection", Gf: function () {
b.groupSelection()
}, visible: function () {
return b.canGroupSelection()
}});
a.add({text: "Ungroup Selection", Gf: function () {
b.ungroupSelection()
}, visible: function () {
return b.canUngroupSelection()
}});
a.add({text: "Edit Text", Gf: function () {
b.editTextBlock()
}, visible: function () {
return b.canEditTextBlock()
}});
return a
};
ch.prototype.showDefaultContextMenu = function () {
var a = this.h;
if (null !== a) {
null === this.Rx && (this.Rx = this.initializeDefaultButtons());
this.Bn !== this.lf && this.hideContextMenu();
t.As.innerHTML = "";
t.zs.addEventListener("click", this.TC, !1);
var b = this, c = document.createElement("ul");
c.className = "defaultCXul";
t.As.appendChild(c);
c.innerHTML = "";
for (var d = this.Rx.l; d.next();) {
var e = d.value, g = e.text, h = e.visible;
if ("function" !== typeof h || h()) {
h = document.createElement("li");
h.className = "defaultCXli";
var k = document.createElement("a");
k.className = "defaultCXa";
k.href = "#";
k.xG = e.Gf;
k.addEventListener("click", function (c) {
this.xG(a);
b.stopTool();
c.preventDefault();
return!1
}, !1);
k.textContent = g;
h.appendChild(k);
c.appendChild(h)
}
}
t.As.style.display = "block";
t.zs.style.display = "block";
this.lf = this.Bn
}
};
ch.prototype.hideDefaultContextMenu = function () {
null !== this.lf && this.lf === this.Bn && (t.As.style.display = "none", t.zs.style.display = "none", t.zs.removeEventListener("click", this.TC, !1), this.lf = null)
};
t.g(ch, "currentContextMenu", ch.prototype.lf);
t.defineProperty(ch, {lf: "currentContextMenu"}, function () {
return this.KB
}, function (a) {
this.KB = a
});
t.A(ch, {CJ: "mouseDownPoint"}, function () {
return this.uC
});
function dh() {
0 < arguments.length && t.m("DragSelectingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "DragSelecting";
this.Cn = 175;
this.lC = !1;
var a = new w;
a.Ad = "Tool";
a.ik = !1;
var b = new Y;
b.name = "SHAPE";
b.Jb = "Rectangle";
b.fill = null;
b.stroke = "magenta";
a.add(b);
this.pn = a
}
t.ia("DragSelectingTool", dh);
t.Oa(dh, ke);
dh.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || !a.Ne)return!1;
var b = a.T;
return!b.left || a.Ta !== this && (!this.isBeyondDragSize() || b.timestamp - a.Fc.timestamp < this.Wv || null !== a.Hs(b.W, !0)) ? !1 : !0
};
dh.prototype.doActivate = function () {
var a = this.h;
null !== a && (this.qa = !0, a.zd = !0, a.Cb = !0, a.add(this.lg), this.doMouseMove())
};
dh.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (a.remove(this.lg), a.Cb = !1, this.qa = a.zd = !1)
};
dh.prototype.doMouseMove = function () {
if (null !== this.h && this.qa && null !== this.lg) {
var a = this.computeBoxBounds(), b = this.lg.le("SHAPE");
null === b && (b = this.lg.dw());
b.Ca = a.size;
this.lg.position = a.position
}
};
dh.prototype.doMouseUp = function () {
if (this.qa) {
var a = this.h;
a.remove(this.lg);
try {
a.bd = "wait", this.selectInRect(this.computeBoxBounds())
} finally {
a.bd = ""
}
}
this.stopTool()
};
dh.prototype.computeBoxBounds = function () {
var a = this.h;
return null === a ? new D(0, 0, 0, 0) : new D(a.Fc.W, a.T.W)
};
dh.prototype.selectInRect = function (a) {
var b = this.h;
if (null !== b) {
var c = b.T;
b.Ja("ChangingSelection");
a = b.bk(a, null, function (a) {
return a instanceof w && a.canSelect()
}, this.CE);
if (b.Rl ? c.Wm : c.control)if (c.shift)for (a = a.l; a.next();)c = a.value, c.bb && (c.bb = !1); else for (a = a.l; a.next();)c = a.value, c.bb = !c.bb; else {
if (!c.shift) {
for (var d = new H(w), e = b.selection.l; e.next();)c = e.value, a.contains(c) || d.add(c);
for (d = d.l; d.next();)c = d.value, c.bb = !1
}
for (a = a.l; a.next();)c = a.value, c.bb || (c.bb = !0)
}
b.Ja("ChangedSelection")
}
};
t.g(dh, "delay", dh.prototype.Wv);
t.defineProperty(dh, {Wv: "delay"}, function () {
return this.Cn
}, function (a) {
this.Cn = a
});
t.g(dh, "isPartialInclusion", dh.prototype.CE);
t.defineProperty(dh, {CE: "isPartialInclusion"}, function () {
return this.lC
}, function (a) {
this.lC = a
});
t.g(dh, "box", dh.prototype.lg);
t.defineProperty(dh, {lg: "box"}, function () {
return this.pn
}, function (a) {
this.pn = a
});
function eh() {
0 < arguments.length && t.m("PanningTool constructor cannot take any arguments.");
ke.call(this);
this.name = "Panning";
this.Oy = new C;
this.cj = !1;
var a = this;
this.NC = function () {
document.removeEventListener("scroll", a.NC, !1);
a.stopTool()
}
}
t.ia("PanningTool", eh);
t.Oa(eh, ke);
eh.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
return null === a || !a.hf && !a.jf || !a.T.left || a.Ta !== this && !this.isBeyondDragSize() ? !1 : !0
};
eh.prototype.doActivate = function () {
var a = this.h;
null !== a && (this.cj ? (a.T.bubbles = !0, document.addEventListener("scroll", this.NC, !1)) : (a.bd = "move", a.zd = !0, this.Oy = a.position.copy()), this.qa = !0)
};
eh.prototype.doDeactivate = function () {
var a = this.h;
null !== a && (a.bd = "", this.qa = a.zd = !1, a.ua())
};
eh.prototype.doCancel = function () {
var a = this.h;
null !== a && (a.position = this.Oy, a.zd = !1);
this.stopTool()
};
eh.prototype.doMouseMove = function () {
this.move()
};
eh.prototype.doMouseUp = function () {
this.move();
this.stopTool()
};
eh.prototype.move = function () {
var a = this.h;
if (this.qa && a)if (this.cj)a.T.bubbles = !0; else {
var b = a.position, c = a.Fc.W, d = a.T.W, e = b.x + c.x - d.x, c = b.y + c.y - d.y;
a.hf || (e = b.x);
a.jf || (c = b.y);
a.position = new C(e, c)
}
};
t.g(eh, "bubbles", eh.prototype.bubbles);
t.defineProperty(eh, {bubbles: "bubbles"}, function () {
return this.cj
}, function (a) {
this.cj = a
});
t.g(eh, "originalPosition", eh.prototype.RI);
t.A(eh, {RI: "originalPosition"}, function () {
return this.Oy
});
function fh() {
0 < arguments.length && t.m("TextEditingTool constructor cannot take any arguments.");
ke.call(this);
this.name = "TextEditing";
this.Sx = this.MB = this.oz = this.QC = null;
this.cz = gh;
this.Kj = null;
this.kb = hh;
this.Qk = null
}
t.ia("TextEditingTool", fh);
t.Oa(fh, ke);
var ih;
fh.LostFocus = ih = t.w(fh, "LostFocus", 0);
var jh;
fh.MouseDown = jh = t.w(fh, "MouseDown", 1);
var kh;
fh.Tab = kh = t.w(fh, "Tab", 2);
var lh;
fh.Enter = lh = t.w(fh, "Enter", 3);
fh.SingleClick = t.w(fh, "SingleClick", 0);
var gh;
fh.SingleClickSelected = gh = t.w(fh, "SingleClickSelected", 1);
var hh = t.w(fh, "StateNone", 0), mh = t.w(fh, "StateActive", 1), yh = t.w(fh, "StateEditing", 2), zh = t.w(fh, "StateEditing2", 3), Ah = t.w(fh, "StateValidating", 4), Bh = t.w(fh, "StateValidated", 5);
t.g(fh, "textBlock", fh.prototype.Ag);
t.defineProperty(fh, {Ag: "textBlock"}, function () {
return this.oz
}, function (a) {
this.oz = a
});
t.g(fh, "currentTextEditor", fh.prototype.Sg);
t.defineProperty(fh, {Sg: "currentTextEditor"}, function () {
return this.MB
}, function (a) {
this.MB = a
});
t.g(fh, "defaultTextEditor", fh.prototype.HD);
t.defineProperty(fh, {HD: "defaultTextEditor"}, function () {
return this.Sx
}, function (a) {
this.Sx = a
});
t.g(fh, "starting", fh.prototype.HF);
t.defineProperty(fh, {HF: "starting"}, function () {
return this.cz
}, function (a) {
this.cz !== a && (f && t.tb(a, fh, fh, "starting"), this.cz = a)
});
fh.prototype.canStart = function () {
if (!this.isEnabled)return!1;
var a = this.h;
if (null === a || a.Ya || !a.T.left || this.isBeyondDragSize())return!1;
a = a.Qd(a.T.W, null, function (a) {
return a instanceof ua
});
if (!(a instanceof ua && a.Yv))return!1;
a = a.U;
return null === a || this.HF === gh && !a.bb ? !1 : !0
};
fh.prototype.doStart = function () {
this.qa || null === this.Ag || this.doActivate()
};
fh.prototype.doActivate = function () {
if (!this.qa) {
var a = this.h;
if (null !== a) {
var b = this.Ag;
null === b && (b = a.Qd(a.T.W, function (a) {
return a instanceof ua ? a : null
}), b = b instanceof ua ? b : null);
if (null !== b && (this.Ag = b, null !== b.U)) {
this.qa = !0;
this.kb = mh;
this.rc(this.name);
var c = this.HD, d = !1;
null !== b.iB && (c = b.iB);
null === c || c.DB || (d = !0);
this.QC = this.Ag.copy();
null === c && (c = document.createElement("textarea"), c.DB = !0, this.Sx = c, c.addEventListener("input", function () {
var a = this.textEditingTool.QC;
a.text = this.value;
Ch(a,
Infinity, Infinity);
this.style.width = 20 + a.Ea.width * this.kJ + "px";
this.rows = a.HE
}, !1), c.addEventListener("keydown", function (a) {
var b = a.which, c = this.textEditingTool;
if (null !== c)if (13 === b)c.acceptText(lh); else {
if (9 === b)return c.acceptText(kh), a.preventDefault(), !1;
27 === b && (c.doCancel(), c.h && c.h.focus())
}
}, !1), c.addEventListener("focus", function () {
var a = this.textEditingTool;
a.kb === mh ? a.kb = yh : a.kb === Bh ? a.kb = zh : a.kb === zh && (a.kb = yh);
this.select()
}, !1), c.addEventListener("blur", function () {
this.focus();
this.select()
},
!1));
if (c.DB) {
var e = b.gb(Ub), g = a.position, h = a.scale, k = b.ek() * h, l = b.Ia.width * k;
Dh(b);
var m = (e.x - g.x) * h, e = (e.y - g.y) * h;
c.value = b.text;
a.Ki.style.font = b.font;
c.style.font = "inherit";
c.style.fontSize = 100 * k + "%";
c.style.lineHeight = "normal";
l = 20 + l;
c.style.width = l + "px";
c.style.height = "";
c.rows = b.HE;
a.Ki.appendChild(c);
c.style.left = (m - l / 2 | 0) + "px";
c.style.top = (e - c.clientHeight / 2 | 0) + "px";
c.style.textAlign = b.textAlign
} else a.Ki.appendChild(c);
c.style.position = "absolute";
c.style.zIndex = 100;
c.className = "start";
c.textEditingTool =
this;
c.kJ = k;
if (d && void 0 !== c.onActivate)c.onActivate();
this.Sg = c;
c.focus()
}
}
}
};
fh.prototype.doCancel = function () {
null !== this.Qk && (this.Sg.style.border = this.Qk, this.Qk = null);
this.stopTool()
};
fh.prototype.doMouseUp = function () {
!this.qa && this.canStart() && this.doActivate()
};
fh.prototype.doMouseDown = function () {
this.qa && this.acceptText(jh)
};
fh.prototype.acceptText = function (a) {
switch (a) {
case jh:
if (this.kb === Bh || this.kb === zh)this.Sg.focus(); else if (this.kb === mh || this.kb === yh)this.kb = Ah, Eh(this);
break;
case ih:
case lh:
case kh:
if (lh === a && !0 === this.oz.rw)break;
if (this.kb === mh || this.kb === yh)this.kb = Ah, Eh(this)
}
};
function Eh(a) {
if (null !== a.Ag && null !== a.Sg) {
var b = a.Ag, c = a.Ag.text, d = a.Sg.value, e = "", e = "function" === typeof d ? d() : d;
if (!a.isValidText(a.Ag, c, e)) {
a.kb = yh;
null !== b.Fs && b.Fs(a, c, e);
null === a.Qk && (a.Qk = a.Sg.style.border, a.Sg.style.border = "3px solid red");
a.Sg.focus();
return
}
a.kb = Bh;
c !== e && (a.Ag.text = e);
a.bf = a.name;
b = a.h;
null !== b && b.Ja("TextEdited", a.Ag, c);
a.stopTool();
null !== b && b.focus()
}
null !== a.Qk && (a.Sg.style.border = a.Qk, a.Qk = null)
}
fh.prototype.doDeactivate = function () {
var a = this.h;
if (null !== a) {
this.qa && this.jk();
this.kb = hh;
this.Ag = null;
if (null !== this.Sg) {
var b = this.Sg;
if (void 0 !== b.onDeactivate)b.onDeactivate();
null !== b && a.Ki.removeChild(b)
}
this.qa = !1
}
};
fh.prototype.isValidText = function (a, b, c) {
t.k(a, ua, fh, "isValidText:textblock");
var d = this.Ct;
if (null !== d && !d(a, b, c))return!1;
d = a.Ct;
return null === d || d(a, b, c) ? !0 : !1
};
t.g(fh, "textValidation", fh.prototype.Ct);
t.defineProperty(fh, {Ct: "textValidation"}, function () {
return this.Kj
}, function (a) {
this.Kj !== a && (this.Kj = a)
});
function Ge() {
ke.call(this);
this.name = "ToolManager";
this.vC = new H(ke);
this.wC = new H(ke);
this.xC = new H(ke);
this.cC = this.dC = 1E3;
this.SB = (new oa(2, 2)).Na();
this.eu = this.Px = null;
this.yC = df
}
t.ia("ToolManager", Ge);
t.Oa(Ge, ke);
var df;
Ge.WheelScroll = df = t.w(Ge, "WheelScroll", 0);
var cf;
Ge.WheelZoom = cf = t.w(Ge, "WheelZoom", 1);
Ge.WheelNone = t.w(Ge, "WheelNone", 2);
t.g(Ge, "mouseWheelBehavior", Ge.prototype.Xm);
t.defineProperty(Ge, {Xm: "mouseWheelBehavior"}, function () {
return this.yC
}, function (a) {
this.yC = a
});
Ge.prototype.initializeStandardTools = function () {
this.aD = new bh;
this.MA = new tf;
this.KE = new Jg;
this.mF = new Rg;
this.qF = new Zg;
this.pA = new wa;
this.ke = new ef;
this.OD = new dh;
this.aF = new eh;
this.Sv = new ch;
this.Qw = new fh;
this.pD = new za;
this.qD = new ah
};
Ge.prototype.doMouseDown = function () {
var a = this.h;
if (null !== a) {
var b = a.Aa;
b.Hz && 0 !== b.Bl && t.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");
for (var b = this.tf.length, c = 0; c < b; c++) {
var d = this.tf.pa(c);
null === d.h && d.He(this.h);
if (d.canStart()) {
a.Ta = d;
a.Ta === d && (d.qa || d.doActivate(), d.doMouseDown());
return
}
}
1 === a.T.button && (this.Xm === df ? this.Xm = cf : this.Xm === cf && (this.Xm = df));
this.doActivate();
this.standardWaitAfter(this.eA)
}
};
Ge.prototype.doMouseMove = function () {
var a = this.h;
if (null !== a) {
if (this.qa)for (var b = this.Wg.length, c = 0; c < b; c++) {
var d = this.Wg.pa(c);
null === d.h && d.He(this.h);
if (d.canStart()) {
a.Ta = d;
a.Ta === d && (d.qa || d.doActivate(), d.doMouseMove());
return
}
}
this.standardMouseOver();
this.isBeyondDragSize() && this.standardWaitAfter(this.qa ? this.eA : this.pE)
}
};
Ge.prototype.doCurrentObjectChanged = function (a, b) {
var c = this.fl;
null === c || null !== b && (b === c || b.Ri(c)) || this.hideToolTip()
};
Ge.prototype.doWaitAfter = function () {
this.h && this.h.Pa && (this.doMouseHover(), this.qa || this.doToolTip())
};
Ge.prototype.doMouseHover = function () {
var a = this.h;
if (null !== a) {
var b = a.T;
null === b.Xd && (b.Xd = a.Qd(b.W, null, null));
var c = b.Xd;
if (null !== c)for (; null !== c;) {
a = this.qa ? c.ct : c.dt;
if (null !== a && (a(b, c), b.Ee))break;
c = c.ga
} else a = this.qa ? a.ct : a.dt, null !== a && a(b)
}
};
Ge.prototype.doToolTip = function () {
var a = this.h;
if (null !== a) {
var b = a.T;
null === b.Xd && (b.Xd = a.Qd(b.W, null, null));
b = b.Xd;
if (null !== b) {
if (b !== this.fl && !b.Ri(this.fl)) {
for (; null !== b;) {
a = b.Dt;
if (null !== a) {
this.showToolTip(a, b);
return
}
b = b.ga
}
this.hideToolTip()
}
} else a = a.Dt, null !== a ? this.showToolTip(a, null) : this.hideToolTip()
}
};
Ge.prototype.showToolTip = function (a, b) {
t.k(a, Ue, Ge, "showToolTip:tooltip");
null !== b && t.k(b, X, Ge, "showToolTip:obj");
var c = this.h;
if (null !== c) {
a !== this.fl && this.hideToolTip();
a.Ad = "Tool";
a.ik = !1;
a.scale = 1 / c.scale;
c.add(a);
if (null !== b && b !== this.eu) {
var c = null, d = b.Ro();
null !== d && (c = d.data);
a.Oc = b;
a.data = c
} else null === b && (a.data = c.fa);
if (null === b || b !== this.eu)a.Hf(), this.positionToolTip(a, b);
this.Px = a;
this.eu = b
}
};
Ge.prototype.positionToolTip = function (a) {
var b = this.h;
if (null !== b) {
var c = b.T.W.copy(), d = a.Ea, e = b.nb;
b.T.sw && (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
}
};
Ge.prototype.hideToolTip = function () {
if (null !== this.fl) {
var a = this.h;
null !== a && (this.fl.data = null, this.fl.Oc = null, a.remove(this.fl), this.eu = this.Px = null)
}
};
t.A(Ge, {fl: "currentToolTip"}, function () {
return this.Px
});
Ge.prototype.doMouseUp = function () {
this.cancelWaitAfter();
if (this.qa) {
var a = this.h;
if (null === a)return;
for (var b = this.Xg.length, c = 0; c < b; c++) {
var d = this.Xg.pa(c);
null === d.h && d.He(this.h);
if (d.canStart()) {
a.Ta = d;
a.Ta === d && (d.qa || d.doActivate(), d.doMouseUp());
return
}
}
}
this.doDeactivate()
};
Ge.prototype.doMouseWheel = function () {
this.standardMouseWheel()
};
Ge.prototype.doKeyDown = function () {
var a = this.h;
null !== a && a.Qe.doKeyDown()
};
Ge.prototype.doKeyUp = function () {
var a = this.h;
null !== a && a.Qe.doKeyUp()
};
Ge.prototype.doCancel = function () {
null !== hf && hf.doCancel();
ke.prototype.doCancel.call(this)
};
Ge.prototype.findTool = function (a) {
t.j(a, "string", Ge, "findTool:name");
for (var b = this.tf.length, c = 0; c < b; c++) {
var d = this.tf.pa(c);
if (d.name === a)return d
}
b = this.Wg.length;
for (c = 0; c < b; c++)if (d = this.Wg.pa(c), d.name === a)return d;
b = this.Xg.length;
for (c = 0; c < b; c++)if (d = this.Xg.pa(c), d.name === a)return d;
return null
};
Ge.prototype.replaceTool = function (a, b) {
t.j(a, "string", Ge, "replaceTool:name");
null !== b && (t.k(b, ke, Ge, "replaceTool:newtool"), b.h && b.h !== this.h && t.m("Cannot share tools between Diagrams: " + b.toString()), b.He(this.h));
for (var c = this.tf.length, d = 0; d < c; d++) {
var e = this.tf.pa(d);
if (e.name === a)return null !== b ? this.tf.xg(d, b) : this.tf.Dd(d), e
}
c = this.Wg.length;
for (d = 0; d < c; d++)if (e = this.Wg.pa(d), e.name === a)return null !== b ? this.Wg.xg(d, b) : this.Wg.Dd(d), e;
c = this.Xg.length;
for (d = 0; d < c; d++)if (e = this.Xg.pa(d), e.name ===
a)return null !== b ? this.Xg.xg(d, b) : this.Xg.Dd(d), e;
return null
};
function Fh(a, b, c, d) {
t.j(b, "string", Ge, "replaceStandardTool:name");
t.k(d, H, Ge, "replaceStandardTool:list");
null !== c && (t.k(c, ke, Ge, "replaceStandardTool:newtool"), c.h && c.h !== a.h && t.m("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.He(a.h));
a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c)
}
t.A(Ge, {tf: "mouseDownTools"}, function () {
return this.vC
});
t.A(Ge, {Wg: "mouseMoveTools"}, function () {
return this.wC
});
t.A(Ge, {Xg: "mouseUpTools"}, function () {
return this.xC
});
t.g(Ge, "hoverDelay", Ge.prototype.pE);
t.defineProperty(Ge, {pE: "hoverDelay"}, function () {
return this.dC
}, function (a) {
this.dC = a
});
t.g(Ge, "holdDelay", Ge.prototype.eA);
t.defineProperty(Ge, {eA: "holdDelay"}, function () {
return this.cC
}, function (a) {
this.cC = a
});
t.g(Ge, "dragSize", Ge.prototype.PD);
t.defineProperty(Ge, {PD: "dragSize"}, function () {
return this.SB
}, function (a) {
this.SB = a
});
t.g(Ge, "actionTool", Ge.prototype.aD);
t.defineProperty(Ge, {aD: "actionTool"}, function () {
return this.findTool("Action")
}, function (a) {
Fh(this, "Action", a, this.tf)
});
t.g(Ge, "relinkingTool", Ge.prototype.MA);
t.defineProperty(Ge, {MA: "relinkingTool"}, function () {
return this.findTool("Relinking")
}, function (a) {
Fh(this, "Relinking", a, this.tf)
});
t.g(Ge, "linkReshapingTool", Ge.prototype.KE);
t.defineProperty(Ge, {KE: "linkReshapingTool"}, function () {
return this.findTool("LinkReshaping")
}, function (a) {
Fh(this, "LinkReshaping", a, this.tf)
});
t.g(Ge, "resizingTool", Ge.prototype.mF);
t.defineProperty(Ge, {mF: "resizingTool"}, function () {
return this.findTool("Resizing")
}, function (a) {
Fh(this, "Resizing", a, this.tf)
});
t.g(Ge, "rotatingTool", Ge.prototype.qF);
t.defineProperty(Ge, {qF: "rotatingTool"}, function () {
return this.findTool("Rotating")
}, function (a) {
Fh(this, "Rotating", a, this.tf)
});
t.g(Ge, "linkingTool", Ge.prototype.pA);
t.defineProperty(Ge, {pA: "linkingTool"}, function () {
return this.findTool("Linking")
}, function (a) {
Fh(this, "Linking", a, this.Wg)
});
t.g(Ge, "draggingTool", Ge.prototype.ke);
t.defineProperty(Ge, {ke: "draggingTool"}, function () {
return this.findTool("Dragging")
}, function (a) {
Fh(this, "Dragging", a, this.Wg)
});
t.g(Ge, "dragSelectingTool", Ge.prototype.OD);
t.defineProperty(Ge, {OD: "dragSelectingTool"}, function () {
return this.findTool("DragSelecting")
}, function (a) {
Fh(this, "DragSelecting", a, this.Wg)
});
t.g(Ge, "panningTool", Ge.prototype.aF);
t.defineProperty(Ge, {aF: "panningTool"}, function () {
return this.findTool("Panning")
}, function (a) {
Fh(this, "Panning", a, this.Wg)
});
t.g(Ge, "contextMenuTool", Ge.prototype.Sv);
t.defineProperty(Ge, {Sv: "contextMenuTool"}, function () {
return this.findTool("ContextMenu")
}, function (a) {
Fh(this, "ContextMenu", a, this.Xg)
});
t.g(Ge, "textEditingTool", Ge.prototype.Qw);
t.defineProperty(Ge, {Qw: "textEditingTool"}, function () {
return this.findTool("TextEditing")
}, function (a) {
Fh(this, "TextEditing", a, this.Xg)
});
t.g(Ge, "clickCreatingTool", Ge.prototype.pD);
t.defineProperty(Ge, {pD: "clickCreatingTool"}, function () {
return this.findTool("ClickCreating")
}, function (a) {
Fh(this, "ClickCreating", a, this.Xg)
});
t.g(Ge, "clickSelectingTool", Ge.prototype.qD);
t.defineProperty(Ge, {qD: "clickSelectingTool"}, function () {
return this.findTool("ClickSelecting")
}, function (a) {
Fh(this, "ClickSelecting", a, this.Xg)
});
function je() {
1 < arguments.length && t.m("Layer constructor cannot take any arguments.");
t.zc(this);
this.ea = null;
this.cb = new H(w);
this.Rb = "";
this.Ef = 1;
this.xy = !1;
this.Rk = this.sz = this.xk = this.wk = this.vk = this.uk = this.sk = this.tk = this.rk = this.zk = this.qk = this.yk = this.pk = this.ok = !0;
this.Xu = []
}
t.ia("Layer", je);
je.prototype.He = function (a) {
this.ea = a
};
je.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.cb.l; k.next();) {
var l = k.value;
l instanceof z ? e++ : l instanceof y ? d++ : l instanceof A ? g++ : l instanceof Ue ? 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 (c = this.cb.l; c.next();)d = c.value, k += "\n " + d.toString(a - 1), (e = d.data) && t.oc(e) && (k += " #" + t.oc(e)), d instanceof y ? k += " " + ka(e) :
d instanceof A && (k += " " + ka(d.da) + " " + ka(d.ja));
return b + " " + this.cb.count + ": " + k
};
je.prototype.findObjectAt = je.prototype.Qd = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
if (!1 === this.Rk)return null;
f && !a.Q() && t.m("findObjectAt: Point must have a real value.");
var d = this.cb, e = !1;
this.h.nb.Ha(a) && (e = !0);
for (var g = t.O(), h = d.length; h--;) {
var k = d.pa(h);
if ((!0 !== e || !1 !== Gh(k)) && k.zb() && (g.assign(a), Xa(g, k.he), k = k.Qd(g, b, c), null !== k && (null !== b && (k = b(k)), k && (null === c || c(k)))))return t.B(g), k
}
t.B(g);
return null
};
je.prototype.findObjectsAt = je.prototype.Po = function (a, b, c, d) {
void 0 === b && (b = null);
void 0 === c && (c = null);
d instanceof H || d instanceof ta || (d = new ta(X));
if (!1 === this.Rk)return d;
f && !a.Q() && t.m("findObjectsAt: Point must have a real value.");
var e = this.cb, g = !1;
this.h.nb.Ha(a) && (g = !0);
for (var h = t.O(), k = e.length; k--;) {
var l = e.pa(k);
!0 === g && !1 === Gh(l) || !l.zb() || (h.assign(a), Xa(h, l.he), l.Po(h, b, c, d) && (null !== b && (l = b(l)), l && (null === c || c(l)) && d.add(l)))
}
t.B(h);
return d
};
je.prototype.findObjectsIn = je.prototype.bk = function (a, b, c, d, e) {
void 0 === b && (b = null);
void 0 === c && (c = null);
void 0 === d && (d = !1);
e instanceof H || e instanceof ta || (e = new ta(X));
if (!1 === this.Rk)return e;
f && !a.Q() && t.m("findObjectsIn: Rect must have a real value.");
var g = this.cb, h = !1;
this.h.nb.Vj(a) && (h = !0);
for (var k = g.length, g = g.p; k--;) {
var l = g[k];
(!0 !== h || !1 !== Gh(l)) && l.zb() && l.bk(a, b, c, d, e) && (null !== b && (l = b(l)), l && (null === c || c(l)) && e.add(l))
}
return e
};
je.prototype.Vz = function (a, b, c, d, e, g, h) {
if (!1 === this.Rk)return e;
for (var k = this.cb, l = k.length, k = k.p; l--;) {
var m = k[l];
(!0 !== h || !1 !== Gh(m)) && g(m) && m.zb() && m.bk(a, b, c, d, e) && (null !== b && (m = b(m)), m && (null === c || c(m)) && e.add(m))
}
return e
};
je.prototype.findObjectsNear = je.prototype.Lm = 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 H || e instanceof ta)g = e;
e = !0
}
g instanceof H || g instanceof ta || (g = new ta(X));
if (!1 === this.Rk)return g;
f && !a.Q() && t.m("findObjectsNear: Point must have a real value.");
var h = this.cb, k = !1;
this.h.nb.Ha(a) && (k = !0);
for (var l = t.O(), m = t.O(), n = h.length; n--;) {
var p = h.p[n];
!0 === k && !1 === Gh(p) || !p.zb() || (l.assign(a), Xa(l, p.he), m.q(a.x + b, a.y), Xa(m, p.he),
p.Lm(l, m, c, d, e, g) && (null !== c && (p = c(p)), p && (null === d || d(p)) && g.add(p)))
}
t.B(l);
t.B(m);
return g
};
aa = je.prototype;
aa.Pf = function (a, b) {
if (this.visible && a.Kk) {
var c = this.cb, d;
d = b ? b : a.nb;
for (var e = c.length, g = 0; g < e; g++) {
var h = c.p[g];
h.BG = g;
if (!(h instanceof A && !1 === h.Rg || h instanceof Ue && null !== h.Pj))if (wb(h.ya, d))for (h.Pf(!0), Hh(h), h = h.Dv; h.next();) {
var k = h.value;
Ch(k, Infinity, Infinity);
k.Ec();
k.Pf(!0)
} else h.Pf(!1), null !== h.Dv && 0 < h.Dv.count && Hh(h)
}
}
};
aa.Se = function (a, b, c, d) {
if (this.visible && (void 0 === d && (d = !0), d || !this.pc)) {
1 !== this.Ef && (a.globalAlpha = this.Ef);
c = this.cb;
d = this.Xu;
d.length = 0;
for (var e = b.scale, g = c.length, h = 0; h < g; h++) {
var k = c.p[h];
if (Gh(k)) {
if (k instanceof A && (k.ac && d.push(k), !1 === k.Rg))continue;
var l = k.ya;
1 < l.width * e || 1 < l.height * e ? k.Se(a, b) : Ih(k, a)
}
}
a.globalAlpha = 1
}
};
function Jh(a, b, c, d) {
if (a.visible) {
b.globalAlpha = a.Ef;
var e = a.cb;
a = a.Xu;
a.length = 0;
for (var g = c.scale, h = e.length, k = d.length, l = 0; l < h; l++) {
var m = e.p[l];
if (Gh(m)) {
if (m instanceof A && (m.ac && a.push(m), !1 === m.Rg))continue;
var n = Kh(m, m.ya), p;
a:{
p = n;
for (var q = d, r = k, s = 2 / g, v = 4 / g, x = 0; x < r; x++) {
var E = q[x];
if (0 !== E[2] && 0 !== E[3] && p.wE(E[0] - s, E[1] - s, E[2] + v, E[3] + v)) {
p = !0;
break a
}
}
p = !1
}
p && (1 < n.width * g || 1 < n.height * g ? m.Se(b, c) : Ih(m, b))
}
}
b.globalAlpha = 1
}
}
aa.i = function (a, b, c, d, e) {
var g = this.h;
null !== g && g.fd(Bd, a, this, b, c, d, e)
};
aa.Pm = function (a, b, c) {
var d = this.cb;
b.Un = this;
if (a >= d.count)a = d.count; else if (d.pa(a) === b)return-1;
d.Rd(a, b);
b.Ps();
d = this.h;
null !== d && (c ? d.ua() : d.Pm(b));
b instanceof z && this.Mw(b);
return a
};
aa.Ue = function (a, b, c) {
var d = this.cb;
if (0 > a || a >= d.length) {
if (a = d.indexOf(b), 0 > a)return-1
} else if (d.pa(a) !== b && (a = d.indexOf(b), 0 > a))return-1;
b.Qs();
d.Dd(a);
d = this.h;
null !== d && (c ? d.ua() : d.Ue(b));
b.Un = null;
return a
};
aa.Mw = function (a) {
for (; null !== a;) {
if (a.layer === this) {
var b = a;
if (b.Hc.next()) {
for (var c = -1, d = -1, e = this.cb.p, g = e.length, h = 0; h < g; h++) {
var k = e[h];
if (k === b && (c = h, 0 <= d))break;
if (0 > d && k.fb === b && (d = h, 0 <= c))break
}
!(0 > d) && d < c && (e = this.cb, e.Dd(c), e.Rd(d, b))
}
}
a = a.fb
}
};
aa.clear = function () {
for (var a = this.cb.af(), b = a.length, c = 0; c < b; c++)a[c].Pf(!1), this.Ue(-1, a[c])
};
t.A(je, {rl: "parts"}, function () {
return this.cb.l
});
t.A(je, {GJ: "partsBackwards"}, function () {
return this.cb.Rm
});
t.A(je, {h: "diagram"}, function () {
return this.ea
});
t.g(je, "name", je.prototype.name);
t.defineProperty(je, {name: "name"}, function () {
return this.Rb
}, function (a) {
t.j(a, "string", je, "name");
var b = this.Rb;
if (b !== a) {
var c = this.h;
if (null !== c)for ("" === b && t.m("Cannot rename default Layer to: " + a), c = c.Tm; c.next();)c.value.name === a && t.m("Layer.name is already present in this diagram: " + a);
this.Rb = a;
this.i("name", b, a);
for (a = this.cb.l; a.next();)a.value.Ad = this.Rb
}
});
t.g(je, "opacity", je.prototype.opacity);
t.defineProperty(je, {opacity: "opacity"}, function () {
return this.Ef
}, function (a) {
var b = this.Ef;
b !== a && (t.j(a, "number", je, "opacity"), (0 > a || 1 < a) && t.ha(a, "0 <= val <= 1", je, "opacity"), this.Ef = a, this.i("opacity", b, a), a = this.h, null !== a && a.ua())
});
t.g(je, "isTemporary", je.prototype.pc);
t.defineProperty(je, {pc: "isTemporary"}, function () {
return this.xy
}, function (a) {
var b = this.xy;
b !== a && (t.j(a, "boolean", je, "isTemporary"), this.xy = a, this.i("isTemporary", b, a))
});
t.g(je, "visible", je.prototype.visible);
t.defineProperty(je, {visible: "visible"}, function () {
return this.sz
}, function (a) {
var b = this.sz;
if (b !== a) {
t.j(a, "boolean", je, "visible");
this.sz = a;
this.i("visible", b, a);
for (b = this.cb.l; b.next();) {
var c = b.value;
a ? (c.K(Lh), c.updateAdornments()) : (c.K(Mh), c.ze())
}
a = this.h;
null !== a && a.ua()
}
});
t.g(je, "pickable", je.prototype.Ze);
t.defineProperty(je, {Ze: "pickable"}, function () {
return this.Rk
}, function (a) {
var b = this.Rk;
b !== a && (t.j(a, "boolean", je, "pickable"), this.Rk = a, this.i("pickable", b, a))
});
t.g(je, "allowCopy", je.prototype.Rj);
t.defineProperty(je, {Rj: "allowCopy"}, function () {
return this.ok
}, function (a) {
var b = this.ok;
b !== a && (t.j(a, "boolean", je, "allowCopy"), this.ok = a, this.i("allowCopy", b, a))
});
t.g(je, "allowDelete", je.prototype.Zk);
t.defineProperty(je, {Zk: "allowDelete"}, function () {
return this.pk
}, function (a) {
var b = this.pk;
b !== a && (t.j(a, "boolean", je, "allowDelete"), this.pk = a, this.i("allowDelete", b, a))
});
t.g(je, "allowTextEdit", je.prototype.Bo);
t.defineProperty(je, {Bo: "allowTextEdit"}, function () {
return this.yk
}, function (a) {
var b = this.yk;
b !== a && (t.j(a, "boolean", je, "allowTextEdit"), this.yk = a, this.i("allowTextEdit", b, a))
});
t.g(je, "allowGroup", je.prototype.xo);
t.defineProperty(je, {xo: "allowGroup"}, function () {
return this.qk
}, function (a) {
var b = this.qk;
b !== a && (t.j(a, "boolean", je, "allowGroup"), this.qk = a, this.i("allowGroup", b, a))
});
t.g(je, "allowUngroup", je.prototype.Co);
t.defineProperty(je, {Co: "allowUngroup"}, function () {
return this.zk
}, function (a) {
var b = this.zk;
b !== a && (t.j(a, "boolean", je, "allowUngroup"), this.zk = a, this.i("allowUngroup", b, a))
});
t.g(je, "allowLink", je.prototype.wm);
t.defineProperty(je, {wm: "allowLink"}, function () {
return this.rk
}, function (a) {
var b = this.rk;
b !== a && (t.j(a, "boolean", je, "allowLink"), this.rk = a, this.i("allowLink", b, a))
});
t.g(je, "allowRelink", je.prototype.Sj);
t.defineProperty(je, {Sj: "allowRelink"}, function () {
return this.tk
}, function (a) {
var b = this.tk;
b !== a && (t.j(a, "boolean", je, "allowRelink"), this.tk = a, this.i("allowRelink", b, a))
});
t.g(je, "allowMove", je.prototype.$k);
t.defineProperty(je, {$k: "allowMove"}, function () {
return this.sk
}, function (a) {
var b = this.sk;
b !== a && (t.j(a, "boolean", je, "allowMove"), this.sk = a, this.i("allowMove", b, a))
});
t.g(je, "allowReshape", je.prototype.yo);
t.defineProperty(je, {yo: "allowReshape"}, function () {
return this.uk
}, function (a) {
var b = this.uk;
b !== a && (t.j(a, "boolean", je, "allowReshape"), this.uk = a, this.i("allowReshape", b, a))
});
t.g(je, "allowResize", je.prototype.zo);
t.defineProperty(je, {zo: "allowResize"}, function () {
return this.vk
}, function (a) {
var b = this.vk;
b !== a && (t.j(a, "boolean", je, "allowResize"), this.vk = a, this.i("allowResize", b, a))
});
t.g(je, "allowRotate", je.prototype.Ao);
t.defineProperty(je, {Ao: "allowRotate"}, function () {
return this.wk
}, function (a) {
var b = this.wk;
b !== a && (t.j(a, "boolean", je, "allowRotate"), this.wk = a, this.i("allowRotate", b, a))
});
t.g(je, "allowSelect", je.prototype.Ne);
t.defineProperty(je, {Ne: "allowSelect"}, function () {
return this.xk
}, function (a) {
var b = this.xk;
b !== a && (t.j(a, "boolean", je, "allowSelect"), this.xk = a, this.i("allowSelect", b, a))
});
function u(a) {
function b() {
document.removeEventListener("DOMContentLoaded", b, !1);
Nh(c)
}
1 < arguments.length && t.m("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");
t.zc(this);
t.ND = [];
this.lc = !0;
this.gf = 17;
var c = this;
null !== document.body ? Nh(this) : document.addEventListener("DOMContentLoaded", b, !1);
this.Bb = new H(je);
this.sc = this.tc = 0;
this.GC = this.Ab = this.Uf = this.Pa = null;
this.rb = (new C(NaN, NaN)).freeze();
this.Sb = 1;
this.oy = (new C(NaN, NaN)).freeze();
this.py = NaN;
this.Ju =
1E-4;
this.Gu = 100;
this.ad = new pa;
this.Av = (new C(NaN, NaN)).freeze();
this.nu = (new D(NaN, NaN, NaN, NaN)).freeze();
this.El = Ye;
this.Hl = Pb;
this.Jk = Ye;
this.Mn = Pb;
this.uu = this.tu = Qb;
this.Zf = new ta(X);
this.Je = !0;
this.Dn = new ra(A, D);
this.En = !0;
this.vG = 250;
this.uG = 1E3;
this.eh = null;
this.Ut = (new rb(16, 16, 16, 16)).freeze();
this.hu = this.ig = !1;
this.Bq = !0;
this.Gg = new td;
this.Yc = new td;
this.cc = new td;
this.ej = null;
this.qv = -1;
this.ez = !1;
this.Vx = new ra("string", H);
this.Ux = new ra("string", "string");
Oh(this);
this.Tu = new ta(y);
this.Uk = new ta(z);
this.Cu = new ta(A);
this.cb = new ta(w);
this.yu = !0;
this.fC = !1;
this.xv = pg;
this.tj = 10;
this.Ox = this.Tx = this.vv = null;
this.du = "";
this.uq = "auto";
this.ai = this.xi = this.ki = this.Mu = this.li = this.mi = this.ni = this.$h = this.di = this.Yh = null;
this.fi = !0;
this.Hy = !1;
this.Fx = null;
this.Yy = this.ui = !1;
this.mC = !0;
this.Jd = !1;
this.de = null;
var d = this;
this.sC = function (a) {
if (a.fa === d.fa && d.Xa) {
d.Xa = !1;
try {
var b = a.nd;
"" === a.sf && b === Bd && Ph(d, a.object, a.propertyName)
} finally {
d.Xa = !0
}
}
};
this.tC = function (a) {
Qh(d, a)
};
this.YC = !0;
this.bi = new ra(Object, w);
this.Ck = new ra(Object, A);
this.Vl = new ra(Object, Array);
this.Lk = !1;
this.pk = this.ok = this.Jt = this.gi = !0;
this.Lt = this.Kt = !1;
this.Qt = this.Ot = this.xk = this.wk = this.vk = this.uk = this.sk = this.tk = this.rk = this.Nt = this.zk = this.qk = this.yk = !0;
this.Pn = this.kC = !1;
this.Pt = this.Mt = this.su = this.ru = !0;
this.gv = this.fv = 16;
this.Uy = this.ev = !1;
this.Wy = this.Vy = this.Hj = this.Gj = null;
this.Le = (new rb(5)).freeze();
this.jv = (new ta(w)).freeze();
this.Hu = 999999999;
this.Kk = this.qj = this.pj = !0;
this.Ol = this.Nl = !1;
this.ny = this.my = 0;
this.Ld = null;
this.Rt = !0;
this.Yf = !1;
this.Nd = null;
this.dm = 1;
this.gy = !1;
this.MC = 0;
this.XC = (new D(NaN, NaN, NaN, NaN)).freeze();
this.iu = (new D(NaN, NaN, NaN, NaN)).freeze();
this.fo = new ta;
Rh(this);
this.Bu = this.pu = this.Su = this.OB = this.NB = this.PB = this.uj = this.Fk = this.oi = null;
Sh(this);
this.Xc = null;
this.ou = !1;
this.Io = this.GA = null;
this.Eb = new Ge;
this.Eb.initializeStandardTools();
this.Ta = this.Vv = this.Eb;
this.Qe = new va;
this.fa = new U;
this.ui = !0;
this.Tb = new le;
this.ui = !1;
void 0 === a && (a = document.createElement("div"));
this.XB = this.Xx = null;
this.rz = !0;
this.Ty = !1;
this.hj = null;
this.Hk = new Th;
Uh(this, a);
this.Xl = 1;
this.Au = 0;
this.pC = new C;
this.VC = 500;
this.Yr = null;
this.On = !1;
window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android") && (this.On = !0);
this.ty = !1;
window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0") && (this.ty = !0);
this.jC = !1;
window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7") && (this.jC = !0);
this.Rl = 0 <= navigator.platform.toUpperCase().indexOf("MAC");
this.lc = !1
}
t.ia("Diagram", u);
function Sh(a) {
a.oi = new ra("string", w);
var b = new y, c = new ua;
c.bind(new Ce("text", "", ka));
b.add(c);
a.PB = b;
a.oi.add("", b);
b = new y;
c = new ua;
c.stroke = "brown";
c.bind(new Ce("text", "", ka));
b.add(c);
a.oi.add("Comment", b);
b = new y;
b.ik = !1;
b.Fz = !1;
c = new Y;
c.Jb = "Ellipse";
c.fill = "black";
c.stroke = null;
c.Ca = (new oa(3, 3)).Na();
b.add(c);
a.oi.add("LinkLabel", b);
a.Fk = new ra("string", z);
b = new z;
b.ut = "GROUPPANEL";
b.type = Vh;
c = new ua;
c.font = "bold 12pt sans-serif";
c.bind(new Ce("text", "", ka));
b.add(c);
c = new B(Wh);
c.name =
"GROUPPANEL";
var d = new Y;
d.Jb = "Rectangle";
d.fill = "rgba(128,128,128,0.2)";
d.stroke = "black";
c.add(d);
d = new Ug;
d.padding = (new rb(5, 5, 5, 5)).Na();
c.add(d);
b.add(c);
a.NB = b;
a.Fk.add("", b);
a.uj = new ra("string", A);
b = new A;
c = new Y;
c.Ih = !0;
b.add(c);
c = new Y;
c.fn = "Standard";
c.fill = "black";
c.stroke = null;
c.ib = 0;
b.add(c);
a.OB = b;
a.uj.add("", b);
b = new A;
c = new Y;
c.Ih = !0;
c.stroke = "brown";
b.add(c);
a.uj.add("Comment", b);
b = new Ue;
b.type = Wh;
c = new Y;
c.fill = null;
c.stroke = "dodgerblue";
c.ib = 3;
b.add(c);
c = new Ug;
c.margin = (new rb(1.5,
1.5, 1.5, 1.5)).Na();
b.add(c);
a.Su = b;
a.pu = b;
b = new Ue;
b.type = Bg;
c = new Y;
c.Ih = !0;
c.fill = null;
c.stroke = "dodgerblue";
c.ib = 3;
b.add(c);
a.Bu = b
}
function Nh(a) {
var b = document.createElement("p");
b.style.width = "100%";
b.style.height = "200px";
var c = document.createElement("div");
c.style.position = "absolute";
c.style.visibility = "hidden";
c.style.width = "200px";
c.style.height = "150px";
c.style.overflow = "hidden";
c.appendChild(b);
document.body.appendChild(c);
var d = b.offsetWidth;
c.style.overflow = "scroll";
b = b.offsetWidth;
d === b && (b = c.clientWidth);
document.body.removeChild(c);
a.gf = d - b
}
u.prototype.toString = function (a) {
void 0 === a && (a = 0);
var b = "";
this.id && (b = this.id);
this.Ki && this.Ki.id && (b = this.Ki.id);
b = 'Diagram "' + b + '"';
if (0 >= a)return b;
for (var c = this.Bb.l; c.next();)b += "\n " + c.value.toString(a - 1);
return b
};
u.prototype.checkProperties = function () {
return t.mH(this)
};
u.fromDiv = function (a) {
var b = a;
"string" === typeof a && (b = document.getElementById(a));
return b instanceof HTMLDivElement && b.ea instanceof u ? b.ea : null
};
t.g(u, "div", u.prototype.Ki);
t.defineProperty(u, {Ki: "div"}, function () {
return this.Ab
}, function (a) {
null !== a && t.k(a, HTMLDivElement, u, "div");
if (this.Ab !== a) {
var b = this.Ab;
if (null !== b) {
delete b.ea;
b.innerHTML = "";
null !== this.Pa && (this.Pa.ea = null, this.Pa.removeEventListener("touchstart", this.RF, !1), this.Pa.removeEventListener("touchmove", this.QF, !1), this.Pa.removeEventListener("touchend", this.PF, !1));
b = this.vv;
if (null !== b) {
for (var c = b.vC.p, d = c.length, e = 0; e < d; e++)c[e].cancelWaitAfter();
c = b.wC.p;
d = c.length;
for (e = 0; e < d; e++)c[e].cancelWaitAfter();
c = b.xC.p;
d = c.length;
for (e = 0; e < d; e++)c[e].cancelWaitAfter()
}
b.cancelWaitAfter();
this.Uf = this.Pa = null;
window.removeEventListener("resize", this.rA, !1);
window.removeEventListener("mousemove", this.qp, !0);
window.removeEventListener("mousedown", this.pp, !0);
window.removeEventListener("mouseup", this.sp, !0);
window.removeEventListener("mousewheel", this.Yg, !0);
window.removeEventListener("DOMMouseScroll", this.Yg, !0);
window.removeEventListener("mouseout", this.rp, !0)
} else this.Yf = !1;
this.Ab = null;
if (null !== a) {
if (b =
a.ea)b.Ki = null;
Uh(this, a);
this.LA()
}
}
});
function Th() {
this.IG = "63ad05bbe23a1786468a4c741b6d2";
if (this.IG === this._tk)this.ij = !0; else {
var a = "p", b = window[t.Qa("76a715b2f73f148a")][t.Qa("72ba13b5")];
if (t.Qa("77bb5bb2f32603de") === window[t.Qa("76a715b2f73f148a")][t.Qa("6aba19a7ec351488")])try {
this.ij = !window[t.Qa("4da118b7ec2108")]([t.Qa("5bb806bfea351a904a84515e1b6d38b6")])([t.Qa("49bc19a1e6")])([t.Qa("59bd04a1e6380fa5539b")])([t.Qa("7bb8069ae7")] === t.Qa(t.Ev));
if (!1 === this.ij)return;
this.ij = !window[t.Qa("4da118b7ec2108")]([t.Qa("5bb806bfea351a904a84515e1b6d38b6")])([t.Qa("49bc19a1e6")])([t.Qa("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([t.Qa("7bb8069ae7")] === t.Qa(t.Ev));
if (!1 === this.ij)return
} catch (c) {
}
for (var d = b[t.Qa("76ad18b4f73e")], e = b[t.Qa("73a612b6fb191d")](t.Qa("35e7")) + 2; e < d; e++)a += b[e];
d = a[t.Qa("73a612b6fb191d")](t.Qa(t.Ev));
0 >= d && t.Qa(t.Ev) !== t.Qa("7da71ca0ad381e90") && (d = a[t.Qa("73a612b6fb191d")](t.Qa("76a715b2ef3e149757")));
if (this.ij = !(0 < d && d < a[t.Qa("73a612b6fb191d")](t.Qa("35"))))for (a = document[t.Qa("69bc0fbfe6051381469f4c")], d = a.length, e = 0; e < d; e++) {
b = null;
try {
b = a[e][t.Qa("79bb0581f63a1e97")]
} catch (g) {
}
if (null !== b) {
for (var h = b.length, k = 0; k < h; k++)if (b[k][t.Qa("69ad1ab6e0221496778e4767")] ===
t.Qa("02cncncn")) {
var l = b[k][t.Qa("69bc0fbfe6")][t.Qa("78a704b7e6242f8b53a8507f1b7b")];
if (!l)return;
if (-1 !== l.indexOf(t.Qa(t.nH)) && -1 !== l.indexOf(t.Qa(t.oH))) {
this.ij = !1;
break
}
}
if (!1 === this.ij)break
}
}
}
}
Th.prototype.Cl = function (a) {
this.ij=false;
a.tG();
return 0 < this.ij && this !== this.GG ? !0 : !1
};
Th.prototype.t = function () {
this.GG = null
};
function Uh(a, b) {
void 0 !== b && null !== b || t.m("Diagram setup requires an argument DIV.");
null !== a.Ab && t.m("Diagram has already completed setup.");
"string" === typeof b ? a.Ab = document.getElementById(b) : b instanceof HTMLDivElement ? a.Ab = b : t.m("No DIV or DIV id supplied: " + b);
null === a.Ab && t.m("Invalid DIV id; could not get element with id: " + b);
void 0 !== a.Ab.ea && t.m("Invalid div id; div already has a Diagram associated with it.");
"static" === window.getComputedStyle(a.Ab, null).position && (a.Ab.style.position =
"relative");
a.Ab.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)";
a.Ab.style["-ms-touch-action"] = "none";
a.Ab.innerHTML = "";
a.Ab.ea = a;
var c = document.createElement("canvas");
if (c.getContext && c.getContext("2d")) {
c.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", c.style.zIndex = "2", c.style.KJ = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect = "none");
a.tc =
a.Ab.clientWidth || 1;
a.sc = a.Ab.clientHeight || 1;
c.width = a.tc;
c.height = a.sc;
var d = document.createElement("canvas"), e = d.getContext("2d");
d.width = 1;
d.height = 1;
a.Xx = d;
a.XB = e;
a.ny = 0;
a.my = 0;
document.body ? (d = document.body.parentNode, a.ny = d.offsetTop || 0, a.my = d.offsetLeft || 0) : document.addEventListener("load", function () {
if (document.body) {
var b = document.body.parentNode;
a.ny = b.offsetTop || 0;
a.my = b.offsetLeft || 0
}
}, !1);
c.ea = a;
a.Pa = c;
a.Uf = c.getContext("2d");
e = a.Uf;
a.tG = e[t.Qa("69ad0287f137159745844d7e")][t.Qa("78a118b7")](e,
1, 0, 0, 1, 0, 0);
a.yx = e[t.Qa("7eba17a4ca3b1a8346")][t.Qa("78a118b7")](e, t.Cl, 4, 4);
a.Ab.insertBefore(c, a.Ab.firstChild);
var d = document.createElement("div"), e = document.createElement("div"), g = document.createElement("div"), h = document.createElement("div");
d.style.position = "absolute";
d.style.overflow = "auto";
d.style.width = a.Pa.width + "px";
d.style.height = a.Pa.height + "px";
d.style.zIndex = "1";
e.style.position = "absolute";
e.style.overflow = "auto";
e.style.width = a.Pa.width + "px";
e.style.height = a.Pa.height + "px";
e.style.zIndex =
"1";
g.style.position = "absolute";
g.style.width = "1px";
g.style.height = "1px";
h.style.position = "absolute";
h.style.width = "1px";
h.style.height = "1px";
a.Ab.appendChild(d);
a.Ab.appendChild(e);
d.appendChild(g);
e.appendChild(h);
d.onscroll = a.AC;
d.onmousedown = a.BC;
d.ea = a;
d.JC = !0;
e.onscroll = a.AC;
e.onmousedown = a.BC;
e.ea = a;
e.KC = !0;
a.Gj = d;
a.Hj = e;
a.Vy = g;
a.Wy = h;
a.preventDefault = function (a) {
a.preventDefault();
return!1
};
a.qp = function (b) {
if (a.isEnabled) {
a.Pn = !0;
var c = a.Yc;
a.On && c.sw ? (b.preventDefault(), b.simulated = !0, a.Yr =
b) : (a.Yc = a.cc, a.cc = c, Xh(a, a, b, c, !0), a.CF(b, new C, b.target.ea) || (a.Ta.doMouseMove(), a.Ta.isBeyondDragSize() && (Yh(a), a.Xl = 0)))
}
};
a.pp = function (b) {
if (a.isEnabled) {
a.Pn = !0;
var c = a.Yc;
if (a.On && null !== a.Yr)a.Yr = b, b.preventDefault(); else if (a.Yc = a.cc, a.cc = c, Xh(a, a, b, c, !0), c.$j = !0, c.Ae = b.detail, a.Gg = c.copy(), !0 === c.Aq.simulated)b.preventDefault(), b.simulated = !0; else if (f && f.XE && (window.XE = a.Po(c.W)), hf = null, a.Ta.doMouseDown(), 1 === b.button)return b.preventDefault(), !1
}
};
a.sp = function (b) {
if (a.isEnabled) {
a.Pn = !0;
var c = a.Yc;
if (a.On && null !== a.Yr)a.Yr = null, b.preventDefault(); else {
a.Yc = a.cc;
a.cc = c;
Xh(a, a, b, c, !0);
c.$i = !0;
c.Ae = b.detail;
if (a.ty || a.jC)b.timeStamp - a.Au < a.VC && !a.Ta.isBeyondDragSize() ? a.Xl++ : a.Xl = 1, a.Au = b.timeStamp, c.Ae = a.Xl;
c.bubbles = b.bubbles;
b.target.ea && (c.zg = b.target.ea);
a.DF(b, null, new C, c.zg) || (a.Ta.doMouseUp(), wf(a), ga(a, c, b))
}
}
};
a.Yg = function (b) {
if (a.isEnabled) {
var c = a.Yc;
a.Yc = a.cc;
a.cc = c;
Xh(a, a, b, c, !0);
c.bubbles = !0;
c.Yj = void 0 !== b.wheelDelta ? b.wheelDelta : -40 * b.detail;
a.Ta.doMouseWheel();
ga(a, c, b)
}
};
a.rp = function () {
if (a.isEnabled) {
a.Pn = !1;
var b = a.Ta;
b.cancelWaitAfter();
b instanceof Ge && b.hideToolTip()
}
};
a.rA = function () {
if (null !== a.Pa) {
var b = a.Ab, c = 0;
a.Ol && (c = a.gf);
var d = 0;
a.Nl && (d = a.gf);
0 === b.clientWidth || 0 === b.clientHeight || b.clientWidth === a.tc + c && b.clientHeight === a.sc + d || (a.qj = !0, a.Je = !0, b = a.Tb, null !== b && b.Ws && b.K(), a.Jd || a.Of())
}
};
a.RF = function (b) {
if (a.isEnabled) {
a.ez = !1;
if (1 < b.touches.length && (a.Ta.doCancel(), !a.fi || !t.LF)) {
if (a.fi) {
a.gy = !0;
a.dm = a.scale;
var c = a.Pa, d = c.getBoundingClientRect(),
e = b.targetTouches[0], g = e.clientX - c.width / d.width * d.left, h = e.clientY - c.height / d.height * d.top, e = b.targetTouches[1], g = e.clientX - c.width / d.width * d.left - g, c = e.clientY - c.height / d.height * d.top - h, c = Math.sqrt(g * g + c * c);
a.MC = c;
b.preventDefault();
b.cancelBubble = !0;
return!1
}
Yh(a);
b.cancelBubble = !1;
return!0
}
c = a.Yc;
a.Yc = a.cc;
a.cc = c;
c.h = a;
d = a.Hg(b.targetTouches[0]);
c.Bc = a.gn(d);
c.W = d;
c.Uc = 0;
c.button = 0;
c.$j = !0;
c.$i = !1;
c.Ae = 1;
c.Yj = 0;
c.Ee = !1;
c.bubbles = !1;
c.event = b;
c.timestamp = Date.now();
c.zg = b.target.ea ? b.target.ea :
null;
c.Xd = null;
a.Gg = c.copy();
hf = null;
a.Ta.doMouseDown();
Zh(a, c);
ga(a, c, b)
}
};
a.QF = function (b) {
if (a.isEnabled) {
if (1 < b.touches.length && (a.Ta.doCancel(), Yh(a), !a.fi || !t.LF)) {
if (a.fi && a.gy && 1 < b.targetTouches.length) {
var c = a.Pa, d = c.getBoundingClientRect(), e = b.targetTouches[0], g = e.clientX - c.width / d.width * d.left, h = e.clientY - c.height / d.height * d.top, e = b.targetTouches[1], r = e.clientX - c.width / d.width * d.left, e = e.clientY - c.height / d.height * d.top, c = r - g, d = e - h, c = Math.sqrt(c * c + d * d) / a.MC, e = new C(Math.min(r, g) + Math.max(r,
g) / 2, Math.min(e, h) + Math.max(e, h) / 2), g = a.dm * c, h = a.Qe;
if (g > a.scale && h.canIncreaseZoom() || g < a.scale && h.canDecreaseZoom())h = a.Uh, a.Uh = e, a.scale = g, a.Uh = h;
b.preventDefault();
b.cancelBubble = !0;
return!1
}
b.cancelBubble = !1;
return!0
}
g = a.Yc;
a.Yc = a.cc;
a.cc = g;
e = h = null;
0 < b.changedTouches.length ? e = b.changedTouches[0] : 0 < b.targetTouches.length && (e = b.targetTouches[0]);
g.h = a;
e ? ((h = document.elementFromPoint(e.clientX, e.clientY)) && h.ea ? (r = h.ea.Hg(e), c = h.ea) : (r = a.Hg(b.changedTouches[0]), c = a), g.W = r, g.Bc = c.gn(r)) : null !==
a.Yc ? (g.W = a.Yc.W, g.Bc = a.Yc.Bc, h = a.Yc.zg) : null !== a.Gg && (g.W = a.Gg.W, g.Bc = a.Gg.Bc, h = a.Gg.zg);
g.Uc = 0;
g.button = 0;
g.$j = !1;
g.$i = !1;
g.Ae = 1;
g.Yj = 0;
g.Ee = !1;
g.bubbles = !1;
g.event = b;
g.timestamp = Date.now();
g.zg = null === h ? b.target.ea : h.ea ? h.ea : null;
g.Xd = null;
a.Ta.isBeyondDragSize() && Yh(a);
a.CF(e ? e : b, new C, g.zg) || (a.Ta.doMouseMove(), ga(a, g, b))
}
};
a.PF = function (b) {
if (a.isEnabled) {
Yh(a);
if (a.ez)return b.preventDefault(), !1;
var c = a.Yc;
a.Yc = a.cc;
a.cc = c;
if (1 < b.touches.length)a.fi && (a.gy = !1); else {
var d = null, e, g = null;
0 < b.changedTouches.length ?
g = b.changedTouches[0] : 0 < b.targetTouches.length && (g = b.targetTouches[0]);
c.h = a;
c.Ae = 1;
if (g) {
var d = document.elementFromPoint(g.clientX, g.clientY), h;
d && d.ea ? (e = d.ea.Hg(g), h = d.ea) : (e = a.Hg(b.changedTouches[0]), h = a);
c.W = e;
c.Bc = h.gn(e);
e = new C(g.screenX, g.screenY);
h = a.pC;
b.timeStamp - a.Au < a.VC && !(25 < Math.abs(h.x - e.x) || 25 < Math.abs(h.y - e.y)) ? a.Xl++ : a.Xl = 1;
c.Ae = a.Xl;
a.Au = b.timeStamp;
a.pC = e
} else null !== a.Yc ? (c.W = a.Yc.W, c.Bc = a.Yc.Bc, d = a.Yc.zg) : null !== a.Gg && (c.W = a.Gg.W, c.Bc = a.Gg.Bc, d = a.Gg.zg);
c.Uc = 0;
c.button = 0;
c.$j = !1;
c.$i = !0;
c.Yj = 0;
c.Ee = !1;
c.bubbles = !1;
c.event = b;
c.timestamp = Date.now();
c.zg = null === d ? b.target.ea : d.ea ? d.ea : null;
c.Xd = null;
a.DF(g ? g : b, null, new C, c.zg) || (a.Ta.doMouseUp(), ga(a, c, b))
}
}
};
c.addEventListener("touchstart", a.RF, !1);
c.addEventListener("touchmove", a.QF, !1);
c.addEventListener("touchend", a.PF, !1);
c.addEventListener("gesturestart", function () {
!1 !== a.fi && (a.dm = a.scale, a.Ta.doCancel(), a.bC = 0)
}, !1);
c.addEventListener("gesturechange", function (b) {
if (!1 !== a.fi) {
var c = b.scale;
a.bC++;
if (1 === a.bC)if (1.02 <
c || 0.98 > c)b.preventDefault(); else {
a.dm = null;
return
}
if (null !== a.dm) {
var d = a.Pa, e = d.getBoundingClientRect();
b = new C(b.pageX - window.scrollX - d.width / e.width * e.left, b.pageY - window.scrollY - d.height / e.height * e.top);
d = a.Uh;
c *= a.dm;
e = a.Qe;
if (c > a.scale && e.canIncreaseZoom() || c < a.scale && e.canDecreaseZoom())a.Uh = b, a.scale = c, a.Uh = d
}
}
}, !1);
c.addEventListener("gestureend", function () {
a.dm = 1
}, !1);
c.addEventListener("mousemove", a.qp, !1);
c.addEventListener("mousedown", a.pp, !1);
c.addEventListener("mouseup", a.sp, !1);
c.addEventListener("mousewheel",
a.Yg, !1);
c.addEventListener("DOMMouseScroll", a.Yg, !1);
c.addEventListener("mouseout", a.rp, !1);
c.addEventListener("keydown", a.yI, !1);
c.addEventListener("keyup", a.zI, !1);
c.addEventListener("selectstart", function (a) {
a.preventDefault();
return!1
}, !1);
c.addEventListener("contextmenu", function (a) {
a.preventDefault();
return!1
}, !1);
window.addEventListener("resize", a.rA, !1);
c.tabIndex = 0;
$h(a)
} else a.Ab.innerHTML = "This text is displayed if your browser does not support the Canvas HTML element."
}
u.prototype.focus = u.prototype.focus = function () {
this.Pa && this.Pa.focus()
};
function $h(a, b, c) {
void 0 === b && (b = a.Uf);
void 0 === c && (c = !0);
c && (b.It = "");
b.ln = "";
b.Dl = ""
}
function Rh(a) {
var b = new je;
b.name = "Background";
a.rs(b);
b = new je;
b.name = "";
a.rs(b);
b = new je;
b.name = "Foreground";
a.rs(b);
b = new je;
b.name = "Adornment";
b.pc = !0;
a.rs(b);
b = new je;
b.name = "Tool";
b.pc = !0;
a.rs(b);
b = new je;
b.name = "Grid";
b.Ne = !1;
b.Ze = !1;
b.pc = !0;
a.PG(b, a.il("Background"))
}
function ai(a) {
a.Xc = new B(bi);
a.Xc.name = "GRID";
var b = new Y;
b.Jb = "LineH";
b.stroke = "lightgray";
b.ib = 0.5;
b.interval = 1;
a.Xc.add(b);
b = new Y;
b.Jb = "LineH";
b.stroke = "gray";
b.ib = 0.5;
b.interval = 5;
a.Xc.add(b);
b = new Y;
b.Jb = "LineH";
b.stroke = "gray";
b.ib = 1;
b.interval = 10;
a.Xc.add(b);
b = new Y;
b.Jb = "LineV";
b.stroke = "lightgray";
b.ib = 0.5;
b.interval = 1;
a.Xc.add(b);
b = new Y;
b.Jb = "LineV";
b.stroke = "gray";
b.ib = 0.5;
b.interval = 5;
a.Xc.add(b);
b = new Y;
b.Jb = "LineV";
b.stroke = "gray";
b.ib = 1;
b.interval = 10;
a.Xc.add(b);
b = new w;
b.add(a.Xc);
b.Ad = "Grid";
b.ow = !1;
b.Ze = !1;
b.Zs = "GRID";
a.add(b);
a.cb.remove(b);
a.Xc.visible = !1
}
u.prototype.AC = function () {
if (this.ea.isEnabled) {
var a = this.ea;
if (a.Uy && null !== a.Pa) {
a.ev = !0;
var b = a.vc, c = a.nb, 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 = a.scale;
if (e < d || h < g) {
var s = t.O();
this.JC && a.hf ? (s.q(this.scrollLeft / r + p, a.position.y), a.position = s) : this.KC && a.jf && (s.q(a.position.x, this.scrollTop / r + b), a.position = s);
t.B(s);
a.ev = !1;
a.qj = !1
} else s = t.O(), this.JC && a.hf && (p < q && (a.position = new C(this.scrollLeft + p, a.position.y)), k > l && (a.position =
new C(-(a.Gj.scrollWidth - a.tc) + this.scrollLeft - a.tc / r + a.vc.right, a.position.y))), this.KC && a.jf && (b < c && (a.position = new C(a.position.x, this.scrollTop + b)), m > n && (a.position = new C(a.position.x, -(a.Hj.scrollHeight - a.sc) + this.scrollTop - a.sc / r + a.vc.bottom))), t.B(s), ci(a), a.ev = !1, a.qj = !1, b = a.vc, c = a.nb, 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 && (a.Vy.style.width = "1px"), h >= g && b >= c && m <= n && (a.Wy.style.height = "1px")
}
} else di(this.ea)
};
u.prototype.BC = function () {
this.ea.isEnabled ? this.ea.Uy = !0 : di(this.ea)
};
u.prototype.computeBounds = u.prototype.kf = function () {
0 < this.Zf.count && ei(this);
return fi(this)
};
function fi(a) {
if (a.Wz.Q()) {
var b = a.Wz.copy();
b.Cv(a.padding);
return b
}
for (var c = !0, d = a.Bb.p, e = d.length, g = 0; g < e; g++) {
var h = d[g];
if (h.visible && !h.pc)for (var h = h.cb.p, k = h.length, l = 0; l < k; l++) {
var m = h[l];
m.ow && m.zb() && (m = m.ya, m.Q() && (c ? (c = !1, b = m.copy()) : b.mk(m)))
}
}
c && (b = new D(0, 0, 0, 0));
b.Cv(a.padding);
return b
}
u.prototype.computePartsBounds = function (a) {
var b = null;
for (a = a.l; a.next();) {
var c = a.value;
c instanceof A || (c.Hf(), null === b ? b = c.ya.copy() : b.mk(c.ya))
}
return null === b ? new D(NaN, NaN, 0, 0) : b
};
function gi(a, b) {
if ((b || a.Yf) && !a.lc && a.vc.Q() && null !== a.Pa) {
a.lc = !0;
var c = a.El;
b && a.Jk !== Ye && (c = a.Jk);
var d = c !== Ye ? hi(a, c) : a.scale, c = a.nb.copy(), e = a.tc / d, g = a.sc / d;
a.position.Va();
var h = a.Hl;
b && a.Mn.qd() && (h = a.Mn);
ii(a, a.rb, a.vc, e, g, h);
a.position.freeze();
a.scale = d;
a.lc = !1;
d = a.nb;
d.Mi(c) || a.kt(c, d)
}
}
function hi(a, b) {
if (null !== a.Pa) {
a.pj && ji(a, a.kf());
var c = a.vc;
if (!c.Q())return 1;
var d = c.width, c = c.height, e = a.tc, g = a.sc, h = e / d, k = g / c, l = 1;
return b === qi ? (l = Math.min(k, h), 1 < l && (l = 1), l < a.qg && (l = a.qg), l > a.pg && (l = a.pg), l) : b === ri ? (l = k > h ? (g - a.gf) / c : (e - a.gf) / d, 1 < l && (l = 1), l < a.qg && (l = a.qg), l > a.pg && (l = a.pg), l) : a.scale
}
}
u.prototype.zoomToFit = u.prototype.zoomToFit = function () {
this.scale = hi(this, qi)
};
u.prototype.zoomToRect = function (a, b) {
void 0 === b && (b = qi);
var c = a.width, d = a.height;
if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) {
var e = 1;
if (b === qi || b === ri)if (isNaN(c))e = this.nb.height * this.scale / d; else if (isNaN(d))e = this.nb.width * this.scale / c; else var e = this.tc, g = this.sc, e = b === ri ? g / d > e / c ? (g - (this.Nl ? this.gf : 0)) / d : (e - (this.Ol ? this.gf : 0)) / c : Math.min(g / d, e / c);
this.scale = e;
this.position = new C(a.x, a.y)
}
};
u.prototype.alignDocument = function (a, b) {
this.pj && ji(this, this.kf());
var c = this.vc, d = this.nb, e = this.lc;
this.lc = !0;
this.position = new C(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));
this.lc = e;
this.ua()
};
function ii(a, b, c, d, e, g) {
g.qd() && (d > c.width && (b.x = c.x + (g.x * c.width + g.offsetX) - (g.x * d - g.offsetX)), e > c.height && (b.y = c.y + (g.y * c.height + g.offsetY) - (g.y * e - g.offsetY)));
d < c.width ? (g = b.x + d / 2, g = Math.min(g, c.right - d / 2), g = Math.max(g, c.left + d / 2), b.x = g - d / 2) : b.x > c.left ? b.x = c.left : b.x < c.right - d && (b.x = c.right - d);
e < c.height ? (d = b.y + e / 2, d = Math.min(d, c.bottom - e / 2), d = Math.max(d, c.top + e / 2), b.y = d - e / 2) : b.y > c.top ? b.y = c.top : b.y < c.bottom - e && (b.y = c.bottom - e);
isFinite(b.x) || (b.x = -a.padding.left);
isFinite(b.y) || (b.y = -a.padding.top)
}
u.prototype.findPartAt = u.prototype.Hs = function (a, b) {
var c = b ? Wf(this, a, function (a) {
return a.U
}, function (a) {
return a.canSelect()
}) : Wf(this, a, function (a) {
return a.U
});
return c instanceof w ? c : null
};
u.prototype.findObjectAt = u.prototype.Qd = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
var d = this.Bb.Rm;
for (ei(this); d.next();) {
var e = d.value;
if (e.visible && (e = e.Qd(a, b, c), null !== e))return e
}
return null
};
function Wf(a, b, c, d) {
void 0 === c && (c = null);
void 0 === d && (d = null);
var e = a.Bb.Rm;
for (ei(a); e.next();)if (a = e.value, a.visible && !a.pc && (a = a.Qd(b, c, d), null !== a))return a;
return null
}
u.prototype.findObjectsAt = u.prototype.Po = function (a, b, c, d) {
void 0 === b && (b = null);
void 0 === c && (c = null);
d instanceof H || d instanceof ta || (d = new ta(X));
ei(this);
for (var e = this.Bb.Rm; e.next();) {
var g = e.value;
g.visible && g.Po(a, b, c, d)
}
return d
};
u.prototype.findObjectsIn = u.prototype.bk = function (a, b, c, d, e) {
void 0 === b && (b = null);
void 0 === c && (c = null);
void 0 === d && (d = !1);
e instanceof H || e instanceof ta || (e = new ta(X));
ei(this);
for (var g = this.Bb.Rm; g.next();) {
var h = g.value;
h.visible && h.bk(a, b, c, d, e)
}
return e
};
u.prototype.Vz = function (a, b, c, d, e, g) {
var h = new ta(X);
ei(this);
for (var k = this.Bb.Rm; k.next();) {
var l = k.value;
l.visible && l.Vz(a, b, c, d, h, e, g)
}
return h
};
u.prototype.findObjectsNear = u.prototype.Lm = 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 H || e instanceof ta)g = e;
e = !0
}
g instanceof H || g instanceof ta || (g = new ta(X));
ei(this);
for (var h = this.Bb.Rm; h.next();) {
var k = h.value;
k.visible && k.Lm(a, b, c, d, e, g)
}
return g
};
function Yh(a) {
-1 !== a.qv && (clearTimeout(a.qv), a.qv = -1)
}
function Zh(a, b) {
var c = b.copy();
a.qv = setTimeout(function () {
c.button = 2;
a.T = c;
a.ez = !0;
a.Ta.doMouseUp()
}, 850)
}
function Xh(a, b, c, d, e) {
d.h = b;
e ? (e = b.Hg(c), d.Bc = b.gn(e), d.W = e) : (d.Bc = b.cc.Bc, d.W = b.cc.W);
b = 0;
c.ctrlKey && (b += 1);
c.altKey && (b += 2);
c.shiftKey && (b += 4);
c.metaKey && (b += 8);
d.Uc = b;
d.button = c.button;
a.Rl && 0 === c.button && c.ctrlKey && (d.button = 2);
d.$j = !1;
d.$i = !1;
d.Ae = 1;
d.Yj = 0;
d.Ee = !1;
d.bubbles = !1;
d.event = c;
d.timestamp = Date.now();
d.zg = c.target.ea ? c.target.ea : null;
d.Xd = null
}
function ga(a, b, c) {
if (b.bubbles)return f && f.mE && t.trace("NOT handled " + c.type + " " + b.toString()), !0;
f && f.mE && t.trace("handled " + c.type + " " + a.Ta.name + " " + b.toString());
void 0 !== c.stopPropagation && c.stopPropagation();
(void 0 === c.touches || 2 > c.touches.length) && c.preventDefault();
c.cancelBubble = !0;
return!1
}
u.prototype.yI = function (a) {
if (this.ea.isEnabled) {
var b = this.ea.cc;
Xh(this.ea, this.ea, a, b, !1);
b.key = String.fromCharCode(a.which);
b.$j = !0;
switch (a.which) {
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:
b.key = "Add";
break;
case 189:
b.key = "Subtract";
break;
case 107:
b.key = "Add";
break;
case 109:
b.key = "Subtract";
break;
case 27:
b.key = "Esc"
}
this.ea.Ta.doKeyDown();
return 187 !== a.which && 189 !== a.which && 48 !== a.which && 107 !== a.which && 109 !== a.which || !0 !== a.ctrlKey ? ga(this.ea, b, a) : (a.cancelBubble = !0, void 0 !== a.preventDefault ? a.preventDefault() : a.returnValue = !1, Event.stop && (t.m("Event.stop can fire for this browser"), Event.stop(a)), void 0 !== a.stopPropagation && a.stopPropagation(), !1)
}
};
u.prototype.zI = function (a) {
if (this.ea.isEnabled) {
var b = this.ea.cc;
Xh(this.ea, this.ea, a, b, !1);
b.key = String.fromCharCode(a.which);
b.$i = !0;
switch (a.which) {
case 33:
b.key = "PageUp";
break;
case 34:
b.key = "PageDown";
break;
case 35:
b.key = "End";
break;
case 36:
b.key = "Home";
break;
case 37:
b.key = "Left";
break;
case 38:
b.key = "Up";
break;
case 39:
b.key = "Right";
break;
case 40:
b.key = "Down";
break;
case 45:
b.key = "Insert";
break;
case 46:
b.key = "Del"
}
this.ea.Ta.doKeyUp();
return ga(this.ea, b, a)
}
};
u.prototype.Hg = function (a) {
var b = this.Pa;
if (null === b)return new C(0, 0);
var c = b.getBoundingClientRect(), d = a.clientX - b.width / c.width * c.left;
a = a.clientY - b.height / c.height * c.top;
return null !== this.ad ? (d = new C(d, a), Xa(d, this.ad), d) : new C(d, a)
};
t.g(u, "renderingHints", u.prototype.hF);
t.defineProperty(u, {hF: "renderingHints"}, function () {
return this.GC
}, function (a) {
this.GC = a;
this.LA()
});
u.prototype.invalidateDocumentBounds = u.prototype.Ac = function () {
this.pj = !0;
this.Of()
};
function si(a) {
a.Jd || ei(a);
a.pj && ji(a, a.kf());
gi(a);
for (a = a.fo.l; a.next();)si(a.value)
}
u.prototype.redraw = u.prototype.LA = function () {
this.lc || this.Jd || (this.ua(), ti(this), ci(this), this.Ac(), this.Vi())
};
u.prototype.isUpdateRequested = function () {
return this.ig
};
u.prototype.delayInitialization = function (a) {
ui(this);
this.Yf = !1;
a && setTimeout(a, 1)
};
u.prototype.requestUpdate = u.prototype.Of = function (a) {
void 0 === a && (a = !1);
if (!0 !== this.ig && !(this.lc || !1 === a && this.Jd)) {
this.ig = !0;
var b = this;
requestAnimationFrame(function () {
b.ig && b.Vi()
})
}
};
u.prototype.maybeUpdate = u.prototype.Vi = function () {
if (!this.Bq || this.ig)this.Bq && (this.Bq = !1), ui(this)
};
function ui(a) {
if (!a.Jd && (a.ig = !1, null !== a.Ab)) {
a.Jd = !0;
a.rA();
!a.lc && a.qj && (di(a) || di(a));
null !== a.Xc && (a.Xc.visible && !a.ou && (vi(a), a.ou = !0), !a.Xc.visible && a.ou && (a.ou = !1));
ei(a);
var b = !1;
if (!a.Yf || a.Rt)a.Yf ? wi(a, !a.hu) : (a.rc("Initial Layout"), wi(a, !1)), b = !0;
a.hu = !1;
ei(a);
a.Yy || si(a);
b && (a.Yf || (xi(a), vi(a)), a.Ja("LayoutCompleted"));
yi(a);
ei(a);
a.lc || !a.qj || di(a) || (di(a), ei(a));
b && !a.Yf && (a.Yf = !0, a.Ce("Initial Layout"), a.Aa.clear(), setTimeout(function () {
a.gk = !1
}, 1));
a.Se();
a.Jd = !1
}
}
function xi(a) {
if (a.Jk !== Ye)a.scale = hi(a, a.Jk); else if (a.El !== Ye)a.scale = hi(a, a.El); else {
var b = a.tE;
isFinite(b) && 0 < b && (a.scale = b)
}
a.pj && ji(a, a.kf());
b = a.sE;
if (b.Q())a.position = b; else {
b = t.O();
b.vt(a.vc, a.rE);
var c = a.nb, c = t.kk(0, 0, c.width, c.height), d = t.O();
d.vt(c, a.uE);
a.position = new C(b.x - d.x, b.y - d.y);
t.Qc(c);
t.B(d);
t.B(b);
gi(a, !0)
}
a.Ja("InitialLayoutCompleted")
}
function ei(a) {
if (0 !== a.Zf.count)for (var b = 0; 23 > b; b++) {
var c = a.Zf.l;
if (null === c || 0 === a.Zf.count)break;
a.Zf = new ta(X);
var d = a, e = a.Zf;
for (c.reset(); c.next();) {
var g = c.value;
!g.Ud() || g instanceof z || (g.ml() ? (Ch(g, Infinity, Infinity), g.Ec()) : e.add(g))
}
for (c.reset(); c.next();)g = c.value, g instanceof z && zi(d, g);
for (c.reset(); c.next();)d = c.value, d instanceof A && (d.ml() ? (Ch(d, Infinity, Infinity), d.Ec(), d.ww()) : e.add(d));
for (c.reset(); c.next();)d = c.value, d instanceof Ue && (d.ml() ? (Ch(d, Infinity, Infinity), d.Ec()) :
e.add(d))
}
}
function zi(a, b) {
for (var c = b.Hc, d = t.Db(); c.next();) {
var e = c.value;
e instanceof z ? (Ai(e) || Bi(e) || Ci(e)) && zi(a, e) : e instanceof A ? d.push(e) : (Ch(e, Infinity, Infinity), e.Ec())
}
c = d.length;
for (e = 0; e < c; e++) {
var g = d[e];
Ch(g, Infinity, Infinity);
g.Ec()
}
t.Da(d);
Ch(b, Infinity, Infinity);
b.Ec()
}
u.prototype.Pf = function (a, b, c, d) {
for (var e = 0; e < b; e++)a[e].Pf(c, d)
};
u.prototype.Se = function (a, b) {
null === this.Ab && t.m("No div specified");
var c = this.Pa;
null === c && t.m("No canvas specified");
a || (a = this.Uf);
var d = a !== this.Uf, e = this.Bb.p, g = e.length, h = this;
this.Pf(e, g, h);
if (d)$h(this, a), ci(this); else if (!this.Je && void 0 === b)return;
var g = this.rb, k = this.Sb, l = Math.round(g.x * k) / k, m = Math.round(g.y * k) / k, n = this.ad;
n.reset();
1 !== k && n.scale(k);
0 === g.x && 0 === g.y || n.translate(-l, -m);
var p = this.hj;
if (k = null !== p && 0 < p.length && !0 === this.Ty) {
m = this.ty;
a.save();
a.beginPath();
g = p.length;
for (l = 0; l < g; l++) {
var q = p[l];
if (0 !== q[2] || 0 !== q[3])q = da(this, q), a.rect(Math.floor(q[0]) - 1, Math.floor(q[1]) - 1, Math.ceil(q[2]) + 2, Math.ceil(q[3]) + 2), m && a.clearRect(Math.floor(q[0]) - 1, Math.floor(q[1]) - 1, Math.ceil(q[2]) + 2, Math.ceil(q[3]) + 2)
}
a.clip()
}
this.On ? (c.width = c.width, k = !1, $h(this, a)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.clearRect(0, 0, this.tc, this.sc));
a.miterLimit = 9;
a.setTransform(n.m11, n.m12, n.m21, n.m22, n.dx, n.dy);
f && f.al && f.TD(this, a);
c = b ? function (c) {
var d = a;
if (c.visible) {
d.globalAlpha = c.Ef;
var e = c.cb;
c = c.Xu;
c.length = 0;
for (var g = h.scale, k = e.length, l = 0; l < k; l++) {
var m = e.p[l];
if (Gh(m) && !b.contains(m)) {
if (m instanceof A && (m.ac && c.push(m), !1 === m.Rg))continue;
var n = m.ya;
1 < n.width * g || 1 < n.height * g ? m.Se(d, h) : Ih(m, d)
}
}
d.globalAlpha = 1
}
} : k ? function (b) {
Jh(b, a, h, p)
} : function (b) {
b.Se(a, h)
};
Di(this, a);
g = e.length;
for (l = 0; l < g; l++)c(e[l]);
this.hj = [];
this.Hk ? this.Hk.Cl(this) && this.yx() : this.Hg = function () {
};
k && (a.restore(), $h(this, a), f && f.QH && f.PH(p, a, this));
f && (f.Tz || f.al) && f.Sz(a, this, n);
d ? ($h(this), ci(this)) : this.Je =
this.Kk = !1
};
function Ei(a, b, c, d, e) {
null === a.Ab && t.m("No div specified");
var g = a.Pa;
null === g && t.m("No canvas specified");
var h = a.Uf;
if (a.Je) {
a.On ? (g.width = g.width, $h(a, h)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.tc, a.sc));
h.iG = !1;
h.qE = !1;
h.drawImage(a.Xx, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e));
e = a.rb;
var g = a.Sb, k = Math.round(e.x * g) / g, l = Math.round(e.y * g) / g;
d = a.ad;
d.reset();
1 !== g && d.scale(g);
0 === e.x && 0 === e.y || d.translate(-k, -l);
h.save();
h.beginPath();
e = c.length;
for (g = 0; g < e; g++)k = c[g], 0 !== k[2] && 0 !== k[3] &&
h.rect(Math.floor(k[0]), Math.floor(k[1]), Math.ceil(k[2]), Math.ceil(k[3]));
h.clip();
h.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
f && f.al && f.TD(a, h);
c = a.Bb.p;
e = c.length;
a.Pf(c, e, a);
Di(a, h);
for (g = 0; g < e; g++)Jh(c[g], h, a, b);
h.restore();
$h(a);
f && (f.Tz || f.al) && f.Sz(h, a, d);
a.Hk ? a.Hk.Cl(a) && a.yx() : a.Hg = function () {
};
a.Kk = !1;
a.Je = !1
}
}
function Fi(a, b, c, d, e, g, h, k, l, m) {
null === a.Ab && t.m("No div specified");
null === a.Pa && t.m("No canvas specified");
$h(a);
ci(a);
var n = void 0;
g && d && e && (n = new D(g.x, g.y, d.width / e, d.height / e));
var p = n.copy();
p.Cv(c);
vi(a, p);
ei(a);
var p = a.Bb.p, q = p.length;
a.Pf(p, q, a, n);
b.setTransform(1, 0, 0, 1, 0, 0);
b.clearRect(0, 0, d.width, d.height);
k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height));
d = t.ah();
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);
t.Te(d);
Di(a, b);
if (h) {
var r = new ta;
c = h.l;
for (c.reset(); c.next();)e = c.value.U, !1 === m && "Grid" === e.layer.name || null === e || r.add(e);
c = function (c) {
var d = l;
if (c.visible && (void 0 === d && (d = !0), d || !c.pc)) {
b.globalAlpha = c.Ef;
d = c.cb;
c = c.Xu;
c.length = 0;
for (var e = a.scale, g = d.length, h = 0; h < g; h++) {
var k = d.p[h];
if (Gh(k) && r.contains(k)) {
if (k instanceof A && (k.ac && c.push(k), !1 === k.Rg))continue;
var m = k.ya;
1 < m.width * e || 1 < m.height * e ? k.Se(b, a) : Ih(k, b)
}
}
b.globalAlpha = 1
}
}
} else if (!l && m) {
var s = a.Yo.U, v = s.layer;
c = function (c) {
c === v ? s.Se(b, a) : c.Se(b, a, n, l, m)
}
} else c = function (c) {
c.Se(b, a, n, l, m)
};
for (e = 0; e < q; e++)c(p[e]);
a.Hk ? a.Hk.Cl(a) && a.yx() : a.Hg = function () {
};
$h(a);
ci(a);
a.Pf(p, q, a);
vi(a)
}
function Di(a, b) {
var c = a.hF;
if (null !== c) {
if (void 0 !== c.imageSmoothingEnabled) {
var d = !!c.imageSmoothingEnabled;
b.qE = d;
b.iG = d;
b.DJ = d
}
c = c.defaultFont;
void 0 !== c && null !== c && (b.font = c, b.It = c)
}
}
function yi(a) {
if (0 < a.Dn.count) {
for (var b = a.Dn.l; b.next();)Ig(b.key, b.value);
a.Dn.clear()
}
}
u.prototype.ua = function (a, b) {
if (this.Ty && void 0 !== a && null !== this.hj) {
var c = this.nb;
if (a && c.Jf(a) || b && c.Jf(b))null !== this.hj && (a && a.Q() && Gi(this, a.x - 2, a.y - 2, a.width + 4, a.height + 4), b && b.Q() && Gi(this, b.x - 2, b.y - 2, b.width + 4, b.height + 4)), this.Je = !0, this.Of()
} else this.hj = null, this.Je = !0, this.Of();
for (c = this.fo.l; c.next();)c.value.ua(a, b)
};
t.g(u, "viewportOptimizations", u.prototype.nJ);
t.defineProperty(u, {nJ: null}, function () {
return this.rz
}, function (a) {
t.j(a, "boolean", u, "viewportOptimizations");
this.hj = null;
this.rz = a
});
function Gi(a, b, c, d, e) {
b = Math.floor(b);
c = Math.floor(c);
d = Math.ceil(d);
e = Math.ceil(e);
for (var g = a.hj, h = g.length, k = 0; k < h; k++) {
var l = g[k];
if (b >= l[0] && c >= l[1] && b + d <= l[0] + l[2] && c + e <= l[1] + l[3])return!1;
b <= l[0] && c <= l[1] && b + d >= l[0] + l[2] && c + e >= l[1] + l[3] ? (g[k][2] = 0, g[k][3] = 0) : b >= l[0] && b < l[0] + l[2] && c >= l[1] && c + e <= l[1] + l[3] ? (d = b + d - (l[0] + l[2]), b = l[0] + l[2], k = -1) : b + d > l[0] && b + d <= l[0] + l[2] && c >= l[1] && c + e <= l[1] + l[3] ? (d = l[0] - b, k = -1) : b >= l[0] && b + d <= l[0] + l[2] && c >= l[1] && c < l[1] + l[3] ? (e = c + e - (l[1] + l[3]), c = l[1] + l[3], k = -1) : b >=
l[0] && b + d <= l[0] + l[2] && c + e > l[1] && c + e <= l[1] + l[3] ? (e = l[1] - c, k = -1) : g[k][0] >= b && g[k][0] < b + d && g[k][1] >= c && g[k][1] + g[k][3] <= c + e ? (g[k][2] -= b + d - g[k][0], g[k][0] = b + d, k = -1) : g[k][0] + g[k][2] > b && g[k][0] + g[k][2] <= b + d && g[k][1] >= c && g[k][1] + g[k][3] <= c + e ? (g[k][2] = b - g[k][0], k = -1) : g[k][0] >= b && g[k][0] + g[k][2] <= b + d && g[k][1] >= c && g[k][1] < c + e ? (g[k][3] -= c + e - g[k][1], g[k][1] = c + e, k = -1) : g[k][0] >= b && g[k][0] + g[k][2] <= b + d && g[k][1] + g[k][3] > c && g[k][1] + g[k][3] <= c + e && (g[k][3] = c - g[k][1], k = -1)
}
for (k = 0; k < h; k++)if (l = g[k], 0 < d && 0 < e && 0 < l[2] &&
0 < l[3] && (Math.max(b + d, l[0] + l[2]) - Math.min(b, l[0])) * (Math.max(c + e, l[1] + l[3]) - Math.min(c, l[1])) < d * e + l[2] * l[3] + 50) {
var h = Math.min(l[0], b), m = Math.min(l[1], c);
b = Math.max(b + d, l[0] + l[2]) - Math.min(l[0], b);
c = Math.max(c + e, l[1] + l[3]) - Math.min(l[1], c);
g[k][2] = 0;
g[k][3] = 0;
return Gi(a, h, m, b, c)
}
g.push([b, c, d, e]);
return!0
}
function Hi(a, b, c) {
if (!0 !== a.Je) {
a.Je = !0;
if (a instanceof Ii)Ji(a); else if (!0 === a.rz && c.width === b.width && c.height === b.height) {
var d = a.scale, e = t.xf(), g = Math.max(b.x, c.x), h = Math.max(b.y, c.y), k = Math.min(b.x + b.width, c.x + c.width), l = Math.min(b.y + b.height, c.y + c.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 (!a.Jd && (a.ig = !1, null !== a.Ab && (a.Jd = !0, yi(a), ei(a), a.vc.Q() || ji(a, a.kf()), k = a.Pa, null !== k))) {
g = a.tc;
h = a.sc;
l = a.scale;
d = Math.round(Math.round(c.x * l) -
Math.round(b.x * l));
b = Math.round(Math.round(c.y * l) - Math.round(b.y * l));
c = a.Xx;
l = a.XB;
c.width = g;
c.height = h;
var m = Math.max(d, 0);
c = Math.max(b, 0);
var n = g - m, p = h - c;
l.iG = !1;
l.qE = !1;
l.drawImage(k, m, c, n, p, 0, 0, n, p);
a.Hk.Cl(a) && l.clearRect(0, 0, 190, 70);
var k = t.Db(), l = t.Db(), p = Math.abs(d), n = Math.abs(b), q = 0 === m ? 0 : g - p, m = t.ic(q, 0), p = t.ic(p + q, h);
l.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
var r = a.ad;
r.reset();
1 !== a.Sb && r.scale(a.Sb);
q = a.rb;
(0 !== q.x || 0 !== q.y) && isFinite(q.x) && isFinite(q.y) &&
r.translate(-q.x, -q.y);
Xa(m, r);
Xa(p, r);
k.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
q = 0 === c ? 0 : h - n;
m.q(0, q);
p.q(g, n + q);
l.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
Xa(m, r);
Xa(p, r);
k.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]);
a.Hk.Cl(a) && (g = 0 < d ? 0 : -d, h = 0 < b ? 0 : -b, m.q(g, h), p.q(190 + g, 70 + h), l.push([Math.min(m.x, p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]), Xa(m, r), Xa(p, r), k.push([Math.min(m.x,
p.x), Math.min(m.y, p.y), Math.abs(m.x - p.x), Math.abs(m.y - p.y)]));
t.B(m);
t.B(p);
!a.lc && a.qj && (di(a) || di(a));
Ei(a, k, l, d, b);
t.Da(k);
t.Da(l);
a.Jd = !1
}
} else a.Of();
t.Qc(e)
} else a.Vi();
for (a = a.fo.l; a.next();)Hi(a.value)
}
}
function ti(a) {
!1 === a.qj && (a.qj = !0)
}
function ci(a) {
!1 === a.Kk && (a.Kk = !0)
}
function di(a) {
var b = a.Pa;
if (null !== b) {
var c = a.Ab, d = a.tc, e = a.sc, g = a.XC.copy(), h = !1, k = a.Ol ? a.gf : 0, l = a.Nl ? a.gf : 0, m = c.clientWidth || d + k, c = c.clientHeight || e + l;
if (m !== d + k || c !== e + l)a.Ol = !1, a.Nl = !1, a.tc = m, a.sc = c, b.width = m, b.height = c, h = !0;
a.qj = !1;
if (a.ev)d === a.tc && e === a.sc || a.Vi(); else {
var n = a.nb, p = a.vc, k = p.width, l = p.height, q = n.width, r = n.height, s = p.x, v = n.x, x = p.right, E = n.right, F = p.y, G = n.y, L = p.bottom, N = n.bottom, p = n = "1px", V = a.scale;
m / V > k && c / V > l || (a.nE && a.hf && (q + 1 < k ? (n = (k - q) * V + a.tc + "px", a.Gj.scrollLeft = (a.position.x -
s) * V) : s + 1 < v ? (n = (v - s) * V + a.tc + "px", a.Gj.scrollLeft = a.Gj.scrollWidth - a.Gj.clientWidth) : x > E + 1 && (n = (x - E) * V + a.tc + "px", a.Gj.scrollLeft = a.position.x * V)), a.oE && a.jf && (r + 1 < l ? (p = (l - r) * V + a.sc + "px", a.Hj.scrollTop = (a.position.y - F) * V) : F + 1 < G ? (p = (G - F) * V + a.sc + "px", a.Hj.scrollTop = a.Hj.scrollHeight - a.Hj.clientHeight) : L > N + 1 && (p = (L - N) * V + a.sc + "px", a.Hj.scrollTop = a.position.y * V)));
m = "1px" !== n;
c = "1px" !== p;
m !== a.Nl && (a.sc = "1px" === n ? a.sc + a.gf : Math.max(a.sc - a.gf, 1), b.height = a.sc, h = !0);
a.Nl = m;
a.Vy.style.width = n;
c !== a.Ol && (a.tc =
"1px" === p ? a.tc + a.gf : Math.max(a.tc - a.gf, 1), b.width = a.tc, h = !0);
a.Ol = c;
a.Wy.style.height = p;
h && $h(a);
m = a.tc;
c = a.sc;
a.Hj.style.height = c + "px";
a.Hj.style.width = m + (a.Ol ? a.gf : 0) + "px";
a.Gj.style.width = m + "px";
a.Gj.style.height = c + (a.Nl ? a.gf : 0) + "px";
a.Uy = !1;
return d !== m || e !== c ? (n = a.nb, a.kt(g, n, h ? !0 : void 0), !1) : !0
}
}
}
function Ki(a, b) {
for (var c = a.Bb, d = c.count, e = 0; e < d; e++)c.pa(e).name === b && t.m("Cannot add layer with the name '" + b + "', a layer of the same name is already present in this diagram.")
}
u.prototype.add = u.prototype.add = function (a) {
t.k(a, w, u, "add:part");
var b = a.h;
if (b !== this) {
null !== b && t.m("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString());
var c = a.Ad, b = this.il(c);
null === b && (b = this.il(""));
null === b && t.m('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer');
a.layer !== b && (c = a.h === this ? b.Pm(99999999, a, !0) : b.Pm(99999999, a), 0 <= c && this.fd(Cd, "parts", b, null, a, null, c), b.pc || this.Ac(), a.K(Li), c = a.fp, null !== c &&
c(a, null, b))
}
};
u.prototype.Pm = function (a) {
if (a instanceof y) {
if (this.Tu.add(a), a instanceof z) {
var b = a.fb;
null === b ? this.Uk.add(a) : b.bm.add(a);
b = a.Tb;
null !== b && (b.h = this)
}
} else a instanceof A ? this.Cu.add(a) : a instanceof Ue || this.cb.add(a);
a.wb && a.aa();
if (b = a.data) {
a instanceof Ue || (a instanceof A ? this.Ck.add(b, a) : this.bi.add(b, a));
var c = this;
Mi(a, function (a) {
Ni(c, a)
})
}
!0 !== Bi(a) && !0 !== Ci(a) || this.Zf.add(a);
Oi(a, !0, this);
a.zb() && (a.ya.Q() && this.ua(Kh(a, a.ya)), this.Ac())
};
u.prototype.Ue = function (a) {
a.ze();
if (a instanceof y) {
if (this.Tu.remove(a), a instanceof z) {
var b = a.fb;
null === b ? this.Uk.remove(a) : b.bm.remove(a);
b = a.Tb;
null !== b && (b.h = null)
}
} else a instanceof A ? this.Cu.remove(a) : a instanceof Ue || this.cb.remove(a);
if (b = a.data) {
a instanceof Ue || (a instanceof A ? this.Ck.remove(b) : this.bi.remove(b));
var c = this;
Mi(a, function (a) {
Pi(c, a)
})
}
this.Zf.remove(a);
a.zb() && (a.ya.Q() && this.ua(Kh(a, a.ya)), this.Ac())
};
u.prototype.remove = u.prototype.remove = function (a) {
t.k(a, w, u, "remove:part");
a.bb = !1;
var b = a.layer;
if (null !== b && b.h === this) {
a.K(Qi);
a.Im();
var c = b.Ue(-1, a);
0 <= c && this.fd(Dd, "parts", b, a, null, c, null);
c = a.fp;
null !== c && c(a, b, null);
b.pc || this.Ac()
}
};
u.prototype.removeParts = u.prototype.PA = function (a, b) {
if (a === this.selection) {
var c = new ta;
c.Me(a);
a = c
}
for (c = a.l; c.next();) {
var d = c.value;
d.h === this && (b && !d.canDelete() || this.remove(d))
}
};
u.prototype.copyParts = u.prototype.copyParts = function (a, b, c) {
return this.Qe.copyParts(a, b, c)
};
u.prototype.moveParts = u.prototype.moveParts = function (a, b, c) {
t.k(b, C, u, "moveParts:offset");
var d = this.Eb;
if (null !== d) {
d = d.ke;
null === d && (d = new ef, d.h = this);
var e = new ra(w, Object);
if (a)a = a.l; else {
for (a = this.rl; a.next();)uf(d, e, a.value, c);
for (a = this.Xi; a.next();)uf(d, e, a.value, c);
a = this.links
}
for (; a.next();)uf(d, e, a.value, c);
d.moveParts(e, b, c)
}
};
u.prototype.addLayer = u.prototype.rs = function (a) {
t.k(a, je, u, "addLayer:layer");
Ki(this, a.name);
a.He(this);
var b = this.Bb, c = b.count - 1;
if (!a.pc)for (; 0 <= c && b.pa(c).pc;)c--;
b.Rd(c + 1, a);
null !== this.de && this.fd(Cd, "layers", this, null, a, null, c + 1);
this.Ac()
};
u.prototype.addLayerBefore = u.prototype.PG = function (a, b) {
t.k(a, je, u, "addLayer:layer");
t.k(b, je, u, "addLayerBefore:existingLayer");
Ki(this, a.name);
a.He(this);
for (var c = !1, d = this.Bb.count, e = 0; e < d; e++)if (this.Bb.pa(e) === b) {
this.Bb.Rd(e, a);
c = !0;
break
}
c || t.m("addLayerBefore: Existing layer " + b.toString() + " not found.");
null !== this.de && this.fd(Cd, "layers", this, null, a, null, e);
this.Ac()
};
u.prototype.addLayerAfter = function (a, b) {
t.k(a, je, u, "addLayer:layer");
t.k(b, je, u, "addLayerAfter:existingLayer");
Ki(this, a.name);
a.He(this);
for (var c = !1, d = this.Bb.count, e = 0; e < d; e++)if (this.Bb.pa(e) === b) {
this.Bb.Rd(e + 1, a);
c = !0;
break
}
c || t.m("addLayerAfter: Existing layer " + b.toString() + " not found.");
null !== this.de && this.fd(Cd, "layers", this, null, a, null, e + 1);
this.Ac()
};
function Ri(a, b, c) {
t.k(b, je, u, "addLayer:layer");
Ki(a, b.name);
b.He(a);
a.Bb.Rd(c, b);
null !== a.de && a.fd(Cd, "layers", a, null, b, null, c);
a.Ac()
}
u.prototype.removeLayer = u.prototype.fF = function (a) {
if ("" !== a.name) {
var b = this.Bb.indexOf(a);
if (this.Bb.remove(a)) {
for (var c = a.cb.copy().l; c.next();) {
var d = c.value, e = d.Ad;
d.Ad = "";
e !== a.name && (d.Ad = e)
}
null !== this.de && this.fd(Dd, "layers", this, a, null, b, null);
this.Ac()
}
}
};
u.prototype.findLayer = u.prototype.il = function (a) {
for (var b = this.Tm; b.next();) {
var c = b.value;
if (c.name === a)return c
}
return null
};
u.prototype.addChangedListener = u.prototype.xz = function (a) {
t.j(a, "function", u, "addChangedListener:listener");
null === this.ej && (this.ej = new H("function"));
this.ej.add(a)
};
u.prototype.removeChangedListener = u.prototype.NA = function (a) {
t.j(a, "function", u, "removeChangedListener:listener");
null !== this.ej && (this.ej.remove(a), 0 === this.ej.count && (this.ej = null))
};
u.prototype.Lv = function (a) {
this.Cb || this.Aa.lE(a);
a.nd !== Ad && (this.gk = !0);
if (null !== this.ej) {
var b = this.ej, c = b.length;
if (1 === c)b = b.pa(0), b(a); else if (0 !== c)for (var d = b.af(), e = 0; e < c; e++)b = d[e], b(a)
}
};
u.prototype.raiseChangedEvent = u.prototype.fd = function (a, b, c, d, e, g, h) {
void 0 === g && (g = null);
void 0 === h && (h = null);
var k = new zd;
k.h = this;
k.nd = a;
k.propertyName = b;
k.object = c;
k.oldValue = d;
k.Nf = g;
k.newValue = e;
k.Lf = h;
this.Lv(k)
};
u.prototype.raiseChanged = u.prototype.i = function (a, b, c, d, e) {
this.fd(Bd, a, this, b, c, d, e)
};
t.A(u, {Aa: "undoManager"}, function () {
return this.de.Aa
});
t.g(u, "skipsUndoManager", u.prototype.Cb);
t.defineProperty(u, {Cb: "skipsUndoManager"}, function () {
return this.ui
}, function (a) {
t.j(a, "boolean", u, "skipsUndoManager");
this.ui = a;
this.de.ui = a
});
u.prototype.changeState = function (a, b) {
if (null !== a && a.h === this) {
var c = a.nd;
if (c === Bd) {
var c = a.object, d = a.propertyName, e = a.Ba(b);
t.Ua(c, d, e);
c instanceof X && (c = c.U, null !== c && c.ze())
} else if (c === Cd)if (e = a.object, d = a.Lf, c = a.newValue, e instanceof B) {
if ("number" === typeof d && c instanceof X) {
var g = e;
b ? g.Ue(d) : g.Rd(d, c);
c = e.U;
null !== c && c.ze()
}
} else e instanceof je ? (g = !0 === a.Nf, "number" === typeof d && c instanceof w && (b ? (c.ze(), g ? e.Ue(d, c, g) : this.remove(c)) : e.Pm(d, c, g))) : e instanceof u ? "number" === typeof d && c instanceof
je && (b ? this.fF(c) : Ri(this, c, d)) : t.m("unknown ChangedEvent.Insert object: " + a.toString()); else c === Dd ? (e = a.object, d = a.Nf, c = a.oldValue, e instanceof B ? "number" === typeof d && c instanceof X && (g = e, b ? g.Rd(d, c) : g.Ue(d)) : e instanceof je ? (g = !0 === a.Lf, "number" === typeof d && c instanceof w && (b ? e.Pm(d, c, g) : (c.ze(), g ? e.Ue(d, c, g) : this.remove(c)))) : e instanceof u ? "number" === typeof d && c instanceof je && (b ? Ri(this, c, d) : this.fF(c)) : t.m("unknown ChangedEvent.Remove object: " + a.toString())) : c !== Ad && t.m("unknown ChangedEvent: " +
a.toString())
}
};
u.prototype.startTransaction = u.prototype.rc = function (a) {
return this.Aa.rc(a)
};
u.prototype.commitTransaction = u.prototype.Ce = function (a) {
return this.Aa.Ce(a)
};
u.prototype.rollbackTransaction = u.prototype.qt = function () {
return this.Aa.qt()
};
u.prototype.updateAllTargetBindings = function () {
for (var a = this.rl; a.next();)a.value.Kb();
for (a = this.Xi; a.next();)a.value.Kb();
for (a = this.links; a.next();)a.value.Kb()
};
u.prototype.kt = function (a, b, c) {
ti(this);
ci(this);
var d = this.Tb;
null !== d && d.Ws && !c && (a.width !== b.width || a.height !== b.height || isNaN(a.x) && !isNaN(b.x) || isNaN(a.y && !isNaN(b.y))) && d.K();
this.lc || gi(this);
vi(this);
d = this.Ta;
!0 === this.Pn && d instanceof Ge && (this.T.W = this.VF(this.T.Bc), d.doMouseMove());
Hi(this, a, b);
this.Ja("ViewportBoundsChanged", c ? {} : null, a)
};
function vi(a, b) {
var c = a.Xc;
if (null !== c && c.visible) {
for (var d = t.xl(), e = 1, g = 1, h = c.za.length, k = 0; k < h; k++) {
var l = c.za.p[k], m = l.interval;
2 > m || ("LineV" === l.Jb ? g = g * m / J.eE(g, m) : e = e * m / J.eE(e, m))
}
h = c.Ms;
d.q(g * h.width, e * h.height);
if (b)k = b.width, l = b.height, g = b.x, h = b.y; else {
e = t.xf();
g = a.nb;
e.q(g.x, g.y, g.width, g.height);
for (h = a.fo.l; h.next();)g = h.value.nb, xb(e, g.x, g.y, g.width, g.height);
k = e.width;
l = e.height;
g = e.x;
h = e.y;
if (!e.Q())return
}
c.width = k + 2 * d.width;
c.height = l + 2 * d.height;
e = t.O();
J.Gs(g, h, 0, 0, d.width, d.height,
e);
e.offset(-d.width, -d.height);
t.ck(d);
c.U.location = e;
t.B(e)
}
}
u.prototype.clearSelection = u.prototype.Iz = function () {
var a = 0 < this.selection.count;
a && this.Ja("ChangingSelection");
Xe(this);
a && this.Ja("ChangedSelection")
};
function Xe(a) {
a = a.selection;
if (0 < a.count) {
for (var b = a.af(), c = b.length, d = 0; d < c; d++)b[d].bb = !1;
a.Va();
a.clear();
a.freeze()
}
}
u.prototype.select = u.prototype.select = function (a) {
null !== a && a.layer.h === this && (!a.bb || 1 < this.selection.count) && (this.Ja("ChangingSelection"), Xe(this), a.bb = !0, this.Ja("ChangedSelection"))
};
u.prototype.selectCollection = u.prototype.uF = function (a) {
this.Ja("ChangingSelection");
Xe(this);
for (a = a.l; a.next();)a.value.bb = !0;
this.Ja("ChangedSelection")
};
u.prototype.scroll = function (a, b, c) {
void 0 === c && (c = 1);
var d = "up" === b || "down" === b, e;
"pixel" === a ? e = c : "line" === a ? e = c * (d ? this.Ep : this.Dp) : "page" === a ? (a = d ? this.nb.height : this.nb.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.Ep : this.Dp), 0), e *= c)) : t.m("scrolling unit must be 'pixel', 'line', or 'page', 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 : t.m("scrolling direction must be 'up', 'down', 'left', or 'right', not: " +
b);
this.position = c
};
u.prototype.scrollToRect = function (a) {
var b = this.nb;
b.Vj(a) || (a = a.Gz, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a)
};
u.prototype.centerRect = function (a) {
var b = this.nb;
a = a.Gz;
a.x -= b.width / 2;
a.y -= b.height / 2;
this.position = a
};
u.prototype.transformDocToView = u.prototype.gn = function (a) {
var b = this.ad;
b.reset();
1 !== this.Sb && b.scale(this.Sb);
var c = this.rb;
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
return a.copy().transform(this.ad)
};
function da(a, b) {
var c = a.ad, d = b[0], e = b[1], g = d + b[2], h = e + b[3], k = c.m11, l = c.m12, m = c.m21, n = c.m22, p = c.dx, q = c.dy, r = d * k + e * m + p, s = d * l + e * n + q, c = g * k + e * m + p, e = g * l + e * n + q, v = d * k + h * m + p, d = d * l + h * n + q, k = g * k + h * m + p, g = g * l + h * n + q, h = r, l = s, r = Math.min(r, c), h = Math.max(h, c), l = Math.min(l, e), s = Math.max(s, e), r = Math.min(r, v), h = Math.max(h, v), l = Math.min(l, d), s = Math.max(s, d), r = Math.min(r, k), h = Math.max(h, k), l = Math.min(l, g), s = Math.max(s, g);
return[r, l, h - r, s - l]
}
u.prototype.transformViewToDoc = u.prototype.VF = function (a) {
var b = this.ad;
b.reset();
1 !== this.Sb && b.scale(this.Sb);
var c = this.rb;
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
return Xa(a.copy(), this.ad)
};
var Ye;
u.None = Ye = t.w(u, "None", 0);
var qi;
u.Uniform = qi = t.w(u, "Uniform", 1);
var ri;
u.UniformToFill = ri = t.w(u, "UniformToFill", 2);
var pg;
u.CycleAll = pg = t.w(u, "CycleAll", 10);
var tg;
u.CycleNotDirected = tg = t.w(u, "CycleNotDirected", 11);
var vg;
u.CycleNotDirectedFast = vg = t.w(u, "CycleNotDirectedFast", 12);
var wg;
u.CycleNotUndirected = wg = t.w(u, "CycleNotUndirected", 13);
var qg;
u.CycleDestinationTree = qg = t.w(u, "CycleDestinationTree", 14);
var sg;
u.CycleSourceTree = sg = t.w(u, "CycleSourceTree", 15);
t.g(u, "validCycle", u.prototype.bG);
t.defineProperty(u, {bG: "validCycle"}, function () {
return this.xv
}, function (a) {
var b = this.xv;
b !== a && (t.tb(a, u, u, "validCycle"), this.xv = a, this.i("validCycle", b, a))
});
t.g(u, "linkSpacing", u.prototype.lp);
t.defineProperty(u, {lp: "linkSpacing"}, function () {
return this.tj
}, function (a) {
var b = this.tj;
b !== a && (t.o(a, u, "linkSpacing"), 0 > a && t.ha(a, ">= zero", u, "linkSpacing"), this.tj = a, this.i("linkSpacing", b, a))
});
t.A(u, {Tm: "layers"}, function () {
return this.Bb.l
});
t.g(u, "isModelReadOnly", u.prototype.Ve);
t.defineProperty(u, {Ve: "isModelReadOnly"}, function () {
var a = this.de;
return null === a ? !1 : a.Ya
}, function (a) {
var b = this.de;
null !== b && (b.Ya = a)
});
t.g(u, "isReadOnly", u.prototype.Ya);
t.defineProperty(u, {Ya: "isReadOnly"}, function () {
return this.Lk
}, function (a) {
var b = this.Lk;
b !== a && (t.j(a, "boolean", u, "isReadOnly"), this.Lk = a, this.i("isReadOnly", b, a))
});
t.g(u, "isEnabled", u.prototype.isEnabled);
t.defineProperty(u, {isEnabled: "isEnabled"}, function () {
return this.gi
}, function (a) {
var b = this.gi;
b !== a && (t.j(a, "boolean", u, "isEnabled"), this.gi = a, this.i("isEnabled", b, a))
});
t.g(u, "allowClipboard", u.prototype.Fv);
t.defineProperty(u, {Fv: "allowClipboard"}, function () {
return this.Jt
}, function (a) {
var b = this.Jt;
b !== a && (t.j(a, "boolean", u, "allowClipboard"), this.Jt = a, this.i("allowClipboard", b, a))
});
t.g(u, "allowCopy", u.prototype.Rj);
t.defineProperty(u, {Rj: "allowCopy"}, function () {
return this.ok
}, function (a) {
var b = this.ok;
b !== a && (t.j(a, "boolean", u, "allowCopy"), this.ok = a, this.i("allowCopy", b, a))
});
t.g(u, "allowDelete", u.prototype.Zk);
t.defineProperty(u, {Zk: "allowDelete"}, function () {
return this.pk
}, function (a) {
var b = this.pk;
b !== a && (t.j(a, "boolean", u, "allowDelete"), this.pk = a, this.i("allowDelete", b, a))
});
t.g(u, "allowDragOut", u.prototype.Gv);
t.defineProperty(u, {Gv: "allowDragOut"}, function () {
return this.Kt
}, function (a) {
var b = this.Kt;
b !== a && (t.j(a, "boolean", u, "allowDragOut"), this.Kt = a, this.i("allowDragOut", b, a))
});
t.g(u, "allowDrop", u.prototype.zz);
t.defineProperty(u, {zz: "allowDrop"}, function () {
return this.Lt
}, function (a) {
var b = this.Lt;
b !== a && (t.j(a, "boolean", u, "allowDrop"), this.Lt = a, this.i("allowDrop", b, a))
});
t.g(u, "allowTextEdit", u.prototype.Bo);
t.defineProperty(u, {Bo: "allowTextEdit"}, function () {
return this.yk
}, function (a) {
var b = this.yk;
b !== a && (t.j(a, "boolean", u, "allowTextEdit"), this.yk = a, this.i("allowTextEdit", b, a))
});
t.g(u, "allowGroup", u.prototype.xo);
t.defineProperty(u, {xo: "allowGroup"}, function () {
return this.qk
}, function (a) {
var b = this.qk;
b !== a && (t.j(a, "boolean", u, "allowGroup"), this.qk = a, this.i("allowGroup", b, a))
});
t.g(u, "allowUngroup", u.prototype.Co);
t.defineProperty(u, {Co: "allowUngroup"}, function () {
return this.zk
}, function (a) {
var b = this.zk;
b !== a && (t.j(a, "boolean", u, "allowUngroup"), this.zk = a, this.i("allowUngroup", b, a))
});
t.g(u, "allowInsert", u.prototype.vm);
t.defineProperty(u, {vm: "allowInsert"}, function () {
return this.Nt
}, function (a) {
var b = this.Nt;
b !== a && (t.j(a, "boolean", u, "allowInsert"), this.Nt = a, this.i("allowInsert", b, a))
});
t.g(u, "allowLink", u.prototype.wm);
t.defineProperty(u, {wm: "allowLink"}, function () {
return this.rk
}, function (a) {
var b = this.rk;
b !== a && (t.j(a, "boolean", u, "allowLink"), this.rk = a, this.i("allowLink", b, a))
});
t.g(u, "allowRelink", u.prototype.Sj);
t.defineProperty(u, {Sj: "allowRelink"}, function () {
return this.tk
}, function (a) {
var b = this.tk;
b !== a && (t.j(a, "boolean", u, "allowRelink"), this.tk = a, this.i("allowRelink", b, a))
});
t.g(u, "allowMove", u.prototype.$k);
t.defineProperty(u, {$k: "allowMove"}, function () {
return this.sk
}, function (a) {
var b = this.sk;
b !== a && (t.j(a, "boolean", u, "allowMove"), this.sk = a, this.i("allowMove", b, a))
});
t.g(u, "allowReshape", u.prototype.yo);
t.defineProperty(u, {yo: "allowReshape"}, function () {
return this.uk
}, function (a) {
var b = this.uk;
b !== a && (t.j(a, "boolean", u, "allowReshape"), this.uk = a, this.i("allowReshape", b, a))
});
t.g(u, "allowResize", u.prototype.zo);
t.defineProperty(u, {zo: "allowResize"}, function () {
return this.vk
}, function (a) {
var b = this.vk;
b !== a && (t.j(a, "boolean", u, "allowResize"), this.vk = a, this.i("allowResize", b, a))
});
t.g(u, "allowRotate", u.prototype.Ao);
t.defineProperty(u, {Ao: "allowRotate"}, function () {
return this.wk
}, function (a) {
var b = this.wk;
b !== a && (t.j(a, "boolean", u, "allowRotate"), this.wk = a, this.i("allowRotate", b, a))
});
t.g(u, "allowSelect", u.prototype.Ne);
t.defineProperty(u, {Ne: "allowSelect"}, function () {
return this.xk
}, function (a) {
var b = this.xk;
b !== a && (t.j(a, "boolean", u, "allowSelect"), this.xk = a, this.i("allowSelect", b, a))
});
t.g(u, "allowUndo", u.prototype.Az);
t.defineProperty(u, {Az: "allowUndo"}, function () {
return this.Ot
}, function (a) {
var b = this.Ot;
b !== a && (t.j(a, "boolean", u, "allowUndo"), this.Ot = a, this.i("allowUndo", b, a))
});
t.g(u, "allowZoom", u.prototype.Do);
t.defineProperty(u, {Do: "allowZoom"}, function () {
return this.Qt
}, function (a) {
var b = this.Qt;
b !== a && (t.j(a, "boolean", u, "allowZoom"), this.Qt = a, this.i("allowZoom", b, a))
});
t.g(u, "hasVerticalScrollbar", u.prototype.oE);
t.defineProperty(u, {oE: "hasVerticalScrollbar"}, function () {
return this.su
}, function (a) {
var b = this.su;
b !== a && (t.j(a, "boolean", u, "hasVerticalScrollbar"), this.su = a, ti(this), this.ua(), this.i("hasVerticalScrollbar", b, a), gi(this))
});
t.g(u, "hasHorizontalScrollbar", u.prototype.nE);
t.defineProperty(u, {nE: "hasHorizontalScrollbar"}, function () {
return this.ru
}, function (a) {
var b = this.ru;
b !== a && (t.j(a, "boolean", u, "hasHorizontalScrollbar"), this.ru = a, ti(this), this.ua(), this.i("hasHorizontalScrollbar", b, a), gi(this))
});
t.g(u, "allowHorizontalScroll", u.prototype.hf);
t.defineProperty(u, {hf: "allowHorizontalScroll"}, function () {
return this.Mt
}, function (a) {
var b = this.Mt;
b !== a && (t.j(a, "boolean", u, "allowHorizontalScroll"), this.Mt = a, this.i("allowHorizontalScroll", b, a), gi(this))
});
t.g(u, "allowVerticalScroll", u.prototype.jf);
t.defineProperty(u, {jf: "allowVerticalScroll"}, function () {
return this.Pt
}, function (a) {
var b = this.Pt;
b !== a && (t.j(a, "boolean", u, "allowVerticalScroll"), this.Pt = a, this.i("allowVerticalScroll", b, a), gi(this))
});
t.g(u, "scrollHorizontalLineChange", u.prototype.Dp);
t.defineProperty(u, {Dp: "scrollHorizontalLineChange"}, function () {
return this.fv
}, function (a) {
var b = this.fv;
b !== a && (t.j(a, "number", u, "scrollHorizontalLineChange"), 0 > a && t.ha(a, ">= 0", u, "scrollHorizontalLineChange"), this.fv = a, this.i("scrollHorizontalLineChange", b, a))
});
t.g(u, "scrollVerticalLineChange", u.prototype.Ep);
t.defineProperty(u, {Ep: "scrollVerticalLineChange"}, function () {
return this.gv
}, function (a) {
var b = this.gv;
b !== a && (t.j(a, "number", u, "scrollVerticalLineChange"), 0 > a && t.ha(a, ">= 0", u, "scrollVerticalLineChange"), this.gv = a, this.i("scrollVerticalLineChange", b, a))
});
t.g(u, "lastInput", u.prototype.T);
t.defineProperty(u, {T: "lastInput"}, function () {
return this.cc
}, function (a) {
f && t.k(a, td, u, "lastInput");
this.cc = a
});
t.g(u, "firstInput", u.prototype.Fc);
t.defineProperty(u, {Fc: "firstInput"}, function () {
return this.Gg
}, function (a) {
f && t.k(a, td, u, "firstInput");
this.Gg = a
});
t.g(u, "currentCursor", u.prototype.bd);
t.defineProperty(u, {bd: "currentCursor"}, function () {
return this.du
}, function (a) {
t.j(a, "string", u, "currentCursor");
null === this.Pa || this.du === a || "" === a && this.du === this.uq || (this.du = a, "" !== a ? (this.Pa.style.cursor = a, this.Ab.style.cursor = a) : (this.Pa.style.cursor = this.Oz, this.Ab.style.cursor = this.Oz))
});
t.g(u, "defaultCursor", u.prototype.Oz);
t.defineProperty(u, {Oz: "defaultCursor"}, function () {
return this.uq
}, function (a) {
t.j(a, "string", u, "defaultCursor");
var b = this.uq;
b !== a && (this.uq = a, this.i("defaultCursor", b, a))
});
t.g(u, "hasGestureZoom", u.prototype.fI);
t.defineProperty(u, {fI: "hasGestureZoom"}, function () {
return this.fi
}, function (a) {
var b = this.fi;
b !== a && (t.j(a, "boolean", u, "hasGestureZoom"), this.fi = a, this.i("hasGestureZoom", b, a))
});
t.g(u, "click", u.prototype.click);
t.defineProperty(u, {click: "click"}, function () {
return this.Yh
}, function (a) {
var b = this.Yh;
b !== a && (null !== a && t.j(a, "function", u, "click"), this.Yh = a, this.i("click", b, a))
});
t.g(u, "doubleClick", u.prototype.Jm);
t.defineProperty(u, {Jm: "doubleClick"}, function () {
return this.di
}, function (a) {
var b = this.di;
b !== a && (null !== a && t.j(a, "function", u, "doubleClick"), this.di = a, this.i("doubleClick", b, a))
});
t.g(u, "contextClick", u.prototype.Bs);
t.defineProperty(u, {Bs: "contextClick"}, function () {
return this.$h
}, function (a) {
var b = this.$h;
b !== a && (null !== a && t.j(a, "function", u, "contextClick"), this.$h = a, this.i("contextClick", b, a))
});
t.g(u, "mouseOver", u.prototype.et);
t.defineProperty(u, {et: "mouseOver"}, function () {
return this.ni
}, function (a) {
var b = this.ni;
b !== a && (null !== a && t.j(a, "function", u, "mouseOver"), this.ni = a, this.i("mouseOver", b, a))
});
t.g(u, "mouseHover", u.prototype.dt);
t.defineProperty(u, {dt: "mouseHover"}, function () {
return this.mi
}, function (a) {
var b = this.mi;
b !== a && (null !== a && t.j(a, "function", u, "mouseHover"), this.mi = a, this.i("mouseHover", b, a))
});
t.g(u, "mouseHold", u.prototype.ct);
t.defineProperty(u, {ct: "mouseHold"}, function () {
return this.li
}, function (a) {
var b = this.li;
b !== a && (null !== a && t.j(a, "function", u, "mouseHold"), this.li = a, this.i("mouseHold", b, a))
});
t.g(u, "mouseDragOver", u.prototype.VE);
t.defineProperty(u, {VE: "mouseDragOver"}, function () {
return this.Mu
}, function (a) {
var b = this.Mu;
b !== a && (null !== a && t.j(a, "function", u, "mouseDragOver"), this.Mu = a, this.i("mouseDragOver", b, a))
});
t.g(u, "mouseDrop", u.prototype.bt);
t.defineProperty(u, {bt: "mouseDrop"}, function () {
return this.ki
}, function (a) {
var b = this.ki;
b !== a && (null !== a && t.j(a, "function", u, "mouseDrop"), this.ki = a, this.i("mouseDrop", b, a))
});
t.g(u, "toolTip", u.prototype.Dt);
t.defineProperty(u, {Dt: "toolTip"}, function () {
return this.xi
}, function (a) {
var b = this.xi;
b !== a && (null !== a && t.k(a, Ue, u, "toolTip"), this.xi = a, this.i("toolTip", b, a))
});
t.g(u, "contextMenu", u.prototype.contextMenu);
t.defineProperty(u, {contextMenu: "contextMenu"}, function () {
return this.ai
}, function (a) {
var b = this.ai;
b !== a && (null !== a && t.k(a, Ue, u, "contextMenu"), this.ai = a, this.i("contextMenu", b, a))
});
t.g(u, "commandHandler", u.prototype.Qe);
t.defineProperty(u, {Qe: "commandHandler"}, function () {
return this.Fx
}, function (a) {
var b = this.Fx;
b !== a && (t.k(a, va, u, "commandHandler"), null !== a.h && t.m("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.He(null), this.Fx = a, a.He(this))
});
t.g(u, "toolManager", u.prototype.Eb);
t.defineProperty(u, {Eb: "toolManager"}, function () {
return this.vv
}, function (a) {
var b = this.vv;
b !== a && (t.k(a, Ge, u, "toolManager"), null !== a.h && t.m("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.He(null), this.vv = a, a.He(this))
});
t.g(u, "defaultTool", u.prototype.Vv);
t.defineProperty(u, {Vv: "defaultTool"}, function () {
return this.Tx
}, function (a) {
var b = this.Tx;
b !== a && (t.k(a, ke, u, "defaultTool"), this.Tx = a, this.Ta === b && (this.Ta = a))
});
t.g(u, "currentTool", u.prototype.Ta);
t.defineProperty(u, {Ta: "currentTool"}, function () {
return this.Ox
}, function (a) {
var b = this.Ox;
null !== b && (b.qa && b.doDeactivate(), b.cancelWaitAfter(), b.doStop());
null === a && (a = this.Vv);
null !== a && (t.k(a, ke, u, "currentTool"), this.Ox = a, a.He(this), a.doStart())
});
t.A(u, {selection: "selection"}, function () {
return this.jv
});
t.g(u, "maxSelectionCount", u.prototype.OE);
t.defineProperty(u, {OE: "maxSelectionCount"}, function () {
return this.Hu
}, function (a) {
var b = this.Hu;
if (b !== a)if (t.j(a, "number", u, "maxSelectionCount"), 0 <= a && !isNaN(a)) {
if (this.Hu = a, this.i("maxSelectionCount", b, a), !this.Aa.qb && (a = this.selection.count - a, 0 < a)) {
this.Ja("ChangingSelection");
for (var b = this.selection.af(), c = 0; c < a; c++)b[c].bb = !1;
this.Ja("ChangedSelection")
}
} else t.ha(a, ">= 0", u, "maxSelectionCount")
});
t.g(u, "nodeSelectionAdornmentTemplate", u.prototype.YE);
t.defineProperty(u, {YE: "nodeSelectionAdornmentTemplate"}, function () {
return this.Su
}, function (a) {
var b = this.Su;
b !== a && (t.k(a, Ue, u, "nodeSelectionAdornmentTemplate"), this.Su = a, this.i("nodeSelectionAdornmentTemplate", b, a))
});
t.g(u, "groupSelectionAdornmentTemplate", u.prototype.kE);
t.defineProperty(u, {kE: "groupSelectionAdornmentTemplate"}, function () {
return this.pu
}, function (a) {
var b = this.pu;
b !== a && (t.k(a, Ue, u, "groupSelectionAdornmentTemplate"), this.pu = a, this.i("groupSelectionAdornmentTemplate", b, a))
});
t.g(u, "linkSelectionAdornmentTemplate", u.prototype.LE);
t.defineProperty(u, {LE: "linkSelectionAdornmentTemplate"}, function () {
return this.Bu
}, function (a) {
var b = this.Bu;
b !== a && (t.k(a, Ue, u, "linkSelectionAdornmentTemplate"), this.Bu = a, this.i("linkSelectionAdornmentTemplate", b, a))
});
t.g(u, "isModified", u.prototype.gk);
t.defineProperty(u, {gk: "isModified"}, function () {
var a = this.Aa;
return null === a ? this.uy : null !== a.gl ? !0 : this.uy && this.Ik !== a.fk
}, function (a) {
if (this.uy !== a) {
t.j(a, "boolean", u, "isModified");
this.uy = a;
var b = this.Aa;
!a && b && (this.Ik = b.fk);
a || Si(this)
}
});
function Si(a) {
var b = a.gk;
a.YC !== b && (a.YC = b, a.Ja("Modified"))
}
t.g(u, "model", u.prototype.fa);
t.defineProperty(u, {fa: "model"}, function () {
return this.de
}, function (a) {
var b = this.de;
if (b !== a) {
t.k(a, I, u, "model");
null !== b && b.Aa !== a.Aa && b.Aa.nI && t.m("Do not replace a Diagram.model while a transaction is in progress.");
this.Yf = !1;
this.Bq = !0;
this.ig = !1;
var c = this.Jd;
this.Jd = !0;
null !== b && (b.NA(this.tC), b instanceof U && Ti(this, b.Ti), Ti(this, b.sg));
this.de = a;
a.xz(this.sC);
Ui(this, a.sg);
a instanceof U && Vi(this, a.Ti);
a.NA(this.sC);
a.xz(this.tC);
this.Jd = c;
this.lc || this.ua();
null !== b && (a.Aa.isEnabled = b.Aa.isEnabled)
}
});
t.defineProperty(u, {Xa: null}, function () {
return this.mC
}, function (a) {
this.mC = a
});
function Qh(a, b) {
if (b.fa === a.fa && a.Xa) {
a.Xa = !1;
try {
var c = b.nd, d = b.sf;
if ("" !== d)if (c === Bd) {
if ("linkFromKey" === d) {
var e = b.object, g = a.If(e);
if (null !== g) {
var h = b.newValue, k = a.ng(h);
g.da = k
}
} else if ("linkToKey" === d)e = b.object, g = a.If(e), null !== g && (h = b.newValue, k = a.ng(h), g.ja = k); else if ("linkFromPortId" === d) {
if (e = b.object, g = a.If(e), null !== g) {
var l = b.newValue;
"string" === typeof l && (g.nf = l)
}
} else if ("linkToPortId" === d)e = b.object, g = a.If(e), null !== g && (l = b.newValue, "string" === typeof l && (g.Rf = l)); else if ("nodeGroupKey" ===
d) {
var e = b.object, m = a.Ni(e);
if (null !== m) {
var n = b.newValue;
if (void 0 !== n) {
var p = a.ng(n);
m.fb = p instanceof z ? p : null
} else m.fb = null
}
} else if ("linkLabelKeys" === d) {
if (e = b.object, g = a.If(e), null !== g) {
var q = b.oldValue, r = b.newValue;
if (t.isArray(q))for (var s = t.yb(q), v = 0; v < s; v++) {
var x = t.sb(q, v), k = a.ng(x);
null !== k && (k.Tc = null)
}
if (t.isArray(r))for (s = t.yb(r), v = 0; v < s; v++)x = t.sb(r, v), k = a.ng(x), null !== k && (k.Tc = g)
}
} else if ("nodeParentKey" === d) {
var E = b.object, F = a.ng(b.newValue), G = a.ew(E);
if (null !== G) {
var L = G.Js();
null !== L ? null === F ? a.remove(L) : a.ed ? L.da = F : L.ja = F : Wi(a, F, G)
}
} else if ("parentLinkCategory" === d) {
var E = b.object, G = a.ew(E), N = b.newValue;
null !== G && "string" === typeof N && (L = G.Js(), null !== L && (L.Pc = N))
} else if ("nodeCategory" === d) {
var e = b.object, V = a.Ni(e), N = b.newValue;
null !== V && "string" === typeof N && (V.Pc = N)
} else if ("linkCategory" === d) {
var e = b.object, T = a.If(e), N = b.newValue;
null !== T && "string" === typeof N && (T.Pc = N)
} else if ("nodeDataArray" === d) {
a.ua();
var W = b.oldValue;
Ti(a, W);
var ea = b.newValue;
Ui(a, ea)
} else"linkDataArray" ===
d && (a.ua(), W = b.oldValue, Ti(a, W), ea = b.newValue, Vi(a, ea));
a.gk = !0
} else if (c === Cd)ea = b.newValue, "nodeDataArray" === d && t.pb(ea) ? Xi(a, ea) : "linkDataArray" === d && t.pb(ea) ? Yi(a, ea) : "linkLabelKeys" === d && xe(ea) && (g = a.If(b.object), k = a.ng(ea), null !== g && null !== k && (k.Tc = g)), a.gk = !0; else if (c === Dd)W = b.oldValue, "nodeDataArray" === d && t.pb(W) ? Zi(a, W) : "linkDataArray" === d && t.pb(W) ? Zi(a, W) : "linkLabelKeys" === d && xe(W) && (k = a.ng(W), null !== k && (k.Tc = null)), a.gk = !0; else {
if (c === Ad && "SourceChanged" === d) {
var m = a.Ni(b.object), R = b.propertyName;
null !== m && "string" === typeof R && (m.Kb(R), a.fa instanceof Rd && (g = a.If(b.object), null !== g && g.Kb(R)))
}
} else if (c === Bd) {
var xa = b.propertyName, e = b.object;
if (e === a.fa) {
if ("nodeKeyProperty" === xa || "nodeCategoryProperty" === xa || "linkFromKeyProperty" === xa || "linkToKeyProperty" === xa || "linkFromPortIdProperty" === xa || "linkToPortIdProperty" === xa || "linkLabelKeysProperty" === xa || "nodeIsGroupProperty" === xa || "nodeGroupKeyProperty" === xa || "nodeParentKeyProperty" === xa || "linkCategoryProperty" === xa)a.Aa.qb || a.$m()
} else Ph(a,
e, xa);
a.gk = !0
} else if (c === Cd || c === Dd)$i(a, b), a.gk = !0; else if (c === Ad) {
var Ja = b.propertyName;
"S" !== Ja[0] ? ("CommittingTransaction" === Ja || "FinishedUndo" !== Ja && "FinishedRedo" !== Ja || (a.Aa.hi = !0, ei(a), a.Aa.hi = !1), a.hu = !0, a.Vi(), Si(a), a.Hy || "CommittedTransaction" !== Ja || (a.Hy = !0, setTimeout(function () {
a.Ta.standardMouseOver();
a.Hy = !1
}, 10))) : "StartingFirstTransaction" !== Ja || a.Jd || a.Yf || (a.hu = !0, a.Bq && (a.ig = !0))
}
} finally {
a.Xa = !0
}
}
}
function Ph(a, b, c) {
var d = a.Ni(b);
if (null !== d && "string" === typeof c)d.Kb(c), a.fa instanceof Rd && (b = a.If(b), null !== b && b.Kb(c)); else if ("string" === typeof c) {
d = null;
for (a = a.Vl.l; a.next();) {
for (var e = a.value, g = 0; g < e.length; g++) {
var h = e[g];
null !== h.$f && (h = h.$f.Ba(b), null !== h && (null === d && (d = t.Db()), d.push(h)))
}
if (null !== d)break
}
b = d;
if (null !== b) {
for (d = 0; d < b.length; d++)b[d].Kb(c);
t.Da(b)
}
}
}
function $i(a, b) {
var c = b.nd === Cd, d = c ? b.Lf : b.Nf, e = c ? b.newValue : b.oldValue, g = a.Vl.Ba(b.object);
if (Array.isArray(g) && "number" === typeof d)for (var h = 0; h < g.length; h++) {
var k = g[h];
k.type !== Tg && k.type !== Wh || d++;
c ? aj(k, e, d) : (k.Ue(d), bj(k, d - 1))
}
}
function Ni(a, b) {
var c = b.rj;
if (t.isArray(c)) {
var d = a.Vl.Ba(c);
if (null === d)a.Vl.add(c, [b]); else {
for (c = 0; c < d.length; c++)if (d[c] === b)return;
d.push(b)
}
}
}
function Pi(a, b) {
var c = b.rj;
if (t.isArray(c)) {
var d = a.Vl.Ba(c);
if (null !== d)for (var e = 0; e < d.length; e++)if (d[e] === b) {
d.splice(e, 1);
0 === d.length && a.Vl.remove(c);
break
}
}
}
u.prototype.clear = u.prototype.clear = function () {
var a = null;
null !== this.Xc && (a = this.Xc.U);
this.fa.clear();
for (var b = this.Bb.length, c = 0; c < b; c++)this.Bb.p[c].clear();
this.Zf.clear();
this.Dn.clear();
this.Tu.clear();
this.Uk.clear();
this.Cu.clear();
this.cb.clear();
this.bi.clear();
this.Ck.clear();
this.Vl.clear();
this.jv.Va();
this.jv.clear();
this.jv.freeze();
this.Io = this.GA = null;
t.ys = null;
this.iu = (new D(NaN, NaN, NaN, NaN)).freeze();
null !== a && (this.add(a), this.cb.remove(a));
this.ua()
};
u.prototype.reset = u.prototype.reset = function () {
this.lc = !0;
this.clear();
this.Bb = new H(je);
this.rb = (new C(NaN, NaN)).freeze();
this.Sb = 1;
this.Ju = 1E-4;
this.Gu = 100;
this.Av = (new C(NaN, NaN)).freeze();
this.nu = (new D(NaN, NaN, NaN, NaN)).freeze();
this.El = Ye;
this.Hl = Pb;
this.Jk = Ye;
this.Mn = Pb;
this.uu = this.tu = Qb;
this.Ut = (new rb(16, 16, 16, 16)).freeze();
this.yu = !0;
this.xv = pg;
this.uq = "auto";
this.de = this.ai = this.xi = this.ki = this.Mu = this.li = this.mi = this.ni = this.$h = this.di = this.Yh = null;
this.Lk = !1;
this.pk = this.ok = this.Jt =
this.gi = !0;
this.Lt = this.Kt = !1;
this.Pt = this.Mt = this.su = this.ru = this.Qt = this.Ot = this.xk = this.wk = this.vk = this.uk = this.sk = this.tk = this.rk = this.Nt = this.zk = this.qk = this.yk = !0;
this.gv = this.fv = 16;
this.Le = (new rb(5)).freeze();
this.Hu = 999999999;
this.Ld = null;
Rh(this);
Sh(this);
this.Xc = null;
this.fa = new U;
this.ui = !0;
this.Tb = new le;
this.lc = this.ui = !1;
this.ua()
};
u.prototype.rebuildParts = u.prototype.$m = function () {
for (var a = this.yw.l; a.next();) {
var b = a.value;
(!b.Ud() || b instanceof z) && t.m('Invalid node template in Diagram.nodeTemplateMap: template for "' + a.key + '" must be a Node or a simple Part, not a Group or Link: ' + b)
}
for (a = this.iw.l; a.next();)b = a.value, b instanceof z || t.m('Invalid group template in Diagram.groupTemplateMap: template for "' + a.key + '" must be a Group, not a normal Node or Link: ' + b);
for (a = this.vw.l; a.next();)b = a.value, b instanceof A || t.m('Invalid link template in Diagram.linkTemplateMap: template for "' +
a.key + '" must be a Link, not a normal Node or simple Part: ' + b);
a = t.Db();
for (b = this.selection.l; b.next();) {
var c = b.value.data;
c && a.push(c)
}
b = this.fa;
b instanceof U && Ti(this, b.Ti);
Ti(this, b.sg);
Ui(this, b.sg);
b instanceof U && Vi(this, b.Ti);
for (b = 0; b < a.length; b++)if (c = this.Ni(a[b]))c.bb = !0;
t.Da(a)
};
function Ui(a, b) {
if (null !== b) {
for (var c = a.fa, d = t.yb(b), e = 0; e < d; e++) {
var g = t.sb(b, e);
c.ie(g) ? Xi(a, g, !1) : c instanceof U && Yi(a, g)
}
if (c instanceof U || c instanceof Rd) {
for (e = 0; e < d; e++)g = t.sb(b, e), c.ie(g) && cj(a, g);
if (c instanceof U)for (c = a.links; c.next();)dj(c.value)
}
ej(a, !1)
}
}
function Xi(a, b, c) {
if (void 0 !== b && null !== b && !a.Aa.qb && !a.bi.contains(b)) {
void 0 === c && (c = !0);
var d = a.getCategoryForNodeData(b), e = a.findTemplateForNodeData(b, d);
e instanceof w && (We(e), e = e.copy(), e instanceof w && (e.gh = d, a.add(e), e.data = b, c && cj(a, b)))
}
}
u.prototype.getCategoryForNodeData = function (a) {
var b = this.fa, c = b.getCategoryForNodeData(a), d = !1;
b instanceof U && (d = b.oI(a));
d && "" === c && (c = "LinkLabel");
return c
};
u.prototype.findTemplateForNodeData = function (a, b) {
var c = !1, d = this.fa;
d instanceof U && (c = d.kA(a));
c ? (c = this.iw.Ba(b), null === c && (c = this.iw.Ba(""), null === c && (t.eG || (t.eG = !0, t.trace('No Group template found for category "' + b + '"'), t.trace(" Using default group template")), c = this.NB))) : (c = this.yw.Ba(b), null === c && (c = this.yw.Ba(""), null === c && (t.hG || (t.hG = !0, t.trace('No Node template found for category "' + b + '"'), t.trace(" Using default node template")), c = this.PB)));
return c instanceof w ? c : null
};
function cj(a, b) {
var c = a.fa;
if (c instanceof U || c instanceof Rd) {
var d = c.Nb(b);
if (void 0 !== d) {
var e = ye(c, d), g = a.Ni(b);
if (null !== e && null !== g) {
for (e = e.l; e.next();) {
var h = e.value;
if (c instanceof U)if (c.ie(h)) {
if (g instanceof z && c.Vo(h) === d) {
var k = a.Ni(h);
null !== k && (k.fb = g)
}
} else {
if (k = a.If(h), null !== k && g instanceof y && (c.Nm(h) === d && (k.da = g), c.Om(h) === d && (k.ja = g), h = c.ll(h), t.isArray(h)))for (var l = 0; l < t.yb(h); l++)if (t.sb(h, l) === d) {
g.Tc = k;
break
}
} else c instanceof Rd && c.ie(h) && g instanceof y && c.Xo(h) === d &&
(k = a.ew(h), Wi(a, g, k))
}
Ae(c, d)
}
c instanceof U ? (c = c.Vo(b), void 0 !== c && (c = a.ng(c), c instanceof z && (g.fb = c))) : c instanceof Rd && (c = c.Xo(b), void 0 !== c && g instanceof y && (c = a.ng(c), Wi(a, c, g)))
}
}
}
function Wi(a, b, c) {
if (null !== b && null !== c) {
var d = a.Eb.pA, e = b, g = c;
if (a.ed)for (b = g.Cd; b.next();) {
var h = b.value;
if (h.ja === g)return
} else for (e = c, g = b, b = e.Cd; b.next();)if (h = b.value, h.da === e)return;
null !== d && rg(d, e, g, null, !0) || (d = a.getCategoryForLinkData(c.data), b = a.findTemplateForLinkData(c.data, d), b instanceof A && (We(b), b = b.copy(), b instanceof A && (b.gh = d, b.da = e, b.ja = g, a.add(b), b.data = c.data)))
}
}
function Vi(a, b) {
if (null !== b) {
for (var c = t.yb(b), d = 0; d < c; d++) {
var e = t.sb(b, d);
Yi(a, e)
}
ej(a, !1)
}
}
function Yi(a, b) {
if (void 0 !== b && null !== b && !a.Aa.qb && !a.Ck.contains(b)) {
var c = a.getCategoryForLinkData(b), d = a.findTemplateForLinkData(b, c);
if (d instanceof A && (We(d), d = d.copy(), d instanceof A)) {
d.gh = c;
var c = a.fa, e = c.$H(b);
"" !== e && (d.nf = e);
e = c.Nm(b);
void 0 !== e && (e = a.ng(e), e instanceof y && (d.da = e));
e = c.cI(b);
"" !== e && (d.Rf = e);
e = c.Om(b);
void 0 !== e && (e = a.ng(e), e instanceof y && (d.ja = e));
c = c.ll(b);
if (t.isArray(c))for (var e = t.yb(c), g = 0; g < e; g++) {
var h = t.sb(c, g), h = a.ng(h);
null !== h && (h.Tc = d)
}
a.add(d);
d.data = b
}
}
}
u.prototype.getCategoryForLinkData = function (a) {
var b = this.fa, c = "";
b instanceof U ? c = b.getCategoryForLinkData(a) : b instanceof Rd && (c = b.bI(a));
return c
};
u.prototype.findTemplateForLinkData = function (a, b) {
var c = this.vw.Ba(b);
null === c && (c = this.vw.Ba(""), null === c && (t.gG || (t.gG = !0, t.trace('No Link template found for category "' + b + '"'), t.trace(" Using default link template")), c = this.OB));
return c instanceof A ? c : null
};
function Ti(a, b) {
for (var c = t.yb(b), d = 0; d < c; d++) {
var e = t.sb(b, d);
Zi(a, e)
}
}
function Zi(a, b) {
if (void 0 !== b && null !== b) {
var c = a.Ni(b);
if (c instanceof w) {
c.bb = !1;
var d = c.layer;
if (null !== d && d.h === a) {
var e = a.fa;
if (e instanceof U && c instanceof y) {
var g = e.Nb(c.data);
if (void 0 !== g) {
for (var h = c.Cd; h.next();) {
var k = h.value.data;
ze(e, g, k)
}
c.Hh && (h = c.Tc, null !== h && (k = h.data, ze(e, g, k)));
if (c instanceof z)for (h = c.Hc; h.next();)k = h.value.data, e.ie(k) && ze(e, g, k)
}
} else if (e instanceof Rd && c instanceof y) {
h = a.If(c.data);
if (null !== h && (h.bb = !1, k = h.layer, null !== k)) {
var l = k.Ue(-1, h);
0 <= l && a.fd(Dd,
"parts", k, h, null, l, null);
l = h.fp;
null !== l && l(h, k, null)
}
h = a.ed;
for (k = c.Cd; k.next();)l = k.value, l = (h ? l.ja : l.da).data, e.ie(l) && ze(e, g, l)
}
e = d.Ue(-1, c);
0 <= e && a.fd(Dd, "parts", d, c, null, e, null);
e = c.fp;
null !== e && e(c, d, null)
}
}
}
}
u.prototype.findPartForKey = function (a) {
if (null === a || void 0 === a)return null;
a = this.fa.mf(a);
if (null === a)return null;
a = this.bi.Ba(a);
return a instanceof w ? a : null
};
u.prototype.findNodeForKey = u.prototype.ng = function (a) {
if (null === a || void 0 === a)return null;
a = this.fa.mf(a);
if (null === a)return null;
a = this.bi.Ba(a);
return a instanceof y ? a : null
};
u.prototype.findPartForData = u.prototype.Ni = function (a) {
if (null === a)return null;
var b = this.bi.Ba(a);
if (b instanceof w)return b;
b = this.Ck.Ba(a);
return b instanceof w ? b : null
};
u.prototype.findNodeForData = u.prototype.ew = function (a) {
if (null === a)return null;
a = this.bi.Ba(a);
return a instanceof y ? a : null
};
u.prototype.findLinkForData = u.prototype.If = function (a) {
if (null === a)return null;
a = this.Ck.Ba(a);
return a instanceof A ? a : null
};
t.g(u, "nodeTemplate", u.prototype.II);
t.defineProperty(u, {II: "nodeTemplate"}, function () {
return this.oi.Ba("")
}, function (a) {
var b = this.oi.Ba("");
b !== a && (t.k(a, w, u, "nodeTemplate"), this.oi.add("", a), this.i("nodeTemplate", b, a), this.Aa.qb || this.$m())
});
t.g(u, "nodeTemplateMap", u.prototype.yw);
t.defineProperty(u, {yw: "nodeTemplateMap"}, function () {
return this.oi
}, function (a) {
var b = this.oi;
b !== a && (t.k(a, ra, u, "nodeTemplateMap"), this.oi = a, this.i("nodeTemplateMap", b, a), this.Aa.qb || this.$m())
});
t.g(u, "groupTemplate", u.prototype.eI);
t.defineProperty(u, {eI: "groupTemplate"}, function () {
return this.Fk.Ba("")
}, function (a) {
var b = this.Fk.Ba("");
b !== a && (t.k(a, z, u, "groupTemplate"), this.Fk.add("", a), this.i("groupTemplate", b, a), this.Aa.qb || this.$m())
});
t.g(u, "groupTemplateMap", u.prototype.iw);
t.defineProperty(u, {iw: "groupTemplateMap"}, function () {
return this.Fk
}, function (a) {
var b = this.Fk;
b !== a && (t.k(a, ra, u, "groupTemplateMap"), this.Fk = a, this.i("groupTemplateMap", b, a), this.Aa.qb || this.$m())
});
t.g(u, "linkTemplate", u.prototype.BI);
t.defineProperty(u, {BI: "linkTemplate"}, function () {
return this.uj.Ba("")
}, function (a) {
var b = this.uj.Ba("");
b !== a && (t.k(a, A, u, "linkTemplate"), this.uj.add("", a), this.i("linkTemplate", b, a), this.Aa.qb || this.$m())
});
t.g(u, "linkTemplateMap", u.prototype.vw);
t.defineProperty(u, {vw: "linkTemplateMap"}, function () {
return this.uj
}, function (a) {
var b = this.uj;
b !== a && (t.k(a, ra, u, "linkTemplateMap"), this.uj = a, this.i("linkTemplateMap", b, a), this.Aa.qb || this.$m())
});
t.g(u, "isMouseCaptured", u.prototype.zd);
t.defineProperty(u, {zd: "isMouseCaptured"}, function () {
return this.kC
}, function (a) {
var b = this.Pa;
null !== b && (a ? (this.T.bubbles = !1, b.removeEventListener("mousemove", this.qp, !1), b.removeEventListener("mousedown", this.pp, !1), b.removeEventListener("mouseup", this.sp, !1), b.removeEventListener("mousewheel", this.Yg, !1), b.removeEventListener("DOMMouseScroll", this.Yg, !1), b.removeEventListener("mouseout", this.rp, !1), window.addEventListener("mousemove", this.qp, !0), window.addEventListener("mousedown", this.pp, !0),
window.addEventListener("mouseup", this.sp, !0), window.addEventListener("mousewheel", this.Yg, !0), window.addEventListener("DOMMouseScroll", this.Yg, !0), window.addEventListener("mouseout", this.rp, !0), window.addEventListener("selectstart", this.preventDefault, !1)) : (window.removeEventListener("mousemove", this.qp, !0), window.removeEventListener("mousedown", this.pp, !0), window.removeEventListener("mouseup", this.sp, !0), window.removeEventListener("mousewheel", this.Yg, !0), window.removeEventListener("DOMMouseScroll",
this.Yg, !0), window.removeEventListener("mouseout", this.rp, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("mousemove", this.qp, !1), b.addEventListener("mousedown", this.pp, !1), b.addEventListener("mouseup", this.sp, !1), b.addEventListener("mousewheel", this.Yg, !1), b.addEventListener("DOMMouseScroll", this.Yg, !1), b.addEventListener("mouseout", this.rp, !1)), this.kC = a)
});
t.g(u, "position", u.prototype.position);
t.defineProperty(u, {position: "position"}, function () {
return this.rb
}, function (a) {
var b = this.rb;
if (!b.N(a)) {
t.k(a, C, u, "position");
var c = this.nb.copy();
c.x = b.x;
c.y = b.y;
a = a.copy();
b.ak(a) || (this.lc || null === this.Pa || (this.lc = !0, b = this.scale, ii(this, a, this.vc, this.tc / b, this.sc / b, this.Hl), this.lc = !1), b = a);
this.rb = b.Z();
this.lc || this.kt(c, this.nb)
}
});
t.g(u, "initialPosition", u.prototype.sE);
t.defineProperty(u, {sE: "initialPosition"}, function () {
return this.oy
}, function (a) {
this.oy.N(a) || (t.k(a, C, u, "initialPosition"), this.oy = a.Z())
});
t.g(u, "initialScale", u.prototype.tE);
t.defineProperty(u, {tE: "initialScale"}, function () {
return this.py
}, function (a) {
this.py !== a && (t.j(a, "number", u, "initialScale"), this.py = a)
});
t.g(u, "grid", u.prototype.Yo);
t.defineProperty(u, {Yo: "grid"}, function () {
null === this.Xc && ai(this);
return this.Xc
}, function (a) {
var b = this.Xc;
if (b !== a) {
null === b && (ai(this), b = this.Xc);
t.k(a, B, u, "grid");
a.type !== bi && t.m("Diagram.grid must be a Panel of type Panel.Grid");
var c = b.ga;
null !== c && c.remove(b);
this.Xc = a;
a.name = "GRID";
null !== c && c.add(a);
vi(this);
this.ua();
this.i("grid", b, a)
}
});
t.A(u, {nb: "viewportBounds"}, function () {
var a = this.XC;
if (null === this.Pa)return a;
var b = this.rb, c = this.Sb;
a.q(b.x, b.y, Math.max(this.tc, 0) / c, Math.max(this.sc, 0) / c);
return a
});
t.g(u, "fixedBounds", u.prototype.Wz);
t.defineProperty(u, {Wz: "fixedBounds"}, function () {
return this.nu
}, function (a) {
var b = this.nu;
b.N(a) || (t.k(a, D, u, "fixedBounds"), this.nu = a = a.Z(), this.Ac(), this.i("fixedBounds", b, a))
});
t.A(u, {vc: "documentBounds"}, function () {
return this.iu
});
function ji(a, b) {
var c = a.iu;
c.N(b) || (b = b.Z(), a.iu = b, a.pj = !1, a.hj = null, gi(a), a.Ja("DocumentBoundsChanged", null, c.copy()), ti(a))
}
t.g(u, "scale", u.prototype.scale);
t.defineProperty(u, {scale: "scale"}, function () {
return this.Sb
}, function (a) {
var b = this.Sb;
t.o(a, u, "scale");
a < this.qg && (a = this.qg);
a > this.pg && (a = this.pg);
if (b !== a) {
var c = this.Sb = a;
if (!this.lc && !this.Jd && (this.lc = !0, null !== this.Pa)) {
a = this.nb.copy();
var d = this.tc / c, e = this.sc / c;
a.width = this.tc / b;
a.height = this.sc / b;
var g = this.Uh.copy();
if (isNaN(g.x))switch (this.Rv) {
case oc:
g.x = 0;
break;
case pc:
g.x = d - 1;
break;
case Ub:
g.x = d / 2;
break;
case Pb:
case wc:
g.x = d / 2
}
if (isNaN(g.y))switch (this.Rv) {
case nc:
g.y = 0;
break;
case vc:
g.y =
e - 1;
break;
case Ub:
g.y = e / 2;
break;
case Pb:
case wc:
g.y = e / 2
}
var h = this.position, b = new C(h.x + g.x / b - g.x / c, h.y + g.y / b - g.y / c);
ii(this, b, this.vc, d, e, this.Hl);
this.position = b;
this.lc = !1;
this.kt(a, this.nb)
}
this.ua();
ti(this)
}
});
t.g(u, "autoScale", u.prototype.zm);
t.defineProperty(u, {zm: "autoScale"}, function () {
return this.El
}, function (a) {
var b = this.El;
b !== a && (t.tb(a, u, u, "autoScale"), this.El = a, this.i("autoScale", b, a), a !== Ye && gi(this))
});
t.g(u, "initialAutoScale", u.prototype.jI);
t.defineProperty(u, {jI: "initialAutoScale"}, function () {
return this.Jk
}, function (a) {
var b = this.Jk;
b !== a && (t.tb(a, u, u, "initialAutoScale"), this.Jk = a, this.i("initialAutoScale", b, a))
});
t.g(u, "initialViewportSpot", u.prototype.uE);
t.defineProperty(u, {uE: "initialViewportSpot"}, function () {
return this.uu
}, function (a) {
var b = this.uu;
b !== a && (t.k(a, K, u, "initialViewportSpot"), a.qd() || t.m("initialViewportSpot must be a real Spot: " + a), this.uu = a, this.i("initialViewportSpot", b, a))
});
t.g(u, "initialDocumentSpot", u.prototype.rE);
t.defineProperty(u, {rE: "initialDocumentSpot"}, function () {
return this.tu
}, function (a) {
var b = this.tu;
b !== a && (t.k(a, K, u, "initialDocumentSpot"), a.qd() || t.m("initialViewportSpot must be a real Spot: " + a), this.tu = a, this.i("initialDocumentSpot", b, a))
});
t.g(u, "minScale", u.prototype.qg);
t.defineProperty(u, {qg: "minScale"}, function () {
return this.Ju
}, function (a) {
t.o(a, u, "minScale");
var b = this.Ju;
b !== a && 0 < a ? (this.Ju = a, this.i("minScale", b, a), a > this.scale && (this.scale = a)) : t.ha(a, "> 0", u, "minScale")
});
t.g(u, "maxScale", u.prototype.pg);
t.defineProperty(u, {pg: "maxScale"}, function () {
return this.Gu
}, function (a) {
t.o(a, u, "maxScale");
var b = this.Gu;
b !== a && 0 < a ? (this.Gu = a, this.i("maxScale", b, a), a < this.scale && (this.scale = a)) : t.ha(a, "> 0", u, "maxScale")
});
t.g(u, "zoomPoint", u.prototype.Uh);
t.defineProperty(u, {Uh: "zoomPoint"}, function () {
return this.Av
}, function (a) {
this.Av.N(a) || (t.k(a, C, u, "zoomPoint"), this.Av = a = a.Z())
});
t.g(u, "contentAlignment", u.prototype.Rv);
t.defineProperty(u, {Rv: "contentAlignment"}, function () {
return this.Hl
}, function (a) {
var b = this.Hl;
b.N(a) || (t.k(a, K, u, "contentAlignment"), this.Hl = a = a.Z(), this.i("contentAlignment", b, a), gi(this))
});
t.g(u, "initialContentAlignment", u.prototype.kI);
t.defineProperty(u, {kI: "initialContentAlignment"}, function () {
return this.Mn
}, function (a) {
var b = this.Mn;
b.N(a) || (t.k(a, K, u, "initialContentAlignment"), this.Mn = a = a.Z(), this.i("initialContentAlignment", b, a))
});
t.g(u, "padding", u.prototype.padding);
t.defineProperty(u, {padding: "padding"}, function () {
return this.Le
}, function (a) {
"number" === typeof a ? a = new rb(a) : t.k(a, rb, u, "padding");
var b = this.Le;
b.N(a) || (this.Le = a = a.Z(), this.Ac(), this.i("padding", b, a))
});
t.A(u, {Xi: "nodes"}, function () {
return this.Tu.l
});
t.A(u, {links: "links"}, function () {
return this.Cu.l
});
t.A(u, {rl: "parts"}, function () {
return this.cb.l
});
u.prototype.findTopLevelGroups = function () {
return this.Uk.l
};
t.g(u, "layout", u.prototype.Tb);
t.defineProperty(u, {Tb: "layout"}, function () {
return this.Ld
}, function (a) {
var b = this.Ld;
b !== a && (t.k(a, le, u, "layout"), null !== b && (b.h = null, b.group = null), this.Ld = a, a.h = this, a.group = null, this.Rt = !0, this.i("layout", b, a), this.Of())
});
u.prototype.layoutDiagram = function (a) {
ei(this);
a && ej(this, !0);
wi(this, !1)
};
function ej(a, b) {
for (var c = a.Uk.l; c.next();)fj(a, c.value, b);
null !== a.Tb && (b ? a.Tb.pf = !1 : a.Tb.K())
}
function fj(a, b, c) {
if (null !== b) {
for (var d = b.bm.l; d.next();)fj(a, d.value, c);
null !== b.Tb && (c ? b.Tb.pf = !1 : b.Tb.K())
}
}
function wi(a, b) {
for (var c = a.Uk.l; c.next();)gj(a, c.value, b);
c = a.Tb;
if (null !== c && !c.pf) {
if (b && !c.mA)return;
c.doLayout(a);
ei(a);
c.pf = !0
}
a.Rt = !1
}
function gj(a, b, c) {
if (null !== b) {
for (var d = b.bm.l; d.next();)gj(a, d.value, c);
d = b.Tb;
null === d || d.pf || c && !d.mA || (b.zC = !b.location.Q(), d.doLayout(b), b.K(hj), d.pf = !0, zi(a, b))
}
}
t.g(u, "isTreePathToChildren", u.prototype.ed);
t.defineProperty(u, {ed: "isTreePathToChildren"}, function () {
return this.yu
}, function (a) {
var b = this.yu;
if (b !== a && (t.j(a, "boolean", u, "isTreePathToChildren"), this.yu = a, this.i("isTreePathToChildren", b, a), !this.Aa.qb))for (a = this.Xi; a.next();)ij(a.value)
});
u.prototype.findTreeRoots = function () {
for (var a = new H(y), b = this.Xi.l; b.next();) {
var c = b.value;
c.ep && null === c.Js() && a.add(c)
}
return a.l
};
t.g(u, "isCollapsingExpanding", u.prototype.Sd);
t.defineProperty(u, {Sd: null}, function () {
return this.fC
}, function (a) {
this.fC = a
});
function Oh(a) {
function b(a) {
var b = a.toLowerCase(), h = new H("function");
c.add(a, h);
c.add(b, h);
d.add(a, a);
d.add(b, a)
}
var c = new ra("string", H), d = new ra("string", "string");
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.Vx = c;
a.Ux = d
}
function sa(a, b) {
var c = a.Ux.Ba(b);
return null !== c ? c : a.Ux.Ba(b.toLowerCase())
}
function jj(a, b) {
var c = a.Vx.Ba(b);
if (null !== c)return c;
c = a.Vx.Ba(b.toLowerCase());
if (null !== c)return c;
t.m("Unknown DiagramEvent name: " + b);
return null
}
u.prototype.addDiagramListener = u.prototype.yz = function (a, b) {
t.j(a, "string", u, "addDiagramListener:name");
t.j(b, "function", u, "addDiagramListener:listener");
var c = jj(this, a);
null !== c && c.add(b)
};
u.prototype.removeDiagramListener = u.prototype.eF = function (a, b) {
t.j(a, "string", u, "removeDiagramListener:name");
t.j(b, "function", u, "addDiagramListener:listener");
var c = jj(this, a);
null !== c && c.remove(b)
};
u.prototype.raiseDiagramEvent = u.prototype.Ja = function (a, b, c) {
f && t.j(a, "string", u, "raiseDiagramEvent:name");
var d = jj(this, a), e = new ud;
e.h = this;
e.name = sa(this, a);
void 0 !== b && (e.Pw = b);
void 0 !== c && (e.Cw = c);
a = d.length;
if (1 === a)d = d.pa(0), d(e); else if (0 !== a)for (b = d.af(), c = 0; c < a; c++)d = b[c], d(e);
return e.cancel
};
function ag(a, b) {
var c = !1;
a.nb.Vj(b) && (c = !0);
c = a.Vz(b, function (a) {
return a.U
}, function (a) {
return a instanceof A
}, !0, function (a) {
return a instanceof A
}, c);
if (0 !== c.count)for (c = c.l; c.next();) {
var d = c.value;
d.Qi && d.$b()
}
}
function ha(a, b, c) {
null === a.Nd && (a.Nd = new kj);
c = null !== c ? c.fb : null;
if (a.Nd.$o || a.Nd.group !== c) {
if (null === c) {
b = a.pj ? fi(a) : a.vc.copy();
b.Ug(100, 100);
a.Nd.initialize(b);
b = t.xf();
for (var d = a.Xi; d.next();) {
var e = d.value, g = e.layer;
null !== g && g.visible && !g.pc && lj(a, e, null, b)
}
} else for (b = c.ya.copy(), b.Ug(20, 20), a.Nd.initialize(b), b = t.xf(), d = c.Hc; d.next();)e = d.value, e instanceof y && lj(a, e, null, b);
t.Qc(b);
a.Nd.group = c;
a.Nd.$o = !1
} else b && mj(a.Nd);
return a.Nd
}
function lj(a, b, c, d) {
if (b !== c)if (b.canAvoid()) {
c = b.getAvoidableRect(d);
d = a.Nd.Bm;
b = a.Nd.Am;
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)nj(a.Nd, h, k);
nj(a.Nd, h, g)
}
for (k = c.y; k < g; k += b)nj(a.Nd, e, k);
nj(a.Nd, e, g)
} else if (b instanceof z)for (b = b.Hc; b.next();)e = b.value, e instanceof y && lj(a, e, c, d)
}
function qj(a, b) {
null === a.Nd || a.Nd.$o || null !== b && !b.canAvoid() || (a.Nd.$o = !0)
}
u.prototype.simulatedMouseMove = u.prototype.CF = function (a, b, c) {
if (null !== hf) {
c instanceof u || (c = null);
var d = jf, e = hf.h;
jf = c;
if (c !== d) {
if (null !== d && d !== e && null !== d.Eb.ke)return d.Eb.ke.doSimulatedDragLeave(), !1;
null !== c && null !== c.Eb.ke && c.Eb.ke.doSimulatedDragEnter()
}
if (null === c || !c.zz || !c.vm || c.Ya || c === e)return!1;
d = c.Eb.ke;
null !== d && (null !== a && (b = c.Hg(a)), c.cc.W = b, c.cc.$j = !1, c.cc.$i = !1, d.doSimulatedDragOver());
return!0
}
return!1
};
u.prototype.simulatedMouseUp = u.prototype.DF = function (a, b, c, d) {
if (null !== hf) {
null === d && (d = b);
b = jf;
var e = hf.h;
if (d !== b) {
if (null !== b && b !== e && null !== b.Eb.ke)return b.Eb.ke.doSimulatedDragLeave(), !1;
null !== d && null !== d.Eb.ke && d.Eb.ke.doSimulatedDragEnter()
}
jf = d;
if (null === d)return hf.doCancel(), !0;
if (d !== this)return null !== a && (c = d.Hg(a)), d.cc.W = c, d.cc.$j = !1, d.cc.$i = !0, a = d.Eb.ke, null !== a && a.doSimulatedDrop(), a = hf, null !== a && (d = a.mayCopy(), a.bf = d ? "Copy" : "Move", a.stopTool()), !0
}
return!1
};
t.g(u, "autoScrollRegion", u.prototype.kD);
t.defineProperty(u, {kD: "autoScrollRegion"}, function () {
return this.Ut
}, function (a) {
"number" === typeof a ? a = new rb(a) : t.k(a, rb, u, "autoScrollRegion");
var b = this.Ut;
b.N(a) || (this.Ut = a = a.Z(), this.Ac(), this.i("autoScrollRegion", b, a))
});
function Xf(a, b) {
a.Bx = a.gn(b);
Cj(a, a.Bx).Mi(a.position) ? wf(a) : Dj(a)
}
function Dj(a) {
if (null === a.eh) {
a.eh = {};
var b;
b = a.Ta !== a.Eb.ke ? a.uG : a.vG;
a.eh.isEnabled = !0;
var c = setInterval(function () {
var b = c;
null !== a.eh && a.eh.isEnabled && (a.eh = null, clearInterval(b), b = Cj(a, a.Bx), b.Mi(a.position) || (a.position = b, a.T.W = a.VF(a.Bx), a.Ta.doMouseMove(), a.pj = !0, ji(a, a.kf()), a.Je = !0, a.Vi(), Dj(a)))
}, b);
a.eh.id = c
}
}
function wf(a) {
null !== a.eh && (a.eh.isEnabled && clearInterval(a.eh.id), a.eh = null)
}
function Cj(a, b) {
var c = a.position, d = a.kD;
if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom)return c;
var e = a.nb, g = a.scale, e = t.kk(0, 0, e.width * g, e.height * g), h = t.ic(0, 0);
if (b.x >= e.x && b.x < e.x + d.left) {
var k = Math.max(a.Dp, 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.Dp, 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.Ep, 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.Ep, 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.Mi(J.nk) || (c = new C(c.x + h.x / g, c.y + h.y / g));
t.Qc(e);
t.B(h);
return c
}
u.prototype.makeSVG = function (a) {
void 0 === a && (a = {});
a.context = "svg";
a = Ej(this, a);
return null !== a ? a.At : null
};
u.prototype.makeImage = function (a) {
var b = document.createElement("img");
b.src = this.CI(a);
return b instanceof HTMLImageElement ? b : null
};
u.prototype.makeImageData = u.prototype.CI = function (a) {
void 0 === a && (a = {});
var b = Ej(this, a);
return null !== b ? b.toDataURL(a.type, a.details) : ""
};
function Ej(a, b) {
a.Vi();
if (null === a.Pa)return null;
"object" !== typeof b && t.m("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 || new oa(2E3, 2E3);
void 0 === b.maxSize && (c = !0);
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.showTemporary;
void 0 === p && (p = !n);
n = b.showGrid;
void 0 === n && (n = p);
null !== d && isNaN(d.width) && isNaN(d.height) &&
(d = null);
l && "number" === typeof l && (l = new rb(l));
l || (l = new rb(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.En = !1;
$h(a);
var q = document.createElement("canvas"), r = q.getContext("2d"), s = q;
if (!(d || e || k || h))return q.width = a.Pa.width + Math.ceil(l.left + l.right), q.height = a.Pa.height + Math.ceil(l.top + l.bottom), "svg" === b.context && (r = s = new Ac(q), r instanceof Ac && (a.En = !0)), Fi(a, r, l, new oa(q.width, q.height), a.Sb, a.rb, k, m, p, n), a.En = !0, s;
var v, x = new C(0,
0);
v = a.vc.copy();
v.hJ(a.padding);
null !== h && h.Q() ? (x = h, e || (e = 1)) : (x.x = v.x, x.y = v.y);
if (k) {
var E, h = !0, k = k.l;
for (k.reset(); k.next();) {
var F = k.value;
if (F instanceof w) {
var G = F.layer;
G && !G.visible || G && G.pc || !F.zb() || (F = F.ya, F.Q() && (h ? (h = !1, E = F.copy()) : E.mk(F)))
}
}
h && (E = new D(0, 0, 0, 0));
v.width = E.width;
v.height = E.height;
x.x = E.x;
x.y = E.y
}
h = E = 0;
l && (E = l.left + l.right, h = l.top + l.bottom);
F = G = 0;
d && (G = d.width, F = d.height, isFinite(G) && (G = Math.max(0, G - E)), isFinite(F) && (F = Math.max(0, F - h)));
d && e ? ("NaN" === e && (e = 1), d.Q() ?
(d = G, v = F) : isNaN(F) ? (d = G, v = v.height * e) : (d = v.width * e, v = F)) : d ? d.Q() ? (e = Math.min(G / v.width, F / v.height), d = G, v = F) : isNaN(F) ? (e = G / v.width, d = G, v = v.height * e) : (e = F / v.height, d = v.width * e, v = F) : e ? "NaN" === e && g.Q() ? (e = Math.min((g.width - E) / v.width, (g.height - h) / v.height), 1 < e ? (e = 1, d = v.width, v = v.height) : (d = g.width, v = g.height)) : (d = v.width * e, v = v.height * e) : (e = 1, d = v.width, v = v.height);
l ? (d += E, v += h) : l = new rb(0);
g && (E = g.width, g = g.height, "svg" !== b.context && c && !t.dG && (d > E || v > g) && (t.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" +
Math.ceil(d) + "x" + Math.ceil(v) + " vs 2000x2000) Consider increasing the max size."), t.dG = !0), isNaN(E) && (E = 2E3), isNaN(g) && (g = 2E3), isFinite(E) && (d = Math.min(d, E)), isFinite(g) && (v = Math.min(v, g)));
q.width = Math.ceil(d);
q.height = Math.ceil(v);
"svg" === b.context && (r = s = new Ac(q), r instanceof Ac && (a.En = !0));
Fi(a, r, l, new oa(Math.ceil(d), Math.ceil(v)), e, x, k, m, p, n);
a.En = !0;
return s
}
u.inherit = function (a, b) {
t.j(a, "function", u, "inherit");
t.j(b, "function", u, "inherit");
b.FG && t.m("Cannot inherit from " + t.Tg(b));
t.Oa(a, b)
};
function Fj(a) {
1 < arguments.length && t.m("Palette constructor can only take one optional argument, the DIV HTML element or its id.");
u.call(this, a);
this.Gv = !0;
this.$k = !1;
this.Ya = !0;
this.Rv = Sb;
this.Tb = new Gj
}
t.ia("Palette", Fj);
t.Oa(Fj, u);
function Ii(a) {
1 < arguments.length && t.m("Overview constructor can only take one optional argument, the DIV HTML element or its id.");
u.call(this, a);
this.lc = !0;
this.pi = null;
this.ku = !0;
var b = new w, c = new Y;
c.stroke = "magenta";
c.ib = 2;
c.fill = null;
c.name = "BOXSHAPE";
b.ut = "BOXSHAPE";
b.Zs = "BOXSHAPE";
b.add(c);
this.pn = b;
this.hz = document.createElement("canvas");
this.HG = this.hz.getContext("2d");
b = new Hj;
b.He(this);
this.Eb.tf.Rd(0, b);
var d = this;
this.$E = function () {
Ij(d)
};
this.ZE = function () {
null !== d.pi && (d.Ac(), d.ua())
};
this.Ya = !0;
this.Ne = !1;
this.zm = qi;
this.Eb.Xm = cf;
this.lc = !1
}
t.ia("Overview", Ii);
t.Oa(Ii, u);
function Ji(a) {
a.lc || a.Jd || !1 !== a.ig || (a.ig = !0, requestAnimationFrame(function () {
if (a.ig && !a.Jd && (a.ig = !1, null !== a.Ab)) {
a.Jd = !0;
ei(a);
a.vc.Q() || ji(a, a.kf());
null === a.Ab && t.m("No div specified");
null === a.Pa && t.m("No canvas specified");
if (a.Je && null !== a.pi) {
var b = a.Uf, c = a.hz;
b.setTransform(1, 0, 0, 1, 0, 0);
b.clearRect(0, 0, a.Pa.width, a.Pa.height);
b.drawImage(c, 0, 0);
c = a.ad;
c.reset();
1 !== a.Sb && c.scale(a.scale);
0 === a.position.x && 0 === a.position.y || c.translate(-a.rb.x, -a.rb.y);
b.setTransform(c.m11, c.m12, c.m21,
c.m22, c.dx, c.dy);
for (var c = a.Bb.length, d = 0; d < c; d++)a.Bb.p[d].Se(b, a);
a.Kk = !1;
a.Je = !1
}
a.Jd = !1
}
}))
}
Ii.prototype.Se = function () {
null === this.Ab && t.m("No div specified");
null === this.Pa && t.m("No canvas specified");
if (this.Je) {
var a = this.pi;
if (null !== a) {
var b = a.Yo;
(b && b.visible && isNaN(b.width) || isNaN(b.height)) && vi(a);
var c = this.Pa, b = this.Uf, d = this.hz, e = this.HG;
d.width = c.width;
d.height = c.height;
b.It = "";
b.setTransform(1, 0, 0, 1, 0, 0);
b.clearRect(0, 0, this.Pa.width, this.Pa.height);
var g = this.ad;
g.reset();
1 !== this.Sb && g.scale(this.scale);
0 === this.position.x && 0 === this.position.y || g.translate(-this.rb.x, -this.rb.y);
b.setTransform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
for (var h = this.ku, k = this.nb, l = a.Bb.length, m = 0; m < l; m++) {
var n = a.Bb.p[m], p = b, q = k, r = h;
void 0 === r && (r = !0);
if (r || !n.pc)for (var n = n.cb, r = this.scale, s = n.length, v = 0; v < s; v++) {
var x = n.p[v], E = x.ya;
E.Jf(q) && (1 < E.width * r || 1 < E.height * r ? x.Se(p, this) : Ih(x, p))
}
}
e.drawImage(c, 0, 0);
f && f.al && (e.fillStyle = "red", e.fillRect(0, d.height / 2, d.width, 4));
a = this.Bb.length;
for (m = 0; m < a; m++)this.Bb.p[m].Se(b, this);
f && (f.Tz || f.al) && f.Sz(b, this, g);
this.Je = this.Kk = !1
}
}
};
t.g(Ii, "observed", Ii.prototype.KI);
t.defineProperty(Ii, {KI: "observed"}, function () {
return this.pi
}, function (a) {
var b = this.pi;
null !== a && t.k(a, u, Ii, "observed");
b === a || a instanceof Ii || (null !== b && (this.remove(this.lg), b.eF("ViewportBoundsChanged", this.$E), b.eF("DocumentBoundsChanged", this.ZE), b.fo.remove(this)), this.pi = a, null !== a && (a.yz("ViewportBoundsChanged", this.$E), a.yz("DocumentBoundsChanged", this.ZE), a.fo.add(this), this.add(this.lg), Ij(this)), this.Ac(), this.i("observed", b, a))
});
t.g(Ii, "box", Ii.prototype.lg);
t.defineProperty(Ii, {lg: "box"}, function () {
return this.pn
}, function (a) {
var b = this.pn;
b !== a && (this.pn = a, this.i("box", b, a))
});
t.g(Ii, "drawsTemporaryLayers", Ii.prototype.RH);
t.defineProperty(Ii, {RH: "drawsTemporaryLayers"}, function () {
return this.ku
}, function (a) {
this.ku !== a && (this.ku = a, this.LA())
});
function Ij(a) {
var b = a.lg;
if (null !== b) {
var c = a.pi;
if (null !== c) {
a.Je = !0;
var c = c.nb, d = b.an, e = t.xl();
e.q(c.width, c.height);
d.Ca = e;
t.ck(e);
a = 2 / a.scale;
d instanceof Y && (d.ib = a);
b.location = new C(c.x - a / 2, c.y - a / 2)
}
}
}
Ii.prototype.kf = function () {
var a = this.pi;
return null === a ? J.sG : a.vc
};
Ii.prototype.kt = function (a) {
this.lc || (ci(this), this.ua(), ti(this), this.Ac(), Ij(this), this.Ja("ViewportBoundsChanged", a))
};
function Hj() {
ke.call(this);
this.name = "MoveBox"
}
t.Oa(Hj, ke);
Hj.prototype.doStart = function () {
this.qa = this.h.zd = !0
};
Hj.prototype.doMouseMove = function () {
if (this.qa) {
var a = this.h;
if (null !== a && null !== a.pi) {
var b = a.pi, c = b.nb, d = a.T.W;
b.position = new C(d.x - c.width / 2, d.y - c.height / 2);
a.Of()
}
}
};
Hj.prototype.doMouseUp = function () {
this.qa && this.doMouseMove();
this.stopTool()
};
Hj.prototype.doStop = function () {
this.qa = !1;
var a = this.h;
a.zd = !1;
Ij(a)
};
function Td(a) {
1 < arguments.length && t.m("Brush constructor can take at most one optional argument, the Brush type.");
t.zc(this);
this.jb = !1;
void 0 === a ? (this.ba = ge, this.tn = "black") : "string" === typeof a ? (this.ba = ge, this.tn = a) : (f && t.tb(a, Td, Td, "constructor:type"), this.ba = a, this.tn = "black");
var b = this.ba;
b === he ? (this.mo = Sb, this.Gn = Wb) : this.Gn = b === ie ? this.mo = Ub : this.mo = Kb;
this.nv = 0;
this.lu = NaN;
this.Eg = this.Zu = this.Dg = null;
this.Hx = this.Ix = 0
}
t.ia("Brush", Td);
var ge;
Td.Solid = ge = t.w(Td, "Solid", 0);
var he;
Td.Linear = he = t.w(Td, "Linear", 1);
var ie;
Td.Radial = ie = t.w(Td, "Radial", 2);
var Jj;
Td.Pattern = Jj = t.w(Td, "Pattern", 2);
Td.prototype.copy = function () {
var a = new Td;
a.ba = this.ba;
a.tn = this.tn;
a.mo = this.mo;
a.Gn = this.Gn;
a.nv = this.nv;
a.lu = this.lu;
null !== this.Dg && (a.Dg = this.Dg.copy());
a.Zu = this.Zu;
return a
};
Td.prototype.Na = function () {
this.freeze();
Object.freeze(this);
return this
};
Td.prototype.freeze = function () {
this.jb = !0;
null !== this.Dg && this.Dg.freeze();
return this
};
Td.prototype.Va = function () {
Object.isFrozen(this) && t.m("cannot thaw constant: " + this);
this.jb = !1;
null !== this.Dg && this.Dg.Va();
return this
};
Td.prototype.toString = function () {
var a = "Brush(";
if (this.type === ge)a += this.color; else if (a = this.type === he ? a + "Linear " : this.type === ie ? a + "Radial " : this.type === Jj ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.Go)for (var b = this.Go.l; b.next();)a += " " + b.key + ":" + b.value;
return a + ")"
};
Td.prototype.addColorStop = Td.prototype.addColorStop = function (a, b) {
t.J(this);
("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && t.ha(a, "0 <= loc <= 1", Td, "addColorStop:loc");
t.j(b, "string", Td, "addColorStop:color");
null === this.Dg && (this.Dg = new ra("number", "string"));
this.Dg.add(a, b);
this.ba === ge && (this.type = he);
this.Eg = null
};
t.g(Td, "type", Td.prototype.type);
t.defineProperty(Td, {type: "type"}, function () {
return this.ba
}, function (a) {
t.J(this, a);
t.tb(a, Td, Td, "type");
this.ba = a;
this.start.pd() && (a === he ? this.start = Sb : a === ie && (this.start = Ub));
this.end.pd() && (a === he ? this.end = Wb : a === ie && (this.end = Ub));
this.Eg = null
});
t.g(Td, "color", Td.prototype.color);
t.defineProperty(Td, {color: "color"}, function () {
return this.tn
}, function (a) {
t.J(this, a);
t.j(a, "string", Td, "color");
this.tn = a;
this.Eg = null
});
t.g(Td, "start", Td.prototype.start);
t.defineProperty(Td, {start: "start"}, function () {
return this.mo
}, function (a) {
t.J(this, a);
a instanceof K || t.Vb(a, "Spot", Td, "start");
this.mo = a.Z();
this.Eg = null
});
t.g(Td, "end", Td.prototype.end);
t.defineProperty(Td, {end: "end"}, function () {
return this.Gn
}, function (a) {
t.J(this, a);
a instanceof K || t.Vb(a, "Spot", Td, "end");
this.Gn = a.Z();
this.Eg = null
});
t.g(Td, "startRadius", Td.prototype.Jp);
t.defineProperty(Td, {Jp: "startRadius"}, function () {
return this.nv
}, function (a) {
t.J(this, a);
t.o(a, Td, "startRadius");
0 > a && t.ha(a, ">= zero", Td, "startRadius");
this.nv = a;
this.Eg = null
});
t.g(Td, "endRadius", Td.prototype.Mo);
t.defineProperty(Td, {Mo: "endRadius"}, function () {
return this.lu
}, function (a) {
t.J(this, a);
t.o(a, Td, "endRadius");
0 > a && t.ha(a, ">= zero", Td, "endRadius");
this.lu = a;
this.Eg = null
});
t.g(Td, "colorStops", Td.prototype.Go);
t.defineProperty(Td, {Go: "colorStops"}, function () {
return this.Dg
}, function (a) {
t.J(this, a);
f && t.k(a, ra, Td, "colorStops");
this.Dg = a;
this.Eg = null
});
t.g(Td, "pattern", Td.prototype.pattern);
t.defineProperty(Td, {pattern: "pattern"}, function () {
return this.Zu
}, function (a) {
t.J(this, a);
this.Zu = a;
this.Eg = null
});
Td.randomColor = function (a, b) {
void 0 === a && (a = 128);
f && (t.o(a, Td, "randomColor:min"), (0 > a || 255 < a) && t.ha(a, "0 <= min <= 255", Td, "randomColor:min"));
void 0 === b && (b = Math.max(a, 255));
f && (t.o(b, Td, "randomColor:max"), (b < a || 255 < b) && t.ha(b, "min <= max <= 255", Td, "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
};
function X() {
t.zc(this);
this.ka = 30723;
this.ri = null;
this.Rb = "";
this.jc = this.Hb = null;
this.rb = (new C(NaN, NaN)).freeze();
this.df = (new oa(NaN, NaN)).freeze();
this.ce = J.kn;
this.yj = J.rG;
this.ad = new pa;
this.Wh = new pa;
this.Nk = new pa;
this.Sb = 1;
this.on = 0;
this.zh = Wg;
this.fr = J.Up;
this.Kc = (new D(NaN, NaN, NaN, NaN)).freeze();
this.Gb = (new D(NaN, NaN, NaN, NaN)).freeze();
this.Lc = (new D(0, 0, NaN, NaN)).freeze();
this.gs = this.Cq = this.V = this.Ar = this.ee = null;
this.hs = this.Dq = Infinity;
this.aq = this.qe = Pb;
this.Lr = 0;
this.Fj = 1;
this.hq =
0;
this.fj = 1;
this.Pr = -Infinity;
this.Nr = 0;
this.Qr = J.nk;
this.Rr = Hg;
this.oq = "";
this.fm = this.Zh = this.Il = this.Cc = this.R = null
}
t.ia("GraphObject", X);
t.Eh(X);
X.prototype.cloneProtected = function (a) {
a.ka = this.ka | 6144;
a.Rb = this.Rb;
a.Hb = this.Hb;
a.jc = this.jc;
a.rb.assign(this.rb);
a.df.assign(this.df);
a.ce = this.ce.Z();
a.yj = this.yj.Z();
a.Nk = this.Nk.copy();
a.Sb = this.Sb;
a.on = this.on;
a.zh = this.zh;
a.fr = this.fr.Z();
a.Kc.assign(this.Kc);
a.Gb.assign(this.Gb);
a.Lc.assign(this.Lc);
a.Ar = this.Ar;
a.qe = this.qe.Z();
a.aq = this.aq.Z();
a.Lr = this.Lr;
a.Fj = this.Fj;
a.hq = this.hq;
a.fj = this.fj;
a.Pr = this.Pr;
a.Nr = this.Nr;
a.Qr = this.Qr.Z();
a.Rr = this.Rr;
a.oq = this.oq;
if (null !== this.R) {
var b =
this.R;
a.R = {Yh: b.Yh, di: b.di, $h: b.$h, qr: b.qr, rr: b.rr, ni: b.ni, mi: b.mi, li: b.li, or: b.or, pr: b.pr, ki: b.ki, Wp: b.Wp, Xp: b.Xp, Yp: b.Yp, Vp: b.Vp, xi: b.xi, ai: b.ai}
}
null !== this.V && (b = this.V, a.V = {mj: b.mj.Z(), Oj: b.Oj.Z(), kj: b.kj, Mj: b.Mj, jj: b.jj, Lj: b.Lj, lj: b.lj, Nj: b.Nj});
a.Cq = this.Cq;
a.Dq = this.Dq;
a.gs = this.gs;
a.hs = this.hs;
a.Cc = this.Cc;
if (Array.isArray(this.Il))for (a.Il = this.Il.slice(0), b = 0; b < this.Il.length; b++) {
var c = this.Il[b];
a[c] = this[c]
}
null !== this.Zh && (a.Zh = this.Zh.copy())
};
X.prototype.Fh = function (a) {
a.ee = null;
a.fm = null;
a.aa()
};
X.prototype.copy = function () {
var a = new this.constructor;
this.cloneProtected(a);
return a
};
X.prototype.toString = function () {
return t.Tg(Object.getPrototypeOf(this)) + "#" + t.oc(this)
};
var Vg;
X.None = Vg = t.w(X, "None", 0);
var Wg;
X.Default = Wg = t.w(X, "Default", 0);
var Kj;
X.Vertical = Kj = t.w(X, "Vertical", 4);
var Lj;
X.Horizontal = Lj = t.w(X, "Horizontal", 5);
var Mc;
X.Fill = Mc = t.w(X, "Fill", 3);
var Xg;
X.Uniform = Xg = t.w(X, "Uniform", 1);
var Yg;
X.UniformToFill = Yg = t.w(X, "UniformToFill", 2);
function Mj(a) {
a.R = {Yh: null, di: null, $h: null, qr: null, rr: null, ni: null, mi: null, li: null, or: null, pr: null, ki: null, Wp: null, Xp: null, Yp: null, Vp: null, xi: null, ai: null}
}
aa = X.prototype;
aa.Fe = function () {
this.V = {mj: Kb, Oj: Kb, kj: 10, Mj: 10, jj: Nj, Lj: Nj, lj: 0, Nj: 0}
};
function Oj(a, b, c, d, e, g, h) {
var k = 0.001, l = g.length;
a.moveTo(b, c);
d -= b;
k = e - c;
0 === d && (d = 0.001);
e = k / d;
for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; 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
}
}
aa.fd = function (a, b, c, d, e, g, h) {
var k = this.U;
null !== k && (k.Zm(a, b, c, d, e, g, h), 0 !== (this.ka & 1024) && c === this && a === Bd && Pj(this, k, b))
};
function Pj(a, b, c) {
var d = a.Ro();
if (null !== d)for (var e = a.Cc.l; e.next();) {
var g = e.value, h = d.data, k = g.yt;
null !== k && (h = d.le(k));
if (null !== h && (g.$F(a, h, c, null !== k ? null : b.h), null !== k && (h = d, "" !== k && (h = d.le(k)), null !== h))) {
var k = g.en, l = d;
"" !== k && (l = d.le(k));
null !== l && g.aG(l, h, c)
}
}
}
aa.i = function (a, b, c) {
this.fd(Bd, a, this, b, c)
};
function Qj(a, b, c, d, e) {
var g = a.Kc, h = a.Nk;
h.reset();
Rj(a, h, b, c, d, e);
a.Nk = h;
g.x = b;
g.y = c;
g.width = d;
g.height = e;
h.Ts() || h.UF(g)
}
function Sj(a, b, c, d) {
if (!1 === a.Ze)return!1;
d.multiply(a.transform);
return c ? a.Jf(b, d) : a.Em(b, d)
}
aa.XD = function (a, b, c) {
if (!1 === this.Ze)return!1;
var d = this.Ia;
b = a.Zj(b);
var e = !1;
c && (e = ab(a.x, a.y, 0, 0, 0, d.height) < b || ab(a.x, a.y, 0, d.height, d.width, d.height) < b || ab(a.x, a.y, d.width, d.height, d.width, 0) < b || ab(a.x, a.y, d.width, 0, 0, 0) < b);
c || (e = ab(a.x, a.y, 0, 0, 0, d.height) < b && ab(a.x, a.y, 0, d.height, d.width, d.height) < b && ab(a.x, a.y, d.width, d.height, d.width, 0) < b && ab(a.x, a.y, d.width, 0, 0, 0) < b);
return e
};
aa.bh = function () {
return!0
};
X.prototype.containsPoint = X.prototype.Ha = function (a) {
f && t.k(a, C, X, "containsPoint:p");
var b = t.O();
b.assign(a);
this.transform.Wa(b);
var c = this.ya;
if (!c.Q())return!1;
if (t.gB) {
var d = this.Ia, e = this.ek() * (null !== this.h ? this.h.scale : 1), g = 1 / e;
if (10 > d.width * e && 10 > d.height * e)return a = yb(c.x - 5 * g, c.y - 5 * g, c.width + 10 * g, c.height + 10 * g, b.x, b.y), t.B(b), a
}
if (void 0 !== this.Oc || this instanceof Y ? yb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Ha(b)) {
if (this.Zh && !this.Zh.Ha(b))return!1;
if (null !== this.jc && c.Ha(b) || null !==
this.Hb && this.Lc.Ha(a))return!0;
t.B(b);
return this.Uj(a)
}
t.B(b);
return!1
};
X.prototype.Uj = function (a) {
var b = this.Ia;
return yb(0, 0, b.width, b.height, a.x, a.y)
};
X.prototype.containsRect = X.prototype.Vj = function (a) {
f && t.k(a, D, X, "containsRect:r");
if (0 === this.angle)return this.ya.Vj(a);
var b = this.Ia, b = t.kk(0, 0, b.width, b.height), c = this.transform, d = !1, e = t.ic(a.x, a.y);
b.Ha(c.Pi(e)) && (e.q(a.x, a.bottom), b.Ha(c.Pi(e)) && (e.q(a.right, a.bottom), b.Ha(c.Pi(e)) && (e.q(a.right, a.y), b.Ha(c.Pi(e)) && (d = !0))));
t.B(e);
t.Qc(b);
return d
};
X.prototype.containedInRect = X.prototype.Em = function (a, b) {
f && t.k(a, D, X, "containedInRect:r");
if (void 0 === b)return a.Vj(this.ya);
var c = this.Ia, d = !1, e = t.ic(0, 0);
a.Ha(b.Wa(e)) && (e.q(0, c.height), a.Ha(b.Wa(e)) && (e.q(c.width, c.height), a.Ha(b.Wa(e)) && (e.q(c.width, 0), a.Ha(b.Wa(e)) && (d = !0))));
return d
};
X.prototype.intersectsRect = X.prototype.Jf = function (a, b) {
f && t.k(a, D, X, "intersectsRect:r");
if (void 0 === b && (b = this.transform, 0 === this.angle))return a.Jf(this.ya);
var c = this.Ia, d = b, e = t.ic(0, 0), g = t.ic(0, c.height), h = t.ic(c.width, c.height), k = t.ic(c.width, 0), l = !1;
if (a.Ha(d.Wa(e)) || a.Ha(d.Wa(g)) || a.Ha(d.Wa(h)) || a.Ha(d.Wa(k)))l = !0; else {
var c = t.kk(0, 0, c.width, c.height), m = t.ic(a.x, a.y);
c.Ha(d.Pi(m)) ? l = !0 : (m.q(a.x, a.bottom), c.Ha(d.Pi(m)) ? l = !0 : (m.q(a.right, a.bottom), c.Ha(d.Pi(m)) ? l = !0 : (m.q(a.right, a.y), c.Ha(d.Pi(m)) &&
(l = !0))));
t.B(m);
t.Qc(c);
!l && (J.lw(a, e, g) || J.lw(a, g, h) || J.lw(a, h, k) || J.lw(a, k, e)) && (l = !0)
}
t.B(e);
t.B(g);
t.B(h);
t.B(k);
return l
};
X.prototype.getDocumentPoint = X.prototype.gb = function (a, b) {
void 0 === b && (b = new C);
a.pd() && t.m("Spot must be real");
var c = this.Ia;
b.q(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY);
this.he.Wa(b);
return b
};
X.prototype.getDocumentAngle = X.prototype.jl = function () {
var a = this.he, a = 180 / Math.PI * Math.atan2(a.m12, a.m11);
0 > a && (a += 360);
return a
};
X.prototype.getDocumentScale = X.prototype.ek = function () {
var a = this.Sb;
return null !== this.ga ? a * this.ga.ek() : a
};
X.prototype.getLocalPoint = X.prototype.gE = function (a, b) {
void 0 === b && (b = new C);
b.assign(a);
this.he.Pi(b);
return b
};
X.prototype.getNearestIntersectionPoint = X.prototype.Wo = function (a, b, c) {
return this.Ls(a.x, a.y, b.x, b.y, c)
};
aa = X.prototype;
aa.Ls = 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.Bi)return g = this.ya, J.Wo(g.left, g.top, g.right, g.bottom, a, b, c, d, e);
if (!(this instanceof B) || this instanceof B && null !== this.background)return h = a * k + b * m + p, a = a * l + b * n + q, k = c * k + d * m + p, c = c * l + d * n + q, e.q(0, 0), d = this.Ia, c = J.Wo(0, 0, d.width, d.height, h, a, k, c, e), e.transform(g), c;
if (this instanceof B && (null === this.Bi || void 0 ===
this.Bi)) {
h = a * k + b * m + p;
a = a * l + b * n + q;
k = c * k + d * m + p;
d = c * l + d * n + q;
e.q(k, d);
l = (k - h) * (k - h) + (d - a) * (d - a);
c = !1;
n = this.za.p;
q = n.length;
m = t.O();
for (p = 0; p < q; p++)b = n[p], b.visible && b.Ls(h, a, k, d, m) && (c = !0, b = (h - m.x) * (h - m.x) + (a - m.y) * (a - m.y), b < l && (l = b, e.set(m)));
t.B(m);
e.transform(g);
return c
}
t.m("Unknown GraphObject case");
return!1
};
function Ch(a, b, c, d, e) {
if (!1 !== Ai(a)) {
var g = a.margin, h = g.top + g.bottom;
b = Math.max(b - (g.right + g.left), 0);
c = Math.max(c - h, 0);
g = a.Ca;
h = 0;
a.ib && (h = a.ib);
b = isFinite(g.width) ? g.width + h : b;
c = isFinite(g.height) ? g.height + h : c;
var g = d || 0, h = e || 0, k = a instanceof B;
switch (Tj(a)) {
case Vg:
h = g = 0;
k && (c = b = Infinity);
break;
case Mc:
isFinite(b) && b > d && (g = b);
isFinite(c) && c > e && (h = c);
break;
case Lj:
isFinite(b) && b > d && (g = b);
h = 0;
k && (c = Infinity);
break;
case Kj:
isFinite(c) && c > e && (h = c), g = 0, k && (b = Infinity)
}
var k = a.Ge, l = a.Ye;
g > k.width &&
l.width < k.width && (g = k.width);
h > k.height && l.height < k.height && (h = k.height);
d = Math.max(g / a.scale, l.width);
e = Math.max(h / a.scale, l.height);
k.width < d && (d = Math.min(l.width, d));
k.height < e && (e = Math.min(l.height, e));
b = Math.min(k.width, b);
c = Math.min(k.height, c);
b = Math.max(d, b);
c = Math.max(e, c);
g = a.angle;
if (90 === g || 270 === g)g = b, b = c, c = g, g = d, d = e, e = g;
a.Kc.Va();
a.$s(b, c, d, e);
a.Kc.freeze();
a.Kc.Q() || t.m("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Kc.toString());
Uj(a, !1)
}
}
aa.Ec = function (a, b, c, d, e) {
Vj(this);
var g = t.xf();
g.assign(this.Gb);
this.Gb.Va();
if (!1 === Bi(this)) {
var h = this.Gb;
h.x = a;
h.y = b;
h.width = c;
h.height = d
} else this.Tj(a, b, c, d);
this.Gb.freeze();
this.Zh = void 0 === e ? null : e;
c = !1;
void 0 !== e ? c = !0 : this.ga && (e = this.ga.Lc, d = this.Ea, null !== this.Bi && (d = this.Gb), c = b + d.height, d = a + d.width, c = !(0 <= a && d <= e.width && 0 <= b && c <= e.height), this instanceof ua && (a = this.Lc, this.Fu > a.height || this.Yn.Ui > a.width)) && (c = !0);
this.ka = c ? this.ka | 256 : this.ka & -257;
this.Gb.Q() || t.m("Non-real actualBounds has been set. Object " +
this + ", actualBounds: " + this.Gb.toString());
Wj(this, g, this.Gb);
t.Qc(g)
};
aa.Tj = function () {
};
function Xj(a, b, c, d, e) {
var g = a.ya;
g.x = b;
g.y = c;
g.width = d;
g.height = e;
if (!a.Ca.Q()) {
g = a.Kc;
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 = Tj(a);
c === d && g === e && (b = Vg);
switch (b) {
case Vg:
if (c > d || g > e)Uj(a, !0), Ch(a, c > d ? d : c, g > e ? e : g);
break;
case Mc:
Uj(a, !0);
Ch(a, d, e, 0, 0);
break;
case Lj:
Uj(a, !0);
Ch(a, d, g, 0, 0);
break;
case Kj:
Uj(a, !0), Ch(a, c, e, 0, 0)
}
}
}
function Wj(a, b, c) {
Yj(a, !1);
var d = a.U;
if (null !== d) {
var e = d.h;
if (null !== e)if (Zj(d), a instanceof w) {
var g = !1, d = b.Q();
if (!1 === e.pj) {
var h = e.vc, k = e.padding, l = h.x + k.left, m = h.y + k.top, n = h.width - 2 * k.right, h = h.height - 2 * k.bottom;
d && b.x > l && b.y > m && b.right < n && b.bottom < h && c.x > l && c.y > m && c.right < n && c.bottom < h && (g = !0)
}
0 !== (a.ca & 65536) !== !0 && b.N(c) || Oi(a, g, e);
e.Ty && null !== e.hj ? (g = null, d && (g = t.xf(), Kh(a, b, g)), e.ua(c.Q() ? Kh(a, c) : null, g), null !== g && t.Qc(g)) : e.ua()
} else ak(a, d), a.ua(), b = a.U, null !== b && (b.an !== a && b.kF !==
a && b.oF !== a || bk(b, !0))
}
}
function ak(a, b) {
null !== a.rd && bk(b, !0);
if (a instanceof B)for (var c = a.za, d = c.length, e = 0; e < d; e++)ak(c.p[e], b)
}
aa.Se = function (a, b) {
if (this.visible)if (a instanceof Ac)a:{
if (this.visible)if (this instanceof B && (this.type === ck || this.type === dk))ek(this, a, b); else {
var c = this.Gb;
if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) {
var d = this.transform, e = this.ga, g = this.Wh;
g.reset();
null !== e && (e.bh() ? g.multiply(e.he) : null !== e.ga && g.multiply(e.ga.he));
g.multiply(this.ad);
var g = 0 !== (this.ka & 256), h = !1;
this instanceof ua && fk(this, a);
if (g) {
h = e.bh() ? e.Ia : e.ya;
if (this.Zh)var k = this.Zh, l = k.x, m = k.y, n = k.width, k = k.height; else l =
Math.max(c.x, h.x), m = Math.max(c.y, h.y), n = Math.min(c.right, h.right) - l, k = Math.min(c.bottom, h.bottom) - m;
if (l > c.width + c.x || c.x > h.width + h.x || m > c.height + c.y || c.y > h.height + h.y)break a;
h = !0;
Ic(a, 1, 0, 0, 1, 0, 0);
a.save();
a.beginPath();
a.rect(l, m, n, k);
a.clip()
}
l = !1;
if (this instanceof w && (l = !0, !this.zb()))break a;
m = !1;
this.U && (m = this.U.Kh);
a.Ii.Xe = [1, 0, 0, 1, 0, 0];
null !== this.jc && (gk(this, a, this.jc, !0, !0), this.jc instanceof Td && this.jc.type === ie ? (a.beginPath(), a.rect(c.x, c.y, c.width, c.height), hk(a, this.jc, !0)) : a.fillRect(c.x,
c.y, c.width, c.height));
l && this.Kh && (Ic(a, 1, 0, 0, 1, 0, 0), c = this.om, a.shadowOffsetX = c.x, a.shadowOffsetY = c.y, a.shadowColor = this.nm, a.shadowBlur = this.mm / b.scale, a.ab());
this instanceof B ? Ic(a, d.m11, d.m12, d.m21, d.m22, d.dx, d.dy) : a.Ii.Xe = [d.m11, d.m12, d.m21, d.m22, d.dx, d.dy];
if (null !== this.Hb) {
var k = this.Ia, c = d = 0, n = k.width, k = k.height, p = 0;
this instanceof Y && (k = this.Ra.Mb, d = k.x, c = k.y, n = k.width, k = k.height, p = this.fe);
gk(this, a, this.Hb, !0);
this.Hb instanceof Td && this.Hb.type === ie ? (a.beginPath(), a.rect(d - p / 2, c - p /
2, n + p, k + p), hk(a, this.Hb, !0)) : a.fillRect(d - p / 2, c - p / 2, n + p, k + p)
}
if (m && (null !== this.Hb || null !== this.jc || null !== e && 0 !== (e.ka & 512) || null !== e && e.type === Wh && e.dw() !== this)) {
ik(this, !0);
var q = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur];
a.shadowOffsetX = 0;
a.shadowOffsetY = 0;
a.shadowBlur = 0
} else ik(this, !1);
this.hl(a, b);
m && 0 !== (this.ka & 512) === !0 && (a.shadowOffsetX = q[0], a.shadowOffsetY = q[1], a.shadowBlur = q[2]);
l && m && (a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0);
g ? (a.restore(), h && a.og.pop(), $h(b, a)) : this instanceof
B && a.og.pop();
l && m && a.og.pop()
}
}
} else if (this instanceof B && (this.type === ck || this.type === dk))ek(this, a, b); else if (d = this.Gb, 0 !== d.width && 0 !== d.height && !isNaN(d.x) && !isNaN(d.y)) {
!f || !f.al || this instanceof Ue || f.KH(a, this);
q = this.transform;
g = this.ga;
h = this.Wh;
h.reset();
null !== g && (g.bh() ? h.multiply(g.he) : null !== g.ga && h.multiply(g.ga.he));
h.multiply(this.ad);
h = 0 !== (this.ka & 256);
this instanceof ua && fk(this, a);
if (h) {
f && f.UD && t.trace("clip" + this.toString());
c = g.bh() ? g.Ia : g.ya;
this.Zh ? (k = this.Zh, l = k.x, m =
k.y, n = k.width, k = k.height) : (l = Math.max(d.x, c.x), m = Math.max(d.y, c.y), n = Math.min(d.right, c.right) - l, k = Math.min(d.bottom, c.bottom) - m);
if (l > d.width + d.x || d.x > c.width + c.x || m > d.height + d.y || d.y > c.height + c.y)return;
f && f.UD && f.MH(a, l, m, n, k);
a.save();
a.beginPath();
a.rect(l, m, n, k);
a.clip()
}
c = !1;
if (this instanceof w) {
c = !0;
if (!this.zb())return;
this.Kh && (l = this.om, a.shadowOffsetX = l.x * b.scale, a.shadowOffsetY = l.y * b.scale, a.shadowColor = this.nm, a.shadowBlur = this.mm)
}
l = !1;
this.U && (l = this.U.Kh);
null !== this.jc && (gk(this,
a, this.jc, !0, !0), this.jc instanceof Td && this.jc.type === ie ? (a.beginPath(), a.rect(d.x, d.y, d.width, d.height), hk(a, this.jc, !0)) : a.fillRect(d.x, d.y, d.width, d.height));
q.Ts() || a.transform(q.m11, q.m12, q.m21, q.m22, q.dx, q.dy);
null !== this.Hb && (k = this.Ia, m = d = 0, n = k.width, k = k.height, p = 0, this instanceof Y && (k = this.Ra.Mb, d = k.x, m = k.y, n = k.width, k = k.height, p = this.fe), gk(this, a, this.Hb, !0), this.Hb instanceof Td && this.Hb.type === ie ? (a.beginPath(), a.rect(d - p / 2, m - p / 2, n + p, k + p), hk(a, this.Hb, !0)) : a.fillRect(d - p / 2, m - p / 2, n +
p, k + p));
f && f.al && f.LH(a, this);
l && (null !== this.Hb || null !== this.jc || null !== g && 0 !== (g.ka & 512) || null !== g && g.type === Wh && g.dw() !== this) ? (ik(this, !0), e = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0) : ik(this, !1);
this.hl(a, b);
l && 0 !== (this.ka & 512) === !0 && (a.shadowOffsetX = e[0], a.shadowOffsetY = e[1], a.shadowBlur = e[2]);
c && l && (a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0);
h ? (a.restore(), this instanceof B ? $h(b, a, !0) : $h(b, a, !1)) : q.Ts() || (e = 1 / (q.m11 * q.m22 - q.m12 *
q.m21), a.transform(q.m22 * e, -q.m12 * e, -q.m21 * e, q.m11 * e, e * (q.m21 * q.dy - q.m22 * q.dx), e * (q.m12 * q.dx - q.m11 * q.dy)))
}
};
function ek(a, b, c) {
var d = a.Gb;
0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.jc && (gk(a, b, a.jc, !0, !0), a.jc instanceof Td && a.jc.type === ie ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), hk(b, a.jc, !0)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Hb && (gk(a, b, a.Hb, !0), a.Hb instanceof Td && a.Hb.type === ie ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), hk(b, a.Hb, !0)) : b.fillRect(d.x, d.y, d.width, d.height)), a.hl(b, c))
}
aa.hl = function () {
};
function hk(a, b, c) {
if (c)if (a instanceof CanvasRenderingContext2D && b instanceof Td && b.type === ie) {
var d = b.Ix;
b = b.Hx;
b > d ? (a.scale(d / b, 1), a.translate((b - d) / 2, 0), c ? a.fill() : a.stroke(), a.translate(-(b - d) / 2, 0), a.scale(1 / (d / b), 1)) : d > b ? (a.scale(1, b / d), a.translate(0, (d - b) / 2), c ? a.fill() : a.stroke(), a.translate(0, -(d - b) / 2), a.scale(1, 1 / (b / d))) : c ? a.fill() : a.stroke()
} else c ? a.fill() : a.stroke(); else a.stroke()
}
function gk(a, b, c, d, e) {
if (null !== c) {
var g = 1, h = 1;
if ("string" === typeof c)d ? b.Dl !== c && (b.fillStyle = c, b.Dl = c) : b.ln !== c && (b.strokeStyle = c, b.ln = c); else if (c.type === ge)c = c.color, d ? b.Dl !== c && (b.fillStyle = c, b.Dl = c) : b.ln !== c && (b.strokeStyle = c, b.ln = c); else {
var k, h = a.Ia, g = h.width, h = h.height;
if (e)var l = a.ya, g = l.width, h = l.height;
var m = b instanceof CanvasRenderingContext2D;
if (m && (c.Eg && c.type === Jj || c.Ix === g && c.Hx === h))k = c.Eg; else {
var n, p, q = p = 0;
e && (l = a.ya, g = l.width, h = l.height, p = l.x, q = l.y);
c.start instanceof C ? (a =
c.start.x, e = c.start.y) : c.start instanceof K ? (a = c.start.x * g, e = c.start.y * h) : (a = Ub.x * g, e = Ub.y * h);
c.end instanceof C ? (l = c.end.x, n = c.end.y) : c.end instanceof K ? (l = c.end.x * g, n = c.end.y * h) : c.type === he ? (l = Wb.x * g, n = Wb.y * h) : (l = Ub.x * g, n = Ub.y * h);
a += p;
l += p;
e += q;
n += q;
c.type === he ? k = b.createLinearGradient(a, e, l, n) : c.type === ie ? (p = isNaN(c.Mo) ? Math.max(g, h) / 2 : c.Mo, isNaN(c.Jp) ? (k = 0, p = Math.max(g, h) / 2) : k = c.Jp, k = b.createRadialGradient(a, e, k, l, n, p)) : c.type === Jj ? k = b.createPattern(c.pattern, "repeat") : t.Vb(c.type, "Brush type");
if (c.type !== Jj && (p = c.Go))for (p = p.l; p.next();)k.addColorStop(p.key, p.value);
m && (c.Eg = k, c.Ix = g, c.Hx = h)
}
d ? b.Dl !== k && (b.fillStyle = k, b.Dl = k) : b.ln !== k && (b.strokeStyle = k, b.ln = k)
}
}
}
X.prototype.isContainedBy = X.prototype.Ri = function (a) {
if (a instanceof B)a:{
if (this !== a && null !== a)for (var b = this.ga; null !== b;) {
if (b === a) {
a = !0;
break a
}
b = b.ga
}
a = !1
} else a = !1;
return a
};
X.prototype.isVisibleObject = X.prototype.ol = function () {
if (!this.visible)return!1;
var a = this.ga;
return null !== a ? a.ol() : !0
};
function jk(a) {
if (0 !== (a.ka & 2048) === !0) {
var b = a.ad;
b.reset();
if (!a.Gb.Q() || !a.Kc.Q()) {
kk(a, !1);
return
}
b.translate(a.Gb.x, a.Gb.y);
b.translate(-a.Ea.x, -a.Ea.y);
var c = a.Ia;
Rj(a, b, c.x, c.y, c.width, c.height);
kk(a, !1);
lk(a, !0)
}
0 !== (a.ka & 4096) === !0 && (null === a.ga ? (a.Wh.set(a.ad), lk(a, !1)) : null !== a.ga.he && (b = a.Wh, b.reset(), b.multiply(a.ga.Wh), b.multiply(a.ad), lk(a, !1)))
}
function Rj(a, b, c, d, e, g) {
1 !== a.scale && b.scale(a.scale);
if (0 !== a.angle) {
var h = Ub;
a.We && a.We.qd() && (h = a.We);
var k = t.O();
if (a instanceof w && a.Ub !== a)for (c = a.Ub, d = c.Ia, k.wt(d.x, d.y, d.width, d.height, h), c.Nk.Wa(k), k.offset(-c.Ea.x, -c.Ea.y), h = c.ga; null !== h && h !== a;)h.Nk.Wa(k), k.offset(-h.Ea.x, -h.Ea.y), h = h.ga; else k.wt(c, d, e, g, h);
b.rotate(a.angle, k.x, k.y);
t.B(k)
}
}
X.prototype.aa = function (a) {
if (!0 !== Ai(this)) {
Uj(this, !0);
Yj(this, !0);
var b = this.ga;
null !== b ? a || b.aa() : (a = this.h, null !== a && (a.Zf.add(this), this instanceof y && (a.Aa.qb || this.Vg(), null !== this.Tc && mk(this.Tc)), a.Of()));
if (this instanceof B) {
var c = null;
a = this.za;
b = a.length;
this.ba === Wh && (c = nk(this, a, b)) && c.aa(!0);
a = a.p;
for (c = 0; c < b; c++) {
var d = a[c];
!0 !== Ai(d) && (d.Ca.Q() || (d instanceof Ug || d instanceof B || d instanceof ua || Tj(d) !== Vg) && d.aa(!0))
}
}
}
};
function ok(a) {
if (!1 === Ai(a) && (Uj(a, !0), Yj(a, !0), a instanceof B)) {
a = a.za.p;
for (var b = a.length, c = 0; c < b; c++)ok(a[c])
}
}
function mk(a) {
if (!1 === Bi(a)) {
if (null !== a.ga)a.ga.aa(); else {
var b = a.h;
null !== b && (b.Zf.add(a), a instanceof y && a.Vg(), b.Of())
}
Yj(a, !0)
}
}
function Vj(a) {
if (0 !== (a.ka & 2048) === !1 && (kk(a, !0), lk(a, !0), a instanceof B))for (a = a.elements; a.next();)pk(a.value)
}
function pk(a) {
lk(a, !0);
if (a instanceof B)for (a = a.elements; a.next();)pk(a.value)
}
X.prototype.ua = function () {
if (this instanceof w) {
var a = this.h;
null !== a && !Bi(this) && !Ci(this) && this.zb() && this.Gb.Q() && a.ua(Kh(this, this.Gb))
} else null !== this.U && this.U.ua()
};
function Tj(a) {
var b = a.Qh, c = a.ga;
if (c && c.ba === ca)return qk(a, c.ne(a.gc), c.me(a.column));
if (c && c.ba === Wh && c.dw() === a)return Mc;
if (b === Wg) {
if (c) {
c.ba === Tg && null === c.qo && (b = c.za, nk(c, b, b.length));
if (c.qo === a)return Mc;
a = c.Pz;
return a === Wg ? Vg : a
}
return Vg
}
return b
}
function qk(a, b, c) {
var d = a.Qh;
if (d !== Wg)return d;
var e = d = void 0;
switch (b.Qh) {
case Kj:
e = !0;
break;
case Mc:
e = !0
}
switch (c.Qh) {
case Lj:
d = !0;
break;
case Mc:
d = !0
}
a = a.ga.Pz;
d = void 0 !== d || a !== Lj && a !== Mc ? !1 : !0;
e = void 0 !== e || a !== Kj && a !== Mc ? !1 : !0;
return!0 === d && !0 === e ? Mc : !0 === d ? Lj : !0 === e ? Kj : Vg
}
t.g(X, "segmentOrientation", X.prototype.tt);
t.defineProperty(X, {tt: "segmentOrientation"}, function () {
return this.Rr
}, function (a) {
var b = this.Rr;
b !== a && (f && t.tb(a, A, X, "segmentOrientation"), this.Rr = a, this.aa(), this.i("segmentOrientation", b, a))
});
t.g(X, "segmentIndex", X.prototype.uf);
t.defineProperty(X, {uf: "segmentIndex"}, function () {
return this.Pr
}, function (a) {
f && t.j(a, "number", X, "segmentIndex");
a = Math.round(a);
var b = this.Pr;
b !== a && (this.Pr = a, this.aa(), this.i("segmentIndex", b, a))
});
t.g(X, "segmentFraction", X.prototype.st);
t.defineProperty(X, {st: "segmentFraction"}, function () {
return this.Nr
}, function (a) {
f && t.j(a, "number", X, "segmentFraction");
isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1);
var b = this.Nr;
b !== a && (this.Nr = a, this.aa(), this.i("segmentFraction", b, a))
});
t.g(X, "segmentOffset", X.prototype.VA);
t.defineProperty(X, {VA: "segmentOffset"}, function () {
return this.Qr
}, function (a) {
var b = this.Qr;
b.N(a) || (f && t.k(a, C, X, "segmentOffset"), this.Qr = a = a.Z(), this.aa(), this.i("segmentOffset", b, a))
});
t.g(X, "stretch", X.prototype.Qh);
t.defineProperty(X, {Qh: "stretch"}, function () {
return this.zh
}, function (a) {
var b = this.zh;
b !== a && (f && t.tb(a, X, X, "stretch"), this.zh = a, this.aa(), this.i("stretch", b, a))
});
t.g(X, "name", X.prototype.name);
t.defineProperty(X, {name: "name"}, function () {
return this.Rb
}, function (a) {
var b = this.Rb;
b !== a && (f && t.j(a, "string", X, "name"), this.Rb = a, this.U && (this.U.zj = null), this.i("name", b, a))
});
t.g(X, "visible", X.prototype.visible);
t.defineProperty(X, {visible: "visible"}, function () {
return 0 !== (this.ka & 1)
}, function (a) {
var b = 0 !== (this.ka & 1);
b !== a && (f && t.j(a, "boolean", X, "visible"), this.ka ^= 1, this.i("visible", b, a), b = this.ga, null !== b ? b.aa() : this instanceof w && (this.aa(), Zj(this), a ? (this.K(Lh), this.updateAdornments()) : (this.K(Mh), this.ze())), this.ua(), rk(this))
});
t.g(X, "pickable", X.prototype.Ze);
t.defineProperty(X, {Ze: "pickable"}, function () {
return 0 !== (this.ka & 2)
}, function (a) {
var b = 0 !== (this.ka & 2);
b !== a && (f && t.j(a, "boolean", X, "pickable"), this.ka ^= 2, this.i("pickable", b, a))
});
t.g(X, "fromLinkableDuplicates", X.prototype.bE);
t.defineProperty(X, {bE: "fromLinkableDuplicates"}, function () {
return 0 !== (this.ka & 4)
}, function (a) {
var b = 0 !== (this.ka & 4);
b !== a && (f && t.j(a, "boolean", X, "fromLinkableDuplicates"), this.ka ^= 4, this.i("fromLinkableDuplicates", b, a))
});
t.g(X, "fromLinkableSelfNode", X.prototype.cE);
t.defineProperty(X, {cE: "fromLinkableSelfNode"}, function () {
return 0 !== (this.ka & 8)
}, function (a) {
var b = 0 !== (this.ka & 8);
b !== a && (f && t.j(a, "boolean", X, "fromLinkableSelfNode"), this.ka ^= 8, this.i("fromLinkableSelfNode", b, a))
});
t.g(X, "toLinkableDuplicates", X.prototype.MF);
t.defineProperty(X, {MF: "toLinkableDuplicates"}, function () {
return 0 !== (this.ka & 16)
}, function (a) {
var b = 0 !== (this.ka & 16);
b !== a && (f && t.j(a, "boolean", X, "toLinkableDuplicates"), this.ka ^= 16, this.i("toLinkableDuplicates", b, a))
});
t.g(X, "toLinkableSelfNode", X.prototype.NF);
t.defineProperty(X, {NF: "toLinkableSelfNode"}, function () {
return 0 !== (this.ka & 32)
}, function (a) {
var b = 0 !== (this.ka & 32);
b !== a && (f && t.j(a, "boolean", X, "toLinkableSelfNode"), this.ka ^= 32, this.i("toLinkableSelfNode", b, a))
});
t.g(X, "isPanelMain", X.prototype.Ih);
t.defineProperty(X, {Ih: "isPanelMain"}, function () {
return 0 !== (this.ka & 64)
}, function (a) {
var b = 0 !== (this.ka & 64);
b !== a && (f && t.j(a, "boolean", X, "isPanelMain"), this.ka ^= 64, this.aa(), this.i("isPanelMain", b, a))
});
t.g(X, "isActionable", X.prototype.Rs);
t.defineProperty(X, {Rs: "isActionable"}, function () {
return 0 !== (this.ka & 128)
}, function (a) {
var b = 0 !== (this.ka & 128);
b !== a && (f && t.j(a, "boolean", X, "isActionable"), this.ka ^= 128, this.i("isActionable", b, a))
});
t.g(X, "areaBackground", X.prototype.Bi);
t.defineProperty(X, {Bi: "areaBackground"}, function () {
return this.jc
}, function (a) {
var b = this.jc;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.jc = a, this.ua(), this.i("areaBackground", b, a))
});
t.g(X, "background", X.prototype.background);
t.defineProperty(X, {background: "background"}, function () {
return this.Hb
}, function (a) {
var b = this.Hb;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.Hb = a, this.ua(), this.i("background", b, a))
});
function ik(a, b) {
a.ka = b ? a.ka | 512 : a.ka & -513
}
function sk(a, b) {
a.ka = b ? a.ka | 1024 : a.ka & -1025
}
function kk(a, b) {
a.ka = b ? a.ka | 2048 : a.ka & -2049
}
function lk(a, b) {
a.ka = b ? a.ka | 4096 : a.ka & -4097
}
function Ai(a) {
return 0 !== (a.ka & 8192)
}
function Uj(a, b) {
a.ka = b ? a.ka | 8192 : a.ka & -8193
}
function Bi(a) {
return 0 !== (a.ka & 16384)
}
function Yj(a, b) {
a.ka = b ? a.ka | 16384 : a.ka & -16385
}
t.A(X, {U: "part"}, function () {
if (this instanceof w)return this;
if (this.fm)return this.fm;
var a;
for (a = this.ga; a;) {
if (a instanceof w)return this.fm = a;
a = a.ga
}
return null
});
X.prototype.ul = function (a) {
this.ri = a
};
t.A(X, {ga: "panel"}, function () {
return this.ri
});
t.A(X, {layer: "layer"}, function () {
var a = this.U;
return null !== a ? a.layer : null
});
t.A(X, {h: "diagram"}, function () {
var a = this.U;
return null !== a ? a.h : null
}, {configurable: !0});
t.g(X, "position", X.prototype.position);
t.defineProperty(X, {position: "position"}, function () {
return this.rb
}, function (a) {
var b = this.rb;
if (!b.N(a)) {
f && t.k(a, C, X, "position");
a = a.Z();
if (this instanceof w) {
if (this instanceof A || !a.Q())return;
var c = this.ji;
this.rb = a;
if (!1 === Bi(this)) {
var d = c.copy();
c.q(d.x + (a.x - b.x), d.y + (a.y - b.y));
tk(this);
Vj(this);
uk(this);
c.N(d) || this.i("location", d, c)
} else c.q(NaN, NaN)
} else this.rb = a, mk(this), Vj(this);
this.i("position", b, a)
}
});
t.A(X, {ya: "actualBounds"}, function () {
return this.Gb
});
t.g(X, "scale", X.prototype.scale);
t.defineProperty(X, {scale: "scale"}, function () {
return this.Sb
}, function (a) {
var b = this.Sb;
b !== a && (f && t.o(a, X, "scale"), 0 >= a && t.m("GraphObject.scale must be greater than zero"), this.Sb = a, Vj(this), this.aa(), this.i("scale", b, a))
});
t.g(X, "angle", X.prototype.angle);
t.defineProperty(X, {angle: "angle"}, function () {
return this.on
}, function (a) {
var b = this.on;
b !== a && (f && t.o(a, X, "angle"), a %= 360, 0 > a && (a += 360), b !== a && (this.on = a, this.aa(), Vj(this), this.i("angle", b, a)))
});
t.g(X, "desiredSize", X.prototype.Ca);
t.defineProperty(X, {Ca: "desiredSize"}, function () {
return this.df
}, function (a) {
var b = this.df;
b.N(a) || (f && t.k(a, oa, X, "desiredSize"), this.df = a = a.Z(), this.aa(), this instanceof Y && this.Kf(), this.i("desiredSize", b, a), a = this.U, null !== a && 0 !== (this.ka & 1024) && (Pj(this, a, "width"), Pj(this, a, "height")))
});
t.g(X, "width", X.prototype.width);
t.defineProperty(X, {width: "width"}, function () {
return this.df.width
}, function (a) {
if (this.df.width !== a) {
f && t.j(a, "number", X, "width");
var b = this.df;
this.df = a = (new oa(a, this.df.height)).freeze();
this.aa();
this instanceof Y && this.Kf();
this.i("desiredSize", b, a);
b = this.U;
null !== b && 0 !== (this.ka & 1024) && Pj(this, b, "width")
}
});
t.g(X, "height", X.prototype.height);
t.defineProperty(X, {height: "height"}, function () {
return this.df.height
}, function (a) {
if (this.df.height !== a) {
f && t.j(a, "number", X, "height");
var b = this.df;
this.df = a = (new oa(this.df.width, a)).freeze();
this.aa();
this instanceof Y && this.Kf();
this.i("desiredSize", b, a);
b = this.U;
null !== b && 0 !== (this.ka & 1024) && Pj(this, b, "height")
}
});
t.g(X, "minSize", X.prototype.Ye);
t.defineProperty(X, {Ye: "minSize"}, function () {
return this.ce
}, function (a) {
var b = this.ce;
b.N(a) || (f && t.k(a, oa, X, "minSize"), a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.ce = a, this.aa(), this.i("minSize", b, a))
});
t.g(X, "maxSize", X.prototype.Ge);
t.defineProperty(X, {Ge: "maxSize"}, function () {
return this.yj
}, function (a) {
var b = this.yj;
b.N(a) || (f && t.k(a, oa, X, "maxSize"), a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.yj = a, this.aa(), this.i("maxSize", b, a))
});
t.A(X, {Ea: "measuredBounds"}, function () {
return this.Kc
});
t.A(X, {Ia: "naturalBounds"}, function () {
return this.Lc
}, {configurable: !0});
t.g(X, "margin", X.prototype.margin);
t.defineProperty(X, {margin: "margin"}, function () {
return this.fr
}, function (a) {
"number" === typeof a ? a = new rb(a) : f && t.k(a, rb, X, "margin");
var b = this.fr;
b.N(a) || (this.fr = a = a.Z(), this.aa(), this.i("margin", b, a))
});
t.A(X, {transform: null}, function () {
0 !== (this.ka & 2048) === !0 && jk(this);
return this.ad
});
t.A(X, {he: null}, function () {
0 !== (this.ka & 4096) === !0 && jk(this);
return this.Wh
});
t.g(X, "alignment", X.prototype.alignment);
t.defineProperty(X, {alignment: "alignment"}, function () {
return this.qe
}, function (a) {
var b = this.qe;
b.N(a) || (f ? t.k(a, K, X, "alignment") : a.pd() && !a.Gc() && t.m("alignment must be a real Spot or Spot.Default"), this.qe = a = a.Z(), mk(this), this.i("alignment", b, a))
});
t.g(X, "column", X.prototype.column);
t.defineProperty(X, {column: "column"}, function () {
return this.hq
}, function (a) {
f && t.o(a, X, "column");
a = Math.round(a);
var b = this.hq;
b !== a && (0 > a && t.ha(a, ">= 0", X, "column"), this.hq = a, this.aa(), this.i("column", b, a))
});
t.g(X, "columnSpan", X.prototype.tD);
t.defineProperty(X, {tD: "columnSpan"}, function () {
return this.fj
}, function (a) {
f && t.o(a, X, "columnSpan");
a = Math.round(a);
var b = this.fj;
b !== a && (1 > a && t.ha(a, ">= 1", X, "columnSpan"), this.fj = a, this.aa(), this.i("columnSpan", b, a))
});
t.g(X, "row", X.prototype.gc);
t.defineProperty(X, {gc: "row"}, function () {
return this.Lr
}, function (a) {
f && t.o(a, X, "row");
a = Math.round(a);
var b = this.Lr;
b !== a && (0 > a && t.ha(a, ">= 0", X, "row"), this.Lr = a, this.aa(), this.i("row", b, a))
});
t.g(X, "rowSpan", X.prototype.rowSpan);
t.defineProperty(X, {rowSpan: "rowSpan"}, function () {
return this.Fj
}, function (a) {
f && t.o(a, X, "rowSpan");
a = Math.round(a);
var b = this.Fj;
b !== a && (1 > a && t.ha(a, ">= 1", X, "rowSpan"), this.Fj = a, this.aa(), this.i("rowSpan", b, a))
});
t.g(X, "alignmentFocus", X.prototype.Qj);
t.defineProperty(X, {Qj: "alignmentFocus"}, function () {
return this.aq
}, function (a) {
var b = this.aq;
b.N(a) || (f ? t.k(a, K, X, "alignmentFocus") : a.pd() && !a.Gc() && t.m("alignmentFocus must be a real Spot or Spot.Default"), this.aq = a = a.Z(), this.aa(), this.i("alignmentFocus", b, a))
});
t.g(X, "portId", X.prototype.rd);
t.defineProperty(X, {rd: "portId"}, function () {
return this.Ar
}, function (a) {
var b = this.Ar;
if (b !== a) {
f && null !== a && t.j(a, "string", X, "portId");
var c = this.U;
null === c || c instanceof y || (t.m("portID being set on a Link: " + a), c = null);
null !== b && c && vk(c, this);
this.Ar = a;
if (null !== a && c) {
c.oj = !0;
null === c.xd && wk(c);
var d = this.rd;
null !== d && c.xd.add(d, this)
}
this.i("portId", b, a)
}
});
function xk(a) {
var b = {value: null};
yk(a, b);
return b.value
}
function yk(a, b) {
var c = a.ga;
return null === c || !yk(c, b) && a.visible ? (b.value = a, !1) : !0
}
function rk(a) {
var b = a.U;
b instanceof y && (a = a.h) && !a.Aa.qb && b.Vg()
}
t.g(X, "toSpot", X.prototype.mb);
t.defineProperty(X, {mb: "toSpot"}, function () {
return null !== this.V ? this.V.Oj : Kb
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Oj;
b.N(a) || (f && t.k(a, K, X, "toSpot"), a = a.Z(), this.V.Oj = a, this.i("toSpot", b, a), rk(this))
});
t.g(X, "toEndSegmentLength", X.prototype.lk);
t.defineProperty(X, {lk: "toEndSegmentLength"}, function () {
return null !== this.V ? this.V.Mj : 10
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Mj;
b !== a && (f && t.j(a, "number", X, "toEndSegmentLength"), 0 > a && t.ha(a, ">= 0", X, "toEndSegmentLength"), this.V.Mj = a, this.i("toEndSegmentLength", b, a), rk(this))
});
t.g(X, "toEndSegmentDirection", X.prototype.Lp);
t.defineProperty(X, {Lp: "toEndSegmentDirection"}, function () {
return null !== this.V ? this.V.Lj : Nj
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Lj;
b !== a && (f && t.tb(a, y, X, "toEndSegmentDirection"), this.V.Lj = a, this.i("toEndSegmentDirection", b, a), rk(this))
});
t.g(X, "toShortLength", X.prototype.Mp);
t.defineProperty(X, {Mp: "toShortLength"}, function () {
return null !== this.V ? this.V.Nj : 0
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Nj;
b !== a && (f && t.j(a, "number", X, "toShortLength"), this.V.Nj = a, this.i("toShortLength", b, a), rk(this))
});
t.g(X, "toLinkable", X.prototype.kB);
t.defineProperty(X, {kB: "toLinkable"}, function () {
return this.gs
}, function (a) {
var b = this.gs;
b !== a && (f && null !== a && t.j(a, "boolean", X, "toLinkable"), this.gs = a, this.i("toLinkable", b, a))
});
t.g(X, "toMaxLinks", X.prototype.OF);
t.defineProperty(X, {OF: "toMaxLinks"}, function () {
return this.hs
}, function (a) {
var b = this.hs;
b !== a && (f && t.o(a, X, "toMaxLinks"), 0 > a && t.ha(a, ">= 0", X, "toMaxLinks"), this.hs = a, this.i("toMaxLinks", b, a))
});
t.g(X, "fromSpot", X.prototype.lb);
t.defineProperty(X, {lb: "fromSpot"}, function () {
return null !== this.V ? this.V.mj : Kb
}, function (a) {
null === this.V && this.Fe();
var b = this.V.mj;
b.N(a) || (f && t.k(a, K, X, "fromSpot"), a = a.Z(), this.V.mj = a, this.i("fromSpot", b, a), rk(this))
});
t.g(X, "fromEndSegmentLength", X.prototype.dk);
t.defineProperty(X, {dk: "fromEndSegmentLength"}, function () {
return null !== this.V ? this.V.kj : 10
}, function (a) {
null === this.V && this.Fe();
var b = this.V.kj;
b !== a && (f && t.j(a, "number", X, "fromEndSegmentLength"), 0 > a && t.ha(a, ">= 0", X, "fromEndSegmentLength"), this.V.kj = a, this.i("fromEndSegmentLength", b, a), rk(this))
});
t.g(X, "fromEndSegmentDirection", X.prototype.So);
t.defineProperty(X, {So: "fromEndSegmentDirection"}, function () {
return null !== this.V ? this.V.jj : Nj
}, function (a) {
null === this.V && this.Fe();
var b = this.V.jj;
b !== a && (f && t.tb(a, y, X, "fromEndSegmentDirection"), this.V.jj = a, this.i("fromEndSegmentDirection", b, a), rk(this))
});
t.g(X, "fromShortLength", X.prototype.To);
t.defineProperty(X, {To: "fromShortLength"}, function () {
return null !== this.V ? this.V.lj : 0
}, function (a) {
null === this.V && this.Fe();
var b = this.V.lj;
b !== a && (f && t.j(a, "number", X, "fromShortLength"), this.V.lj = a, this.i("fromShortLength", b, a), rk(this))
});
t.g(X, "fromLinkable", X.prototype.Zz);
t.defineProperty(X, {Zz: "fromLinkable"}, function () {
return this.Cq
}, function (a) {
var b = this.Cq;
b !== a && (f && null !== a && t.j(a, "boolean", X, "fromLinkable"), this.Cq = a, this.i("fromLinkable", b, a))
});
t.g(X, "fromMaxLinks", X.prototype.dE);
t.defineProperty(X, {dE: "fromMaxLinks"}, function () {
return this.Dq
}, function (a) {
var b = this.Dq;
b !== a && (f && t.o(a, X, "fromMaxLinks"), 0 > a && t.ha(a, ">= 0", X, "fromMaxLinks"), this.Dq = a, this.i("fromMaxLinks", b, a))
});
t.g(X, "cursor", X.prototype.cursor);
t.defineProperty(X, {cursor: "cursor"}, function () {
return this.oq
}, function (a) {
var b = this.oq;
b !== a && (t.j(a, "string", X, "cursor"), this.oq = a, this.i("cursor", b, a))
});
t.g(X, "click", X.prototype.click);
t.defineProperty(X, {click: "click"}, function () {
return null !== this.R ? this.R.Yh : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.Yh;
b !== a && (null !== a && t.j(a, "function", X, "click"), this.R.Yh = a, this.i("click", b, a))
});
t.g(X, "doubleClick", X.prototype.Jm);
t.defineProperty(X, {Jm: "doubleClick"}, function () {
return null !== this.R ? this.R.di : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.di;
b !== a && (null !== a && t.j(a, "function", X, "doubleClick"), this.R.di = a, this.i("doubleClick", b, a))
});
t.g(X, "contextClick", X.prototype.Bs);
t.defineProperty(X, {Bs: "contextClick"}, function () {
return null !== this.R ? this.R.$h : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.$h;
b !== a && (null !== a && t.j(a, "function", X, "contextClick"), this.R.$h = a, this.i("contextClick", b, a))
});
t.g(X, "mouseEnter", X.prototype.uA);
t.defineProperty(X, {uA: "mouseEnter"}, function () {
return null !== this.R ? this.R.qr : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.qr;
b !== a && (null !== a && t.j(a, "function", X, "mouseEnter"), this.R.qr = a, this.i("mouseEnter", b, a))
});
t.g(X, "mouseLeave", X.prototype.vA);
t.defineProperty(X, {vA: "mouseLeave"}, function () {
return null !== this.R ? this.R.rr : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.rr;
b !== a && (null !== a && t.j(a, "function", X, "mouseLeave"), this.R.rr = a, this.i("mouseLeave", b, a))
});
t.g(X, "mouseOver", X.prototype.et);
t.defineProperty(X, {et: "mouseOver"}, function () {
return null !== this.R ? this.R.ni : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.ni;
b !== a && (null !== a && t.j(a, "function", X, "mouseOver"), this.R.ni = a, this.i("mouseOver", b, a))
});
t.g(X, "mouseHover", X.prototype.dt);
t.defineProperty(X, {dt: "mouseHover"}, function () {
return null !== this.R ? this.R.mi : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.mi;
b !== a && (null !== a && t.j(a, "function", X, "mouseHover"), this.R.mi = a, this.i("mouseHover", b, a))
});
t.g(X, "mouseHold", X.prototype.ct);
t.defineProperty(X, {ct: "mouseHold"}, function () {
return null !== this.R ? this.R.li : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.li;
b !== a && (null !== a && t.j(a, "function", X, "mouseHold"), this.R.li = a, this.i("mouseHold", b, a))
});
t.g(X, "mouseDragEnter", X.prototype.UE);
t.defineProperty(X, {UE: "mouseDragEnter"}, function () {
return null !== this.R ? this.R.or : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.or;
b !== a && (null !== a && t.j(a, "function", X, "mouseDragEnter"), this.R.or = a, this.i("mouseDragEnter", b, a))
});
t.g(X, "mouseDragLeave", X.prototype.tA);
t.defineProperty(X, {tA: "mouseDragLeave"}, function () {
return null !== this.R ? this.R.pr : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.pr;
b !== a && (null !== a && t.j(a, "function", X, "mouseDragLeave"), this.R.pr = a, this.i("mouseDragLeave", b, a))
});
t.g(X, "mouseDrop", X.prototype.bt);
t.defineProperty(X, {bt: "mouseDrop"}, function () {
return null !== this.R ? this.R.ki : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.ki;
b !== a && (null !== a && t.j(a, "function", X, "mouseDrop"), this.R.ki = a, this.i("mouseDrop", b, a))
});
t.g(X, "actionDown", X.prototype.uz);
t.defineProperty(X, {uz: "actionDown"}, function () {
return null !== this.R ? this.R.Wp : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.Wp;
b !== a && (null !== a && t.j(a, "function", X, "actionDown"), this.R.Wp = a, this.i("actionDown", b, a))
});
t.g(X, "actionUp", X.prototype.wz);
t.defineProperty(X, {wz: "actionUp"}, function () {
return null !== this.R ? this.R.Yp : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.Yp;
b !== a && (null !== a && t.j(a, "function", X, "actionUp"), this.R.Yp = a, this.i("actionUp", b, a))
});
t.g(X, "actionMove", X.prototype.vz);
t.defineProperty(X, {vz: "actionMove"}, function () {
return null !== this.R ? this.R.Xp : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.Xp;
b !== a && (null !== a && t.j(a, "function", X, "actionMove"), this.R.Xp = a, this.i("actionMove", b, a))
});
t.g(X, "actionCancel", X.prototype.tz);
t.defineProperty(X, {tz: "actionCancel"}, function () {
return null !== this.R ? this.R.Vp : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.Vp;
b !== a && (null !== a && t.j(a, "function", X, "actionCancel"), this.R.Vp = a, this.i("actionCancel", b, a))
});
t.g(X, "toolTip", X.prototype.Dt);
t.defineProperty(X, {Dt: "toolTip"}, function () {
return null !== this.R ? this.R.xi : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.xi;
b !== a && (null !== a && t.k(a, Ue, X, "toolTip"), this.R.xi = a, this.i("toolTip", b, a))
});
t.g(X, "contextMenu", X.prototype.contextMenu);
t.defineProperty(X, {contextMenu: "contextMenu"}, function () {
return null !== this.R ? this.R.ai : null
}, function (a) {
null === this.R && Mj(this);
var b = this.R.ai;
b !== a && (null !== a && t.k(a, Ue, X, "contextMenu"), this.R.ai = a, this.i("contextMenu", b, a))
});
X.prototype.bind = X.prototype.bind = function (a) {
a.fg = this;
var b = this.Ro();
null !== b && zk(b) && t.m("Cannot add a Binding to a template that has already been copied: " + a);
null === this.Cc && (this.Cc = new H(Ce));
this.Cc.add(a)
};
X.prototype.findTemplateBinder = X.prototype.Ro = function () {
for (var a = this instanceof B ? this : this.ga; null !== a;) {
if (null !== a.Fl && a instanceof B)return a;
a = a.ga
}
return null
};
X.fromSvg = function (a) {
return Ak(a)
};
X.prototype.setProperties = function (a) {
t.Kw(this, a)
};
var Bk;
X.make = Bk = function (a, b) {
var c = arguments, d = null, e = null;
if ("function" === typeof a)e = a; else if ("string" === typeof a) {
var g = Ck.Ba(a);
"function" === typeof g ? (c = Array.prototype.slice.call(arguments), d = g(c)) : e = ba[a]
}
null === d && (void 0 === e && (d = window.$, void 0 !== d && void 0 !== d.noop && t.m("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"), t.m("GraphObject.make failed to complete, it may be conflicting with another var.")), null !== e && e.constructor || t.m("GraphObject.make requires a class function or class name, not: " +
a), d = new e);
g = 1;
d instanceof u && 1 < c.length && (e = c[1], "string" === typeof e || e instanceof HTMLDivElement) && (d.Ki = null, Uh(d, e), g++);
for (; g < c.length; g++)e = c[g], void 0 === e ? t.m("Undefined value at argument " + g + " for object being constructed by GraphObject.make: " + d) : Dk(d, e);
return d
};
function Dk(a, b) {
if ("string" === typeof b) {
var c = a;
if (c instanceof ua)c.text = b; else if (c instanceof Y)c.Jb = b; else if (c instanceof Ek)c.source = b; else if (c instanceof B) {
var d = t.Km(B, b);
null !== d ? c.type = d : t.m("Unknown Panel type as an argument to GraphObject.make: " + b)
} else c instanceof Td ? (d = t.Km(Td, b), null !== d ? c.type = d : t.m("Unknown Brush type as an argument to GraphObject.make: " + b)) : c instanceof M ? (d = t.Km(M, b), null !== d ? c.type = d : t.m("Unknown Geometry type as an argument to GraphObject.make: " + b)) : c instanceof
S ? (d = t.Km(S, b), null !== d ? c.type = d : t.m("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : t.m("Unable to use a string as an argument to GraphObject.make: " + b)
} else if (b instanceof X)a instanceof B || t.m("A GraphObject can only be added to a Panel, not to: " + a), a.add(b); else if (b instanceof Fk)a instanceof B || t.m("A RowColumnDefinition can only be added to a Panel, not to: " + a), c = b.Jh ? a.ne(b.index) : a.me(b.index), t.k(b, Fk, Fk, "copyFrom:pd"), b.Jh ? c.height = b.height : c.width = b.width, c.Mh = b.Mh,
c.rf = b.rf, c.alignment = b.alignment, c.xt = b.xt, c.Ij = null === b.Ij ? null : b.Ij.Z(), c.bn = b.bn, c.cn = b.cn, c.vh = null, b.vh && (c.vh = b.vh.slice(0)), c.background = b.background, c.Uv = b.Uv, c.Cc = b.Cc; else if (b instanceof la)c = a, c instanceof A && b.Pe === A ? 2 === (b.value & 2) ? c.rt = b : b === Pg || b === Gg || b === Cg ? c.De = b : b === Gk || b === Hk || b === Ik ? c.wo = b : b !== Jk && b !== Hg && t.m("Unknown Link enum value for a Link property: " + b) : c instanceof B && b.Pe === B ? c.type = b : c instanceof ua && b.Pe === ua ? c.qB = b : c instanceof X && b.Pe === A ? 0 === b.name.indexOf("Orient") ?
c.tt = b : t.m("Unknown Link enum value for GraphObject.segmentOrientation property: " + b) : c instanceof X && b.Pe === X ? c.Qh = b : c instanceof u && b.Pe === u ? c.zm = b : c instanceof Td && b.Pe === Td ? c.type = b : c instanceof M && b.Pe === M ? c.type = b : c instanceof S && b.Pe === S ? c.type = b : c instanceof Ce && b.Pe === Ce ? c.mode = b : c instanceof zd && b.Pe === zd ? c.nd = b : c instanceof Z && b.Pe === Z ? 0 === b.name.indexOf("Alignment") ? c.alignment = b : 0 === b.name.indexOf("Arrangement") ? c.Oe = b : 0 === b.name.indexOf("Compaction") ? c.compaction = b : 0 === b.name.indexOf("Path") ?
c.path = b : 0 === b.name.indexOf("Sorting") ? c.sorting = b : 0 === b.name.indexOf("Style") ? c.XF = b : t.m("Unknown enum value: " + b) : c instanceof Kk && b.Pe === Kk ? 0 === b.name.indexOf("Aggressive") ? c.eD = b : 0 === b.name.indexOf("Cycle") ? c.BD = b : 0 === b.name.indexOf("Init") ? c.vE = b : 0 === b.name.indexOf("Layer") ? c.FE = b : t.m("Unknown enum value: " + b) : c instanceof Gj && b.Pe === Gj ? b === Lk || b === Mk || b === Nk || b === Ok ? c.sorting = b : b === Pk || b === Qk ? c.Oe = b : b === Rk || b === Sk ? c.alignment = b : t.m("Unknown enum value: " + b) : c instanceof Tk && b.Pe === Tk ? b === Uk ||
b === Vk || b === Wk || b === Xk || b === Yk ? c.sorting = b : b === Zk || b === $k || b === al || b === bl ? c.direction = b : b === cl || b === dl || b === el || b === fl ? c.Oe = b : b === gl || b === hl ? c.ht = b : t.m("Unknown enum value: " + b) : t.m("No property to set for this enum value: " + b); else if (b instanceof Ce)if (a instanceof X || a instanceof Fk) {
var d = b.Bt, e = d.indexOf(".");
0 < e && a instanceof B && (c = d.substr(e + 1), d = a.le(d.substring(0, e)), null !== d && (a = d, b.Bt = c));
a.bind(b)
} else t.m("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " +
a); else if (b instanceof Lc)a instanceof M ? a.ub.add(b) : t.m("A PathFigure can only be added to a Geometry, not to: " + a); else if (b instanceof S)a instanceof Lc ? a.Ga.add(b) : t.m("A PathSegment can only be added to a PathFigure, not to: " + a); else if (Array.isArray(b))for (c = 0; c < b.length; c++)Dk(a, b[c]); else if ("object" === typeof b && null !== b)if (c = a, c instanceof Td) {
d = {};
for (e in b) {
var g = parseFloat(e);
isNaN(g) ? d[e] = b[e] : c.addColorStop(g, b[e])
}
t.Kw(c, d)
} else c instanceof Fk ? (void 0 !== b.row ? (d = b.row, (void 0 ===
d || null === d || Infinity === d || isNaN(d) || 0 > d) && t.m("Must specify non-negative integer row for RowColumnDefinition " + b), c.Sl = !0, c.se = d) : void 0 !== b.column ? (d = b.column, (void 0 === d || null === d || Infinity === d || isNaN(d) || 0 > d) && t.m("Must specify non-negative integer column for RowColumnDefinition " + b), c.Sl = !1, c.se = d) : t.m("Must specify row or column value in a RowColumnDefinition " + b), d = t.rH(b, "row", "column"), t.Kw(c, d)) : t.Kw(c, b); else t.m('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' +
a)
}
var Ck;
X.Builders = Ck = new ra("string", "function");
Ck.add("Button", function () {
var a = new Td(he);
a.addColorStop(0, "white");
a.addColorStop(1, "lightgray");
var b = new Td(he);
b.addColorStop(0, "white");
b.addColorStop(1, "dodgerblue");
var c = Bk(B, Wh, {Rs: !0}, Bk(Y, {name: "ButtonBorder", Jb: "RoundedRectangle", fill: a, stroke: "gray"}));
c.uA = function (a, c) {
var g = c.pa(0), h = c._buttonFillOver;
void 0 === h && (h = b);
c._buttonFillNormal = g.fill;
g.fill = h;
h = c._buttonStrokeOver;
void 0 === h && (h = "blue");
c._buttonStrokeNormal = g.stroke;
g.stroke = h
};
c.vA = function (b, c) {
var g = c.pa(0), h = c._buttonFillNormal;
void 0 === h && (h = a);
g.fill = h;
h = c._buttonStrokeNormal;
void 0 === h && (h = "gray");
g.stroke = h
};
return c
});
Ck.add("TreeExpanderButton", function () {
var a = Bk("Button", Bk(Y, {name: "ButtonIcon", Jb: "MinusLine", Ca: J.Sp}, (new Ce("figure", "isTreeExpanded", function (a, c) {
var d = null, e = c.ga;
e && (d = a ? e._treeExpandedFigure : e._treeCollapsedFigure);
d || (d = a ? "MinusLine" : "PlusLine");
return d
})).CA("")), {visible: !1}, (new Ce("visible", "isTreeLeaf", function (a) {
return!a
})).CA(""));
a.click = function (a, c) {
var d = c.U;
if (d instanceof y) {
var e = d.h;
null === e || e.Ya || (a.Ee = !0, d.Sc ? e.Qe.collapseTree(d) : e.Qe.expandTree(d))
}
};
return a
});
Ck.add("SubGraphExpanderButton", function () {
var a = Bk("Button", Bk(Y, {name: "ButtonIcon", Jb: "MinusLine", Ca: J.Sp}, (new Ce("figure", "isSubGraphExpanded", function (a, c) {
var d = null, e = c.ga;
e && (d = a ? e._subGraphExpandedFigure : e._subGraphCollapsedFigure);
d || (d = a ? "MinusLine" : "PlusLine");
return d
})).CA("")));
a.click = function (a, c) {
var d = c.U;
if (d instanceof z) {
var e = d.h;
null === e || e.Ya || (a.Ee = !0, d.of ? e.Qe.collapseSubGraph(d) : e.Qe.expandSubGraph(d))
}
};
return a
});
Ck.add("ContextMenuButton", function () {
var a = Bk("Button");
a.Qh = Lj;
var b = a.le("ButtonBorder");
b instanceof Y && (b.Jb = "Rectangle", b.G = new K(0, 0, 2, 2), b.H = new K(1, 1, -2, -2));
return a
});
function B(a) {
X.call(this);
void 0 === a ? 0 === arguments.length ? this.ba = $g : t.m("invalid argument to Panel constructor: undefined") : (t.tb(a, B, B, "type"), this.ba = a);
this.za = new H(X);
this.Le = J.Up;
this.Ig = !1;
this.ba === bi && (this.Ig = !0);
this.Ef = 1;
this.rq = Pb;
this.kc = Wg;
this.ba === ca && il(this);
this.so = Xg;
this.Hq = (new oa(10, 10)).freeze();
this.Iq = J.nk;
this.Fl = this.Kl = null;
this.zy = "";
this.Jg = this.rj = null;
this.Sn = "category";
this.$f = null;
this.zi = new D(NaN, NaN, NaN, NaN);
this.qo = null;
this.oj = !1
}
t.ia("Panel", B);
t.Eh(B);
t.Oa(B, X);
function il(a) {
a.gj = J.Up;
a.lh = 1;
a.ci = null;
a.Ml = null;
a.kh = 1;
a.jh = null;
a.Ll = null;
a.Zc = [];
a.Vc = [];
a.km = jl;
a.Gl = jl;
a.yi = 0;
a.ii = 0
}
B.prototype.cloneProtected = function (a) {
X.prototype.cloneProtected.call(this, a);
a.ba = this.ba;
a.Le = this.Le.Z();
a.Ig = this.Ig;
a.Ef = this.Ef;
a.rq = this.rq.Z();
a.kc = this.kc;
if (a.ba === ca) {
a.gj = this.gj.Z();
a.lh = this.lh;
a.ci = this.ci;
a.Ml = this.Ml;
a.kh = this.kh;
a.jh = this.jh;
a.Ll = this.Ll;
var b = [];
if (0 < this.Zc.length)for (var c = this.Zc, d = c.length, e = 0; e < d; e++)if (void 0 !== c[e]) {
var g = c[e].copy();
g.ul(a);
b[e] = g
}
a.Zc = b;
b = [];
if (0 < this.Vc.length)for (c = this.Vc, d = c.length, e = 0; e < d; e++)void 0 !== c[e] && (g = c[e].copy(), g.ul(a),
b[e] = g);
a.Vc = b;
a.km = this.km;
a.Gl = this.Gl;
a.yi = this.yi;
a.ii = this.ii
}
a.so = this.so;
a.Hq.assign(this.Hq);
a.Iq = this.Iq.Z();
a.Kl = this.Kl;
a.Fl = this.Fl;
a.zy = this.zy;
a.rj = this.rj;
a.Jg = this.Jg;
a.Sn = this.Sn;
a.zi.assign(this.zi);
a.oj = this.oj;
this.dv && (a.dv = this.dv);
this._buttonFillNormal && (a._buttonFillNormal = this._buttonFillNormal);
this._buttonFillOver && (a._buttonFillOver = this._buttonFillOver);
this._buttonStrokeNormal && (a._buttonStrokeNormal = this._buttonStrokeNormal);
this._buttonStrokeOver && (a._buttonStrokeOver =
this._buttonStrokeOver);
this._treeExpandedFigure && (a._treeExpandedFigure = this._treeExpandedFigure);
this._treeCollapsedFigure && (a._treeCollapsedFigure = this._treeCollapsedFigure);
this._subGraphExpandedFigure && (a._subGraphExpandedFigure = this._subGraphExpandedFigure);
this._subGraphCollapsedFigure && (a._subGraphCollapsedFigure = this._subGraphCollapsedFigure)
};
B.prototype.Fh = function (a) {
X.prototype.Fh.call(this, a);
a.za = this.za;
for (var b = a.za.l; b.next();)b.value.ri = a
};
B.prototype.copy = function () {
var a = X.prototype.copy.call(this);
if (a instanceof B) {
var b = this.za;
if (0 < b.length)for (var c = b.length, d = 0; d < c; d++) {
var e = b.p[d].copy(), g = a;
e.ul(g);
e.fm = null;
var h = g.za, k = h.count;
h.Rd(k, e);
h = g.U;
if (null !== h) {
h.zj = null;
null !== e.rd && h instanceof y && (h.oj = !0);
var l = g.h;
null !== l && l.Aa.qb || h.fd(Cd, "elements", g, null, e, null, k)
}
}
return a
}
return null
};
B.prototype.toString = function () {
return"Panel(" + this.type + ")#" + t.oc(this)
};
var $g;
B.Position = $g = t.w(B, "Position", 0);
B.Horizontal = t.w(B, "Horizontal", 1);
var Vh;
B.Vertical = Vh = t.w(B, "Vertical", 2);
var Tg;
B.Spot = Tg = t.w(B, "Spot", 3);
var Wh;
B.Auto = Wh = t.w(B, "Auto", 4);
var ca;
B.Table = ca = t.w(B, "Table", 5);
B.Viewbox = t.w(B, "Viewbox", 6);
var ck;
B.TableRow = ck = t.w(B, "TableRow", 7);
var dk;
B.TableColumn = dk = t.w(B, "TableColumn", 8);
var Bg;
B.Link = Bg = t.w(B, "Link", 9);
var bi;
B.Grid = bi = t.w(B, "Grid", 10);
t.g(B, "type", B.prototype.type);
t.defineProperty(B, {type: "type"}, function () {
return this.ba
}, function (a) {
var b = this.ba;
b !== a && (f && t.tb(a, B, B, "type"), b !== ck && b !== dk || t.m("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.ba = a, this.ba === bi ? this.Ig = !0 : this.ba === ca && il(this), this.aa(), this.i("type", b, a))
});
t.A(B, {elements: "elements"}, function () {
return this.za.l
});
t.A(B, {Ia: "naturalBounds"}, function () {
return this.Lc
});
t.g(B, "padding", B.prototype.padding);
t.defineProperty(B, {padding: "padding"}, function () {
return this.Le
}, function (a) {
"number" === typeof a ? (0 > a && t.ha(a, ">= 0", B, "padding"), a = new rb(a)) : (t.k(a, rb, B, "padding"), 0 > a.left && t.ha(a.left, ">= 0", B, "padding:val.left"), 0 > a.right && t.ha(a.right, ">= 0", B, "padding:val.right"), 0 > a.top && t.ha(a.top, ">= 0", B, "padding:val.top"), 0 > a.bottom && t.ha(a.bottom, ">= 0", B, "padding:val.bottom"));
var b = this.Le;
b.N(a) || (this.Le = a = a.Z(), this.aa(), this.i("padding", b, a))
});
t.g(B, "defaultAlignment", B.prototype.Xj);
t.defineProperty(B, {Xj: "defaultAlignment"}, function () {
return this.rq
}, function (a) {
var b = this.rq;
b.N(a) || (f && t.k(a, K, B, "defaultAlignment"), this.rq = a = a.Z(), this.aa(), this.i("defaultAlignment", b, a))
});
t.g(B, "defaultStretch", B.prototype.Pz);
t.defineProperty(B, {Pz: "defaultStretch"}, function () {
return this.kc
}, function (a) {
var b = this.kc;
b !== a && (t.tb(a, X, B, "defaultStretch"), this.kc = a, this.aa(), this.i("defaultStretch", b, a))
});
t.g(B, "defaultSeparatorPadding", B.prototype.DH);
t.defineProperty(B, {DH: "defaultSeparatorPadding"}, function () {
return void 0 === this.gj ? J.Up : this.gj
}, function (a) {
if (void 0 !== this.gj) {
"number" === typeof a ? a = new rb(a) : f && t.k(a, rb, B, "defaultSeparatorPadding");
var b = this.gj;
b.N(a) || (this.gj = a = a.Z(), this.i("defaultSeparatorPadding", b, a))
}
});
t.g(B, "defaultRowSeparatorStroke", B.prototype.BH);
t.defineProperty(B, {BH: "defaultRowSeparatorStroke"}, function () {
return void 0 === this.ci ? null : this.ci
}, function (a) {
var b = this.ci;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.ci = a, this.i("defaultRowSeparatorStroke", b, a))
});
t.g(B, "defaultRowSeparatorStrokeWidth", B.prototype.CH);
t.defineProperty(B, {CH: "defaultRowSeparatorStrokeWidth"}, function () {
return void 0 === this.lh ? 1 : this.lh
}, function (a) {
if (void 0 !== this.lh) {
var b = this.lh;
b !== a && (this.lh = a, this.i("defaultRowSeparatorStrokeWidth", b, a))
}
});
t.g(B, "defaultRowSeparatorDashArray", B.prototype.AH);
t.defineProperty(B, {AH: "defaultRowSeparatorDashArray"}, function () {
return void 0 === this.Ml ? null : this.Ml
}, function (a) {
if (void 0 !== this.Ml) {
var b = this.Ml;
b !== a && (Array.isArray(a) || t.Vb(a, "Array", B, "defaultRowSeparatorDashArray:val"), this.Ml = a, this.i("defaultRowSeparatorDashArray", b, a))
}
});
t.g(B, "defaultColumnSeparatorStroke", B.prototype.wH);
t.defineProperty(B, {wH: "defaultColumnSeparatorStroke"}, function () {
return void 0 === this.jh ? null : this.jh
}, function (a) {
if (void 0 !== this.jh) {
var b = this.jh;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.jh = a, this.i("defaultColumnSeparatorStroke", b, a))
}
});
t.g(B, "defaultColumnSeparatorStrokeWidth", B.prototype.xH);
t.defineProperty(B, {xH: "defaultColumnSeparatorStrokeWidth"}, function () {
return void 0 === this.kh ? 1 : this.kh
}, function (a) {
if (void 0 !== this.kh) {
var b = this.kh;
b !== a && (this.kh = a, this.i("defaultColumnSeparatorStrokeWidth", b, a))
}
});
t.g(B, "defaultColumnSeparatorDashArray", B.prototype.vH);
t.defineProperty(B, {vH: "defaultColumnSeparatorDashArray"}, function () {
return void 0 === this.Ll ? null : this.Ll
}, function (a) {
if (void 0 !== this.Ll) {
var b = this.Ll;
b !== a && (Array.isArray(a) || t.Vb(a, "Array", B, "defaultColumnSeparatorDashArray:val"), this.Ll = a, this.i("defaultColumnSeparatorDashArray", b, a))
}
});
t.g(B, "viewboxStretch", B.prototype.mJ);
t.defineProperty(B, {mJ: "viewboxStretch"}, function () {
return this.so
}, function (a) {
var b = this.so;
b !== a && (t.tb(a, X, B, "viewboxStretch"), this.so = a, this.i("viewboxStretch", b, a))
});
t.g(B, "gridCellSize", B.prototype.Ms);
t.defineProperty(B, {Ms: "gridCellSize"}, function () {
return this.Hq
}, function (a) {
var b = this.Hq;
b.N(a) || (t.k(a, oa, B, "gridCellSize"), a.Q() && 0 !== a.width && 0 !== a.height || t.m("Invalid Panel.gridCellSize: " + a), this.Hq = a.Z(), null !== this.h && this === this.h.Yo && vi(this.h), this.ua(), this.i("gridCellSize", b, a))
});
t.g(B, "gridOrigin", B.prototype.bA);
t.defineProperty(B, {bA: "gridOrigin"}, function () {
return this.Iq
}, function (a) {
var b = this.Iq;
b.N(a) || (t.k(a, C, B, "gridOrigin"), a.Q() || t.m("Invalid Panel.gridOrigin: " + a), this.Iq = a.Z(), this.h && vi(this.h), this.ua(), this.i("gridOrigin", b, a))
});
B.prototype.hl = function (a, b) {
var c = this.opacity, d = 1;
1 !== c && (d = a.globalAlpha, a.globalAlpha = d * c);
if (this.ba === bi) {
c = this.ek() * b.scale;
0 >= c && (c = 1);
var e = this.Ms, d = e.width, e = e.height, g = this.Ia, h = g.width, g = g.height, k = Math.ceil(h / d), l = Math.ceil(g / e), m = this.bA;
a.save();
a.beginPath();
a.rect(0, 0, h, g);
a.clip();
for (var n = [], p = this.za.p, q = this.za.length, r = 0; r < q; r++) {
var s = [];
n.push(s);
var v = p[r];
if (v.visible)for (var v = "LineV" === v.Jb, x = r + 1; x < q; x++) {
var E = p[x];
E.visible && "LineV" === E.Jb === v && (E = E.interval, 2 <= E &&
s.push(E))
}
}
p = this.za.length;
for (q = 0; q < p; q++)if (r = this.za.p[q], r.visible) {
s = n[q];
v = r.interval;
x = !1;
E = r.Ow;
if (null !== E) {
var F = x = !0;
void 0 !== a.setLineDash ? (a.setLineDash(E), a.lineDashOffset = r.$c) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = E, a.webkitLineDashOffset = r.$c) : void 0 !== a.mozDash ? (a.mozDash = E, a.mozDashOffset = r.$c) : F = !1
}
a.lineWidth = r.ib;
gk(this, a, r.stroke, !1);
a.beginPath();
if ("LineV" === r.Jb)for (var G = Math.floor(-m.x / d), L = G; L <= G + k; L++) {
var N = L * d + m.x;
if (0 <= N && N < h && kl(L, v, s) && (x && !F ? Oj(a, N, 0, N,
g, E, r.$c) : (a.moveTo(N, 0), a.lineTo(N, g)), 2 > d * v * c))break
} else for (L = G = Math.floor(-m.y / e); L <= G + l && !(N = L * e + m.y, 0 <= N && N <= g && kl(L, v, s) && (x && !F ? Oj(a, 0, N, h, N, E, r.$c) : (a.moveTo(0, N), a.lineTo(h, N)), 2 > e * v * c)); L++);
a.stroke();
x && (void 0 !== a.setLineDash ? (a.setLineDash(t.Vh), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = t.Vh, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash && (a.mozDash = null, a.mozDashOffset = 0))
}
a.restore();
$h(b, a, !1)
} else {
this.ba === ca && (a.lineCap = "butt", ol(this, a, !0, this.Zc, !0), ol(this,
a, !1, this.Vc, !0), pl(this, a, !0, this.Zc), pl(this, a, !1, this.Vc), ol(this, a, !0, this.Zc, !1), ol(this, a, !1, this.Vc, !1));
F = this.za.length;
for (e = 0; e < F; e++)this.za.p[e].Se(a, b);
f && f.OH && this instanceof A && f.NH(a, b, this);
1 !== c && (a.globalAlpha = d)
}
};
function pl(a, b, c, d) {
for (var e = d.length, g, h = a.ya, k = c ? a.ne(0) : a.me(0), l = 0; l < e; l++)if (g = d[l], void 0 !== g && g !== k && 0 !== g.Yb) {
var m = g.cn;
isNaN(m) && (m = c ? a.lh : a.kh);
var n = g.bn;
null === n && (n = c ? a.ci : a.jh);
if (0 !== m && null !== n) {
gk(a, b, n, !1);
var n = !1, p = g.xF;
if (null !== p) {
var q = n = !0;
void 0 !== b.setLineDash ? (b.setLineDash(p), b.lineDashOffset = a.$c) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = p, b.webkitLineDashOffset = a.$c) : void 0 !== b.mozDash ? (b.mozDash = p, b.mozDashOffset = a.$c) : q = !1
}
b.beginPath();
var r = g.position + m;
c ? r >
h.height && (m -= r - h.height) : r > h.width && (m -= r - h.width);
g = g.position + m / 2;
b.lineWidth = m;
r = a.padding;
c ? (g += r.top, m = r.left, r = h.width - r.right, n && !q ? Oj(b, m, g, r, g, p, 0) : (b.moveTo(m, g), b.lineTo(r, g))) : (g += r.left, m = r.top, r = h.height - r.bottom, n && !q ? Oj(b, g, m, g, r, p, 0) : (b.moveTo(g, m), b.lineTo(g, r)));
b.stroke();
n && (void 0 !== b.setLineDash ? (b.setLineDash(t.Vh), b.lineDashOffset = 0) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = t.Vh, b.webkitLineDashOffset = 0) : void 0 !== b.mozDash && (b.mozDash = null, b.mozDashOffset = 0))
}
}
}
function ol(a, b, c, d, e) {
for (var g = d.length, h, k = a.ya, l = 0; l < g; l++)if (h = d[l], void 0 !== h && null !== h.background && h.Uv !== e && 0 !== h.Yb) {
var m = c ? k.height : k.width;
if (!(h.position > m)) {
var n = ql(h), p = h.cn;
isNaN(p) && (p = c ? a.lh : a.kh);
var q = h.bn;
null === q && (q = c ? a.ci : a.jh);
null === q && (p = 0);
n -= p;
p = h.position + p;
n += h.Yb;
p + n > m && (n = m - p);
0 >= n || (m = a.padding, gk(a, b, h.background, !0), c ? b.fillRect(m.left, p + m.top, k.width - (m.left + m.right), n) : b.fillRect(p + m.left, m.top, n, k.height - (m.top + m.bottom)))
}
}
}
function kl(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
}
B.prototype.$s = function (a, b, c, d) {
var e = this.zi;
e.width = 0;
e.height = 0;
var g = this.Ca, h = this.Ye;
void 0 === c && (c = h.width, d = h.height);
c = Math.max(c, h.width);
d = Math.max(d, h.height);
var k = this.Ge;
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.za, n = m.length;
if (0 === n) {
var p = this.Lc;
nb(p, isNaN(g.width) ? 0 : a, isNaN(g.height) ? 0 : b);
Qj(this, 0, 0, p.width,
p.height)
} else {
var q = this.ba.Rb;
switch (q) {
case "Position":
var r = a, s = b, v = c, x = d;
e.x = 0;
e.y = 0;
e.width = 0;
for (var E = e.height = 0; E < n; E++) {
var F = m.p[E];
if (F.visible || F === this.Ub) {
var G = F.margin, L = G.right + G.left, N = G.top + G.bottom;
Ch(F, r, s, v, x);
var V = F.Ea, T = Math.max(V.width + L, 0), W = Math.max(V.height + N, 0), ea = F.position.x, R = F.position.y;
isFinite(ea) || (ea = 0);
isFinite(R) || (R = 0);
if (F instanceof Y && F.jA)var xa = F.ib / 2, ea = ea - xa, R = R - xa;
xb(e, ea, R, T, W)
}
}
break;
case "Vertical":
for (var Ja = a, Ma = c, Na = t.Db(), ya = 0; ya < n; ya++) {
var Ra =
m.p[ya];
if (Ra.visible || Ra === this.Ub) {
var Ca = Tj(Ra);
if (Ca !== Vg && Ca !== Kj)Na.push(Ra); else {
var ob = Ra.margin, kf = ob.right + ob.left, hc = ob.top + ob.bottom;
Ch(Ra, Ja, Infinity, Ma, 0);
var lf = Ra.Ea, ic = Math.max(lf.width + kf, 0), hb = Math.max(lf.height + hc, 0);
e.width = Math.max(e.width, ic);
e.height += hb
}
}
}
var ib = Na.length;
if (0 !== ib) {
this.Ca.width ? Ja = Math.min(this.Ca.width, this.Ge.width) : 0 !== e.width && (Ja = Math.min(e.width, this.Ge.width));
for (ya = 0; ya < ib; ya++)if (Ra = Na[ya], Ra.visible || Ra === this.Ub)ob = Ra.margin, kf = ob.right + ob.left,
hc = ob.top + ob.bottom, Ch(Ra, Ja, Infinity, Ma, 0), lf = Ra.Ea, ic = Math.max(lf.width + kf, 0), hb = Math.max(lf.height + hc, 0), e.width = Math.max(e.width, ic), e.height += hb;
t.Da(Na)
}
break;
case "Horizontal":
for (var Ga = b, Ka = d, bb = t.Db(), tb = 0; tb < n; tb++) {
var Ya = m.p[tb];
if (Ya.visible || Ya === this.Ub) {
var Hf = Tj(Ya);
if (Hf !== Vg && Hf !== Lj)bb.push(Ya); else {
var ed = Ya.margin, vd = ed.right + ed.left, Ed = ed.top + ed.bottom;
Ch(Ya, Infinity, Ga, 0, Ka);
var Ud = Ya.Ea, wd = Math.max(Ud.width + vd, 0), Vd = Math.max(Ud.height + Ed, 0);
e.width += wd;
e.height = Math.max(e.height,
Vd)
}
}
}
var Dg = bb.length;
if (0 !== Dg) {
this.Ca.height ? Ga = Math.min(this.Ca.height, this.Ge.height) : 0 !== e.height && (Ga = Math.min(e.height, this.Ge.height));
for (tb = 0; tb < Dg; tb++)if (Ya = bb[tb], Ya.visible || Ya === this.Ub)ed = Ya.margin, vd = ed.right + ed.left, Ed = ed.top + ed.bottom, Ch(Ya, Infinity, Ga, 0, Ka), Ud = Ya.Ea, wd = Math.max(Ud.width + vd, 0), Vd = Math.max(Ud.height + Ed, 0), e.width += wd, e.height = Math.max(e.height, Vd);
t.Da(bb)
}
break;
case "Spot":
a:{
var Cb = a, mf = b, Ib = c, dc = d, Lb = nk(this, m, n), Sa = Lb.margin, jc, Ie, If = Sa.right + Sa.left, fg = Sa.top +
Sa.bottom;
Ch(Lb, Cb, mf, Ib, dc);
var Fb = Lb.Ea, fd = Fb.width, qc = Fb.height, gd = Math.max(fd + If, 0), Za = Math.max(qc + fg, 0);
e.x = -Sa.left;
e.y = -Sa.top;
e.width = gd;
e.height = Za;
for (var fb = 0; fb < n; fb++) {
var Xb = m.p[fb];
if (Xb !== Lb && (Xb.visible || Xb === this.Ub)) {
Sa = Xb.margin;
jc = Sa.right + Sa.left;
Ie = Sa.top + Sa.bottom;
Ch(Xb, Cb, mf, 0, 0);
var Fb = Xb.Ea, gd = Math.max(Fb.width + jc, 0), Za = Math.max(Fb.height + Ie, 0), ub = Xb.alignment;
ub.Gc() && (ub = this.Xj);
ub.qd() || (ub = Ub);
var kc = Xb.Qj;
kc.Gc() && (kc = Ub);
xb(e, ub.x * fd + ub.offsetX - (kc.x * Fb.width - kc.offsetX) -
Sa.left, ub.y * qc + ub.offsetY - (kc.y * Fb.height - kc.offsetY) - Sa.top, gd, Za)
}
}
var nf = Lb.Qh;
nf === Wg && (nf = Tj(Lb));
switch (nf) {
case Vg:
break a;
case Mc:
if (!isFinite(Cb) && !isFinite(mf))break a;
break;
case Lj:
if (!isFinite(Cb))break a;
break;
case Kj:
if (!isFinite(mf))break a
}
Fb = Lb.Ea;
fd = Fb.width;
qc = Fb.height;
gd = Math.max(fd + If, 0);
Za = Math.max(qc + fg, 0);
Sa = Lb.margin;
e.x = -Sa.left;
e.y = -Sa.top;
e.width = gd;
e.height = Za;
for (fb = 0; fb < n; fb++)Xb = m.p[fb], Xb === Lb || !Xb.visible && Xb !== this.Ub || (Sa = Xb.margin, jc = Sa.right + Sa.left, Ie = Sa.top +
Sa.bottom, Fb = Xb.Ea, gd = Math.max(Fb.width + jc, 0), Za = Math.max(Fb.height + Ie, 0), ub = Xb.alignment, ub.Gc() && (ub = this.Xj), ub.qd() || (ub = Ub), kc = Xb.Qj, kc.Gc() && (kc = Ub), xb(e, ub.x * fd + ub.offsetX - (kc.x * Fb.width - kc.offsetX) - Sa.left, ub.y * qc + ub.offsetY - (kc.y * Fb.height - kc.offsetY) - Sa.top, gd, Za))
}
break;
case "Auto":
var rc = a, zb = b, Wd = c, Je = d, Ab = nk(this, m, n), Fd = Ab.margin, Ke = Fd.right + Fd.left, me = Fd.top + Fd.bottom;
Ch(Ab, rc, zb, Wd, Je);
var gb = Ab.Ea, of = Math.max(gb.width + Ke, 0), Bb = Math.max(gb.height + me, 0), $a = rl(Ab), Oc = $a.x * of + $a.offsetX,
Mb = $a.y * Bb + $a.offsetY, $a = sl(Ab), Gd = $a.x * of + $a.offsetX, Xd = $a.y * Bb + $a.offsetY, Yd = rc, ne = zb;
isFinite(rc) && (Yd = Math.abs(Oc - Gd));
isFinite(zb) && (ne = Math.abs(Mb - Xd));
var Pc = t.xl();
Pc.q(0, 0);
for (var xd = 0; xd < n; xd++) {
var jb = m.p[xd];
if (jb !== Ab && (jb.visible || jb === this.Ub)) {
var Fd = jb.margin, Le = Fd.right + Fd.left, Me = Fd.top + Fd.bottom;
Ch(jb, Yd, ne, 0, 0);
gb = jb.Ea;
of = Math.max(gb.width + Le, 0);
Bb = Math.max(gb.height + Me, 0);
Pc.q(Math.max(of, Pc.width), Math.max(Bb, Pc.height))
}
}
if (1 === n)e.width = of, e.height = Bb, t.ck(Pc); else {
var mb =
rl(Ab), oe = sl(Ab), Db, lc;
oe.x !== mb.x && oe.y !== mb.y && (Db = Pc.width / Math.abs(oe.x - mb.x), lc = Pc.height / Math.abs(oe.y - mb.y));
t.ck(Pc);
var yd = 0;
Ab instanceof Y && (yd = Ab.ib * Ab.scale, tl(Ab) === Xg && (Db = Math.max(Db, lc), lc = Math.max(Db, lc)));
Db += Math.abs(mb.offsetX) + Math.abs(oe.offsetX) + yd;
lc += Math.abs(mb.offsetY) + Math.abs(oe.offsetY) + yd;
var sc = Ab.Qh;
sc === Wg && (sc = Tj(Ab));
switch (sc) {
case Vg:
Je = Wd = 0;
break;
case Mc:
isFinite(rc) && (Db = rc);
isFinite(zb) && (lc = zb);
break;
case Lj:
isFinite(rc) && (Db = rc);
Je = 0;
break;
case Kj:
Wd = 0,
isFinite(zb) && (lc = zb)
}
Ab instanceof Y && !Ab.Ca.Q() && (Ab.Qg ? Ab.Ak = null : Ab.Ra = null);
ok(Ab);
Ch(Ab, Db, lc, Wd, Je);
e.width = Ab.Ea.width + Ke;
e.height = Ab.Ea.height + me
}
break;
case "Table":
for (var Nb = a, Ne = b, kb = n, cb = c, Jf = d, Dc = t.Db(), Hd = t.Db(), ma = 0; ma < kb; ma++) {
var na = m.p[ma];
if (na instanceof B && (na.type === ck || na.type === dk) && na.visible) {
Hd.push(na);
for (var gg = na.za, Eg = gg.length, Qc = 0; Qc < Eg; Qc++) {
var nh = gg.p[Qc];
na.type === ck ? nh.gc = na.gc : na.type === dk && (nh.column = na.column);
Dc.push(nh)
}
} else Dc.push(na)
}
for (var kb = Dc.length,
ec = [], ma = 0; ma < kb; ma++)na = Dc[ma], Uj(na, !0), Yj(na, !0), ec[na.gc] || (ec[na.gc] = []), ec[na.gc][na.column] || (ec[na.gc][na.column] = []), ec[na.gc][na.column].push(na);
t.Da(Dc);
for (var oh = t.Db(), Rc = t.Db(), Zd = t.Db(), Ec = {count: 0}, hd = {count: 0}, yc = Nb, id = Ne, Kf = this.Zc, kb = Kf.length, ma = 0; ma < kb; ma++) {
var fa = Kf[ma];
void 0 !== fa && ul(fa, 0)
}
Kf = this.Vc;
kb = Kf.length;
for (ma = 0; ma < kb; ma++)fa = Kf[ma], void 0 !== fa && ul(fa, 0);
for (var Id = ec.length, hg = 0, ma = 0; ma < Id; ma++)ec[ma] && (hg = Math.max(hg, ec[ma].length));
for (var oj = Math.min(this.yi,
Id - 1), ig = Math.min(this.ii, hg - 1), Sc, Id = ec.length, ma = oj; ma < Id; ma++)if (ec[ma]) {
var hg = ec[ma].length, pb = this.ne(ma);
ul(pb, 0);
for (Qc = ig; Qc < hg; Qc++)if (ec[ma][Qc]) {
var lb = this.me(Qc);
void 0 === oh[Qc] && (ul(lb, 0), oh[Qc] = !0);
for (var pj = ec[ma][Qc], ph = pj.length, jg = 0; jg < ph; jg++)if (na = pj[jg], na.visible || na === this.Ub) {
var kg = 1 < na.Fj || 1 < na.fj;
kg && Rc.push(na);
var mc = na.margin, Lf = mc.right + mc.left, Mf = mc.top + mc.bottom, Yb = qk(na, pb, lb), qh = na.Ca, Nf = !isNaN(qh.width), pe = !isNaN(qh.height), ki = Nf && pe;
kg || Yb === Vg || ki || (void 0 ===
Ec[Qc] && (Ec[Qc] = -1, Ec.count++), void 0 === hd[ma] && (hd[ma] = -1, hd.count++), Zd.push(na));
Ch(na, Infinity, Infinity, 0, 0);
var Oe = na.Ea, Pe = Math.max(Oe.width + Lf, 0), Qe = Math.max(Oe.height + Mf, 0);
1 !== na.Fj || !pe && Yb !== Vg && Yb !== Lj || (fa = this.ne(ma), Sc = Math.max(Qe - fa.Yb, 0), Sc > id && (Sc = id), ul(fa, fa.Yb + Sc), id = Math.max(id - Sc, 0));
1 !== na.fj || !Nf && Yb !== Vg && Yb !== Kj || (fa = this.me(Qc), Sc = Math.max(Pe - fa.Yb, 0), Sc > yc && (Sc = yc), ul(fa, fa.Yb + Sc), yc = Math.max(yc - Sc, 0));
kg && ok(na)
}
}
}
t.Da(oh);
for (var $d = 0, Ob = 0, kb = this.Pv, ma = 0; ma < kb; ma++)void 0 !==
this.Vc[ma] && ($d += this.me(ma).Fb);
kb = this.Hw;
for (ma = 0; ma < kb; ma++)void 0 !== this.Zc[ma] && (Ob += this.ne(ma).Fb);
for (var yc = Math.max(Nb - $d, 0), rh = id = Math.max(Ne - Ob, 0), sh = yc, kb = Zd.length, ma = 0; ma < kb; ma++) {
var na = Zd[ma], pb = this.ne(na.gc), lb = this.me(na.column), qe = na.Ea, mc = na.margin, Lf = mc.right + mc.left, Mf = mc.top + mc.bottom;
Ec[na.column] = 0 === lb.Yb ? Math.max(qe.width + Lf, Ec[na.column]) : null;
hd[na.gc] = 0 === pb.Yb ? Math.max(qe.height + Mf, hd[na.gc]) : null
}
var Fg = 0, lg = 0;
for (ma in hd)"count" !== ma && (Fg += hd[ma]);
for (ma in Ec)"count" !==
ma && (lg += Ec[ma]);
for (var vb = t.xl(), ma = 0; ma < kb; ma++)if (na = Zd[ma], na.visible || na === this.Ub) {
var pb = this.ne(na.gc), lb = this.me(na.column), pf;
isFinite(lb.width) ? pf = lb.width : (pf = isFinite(yc) && null !== Ec[na.column] ? 0 === lg ? lb.Yb + yc : Ec[na.column] / lg * sh : null !== Ec[na.column] ? yc : lb.Yb || yc, pf = Math.max(0, pf - ql(lb)));
var Jd;
isFinite(pb.height) ? Jd = pb.height : (Jd = isFinite(id) && null !== hd[na.gc] ? 0 === Fg ? pb.Yb + id : hd[na.gc] / Fg * rh : null !== hd[na.gc] ? id : pb.Yb || id, Jd = Math.max(0, Jd - ql(pb)));
vb.q(Math.max(lb.Mh, Math.min(pf, lb.rf)),
Math.max(pb.Mh, Math.min(Jd, pb.rf)));
Yb = qk(na, pb, lb);
switch (Yb) {
case Lj:
vb.height = Infinity;
break;
case Kj:
vb.width = Infinity
}
mc = na.margin;
Lf = mc.right + mc.left;
Mf = mc.top + mc.bottom;
ok(na);
Ch(na, vb.width, vb.height, lb.Mh, pb.Mh);
Oe = na.Ea;
Pe = Math.max(Oe.width + Lf, 0);
Qe = Math.max(Oe.height + Mf, 0);
isFinite(yc) && (Pe = Math.min(Pe, vb.width));
isFinite(id) && (Qe = Math.min(Qe, vb.height));
var qf;
qf = pb.Yb;
ul(pb, Math.max(pb.Yb, Qe));
Sc = pb.Yb - qf;
id = Math.max(id - Sc, 0);
qf = lb.Yb;
ul(lb, Math.max(lb.Yb, Pe));
Sc = lb.Yb - qf;
yc = Math.max(yc -
Sc, 0)
}
t.Da(Zd);
for (var ae = t.xl(), kb = Rc.length, ma = 0; ma < kb; ma++)if (na = Rc[ma], na.visible || na === this.Ub) {
pb = this.ne(na.gc);
lb = this.me(na.column);
vb.q(Math.max(lb.Mh, Math.min(Nb, lb.rf)), Math.max(pb.Mh, Math.min(Ne, pb.rf)));
Yb = qk(na, pb, lb);
switch (Yb) {
case Mc:
0 !== lb.Yb && (vb.width = Math.min(vb.width, lb.Yb));
0 !== pb.Yb && (vb.height = Math.min(vb.height, pb.Yb));
break;
case Lj:
0 !== lb.Yb && (vb.width = Math.min(vb.width, lb.Yb));
break;
case Kj:
0 !== pb.Yb && (vb.height = Math.min(vb.height, pb.Yb))
}
isFinite(lb.width) && (vb.width =
lb.width);
isFinite(pb.height) && (vb.height = pb.height);
ae.q(0, 0);
for (var tc = 1; tc < na.Fj && !(na.gc + tc >= this.Hw); tc++)fa = this.ne(na.gc + tc), ae.height += Math.max(fa.Mh, isNaN(fa.Ff) ? fa.rf : Math.min(fa.Ff, fa.rf));
for (tc = 1; tc < na.fj && !(na.column + tc >= this.Pv); tc++)fa = this.me(na.column + tc), ae.width += Math.max(fa.Mh, isNaN(fa.Ff) ? fa.rf : Math.min(fa.Ff, fa.rf));
vb.width += ae.width;
vb.height += ae.height;
mc = na.margin;
Lf = mc.right + mc.left;
Mf = mc.top + mc.bottom;
Ch(na, vb.width, vb.height, cb, Jf);
for (var Oe = na.Ea, Pe = Math.max(Oe.width +
Lf, 0), Qe = Math.max(Oe.height + Mf, 0), Of = 0, tc = 0; tc < na.Fj; tc++)fa = this.ne(na.gc + tc), Of += fa.total || 0;
if (Of < Qe)for (var uc = Qe - Of; 0 < uc;) {
var kd = fa.Fb || 0;
isNaN(fa.height) && fa.rf > kd && (ul(fa, Math.min(fa.rf, kd + uc)), fa.Fb !== kd && (uc -= fa.Fb - kd));
if (-1 === fa.index - 1)break;
fa = this.ne(fa.index - 1)
}
for (var mg = 0, tc = 0; tc < na.fj; tc++)fa = this.me(na.column + tc), mg += fa.total || 0;
if (mg < Pe)for (uc = Pe - mg; 0 < uc;) {
kd = fa.Fb || 0;
isNaN(fa.width) && fa.rf > kd && (ul(fa, Math.min(fa.rf, kd + uc)), fa.Fb !== kd && (uc -= fa.Fb - kd));
if (-1 === fa.index - 1)break;
fa = this.me(fa.index - 1)
}
}
t.Da(Rc);
t.ck(ae);
t.ck(vb);
for (var be = 0, Pf = 0, Yb = Tj(this), rf = this.Ca, Re = this.Ge, ce = Ob = $d = 0, de = 0, kb = this.Pv, ma = 0; ma < kb; ma++)void 0 !== this.Vc[ma] && (fa = this.me(ma), isFinite(fa.width) ? (ce += fa.width, ce += ql(fa)) : vl(fa) === wl ? (ce += fa.Fb, ce += ql(fa)) : 0 !== fa.Fb && ($d += fa.Fb, $d += ql(fa)));
var be = isFinite(rf.width) ? Math.min(rf.width, Re.width) : Yb !== Vg && isFinite(Nb) ? Nb : $d, be = Math.max(be, this.Ye.width), be = Math.max(be - ce, 0), Se = Math.max(be / $d, 1);
isFinite(Se) || (Se = 1);
for (ma = 0; ma < kb; ma++)void 0 !==
this.Vc[ma] && (fa = this.me(ma), isFinite(fa.width) || vl(fa) === wl || ul(fa, fa.Fb * Se), fa.rb = e.width, 0 !== fa.Fb && (e.width += fa.Fb, e.width += ql(fa)));
kb = this.Hw;
for (ma = 0; ma < kb; ma++)void 0 !== this.Zc[ma] && (fa = this.ne(ma), isFinite(fa.height) ? (de += fa.height, de += ql(fa)) : vl(fa) === wl ? (de += fa.Fb, de += ql(fa)) : 0 !== fa.Fb && (Ob += fa.Fb, Ob += ql(fa)));
var Pf = isFinite(rf.height) ? Math.min(rf.height, Re.height) : Yb !== Vg && isFinite(Ne) ? Ne : Ob, Pf = Math.max(Pf, this.Ye.height), Pf = Math.max(Pf - de, 0), th = Math.max(Pf / Ob, 1);
isFinite(th) || (th = 1);
for (ma = 0; ma < kb; ma++)void 0 !== this.Zc[ma] && (fa = this.ne(ma), isFinite(fa.height) || vl(fa) === wl || ul(fa, fa.Fb * th), fa.rb = e.height, 0 !== fa.Fb && (e.height += fa.Fb, e.height += ql(fa)));
kb = Hd.length;
for (ma = 0; ma < kb; ma++) {
var Kd = Hd[ma];
Kd.type === ck ? (pf = e.width, fa = this.ne(Kd.gc), Jd = fa.Yb) : (fa = this.me(Kd.column), pf = fa.Yb, Jd = e.height);
Kd.Kc.q(0, 0, pf, Jd);
Uj(Kd, !1);
ec[Kd.gc] || (ec[Kd.gc] = []);
ec[Kd.gc][Kd.column] || (ec[Kd.gc][Kd.column] = []);
ec[Kd.gc][Kd.column].push(Kd)
}
t.Da(Hd);
this.dv = ec;
break;
case "Viewbox":
var rj = a, sj =
b, no = c, oo = d;
1 < n && t.m("Viewbox Panel cannot contain more than one GraphObject.");
var ee = m.p[0];
ee.Sb = 1;
ok(ee);
Ch(ee, Infinity, Infinity, no, oo);
var li = ee.Ea, tj = ee.margin, po = tj.right + tj.left, qo = tj.top + tj.bottom;
if (isFinite(rj) || isFinite(sj)) {
var qq = ee.scale, ro = li.width, so = li.height, to = Math.max(rj - po, 0), uo = Math.max(sj - qo, 0);
ee.Sb = this.so === Xg ? ee.Sb * Math.min(to / ro, uo / so) : ee.Sb * Math.max(to / ro, uo / so);
qq !== ee.scale && (Uj(ee, !0), Ch(ee, Infinity, Infinity, no, oo))
}
li = ee.Ea;
e.width = isFinite(rj) ? rj : Math.max(li.width +
po, 0);
e.height = isFinite(sj) ? sj : Math.max(li.height + qo, 0);
break;
case "Link":
var uj = this instanceof Ue ? this.Pj : this;
if (0 === n) {
var vj = this.Lc;
nb(vj, 0, 0);
var Ld = this.Ea;
Ld.q(0, 0, 0, 0)
} else {
var wj = this.Gq(), Te = this.nj(), re = this.zi;
re.assign(Te);
re.x = 0;
re.y = 0;
var uh, mi = this.hy();
uh = void 0 !== this.ma ? this.ma : mi.count;
this.ji.q(Te.x, Te.y);
this.Xh.clear();
null !== wj && (xl(wj, Te.width, Te.height), Ld = wj.Ea, re.mk(Ld), this.Xh.add(Ld));
for (var vh = t.ah(), ng = t.O(), Qf = t.O(), ll = 0; ll < n; ll++) {
var Rb = m.p[ll];
if (Rb !== wj)if (Rb.Ih &&
Rb instanceof Y)xl(Rb, Te.width, Te.height), Ld = Rb.Ea, re.mk(Ld), this.Xh.add(Ld); else if (2 > uh)Ch(Rb, Infinity, Infinity), Ld = Rb.Ea, re.mk(Ld), this.Xh.add(Ld); else {
var Rf = Rb.uf, wo = Rb.st, ml = Rb.Qj;
ml.pd() && (ml = Ub);
var xj = Rb.tt, rq = Rb.VA, ni, oi, yj = 0;
if (Rf < -uh || Rf >= uh) {
var xo = uj.SE, zj = uj.RE;
xj !== Hg && (yj = uj.computeAngle(Rb, xj, zj), Rb.angle = yj);
ni = xo.x - Te.x;
oi = xo.y - Te.y
} else {
var sf, wh;
if (0 <= Rf)sf = mi.p[Rf], wh = Rf < uh - 1 ? mi.p[Rf + 1] : sf; else {
var nl = uh + Rf;
sf = mi.p[nl];
wh = 0 < nl ? mi.p[nl - 1] : sf
}
zj = 0 <= Rf ? sf.Ji(wh) : wh.Ji(sf);
xj !==
Hg && (yj = uj.computeAngle(Rb, xj, zj), Rb.on = yj);
ni = sf.x + (wh.x - sf.x) * wo - Te.x;
oi = sf.y + (wh.y - sf.y) * wo - Te.y
}
Ch(Rb, Infinity, Infinity);
var Ld = Rb.Ea, vj = Rb.Ia, pi = 0;
Rb instanceof Y && (pi = Rb.ib);
var yo = vj.width + pi, zo = vj.height + pi;
vh.reset();
vh.translate(-Ld.x, -Ld.y);
vh.scale(Rb.scale, Rb.scale);
vh.rotate(Rb.angle, yo / 2, zo / 2);
var xh = new D(0, 0, yo, zo);
ng.vt(xh, ml);
vh.Wa(ng);
var sq = -ng.x + pi / 2, tq = -ng.y + pi / 2;
Qf.assign(rq);
isNaN(Qf.x) && (Qf.x = 0 <= Rf ? ng.x + 3 : -(ng.x + 3));
isNaN(Qf.y) && (Qf.y = -(ng.y + 3));
Qf.rotate(zj);
ni += Qf.x;
oi +=
Qf.y;
xh.set(Ld);
xh.x = ni + sq;
xh.y = oi + tq;
this.Xh.add(xh);
re.mk(xh)
}
}
if (this.ff)for (var Ao = this.Si; Ao.next();)Ch(Ao.value, Infinity, Infinity);
this.zi = re;
var Aj = this.ji;
Aj && Aj.q(Aj.x + re.x, Aj.y + re.y);
nb(e, re.width || 0, re.height || 0);
t.Te(vh);
t.B(ng);
t.B(Qf)
}
break;
case "Grid":
break;
case "TableRow":
case "TableColumn":
t.m(this.toString() + " is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");
break;
default:
t.m("Unknown panel type: " + q)
}
var se = e.width, te =
e.height, Bj = this.padding, uq = Bj.top + Bj.bottom, se = se + (Bj.left + Bj.right), te = te + uq;
isFinite(g.width) && (se = g.width);
isFinite(g.height) && (te = g.height);
se = Math.min(k.width, se);
te = Math.min(k.height, te);
se = Math.max(h.width, se);
te = Math.max(h.height, te);
se = Math.max(c, se);
te = Math.max(d, te);
e.width = se;
e.height = te;
p = this.Lc;
nb(p, se, te);
Qj(this, 0, 0, se, te)
}
};
B.prototype.findMainElement = B.prototype.dw = function () {
null === this.qo && nk(this, this.za, this.za.length);
return this.qo
};
function nk(a, b, c) {
for (var d = 0; d < c; d++) {
var e = b.p[d];
if (!0 === e.Ih)return a.qo = e
}
b = b.p[0];
return a.qo = b
}
B.prototype.Tj = function (a, b, c, d) {
var e = this.zi, g = this.za, h = g.length, k = t.kk(0, 0, 0, 0);
if (0 === h) {
var l = this.ya;
l.x = a;
l.y = b;
l.width = c;
l.height = d
} else {
if (!this.Ca.Q()) {
var m = Tj(this), n = this.Kc, p = n.width, q = n.height, r = this.margin, s = r.left + r.right, v = r.top + r.bottom;
p === c && q === d && (m = Vg);
switch (m) {
case Vg:
if (p > c || q > d)this.aa(), Ch(this, p > c ? c : p, q > d ? d : q);
break;
case Mc:
Uj(this, !0);
Ch(this, c + s, d + v, 0, 0);
break;
case Lj:
Uj(this, !0);
Ch(this, c + s, q + v, 0, 0);
break;
case Kj:
Uj(this, !0), Ch(this, p + s, d + v, 0, 0)
}
}
l = this.ya;
l.x = a;
l.y = b;
l.width = c;
l.height = d;
var x = this.ba.Rb;
switch (x) {
case "Position":
for (var E = e.x - this.padding.left, F = e.y - this.padding.top, G = 0; G < h; G++) {
var L = g.p[G], N = L.Ea, V = L.margin, T = L.position.x, W = L.position.y;
k.x = isNaN(T) ? -E : T - E;
k.y = isNaN(W) ? -F : W - F;
if (L instanceof Y && L.jA) {
var ea = L.ib / 2;
k.x -= ea;
k.y -= ea
}
k.x += V.left;
k.y += V.top;
k.width = N.width;
k.height = N.height;
L.visible && L.Ec(k.x, k.y, k.width, k.height)
}
break;
case "Vertical":
for (var R = this.padding.left, xa = this.padding.top, Ja = 0; Ja < h; Ja++) {
var Ma = R, Na = g.p[Ja], ya =
Na.Ea, Ra = Na.margin, Ca = Ra.left + Ra.right, ob = R + this.padding.right, kf = ya.width, hc = Tj(Na);
if (isNaN(Na.Ca.width) && hc === Mc || hc === Lj)kf = Math.max(e.width - Ca - ob, 0);
var lf = kf + Ca + ob, ic = Na.alignment;
ic.Gc() && (ic = this.Xj);
ic.qd() || (ic = Ub);
k.x = Ma + ic.offsetX + Ra.left + (e.width * ic.x - lf * ic.x);
k.y = xa + ic.offsetY + Ra.top;
k.width = kf;
k.height = ya.height;
Na.visible && (Na.Ec(k.x, k.y, k.width, k.height), xa += ya.height + Ra.bottom + Ra.top)
}
break;
case "Horizontal":
for (var hb = this.padding.top, ib = this.padding.left, Ga = 0; Ga < h; Ga++) {
var Ka =
hb, bb = g.p[Ga], tb = bb.Ea, Ya = bb.margin, Hf = Ya.top + Ya.bottom, ed = hb + this.padding.bottom, vd = tb.height, Ed = Tj(bb);
if (isNaN(bb.Ca.height) && Ed === Mc || Ed === Kj)vd = Math.max(e.height - Hf - ed, 0);
var Ud = vd + Hf + ed, wd = bb.alignment;
wd.Gc() && (wd = this.Xj);
wd.qd() || (wd = Ub);
k.x = ib + wd.offsetX + Ya.left;
k.y = Ka + wd.offsetY + Ya.top + (e.height * wd.y - Ud * wd.y);
k.width = tb.width;
k.height = vd;
bb.visible && (bb.Ec(k.x, k.y, k.width, k.height), ib += tb.width + Ya.left + Ya.right)
}
break;
case "Spot":
var Vd = nk(this, g, h), Dg = Vd.Ea, Cb = Dg.width, mf = Dg.height, Ib =
this.padding, dc = Ib.left, Lb = Ib.top;
k.x = dc - e.x;
k.y = Lb - e.y;
Vd.Ec(k.x, k.y, Cb, mf);
for (var Sa = 0; Sa < h; Sa++) {
var jc = g.p[Sa];
if (jc !== Vd) {
var Ie = jc.Ea, If = Ie.width, fg = Ie.height, Fb = jc.alignment;
Fb.Gc() && (Fb = this.Xj);
Fb.qd() || (Fb = Ub);
var fd = jc.Qj;
fd.Gc() && (fd = Ub);
k.x = Fb.x * Cb + Fb.offsetX - (fd.x * If - fd.offsetX);
k.y = Fb.y * mf + Fb.offsetY - (fd.y * fg - fd.offsetY);
k.x -= e.x;
k.y -= e.y;
jc.visible && jc.Ec(dc + k.x, Lb + k.y, If, fg)
}
}
break;
case "Auto":
var qc = nk(this, g, h), gd = qc.Ea, Za = t.xf();
Za.q(0, 0, 1, 1);
var fb = qc.margin, Xb = fb.left, ub = fb.top,
kc = this.padding, nf = kc.left, rc = kc.top;
k.x = Xb;
k.y = ub;
k.width = gd.width;
k.height = gd.height;
qc.Ec(nf + k.x, rc + k.y, k.width, k.height);
var zb = rl(qc), Wd = sl(qc), Je = 0 + zb.y * gd.height + zb.offsetY, Ab = 0 + Wd.x * gd.width + Wd.offsetX, Fd = 0 + Wd.y * gd.height + Wd.offsetY;
Za.x = 0 + zb.x * gd.width + zb.offsetX;
Za.y = Je;
xb(Za, Ab, Fd, 0, 0);
Za.x += Xb + nf;
Za.y += ub + rc;
for (var Ke = 0; Ke < h; Ke++) {
var me = g.p[Ke];
if (me !== qc) {
var gb = me.Ea, fb = me.margin, of = Math.max(gb.width + fb.right + fb.left, 0), Bb = Math.max(gb.height + fb.top + fb.bottom, 0), $a = me.alignment;
$a.Gc() &&
($a = this.Xj);
$a.qd() || ($a = Ub);
k.x = Za.width * $a.x + $a.offsetX - of * $a.x + fb.left + Za.x;
k.y = Za.height * $a.y + $a.offsetY - Bb * $a.y + fb.top + Za.y;
k.width = Za.width;
k.height = Za.height;
me.visible && (yb(Za.x, Za.y, Za.width, Za.height, k.x, k.y, gb.width, gb.height) ? me.Ec(k.x, k.y, gb.width, gb.height) : me.Ec(k.x, k.y, gb.width, gb.height, new D(Za.x, Za.y, Za.width, Za.height)))
}
}
t.Qc(Za);
break;
case "Table":
for (var Oc = this.padding, Mb = Oc.left, Gd = Oc.top, Xd = this.dv, Yd, ne, Pc = Xd.length, xd = 0, jb = 0; jb < Pc; jb++)Xd[jb] && (xd = Math.max(xd, Xd[jb].length));
for (var Le = Math.min(this.yi, Pc - 1); Le !== Pc && (void 0 === this.Zc[Le] || 0 === this.Zc[Le].Fb);)Le++;
for (var Le = Math.min(Le, Pc - 1), Me = -this.Zc[Le].rb, mb = Math.min(this.ii, xd - 1); mb !== xd && (void 0 === this.Vc[mb] || 0 === this.Vc[mb].Fb);)mb++;
for (var mb = Math.min(mb, xd - 1), oe = -this.Vc[mb].rb, Db = t.xl(), jb = 0; jb < Pc; jb++)if (Xd[jb]) {
var xd = Xd[jb].length, lc = this.ne(jb);
ne = lc.rb + Me + Gd + yl(lc);
for (var yd = 0; yd < xd; yd++)if (Xd[jb][yd]) {
var sc = this.me(yd);
Yd = sc.rb + oe + Mb + yl(sc);
for (var Nb = Xd[jb][yd], Ne = Nb.length, kb = 0; kb < Ne; kb++) {
var cb =
Nb[kb], Jf = cb.Ea;
if (cb instanceof B && (cb.type === ck || cb.type === dk)) {
Vj(cb);
cb.Gb.Va();
var Dc = cb.Gb;
Dc.x = cb.type === ck ? Mb : Yd;
Dc.y = cb.type === dk ? Gd : ne;
Dc.width = Jf.width;
Dc.height = Jf.height;
cb.Gb.freeze();
Yj(cb, !1)
} else {
Db.q(0, 0);
for (var Hd = 1; Hd < cb.rowSpan && !(jb + Hd >= this.Hw); Hd++) {
var ma = this.ne(jb + Hd);
Db.height += ma.total
}
for (Hd = 1; Hd < cb.tD && !(yd + Hd >= this.Pv); Hd++) {
var na = this.me(yd + Hd);
Db.width += na.total
}
var gg = sc.Fb + Db.width, Eg = lc.Fb + Db.height;
k.x = Yd;
k.y = ne;
k.width = gg;
k.height = Eg;
ne + Eg > e.height && (Eg = Math.max(e.height -
ne, 0));
Yd + gg > e.width && (gg = Math.max(e.width - Yd, 0));
var Qc = Yd, nh = ne, ec = gg, oh = Eg, Rc = cb.alignment, Zd, Ec, hd, yc;
if (Rc.Gc()) {
Rc = this.Xj;
Rc.qd() || (Rc = Ub);
Zd = Rc.x;
Ec = Rc.y;
hd = Rc.offsetX;
yc = Rc.offsetY;
var id = sc.alignment, Kf = lc.alignment;
id.qd() && (Zd = id.x, hd = id.offsetX);
Kf.qd() && (Ec = Kf.y, yc = Kf.offsetY)
} else Zd = Rc.x, Ec = Rc.y, hd = Rc.offsetX, yc = Rc.offsetY;
if (isNaN(Zd) || isNaN(Ec))Ec = Zd = 0.5, yc = hd = 0;
var fa = Jf.width, Id = Jf.height, hg = cb.Ge, oj = cb.Ye, fa = Math.min(hg.width, fa), Id = Math.min(hg.height, Id), fa = Math.max(oj.width,
fa), Id = Math.max(oj.height, Id), ig = cb.margin, Sc = ig.left + ig.right, pb = ig.top + ig.bottom, lb = qk(cb, lc, sc);
if (isNaN(cb.Ca.width) && isNaN(sc.width) && lb === Mc || lb === Lj)fa = Math.max(gg - Sc, 0);
if (isNaN(cb.Ca.height) && isNaN(lc.height) && lb === Mc || lb === Kj)Id = Math.max(Eg - pb, 0);
var pj = Id + pb;
k.x += k.width * Zd - (fa + Sc) * Zd + hd + ig.left;
k.y += k.height * Ec - pj * Ec + yc + ig.top;
cb.visible && (yb(Qc, nh, ec, oh, k.x, k.y, fa, Id) ? cb.Ec(k.x, k.y, fa, Id) : cb.Ec(k.x, k.y, fa, Id, new D(Qc, nh, ec, oh)))
}
}
}
}
t.ck(Db);
for (jb = 0; jb < h; jb++)cb = g.p[jb], cb instanceof
B && (cb.type === ck || cb.type === dk) && (Dc = cb.Gb, cb.Lc.Va(), cb.Lc.Fp(0, 0, Dc.width, Dc.height), cb.Lc.freeze());
break;
case "Viewbox":
var ph = g.p[0], jg = ph.Ea, kg = ph.margin, mc = kg.top + kg.bottom, Lf = Math.max(jg.width + (kg.right + kg.left), 0), Mf = Math.max(jg.height + mc, 0), Yb = ph.alignment;
Yb.Gc() && (Yb = this.Xj);
Yb.qd() || (Yb = Ub);
k.x = e.width * Yb.x - Lf * Yb.x + Yb.offsetX;
k.y = e.height * Yb.y - Mf * Yb.y + Yb.offsetY;
k.width = jg.width;
k.height = jg.height;
ph.Ec(k.x, k.y, k.width, k.height);
break;
case "Link":
var qh = this.Gq(), Nf = 0;
if (null !== qh &&
Nf < this.Xh.count) {
var pe = this.Xh.p[Nf];
Nf++;
qh.Ec(pe.x - this.zi.x, pe.y - this.zi.y, pe.width, pe.height)
}
for (var ki = 0; ki < h; ki++) {
var Oe = g.p[ki];
Oe !== qh && Nf < this.Xh.count && (pe = this.Xh.p[Nf], Nf++, Oe.Ec(pe.x - this.zi.x, pe.y - this.zi.y, pe.width, pe.height))
}
var Pe = this.hy(), Qe = Pe.count;
if (2 <= Qe && this.ff)for (var $d = this.Si; $d.next();) {
var Ob = $d.value, rh = Qe, sh = Pe, qe = Ob.uf, Fg = Ob.st, lg = Ob.Qj;
lg.pd() && (lg = Ub);
var vb = Ob.tt, pf = Ob.VA, Jd = void 0, qf = void 0, ae = 0;
if (qe < -rh || qe >= rh) {
var tc = this.SE, Of = this.RE;
vb !== Hg && (ae =
this.computeAngle(Ob, vb, Of), Ob.angle = ae);
Jd = tc.x;
qf = tc.y
} else {
var uc = void 0, kd = void 0;
if (0 <= qe)uc = sh.p[qe], kd = qe < rh - 1 ? sh.p[qe + 1] : uc; else var mg = rh + qe, uc = sh.p[mg], kd = 0 < mg ? sh.p[mg - 1] : uc;
Of = 0 <= qe ? uc.Ji(kd) : kd.Ji(uc);
vb !== Hg && (ae = this.computeAngle(Ob, vb, Of), Ob.angle = ae);
Jd = uc.x + (kd.x - uc.x) * Fg;
qf = uc.y + (kd.y - uc.y) * Fg
}
var be = t.ah();
be.reset();
be.scale(Ob.scale, Ob.scale);
be.rotate(Ob.angle, 0, 0);
var Pf = Ob.Ia, rf = t.kk(0, 0, Pf.width, Pf.height), Re = t.O();
Re.vt(rf, lg);
be.Wa(Re);
var ce = -Re.x, de = -Re.y, Se = pf.copy();
isNaN(Se.x) && (Se.x = 0 <= qe ? Re.x + 3 : -(Re.x + 3));
isNaN(Se.y) && (Se.y = -(Re.y + 3));
Se.rotate(Of);
Jd += Se.x;
qf += Se.y;
be.UF(rf);
var ce = ce + rf.x, de = de + rf.y, th = t.ic(Jd + ce, qf + de);
Ob.move(th);
t.B(th);
t.B(Re);
t.Qc(rf);
t.Te(be)
}
this.ww();
break;
case "Grid":
break;
case "TableRow":
case "TableColumn":
t.m(this.toString() + " is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
break;
default:
t.m("Unknown panel type: " + x)
}
t.Qc(k)
}
};
B.prototype.Uj = function (a) {
var b = this.Ia;
if (yb(0, 0, b.width, b.height, a.x, a.y)) {
for (var c = this.za.length, b = t.ic(0, 0); c--;) {
var d = this.za.p[0];
if (d.visible || d === this.Ub)if (Xa(b.set(a), d.transform), d.Ha(b))return t.B(b), !0
}
t.B(b);
return null === this.Hb && null === this.jc ? !1 : !0
}
return!1
};
function zl(a, b, c) {
c(a, b);
if (b instanceof B)for (b = b.elements; b.next();)zl(a, b.value, c)
}
function Mi(a, b) {
Al(a, a, b)
}
function Al(a, b, c) {
c(b);
for (b = b.elements; b.next();) {
var d = b.value;
d instanceof B && Al(a, d, c)
}
}
function Bl(a, b, c) {
if (c(b))return b;
if (b instanceof B)for (b = b.elements; b.next();) {
var d = Bl(a, b.value, c);
if (null !== d)return b.Fg(), d
}
return null
}
B.prototype.findObject = B.prototype.le = function (a) {
if (this.name === a)return this;
for (var b = this.za.p, c = b.length, d = 0; d < c; d++) {
var e = b[d];
if (e.name === a)return e;
if (e instanceof B)if (!e.AE()) {
if (e = e.le(a), null !== e)return e
} else if (Cl(e) && (e = e.za.eb(), null !== e && (e = e.le(a), null !== e)))return e
}
return null
};
function $e(a, b) {
return b(a) ? a : Dl(a, b)
}
function Dl(a, b) {
for (var c = a.elements; c.next();) {
var d = c.value;
if (b(d))return d;
if (d instanceof B && (d = Dl(d, b), null !== d))return d
}
return null
}
function El(a) {
a = a.za.p;
for (var b = a.length, c = 0, d = 0; d < b; d++) {
var e = a[d];
if (e instanceof B)c = Math.max(c, El(e)); else if (e instanceof Y) {
a:{
if (!e.Qg)switch (e.Hn) {
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.fe / 2 * e.qm * e.ek()
}
c = Math.max(c, e)
}
}
return c
}
aa = B.prototype;
aa.bh = function () {
return!(this.type === ck || this.type === dk)
};
aa.Qd = function (a, b, c) {
if (!1 === this.Ze)return null;
void 0 === b && (b = null);
void 0 === c && (c = null);
if (Bi(this))return null;
var d = this.Ia, e = 1 / this.ek(), g = this.bh(), h = g ? a : Xa(t.ic(a.x, a.y), this.transform);
if (yb(-(5 * e), -(5 * e), d.width + 10 * e, d.height + 10 * e, h.x, h.y)) {
if (!this.Ig) {
for (var k = this.za.length, e = t.O(); k--;) {
var l = this.za.p[k];
if (l.visible || l === this.Ub) {
l.bh() ? Xa(e.set(a), l.transform) : e.set(a);
var m = null;
l instanceof B ? m = l.Qd(e, b, c) : !0 === l.Ze && l.Ha(e) && (m = l);
if (null !== m && (null !== b && (m = b(m)), m && (null ===
c || c(m))))return t.B(e), g || t.B(h), m
}
}
t.B(e)
}
if (null === this.background && null === this.Bi)return g || t.B(h), null;
a = yb(0, 0, d.width, d.height, h.x, h.y) ? this : null;
g || t.B(h);
return a
}
g || t.B(h);
return null
};
aa.Po = function (a, b, c, d) {
if (!1 === this.Ze)return!1;
void 0 === b && (b = null);
void 0 === c && (c = null);
d instanceof H || d instanceof ta || (d = new H(X));
var e = this.Ia, g = this.bh(), h = g ? a : Xa(t.ic(a.x, a.y), this.transform);
if (yb(0, 0, e.width, e.height, h.x, h.y)) {
if (!this.Ig) {
for (var k = this.za.length, e = t.O(); k--;) {
var l = this.za.p[k];
if (l.visible || l === this.Ub)l.bh() ? Xa(e.set(a), l.transform) : e.set(a), (l instanceof B ? l.Po(e, b, c, d) : l.Ha(e)) && !1 !== l.Ze && (null !== b && (l = b(l)), l && (null === c || c(l)) && d.add(l))
}
t.B(e)
}
g || t.B(h);
return null !==
this.background || null !== this.Bi
}
g || t.B(h);
return!1
};
aa.bk = function (a, b, c, d, e, g) {
if (!1 === this.Ze)return!1;
void 0 === b && (b = null);
void 0 === c && (c = null);
var h = g;
void 0 === g && (h = t.ah(), h.reset());
h.multiply(this.transform);
if (this.Em(a, h))return Fl(this, b, c, e), void 0 === g && t.Te(h), !0;
if (this.Jf(a, h)) {
if (!this.Ig)for (var k = this.za.length; k--;) {
var l = this.za.p[k];
if (l.visible || l === this.Ub) {
var m = l.ya, n = this.Ia;
if (!(m.x > n.width || m.y > n.height || 0 > m.x + m.width || 0 > m.y + m.height)) {
m = t.ah();
m.set(h);
if (l instanceof B ? l.bk(a, b, c, d, e, m) : Sj(l, a, d, m))null !== b && (l = b(l)), l &&
(null === c || c(l)) && e.add(l);
t.Te(m)
}
}
}
void 0 === g && t.Te(h);
return d
}
void 0 === g && t.Te(h);
return!1
};
function Fl(a, b, c, d) {
for (var e = a.za.length; e--;) {
var g = a.za.p[e];
if (g.visible) {
var h = g.ya, k = a.Ia;
h.x > k.width || h.y > k.height || 0 > h.x + h.width || 0 > h.y + h.height || (g instanceof B && Fl(g, b, c, d), null !== b && (g = b(g)), g && (null === c || c(g)) && d.add(g))
}
}
}
aa.Lm = function (a, b, c, d, e, g) {
if (!1 === this.Ze)return!1;
void 0 === c && (c = null);
void 0 === d && (d = null);
var h = this.Ia, k = this.bh(), l = k ? a : Xa(t.ic(a.x, a.y), this.transform), m = k ? b : Xa(t.ic(b.x, b.y), this.transform), n = l.Zj(m), p = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height || ab(l.x, l.y, 0, 0, 0, h.height) < n || ab(l.x, l.y, 0, h.height, h.width, h.height) < n || ab(l.x, l.y, h.width, h.height, h.width, 0) < n || ab(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 && ab(l.x, l.y, 0, 0, 0, h.height) < n && ab(l.x, l.y, 0, h.height, h.width, h.height) <
n && ab(l.x, l.y, h.width, h.height, h.width, 0) < n && ab(l.x, l.y, h.width, 0, 0, 0) < n;
k || (t.B(l), t.B(m));
if (p) {
if (!this.Ig) {
k = t.O();
l = t.O();
for (m = this.za.length; m--;)if (n = this.za.p[m], n.visible || n === this.Ub) {
var q = n.ya, r = this.Ia;
q.x > r.width || q.y > r.height || 0 > q.x + q.width || 0 > q.y + q.height || (n.bh() ? (q = n.transform, Xa(k.set(a), q), Xa(l.set(b), q)) : (k.set(a), l.set(b)), n instanceof B ? !n.Lm(k, l, c, d, e, g) : !n.XD(k, l, e)) || (null !== c && (n = c(n)), n && (null === d || d(n)) && g.add(n))
}
t.B(k);
t.B(l)
}
return e ? p : h
}
return!1
};
function rl(a) {
var b = a.G;
if (void 0 === b || b === Pb)b = null;
null === b && a instanceof Y && (a = a.Ra, null !== a && (b = a.G));
null === b && (b = Qb);
return b
}
function sl(a) {
var b = a.H;
if (void 0 === b || b === Pb)b = null;
null === b && a instanceof Y && (a = a.Ra, null !== a && (b = a.H));
null === b && (b = Zb);
return b
}
B.prototype.add = B.prototype.add = function (a) {
t.k(a, X, B, "add:element");
this.Rd(this.za.count, a)
};
B.prototype.elt = B.prototype.pa = function (a) {
return this.za.pa(a)
};
B.prototype.insertAt = B.prototype.Rd = function (a, b) {
b instanceof w && t.m("Cannot add a Part to a Panel: " + b);
if (this === b || this.Ri(b))this === b && t.m("Cannot make a Panel contain itself: " + this.toString()), t.m("Cannot make a Panel indirectly contain itself: " + this.toString() + " already contains " + b.toString());
var c = b.ga;
null !== c && c !== this && t.m("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 !== bi || b instanceof Y || t.m("Can only add Shapes to a Grid Panel, not: " + b);
b.ul(this);
b.fm = null;
if (null !== this.Xs) {
var d = b.data;
null !== d && "object" === typeof d && (null === this.$f && (this.$f = new ra(Object, B)), this.$f.add(d, b))
}
var e = this.za, d = -1;
if (c === this) {
for (var g = -1, h = e.count, k = 0; k < h; k++)if (e.p[k] === b) {
g = k;
break
}
if (-1 !== g) {
if (g === a || g + 1 >= e.count && a >= e.count)return;
e.Dd(g);
d = g
} else t.m("element " + b.toString() + " has panel " + c.toString() + " but is not contained by it.")
}
if (0 > a ||
a > e.count)a = e.count;
e.Rd(a, b);
this.aa();
b.aa();
null !== b.rd && (this.oj = !0);
b instanceof B && !0 === b.oj && (this.oj = !0);
c = this.U;
null !== c && (c.zj = null, c.xj = NaN, null !== b.rd && c instanceof y && (c.oj = !0), e = this.h, null !== e && e.Aa.qb || (-1 !== d && c.fd(Dd, "elements", this, b, null, d, null), c.fd(Cd, "elements", this, null, b, null, a)))
};
B.prototype.remove = B.prototype.remove = function (a) {
t.k(a, X, B, "remove:element");
for (var b = this.za, c = b.count, d = -1, e = 0; e < c; e++)if (b.p[e] === a) {
d = e;
break
}
-1 !== d && this.Ue(d)
};
B.prototype.removeAt = B.prototype.Dd = function (a) {
f && t.o(a, B, "removeAt:idx");
0 <= a && this.Ue(a)
};
B.prototype.Ue = function (a) {
var b = this.za, c = b.pa(a);
c.fm = null;
c.ul(null);
if (null !== this.$f) {
var d = c.data;
"object" === typeof d && this.$f.remove(d)
}
b.Dd(a);
Uj(this, !1);
this.aa();
b = this.U;
null !== b && (b.zj = null, b.xj = NaN, d = this.h, null !== d && d.Aa.qb || b.fd(Dd, "elements", this, c, null, a, null))
};
t.A(B, {Hw: "rowCount"}, function () {
return void 0 === this.Zc ? 0 : this.Zc.length
});
B.prototype.getRowDefinition = B.prototype.ne = function (a) {
if (void 0 === this.Zc)return null;
f && t.o(a, B, "getRowDefinition:idx");
0 > a && t.ha(a, ">= 0", B, "getRowDefinition:idx");
a = Math.round(a);
var b = this.Zc;
if (void 0 === b[a]) {
var c = new Fk;
c.ul(this);
c.Sl = !0;
c.se = a;
b[a] = c
}
return b[a]
};
B.prototype.removeRowDefinition = function (a) {
if (void 0 !== this.Zc) {
f && t.o(a, B, "removeRowDefinition:idx");
0 > a && t.ha(a, ">= 0", B, "removeRowDefinition:idx");
a = Math.round(a);
var b = this.Zc;
b[a] && (b[a] = void 0)
}
};
t.A(B, {Pv: "columnCount"}, function () {
return void 0 === this.Vc ? 0 : this.Vc.length
});
B.prototype.getColumnDefinition = B.prototype.me = function (a) {
if (void 0 === this.Vc)return null;
f && t.o(a, B, "getColumnDefinition:idx");
0 > a && t.ha(a, ">= 0", B, "getColumnDefinition:idx");
a = Math.round(a);
var b = this.Vc;
if (void 0 === b[a]) {
var c = new Fk;
c.ul(this);
c.Sl = !1;
c.se = a;
b[a] = c
}
return b[a]
};
B.prototype.removeColumnDefinition = function (a) {
if (void 0 !== this.Vc) {
f && t.o(a, B, "removeColumnDefinition:idx");
0 > a && t.ha(a, ">= 0", B, "removeColumnDefinition:idx");
a = Math.round(a);
var b = this.Vc;
b[a] && (b[a] = void 0)
}
};
t.g(B, "rowSizing", B.prototype.rF);
t.defineProperty(B, {rF: "rowSizing"}, function () {
return void 0 === this.km ? jl : this.km
}, function (a) {
if (void 0 !== this.km) {
var b = this.km;
b !== a && (a !== jl && a !== wl && t.m("rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"), this.km = a, this.aa(), this.i("rowSizing", b, a))
}
});
t.g(B, "columnSizing", B.prototype.sD);
t.defineProperty(B, {sD: "columnSizing"}, function () {
return void 0 === this.Gl ? jl : this.Gl
}, function (a) {
if (void 0 !== this.Gl) {
var b = this.Gl;
b !== a && (a !== jl && a !== wl && t.m("columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None"), this.Gl = a, this.aa(), this.i("columnSizing", b, a))
}
});
t.g(B, "topIndex", B.prototype.mB);
t.defineProperty(B, {mB: "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) && t.m("topIndex must be greater than zero and a real number. Was " + a), this.yi = a, this.aa(), this.i("topIndex", b, a))
}
});
t.g(B, "leftIndex", B.prototype.nA);
t.defineProperty(B, {nA: "leftIndex"}, function () {
return void 0 === this.ii ? 0 : this.ii
}, function (a) {
if (void 0 !== this.ii) {
var b = this.ii;
b !== a && ((!isFinite(a) || 0 > a) && t.m("leftIndex must be greater than zero and a real number. Was " + a), this.ii = a, this.aa(), this.i("leftIndex", b, a))
}
});
B.prototype.findRowForLocalY = function (a) {
if (0 > a)return-1;
if (this.type !== ca)return NaN;
for (var b = 0, c = this.Zc, 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
};
B.prototype.findColumnForLocalX = function (a) {
if (0 > a)return-1;
if (this.type !== ca)return NaN;
for (var b = 0, c = this.Vc, d = c.length, e = this.ii; e < d; e++) {
var g = c[e];
if (void 0 !== g && (b += g.total, a < b))return e
}
return-1
};
t.g(B, "data", B.prototype.data);
t.defineProperty(B, {data: "data"}, function () {
return this.Kl
}, function (a) {
var b = this.Kl;
if (b !== a) {
var c = this instanceof w && !(this instanceof Ue);
c && t.j(a, "object", B, "data");
We(this);
this.Kl = a;
var d = this.h;
null !== d && (c ? this instanceof A ? (null !== b && d.Ck.remove(b), null !== a && d.Ck.add(a, this)) : (null !== b && d.bi.remove(b), null !== a && d.bi.add(a, this)) : (c = this.ga, null !== c && null !== c.$f && (null !== b && c.$f.remove(b), null !== a && c.$f.add(a, this))));
this.i("data", b, a);
null !== d && d.Aa.qb || null !== a && this.Kb()
}
});
function zk(a) {
a = a.Fl;
return null !== a && a.jb
}
function We(a) {
var b = a.Fl;
if (null === b)null !== a.data && t.m("Template cannot have .data be non-null: " + a), a.Fl = b = new H(Ce); else if (b.jb)return;
var c = new H(X);
zl(a, a, function (a, d) {
var e = d.Cc;
if (null !== e) {
sk(d, !1);
for (var g = e.l; g.next();) {
e = g.value;
e.mode === Ee && sk(d, !0);
var h = e.yt;
if (null !== h) {
var q = a;
"" !== h && (q = a.le(h));
null !== q && (c.add(q), void 0 === q.bs && (q.bs = new H(Ce)), q.bs.add(e))
}
b.add(e)
}
}
if (d instanceof B && d.type === ca) {
if (0 < d.Zc.length)for (g = d.Zc, h = g.length, q = 0; q < h; q++) {
var r = g[q];
if (void 0 !== r &&
null !== r.Cc)for (var s = r.Cc.l; s.next();)e = s.value, e.fg = r, e.fz = 2, e.rv = r.index, b.add(e)
}
if (0 < d.Vc.length)for (g = d.Vc, h = g.length, q = 0; q < h; q++)if (r = g[q], void 0 !== r && null !== r.Cc)for (s = r.Cc.l; s.next();)e = s.value, e.fg = r, e.fz = 1, e.rv = r.index, b.add(e)
}
});
for (var d = c.l; d.next();) {
var e = d.value;
if (void 0 !== e.bs) {
sk(e, !0);
for (var g = e.bs.l; g.next();) {
var h = g.value;
null === e.Cc && (e.Cc = new H(Ce));
e.Cc.add(h)
}
}
delete e.bs
}
for (d = b.l; d.next();)e = d.value, g = e.fg, null !== g && (e.fg = null, g === a ? e.en = "" : (g instanceof Fk && (g = g.ga),
e.en = "" !== g.name ? g.name : g.name = "_" + t.oc(g)));
b.freeze();
a instanceof w && a.Ud() && (Ch(a, Infinity, Infinity), a.Ec())
}
B.prototype.updateTargetBindings = B.prototype.Kb = function (a) {
var b = this.Fl;
if (null !== b)for (void 0 === a && (a = ""), b = b.l; b.next();) {
var c = b.value, d = c.eB;
if ("" === a || d === a)if (d = c.Bt, null !== c.wD || "" !== d) {
var d = this.data, e = c.yt;
null !== e && (d = this.le(e));
if (null === d)f && t.trace("Binding error: missing GraphObject named " + e + " in " + this.toString()); else {
var e = this, g = c.en;
if ("" !== g) {
if (e = this.le(g), null === e)continue
} else null !== c.fg && (e = c.fg);
g = c.fz;
if (0 !== g) {
if (!(e instanceof B))continue;
1 === g ? e = e.me(c.rv) : 2 ===
g && (e = e.ne(c.rv))
}
void 0 !== e && c.aG(e, d)
}
}
}
};
t.g(B, "itemArray", B.prototype.Xs);
t.defineProperty(B, {Xs: "itemArray"}, function () {
return this.rj
}, function (a) {
var b = this.rj;
if (b !== a) {
f && null !== a && !t.isArray(a) && t.m("Panel.itemArray must be an Array-like object or null, not: " + a);
var c = this.h;
null !== c && null !== b && Pi(c, this);
this.rj = a;
null !== c && null !== a && Ni(c, this);
this.i("itemArray", b, a);
null !== c && c.Aa.qb || this.KA()
}
});
function Cl(a) {
return a.type === Tg || a.type === Wh || a.type === Bg
}
B.prototype.rebuildItemElements = B.prototype.KA = function () {
var a = 0;
for (Cl(this) && (a = 1); this.za.length > a;)this.Ue(a);
a = this.Xs;
if (null !== a)for (var b = t.yb(a), c = 0; c < b; c++)aj(this, t.sb(a, c), c)
};
function aj(a, b, c) {
if (void 0 !== b && null !== b) {
var d = a.getCategoryForItemData(b, c), e = a.findTemplateForItemData(b, c, d);
e instanceof B && (We(e), e = e.copy(), "object" === typeof b && (null === a.$f && (a.$f = new ra(Object, B)), a.$f.add(b, e)), a.type !== Tg && a.type !== Wh || c++, a.Rd(c, e), Gl(e, c), bj(a, c), e.zy = d, e.data = b)
}
}
function bj(a, b) {
for (var c = a.za, d = b + 1; d < c.length;) {
var e = c.pa(d);
e instanceof B && Gl(e, d);
d++
}
}
function Gl(a, b) {
a.type === ck ? a.gc = b : a.type === dk && (a.column = b)
}
B.prototype.isItemPanel = B.prototype.AE = function () {
return null !== this.rj || null !== this.Jg
};
t.g(B, "itemTemplate", B.prototype.wI);
t.defineProperty(B, {wI: "itemTemplate"}, function () {
return null === this.Jg ? null : this.Jg.Ba("")
}, function (a) {
if (null === this.Jg) {
if (null === a)return;
this.Jg = new ra("string", B)
}
var b = this.Jg.Ba("");
b !== a && (t.k(a, B, B, "itemTemplate"), a instanceof w && t.m("itemTemplate must not be a Part: " + a), this.Jg.add("", a), this.i("itemTemplate", b, a), a = this.h, null !== a && a.Aa.qb || this.KA())
});
t.g(B, "itemTemplateMap", B.prototype.DE);
t.defineProperty(B, {DE: "itemTemplateMap"}, function () {
return this.Jg
}, function (a) {
var b = this.Jg;
if (b !== a) {
t.k(a, ra, B, "itemTemplateMap");
for (var c = a.l; c.next();) {
var d = c.value;
d instanceof w && t.m("Template in itemTemplateMap must not be a Part: " + d)
}
this.Jg = a;
this.i("itemTemplateMap", b, a);
a = this.h;
null !== a && a.Aa.qb || this.KA()
}
});
t.g(B, "itemCategoryProperty", B.prototype.vI);
t.defineProperty(B, {vI: "itemCategoryProperty"}, function () {
return this.Sn
}, function (a) {
var b = this.Sn;
b !== a && ("string" !== typeof a && "function" !== typeof a && t.Vb(a, "string or function", B, "itemCategoryProperty"), this.Sn = a, this.i("itemCategoryProperty", b, a))
});
B.prototype.getCategoryForItemData = function (a) {
if (null === a)return"";
var b = this.Sn;
if ("function" === typeof b)b = b(a); else if ("string" === typeof b && "object" === typeof a) {
if ("" === b)return"";
b = t.hb(a, b)
} else return"";
if (void 0 === b)return"";
if ("string" === typeof b)return b;
t.m("Panel.getCategoryForItemData found a non-string category for " + a + ": " + b);
return""
};
B.prototype.findTemplateForItemData = function (a, b, c) {
a = this.DE;
b = null;
null !== a && (b = a.Ba(c));
null === b && (t.fG || (t.fG = !0, t.trace('No item template Panel found for category "' + c + '" on ' + this), t.trace(" Using default item template."), c = new B, a = new ua, a.bind(new Ce("text", "", ka)), c.add(a), t.FD = c), b = t.FD);
return b instanceof B ? b : null
};
t.g(B, "isAtomic", B.prototype.mI);
t.defineProperty(B, {mI: "isAtomic"}, function () {
return this.Ig
}, function (a) {
var b = this.Ig;
b !== a && (t.j(a, "boolean", B, "isAtomic"), this.Ig = a, this.i("isAtomic", b, a))
});
t.g(B, "opacity", B.prototype.opacity);
t.defineProperty(B, {opacity: "opacity"}, function () {
return this.Ef
}, function (a) {
var b = this.Ef;
b !== a && (t.j(a, "number", B, "opacity"), (0 > a || 1 < a) && t.ha(a, "0 <= val <= 1", B, "opacity"), this.Ef = a, this.i("opacity", b, a), a = this.h, b = this.U, null !== a && null !== b && a.ua(Kh(b, b.ya)))
});
function Fk() {
t.zc(this);
this.ri = null;
this.Sl = !0;
this.se = 0;
this.Ff = NaN;
this.$l = 0;
this.Zl = Infinity;
this.qe = Pb;
this.rb = this.Fb = 0;
this.Cc = null;
this.Zr = Hl;
this.zh = Wg;
this.Wr = this.Ij = null;
this.Xr = NaN;
this.Hb = this.vh = null;
this.nq = !1
}
t.ia("RowColumnDefinition", Fk);
Fk.prototype.copy = function () {
var a = new Fk;
a.Sl = this.Sl;
a.se = this.se;
a.Ff = this.Ff;
a.$l = this.$l;
a.Zl = this.Zl;
a.qe = this.qe;
a.Fb = this.Fb;
a.rb = this.rb;
a.zh = this.zh;
a.Zr = this.Zr;
a.Ij = null === this.Ij ? null : this.Ij.Z();
a.Wr = this.Wr;
a.Xr = this.Xr;
a.vh = null;
this.vh && (a.vh = this.vh.slice(0));
a.Hb = this.Hb;
a.nq = this.nq;
a.Cc = this.Cc;
return a
};
Fk.prototype.toString = function () {
return"RowColumnDefinition " + (this.Jh ? "(Row " : "(Column ") + this.index + ") #" + t.oc(this)
};
var Hl;
Fk.Default = Hl = t.w(Fk, "Default", 0);
var wl;
Fk.None = wl = t.w(Fk, "None", 1);
var jl;
Fk.ProportionalExtra = jl = t.w(Fk, "ProportionalExtra", 2);
Fk.prototype.ul = function (a) {
this.ri = a
};
function ul(a, b) {
a.Fb = isNaN(a.Ff) ? Math.max(Math.min(a.Zl, b), a.$l) : Math.max(Math.min(a.Zl, a.Ff), a.$l)
}
function yl(a) {
var b = a.ri, c = a.bn;
null === c && (c = a.Jh ? b.ci : b.jh);
var d = a.cn;
isNaN(d) && (d = a.Jh ? b.lh : b.kh);
d = null !== c ? d : 0;
0 === a.index && (d = 0);
c = a.XA;
null === c && (c = b.gj);
return d + (a.Jh ? c.top : c.left)
}
function ql(a) {
var b = a.ri, c = a.bn;
null === c && (c = a.Jh ? b.ci : b.jh);
var d = a.cn;
isNaN(d) && (d = a.Jh ? b.lh : b.kh);
d = null !== c ? d : 0;
0 === a.index && (d = 0);
c = a.XA;
null === c && (c = b.gj);
return d + (a.Jh ? c.top + c.bottom : c.left + c.right)
}
Fk.prototype.Mc = function (a, b, c, d, e) {
var g = this.ri;
if (null !== g) {
g.aa();
for (var h = this.Jh, k = g.za, l = k.length, m = 0; m < l; m++) {
var n = k.p[m];
(h ? n.gc : n.column) === this.index && n.aa()
}
g.fd(Bd, a, this, b, c, d, e);
if (null !== this.Cc && (b = g.Ro(), null !== b && (b = b.data, null !== b)))for (c = this.Cc.l; c.next();)c.value.$F(this, b, a, null)
}
};
t.A(Fk, {ga: "panel"}, function () {
return this.ri
});
t.A(Fk, {Jh: "isRow"}, function () {
return this.Sl
});
t.A(Fk, {index: "index"}, function () {
return this.se
});
t.g(Fk, "height", Fk.prototype.height);
t.defineProperty(Fk, {height: "height"}, function () {
return this.Ff
}, function (a) {
var b = this.Ff;
b !== a && (f && t.j(a, "number", Fk, "height"), 0 > a && t.ha(a, ">= 0", Fk, "height"), this.Ff = a, ul(this, this.Fb), this.Mc("size", b, a))
});
t.g(Fk, "width", Fk.prototype.width);
t.defineProperty(Fk, {width: "width"}, function () {
return this.Ff
}, function (a) {
var b = this.Ff;
b !== a && (f && t.j(a, "number", Fk, "width"), 0 > a && t.ha(a, ">= 0", Fk, "width"), this.Ff = a, ul(this, this.Fb), this.Mc("size", b, a))
});
t.g(Fk, "minimum", Fk.prototype.Mh);
t.defineProperty(Fk, {Mh: "minimum"}, function () {
return this.$l
}, function (a) {
var b = this.$l;
b !== a && (f && t.j(a, "number", Fk, "minimum"), (0 > a || !isFinite(a)) && t.ha(a, ">= 0", Fk, "minimum"), this.$l = a, ul(this, this.Fb), this.Mc("minimum", b, a))
});
t.g(Fk, "maximum", Fk.prototype.rf);
t.defineProperty(Fk, {rf: "maximum"}, function () {
return this.Zl
}, function (a) {
var b = this.Zl;
b !== a && (f && t.j(a, "number", Fk, "maximum"), 0 > a && t.ha(a, ">= 0", Fk, "maximum"), this.Zl = a, ul(this, this.Fb), this.Mc("maximum", b, a))
});
t.g(Fk, "alignment", Fk.prototype.alignment);
t.defineProperty(Fk, {alignment: "alignment"}, function () {
return this.qe
}, function (a) {
var b = this.qe;
b.N(a) || (f && t.k(a, K, Fk, "alignment"), this.qe = a.Z(), this.Mc("alignment", b, a))
});
t.g(Fk, "stretch", Fk.prototype.Qh);
t.defineProperty(Fk, {Qh: "stretch"}, function () {
return this.zh
}, function (a) {
var b = this.zh;
b !== a && (f && t.tb(a, X, Fk, "stretch"), this.zh = a, this.Mc("stretch", b, a))
});
t.g(Fk, "separatorPadding", Fk.prototype.XA);
t.defineProperty(Fk, {XA: "separatorPadding"}, function () {
return this.Ij
}, function (a) {
"number" === typeof a ? a = new rb(a) : null !== a && f && t.k(a, rb, Fk, "separatorPadding");
var b = this.Ij;
null !== a && null !== b && b.N(a) || (null !== a && (a = a.Z()), this.Ij = a, this.Mc("separatorPadding", b, a))
});
t.g(Fk, "separatorStroke", Fk.prototype.bn);
t.defineProperty(Fk, {bn: "separatorStroke"}, function () {
return this.Wr
}, function (a) {
var b = this.Wr;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.Wr = a, this.ga && this.ga.ua(), this.Mc("separatorStroke", b, a))
});
t.g(Fk, "separatorStrokeWidth", Fk.prototype.cn);
t.defineProperty(Fk, {cn: "separatorStrokeWidth"}, function () {
return this.Xr
}, function (a) {
var b = this.Xr;
b !== a && (this.Xr = a, this.ga && this.ga.ua(), this.Mc("separatorStrokeWidth", b, a))
});
t.g(Fk, "separatorDashArray", Fk.prototype.xF);
t.defineProperty(Fk, {xF: "separatorDashArray"}, function () {
return this.vh
}, function (a) {
var b = this.vh;
b !== a && (Array.isArray(a) || t.Vb(a, "Array", Fk, "separatorDashArray:val"), this.vh = a, this.ga && this.ga.ua(), this.Mc("separatorDashArray", b, a))
});
t.g(Fk, "background", Fk.prototype.background);
t.defineProperty(Fk, {background: "background"}, function () {
return this.Hb
}, function (a) {
var b = this.Hb;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.Hb = a, this.ga && this.ga.ua(), this.Mc("background", b, a))
});
t.g(Fk, "coversSeparators", Fk.prototype.Uv);
t.defineProperty(Fk, {Uv: "coversSeparators"}, function () {
return this.nq
}, function (a) {
var b = this.nq;
b !== a && (t.j(a, "boolean", Fk, "coversSeparators"), this.nq = a, this.Mc("coversSeparators", b, a))
});
t.g(Fk, "sizing", Fk.prototype.xt);
t.defineProperty(Fk, {xt: "sizing"}, function () {
return this.Zr
}, function (a) {
var b = this.Zr;
b !== a && (f && t.tb(a, Fk, Fk, "sizing"), this.Zr = a, this.Mc("sizing", b, a))
});
function vl(a) {
if (a.xt === Hl) {
var b = a.ri;
return a.Jh ? b.rF : b.sD
}
return a.xt
}
t.A(Fk, {Yb: "actual"}, function () {
return this.Fb
});
t.A(Fk, {total: "total"}, function () {
return this.Fb + ql(this)
});
t.A(Fk, {position: "position"}, function () {
return this.rb
});
Fk.prototype.bind = Fk.prototype.bind = function (a) {
a.fg = this;
var b = this.ga;
null !== b && (b = b.Ro(), null !== b && zk(b) && t.m("Cannot add a Binding to a RowColumnDefinition that is already frozen: " + a));
null === this.Cc && (this.Cc = new H(Ce));
this.Cc.add(a)
};
function Y() {
X.call(this);
this.Ra = null;
this.Hn = "None";
this.Qg = !1;
this.Fq = Wg;
this.Ak = null;
this.xb = this.Jc = "black";
this.fe = 1;
this.oo = "butt";
this.po = "miter";
this.qm = 10;
this.pm = null;
this.$c = 0;
this.wi = this.vi = Pb;
this.xr = this.wr = 0;
this.Kq = !1;
this.Pq = !0;
this.zr = null;
this.Jn = this.ro = "None";
this.Jq = 1
}
t.ia("Shape", Y);
t.Oa(Y, X);
Y.prototype.cloneProtected = function (a) {
X.prototype.cloneProtected.call(this, a);
a.Ra = this.Ra;
a.Hn = this.Hn;
a.Qg = this.Qg;
a.Fq = this.Fq;
a.Ak = this.Ak;
a.Jc = this.Jc;
a.xb = this.xb;
a.fe = this.fe;
a.oo = this.oo;
a.po = this.po;
a.qm = this.qm;
a.pm = null;
this.pm && (a.pm = this.pm.slice(0));
a.$c = this.$c;
a.vi = this.vi.Z();
a.wi = this.wi.Z();
a.wr = this.wr;
a.xr = this.xr;
a.Kq = this.Kq;
a.Pq = this.Pq;
a.zr = this.zr;
a.ro = this.ro;
a.Jn = this.Jn;
a.Jq = this.Jq
};
Y.prototype.toString = function () {
return"Shape(" + ("None" !== this.Jb ? this.Jb : "None" !== this.fn ? this.fn : this.gw) + ")#" + t.oc(this)
};
function Il(a, b, c, d) {
var e = 0.001, g = d.Ea, h = g.width, g = g.height, k, l, m, n = c.length;
if (!(2 > n)) {
k = c[0][0];
l = c[0][1];
for (var p, q, r, s, v = 0, x = t.Db(), E = 1; E < n; E++)p = c[E], e = p[0], m = p[1], p = e - k, k = m - l, 0 === p && (p = 0.001), q = k / p, s = Math.atan2(k, p), k = Math.sqrt(p * p + k * k), x.push([p, s, q, k]), v += k, k = e, l = m;
k = c[0][0];
l = c[0][1];
c = 0;
e = h;
n = h / 2;
E = 0 === n ? !1 : !0;
m = 0;
r = x[m];
p = r[0];
s = r[1];
q = r[2];
r = r[3];
for (var F = 0; 0.1 <= v;) {
0 === F && (E ? (e = h, c++, e -= n, v -= n, E = !1) : (e = h, c++), 0 === e && (e = 1));
if (e > v) {
t.Da(x);
return
}
e > r ? (F = e - r, e = r) : F = 0;
var G = Math.sqrt(e *
e / (1 + q * q));
0 > p && (G = -G);
k += G;
l += q * G;
a.translate(k, l);
a.rotate(s);
a.translate(-(h / 2), -(g / 2));
0 === F && d.hl(a, b);
a.translate(h / 2, g / 2);
a.rotate(-s);
a.translate(-k, -l);
v -= e;
r -= e;
if (0 !== F) {
m++;
if (m === x.length) {
t.Da(x);
return
}
r = x[m];
p = r[0];
s = r[1];
q = r[2];
r = r[3];
e = F
}
}
t.Da(x)
}
}
Y.prototype.hl = function (a, b) {
if (null !== this.xb || null !== this.Jc) {
null !== this.Jc && gk(this, a, this.Jc, !0);
null !== this.xb && gk(this, a, this.xb, !1);
var c = this.fe;
if (0 === c) {
var d = this.U;
d instanceof Ue && d.type === Bg && d.Oc instanceof Y && (c = d.Oc.ib)
}
a.lineWidth = c;
a.lineJoin = this.po;
a.lineCap = this.oo;
a.miterLimit = this.qm;
var e = !1;
this.U && (e = this.U.Kh);
var g = !0;
null !== this.xb && null === this.Jc && (g = !1);
var d = !1, h = this.Ow;
if (null !== h) {
var k = d = !0;
void 0 !== a.setLineDash ? (a.setLineDash(h), a.lineDashOffset = this.$c) : void 0 !==
a.webkitLineDash ? (a.webkitLineDash = h, a.webkitLineDashOffset = this.$c) : void 0 !== a.mozDash ? (a.mozDash = h, a.mozDashOffset = this.$c) : k = !1
}
var l = this.Ra;
if (null !== l) {
if (l.ba === Nc)a.beginPath(), d && !k ? Oj(a, l.ec, l.nc, l.ld, l.wd, h, this.$c) : (a.moveTo(l.ec, l.nc), a.lineTo(l.ld, l.wd)), null !== this.Jc && hk(a, this.Jc, !0), 0 !== c && null !== this.xb && hk(a, this.xb, !1); else if (l.ba === Tc) {
var m = l.ec, n = l.nc, p = l.ld, l = l.wd, q = Math.min(m, p), r = Math.min(n, l), m = Math.abs(p - m), n = Math.abs(l - n);
null !== this.Jc && (this.Jc instanceof Td && this.Jc.type ===
ie ? (a.beginPath(), a.rect(q, r, m, n), hk(a, this.Jc, !0)) : a.fillRect(q, r, m, n));
if (null !== this.xb) {
if (g && e) {
var s = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur];
a.shadowOffsetX = 0;
a.shadowOffsetY = 0;
a.shadowBlur = 0
}
d && !k ? (k = [
[q, r],
[q + m, r],
[q + m, r + n],
[q, r + n],
[q, r]
], a.beginPath(), Jl(a, k, h, this.$c), hk(a, this.xb, !1)) : 0 !== c && (this.xb instanceof Td && this.xb.type === ie ? (a.beginPath(), a.rect(q, r, m, n), hk(a, this.xb, !1)) : a.strokeRect(q, r, m, n));
g && e && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2])
}
} else if (l.ba ===
Uc)m = l.ec, n = l.nc, p = l.ld, l = l.wd, q = Math.abs(p - m) / 2, r = Math.abs(l - n) / 2, m = Math.min(m, p) + q, n = Math.min(n, l) + r, a.beginPath(), a.moveTo(m, n - r), a.bezierCurveTo(m + J.va * q, n - r, m + q, n - J.va * r, m + q, n), a.bezierCurveTo(m + q, n + J.va * r, m + J.va * q, n + r, m, n + r), a.bezierCurveTo(m - J.va * q, n + r, m - q, n + J.va * r, m - q, n), a.bezierCurveTo(m - q, n - J.va * r, m - J.va * q, n - r, m, n - r), a.closePath(), null !== this.Jc && hk(a, this.Jc, !0), d && !k && (k = t.Db(), J.ye(m, n - r, m + J.va * q, n - r, m + q, n - J.va * r, m + q, n, 0.5, k), J.ye(m + q, n, m + q, n + J.va * r, m + J.va * q, n + r, m, n + r, 0.5, k), J.ye(m, n +
r, m - J.va * q, n + r, m - q, n + J.va * r, m - q, n, 0.5, k), J.ye(m - q, n, m - q, n - J.va * r, m - J.va * q, n - r, m, n - r, 0.5, k), a.beginPath(), Jl(a, k, h, this.$c), t.Da(k)), 0 !== c && null !== this.xb && (g && e && (s = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), hk(a, this.xb, !1), g && e && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2])); else if (l.ba === Kc) {
for (var q = l.Ek, r = q.length, v = 0; v < r; v++) {
var x = q.p[v];
a.beginPath();
a.moveTo(x.na, x.oa);
for (var E = x.Ga.p, F = E.length, G = null, L = 0; L < F; L++) {
var N =
E[L];
switch (N.ba) {
case jd:
a.moveTo(N.D, N.F);
break;
case Wc:
a.lineTo(N.D, N.F);
break;
case ld:
a.bezierCurveTo(N.Og, N.Pg, N.Sk, N.Tk, N.ue, N.ve);
break;
case md:
a.quadraticCurveTo(N.Og, N.Pg, N.ue, N.ve);
break;
case nd:
if (N.radiusX === N.radiusY)G = Math.PI / 180, a.arc(N.rn, N.sn, N.radiusX, N.yg * G, (N.yg + N.Rh) * G, 0 > N.Rh); else for (var G = pd(N, x), V = G.length, T = 0; T < V; T++) {
var W = G[T];
0 === T && a.lineTo(W.x1, W.y1);
a.bezierCurveTo(W.x2, W.y2, W.$d, W.ae, W.Ob, W.Pb)
}
break;
case od:
G && G.type === nd ? (G = pd(G, x), G = G[G.length - 1] || null, null !== G &&
(m = G.Ob, p = G.Pb)) : (m = G ? G.D : x.na, p = G ? G.F : x.oa);
G = qd(N, x, m, p);
V = G.length;
for (T = 0; T < V; T++)W = G[T], a.bezierCurveTo(W.x2, W.y2, W.$d, W.ae, W.Ob, W.Pb);
break;
default:
t.m("Segment not of valid type")
}
N.ph && a.closePath();
G = N
}
e ? x.Qn ? (!0 === x.Pl && null !== this.Jc ? (hk(a, this.Jc, !0), g = !0) : g = !1, 0 !== c && null !== this.xb && (g && (s = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), d && !k || hk(a, this.xb, !1), g && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2]))) : (g && (s =
[a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), !0 === x.Pl && null !== this.Jc && hk(a, this.Jc, !0), 0 !== c && null !== this.xb && (d && !k || hk(a, this.xb, !1)), g && (a.shadowOffsetX = s[0], a.shadowOffsetY = s[1], a.shadowBlur = s[2])) : (!0 === x.Pl && null !== this.Jc && hk(a, this.Jc, !0), 0 === c || null === this.xb || d && !k || hk(a, this.xb, !1))
}
if (d && !k)for (c = g, s = l.Ek, g = s.length, k = 0; k < g; k++) {
l = s.p[k];
a.beginPath();
m = t.Db();
m.push([l.na, l.oa]);
p = l.na;
q = l.oa;
r = p;
v = q;
x = l.Ga.p;
E = x.length;
for (F = 0; F <
E; F++) {
L = x[F];
switch (L.ba) {
case jd:
Jl(a, m, h, this.$c);
m.length = 0;
m.push([L.D, L.F]);
p = L.D;
q = L.F;
r = p;
v = q;
break;
case Wc:
m.push([L.D, L.F]);
p = L.D;
q = L.F;
break;
case ld:
J.ye(p, q, L.Og, L.Pg, L.Sk, L.Tk, L.ue, L.ve, 0.5, m);
p = L.D;
q = L.F;
break;
case md:
J.xp(p, q, L.Og, L.Pg, L.ue, L.ve, 0.5, m);
p = L.D;
q = L.F;
break;
case nd:
N = pd(L, l);
G = N.length;
for (V = 0; V < G; V++)T = N[V], J.ye(p, q, T.x2, T.y2, T.$d, T.ae, T.Ob, T.Pb, 0.5, m), p = T.Ob, q = T.Pb;
break;
case od:
N = qd(L, l, p, q);
G = N.length;
for (V = 0; V < G; V++)T = N[V], J.ye(p, q, T.x2, T.y2, T.$d, T.ae, T.Ob, T.Pb, 0.5,
m), p = T.Ob, q = T.Pb;
break;
default:
t.m("Segment not of valid type")
}
L.ph && (m.push([r, v]), Jl(a, m, h, this.$c))
}
Jl(a, m, h, this.$c);
t.Da(m);
null !== this.xb && (c && e && (n = [a.shadowOffsetX, a.shadowOffsetY, a.shadowBlur], a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), hk(a, this.xb, !1), c && e && (a.shadowOffsetX = n[0], a.shadowOffsetY = n[1], a.shadowBlur = n[2]))
}
}
d && (void 0 !== a.setLineDash ? (a.setLineDash(t.Vh), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = t.Vh, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash &&
(a.mozDash = null, a.mozDashOffset = 0));
if (this.DA) {
d = this.DA;
Ch(d, Infinity, Infinity);
h = d.Ea;
d.Ec(0, 0, h.width, h.height);
a.save();
h = this.dd.ub.eb();
a.beginPath();
n = t.Db();
n.push([h.na, h.oa]);
c = h.na;
e = h.oa;
s = c;
g = e;
k = h.Ga.p;
l = k.length;
for (m = 0; m < l; m++) {
p = k[m];
switch (p.ba) {
case jd:
Il(a, b, n, d);
n.length = 0;
n.push([p.D, p.F]);
c = p.D;
e = p.F;
s = c;
g = e;
break;
case Wc:
n.push([p.D, p.F]);
c = p.D;
e = p.F;
break;
case ld:
J.ye(c, e, p.Og, p.Pg, p.Sk, p.Tk, p.ue, p.ve, 0.5, n);
c = p.D;
e = p.F;
break;
case md:
J.xp(c, e, p.Og, p.Pg, p.ue, p.ve, 0.5, n);
c =
p.D;
e = p.F;
break;
case nd:
q = pd(p, h);
r = q.length;
for (v = 0; v < r; v++)x = q[v], J.ye(c, e, x.x2, x.y2, x.$d, x.ae, x.Ob, x.Pb, 0.5, n), c = x.Ob, e = x.Pb;
break;
case od:
q = qd(p, h, c, e);
r = q.length;
for (v = 0; v < r; v++)x = q[v], J.ye(c, e, x.x2, x.y2, x.$d, x.ae, x.Ob, x.Pb, 0.5, n), c = x.Ob, e = x.Pb;
break;
default:
t.m("Segment not of valid type")
}
p.ph && (n.push([s, g]), Il(a, b, n, d))
}
Il(a, b, n, d);
t.Da(n);
a.restore()
}
}
}
};
function Jl(a, b, c, d) {
var e = 0.001, g = c.length, h, k, l, m = b.length;
if (!(2 > m))if (h = b[0][0], k = b[0][1], 2 === m)Oj(a, h, k, b[1][0], b[1][1], c, d); else {
a.moveTo(h, k);
for (var n, p, q, r = 0, s = t.Db(), v = 1; v < m; v++)n = b[v], e = n[0], l = n[1], n = e - h, h = l - k, 0 === n && (n = 0.001), p = h / n, h = Math.sqrt(n * n + h * h), s.push([n, p, h]), r += h, h = e, k = l;
h = b[0][0];
k = b[0][1];
b = 0;
m = !0;
e = c[b % g];
v = 0 !== d;
l = 0;
q = s[l];
n = q[0];
p = q[1];
q = q[2];
for (var x = 0; 0.1 <= r;) {
0 === x && (e = c[b % g], b++, v && (d %= e, e -= d, v = !1));
e > r && (e = r);
e > q ? (x = e - q, e = q) : x = 0;
var E = Math.sqrt(e * e / (1 + p * p));
0 > n && (E = -E);
h += E;
k += p * E;
m ? a.lineTo(h, k) : a.moveTo(h, k);
r -= e;
q -= e;
if (0 !== x) {
l++;
if (l === s.length) {
t.Da(s);
return
}
q = s[l];
n = q[0];
p = q[1];
q = q[2];
e = x
} else m = !m
}
t.Da(s)
}
}
Y.prototype.getDocumentPoint = Y.prototype.gb = function (a, b) {
void 0 === b && (b = new C);
a.pd() && t.m("Spot must be real");
var c = this.Ia, d = this.ib;
b.q(a.x * (c.width + d) - d / 2 + c.x + a.offsetX, a.y * (c.height + d) - d / 2 + c.y + a.offsetY);
this.he.Wa(b);
return b
};
Y.prototype.Uj = function (a, b) {
var c = this.Ra;
if (null === c || null === this.fill && null === this.stroke)return!1;
var d = c.Mb, e = this.ib / 2;
c.type !== Nc || b || (e += 2);
var g = t.xf();
g.assign(d);
g.Ug(e + 2, e + 2);
if (!g.Ha(a))return t.Qc(g), !1;
d = e + 1E-4;
if (c.type === Nc) {
if (null === this.stroke)return!1;
g = (c.D - c.na) * (a.x - c.na) + (c.F - c.oa) * (a.y - c.oa);
return 0 > (c.na - c.D) * (a.x - c.D) + (c.oa - c.F) * (a.y - c.F) || 0 > g ? !1 : J.Bd(c.na, c.oa, c.D, c.F, e, a.x, a.y)
}
if (c.type === Tc) {
var h = c.na, k = c.oa, l = c.D, m = c.F, c = Math.min(h, l), n = Math.min(k, m), h = Math.abs(l -
h), k = Math.abs(m - k);
g.x = c;
g.y = n;
g.width = h;
g.height = k;
if (null === this.fill) {
g.Ug(-d, -d);
if (g.Ha(a))return!1;
g.Ug(d, d)
}
null !== this.stroke && g.Ug(e, e);
e = g.Ha(a);
t.Qc(g);
return e
}
if (c.type === Uc) {
h = c.na;
k = c.oa;
l = c.D;
m = c.F;
c = Math.min(h, l);
n = Math.min(k, m);
h = Math.abs(l - h);
k = Math.abs(m - k);
g = h / 2;
k /= 2;
c = a.x - (c + g);
n = a.y - (n + k);
if (null === this.fill) {
g -= d;
k -= d;
if (0 >= g || 0 >= k || 1 >= c * c / (g * g) + n * n / (k * k))return!1;
g += d;
k += d
}
null !== this.stroke && (g += e, k += e);
return 0 >= g || 0 >= k ? !1 : 1 >= c * c / (g * g) + n * n / (k * k)
}
if (c.type === Kc)return null ===
this.fill ? sd(c, a.x, a.y, e) : c.Ha(a, e, 1 < this.ib, b);
t.m("Unknown Geometry type");
return!1
};
Y.prototype.$s = function (a, b, c, d) {
var e = this.Ca, g = this.fe;
a = Math.max(a, 0);
b = Math.max(b, 0);
var h;
if (this.Qg)h = this.Ra.Mb; else {
var k = this.Jb, l = J.FA[k];
if (void 0 === l) {
var m = J.Oi[k];
"string" === typeof m && (m = J.Oi[m]);
"function" === typeof m ? (l = m(null, 100, 100), J.FA[k] = l) : t.m("Unsupported Figure:" + k)
}
h = l.Mb
}
var k = h.width, l = h.height, m = h.width, n = h.height;
switch (Tj(this)) {
case Vg:
d = c = 0;
break;
case Mc:
m = Math.max(a - g, 0);
n = Math.max(b - g, 0);
break;
case Lj:
m = Math.max(a - g, 0);
d = 0;
break;
case Kj:
c = 0, n = Math.max(b - g, 0)
}
isFinite(e.width) &&
(m = e.width);
isFinite(e.height) && (n = e.height);
e = this.Ge;
h = this.Ye;
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 = tl(this);
switch (c) {
case Vg:
break;
case Mc:
k = m;
l = n;
break;
case Xg:
c = Math.min(m / k, n / l);
isFinite(c) || (c = 1);
k *= c;
l *= c;
break;
default:
t.m(c + " is not a valid geometryStretch.")
}
if (this.Qg) {
h = this.dd;
d = k;
e = l;
c = h.copy();
h = h.Mb;
d /= h.width;
e /= h.height;
isFinite(d) || (d = 1);
isFinite(e) || (e = 1);
if (1 !== d || 1 !== e)switch (c.type) {
case Nc:
case Tc:
case Uc:
c.na *= d;
c.oa *= e;
c.D *= d;
c.F *= e;
break;
case Kc:
h = c.ub;
for (var p = h.length, q = 0; q < p; q++) {
var r = h.p[q];
r.na *= d;
r.oa *= e;
for (var r = r.Ga, s = r.length, v = 0; v < s; v++) {
var x = r.p[v];
switch (x.type) {
case Wc:
case jd:
x.D *= d;
x.F *= e;
break;
case ld:
x.vb *= d;
x.Lb *= e;
x.oe *= d;
x.pe *= e;
x.D *= d;
x.F *= e;
break;
case md:
x.vb *= d;
x.Lb *= e;
x.D *= d;
x.F *= e;
break;
case nd:
x.Fa *= d;
x.Sa *= e;
x.radiusX *= d;
void 0 !== x.radiusY && (x.radiusY *= e);
break;
case od:
x.D *= d;
x.F *= e;
x.radiusX *=
d;
x.radiusY *= e;
break;
default:
t.m("Unknown Segment type: " + x.type)
}
}
}
}
this.Ra = c
} else if (null === this.Ra || this.Ra.wu !== a - g || this.Ra.vu !== b - g)this.Ra = J.makeGeometry(this, k, l);
h = this.Ra.Mb;
Infinity === a || Infinity === b ? Qj(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) : Qj(this, -(g / 2), -(g / 2), m + g, n + g)
};
function xl(a, b, c) {
if (!1 !== Ai(a)) {
a.Kc.Va();
var d = a.fe;
if (0 === d) {
var e = a.U;
e instanceof Ue && e.type === Bg && e.Oc instanceof Y && (d = e.Oc.ib)
}
d *= a.Sb;
Qj(a, -(d / 2), -(d / 2), b + d, c + d);
b = a.Kc;
c = a.Ge;
d = a.Ye;
b.width = Math.min(c.width, b.width);
b.height = Math.min(c.height, b.height);
b.width = Math.max(d.width, b.width);
b.height = Math.max(d.height, b.height);
a.Kc.freeze();
a.Kc.Q() || t.m("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.Kc.toString());
Uj(a, !1)
}
}
function tl(a) {
var b = a.hw;
return a.Qg ? b === Wg ? Mc : b : b === Wg ? J.FA[a.Jb].kc : b
}
Y.prototype.Tj = function (a, b, c, d) {
Xj(this, a, b, c, d)
};
Y.prototype.getNearestIntersectionPoint = Y.prototype.Wo = function (a, b, c) {
return this.Ls(a.x, a.y, b.x, b.y, c)
};
Y.prototype.Ls = 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.ib / 2, p = this.Ra;
null === p && (Ch(this, Infinity, Infinity), p = this.Ra);
q = p.Mb;
n = !1;
if (p.type === Nc)if (1.5 >= this.ib)n = J.Zg(p.ec, p.nc, p.ld, p.wd, g, h, k, l, e); else {
var r, s;
p.ec === p.ld ? (r = m, s = 0) : (b = (p.wd - p.nc) / (p.ld - p.ec), s = m / Math.sqrt(1 + b * b), r = s * b);
d = t.Db();
b = new C;
J.Zg(p.ec +
r, p.nc + s, p.ld + r, p.wd + s, g, h, k, l, b) && d.push(b);
b = new C;
J.Zg(p.ec - r, p.nc - s, p.ld - r, p.wd - s, g, h, k, l, b) && d.push(b);
b = new C;
J.Zg(p.ec + r, p.nc + s, p.ec - r, p.nc - s, g, h, k, l, b) && d.push(b);
b = new C;
J.Zg(p.ld + r, p.wd + s, p.ld - r, p.wd - s, g, h, k, l, b) && d.push(b);
b = d.length;
if (0 === b)return t.Da(d), !1;
n = !0;
s = Infinity;
for (r = 0; r < b; r++) {
var k = d[r], v = (k.x - g) * (k.x - g) + (k.y - h) * (k.y - h);
v < s && (s = v, e.x = k.x, e.y = k.y)
}
t.Da(d)
} else if (p.type === Tc)b = q.x - m, n = J.Wo(b, q.y - m, q.x + q.width + m, q.y + q.height + m, g, h, k, l, e); else if (p.type === Uc)a:if (b = q.copy().Ug(m,
m), 0 === b.width)n = J.Zg(b.x, b.y, b.x, b.y + b.height, g, h, k, l, e); else if (0 === b.height)n = J.Zg(b.x, b.y, b.x + b.width, b.y, g, h, k, l, e); else {
a = b.width / 2;
var x = b.height / 2;
d = b.x + a;
b = b.y + x;
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 + x * x - n * n) {
e.x = NaN;
e.y = NaN;
n = !1;
break a
}
m = Math.sqrt(a * a * c * c + x * x - n * n);
k = (-(a * a * c * n) + a * x * m) / (x * x + a * a * c * c) + d;
a = (-(a * a * c * n) - a * x * m) / (x * x + 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 = x * x;
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 === Kc) {
var E, F, G, q = t.O();
r = k - g;
s = l - h;
s = r * r + s * s;
e.x = k;
e.y = l;
for (r = 0; r < p.ub.count; r++) {
var L = p.ub.p[r], N = L.Ga;
E = L.na;
F = L.oa;
for (var V = E, T = F, W, ea, R = 0; R < N.count; R++) {
W = N.p[R];
ea = W.type;
v = W.D;
G = W.F;
var xa = !1;
switch (ea) {
case jd:
V = v;
T = G;
break;
case Wc:
xa = Kl(E, F, v, G, g, h, k, l, q);
break;
case ld:
xa =
W.vb;
ea = W.Lb;
var Ja = W.oe, Ma = W.pe, xa = J.vs(E, F, xa, ea, Ja, Ma, v, G, g, h, k, l, 0.5, q);
break;
case md:
xa = (E + 2 * W.vb) / 3;
ea = (F + 2 * W.Lb) / 3;
Ja = (2 * W.vb + v) / 3;
Ma = (2 * W.vb + v) / 3;
xa = J.vs(E, F, xa, ea, Ja, Ma, v, G, g, h, k, l, 0.5, q);
break;
case nd:
case od:
G = W.type === nd ? pd(W, L) : qd(W, L, E, F);
ea = G.length;
for (Ja = 0; Ja < ea; Ja++)x = G[Ja], 0 === Ja && Kl(E, F, x.x1, x.y1, g, h, k, l, q) && (v = Ll(g, h, q, s, e), v < s && (s = v, n = !0)), J.vs(x.x1, x.y1, x.x2, x.y2, x.$d, x.ae, x.Ob, x.Pb, g, h, k, l, 0.5, q) && (v = Ll(g, h, q, s, e), v < s && (s = v, n = !0));
v = x.Ob;
G = x.Pb;
break;
default:
t.m("Unknown Segment type: " +
W.type)
}
E = v;
F = G;
xa && (v = Ll(g, h, q, s, e), v < s && (s = v, n = !0));
W.Ss && (v = V, G = T, Kl(E, F, v, G, g, h, k, l, q) && (v = Ll(g, h, q, s, e), v < s && (s = v, 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;
t.B(q)
} else t.m("Invalid Geometry type");
if (!n)return!1;
this.transform.Wa(e);
return!0
};
function Ll(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 Kl(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 || J.Ka(l.y, e)) && (l.y < a || J.Ka(l.y, a)) && (m = !0)) : (e = a < c ? a : c, a = a < c ? c : a, (l.x > e || J.Ka(l.x, e)) && (l.x < a || J.Ka(l.x, a)) && (m = !0));
return m
}
Y.prototype.containedInRect = Y.prototype.Em = function (a, b) {
if (void 0 === b)return a.Vj(this.ya);
var c = this.Ra;
null === c && (Ch(this, Infinity, Infinity), c = this.Ra);
var c = c.Mb, d = this.ib / 2, e = !1, g = t.O();
g.q(c.x - d, c.y - d);
a.Ha(b.Wa(g)) && (g.q(c.x - d, c.bottom + d), a.Ha(b.Wa(g)) && (g.q(c.right + d, c.bottom + d), a.Ha(b.Wa(g)) && (g.q(c.right + d, c.y - d), a.Ha(b.Wa(g)) && (e = !0))));
t.B(g);
return e
};
Y.prototype.intersectsRect = Y.prototype.Jf = function (a, b) {
if (this.Em(a, b) || void 0 === b && (b = this.transform, a.Vj(this.ya)))return!0;
var c = t.ah();
c.set(b);
c.iA();
var d = a.left, e = a.right, g = a.top, h = a.bottom, k = t.O();
k.q(d, g);
c.Wa(k);
if (this.Uj(k, !0))return t.B(k), !0;
k.q(e, g);
c.Wa(k);
if (this.Uj(k, !0))return t.B(k), !0;
k.q(d, h);
c.Wa(k);
if (this.Uj(k, !0))return t.B(k), !0;
k.q(e, h);
c.Wa(k);
if (this.Uj(k, !0))return t.B(k), !0;
var l = t.O(), m = t.O();
c.set(b);
c.xA(this.transform);
c.iA();
l.x = e;
l.y = g;
l.transform(c);
k.x = d;
k.y =
g;
k.transform(c);
var n = !1;
Ml(this, k, l, m) ? n = !0 : (k.x = e, k.y = h, k.transform(c), Ml(this, k, l, m) ? n = !0 : (l.x = d, l.y = h, l.transform(c), Ml(this, k, l, m) ? n = !0 : (k.x = d, k.y = g, k.transform(c), Ml(this, k, l, m) && (n = !0))));
t.B(k);
t.Te(c);
t.B(l);
t.B(m);
return n
};
function Ml(a, b, c, d) {
if (!a.Wo(b, c, d))return!1;
a = b.x;
b = b.y;
var e = c.x, g = c.y;
c = d.x;
d = d.y;
if (a === e) {
var h;
b < g ? (h = b, a = g) : (h = g, a = b);
return d >= h && d <= a
}
a < e ? (h = a, a = e) : h = e;
return c >= h && c <= a
}
Y.prototype.XD = function (a, b, c) {
function d(a, b) {
for (var c = a.length, d = 0; d < c; d++) {
var g = a[d];
if (b.Es(g[0], g[1]) > e)return!0
}
return!1
}
if (c && null !== this.fill && this.Uj(a, !0))return!0;
var e = a.Zj(b);
b = e;
1.5 < this.ib && (e = this.ib / 2 + Math.sqrt(e), e *= e);
var g = this.Ra;
null === g && (Ch(this, Infinity, Infinity), g = this.Ra);
if (!c) {
var h = g.Mb, k = h.x, l = h.y, m = h.x + h.width, h = h.y + h.height;
if (db(a.x, a.y, k, l) <= e && db(a.x, a.y, m, l) <= e && db(a.x, a.y, k, h) <= e && db(a.x, a.y, m, h) <= e)return!0
}
k = g.ec;
l = g.nc;
m = g.ld;
h = g.wd;
if (g.type === Nc) {
if (c =
ab(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 === Tc)return b = !1, c && (b = ab(a.x, a.y, k, l, k, h) <= e || ab(a.x, a.y, k, l, m, l) <= e || ab(a.x, a.y, m, l, m, h) <= e || ab(a.x, a.y, k, h, m, h) <= e), b;
if (g.type === Uc) {
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 = ab(a.x, a.y, k, l, m, h), c <= e ? !0 : !1;
if (c) {
if (a = J.HH(n, p, b, g), a * a <= e)return!0
} else return db(b, g, -n, 0) >= e || db(b, g, 0, -p) >= e || db(b, g, 0, p) >= e || db(b, g, n, 0) >= e ? !1 :
!0
} else if (g.type === Kc) {
h = g.Mb;
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 && ab(a.x, a.y, k, l, k, h) > e && ab(a.x, a.y, k, l, m, l) > e && ab(a.x, a.y, m, h, k, h) > e && ab(a.x, a.y, m, h, m, l) > e)return!1;
b = Math.sqrt(e);
if (c) {
if (null === this.fill ? sd(g, a.x, a.y, b) : g.Ha(a, b, !0))return!0
} else {
c = g.ub;
for (b = 0; b < c.count; b++) {
k = c.p[b];
n = k.na;
p = k.oa;
if (a.Es(n, p) > e)return!1;
l = k.Ga.p;
m = l.length;
for (h = 0; h < m; h++) {
var q = l[h];
switch (q.type) {
case jd:
case Wc:
n = q.D;
p = q.F;
if (a.Es(n, p) > e)return!1;
break;
case ld:
g = t.Db();
J.ye(n, p, q.vb, q.Lb, q.oe, q.pe, q.D, q.F, 0.8, g);
n = d(g, a);
t.Da(g);
if (n)return!1;
n = q.D;
p = q.F;
if (a.Es(n, p) > e)return!1;
break;
case md:
g = t.Db();
J.xp(n, p, q.vb, q.Lb, q.D, q.F, 0.8, g);
n = d(g, a);
t.Da(g);
if (n)return!1;
n = q.D;
p = q.F;
if (a.Es(n, p) > e)return!1;
break;
case nd:
case od:
var q = q.type === nd ? pd(q, k) : qd(q, k, n, p), r = q.length, s = null, g = t.Db();
for (b = 0; b < r; b++)if (s = q[b], g.length = 0, J.ye(s.x1, s.y1, s.x2, s.y2, s.$d, s.ae, s.Ob, s.Pb, 0.8, g), d(g, a))return t.Da(g), !1;
t.Da(g);
null !== s && (n = s.Ob, p = s.Pb);
break;
default:
t.m("Unknown Segment type: " +
q.type)
}
}
}
return!0
}
}
}
return!1
};
t.g(Y, "geometry", Y.prototype.dd);
t.defineProperty(Y, {dd: "geometry"}, function () {
return this.Ak ? this.Ak : this.Ra
}, function (a) {
var b = this.Ra;
if (b !== a) {
null !== a ? (f && t.k(a, M, Y, "geometry"), this.Ak = this.Ra = a.freeze()) : this.Ak = this.Ra = null;
var c = this.U;
c && (c.xj = NaN);
this.Qg = !0;
this.aa();
this.i("geometry", b, a)
}
});
t.g(Y, "geometryString", Y.prototype.fE);
t.defineProperty(Y, {fE: "geometryString"}, function () {
return this.dd.toString()
}, function (a) {
var b = Zc(a);
a = b.normalize();
this.dd = b;
var b = t.O(), c = this.position;
c.Q() ? b.q(c.x - a.x, c.y - a.y) : b.q(-a.x, -a.y);
this.position = b;
t.B(b)
});
t.defineProperty(Y, {jA: "isGeometryPositioned"}, function () {
return this.Kq
}, function (a) {
f && t.j(a, "boolean", Y, "isGeometryPositioned");
var b = this.Kq;
b !== a && (this.Kq = a, this.aa(), this.i("isGeometryPositioned", b, a))
});
Y.prototype.Kf = function () {
this.Qg ? this.Ak = null : this.Ra = null;
this.aa()
};
t.g(Y, "fill", Y.prototype.fill);
t.defineProperty(Y, {fill: "fill"}, function () {
return this.Jc
}, function (a) {
var b = this.Jc;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.Jc = a, this.ua(), this.i("fill", b, a))
});
t.g(Y, "stroke", Y.prototype.stroke);
t.defineProperty(Y, {stroke: "stroke"}, function () {
return this.xb
}, function (a) {
var b = this.xb;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.xb = a, this.ua(), this.i("stroke", b, a))
});
t.g(Y, "strokeWidth", Y.prototype.ib);
t.defineProperty(Y, {ib: "strokeWidth"}, function () {
return this.fe
}, function (a) {
var b = this.fe;
if (b !== a)if (f && t.o(a, Y, "strokeWidth"), 0 <= a) {
this.fe = a;
this.aa();
var c = this.U;
c && (c.xj = NaN);
this.i("strokeWidth", b, a)
} else t.ha(a, "val >= 0", Y, "strokeWidth:val")
});
t.g(Y, "strokeCap", Y.prototype.IF);
t.defineProperty(Y, {IF: "strokeCap"}, function () {
return this.oo
}, function (a) {
var b = this.oo;
b !== a && ("string" !== typeof a || "butt" !== a && "round" !== a && "square" !== a ? t.ha(a, '"butt", "round", or "square"', Y, "strokeCap") : (this.oo = a, this.ua(), this.i("strokeCap", b, a)))
});
t.g(Y, "strokeJoin", Y.prototype.fJ);
t.defineProperty(Y, {fJ: "strokeJoin"}, function () {
return this.po
}, function (a) {
var b = this.po;
b !== a && ("string" !== typeof a || "miter" !== a && "bevel" !== a && "round" !== a ? t.ha(a, '"miter", "bevel", or "round"', Y, "strokeJoin") : (this.po = a, this.ua(), this.i("strokeJoin", b, a)))
});
t.g(Y, "strokeMiterLimit", Y.prototype.gJ);
t.defineProperty(Y, {gJ: "strokeMiterLimit"}, function () {
return this.qm
}, function (a) {
var b = this.qm;
if (b !== a)if (f && t.o(a, Y, "strokeMiterLimit"), 0 < a) {
this.qm = a;
this.ua();
var c = this.U;
c && (c.xj = NaN);
this.i("strokeMiterLimit", b, a)
} else t.ha(a, "val > 0", Y, "strokeWidth:val")
});
t.g(Y, "strokeDashArray", Y.prototype.Ow);
t.defineProperty(Y, {Ow: "strokeDashArray"}, function () {
return this.pm
}, function (a) {
var b = this.pm;
if (b !== a) {
null === a || Array.isArray(a) || t.Vb(a, "Array", Y, "strokeDashArray:val");
if (null !== a)for (var c = a.length, d = 0; d < c; d++) {
var e = a[d];
("number" !== typeof e || isNaN(e) || 0 > e || !isFinite(e)) && t.m("strokeDashArray:val " + e + " is a negative number or not a real number.")
}
this.pm = a;
this.ua();
this.i("strokeDashArray", b, a)
}
});
t.g(Y, "strokeDashOffset", Y.prototype.JF);
t.defineProperty(Y, {JF: "strokeDashOffset"}, function () {
return this.$c
}, function (a) {
var b = this.$c;
b !== a && (f && t.o(a, Y, "strokeDashOffset"), 0 <= a && (this.$c = a, this.ua(), this.i("strokeDashOffset", b, a)))
});
t.g(Y, "figure", Y.prototype.Jb);
t.defineProperty(Y, {Jb: "figure"}, function () {
return this.Hn
}, function (a) {
var b = this.Hn;
if (b !== a) {
f && t.j(a, "string", Y, "figure");
var c = J.Oi[a];
"function" === typeof c ? c = a : (c = J.Oi[a.toLowerCase()]) || t.m("Unknown Shape.figure: " + a);
if (b !== c) {
if (a = this.U)a.xj = NaN;
this.Hn = c;
this.Qg = !1;
this.Kf();
this.i("figure", b, c)
}
}
});
t.g(Y, "toArrow", Y.prototype.fn);
t.defineProperty(Y, {fn: "toArrow"}, function () {
return this.ro
}, function (a) {
var b = this.ro;
!0 === a ? a = "Standard" : !1 === a && (a = "None");
if (b !== a) {
f && t.j(a, "string", Y, "toArrow");
var c = J.Oo(a);
c instanceof M ? c = a : (c = J.Oo(a.toLowerCase())) || t.m("Unknown Shape.toArrow: " + a);
b !== c && (this.ro = c, this.Qg = !1, this.Kf(), Nl(this, c), this.i("toArrow", b, c))
}
});
t.g(Y, "fromArrow", Y.prototype.gw);
t.defineProperty(Y, {gw: "fromArrow"}, function () {
return this.Jn
}, function (a) {
var b = this.Jn;
!0 === a ? a = "Standard" : !1 === a && (a = "None");
if (b !== a) {
f && t.j(a, "string", Y, "fromArrow");
var c = J.Oo(a);
c instanceof M ? c = a : (c = J.Oo(a.toLowerCase())) || t.m("Unknown Shape.fromArrow: " + a);
b !== c && (this.Jn = c, this.Qg = !1, this.Kf(), Nl(this, c), this.i("fromArrow", b, c))
}
});
function Nl(a, b) {
var c = a.h;
if (null === c || !c.Aa.qb) {
a.tt = Ol;
c = bc;
switch (b) {
case "halfarrowtop":
c = Zb;
break;
case "halftriangletop":
c = Zb;
break;
case "openrighttriangletop":
c = Zb;
break;
case "opentriangletop":
c = Zb
}
"None" !== a.ro ? (a.uf = -1, a.Qj = c) : "None" !== a.Jn && (a.uf = 0, a.Qj = new K(1 - c.x, c.y))
}
}
t.defineProperty(Y, {G: "spot1"}, function () {
return this.vi
}, function (a) {
t.k(a, K, Y, "spot1");
var b = this.vi;
b.N(a) || (this.vi = a = a.Z(), this.aa(), this.i("spot1", b, a))
});
t.defineProperty(Y, {H: "spot2"}, function () {
return this.wi
}, function (a) {
t.k(a, K, Y, "spot2");
var b = this.wi;
b.N(a) || (this.wi = a = a.Z(), this.aa(), this.i("spot2", b, a))
});
t.defineProperty(Y, {yc: "parameter1"}, function () {
return this.wr
}, function (a) {
var b = this.wr;
b !== a && (this.wr = a, this.aa(), this.i("parameter1", b, a))
});
t.defineProperty(Y, {lt: "parameter2"}, function () {
return this.xr
}, function (a) {
var b = this.xr;
b !== a && (this.xr = a, this.aa(), this.i("parameter2", b, a))
});
t.A(Y, {Ia: "naturalBounds"}, function () {
if (null !== this.Ra)return this.Lc.assign(this.Ra.Mb), this.Lc;
var a = this.Ca;
return new D(0, 0, a.width, a.height)
});
t.g(Y, "isRectangular", Y.prototype.qI);
t.defineProperty(Y, {qI: "isRectangular"}, function () {
return this.Pq
}, function (a) {
var b = this.Pq;
b !== a && (f && t.j(a, "boolean", Y, "isRectangular"), this.Pq = a, this.aa(), this.i("isRectangular", b, a))
});
t.g(Y, "pathObject", Y.prototype.DA);
t.defineProperty(Y, {DA: "pathObject"}, function () {
return this.zr
}, function (a) {
var b = this.zr;
b !== a && (f && t.k(a, X, Y, "pathObject"), this.zr = a, this.ua(), this.i("pathObject", b, a))
});
t.g(Y, "geometryStretch", Y.prototype.hw);
t.defineProperty(Y, {hw: "geometryStretch"}, function () {
return this.Fq
}, function (a) {
var b = this.Fq;
b !== a && (t.tb(a, X, Y, "geometryStretch"), this.Fq = a, this.i("geometryStretch", b, a))
});
t.g(Y, "interval", Y.prototype.interval);
t.defineProperty(Y, {interval: "interval"}, function () {
return this.Jq
}, function (a) {
var b = this.Jq;
f && t.o(a, Y, "interval");
a = Math.floor(a);
b !== a && 0 <= a && (this.Jq = a, this.h && vi(this.h), this.aa(), this.i("interval", b, a))
});
function ua() {
X.call(this);
this.ge = "";
this.xb = "black";
this.mh = "13px sans-serif";
this.Od = "start";
this.Mq = !0;
this.Tl = this.Ul = !1;
this.eo = Pl;
this.tm = Ql;
this.Fu = this.Yq = 0;
this.In = this.Cy = this.Dy = null;
this.Yn = {};
this.yq = !1;
this.ef = this.Kj = this.fs = null
}
t.ia("TextBlock", ua);
t.Oa(ua, X);
ua.prototype.cloneProtected = function (a) {
X.prototype.cloneProtected.call(this, a);
a.ge = this.ge;
a.xb = this.xb;
a.mh = this.mh;
a.Od = this.Od;
a.Mq = this.Mq;
a.Ul = this.Ul;
a.Tl = this.Tl;
a.tm = this.tm;
a.eo = this.eo;
a.Yq = this.Yq;
a.Fu = this.Fu;
a.Dy = this.Dy;
a.Cy = this.Cy;
a.In = this.In;
a.Yn = this.Yn;
a.yq = this.yq;
a.fs = this.fs;
a.Kj = this.Kj;
a.ef = this.ef
};
ua.prototype.toString = function () {
return 22 < this.ge.length ? 'TextBlock("' + this.ge.substring(0, 20) + '"...)' : 'TextBlock("' + this.ge + '")'
};
var Rl;
ua.None = Rl = t.w(ua, "None", 0);
var Sl;
ua.WrapFit = Sl = t.w(ua, "WrapFit", 1);
var Ql;
ua.WrapDesiredSize = Ql = t.w(ua, "WrapDesiredSize", 2);
var Pl;
ua.OverflowClip = Pl = t.w(ua, "OverflowClip", 0);
var Tl;
ua.OverflowEllipsis = Tl = t.w(ua, "OverflowEllipsis", 1);
ua.prototype.aa = function () {
X.prototype.aa.call(this);
this.Cy = this.Dy = null
};
t.g(ua, "font", ua.prototype.font);
t.defineProperty(ua, {font: "font"}, function () {
return this.mh
}, function (a) {
var b = this.mh;
b !== a && (f && t.j(a, "string", ua, "font"), this.mh = a, this.In = null, this.aa(), this.i("font", b, a))
});
t.g(ua, "text", ua.prototype.text);
t.defineProperty(ua, {text: "text"}, function () {
return this.ge
}, function (a) {
var b = this.ge;
a = null !== a && void 0 !== a ? a.toString() : "";
b !== a && (this.ge = a, this.aa(), this.i("text", b, a))
});
t.g(ua, "textAlign", ua.prototype.textAlign);
t.defineProperty(ua, {textAlign: "textAlign"}, function () {
return this.Od
}, function (a) {
var b = this.Od;
b !== a && (f && t.j(a, "string", ua, "textAlign"), "start" === a || "end" === a || "left" === a || "right" === a || "center" === a ? (this.Od = a, this.ua(), this.i("textAlign", b, a)) : t.ha(a, '"start", "end", "left", "right", or "center"', ua, "textAlign"))
});
t.A(ua, {Ia: "naturalBounds"}, function () {
if (!this.Lc.Q()) {
var a = Ul(this, this.ge, {}, 999999).width, b = Vl(this, a, {}), c = this.Ca;
isNaN(c.width) || (a = c.width);
isNaN(c.height) || (b = c.height);
nb(this.Lc, a, b)
}
return this.Lc
});
t.g(ua, "isMultiline", ua.prototype.rw);
t.defineProperty(ua, {rw: "isMultiline"}, function () {
return this.Mq
}, function (a) {
var b = this.Mq;
b !== a && (f && t.j(a, "boolean", ua, "isMultiline"), this.Mq = a, this.aa(), this.i("isMultiline", b, a))
});
t.g(ua, "isUnderline", ua.prototype.tI);
t.defineProperty(ua, {tI: "isUnderline"}, function () {
return this.Ul
}, function (a) {
var b = this.Ul;
b !== a && (f && t.j(a, "boolean", ua, "isUnderline"), this.Ul = a, this.ua(), this.i("isUnderline", b, a))
});
t.g(ua, "isStrikethrough", ua.prototype.rI);
t.defineProperty(ua, {rI: "isStrikethrough"}, function () {
return this.Tl
}, function (a) {
var b = this.Tl;
b !== a && (f && t.j(a, "boolean", ua, "isStrikethrough"), this.Tl = a, this.ua(), this.i("isStrikethrough", b, a))
});
t.g(ua, "wrap", ua.prototype.qB);
t.defineProperty(ua, {qB: "wrap"}, function () {
return this.tm
}, function (a) {
var b = this.tm;
b !== a && (f && t.tb(a, ua, ua, "wrap"), this.tm = a, this.aa(), this.i("wrap", b, a))
});
t.g(ua, "overflow", ua.prototype.overflow);
t.defineProperty(ua, {overflow: "overflow"}, function () {
return this.eo
}, function (a) {
var b = this.eo;
b !== a && (f && t.tb(a, ua, ua, "overflow"), this.eo = a, this.aa(), this.i("overflow", b, a))
});
t.g(ua, "stroke", ua.prototype.stroke);
t.defineProperty(ua, {stroke: "stroke"}, function () {
return this.xb
}, function (a) {
var b = this.xb;
b !== a && (null === a || "string" === typeof a || a instanceof Td) && (a instanceof Td && a.freeze(), this.xb = a, this.ua(), this.i("stroke", b, a))
});
t.A(ua, {HE: "lineCount"}, function () {
return this.Yq
});
t.g(ua, "editable", ua.prototype.Yv);
t.defineProperty(ua, {Yv: "editable"}, function () {
return this.yq
}, function (a) {
var b = this.yq;
b !== a && (f && t.j(a, "boolean", ua, "editable"), this.yq = a, this.i("editable", b, a))
});
t.g(ua, "textEditor", ua.prototype.iB);
t.defineProperty(ua, {iB: "textEditor"}, function () {
return this.fs
}, function (a) {
var b = this.fs;
b !== a && (a instanceof HTMLElement || t.m("textEditor must be an HTMLElement"), this.fs = a, this.i("textEditor", b, a))
});
t.g(ua, "errorFunction", ua.prototype.Fs);
t.defineProperty(ua, {Fs: "errorFunction"}, function () {
return this.ef
}, function (a) {
var b = this.ef;
b !== a && (null !== a && t.j(a, "function", ua, "errorFunction"), this.ef = a, this.i("errorFunction", b, a))
});
function fk(a, b) {
var c = a.mh;
null !== c && b.It !== c && (b.font = c, b.It = c)
}
ua.prototype.hl = function (a, b) {
if (null !== this.xb && 0 !== this.ge.length && null !== this.mh) {
var c = this.Ia.width, d = Dh(this);
a.textAlign = this.Od;
gk(this, a, this.xb, !0);
(this.Ul || this.Tl) && gk(this, a, this.xb, !1);
var e = this.Yn, g = 0, h = !1, k = t.ic(0, 0);
this.he.Wa(k);
var l = t.ic(0, d);
this.he.Wa(l);
var m = k.Zj(l);
t.B(k);
t.B(l);
k = b.scale;
8 > m * k * k && (h = !0);
m = e.Ci.length;
for (k = 0; k < m; k++) {
var n = e.Ci[k], l = e.xm[k];
n > c && (n = c);
var p = l, l = a, q = g, r = c, s = d, v = 0;
h ? ("start" === this.Od || "left" === this.Od ? v = 0 : "end" === this.Od || "right" === this.Od ?
v = r - n : "center" === this.Od ? v = (r - n) / 2 : t.m("textAlign must be start, end, left, right, or center"), l.fillRect(0 + v, q + 0.25 * s, n, 1)) : ("start" === this.Od || "left" === this.Od ? v = 0 : "end" === this.Od || "right" === this.Od ? v = r : "center" === this.Od ? v = r / 2 : t.m("textAlign must be start, end, left, right, or center"), l.fillText(p, 0 + v, q + s - 0.25 * s), p = s / 20 | 0, this.Ul && ("end" === this.Od || "right" === this.Od ? v -= n : "center" === this.Od && (v -= n / 2), l.beginPath(), l.lineWidth = p, l.moveTo(0 + v, q + s - 0.2 * s), l.lineTo(0 + v + n, q + s - 0.2 * s), l.stroke()), this.Tl &&
(l.beginPath(), l.lineWidth = p, q = q + s - s / 2.2 | 0, 0 !== p % 2 && (q += 0.5), l.moveTo(0, q), l.lineTo(0 + n, q), l.stroke()));
g += d
}
}
};
ua.prototype.$s = function (a, b, c, d) {
var e = {}, g = 0, h = 0;
if (isNaN(this.Ca.width)) {
g = this.ge;
if (0 === g.length)g = 0; else if (this.rw) {
for (var k = h = 0, l = !1, m = {Th: 0}; !l;) {
var n = Wl(g, k, m);
-1 === n && (n = g.length, l = !0);
k = Xl(g.substr(k, n - k).replace(/^\s+|\s+$/g, ""), this.mh);
k > h && (h = k);
k = m.Th
}
g = h
} else h = Wl(g, 0, {}), 0 <= h && (g = g.substr(0, h)), g = k = Xl(g, this.mh);
g = Math.min(g, a / this.scale);
g = Math.max(8, g)
} else g = this.Ca.width;
this.ga && (g = Math.min(g, this.ga.Ge.width), g = Math.max(g, this.ga.Ye.width));
h = Vl(this, g, e);
h = isNaN(this.Ca.height) ?
Math.min(h, b / this.scale) : this.Ca.height;
if (this.qB === Sl || isNaN(this.Ca.width))g = e.Ui, isNaN(this.Ca.width) && (g = Math.max(8, g));
g = Math.max(c, g);
h = Math.max(d, h);
nb(this.Lc, g, h);
Qj(this, 0, 0, g, h);
this.Yn = e
};
ua.prototype.Tj = function (a, b, c, d) {
Xj(this, a, b, c, d)
};
function Ul(a, b, c, d) {
b = b.replace(/^\s+|\s+$/g, "");
void 0 === c.Ui && (c.Ui = 0);
void 0 === c.Ci && (c.Ci = []);
void 0 === c.xm && (c.xm = []);
var e = 0, g, h, k = a.mh;
a.eo === Tl ? (t.Hp !== k && (t.Gp.font = k, t.Hp = k), g = 0, void 0 !== t.Xz[k] && 5E3 > t.$D ? g = t.Xz[k] : (g = t.Gp.measureText(t.VD).width, t.Xz[k] = g, t.$D++)) : g = 0;
var l = g;
if (a.tm === Rl) {
c.Th = 1;
g = Xl(b, k);
if (0 === l || g <= d)return c.Ui = g, c.Ci.push(c.Ui), c.xm.push(b), new oa(g, Dh(a));
var m = Yl(b);
b = b.substr(m.length);
h = Yl(b);
for (g = Xl(m + h, k); 0 < h.length && g <= d;)m += h, b = b.substr(h.length), h = Yl(b),
g = Xl((m + h).replace(/^\s+|\s+$/g, ""), k);
m += h.replace(/^\s+|\s+$/g, "");
for (d = Math.max(1, d - l); Xl(m, k) > d && 1 < m.length;)m = m.substr(0, m.length - 1);
m += t.VD;
h = Xl(m, k);
c.Ci.push(h);
c.Ui = h;
c.xm.push(m);
return new oa(h, Dh(a))
}
l = 0;
0 === b.length && (l = 1, c.Ci.push(0), c.xm.push(b));
for (; 0 < b.length;) {
m = Yl(b);
for (b = b.substr(m.length); Xl(m, k) > d;) {
var n = 1;
g = Xl(m.substr(0, n), k);
for (h = 0; g <= d;)n++, h = g, g = Xl(m.substr(0, n), k);
1 === n ? (c.Ci[l] = g, e = Math.max(e, g)) : (c.Ci[l] = h, e = Math.max(e, h));
n--;
1 > n && (n = 1);
c.xm[l] = m.substr(0, n);
l++;
m = m.substr(n)
}
h = Yl(b);
for (g = Xl(m + h, k); 0 < h.length && g <= d;)m += h, b = b.substr(h.length), h = Yl(b), g = Xl((m + h).replace(/^\s+|\s+$/g, ""), k);
m = m.replace(/^\s+|\s+$/g, "");
"" !== m && (0 === h.length ? (c.Ci.push(g), e = Math.max(e, g)) : (h = Xl(m, k), c.Ci.push(h), e = Math.max(e, h)), c.xm.push(m), l++)
}
c.Th = l;
c.Ui = Math.max(c.Ui, e);
return new oa(c.Ui, Dh(a) * c.Th)
}
function Yl(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 Xl(a, b) {
t.Hp !== b && (t.Gp.font = b, t.Hp = b);
return t.Gp.measureText(a).width
}
function Dh(a) {
if (null !== a.In)return a.In;
var b = a.mh;
t.Hp !== b && (t.Gp.font = b, t.Hp = b);
var c = 0;
void 0 !== t.Yz[b] && 5E3 > t.aE ? c = t.Yz[b] : (c = 1.3 * t.Gp.measureText("M").width, t.Yz[b] = c, t.aE++);
return a.In = c
}
function Wl(a, b, c) {
void 0 === c.Th && (c.Th = 0);
var d = a.indexOf("\r", b);
-1 === d && (d = a.indexOf("\n", b));
0 <= d && (c.Th = "\r" === a[d] && d + 1 < a.length && "\n" === a[d + 1] ? d + 2 : d + 1);
return d
}
function Vl(a, b, c) {
var d = a.ge, e = Dh(a);
if (0 === d.length)return c.Ui = 0, a.Yq = 1, e;
if (!a.rw) {
var g = Wl(d, 0, {});
0 <= g && (d = d.substr(0, g))
}
for (var h = g = 0, k = 0, l = -1, m = {Th: 0}, n = !1; !n;)l = Wl(d, k, m), -1 === l && (l = d.length, n = !0), k <= l && (k = d.substr(k, l - k), a.tm !== Rl ? (c.Th = 0, k = Ul(a, k, c, b), g += k.height, h += c.Th) : (Ul(a, k, c, b), g += e, h++)), k = m.Th;
a.Yq = h;
return a.Fu = g
}
t.g(ua, "textValidation", ua.prototype.Ct);
t.defineProperty(ua, {Ct: "textValidation"}, function () {
return this.Kj
}, function (a) {
var b = this.Kj;
b !== a && (null !== a && t.j(a, "function", ua, "textValidation"), this.Kj = a, this.i("textValidation", b, a))
});
function Ek() {
X.call(this);
this.Wf = null;
this.as = "";
this.Jj = (new D(NaN, NaN, NaN, NaN)).freeze();
this.Ln = Mc;
this.ds = this.ef = null;
this.xu = this.Zn = !1
}
t.ia("Picture", Ek);
t.Oa(Ek, X);
Ek.cacheFlush = function () {
t.fA = {};
t.gA = 0
};
Ek.prototype.cloneProtected = function (a) {
X.prototype.cloneProtected.call(this, a);
a.element = this.Wf;
a.as = this.as;
a.Jj.assign(this.Jj);
a.Ln = this.Ln;
a.ef = this.ef
};
Ek.prototype.toString = function () {
return"Picture(" + this.source + ")#" + t.oc(this)
};
t.g(Ek, "element", Ek.prototype.element);
t.defineProperty(Ek, {element: "element"}, function () {
return this.Wf
}, function (a) {
var b = this.Wf;
if (b !== a) {
a instanceof HTMLImageElement || a instanceof HTMLVideoElement || a instanceof HTMLCanvasElement || t.m("Picture.element must be an instance of Image, Canvas, or Video.");
var c = this;
a instanceof HTMLCanvasElement ? this.xu = !0 : (this.xu = !1, a.onerror = function (a) {
null !== c.ef && c.ef(c, a)
});
this.Wf = a;
!0 === a.complete || void 0 === a.complete ? (this.Zn = !0, this.Ca.Q() || (Uj(this, !1), this.aa())) : (t.nB.push(this), null ===
t.Dw && (t.Dw = setInterval(function () {
for (var a = [], b = t.nB, c = b.length, h = 0; h < c; h++) {
var k = b[h], l;
l = k;
var m = l.Wf;
if (m)if (m.complete) {
l.Zn = !0;
l.Ca.Q() || (Uj(l, !1), l.aa());
if (l.h)l.Ca.Q() || l.h.Ac(), l.h.ua(); else {
l = t.ND;
var n = l.length;
if (0 === n)for (var n = document.getElementsByTagName("canvas"), p = n.length, m = 0; m < p; m++) {
var q = n[m];
q.parentElement && q.parentElement.ea && l.push(q.parentElement.ea)
}
n = l.length;
for (m = 0; m < n; m++)l[m].ua()
}
l = !0
} else l = !1; else l = !0;
l || a.push(k)
}
0 === a.length && (clearInterval(t.Dw), t.Dw = null);
t.nB = a
}, 200)));
this.i("element", b, a);
this.ua()
}
});
t.g(Ek, "source", Ek.prototype.source);
t.defineProperty(Ek, {source: "source"}, function () {
return this.as
}, function (a) {
var b = this.as;
if (b !== a) {
t.j(a, "string", Ek, "source");
this.as = a;
var c = t.fA;
if (void 0 !== c[a])this.element = c[a]; else {
10 < t.gA && (Ek.cacheFlush(), c = t.fA);
var d = document.createElement("img");
d.src = a;
c[a] = d;
t.gA++;
d instanceof HTMLImageElement && (this.element = d)
}
this.ua();
this.i("source", b, a)
}
});
t.g(Ek, "sourceRect", Ek.prototype.Ph);
t.defineProperty(Ek, {Ph: "sourceRect"}, function () {
return this.Jj
}, function (a) {
var b = this.Jj;
b.N(a) || (t.k(a, D, Ek, "sourceRect"), this.Jj = a = a.Z(), this.ua(), this.i("sourceRect", b, a))
});
t.g(Ek, "imageStretch", Ek.prototype.hI);
t.defineProperty(Ek, {hI: "imageStretch"}, function () {
return this.Ln
}, function (a) {
var b = this.Ln;
b !== a && (t.tb(a, X, Ek, "imageStretch"), this.Ln = a, this.ua(), this.i("imageStretch", b, a))
});
t.g(Ek, "errorFunction", Ek.prototype.Fs);
t.defineProperty(Ek, {Fs: "errorFunction"}, function () {
return this.ef
}, function (a) {
var b = this.ef;
if (b !== a) {
null !== a && t.j(a, "function", Ek, "errorFunction");
this.ef = a;
if (this.Wf) {
var c = this;
this.Wf.onerror = function (a) {
null !== c.ef && c.ef(c, a)
}
}
this.i("errorFunction", b, a)
}
});
Ek.prototype.hl = function (a, b) {
if (!b.En) {
if (null === this.ds)if (null === this.Wf)this.ds = !1; else {
var c = document.createElement("canvas").getContext("2d");
0 !== this.Wf.width && 0 !== this.Wf.height && c.drawImage(this.Wf, 0, 0);
try {
c.getImageData(0, 0, 1, 1), this.ds = !1
} catch (d) {
this.ds = !0
}
}
if (this.ds)return
}
c = this.Wf;
if (null !== c) {
var e = c.src;
null !== e && "" !== e || t.m("Element has no source attribute: " + c);
var e = this.Ia, g = 0, h = 0, k = this.xu, l = k ? +c.width : c.naturalWidth, k = k ? +c.height : c.naturalHeight;
if (0 !== l && 0 !== k) {
void 0 ===
l && c.videoWidth && (l = c.videoWidth || e.width);
void 0 === k && c.videoHeight && (k = c.videoHeight || e.height);
this.Ph.Q() && (g = this.Jj.x, h = this.Jj.y, l = this.Jj.width, k = this.Jj.height);
var m = l, n = k, p = this.Ln;
switch (p) {
case Vg:
if (this.Ph.Q())break;
g += Math.max((m - e.width) / 2, 0);
h += Math.max((n - e.height) / 2, 0);
l = Math.min(e.width, m);
k = Math.min(e.height, n);
break;
case Mc:
m = e.width;
n = e.height;
break;
case Xg:
case Yg:
p === Xg ? (p = Math.min(e.height / n, e.width / m), m *= p, n *= p) : p === Yg && (p = Math.max(e.height / n, e.width / m), m *= p, n *= p, g += (m -
e.width) / 2, h += (n - e.height) / 2, l *= 1 / (m / e.width), k *= 1 / (n / e.height), m = e.width, n = e.height)
}
a.drawImage(c, g, h, l, k, Math.max((e.width - m) / 2, 0), Math.max((e.height - n) / 2, 0), Math.min(e.width, m), Math.min(e.height, n))
}
}
};
t.A(Ek, {Ia: "naturalBounds"}, function () {
return this.Lc
});
Ek.prototype.$s = function (a, b, c, d) {
var e = this.Ca, g = Tj(this), h = this.Wf, k = this.xu;
if (k || !this.Zn && h && h.complete)this.Zn = !0;
null === h && (b = a = 0);
g !== Mc && g !== Lj ? isFinite(e.width) ? a = e.width : null !== h && !1 !== this.Zn && (a = this.Ph.Q() ? this.Ph.width : k ? +h.width : h.naturalWidth) : (isFinite(a) || (a = this.Ph.Q() ? this.Ph.width : k ? +h.width : h.naturalWidth), c = 0);
g !== Mc && g !== Kj ? isFinite(e.height) ? b = e.height : null !== h && !1 !== this.Zn && (b = this.Ph.Q() ? this.Ph.height : k ? +h.height : h.naturalHeight) : (isFinite(b) || (b = this.Ph.Q() ? this.Ph.height :
k ? +h.height : h.naturalHeight), d = 0);
e = this.Ge;
g = this.Ye;
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));
nb(this.Lc, a, b);
Qj(this, 0, 0, a, b)
};
Ek.prototype.Tj = function (a, b, c, d) {
Xj(this, a, b, c, d)
};
function qa() {
this.s = new M;
this.Qb = null
}
aa = qa.prototype;
aa.reset = function () {
this.s = new M;
this.Qb = null
};
function O(a, b, c, d, e, g) {
null === a.s && t.m("StreamGeometryContext has been closed");
void 0 !== e && !0 === e ? (null === a.Qb && t.m("Need to call beginFigure first"), d = new S(jd), d.D = b, d.F = c, a.Qb.Ga.add(d)) : (a.Qb = new Lc, a.Qb.na = b, a.Qb.oa = c, a.Qb.bp = d, a.s.ub.add(a.Qb));
void 0 !== g && (a.Qb.Qn = g)
}
function Q(a) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Qb && t.m("Need to call beginFigure first");
var b = a.Qb.Ga.length;
0 < b && a.Qb.Ga.p[b - 1].close()
}
function bd(a) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Qb && t.m("Need to call beginFigure first");
0 < a.Qb.Ga.length && (a.Qb.bp = !0)
}
aa.ab = function (a) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Qb && t.m("Need to call beginFigure first");
this.Qb.Kh = a
};
aa.moveTo = function (a, b, c) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Qb && t.m("Need to call beginFigure first");
var d = new S(jd);
d.D = a;
d.F = b;
c && d.close();
this.Qb.Ga.add(d)
};
aa.lineTo = function (a, b, c) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Qb && t.m("Need to call beginFigure first");
var d = new S(Wc);
d.D = a;
d.F = b;
c && d.close();
this.Qb.Ga.add(d)
};
function P(a, b, c, d, e, g, h, k) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Qb && t.m("Need to call beginFigure first");
var l = new S(ld);
l.vb = b;
l.Lb = c;
l.oe = d;
l.pe = e;
l.D = g;
l.F = h;
k && l.close();
a.Qb.Ga.add(l)
}
function $c(a, b, c, d, e) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Qb && t.m("Need to call beginFigure first");
var g = new S(md);
g.vb = b;
g.Lb = c;
g.D = d;
g.F = e;
a.Qb.Ga.add(g)
}
aa.arcTo = function (a, b, c, d, e, g, h) {
null === this.s && t.m("StreamGeometryContext has been closed");
null === this.Qb && t.m("Need to call beginFigure first");
var k = new S(nd);
k.yg = a;
k.Rh = b;
k.Fa = c;
k.Sa = d;
k.radiusX = e;
k.radiusY = g ? g : e;
h && k.close();
this.Qb.Ga.add(k)
};
function ad(a, b, c, d, e, g, h, k) {
null === a.s && t.m("StreamGeometryContext has been closed");
null === a.Qb && t.m("Need to call beginFigure first");
b = new S(od, h, k, b, c, d, e, g);
a.Qb.Ga.add(b)
}
J.makeGeometry = function (a, b, c) {
var d = a.Ca, e = d.width, d = d.height;
void 0 !== b && !isNaN(b) && isFinite(b) && (e = b);
void 0 !== c && !isNaN(c) && isFinite(c) && (d = c);
isFinite(e) || (e = 100);
isFinite(d) || (d = 100);
var g = void 0;
if ("None" !== a.fn)g = J.Oo(a.fn); else if ("None" !== a.gw)g = J.Oo(a.gw); else {
var h = J.Oi[a.Jb];
"string" === typeof h && (h = J.Oi[h]);
void 0 === h && t.m("Unknown Shape.figure: " + a.Jb);
g = h(a, e, d);
g.ce = new oa(e, d)
}
void 0 === g && (h = J.Oi.Rectangle) && (g = h(a, e, d));
g.wu = b;
g.vu = c;
return g
};
J.Fi = function (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
};
J.Ho = function (a) {
a = J.Gm(a);
var b = t.Db();
b[0] = a[0];
for (var c = 1, d = 1; c < a.length; c += 2, d += 3)b[d] = a[c], b[d + 1] = a[c], b[d + 2] = a[c + 1];
t.Da(a);
return b
};
J.Gm = function (a) {
var b = J.el(a), c = t.Db(), 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] = J.kl(h.x, h.y, l.x, l.y, k.x, k.y, m.x, m.y, new C)
}
c[c.length] = c[0];
t.Da(b);
return c
};
J.kl = function (a, b, c, d, e, g, h, k, l) {
c = a - c;
h = e - h;
0 === c || 0 === h ? 0 === c ? (h = (g - k) / h, k = a, e = h * k + (g - h * e)) : (d = (b - d) / c, k = e, e = d * k + (b - d * a)) : (d = (b - d) / c, h = (g - k) / h, a = b - d * a, k = (g - h * e - a) / (d - h), e = d * k + a);
l.q(k, e);
return l
};
J.el = function (a) {
for (var b = t.Db(), c = 1.5 * Math.PI, d = 0, e = 0; e < a; e++)d = 2 * Math.PI / a * e + c, b[e] = new C(0.5 + 0.5 * Math.cos(d), 0.5 + 0.5 * Math.sin(d));
b.push(b[0]);
return b
};
J.tB = (new K(0.156, 0.156)).Na();
J.uB = (new K(0.844, 0.844)).Na();
J.Oi = {None: "Rectangle", Rectangle: function (a, b, c) {
a = new M;
a.type = Tc;
a.na = 0;
a.oa = 0;
a.D = b;
a.F = c;
return a
}, Square: function (a, b, c) {
a = new M;
a.kc = Xg;
a.type = Tc;
a.na = 0;
a.oa = 0;
a.D = b;
a.F = c;
return a
}, Ellipse: function (a, b, c) {
a = new M;
a.type = Uc;
a.na = 0;
a.oa = 0;
a.D = b;
a.F = c;
a.G = J.tB;
a.H = J.uB;
return a
}, Circle: function (a, b, c) {
a = new M;
a.kc = Xg;
a.type = Uc;
a.na = 0;
a.oa = 0;
a.D = b;
a.F = c;
a.G = J.tB;
a.H = J.uB;
return a
}, Connector: "Ellipse", TriangleRight: function (a, b, c) {
a = new M;
var d = new Lc, e = new S;
e.D = b;
e.F = 0.5 * c;
d.Ga.add(e);
b = new S;
b.D = 0;
b.F = c;
d.Ga.add(b.close());
a.ub.add(d);
a.G = new K(0, 0.25);
a.H = new K(0.5, 0.75);
return a
}, TriangleDown: function (a, b, c) {
a = new M;
var d = new Lc, e = new S;
e.D = b;
e.F = 0;
d.Ga.add(e);
e = new S;
e.D = 0.5 * b;
e.F = c;
d.Ga.add(e.close());
a.ub.add(d);
a.G = new K(0.25, 0);
a.H = new K(0.75, 0.5);
return a
}, TriangleLeft: function (a, b, c) {
a = new M;
var d = new Lc;
d.na = b;
d.oa = c;
var e = new S;
e.D = 0;
e.F = 0.5 * c;
d.Ga.add(e);
c = new S;
c.D = b;
c.F = 0;
d.Ga.add(c.close());
a.ub.add(d);
a.G = new K(0.5, 0.25);
a.H = new K(1, 0.75);
return a
}, TriangleUp: function (a, b, c) {
a = new M;
var d = new Lc;
d.na = b;
d.oa = c;
var e = new S;
e.D = 0;
e.F = c;
d.Ga.add(e);
c = new S;
c.D = 0.5 * b;
c.F = 0;
d.Ga.add(c.close());
a.ub.add(d);
a.G = new K(0.25, 0.5);
a.H = new K(0.75, 1);
return a
}, Line1: function (a, b, c) {
a = new M;
a.type = Nc;
a.na = 0;
a.oa = 0;
a.D = b;
a.F = c;
return a
}, Line2: function (a, b, c) {
a = new M;
a.type = Nc;
a.na = b;
a.oa = 0;
a.D = 0;
a.F = c;
return a
}, MinusLine: "LineH", LineH: function (a, b, c) {
a = new M;
a.type = Nc;
a.na = 0;
a.oa = c / 2;
a.D = b;
a.F = c / 2;
return a
}, LineV: function (a, b, c) {
a = new M;
a.type = Nc;
a.na = b / 2;
a.oa = 0;
a.D = b / 2;
a.F = c;
return a
},
Curve1: function (a, b, c) {
var d = J.va;
a = t.u();
O(a, 0, 0, !1);
P(a, d * b, 0, 1 * b, (1 - d) * c, b, c);
b = a.s;
t.v(a);
return b
}, Curve2: function (a, b, c) {
var d = J.va;
a = t.u();
O(a, 0, 0, !1);
P(a, 0, d * c, (1 - d) * b, c, b, c);
b = a.s;
t.v(a);
return b
}, Curve3: function (a, b, c) {
var d = J.va;
a = t.u();
O(a, 1 * b, 0, !1);
P(a, 1 * b, d * c, d * b, 1 * c, 0, 1 * c);
b = a.s;
t.v(a);
return b
}, Curve4: function (a, b, c) {
var d = J.va;
a = t.u();
O(a, 1 * b, 0, !1);
P(a, (1 - d) * b, 0, 0, (1 - d) * c, 0, 1 * c);
b = a.s;
t.v(a);
return b
}, Alternative: "Triangle", Merge: "Triangle", Triangle: function (a, b, c) {
a = t.u();
O(a, 0.5 *
b, 0 * c, !0);
a.lineTo(0 * b, 1 * c);
a.lineTo(1 * b, 1 * c, !0);
b = a.s;
b.G = new K(0.25, 0.5);
b.H = new K(0.75, 1);
t.v(a);
return b
}, Decision: "Diamond", Diamond: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !0);
a.lineTo(0, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(1 * b, 0.5 * c, !0);
b = a.s;
b.G = new K(0.25, 0.25);
b.H = new K(0.75, 0.75);
t.v(a);
return b
}, Pentagon: function (a, b, c) {
var d = J.el(5);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.2, 0.22);
b.H = new K(0.8, 0.9);
t.v(a);
return b
}, DataTransmission: "Hexagon",
Hexagon: function (a, b, c) {
var d = J.el(6);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.07, 0.25);
b.H = new K(0.93, 0.75);
t.v(a);
return b
}, Heptagon: function (a, b, c) {
var d = J.el(7);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.2, 0.15);
b.H = new K(0.8, 0.85);
t.v(a);
return b
}, Octagon: function (a, b, c) {
var d = J.el(8);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.15, 0.15);
b.H = new K(0.85, 0.85);
t.v(a);
return b
}, Nonagon: function (a, b, c) {
var d = J.el(9);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.17, 0.13);
b.H = new K(0.82, 0.82);
t.v(a);
return b
}, Decagon: function (a, b, c) {
var d = J.el(10);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.16, 0.16);
b.H = new K(0.84, 0.84);
t.v(a);
return b
}, Dodecagon: function (a, b, c) {
var d = J.el(12);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.16, 0.16);
b.H = new K(0.84, 0.84);
t.v(a);
return b
}, FivePointedStar: function (a, b, c) {
var d = J.Gm(5);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.312, 0.383);
b.H = new K(0.693, 0.765);
t.v(a);
return b
}, SixPointedStar: function (a, b, c) {
var d = J.Gm(6);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.17, 0.251);
b.H = new K(0.833, 0.755);
t.v(a);
return b
}, SevenPointedStar: function (a, b, c) {
var d = J.Gm(7);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.363, 0.361);
b.H = new K(0.641, 0.709);
t.v(a);
return b
}, EightPointedStar: function (a, b, c) {
var d = J.Gm(8);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.252, 0.255);
b.H = new K(0.75, 0.75);
t.v(a);
return b
}, NinePointedStar: function (a, b, c) {
var d = J.Gm(9);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.355, 0.361);
b.H = new K(0.645, 0.651);
t.v(a);
return b
}, TenPointedStar: function (a, b, c) {
var d = J.Gm(10);
a = t.u();
O(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.281, 0.261);
b.H = new K(0.723, 0.748);
t.v(a);
return b
}, FivePointedBurst: function (a, b, c) {
var d = J.Ho(5);
a = t.u();
O(a, d[0].x * b, d[0].y *
c, !0);
for (var e = 1; e < d.length; e += 3)P(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.312, 0.383);
b.H = new K(0.693, 0.765);
t.v(a);
return b
}, SixPointedBurst: function (a, b, c) {
var d = J.Ho(6);
a = t.u();
O(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)P(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.17, 0.251);
b.H = new K(0.833, 0.755);
t.v(a);
return b
}, SevenPointedBurst: function (a, b, c) {
var d = J.Ho(7);
a = t.u();
O(a, d[0].x *
b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)P(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.363, 0.361);
b.H = new K(0.641, 0.709);
t.v(a);
return b
}, EightPointedBurst: function (a, b, c) {
var d = J.Ho(8);
a = t.u();
O(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)P(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.252, 0.255);
b.H = new K(0.75, 0.75);
t.v(a);
return b
}, NinePointedBurst: function (a, b, c) {
var d = J.Ho(9);
a = t.u();
O(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)P(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.355, 0.361);
b.H = new K(0.645, 0.651);
t.v(a);
return b
}, TenPointedBurst: function (a, b, c) {
var d = J.Ho(10);
a = t.u();
O(a, d[0].x * b, d[0].y * c, !0);
for (var e = 1; e < d.length; e += 3)P(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);
t.Da(d);
Q(a);
b = a.s;
b.G = new K(0.281, 0.261);
b.H = new K(0.723, 0.748);
t.v(a);
return b
}, Cloud: function (a, b, c) {
a = t.u();
O(a, 0.08034461 *
b, 0.1944299 * c, !0);
P(a, -0.09239631 * b, 0.07836421 * c, 0.1406031 * b, -0.0542823 * c, 0.2008615 * b, 0.05349299 * c);
P(a, 0.2450511 * b, -0.00697547 * c, 0.3776197 * b, -0.01112067 * c, 0.4338609 * b, 0.074219 * c);
P(a, 0.4539471 * b, 0, 0.6066018 * b, -0.02526587 * c, 0.6558228 * b, 0.07004196 * c);
P(a, 0.6914277 * b, -0.01904177 * c, 0.8921095 * b, -0.01220843 * c, 0.8921095 * b, 0.08370865 * c);
P(a, 1.036446 * b, 0.04105738 * c, 1.020377 * b, 0.3022052 * c, 0.9147671 * b, 0.3194596 * c);
P(a, 1.04448 * b, 0.360238 * c, 0.992256 * b, 0.5219009 * c, 0.9082935 * b, 0.562044 * c);
P(a, 1.032337 * b, 0.5771781 *
c, 1.018411 * b, 0.8120651 * c, 0.9212406 * b, 0.8217117 * c);
P(a, 1.028411 * b, 0.9571472 * c, 0.8556702 * b, 1.052487 * c, 0.7592566 * b, 0.9156953 * c);
P(a, 0.7431877 * b, 1.009325 * c, 0.5624123 * b, 1.021761 * c, 0.5101666 * b, 0.9310455 * c);
P(a, 0.4820677 * b, 1.031761 * c, 0.3030112 * b, 1.002796 * c, 0.2609328 * b, 0.9344623 * c);
P(a, 0.2329994 * b, 1.01518 * c, 0.03213784 * b, 1.01518 * c, 0.08034461 * b, 0.870098 * c);
P(a, -0.02812061 * b, 0.9032597 * c, -0.01205169 * b, 0.6835638 * c, 0.06829292 * b, 0.6545475 * c);
P(a, -0.01812061 * b, 0.6089503 * c, -0.00606892 * b, 0.4555777 * c, 0.06427569 * b, 0.4265613 *
c);
P(a, -0.01606892 * b, 0.3892545 * c, -0.01205169 * b, 0.1944299 * c, 0.08034461 * b, 0.1944299 * c);
Q(a);
b = a.s;
b.G = new K(0.1, 0.1);
b.H = new K(0.9, 0.9);
t.v(a);
return b
}, Gate: "Crescent", Crescent: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
P(a, 1 * b, 0, 1 * b, 1 * c, 0, 1 * c);
P(a, 0.5 * b, 0.75 * c, 0.5 * b, 0.25 * c, 0, 0);
Q(a);
b = a.s;
b.G = new K(0.511, 0.19);
b.H = new K(0.776, 0.76);
t.v(a);
return b
}, FramedRectangle: function (a, b, c) {
var d = t.u(), e = a ? a.yc : 0;
a = a ? a.lt : 0;
0 === e && (e = 0.1);
0 === a && (a = 0.1);
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c,
!0);
O(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.s;
b.G = new K(e, a);
b.H = new K(1 - e, 1 - a);
t.v(d);
return b
}, Delay: "HalfEllipse", HalfEllipse: function (a, b, c) {
var d = J.va;
a = t.u();
O(a, 0, 0, !0);
P(a, d * b, 0, 1 * b, (0.5 - d / 2) * c, 1 * b, 0.5 * c);
P(a, 1 * b, (0.5 + d / 2) * c, d * b, 1 * c, 0, 1 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.2);
b.H = new K(0.75, 0.8);
t.v(a);
return b
}, Heart: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 1 * c, !0);
P(a, 0.1 * b, 0.8 * c, 0, 0.5 * c, 0 * b, 0.3 * c);
P(a, 0 * b, 0, 0.45 * b, 0, 0.5 * b, 0.3 * c);
P(a, 0.55 * b, 0, 1 * b,
0, 1 * b, 0.3 * c);
P(a, b, 0.5 * c, 0.9 * b, 0.8 * c, 0.5 * b, 1 * c);
Q(a);
b = a.s;
b.G = new K(0.15, 0.29);
b.H = new K(0.86, 0.68);
t.v(a);
return b
}, Spade: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !0);
a.lineTo(0.51 * b, 0.01 * c);
P(a, 0.6 * b, 0.2 * c, b, 0.25 * c, b, 0.5 * c);
P(a, b, 0.8 * c, 0.6 * b, 0.8 * c, 0.55 * b, 0.7 * c);
P(a, 0.5 * b, 0.75 * c, 0.55 * b, 0.95 * c, 0.75 * b, c);
a.lineTo(0.25 * b, c);
P(a, 0.45 * b, 0.95 * c, 0.5 * b, 0.75 * c, 0.45 * b, 0.7 * c);
P(a, 0.4 * b, 0.8 * c, 0, 0.8 * c, 0, 0.5 * c);
P(a, 0, 0.25 * c, 0.4 * b, 0.2 * c, 0.49 * b, 0.01 * c);
Q(a);
b = a.s;
b.G = new K(0.19, 0.26);
b.H = new K(0.8, 0.68);
t.v(a);
return b
},
Club: function (a, b, c) {
a = t.u();
O(a, 0.4 * b, 0.6 * c, !0);
P(a, 0.5 * b, 0.75 * c, 0.45 * b, 0.95 * c, 0.15 * b, 1 * c);
a.lineTo(0.85 * b, c);
P(a, 0.55 * b, 0.95 * c, 0.5 * b, 0.75 * c, 0.6 * b, 0.6 * c);
var d = 0.2, e = 0.3, g = 0, h = 4 * (Math.SQRT2 - 1) / 3 * d;
P(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
P(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
P(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e + 0.05) * b, (0.5 - h + g - 0.02) * c, 0.65 * b, 0.36771243 *
c);
d = 0.2;
e = 0;
g = -0.3;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
P(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
P(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
P(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, 0.35 * b, 0.36771243 * c);
d = 0.2;
e = -0.3;
g = 0;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
P(a, (0.5 + d + e - 0.05) * b, (0.5 - h + g - 0.02) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d +
e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
P(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
P(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, 0.4 * b, 0.6 * c);
Q(a);
b = a.s;
b.G = new K(0.06, 0.39);
b.H = new K(0.93, 0.58);
t.v(a);
return b
}, Ring: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
O(a, b, 0.5 * c, !0);
P(a, b, (0.5 - d) * c, (0.5 + d) * b, 0, 0.5 * b, 0);
P(a, (0.5 - d) * b, 0, 0, (0.5 - d) * c, 0, 0.5 * c);
P(a, 0, (0.5 + d) * c, (0.5 - d) * b, c, 0.5 * b, c);
P(a, (0.5 + d) * b, c, b, (0.5 + d) * c, b, 0.5 * c);
d = 4 * (Math.SQRT2 - 1) / 3 * 0.4;
O(a,
0.5 * b, 0.1 * c, !0, !0);
P(a, (0.5 + d) * b, 0.1 * c, 0.9 * b, (0.5 - d) * c, 0.9 * b, 0.5 * c);
P(a, 0.9 * b, (0.5 + d) * c, (0.5 + d) * b, 0.9 * c, 0.5 * b, 0.9 * c);
P(a, (0.5 - d) * b, 0.9 * c, 0.1 * b, (0.5 + d) * c, 0.1 * b, 0.5 * c);
P(a, 0.1 * b, (0.5 - d) * c, (0.5 - d) * b, 0.1 * c, 0.5 * b, 0.1 * c);
b = a.s;
b.G = new K(0.146, 0.146);
b.H = new K(0.853, 0.853);
b.kc = Xg;
t.v(a);
return b
}, YinYang: function (a, b, c) {
var d = 0.5;
a = t.u();
d = 0.5;
O(a, 0.5 * b, 0, !0);
a.arcTo(270, 180, 0.5 * b, 0.5 * b, 0.5 * b);
P(a, 1 * b, d * c, 0, d * c, d * b, 0, !0);
var d = 0.1, e = 0.25;
O(a, (0.5 + d) * b, e * c, !0, !0);
a.arcTo(0, -360, 0.5 * b, c * e, d * b);
Q(a);
O(a, 0.5 *
b, 0, !1);
a.arcTo(270, -180, 0.5 * b, 0.5 * b, 0.5 * b);
a.ab(!1);
e = 0.75;
O(a, (0.5 + d) * b, e * c, !0);
a.arcTo(0, 360, 0.5 * b, c * e, d * b);
Q(a);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}, Peace: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
O(a, b, 0.5 * c, !0);
P(a, b, (0.5 - d) * c, (0.5 + d) * b, 0, 0.5 * b, 0);
P(a, (0.5 - d) * b, 0, 0, (0.5 - d) * c, 0, 0.5 * c);
P(a, 0, (0.5 + d) * c, (0.5 - d) * b, c, 0.5 * b, c);
P(a, (0.5 + d) * b, c, b, (0.5 + d) * c, b, 0.5 * c);
d = 4 * (Math.SQRT2 - 1) / 3 * 0.4;
O(a, 0.5 * b, 0.1 * c, !0, !0);
P(a, (0.5 + d) * b, 0.1 * c, 0.9 * b, (0.5 - d) * c, 0.9 * b, 0.5 * c);
P(a, 0.9 * b, (0.5 + d) * c, (0.5 + d) * b, 0.9 *
c, 0.5 * b, 0.9 * c);
P(a, (0.5 - d) * b, 0.9 * c, 0.1 * b, (0.5 + d) * c, 0.1 * b, 0.5 * c);
P(a, 0.1 * b, (0.5 - d) * c, (0.5 - d) * b, 0.1 * c, 0.5 * b, 0.1 * c);
var d = 0.07, e = 0, g = -0.707 * 0.11, h = 4 * (Math.SQRT2 - 1) / 3 * d;
O(a, (0.5 + d + e) * b, (0.5 + g) * c, !0);
P(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
P(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
P(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
d = 0.07;
e = -0.707 * 0.11;
g = 0.707 * 0.11;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
O(a, (0.5 + d + e) * b, (0.5 + g) * c, !0);
P(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
P(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
P(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
d = 0.07;
e = 0.707 * 0.11;
g = 0.707 * 0.11;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
O(a, (0.5 + d + e) * b, (0.5 + g) * c, !0);
P(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h +
e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
P(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
P(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
b = a.s;
b.G = new K(0.146, 0.146);
b.H = new K(0.853, 0.853);
b.kc = Xg;
t.v(a);
return b
}, NotAllowed: function (a, b, c) {
var d = J.va, e = 0.5 * d, g = 0.5;
a = t.u();
O(a, 0.5 * b, (0.5 - g) * c, !0);
P(a, (0.5 - e) * b, (0.5 - g) * c, (0.5 - g) * b, (0.5 - e) * c, (0.5 - g) * b, 0.5 * c);
P(a, (0.5 - g) * b,
(0.5 + e) * c, (0.5 - e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
P(a, (0.5 + e) * b, (0.5 + g) * c, (0.5 + g) * b, (0.5 + e) * c, (0.5 + g) * b, 0.5 * c);
P(a, (0.5 + g) * b, (0.5 - e) * c, (0.5 + e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
var g = 0.4, e = 0.4 * d, d = t.O(), h = t.O(), k = t.O(), l = t.O();
J.Fi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.42, d, h, k, l, l);
var m = t.O(), n = t.O(), p = t.O();
J.Fi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.58, l, l, p, m, n);
var q = t.O(), r = t.O(), s = t.O();
J.Fi(0.5, 0.5 + g, 0.5 - e, 0.5 + g, 0.5 - g, 0.5 + e, 0.5 - g, 0.5, 0.42, q, r, s, l, l);
var v = t.O(), x = t.O(), E = t.O();
J.Fi(0.5,
0.5 + g, 0.5 - e, 0.5 + g, 0.5 - g, 0.5 + e, 0.5 - g, 0.5, 0.58, l, l, E, v, x);
O(a, E.x * b, E.y * c, !0, !0);
P(a, v.x * b, v.y * c, x.x * b, x.y * c, (0.5 - g) * b, 0.5 * c);
P(a, (0.5 - g) * b, (0.5 - e) * c, (0.5 - e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
P(a, d.x * b, d.y * c, h.x * b, h.y * c, k.x * b, k.y * c);
a.lineTo(E.x * b, E.y * c);
Q(a);
O(a, s.x * b, s.y * c, !0, !0);
a.lineTo(p.x * b, p.y * c);
P(a, m.x * b, m.y * c, n.x * b, n.y * c, (0.5 + g) * b, 0.5 * c);
P(a, (0.5 + g) * b, (0.5 + e) * c, (0.5 + e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
P(a, q.x * b, q.y * c, r.x * b, r.y * c, s.x * b, s.y * c);
Q(a);
t.B(d);
t.B(h);
t.B(k);
t.B(l);
t.B(m);
t.B(n);
t.B(p);
t.B(q);
t.B(r);
t.B(s);
t.B(v);
t.B(x);
t.B(E);
b = a.s;
t.v(a);
b.kc = Xg;
return b
}, Fragile: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(0.25 * b, 0);
a.lineTo(0.2 * b, 0.15 * c);
a.lineTo(0.3 * b, 0.25 * c);
a.lineTo(0.29 * b, 0.33 * c);
a.lineTo(0.35 * b, 0.25 * c);
a.lineTo(0.3 * b, 0.15 * c);
a.lineTo(0.4 * b, 0);
a.lineTo(1 * b, 0);
P(a, 1 * b, 0.25 * c, 0.75 * b, 0.5 * c, 0.55 * b, 0.5 * c);
a.lineTo(0.55 * b, 0.9 * c);
a.lineTo(0.7 * b, 0.9 * c);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.3 * b, 1 * c);
a.lineTo(0.3 * b, 0.9 * c);
a.lineTo(0.45 * b, 0.9 * c);
a.lineTo(0.45 * b, 0.5 * c);
P(a, 0.25 * b, 0.5 * c, 0, 0.25 * c,
0, 0);
Q(a);
b = a.s;
b.G = new K(0.25, 0);
b.H = new K(0.75, 0.4);
t.v(a);
return b
}, HourGlass: function (a, b, c) {
a = t.u();
O(a, 0.65 * b, 0.5 * c, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0.35 * b, 0.5 * c);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
Q(a);
b = a.s;
t.v(a);
return b
}, Lightning: function (a, b, c) {
a = t.u();
O(a, 0 * b, 0.55 * c, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(0.25 * b, 0.45 * c);
a.lineTo(0.9 * b, 0.48 * c);
a.lineTo(0.4 * b, 1 * c);
a.lineTo(0.65 * b, 0.55 * c);
Q(a);
b = a.s;
t.v(a);
return b
}, Parallelogram1: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.1);
var d = t.u();
O(d, a * b, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo((1 - a) * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
b = d.s;
b.G = new K(a, 0);
b.H = new K(1 - a, 1);
t.v(d);
return b
}, Input: "Output", Output: function (a, b, c) {
a = t.u();
O(a, 0, 1 * c, !0);
a.lineTo(0.1 * b, 0);
a.lineTo(1 * b, 0);
a.lineTo(0.9 * b, 1 * c);
Q(a);
b = a.s;
b.G = new K(0.1, 0);
b.H = new K(0.9, 1);
t.v(a);
return b
}, Parallelogram2: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.25);
var d = t.u();
O(d, a * b, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo((1 - a) * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
b = d.s;
b.G = new K(a, 0);
b.H = new K(1 - a, 1);
t.v(d);
return b
},
ThickCross: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.25);
var d = t.u();
O(d, (0.5 - a / 2) * b, 0, !0);
d.lineTo((0.5 + a / 2) * b, 0);
d.lineTo((0.5 + a / 2) * b, (0.5 - a / 2) * c);
d.lineTo(1 * b, (0.5 - a / 2) * c);
d.lineTo(1 * b, (0.5 + a / 2) * c);
d.lineTo((0.5 + a / 2) * b, (0.5 + a / 2) * c);
d.lineTo((0.5 + a / 2) * b, 1 * c);
d.lineTo((0.5 - a / 2) * b, 1 * c);
d.lineTo((0.5 - a / 2) * b, (0.5 + a / 2) * c);
d.lineTo(0, (0.5 + a / 2) * c);
d.lineTo(0, (0.5 - a / 2) * c);
d.lineTo((0.5 - a / 2) * b, (0.5 - a / 2) * c);
Q(d);
b = d.s;
b.G = new K(0.5 - a / 2, 0.5 - a / 2);
b.H = new K(0.5 + a / 2, 0.5 + a / 2);
t.v(d);
return b
}, ThickX: function (a, b, c) {
a = 0.25 / Math.SQRT2;
var d = t.u();
O(d, 0.3 * b, 0, !0);
d.lineTo(0.5 * b, 0.2 * c);
d.lineTo(0.7 * b, 0);
d.lineTo(1 * b, 0.3 * c);
d.lineTo(0.8 * b, 0.5 * c);
d.lineTo(1 * b, 0.7 * c);
d.lineTo(0.7 * b, 1 * c);
d.lineTo(0.5 * b, 0.8 * c);
d.lineTo(0.3 * b, 1 * c);
d.lineTo(0, 0.7 * c);
d.lineTo(0.2 * b, 0.5 * c);
d.lineTo(0, 0.3 * c);
Q(d);
b = d.s;
b.G = new K(0.5 - a, 0.5 - a);
b.H = new K(0.5 + a, 0.5 + a);
t.v(d);
return b
}, ThinCross: function (a, b, c) {
var d = a ? a.yc : 0;
0 === d && (d = 0.1);
a = t.u();
O(a, (0.5 - d / 2) * b, 0, !0);
a.lineTo((0.5 + d / 2) * b, 0);
a.lineTo((0.5 + d / 2) * b, (0.5 - d / 2) * c);
a.lineTo(1 * b,
(0.5 - d / 2) * c);
a.lineTo(1 * b, (0.5 + d / 2) * c);
a.lineTo((0.5 + d / 2) * b, (0.5 + d / 2) * c);
a.lineTo((0.5 + d / 2) * b, 1 * c);
a.lineTo((0.5 - d / 2) * b, 1 * c);
a.lineTo((0.5 - d / 2) * b, (0.5 + d / 2) * c);
a.lineTo(0, (0.5 + d / 2) * c);
a.lineTo(0, (0.5 - d / 2) * c);
a.lineTo((0.5 - d / 2) * b, (0.5 - d / 2) * c);
Q(a);
b = a.s;
t.v(a);
return b
}, ThinX: function (a, b, c) {
a = t.u();
O(a, 0.1 * b, 0, !0);
a.lineTo(0.5 * b, 0.4 * c);
a.lineTo(0.9 * b, 0);
a.lineTo(1 * b, 0.1 * c);
a.lineTo(0.6 * b, 0.5 * c);
a.lineTo(1 * b, 0.9 * c);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.5 * b, 0.6 * c);
a.lineTo(0.1 * b, 1 * c);
a.lineTo(0, 0.9 * c);
a.lineTo(0.4 *
b, 0.5 * c);
a.lineTo(0, 0.1 * c);
Q(a);
return a.s
}, RightTriangle: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.5);
b.H = new K(0.5, 1);
t.v(a);
return b
}, RoundedIBeam: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(1 * b, 0);
P(a, 0.5 * b, 0.25 * c, 0.5 * b, 0.75 * c, 1 * b, 1 * c);
a.lineTo(0, 1 * c);
P(a, 0.5 * b, 0.75 * c, 0.5 * b, 0.25 * c, 0, 0);
Q(a);
b = a.s;
t.v(a);
return b
}, RoundedRectangle: function (a, b, c) {
var d = a ? a.yc : 0;
0 >= d && (d = 5);
d = Math.min(d, b / 3);
d = Math.min(d, c / 3);
a = d * J.va;
var e = t.u();
O(e, d, 0, !0);
e.lineTo(b - d, 0);
P(e, b - a, 0, b, a, b, d);
e.lineTo(b, c - d);
P(e, b, c - a, b - a, c, b - d, c);
e.lineTo(d, c);
P(e, a, c, 0, c - a, 0, c - d);
e.lineTo(0, d);
P(e, 0, a, a, 0, d, 0);
Q(e);
b = e.s;
1 < a ? (b.G = new K(0, 0, a, a), b.H = new K(1, 1, -a, -a)) : (b.G = Qb, b.H = Zb);
t.v(e);
return b
}, Border: function (a, b, c) {
var d = a ? a.yc : 0;
0 >= d && (d = 5);
d = Math.min(d, b / 3);
d = Math.min(d, c / 3);
a = t.u();
O(a, d, 0, !0);
a.lineTo(b - d, 0);
P(a, b - 0, 0, b, 0, b, d);
a.lineTo(b, c - d);
P(a, b, c - 0, b - 0, c, b - d, c);
a.lineTo(d, c);
P(a, 0, c, 0, c - 0, 0, c - d);
a.lineTo(0, d);
P(a, 0, 0, 0, 0, d, 0);
Q(a);
b = a.s;
b.G = Qb;
b.H = Zb;
t.v(a);
return b
}, SquareIBeam: function (a, b, c) {
var d = a ? a.yc : 0;
0 === d && (d = 0.2);
a = t.u();
O(a, 0, 0, !0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, d * c);
a.lineTo((0.5 + d / 2) * b, d * c);
a.lineTo((0.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((0.5 - d / 2) * b, (1 - d) * c);
a.lineTo((0.5 - d / 2) * b, d * c);
a.lineTo(0, d * c);
Q(a);
b = a.s;
t.v(a);
return b
}, Trapezoid: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.2);
var d = t.u();
O(d, a * b, 0, !0);
d.lineTo((1 - a) * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
b = d.s;
b.G = new K(a, 0);
b.H = new K(1 - a, 1);
t.v(d);
return b
}, ManualLoop: "ManualOperation", ManualOperation: function (a, b, c) {
var d = a ? a.yc : 0;
a = t.u();
O(a, d, 0, !0);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.1 * b, 1 * c);
Q(a);
b = a.s;
b.G = new K(0.1, 0);
b.H = new K(0.9, 1);
t.v(a);
return b
}, GenderMale: function (a, b, c) {
a = t.u();
var d = J.va, e = 0.4 * d, g = 0.4, h = t.O(), k = t.O(), l = t.O(), m = t.O();
O(a, (0.5 - g) * b, 0.5 * c, !0);
P(a, (0.5 - g) * b, (0.5 - e) * c, (0.5 - e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
J.Fi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5,
0.44, l, m, k, h, h);
P(a, l.x * b, l.y * c, m.x * b, m.y * c, k.x * b, k.y * c);
var n = t.ic(k.x, k.y);
J.Fi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.56, h, h, k, l, m);
var p = t.ic(k.x, k.y);
a.lineTo((0.1 * n.x + 0.855) * b, 0.1 * n.y * c);
a.lineTo(0.85 * b, 0.1 * n.y * c);
a.lineTo(0.85 * b, 0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.15 * c);
a.lineTo((0.1 * p.x + 0.9) * b, 0.15 * c);
a.lineTo((0.1 * p.x + 0.9) * b, (0.1 * p.y + 0.05 * 0.9) * c);
a.lineTo(p.x * b, p.y * c);
P(a, l.x * b, l.y * c, m.x * b, m.y * c, (0.5 + g) * b, 0.5 * c);
P(a, (0.5 + g) * b, (0.5 + e) * c, (0.5 + e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
P(a, (0.5 - e) *
b, (0.5 + g) * c, (0.5 - g) * b, (0.5 + e) * c, (0.5 - g) * b, 0.5 * c);
g = 0.35;
e = 0.35 * d;
O(a, 0.5 * b, (0.5 - g) * c, !0, !0);
P(a, (0.5 - e) * b, (0.5 - g) * c, (0.5 - g) * b, (0.5 - e) * c, (0.5 - g) * b, 0.5 * c);
P(a, (0.5 - g) * b, (0.5 + e) * c, (0.5 - e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
P(a, (0.5 + e) * b, (0.5 + g) * c, (0.5 + g) * b, (0.5 + e) * c, (0.5 + g) * b, 0.5 * c);
P(a, (0.5 + g) * b, (0.5 - e) * c, (0.5 + e) * b, (0.5 - g) * c, 0.5 * b, (0.5 - g) * c);
O(a, (0.5 - g) * b, 0.5 * c, !0);
t.B(h);
t.B(k);
t.B(l);
t.B(m);
t.B(n);
t.B(p);
b = a.s;
b.G = new K(0.202, 0.257);
b.H = new K(0.692, 0.839);
b.kc = Xg;
t.v(a);
return b
}, GenderFemale: function (a, b, c) {
a = t.u();
var d = 0.375, e = 0, g = -0.125, h = 4 * (Math.SQRT2 - 1) / 3 * d;
O(a, (0.525 + e) * b, (0.5 + d + g) * c, !0);
P(a, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + d + e) * b, (0.5 + g) * c);
P(a, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
P(a, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.475 + e) * b, (0.5 + d + g) * c);
a.lineTo(0.475 * b, 0.85 * c);
a.lineTo(0.425 * b, 0.85 * c);
a.lineTo(0.425 * b, 0.9 * c);
a.lineTo(0.475 * b, 0.9 * c);
a.lineTo(0.475 *
b, 1 * c);
a.lineTo(0.525 * b, 1 * c);
a.lineTo(0.525 * b, 0.9 * c);
a.lineTo(0.575 * b, 0.9 * c);
a.lineTo(0.575 * b, 0.85 * c);
a.lineTo(0.525 * b, 0.85 * c);
Q(a);
d = 0.325;
e = 0;
g = -0.125;
h = 4 * (Math.SQRT2 - 1) / 3 * d;
O(a, (0.5 + d + e) * b, (0.5 + g) * c, !0, !0);
P(a, (0.5 + d + e) * b, (0.5 + h + g) * c, (0.5 + h + e) * b, (0.5 + d + g) * c, (0.5 + e) * b, (0.5 + d + g) * c);
P(a, (0.5 - h + e) * b, (0.5 + d + g) * c, (0.5 - d + e) * b, (0.5 + h + g) * c, (0.5 - d + e) * b, (0.5 + g) * c);
P(a, (0.5 - d + e) * b, (0.5 - h + g) * c, (0.5 - h + e) * b, (0.5 - d + g) * c, (0.5 + e) * b, (0.5 - d + g) * c);
P(a, (0.5 + h + e) * b, (0.5 - d + g) * c, (0.5 + d + e) * b, (0.5 - h + g) * c, (0.5 + d + e) * b, (0.5 +
g) * c);
O(a, (0.525 + e) * b, (0.5 + d + g) * c, !0);
b = a.s;
b.G = new K(0.232, 0.136);
b.H = new K(0.782, 0.611);
b.kc = Xg;
t.v(a);
return b
}, PlusLine: function (a, b, c) {
a = t.u();
O(a, 0, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0.5 * b, 0);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, XLine: function (a, b, c) {
a = t.u();
O(a, 0, 1 * c, !1);
a.lineTo(1 * b, 0);
a.moveTo(0, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, AsteriskLine: function (a, b, c) {
a = t.u();
var d = 0.2 / Math.SQRT2;
O(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, 0.5 * c);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0.5 * b, 0 * c);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, CircleLine: function (a, b, c) {
var d = 0.5 * J.va;
a = t.u();
O(a, 1 * b, 0.5 * c, !1);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
P(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.G = new K(0.146, 0.146);
b.H = new K(0.853, 0.853);
b.kc = Xg;
t.v(a);
return b
}, Pie: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
O(a, (0.5 * Math.SQRT2 / 2 + 0.5) * b, (0.5 -
0.5 * Math.SQRT2 / 2) * c, !0);
P(a, 0.7 * b, 0 * c, 0.5 * b, 0 * c, 0.5 * b, 0 * c);
P(a, (0.5 - d + 0) * b, 0 * c, 0 * b, (0.5 - d + 0) * c, 0 * b, 0.5 * c);
P(a, 0 * b, (0.5 + d + 0) * c, (0.5 - d + 0) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 + d + 0) * b, 1 * c, 1 * b, (0.5 + d + 0) * c, 1 * b, 0.5 * c);
a.lineTo(0.5 * b, 0.5 * c);
Q(a);
b = a.s;
t.v(a);
return b
}, PiePiece: function (a, b, c) {
var d = J.va / Math.SQRT2 * 0.5, e = Math.SQRT2 / 2, g = 1 - Math.SQRT2 / 2;
a = t.u();
O(a, b, c, !0);
P(a, b, (1 - d) * c, (e + d) * b, (g + d) * c, e * b, g * c);
a.lineTo(0, c);
Q(a);
b = a.s;
t.v(a);
return b
}, StopSign: function (a, b, c) {
a = 1 / (Math.SQRT2 + 2);
var d = t.u();
O(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);
Q(d);
b = d.s;
b.G = new K(a / 2, a / 2);
b.H = new K(1 - a / 2, 1 - a / 2);
t.v(d);
return b
}, LogicImplies: function (a, b, c) {
var d = a ? a.yc : 0;
0 === d && (d = 0.2);
a = t.u();
O(a, (1 - d) * b, 0 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.lineTo((1 - d) * b, c);
a.moveTo(0, 0.5 * c);
a.lineTo(b, 0.5 * c);
b = a.s;
b.G = Qb;
b.H = new K(0.8, 0.5);
t.v(a);
return b
}, LogicIff: function (a, b, c) {
var d = a ? a.yc : 0;
0 === d && (d = 0.2);
a = t.u();
O(a, (1 - d) * b, 0 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.lineTo((1 - d) * b, c);
a.moveTo(0, 0.5 * c);
a.lineTo(b, 0.5 * c);
a.moveTo(d * b, 0);
a.lineTo(0, 0.5 * c);
a.lineTo(d * b, c);
b = a.s;
b.G = new K(0.2, 0);
b.H = new K(0.8, 0.5);
t.v(a);
return b
}, LogicNot: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, LogicAnd: function (a, b, c) {
a = t.u();
O(a, 0, 1 * c, !1);
a.lineTo(0.5 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
b.G = new K(0.25, 0.5);
b.H = new K(0.75, 1);
t.v(a);
return b
}, LogicOr: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(1 *
b, 0);
b = a.s;
b.G = new K(0.219, 0);
b.H = new K(0.78, 0.409);
t.v(a);
return b
}, LogicXor: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.moveTo(0, 0.5 * c);
a.lineTo(1 * b, 0.5 * c);
var d = 0.5 * J.va;
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
P(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}, LogicTruth: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.moveTo(0.5 * b, 0);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
t.v(a);
return b
},
LogicFalsity: function (a, b, c) {
a = t.u();
O(a, 0, 1 * c, !1);
a.lineTo(1 * b, 1 * c);
a.moveTo(0.5 * b, 1 * c);
a.lineTo(0.5 * b, 0);
b = a.s;
t.v(a);
return b
}, LogicThereExists: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0, 0.5 * c);
a.moveTo(1 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
b = a.s;
t.v(a);
return b
}, LogicForAll: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(1 * b, 0);
a.moveTo(0.25 * b, 0.5 * c);
a.lineTo(0.75 * b, 0.5 * c);
b = a.s;
b.G = new K(0.25, 0);
b.H = new K(0.75, 0.5);
t.v(a);
return b
},
LogicIsDefinedAs: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(b, 0);
a.moveTo(0, 0.5 * c);
a.lineTo(b, 0.5 * c);
a.moveTo(0, c);
a.lineTo(b, c);
b = a.s;
b.G = new K(0.01, 0.01);
b.H = new K(0.99, 0.49);
t.v(a);
return b
}, LogicIntersect: function (a, b, c) {
var d = 0.5 * J.va;
a = t.u();
O(a, 0, 1 * c, !1);
a.lineTo(0, 0.5 * c);
P(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
b = a.s;
b.G = new K(0, 0.5);
b.H = Zb;
t.v(a);
return b
}, LogicUnion: function (a, b, c) {
var d = 0.5 * J.va;
a = t.u();
O(a, 1 * b, 0, !1);
a.lineTo(1 * b,
0.5 * c);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
a.lineTo(0, 0);
b = a.s;
b.G = Qb;
b.H = new K(1, 0.5);
t.v(a);
return b
}, Arrow: function (a, b, c) {
var d = a ? a.yc : 0, e = a ? a.lt : 0;
0 === d && (d = 0.3);
0 === e && (e = 0.3);
a = t.u();
O(a, 0, (0.5 - e / 2) * c, !0);
a.lineTo((1 - d) * b, (0.5 - e / 2) * c);
a.lineTo((1 - d) * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo((1 - d) * b, 1 * c);
a.lineTo((1 - d) * b, (0.5 + e / 2) * c);
a.lineTo(0, (0.5 + e / 2) * c);
Q(a);
b = a.s;
b.G = new K(0, 0.5 - e / 2);
d = J.kl(0, 0.5 + e / 2, 1, 0.5 + e / 2, 1 - d, 1, 1, 0.5, t.O());
b.H = new K(d.x, d.y);
t.B(d);
t.v(a);
return b
}, ISOProcess: "Chevron", Chevron: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(0.5 * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0.5 * b, 0.5 * c);
Q(a);
b = a.s;
t.v(a);
return b
}, DoubleArrow: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(0.3 * b, 0.214 * c);
a.lineTo(0.3 * b, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.3 * b, 1 * c);
a.lineTo(0.3 * b, 0.786 * c);
a.lineTo(0, 1 * c);
Q(a);
O(a, 0.3 * b, 0.214 * c, !1);
a.lineTo(0.3 * b, 0.786 * c);
a.ab(!1);
b = a.s;
t.v(a);
return b
}, DoubleEndArrow: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.7 * b, 0.7 * c);
a.lineTo(0.3 * b, 0.7 * c);
a.lineTo(0.3 * b, 1 * c);
a.lineTo(0, 0.5 * c);
a.lineTo(0.3 * b, 0);
a.lineTo(0.3 * b, 0.3 * c);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 0);
Q(a);
b = a.s;
c = J.kl(0, 0.5, 0.3, 0, 0, 0.3, 0.3, 0.3, t.O());
b.G = new K(c.x, c.y);
c = J.kl(0.7, 1, 1, 0.5, 0.7, 0.7, 1, 0.7, c);
b.H = new K(c.x, c.y);
t.B(c);
t.v(a);
return b
}, IBeamArrow: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.7 * b, 0.7 * c);
a.lineTo(0.2 * b, 0.7 * c);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.2 * b, 0);
a.lineTo(0.2 * b, 0.3 * c);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 0);
Q(a);
b = a.s;
b.G = new K(0, 0.3);
c = J.kl(0.7, 1, 1, 0.5, 0.7, 0.7, 1, 0.7, t.O());
b.H = new K(c.x, c.y);
t.B(c);
t.v(a);
return b
}, Pointer: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
a.lineTo(0.2 * b, 0.5 * c);
a.lineTo(0, 0);
Q(a);
b = a.s;
b.G = new K(0.2, 0.35);
c = J.kl(0.2, 0.65, 1, 0.65, 0, 1, 1, 0.5, t.O());
b.H = new K(c.x, c.y);
t.B(c);
t.v(a);
return b
}, RoundedPointer: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
P(a, 0.5 *
b, 0.75 * c, 0.5 * b, 0.25 * c, 0, 0);
Q(a);
b = a.s;
b.G = new K(0.4, 0.35);
c = J.kl(0.2, 0.65, 1, 0.65, 0, 1, 1, 0.5, t.O());
b.H = new K(c.x, c.y);
t.B(c);
t.v(a);
return b
}, SplitEndArrow: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0.7 * b, 0.7 * c);
a.lineTo(0, 0.7 * c);
a.lineTo(0.2 * b, 0.5 * c);
a.lineTo(0, 0.3 * c);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 0);
Q(a);
b = a.s;
b.G = new K(0.2, 0.3);
c = J.kl(0.7, 1, 1, 0.5, 0.7, 0.7, 1, 0.7, t.O());
b.H = new K(c.x, c.y);
t.B(c);
t.v(a);
return b
}, MessageToUser: "SquareArrow", SquareArrow: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0.5 * c, !0);
a.lineTo(0.7 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.7 * b, 0);
Q(a);
b = a.s;
b.G = Qb;
b.H = new K(0.7, 1);
t.v(a);
return b
}, Cone1: function (a, b, c) {
var d = J.va;
a = 0.5 * d;
var e = 0.1 * d, d = t.u();
O(d, 0, 0.9 * c, !0);
d.lineTo(0.5 * b, 0);
d.lineTo(1 * b, 0.9 * c);
P(d, 1 * b, (0.9 + e) * c, (0.5 + a) * b, 1 * c, 0.5 * b, 1 * c);
P(d, (0.5 - a) * b, 1 * c, 0, (0.9 + e) * c, 0, 0.9 * c);
Q(d);
b = d.s;
b.G = new K(0.25, 0.5);
b.H = new K(0.75, 0.97);
t.v(d);
return b
}, Cone2: function (a, b, c) {
a = t.u();
O(a, 0, 0.9 * c, !0);
P(a, (1 - 0.85 / 0.9) * b, 1 * c, 0.85 / 0.9 * b, 1 * c,
1 * b, 0.9 * c);
a.lineTo(0.5 * b, 0);
a.lineTo(0, 0.9 * c);
Q(a);
O(a, 0, 0.9 * c, !1);
P(a, (1 - 0.85 / 0.9) * b, 0.8 * c, 0.85 / 0.9 * b, 0.8 * c, 1 * b, 0.9 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.25, 0.5);
b.H = new K(0.75, 0.82);
t.v(a);
return b
}, Cube1: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 1 * c, !0);
a.lineTo(1 * b, 0.85 * c);
a.lineTo(1 * b, 0.15 * c);
a.lineTo(0.5 * b, 0 * c);
a.lineTo(0 * b, 0.15 * c);
a.lineTo(0 * b, 0.85 * c);
Q(a);
O(a, 0.5 * b, 1 * c, !1);
a.lineTo(0.5 * b, 0.3 * c);
a.lineTo(0, 0.15 * c);
a.moveTo(0.5 * b, 0.3 * c);
a.lineTo(1 * b, 0.15 * c);
a.ab(!1);
b = a.s;
b.G = new K(0, 0.3);
b.H = new K(0.5, 0.85);
t.v(a);
return b
}, Cube2: function (a, b, c) {
a = t.u();
O(a, 0, 0.3 * c, !0);
a.lineTo(0 * b, 1 * c);
a.lineTo(0.7 * b, c);
a.lineTo(1 * b, 0.7 * c);
a.lineTo(1 * b, 0 * c);
a.lineTo(0.3 * b, 0 * c);
Q(a);
O(a, 0, 0.3 * c, !1);
a.lineTo(0.7 * b, 0.3 * c);
a.lineTo(1 * b, 0 * c);
a.moveTo(0.7 * b, 0.3 * c);
a.lineTo(0.7 * b, 1 * c);
a.ab(!1);
b = a.s;
b.G = new K(0, 0.3);
b.H = new K(0.7, 1);
t.v(a);
return b
}, MagneticData: "Cylinder1", Cylinder1: function (a, b, c) {
var d = J.va;
a = 0.5 * d;
var e = 0.1 * d, d = t.u();
O(d, 0, 0.1 * c, !0);
P(d, 0, (0.1 - e) * c, (0.5 - a) * b, 0, 0.5 * b, 0);
P(d, (0.5 + a) * b, 0, 1 * b, (0.1 - e) * c, 1 *
b, 0.1 * c);
d.lineTo(b, 0.9 * c);
P(d, 1 * b, (0.9 + e) * c, (0.5 + a) * b, 1 * c, 0.5 * b, 1 * c);
P(d, (0.5 - a) * b, 1 * c, 0, (0.9 + e) * c, 0, 0.9 * c);
d.lineTo(0, 0.1 * c);
O(d, 0, 0.1 * c, !1);
P(d, 0, (0.1 + e) * c, (0.5 - a) * b, 0.2 * c, 0.5 * b, 0.2 * c);
P(d, (0.5 + a) * b, 0.2 * c, 1 * b, (0.1 + e) * c, 1 * b, 0.1 * c);
d.ab(!1);
b = d.s;
b.G = new K(0, 0.2);
b.H = new K(1, 0.9);
t.v(d);
return b
}, Cylinder2: function (a, b, c) {
var d = J.va;
a = 0.5 * d;
var e = 0.1 * d, d = t.u();
O(d, 0, 0.9 * c, !0);
d.lineTo(0, 0.1 * c);
P(d, 0, (0.1 - e) * c, (0.5 - a) * b, 0, 0.5 * b, 0);
P(d, (0.5 + a) * b, 0, 1 * b, (0.1 - e) * c, 1 * b, 0.1 * c);
d.lineTo(1 * b, 0.9 * c);
P(d, 1 *
b, (0.9 + e) * c, (0.5 + a) * b, 1 * c, 0.5 * b, 1 * c);
P(d, (0.5 - a) * b, 1 * c, 0, (0.9 + e) * c, 0, 0.9 * c);
O(d, 0, 0.9 * c, !1);
P(d, 0, (0.9 - e) * c, (0.5 - a) * b, 0.8 * c, 0.5 * b, 0.8 * c);
P(d, (0.5 + a) * b, 0.8 * c, 1 * b, (0.9 - e) * c, 1 * b, 0.9 * c);
d.ab(!1);
b = d.s;
b.G = new K(0, 0.1);
b.H = new K(1, 0.8);
t.v(d);
return b
}, Cylinder3: function (a, b, c) {
var d = J.va;
a = 0.1 * d;
var e = 0.5 * d, d = t.u();
O(d, 0.1 * b, 0, !0);
d.lineTo(0.9 * b, 0);
P(d, (0.9 + a) * b, 0, 1 * b, (0.5 - e) * c, 1 * b, 0.5 * c);
P(d, 1 * b, (0.5 + e) * c, (0.9 + a) * b, 1 * c, 0.9 * b, 1 * c);
d.lineTo(0.1 * b, 1 * c);
P(d, (0.1 - a) * b, 1 * c, 0, (0.5 + e) * c, 0, 0.5 * c);
P(d, 0, (0.5 -
e) * c, (0.1 - a) * b, 0, 0.1 * b, 0);
O(d, 0.1 * b, 0, !1);
P(d, (0.1 + a) * b, 0, 0.2 * b, (0.5 - e) * c, 0.2 * b, 0.5 * c);
P(d, 0.2 * b, (0.5 + e) * c, (0.1 + a) * b, 1 * c, 0.1 * b, 1 * c);
d.ab(!1);
b = d.s;
b.G = new K(0.2, 0);
b.H = new K(0.9, 1);
t.v(d);
return b
}, DirectData: "Cylinder4", Cylinder4: function (a, b, c) {
var d = J.va;
a = 0.1 * d;
var e = 0.5 * d, d = t.u();
O(d, 0.9 * b, 0, !0);
P(d, (0.9 + a) * b, 0, 1 * b, (0.5 - e) * c, 1 * b, 0.5 * c);
P(d, 1 * b, (0.5 + e) * c, (0.9 + a) * b, 1 * c, 0.9 * b, 1 * c);
d.lineTo(0.1 * b, 1 * c);
P(d, (0.1 - a) * b, 1 * c, 0, (0.5 + e) * c, 0, 0.5 * c);
P(d, 0, (0.5 - e) * c, (0.1 - a) * b, 0, 0.1 * b, 0);
d.lineTo(0.9 * b, 0);
O(d,
0.9 * b, 0, !1);
P(d, (0.9 - a) * b, 0, 0.8 * b, (0.5 - e) * c, 0.8 * b, 0.5 * c);
P(d, 0.8 * b, (0.5 + e) * c, (0.9 - a) * b, 1 * c, 0.9 * b, 1 * c);
d.ab(!1);
b = d.s;
b.G = new K(0.1, 0);
b.H = new K(0.8, 1);
t.v(d);
return b
}, Prism1: function (a, b, c) {
a = t.u();
O(a, 0.25 * b, 0.25 * c, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(b, 0.5 * c);
a.lineTo(0.5 * b, c);
a.lineTo(0, c);
Q(a);
O(a, 0.25 * b, 0.25 * c, !1);
a.lineTo(0.5 * b, c);
a.ab(!1);
b = a.s;
b.G = new K(0.408, 0.172);
b.H = new K(0.833, 0.662);
t.v(a);
return b
}, Prism2: function (a, b, c) {
a = t.u();
O(a, 0, 0.25 * c, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 * b, 0.25 * c);
a.lineTo(0.75 * b, 0.75 * c);
a.lineTo(0, 1 * c);
Q(a);
O(a, 0, c, !1);
a.lineTo(0.25 * b, 0.5 * c);
a.lineTo(b, 0.25 * c);
a.moveTo(0, 0.25 * c);
a.lineTo(0.25 * b, 0.5 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.25, 0.5);
b.H = new K(0.75, 0.75);
t.v(a);
return b
}, Pyramid1: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !0);
a.lineTo(b, 0.75 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.75 * c);
Q(a);
O(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 1 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.25, 0.367);
b.H = new K(0.75, 0.875);
t.v(a);
return b
}, Pyramid2: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !0);
a.lineTo(b, 0.85 *
c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.85 * c);
Q(a);
O(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 0.7 * c);
a.lineTo(0, 0.85 * c);
a.moveTo(0.5 * b, 0.7 * c);
a.lineTo(1 * b, 0.85 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.25, 0.367);
b.H = new K(0.75, 0.875);
t.v(a);
return b
}, Actor: function (a, b, c) {
var d = J.va, e = 0.2 * d, g = 0.1 * d, h = 0.5, k = 0.1;
a = t.u();
O(a, h * b, (k + 0.1) * c, !0);
P(a, (h - e) * b, (k + 0.1) * c, (h - 0.2) * b, (k + g) * c, (h - 0.2) * b, k * c);
P(a, (h - 0.2) * b, (k - g) * c, (h - e) * b, (k - 0.1) * c, h * b, (k - 0.1) * c);
P(a, (h + e) * b, (k - 0.1) * c, (h + 0.2) * b, (k - g) * c, (h + 0.2) * b, k * c);
P(a, (h + 0.2) * b, (k + g) * c,
(h + e) * b, (k + 0.1) * c, h * b, (k + 0.1) * c);
e = 0.05;
g = d * e;
O(a, 0.5 * b, 0.2 * c, !0);
a.lineTo(0.95 * b, 0.2 * c);
h = 0.95;
k = 0.25;
P(a, (h + g) * b, (k - e) * c, (h + e) * b, (k - g) * c, (h + e) * b, k * c);
a.lineTo(1 * b, 0.6 * c);
a.lineTo(0.85 * b, 0.6 * c);
a.lineTo(0.85 * b, 0.35 * c);
e = 0.025;
g = d * e;
h = 0.825;
k = 0.35;
P(a, (h + e) * b, (k - g) * c, (h + g) * b, (k - e) * c, h * b, (k - e) * c);
P(a, (h - g) * b, (k - e) * c, (h - e) * b, (k - g) * c, (h - e) * b, k * c);
a.lineTo(0.8 * b, 1 * c);
a.lineTo(0.55 * b, 1 * c);
a.lineTo(0.55 * b, 0.7 * c);
e = 0.05;
g = d * e;
h = 0.5;
k = 0.7;
P(a, (h + e) * b, (k - g) * c, (h + g) * b, (k - e) * c, h * b, (k - e) * c);
P(a, (h - g) * b, (k - e) *
c, (h - e) * b, (k - g) * c, (h - e) * b, k * c);
a.lineTo(0.45 * b, 1 * c);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0.2 * b, 0.35 * c);
e = 0.025;
g = d * e;
h = 0.175;
k = 0.35;
P(a, (h + e) * b, (k - g) * c, (h + g) * b, (k - e) * c, h * b, (k - e) * c);
P(a, (h - g) * b, (k - e) * c, (h - e) * b, (k - g) * c, (h - e) * b, k * c);
a.lineTo(0.15 * b, 0.6 * c);
a.lineTo(0 * b, 0.6 * c);
a.lineTo(0 * b, 0.25 * c);
e = 0.05;
g = d * e;
h = 0.05;
k = 0.25;
P(a, (h - e) * b, (k - g) * c, (h - g) * b, (k - e) * c, h * b, (k - e) * c);
a.lineTo(0.5 * b, 0.2 * c);
b = a.s;
b.G = new K(0.2, 0.2);
b.H = new K(0.8, 0.65);
t.v(a);
return b
}, Card: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0 * c, !0);
a.lineTo(1 *
b, 1 * c);
a.lineTo(0 * b, 1 * c);
a.lineTo(0 * b, 0.2 * c);
a.lineTo(0.2 * b, 0 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.2);
b.H = Zb;
t.v(a);
return b
}, Collate: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0.5 * c, !0);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
a.lineTo(0.5 * b, 0.5 * c);
O(a, 0.5 * b, 0.5 * c, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0.5 * b, 0.5 * c);
b = a.s;
b.G = new K(0.25, 0);
b.H = new K(0.75, 0.25);
t.v(a);
return b
}, CreateRequest: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.1);
var d = t.u();
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
O(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.ab(!1);
b = d.s;
b.G = new K(0, a);
b.H = new K(1, 1 - a);
t.v(d);
return b
}, Database: function (a, b, c) {
a = t.u();
var d = J.va, e = 0.5 * d, d = 0.1 * d;
O(a, 1 * b, 0.1 * c, !0);
a.lineTo(1 * b, 0.9 * c);
P(a, 1 * b, (0.9 + d) * c, (0.5 + e) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - e) * b, 1 * c, 0, (0.9 + d) * c, 0, 0.9 * c);
a.lineTo(0, 0.1 * c);
P(a, 0, (0.1 - d) * c, (0.5 - e) * b, 0, 0.5 * b, 0);
P(a, (0.5 + e) * b, 0, 1 * b, (0.1 - d) * c, 1 * b, 0.1 * c);
O(a, 1 * b, 0.1 * c, !1);
P(a, 1 * b, (0.1 + d) * c, (0.5 + e) * b, 0.2 * c, 0.5 * b, 0.2 * c);
P(a, (0.5 - e) * b, 0.2 * c, 0, (0.1 + d) *
c, 0, 0.1 * c);
a.moveTo(1 * b, 0.2 * c);
P(a, 1 * b, (0.2 + d) * c, (0.5 + e) * b, 0.3 * c, 0.5 * b, 0.3 * c);
P(a, (0.5 - e) * b, 0.3 * c, 0, (0.2 + d) * c, 0, 0.2 * c);
a.moveTo(1 * b, 0.3 * c);
P(a, 1 * b, (0.3 + d) * c, (0.5 + e) * b, 0.4 * c, 0.5 * b, 0.4 * c);
P(a, (0.5 - e) * b, 0.4 * c, 0, (0.3 + d) * c, 0, 0.3 * c);
a.ab(!1);
b = a.s;
b.G = new K(0, 0.4);
b.H = new K(1, 0.9);
t.v(a);
return b
}, StoredData: "DataStorage", DataStorage: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(0.75 * b, 0);
P(a, 1 * b, 0, 1 * b, 1 * c, 0.75 * b, 1 * c);
a.lineTo(0, 1 * c);
P(a, 0.25 * b, 0.9 * c, 0.25 * b, 0.1 * c, 0, 0);
Q(a);
b = a.s;
b.G = new K(0.226, 0);
b.H = new K(0.81,
1);
t.v(a);
return b
}, DiskStorage: function (a, b, c) {
a = t.u();
var d = J.va, e = 0.5 * d, d = 0.1 * d;
O(a, 1 * b, 0.1 * c, !0);
a.lineTo(1 * b, 0.9 * c);
P(a, 1 * b, (0.9 + d) * c, (0.5 + e) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - e) * b, 1 * c, 0, (0.9 + d) * c, 0, 0.9 * c);
a.lineTo(0, 0.1 * c);
P(a, 0, (0.1 - d) * c, (0.5 - e) * b, 0, 0.5 * b, 0);
P(a, (0.5 + e) * b, 0, 1 * b, (0.1 - d) * c, 1 * b, 0.1 * c);
O(a, 1 * b, 0.1 * c, !1);
P(a, 1 * b, (0.1 + d) * c, (0.5 + e) * b, 0.2 * c, 0.5 * b, 0.2 * c);
P(a, (0.5 - e) * b, 0.2 * c, 0, (0.1 + d) * c, 0, 0.1 * c);
a.moveTo(1 * b, 0.2 * c);
P(a, 1 * b, (0.2 + d) * c, (0.5 + e) * b, 0.3 * c, 0.5 * b, 0.3 * c);
P(a, (0.5 - e) * b, 0.3 * c, 0, (0.2 + d) *
c, 0, 0.2 * c);
a.ab(!1);
b = a.s;
b.G = new K(0, 0.3);
b.H = new K(1, 0.9);
t.v(a);
return b
}, Display: function (a, b, c) {
a = t.u();
O(a, 0.25 * b, 0, !0);
a.lineTo(0.75 * b, 0);
P(a, 1 * b, 0, 1 * b, 1 * c, 0.75 * b, 1 * c);
a.lineTo(0.25 * b, 1 * c);
a.lineTo(0, 0.5 * c);
Q(a);
b = a.s;
b.G = new K(0.25, 0);
b.H = new K(0.75, 1);
t.v(a);
return b
}, DividedEvent: function (a, b, c) {
a = a ? a.yc : 0;
0 === a ? a = 0.2 : 0.15 > a && (a = 0.15);
var d = t.u(), e = 0.2 * J.va;
O(d, 0, 0.2 * c, !0);
P(d, 0, (0.2 - e) * c, (0.2 - e) * b, 0, 0.2 * b, 0);
d.lineTo(0.8 * b, 0);
P(d, (0.8 + e) * b, 0, 1 * b, (0.2 - e) * c, 1 * b, 0.2 * c);
d.lineTo(1 * b, 0.8 * c);
P(d, 1 * b, (0.8 + e) * c, (0.8 + e) * b, 1 * c, 0.8 * b, 1 * c);
d.lineTo(0.2 * b, 1 * c);
P(d, (0.2 - e) * b, 1 * c, 0, (0.8 + e) * c, 0, 0.8 * c);
d.lineTo(0, 0.2 * c);
O(d, 0, a * c, !1);
d.lineTo(1 * b, a * c);
d.ab(!1);
b = d.s;
b.G = new K(0, a);
b.H = new K(1, 1 - a);
t.v(d);
return b
}, DividedProcess: function (a, b, c) {
a = a ? a.yc : 0;
0.1 > a && (a = 0.1);
var d = t.u();
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
O(d, 0, a * c, !1);
d.lineTo(1 * b, a * c);
d.ab(!1);
b = d.s;
b.G = new K(0, a);
b.H = Zb;
t.v(d);
return b
}, Document: function (a, b, c) {
c /= 0.8;
a = t.u();
O(a, 0, 0.7 * c, !0);
a.lineTo(0,
0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.7 * c);
P(a, 0.5 * b, 0.4 * c, 0.5 * b, 1 * c, 0, 0.7 * c);
Q(a);
b = a.s;
b.G = Qb;
b.H = new K(1, 0.6);
t.v(a);
return b
}, ExternalOrganization: function (a, b, c) {
a = a ? a.yc : 0;
0.2 > a && (a = 0.2);
var d = t.u();
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
O(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.ab(!1);
b = d.s;
b.G = new K(a / 2, a / 2);
b.H = new K(1 - a / 2, 1 - a / 2);
t.v(d);
return b
}, ExternalProcess: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.5 * c);
Q(a);
O(a, 0.1 * b, 0.4 * c, !1);
a.lineTo(0.1 * b, 0.6 * c);
a.moveTo(0.9 * b, 0.6 * c);
a.lineTo(0.9 * b, 0.4 * c);
a.moveTo(0.6 * b, 0.1 * c);
a.lineTo(0.4 * b, 0.1 * c);
a.moveTo(0.4 * b, 0.9 * c);
a.lineTo(0.6 * b, 0.9 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.25, 0.25);
b.H = new K(0.75, 0.75);
t.v(a);
return b
}, File: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 * b, 0.25 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
Q(a);
O(a, 0.75 * b, 0, !1);
a.lineTo(0.75 * b, 0.25 * c);
a.lineTo(1 * b, 0.25 * c);
a.ab(!1);
b = a.s;
b.G = new K(0, 0.25);
b.H = Zb;
t.v(a);
return b
}, Interrupt: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(1 * b, 0.5 * c);
O(a, 1 * b, 0.5 * c, !1);
a.lineTo(1 * b, 1 * c);
O(a, 1 * b, 0.5 * c, !1);
a.lineTo(1 * b, 0);
b = a.s;
b.G = new K(0, 0.25);
b.H = new K(0.5, 0.75);
t.v(a);
return b
}, InternalStorage: function (a, b, c) {
var d = a ? a.yc : 0;
a = a ? a.lt : 0;
0 === d && (d = 0.1);
0 === a && (a = 0.1);
var e = t.u();
O(e, 0, 0, !0);
e.lineTo(1 * b, 0);
e.lineTo(1 * b, 1 * c);
e.lineTo(0, 1 * c);
Q(e);
O(e, d * b, 0, !1);
e.lineTo(d *
b, 1 * c);
e.moveTo(0, a * c);
e.lineTo(1 * b, a * c);
e.ab(!1);
b = e.s;
b.G = new K(d, a);
b.H = Zb;
t.v(e);
return b
}, Junction: function (a, b, c) {
a = t.u();
var d = 1 / Math.SQRT2, e = (1 - 1 / Math.SQRT2) / 2, g = 0.5 * J.va;
O(a, 1 * b, 0.5 * c, !0);
P(a, 1 * b, (0.5 + g) * c, (0.5 + g) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - g) * b, 1 * c, 0, (0.5 + g) * c, 0, 0.5 * c);
P(a, 0, (0.5 - g) * c, (0.5 - g) * b, 0, 0.5 * b, 0);
P(a, (0.5 + g) * b, 0, 1 * b, (0.5 - g) * c, 1 * b, 0.5 * c);
O(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.ab(!1);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}, LinedDocument: function (a, b, c) {
c /= 0.8;
a = t.u();
O(a, 0, 0.7 * c, !0);
a.lineTo(0, 0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.7 * c);
P(a, 0.5 * b, 0.4 * c, 0.5 * b, 1 * c, 0, 0.7 * c);
Q(a);
O(a, 0.1 * b, 0, !1);
a.lineTo(0.1 * b, 0.75 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.1, 0);
b.H = new K(1, 0.6);
t.v(a);
return b
}, LoopLimit: function (a, b, c) {
a = t.u();
O(a, 0, 1 * c, !0);
a.lineTo(0, 0.25 * c);
a.lineTo(0.25 * b, 0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 * b, 0.25 * c);
a.lineTo(1 * b, 1 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.25);
b.H = Zb;
t.v(a);
return b
}, SequentialData: "MagneticTape", MagneticTape: function (a, b, c) {
a = t.u();
var d =
0.5 * J.va;
O(a, 0.5 * b, 1 * c, !0);
P(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
P(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 0.9 * c, 0.6 * b, 0.9 * c);
a.lineTo(1 * b, 0.9 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0.5 * b, 1 * c);
b = a.s;
b.G = new K(0.15, 0.15);
b.H = new K(0.85, 0.8);
t.v(a);
return b
}, ManualInput: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0, !0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0.25 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.25);
b.H = Zb;
t.v(a);
return b
}, MessageFromUser: function (a, b, c) {
a =
a ? a.yc : 0;
0 === a && (a = 0.7);
var d = t.u();
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(a * b, 0.5 * c);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
b = d.s;
b.G = Qb;
b.H = new K(a, 1);
t.v(d);
return b
}, MicroformProcessing: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.25);
var d = t.u();
O(d, 0, 0, !0);
d.lineTo(0.5 * b, a * c);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0.5 * b, (1 - a) * c);
d.lineTo(0, 1 * c);
Q(d);
b = d.s;
b.G = new K(0, a);
b.H = new K(1, 1 - a);
t.v(d);
return b
}, MicroformRecording: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(0.75 * b, 0.25 * c);
a.lineTo(1 * b,
0.15 * c);
a.lineTo(1 * b, 0.85 * c);
a.lineTo(0.75 * b, 0.75 * c);
a.lineTo(0, 1 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.25);
b.H = new K(1, 0.75);
t.v(a);
return b
}, MultiDocument: function (a, b, c) {
c /= 0.8;
a = t.u();
O(a, b, 0, !0);
a.lineTo(b, 0.5 * c);
P(a, 0.96 * b, 0.47 * c, 0.93 * b, 0.45 * c, 0.9 * b, 0.44 * c);
a.lineTo(0.9 * b, 0.6 * c);
P(a, 0.86 * b, 0.57 * c, 0.83 * b, 0.55 * c, 0.8 * b, 0.54 * c);
a.lineTo(0.8 * b, 0.7 * c);
P(a, 0.4 * b, 0.4 * c, 0.4 * b, 1 * c, 0, 0.7 * c);
a.lineTo(0, 0.2 * c);
a.lineTo(0.1 * b, 0.2 * c);
a.lineTo(0.1 * b, 0.1 * c);
a.lineTo(0.2 * b, 0.1 * c);
a.lineTo(0.2 * b, 0);
Q(a);
O(a, 0.1 * b, 0.2 * c,
!1);
a.lineTo(0.8 * b, 0.2 * c);
a.lineTo(0.8 * b, 0.54 * c);
a.moveTo(0.2 * b, 0.1 * c);
a.lineTo(0.9 * b, 0.1 * c);
a.lineTo(0.9 * b, 0.44 * c);
a.ab(!1);
b = a.s;
b.G = new K(0, 0.25);
b.H = new K(0.8, 0.77);
t.v(a);
return b
}, MultiProcess: function (a, b, c) {
a = t.u();
O(a, 0.1 * b, 0.1 * c, !0);
a.lineTo(0.2 * b, 0.1 * c);
a.lineTo(0.2 * b, 0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 0.8 * c);
a.lineTo(0.9 * b, 0.8 * c);
a.lineTo(0.9 * b, 0.9 * c);
a.lineTo(0.8 * b, 0.9 * c);
a.lineTo(0.8 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0.2 * c);
a.lineTo(0.1 * b, 0.2 * c);
Q(a);
O(a, 0.2 * b, 0.1 * c, !1);
a.lineTo(0.9 * b,
0.1 * c);
a.lineTo(0.9 * b, 0.8 * c);
a.moveTo(0.1 * b, 0.2 * c);
a.lineTo(0.8 * b, 0.2 * c);
a.lineTo(0.8 * b, 0.9 * c);
a.ab(!1);
b = a.s;
b.G = new K(0, 0.2);
b.H = new K(0.8, 1);
t.v(a);
return b
}, OfflineStorage: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.1);
var d = 1 - a, e = t.u();
O(e, 0, 0, !0);
e.lineTo(1 * b, 0);
e.lineTo(0.5 * b, 1 * c);
Q(e);
O(e, 0.5 * a * b, a * c, !1);
e.lineTo((1 - 0.5 * a) * b, a * c);
e.ab(!1);
b = e.s;
b.G = new K(d / 4 + 0.5 * a, a);
b.H = new K(3 * d / 4 + 0.5 * a, a + 0.5 * d);
t.v(e);
return b
}, OffPageConnector: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(0.75 * b, 0);
a.lineTo(1 *
b, 0.5 * c);
a.lineTo(0.75 * b, 1 * c);
a.lineTo(0, 1 * c);
Q(a);
b = a.s;
b.G = Qb;
b.H = new K(0.75, 1);
t.v(a);
return b
}, Or: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 1 * b, 0.5 * c, !0);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
P(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
O(a, 1 * b, 0.5 * c, !1);
a.lineTo(0, 0.5 * c);
a.moveTo(0.5 * b, 1 * c);
a.lineTo(0.5 * b, 0);
a.ab(!1);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}, PaperTape: function (a, b, c) {
c /= 0.8;
a = t.u();
O(a, 0, 0.7 * c, !0);
a.lineTo(0,
0.3 * c);
P(a, 0.5 * b, 0.6 * c, 0.5 * b, 0, 1 * b, 0.3);
a.lineTo(1 * b, 0.7 * c);
P(a, 0.5 * b, 0.4 * c, 0.5 * b, 1 * c, 0, 0.7 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.49);
b.H = new K(1, 0.75);
t.v(a);
return b
}, PrimitiveFromCall: function (a, b, c) {
var d = a ? a.yc : 0;
a = a ? a.lt : 0;
0 === d && (d = 0.1);
0 === a && (a = 0.3);
var e = t.u();
O(e, 0, 0, !0);
e.lineTo(1 * b, 0);
e.lineTo((1 - a) * b, 0.5 * c);
e.lineTo(1 * b, 1 * c);
e.lineTo(0, 1 * c);
Q(e);
b = e.s;
b.G = new K(d, 0);
b.H = new K(1 - a, 1);
t.v(e);
return b
}, PrimitiveToCall: function (a, b, c) {
var d = a ? a.yc : 0;
a = a ? a.lt : 0;
0 === d && (d = 0.1);
0 === a && (a = 0.3);
var e =
t.u();
O(e, 0, 0, !0);
e.lineTo((1 - a) * b, 0);
e.lineTo(1 * b, 0.5 * c);
e.lineTo((1 - a) * b, 1 * c);
e.lineTo(0, 1 * c);
Q(e);
b = e.s;
b.G = new K(d, 0);
b.H = new K(1 - a, 1);
t.v(e);
return b
}, Subroutine: "Procedure", Procedure: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.1);
var d = t.u();
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
O(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.ab(!1);
b = d.s;
b.G = new K(a, 0);
b.H = new K(1 - a, 1);
t.v(d);
return b
}, Process: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.1);
var d =
t.u();
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0, 1 * c);
Q(d);
O(d, a * b, 0, !1);
d.lineTo(a * b, 1 * c);
d.ab(!1);
b = d.s;
b.G = new K(a, 0);
b.H = Zb;
t.v(d);
return b
}, Sort: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
a.lineTo(0, 0.5 * c);
Q(a);
O(a, 0, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.25, 0.25);
b.H = new K(0.75, 0.5);
t.v(a);
return b
}, Start: function (a, b, c) {
a = t.u();
O(a, 0.25 * b, 0, !0);
O(a, 0.25 * b, 0, !0);
a.arcTo(270, 180, 0.75 * b, 0.5 * c, 0.25 * b, 0.5 * c);
a.arcTo(90, 180, 0.25 *
b, 0.5 * c, 0.25 * b, 0.5 * c);
O(a, 0.25 * b, 0, !1);
a.lineTo(0.25 * b, 1 * c);
a.moveTo(0.75 * b, 0);
a.lineTo(0.75 * b, 1 * c);
a.ab(!1);
b = a.s;
b.G = new K(0.25, 0);
b.H = new K(0.75, 1);
t.v(a);
return b
}, Terminator: function (a, b, c) {
a = t.u();
O(a, 0.25 * b, 0, !0);
a.arcTo(270, 180, 0.75 * b, 0.5 * c, 0.25 * b, 0.5 * c);
a.arcTo(90, 180, 0.25 * b, 0.5 * c, 0.25 * b, 0.5 * c);
b = a.s;
b.G = new K(0.23, 0);
b.H = new K(0.77, 1);
t.v(a);
return b
}, TransmittalTape: function (a, b, c) {
a = a ? a.yc : 0;
0 === a && (a = 0.1);
var d = t.u();
O(d, 0, 0, !0);
d.lineTo(1 * b, 0);
d.lineTo(1 * b, 1 * c);
d.lineTo(0.75 * b, (1 - a) *
c);
d.lineTo(0, (1 - a) * c);
Q(d);
b = d.s;
b.G = Qb;
b.H = new K(1, 1 - a);
t.v(d);
return b
}, AndGate: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 0, 0, !0);
a.lineTo(0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
a.lineTo(0, 1 * c);
Q(a);
b = a.s;
b.G = Qb;
b.H = new K(0.55, 1);
t.v(a);
return b
}, Buffer: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0, 1 * c);
Q(a);
b = a.s;
b.G = new K(0, 0.25);
b.H = new K(0.5, 0.75);
t.v(a);
return b
}, Clock: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 1 *
b, 0.5 * c, !0);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
P(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
O(a, 1 * b, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
O(a, 0.8 * b, 0.75 * c, !1);
a.lineTo(0.8 * b, 0.25 * c);
a.lineTo(0.6 * b, 0.25 * c);
a.lineTo(0.6 * b, 0.75 * c);
a.lineTo(0.4 * b, 0.75 * c);
a.lineTo(0.4 * b, 0.25 * c);
a.lineTo(0.2 * b, 0.25 * c);
a.lineTo(0.2 * b, 0.75 * c);
a.ab(!1);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}, Ground: function (a, b, c) {
a = t.u();
O(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 0.4 * c);
a.moveTo(0.2 * b, 0.6 * c);
a.lineTo(0.8 * b, 0.6 * c);
a.moveTo(0.3 * b, 0.8 * c);
a.lineTo(0.7 * b, 0.8 * c);
a.moveTo(0.4 * b, 1 * c);
a.lineTo(0.6 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, Inverter: function (a, b, c) {
a = t.u();
var d = 0.1 * J.va;
O(a, 0.8 * b, 0.5 * c, !0);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.8 * b, 0.5 * c);
O(a, 1 * b, 0.5 * c, !0);
P(a, 1 * b, (0.5 + d) * c, (0.9 + d) * b, 0.6 * c, 0.9 * b, 0.6 * c);
P(a, (0.9 - d) * b, 0.6 * c, 0.8 * b, (0.5 + d) * c, 0.8 * b, 0.5 * c);
P(a, 0.8 * b, (0.5 - d) * c, (0.9 - d) * b, 0.4 * c, 0.9 * b, 0.4 * c);
P(a, (0.9 + d) * b, 0.4 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.G = new K(0, 0.25);
b.H = new K(0.4, 0.75);
t.v(a);
return b
}, NandGate: function (a, b, c) {
a = t.u();
var d = J.va, e = 0.5 * d, g = 0.4 * d, d = 0.1 * d;
O(a, 0.8 * b, 0.5 * c, !0);
P(a, 0.8 * b, (0.5 + g) * c, (0.4 + e) * b, 1 * c, 0.4 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(0.4 * b, 0);
P(a, (0.4 + e) * b, 0, 0.8 * b, (0.5 - g) * c, 0.8 * b, 0.5 * c);
O(a, 1 * b, 0.5 * c, !0);
P(a, 1 * b, (0.5 + d) * c, (0.9 + d) * b, 0.6 * c, 0.9 * b, 0.6 * c);
P(a, (0.9 - d) * b, 0.6 * c, 0.8 * b, (0.5 + d) * c, 0.8 * b, 0.5 * c);
P(a, 0.8 * b, (0.5 - d) * c, (0.9 - d) * b, 0.4 * c, 0.9 * b, 0.4 * c);
P(a, (0.9 + d) * b, 0.4 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
b = a.s;
b.G = new K(0, 0.05);
b.H = new K(0.55,
0.95);
t.v(a);
return b
}, NorGate: function (a, b, c) {
a = t.u();
var d = J.va, e = 0.5, g = d * e, h = 0, k = 0.5;
O(a, 0.8 * b, 0.5 * c, !0);
P(a, 0.7 * b, (k + g) * c, (h + g) * b, (k + e) * c, 0, 1 * c);
P(a, 0.25 * b, 0.75 * c, 0.25 * b, 0.25 * c, 0, 0);
P(a, (h + g) * b, (k - e) * c, 0.7 * b, (k - g) * c, 0.8 * b, 0.5 * c);
e = 0.1;
g = 0.1 * d;
h = 0.9;
k = 0.5;
O(a, (h - e) * b, k * c, !0);
P(a, (h - e) * b, (k - g) * c, (h - g) * b, (k - e) * c, h * b, (k - e) * c);
P(a, (h + g) * b, (k - e) * c, (h + e) * b, (k - g) * c, (h + e) * b, k * c);
P(a, (h + e) * b, (k + g) * c, (h + g) * b, (k + e) * c, h * b, (k + e) * c);
P(a, (h - g) * b, (k + e) * c, (h - e) * b, (k + g) * c, (h - e) * b, k * c);
b = a.s;
b.G = new K(0.2, 0.25);
b.H = new K(0.6, 0.75);
t.v(a);
return b
}, OrGate: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 0, 0, !0);
P(a, (0 + d + d) * b, 0 * c, 0.8 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
P(a, 0.8 * b, (0.5 + d) * c, (0 + d + d) * b, 1 * c, 0, 1 * c);
P(a, 0.25 * b, 0.75 * c, 0.25 * b, 0.25 * c, 0, 0);
Q(a);
b = a.s;
b.G = new K(0.2, 0.25);
b.H = new K(0.75, 0.75);
t.v(a);
return b
}, XnorGate: function (a, b, c) {
a = t.u();
var d = J.va, e = 0.5, g = d * e, h = 0.2, k = 0.5;
O(a, 0.1 * b, 0, !1);
P(a, 0.35 * b, 0.25 * c, 0.35 * b, 0.75 * c, 0.1 * b, 1 * c);
O(a, 0.8 * b, 0.5 * c, !0);
P(a, 0.7 * b, (k + g) * c, (h + g) * b, (k + e) * c, 0.2 * b, 1 * c);
P(a, 0.45 * b, 0.75 * c, 0.45 *
b, 0.25 * c, 0.2 * b, 0);
P(a, (h + g) * b, (k - e) * c, 0.7 * b, (k - g) * c, 0.8 * b, 0.5 * c);
e = 0.1;
g = 0.1 * d;
h = 0.9;
k = 0.5;
O(a, (h - e) * b, k * c, !0);
P(a, (h - e) * b, (k - g) * c, (h - g) * b, (k - e) * c, h * b, (k - e) * c);
P(a, (h + g) * b, (k - e) * c, (h + e) * b, (k - g) * c, (h + e) * b, k * c);
P(a, (h + e) * b, (k + g) * c, (h + g) * b, (k + e) * c, h * b, (k + e) * c);
P(a, (h - g) * b, (k + e) * c, (h - e) * b, (k + g) * c, (h - e) * b, k * c);
b = a.s;
b.G = new K(0.4, 0.25);
b.H = new K(0.65, 0.75);
t.v(a);
return b
}, XorGate: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 0.1 * b, 0, !1);
P(a, 0.35 * b, 0.25 * c, 0.35 * b, 0.75 * c, 0.1 * b, 1 * c);
O(a, 0.2 * b, 0, !0);
P(a, (0.2 +
d) * b, 0 * c, 0.9 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
P(a, 0.9 * b, (0.5 + d) * c, (0.2 + d) * b, 1 * c, 0.2 * b, 1 * c);
P(a, 0.45 * b, 0.75 * c, 0.45 * b, 0.25 * c, 0.2 * b, 0);
Q(a);
b = a.s;
b.G = new K(0.4, 0.25);
b.H = new K(0.8, 0.75);
t.v(a);
return b
}, Capacitor: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(0, 1 * c);
a.moveTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, Resistor: function (a, b, c) {
a = t.u();
O(a, 0, 0.5 * c, !1);
a.lineTo(0.1 * b, 0);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0.3 * b, 0);
a.lineTo(0.4 * b, 1 * c);
a.lineTo(0.5 * b, 0);
a.lineTo(0.6 * b, 1 * c);
a.lineTo(0.7 * b, 0.5 * c);
b = a.s;
t.v(a);
return b
}, Inductor: function (a, b, c) {
a = t.u();
var d = 0.1 * J.va, e = 0.1, g = 0.5;
O(a, (e - 0.5 * d) * b, (g + 0.1) * c, !1);
P(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) * b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
e = 0.3;
g = 0.5;
P(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, e * b, (g + 0.1) * c);
P(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) * b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
g = e = 0.5;
P(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, e * b, (g + 0.1) * c);
P(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) * b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
e = 0.7;
g = 0.5;
P(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, e * b, (g + 0.1) * c);
P(a, (e - d) * b, (g + 0.1) * c, (e - 0.1) *
b, (g + d) * c, (e + 0.1) * b, (g + d) * c);
e = 0.9;
g = 0.5;
P(a, (e + 0.1) * b, (g + d) * c, (e + d) * b, (g + 0.1) * c, (e + 0.5 * d) * b, (g + 0.1) * c);
b = a.s;
t.v(a);
return b
}, ACvoltageSource: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 0 * b, 0.5 * c, !1);
P(a, 0 * b, (0.5 - d) * c, (0.5 - d) * b, 0 * c, 0.5 * b, 0 * c);
P(a, (0.5 + d) * b, 0 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0 * b, (0.5 + d) * c, 0 * b, 0.5 * c);
a.moveTo(0.1 * b, 0.5 * c);
P(a, 0.5 * b, 0 * c, 0.5 * b, 1 * c, 0.9 * b, 0.5 * c);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}, DCvoltageSource: function (a, b, c) {
a = t.u();
O(a, 0, 0.75 * c, !1);
a.lineTo(0, 0.25 * c);
a.moveTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, Diode: function (a, b, c) {
a = t.u();
O(a, 1 * b, 0, !1);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0);
a.lineTo(1 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
b = a.s;
b.G = new K(0, 0.25);
b.H = new K(0.5, 0.75);
t.v(a);
return b
}, Wifi: function (a, b, c) {
var d = b, e = c;
b *= 0.38;
c *= 0.6;
a = t.u();
var g = J.va, h = 0.8 * g, k = 0.8, l = 0, m = 0.5, d = (d - b) / 2, e = (e - c) / 2;
O(a, l * b + d, (m + k) * c + e, !0);
P(a, (l - h) * b + d, (m + k) * c + e, (l - k) * b + d, (m + h) * c + e, (l - k) * b + d, m * c + e);
P(a, (l - k) * b + d, (m - h) *
c + e, (l - h) * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
P(a, l * b + d, (m - k) * c + e, (l - k + 0.5 * h) * b + d, (m - h) * c + e, (l - k + 0.5 * h) * b + d, m * c + e);
P(a, (l - k + 0.5 * h) * b + d, (m + h) * c + e, l * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
Q(a);
h = 0.4 * g;
k = 0.4;
l = 0.2;
m = 0.5;
O(a, l * b + d, (m + k) * c + e, !0);
P(a, (l - h) * b + d, (m + k) * c + e, (l - k) * b + d, (m + h) * c + e, (l - k) * b + d, m * c + e);
P(a, (l - k) * b + d, (m - h) * c + e, (l - h) * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
P(a, l * b + d, (m - k) * c + e, (l - k + 0.5 * h) * b + d, (m - h) * c + e, (l - k + 0.5 * h) * b + d, m * c + e);
P(a, (l - k + 0.5 * h) * b + d, (m + h) * c + e, l * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
Q(a);
h = 0.2 * g;
k = 0.2;
m = l = 0.5;
O(a, (l - k) * b + d, m * c + e, !0);
P(a, (l - k) * b + d, (m - h) * c + e, (l - h) * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
P(a, (l + h) * b + d, (m - k) * c + e, (l + k) * b + d, (m - h) * c + e, (l + k) * b + d, m * c + e);
P(a, (l + k) * b + d, (m + h) * c + e, (l + h) * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
P(a, (l - h) * b + d, (m + k) * c + e, (l - k) * b + d, (m + h) * c + e, (l - k) * b + d, m * c + e);
h = 0.4 * g;
k = 0.4;
l = 0.8;
m = 0.5;
O(a, l * b + d, (m - k) * c + e, !0);
P(a, (l + h) * b + d, (m - k) * c + e, (l + k) * b + d, (m - h) * c + e, (l + k) * b + d, m * c + e);
P(a, (l + k) * b + d, (m + h) * c + e, (l + h) * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
P(a, l * b + d, (m + k) * c + e, (l + k - 0.5 * h) * b + d, (m + h) * c + e, (l + k - 0.5 *
h) * b + d, m * c + e);
P(a, (l + k - 0.5 * h) * b + d, (m - h) * c + e, l * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
Q(a);
h = 0.8 * g;
k = 0.8;
l = 1;
m = 0.5;
O(a, l * b + d, (m - k) * c + e, !0);
P(a, (l + h) * b + d, (m - k) * c + e, (l + k) * b + d, (m - h) * c + e, (l + k) * b + d, m * c + e);
P(a, (l + k) * b + d, (m + h) * c + e, (l + h) * b + d, (m + k) * c + e, l * b + d, (m + k) * c + e);
P(a, l * b + d, (m + k) * c + e, (l + k - 0.5 * h) * b + d, (m + h) * c + e, (l + k - 0.5 * h) * b + d, m * c + e);
P(a, (l + k - 0.5 * h) * b + d, (m - h) * c + e, l * b + d, (m - k) * c + e, l * b + d, (m - k) * c + e);
Q(a);
b = a.s;
t.v(a);
return b
}, Email: function (a, b, c) {
a = t.u();
O(a, 0, 0, !0);
a.lineTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 *
c);
a.lineTo(0, 0);
Q(a);
O(a, 0, 0, !1);
a.lineTo(0.5 * b, 0.6 * c);
a.lineTo(1 * b, 0);
a.moveTo(0, 1 * c);
a.lineTo(0.45 * b, 0.54 * c);
a.moveTo(1 * b, 1 * c);
a.lineTo(0.55 * b, 0.54 * c);
a.ab(!1);
b = a.s;
t.v(a);
return b
}, Ethernet: function (a, b, c) {
a = t.u();
O(a, 0.35 * b, 0, !0);
a.lineTo(0.65 * b, 0);
a.lineTo(0.65 * b, 0.4 * c);
a.lineTo(0.35 * b, 0.4 * c);
a.lineTo(0.35 * b, 0);
Q(a);
O(a, 0.1 * b, 1 * c, !0, !0);
a.lineTo(0.4 * b, 1 * c);
a.lineTo(0.4 * b, 0.6 * c);
a.lineTo(0.1 * b, 0.6 * c);
a.lineTo(0.1 * b, 1 * c);
Q(a);
O(a, 0.6 * b, 1 * c, !0, !0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.9 * b, 0.6 * c);
a.lineTo(0.6 *
b, 0.6 * c);
a.lineTo(0.6 * b, 1 * c);
Q(a);
O(a, 0, 0.5 * c, !1);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0.5 * b, 0.5 * c);
a.lineTo(0.5 * b, 0.4 * c);
a.moveTo(0.75 * b, 0.5 * c);
a.lineTo(0.75 * b, 0.6 * c);
a.moveTo(0.25 * b, 0.5 * c);
a.lineTo(0.25 * b, 0.6 * c);
a.ab(!1);
b = a.s;
t.v(a);
return b
}, Power: function (a, b, c) {
a = t.u();
var d = J.va, e = 0.4 * d, g = 0.4, h = t.O(), k = t.O(), l = t.O(), m = t.O();
J.Fi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 - e, 0.5 + g, 0.5, 0.5, h, h, k, l, m);
var n = t.ic(k.x, k.y);
O(a, k.x * b, k.y * c, !0);
P(a, l.x * b, l.y * c, m.x * b, m.y * c, (0.5 + g) * b, 0.5 * c);
P(a, (0.5 + g) * b, (0.5 + e) * c, (0.5 +
e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
P(a, (0.5 - e) * b, (0.5 + g) * c, (0.5 - g) * b, (0.5 + e) * c, (0.5 - g) * b, 0.5 * c);
J.Fi(0.5 - g, 0.5, 0.5 - g, 0.5 - e, 0.5 - e, 0.5 - g, 0.5, 0.5 - g, 0.5, l, m, k, h, h);
P(a, l.x * b, l.y * c, m.x * b, m.y * c, k.x * b, k.y * c);
e = 0.3 * d;
g = 0.3;
J.Fi(0.5 - g, 0.5, 0.5 - g, 0.5 - e, 0.5 - e, 0.5 - g, 0.5, 0.5 - g, 0.5, l, m, k, h, h);
a.lineTo(k.x * b, k.y * c);
P(a, m.x * b, m.y * c, l.x * b, l.y * c, (0.5 - g) * b, 0.5 * c);
P(a, (0.5 - g) * b, (0.5 + e) * c, (0.5 - e) * b, (0.5 + g) * c, 0.5 * b, (0.5 + g) * c);
P(a, (0.5 + e) * b, (0.5 + g) * c, (0.5 + g) * b, (0.5 + e) * c, (0.5 + g) * b, 0.5 * c);
J.Fi(0.5, 0.5 - g, 0.5 + e, 0.5 - g, 0.5 + g, 0.5 -
e, 0.5 + g, 0.5, 0.5, h, h, k, l, m);
P(a, m.x * b, m.y * c, l.x * b, l.y * c, k.x * b, k.y * c);
Q(a);
O(a, 0.45 * b, 0, !0);
a.lineTo(0.45 * b, 0.5 * c);
a.lineTo(0.55 * b, 0.5 * c);
a.lineTo(0.55 * b, 0);
Q(a);
t.B(h);
t.B(k);
t.B(l);
t.B(m);
t.B(n);
b = a.s;
b.G = new K(0.25, 0.55);
b.H = new K(0.75, 0.8);
t.v(a);
return b
}, Fallout: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 0 * b, 0.5 * c, !0);
P(a, 0 * b, (0.5 - d) * c, (0.5 - d) * b, 0 * c, 0.5 * b, 0 * c);
P(a, (0.5 + d) * b, 0 * c, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0 * b, (0.5 + d) * c, 0 * b, 0.5 * c);
var e =
d = 0;
O(a, (0.3 + d) * b, (0.8 + e) * c, !0, !0);
a.lineTo((0.5 + d) * b, (0.5 + e) * c);
a.lineTo((0.1 + d) * b, (0.5 + e) * c);
a.lineTo((0.3 + d) * b, (0.8 + e) * c);
d = 0.4;
e = 0;
Q(a);
O(a, (0.3 + d) * b, (0.8 + e) * c, !0, !0);
a.lineTo((0.5 + d) * b, (0.5 + e) * c);
a.lineTo((0.1 + d) * b, (0.5 + e) * c);
a.lineTo((0.3 + d) * b, (0.8 + e) * c);
d = 0.2;
e = -0.3;
Q(a);
O(a, (0.3 + d) * b, (0.8 + e) * c, !0, !0);
a.lineTo((0.5 + d) * b, (0.5 + e) * c);
a.lineTo((0.1 + d) * b, (0.5 + e) * c);
a.lineTo((0.3 + d) * b, (0.8 + e) * c);
Q(a);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}, IrritationHazard: function (a, b, c) {
a = t.u();
O(a, 0.2 * b, 0 * c, !0);
a.lineTo(0.5 *
b, 0.3 * c);
a.lineTo(0.8 * b, 0 * c);
a.lineTo(1 * b, 0.2 * c);
a.lineTo(0.7 * b, 0.5 * c);
a.lineTo(1 * b, 0.8 * c);
a.lineTo(0.8 * b, 1 * c);
a.lineTo(0.5 * b, 0.7 * c);
a.lineTo(0.2 * b, 1 * c);
a.lineTo(0 * b, 0.8 * c);
a.lineTo(0.3 * b, 0.5 * c);
a.lineTo(0 * b, 0.2 * c);
Q(a);
b = a.s;
b.G = new K(0.3, 0.3);
b.H = new K(0.7, 0.7);
t.v(a);
return b
}, ElectricalHazard: function (a, b, c) {
a = t.u();
O(a, 0.37, 0 * c, !0);
a.lineTo(0.5 * b, 0.11 * c);
a.lineTo(0.77 * b, 0.04 * c);
a.lineTo(0.33 * b, 0.49 * c);
a.lineTo(1 * b, 0.37 * c);
a.lineTo(0.63 * b, 0.86 * c);
a.lineTo(0.77 * b, 0.91 * c);
a.lineTo(0.34 * b, 1 * c);
a.lineTo(0.34 *
b, 0.78 * c);
a.lineTo(0.44 * b, 0.8 * c);
a.lineTo(0.65 * b, 0.56 * c);
a.lineTo(0 * b, 0.68 * c);
Q(a);
b = a.s;
t.v(a);
return b
}, FireHazard: function (a, b, c) {
a = t.u();
O(a, 0.1 * b, 1 * c, !0);
P(a, -0.25 * b, 0.63 * c, 0.45 * b, 0.44 * c, 0.29 * b, 0 * c);
P(a, 0.48 * b, 0.17 * c, 0.54 * b, 0.35 * c, 0.51 * b, 0.42 * c);
P(a, 0.59 * b, 0.29 * c, 0.58 * b, 0.28 * c, 0.59 * b, 0.18 * c);
P(a, 0.8 * b, 0.34 * c, 0.88 * b, 0.43 * c, 0.75 * b, 0.6 * c);
P(a, 0.87 * b, 0.48 * c, 0.88 * b, 0.43 * c, 0.88 * b, 0.31 * c);
P(a, 1.17 * b, 0.76 * c, 0.82 * b, 0.8 * c, 0.9 * b, 1 * c);
Q(a);
b = a.s;
b.G = new K(0.05, 0.645);
b.H = new K(0.884, 0.908);
t.v(a);
return b
},
BpmnActivityLoop: function (a, b, c) {
a = t.u();
var d = 4 * (Math.SQRT2 - 1) / 3 * 0.5;
O(a, (0.5 * Math.SQRT2 / 2 + 0.5) * b, (1 - (0.5 - 0.5 * Math.SQRT2 / 2)) * c, !1);
P(a, 1 * b, 0.7 * c, 1 * b, 0.5 * c, 1 * b, 0.5 * c);
P(a, 1 * b, (0.5 - d + 0) * c, (0.5 + d + 0) * b, 0 * c, 0.5 * b, 0 * c);
P(a, (0.5 - d + 0) * b, 0 * c, 0 * b, (0.5 - d + 0) * c, 0 * b, 0.5 * c);
P(a, 0 * b, (0.5 + d + 0) * c, (0.5 - d + 0) * b, 1 * c, 0.35 * b, 0.98 * c);
a.moveTo(0.35 * b, 0.8 * c);
a.lineTo(0.35 * b, 1 * c);
a.lineTo(0.15 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivityParallel: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(0, 1 * c);
a.moveTo(0.5 * b, 0);
a.lineTo(0.5 *
b, 1 * c);
a.moveTo(1 * b, 0);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivitySequential: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
a.lineTo(1 * b, 0);
a.moveTo(0, 0.5 * c);
a.lineTo(1 * b, 0.5 * c);
a.moveTo(0, 1 * c);
a.lineTo(1 * b, 1 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivityAdHoc: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
O(a, 1 * b, 1 * c, !1);
O(a, 0, 0.5 * c, !1);
P(a, 0.2 * b, 0.35 * c, 0.3 * b, 0.35 * c, 0.5 * b, 0.5 * c);
P(a, 0.7 * b, 0.65 * c, 0.8 * b, 0.65 * c, 1 * b, 0.5 * c);
b = a.s;
t.v(a);
return b
}, BpmnActivityCompensation: function (a, b, c) {
a = t.u();
O(a, 0, 0.5 * c, !0);
a.lineTo(0.5 *
b, 0);
a.lineTo(0.5 * b, 0.5 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(1 * b, 0);
a.lineTo(0.5 * b, 0.5 * c);
a.lineTo(0.5 * b, 1 * c);
Q(a);
b = a.s;
t.v(a);
return b
}, BpmnTaskMessage: function (a, b, c) {
a = t.u();
O(a, 0, 0.2 * c, !0);
a.lineTo(1 * b, 0.2 * c);
a.lineTo(1 * b, 0.8 * c);
a.lineTo(0, 0.8 * c);
a.lineTo(0, 0.8 * c);
Q(a);
O(a, 0, 0.2 * c, !1);
a.lineTo(0.5 * b, 0.5 * c);
a.lineTo(1 * b, 0.2 * c);
a.ab(!1);
b = a.s;
t.v(a);
return b
}, BpmnTaskScript: function (a, b, c) {
a = t.u();
O(a, 0.7 * b, 1 * c, !0);
a.lineTo(0.3 * b, 1 * c);
P(a, 0.6 * b, 0.5 * c, 0, 0.5 * c, 0.3 * b, 0);
a.lineTo(0.7 * b, 0);
P(a, 0.4 * b, 0.5 * c,
1 * b, 0.5 * c, 0.7 * b, 1 * c);
Q(a);
O(a, 0.45 * b, 0.73 * c, !1);
a.lineTo(0.7 * b, 0.73 * c);
a.moveTo(0.38 * b, 0.5 * c);
a.lineTo(0.63 * b, 0.5 * c);
a.moveTo(0.31 * b, 0.27 * c);
a.lineTo(0.56 * b, 0.27 * c);
a.ab(!1);
b = a.s;
t.v(a);
return b
}, BpmnTaskUser: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
O(a, 0.335 * b, (1 - 0.555) * c, !0);
a.lineTo(0.335 * b, 0.595 * c);
a.lineTo(0.665 * b, 0.595 * c);
a.lineTo(0.665 * b, (1 - 0.555) * c);
P(a, 0.88 * b, 0.46 * c, 0.98 * b, 0.54 * c, 1 * b, 0.68 * c);
a.lineTo(1 * b, 1 * c);
a.lineTo(0, 1 * c);
a.lineTo(0, 0.68 * c);
P(a, 0.02 * b, 0.54 * c, 0.12 * b, 0.46 * c, 0.335 * b, (1 - 0.555) *
c);
a.lineTo(0.365 * b, 0.405 * c);
var d = 0.5 - 0.285, e = Math.PI / 4, g = 4 * (1 - Math.cos(e)) / (3 * Math.sin(e)), e = g * d, g = g * d;
P(a, (0.5 - (e + d) / 2) * b, (d + (d + g) / 2) * c, (0.5 - d) * b, (d + g) * c, (0.5 - d) * b, d * c);
P(a, (0.5 - d) * b, (d - g) * c, (0.5 - e) * b, (d - d) * c, 0.5 * b, (d - d) * c);
P(a, (0.5 + e) * b, (d - d) * c, (0.5 + d) * b, (d - g) * c, (0.5 + d) * b, d * c);
P(a, (0.5 + d) * b, (d + g) * c, (0.5 + (e + d) / 2) * b, (d + (d + g) / 2) * c, 0.635 * b, 0.405 * c);
a.lineTo(0.635 * b, 0.405 * c);
a.lineTo(0.665 * b, (1 - 0.555) * c);
a.lineTo(0.665 * b, 0.595 * c);
a.lineTo(0.335 * b, 0.595 * c);
O(a, 0.2 * b, 1 * c, !1);
a.lineTo(0.2 * b, 0.8 * c);
O(a,
0.8 * b, 1 * c, !1);
a.lineTo(0.8 * b, 0.8 * c);
b = a.s;
t.v(a);
return b
}, BpmnEventConditional: function (a, b, c) {
a = t.u();
O(a, 0.1 * b, 0, !0);
a.lineTo(0.9 * b, 0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.1 * b, 1 * c);
Q(a);
O(a, 0.2 * b, 0.2 * c, !1);
a.lineTo(0.8 * b, 0.2 * c);
a.moveTo(0.2 * b, 0.4 * c);
a.lineTo(0.8 * b, 0.4 * c);
a.moveTo(0.2 * b, 0.6 * c);
a.lineTo(0.8 * b, 0.6 * c);
a.moveTo(0.2 * b, 0.8 * c);
a.lineTo(0.8 * b, 0.8 * c);
a.ab(!1);
b = a.s;
t.v(a);
return b
}, BpmnEventError: function (a, b, c) {
a = t.u();
O(a, 0, 1 * c, !0);
a.lineTo(0.33 * b, 0);
a.lineTo(0.66 * b, 0.5 * c);
a.lineTo(1 * b, 0);
a.lineTo(0.66 *
b, 1 * c);
a.lineTo(0.33 * b, 0.5 * c);
Q(a);
b = a.s;
t.v(a);
return b
}, BpmnEventEscalation: function (a, b, c) {
a = t.u();
O(a, 0, 0, !1);
O(a, 1 * b, 1 * c, !1);
O(a, 0.1 * b, 1 * c, !0);
a.lineTo(0.5 * b, 0);
a.lineTo(0.9 * b, 1 * c);
a.lineTo(0.5 * b, 0.5 * c);
Q(a);
b = a.s;
t.v(a);
return b
}, BpmnEventTimer: function (a, b, c) {
a = t.u();
var d = 0.5 * J.va;
O(a, 1 * b, 0.5 * c, !0);
P(a, 1 * b, (0.5 + d) * c, (0.5 + d) * b, 1 * c, 0.5 * b, 1 * c);
P(a, (0.5 - d) * b, 1 * c, 0, (0.5 + d) * c, 0, 0.5 * c);
P(a, 0, (0.5 - d) * c, (0.5 - d) * b, 0, 0.5 * b, 0);
P(a, (0.5 + d) * b, 0, 1 * b, (0.5 - d) * c, 1 * b, 0.5 * c);
O(a, 0.5 * b, 0, !1);
a.lineTo(0.5 * b, 0.15 *
c);
a.moveTo(0.5 * b, 1 * c);
a.lineTo(0.5 * b, 0.85 * c);
a.moveTo(0, 0.5 * c);
a.lineTo(0.15 * b, 0.5 * c);
a.moveTo(1 * b, 0.5 * c);
a.lineTo(0.85 * b, 0.5 * c);
a.moveTo(0.5 * b, 0.5 * c);
a.lineTo(0.58 * b, 0.1 * c);
a.moveTo(0.5 * b, 0.5 * c);
a.lineTo(0.78 * b, 0.54 * c);
a.ab(!1);
b = a.s;
b.kc = Xg;
t.v(a);
return b
}};
for (var Zl in J.Oi)J.Oi[Zl.toLowerCase()] = Zl;
J.Iv = {"": "", 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", None: ""};
J.FA = {};
J.Jv = {};
J.Oo = function (a) {
if (J.Iv) {
for (var b in J.Iv) {
var c = Zc(J.Iv[b], !1);
J.Jv[b] = c;
b.toLowerCase() !== b && (J.Jv[b.toLowerCase()] = b)
}
J.Iv = void 0
}
return J.Jv[a]
};
Y.FigureGenerators = J.Oi;
Y.ArrowheadGeometries = J.Jv;
function w(a) {
0 === arguments.length ? B.call(this) : B.call(this, a);
this.ca = 49663;
this.Vn = this.gh = "";
this.Jr = this.Gr = this.Tr = this.Wq = null;
this.Vr = "";
this.Bg = this.Ur = this.lm = null;
this.Ir = "";
this.jo = null;
this.Hr = (new oa(NaN, NaN)).freeze();
this.Kr = "";
this.lo = null;
this.ge = "";
this.Un = this.lq = this.Bk = null;
this.ji = (new C(NaN, NaN)).freeze();
this.dr = "";
this.Ok = null;
this.er = Qb;
this.nr = J.oG;
this.gr = J.nG;
this.vq = null;
this.Xq = $l;
this.om = (new C(6, 6)).freeze();
this.nm = "gray";
this.mm = 4;
this.BG = -1;
this.yG = new D;
this.zj =
null;
this.xj = NaN
}
t.ia("Part", w);
t.Oa(w, B);
w.prototype.cloneProtected = function (a) {
B.prototype.cloneProtected.call(this, a);
a.ca = this.ca & -4097 | 49152;
a.gh = this.gh;
a.Vn = this.Vn;
a.Wq = this.Wq;
a.Tr = this.Tr;
a.Gr = this.Gr;
a.Jr = this.Jr;
a.Vr = this.Vr;
a.Ur = this.Ur;
a.Bg = null;
a.Ir = this.Ir;
a.Hr.assign(this.Hr);
a.Kr = this.Kr;
a.ge = this.ge;
a.lq = this.lq;
a.ji.assign(this.ji);
a.dr = this.dr;
a.er = this.er.Z();
a.nr = this.nr.Z();
a.gr = this.gr.Z();
a.vq = this.vq;
a.Xq = this.Xq;
a.om.assign(this.om);
a.nm = this.nm;
a.mm = this.mm
};
w.prototype.Fh = function (a) {
B.prototype.Fh.call(this, a);
Zj(a);
a.lm = null;
a.jo = null;
a.lo = null;
a.Ok = null;
a.zj = null
};
w.prototype.toString = function () {
var a = t.Tg(Object.getPrototypeOf(this)) + "#" + t.oc(this);
this.data && (a += "(" + ka(this.data) + ")");
return a
};
w.LayoutNone = 0;
var Li;
w.LayoutAdded = Li = 1;
var Qi;
w.LayoutRemoved = Qi = 2;
var Lh;
w.LayoutShown = Lh = 4;
var Mh;
w.LayoutHidden = Mh = 8;
w.LayoutNodeSized = 16;
var hj;
w.LayoutGroupLayout = hj = 32;
w.LayoutNodeReplaced = 64;
var $l;
w.LayoutStandard = $l = Li | Qi | Lh | Mh | 16 | hj | 64;
w.prototype.Zm = function (a, b, c, d, e, g, h) {
var k = this.h;
null !== k && (a === Cd && "elements" === b ? e instanceof B && Mi(e, function (a) {
Ni(k, a)
}) : a === Dd && "elements" === b && e instanceof B && Mi(e, function (a) {
Pi(k, a)
}), k.fd(a, b, c, d, e, g, h))
};
w.prototype.updateTargetBindings = w.prototype.Kb = function (a) {
B.prototype.Kb.call(this, a);
if (null !== this.data)for (a = this.elements; a.next();) {
var b = a.value;
b instanceof B && Mi(b, function (a) {
null !== a.data && a.Kb()
})
}
};
t.A(w, {Dv: "adornments"}, function () {
return null === this.Bg ? t.dh : this.Bg.l
});
w.prototype.findAdornment = w.prototype.No = function (a) {
f && t.j(a, "string", w, "findAdornment:category");
var b = this.Bg;
return null === b ? null : b.Ba(a)
};
w.prototype.addAdornment = w.prototype.Wk = function (a, b) {
if (null !== b) {
f && (t.j(a, "string", w, "addAdornment:category"), t.k(b, Ue, w, "addAdornment:ad"));
var c = null, d = this.Bg;
null !== d && (c = d.Ba(a));
if (c !== b) {
if (null !== c) {
var e = c.h;
null !== e && e.remove(c)
}
null === d && (this.Bg = d = new ra("string", Ue));
b.gh !== a && (b.Pc = a);
d.add(a, b);
c = this.h;
null !== c && (c.add(b), b.data = this.data)
}
}
};
w.prototype.removeAdornment = w.prototype.tl = function (a) {
f && t.j(a, "string", w, "removeAdornment:category");
var b = this.Bg;
if (null !== b) {
var c = b.Ba(a);
if (null !== c) {
var d = c.h;
null !== d && d.remove(c)
}
b.remove(a);
0 === b.count && (this.Bg = null)
}
};
w.prototype.clearAdornments = w.prototype.ze = function () {
var a = this.Bg;
if (null !== a) {
for (var b = t.Db(), a = a.l; a.next();)b.push(a.key);
for (var a = b.length, c = 0; c < a; c++)this.tl(b[c]);
t.Da(b)
}
};
w.prototype.updateAdornments = function () {
var a = this.h;
if (null !== a) {
am(this, a);
for (var a = a.Eb.tf.p, b = a.length, c = 0; c < b; c++) {
var d = a[c];
d.isEnabled && d.updateAdornments(this)
}
for (a = this.Dv; a.next();)b = a.value, b.nl || null !== b.wb && b.aa()
}
};
function am(a, b) {
if (a.bb && a.WA) {
var c = a.an;
if (null === c || !(a.ya.Q() && a.zb() && c.ol() && c.ya.Q()))return;
var d = a.No("Selection");
if (null === d) {
d = a.vF;
null === d && (a instanceof A ? d = b.LE : a instanceof w && (d = a instanceof z ? b.kE : b.YE));
if (!(d instanceof Ue))return;
We(d);
d = d.copy();
if (!(d instanceof Ue))return;
d.Pc = "Selection";
d.nl = !0;
d.Oc = c
}
if (null !== d) {
var e = d.placeholder;
if (null !== e) {
var g = c.ek(), h = 0;
c instanceof Y && (h = c.ib);
var k = t.xl();
k.q((c.Ia.width + h) * g, (c.Ia.height + h) * g);
e.Ca = k;
t.ck(k)
}
d.angle = c.jl();
d.type !== Bg ? (e = t.O(), d.location = c.gb(Qb, e), t.B(e)) : d.aa();
a.Wk("Selection", d);
return
}
}
a.tl("Selection")
}
t.A(w, {layer: "layer"}, function () {
return this.Un
});
t.A(w, {h: "diagram"}, function () {
var a = this.Un;
return null !== a ? a.h : null
});
t.g(w, "layerName", w.prototype.Ad);
t.defineProperty(w, {Ad: "layerName"}, function () {
return this.Vn
}, function (a) {
var b = this.Vn;
if (b !== a) {
t.j(a, "string", w, "layerName");
var c = this.h;
if (null === c || null !== c.il(a))if (this.Vn = a, this.i("layerName", b, a), b = this.layer, null !== b && b.name !== a && (c = b.h, null !== c && (a = c.il(a), null !== a && a !== b))) {
var d = b.Ue(-1, this, !0);
0 <= d && c.fd(Dd, "parts", b, this, null, d, !0);
d = a.Pm(99999999, this, !0);
0 <= d && c.fd(Cd, "parts", a, null, this, !0, d);
d = this.fp;
if (null !== d) {
var e = c.Xa;
c.Xa = !0;
d(this, b, a);
c.Xa = e
}
}
}
});
t.g(w, "layerChanged", w.prototype.fp);
t.defineProperty(w, {fp: "layerChanged"}, function () {
return this.Wq
}, function (a) {
var b = this.Wq;
b !== a && (null !== a && t.j(a, "function", w, "layerChanged"), this.Wq = a, this.i("layerChanged", b, a))
});
t.A(w, {pc: "isTemporary"}, function () {
return null !== this.Un ? this.Un.pc : !1
});
function bm(a) {
var b = a.h;
null !== b && (ci(b), 0 !== (a.ca & 16384) !== !0 && (a.ca |= 16384, a.ua(), b.Zf.add(a), b.Of()))
}
function Hh(a) {
0 !== (a.ca & 16384) !== !1 && (a.updateAdornments(), a.ca &= -16385, a = a.h, null !== a && (a.Je = !0))
}
t.g(w, "location", w.prototype.location);
t.defineProperty(w, {location: "location"}, function () {
return this.ji
}, function (a) {
var b = this.ji;
if (!(b.N(a) || this instanceof A)) {
f && t.k(a, C, w, "location");
a = a.Z();
var c = this.h;
this.ji = a;
if (!1 === Bi(this)) {
var d = this.rb, e = a.x - b.x, g = a.y - b.y, h = d.copy();
d.q(h.x + e, h.y + g);
tk(this);
!d.N(h) && c && this.i("position", h, d)
}
this.i("location", b, a)
}
});
function tk(a) {
if (!1 === Ci(a)) {
var b = a.h;
null !== b && (b.Zf.add(a), a instanceof y && !b.Aa.qb && a.Vg(), b.Of());
cm(a, !0)
}
}
function uk(a) {
if (!1 !== Ci(a)) {
var b = a.position, c = a.location;
c.Q() && b.Q() || (dm(a, b, c), Vj(a));
var b = a.rb, c = a.Gb, d = c.copy();
c.Va();
c.x = b.x;
c.y = b.y;
c.freeze();
Wj(a, d, c);
cm(a, !1)
}
}
t.A(w, {Ub: "locationObject"}, function () {
if (null === this.Ok) {
var a = this.Zs;
void 0 !== a && null !== a && "" !== a ? (a = this.le(a), this.Ok = null !== a ? a : this) : this.Ok = this instanceof Ue && this.ba !== Bg && null !== this.wb ? this.wb : this
}
return this.Ok.visible ? this.Ok : this
});
t.g(w, "minLocation", w.prototype.TE);
t.defineProperty(w, {TE: "minLocation"}, function () {
return this.nr
}, function (a) {
var b = this.nr;
b.N(a) || (f && t.k(a, C, w, "minLocation"), this.nr = a = a.Z(), this.i("minLocation", b, a))
});
t.g(w, "maxLocation", w.prototype.NE);
t.defineProperty(w, {NE: "maxLocation"}, function () {
return this.gr
}, function (a) {
var b = this.gr;
b.N(a) || (f && t.k(a, C, w, "maxLocation"), this.gr = a = a.Z(), this.i("maxLocation", b, a))
});
t.g(w, "locationObjectName", w.prototype.Zs);
t.defineProperty(w, {Zs: "locationObjectName"}, function () {
return this.dr
}, function (a) {
var b = this.dr;
b !== a && (f && t.j(a, "string", w, "locationObjectName"), this.dr = a, this.Ok = null, mk(this), this.i("locationObjectName", b, a))
});
t.g(w, "locationSpot", w.prototype.We);
t.defineProperty(w, {We: "locationSpot"}, function () {
return this.er
}, function (a) {
var b = this.er;
b.N(a) || (f && (t.k(a, K, w, "locationSpot"), a.qd() || t.m("Part.locationSpot must be a specific Spot value, not: " + a)), this.er = a = a.Z(), mk(this), this.i("locationSpot", b, a))
});
w.prototype.move = w.prototype.move = function (a) {
this.position = a
};
w.prototype.moveTo = w.prototype.moveTo = function (a, b) {
var c = t.ic(a, b);
this.move(c);
t.B(c)
};
w.prototype.isVisible = w.prototype.zb = function () {
if (!this.visible)return!1;
var a = this.layer;
if (null !== a && !a.visible)return!1;
a = this.fb;
if (!(null === a || a.of && a.zb()))return!1;
if (this instanceof y) {
a = this.ZD();
if (null !== a && !a.Sc)return!1;
a = this.Tc;
if (null !== a) {
var b = {};
b[t.oc(this)] = !0;
return em(a, b)
}
} else if (this instanceof A) {
var b = !0, c = this.h;
null !== c && (b = c.ed);
c = this.da;
if (null !== c) {
if (this.xc && b && !c.Sc)return!1;
c = fm(c);
if (null === c || c === a)return!1
}
c = this.ja;
if (null !== c) {
if (this.xc && !b && !c.Sc)return!1;
b = fm(c);
if (null === b || b === a)return!1
}
}
return!0
};
function em(a, b) {
var c = a.da;
if (null !== c) {
var d = c.Tc;
if (null !== d)b[t.oc(c)] || (b[t.oc(c)] = !0, em(d, b)); else if (null === fm(c))return!1
}
c = a.ja;
if (null !== c)if (d = c.Tc, null !== d)b[t.oc(c)] || (b[t.oc(c)] = !0, em(d, b)); else if (null === fm(c))return!1;
return!0
}
w.prototype.findObject = w.prototype.le = function (a) {
if (this.name === a)return this;
null === this.zj && (this.zj = {});
var b = this.zj;
if (void 0 !== b[a])return b[a];
for (var c = this.za.p, d = c.length, e = 0; e < d; e++) {
var g = c[e];
if (g.name === a)return b[a] = g;
if (g instanceof B)if (!g.AE()) {
if (g = g.le(a), null !== g)return b[a] = g
} else if (Cl(g) && (g = g.za.eb(), null !== g && g.name === a))return b[a] = g
}
return b[a] = null
};
function gm(a, b, c, d) {
void 0 === d && (d = new C);
c.pd() && (c = Ub);
var e = b.Ia;
d.q(e.width * c.x + c.offsetX, e.height * c.y + c.offsetY);
if (null === b || b === a)return d;
b.transform.Wa(d);
for (b = b.ga; null !== b && b !== a;)b.transform.Wa(d), b = b.ga;
a.Nk.Wa(d);
d.offset(-a.Kc.x, -a.Kc.y);
return d
}
w.prototype.ensureBounds = w.prototype.Hf = function () {
Ch(this, Infinity, Infinity);
this.Ec()
};
function Kh(a, b, c) {
c = void 0 === c ? a.yG : c;
var d;
isNaN(a.xj) && (a.xj = El(a));
d = a.xj;
var e = 2 * d;
if (!a.Kh)return c.q(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;
b = b.height;
var h = a.shadowBlur;
a = a.AF;
g += h;
b += h;
d -= h / 2;
e -= h / 2;
0 < a.x ? g += a.x : (d += a.x, g -= a.x);
0 < a.y ? b += a.y : (e += a.y, b -= a.y);
c.q(d - 1, e - 1, g + 2, b + 2);
return c
}
w.prototype.Ec = function () {
Vj(this);
if (!1 === Bi(this))uk(this); else {
var a = t.xf();
a.assign(this.Gb);
jk(this);
this.Gb.Va();
var b = Gh(this);
this.Tj(0, 0, this.Kc.width, this.Kc.height);
var c = this.position;
dm(this, c, this.location);
var d = this.Gb;
d.x = c.x;
d.y = c.y;
d.freeze();
Vj(this);
Wj(this, a, d);
a.N(d) ? this.Pf(b) : !this.Ud() || J.I(a.width, d.width) && J.I(a.height, d.height) || this.K(16);
t.Qc(a);
cm(this, !1)
}
};
function dm(a, b, c) {
var d = NaN, e = NaN, g = t.O(), h = a.We, d = a.Ub;
h.pd() && t.m("Spot must be real: " + h.toString());
var e = d.Ia, k = 0;
d.ib && (k = d.fe);
g.wt(0, 0, e.width + k, e.height + k, h);
if (d !== a)for (d.ib && g.offset(-k / 2, -k / 2), d.transform.Wa(g), h = d.ga; null !== h && h !== a;)h.transform.Wa(g), h = h.ga;
a.Nk.Wa(g);
g.offset(-a.Kc.x, -a.Kc.y);
h = a.h;
c.Q() ? (d = c.x - g.x, e = c.y - g.y, c = b.copy(), b.q(d, e), b.N(c) || null === h || (d = h.Cb, h.Cb = !0, a.i("position", c, b), h.Cb = d)) : b.Q() && (d = b.x, e = b.y, b = c.copy(), c.q(d + g.x, e + g.y), c.N(b) || null === h || (d = h.Cb,
h.Cb = !0, a.i("location", b, c), h.Cb = d));
t.B(g)
}
function Oi(a, b, c) {
bk(a, !1);
a instanceof y && qj(c, a);
a.layer.pc || b || c.Ac();
b = a.Gb;
var d = c.nb;
d.Q() ? (Gh(a) ? wb(b, d) || (a.Pf(!1), bm(a)) : b.Jf(d) && a.Pf(!0), a.updateAdornments()) : c.Kk = !0
}
w.prototype.ml = function () {
return!0
};
function Ih(a, b) {
if (a.visible) {
var c = a.Gb;
if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) {
var d = a.transform, e = a.ga, g = a.Wh;
g.reset();
null !== e && (e.bh() ? g.multiply(e.he) : null !== e.ga && g.multiply(e.ga.he));
g.multiply(a.ad);
null !== a.jc && (gk(a, b, a.jc, !0, !0), b.fillRect(c.x, c.y, c.width, c.height));
null === a.jc && null === a.Hb && (b.fillStyle = "rgba(0,0,0,0.4)", b.fillRect(c.x, c.y, c.width, c.height));
null !== a.Hb && (d.Ts() || b.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), e = a.Ia, c = e.width, e = e.height, gk(a, b, a.Hb,
!0), b.fillRect(0, 0, c + 0, e + 0), d.Ts() || (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))))
}
}
}
w.prototype.Ud = function () {
return!0
};
t.g(w, "category", w.prototype.Pc);
t.defineProperty(w, {Pc: "category"}, function () {
return this.gh
}, function (a) {
var b = this.gh;
if (b !== a) {
t.j(a, "string", w, "category");
this.gh = a;
this.i("category", b, a);
var c = this.h, d = this.data;
if (null !== c && null !== d) {
var e = c.fa;
this instanceof A ? (e instanceof U ? e.yF(d, a) : e instanceof Rd && e.cJ(d, a), c = c.findTemplateForLinkData(d, a), c instanceof A && (We(c), c = c.copy(), c instanceof A && hm(this, c, b, a))) : this instanceof Ue || (null !== e && e.Jw(d, a), c = c.findTemplateForNodeData(d, a), c instanceof w && (We(c), c = c.copy(), c instanceof
w && !(c instanceof A) && hm(this, c, b, a)))
}
this instanceof Ue && (a = this.Pj, null !== a && (c = a.Bg, null !== c && c.remove(b), a.Wk(this.gh, this)))
}
});
function hm(a, b, c, d) {
b.constructor === a.constructor || t.cG || (t.cG = !0, t.trace('Should not change the class of the Part when changing category from "' + c + '" to "' + d + '"'), t.trace(" Old class: " + t.Tg(a) + ", new class: " + t.Tg(b) + ", part: " + a.toString()));
a.ze();
var e = a.data;
c = a.Ad;
var g = a.bb, h = !0, k = !0, l = !1;
a instanceof y && (h = a.Lh, k = a.Sc, l = a.hn);
b.Fh(a);
b.cloneProtected(a);
a.gh = d;
a.aa();
a.ua();
b = a.h;
d = !0;
null !== b && (d = b.Cb, b.Cb = !0);
a.Kl = e;
null !== e && a.Kb();
null !== b && (b.Cb = d);
e = a.Ad;
e !== c && (a.Vn = c, a.Ad = e);
a instanceof
y && (a.Lh = h, a.Sc = k, a.hn = l, a.Ud() && a.K(64));
a.bb = g
}
w.prototype.canCopy = function () {
if (!this.Nz)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Rj)return!1;
a = a.h;
return null === a ? !0 : a.Rj ? !0 : !1
};
w.prototype.canDelete = function () {
if (!this.Qz)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Zk)return!1;
a = a.h;
return null === a ? !0 : a.Zk ? !0 : !1
};
w.prototype.canEdit = function () {
if (!this.hB)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Bo)return!1;
a = a.h;
return null === a ? !0 : a.Bo ? !0 : !1
};
w.prototype.canGroup = function () {
if (!this.dA)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.xo)return!1;
a = a.h;
return null === a ? !0 : a.xo ? !0 : !1
};
w.prototype.canMove = function () {
if (!this.wA)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.$k)return!1;
a = a.h;
return null === a ? !0 : a.$k ? !0 : !1
};
w.prototype.canReshape = function () {
if (!this.RA)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.yo)return!1;
a = a.h;
return null === a ? !0 : a.yo ? !0 : !1
};
w.prototype.canResize = function () {
if (!this.SA)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.zo)return!1;
a = a.h;
return null === a ? !0 : a.zo ? !0 : !1
};
w.prototype.canRotate = function () {
if (!this.TA)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Ao)return!1;
a = a.h;
return null === a ? !0 : a.Ao ? !0 : !1
};
w.prototype.canSelect = function () {
if (!this.ik)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Ne)return!1;
a = a.h;
return null === a ? !0 : a.Ne ? !0 : !1
};
t.g(w, "copyable", w.prototype.Nz);
t.defineProperty(w, {Nz: "copyable"}, function () {
return 0 !== (this.ca & 1)
}, function (a) {
var b = 0 !== (this.ca & 1);
b !== a && (f && t.j(a, "boolean", w, "copyable"), this.ca ^= 1, this.i("copyable", b, a))
});
t.g(w, "deletable", w.prototype.Qz);
t.defineProperty(w, {Qz: "deletable"}, function () {
return 0 !== (this.ca & 2)
}, function (a) {
var b = 0 !== (this.ca & 2);
b !== a && (f && t.j(a, "boolean", w, "deletable"), this.ca ^= 2, this.i("deletable", b, a))
});
t.g(w, "textEditable", w.prototype.hB);
t.defineProperty(w, {hB: "textEditable"}, function () {
return 0 !== (this.ca & 4)
}, function (a) {
var b = 0 !== (this.ca & 4);
b !== a && (f && t.j(a, "boolean", w, "textEditable"), this.ca ^= 4, this.i("textEditable", b, a), this.updateAdornments())
});
t.g(w, "groupable", w.prototype.dA);
t.defineProperty(w, {dA: "groupable"}, function () {
return 0 !== (this.ca & 8)
}, function (a) {
var b = 0 !== (this.ca & 8);
b !== a && (f && t.j(a, "boolean", w, "groupable"), this.ca ^= 8, this.i("groupable", b, a))
});
t.g(w, "movable", w.prototype.wA);
t.defineProperty(w, {wA: "movable"}, function () {
return 0 !== (this.ca & 16)
}, function (a) {
var b = 0 !== (this.ca & 16);
b !== a && (f && t.j(a, "boolean", w, "movable"), this.ca ^= 16, this.i("movable", b, a))
});
t.g(w, "selectionAdorned", w.prototype.WA);
t.defineProperty(w, {WA: "selectionAdorned"}, function () {
return 0 !== (this.ca & 32)
}, function (a) {
var b = 0 !== (this.ca & 32);
b !== a && (f && t.j(a, "boolean", w, "selectionAdorned"), this.ca ^= 32, this.i("selectionAdorned", b, a), this.updateAdornments())
});
t.g(w, "isInDocumentBounds", w.prototype.ow);
t.defineProperty(w, {ow: "isInDocumentBounds"}, function () {
return 0 !== (this.ca & 64)
}, function (a) {
var b = 0 !== (this.ca & 64);
b !== a && (f && t.j(a, "boolean", w, "isInDocumentBounds"), this.ca ^= 64, this.i("isInDocumentBounds", b, a))
});
t.g(w, "isLayoutPositioned", w.prototype.qw);
t.defineProperty(w, {qw: "isLayoutPositioned"}, function () {
return 0 !== (this.ca & 128)
}, function (a) {
var b = 0 !== (this.ca & 128);
b !== a && (f && t.j(a, "boolean", w, "isLayoutPositioned"), this.ca ^= 128, this.i("isLayoutPositioned", b, a), this.K(a ? Lh : Mh))
});
t.g(w, "selectable", w.prototype.ik);
t.defineProperty(w, {ik: "selectable"}, function () {
return 0 !== (this.ca & 256)
}, function (a) {
var b = 0 !== (this.ca & 256);
b !== a && (f && t.j(a, "boolean", w, "selectable"), this.ca ^= 256, this.i("selectable", b, a), this.updateAdornments())
});
t.g(w, "reshapable", w.prototype.RA);
t.defineProperty(w, {RA: "reshapable"}, function () {
return 0 !== (this.ca & 512)
}, function (a) {
var b = 0 !== (this.ca & 512);
b !== a && (f && t.j(a, "boolean", w, "reshapable"), this.ca ^= 512, this.i("reshapable", b, a), this.updateAdornments())
});
t.g(w, "resizable", w.prototype.SA);
t.defineProperty(w, {SA: "resizable"}, function () {
return 0 !== (this.ca & 1024)
}, function (a) {
var b = 0 !== (this.ca & 1024);
b !== a && (f && t.j(a, "boolean", w, "resizable"), this.ca ^= 1024, this.i("resizable", b, a), this.updateAdornments())
});
t.g(w, "rotatable", w.prototype.TA);
t.defineProperty(w, {TA: "rotatable"}, function () {
return 0 !== (this.ca & 2048)
}, function (a) {
var b = 0 !== (this.ca & 2048);
b !== a && (f && t.j(a, "boolean", w, "rotatable"), this.ca ^= 2048, this.i("rotatable", b, a), this.updateAdornments())
});
t.g(w, "isSelected", w.prototype.bb);
t.defineProperty(w, {bb: "isSelected"}, function () {
return 0 !== (this.ca & 4096)
}, function (a) {
var b = 0 !== (this.ca & 4096);
if (b !== a) {
f && t.j(a, "boolean", w, "isSelected");
var c = this.h;
if (!a || this.canSelect() && !(null !== c && c.selection.count >= c.OE)) {
this.ca ^= 4096;
var d = !1;
if (null !== c) {
d = c.Cb;
c.Cb = !0;
var e = c.selection;
e.Va();
a ? e.add(this) : e.remove(this);
e.freeze()
}
this.i("isSelected", b, a);
bm(this);
a = this.wF;
null !== a && a(this);
null !== c && (c.Of(), c.Cb = d)
}
}
});
t.g(w, "isShadowed", w.prototype.Kh);
t.defineProperty(w, {Kh: "isShadowed"}, function () {
return 0 !== (this.ca & 8192)
}, function (a) {
var b = 0 !== (this.ca & 8192);
b !== a && (f && t.j(a, "boolean", w, "isShadowed"), this.ca ^= 8192, this.i("isShadowed", b, a), this.ua())
});
function Ci(a) {
return 0 !== (a.ca & 32768)
}
function cm(a, b) {
a.ca = b ? a.ca | 32768 : a.ca & -32769
}
function bk(a, b) {
a.ca = b ? a.ca | 65536 : a.ca & -65537
}
function Gh(a) {
return 0 !== (a.ca & 131072)
}
w.prototype.Pf = function (a) {
this.ca = a ? this.ca | 131072 : this.ca & -131073
};
t.g(w, "selectionObjectName", w.prototype.ut);
t.defineProperty(w, {ut: "selectionObjectName"}, function () {
return this.Vr
}, function (a) {
var b = this.Vr;
b !== a && (f && t.j(a, "string", w, "selectionObjectName"), this.Vr = a, this.lm = null, this.i("selectionObjectName", b, a))
});
t.g(w, "selectionAdornmentTemplate", w.prototype.vF);
t.defineProperty(w, {vF: "selectionAdornmentTemplate"}, function () {
return this.Tr
}, function (a) {
var b = this.Tr;
b !== a && (f && t.k(a, Ue, w, "selectionAdornmentTemplate"), this instanceof A && (a.type = Bg), this.Tr = a, this.i("selectionAdornmentTemplate", b, a))
});
t.A(w, {an: "selectionObject"}, function () {
if (null === this.lm) {
var a = this.ut;
null !== a && "" !== a ? (a = this.le(a), this.lm = null !== a ? a : this) : this instanceof A ? (a = this.path, this.lm = null !== a ? a : this) : this.lm = this
}
return this.lm
});
t.g(w, "selectionChanged", w.prototype.wF);
t.defineProperty(w, {wF: "selectionChanged"}, function () {
return this.Ur
}, function (a) {
var b = this.Ur;
b !== a && (null !== a && t.j(a, "function", w, "selectionChanged"), this.Ur = a, this.i("selectionChanged", b, a))
});
t.g(w, "resizeAdornmentTemplate", w.prototype.iF);
t.defineProperty(w, {iF: "resizeAdornmentTemplate"}, function () {
return this.Gr
}, function (a) {
var b = this.Gr;
b !== a && (f && t.k(a, Ue, w, "resizeAdornmentTemplate"), this.Gr = a, this.i("resizeAdornmentTemplate", b, a))
});
t.g(w, "resizeObjectName", w.prototype.lF);
t.defineProperty(w, {lF: "resizeObjectName"}, function () {
return this.Ir
}, function (a) {
var b = this.Ir;
b !== a && (f && t.j(a, "string", w, "resizeObjectName"), this.Ir = a, this.jo = null, this.i("resizeObjectName", b, a))
});
t.A(w, {kF: "resizeObject"}, function () {
if (null === this.jo) {
var a = this.lF;
null !== a && "" !== a ? (a = this.le(a), this.jo = null !== a ? a : this) : this.jo = this
}
return this.jo
});
t.g(w, "resizeCellSize", w.prototype.jF);
t.defineProperty(w, {jF: "resizeCellSize"}, function () {
return this.Hr
}, function (a) {
var b = this.Hr;
b.N(a) || (f && t.k(a, oa, w, "resizeCellSize"), this.Hr = a = a.Z(), this.i("resizeCellSize", b, a))
});
t.g(w, "rotateAdornmentTemplate", w.prototype.nF);
t.defineProperty(w, {nF: "rotateAdornmentTemplate"}, function () {
return this.Jr
}, function (a) {
var b = this.Jr;
b !== a && (f && t.k(a, Ue, w, "rotateAdornmentTemplate"), this.Jr = a, this.i("rotateAdornmentTemplate", b, a))
});
t.g(w, "rotateObjectName", w.prototype.pF);
t.defineProperty(w, {pF: "rotateObjectName"}, function () {
return this.Kr
}, function (a) {
var b = this.Kr;
b !== a && (f && t.j(a, "string", w, "rotateObjectName"), this.Kr = a, this.lo = null, this.i("rotateObjectName", b, a))
});
t.A(w, {oF: "rotateObject"}, function () {
if (null === this.lo) {
var a = this.pF;
null !== a && "" !== a ? (a = this.le(a), this.lo = null !== a ? a : this) : this.lo = this
}
return this.lo
});
t.g(w, "text", w.prototype.text);
t.defineProperty(w, {text: "text"}, function () {
return this.ge
}, function (a) {
var b = this.ge;
b !== a && (f && t.j(a, "string", w, "text"), this.ge = a, this.i("text", b, a))
});
t.g(w, "containingGroup", w.prototype.fb);
t.defineProperty(w, {fb: "containingGroup"}, function () {
return this.Bk
}, function (a) {
if (this.Ud()) {
var b = this.Bk;
if (b !== a) {
f && null !== a && t.k(a, z, w, "containingGroup");
null === a || this !== a && !a.Us(this) || (this === a && t.m("Cannot make a Group a member of itself: " + this.toString()), t.m("Cannot make a Group indirectly contain itself: " + this.toString() + " already contains " + a.toString()));
this.K(Qi);
var c = this.h;
null !== b ? im(b, this) : this instanceof z && null !== c && c.Uk.remove(this);
this.Bk = a;
null !== a ? jm(a, this) : this instanceof
z && null !== c && c.Uk.add(this);
this.K(Li);
if (null !== c) {
var d = this.data, e = c.fa;
null !== d && e instanceof U && e.$A(d, e.Nb(null !== a ? a.data : null))
}
d = this.Kz;
null !== d && (e = !0, null !== c && (e = c.Xa, c.Xa = !0), d(this, b, a), null !== c && (c.Xa = e));
if (this instanceof z)for (c = new ta(w), He(c, this, !0, 0), c = c.l; c.next();)if (d = c.value, d instanceof y)for (d = d.Cd; d.next();)e = d.value, dj(e);
if (this instanceof y)for (d = this.Cd; d.next();)e = d.value, dj(e);
this.i("containingGroup", b, a);
null !== a && a.Mw()
}
} else t.m("cannot set the Part.containingGroup of a Link or Adornment")
});
function Zj(a) {
a = a.fb;
null !== a && (a.aa(), null !== a.wb && a.wb.aa(), a.Vg())
}
w.prototype.Ps = function () {
var a = this.Bk;
null !== a && jm(a, this)
};
w.prototype.Qs = function () {
var a = this.Bk;
null !== a && im(a, this)
};
w.prototype.Im = function () {
var a = this.data;
if (null !== a) {
var b = this.h;
null !== b && (b = b.fa, null !== b && b.Fw(a))
}
};
t.g(w, "containingGroupChanged", w.prototype.Kz);
t.defineProperty(w, {Kz: "containingGroupChanged"}, function () {
return this.lq
}, function (a) {
var b = this.lq;
b !== a && (null !== a && t.j(a, "function", w, "containingGroupChanged"), this.lq = a, this.i("containingGroupChanged", b, a))
});
w.prototype.findTopLevelPart = function () {
return km(this, this)
};
function km(a, b) {
var c = b.fb;
return null !== c ? km(a, c) : b instanceof y && (c = b.Tc, null !== c) ? km(a, c) : b
}
t.A(w, {ep: "isTopLevel"}, function () {
return null !== this.fb || this instanceof y && this.Hh ? !1 : !0
});
w.prototype.isMemberOf = w.prototype.Us = function (a) {
return a instanceof z ? lm(this, this, a) : !1
};
function lm(a, b, c) {
if (b === c || null === c)return!1;
var d = b.fb;
return null === d || d !== c && !lm(a, d, c) ? b instanceof y && (b = b.Tc, null !== b) ? lm(a, b, c) : !1 : !0
}
w.prototype.findCommonContainingGroup = w.prototype.VH = function (a) {
return mm(this, this, a)
};
function mm(a, b, c) {
if (null === b || null === c)return null;
var d = b.fb;
if (null === d)return null;
if (b === c)return d;
var e = c.fb;
return null === e ? null : d === e ? e : lm(a, c, d) ? d : lm(a, b, e) ? e : mm(a, d, e)
}
t.g(w, "layoutConditions", w.prototype.GE);
t.defineProperty(w, {GE: "layoutConditions"}, function () {
return this.Xq
}, function (a) {
var b = this.Xq;
b !== a && (f && t.j(a, "number", w, "layoutConditions"), this.Xq = a, this.i("layoutConditions", b, a))
});
w.prototype.canLayout = function () {
if (!this.qw || !this.zb())return!1;
var a = this.layer;
return null !== a && a.pc || this instanceof y && this.Hh ? !1 : !0
};
w.prototype.invalidateLayout = w.prototype.K = function (a) {
void 0 === a && (a = 16777215);
var b;
this.qw && 0 !== (a & this.GE) ? (b = this.layer, null !== b && b.pc || this instanceof y && this.Hh ? b = !1 : (b = this.h, b = null !== b && b.Aa.qb ? !1 : !0)) : b = !1;
if (b)if (b = this.Bk, null !== b) {
var c = b.Tb;
null !== c ? c.K() : b.K(a)
} else a = this.h, null !== a && (c = a.Tb, null !== c && c.K())
};
t.g(w, "dragComputation", w.prototype.Rz);
t.defineProperty(w, {Rz: "dragComputation"}, function () {
return this.vq
}, function (a) {
var b = this.vq;
b !== a && (null !== a && t.j(a, "function", w, "dragComputation"), this.vq = a, this.i("dragComputation", b, a))
});
t.g(w, "shadowOffset", w.prototype.AF);
t.defineProperty(w, {AF: "shadowOffset"}, function () {
return this.om
}, function (a) {
var b = this.om;
b.N(a) || (f && t.k(a, C, w, "shadowOffset"), this.om = a = a.Z(), this.ua(), this.i("shadowOffset", b, a))
});
t.g(w, "shadowColor", w.prototype.shadowColor);
t.defineProperty(w, {shadowColor: "shadowColor"}, function () {
return this.nm
}, function (a) {
var b = this.nm;
b !== a && (f && t.j(a, "string", w, "shadowColor"), this.nm = a, this.ua(), this.i("shadowColor", b, a))
});
t.g(w, "shadowBlur", w.prototype.shadowBlur);
t.defineProperty(w, {shadowBlur: "shadowBlur"}, function () {
return this.mm
}, function (a) {
var b = this.mm;
b !== a && (f && t.j(a, "number", w, "shadowBlur"), this.mm = a, this.ua(), this.i("shadowBlur", b, a))
});
function Ue(a) {
0 === arguments.length ? w.call(this, $g) : w.call(this, a);
this.Ad = "Adornment";
this.La = null;
this.ca &= -257;
this.ji = new C(NaN, NaN);
this.Xh = new H(D);
this.wb = null;
this.wy = !1
}
t.ia("Adornment", Ue);
t.Oa(Ue, w);
aa = Ue.prototype;
aa.toString = function () {
var a = this.Pj;
return"Adornment(" + this.Pc + ")" + (null !== a ? a.toString() : "")
};
aa.nj = function () {
return this.La && this.La.U instanceof A ? this.La.U.nj() : null
};
aa.Gq = function () {
return null
};
aa.ww = function () {
var a = this.Oc.U, b = this.Oc;
if (a instanceof A && b instanceof Y) {
var c = a.path, b = c.Ra;
a.ww();
for (var b = c.Ra, a = this.za, c = a.length, d = 0; d < c; d++) {
var e = a.p[d];
e.Ih && e instanceof Y && (e.Ra = b)
}
}
};
aa.hy = function () {
var a = this.Pj;
return a instanceof A ? a.mc : null
};
t.A(Ue, {placeholder: "placeholder"}, function () {
return this.wb
});
t.g(Ue, "isStandard", Ue.prototype.nl);
t.defineProperty(Ue, {nl: "isStandard"}, function () {
return this.wy
}, function (a) {
var b = this.wy;
b !== a && (f && t.j(a, "boolean", Ue, "isStandard"), this.wy = a, this.i("isStandard", b, a))
});
t.g(Ue, "adornedObject", Ue.prototype.Oc);
t.defineProperty(Ue, {Oc: "adornedObject"}, function () {
return this.La
}, function (a) {
f && null !== a && t.k(a, X, w, "adornedObject:val");
var b = this.Pj, c = null;
null !== a && (c = a.U);
null === b || null !== a && b === c || b.tl(this.Pc);
this.La = a;
c && c.Wk(this.Pc, this)
});
t.A(Ue, {Pj: "adornedPart"}, function () {
var a = this.La;
return null !== a ? a.U : null
});
Ue.prototype.ml = function () {
var a = this.La;
if (null === a)return!0;
a = a.U;
return null === a || !Bi(a)
};
Ue.prototype.Ud = function () {
return!1
};
t.A(Ue, {fb: "containingGroup"}, function () {
return null
});
Ue.prototype.Zm = function (a, b, c, d, e, g, h) {
if (a === Cd && "elements" === b)if (e instanceof Ug)null === this.wb ? this.wb = e : this.wb !== e && t.m("Cannot insert a second Placeholder into the visual tree of an Adornment."); else {
if (e instanceof B) {
var k = Bl(e, e, function (a) {
return a instanceof Ug
});
k instanceof Ug && (null === this.wb ? this.wb = k : this.wb !== k && t.m("Cannot insert a second Placeholder into the visual tree of an Adornment."))
}
} else a === Dd && "elements" === b && null !== this.wb && (d === this.wb ? this.wb = null : d instanceof B &&
this.wb.Ri(d) && (this.wb = null));
w.prototype.Zm.call(this, a, b, c, d, e, g, h)
};
Ue.prototype.updateAdornments = function () {
};
Ue.prototype.Im = function () {
};
function y(a) {
0 === arguments.length ? w.call(this, $g) : w.call(this, a);
this.dc = new H(A);
this.Tn = this.Mk = this.ar = this.$q = null;
this.Rq = !0;
this.os = !1;
this.js = null;
this.eq = this.Sq = !0;
this.fq = J.qG;
this.xd = this.fh = null;
this.Bh = !1
}
t.ia("Node", y);
t.Oa(y, w);
y.prototype.cloneProtected = function (a) {
w.prototype.cloneProtected.call(this, a);
a.$q = this.$q;
a.ar = this.ar;
a.Mk = this.Mk;
a.Rq = this.Rq;
a.os = this.os;
a.js = this.js;
a.Sq = this.Sq;
a.eq = this.eq;
a.fq = this.fq.Z()
};
y.prototype.Fh = function (a) {
w.prototype.Fh.call(this, a);
a.Vg();
a.fh = this.fh;
a.xd = null
};
var nm;
y.DirectionDefault = nm = t.w(y, "DirectionDefault", 0);
y.DirectionAbsolute = t.w(y, "DirectionAbsolute", 1);
var om;
y.DirectionRotatedNode = om = t.w(y, "DirectionRotatedNode", 2);
var Nj;
y.DirectionRotatedNodeOrthogonal = Nj = t.w(y, "DirectionRotatedNodeOrthogonal", 3);
function pm(a, b) {
null !== b && (null === a.fh && (a.fh = new ta(qm)), a.fh.add(b))
}
y.prototype.Zm = function (a, b, c, d, e, g, h) {
a === Cd && "elements" === b ? this.xd = null : a === Dd && "elements" === b && (null === this.h ? this.xd = null : d instanceof X && zl(this, d, function (a, b) {
vk(a, b, !0)
}));
w.prototype.Zm.call(this, a, b, c, d, e, g, h)
};
y.prototype.invalidateConnectedLinks = y.prototype.Vg = function (a) {
void 0 === a && (a = null);
for (var b = this.Cd; b.next();) {
var c = b.value;
if (null === a || !a.contains(c)) {
var d = c.Rc;
null !== d && (d.ee = null);
var e = c.Ed;
null !== e && e !== d && (e.ee = null);
c.$b()
}
}
};
y.prototype.ml = function () {
return!0
};
t.g(y, "avoidable", y.prototype.Fz);
t.defineProperty(y, {Fz: "avoidable"}, function () {
return this.eq
}, function (a) {
var b = this.eq;
if (b !== a) {
f && t.j(a, "boolean", y, "avoidable");
this.eq = a;
var c = this.h;
null !== c && qj(c, this);
this.i("avoidable", b, a)
}
});
t.g(y, "avoidableMargin", y.prototype.lD);
t.defineProperty(y, {lD: "avoidableMargin"}, function () {
return this.fq
}, function (a) {
"number" === typeof a ? a = new rb(a) : t.k(a, rb, y, "avoidableMargin");
var b = this.fq;
if (!b.N(a)) {
this.fq = a = a.Z();
var c = this.h;
null !== c && qj(c, this);
this.i("avoidableMargin", b, a)
}
});
y.prototype.canAvoid = function () {
return this.Fz && !this.Hh
};
y.prototype.getAvoidableRect = function (a) {
a.set(this.ya);
a.Cv(this.lD);
return a
};
function fm(a) {
for (; null !== a && !a.zb();)a = a.fb;
return a
}
t.A(y, {Cd: "linksConnected"}, function () {
return this.dc.l
});
y.prototype.findLinksConnected = y.prototype.WH = function (a) {
void 0 === a && (a = null);
if (null === a)return this.dc.l;
f && t.j(a, "string", y, "findLinksConnected:pid");
var b = new Ia(this.dc), c = this;
b.sl = function (b) {
return b.da === c && b.nf === a || b.ja === c && b.Rf === a
};
return b
};
y.prototype.findLinksOutOf = y.prototype.cw = function (a) {
void 0 === a && (a = null);
f && null !== a && t.j(a, "string", y, "findLinksOutOf:pid");
var b = new Ia(this.dc), c = this;
b.sl = function (b) {
return b.da !== c ? !1 : null === a ? !0 : b.nf === a
};
return b
};
y.prototype.findLinksInto = y.prototype.mg = function (a) {
void 0 === a && (a = null);
f && null !== a && t.j(a, "string", y, "findLinksInto:pid");
var b = new Ia(this.dc), c = this;
b.sl = function (b) {
return b.ja !== c ? !1 : null === a ? !0 : b.Rf === a
};
return b
};
y.prototype.findNodesConnected = y.prototype.WD = function (a) {
void 0 === a && (a = null);
f && null !== a && t.j(a, "string", y, "findNodesConnected:pid");
for (var b = null, c = null, d = this.dc.l; d.next();) {
var e = d.value;
if (e.da === this) {
if (null === a || e.nf === a)e = e.ja, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ta(y), b.add(c), b.add(e)) : c = e
} else e.ja !== this || null !== a && e.Rf !== a || (e = e.da, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ta(y), b.add(c), b.add(e)) : c = e)
}
return null !== b ? b.l : null !== c ? new Ha(c) : t.dh
};
y.prototype.findNodesOutOf = function (a) {
void 0 === a && (a = null);
f && null !== a && t.j(a, "string", y, "findNodesOutOf:pid");
for (var b = null, c = null, d = this.dc.l; d.next();) {
var e = d.value;
e.da !== this || null !== a && e.nf !== a || (e = e.ja, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ta(y), b.add(c), b.add(e)) : c = e)
}
return null !== b ? b.l : null !== c ? new Ha(c) : t.dh
};
y.prototype.findNodesInto = function (a) {
void 0 === a && (a = null);
f && null !== a && t.j(a, "string", y, "findNodesInto:pid");
for (var b = null, c = null, d = this.dc.l; d.next();) {
var e = d.value;
e.ja !== this || null !== a && e.Rf !== a || (e = e.da, null !== b ? b.add(e) : null !== c && c !== e ? (b = new ta(y), b.add(c), b.add(e)) : c = e)
}
return null !== b ? b.l : null !== c ? new Ha(c) : t.dh
};
y.prototype.findLinksBetween = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
f && (t.k(a, y, y, "findLinksBetween:othernode"), null !== b && t.j(b, "string", y, "findLinksBetween:pid"), null !== c && t.j(c, "string", y, "findLinksBetween:otherpid"));
var d = new Ia(this.dc), e = this;
d.sl = function (d) {
return(d.da !== e || d.ja !== a || null !== b && d.nf !== b || null !== c && d.Rf !== c) && (d.da !== a || d.ja !== e || null !== c && d.nf !== c || null !== b && d.Rf !== b) ? !1 : !0
};
return d
};
y.prototype.findLinksTo = function (a, b, c) {
void 0 === b && (b = null);
void 0 === c && (c = null);
f && (t.k(a, y, y, "findLinksTo:othernode"), null !== b && t.j(b, "string", y, "findLinksTo:pid"), null !== c && t.j(c, "string", y, "findLinksTo:otherpid"));
var d = new Ia(this.dc), e = this;
d.sl = function (d) {
return d.da !== e || d.ja !== a || null !== b && d.nf !== b || null !== c && d.Rf === c ? !1 : !0
};
return d
};
t.g(y, "linkConnected", y.prototype.IE);
t.defineProperty(y, {IE: "linkConnected"}, function () {
return this.$q
}, function (a) {
var b = this.$q;
b !== a && (null !== a && t.j(a, "function", y, "linkConnected"), this.$q = a, this.i("linkConnected", b, a))
});
t.g(y, "linkDisconnected", y.prototype.JE);
t.defineProperty(y, {JE: "linkDisconnected"}, function () {
return this.ar
}, function (a) {
var b = this.ar;
b !== a && (null !== a && t.j(a, "function", y, "linkDisconnected"), this.ar = a, this.i("linkDisconnected", b, a))
});
t.g(y, "linkValidation", y.prototype.op);
t.defineProperty(y, {op: "linkValidation"}, function () {
return this.Mk
}, function (a) {
var b = this.Mk;
b !== a && (null !== a && t.j(a, "function", y, "linkValidation"), this.Mk = a, this.i("linkValidation", b, a))
});
function rm(a, b, c) {
if (!a.dc.contains(b)) {
a.dc.add(b);
var d = a.IE;
if (null !== d) {
var e = !0, g = a.h;
null !== g && (e = g.Xa, g.Xa = !0);
d(a, b, c);
null !== g && (g.Xa = e)
}
b.xc && (c = b.da, b = b.ja, null !== c && null !== b && c !== b && (d = !0, g = a.h, null !== g && (d = g.ed), a = d ? b : c, e = d ? c : b, a.Bh || (a.Bh = e), !e.Lh || null !== g && g.Aa.qb || (d ? c === e && (e.Lh = !1) : b === e && (e.Lh = !1))))
}
}
function sm(a, b, c) {
if (a.dc.remove(b)) {
var d = a.JE, e = a.h;
if (null !== d) {
var g = !0;
null !== e && (g = e.Xa, e.Xa = !0);
d(a, b, c);
null !== e && (e.Xa = g)
}
b.xc && (c = !0, null !== e && (c = e.ed), a = c ? b.ja : b.da, b = c ? b.da : b.ja, null !== a && (a.Bh = !1), null === b || b.Lh || (0 === b.dc.count ? (b.Bh = null, null !== e && e.Aa.qb || (b.Lh = !0)) : ij(b)))
}
}
function ij(a) {
a.Bh = !1;
if (0 !== a.dc.count) {
var b = !0, c = a.h;
if (null === c || !c.Aa.qb) {
null !== c && (b = c.ed);
for (c = a.dc.l; c.next();) {
var d = c.value;
if (d.xc)if (b) {
if (d.da === a) {
a.Lh = !1;
return
}
} else if (d.ja === a) {
a.Lh = !1;
return
}
}
a.Lh = !0
}
}
}
y.prototype.Ps = function () {
w.prototype.Ps.call(this);
ij(this);
var a = this.Tn;
null !== a && tm(a, this)
};
y.prototype.Qs = function () {
w.prototype.Qs.call(this);
var a = this.Tn;
null !== a && null !== a.ff && (a.ff.remove(this), a.aa())
};
y.prototype.Im = function () {
if (0 < this.dc.count) {
var a = this.h;
if (null === a)return;
for (var b = this.dc.copy().l; b.next();)a.remove(b.value)
}
this.Tc = null;
w.prototype.Im.call(this)
};
t.A(y, {Hh: "isLinkLabel"}, function () {
return null !== this.Tn
});
t.g(y, "labeledLink", y.prototype.Tc);
t.defineProperty(y, {Tc: "labeledLink"}, function () {
return this.Tn
}, function (a) {
var b = this.Tn;
if (b !== a) {
f && null !== a && t.k(a, A, y, "labeledLink");
var c = this.h, d = this.data;
if (null !== b && (null !== b.ff && (b.ff.remove(this), b.aa()), null !== c && null !== d && !c.Aa.qb)) {
var e = b.data, g = c.fa;
if (null !== e && g instanceof U) {
var h = g.Nb(d);
void 0 !== h && g.XI(e, h)
}
}
this.Tn = a;
null !== a && (tm(a, this), null === c || null === d || c.Aa.qb || (e = a.data, g = c.fa, null !== e && g instanceof U && (h = g.Nb(d), void 0 !== h && g.cD(e, h))));
mk(this);
this.i("labeledLink",
b, a)
}
});
y.prototype.findPort = y.prototype.Is = function (a) {
f && t.j(a, "string", y, "findPort:pid");
if (null === this.xd) {
if ("" === a && !1 === this.oj)return this;
wk(this)
}
var b = this.xd.Ba(a);
return null !== b || "" !== a && (b = this.xd.Ba(""), null !== b) ? b : this
};
t.A(y, {port: "port"}, function () {
return this.Is("")
});
t.A(y, {ports: "ports"}, function () {
null === this.xd && wk(this);
return this.xd.l
});
function wk(a) {
null === a.xd ? a.xd = new ra("string", X) : a.xd.clear();
zl(a, a, function (a, c) {
var d = c.rd;
null !== d && a.xd.add(d, c)
});
0 === a.xd.count && a.xd.add("", a)
}
function vk(a, b, c) {
var d = b.rd;
if (null !== d && (null !== a.xd && a.xd.remove(d), b = a.h, null !== b && c)) {
c = null;
for (a = a.WH(d); a.next();)null === c && (c = t.Db()), c.push(a.value);
if (null !== c) {
for (a = 0; a < c.length; a++)b.remove(c[a]);
t.Da(c)
}
}
}
y.prototype.isInTreeOf = function (a) {
if (null === a || a === this)return!1;
var b = !0, c = this.h;
null !== c && (b = c.ed);
c = this;
if (b)for (; c !== a;) {
for (var b = null, d = c.dc.l; d.next();) {
var e = d.value;
if (e.xc && (b = e.da, 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.dc.l; d.next() && (e = d.value, !e.xc || (b = e.ja, b === c || b === this)););
if (b === this || null === b || b === c)return!1;
c = b
}
return!0
};
y.prototype.findTreeRoot = function () {
var a = !0, b = this.h;
null !== b && (a = b.ed);
b = this;
if (a)for (; ;) {
for (var a = null, c = b.dc.l; c.next();) {
var d = c.value;
if (d.xc && (a = d.da, 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.dc.l; c.next() && (d = c.value, !d.xc || (a = d.ja, a === b || a === this)););
if (a === this)return this;
if (null === a || a === b)return b;
b = a
}
};
y.prototype.findTreeParentLink = y.prototype.Js = function () {
var a = !0, b = this.h;
null !== b && (a = b.ed);
b = this.dc.l;
if (a)for (; b.next();) {
if (a = b.value, a.xc && a.da !== this)return a
} else for (; b.next();)if (a = b.value, a.xc && a.ja !== this)return a;
return null
};
y.prototype.findTreeParentNode = y.prototype.ZD = function () {
if (null === this.Bh || this.Bh instanceof y)return this.Bh;
var a = !0, b = this.h;
null !== b && (a = b.ed);
var b = this.dc.p, c = b.length;
if (a)for (a = 0; a < c; a++) {
var d = b[a];
if (d.xc && (d = d.da, d !== this))return this.Bh = d
} else for (a = 0; a < c; a++)if (d = b[a], d.xc && (d = d.ja, d !== this))return this.Bh = d;
return this.Bh = null
};
y.prototype.findTreeChildrenLinks = y.prototype.fw = function () {
var a = !0, b = this.h;
null !== b && (a = b.ed);
if (a) {
var a = new Ia(this.dc), c = this;
a.sl = function (a) {
return a.xc && a.da === c ? !0 : !1
}
} else a = new Ia(this.dc), c = this, a.sl = function (a) {
return a.xc && a.ja === c ? !0 : !1
};
return a
};
y.prototype.findTreeChildrenNodes = y.prototype.YD = function () {
var a = !0, b = this.h;
null !== b && (a = b.ed);
var c = b = null, d = this.dc.l;
if (a)for (; d.next();)a = d.value, a.xc && a.da === this && (a = a.ja, null !== b ? b.add(a) : null !== c && c !== a ? (b = new H(y), b.add(c), b.add(a)) : c = a); else for (; d.next();)a = d.value, a.xc && a.ja === this && (a = a.da, null !== b ? b.add(a) : null !== c && c !== a ? (b = new H(y), b.add(c), b.add(a)) : c = a);
return null !== b ? b.l : null !== c ? new Ha(c) : t.dh
};
y.prototype.findTreeParts = function (a) {
void 0 === a && (a = Infinity);
t.j(a, "number", y, "collapseTree:level");
var b = new ta(w);
He(b, this, !1, a);
return b
};
y.prototype.collapseTree = y.prototype.collapseTree = function (a) {
void 0 === a && (a = 1);
t.o(a, y, "collapseTree:level");
1 > a && (a = 1);
var b = this.h;
if (null !== b && !b.Sd) {
b.Sd = !0;
var c = b.ed, d = new ta(y);
d.add(this);
um(this, d, c, a, this.Sc);
b.Sd = !1;
b.ua()
}
};
function um(a, b, c, d, e) {
if (1 < d)for (e = c ? a.cw() : a.mg(); e.next();) {
var g = e.value;
g.xc && (g = g.aA(a), null === g || g === a || b.contains(g) || (b.add(g), um(g, b, c, d - 1, g.Sc)))
} else vm(a, b, c, e)
}
function vm(a, b, c, d) {
a.Sc = !1;
for (var e = c ? a.cw() : a.mg(); e.next();) {
var g = e.value;
d && g.ze();
g.xc && (g = g.aA(a), null === g || g === a || b.contains(g) || (b.add(g), d && (g.ua(), g.ze(), Zj(g), g.K(Mh)), g.Sc && (g.hn = g.Sc, vm(g, b, c, g.hn))))
}
}
y.prototype.expandTree = y.prototype.expandTree = function (a) {
void 0 === a && (a = 2);
t.o(a, y, "collapseTree:level");
2 > a && (a = 2);
var b = this.h;
if (null !== b && !b.Sd) {
b.Sd = !0;
var c = b.ed, d = new ta(y);
d.add(this);
wm(this, d, c, a, this.Sc);
b.Sd = !1
}
};
function wm(a, b, c, d, e) {
a.Sc = !0;
for (var g = c ? a.cw() : a.mg(); g.next();) {
var h = g.value;
h.xc && (e || (h.Rg || h.$b(), h.updateAdornments()), h = h.aA(a), null !== h && h !== a && !b.contains(h) && (b.add(h), e || (h.ua(), h.updateAdornments(), Zj(h), h.K(Lh)), 2 < d || h.hn)) && (h.hn = !1, wm(h, b, c, d - 1, h.Sc))
}
}
t.g(y, "isTreeExpanded", y.prototype.Sc);
t.defineProperty(y, {Sc: "isTreeExpanded"}, function () {
return this.Rq
}, function (a) {
var b = this.Rq;
if (b !== a) {
f && t.j(a, "boolean", y, "isTreeExpanded");
this.Rq = a;
var c = this.h;
this.i("isTreeExpanded", b, a);
b = this.WF;
if (null !== b) {
var d = !0;
null !== c && (d = c.Xa, c.Xa = !0);
b(this);
null !== c && (c.Xa = d)
}
null !== c && c.Aa.qb || (a ? (a = 2, 2 > a && (a = 2), null === c || c.Sd || (c.Sd = !0, b = c.ed, d = new ta(y), d.add(this), wm(this, d, b, a, !1), c.Sd = !1)) : (a = 1, 1 > a && (a = 1), null === c || c.Sd || (c.Sd = !0, b = c.ed, d = new ta(y), d.add(this), um(this, d, b, a, !0), c.Sd = !1)))
}
});
t.g(y, "wasTreeExpanded", y.prototype.hn);
t.defineProperty(y, {hn: "wasTreeExpanded"}, function () {
return this.os
}, function (a) {
var b = this.os;
b !== a && (f && t.j(a, "boolean", y, "wasTreeExpanded"), this.os = a, this.i("wasTreeExpanded", b, a))
});
t.g(y, "treeExpandedChanged", y.prototype.WF);
t.defineProperty(y, {WF: "treeExpandedChanged"}, function () {
return this.js
}, function (a) {
var b = this.js;
b !== a && (null !== a && t.j(a, "function", y, "treeExpandedChanged"), this.js = a, this.i("treeExpandedChanged", b, a))
});
t.g(y, "isTreeLeaf", y.prototype.Lh);
t.defineProperty(y, {Lh: "isTreeLeaf"}, function () {
return this.Sq
}, function (a) {
var b = this.Sq;
b !== a && (f && t.j(a, "boolean", y, "isTreeLeaf"), this.Sq = a, this.i("isTreeLeaf", b, a))
});
function A() {
w.call(this, Bg);
this.Xf = null;
this.nh = "";
this.gg = this.Eq = null;
this.Ah = "";
this.is = null;
this.Fr = this.Er = this.Dr = !1;
this.Tq = !0;
this.$p = Hg;
this.mq = 0;
this.pq = Hg;
this.qq = NaN;
this.hm = Jk;
this.$r = 0.5;
this.si = this.ff = null;
this.mc = (new H(C)).freeze();
this.te = null;
this.Rg = !1;
this.Sy = null;
this.dz = !1;
this.qn = this.ei = this.Ra = null;
this.cf = 0;
this.An = this.wn = null;
this.Xh = new H(D);
this.iz = new C;
this.RC = this.PC = null;
this.Gx = !1;
this.V = null
}
t.ia("Link", A);
t.Oa(A, w);
A.prototype.cloneProtected = function (a) {
w.prototype.cloneProtected.call(this, a);
a.nh = this.nh;
a.Eq = this.Eq;
a.Ah = this.Ah;
a.is = this.is;
a.Dr = this.Dr;
a.Er = this.Er;
a.Fr = this.Fr;
a.Tq = this.Tq;
a.$p = this.$p;
a.mq = this.mq;
a.pq = this.pq;
a.qq = this.qq;
a.hm = this.hm;
a.$r = this.$r
};
A.prototype.Fh = function (a) {
w.prototype.Fh.call(this, a);
this.nh = a.nh;
this.Ah = a.Ah;
a.si = null;
a.te = null;
a.$b();
a.qn = this.qn;
a.cf = this.cf
};
var Jk;
A.Normal = Jk = t.w(A, "Normal", 1);
A.Orthogonal = t.w(A, "Orthogonal", 2);
A.AvoidsNodes = t.w(A, "AvoidsNodes", 6);
var xm;
A.AvoidsNodesStraight = xm = t.w(A, "AvoidsNodesStraight", 7);
var Hg;
A.None = Hg = t.w(A, "None", 0);
var Pg;
A.Bezier = Pg = t.w(A, "Bezier", 9);
var Gg;
A.JumpGap = Gg = t.w(A, "JumpGap", 10);
var Cg;
A.JumpOver = Cg = t.w(A, "JumpOver", 11);
var Gk;
A.End = Gk = t.w(A, "End", 17);
var Hk;
A.Scale = Hk = t.w(A, "Scale", 18);
var Ik;
A.Stretch = Ik = t.w(A, "Stretch", 19);
var Ol;
A.OrientAlong = Ol = t.w(A, "OrientAlong", 21);
var ym;
A.OrientPlus90 = ym = t.w(A, "OrientPlus90", 22);
var zm;
A.OrientMinus90 = zm = t.w(A, "OrientMinus90", 23);
var Am;
A.OrientOpposite = Am = t.w(A, "OrientOpposite", 24);
var Bm;
A.OrientUpright = Bm = t.w(A, "OrientUpright", 25);
var Cm;
A.OrientPlus90Upright = Cm = t.w(A, "OrientPlus90Upright", 26);
var Dm;
A.OrientMinus90Upright = Dm = t.w(A, "OrientMinus90Upright", 27);
var Em;
A.OrientUpright45 = Em = t.w(A, "OrientUpright45", 28);
A.prototype.Fe = function () {
this.V = {mj: Pb, Oj: Pb, kj: NaN, Mj: NaN, jj: nm, Lj: nm, lj: NaN, Nj: NaN}
};
A.prototype.ml = function () {
var a = this.da;
if (null !== a && (Bi(a) || Ci(a)))return!1;
a = this.ja;
return null !== a && (Bi(a) || Ci(a)) ? !1 : !0
};
A.prototype.Ud = function () {
return!1
};
A.prototype.computeAngle = function (a, b, c) {
switch (b) {
default:
case Hg:
a = 0;
break;
case Ol:
a = c;
break;
case ym:
a = c + 90;
break;
case zm:
a = c - 90;
break;
case Am:
a = c + 180;
break;
case Bm:
a = J.jt(c);
90 < a && 270 > a && (a -= 180);
break;
case Cm:
a = J.jt(c + 90);
90 < a && 270 > a && (a -= 180);
break;
case Dm:
a = J.jt(c - 90);
90 < a && 270 > a && (a -= 180);
break;
case Em:
a = J.jt(c);
if (45 < a && 135 > a || 225 < a && 315 > a)return 0;
90 < a && 270 > a && (a -= 180)
}
return J.jt(a)
};
t.g(A, "fromNode", A.prototype.da);
t.defineProperty(A, {da: "fromNode"}, function () {
return this.Xf
}, function (a) {
var b = this.Xf;
if (b !== a) {
f && null !== a && t.k(a, y, A, "fromNode");
var c = this.Rc;
null !== b && (this.gg !== b && sm(b, this, c), null !== c && (c.ee = null), Fm(this), b.K(Qi));
this.Xf = a;
this.ei = null;
this.$b();
var d = this.h;
if (null !== d) {
var e = this.data, g = d.fa;
if (null !== e)if (g instanceof U) {
var h = null !== a ? a.data : null;
g.YA(e, g.Nb(h))
} else g instanceof Rd && (h = null !== a ? a.data : null, d.ed ? g.Oh(e, g.Nb(h)) : (null !== b && g.Oh(b.data, void 0), g.Oh(h, g.Nb(null !== this.gg ?
this.gg.data : null))))
}
e = this.Rc;
g = this.$z;
null !== g && (h = !0, null !== d && (h = d.Xa, d.Xa = !0), g(this, c, e), null !== d && (d.Xa = h));
null !== a && (this.gg !== a && rm(a, this, e), null !== e && (e.ee = null), Gm(this), a.K(Li));
this.i("fromNode", b, a);
dj(this)
}
});
t.g(A, "fromPortId", A.prototype.nf);
t.defineProperty(A, {nf: "fromPortId"}, function () {
return this.nh
}, function (a) {
var b = this.nh;
if (b !== a) {
f && t.j(a, "string", A, "fromPortId");
var c = this.Rc;
null !== c && (c.ee = null);
Fm(this);
this.nh = a;
var d = this.Rc;
null !== d && (d.ee = null);
var e = this.h;
if (null !== e) {
var g = this.data, h = e.fa;
null !== g && h instanceof U && h.ZA(g, a)
}
c !== d && (this.ei = null, this.$b(), g = this.$z, null !== g && (h = !0, null !== e && (h = e.Xa, e.Xa = !0), g(this, c, d), null !== e && (e.Xa = h)));
Gm(this);
this.i("fromPortId", b, a)
}
});
t.A(A, {Rc: "fromPort"}, function () {
var a = this.Xf;
return null === a ? null : a.Is(this.nh)
});
t.g(A, "fromPortChanged", A.prototype.$z);
t.defineProperty(A, {$z: "fromPortChanged"}, function () {
return this.Eq
}, function (a) {
var b = this.Eq;
b !== a && (null !== a && t.j(a, "function", A, "fromPortChanged"), this.Eq = a, this.i("fromPortChanged", b, a))
});
t.g(A, "toNode", A.prototype.ja);
t.defineProperty(A, {ja: "toNode"}, function () {
return this.gg
}, function (a) {
var b = this.gg;
if (b !== a) {
f && null !== a && t.k(a, y, A, "toNode");
var c = this.Ed;
null !== b && (this.Xf !== b && sm(b, this, c), null !== c && (c.ee = null), Fm(this), b.K(Qi));
this.gg = a;
this.ei = null;
this.$b();
var d = this.h;
if (null !== d) {
var e = this.data, g = d.fa;
if (null !== e)if (g instanceof U) {
var h = null !== a ? a.data : null;
g.cB(e, g.Nb(h))
} else g instanceof Rd && (h = null !== a ? a.data : null, d.ed ? (null !== b && g.Oh(b.data, void 0), g.Oh(h, g.Nb(null !== this.Xf ? this.Xf.data : null))) :
g.Oh(e, g.Nb(h)))
}
e = this.Ed;
g = this.lB;
null !== g && (h = !0, null !== d && (h = d.Xa, d.Xa = !0), g(this, c, e), null !== d && (d.Xa = h));
null !== a && (this.Xf !== a && rm(a, this, e), null !== e && (e.ee = null), Gm(this), a.K(Li));
this.i("toNode", b, a);
dj(this)
}
});
t.g(A, "toPortId", A.prototype.Rf);
t.defineProperty(A, {Rf: "toPortId"}, function () {
return this.Ah
}, function (a) {
var b = this.Ah;
if (b !== a) {
f && t.j(a, "string", A, "toPortId");
var c = this.Ed;
null !== c && (c.ee = null);
Fm(this);
this.Ah = a;
var d = this.Ed;
null !== d && (d.ee = null);
var e = this.h;
if (null !== e) {
var g = this.data, h = e.fa;
null !== g && h instanceof U && h.dB(g, a)
}
c !== d && (this.ei = null, this.$b(), g = this.lB, null !== g && (h = !0, null !== e && (h = e.Xa, e.Xa = !0), g(this, c, d), null !== e && (e.Xa = h)));
Gm(this);
this.i("toPortId", b, a)
}
});
t.A(A, {Ed: "toPort"}, function () {
var a = this.gg;
return null === a ? null : a.Is(this.Ah)
});
t.g(A, "toPortChanged", A.prototype.lB);
t.defineProperty(A, {lB: "toPortChanged"}, function () {
return this.is
}, function (a) {
var b = this.is;
b !== a && (null !== a && t.j(a, "function", A, "toPortChanged"), this.is = a, this.i("toPortChanged", b, a))
});
t.defineProperty(A, {lb: "fromSpot"}, function () {
return null !== this.V ? this.V.mj : Pb
}, function (a) {
null === this.V && this.Fe();
var b = this.V.mj;
b.N(a) || (f && t.k(a, K, A, "fromSpot"), a = a.Z(), this.V.mj = a, this.i("fromSpot", b, a), this.$b())
});
t.defineProperty(A, {dk: "fromEndSegmentLength"}, function () {
return null !== this.V ? this.V.kj : NaN
}, function (a) {
null === this.V && this.Fe();
var b = this.V.kj;
b !== a && (f && t.j(a, "number", A, "fromEndSegmentLength"), 0 > a && t.ha(a, ">= 0", A, "fromEndSegmentLength"), this.V.kj = a, this.i("fromEndSegmentLength", b, a), this.$b())
});
t.defineProperty(A, {So: "fromEndSegmentDirection"}, function () {
return null !== this.V ? this.V.jj : nm
}, function (a) {
null === this.V && this.Fe();
var b = this.V.jj;
b !== a && (f && t.tb(a, y, A, "fromEndSegmentDirection"), this.V.jj = a, this.i("fromEndSegmentDirection", b, a), this.$b())
});
t.defineProperty(A, {To: "fromShortLength"}, function () {
return null !== this.V ? this.V.lj : NaN
}, function (a) {
null === this.V && this.Fe();
var b = this.V.lj;
b !== a && (f && t.j(a, "number", A, "fromShortLength"), this.V.lj = a, this.i("fromShortLength", b, a), this.$b())
});
t.defineProperty(A, {mb: "toSpot"}, function () {
return null !== this.V ? this.V.Oj : Pb
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Oj;
b.N(a) || (f && t.k(a, K, A, "toSpot"), a = a.Z(), this.V.Oj = a, this.i("toSpot", b, a), this.$b())
});
t.defineProperty(A, {lk: "toEndSegmentLength"}, function () {
return null !== this.V ? this.V.Mj : NaN
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Mj;
b !== a && (f && t.j(a, "number", A, "toEndSegmentLength"), 0 > a && t.ha(a, ">= 0", A, "toEndSegmentLength"), this.V.Mj = a, this.i("toEndSegmentLength", b, a), this.$b())
});
t.defineProperty(A, {Lp: "toEndSegmentDirection"}, function () {
return null !== this.V ? this.V.Lj : nm
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Lj;
b !== a && (f && t.tb(a, y, A, "toEndSegmentDirection"), this.V.Lj = a, this.i("toEndSegmentDirection", b, a), this.$b())
});
t.defineProperty(A, {Mp: "toShortLength"}, function () {
return null !== this.V ? this.V.Nj : NaN
}, function (a) {
null === this.V && this.Fe();
var b = this.V.Nj;
b !== a && (f && t.j(a, "number", A, "toShortLength"), this.V.Nj = a, this.i("toShortLength", b, a), this.$b())
});
function dj(a) {
var b = a.da, c = a.ja;
null !== b && null !== c ? Hm(a, b.VH(c)) : Hm(a, null)
}
function Hm(a, b) {
var c = a.Bk;
if (c !== b) {
null !== c && im(c, a);
a.Bk = b;
null !== b && jm(b, a);
var d = a.Kz;
if (null !== d) {
var e = !0, g = a.h;
null !== g && (e = g.Xa, g.Xa = !0);
d(a, c, b);
null !== g && (g.Xa = e)
}
!a.Rg || a.PC !== c && a.RC !== c || a.$b()
}
}
A.prototype.getOtherNode = A.prototype.aA = function (a) {
f && t.k(a, y, A, "getOtherNode:node");
var b = this.da;
return a === b ? this.ja : b
};
A.prototype.getOtherPort = function (a) {
f && t.k(a, X, A, "getOtherPort:port");
var b = this.Rc;
return a === b ? this.Ed : b
};
t.A(A, {vJ: "isLabeledLink"}, function () {
return null === this.ff ? !1 : 0 < this.ff.count
});
t.A(A, {Si: "labelNodes"}, function () {
return null === this.ff ? t.dh : this.ff.l
});
function tm(a, b) {
null === a.ff && (a.ff = new ta(y));
a.ff.add(b);
a.aa()
}
A.prototype.Ps = function () {
w.prototype.Ps.call(this);
Im(this) && Ig(this, this.ya);
var a = this.Xf, b = this.gg;
if (null !== a) {
var c = this.Rc;
null !== c && (c.ee = null);
rm(a, this, c);
Gm(this)
}
null !== b && (c = this.Ed, null !== c && (c.ee = null), rm(b, this, c), Gm(this))
};
A.prototype.Qs = function () {
w.prototype.Qs.call(this);
Im(this) && Ig(this, this.ya);
var a = this.Xf, b = this.gg;
if (null !== a) {
var c = this.Rc;
null !== c && (c.ee = null);
sm(a, this, c);
Fm(this)
}
null !== b && (c = this.Ed, null !== c && (c.ee = null), sm(b, this, c), Fm(this))
};
A.prototype.Im = function () {
if (null !== this.ff) {
var a = this.h;
if (null === a)return;
for (var b = this.ff.copy().l; b.next();)a.remove(b.value)
}
b = this.data;
null !== b && (a = this.h, null !== a && (a = a.fa, a instanceof U ? a.OA(b) : a instanceof Rd && a.Oh(b, void 0)))
};
A.prototype.move = A.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;
w.prototype.move.call(this, a);
this.pl(c, b);
for (a = this.Si; a.next();) {
var d = a.value, e = d.position;
d.moveTo(e.x + c, e.y + b)
}
};
t.g(A, "relinkableFrom", A.prototype.cF);
t.defineProperty(A, {cF: "relinkableFrom"}, function () {
return this.Dr
}, function (a) {
var b = this.Dr;
b !== a && (f && t.j(a, "boolean", A, "relinkableFrom"), this.Dr = a, this.i("relinkableFrom", b, a), this.updateAdornments())
});
t.g(A, "relinkableTo", A.prototype.dF);
t.defineProperty(A, {dF: "relinkableTo"}, function () {
return this.Er
}, function (a) {
var b = this.Er;
b !== a && (f && t.j(a, "boolean", A, "relinkableTo"), this.Er = a, this.i("relinkableTo", b, a), this.updateAdornments())
});
A.prototype.canRelinkFrom = function () {
if (!this.cF)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Sj)return!1;
a = a.h;
return null === a || a.Sj ? !0 : !1
};
A.prototype.canRelinkTo = function () {
if (!this.dF)return!1;
var a = this.layer;
if (null === a)return!0;
if (!a.Sj)return!1;
a = a.h;
return null === a || a.Sj ? !0 : !1
};
t.g(A, "resegmentable", A.prototype.yp);
t.defineProperty(A, {yp: "resegmentable"}, function () {
return this.Fr
}, function (a) {
var b = this.Fr;
b !== a && (f && t.j(a, "boolean", A, "resegmentable"), this.Fr = a, this.i("resegmentable", b, a), this.updateAdornments())
});
t.g(A, "isTreeLink", A.prototype.xc);
t.defineProperty(A, {xc: "isTreeLink"}, function () {
return this.Tq
}, function (a) {
var b = this.Tq;
b !== a && (f && t.j(a, "boolean", A, "isTreeLink"), this.Tq = a, this.i("isTreeLink", b, a), null !== this.da && ij(this.da), null !== this.ja && ij(this.ja))
});
t.A(A, {path: "path"}, function () {
var a = this.si;
if (null !== a)return a;
a = this.za;
a = nk(this, a, a.length);
return a instanceof Y ? this.si = a : null
});
A.prototype.Gq = function () {
return this.path
};
A.prototype.hy = function () {
return this.mc
};
A.prototype.nj = function () {
this.updateRoute();
var a = new D;
this.kf(a);
return this.Sy = a
};
A.prototype.kf = function (a) {
var b = Infinity, c = Infinity, d = this.ma;
if (0 === d)return a.q(NaN, NaN, 0, 0), a;
if (1 === d)d = this.n(0), b = Math.min(d.x, b), c = Math.min(d.y, c), a.q(d.x, d.y, 0, 0); else if (2 === d) {
var e = this.n(0), g = this.n(1), b = Math.min(e.x, g.x), c = Math.min(e.y, g.y);
a.q(e.x, e.y, 0, 0);
a.Zi(g)
} else if (this.computeCurve() === Pg && 3 <= d && !this.ac)if (e = this.n(0), b = e.x, c = e.y, a.q(b, c, 0, 0), 3 === d)d = this.n(1), b = Math.min(d.x, b), c = Math.min(d.y, c), g = this.n(2), b = Math.min(g.x, b), c = Math.min(g.y, c), J.Eo(e.x, e.y, d.x, d.y, d.x, d.y, g.x,
g.y, 0.5, a); else for (var h, k, l = 3; l < d; l += 3)h = this.n(l - 2), l + 3 >= d && (l = d - 1), k = this.n(l - 1), g = this.n(l), J.Eo(e.x, e.y, h.x, h.y, k.x, k.y, g.x, g.y, 0.5, a), b = Math.min(g.x, b), c = Math.min(g.y, c), e = g; else for (e = this.n(0), g = this.n(1), b = Math.min(e.x, g.x), c = Math.min(e.y, g.y), a.q(e.x, e.y, 0, 0), a.Zi(g), l = 2; l < d; l++)e = this.n(l), b = Math.min(e.x, b), c = Math.min(e.y, c), a.Zi(e);
this.iz.q(b - a.x, c - a.y);
return a
};
t.A(A, {SE: "midPoint"}, function () {
this.updateRoute();
return this.computeMidPoint(new C)
});
A.prototype.computeMidPoint = function (a) {
var b = this.ma;
if (0 === b)return a.assign(J.pG), a;
if (1 === b)return a.assign(this.n(0)), a;
if (2 === b) {
var c = this.n(0), d = this.n(1);
a.q((c.x + d.x) / 2, (c.y + d.y) / 2);
return a
}
if (this.computeCurve() === Pg && 3 <= b && !this.ac) {
if (3 === b)return this.n(1);
var b = (b - 1) / 3 | 0, e = 3 * (b / 2 | 0);
1 === b % 2 ? (c = this.n(e), d = this.n(e + 1), b = this.n(e + 2), e = this.n(e + 3), J.lH(c.x, c.y, d.x, d.y, b.x, b.y, e.x, e.y, a)) : a.assign(this.n(e));
return a
}
for (var e = 0, g = t.Db(), h = 0; h < b - 1; h++)c = this.n(h), d = this.n(h + 1), J.Ka(c.x,
d.x) ? (c = d.y - c.y, 0 > c && (c = -c)) : J.Ka(c.y, d.y) ? (c = d.x - c.x, 0 > c && (c = -c)) : c = Math.sqrt(c.Zj(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++
}
t.Da(g);
b = this.n(h);
g = this.n(h + 1);
b.x === g.x ? b.y > g.y ? a.q(b.x, b.y - (e / 2 - c)) : a.q(b.x, b.y + (e / 2 - c)) : b.y === g.y ? b.x > g.x ? a.q(b.x - (e / 2 - c), b.y) : a.q(b.x + (e / 2 - c), b.y) : (e = (e / 2 - c) / d, a.q(b.x + e * (g.x - b.x), b.y + e * (g.y - b.y)));
return a
};
t.A(A, {RE: "midAngle"}, function () {
this.updateRoute();
return this.computeMidAngle()
});
A.prototype.computeMidAngle = function () {
var a = this.ma;
if (2 > a)return NaN;
if (this.computeCurve() === Pg && 4 <= a && !this.ac) {
var b = (a - 1) / 3 | 0, c = 3 * (b / 2 | 0);
if (1 === b % 2) {
var c = Math.floor(c), a = this.n(c), b = this.n(c + 1), d = this.n(c + 2), c = this.n(c + 3);
return J.kH(a.x, a.y, b.x, b.y, d.x, d.y, c.x, c.y)
}
if (0 < c && c + 1 < a)return a = this.n(c - 1), b = this.n(c + 1), a.Ji(b)
}
d = a / 2 | 0;
if (0 === a % 2)return a = this.n(d - 1), b = this.n(d), a.Ji(b);
var a = this.n(d - 1), b = this.n(d), d = this.n(d + 1), c = a.Zj(b), e = b.Zj(d);
return c > e ? a.Ji(b) : b.Ji(d)
};
t.g(A, "points", A.prototype.points);
t.defineProperty(A, {points: "points"}, function () {
return this.mc
}, function (a) {
f && t.k(a, H, A, "points");
var b = this.mc;
if (b !== a && null !== a) {
a = a.copy();
for (var c = a.l; c.next();)c.value.freeze();
a.freeze();
this.mc = a;
this.Kf();
Jm(this);
this.i("points", b, a)
}
});
t.A(A, {ma: "pointsCount"}, function () {
return this.mc.count
});
A.prototype.getPoint = A.prototype.n = function (a) {
return this.mc.p[a]
};
A.prototype.setPoint = A.prototype.vf = function (a, b) {
f && (t.k(b, C, A, "setPoint"), b.Q() || t.m("Link.setPoint called with a Point that does not have real numbers: " + b.toString()));
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.xg(a, b)
};
A.prototype.setPointAt = A.prototype.Y = function (a, b, c) {
f && (t.o(b, A, "setPointAt:x"), t.o(c, A, "setPointAt:y"));
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.xg(a, new C(b, c))
};
A.prototype.insertPoint = function (a, b) {
f && (t.k(b, C, A, "insertPoint"), b.Q() || t.m("Link.insertPoint called with a Point that does not have real numbers: " + b.toString()));
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.Rd(a, b)
};
A.prototype.insertPointAt = A.prototype.C = function (a, b, c) {
f && (t.o(b, A, "insertPointAt:x"), t.o(c, A, "insertPointAt:y"));
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.Rd(a, new C(b, c))
};
A.prototype.addPoint = A.prototype.Ch = function (a) {
f && (t.k(a, C, A, "addPoint"), a.Q() || t.m("Link.addPoint called with a Point that does not have real numbers: " + a.toString()));
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.add(a)
};
A.prototype.addPointAt = A.prototype.Xk = function (a, b) {
f && (t.o(a, A, "insertPointAt:x"), t.o(b, A, "insertPointAt:y"));
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.add(new C(a, b))
};
A.prototype.removePoint = A.prototype.gF = function (a) {
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.Dd(a)
};
A.prototype.clearPoints = A.prototype.Fo = function () {
null === this.te && t.m("Call Link.startRoute before modifying the points of the route.");
this.mc.clear()
};
A.prototype.movePoints = A.prototype.pl = function (a, b) {
for (var c = new H(C), d = this.mc.l; d.next();) {
var e = d.value;
c.add((new C(e.x + a, e.y + b)).freeze())
}
c.freeze();
d = this.mc;
this.mc = c;
this.Kf();
Jm(this);
this.i("points", d, c)
};
A.prototype.startRoute = A.prototype.wl = function () {
null === this.te && (this.te = this.mc, this.mc = this.mc.copy())
};
A.prototype.commitRoute = A.prototype.Gi = function () {
if (null !== this.te) {
for (var a = this.te, b = this.mc, c = Infinity, d = Infinity, e = a.count, g = 0; g < e; g++)var h = a.p[g], c = Math.min(h.x, c), d = Math.min(h.y, d);
for (var k = Infinity, l = Infinity, m = b.count, g = 0; g < m; g++)h = b.p[g], k = Math.min(h.x, k), l = Math.min(h.y, l), h.freeze();
b.freeze();
if (m === e)for (g = 0; g < m; g++)if (e = a.p[g], h = b.p[g], e.x - c !== h.x - k || e.y - d !== h.y - l) {
this.Kf();
break
}
this.te = null;
Jm(this);
this.i("points", a, b)
}
};
A.prototype.rollbackRoute = A.prototype.ZI = function () {
null !== this.te && (this.mc = this.te, this.te = null)
};
function Jm(a) {
0 === a.mc.count ? a.Rg = !1 : (a.Rg = !0, a.wn = a.n(0).copy(), a.An = a.n(a.ma - 1).copy(), Km(a, !1))
}
A.prototype.invalidateRoute = A.prototype.$b = function () {
if (!(this.dz || this.h && this.h.Aa.qb)) {
var a = this.Gq();
null !== a && (this.Rg = !1, this.Kf(), a.aa())
}
};
t.defineProperty(A, {Kp: null}, function () {
return this.dz
}, function (a) {
this.dz = a
});
A.prototype.updateRoute = function () {
if (!this.Rg && !this.Gx) {
var a = !0;
try {
this.Gx = !0, this.wl(), a = this.computePoints()
} finally {
this.Gx = !1, a ? this.Gi() : this.ZI()
}
}
};
A.prototype.computePoints = function () {
var a = this.h;
if (null === a)return!1;
var b = this.da, c = null;
null === b ? (a.im || (a.bv = new Y, a.bv.Ca = J.kn, a.bv.ib = 0, a.im = new y, a.im.add(a.bv), a.im.Hf()), this.wn && (a.im.position = a.im.location = this.wn, a.im.Hf(), b = a.im, c = a.bv)) : c = this.Rc;
if (null !== c) {
var d = xk(c);
d !== b && b.zb() ? c = d : (d = fm(b), null !== d && d !== b ? (b = d, c = d.Is("")) : b = d)
}
this.PC = b;
if (null === b || null === c || !b.location.Q())return!1;
var d = this.ja, e = null;
null === d ? (a.jm || (a.cv = new Y, a.cv.Ca = J.kn, a.cv.ib = 0, a.jm = new y, a.jm.add(a.cv),
a.jm.Hf()), this.An && (a.jm.position = a.jm.location = this.An, a.jm.Hf(), d = a.jm, e = a.cv)) : e = this.Ed;
null !== e && (a = xk(e), a !== d && d.zb() ? e = a : (a = fm(d), null !== a && a !== d ? (d = a, e = a.Is("")) : d = a));
this.RC = d;
if (null === d || null === e || !d.location.Q())return!1;
var a = this.ma, g = Lm(this, c), h = Mm(this, e), k = c === e, l = this.ac, m = this.De === Pg;
this.ei = k && !l ? m = !0 : !1;
var n = this.wo === Hg || k;
if (l || g !== Kb || h !== Kb || k) {
m = this.Qi;
n && (l && m || k) && this.Fo();
var p = k ? this.computeCurviness() : 0, q = this.getLinkPoint(b, c, g, !0, l, d, e), r = 0, s = 0, v = 0;
if (l || g !==
Kb || k) {
var x = this.computeEndSegmentLength(b, c, g, !0), v = this.getLinkDirection(b, c, q, g, !0, l, d, e);
k && (v -= l ? 90 : 30, 0 > p && (v -= 180));
0 > v ? v += 360 : 360 <= v && (v -= 360);
k && (x += Math.abs(p));
0 === v ? r = x : 90 === v ? s = x : 180 === v ? r = -x : 270 === v ? s = -x : (r = x * Math.cos(v * Math.PI / 180), s = x * Math.sin(v * Math.PI / 180));
if (g.pd() && k) {
var E = c.gb(Ub, t.O()), F = t.ic(E.x + 1E3 * r, E.y + 1E3 * s);
this.getLinkPointFromPoint(b, c, E, F, !0, q);
t.B(E);
t.B(F)
}
}
var x = this.getLinkPoint(d, e, h, !1, l, b, c), G = 0, L = 0, N = 0;
if (l || h !== Kb || k)E = this.computeEndSegmentLength(d, e, h,
!1), N = this.getLinkDirection(d, e, x, h, !1, l, b, c), k && (N += l ? 0 : 30, 0 > p && (N += 180)), 0 > N ? N += 360 : 360 <= N && (N -= 360), k && (E += Math.abs(p)), 0 === N ? G = E : 90 === N ? L = E : 180 === N ? G = -E : 270 === N ? L = -E : (G = E * Math.cos(N * Math.PI / 180), L = E * Math.sin(N * Math.PI / 180)), h.pd() && k && (E = e.gb(Ub, t.O()), F = t.ic(E.x + 1E3 * G, E.y + 1E3 * L), this.getLinkPointFromPoint(d, e, E, F, !1, x), t.B(E), t.B(F));
e = q;
if (l || g !== Kb || k)e = new C(q.x + r, q.y + s);
c = x;
if (l || h !== Kb || k)c = new C(x.x + G, x.y + L);
!n && !l && g.pd() && 3 < a && this.adjustPoints(0, q, a - 2, c) ? this.vf(a - 1, x) : !n && !l && h.pd() &&
3 < a && this.adjustPoints(1, e, a - 1, x) ? this.vf(0, q) : !n && !l && 4 < a && this.adjustPoints(1, e, a - 2, c) ? (this.vf(0, q), this.vf(a - 1, x)) : !n && l && 6 <= a && !m && this.adjustPoints(1, e, a - 2, c) ? (this.vf(0, q), this.vf(a - 1, x)) : (this.Fo(), this.Ch(q), (l || g !== Kb || k) && this.Ch(e), l && this.addOrthoPoints(e, v, c, N, b, d), (l || h !== Kb || k) && this.Ch(c), this.Ch(x))
} else g = !1, !n && 3 <= a && (n = this.getLinkPoint(b, c, Kb, !0, !1, d, e), g = this.getLinkPoint(d, e, Kb, !1, !1, b, c), g = this.adjustPoints(0, n, a - 1, g)), g || (this.Fo(), m ? (a = this.getLinkPoint(b, c, Kb, !0, !1, d, e),
n = this.getLinkPoint(d, e, Kb, !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, v = a.y + h / 3, r = q, s = v, J.I(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) + v), q = a.x + 2 * g / 3, v = a.y + 2 * h / 3, x = q, G = v, J.I(h, 0) ? G = 0 < g ? G - k : G + k : (x = (0 > h ? -1 : 1) * m + q, G = l * (x - q) + v), this.Fo(), this.Ch(a), this.Xk(r, s), this.Xk(x, G), this.Ch(n), this.vf(0, this.getLinkPoint(b, c, Kb, !0, !1, d, e)), this.vf(3, this.getLinkPoint(d, e, Kb, !1, !1, b, c))) : (a = d, d = this.getLinkPoint(b, c, Kb, !0, !1, a, e), e = this.getLinkPoint(a,
e, Kb, !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, J.I(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.Ch(d), this.Xk(g, k)) : this.Ch(d), this.Ch(e)));
return!0
};
function Nm(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
}
A.prototype.getLinkPointFromPoint = function (a, b, c, d, e, g) {
void 0 === g && (g = new C);
if (null === a || null === b)return g.assign(c), g;
a.zb() || (e = fm(a), null !== e && e !== a && (b = e.port));
var h;
a = null;
if (null === b.ga)e = d.x, d = d.y, h = c.x, c = c.y; else {
a = b.ga.he;
e = 1 / (a.m11 * a.m22 - a.m12 * a.m21);
h = a.m22 * e;
var k = -a.m12 * e, l = -a.m21 * e, m = a.m11 * e, n = e * (a.m21 * a.dy - a.m22 * a.dx), p = e * (a.m12 * a.dx - a.m11 * a.dy);
e = d.x * h + d.y * l + n;
d = d.x * k + d.y * m + p;
h = c.x * h + c.y * l + n;
c = c.x * k + c.y * m + p
}
b.Ls(e, d, h, c, g);
a && g.transform(a);
return g
};
function Om(a, b) {
var c = b.ee;
null === c && (c = new Pm, c.port = b, c.Ic = b.U, b.ee = c);
return Qm(c, a)
}
A.prototype.getLinkPoint = function (a, b, c, d, e, g, h, k) {
void 0 === k && (k = new C);
if (c.qd())return b.gb(c, k), k;
if (c.dp() && (c = Om(this, b), null !== c)) {
k.assign(c.kp);
if (e && this.rt === xm) {
var l = Om(this, h);
if (c.Fm < l.Fm) {
c = t.O();
var l = t.O(), m = new D(b.gb(Qb, c), b.gb(Zb, 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);
t.B(c);
t.B(l)
}
}
return k
}
g = b.gb(Ub, t.O());
c = null;
this.ma > (e ? 6 : 2) ? (h = d ? this.n(1) : this.n(this.ma - 2), e && (h = Nm(g, h.copy()))) :
(c = t.O(), h = h.gb(Ub, c), e && (h = Nm(g, h)));
this.getLinkPointFromPoint(a, b, g, h, d, k);
t.B(g);
null !== c && t.B(c);
return k
};
A.prototype.getLinkDirection = function (a, b, c, d, e, g, h, k) {
a:if (d.qd())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 : 0.5 > d.x ? 225 : 0.5 < d.x ? 45 : 0; else {
if (d.dp() && (a = Om(this, b), null !== a))switch (a.Ie) {
case t.Fd:
c = 270;
break a;
case t.gd:
c = 180;
break a;
default:
case t.td:
c = 0;
break a;
case t.sd:
c = 90;
break a
}
a = b.gb(Ub, t.O());
d = null;
this.ma > (g ? 6 : 2) ? (k = e ? this.n(1) : this.n(this.ma - 2), k = g ? Nm(a, k.copy()) : c) : (d = t.O(), k = k.gb(Ub, d));
c = Math.abs(k.x - a.x) > Math.abs(k.y - a.y) ? k.x >= a.x ? 0 : 180 : k.y >=
a.y ? 90 : 270;
t.B(a);
null !== d && t.B(d)
}
g = nm;
g = e ? this.So : this.Lp;
g === nm && (g = e ? b.So : b.Lp);
switch (g) {
case om:
b = b.jl();
c += b;
360 <= c && (c -= 360);
break;
case nm:
case Nj:
b = b.jl();
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
};
A.prototype.computeEndSegmentLength = function (a, b, c, d) {
if (c.dp() && (a = Om(this, b), null !== a))return a.$v;
a = NaN;
a = d ? this.dk : this.lk;
isNaN(a) && (a = d ? b.dk : b.lk);
isNaN(a) && (a = 10);
return a
};
A.prototype.computeSpot = function (a) {
return a ? Lm(this, this.Rc) : Mm(this, this.Ed)
};
function Lm(a, b) {
var c = a.lb;
c.Gc() && (void 0 === b && (b = a.Rc), null !== b && (c = b.lb));
return c === Pb ? Kb : c
}
function Mm(a, b) {
var c = a.mb;
c.Gc() && (void 0 === b && (b = a.Ed), null !== b && (c = b.mb));
return c === Pb ? Kb : c
}
A.prototype.computeOtherPoint = function (a, b) {
var c = b.gb(Ub), d;
d = b.ee;
d = null !== d ? Qm(d, this) : null;
null !== d && (c = d.kp);
return c
};
A.prototype.computeShortLength = function (a) {
return a ? Rm(this) : Sm(this)
};
function Rm(a) {
var b = a.To;
isNaN(b) && (a = a.Rc, null !== a && (b = a.To));
return isNaN(b) ? 0 : b
}
function Sm(a) {
var b = a.Mp;
isNaN(b) && (a = a.Ed, null !== a && (b = a.Mp));
return isNaN(b) ? 0 : b
}
A.prototype.bk = function (a, b, c, d, e, g) {
if (!1 === this.Ze)return!1;
void 0 === b && (b = null);
void 0 === c && (c = null);
var h = g;
void 0 === g && (h = t.ah(), h.reset());
h.multiply(this.transform);
if (this.Em(a, h))return Fl(this, b, c, e), void 0 === g && t.Te(h), !0;
if (this.Jf(a, h)) {
var k = !1;
if (!this.Ig)for (var l = this.za.length; l--;) {
var m = this.za.p[l];
if (m.visible || m === this.Ub) {
var n = m.ya, p = this.Ia;
if (!(n.x > p.width || n.y > p.height || 0 > n.x + n.width || 0 > n.y + n.height)) {
n = t.ah();
n.set(h);
if (m instanceof B)k = m.bk(a, b, c, d, e, n); else if (this.path ===
m) {
var k = m, q = a, r = d, p = n;
if (!1 === k.Ze)k = !1; else if (p.multiply(k.transform), r)b:{
var s = q, v = p;
if (k.Em(s, v))k = !0; else {
if (void 0 === v && (v = k.transform, s.Vj(k.ya))) {
k = !0;
break b
}
var p = s.left, q = s.right, r = s.top, s = s.bottom, x = t.O(), E = t.O(), F = t.O(), G = t.ah();
G.set(v);
G.xA(k.transform);
G.iA();
E.x = q;
E.y = r;
E.transform(G);
x.x = p;
x.y = r;
x.transform(G);
v = !1;
Ml(k, x, E, F) ? v = !0 : (x.x = q, x.y = s, x.transform(G), Ml(k, x, E, F) ? v = !0 : (E.x = p, E.y = s, E.transform(G), Ml(k, x, E, F) ? v = !0 : (x.x = p, x.y = r, x.transform(G), Ml(k, x, E, F) && (v = !0))));
t.Te(G);
t.B(x);
t.B(E);
t.B(F);
k = v
}
} else k = k.Em(q, p)
} else k = Sj(m, a, d, n);
k && (null !== b && (m = b(m)), m && (null === c || c(m)) && e.add(m));
t.Te(n)
}
}
}
void 0 === g && t.Te(h);
return k || null !== this.background || null !== this.Bi
}
void 0 === g && t.Te(h);
return!1
};
t.A(A, {ac: "isOrthogonal"}, function () {
return 2 === (this.hm.value & 2)
});
t.A(A, {Qi: "isAvoiding"}, function () {
return 4 === (this.hm.value & 4)
});
A.prototype.computeCurve = function () {
if (null === this.ei) {
var a = this.ac;
this.ei = this.Rc === this.Ed && !a
}
return this.ei ? Pg : this.De
};
A.prototype.computeCorner = function () {
if (this.De === Pg)return 0;
var a = this.Tv;
if (isNaN(a) || 0 > a)a = 10;
return a
};
A.prototype.computeCurviness = function () {
var a = this.Cs;
if (isNaN(a)) {
var b = this.cf;
if (0 !== b) {
var a = 10, c = this.h;
null !== c && (a = c.lp);
c = Math.abs(b);
a = a / 2 + ((c - 1) / 2 | 0) * a;
0 === c % 2 && (a = -a);
0 > b && (a = -a)
} else a = 10
}
return a
};
A.prototype.hasCurviness = function () {
return!isNaN(this.Cs) || 0 !== this.cf && !this.ac
};
A.prototype.adjustPoints = function (a, b, c, d) {
var e = this.wo;
if (this.ac) {
if (e === Hk)return!1;
e === Ik && (e = Gk)
}
switch (e) {
case Hk:
var g = this.n(a), h = this.n(c);
if (!g.N(b) || !h.N(d)) {
var e = g.x, g = g.y, k = h.x - e, l = h.y - g, m = Math.sqrt(k * k + l * l);
if (!J.I(m, 0)) {
var n;
J.I(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, k = d.x - h, q = d.y - p, l = Math.sqrt(k * k + q * q);
J.I(k, 0) ? q = 0 > q ? -Math.PI / 2 : Math.PI / 2 : (q = Math.atan(q / Math.abs(k)), 0 > k && (q = Math.PI - q));
m = l / m;
n = q - n;
this.vf(a, b);
for (a += 1; a < c; a++)b =
this.n(a), k = b.x - e, l = b.y - g, b = Math.sqrt(k * k + l * l), J.I(b, 0) || (J.I(k, 0) ? l = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (l = Math.atan(l / Math.abs(k)), 0 > k && (l = Math.PI - l)), k = l + n, b *= m, this.Y(a, h + b * Math.cos(k), p + b * Math.sin(k)));
this.vf(c, d)
}
}
return!0;
case Ik:
g = this.n(a);
p = this.n(c);
if (!g.N(b) || !p.N(d)) {
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;
var l = d.x, q = d.y, r = 0, s = 1, r = 0 !== l - k ? (q - n) / (l - k) : 9E9;
0 !== r && (s = Math.sqrt(1 + 1 / (r * r)));
this.vf(a, b);
for (a += 1; a < c; a++) {
b = this.n(a);
var v = b.x, x = b.y, E = 0.5;
0 !== m && (E = ((e - v) * (e -
h) + (g - x) * (g - p)) / m);
var F = e + E * (h - e), G = g + E * (p - g);
b = Math.sqrt((v - F) * (v - F) + (x - G) * (x - G));
x < r * (v - F) + G && (b = -b);
0 < r && (b = -b);
v = k + E * (l - k);
E = n + E * (q - n);
0 !== r ? (b = v + b / s, this.Y(a, b, E - (b - v) / r)) : this.Y(a, v, E + b)
}
this.vf(c, d)
}
return!0;
case Gk:
return this.ac && (e = this.n(a), g = this.n(a + 1), h = this.n(a + 2), J.I(e.y, g.y) ? J.I(g.x, h.x) ? this.Y(a + 1, g.x, b.y) : J.I(g.y, h.y) && this.Y(a + 1, b.x, g.y) : J.I(e.x, g.x) && (J.I(g.y, h.y) ? this.Y(a + 1, b.x, g.y) : J.I(g.x, h.x) && this.Y(a + 1, g.x, b.y)), e = this.n(c), g = this.n(c - 1), h = this.n(c - 2), J.I(e.y, g.y) ? J.I(g.x,
h.x) ? this.Y(c - 1, g.x, d.y) : J.I(g.y, h.y) && this.Y(c - 1, d.x, g.y) : J.I(e.x, g.x) && (J.I(g.y, h.y) ? this.Y(c - 1, d.x, g.y) : J.I(g.x, h.x) && this.Y(c - 1, g.x, d.y))), this.vf(a, b), this.vf(c, d), !0;
default:
return!1
}
};
A.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.ya.copy(), k = g.ya.copy();
if (h.Q() && k.Q()) {
h.Ug(8, 8);
k.Ug(8, 8);
h.Zi(a);
k.Zi(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 C(c.x, a.y), m = new C(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 C(a.x, c.y);
m = new C((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.Ha(a) || h.Ha(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 C(Math.max((a.x + c.x) / 2, a.x), a.y), m = new C(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 C(c.x, a.y), m = new C(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 C(a.x, c.y);
m = new C((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.Ha(a) || h.Ha(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 C(Math.min((a.x + c.x) / 2, a.x), a.y), m = new C(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 C(a.x, c.y), m = new C((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 C(c.x, a.y);
m = new C(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.Ha(a) || h.Ha(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 C(a.x, Math.max((a.y + c.y) / 2, a.y)), m = new C(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 C(a.x, c.y), m = new C((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 C(c.x, a.y);
m = new C(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.Ha(a) || h.Ha(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 C(a.x, Math.min((a.y + c.y) / 2, a.y)), m = new C(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.Qi) {
var q = this.h;
if (null === q || h.Ha(c) || k.Ha(a) || e === g || this.layer.pc)a = !1; else if (e = ha(q, !0, this), Tm(e, Math.min(a.x, n.x), Math.min(a.y, n.y), Math.abs(a.x - n.x), Math.abs(a.y - n.y)) && Tm(e, Math.min(n.x, p.x), Math.min(n.y, p.y), Math.abs(n.x - p.x), Math.abs(n.y - p.y)) && Tm(e, 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().mk(k), h.Ug(2 * e.Bm, 2 * e.Am), Um(e, a, b, c, d, h), k = Vm(e, c.x, c.y), e.abort || k !== ja || (mj(e), k = e.EF, h.Ug(e.Bm *
k, e.Am * k), Um(e, a, b, c, d, h), k = Vm(e, c.x, c.y)), e.abort || k !== ja || (mj(e), k = e.EE, h.Ug(e.Bm * k, e.Am * k), Um(e, a, b, c, d, h), k = Vm(e, c.x, c.y)), !e.abort && k === ja && e.jG && (mj(e), Um(e, a, b, c, d, e.Mb), k = Vm(e, c.x, c.y)), !e.abort && k < ja && Vm(e, c.x, c.y) !== ia) {
Wm(this, e, c.x, c.y, d, !0);
d = this.n(2);
if (4 > this.ma)0 === b || 180 === b ? (d.x = a.x, d.y = c.y) : (d.x = c.x, d.y = a.y), this.Y(2, d.x, d.y), this.C(3, d.x, d.y); else if (c = this.n(3), 0 === b || 180 === b)J.I(d.x, c.x) ? (b = 0 === b ? Math.max(d.x, a.x) : Math.min(d.x, a.x), this.Y(2, b, a.y), this.Y(3, b, c.y)) : J.I(d.y, c.y) ?
(Math.abs(a.y - d.y) <= e.Am / 2 && (this.Y(2, d.x, a.y), this.Y(3, c.x, a.y)), this.C(2, d.x, a.y)) : this.Y(2, a.x, d.y); else if (90 === b || 270 === b)J.I(d.y, c.y) ? (b = 90 === b ? Math.max(d.y, a.y) : Math.min(d.y, a.y), this.Y(2, a.x, b), this.Y(3, c.x, b)) : J.I(d.x, c.x) ? (Math.abs(a.x - d.x) <= e.Bm / 2 && (this.Y(2, a.x, d.y), this.Y(3, a.x, c.y)), this.C(2, a.x, d.y)) : this.Y(2, d.x, a.y);
a = !0
} else a = !1
} else a = !1;
a || (this.Ch(l), this.Ch(m))
}
};
A.prototype.computeMidOrthoPosition = function (a, b) {
if (this.hasCurviness()) {
var c = this.computeCurviness();
return(a + b) / 2 + c
}
return(a + b) / 2
};
function Df(a) {
if (!a.Qi)return!1;
var b = a.points.p, c = b.length;
if (4 > c)return!1;
a = ha(a.h, !0, a);
for (var d = 1; d < c - 2; d++) {
var e = b[d], g = b[d + 1];
if (!Tm(a, 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 Wm(a, b, c, d, e, g) {
var h = b.Bm, k = b.Am, l = Vm(b, c, d), m = c, n = d;
for (0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k; l > Xm && Vm(b, m, n) === l - Ym;)c = m, d = n, 0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k, l -= Ym;
if (g) {
if (l > Xm)if (180 === e || 0 === e)c = Math.floor(c / h) * h + h / 2; else if (90 === e || 270 === e)d = Math.floor(d / k) * k + k / 2
} else c = Math.floor(c / h) * h + h / 2, d = Math.floor(d / k) * k + k / 2;
l > Xm && (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), Vm(b, m, n) === l - Ym ? Wm(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), Vm(b, m, n) === l - Ym && Wm(a, b, m, n, g, !1)));
a.Xk(c, d)
}
A.prototype.findClosestSegment = function (a) {
f && t.k(a, C, A, "findClosestSegment:p");
var b = a.x;
a = a.y;
for (var c = this.n(0), d = this.n(1), e = ab(b, a, c.x, c.y, d.x, d.y), g = 0, h = 1; h < this.ma - 1; h++) {
var c = this.n(h + 1), k = ab(b, a, d.x, d.y, c.x, c.y), d = c;
k < e && (g = h, e = k)
}
return g
};
A.prototype.invalidateGeometry = A.prototype.Kf = function () {
this.si = this.Ra = null;
this.aa()
};
t.A(A, {dd: "geometry"}, function () {
null === this.Ra && (this.updateRoute(), this.Ra = this.makeGeometry());
return this.Ra
});
A.prototype.ww = function () {
if (null === this.Ra && !1 !== this.Rg) {
this.Ra = this.makeGeometry();
var a = this.Gq();
if (null !== a) {
a.Ra = this.Ra;
for (var b = this.za, c = b.length, d = 0; d < c; d++) {
var e = b.p[d];
e !== a && e.Ih && e instanceof Y && (e.Ra = this.Ra)
}
}
}
};
A.prototype.makeGeometry = function () {
var a = this.ma;
if (2 > a) {
var b = new M(Kc), c = new Lc(0, 0);
b.ub.add(c);
return b
}
var d = this.n(0).copy(), e = d.copy(), g = this.computeCurve();
if (g === Pg && 3 <= a && !J.Ka(this.dn, 0))if (3 === a)var h = this.n(1), b = Math.min(d.x, h.x), c = Math.min(d.y, h.y), h = this.n(2), b = Math.min(b, h.x), c = Math.min(c, h.y); else {
if (this.ac)for (h = 0; h < a; h++)b = this.mc.p[h], e.x = Math.min(b.x, e.x), e.y = Math.min(b.y, e.y); else for (var k, h = 3; h < a; h += 3)h + 3 >= a && (h = a - 1), k = this.n(h), e.x = Math.min(k.x, e.x), e.y = Math.min(k.y, e.y);
b = e.x;
c = e.y
} else {
for (h = 0; h < a; h++)b = this.mc.p[h], e.x = Math.min(b.x, e.x), e.y = Math.min(b.y, e.y);
b = e.x;
c = e.y
}
b -= this.iz.x;
c -= this.iz.y;
d.x -= b;
d.y -= c;
if (2 === a) {
var l = this.n(1).copy();
l.x -= b;
l.y -= c;
0 !== Rm(this) && Zm(this, d, !0, e);
0 !== Sm(this) && Zm(this, l, !1, e);
b = new M(Nc);
b.na = d.x;
b.oa = d.y;
b.D = l.x;
b.F = l.y
} else {
l = t.u();
0 !== Rm(this) && Zm(this, d, !0, e);
O(l, d.x, d.y, !1, !1);
if (g === Pg && 3 <= a && !J.Ka(this.dn, 0))if (3 === a)h = this.n(1), a = h.x - b, d = h.y - c, h = this.n(2).copy(), h.x -= b, h.y -= c, 0 !== Sm(this) && Zm(this, h, !1, e), P(l, a, d,
a, d, h.x, h.y); else if (this.ac) {
d = new C(b, c);
g = this.n(1).copy();
k = new C(b, c);
for (var a = new C(b, c), e = this.n(0), m = null, n = this.dn / 3, h = 1; h < this.ma - 1; h++) {
var m = this.n(h), p = e, q = m, r = this.n($m(this, m, h, !1));
if (!J.Ka(p.x, q.x) || !J.Ka(q.x, r.x))if (!J.Ka(p.y, q.y) || !J.Ka(q.y, r.y)) {
var s = n, v = k, x = a;
isNaN(s) && (s = this.dn / 3);
var E = p.x, p = p.y, F = q.x, q = q.y, G = r.x, r = r.y, L = s * an(E, p, F, q), s = s * an(F, q, G, r);
J.Ka(p, q) && J.Ka(F, G) && (F > E ? r > q ? (v.x = F - L, v.y = q - L, x.x = F + s, x.y = q + s) : (v.x = F - L, v.y = q + L, x.x = F + s, x.y = q - s) : r > q ? (v.x = F + L, v.y = q - L, x.x =
F - s, x.y = q + s) : (v.x = F + L, v.y = q + L, x.x = F - s, x.y = q - s));
J.Ka(E, F) && J.Ka(q, r) && (q > p ? (G > F ? (v.x = F - L, v.y = q - L, x.x = F + s) : (v.x = F + L, v.y = q - L, x.x = F - s), x.y = q + s) : (G > F ? (v.x = F - L, v.y = q + L, x.x = F + s) : (v.x = F + L, v.y = q + L, x.x = F - s), x.y = q - s));
if (J.Ka(E, F) && J.Ka(F, G) || J.Ka(p, q) && J.Ka(q, r))E = 0.5 * (E + G), p = 0.5 * (p + r), v.x = E, v.y = p, x.x = E, x.y = p;
1 === h ? (g.x = 0.5 * (e.x + m.x), g.y = 0.5 * (e.y + m.y)) : 2 === h && J.Ka(e.x, this.n(0).x) && J.Ka(e.y, this.n(0).y) && (g.x = 0.5 * (e.x + m.x), g.y = 0.5 * (e.y + m.y));
P(l, g.x - b, g.y - c, k.x - b, k.y - c, m.x - b, m.y - c);
d.set(k);
g.set(a);
e = m
}
}
h =
e.x;
e = e.y;
d = this.n(this.ma - 1);
h = 0.5 * (h + d.x);
e = 0.5 * (e + d.y);
P(l, a.x - b, a.y - c, h - b, e - c, d.x - b, d.y - c)
} else for (h = 3; h < a; h += 3)e = this.n(h - 2), h + 3 >= a && (h = a - 1), d = this.n(h - 1), k = this.n(h), h === a - 1 && 0 !== Sm(this) && (k = k.copy(), Zm(this, k, !1, J.nk)), P(l, e.x - b, e.y - c, d.x - b, d.y - c, k.x - b, k.y - c); else {
e = t.O();
e.assign(this.n(0));
for (h = 1; h < a;) {
h = $m(this, e, h, 1 < h);
n = this.n(h);
if (h >= a - 1) {
e !== n && (0 !== Sm(this) && (n = n.copy(), Zm(this, n, !1, J.nk)), bn(this, l, -b, -c, e, n));
break
}
h = $m(this, n, h + 1, h < a - 3);
d = l;
g = -b;
k = -c;
m = e;
v = this.n(h);
x = e;
J.I(m.y,
n.y) && J.I(n.x, v.x) ? (E = this.computeCorner(), E = Math.min(E, Math.abs(n.x - m.x) / 2), E = p = Math.min(E, Math.abs(v.y - n.y) / 2), J.I(E, 0) ? (bn(this, d, g, k, m, n), x.assign(n)) : (s = n.x, F = n.y, q = s, G = F, s = n.x > m.x ? n.x - E : n.x + E, G = v.y > n.y ? n.y + p : n.y - p, bn(this, d, g, k, m, new C(s, F)), $c(d, n.x + g, n.y + k, q + g, G + k), x.q(q, G))) : J.I(m.x, n.x) && J.I(n.y, v.y) ? (E = this.computeCorner(), p = Math.min(E, Math.abs(n.y - m.y) / 2), p = E = Math.min(p, Math.abs(v.x - n.x) / 2), J.I(E, 0) ? (bn(this, d, g, k, m, n), x.assign(n)) : (s = n.x, G = F = n.y, F = n.y > m.y ? n.y - p : n.y + p, q = v.x > n.x ? n.x + E :
n.x - E, bn(this, d, g, k, m, new C(s, F)), $c(d, n.x + g, n.y + k, q + g, G + k), x.q(q, G))) : (bn(this, d, g, k, m, n), x.assign(n))
}
t.B(e)
}
b = l.s;
t.v(l)
}
return b
};
function an(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 J.Ka(a, 0) ? b : J.Ka(b, 0) ? a : Math.sqrt(a * a + b * b)
}
function Zm(a, b, c, d) {
var e = a.ma;
if (!(2 > e))if (c) {
var g = a.n(1);
c = g.x - d.x;
d = g.y - d.y;
g = an(b.x, b.y, c, d);
0 !== g && (e = 2 === e ? 0.5 * g : g, a = Rm(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.n(e - 2), c = g.x - d.x, d = g.y - d.y, g = an(b.x, b.y, c, d), 0 !== g && (e = 2 === e ? 0.5 * g : g, a = Sm(a), a > e && (a = e), c = a * (b.x - c) / g, a = a * (b.y - d) / g, b.x -= c, b.y -= a)
}
function $m(a, b, c, d) {
for (var e = a.ma, g = b; J.Ka(b.x, g.x) && J.Ka(b.y, g.y);) {
if (c >= e)return e - 1;
g = a.n(c++)
}
if (!J.Ka(b.x, g.x) && !J.Ka(b.y, g.y))return c - 1;
for (var h = g; J.Ka(b.x, g.x) && J.Ka(g.x, h.x) && (!d || (b.y >= g.y ? g.y >= h.y : g.y <= h.y)) || J.Ka(b.y, g.y) && J.Ka(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.n(c++)
}
return c - 2
}
function bn(a, b, c, d, e, g) {
if (Im(a)) {
var h = new H("number"), k = cn(a, e, g, h), l = e.x, l = e.y;
if (0 < k)if (J.I(e.y, g.y))if (e.x < g.x)for (var m = 0; m < k;) {
var n = Math.max(e.x, Math.min(h.p[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.p[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.De === Gg ? O(b, n, p, !1, !1) : P(b, l, q, n, q, n, p)
} else for (m = k - 1; 0 <= m;) {
n = Math.min(e.x, Math.max(h.p[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.p[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.De === Gg ? O(b, n, p, !1, !1) : P(b, l, q, n, q, n, p)
} else if (J.I(e.x, g.x))if (e.y < g.y)for (m = 0; m < k;) {
n = Math.max(e.y, Math.min(h.p[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.p[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.De === Gg ? O(b, n, p, !1, !1) : P(b, q, l, q, p, n, p)
} else for (m = k - 1; 0 <= m;) {
n = Math.min(e.y, Math.max(h.p[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.p[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.De === Gg ? O(b, n, p, !1, !1) : P(b, q, l, q, p, n, p)
}
}
b.lineTo(g.x + c, g.y + d)
}
function cn(a, b, c, d) {
var e = a.h;
if (null === e)return 0;
Math.min(b.x, c.x);
Math.min(b.y, c.y);
Math.max(b.x, c.x);
Math.max(b.y, c.y);
for (e = e.Tm; e.next();) {
var g = e.value;
if (null !== g && g.visible)for (var g = g.cb.p, h = g.length, k = 0; k < h; k++) {
var l = g[k];
if (l === a)return 0 < d.length && d.sort(function (a, b) {
return a - b
}), d.length;
if (l instanceof A && a.zb() && l.zb() && Im(l)) {
var m = l.nj();
m.Q() && a.nj().Jf(m) && !a.usesSamePort(l) && (m = l.path, null !== m && m.ol() && dn(b, c, d, l))
}
}
}
0 < d.length && d.sort(function (a, b) {
return a - b
});
return d.length
}
function dn(a, b, c, d) {
for (var e = d.ma, g = 1; g < e; g++) {
var h = d.n(g - 1), k = d.n(g), l = t.O(), m;
a:{
m = a;
var n = b, p = l;
if (!J.I(m.x, n.x)) {
if (J.I(h.x, k.x) && Math.min(m.x, n.x) <= h.x && Math.max(m.x, n.x) >= h.x && Math.min(h.y, k.y) <= m.y && Math.max(h.y, k.y) >= m.y && !J.I(h.y, k.y)) {
p.x = h.x;
p.y = m.y;
m = !0;
break a
}
} else if (J.I(h.y, k.y) && Math.min(m.y, n.y) <= h.y && Math.max(m.y, n.y) >= h.y && Math.min(h.x, k.x) <= m.x && Math.max(h.x, k.x) >= m.x && !J.I(h.x, k.x)) {
p.x = m.x;
p.y = h.y;
m = !0;
break a
}
p.x = 0;
p.y = 0;
m = !1
}
m && (J.I(a.y, b.y) ? c.add(l.x) : c.add(l.y));
t.B(l)
}
}
t.A(A, {Ks: "firstPickIndex"}, function () {
return 2 >= this.ma ? 0 : this.ac || Lm(this) !== Kb ? 1 : 0
});
t.A(A, {tw: "lastPickIndex"}, function () {
var a = this.ma;
return 0 === a ? 0 : 2 >= a ? a - 1 : this.ac || Mm(this) !== Kb ? a - 2 : a - 1
});
function Im(a) {
a = a.De;
return a === Cg || a === Gg
}
function Km(a, b) {
if (b || Im(a)) {
var c = a.h;
null === c || c.Dn.contains(a) || null === a.Sy || c.Dn.add(a, a.Sy)
}
}
function Ig(a, b) {
var c = a.layer;
if (null !== c && c.visible && !c.pc) {
var d = c.h;
if (null !== d)for (var e = !1, d = d.Tm; d.next();) {
var g = d.value;
if (g.visible)if (g === c)for (var e = !0, h = !1, g = g.cb.p, k = g.length, l = 0; l < k; l++) {
var m = g[l];
m instanceof A && (m === a ? h = !0 : h && en(a, m, b))
} else if (e)for (g = g.cb.p, k = g.length, l = 0; l < k; l++)m = g[l], m instanceof A && en(a, m, b)
}
}
}
function en(a, b, c) {
if (null !== b && Im(b) && null !== b.Ra) {
var d = b.nj();
d.Q() && (a.nj().Jf(d) || c.Jf(d)) && (a.usesSamePort(b) || b.Kf())
}
}
A.prototype.usesSamePort = function (a) {
var b = this.ma, c = a.ma;
if (0 < b && 0 < c) {
if (this.n(0).Mi(a.n(0)) || this.n(b - 1).Mi(a.n(c - 1)))return!0
} else if (this.da === a.da || this.ja === a.ja)return!0;
return!1
};
t.g(A, "adjusting", A.prototype.wo);
t.defineProperty(A, {wo: "adjusting"}, function () {
return this.$p
}, function (a) {
var b = this.$p;
b !== a && (f && t.tb(a, A, A, "adjusting"), this.$p = a, this.i("adjusting", b, a))
});
t.g(A, "corner", A.prototype.Tv);
t.defineProperty(A, {Tv: "corner"}, function () {
return this.mq
}, function (a) {
var b = this.mq;
b !== a && (f && t.j(a, "number", A, "corner"), this.mq = a, this.Kf(), this.i("corner", b, a))
});
t.g(A, "curve", A.prototype.De);
t.defineProperty(A, {De: "curve"}, function () {
return this.pq
}, function (a) {
var b = this.pq;
b !== a && (f && t.tb(a, A, A, "curve"), this.pq = a, this.$b(), Km(this, b === Gg || b === Cg || a === Gg || a === Cg), this.i("curve", b, a))
});
t.g(A, "curviness", A.prototype.Cs);
t.defineProperty(A, {Cs: "curviness"}, function () {
return this.qq
}, function (a) {
var b = this.qq;
b !== a && (f && t.j(a, "number", A, "curviness"), this.qq = a, this.$b(), this.i("curviness", b, a))
});
t.g(A, "routing", A.prototype.rt);
t.defineProperty(A, {rt: "routing"}, function () {
return this.hm
}, function (a) {
var b = this.hm;
b !== a && (f && t.tb(a, A, A, "routing"), this.hm = a, this.ei = null, this.$b(), Km(this, 2 === (b.value & 2) || 2 === (a.value & 2)), this.i("routing", b, a))
});
t.g(A, "smoothness", A.prototype.dn);
t.defineProperty(A, {dn: "smoothness"}, function () {
return this.$r
}, function (a) {
var b = this.$r;
b !== a && (f && t.j(a, "number", A, "smoothness"), this.$r = a, this.Kf(), this.i("smoothness", b, a))
});
function Gm(a) {
var b = a.Xf;
if (null !== b) {
var c = a.gg;
if (null !== c) {
var d = a.nh;
a = a.Ah;
var e;
a:{
if (null !== c && null !== b.fh)for (e = b.fh.l; e.next();) {
var g = e.value;
if (g.tp === b && g.gt === c && g.Aw === d && g.Bw === a || g.tp === c && g.gt === b && g.Aw === a && g.Bw === d) {
e = g;
break a
}
}
e = null
}
for (var h = g = null, k = b.dc.p, l = k.length, m = 0; m < l; m++) {
var n = k[m];
if (n.Xf === b && n.nh === d && n.gg === c && n.Ah === a || n.Xf === c && n.nh === a && n.gg === b && n.Ah === d)null === h ? h = n : (null === g && (g = new H(A), g.add(h)), g.add(n))
}
if (null !== g)for (null === e && (e = new qm, e.tp = b, e.Aw =
d, e.gt = c, e.Bw = a, pm(b, e), pm(c, e)), e.links = g, m = 0; m < g.count; m++)if (n = g.p[m], 0 === n.cf) {
b = 1;
for (c = 0; c < g.count; c++)Math.abs(g.p[c].cf) === b && (b++, c = -1);
n.qn = e;
n.cf = n.da === e.tp ? b : -b;
n.$b()
}
}
}
}
function Fm(a) {
var b = a.qn;
if (null !== b) {
var c = a.cf;
a.qn = null;
a.cf = 0;
a.$b();
b.links.remove(a);
if (2 > b.links.count)1 === b.links.count && (c = b.links.p[0], c.qn = null, c.cf = 0, c.$b()), c = b.tp, null !== b && null !== c.fh && c.fh.remove(b), c = b.gt, null !== b && null !== c.fh && c.fh.remove(b); else for (c = Math.abs(c), a = 0 === c % 2, b = b.links.l; b.next();) {
var d = b.value, e = Math.abs(d.cf), g = 0 === e % 2;
e > c && a === g && (d.cf = 0 < d.cf ? d.cf - 2 : d.cf + 2, d.$b())
}
}
}
function qm() {
t.zc(this);
this.links = this.Bw = this.gt = this.Aw = this.tp = null
}
t.je(qm, {tp: !0, Aw: !0, gt: !0, Bw: !0, links: !0, spacing: !0});
function kj() {
t.zc(this);
this.group = null;
this.$o = !0;
this.abort = !1;
this.Df = this.Cf = 1;
this.ir = this.hr = -1;
this.jd = this.ud = 8;
this.bc = null;
this.jG = !1;
this.EF = 22;
this.EE = 111
}
t.je(kj, {group: !0, $o: !0, abort: !0, jG: !0, EF: !0, EE: !0});
var ia = 0, Xm = 1, Ym = 1, ja = 999999999, fn = ja;
kj.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.Cf = Math.floor((a.x - this.ud) / this.ud) * this.ud;
this.Df = Math.floor((b - this.jd) / this.jd) * this.jd;
this.hr = Math.ceil((c + 2 * this.ud) / this.ud) * this.ud;
this.ir = Math.ceil((d + 2 * this.jd) / this.jd) * this.jd;
a = 1 + (Math.ceil((this.hr - this.Cf) / this.ud) | 0);
b = 1 + (Math.ceil((this.ir - this.Df) / this.jd) | 0);
if (null === this.bc || this.rm < a - 1 || this.sm < b - 1) {
c = [];
for (d = 0; d <= a; d++) {
for (var e = [], g = 0; g <= b; g++)e[g] = 0;
c[d] = e
}
this.bc =
c;
this.rm = a - 1;
this.sm = b - 1
}
if (null !== this.bc)for (a = 0; a <= this.rm; a++)for (b = 0; b <= this.sm; b++)this.bc[a][b] = fn
}
};
t.A(kj, {Mb: null}, function () {
return new D(this.Cf, this.Df, this.hr - this.Cf, this.ir - this.Df)
});
t.g(kj, "cellWidth", kj.prototype.Bm);
t.defineProperty(kj, {Bm: null}, function () {
return this.ud
}, function (a) {
0 < a && a !== this.ud && (this.ud = a, this.initialize(this.Mb))
});
t.g(kj, "cellHeight", kj.prototype.Am);
t.defineProperty(kj, {Am: null}, function () {
return this.jd
}, function (a) {
0 < a && a !== this.jd && (this.jd = a, this.initialize(this.Mb))
});
function gn(a, b, c) {
return a.Cf <= b && b <= a.hr && a.Df <= c && c <= a.ir
}
function Vm(a, b, c) {
if (!gn(a, b, c))return 0;
b -= a.Cf;
b /= a.ud;
c -= a.Df;
c /= a.jd;
return a.bc[b | 0][c | 0]
}
function nj(a, b, c) {
gn(a, b, c) && (b -= a.Cf, b /= a.ud, c -= a.Df, c /= a.jd, a.bc[b | 0][c | 0] = ia)
}
function mj(a) {
if (null !== a.bc)for (var b = 0; b <= a.rm; b++)for (var c = 0; c <= a.sm; c++)a.bc[b][c] >= Xm && (a.bc[b][c] |= ja)
}
function Tm(a, b, c, d, e) {
if (b > a.hr || b + d < a.Cf || c > a.ir || c + e < a.Df)return!0;
b = (b - a.Cf) / a.ud | 0;
c = (c - a.Df) / a.jd | 0;
d = Math.max(0, d) / a.ud + 1 | 0;
var g = Math.max(0, e) / a.jd + 1 | 0;
0 > b && (d += b, b = 0);
0 > c && (g += c, c = 0);
if (0 > d || 0 > g)return!0;
e = Math.min(b + d - 1, a.rm) | 0;
for (d = Math.min(c + g - 1, a.sm) | 0; b <= e; b++)for (g = c; g <= d; g++)if (a.bc[b][g] === ia)return!1;
return!0
}
function hn(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.bc[m][n];
if (p >= Xm && p < ja)for (e ? n += d : m += d, p += Ym; g <= m && m <= h && k <= n && n <= l && !(p >= a.bc[m][n]);)a.bc[m][n] = p, p += Ym, e ? n += d : m += d;
m = e ? n : m;
if (e)if (0 < d)for (c += d; c < m; c += d)hn(a, b, c, 1, !e, g, h, k, l), hn(a, b, c, -1, !e, g, h, k, l); else for (c += d; c > m; c += d)hn(a, b, c, 1, !e, g, h, k, l), hn(a, b, c, -1, !e, g, h, k, l); else if (0 < d)for (b += d; b < m; b += d)hn(a, b, c, 1, !e, g, h, k, l), hn(a, b, c, -1, !e, g, h, k, l); else for (b += d; b > m; b += d)hn(a, b, c, 1, !e, g, h, k, l), hn(a, b, c, -1, !e, g, h,
k, l)
}
}
function jn(a, b, c, d, e, g, h, k, l, m, n) {
for (var p = b | 0, q = c | 0, r = a.bc[p][q]; 0 === r && p > k && p < l && q > m && q < n;)if (h ? q += g : p += g, r = a.bc[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.bc[p][q];
b = Xm;
for (a.bc[p][q] = b; 0 === r && p > k && p < l && q > m && q < n;)h ? q += g : p += g, r = a.bc[p][q], a.bc[p][q] = b, b += Ym;
return h ? q : p
}
function Um(a, b, c, d, e, g) {
if (null !== a.bc) {
a.abort = !1;
var h = b.x, k = b.y;
if (gn(a, h, k)) {
var h = h - a.Cf, h = h / a.ud, k = k - a.Df, k = k / a.jd, l = d.x, m = d.y;
if (gn(a, l, m))if (l -= a.Cf, l /= a.ud, m -= a.Df, m /= a.jd, 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.Cf, n = n / a.ud;
b -= a.Df;
b /= a.jd;
d -= a.Cf;
d /= a.ud;
p -= a.Df;
p /= a.jd;
g = Math.max(0, Math.min(a.rm, n | 0));
d = Math.min(a.rm, Math.max(0, d | 0));
b = Math.max(0, Math.min(a.sm, b | 0));
var p = Math.min(a.sm, 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 = jn(a, h, k, l, m, r, c, g, d, b, p) : n = jn(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, v = a.bc[r][s]; 0 === v && r > g && r < d && s > b && s < p;)if (e ? s += c : r += c, v = a.bc[r][s], 1 >= Math.abs(r - h) && 1 >= Math.abs(s - k)) {
a.abort = !0;
break a
}
r = l | 0;
s = m | 0;
v = a.bc[r][s];
for (a.bc[r][s] = fn; 0 === v && r > g && r < d && s > b && s < p;)e ? s += c : r += c, v = a.bc[r][s], a.bc[r][s] = fn
}
a.abort || (hn(a, n, q, 1, !1, g, d, b, p), hn(a, n, q, -1, !1, g, d, b, p), hn(a, n, q, 1, !0, g, d, b, p), hn(a,
n, q, -1, !0, g, d, b, p))
}
}
}
}
}
function Pm() {
t.zc(this);
this.port = this.Ic = null;
this.rg = [];
this.ft = !1
}
t.je(Pm, {Ic: !0, port: !0, rg: !0, ft: !0});
Pm.prototype.toString = function () {
for (var a = this.rg, b = this.Ic.toString() + " " + a.length.toString() + ":", c = 0; c < a.length; c++) {
var d = a[c];
null !== d && (b += "\n " + d.toString())
}
return b
};
function kn(a, b, c, d) {
b = b.offsetY;
switch (b) {
case t.sd:
return 90;
case t.gd:
return 180;
case t.Fd:
return 270;
case t.td:
return 0
}
switch (b) {
case t.sd | t.Fd:
return 180 < c ? 270 : 90;
case t.gd | t.td:
return 90 < c && 270 >= c ? 180 : 0
}
a = 180 * Math.atan2(a.height, a.width) / Math.PI;
switch (b) {
case t.gd | t.Fd:
return c > a && c <= 180 + a ? 180 : 270;
case t.Fd | t.td:
return c > 180 - a && c <= 360 - a ? 270 : 0;
case t.td | t.sd:
return c > a && c <= 180 + a ? 90 : 0;
case t.sd | t.gd:
return c > 180 - a && c <= 360 - a ? 180 : 90;
case t.gd | t.Fd | t.td:
return 90 < c && c <= 180 + a ? 180 : c > 180 + a && c <= 360 -
a ? 270 : 0;
case t.Fd | t.td | t.sd:
return 180 < c && c <= 360 - a ? 270 : c > a && 180 >= c ? 90 : 0;
case t.td | t.sd | t.gd:
return c > a && c <= 180 - a ? 90 : c > 180 - a && 270 >= c ? 180 : 0;
case t.sd | t.gd | t.Fd:
return c > 180 - a && c <= 180 + a ? 180 : c > 180 + a ? 270 : 90
}
d && b !== (t.gd | t.Fd | t.td | t.sd) && (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
}
function Qm(a, b) {
var c = a.rg;
if (0 === c.length) {
if (!a.ft) {
c = a.ft;
a.ft = !0;
var d = a.Ic.Cd, e = a.rg.length = 0, g = a.port.gb(Qb, t.O()), h = a.port.gb(Zb, t.O()), k = t.kk(g.x, g.y, 0, 0);
k.Zi(h);
t.B(g);
t.B(h);
g = t.ic(k.x + k.width / 2, k.y + k.height / 2);
for (d = d.l; d.next();)if (h = d.value, h.zb()) {
var l = Kb, l = h.Rc === a.port ? Lm(h, a.port) : Mm(h, a.port);
if (l.dp()) {
var m;
m = h.Rc === a.port ? h.Ed : h.Rc;
if (null !== m) {
var n = m.U;
if (null !== n) {
m = h.computeOtherPoint(n, m);
var n = g.Ji(m), l = kn(k, l, n, h.ac), p;
0 === l ? (p = t.td, 180 < n && (n -= 360)) : p = 90 === l ? t.sd : 180 ===
l ? t.gd : t.Fd;
(l = a.rg[e]) ? (l.link = h, l.angle = n, l.Ie = p) : (l = new ln(h, n, p), a.rg[e] = l);
l.zw.set(m);
e++
}
}
}
}
t.B(g);
a.rg.sort(Pm.prototype.HI);
g = a.rg.length;
d = -1;
for (e = h = 0; e < g; e++)l = a.rg[e], null !== l && (l.Ie !== d && (d = l.Ie, h = 0), l.Zo = h, h++);
d = -1;
h = 0;
for (e = g - 1; 0 <= e; e--)l = a.rg[e], null !== l && (l.Ie !== d && (d = l.Ie, h = l.Zo + 1), l.Fm = h);
e = a.rg;
for (g = 0; g < e.length; g++)if (d = e[g], null !== d) {
l = d;
m = a.port;
d = t.O();
h = t.O();
switch (l.Ie) {
case t.sd:
m.gb(Zb, d);
m.gb(Vb, h);
break;
case t.gd:
m.gb(Vb, d);
m.gb(Qb, h);
break;
case t.Fd:
m.gb(Qb, d);
m.gb(Tb,
h);
break;
default:
case t.td:
m.gb(Tb, d), m.gb(Zb, h)
}
m = h.y - d.y;
n = (l.Zo + 1) / (l.Fm + 1);
l = l.kp;
l.x = d.x + (h.x - d.x) * n;
l.y = d.y + m * n;
t.B(d);
t.B(h)
}
e = a.rg;
for (g = 0; g < e.length; g++)d = e[g], null !== d && (d.$v = a.computeEndSegmentLength(d));
a.ft = c;
t.Qc(k)
}
c = a.rg
}
for (k = 0; k < c.length; k++)if (e = c[k], null !== e && e.link === b)return e;
return null
}
Pm.prototype.HI = function (a, b) {
return a === b ? 0 : null === a ? -1 : null === b ? 1 : a.Ie < b.Ie ? -1 : a.Ie > b.Ie ? 1 : a.angle < b.angle ? -1 : a.angle > b.angle ? 1 : 0
};
Pm.prototype.computeEndSegmentLength = function (a) {
var b = a.link, c = b.computeEndSegmentLength(this.Ic, this.port, Kb, b.Rc === this.port), d = a.Zo;
if (0 > d)return c;
var e = a.Fm;
if (1 >= e || !b.ac)return c;
var b = a.zw, g = a.kp;
if (a.Ie === t.gd || a.Ie === t.sd)d = e - 1 - d;
return((a = a.Ie === t.gd || a.Ie === t.td) ? 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 ln(a, b, c) {
this.link = a;
this.angle = b;
this.Ie = c;
this.zw = new C;
this.Fm = this.Zo = 0;
this.kp = new C;
this.$v = 0
}
t.je(ln, {link: !0, angle: !0, Ie: !0, zw: !0, Zo: !0, Fm: !0, kp: !0, $v: !0});
ln.prototype.toString = function () {
return this.link.toString() + " " + this.angle.toString() + " " + this.Ie.toString() + ":" + this.Zo.toString() + "/" + this.Fm.toString() + " " + this.kp.toString() + " " + this.$v.toString() + " " + this.zw.toString()
};
function z(a) {
0 === arguments.length ? y.call(this, $g) : y.call(this, a);
this.kr = new ta(w);
this.bm = new ta(z);
this.Pk = this.lr = this.jr = null;
this.ms = !1;
this.Qq = !0;
this.ns = !1;
this.wb = this.cs = null;
this.iq = !1;
this.jq = !0;
this.kq = !1;
this.Ld = new le;
this.Ld.group = this
}
t.ia("Group", z);
t.Oa(z, y);
z.prototype.cloneProtected = function (a) {
y.prototype.cloneProtected.call(this, a);
a.jr = this.jr;
a.lr = this.lr;
a.Pk = this.Pk;
a.ms = this.ms;
a.Qq = this.Qq;
a.ns = this.ns;
a.cs = this.cs;
var b = Bl(a, a, function (a) {
return a instanceof Ug
});
a.wb = b instanceof Ug ? b : null;
a.iq = this.iq;
a.jq = this.jq;
a.kq = this.kq;
null !== this.Ld ? (a.Ld = this.Ld.copy(), a instanceof z && (a.Ld.group = a)) : (null !== a.Ld && (a.Ld.group = null), a.Ld = null)
};
z.prototype.Fh = function (a) {
y.prototype.Fh.call(this, a);
var b = a.Qo();
for (a = a.Hc; a.next();) {
var c = a.value;
c.aa();
c.K(Mh);
c.ze();
c instanceof z && (c.Sw = c.of, mn(c, b));
if (c instanceof y)c.Vg(b); else if (c instanceof A)for (c = c.Si; c.next();)c.value.Vg(b)
}
};
z.prototype.Zm = function (a, b, c, d, e, g, h) {
if (a === Cd && "elements" === b)if (e instanceof Ug)null === this.wb ? this.wb = e : this.wb !== e && t.m("Cannot insert a second Placeholder into the visual tree of a Group."); else {
if (e instanceof B) {
var k = Bl(e, e, function (a) {
return a instanceof Ug
});
k instanceof Ug && (null === this.wb ? this.wb = k : this.wb !== k && t.m("Cannot insert a second Placeholder into the visual tree of a Group."))
}
} else a === Dd && "elements" === b && null !== this.wb && (d === this.wb ? this.wb = null : d instanceof B && this.wb.Ri(d) &&
(this.wb = null));
y.prototype.Zm.call(this, a, b, c, d, e, g, h)
};
z.prototype.Tj = function (a, b, c, d) {
this.Ok = this.wb;
B.prototype.Tj.call(this, a, b, c, d)
};
z.prototype.ml = function () {
if (!y.prototype.ml.call(this))return!1;
for (var a = this.Hc; a.next();) {
var b = a.value;
if (b instanceof y) {
if (b.zb() && Bi(b))return!1
} else if (b instanceof A && b.zb() && Bi(b) && b.da !== this && b.ja !== this)return!1
}
return!0
};
t.A(z, {placeholder: "placeholder"}, function () {
return this.wb
});
t.g(z, "computesBoundsAfterDrag", z.prototype.Jz);
t.defineProperty(z, {Jz: "computesBoundsAfterDrag"}, function () {
return this.iq
}, function (a) {
var b = this.iq;
b !== a && (t.j(a, "boolean", z, "computesBoundsAfterDrag"), this.iq = a, this.i("computesBoundsAfterDrag", b, a))
});
t.g(z, "computesBoundsIncludingLinks", z.prototype.uD);
t.defineProperty(z, {uD: "computesBoundsIncludingLinks"}, function () {
return this.jq
}, function (a) {
t.j(a, "boolean", z, "computesBoundsIncludingLinks");
var b = this.jq;
b !== a && (this.jq = a, this.i("computesBoundsIncludingLinks", b, a))
});
t.g(z, "computesBoundsIncludingLocation", z.prototype.vD);
t.defineProperty(z, {vD: "computesBoundsIncludingLocation"}, function () {
return this.kq
}, function (a) {
t.j(a, "boolean", z, "computesBoundsIncludingLocation");
var b = this.kq;
b !== a && (this.kq = a, this.i("computesBoundsIncludingLocation", b, a))
});
t.A(z, {Hc: "memberParts"}, function () {
return this.kr.l
});
function jm(a, b) {
if (a.kr.add(b)) {
b instanceof z && a.bm.add(b);
var c = a.PE;
if (null !== c) {
var d = !0, e = a.h;
null !== e && (d = e.Xa, e.Xa = !0);
c(a, b);
null !== e && (e.Xa = d)
}
}
c = a.wb;
null === c && (c = a);
c.aa()
}
function im(a, b) {
if (a.kr.remove(b)) {
b instanceof z && a.bm.remove(b);
var c = a.QE;
if (null !== c) {
var d = !0, e = a.h;
null !== e && (d = e.Xa, e.Xa = !0);
c(a, b);
null !== e && (e.Xa = d)
}
}
c = a.wb;
null === c && (c = a);
c.aa()
}
z.prototype.Im = function () {
if (0 < this.kr.count) {
var a = this.h;
if (null === a)return;
for (var b = this.kr.copy().l; b.next();)a.remove(b.value)
}
y.prototype.Im.call(this)
};
z.prototype.Mw = function () {
var a = this.layer;
null !== a && a.Mw(this)
};
t.g(z, "layout", z.prototype.Tb);
t.defineProperty(z, {Tb: "layout"}, function () {
return this.Ld
}, function (a) {
var b = this.Ld;
b !== a && (null !== a && t.k(a, le, z, "layout"), null !== b && (b.h = null, b.group = null), this.Ld = a, null !== a && (a.h = this.h, a.group = this), this.i("layout", b, a))
});
t.g(z, "memberAdded", z.prototype.PE);
t.defineProperty(z, {PE: "memberAdded"}, function () {
return this.jr
}, function (a) {
var b = this.jr;
b !== a && (null !== a && t.j(a, "function", z, "memberAdded"), this.jr = a, this.i("memberAdded", b, a))
});
t.g(z, "memberRemoved", z.prototype.QE);
t.defineProperty(z, {QE: "memberRemoved"}, function () {
return this.lr
}, function (a) {
var b = this.lr;
b !== a && (null !== a && t.j(a, "function", z, "memberRemoved"), this.lr = a, this.i("memberRemoved", b, a))
});
t.g(z, "memberValidation", z.prototype.at);
t.defineProperty(z, {at: "memberValidation"}, function () {
return this.Pk
}, function (a) {
var b = this.Pk;
b !== a && (null !== a && t.j(a, "function", z, "memberValidation"), this.Pk = a, this.i("memberValidation", b, a))
});
z.prototype.canAddMembers = function (a) {
var b = this.h;
if (null === b)return!1;
b = b.Qe;
for (a = Ze(a).l; a.next();)if (!b.isValidMember(this, a.value))return!1;
return!0
};
z.prototype.addMembers = function (a, b) {
var c = this.h;
if (null === c)return!1;
for (var c = c.Qe, d = !0, e = Ze(a).l; e.next();) {
var g = e.value;
!b || c.isValidMember(this, g) ? g.fb = this : d = !1
}
return d
};
t.g(z, "ungroupable", z.prototype.YF);
t.defineProperty(z, {YF: "ungroupable"}, function () {
return this.ms
}, function (a) {
var b = this.ms;
b !== a && (t.j(a, "boolean", z, "ungroupable"), this.ms = a, this.i("ungroupable", b, a))
});
z.prototype.canUngroup = function () {
if (!this.YF)return!1;
var a = this.layer;
if (null !== a && !a.Co)return!1;
a = a.h;
return null === a || a.Co ? !0 : !1
};
z.prototype.findExternalLinksConnected = function () {
var a = this.Qo();
a.add(this);
for (var b = new ta(A), c = a.l; c.next();) {
var d = c.value;
if (d instanceof y)for (d = d.Cd; d.next();) {
var e = d.value;
a.contains(e) || b.add(e)
}
}
return b.l
};
z.prototype.findExternalNodesConnected = function () {
var a = this.Qo();
a.add(this);
for (var b = new ta(y), c = a.l; c.next();) {
var d = c.value;
if (d instanceof y)for (d = d.Cd; d.next();) {
var e = d.value, g = e.da;
a.contains(g) && g !== this || b.add(g);
e = e.ja;
a.contains(e) && e !== this || b.add(e)
}
}
return b.l
};
z.prototype.findSubGraphParts = z.prototype.Qo = function () {
var a = new ta(w);
He(a, this, !0, 0);
a.remove(this);
return a
};
z.prototype.collapseSubGraph = z.prototype.collapseSubGraph = function () {
var a = this.h;
if (null !== a && !a.Sd) {
a.Sd = !0;
var b = this.Qo();
mn(this, b);
a.Sd = !1
}
};
function mn(a, b) {
a.of = !1;
for (var c = a.Hc; c.next();) {
var d = c.value;
d.aa();
d.K(Mh);
d.ze();
d instanceof z && (d.Sw = d.of, mn(d, b));
if (d instanceof y)d.Vg(b); else if (d instanceof A)for (d = d.Si; d.next();)d.value.Vg(b)
}
}
z.prototype.expandSubGraph = z.prototype.expandSubGraph = function () {
var a = this.h;
if (null !== a && !a.Sd) {
a.Sd = !0;
var b = this.Qo();
nn(this, b);
a.Sd = !1
}
};
function nn(a, b) {
a.of = !0;
for (var c = a.Hc; c.next();) {
var d = c.value;
d.aa();
d.K(Lh);
d.updateAdornments();
d instanceof z && d.Sw && nn(d, b);
if (d instanceof y)d.Vg(b); else if (d instanceof A)for (d = d.Si; d.next();)d.value.Vg(b)
}
}
t.g(z, "isSubGraphExpanded", z.prototype.of);
t.defineProperty(z, {of: "isSubGraphExpanded"}, function () {
return this.Qq
}, function (a) {
var b = this.Qq;
if (b !== a) {
t.j(a, "boolean", z, "isSubGraphExpanded");
this.Qq = a;
var c = this.h;
this.i("isSubGraphExpanded", b, a);
b = this.KF;
if (null !== b) {
var d = !0;
null !== c && (d = c.Xa, c.Xa = !0);
b(this);
null !== c && (c.Xa = d)
}
null !== c && c.Aa.qb || (a ? this.expandSubGraph() : this.collapseSubGraph())
}
});
t.g(z, "wasSubGraphExpanded", z.prototype.Sw);
t.defineProperty(z, {Sw: "wasSubGraphExpanded"}, function () {
return this.ns
}, function (a) {
var b = this.ns;
b !== a && (t.j(a, "boolean", z, "wasSubGraphExpanded"), this.ns = a, this.i("wasSubGraphExpanded", b, a))
});
t.g(z, "subGraphExpandedChanged", z.prototype.KF);
t.defineProperty(z, {KF: "subGraphExpandedChanged"}, function () {
return this.cs
}, function (a) {
var b = this.cs;
b !== a && (null !== a && t.j(a, "function", z, "subGraphExpandedChanged"), this.cs = a, this.i("subGraphExpandedChanged", b, a))
});
z.prototype.move = z.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 = t.ic(c, b);
y.prototype.move.call(this, a);
for (a = this.Qo().l; a.next();) {
var e = a.value;
if (!(e instanceof A || e.Hh)) {
var g = e.position;
d.x = g.x + c;
d.y = g.y + b;
y.prototype.move.call(e, d)
}
}
for (a.reset(); a.next();)e = a.value, e instanceof A && (g = e.position, d.x = g.x + c, d.y = g.y + b, e.move(d));
t.B(d)
};
function Ug() {
X.call(this);
this.Le = J.Up;
this.Mr = new D(NaN, NaN, NaN, NaN)
}
t.ia("Placeholder", Ug);
t.Oa(Ug, X);
Ug.prototype.cloneProtected = function (a) {
X.prototype.cloneProtected.call(this, a);
a.Le = this.Le.Z();
a.Mr = this.Mr.copy()
};
Ug.prototype.Uj = function (a) {
if (null === this.background && null === this.Bi)return!1;
var b = this.Ia;
return yb(0, 0, b.width, b.height, a.x, a.y)
};
Ug.prototype.$s = function () {
var a = this.U;
null !== a && (a instanceof z || a instanceof Ue) || t.m("Placeholder is not inside a Group or Adornment.");
if (a instanceof z) {
var b = this.computeBorder(this.Mr), c = this.Lc;
nb(c, b.width || 0, b.height || 0);
Qj(this, 0, 0, c.width, c.height);
for (var c = a.Hc, d = !1; c.next();)if (c.value.zb()) {
d = !0;
break
}
!d || isNaN(b.x) || isNaN(b.y) || (c = new C, c.vt(b, a.We), a.location = new C(c.x, c.y))
} else {
var b = this.Ca, c = this.Lc, a = this.padding, d = a.left + a.right, e = a.top + a.bottom;
if (b.Q())nb(c, b.width + d || 0,
b.height + e || 0), Qj(this, -a.left, -a.top, c.width, c.height); else {
var g = this.U, h = g.Oc, k = h.gb(Qb, t.O()), b = t.kk(k.x, k.y, 0, 0);
b.Zi(h.gb(Zb, k));
b.Zi(h.gb(Tb, k));
b.Zi(h.gb(Vb, k));
g.ji.q(b.x, b.y);
nb(c, b.width + d || 0, b.height + e || 0);
Qj(this, -a.left, -a.top, c.width, c.height);
t.B(k);
t.Qc(b)
}
}
};
Ug.prototype.Tj = function (a, b, c, d) {
var e = this.ya;
e.x = a;
e.y = b;
e.width = c;
e.height = d
};
Ug.prototype.computeBorder = function (a) {
var b = this.U;
if (b instanceof z && b.Jz && this.Mr.Q()) {
var c = b.h;
if (null !== c && (c = c.Ta, c instanceof ef && !c.wq && null !== c.wc && !c.wc.contains(b)))return a.assign(this.Mr), a
}
var c = t.xf(), d = this.computeMemberBounds(c), e = this.padding;
a.q(d.x - e.left, d.y - e.top, d.width + e.left + e.right, d.height + e.top + e.bottom);
t.Qc(c);
b instanceof z && b.vD && b.location.Q() && a.Zi(b.location);
return a
};
Ug.prototype.computeMemberBounds = function (a) {
var b = this.U;
if (!(b instanceof z))return a.q(0, 0, 0, 0), a;
for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = b.Hc; h.next();) {
var k = h.value;
if (k.zb()) {
if (k instanceof A) {
if (!b.uD)continue;
if (Ai(k))continue;
if (k.da === b || k.ja === b)continue
}
k = k.ya;
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.q(c, d, e - c, g - d) : (b = b.location, c = this.padding, a.q(b.x + c.left, b.y + c.top, 0, 0));
return a
};
t.g(Ug, "padding", Ug.prototype.padding);
t.defineProperty(Ug, {padding: "padding"}, function () {
return this.Le
}, function (a) {
"number" === typeof a ? (0 > a && t.ha(a, ">= 0", Ug, "padding"), a = new rb(a)) : (t.k(a, rb, Ug, "padding"), 0 > a.left && t.ha(a.left, ">= 0", Ug, "padding:val.left"), 0 > a.right && t.ha(a.right, ">= 0", Ug, "padding:val.right"), 0 > a.top && t.ha(a.top, ">= 0", Ug, "padding:val.top"), 0 > a.bottom && t.ha(a.bottom, ">= 0", Ug, "padding:val.bottom"));
var b = this.Le;
b.N(a) || (this.Le = a = a.Z(), this.i("padding", b, a))
});
function le() {
0 < arguments.length && t.m("Layout constructor cannot take any arguments.");
t.zc(this);
this.ly = this.ea = null;
this.Lq = this.Nq = !0;
this.Uq = this.Rn = !1;
this.bq = (new C(0, 0)).freeze();
this.vy = !0;
this.Iy = null;
this.Oq = !0
}
t.ia("Layout", le);
le.prototype.cloneProtected = function (a) {
a.Nq = this.Nq;
a.Lq = this.Lq;
this.Lq || (a.Rn = !0);
a.Uq = this.Uq;
a.bq.assign(this.bq);
a.Oq = this.Oq
};
le.prototype.copy = function () {
var a = new this.constructor;
this.cloneProtected(a);
return a
};
le.prototype.toString = function () {
var a = t.Tg(Object.getPrototypeOf(this)), a = a + "(";
null !== this.group && (a += " in " + this.group);
null !== this.h && (a += " for " + this.h);
return a + ")"
};
t.g(le, "diagram", le.prototype.h);
t.defineProperty(le, {h: "diagram"}, function () {
return this.ea
}, function (a) {
this.ea !== a && (null !== a && t.k(a, u, le, "diagram"), this.ea = a)
});
t.g(le, "group", le.prototype.group);
t.defineProperty(le, {group: "group"}, function () {
return this.ly
}, function (a) {
this.ly !== a && (null !== a && t.k(a, z, le, "group"), this.ly = a)
});
t.g(le, "isOngoing", le.prototype.BE);
t.defineProperty(le, {BE: "isOngoing"}, function () {
return this.Nq
}, function (a) {
this.Nq !== a && (t.j(a, "boolean", le, "isOngoing"), this.Nq = a)
});
t.g(le, "isInitial", le.prototype.zE);
t.defineProperty(le, {zE: "isInitial"}, function () {
return this.Lq
}, function (a) {
t.j(a, "boolean", le, "isInitial");
this.Lq = a;
a || (this.Rn = !0)
});
t.g(le, "isValidLayout", le.prototype.pf);
t.defineProperty(le, {pf: "isValidLayout"}, function () {
return this.Rn
}, function (a) {
this.Rn !== a && (t.j(a, "boolean", le, "isValidLayout"), this.Rn = a, a || (a = this.h, null !== a && (a.Rt = !0)))
});
le.prototype.invalidateLayout = le.prototype.K = function () {
if (this.Rn) {
var a = this.h;
null !== a && !a.Aa.qb && (this.BE && a.Yf || this.zE && !a.Yf) && (this.pf = !1, a.Of(!0))
}
};
t.g(le, "isRealtime", le.prototype.mA);
t.defineProperty(le, {mA: "isRealtime"}, function () {
return this.Oq
}, function (a) {
this.Oq !== a && (t.j(a, "boolean", le, "isRealtime"), this.Oq = a)
});
t.g(le, "isViewportSized", le.prototype.Ws);
t.defineProperty(le, {Ws: "isViewportSized"}, function () {
return this.Uq
}, function (a) {
this.Uq !== a && (t.j(a, "boolean", le, "isViewportSized"), (this.Uq = a) && this.K())
});
t.g(le, "isRouting", le.prototype.Vs);
t.defineProperty(le, {Vs: "isRouting"}, function () {
return this.vy
}, function (a) {
this.vy !== a && (t.j(a, "boolean", le, "isRouting"), this.vy = a)
});
t.g(le, "network", le.prototype.network);
t.defineProperty(le, {network: "network"}, function () {
return this.Iy
}, function (a) {
var b = this.Iy;
b !== a && (null !== a && t.k(a, Aa, le, "network"), null !== b && on(b, null), this.Iy = a, null !== a && on(a, this))
});
le.prototype.createNetwork = function () {
var a = new Aa;
on(a, this);
return a
};
le.prototype.makeNetwork = function (a) {
var b = this.createNetwork();
a instanceof u ? (b.ss(a.Xi, !0), b.ss(a.links, !0)) : a instanceof z ? b.ss(a.Hc) : b.ss(a.l);
return b
};
le.prototype.updateParts = function () {
var a = this.h;
if (null === a && null !== this.network)for (var b = this.network.vertexes.l; b.next();) {
var c = b.value.Ic;
if (null !== c && (a = c.h, null !== a))break
}
this.pf = !0;
null !== a && a.rc("Layout");
this.commitLayout();
null !== a && a.Ce("Layout")
};
le.prototype.commitLayout = function () {
};
le.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
var b = new ta(w);
a === this.h ? (pn(this, b, a.Xi, !0, this.yA, !0, !1, !0), pn(this, b, a.rl, !0, this.yA, !0, !1, !0)) : a === this.group ? pn(this, b, a.Hc, !1, this.yA, !0, !1, !0) : b.Me(a.l);
var c = b.count;
if (0 < c) {
a = this.h;
null !== a && a.rc("Layout");
for (var c = Math.ceil(Math.sqrt(c)), d = this.yd.x, e = d, g = this.yd.y, h = 0, k = 0, b = b.l; b.next();) {
var l = b.value;
l.Hf();
var m = l.Ea, n = m.width, m = m.height;
l.moveTo(e, g);
delete l.zC;
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.Ce("Layout")
}
this.pf = !0
};
le.prototype.yA = function (a) {
return!a.location.Q() || a instanceof z && a.zC ? !0 : !1
};
function pn(a, b, c, d, e, g, h, k) {
for (c = c.l; c.next();) {
var l = c.value;
d && !l.ep || e && !e(l) || l.canLayout() && (g && l instanceof y ? l.Hh || (l instanceof z && null === l.Tb ? pn(a, b, l.Hc, !1, e, g, h, k) : b.add(l)) : h && l instanceof A ? b.add(l) : !k || !l.Ud() || l instanceof y || b.add(l))
}
}
t.g(le, "arrangementOrigin", le.prototype.yd);
t.defineProperty(le, {yd: "arrangementOrigin"}, function () {
return this.bq
}, function (a) {
this.bq.N(a) || (t.k(a, C, le, "arrangementOrigin"), this.bq.assign(a), this.K())
});
le.prototype.initialOrigin = le.prototype.hA = function (a) {
var b = this.group;
if (null !== b) {
var c = b.location;
if (isNaN(c.x) || isNaN(c.y))return a;
a = b.placeholder;
null !== a ? (c = a.gb(Qb), c.x += a.padding.left, c.y += a.padding.top) : c = b.position.copy();
return c
}
return a
};
function Aa() {
t.zc(this);
this.Ld = null;
this.clear()
}
t.ia("LayoutNetwork", Aa);
Aa.prototype.clear = function () {
if (this.vertexes)for (var a = this.vertexes.l; a.next();) {
var b = a.value;
b.clear();
b.network = null
}
if (this.edges)for (a = this.edges.l; a.next();)b = a.value, b.clear(), b.network = null;
this.vertexes = new ta(Ba);
this.edges = new ta(Da);
this.BA = new ra(y, Ba);
this.oA = new ra(A, Da)
};
Aa.prototype.toString = function () {
return"LayoutNetwork" + (null !== this.Tb ? "(" + this.Tb.toString() + ")" : "")
};
t.A(Aa, {Tb: "layout"}, function () {
return this.Ld
});
function on(a, b) {
f && null !== b && t.k(b, le, Aa, "setLayout");
a.Ld = b
}
Aa.prototype.createVertex = function () {
return new Ba
};
Aa.prototype.createEdge = function () {
return new Da
};
Aa.prototype.addParts = Aa.prototype.ss = function (a, b) {
if (null !== a) {
void 0 === b && (b = !1);
t.j(b, "boolean", Aa, "addParts:toplevelonly");
for (var c = a.l; c.next();) {
var d = c.value;
if (d instanceof y && (!b || d.ep) && d.canLayout() && !d.Hh)if (d instanceof z && null === d.Tb)this.ss(d.Hc, !1); else if (null === this.Mm(d)) {
var e = this.createVertex();
e.Ic = d;
this.Yk(e)
}
}
for (c.reset(); c.next();)if (d = c.value, d instanceof A && (!b || d.ep) && d.canLayout() && null === this.aw(d)) {
var g = d.da, e = d.ja;
g !== e && (g = this.bw(g), e = this.bw(e), null !== g && null !==
e && this.Um(g, e, d))
}
}
};
Aa.prototype.findGroupVertex = Aa.prototype.bw = function (a) {
if (null === a)return null;
a = fm(a);
if (null === a)return null;
var b = this.Mm(a);
if (null !== b)return b;
a = a.fb;
return null !== a && (b = this.Mm(a), null !== b) ? b : null
};
Aa.prototype.addVertex = Aa.prototype.Yk = function (a) {
if (null !== a) {
f && t.k(a, Ba, Aa, "addVertex:vertex");
this.vertexes.add(a);
var b = a.Ic;
null !== b && this.BA.add(b, a);
a.network = this
}
};
Aa.prototype.addNode = Aa.prototype.vo = function (a) {
if (null === a)return null;
f && t.k(a, y, Aa, "addNode:node");
var b = this.Mm(a);
null === b && (b = this.createVertex(), b.Ic = a, this.Yk(b));
return b
};
Aa.prototype.deleteVertex = Aa.prototype.LD = function (a) {
if (null !== a && (f && t.k(a, Ba, Aa, "deleteVertex:vertex"), qn(this, a))) {
for (var b = a.$e, c = b.count - 1; 0 <= c; c--) {
var d = b.pa(c);
this.Ko(d)
}
b = a.Re;
for (c = b.count - 1; 0 <= c; c--)d = b.pa(c), this.Ko(d)
}
};
function qn(a, b) {
if (null === b)return!1;
var c = a.vertexes.remove(b);
c && (a.BA.remove(b.Ic), b.network = null);
return c
}
Aa.prototype.deleteNode = function (a) {
null !== a && (f && t.k(a, y, Aa, "deleteNode:node"), a = this.Mm(a), null !== a && this.LD(a))
};
Aa.prototype.findVertex = Aa.prototype.Mm = function (a) {
if (null === a)return null;
f && t.k(a, y, Aa, "findVertex:node");
return this.BA.Ba(a)
};
Aa.prototype.addEdge = Aa.prototype.uo = function (a) {
if (null !== a) {
f && t.k(a, Da, Aa, "addEdge:edge");
this.edges.add(a);
var b = a.link;
null !== b && null === this.aw(b) && this.oA.add(b, a);
b = a.toVertex;
null !== b && b.dD(a);
b = a.fromVertex;
null !== b && b.bD(a);
a.network = this
}
};
Aa.prototype.addLink = function (a) {
if (null === a)return null;
f && t.k(a, A, Aa, "addLink:link");
var b = a.da, c = a.ja, d = this.aw(a);
null === d ? (d = this.createEdge(), d.link = a, null !== b && (d.fromVertex = this.vo(b)), null !== c && (d.toVertex = this.vo(c)), this.uo(d)) : (d.fromVertex = null !== b ? this.vo(b) : null, d.toVertex = null !== c ? this.vo(c) : null);
return d
};
Aa.prototype.deleteEdge = Aa.prototype.Ko = function (a) {
if (null !== a) {
f && t.k(a, Da, Aa, "deleteEdge:edge");
var b = a.toVertex;
null !== b && b.KD(a);
b = a.fromVertex;
null !== b && b.JD(a);
rn(this, a)
}
};
function rn(a, b) {
null !== b && a.edges.remove(b) && (a.oA.remove(b.link), b.network = null)
}
Aa.prototype.deleteLink = function (a) {
null !== a && (f && t.k(a, A, Aa, "deleteLink:link"), a = this.aw(a), null !== a && this.Ko(a))
};
Aa.prototype.findEdge = Aa.prototype.aw = function (a) {
if (null === a)return null;
f && t.k(a, A, Aa, "findEdge:link");
return this.oA.Ba(a)
};
Aa.prototype.linkVertexes = Aa.prototype.Um = function (a, b, c) {
if (null === a || null === b)return null;
f && (t.k(a, Ba, Aa, "linkVertexes:fromVertex"), t.k(b, Ba, Aa, "linkVertexes:toVertex"), null !== c && t.k(c, A, Aa, "linkVertexes:link"));
if (a.network === this && b.network === this) {
var d = this.createEdge();
d.link = c;
d.fromVertex = a;
d.toVertex = b;
this.uo(d);
return d
}
return null
};
Aa.prototype.reverseEdge = Aa.prototype.Gw = function (a) {
if (null !== a) {
f && t.k(a, Da, Aa, "reverseEdge:edge");
var b = a.fromVertex, c = a.toVertex;
null !== b && null !== c && (b.JD(a), c.KD(a), a.Gw(), b.dD(a), c.bD(a))
}
};
Aa.prototype.deleteSelfEdges = Aa.prototype.Xv = function () {
for (var a = t.Db(), b = this.edges.l; b.next();) {
var c = b.value;
c.fromVertex === c.toVertex && a.push(c)
}
b = a.length;
for (c = 0; c < b; c++)this.Ko(a[c]);
t.Da(a)
};
Aa.prototype.deleteArtificialVertexes = function () {
for (var a = t.Db(), b = this.vertexes.l; b.next();) {
var c = b.value;
null === c.Ic && a.push(c)
}
c = a.length;
for (b = 0; b < c; b++)this.LD(a[b]);
c = t.Db();
for (b = this.edges.l; b.next();) {
var d = b.value;
null === d.link && c.push(d)
}
d = c.length;
for (b = 0; b < d; b++)this.Ko(c[b]);
t.Da(a);
t.Da(c)
};
function sn(a) {
for (var b = t.Db(), c = a.edges.l; 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.Ko(b[d]);
t.Da(b)
}
Aa.prototype.splitIntoSubNetworks = Aa.prototype.eJ = function () {
this.deleteArtificialVertexes();
sn(this);
this.Xv();
for (var a = new H(Aa), b = !0; b;)for (var b = !1, c = this.vertexes.l; c.next();) {
var d = c.value;
if (0 < d.$e.count || 0 < d.Re.count) {
b = this.Tb.createNetwork();
a.add(b);
tn(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 tn(a, b, c) {
if (null !== c && c.network !== b) {
qn(a, c);
b.Yk(c);
for (var d = c.hc; d.next();) {
var e = d.value;
e.network !== b && (rn(a, e), b.uo(e), tn(a, b, e.fromVertex))
}
for (d = c.Zb; d.next();)e = d.value, e.network !== b && (rn(a, e), b.uo(e), tn(a, b, e.toVertex))
}
}
Aa.prototype.findAllParts = function () {
for (var a = new ta(w), b = this.vertexes.l; b.next();)a.add(b.value.Ic);
for (b = this.edges.l; b.next();)a.add(b.value.link);
return a
};
function Ba() {
t.zc(this);
this.network = null;
this.S = (new D(0, 0, 10, 10)).freeze();
this.P = (new C(5, 5)).freeze();
this.clear()
}
t.ia("LayoutVertex", Ba);
Ba.prototype.clear = function () {
this.md = null;
this.$e = new H(Da);
this.Re = new H(Da)
};
Ba.prototype.toString = function () {
return"LayoutVertex#" + t.oc(this) + (null !== this.Ic ? "(" + this.Ic.toString() + ")" : "")
};
t.g(Ba, "node", Ba.prototype.Ic);
t.defineProperty(Ba, {Ic: "node"}, function () {
return this.md
}, function (a) {
if (this.md !== a) {
f && null !== a && t.k(a, y, Ba, "node");
this.md = a;
a.Hf();
var b = a.ya, c = b.x, d = b.y, e = b.width, b = b.height;
isNaN(c) && (c = 0);
isNaN(d) && (d = 0);
this.S.q(c, d, e, b);
c = a.Ub;
c === a || a instanceof z ? this.P.q(e / 2, b / 2) : (a = c.ya, this.P.q(a.x + a.width / 2, a.y + a.height / 2))
}
});
t.g(Ba, "bounds", Ba.prototype.Mb);
t.defineProperty(Ba, {Mb: "bounds"}, function () {
return this.S
}, function (a) {
this.S.N(a) || (f && t.k(a, D, Ba, "bounds"), this.S.assign(a))
});
t.g(Ba, "focus", Ba.prototype.focus);
t.defineProperty(Ba, {focus: "focus"}, function () {
return this.P
}, function (a) {
this.P.N(a) || (f && t.k(a, C, Ba, "focus"), this.P.assign(a))
});
t.g(Ba, "centerX", Ba.prototype.Fa);
t.defineProperty(Ba, {Fa: "centerX"}, function () {
return this.S.x + this.P.x
}, function (a) {
var b = this.S;
b.x + this.P.x !== a && (f && t.o(a, Ba, "centerX"), b.Va(), b.x = a - this.P.x, b.freeze())
});
t.g(Ba, "centerY", Ba.prototype.Sa);
t.defineProperty(Ba, {Sa: "centerY"}, function () {
return this.S.y + this.P.y
}, function (a) {
var b = this.S;
b.y + this.P.y !== a && (f && t.o(a, Ba, "centerY"), b.Va(), b.y = a - this.P.y, b.freeze())
});
t.g(Ba, "focusX", Ba.prototype.XH);
t.defineProperty(Ba, {XH: "focusX"}, function () {
return this.P.x
}, function (a) {
var b = this.P;
b.x !== a && (b.Va(), b.x = a, b.freeze())
});
t.g(Ba, "focusY", Ba.prototype.YH);
t.defineProperty(Ba, {YH: "focusY"}, function () {
return this.P.y
}, function (a) {
var b = this.P;
b.y !== a && (b.Va(), b.y = a, b.freeze())
});
t.g(Ba, "x", Ba.prototype.x);
t.defineProperty(Ba, {x: "x"}, function () {
return this.S.x
}, function (a) {
var b = this.S;
b.x !== a && (b.Va(), b.x = a, b.freeze())
});
t.g(Ba, "y", Ba.prototype.y);
t.defineProperty(Ba, {y: "y"}, function () {
return this.S.y
}, function (a) {
var b = this.S;
b.y !== a && (b.Va(), b.y = a, b.freeze())
});
t.g(Ba, "width", Ba.prototype.width);
t.defineProperty(Ba, {width: "width"}, function () {
return this.S.width
}, function (a) {
var b = this.S;
b.width !== a && (b.Va(), b.width = a, b.freeze())
});
t.g(Ba, "height", Ba.prototype.height);
t.defineProperty(Ba, {height: "height"}, function () {
return this.S.height
}, function (a) {
var b = this.S;
b.height !== a && (b.Va(), b.height = a, b.freeze())
});
Ba.prototype.commit = function () {
var a = this.Ic;
if (null !== a) {
var b = this.Mb;
a.moveTo(b.x, b.y)
}
};
Ba.prototype.addSourceEdge = Ba.prototype.dD = function (a) {
null !== a && (f && t.k(a, Da, Ba, "addSourceEdge:edge"), this.$e.contains(a) || this.$e.add(a))
};
Ba.prototype.deleteSourceEdge = Ba.prototype.KD = function (a) {
null !== a && (f && t.k(a, Da, Ba, "deleteSourceEdge:edge"), this.$e.remove(a))
};
Ba.prototype.addDestinationEdge = Ba.prototype.bD = function (a) {
null !== a && (f && t.k(a, Da, Ba, "addDestinationEdge:edge"), this.Re.contains(a) || this.Re.add(a))
};
Ba.prototype.deleteDestinationEdge = Ba.prototype.JD = function (a) {
null !== a && (f && t.k(a, Da, Ba, "deleteDestinationEdge:edge"), this.Re.remove(a))
};
t.A(Ba, {dJ: "sourceVertexes"}, function () {
for (var a = new ta(Ba), b = this.hc; b.next();) {
var c = b.value.fromVertex;
null === c || a.contains(c) || a.add(c)
}
return a.l
});
t.A(Ba, {GH: "destinationVertexes"}, function () {
for (var a = new ta(Ba), b = this.Zb; b.next();) {
var c = b.value.toVertex;
null === c || a.contains(c) || a.add(c)
}
return a.l
});
t.A(Ba, {vertexes: "vertexes"}, function () {
for (var a = new ta(Ba), b = this.hc; b.next();) {
var c = b.value, c = c.fromVertex;
null === c || a.contains(c) || a.add(c)
}
for (b = this.Zb; b.next();)c = b.value, c = c.toVertex, null === c || a.contains(c) || a.add(c);
return a.l
});
t.A(Ba, {hc: "sourceEdges"}, function () {
return this.$e.l
});
t.A(Ba, {Zb: "destinationEdges"}, function () {
return this.Re.l
});
t.A(Ba, {edges: "edges"}, function () {
for (var a = new H(Da), b = this.hc; b.next();) {
var c = b.value;
a.add(c)
}
for (b = this.Zb; b.next();)c = b.value, a.add(c);
return a.l
});
t.A(Ba, {UH: "edgesCount"}, function () {
return this.$e.count + this.Re.count
});
var un;
Ba.standardComparer = un = function (a, b) {
f && t.k(a, Ba, Ba, "standardComparer:m");
f && t.k(b, Ba, Ba, "standardComparer:n");
var c = a.md, d = b.md;
return c ? d ? (c = c.text, d = d.text, c < d ? -1 : c > d ? 1 : 0) : 1 : null !== d ? -1 : 0
};
Ba.smartComparer = function (a, b) {
f && t.k(a, Ba, Ba, "smartComparer:m");
f && t.k(b, Ba, Ba, "smartComparer:n");
if (null !== a) {
if (null !== b) {
var c = a.md, d = b.md;
if (null !== c) {
if (null !== d) {
var c = c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e;
for (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 Da() {
t.zc(this);
this.network = null;
this.clear()
}
t.ia("LayoutEdge", Da);
Da.prototype.clear = function () {
this.toVertex = this.fromVertex = this.link = null
};
Da.prototype.toString = function () {
return"LayoutEdge#" + t.oc(this) + (null !== this.link ? "(" + this.link.toString() + ")" : "")
};
Da.prototype.Gw = function () {
var a = this.fromVertex;
this.fromVertex = this.toVertex;
this.toVertex = a
};
Da.prototype.commit = function () {
};
Da.prototype.getOtherVertex = Da.prototype.aI = function (a) {
f && t.k(a, Ba, Da, "getOtherVertex:v");
return this.toVertex === a ? this.fromVertex : this.fromVertex === a ? this.toVertex : null
};
function Gj() {
0 < arguments.length && t.m("GridLayout constructor cannot take any arguments.");
le.call(this);
this.Ws = !0;
this.ps = this.qs = NaN;
this.dj = (new oa(NaN, NaN)).freeze();
this.yh = (new oa(10, 10)).freeze();
this.qe = Rk;
this.hd = Pk;
this.xh = Lk;
this.ih = vn
}
t.ia("GridLayout", Gj);
t.Oa(Gj, le);
Gj.prototype.cloneProtected = function (a) {
le.prototype.cloneProtected.call(this, a);
a.qs = this.qs;
a.ps = this.ps;
a.dj.assign(this.dj);
a.yh.assign(this.yh);
a.qe = this.qe;
a.hd = this.hd;
a.xh = this.xh;
a.ih = this.ih
};
Gj.prototype.doLayout = function (a) {
a || t.m("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
var b = this.h;
null === b && t.m("The diagram for this layout is not set.");
this.yd = this.hA(this.yd);
var c = new ta(w);
a === this.h ? (pn(this, c, a.Xi, !0, null, !0, !0, !0), pn(this, c, a.links, !0, null, !0, !0, !0), pn(this, c, a.rl, !0, null, !0, !0, !0)) : a === this.group ? pn(this, c, a.Hc, !1, null, !0, !0, !0) : c.Me(a.l);
for (a = c.copy().l; a.next();) {
var d = a.value;
if (d instanceof A && (null !== d.da ||
null !== d.ja))c.remove(d); else if (d.Hf(), d instanceof z)for (d = d.Hc; d.next();)c.remove(d.value)
}
c = c.af();
if (0 !== c.length) {
switch (this.sorting) {
case Ok:
c.reverse();
break;
case Lk:
c.sort(this.comparer);
break;
case Mk:
c.sort(this.comparer), c.reverse()
}
d = this.kG;
isNaN(d) && (d = 0);
a = this.rB;
a = isNaN(a) ? Math.max(this.h.nb.width - b.padding.left - b.padding.right, 0) : Math.max(this.rB, 0);
0 >= d && 0 >= a && (d = 1);
var e = this.spacing.width;
isFinite(e) || (e = 0);
var g = this.spacing.height;
isFinite(g) || (g = 0);
b.rc("Layout");
switch (this.alignment) {
case Sk:
var h =
Math.max(this.bl.width, 1);
if (!isFinite(h))for (var k = h = 0; k < c.length; k++)var l = c[k], m = l.Ea, h = Math.max(h, m.width);
var h = Math.max(h + e, 1), n = Math.max(this.bl.height, 1);
if (!isFinite(n))for (k = n = 0; k < c.length; k++)l = c[k], m = l.Ea, n = Math.max(n, m.height);
for (var n = Math.max(n + g, 1), p = this.Oe, q = this.yd.x, r = q, s = this.yd.y, v = 0, x = 0, k = 0; k < c.length; k++) {
var l = c[k], m = l.Ea, E = Math.ceil((m.width + e) / h) * h, F = Math.ceil((m.height + g) / n) * n, G;
switch (p) {
case Qk:
G = Math.abs(r - m.width) + q;
break;
default:
G = r + m.width - q
}
if (0 < d && v > d - 1 || 0 < a &&
0 < v && G > a)v = 0, r = q, s += x, x = 0;
x = Math.max(x, F);
switch (p) {
case Qk:
m = -m.width;
break;
default:
m = 0
}
l.moveTo(r + m, s);
switch (p) {
case Qk:
r -= E;
break;
default:
r += E
}
v++
}
break;
case Rk:
h = Math.max(this.bl.width, 1);
k = x = v = 0;
l = t.O();
for (n = 0; n < c.length; n++)p = c[n], q = p.Ea, r = gm(p, p.Ub, p.We, l), v = Math.max(v, r.x), x = Math.max(x, q.width - r.x), k = Math.max(k, r.y);
s = this.Oe;
switch (s) {
case Qk:
v += e;
break;
default:
x += e
}
var h = isFinite(h) ? Math.max(h + e, 1) : Math.max(v + x, 1), L = v = this.yd.x, x = this.yd.y, m = E = 0, F = Math.max(this.bl.height, 1);
G = k = 0;
for (var N =
!0, V = t.O(), n = 0; n < c.length; n++) {
p = c[n];
q = p.Ea;
r = gm(p, p.Ub, p.We, l);
if (0 < E)switch (s) {
case Qk:
L = Math.floor((L - v - (q.width - r.x)) / h) * h + v;
break;
default:
L = Math.ceil((L - v + r.x) / h) * h + v
} else switch (s) {
case Qk:
m = L + r.x + q.width;
break;
default:
m = L - r.x
}
var T;
switch (s) {
case Qk:
T = -(L + r.x) + v + m;
break;
default:
T = L + q.width - r.x - v - m
}
if (0 < d && E > d - 1 || 0 < a && 0 < E && T > a) {
for (L = 0; L < E && n !== E; L++) {
T = c[n - E + L];
var W = gm(T, T.Ub, T.We, V);
T.moveTo(T.position.x, T.position.y + k - W.y)
}
G += g;
x = N ? x + G : x + (G + k);
E = G = k = 0;
L = v;
N = !1
}
k = Math.max(k, r.y);
G = Math.max(G,
q.height - r.y);
isFinite(F) && (G = Math.max(G, Math.max(q.height, F) - r.y));
N ? p.moveTo(L - r.x, x - r.y) : p.moveTo(L - r.x, x);
switch (s) {
case Qk:
L -= r.x + e;
break;
default:
L += q.width - r.x + e
}
E++
}
for (L = 0; L < E && n !== E; L++)T = c[n - E + L], W = gm(T, T.Ub, T.We, l), T.moveTo(T.position.x, T.position.y + k - W.y);
t.B(l);
t.B(V)
}
b.Ce("Layout");
this.pf = !0
}
};
t.g(Gj, "wrappingWidth", Gj.prototype.rB);
t.defineProperty(Gj, {rB: "wrappingWidth"}, function () {
return this.qs
}, function (a) {
this.qs !== a && (0 < a || isNaN(a)) && (this.qs = a, this.Ws = isNaN(a), this.K())
});
t.g(Gj, "wrappingColumn", Gj.prototype.kG);
t.defineProperty(Gj, {kG: "wrappingColumn"}, function () {
return this.ps
}, function (a) {
this.ps !== a && (0 < a || isNaN(a)) && (this.ps = a, this.K())
});
t.g(Gj, "cellSize", Gj.prototype.bl);
t.defineProperty(Gj, {bl: "cellSize"}, function () {
return this.dj
}, function (a) {
this.dj.N(a) || (this.dj.assign(a), this.K())
});
t.g(Gj, "spacing", Gj.prototype.spacing);
t.defineProperty(Gj, {spacing: "spacing"}, function () {
return this.yh
}, function (a) {
this.yh.N(a) || (this.yh.assign(a), this.K())
});
t.g(Gj, "alignment", Gj.prototype.alignment);
t.defineProperty(Gj, {alignment: "alignment"}, function () {
return this.qe
}, function (a) {
this.qe !== a && (f && t.k(a, la, Gj, "alignment"), a === Rk || a === Sk) && (this.qe = a, this.K())
});
t.g(Gj, "arrangement", Gj.prototype.Oe);
t.defineProperty(Gj, {Oe: "arrangement"}, function () {
return this.hd
}, function (a) {
this.hd !== a && (f && t.k(a, la, Gj, "arrangement"), a === Pk || a === Qk) && (this.hd = a, this.K())
});
t.g(Gj, "sorting", Gj.prototype.sorting);
t.defineProperty(Gj, {sorting: "sorting"}, function () {
return this.xh
}, function (a) {
this.xh !== a && (f && t.k(a, la, Gj, "sorting"), a === Nk || a === Ok || a === Lk || a === Mk) && (this.xh = a, this.K())
});
t.g(Gj, "comparer", Gj.prototype.comparer);
t.defineProperty(Gj, {comparer: "comparer"}, function () {
return this.ih
}, function (a) {
this.ih !== a && (f && t.j(a, "function", Gj, "comparer"), this.ih = a, this.K())
});
var vn;
Gj.standardComparer = vn = function (a, b) {
f && t.k(a, w, Gj, "standardComparer:a");
f && t.k(b, w, Gj, "standardComparer:b");
var c = a.text, d = b.text;
return c < d ? -1 : c > d ? 1 : 0
};
Gj.smartComparer = function (a, b) {
f && t.k(a, w, Gj, "standardComparer:a");
f && t.k(b, w, Gj, "standardComparer:b");
if (null !== a) {
if (null !== b) {
var c = a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e;
for (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 Sk;
Gj.Position = Sk = t.w(Gj, "Position", 0);
var Rk;
Gj.Location = Rk = t.w(Gj, "Location", 1);
var Pk;
Gj.LeftToRight = Pk = t.w(Gj, "LeftToRight", 2);
var Qk;
Gj.RightToLeft = Qk = t.w(Gj, "RightToLeft", 3);
var Nk;
Gj.Forward = Nk = t.w(Gj, "Forward", 4);
var Ok;
Gj.Reverse = Ok = t.w(Gj, "Reverse", 5);
var Lk;
Gj.Ascending = Lk = t.w(Gj, "Ascending", 6);
var Mk;
Gj.Descending = Mk = t.w(Gj, "Descending", 7);
function Tk() {
0 < arguments.length && t.m("CircularLayout constructor cannot take any arguments.");
le.call(this);
this.Zx = this.Fn = this.vd = 0;
this.xq = 360;
this.Yx = el;
this.Dk = 0;
this.ZB = el;
this.$t = this.kg = this.UC = 0;
this.yv = new wn;
this.cu = this.em = 0;
this.EG = 600;
this.Br = NaN;
this.dq = 1;
this.we = 0;
this.xe = 360;
this.hd = el;
this.ra = al;
this.xh = Yk;
this.ih = un;
this.yh = 6;
this.vr = hl
}
t.ia("CircularLayout", Tk);
t.Oa(Tk, le);
Tk.prototype.cloneProtected = function (a) {
le.prototype.cloneProtected.call(this, a);
a.Br = this.Br;
a.dq = this.dq;
a.we = this.we;
a.xe = this.xe;
a.hd = this.hd;
a.ra = this.ra;
a.xh = this.xh;
a.ih = this.ih;
a.yh = this.yh;
a.vr = this.vr
};
Tk.prototype.createNetwork = function () {
var a = new xn;
on(a, this);
return a
};
Tk.prototype.doLayout = function (a) {
a || t.m("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.eb(), a.Fa = 0, a.Sa = 0); else {
var b = new H(yn);
b.Me(a.l);
a = new H(yn);
var c = new H(yn), b = this.sort(b);
a = new H(yn);
var c = new H(yn), d = this.Yx, e = this.ZB, g = this.vd, h = this.Fn, k = this.Zx, l = this.xq, m = this.Dk, n = this.UC, p = this.kg, q = this.$t, d = this.Oe, e = this.ht, g =
this.bF;
if (!isFinite(g) || 0 >= g)g = NaN;
h = this.iD;
if (!isFinite(h) || 0 >= h)h = 1;
k = this.yg;
isFinite(k) || (k = 0);
l = this.Rh;
if (!isFinite(l) || 360 < l || 1 > l)l = 360;
m = this.spacing;
isFinite(m) || (m = NaN);
d === fl && e === gl ? d = el : d === fl && e !== gl && (e = gl, d = this.Oe);
if ((this.direction === Zk || this.direction === $k) && this.sorting !== Yk) {
for (var r = 0; !(r >= b.length); r += 2) {
a.add(b.pa(r));
if (r + 1 >= b.length)break;
c.add(b.pa(r + 1))
}
this.direction === Zk ? (this.Oe === fl && a.reverse(), b = new H(yn), b.Me(a), b.Me(c)) : (this.Oe === fl && c.reverse(), b = new H(yn),
b.Me(c), b.Me(a))
}
for (var s = b.length, v = n = 0, r = 0; r < b.length; r++) {
var p = k + l * v * (this.direction === al ? 1 : -1) / s, x = b.pa(r).diameter;
isNaN(x) && (x = zn(b.pa(r), p));
360 > l && (0 === r || r === b.length - 1) && (x /= 2);
n += x;
v++
}
if (isNaN(g) || d === fl) {
isNaN(m) && (m = 6);
if (d !== el && d !== fl) {
x = -Infinity;
for (r = 0; r < s; r++) {
var q = b.pa(r), E = b.pa(r === s - 1 ? 0 : r + 1);
isNaN(q.diameter) && zn(q, 0);
isNaN(E.diameter) && zn(E, 0);
x = Math.max(x, (q.diameter + E.diameter) / 2)
}
q = x + m;
d === cl ? (p = 2 * Math.PI / s, g = (x + m) / p) : g = An(this, q * (360 <= l ? s : s - 1), h, k * Math.PI / 180, l * Math.PI /
180)
} else g = An(this, n + (360 <= l ? s : s - 1) * (d !== fl ? m : 1.6 * m), h, k * Math.PI / 180, l * Math.PI / 180);
p = g * h
} else if (p = g * h, v = Bn(this, g, p, k * Math.PI / 180, l * Math.PI / 180), isNaN(m)) {
if (d === el || d === fl)m = (v - n) / (360 <= l ? s : s - 1)
} else if (d === el || d === fl)r = (v - n) / (360 <= l ? s : s - 1), r < m ? (g = An(this, n + m * (360 <= l ? s : s - 1), h, k * Math.PI / 180, l * Math.PI / 180), p = g * h) : m = r; else {
x = -Infinity;
for (r = 0; r < s; r++)q = b.pa(r), E = b.pa(r === s - 1 ? 0 : r + 1), isNaN(q.diameter) && zn(q, 0), isNaN(E.diameter) && zn(E, 0), x = Math.max(x, (q.diameter + E.diameter) / 2);
q = x + m;
r = An(this, q * (360 <=
l ? s : s - 1), h, k * Math.PI / 180, l * Math.PI / 180);
r > g ? (g = r, p = g * h) : q = v / (360 <= l ? s : s - 1)
}
this.Yx = d;
this.ZB = e;
this.vd = g;
this.Fn = h;
this.Zx = k;
this.xq = l;
this.Dk = m;
this.UC = n;
this.kg = p;
this.$t = q;
c = [b, a, c];
b = c[0];
a = c[1];
c = c[2];
d = this.Yx;
e = this.vd;
h = this.Zx;
k = this.xq;
l = this.Dk;
m = this.kg;
n = this.$t;
if (this.direction !== Zk && this.direction !== $k || d !== fl)if (this.direction === Zk || this.direction === $k) {
g = 0;
switch (d) {
case dl:
g = 180 * Cn(this, e, m, h, n) / Math.PI;
break;
case el:
n = b = 0;
g = a.eb();
null !== g && (b = zn(g, Math.PI / 2));
g = c.eb();
null !==
g && (n = zn(g, Math.PI / 2));
g = 180 * Cn(this, e, m, h, l + (b + n) / 2) / Math.PI;
break;
case cl:
g = k / b.length
}
if (this.direction === Zk) {
switch (d) {
case dl:
Dn(this, a, h, bl);
break;
case el:
En(this, a, h, bl);
break;
case cl:
Fn(this, a, k / 2, h, bl)
}
switch (d) {
case dl:
Dn(this, c, h + g, al);
break;
case el:
En(this, c, h + g, al);
break;
case cl:
Fn(this, c, k / 2, h + g, al)
}
} else {
switch (d) {
case dl:
Dn(this, c, h, bl);
break;
case el:
En(this, c, h, bl);
break;
case cl:
Fn(this, c, k / 2, h, bl)
}
switch (d) {
case dl:
Dn(this, a, h + g, al);
break;
case el:
En(this, a, h + g, al);
break;
case cl:
Fn(this,
a, k / 2, h + g, al)
}
}
} else switch (d) {
case dl:
Dn(this, b, h, this.direction);
break;
case el:
En(this, b, h, this.direction);
break;
case cl:
Fn(this, b, k, h, this.direction);
break;
case fl:
Gn(this, b, k, h, this.direction)
} else Gn(this, b, k, h - k / 2, al)
}
this.updateParts();
this.network = null;
this.pf = !0
};
function Fn(a, b, c, d, e) {
var g = a.xq, h = a.vd;
a = a.kg;
d = d * Math.PI / 180;
c = c * Math.PI / 180;
for (var k = b.length, l = 0; l < k; l++) {
var m = d + (e === al ? l * c / (360 <= g ? k : k - 1) : -(l * c) / k), n = b.pa(l), p = h * Math.tan(m) / a, p = Math.sqrt((h * h + a * a * p * p) / (1 + p * p));
n.Fa = p * Math.cos(m);
n.Sa = p * Math.sin(m);
n.actualAngle = 180 * m / Math.PI
}
}
function En(a, b, c, d) {
var e = a.vd, g = a.kg, h = a.Dk;
c = c * Math.PI / 180;
for (var k = b.length, l = 0; l < k; l++) {
var m = b.pa(l), n = b.pa(l === k - 1 ? 0 : l + 1), p = g * Math.sin(c);
m.Fa = e * Math.cos(c);
m.Sa = p;
m.actualAngle = 180 * c / Math.PI;
isNaN(m.diameter) && zn(m, 0);
isNaN(n.diameter) && zn(n, 0);
m = Cn(a, e, g, d === al ? c : -c, (m.diameter + n.diameter) / 2 + h);
c += d === al ? m : -m
}
}
function Dn(a, b, c, d) {
var e = a.vd, g = a.kg, h = a.$t;
c = c * Math.PI / 180;
for (var k = b.length, l = 0; l < k; l++) {
var m = b.pa(l);
m.Fa = e * Math.cos(c);
m.Sa = g * Math.sin(c);
m.actualAngle = 180 * c / Math.PI;
m = Cn(a, e, g, d === al ? c : -c, h);
c += d === al ? m : -m
}
}
function Gn(a, b, c, d, e) {
var g = a.cu, g = a.xq;
a.em = 0;
a.yv = new wn;
if (360 > c) {
for (g = d + (e === al ? g : -g); 0 > g;)g += 360;
g %= 360;
180 < g && (g -= 360);
g *= Math.PI / 180;
a.cu = g;
Hn(a, b, c, d, e)
} else In(a, b, c, d, e);
a.yv.commit(b)
}
function In(a, b, c, d, e) {
var g = a.vd, h = a.Dk, k = a.Fn, l = g * Math.cos(d * Math.PI / 180), m = a.kg * Math.sin(d * Math.PI / 180), n = b.af();
if (3 === n.length)n[0].Fa = g, n[0].Sa = 0, n[1].Fa = n[0].Fa - n[0].width / 2 - n[1].width / 2 - h, n[1].y = n[0].y, n[2].Fa = (n[0].Fa + n[1].Fa) / 2, n[2].y = n[0].y - n[2].height - h; else if (4 === n.length)n[0].Fa = g, n[0].Sa = 0, n[2].Fa = -n[0].Fa, n[2].Sa = n[0].Sa, n[1].Fa = 0, n[1].y = Math.min(n[0].y, n[2].y) - n[1].height - h, n[3].Fa = 0, n[3].y = Math.max(n[0].y + n[0].height + h, n[2].y + n[2].height + h); else {
for (g = 0; g < n.length; g++) {
n[g].Fa =
l;
n[g].Sa = m;
if (g >= n.length - 1)break;
var p = Jn(a, l, m, n, g, e);
p[0] || (p = Kn(a, l, m, n, g, e));
l = p[1];
m = p[2]
}
a.em++;
if (!(23 < a.em)) {
var l = n[0].Fa, m = n[0].Sa, g = n[n.length - 1].Fa, p = n[n.length - 1].Sa, 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 === al ? q : !q)h = -Math.abs(h), h = Math.min(h, -n[n.length -
1].width), h = Math.min(h, -n[n.length - 1].height);
l = a.yv;
if (0 < h && 0 > l.Uo || Math.abs(h) < Math.abs(l.Uo) && !(0 > h && 0 < l.Uo))for (l.Uo = h, l.jn = [], l.Op = [], m = 0; m < n.length; m++)l.jn[m] = n[m].Mb.x, l.Op[m] = n[m].Mb.y;
1 < Math.abs(h) && (a.vd = 8 > a.em ? a.vd - h / (2 * Math.PI) : 5 > n.length && 10 < h ? a.vd / 2 : a.vd - (0 < h ? 1.7 : -2.3), a.kg = a.vd * k, In(a, b, c, d, e))
}
}
}
function Hn(a, b, c, d, e) {
for (var g = a.vd, h = a.kg, k = a.Fn, l = g * Math.cos(d * Math.PI / 180), m = h * Math.sin(d * Math.PI / 180), n = b.af(), p = 0; p < n.length; p++) {
n[p].Fa = l;
n[p].Sa = m;
if (p >= n.length - 1)break;
var q = Jn(a, l, m, n, p, e);
q[0] || (q = Kn(a, l, m, n, p, e));
l = q[1];
m = q[2]
}
a.em++;
if (!(23 < a.em)) {
l = Math.atan2(m, l);
l = e === al ? a.cu - l : l - a.cu;
l = Math.abs(l) < Math.abs(l - 2 * Math.PI) ? l : l - 2 * Math.PI;
g = l * (g + h) / 2;
h = a.yv;
if (Math.abs(g) < Math.abs(h.Uo))for (h.Uo = g, h.jn = [], h.Op = [], l = 0; l < n.length; l++)h.jn[l] = n[l].Mb.x, h.Op[l] = n[l].Mb.y;
1 < Math.abs(g) &&
(a.vd = 8 > a.em ? a.vd - g / (2 * Math.PI) : a.vd - (0 < g ? 1.7 : -2.3), a.kg = a.vd * k, Hn(a, b, c, d, e))
}
}
function Jn(a, b, c, d, e, g) {
var h = a.vd, k = a.kg, l = 0, m = 0;
a = (d[e].width + d[e + 1].width) / 2 + a.Dk;
var n = !1;
if (0 <= c !== (g === al)) {
if (l = b + a, l > h) {
l = b - a;
if (l < -h)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
} else if (l = b - a, l < -h) {
l = b + a;
if (l > h)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
m = Math.sqrt(1 - Math.min(1, l * l / (h * h))) * k;
0 > c !== n && (m = -m);
b = Math.abs(c - m) > (d[e].height + d[e + 1].height) / 2 ? [!1] : [!0];
b[1] = l;
b[2] = m;
return b
}
function Kn(a, b, c, d, e, g) {
var h = a.vd, k = a.kg, l = 0, m = 0;
a = (d[e].height + d[e + 1].height) / 2 + a.Dk;
var n = !1;
if (0 <= b !== (g === al)) {
if (m = c - a, m < -k) {
m = c + a;
if (m > k)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
} else if (m = c + a, m > k) {
m = c - a;
if (m < -k)return b = [!1], b[1] = l, b[2] = m, b;
n = !0
}
l = Math.sqrt(1 - Math.min(1, m * m / (k * k))) * h;
0 > b !== n && (l = -l);
b = Math.abs(b - l) > (d[e].width + d[e + 1].width) / 2 ? [!1] : [!0];
b[1] = l;
b[2] = m;
return b
}
function wn() {
this.Uo = -Infinity;
this.Op = this.jn = null
}
wn.prototype.commit = function (a) {
if (null !== this.jn && null !== this.Op)for (var b = 0; b < this.jn.length; b++) {
var c = a.pa(b);
c.x = this.jn[b];
c.y = this.Op[b]
}
};
Tk.prototype.commitLayout = function () {
this.commitNodes();
this.Vs && this.commitLinks()
};
Tk.prototype.commitNodes = function () {
for (var a = this.MG, b = this.network.vertexes.l, c; b.next();)c = b.value, c.x += a.x, c.y += a.y, c.commit()
};
Tk.prototype.commitLinks = function () {
for (var a = this.network.edges.l; a.next();)a.value.commit()
};
function Bn(a, b, c, d, e) {
var g = a.EG;
if (0.001 > Math.abs(a.Fn - 1))return void 0 !== d && void 0 !== e ? e * b : 2 * Math.PI * b;
a = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c;
var h = 0, k;
k = void 0 !== d && void 0 !== e ? e / (g + 1) : Math.PI / (2 * (g + 1));
for (var l = 0; l <= g; l++)var m = Math.sin(void 0 !== d && void 0 !== e ? d + l * e / g : l * Math.PI / (2 * g)), h = h + Math.sqrt(1 - a * a * m * m) * k;
return void 0 !== d && void 0 !== e ? (b > c ? b : c) * h : 4 * (b > c ? b : c) * h
}
function An(a, b, c, d, e) {
a = void 0 !== d && void 0 !== e ? Bn(a, 1, c, d, e) : Bn(a, 1, c);
return b / a
}
function Cn(a, b, c, d, e) {
if (0.001 > Math.abs(a.Fn - 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
}
return 0
}
Tk.prototype.sort = function (a) {
switch (this.sorting) {
case Wk:
break;
case Xk:
a.reverse();
break;
case Uk:
a.sort(this.comparer);
break;
case Vk:
a.sort(this.comparer);
a.reverse();
break;
case Yk:
for (var b = [], c = 0; c < a.length; c++)b.push(0);
for (var d = new H(yn), 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.pa(h).UH;
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.pa(g));
b[g] = -1;
g = a.pa(g);
e = g.hc;
for (g = g.Zb; e.next();)h = e.value, h = h.fromVertex, h = a.indexOf(h), 0 >
h || 0 <= b[h] && b[h]++;
for (; g.next();)h = g.value, h = h.toVertex, h = a.indexOf(h), 0 > h || 0 <= b[h] && b[h]++
}
a = [];
for (b = 0; b < d.length; b++) {
k = d.pa(b);
a[b] = [];
for (var c = k.Zb, e = k.hc, l, m; c.next();)l = c.value, m = d.indexOf(l.toVertex), m !== b && 0 > a[b].indexOf(m) && a[b].push(m);
for (; e.next();)l = e.value, m = d.indexOf(l.fromVertex), m !== b && 0 > a[b].indexOf(m) && a[b].push(m)
}
k = [];
for (b = 0; b < a.length; b++)k[b] = 0;
for (var c = [], n = [], p = [], e = [], g = new H(yn), h = b = 0; b < a.length; b++) {
var q = a[b].length;
if (1 === q)e.push(b); else if (0 === q)g.add(d.pa(b));
else {
if (0 === h)c.push(b); else {
for (var r = Infinity, s = Infinity, v = -1, x = [], q = 0; q < c.length; q++)0 > a[c[q]].indexOf(c[q === c.length - 1 ? 0 : q + 1]) && x.push(q === c.length - 1 ? 0 : q + 1);
if (0 === x.length)for (q = 0; q < c.length; q++)x.push(q);
for (q = 0; q < x.length; q++) {
var E = x[q], F;
m = a[b];
l = n;
F = p;
for (var G = k, L = E, N = c, V = 0, T = 0; T < l.length; T++) {
var W = G[l[T]], ea = G[F[T]], R = 0, xa = 0;
W < ea ? (R = W, xa = ea) : (R = ea, xa = W);
if (R < L && L <= xa)for (W = 0; W < m.length; W++)ea = m[W], 0 > N.indexOf(ea) || R < G[ea] && G[ea] < xa || R === G[ea] || xa === G[ea] || V++; else for (W = 0; W < m.length; W++)ea =
m[W], 0 > N.indexOf(ea) || R < G[ea] && G[ea] < xa && R !== G[ea] && xa !== G[ea] && V++
}
F = V;
for (l = G = 0; l < a[b].length; l++)m = c.indexOf(a[b][l]), 0 <= m && (m = Math.abs(E - (m >= E ? m + 1 : m)), G += m < c.length + 1 - m ? m : c.length + 1 - m);
for (l = 0; l < n.length; l++)m = k[n[l]], L = k[p[l]], m >= E && m++, L >= E && L++, m > L && (N = L, L = m, m = N), L - m < (c.length + 2) / 2 === (m < E && E <= L) && G++;
if (F < r || F === r && G < s)r = F, s = G, v = E
}
c.splice(v, 0, b);
for (q = 0; q < c.length; q++)k[c[q]] = q;
for (q = 0; q < a[b].length; q++)r = a[b][q], 0 <= c.indexOf(r) && (n.push(b), p.push(r))
}
h++
}
}
n = !1;
for (p = c.length; ;) {
n = !0;
for (k =
0; k < e.length; k++)if (b = e[k], q = a[b][0], m = c.indexOf(q), 0 <= m) {
for (h = s = 0; h < a[q].length; h++)r = a[q][h], r = c.indexOf(r), 0 > r || r === m || (v = r > m ? r - m : m - r, s += r < m !== v > p - v ? 1 : -1);
c.splice(0 > s ? m : m + 1, 0, b);
e.splice(k, 1);
k--
} else n = !1;
if (n)break; else c.push(e[0]), e.splice(0, 1)
}
for (b = 0; b < c.length; b++)m = c[b], g.add(d.pa(m));
return g;
default:
t.m("Invalid sorting type.")
}
return a
};
t.g(Tk, "radius", Tk.prototype.bF);
t.defineProperty(Tk, {bF: "radius"}, function () {
return this.Br
}, function (a) {
this.Br !== a && (0 < a || isNaN(a)) && (this.Br = a, this.K())
});
t.g(Tk, "aspectRatio", Tk.prototype.iD);
t.defineProperty(Tk, {iD: "aspectRatio"}, function () {
return this.dq
}, function (a) {
this.dq !== a && 0 < a && (this.dq = a, this.K())
});
t.g(Tk, "startAngle", Tk.prototype.yg);
t.defineProperty(Tk, {yg: "startAngle"}, function () {
return this.we
}, function (a) {
this.we !== a && (this.we = a, this.K())
});
t.g(Tk, "sweepAngle", Tk.prototype.Rh);
t.defineProperty(Tk, {Rh: "sweepAngle"}, function () {
return this.xe
}, function (a) {
this.xe !== a && (this.xe = 0 < a && 360 >= a ? a : 360, this.K())
});
t.g(Tk, "arrangement", Tk.prototype.Oe);
t.defineProperty(Tk, {Oe: "arrangement"}, function () {
return this.hd
}, function (a) {
this.hd !== a && (f && t.k(a, la, Tk, "arrangement"), a === fl || a === el || a === dl || a === cl) && (this.hd = a, this.K())
});
t.g(Tk, "direction", Tk.prototype.direction);
t.defineProperty(Tk, {direction: "direction"}, function () {
return this.ra
}, function (a) {
this.ra !== a && (f && t.k(a, la, Tk, "direction"), a === al || a === bl || a === Zk || a === $k) && (this.ra = a, this.K())
});
t.g(Tk, "sorting", Tk.prototype.sorting);
t.defineProperty(Tk, {sorting: "sorting"}, function () {
return this.xh
}, function (a) {
this.xh !== a && (f && t.k(a, la, Tk, "sorting"), a === Wk || a === Xk || a === Uk || Vk || a === Yk) && (this.xh = a, this.K())
});
t.g(Tk, "comparer", Tk.prototype.comparer);
t.defineProperty(Tk, {comparer: "comparer"}, function () {
return this.ih
}, function (a) {
this.ih !== a && (f && t.j(a, "function", Tk, "comparer"), this.ih = a, this.K())
});
t.g(Tk, "spacing", Tk.prototype.spacing);
t.defineProperty(Tk, {spacing: "spacing"}, function () {
return this.yh
}, function (a) {
this.yh !== a && (this.yh = a, this.K())
});
t.g(Tk, "nodeDiameterFormula", Tk.prototype.ht);
t.defineProperty(Tk, {ht: "nodeDiameterFormula"}, function () {
return this.vr
}, function (a) {
this.vr !== a && (f && t.k(a, la, Tk, "nodeDiameterFormula"), a === hl || a === gl) && (this.vr = a, this.K())
});
t.A(Tk, {NG: "actualXRadius"}, function () {
return this.vd
});
t.A(Tk, {OG: "actualYRadius"}, function () {
return this.kg
});
t.A(Tk, {oJ: "actualSpacing"}, function () {
return this.Dk
});
t.A(Tk, {MG: "actualCenter"}, function () {
return isNaN(this.yd.x) || isNaN(this.yd.y) ? new C(0, 0) : new C(this.yd.x + this.NG, this.yd.y + this.OG)
});
var el;
Tk.ConstantSpacing = el = t.w(Tk, "ConstantSpacing", 0);
var dl;
Tk.ConstantDistance = dl = t.w(Tk, "ConstantDistance", 1);
var cl;
Tk.ConstantAngle = cl = t.w(Tk, "ConstantAngle", 2);
var fl;
Tk.Packed = fl = t.w(Tk, "Packed", 3);
var al;
Tk.Clockwise = al = t.w(Tk, "Clockwise", 4);
var bl;
Tk.Counterclockwise = bl = t.w(Tk, "Counterclockwise", 5);
var Zk;
Tk.BidirectionalLeft = Zk = t.w(Tk, "BidirectionalLeft", 6);
var $k;
Tk.BidirectionalRight = $k = t.w(Tk, "BidirectionalRight", 7);
var Wk;
Tk.Forwards = Wk = t.w(Tk, "Forwards", 8);
var Xk;
Tk.Reverse = Xk = t.w(Tk, "Reverse", 9);
var Uk;
Tk.Ascending = Uk = t.w(Tk, "Ascending", 10);
var Vk;
Tk.Descending = Vk = t.w(Tk, "Descending", 11);
var Yk;
Tk.Optimized = Yk = t.w(Tk, "Optimized", 12);
var hl;
Tk.Pythagorean = hl = t.w(Tk, "Pythagorean", 13);
var gl;
Tk.Circular = gl = t.w(Tk, "Circular", 14);
function xn() {
Aa.call(this)
}
t.ia("CircularNetwork", xn);
t.Oa(xn, Aa);
xn.prototype.createVertex = function () {
return new yn
};
xn.prototype.createEdge = function () {
return new Ln
};
function yn() {
Ba.call(this);
this.actualAngle = this.diameter = NaN
}
t.ia("CircularVertex", yn);
t.Oa(yn, Ba);
function zn(a, b) {
var c = a.network;
if (null === c)return NaN;
c = c.Tb;
if (null === c)return NaN;
if (c.Oe === fl)if (c.ht === gl)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.ht === gl ? Math.max(a.width, a.height) : Math.sqrt(a.width * a.width + a.height * a.height);
return a.diameter
}
function Ln() {
Da.call(this)
}
t.ia("CircularEdge", Ln);
t.Oa(Ln, Da);
function Mn() {
0 < arguments.length && t.m("ForceDirectedLayout constructor cannot take any arguments.");
le.call(this);
this.jg = null;
this.Vq = 0;
this.Sf = (new oa(100, 100)).freeze();
this.cq = !1;
this.wh = !0;
this.hh = !1;
this.$n = 100;
this.zq = 1;
this.oh = 1E3;
this.zn = 0.05;
this.yn = 50;
this.vn = 150;
this.xn = 0;
this.tq = 10;
this.sq = 5
}
t.ia("ForceDirectedLayout", Mn);
t.Oa(Mn, le);
Mn.prototype.cloneProtected = function (a) {
le.prototype.cloneProtected.call(this, a);
a.Sf.assign(this.Sf);
a.cq = this.cq;
a.wh = this.wh;
a.hh = this.hh;
a.$n = this.$n;
a.zq = this.zq;
a.oh = this.oh;
a.zn = this.zn;
a.yn = this.yn;
a.vn = this.vn;
a.xn = this.xn;
a.tq = this.tq;
a.sq = this.sq
};
Mn.prototype.createNetwork = function () {
var a = new Nn;
on(a, this);
return a
};
Mn.prototype.doLayout = function (a) {
a || t.m("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.xw;
if (0 < this.network.vertexes.count) {
this.network.Xv();
for (var b = this.network.vertexes.l; b.next();) {
var c = b.value;
c.charge = this.electricalCharge(c);
c.mass = this.gravitationalMass(c)
}
for (b = this.network.edges.l; b.next();)c = b.value, c.stiffness = this.springStiffness(c), c.length = this.springLength(c);
this.Bz();
this.Vq = 0;
if (this.needsClusterLayout()) {
for (var b = this.network, d = b.eJ().l; d.next();) {
var e = d.value;
this.network = e;
for (c = this.network.vertexes.l; c.next();) {
for (var e = c.value, g = 0, h = e.vertexes; h.next();)g++;
e.Mf = g;
e.hk = 1;
e.Dm = null;
e.$g = null
}
On(this, 0, a)
}
this.network = b;
d.reset();
f && t.k(b, Nn, Mn, "arrangeConnectedGraphs:singletons");
for (var c = this.Hv, k = d.count, l = !0, g = e = 0, h = t.Db(), m = 0; m < k + b.vertexes.count + 2; m++)h[m] = null;
k = 0;
d.reset();
for (m = t.xf(); d.next();) {
var n = d.value;
this.kf(n, m);
if (l)l = !1,
e = m.x + m.width / 2, g = m.y + m.height / 2, h[0] = new C(m.x + m.width + c.width, m.y), h[1] = new C(m.x, m.y + m.height + c.height), k = 2; else {
var p = Pn(h, k, e, g, m.width, m.height, c), q = h[p], r = new C(q.x + m.width + c.width, q.y), s = new C(q.x, q.y + m.height + c.height);
p + 1 < k && h.splice(p + 1, 0, null);
h[p] = r;
h[p + 1] = s;
k++;
p = q.x - m.x;
q = q.y - m.y;
for (n = n.vertexes.l; n.next();) {
var v = n.value;
v.Fa += p;
v.Sa += q
}
}
}
t.Qc(m);
for (n = b.vertexes.l; n.next();)v = n.value, l = v.S, 2 > k ? (e = l.x + l.width / 2, g = l.y + l.height / 2, h[0] = new C(l.x + l.width + c.width, l.y), h[1] = new C(l.x, l.y +
l.height + c.height), k = 2) : (p = Pn(h, k, e, g, l.width, l.height, c), q = h[p], r = new C(q.x + l.width + c.width, q.y), s = new C(q.x, q.y + l.height + c.height), p + 1 < k && h.splice(p + 1, 0, null), h[p] = r, h[p + 1] = s, k++, v.Fa = q.x + v.width / 2, v.Sa = q.y + v.height / 2);
t.Da(h);
for (d.reset(); d.next();) {
e = d.value;
for (g = e.vertexes.l; g.next();)c = g.value, b.Yk(c);
for (e = e.edges.l; e.next();)c = e.value, b.uo(c)
}
}
Qn(this, a);
this.updateParts()
}
this.$n = a;
this.network = null;
this.pf = !0
};
Mn.prototype.needsClusterLayout = function () {
if (3 > this.network.vertexes.count)return!1;
var a = 0, b = 0, c = this.network.vertexes.l;
c.next();
for (var d = c.value.S; c.next();) {
if (c.value.S.Jf(d) && (a++, 1 < a))return!0;
if (10 < b)break;
b++
}
return!1
};
Mn.prototype.kf = function (a, b) {
for (var c = !0, d = a.vertexes.l; d.next();) {
var e = d.value;
c ? (c = !1, b.set(e.S)) : b.mk(e.S)
}
return b
};
function Rn(a, b, c) {
f && (t.o(b, Mn, "computeClusterLayoutIterations:level"), t.o(c, Mn, "computeClusterLayoutIterations:maxiter"));
return Math.max(Math.min(a.network.vertexes.count, c * (b + 1) / 11), 10)
}
function On(a, b, c) {
f && (t.o(b, Mn, "layoutClusters:level"), t.o(c, Mn, "layoutClusters:maxiter"));
if (Sn(a, b)) {
var d = a.oh;
a.oh *= 1 + 1 / (b + 1);
var e = Tn(a, b), g = Math.max(0, Rn(a, b, c));
a.xw += g;
On(a, b + 1, c);
Qn(a, g);
Un(a, e, b);
c = a.jg;
null === c ? c = new H(Vn) : c.clear();
c.Me(e.vertexes);
c.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : b.Mf - a.Mf
});
for (e = c.l; e.next();)Wn(a, e.value, b);
a.oh = d
}
}
function Sn(a, b) {
f && t.o(b, Mn, "hasClusters:level");
if (10 < b || 3 > a.network.vertexes.count)return!1;
null === a.jg ? a.jg = new H(Vn) : a.jg.clear();
a.jg.Me(a.network.vertexes);
var c = a.jg;
c.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : b.Mf - a.Mf
});
for (var d = c.count - 1; 0 <= d && 1 >= c.p[d].Mf;)d--;
return 1 < c.count - d
}
function Tn(a, b) {
f && t.o(b, Mn, "pushSubNetwork:level");
for (var c = a.network, d = new Nn, e = a.jg.l; e.next();) {
var g = e.value;
if (1 < g.Mf) {
d.Yk(g);
var h = {wB: g.Mf, yB: g.width, vB: g.height, lG: g.P.x, mG: g.P.y};
null === g.$g && (g.$g = new H);
g.$g.add(h);
g.UA = g.$g.count - 1
} else break
}
for (var k = c.edges.l; k.next();) {
var l = k.value;
if (l.fromVertex.network === d && l.toVertex.network === d)d.uo(l); else if (l.fromVertex.network === d) {
var m = l.fromVertex.Dm;
null === m && (m = new H(Vn), l.fromVertex.Dm = m);
m.add(l.toVertex);
l.fromVertex.Mf--;
l.fromVertex.hk +=
l.toVertex.hk
} else l.toVertex.network === d && (m = l.toVertex.Dm, null === m && (m = new H(Vn), l.toVertex.Dm = m), m.add(l.fromVertex), l.toVertex.Mf--, l.toVertex.hk += l.fromVertex.hk)
}
for (k = d.edges.l; k.next();)l = k.value, l.length *= Math.max(1, J.sqrt((l.fromVertex.hk + l.toVertex.hk) / (4 * b + 1)));
for (e = d.vertexes.l; e.next();)if (g = e.value, m = g.Dm, null !== m && 0 < m.count && (h = g.$g.p[g.$g.count - 1], h = h.wB - g.Mf, !(0 >= h))) {
for (var n = 0, p = 0, q = m.count - h; q < m.count; q++) {
for (var r = m.p[q], l = null, k = r.edges.l; k.next();) {
var s = k.value;
if (s.aI(r) ===
g) {
l = s;
break
}
}
null !== l && (p += l.length, n += r.width * r.height)
}
m = g.Fa;
k = g.Sa;
l = g.width;
q = g.height;
r = g.P;
s = l * q;
1 > s && (s = 1);
n = J.sqrt((n + s + p * p * 4 / (h * h)) / s);
h = (n - 1) * l / 2;
n = (n - 1) * q / 2;
g.Mb = new D(m - r.x - h, k - r.y - n, l + 2 * h, q + 2 * n);
g.focus = new C(r.x + h, r.y + n)
}
a.network = d;
return c
}
function Un(a, b, c) {
f && (t.k(b, Nn, Mn, "popNetwork:oldnet"), t.o(c, Mn, "popNetwork:level"));
for (c = a.network.vertexes.l; c.next();) {
var d = c.value;
d.network = b;
if (null !== d.$g) {
var e = d.$g.p[d.UA];
d.Mf = e.wB;
var g = e.lG, h = e.mG;
d.Mb = new D(d.Fa - g, d.Sa - h, e.yB, e.vB);
d.focus = new C(g, h);
d.UA--
}
}
for (c = a.network.edges.l; c.next();)c.value.network = b;
a.network = b
}
function Wn(a, b, c) {
f && (t.k(b, Vn, Mn, "surroundNode:oldnet"), t.o(c, Mn, "surroundNode:level"));
var d = b.Dm;
if (null !== d && 0 !== d.count) {
c = b.Fa;
var e = b.Sa, g = b.width, h = b.height;
null !== b.$g && 0 < b.$g.count && (h = b.$g.p[0], g = h.yB, h = h.vB);
for (var g = J.sqrt(g * g + h * h) / 2, k = !1, l = h = 0, m = 0, n = b.vertexes.l; n.next();) {
var p = n.value;
1 >= p.Mf ? l++ : (k = !0, m++, h += Math.atan2(b.Sa - p.Sa, b.Fa - p.Fa))
}
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, n = d.l; n.next();)if (p = n.value, !(1 < p.Mf || a.isFixed(p))) {
d = null;
for (l = p.edges.l; l.next();) {
d = l.value;
break
}
var l = p.width, q = p.height, l = J.sqrt(l * l + q * q) / 2, d = g + d.length + l, l = h + (b * (k / 2 >> 1) + m) * (0 == k % 2 ? 1 : -1);
p.Fa = c + d * Math.cos(l);
p.Sa = e + d * Math.sin(l);
k++
}
}
}
function Pn(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
}
Mn.prototype.Bz = function () {
if (this.comments)for (var a = this.network.vertexes.l; a.next();)this.addComments(a.value)
};
Mn.prototype.addComments = function (a) {
var b = a.Ic;
if (null !== b)for (b = b.WD(); b.next();) {
var c = b.value;
if ("Comment" === c.Pc && c.zb()) {
var d = this.network.Mm(c);
null === d && (d = this.network.vo(c));
d.charge = this.CD;
for (var c = null, e = d.Zb; e.next();)if (e.value.toVertex === a) {
c = e.value;
break
}
if (null === c)for (e = d.hc; e.next();)if (e.value.fromVertex === a) {
c = e.value;
break
}
null === c && (c = this.network.Um(a, d, null));
c.length = this.DD
}
}
};
function Xn(a, b) {
f && (t.k(a, Vn, Mn, "getNodeDistance:vertexA"), t.k(b, Vn, Mn, "getNodeDistance:vertexB"));
var c = a.S, d = c.x, e = c.y, g = c.width, c = c.height, h = b.S, 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, J.sqrt(d * d + e * e)) : e + c < l ? (d = d + g - k, e = e + c - l, J.sqrt(d * d + e * e)) : k - (d + g) : d > k + m ? e > l + h ? (d = d - k - m, e = e - l - h, J.sqrt(d * d + e * e)) : e + c < l ? (d = d - k - m, e = e + c - l, J.sqrt(d * d + e * e)) : d - (k + m) : e > l + h ? e - (l + h) : e + c < l ? l - (e + c) : 0.1
}
function Qn(a, b) {
f && t.o(b, Mn, "performIterations:num");
a.jg = null;
for (var c = a.Vq + b; a.Vq < c && (a.Vq++, Yn(a)););
a.jg = null
}
function Yn(a) {
null === a.jg && (a.jg = new H(Vn), a.jg.Me(a.network.vertexes));
var b = a.jg.p;
if (0 >= b.length)return!1;
var c = b[0];
c.forceX = 0;
c.forceY = 0;
for (var d = c.Fa, e = d, g = c.Sa, h = g, c = 1; c < b.length; c++) {
var k = b[c];
k.forceX = 0;
k.forceY = 0;
var l = k.Fa, k = k.Sa, 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.Fa - b.Fa
}) : b.sort(function (a, b) {
return null === a || null === b || a === b ? 0 : a.Sa - b.Sa
});
for (var h = a.oh, m = 0, n = 0, p = 0, c = 0; c < b.length; c++) {
var k =
b[c], l = k.S, q = k.P, 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 n = e.S, r = e.P, p = n.x + r.x, r = n.y + r.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 = Xn(k, e);
1 > s ? (d > p ? (n = Math.abs(e.S.right - k.S.x), n = (1 + n) * Math.random()) : d < p ? (n = Math.abs(e.S.x - k.S.right), n = -(1 + n) * Math.random()) : (n = Math.max(e.width,
k.width), n = (1 + n) * Math.random() - n / 2), l > r ? (p = Math.abs(e.S.bottom - k.S.y), p = (1 + p) * Math.random()) : d < p ? (p = Math.abs(e.S.y - k.S.bottom), p = -(1 + p) * Math.random()) : (p = Math.max(e.height, k.height), p = (1 + p) * Math.random() - 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.l; c.next();)g = c.value, k = g.fromVertex, e = g.toVertex, l = k.S, q = k.P, d = l.x + q.x, l = l.y + q.y, n = e.S, r = e.P, p = n.x + r.x, r = n.y + r.y, s = Xn(k, e), 1 > s ? (n = (d > p ? 1 : -1) * (1 + (e.width > k.width) ? e.width :
k.width) * Math.random(), p = (l > r ? 1 : -1) * (1 + (e.height > k.height) ? e.height : k.height) * Math.random()) : (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.oh / 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.Fa += g, k.Sa += h, c = Math.max(c, g * g + h * h));
return c > a.Uz * a.Uz
}
Mn.prototype.moveFixedVertex = function () {
};
Mn.prototype.commitLayout = function () {
this.bB();
this.commitNodes();
this.Vs && this.commitLinks()
};
Mn.prototype.bB = function () {
if (this.vl)for (var a = this.network.edges.l; a.next();) {
var b = a.value.link;
null !== b && (b.lb = Pb, b.mb = Pb)
}
};
Mn.prototype.commitNodes = function () {
var a = 0, b = 0;
if (this.gD) {
var c = t.xf();
this.kf(this.network, c);
b = this.yd;
a = b.x - c.x;
b = b.y - c.y;
t.Qc(c)
}
for (var c = t.xf(), d = this.network.vertexes.l; d.next();) {
var e = d.value;
if (0 !== a || 0 !== b)c.assign(e.S), c.x += a, c.y += b, e.Mb = c;
e.commit()
}
t.Qc(c)
};
Mn.prototype.commitLinks = function () {
for (var a = this.network.edges.l; a.next();)a.value.commit()
};
Mn.prototype.springStiffness = function (a) {
a = a.stiffness;
return isNaN(a) ? this.zn : a
};
Mn.prototype.springLength = function (a) {
a = a.length;
return isNaN(a) ? this.yn : a
};
Mn.prototype.electricalCharge = function (a) {
a = a.charge;
return isNaN(a) ? this.vn : a
};
Mn.prototype.electricalFieldX = function () {
return 0
};
Mn.prototype.electricalFieldY = function () {
return 0
};
Mn.prototype.gravitationalMass = function (a) {
a = a.mass;
return isNaN(a) ? this.xn : a
};
Mn.prototype.gravitationalFieldX = function () {
return 0
};
Mn.prototype.gravitationalFieldY = function () {
return 0
};
Mn.prototype.isFixed = function (a) {
return a.isFixed
};
t.A(Mn, {pJ: "currentIteration"}, function () {
return this.Vq
});
t.g(Mn, "arrangementSpacing", Mn.prototype.Hv);
t.defineProperty(Mn, {Hv: "arrangementSpacing"}, function () {
return this.Sf
}, function (a) {
this.Sf.N(a) || (this.Sf.assign(a), this.K())
});
t.g(Mn, "arrangesToOrigin", Mn.prototype.gD);
t.defineProperty(Mn, {gD: "arrangesToOrigin"}, function () {
return this.cq
}, function (a) {
this.cq !== a && (this.cq = a, this.K())
});
t.g(Mn, "setsPortSpots", Mn.prototype.vl);
t.defineProperty(Mn, {vl: "setsPortSpots"}, function () {
return this.wh
}, function (a) {
this.wh !== a && (this.wh = a, this.K())
});
t.g(Mn, "comments", Mn.prototype.comments);
t.defineProperty(Mn, {comments: "comments"}, function () {
return this.hh
}, function (a) {
this.hh !== a && (this.hh = a, this.K())
});
t.g(Mn, "maxIterations", Mn.prototype.xw);
t.defineProperty(Mn, {xw: "maxIterations"}, function () {
return this.$n
}, function (a) {
this.$n !== a && 0 <= a && (this.$n = a, this.K())
});
t.g(Mn, "epsilonDistance", Mn.prototype.Uz);
t.defineProperty(Mn, {Uz: "epsilonDistance"}, function () {
return this.zq
}, function (a) {
this.zq !== a && 0 < a && (this.zq = a, this.K())
});
t.g(Mn, "infinityDistance", Mn.prototype.iI);
t.defineProperty(Mn, {iI: "infinityDistance"}, function () {
return this.oh
}, function (a) {
this.oh !== a && 1 < a && (this.oh = a, this.K())
});
t.g(Mn, "defaultSpringStiffness", Mn.prototype.FH);
t.defineProperty(Mn, {FH: "defaultSpringStiffness"}, function () {
return this.zn
}, function (a) {
this.zn !== a && (this.zn = a, this.K())
});
t.g(Mn, "defaultSpringLength", Mn.prototype.EH);
t.defineProperty(Mn, {EH: "defaultSpringLength"}, function () {
return this.yn
}, function (a) {
this.yn !== a && (this.yn = a, this.K())
});
t.g(Mn, "defaultElectricalCharge", Mn.prototype.yH);
t.defineProperty(Mn, {yH: "defaultElectricalCharge"}, function () {
return this.vn
}, function (a) {
this.vn !== a && (this.vn = a, this.K())
});
t.g(Mn, "defaultGravitationalMass", Mn.prototype.zH);
t.defineProperty(Mn, {zH: "defaultGravitationalMass"}, function () {
return this.xn
}, function (a) {
this.xn !== a && (this.xn = a, this.K())
});
t.g(Mn, "defaultCommentSpringLength", Mn.prototype.DD);
t.defineProperty(Mn, {DD: "defaultCommentSpringLength"}, function () {
return this.tq
}, function (a) {
this.tq !== a && (this.tq = a, this.K())
});
t.g(Mn, "defaultCommentElectricalCharge", Mn.prototype.CD);
t.defineProperty(Mn, {CD: "defaultCommentElectricalCharge"}, function () {
return this.sq
}, function (a) {
this.sq !== a && (this.sq = a, this.K())
});
function Nn() {
Aa.call(this)
}
t.ia("ForceDirectedNetwork", Nn);
t.Oa(Nn, Aa);
Nn.prototype.createVertex = function () {
return new Vn
};
Nn.prototype.createEdge = function () {
return new Zn
};
function Vn() {
Ba.call(this);
this.isFixed = !1;
this.mass = this.charge = NaN;
this.hk = this.Mf = this.forceY = this.forceX = 0;
this.$g = this.Dm = null;
this.UA = 0
}
t.ia("ForceDirectedVertex", Vn);
t.Oa(Vn, Ba);
function Zn() {
Da.call(this);
this.length = this.stiffness = NaN
}
t.ia("ForceDirectedEdge", Zn);
t.Oa(Zn, Da);
function Kk() {
0 < arguments.length && t.m("LayeredDigraphLayout constructor cannot take any arguments.");
le.call(this);
this.Gd = this.Wn = 25;
this.ra = 0;
this.un = $n;
this.Xn = ao;
this.Nn = bo;
this.Wl = 4;
this.nn = co;
this.qi = eo;
this.wh = !0;
this.tj = 4;
this.Ib = this.Eu = this.ob = -1;
this.Bf = this.mr = 0;
this.Kd = this.zf = this.Kg = this.th = this.Hd = null;
this.sr = 0;
this.Nu = this.am = null;
this.bg = 0;
this.tr = null;
this.Mg = [];
this.Mg.length = 100
}
t.ia("LayeredDigraphLayout", Kk);
t.Oa(Kk, le);
Kk.prototype.cloneProtected = function (a) {
le.prototype.cloneProtected.call(this, a);
a.Wn = this.Wn;
a.Gd = this.Gd;
a.ra = this.ra;
a.un = this.un;
a.Xn = this.Xn;
a.Nn = this.Nn;
a.Wl = this.Wl;
a.nn = this.nn;
a.qi = this.qi;
a.wh = this.wh;
a.tj = this.tj
};
Kk.prototype.createNetwork = function () {
var a = new fo;
on(a, this);
return a
};
Kk.prototype.doLayout = function (a) {
a || t.m("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.yd = this.hA(this.yd);
this.Eu = -1;
this.Bf = this.mr = 0;
this.tr = this.Nu = this.am = null;
for (a = 0; a < this.Mg.length; a++)this.Mg[a] = null;
if (0 < this.network.vertexes.count) {
this.network.Xv();
for (a = this.network.edges.l; a.next();)a.value.rev = !1;
switch (this.un) {
default:
case ho:
var b = 0, c = this.network.vertexes.count -
1;
a = [];
a.length = c + 1;
for (var d = this.network.vertexes.l; d.next();)d.value.valid = !0;
for (; null !== io(this.network);) {
for (d = jo(this.network); null !== d;)a[c] = d, c--, d.valid = !1, d = jo(this.network);
for (d = lo(this.network); null !== d;)a[b] = d, b++, d.valid = !1, d = lo(this.network);
for (var d = null, e = 0, g = this.network.vertexes.l; g.next();) {
var h = g.value;
if (h.valid) {
for (var k = 0, l = h.Zb; l.next();)l.value.toVertex.valid && k++;
for (var l = 0, m = h.hc; 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.l; a.next();)b = a.value, b.fromVertex.index > b.toVertex.index && (this.network.Gw(b), b.rev = !0);
break;
case $n:
for (b = this.network.vertexes.l; b.next();)b.value.Lo = -1, b.value.finish = -1;
for (a = this.network.edges.l; a.next();)a.value.forest = !1;
this.sr = 0;
for (b.reset(); b.next();)0 === b.value.hc.count && mo(this, b.value);
for (b.reset(); b.next();)-1 === b.value.Lo && mo(this, b.value);
for (a.reset(); a.next();)b = a.value, b.forest ||
(c = b.fromVertex, d = c.finish, e = b.toVertex, g = e.finish, e.Lo < c.Lo && d < g && (this.network.Gw(b), b.rev = !0))
}
for (a = this.network.vertexes.l; a.next();)b = a.value, b.layer = -1;
this.ob = -1;
this.assignLayers();
for (a.reset(); a.next();)this.ob = Math.max(this.ob, a.value.layer);
c = this.network.edges.l;
for (b = []; c.next();)a = c.value, a.valid = !1, b.push(a);
for (c = 0; c < b.length; c++)if (a = b[c], !a.valid && (null !== a.fromVertex.md && null !== a.toVertex.md || a.fromVertex.layer !== a.toVertex.layer)) {
g = k = h = l = 0;
e = a.fromVertex;
d = a.toVertex;
if (null !==
a.link) {
k = a.link;
if (null === k)continue;
var n = e.md, g = d.md;
if (null === n || null === g)continue;
var p = k.da, h = k.ja, q = k.Rc, l = k.Ed;
a.rev && (k = p, m = q, p = h, q = l, h = k, l = m);
var r = e.P, k = a.toVertex.P, s = a.rev ? d.S : e.S, m = t.O();
isNaN(s.x) ? m.assign(r) : gm(p, q, Ub, m);
n !== p && !isNaN(s.x) && p.zb() && (n = e.S, isNaN(n.x) || (m.x += s.x - n.x, m.y += s.y - n.y));
p = a.rev ? e.S : d.S;
n = t.O();
isNaN(p.x) ? n.assign(k) : gm(h, l, Ub, n);
g !== h && !isNaN(p.x) && h.zb() && (g = d.S, isNaN(g.x) || (n.x += p.x - g.x, n.y += p.y - g.y));
90 === this.ra || 270 === this.ra ? (g = Math.round((m.x - r.x) /
this.Gd), h = m.x, k = Math.round((n.x - k.x) / this.Gd), l = n.x) : (g = Math.round((m.y - r.y) / this.Gd), h = m.y, k = Math.round((n.y - k.y) / this.Gd), l = n.y);
t.B(m);
t.B(n);
a.portFromColOffset = g;
a.portFromPos = h;
a.portToColOffset = k;
a.portToPos = l
} else a.portFromColOffset = 0, a.portFromPos = 0, a.portToColOffset = 0, a.portToPos = 0;
m = e.layer;
r = d.layer;
n = a;
p = 0;
s = n.link;
if (null !== s) {
var v = s.Rc, x = s.Ed;
if (null !== v && null !== x) {
var E = s.da, q = s.ja;
if (null !== E && null !== q) {
var F = v.lb, G = x.mb;
this.vl || (s.lb.Gc() || (F = s.lb), s.mb.Gc() || (G = s.mb));
if (F.Gc() ||
F === Kb)F = vo(this, !0);
if (G.Gc() || G === Kb)G = vo(this, !1);
var L = s.ac, N = s.getLinkPoint(E, v, F, !0, L, q, x, t.O()), F = s.getLinkDirection(E, v, N, F, !0, L, q, x);
t.B(N);
F === Bo(this, n, !0) ? p += 1 : this.vl && null !== E && 1 === E.ports.count && n.rev && (p += 1);
N = s.getLinkPoint(q, x, G, !1, L, E, v, t.O());
s = s.getLinkDirection(q, x, N, G, !1, L, E, v);
t.B(N);
s === Bo(this, n, !1) ? p += 2 : this.vl && 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.md = null, q.ym = 1, q.layer = m, q.near = e, this.network.Yk(q),
e = this.network.Um(e, q, a.link), e.valid = !1, e.rev = a.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) {
a.valid = !1;
q = this.network.createVertex();
q.md = null;
q.ym = 2;
q.layer = m - 1;
this.network.Yk(q);
e = this.network.Um(e, q, a.link);
e.valid = !0;
e.rev = a.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.md = null, q.ym = 3, q.layer = m - 1, this.network.Yk(q), e = this.network.Um(e, q,
a.link), e.valid = !0, e.rev = a.rev, e.portFromColOffset = 0, e.portToColOffset = 0, e.portFromPos = 0, e.portToPos = 0, e = q, m--;
e = this.network.Um(q, d, a.link);
e.valid = !n;
n && (q.near = d);
e.rev = a.rev;
e.portFromColOffset = 0;
e.portToColOffset = k;
e.portFromPos = 0;
e.portToPos = l
} else a.valid = !0
}
b = this.Hd = [];
for (c = 0; c <= this.ob; c++)b[c] = 0;
for (a = this.network.vertexes.l; a.next();)a.value.index = -1;
this.initializeIndices();
this.Eu = -1;
for (c = this.Bf = this.mr = 0; c <= this.ob; c++)b[c] > b[this.Bf] && (this.Eu = b[c] - 1, this.Bf = c), b[c] < b[this.mr] &&
(this.mr = c);
this.tr = [];
for (c = 0; c < b.length; c++)this.tr[c] = [];
for (a.reset(); a.next();)c = a.value, b = c.layer, this.tr[b][c.index] = c;
this.Ib = -1;
for (a = 0; a <= this.ob; a++) {
b = Co(this, a);
c = 0;
d = this.Hd[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.Ib = Math.max(this.Ib, c - 1);
Do(this, a, b)
}
this.reduceCrossings();
this.straightenAndPack();
this.updateParts()
}
this.network = null;
this.pf = !0
};
function Eo(a) {
var b = a.toVertex, c = 0;
for (a = a.fromVertex.Zb; a.next();)a.value.toVertex === b && c++;
return 1 < c ? 2 : 1
}
function Fo(a) {
var b = a.fromVertex.md;
a = a.toVertex.md;
return null === b && null === a ? 8 : null === b || null === a ? 4 : 1
}
Kk.prototype.nodeMinLayerSpace = function (a, b) {
return null === a.md ? 0 : 90 === this.ra || 270 === this.ra ? b ? a.P.y + 10 : a.S.height - a.P.y + 10 : b ? a.P.x + 10 : a.S.width - a.P.x + 10
};
Kk.prototype.nodeMinColumnSpace = function (a, b) {
if (null === a.md)return 0;
var c = b ? a.AA : a.zA;
if (void 0 !== c)return c;
c = this.ra;
return 90 === c || 270 === c ? b ? a.AA = a.P.x / this.Gd + 1 | 0 : a.zA = (a.S.width - a.P.x) / this.Gd + 1 | 0 : b ? a.AA = a.P.y / this.Gd + 1 | 0 : a.zA = (a.S.height - a.P.y) / this.Gd + 1 | 0
};
function Go(a) {
null === a.am && (a.am = []);
for (var b = 0, c = a.network.vertexes.l, d; c.next();)d = c.value, a.am[b] = d.layer, b++, a.am[b] = d.column, b++, a.am[b] = d.index, b++;
return a.am
}
function Ho(a, b) {
for (var c = 0, d = a.network.vertexes.l, e; d.next();)e = d.value, e.layer = b[c], c++, e.column = b[c], c++, e.index = b[c], c++
}
function Io(a, b, c) {
f && (t.o(b, Kk, "crossingMatrix:unfixedLayer"), t.o(c, Kk, "crossingMatrix:direction"));
var d = Co(a, b), e = a.Hd[b];
a.Nu || (a.Nu = []);
for (var g = a.Nu, h, k = 0; k < e; k++) {
h = 0;
var l = d[k], m = l.near, n, p;
if (null !== m && m.layer === l.layer)if (l = m.index, l > k)for (p = k + 1; p < l; p++)n = d[p], n.near === m && n.ym === m.ym || h++; else for (p = k - 1; p > l; p--)n = d[p], n.near === m && n.ym === m.ym || h++;
var q, r, s, v, x, E;
if (0 <= c)for (l = d[k].$e, m = 0; m < l.count; m++)if (q = l.p[m], q.valid && q.fromVertex.layer !== b)for (n = q.fromVertex.index, p = q.portToPos, q =
q.portFromPos, r = m + 1; r < l.count; r++)s = l.p[r], s.valid && s.fromVertex.layer !== b && (v = s.fromVertex.index, x = s.portToPos, s = s.portFromPos, p < x && (n > v || n === v && q > s) && h++, x < p && (v > n || v === n && s > q) && h++);
if (0 >= c)for (l = d[k].Re, m = 0; m < l.count; m++)if (q = l.p[m], q.valid && q.toVertex.layer !== b)for (n = q.toVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < l.count; r++)s = l.p[r], s.valid && s.toVertex.layer !== b && (v = s.toVertex.index, x = s.portToPos, s = s.portFromPos, q < s && (n > v || n === v && p > x) && h++, s < q && (v > n || v === n && x > p) && h++);
g[k * e + k] = h;
for (l =
k + 1; l < e; l++) {
var F = 0, G = 0;
if (0 <= c)for (h = d[k].$e, E = d[l].$e, m = 0; m < h.count; m++)if (q = h.p[m], q.valid && q.fromVertex.layer !== b)for (n = q.fromVertex.index, q = q.portFromPos, r = 0; r < E.count; r++)s = E.p[r], s.valid && s.fromVertex.layer !== b && (v = s.fromVertex.index, s = s.portFromPos, (n < v || n === v && q < s) && G++, (v < n || v === n && s < q) && F++);
if (0 >= c)for (h = d[k].Re, E = d[l].Re, m = 0; m < h.count; m++)if (q = h.p[m], q.valid && q.toVertex.layer !== b)for (n = q.toVertex.index, p = q.portToPos, r = 0; r < E.count; r++)s = E.p[r], s.valid && s.toVertex.layer !== b && (v = s.toVertex.index,
x = s.portToPos, (n < v || n === v && p < x) && G++, (v < n || v === n && x < p) && F++);
g[k * e + l] = F;
g[l * e + k] = G
}
}
Do(a, b, d);
return g
}
Kk.prototype.countCrossings = function () {
var a, b = 0, c, d;
for (a = 0; a <= this.ob; a++) {
c = Io(this, a, 1);
d = this.Hd[a];
for (var e = 0; e < d; e++)for (var g = e; g < d; g++)b += c[e * d + g]
}
return b
};
function Jo(a) {
for (var b = 0, c = 0; c <= a.ob; c++) {
for (var d = a, e = c, g = Co(d, e), h = d.Hd[e], k = 0, l = void 0, l = 0; l < h; l++) {
var m = g[l].Re, n, p, q;
if ("undefined" !== typeof m)for (var r = 0; r < m.count; r++)n = m.p[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) * Fo(n))
}
Do(d, e, g);
b += k
}
return b
}
Kk.prototype.normalize = function () {
var a = Infinity;
this.Ib = -1;
for (var b = this.network.vertexes.l, c; b.next();)c = b.value, a = Math.min(a, c.column - this.nodeMinColumnSpace(c, !0)), this.Ib = Math.max(this.Ib, c.column + this.nodeMinColumnSpace(c, !1));
for (b.reset(); b.next();)b.value.column -= a;
this.Ib -= a
};
function Ko(a, b, c) {
f && (t.o(b, Kk, "barycenters:unfixedLayer"), t.o(c, Kk, "barycenters:direction"));
var d = Co(a, b), e = a.Hd[b], g = [], h;
for (h = 0; h < e; h++) {
var k = d[h], l = null;
0 >= c && (l = k.$e);
var m = null;
0 <= c && (m = k.Re);
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.p[q], r = k.fromVertex;
k.valid && !k.rev && r.layer !== b && (n += r.column + k.portFromColOffset, p++)
}
if (null !== m)for (l = 0; l < m.count; l++)k = m.p[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (n += q.column +
k.portToColOffset, p++);
g[h] = 0 === p ? -1 : n / p
}
Do(a, b, d);
return g
}
function Lo(a, b, c) {
f && (t.o(b, Kk, "medians:unfixedLayer"), t.o(c, Kk, "medians:direction"));
for (var d = Co(a, b), e = a.Hd[b], g = [], h = 0; h < e; h++) {
var k = d[h], l = null;
0 >= c && (l = k.$e);
var m = null;
0 <= c && (m = k.Re);
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.p[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.p[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)
}
Do(a, b, d);
return g
}
function Mo(a, b, c, d, e, g) {
if (b.component === d) {
b.component = c;
var h, k;
if (e)for (var l = b.Zb; l.next();) {
var m = l.value.toVertex;
h = b.layer - m.layer;
k = Eo(l.value);
h === k && Mo(a, m, c, d, e, g)
}
if (g)for (l = b.hc; l.next();)m = l.value.fromVertex, h = m.layer - b.layer, k = Eo(l.value), h === k && Mo(a, m, c, d, e, g)
}
}
function No(a, b, c, d, e, g) {
if (b.component === d) {
b.component = c;
if (e)for (var h = b.Zb, k; h.next();)k = h.value.toVertex, No(a, k, c, d, e, g);
if (g)for (b = b.hc; b.next();)h = b.value.fromVertex, No(a, h, c, d, e, g)
}
}
function io(a) {
for (a = a.vertexes.l; a.next();) {
var b = a.value;
if (b.valid)return b
}
return null
}
function jo(a) {
for (a = a.vertexes.l; a.next();) {
var b = a.value;
if (b.valid) {
for (var c = !0, d = b.Zb; d.next();)if (d.value.toVertex.valid) {
c = !1;
break
}
if (c)return b
}
}
return null
}
function lo(a) {
for (a = a.vertexes.l; a.next();) {
var b = a.value;
if (b.valid) {
for (var c = !0, d = b.hc; d.next();)if (d.value.fromVertex.valid) {
c = !1;
break
}
if (c)return b
}
}
return null
}
function mo(a, b) {
b.Lo = a.sr;
a.sr++;
for (var c = b.Zb; c.next();) {
var d = c.value, e = d.toVertex;
-1 === e.Lo && (d.forest = !0, mo(a, e))
}
b.finish = a.sr;
a.sr++
}
Kk.prototype.assignLayers = function () {
switch (this.Xn) {
case Oo:
Po(this);
break;
case Qo:
for (var a, b = this.network.vertexes.l; b.next();)a = Ro(this, b.value), this.ob = Math.max(a, this.ob);
for (b.reset(); b.next();)a = b.value, a.layer = this.ob - a.layer;
break;
default:
case ao:
Po(this);
for (b = this.network.vertexes.l; b.next();)b.value.valid = !1;
for (b.reset(); b.next();)0 === b.value.hc.count && So(this, b.value);
a = Infinity;
for (b.reset(); b.next();)a = Math.min(a, b.value.layer);
this.ob = -1;
for (b.reset(); b.next();)b.value.layer -= a,
this.ob = Math.max(this.ob, b.value.layer)
}
};
function Po(a) {
for (var b = a.network.vertexes.l; b.next();) {
var c = To(a, b.value);
a.ob = Math.max(c, a.ob)
}
}
function To(a, b) {
var c = 0;
if (-1 === b.layer) {
for (var d = b.Zb; d.next();)var e = d.value, g = Eo(e), c = Math.max(c, To(a, e.toVertex) + g);
b.layer = c
} else c = b.layer;
return c
}
function Ro(a, b) {
var c = 0;
if (-1 === b.layer) {
for (var d, e, g = b.hc; g.next();)e = g.value, d = Eo(e), c = Math.max(c, Ro(a, e.fromVertex) + d);
b.layer = c
} else c = b.layer;
return c
}
function So(a, b) {
if (!b.valid) {
b.valid = !0;
for (var c = b.Zb; c.next();)So(a, c.value.toVertex);
for (c = a.network.vertexes.l; c.next();)c.value.component = -1;
for (var d = b.$e.p, e = d.length, g = 0; g < e; g++) {
var h = d[g], k = Eo(h);
h.fromVertex.layer - h.toVertex.layer > k && Mo(a, h.fromVertex, 0, -1, !0, !1)
}
for (Mo(a, b, 1, -1, !0, !0); 0 !== b.component;) {
for (var k = 0, d = Infinity, l = 0, m = null, n = a.network.vertexes.l; n.next();) {
var p = n.value;
if (1 === p.component) {
for (var q = 0, r = !1, s = p.$e.p, e = s.length, g = 0; g < e; g++) {
var h = s[g], v = h.fromVertex, q = q + 1;
1 !== v.component && (k += 1, v = v.layer - p.layer, h = Eo(h), d = Math.min(d, v - h))
}
h = p.Re.p;
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.l; c.next();)c.value.component = -1;
for (Mo(a, b, 1, -1, !0, !1); 0 !== b.component;) {
g = 0;
e = Infinity;
d = 0;
k = null;
for (l = a.network.vertexes.l; l.next();)if (m = l.value, 1 === m.component) {
n = 0;
p = !1;
h = m.$e.p;
q = h.length;
for (r = 0; r < q; r++)s = h[r].fromVertex, n += 1, 1 !== s.component ? g += 1 : p = !0;
h = m.Re.p;
q = h.length;
for (r = 0; r < q; r++)s = h[r], v = s.toVertex, n -= 1, 1 !== v.component && (g -= 1, v = m.layer - v.layer, s = Eo(s), e = Math.min(e, v - 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 Bo(a, b, c) {
return 90 === a.ra ? c && !b.rev || !c && b.rev ? 270 : 90 : 180 === a.ra ? c && !b.rev || !c && b.rev ? 0 : 180 : 270 === a.ra ? c && !b.rev || !c && b.rev ? 90 : 270 : c && !b.rev || !c && b.rev ? 180 : 0
}
Kk.prototype.initializeIndices = function () {
switch (this.Nn) {
default:
case Uo:
for (var a, b = this.network.vertexes.l; b.next();) {
var c = b.value;
a = c.layer;
c.index = this.Hd[a];
this.Hd[a]++
}
break;
case bo:
b = this.network.vertexes.l;
for (a = this.ob; 0 <= a; a--) {
for (; b.next();)b.value.layer === a && -1 === b.value.index && Vo(this, b.value);
b.reset()
}
break;
case Wo:
for (b = this.network.vertexes.l, a = 0; a <= this.ob; a++) {
for (; b.next();)b.value.layer === a && -1 === b.value.index && Xo(this, b.value);
b.reset()
}
}
};
function Vo(a, b) {
var c = b.layer;
b.index = a.Hd[c];
a.Hd[c]++;
for (var c = b.Re.af(), d = !0, e; d;)for (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 && Vo(a, d))
}
function Xo(a, b) {
var c = b.layer;
b.index = a.Hd[c];
a.Hd[c]++;
for (var c = b.$e.af(), d = !0, e; 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 && Xo(a, d))
}
Kk.prototype.reduceCrossings = function () {
var a = this.countCrossings(), b = Go(this), c, d, e;
for (c = 0; c < this.Wl; c++) {
for (d = 0; d <= this.ob; d++)Yo(this, d, 1), Zo(this, d, 1);
e = this.countCrossings();
e < a && (a = e, b = Go(this));
for (d = this.ob; 0 <= d; d--)Yo(this, d, -1), Zo(this, d, -1);
e = this.countCrossings();
e < a && (a = e, b = Go(this))
}
Ho(this, b);
for (c = 0; c < this.Wl; c++) {
for (d = 0; d <= this.ob; d++)Yo(this, d, 0), Zo(this, d, 0);
e = this.countCrossings();
e < a && (a = e, b = Go(this));
for (d = this.ob; 0 <= d; d--)Yo(this, d, 0), Zo(this, d, 0);
e = this.countCrossings();
e < a && (a = e, b = Go(this))
}
Ho(this, b);
var g, h, k;
switch (this.nn) {
case $o:
break;
case ap:
for (k = a + 1; (d = this.countCrossings()) < k;)for (k = d, c = this.ob; 0 <= c; c--)for (h = 0; h <= c; h++) {
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Zo(this, d, -1) || g;
e = this.countCrossings();
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Zo(this, d, 1) || g;
e = this.countCrossings();
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Zo(this, d, 1) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g =
Zo(this, d, -1) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Zo(this, d, 0) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Zo(this, d, 0) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this))
}
break;
default:
case co:
for (c = this.ob, h = 0, k = a + 1; (d = this.countCrossings()) < k;) {
k = d;
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Zo(this, d, -1) || g;
e = this.countCrossings();
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Zo(this, d, 1) || g;
e = this.countCrossings();
e >= a ? Ho(this, b) :
(a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Zo(this, d, 1) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Zo(this, d, -1) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = c; d >= h; d--)g = Zo(this, d, 0) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this));
for (g = !0; g;)for (g = !1, d = h; d <= c; d++)g = Zo(this, d, 0) || g;
e >= a ? Ho(this, b) : (a = e, b = Go(this))
}
}
Ho(this, b)
};
function Yo(a, b, c) {
f && (t.o(b, Kk, "medianBarycenterCrossingReduction:unfixedLayer"), t.o(c, Kk, "medianBarycenterCrossingReduction:direction"));
var d = Co(a, b), e = a.Hd[b], g = Lo(a, b, c), h = Ko(a, b, c);
for (c = 0; c < e; c++)-1 === h[c] && (h[c] = d[c].column), -1 === g[c] && (g[c] = d[c].column);
for (var k = !0, l; k;)for (k = !1, c = 0; c < e - 1; c++)if (g[c + 1] < g[c] || g[c + 1] === g[c] && h[c + 1] < h[c])k = !0, l = g[c], g[c] = g[c + 1], g[c + 1] = l, l = h[c], h[c] = h[c + 1], h[c + 1] = l, l = d[c], d[c] = d[c + 1], d[c + 1] = l;
for (c = g = 0; c < e; c++)l = d[c], l.index = c, g += a.nodeMinColumnSpace(l, !0),
l.column = g, g += 1, g += a.nodeMinColumnSpace(l, !1);
Do(a, b, d)
}
function Zo(a, b, c) {
var d = Co(a, b), e = a.Hd[b];
c = Io(a, b, c);
var g, 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, v = d[g + 1].column, x = a.nodeMinColumnSpace(d[g], !0), E = a.nodeMinColumnSpace(d[g], !1), F = a.nodeMinColumnSpace(d[g + 1], !0), G = a.nodeMinColumnSpace(d[g + 1], !1), x = s - x + F, E = v - E + G, L = d[g].hc.l;
for (L.reset(); L.next();)if (G = L.value, G.valid && G.fromVertex.layer ===
b) {
G = G.fromVertex;
for (F = 0; d[F] !== G;)F++;
F < g && (q += 2 * (g - F), r += 2 * (g + 1 - F));
F === g + 1 && (q += 1);
F > g + 1 && (q += 4 * (F - g), r += 4 * (F - (g + 1)))
}
L = d[g].Zb.l;
for (L.reset(); L.next();)if (G = L.value, G.valid && G.toVertex.layer === b) {
G = G.toVertex;
for (F = 0; d[F] !== G;)F++;
F === g + 1 && (r += 1)
}
L = d[g + 1].hc.l;
for (L.reset(); L.next();)if (G = L.value, G.valid && G.fromVertex.layer === b) {
G = G.fromVertex;
for (F = 0; d[F] !== G;)F++;
F < g && (q += 2 * (g + 1 - F), r += 2 * (g - F));
F === g && (r += 1);
F > g + 1 && (q += 4 * (F - (g + 1)), r += 4 * (F - g))
}
L = d[g + 1].Zb.l;
for (L.reset(); L.next();)if (G = L.value,
G.valid && G.toVertex.layer === b) {
G = G.toVertex;
for (F = 0; d[F] !== G;)F++;
F === g && (q += 1)
}
var F = G = 0, L = h[d[g].index], N = k[d[g].index], V = h[d[g + 1].index], T = k[d[g + 1].index];
-1 !== L && (G += Math.abs(L - s), F += Math.abs(L - E));
-1 !== N && (G += Math.abs(N - s), F += Math.abs(N - E));
-1 !== V && (G += Math.abs(V - v), F += Math.abs(V - x));
-1 !== T && (G += Math.abs(T - v), F += Math.abs(T - x));
if (r < q - 0.5 || r === q && p < n - 0.5 || r === q && p === n && F < G - 0.5)m = l = !0, d[g].column = E, d[g + 1].column = x, n = d[g], d[g] = d[g + 1], d[g + 1] = n
}
for (g = 0; g < e; g++)d[g].index = g;
Do(a, b, d);
return l
}
Kk.prototype.straightenAndPack = function () {
var a, b, c = 0 !== (this.qi & bp);
a = this.qi === eo;
1E3 < this.network.edges.count && !a && (c = !1);
if (c) {
b = [];
for (a = 0; a <= this.ob; a++)b[a] = 0;
for (var d = this.network.vertexes.l, e, g; d.next();)e = d.value, a = e.layer, g = e.column, e = this.nodeMinColumnSpace(e, !1), b[a] = Math.max(b[a], g + e);
for (d.reset(); d.next();)e = d.value, a = e.layer, g = e.column, e.column = (8 * (this.Ib - b[a]) >> 1) + 8 * g;
this.Ib *= 8
}
if (0 !== (this.qi & cp))for (b = !0; b;) {
b = !1;
for (a = this.Bf + 1; a <= this.ob; a++)b = dp(this, a, 1) || b;
for (a = this.Bf -
1; 0 <= a; a--)b = dp(this, a, -1) || b;
b = dp(this, this.Bf, 0) || b
}
if (0 !== (this.qi & ep)) {
for (a = this.Bf + 1; a <= this.ob; a++)fp(this, a, 1);
for (a = this.Bf - 1; 0 <= a; a--)fp(this, a, -1);
fp(this, this.Bf, 0)
}
c && (gp(this, -1), gp(this, 1));
if (0 !== (this.qi & cp))for (b = !0; b;) {
b = !1;
b = dp(this, this.Bf, 0) || b;
for (a = this.Bf + 1; a <= this.ob; a++)b = dp(this, a, 0) || b;
for (a = this.Bf - 1; 0 <= a; a--)b = dp(this, a, 0) || b
}
};
function dp(a, b, c) {
f && (t.o(b, Kk, "bendStraighten:unfixedLayer"), t.o(c, Kk, "bendStraighten:direction"));
for (var d = !1; hp(a, b, c);)d = !0;
return d
}
function hp(a, b, c) {
f && (t.o(b, Kk, "shiftbendStraighten:unfixedLayer"), t.o(c, Kk, "shiftbendStraighten:direction"));
var d, e = Co(a, b), g = a.Hd[b], h = Ko(a, b, -1);
if (0 < c)for (d = 0; d < g; d++)h[d] = -1;
var k = Ko(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), p = 0 > d - 1 || n - e[d - 1].column - 1 > p + a.nodeMinColumnSpace(e[d - 1], !1) ? n - 1 : n, q = d + 1 >= g || e[d + 1].column - n - 1 > q + a.nodeMinColumnSpace(e[d + 1], !0) ? n + 1 : n, r = 0, s = 0, v = 0, x,
E, F, G;
if (0 >= c)for (var L = e[d].hc.l; L.next();)x = L.value, x.valid && x.fromVertex.layer !== b && (E = Fo(x), F = x.portFromColOffset, G = x.portToColOffset, x = x.fromVertex.column, r += (Math.abs(n + G - (x + F)) + 1) * E, s += (Math.abs(p + G - (x + F)) + 1) * E, v += (Math.abs(q + G - (x + F)) + 1) * E);
if (0 <= c)for (L = e[d].Zb.l; L.next();)x = L.value, x.valid && x.toVertex.layer !== b && (E = Fo(x), F = x.portFromColOffset, G = x.portToColOffset, x = x.toVertex.column, r += (Math.abs(n + F - (x + G)) + 1) * E, s += (Math.abs(p + F - (x + G)) + 1) * E, v += (Math.abs(q + F - (x + G)) + 1) * E);
G = F = E = 0;
x = h[e[d].index];
L = k[e[d].index];
-1 !== x && (E += Math.abs(x - n), F += Math.abs(x - p), G += Math.abs(x - q));
-1 !== L && (E += Math.abs(L - n), F += Math.abs(L - p), G += Math.abs(L - q));
if (s < r || s === r && F < E)m = l = !0, e[d].column = p;
if (v < r || v === r && G < E)m = l = !0, e[d].column = q
}
Do(a, b, e);
a.normalize();
return l
}
function fp(a, b, c) {
f && (t.o(b, Kk, "medianStraighten:unfixedLayer"), t.o(c, Kk, "medianStraighten:direction"));
var d = Co(a, b), e = a.Hd[b], g = Lo(a, b, c), h = [];
for (c = 0; c < e; c++)h[c] = g[c];
for (g = !0; g;)for (g = !1, c = 0; c < e; c++) {
var k = d[c].column, l = a.nodeMinColumnSpace(d[c], !0), m = a.nodeMinColumnSpace(d[c], !1), n = 0, p;
-1 === h[c] ? 0 === c && c === e - 1 ? n = k : 0 === c ? (p = d[c + 1].column, n = p - k === m + a.nodeMinColumnSpace(d[c + 1], !0) ? k - 1 : k) : c === e - 1 ? (p = d[c - 1].column, n = k - p === l + a.nodeMinColumnSpace(d[c - 1], !1) ? k + 1 : k) : (p = d[c - 1].column, l = p + a.nodeMinColumnSpace(d[c -
1], !1) + l + 1, p = d[c + 1].column, m = p - a.nodeMinColumnSpace(d[c + 1], !0) - m - 1, n = (l + m) / 2 | 0) : 0 === c && c === e - 1 ? n = h[c] : 0 === c ? (p = d[c + 1].column, m = p - a.nodeMinColumnSpace(d[c + 1], !0) - m - 1, n = Math.min(h[c], m)) : c === e - 1 ? (p = d[c - 1].column, l = p + a.nodeMinColumnSpace(d[c - 1], !1) + l + 1, n = Math.max(h[c], l)) : (p = d[c - 1].column, l = p + a.nodeMinColumnSpace(d[c - 1], !1) + l + 1, p = d[c + 1].column, m = p - a.nodeMinColumnSpace(d[c + 1], !0) - m - 1, l < h[c] && h[c] < m ? n = h[c] : l >= h[c] ? n = l : m <= h[c] && (n = m));
n !== k && (g = !0, d[c].column = n)
}
Do(a, b, d);
a.normalize()
}
function ip(a, b) {
f && (t.o(b, Kk, "packAux:column"), t.o(1, Kk, "packAux:direction"));
for (var c = !0, d = a.network.vertexes.l, e; d.next();) {
e = d.value;
var g = a.nodeMinColumnSpace(e, !0), h = a.nodeMinColumnSpace(e, !1);
if (e.column - g <= b && e.column + h >= b) {
c = !1;
break
}
}
g = !1;
if (c)for (d.reset(); d.next();)e = d.value, e.column > b && (e.column -= 1, g = !0);
return g
}
function jp(a, b) {
f && (t.o(b, Kk, "tightPackAux:column"), t.o(1, Kk, "tightPackAux:direction"));
var c = b, c = b + 1, d, e = [], g = [];
for (d = 0; d <= a.ob; d++)e[d] = !1, g[d] = !1;
for (var h = a.network.vertexes.l; h.next();) {
d = h.value;
var 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.ob; d++)k = k && !(e[d] && g[d]);
if (k)for (h.reset(); h.next();)d = h.value, d.column > b && (d.column -= 1, c = !0);
return c
}
function gp(a, b) {
f && t.o(b, Kk, "componentPack:direction");
for (var c = 0; c <= a.Ib; c++)for (; ip(a, c););
a.normalize();
for (c = 0; c < a.Ib; c++)for (; jp(a, c););
a.normalize();
var d, e, g, h;
if (0 < b)for (c = 0; c <= a.Ib; c++)for (d = Go(a), e = Jo(a), g = e + 1; e < g;)g = e, kp(a, c, 1), h = Jo(a), h > e ? Ho(a, d) : h < e && (e = h, d = Go(a));
if (0 > b)for (c = a.Ib; 0 <= c; c--)for (d = Go(a), e = Jo(a), g = e + 1; e < g;)g = e, kp(a, c, -1), h = Jo(a), h > e ? Ho(a, d) : h < e && (e = h, d = Go(a));
a.normalize()
}
function kp(a, b, c) {
a.bg = 0;
for (var d = a.network.vertexes.l, e; d.next();)d.value.component = -1;
if (0 < c)for (d.reset(); d.next();)e = d.value, e.column - a.nodeMinColumnSpace(e, !0) <= b && (e.component = a.bg);
if (0 > c)for (d.reset(); d.next();)e = d.value, e.column + a.nodeMinColumnSpace(e, !1) >= b && (e.component = a.bg);
a.bg++;
for (d.reset(); d.next();)e = d.value, -1 === e.component && (No(a, e, a.bg, -1, !0, !0), a.bg++);
b = [];
for (e = 0; e < a.bg * a.bg; e++)b[e] = !1;
var g = [];
for (e = 0; e < (a.ob + 1) * (a.Ib + 1); e++)g[e] = -1;
for (d.reset(); d.next();) {
e = d.value;
for (var h = e.layer, k = Math.max(0, e.column - a.nodeMinColumnSpace(e, !0)), l = Math.min(a.Ib, e.column + a.nodeMinColumnSpace(e, !1)); k <= l; k++)g[h * (a.Ib + 1) + k] = e.component
}
for (e = 0; e <= a.ob; e++) {
if (0 < c)for (k = 0; k < a.Ib; k++)-1 !== g[e * (a.Ib + 1) + k] && -1 !== g[e * (a.Ib + 1) + k + 1] && g[e * (a.Ib + 1) + k] !== g[e * (a.Ib + 1) + k + 1] && (b[g[e * (a.Ib + 1) + k] * a.bg + g[e * (a.Ib + 1) + k + 1]] = !0);
if (0 > c)for (k = a.Ib; 0 < k; k--)-1 !== g[e * (a.Ib + 1) + k] && -1 !== g[e * (a.Ib + 1) + k - 1] && g[e * (a.Ib + 1) + k] !== g[e * (a.Ib + 1) + k - 1] && (b[g[e * (a.Ib + 1) + k] * a.bg + g[e * (a.Ib + 1) + k - 1]] = !0)
}
g = [];
for (e =
0; e < a.bg; e++)g[e] = !0;
h = new H("number");
for (h.add(0); 0 !== h.count;)if (l = h.p[h.count - 1], h.Dd(h.count - 1), g[l])for (g[l] = !1, e = 0; e < a.bg; e++)b[l * a.bg + e] && h.Rd(0, e);
if (0 < c)for (d.reset(); d.next();)e = d.value, g[e.component] && (e.column -= 1);
if (0 > c)for (d.reset(); d.next();)e = d.value, g[e.component] && (e.column += 1)
}
Kk.prototype.commitLayout = function () {
if (this.vl)for (var a = vo(this, !0), b = vo(this, !1), c = this.network.edges.l, d; c.next();)d = c.value.link, null !== d && (d.lb = a, d.mb = b);
this.commitNodes();
this.Vs && this.commitLinks()
};
function vo(a, b) {
return 270 === a.ra ? b ? $b : cc : 90 === a.ra ? b ? cc : $b : 180 === a.ra ? b ? ac : bc : b ? bc : ac
}
Kk.prototype.commitNodes = function () {
this.th = [];
this.Kg = [];
this.zf = [];
this.Kd = [];
for (var a = 0; a <= this.ob; a++)this.th[a] = 0, this.Kg[a] = 0, this.zf[a] = 0, this.Kd[a] = 0;
for (var a = this.network.vertexes.l, b, c; a.next();)b = a.value, c = b.layer, this.th[c] = Math.max(this.th[c], this.nodeMinLayerSpace(b, !0)), this.Kg[c] = Math.max(this.Kg[c], this.nodeMinLayerSpace(b, !1));
b = 0;
for (var d = this.Wn, e = 0; e <= this.ob; e++)c = d, 0 >= this.th[e] + this.Kg[e] && (c = 0), 0 < e && (b += c / 2), 90 === this.ra || 0 === this.ra ? (b += this.Kg[e], this.zf[e] = b, b += this.th[e]) :
(b += this.th[e], this.zf[e] = b, b += this.Kg[e]), e < this.ob && (b += c / 2), this.Kd[e] = b;
d = this.yd;
for (e = 0; e <= this.ob; e++)270 === this.ra ? (this.zf[e] = d.y + this.zf[e], this.Kd[e] = d.y + this.Kd[e]) : 90 === this.ra ? (this.zf[e] = d.y + b - this.zf[e], this.Kd[e] = d.y + b - this.Kd[e]) : 180 === this.ra ? (this.zf[e] = d.x + this.zf[e], this.Kd[e] = d.x + this.Kd[e]) : (this.zf[e] = d.x + b - this.zf[e], this.Kd[e] = d.x + b - this.Kd[e]);
for (a.reset(); a.next();) {
b = a.value;
c = b.layer;
var g = b.column | 0;
270 === this.ra || 90 === this.ra ? (e = d.x + this.Gd * g, c = this.zf[c]) : (e = this.zf[c],
c = d.y + this.Gd * g);
b.Fa = e;
b.Sa = c;
b.commit()
}
};
Kk.prototype.commitLinks = function () {
for (var a = this.network.edges.l, b, c; a.next();)c = a.value.link, "undefined" !== typeof c && null !== c && (c.wl(), c.Fo(), c.Gi());
for (a.reset(); a.next();)c = a.value.link, "undefined" !== typeof c && null !== c && c.updateRoute();
for (a.reset(); a.next();)if (b = a.value, c = b.link) {
c.wl();
var d = c, e = d.da, g = d.ja, h = d.Rc, k = d.Ed;
if (b.valid) {
if (c.De === Pg && 4 === c.ma) {
if (b.rev)var l = e, e = g, g = l, m = h, h = k, k = m;
if (b.fromVertex.column === b.toVertex.column) {
var n = c.getLinkPoint(e, h, c.computeSpot(!0), !0, !1, g, k),
p = c.getLinkPoint(g, k, c.computeSpot(!1), !1, !1, e, h);
c.Fo();
c.Xk(n.x, n.y);
c.Xk((2 * n.x + p.x) / 3, (2 * n.y + p.y) / 3);
c.Xk((n.x + 2 * p.x) / 3, (n.y + 2 * p.y) / 3);
c.Xk(p.x, p.y)
} else {
var q = !1, r = !1;
null !== h && c.computeSpot(!0) === Kb && (q = !0);
null !== k && c.computeSpot(!1) === Kb && (r = !0);
if (q || r) {
var s = c.n(0).x, v = c.n(0).y, x = c.n(1).x, E = c.n(1).y, F = c.n(2).x, G = c.n(2).y, L = c.n(3).x, N = c.n(3).y;
if (q) {
90 === this.ra || 270 === this.ra ? (x = s, E = (v + N) / 2) : (x = (s + L) / 2, E = v);
c.Y(1, x, E);
var V = c.getLinkPoint(e, h, c.computeSpot(!0), !0, !1, g, k);
c.Y(0, V.x, V.y)
}
r &&
(90 === this.ra || 270 === this.ra ? (F = L, G = (v + N) / 2) : (F = (s + L) / 2, G = N), c.Y(2, F, G), V = c.getLinkPoint(g, k, c.computeSpot(!1), !1, !1, e, h), c.Y(3, V.x, V.y))
}
}
}
c.Gi()
} else if (b.fromVertex.layer === b.toVertex.layer)c.Gi(); else {
var T = !1, W = !1, ea, R = c.Ks + 1;
if (c.ac)W = !0, ea = c.ma, 4 < ea && c.points.removeRange(2, ea - 3); else if (c.De === Pg)T = !0, ea = c.ma, 4 < ea && c.points.removeRange(2, ea - 3), R = 2; else {
ea = c.ma;
var xa = c.computeSpot(!0) === Kb, Ja = c.computeSpot(!1) === Kb;
2 < ea && xa && Ja ? c.points.removeRange(1, ea - 2) : 3 < ea && xa && !Ja ? c.points.removeRange(1,
ea - 3) : 3 < ea && !xa && Ja ? c.points.removeRange(2, ea - 2) : 4 < ea && !xa && !Ja && c.points.removeRange(2, ea - 3)
}
var Ma = b.fromVertex, Na = b.toVertex, ya, Ra;
if (b.rev) {
for (var Ca; null !== Na && Ma !== Na;) {
Ra = ya = null;
for (var ob = Na.hc.l; ob.next() && (ic = ob.value, ic.link !== b.link || (ya = ic.fromVertex, Ra = ic.toVertex, null !== ya.md)););
ya !== Ma && (hb = c.n(R - 1).x, ib = c.n(R - 1).y, Ga = ya.Fa, Ka = ya.Sa, W ? 180 === this.ra || 0 === this.ra ? 2 === R ? (c.C(R++, hb, ib), c.C(R++, hb, Ka)) : (Hf = null !== Ra ? Ra.Sa : ib, Hf !== Ka && (bb = this.Kd[ya.layer - 1], c.C(R++, bb, ib), c.C(R++, bb,
Ka))) : 2 === R ? (c.C(R++, hb, ib), c.C(R++, Ga, ib)) : (ed = null !== Ra ? Ra.Fa : hb, ed !== Ga && (bb = this.Kd[ya.layer - 1], c.C(R++, hb, bb), c.C(R++, Ga, bb))) : 2 === R ? T ? (tb = Math.max(10, this.th[Na.layer]), Ya = Math.max(10, this.Kg[Na.layer]), 180 === this.ra ? (Ca = Na.S.x, c.C(R++, Ca - tb, Ka), c.C(R++, Ca, Ka), c.C(R++, Ca + Ya, Ka)) : 90 === this.ra ? (Ca = Na.S.y + Na.S.height, c.C(R++, Ga, Ca + Ya), c.C(R++, Ga, Ca), c.C(R++, Ga, Ca - tb)) : 270 === this.ra ? (Ca = Na.S.y, c.C(R++, Ga, Ca - tb), c.C(R++, Ga, Ca), c.C(R++, Ga, Ca + Ya)) : (Ca = Na.S.x + Na.S.width, c.C(R++, Ca + Ya, Ka), c.C(R++, Ca,
Ka), c.C(R++, Ca - tb, Ka))) : (c.C(R++, hb, ib), 180 === this.ra || 0 === this.ra ? c.C(R++, hb, Ka) : c.C(R++, Ga, ib), c.C(R++, Ga, Ka)) : (tb = Math.max(10, this.th[ya.layer]), Ya = Math.max(10, this.Kg[ya.layer]), 180 === this.ra ? (T && c.C(R++, Ga - tb, Ka), c.C(R++, Ga, Ka), T && c.C(R++, Ga + Ya, Ka)) : 90 === this.ra ? (T && c.C(R++, Ga, Ka + Ya), c.C(R++, Ga, Ka), T && c.C(R++, Ga, Ka - tb)) : 270 === this.ra ? (T && c.C(R++, Ga, Ka - tb), c.C(R++, Ga, Ka), T && c.C(R++, Ga, Ka + Ya)) : (T && c.C(R++, Ga + Ya, Ka), c.C(R++, Ga, Ka), T && c.C(R++, Ga - tb, Ka))));
Na = ya
}
if (null === k || c.computeSpot(!1) !== Kb)if (hb =
c.n(R - 1).x, ib = c.n(R - 1).y, Ga = c.n(R).x, Ka = c.n(R).y, W) {
var kf = this.Kg[Ma.layer], hc;
180 === this.ra || 0 === this.ra ? (hc = ib, hc >= Ma.S.y && hc <= Ma.S.bottom && (Ca = Ma.Fa + kf, hc = hc < Ma.S.y + Ma.S.height / 2 ? Ma.S.y - this.Gd / 2 : Ma.S.bottom + this.Gd / 2, c.C(R++, Ca, ib), c.C(R++, Ca, hc)), c.C(R++, Ga, hc)) : (hc = hb, hc >= Ma.S.x && hc <= Ma.S.right && (Ca = Ma.Sa + kf, hc = hc < Ma.S.x + Ma.S.width / 2 ? Ma.S.x - this.Gd / 2 : Ma.S.right + this.Gd / 2, c.C(R++, hb, Ca), c.C(R++, hc, Ca)), c.C(R++, hc, Ka));
c.C(R++, Ga, Ka)
} else T ? (tb = Math.max(10, this.th[Ma.layer]), Ya = Math.max(10, this.Kg[Ma.layer]),
180 === this.ra ? (Ca = Ma.S.x + Ma.S.width, c.Y(R - 2, Ca, ib), c.Y(R - 1, Ca + Ya, ib)) : 90 === this.ra ? (Ca = Ma.S.y, c.Y(R - 2, hb, Ca), c.Y(R - 1, hb, Ca - tb)) : 270 === this.ra ? (Ca = Ma.S.y + Ma.S.height, c.Y(R - 2, hb, Ca), c.Y(R - 1, hb, Ca + Ya)) : (Ca = Ma.S.x, c.Y(R - 2, Ca, ib), c.Y(R - 1, Ca - tb, ib))) : (180 === this.ra || 0 === this.ra ? c.C(R++, Ga, ib) : c.C(R++, hb, Ka), c.C(R++, Ga, Ka))
} else {
for (; null !== Ma && Ma !== Na;) {
Ra = ya = null;
for (var lf = Ma.Zb.l, ic; lf.next() && (ic = lf.value, ic.link !== b.link || (ya = ic.toVertex, Ra = ic.fromVertex, null !== Ra.md && (Ra = null), null !== ya.md)););
var hb,
ib, Ga, Ka, bb, tb, Ya;
if (ya !== Na)if (hb = c.n(R - 1).x, ib = c.n(R - 1).y, Ga = ya.Fa, Ka = ya.Sa, W)if (180 === this.ra || 0 === this.ra) {
var Hf = null !== Ra ? Ra.Sa : ib;
Hf !== Ka && (bb = this.Kd[ya.layer], 2 === R && (bb = 0 === this.ra ? Math.max(bb, hb) : Math.min(bb, hb)), c.C(R++, bb, ib), c.C(R++, bb, Ka))
} else {
var ed = null !== Ra ? Ra.Fa : hb;
ed !== Ga && (bb = this.Kd[ya.layer], 2 === R && (bb = 90 === this.ra ? Math.max(bb, ib) : Math.min(bb, ib)), c.C(R++, hb, bb), c.C(R++, Ga, bb))
} else tb = Math.max(10, this.th[ya.layer]), Ya = Math.max(10, this.Kg[ya.layer]), 180 === this.ra ? (c.C(R++,
Ga + Ya, Ka), T && c.C(R++, Ga, Ka), c.C(R++, Ga - tb, Ka)) : 90 === this.ra ? (c.C(R++, Ga, Ka - tb), T && c.C(R++, Ga, Ka), c.C(R++, Ga, Ka + Ya)) : 270 === this.ra ? (c.C(R++, Ga, Ka + Ya), T && c.C(R++, Ga, Ka), c.C(R++, Ga, Ka - tb)) : (c.C(R++, Ga - tb, Ka), T && c.C(R++, Ga, Ka), c.C(R++, Ga + Ya, Ka));
Ma = ya
}
W && (hb = c.n(R - 1).x, ib = c.n(R - 1).y, Ga = c.n(R).x, Ka = c.n(R).y, 180 === this.ra || 0 === this.ra ? ib !== Ka && (bb = 0 === this.ra ? Math.min(Math.max((Ga + hb) / 2, this.Kd[Na.layer]), Ga) : Math.max(Math.min((Ga + hb) / 2, this.Kd[Na.layer]), Ga), c.C(R++, bb, ib), c.C(R++, bb, Ka)) : hb !== Ga && (bb =
90 === this.ra ? Math.min(Math.max((Ka + ib) / 2, this.Kd[Na.layer]), Ka) : Math.max(Math.min((Ka + ib) / 2, this.Kd[Na.layer]), Ka), c.C(R++, hb, bb), c.C(R++, Ga, bb)))
}
if (null !== d && T) {
if (null !== h) {
if (c.computeSpot(!0).pd()) {
var vd = c.n(0), Ed = c.n(2);
vd.N(Ed) || c.Y(1, (vd.x + Ed.x) / 2, (vd.y + Ed.y) / 2)
}
V = c.getLinkPoint(e, h, Kb, !0, !1, g, k);
c.Y(0, V.x, V.y)
}
null !== k && (c.computeSpot(!1).pd() && (vd = c.n(c.ma - 1), Ed = c.n(c.ma - 3), vd.N(Ed) || c.Y(c.ma - 2, (vd.x + Ed.x) / 2, (vd.y + Ed.y) / 2)), V = c.getLinkPoint(g, k, Kb, !1, !1, e, h), c.Y(c.ma - 1, V.x, V.y))
}
c.Gi();
b.commit()
}
}
for (var Ud = new H(A), wd = this.network.edges.l, Vd; wd.next();)Vd = wd.value.link, null !== Vd && Vd.ac && !Ud.contains(Vd) && Ud.add(Vd);
if (0 < Ud.count)if (90 === this.ra || 270 === this.ra) {
for (var Dg = 0, Cb = new H(lp), mf = Ud.l, Ib, dc, Lb; mf.next();)if (Ib = mf.value, null !== Ib && Ib.ac)for (var Sa = 2; Sa < Ib.ma - 3; Sa++)if (dc = Ib.n(Sa), Lb = Ib.n(Sa + 1), this.I(dc.y, Lb.y) && !this.I(dc.x, Lb.x)) {
var jc = new lp;
jc.layer = Math.floor(dc.y / 2);
var Ie = Ib.n(0), If = Ib.n(Ib.ma - 1);
jc.eb = Ie.x * Ie.x + Ie.y;
jc.Wd = If.x * If.x + If.y;
jc.Be = Math.min(dc.x, Lb.x);
jc.Pd = Math.max(dc.x, Lb.x);
jc.index = Sa;
jc.link = Ib;
if (Sa + 2 < Ib.ma) {
var fg = Ib.n(Sa - 1), Fb = Ib.n(Sa + 2), fd = 0;
fg.y < dc.y ? fd = Fb.y < dc.y ? 3 : dc.x < Lb.x ? 2 : 1 : fg.y > dc.y && (fd = Fb.y > dc.y ? 0 : Lb.x < dc.x ? 2 : 1);
jc.Sh = fd
}
Cb.add(jc)
}
if (1 < Cb.count) {
Cb.sort(this.tF);
for (var qc = 0; qc < Cb.count;) {
for (var gd = Cb.p[qc].layer, Za = qc + 1; Za < Cb.count && Cb.p[Za].layer === gd;)Za++;
if (1 < Za - qc)for (var fb = qc; fb < Za;) {
for (var Xb = Cb.p[fb].Pd, ub = qc + 1; ub < Za && Cb.p[ub].Be < Xb;)Xb = Math.max(Xb, Cb.p[ub].Pd), ub++;
var kc = ub - fb;
if (1 < kc) {
Cb.Ip(this.Iw, fb, fb + kc);
for (var nf =
1, rc = Cb.p[fb].Wd, zb, Sa = fb; Sa < ub; Sa++)zb = Cb.p[Sa], zb.Wd !== rc && (nf++, rc = zb.Wd);
Cb.Ip(this.sF, fb, fb + kc);
for (var Wd = 1, rc = Cb.p[fb].eb, Sa = fb; Sa < ub; Sa++)zb = Cb.p[Sa], zb.eb !== rc && (Wd++, rc = zb.eb);
var Je, Ab;
nf < Wd ? (Je = !1, Ab = nf, rc = Cb.p[fb].Wd, Cb.Ip(this.Iw, fb, fb + kc)) : (Je = !0, Ab = Wd, rc = Cb.p[fb].eb);
for (var Fd = 0, Sa = fb; Sa < ub; Sa++) {
zb = Cb.p[Sa];
(Je ? zb.eb : zb.Wd) !== rc && (Fd++, rc = Je ? zb.eb : zb.Wd);
Ib = zb.link;
dc = Ib.n(zb.index);
Lb = Ib.n(zb.index + 1);
var Ke = this.lp * (Fd - (Ab - 1) / 2);
if (!Ib.Qi || mp(dc.x, dc.y + Ke, Lb.x, Lb.y + Ke))Dg++, Ib.wl(),
Ib.Y(zb.index, dc.x, dc.y + Ke), Ib.Y(zb.index + 1, Lb.x, Lb.y + Ke), Ib.Gi()
}
}
fb = ub
}
qc = Za
}
}
} else {
for (var me = 0, gb = new H(lp), of = Ud.l, Bb, $a, Oc; of.next();)if (Bb = of.value, null !== Bb && Bb.ac)for (var Mb = 2; Mb < Bb.ma - 3; Mb++)if ($a = Bb.n(Mb), Oc = Bb.n(Mb + 1), this.I($a.x, Oc.x) && !this.I($a.y, Oc.y)) {
var Gd = new lp;
Gd.layer = Math.floor($a.x / 2);
var Xd = Bb.n(0), Yd = Bb.n(Bb.ma - 1);
Gd.eb = Xd.x + Xd.y * Xd.y;
Gd.Wd = Yd.x + Yd.y * Yd.y;
Gd.Be = Math.min($a.y, Oc.y);
Gd.Pd = Math.max($a.y, Oc.y);
Gd.index = Mb;
Gd.link = Bb;
if (Mb + 2 < Bb.ma) {
var ne = Bb.n(Mb - 1), Pc = Bb.n(Mb +
2), xd = 0;
ne.x < $a.x ? xd = Pc.x < $a.x ? 3 : $a.y < Oc.y ? 2 : 1 : ne.x > $a.x && (xd = Pc.x > $a.x ? 0 : Oc.y < $a.y ? 2 : 1);
Gd.Sh = xd
}
gb.add(Gd)
}
if (1 < gb.count) {
gb.sort(this.tF);
for (var jb = 0; jb < gb.count;) {
for (var Le = gb.p[jb].layer, Me = jb + 1; Me < gb.count && gb.p[Me].layer === Le;)Me++;
if (1 < Me - jb)for (var mb = jb; mb < Me;) {
for (var oe = gb.p[mb].Pd, Db = jb + 1; Db < Me && gb.p[Db].Be < oe;)oe = Math.max(oe, gb.p[Db].Pd), Db++;
var lc = Db - mb;
if (1 < lc) {
gb.Ip(this.Iw, mb, mb + lc);
for (var yd = 1, sc = gb.p[mb].Wd, Nb, Mb = mb; Mb < Db; Mb++)Nb = gb.p[Mb], Nb.Wd !== sc && (yd++, sc = Nb.Wd);
gb.Ip(this.sF,
mb, mb + lc);
for (var Ne = 1, sc = gb.p[mb].eb, Mb = mb; Mb < Db; Mb++)Nb = gb.p[Mb], Nb.eb !== sc && (Ne++, sc = Nb.eb);
var kb, cb;
yd < Ne ? (kb = !1, cb = yd, sc = gb.p[mb].Wd, gb.Ip(this.Iw, mb, mb + lc)) : (kb = !0, cb = Ne, sc = gb.p[mb].eb);
for (var Jf = 0, Mb = mb; Mb < Db; Mb++) {
Nb = gb.p[Mb];
(kb ? Nb.eb : Nb.Wd) !== sc && (Jf++, sc = kb ? Nb.eb : Nb.Wd);
Bb = Nb.link;
$a = Bb.n(Nb.index);
Oc = Bb.n(Nb.index + 1);
var Dc = this.lp * (Jf - (cb - 1) / 2);
if (!Bb.Qi || mp($a.x + Dc, $a.y, Oc.x + Dc, Oc.y))me++, Bb.wl(), Bb.Y(Nb.index, $a.x + Dc, $a.y), Bb.Y(Nb.index + 1, Oc.x + Dc, Oc.y), Bb.Gi()
}
}
mb = Db
}
jb = Me
}
}
}
};
function lp() {
this.index = this.Pd = this.Be = this.Wd = this.eb = this.layer = 0;
this.link = null;
this.Sh = 0
}
t.je(lp, {layer: !0, eb: !0, Wd: !0, Be: !0, Pd: !0, index: !0, link: !0, Sh: !0});
Kk.prototype.tF = function (a, b) {
return a instanceof lp && b instanceof lp && a !== b ? a.layer < b.layer ? -1 : a.layer > b.layer ? 1 : a.Be < b.Be ? -1 : a.Be > b.Be ? 1 : a.Pd < b.Pd ? -1 : a.Pd > b.Pd ? 1 : 0 : 0
};
Kk.prototype.sF = function (a, b) {
return a instanceof lp && b instanceof lp && a !== b ? a.eb < b.eb ? -1 : a.eb > b.eb || a.Sh < b.Sh ? 1 : a.Sh > b.Sh || a.Be < b.Be ? -1 : a.Be > b.Be ? 1 : a.Pd < b.Pd ? -1 : a.Pd > b.Pd ? 1 : 0 : 0
};
Kk.prototype.Iw = function (a, b) {
return a instanceof lp && b instanceof lp && a !== b ? a.Wd < b.Wd ? -1 : a.Wd > b.Wd || a.Sh < b.Sh ? 1 : a.Sh > b.Sh || a.Be < b.Be ? -1 : a.Be > b.Be ? 1 : a.Pd < b.Pd ? -1 : a.Pd > b.Pd ? 1 : 0 : 0
};
Kk.prototype.I = function (a, b) {
f && (t.o(a, Kk, "isApprox:a"), t.o(b, Kk, "isApprox:b"));
var c = a - b;
return-1 < c && 1 > c
};
function mp(a, b, c, d) {
f && (t.o(a, Kk, "isUnoccupied2:px"), t.o(b, Kk, "isUnoccupied2:py"), t.o(c, Kk, "isUnoccupied2:qx"), t.o(d, Kk, "isUnoccupied2:qy"));
return!0
}
function Co(a, b) {
var c, d = a.Hd[b];
if (d >= a.Mg.length) {
c = [];
var e;
for (e = 0; e < a.Mg.length; e++)c[e] = a.Mg[e];
a.Mg = c
}
"undefined" === typeof a.Mg[d] || null === a.Mg[d] ? c = [] : (c = a.Mg[d], a.Mg[d] = null);
var d = a.tr[b], g;
for (e = 0; e < d.length; e++)g = d[e], g instanceof np && (c[g.index] = g);
return c
}
function Do(a, b, c) {
a.Mg[a.Hd[b]] = c
}
t.g(Kk, "layerSpacing", Kk.prototype.layerSpacing);
t.defineProperty(Kk, {layerSpacing: "layerSpacing"}, function () {
return this.Wn
}, function (a) {
this.Wn !== a && "number" === typeof a && 0 <= a && (this.Wn = a, this.K())
});
t.g(Kk, "columnSpacing", Kk.prototype.pH);
t.defineProperty(Kk, {pH: "columnSpacing"}, function () {
return this.Gd
}, function (a) {
this.Gd !== a && "number" === typeof a && 0 <= a && (this.Gd = a, this.K())
});
t.g(Kk, "direction", Kk.prototype.direction);
t.defineProperty(Kk, {direction: "direction"}, function () {
return this.ra
}, function (a) {
this.ra !== a && "number" === typeof a && (this.ra = a, this.K())
});
t.g(Kk, "cycleRemoveOption", Kk.prototype.BD);
t.defineProperty(Kk, {BD: "cycleRemoveOption"}, function () {
return this.un
}, function (a) {
this.un !== a && (f && t.k(a, la, fo, "cycleRemoveOption"), a === ho || a === $n) && (this.un = a, this.K())
});
t.g(Kk, "layeringOption", Kk.prototype.FE);
t.defineProperty(Kk, {FE: "layeringOption"}, function () {
return this.Xn
}, function (a) {
this.Xn !== a && (f && t.k(a, la, fo, "layeringOption"), a === ao || a === Oo || a === Qo) && (this.Xn = a, this.K())
});
t.g(Kk, "initializeOption", Kk.prototype.vE);
t.defineProperty(Kk, {vE: "initializeOption"}, function () {
return this.Nn
}, function (a) {
this.Nn !== a && (f && t.k(a, la, fo, "initializeOption"), a === bo || a === Wo || a === Uo) && (this.Nn = a, this.K())
});
t.g(Kk, "iterations", Kk.prototype.xI);
t.defineProperty(Kk, {xI: "iterations"}, function () {
return this.Wl
}, function (a) {
f && t.o(a, fo, "iterations");
this.Wl !== a && "number" === typeof a && 0 <= a && (this.Wl = a, this.K())
});
t.g(Kk, "aggressiveOption", Kk.prototype.eD);
t.defineProperty(Kk, {eD: "aggressiveOption"}, function () {
return this.nn
}, function (a) {
this.nn !== a && (f && t.k(a, la, fo, "cycleRemoveOption"), a === $o || a === co || a === ap) && (this.nn = a, this.K())
});
t.g(Kk, "packOption", Kk.prototype.SI);
t.defineProperty(Kk, {SI: "packOption"}, function () {
return this.qi
}, function (a) {
this.qi !== a && "number" === typeof a && 0 <= a && 8 > a && (this.qi = a, this.K())
});
t.g(Kk, "setsPortSpots", Kk.prototype.vl);
t.defineProperty(Kk, {vl: "setsPortSpots"}, function () {
return this.wh
}, function (a) {
this.wh !== a && "boolean" === typeof a && (this.wh = a, this.K())
});
t.g(Kk, "linkSpacing", Kk.prototype.lp);
t.defineProperty(Kk, {lp: "linkSpacing"}, function () {
return this.tj
}, function (a) {
this.tj !== a && (this.tj = a, this.K())
});
t.A(Kk, {AJ: "maxLayer"}, function () {
return this.ob
});
t.A(Kk, {yJ: "maxIndex"}, function () {
return this.Eu
});
t.A(Kk, {xJ: "maxColumn"}, function () {
return this.Ib
});
t.A(Kk, {BJ: "minIndexLayer"}, function () {
return this.mr
});
t.A(Kk, {zJ: "maxIndexLayer"}, function () {
return this.Bf
});
var $n;
Kk.CycleDepthFirst = $n = t.w(Kk, "CycleDepthFirst", 0);
var ho;
Kk.CycleGreedy = ho = t.w(Kk, "CycleGreedy", 1);
var ao;
Kk.LayerOptimalLinkLength = ao = t.w(Kk, "LayerOptimalLinkLength", 0);
var Oo;
Kk.LayerLongestPathSink = Oo = t.w(Kk, "LayerLongestPathSink", 1);
var Qo;
Kk.LayerLongestPathSource = Qo = t.w(Kk, "LayerLongestPathSource", 2);
var bo;
Kk.InitDepthFirstOut = bo = t.w(Kk, "InitDepthFirstOut", 0);
var Wo;
Kk.InitDepthFirstIn = Wo = t.w(Kk, "InitDepthFirstIn", 1);
var Uo;
Kk.InitNaive = Uo = t.w(Kk, "InitNaive", 2);
var $o;
Kk.AggressiveNone = $o = t.w(Kk, "AggressiveNone", 0);
var co;
Kk.AggressiveLess = co = t.w(Kk, "AggressiveLess", 1);
var ap;
Kk.AggressiveMore = ap = t.w(Kk, "AggressiveMore", 2);
Kk.PackNone = 0;
var bp;
Kk.PackExpand = bp = 1;
var cp;
Kk.PackStraighten = cp = 2;
var ep;
Kk.PackMedian = ep = 4;
var eo;
Kk.PackAll = eo = 7;
function fo() {
Aa.call(this)
}
t.ia("LayeredDigraphNetwork", fo);
t.Oa(fo, Aa);
fo.prototype.createVertex = function () {
return new np
};
fo.prototype.createEdge = function () {
return new op
};
function np() {
Ba.call(this);
this.index = this.column = this.layer = -1;
this.component = NaN;
this.near = null;
this.valid = !1;
this.finish = this.Lo = NaN;
this.ym = 0;
this.zA = this.AA = void 0
}
t.ia("LayeredDigraphVertex", np);
t.Oa(np, Ba);
function op() {
Da.call(this);
this.forest = this.rev = this.valid = !1;
this.portToPos = this.portFromPos = NaN;
this.portToColOffset = this.portFromColOffset = 0
}
t.ia("LayeredDigraphEdge", op);
t.Oa(op, Da);
function Z() {
0 < arguments.length && t.m("TreeLayout constructor cannot take any arguments.");
le.call(this);
this.Nc = new ta(Object);
this.si = pp;
this.yf = qp;
this.ks = rp;
this.hh = !0;
this.hd = sp;
this.Sf = (new oa(10, 10)).freeze();
this.ta = new tp;
this.sa = new tp
}
t.ia("TreeLayout", Z);
t.Oa(Z, le);
Z.prototype.cloneProtected = function (a) {
le.prototype.cloneProtected.call(this, a);
a.si = this.si;
a.ks = this.ks;
a.hh = this.hh;
a.hd = this.hd;
a.Sf.assign(this.Sf);
a.ta.copyInheritedPropertiesFrom(this.ta);
a.sa.copyInheritedPropertiesFrom(this.sa)
};
Z.prototype.createNetwork = function () {
var a = new up;
on(a, this);
return a
};
Z.prototype.makeNetwork = function (a) {
var b = this.createNetwork();
a instanceof u ? (vp(this, b, a.Xi, !0), vp(this, b, a.links, !0)) : a instanceof z ? vp(this, b, a.Hc, !1) : vp(this, b, a.l, !1);
return b
};
function vp(a, b, c, d) {
for (c = c.l; c.next();) {
var e = c.value;
e instanceof y && e.canLayout() && "Comment" !== e.Pc && (!d || e.ep) && (e.Hh || (e instanceof z && null === e.Tb ? vp(a, b, e.Hc, !1) : b.vo(e)))
}
for (c.reset(); c.next();)if (e = c.value, e instanceof A && e.canLayout() && "Comment" !== e.Pc && (!d || e.ep)) {
var g = e.da;
a = e.ja;
null !== g && null !== a && g !== a && "Comment" !== g.Pc && "Comment" !== a.Pc && (g = b.bw(g), a = b.bw(a), null !== g && null !== a && b.Um(g, a, e))
}
}
Z.prototype.doLayout = function (a) {
a || t.m("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.Oe !== wp && (this.yd = this.hA(this.yd));
var b = this.h;
null === b && a instanceof u && (b = a);
this.yf = this.path === pp && null !== b ? b.ed ? qp : xp : this.path === pp ? qp : this.path;
if (0 < this.network.vertexes.count) {
this.network.Xv();
for (b = this.network.vertexes.l; b.next();)a = b.value, a.initialized = !1, a.level = 0, a.parent = null,
a.children = [];
if (0 < this.Nc.count)for (b = this.Nc.l, this.Nc = new ta(tp); b.next();)a = b.value, a instanceof y ? (a = this.network.Mm(a), null !== a && this.Nc.add(a)) : a instanceof tp && this.Nc.add(a);
if (0 === this.Nc.count) {
for (a = this.network.vertexes.l; a.next();)switch (b = a.value, this.yf) {
case qp:
0 === b.hc.count && this.Nc.add(b);
break;
case xp:
0 === b.Zb.count && this.Nc.add(b);
break;
default:
t.m("Unhandled path value " + this.yf.toString())
}
if (0 === this.Nc.count) {
a = 999999;
for (var b = null, c = this.network.vertexes.l; c.next();) {
var d =
c.value;
switch (this.yf) {
case qp:
d.hc.count < a && (a = d.hc.count, b = d);
break;
case xp:
d.Zb.count < a && (a = d.Zb.count, b = d);
break;
default:
t.m("Unhandled path value " + this.yf.toString())
}
}
null !== b && this.Nc.add(b)
}
}
for (b = this.Nc.l; b.next();)a = b.value, a.initialized || (a.initialized = !0, yp(this, a));
for (a = this.Nc.l; a.next();)zp(this, a.value);
for (a = this.Nc.l; a.next();)Ap(this, a.value);
for (a = this.Nc.l; a.next();)Bp(this, a.value);
this.Bz();
for (a = this.Nc.l; a.next();)Cp(this, a.value);
this.arrangeTrees();
this.updateParts()
}
this.network =
null;
this.Nc = new ta(Object);
this.pf = !0
};
function yp(a, b) {
f && t.k(b, tp, Z, "walkTree:v");
if (null !== b) {
switch (a.yf) {
case qp:
if (0 < b.Zb.count) {
for (var c = new H(tp), d = b.GH; d.next();) {
var e = d.value;
Dp(a, b, e) && c.add(e)
}
0 < c.count && (b.children = c.af())
}
break;
case xp:
if (0 < b.hc.count) {
c = new H(tp);
for (d = b.dJ; d.next();)e = d.value, Dp(a, b, e) && c.add(e);
0 < c.count && (b.children = c.af())
}
break;
default:
t.m("Unhandled path value" + a.yf.toString())
}
for (var c = b.children, d = c.length, g = 0; g < d; g++)e = c[g], e.initialized = !0, e.level = b.level + 1, e.parent = b, a.Nc.remove(e);
for (g = 0; g <
d; g++)e = c[g], yp(a, e)
}
}
function Dp(a, b, c) {
f && t.k(b, tp, Z, "walkOK:v");
f && t.k(c, tp, Z, "walkOK:c");
if (c.initialized) {
var d;
f && t.k(c, tp, Z, "isAncestor:a");
f && t.k(b, tp, Z, "isAncestor:b");
if (null === b)d = !1; else {
for (d = b.parent; null !== d && d !== c;)d = d.parent;
d = d === c
}
if (d || c.level > b.level)return!1;
a.removeChild(c.parent, c)
}
return!0
}
Z.prototype.removeChild = function (a, b) {
f && t.k(a, tp, Z, "removeChild:p");
f && t.k(b, tp, Z, "removeChild:c");
if (null !== a && null !== b) {
for (var c = a.children, d = 0, e = 0; e < c.length; e++)c[e] === b && d++;
if (0 < d) {
for (var d = Array(c.length - d), g = 0, e = 0; e < c.length; e++)c[e] !== b && (d[g++] = c[e]);
a.children = d
}
}
};
function zp(a, b) {
f && t.k(b, tp, Z, "initializeTree:v");
if (null !== b) {
a.initializeTreeVertexValues(b);
b.alignment === Ep && a.sortTreeVertexChildren(b);
for (var c = 0, d = b.Cm, e = 0, g = b.children, h = g.length, k = 0; k < h; k++) {
var l = g[k];
zp(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 Fp(a, b) {
f && t.k(b, tp, Z, "mom:v");
switch (a.ks) {
default:
case rp:
return null !== b.parent ? b.parent : a.ta;
case Gp:
return null === b.parent ? a.ta : null === b.parent.parent ? a.sa : b.parent;
case Hp:
if (null !== b.parent)return null !== b.parent.parent ? b.parent.parent : a.sa;
case Ip:
var c = !0;
if (0 === b.Cm)c = !1; else for (var d = b.children, e = d.length, g = 0; g < e; g++)if (0 < d[g].Cm) {
c = !1;
break
}
return c && null !== b.parent ? a.sa : null !== b.parent ? b.parent : a.ta
}
}
Z.prototype.initializeTreeVertexValues = function (a) {
f && t.k(a, tp, Z, "initializeTreeVertexValues:v");
var b = Fp(this, a);
a.copyInheritedPropertiesFrom(b);
if (null !== a.parent && a.parent.alignment === Ep) {
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 Ap(a, b) {
f && t.k(b, tp, Z, "assignTree:v");
if (null !== b) {
a.assignTreeVertexValues(b);
for (var c = b.children, d = c.length, e = 0; e < d; e++)Ap(a, c[e])
}
}
Z.prototype.assignTreeVertexValues = function () {
};
function Bp(a, b) {
f && t.k(b, tp, Z, "sortTree:v");
if (null !== b) {
b.alignment !== Ep && a.sortTreeVertexChildren(b);
for (var c = b.children, d = c.length, e = 0; e < d; e++)Bp(a, c[e])
}
}
Z.prototype.sortTreeVertexChildren = function (a) {
f && t.k(a, tp, Z, "sortTreeVertexChildren:v");
switch (a.sorting) {
case Jp:
break;
case Kp:
a.children.reverse();
break;
case Lp:
a.children.sort(a.comparer);
break;
case Mp:
a.children.sort(a.comparer);
a.children.reverse();
break;
default:
t.m("Unhandled sorting value " + a.sorting.toString())
}
};
Z.prototype.Bz = function () {
if (this.comments)for (var a = this.network.vertexes.l; a.next();)this.addComments(a.value)
};
Z.prototype.addComments = function (a) {
f && t.k(a, tp, Z, "addComments:v");
var b = a.angle, c = a.parent, d = 0, e = Np, e = !1;
null !== c && (d = c.angle, e = c.alignment, e = Op(e));
var b = 90 === b || 270 === b, d = 90 === d || 270 === d, c = 0 === a.Cm, g = 0, h = 0, k = 0, l = a.commentSpacing;
if (null !== a.Ic)for (var m = a.Ic.WD(); m.next();) {
var n = m.value;
"Comment" === n.Pc && n.zb() && (null === a.comments && (a.comments = []), a.comments.push(n), n.Hf(), n = n.Ea, 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 = t.kk(0, 0, a.S.width + g, a.S.height + h), a.Mb = e, t.Qc(e))
};
function Op(a) {
return a === Pp || a === Ep || a === Qp || a === Rp
}
function Sp(a) {
return a === Pp || a === Ep
}
function Tp(a) {
f && t.k(a, tp, Z, "isLeftSideBus:v");
var b = a.parent;
if (null !== b) {
var c = b.alignment;
if (Op(c)) {
if (Sp(c)) {
b = b.children;
for (c = 0; c < b.length && a !== b[c];)c++;
return 0 === c % 2
}
if (c === Qp)return!0
}
}
return!1
}
Z.prototype.layoutComments = function (a) {
f && t.k(a, tp, Z, "layoutComments:v");
if (null !== a.comments) {
var b = a.Ic.Ea, c = a.parent, d = a.angle, e = 0, g = Np, g = !1;
null !== c && (e = c.angle, g = c.alignment, g = Op(g));
for (var d = 90 === d || 270 === d, h = 90 === e || 270 === e, k = 0 === a.Cm, l = Tp(a), m = 0, n = a.comments, p = n.length, q = t.O(), r = 0; r < p; r++) {
var c = n[r], s = c.Ea;
if (d && !k || !g && !h && k || g && h && k) {
if (135 < e && !g || h && l)if (0 <= a.commentMargin) {
q.q(a.S.x - a.commentMargin - s.width, a.S.y + m);
c.location = q;
for (var v = c.mg(); v.next();)c = v.value, c.lb = ac, c.mb = bc
} else for (q.q(a.S.x +
2 * a.P.x - a.commentMargin, a.S.y + m), c.location = q, v = c.mg(); v.next();)c = v.value, c.lb = bc, c.mb = ac; else if (0 <= a.commentMargin)for (q.q(a.S.x + 2 * a.P.x + a.commentMargin, a.S.y + m), c.location = q, v = c.mg(); v.next();)c = v.value, c.lb = bc, c.mb = ac; else for (q.q(a.S.x + a.commentMargin - s.width, a.S.y + m), c.location = q, v = c.mg(); v.next();)c = v.value, c.lb = ac, c.mb = bc;
m = 0 <= a.commentSpacing ? m + (s.height + a.commentSpacing) : m + (a.commentSpacing - s.height)
} else {
if (135 < e && !g || !h && l)if (0 <= a.commentMargin)for (q.q(a.S.x + m, a.S.y - a.commentMargin - s.height),
c.location = q, v = c.mg(); v.next();)c = v.value, c.lb = $b, c.mb = cc; else for (q.q(a.S.x + m, a.S.y + 2 * a.P.y - a.commentMargin), c.location = q, v = c.mg(); v.next();)c = v.value, c.lb = cc, c.mb = $b; else if (0 <= a.commentMargin)for (q.q(a.S.x + m, a.S.y + 2 * a.P.y + a.commentMargin), c.location = q, v = c.mg(); v.next();)c = v.value, c.lb = cc, c.mb = $b; else for (q.q(a.S.x + m, a.S.y + a.commentMargin - s.height), c.location = q, v = c.mg(); v.next();)c = v.value, c.lb = $b, c.mb = cc;
m = 0 <= a.commentSpacing ? m + (s.width + a.commentSpacing) : m + (a.commentSpacing - s.width)
}
}
t.B(q);
b =
m - a.commentSpacing - (d ? b.height : b.width);
if (this.yf === qp)for (a = a.Zb; a.next();)e = a.value, (c = e.link) && !c.Qi && (c.dk = 0 < b ? b : NaN); else for (a = a.hc; a.next();)e = a.value, (c = e.link) && !c.Qi && (c.lk = 0 < b ? b : NaN)
}
};
function Cp(a, b) {
f && t.k(b, tp, Z, "layoutTree:v");
if (null !== b) {
for (var c = b.children, d = c.length, e = 0; e < d; e++)Cp(a, c[e]);
switch (b.compaction) {
case Up:
Vp(a, b);
break;
case Wp:
if (b.alignment === Ep)Vp(a, b); else if (f && t.k(b, tp, Z, "layoutTreeBlock:v"), 0 === b.Cm) {
var e = b.parent, c = !1, d = 0, g = Np;
null !== e && (d = e.angle, g = e.alignment, c = Op(g));
e = Tp(b);
b.la.q(0, 0);
b.$a.q(b.width, b.height);
null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Ma.q(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Ma.q(b.width - 2 * b.P.x, 0) : b.Ma.q(0,
b.height - 2 * b.P.y);
b.Ys = null;
b.pt = null
} else {
for (var h = Xp(b), c = 90 === h || 270 === h, k = 0, l = b.children, m = l.length, n = 0; n < m; n++)var p = l[n], k = Math.max(k, c ? p.$a.width : p.$a.height);
var q = b.alignment, e = q === Yp, r = q === Zp, s = Op(q), v = Math.max(0, b.breadthLimit), d = $p(b), x = b.nodeSpacing, E = aq(b), F = b.rowSpacing, G = 0;
if (e || r || b.Bp || b.Cp && 1 === b.maxGenerationCount)G = Math.max(0, b.rowIndent);
var e = b.width, g = b.height, L = 0, N = 0, V = 0, T = null, W = null, ea = 0, R = 0, xa = 0, Ja = 0, Ma = 0, Na = 0, ya = 0, Ra = 0, p = 0;
s && !Sp(q) && 135 < h && l.reverse();
if (Sp(q))if (1 <
m)for (n = 0; n < m; n++)0 === n % 2 && n !== m - 1 ? Ra = Math.max(Ra, c ? l[n].$a.width : l[n].$a.height) : 0 !== n % 2 && (p = Math.max(p, c ? l[n].$a.width : l[n].$a.height)); else 1 === m && (Ra = c ? l[0].$a.width : l[0].$a.height);
if (s) {
switch (q) {
case Pp:
R = 135 > h ? bq(b, l, Ra, L, N) : cq(b, l, Ra, L, N);
Ra = R[0];
L = R[1];
N = R[2];
break;
case Qp:
for (n = 0; n < m; n++) {
var p = l[n], Ca = p.$a, T = 0 === Na ? 0 : F;
c ? (p.la.q(k - Ca.width, Ja + T), L = Math.max(L, Ca.width), N = Math.max(N, Ja + T + Ca.height), Ja += T + Ca.height) : (p.la.q(xa + T, k - Ca.height), L = Math.max(L, xa + T + Ca.width), N = Math.max(N, Ca.height),
xa += T + Ca.width);
Na++
}
break;
case Rp:
for (n = 0; n < m; n++)p = l[n], Ca = p.$a, T = 0 === Na ? 0 : F, c ? (p.la.q(x / 2 + b.P.x, Ja + T), L = Math.max(L, Ca.width), N = Math.max(N, Ja + T + Ca.height), Ja += T + Ca.height) : (p.la.q(xa + T, x / 2 + b.P.y), L = Math.max(L, xa + T + Ca.width), N = Math.max(N, Ca.height), xa += T + Ca.width), Na++
}
T = dq(a, 2);
W = dq(a, 2);
c ? (T[0].q(0, 0), T[1].q(0, N), W[0].q(L, 0)) : (T[0].q(0, 0), T[1].q(L, 0), W[0].q(0, N));
W[1].q(L, N)
} else for (n = 0; n < m; n++) {
p = l[n];
Ca = p.$a;
if (c) {
0 < v && 0 < Na && xa + x + Ca.width > v && (xa < k && eq(b, q, k - xa, 0, ya, n - 1), Ma++, Na = 0, ya = n, V = N, xa =
0, Ja = 135 < h ? -N - F : N + F);
fq(a, p, 0, Ja);
var ob = 0;
if (0 === Na) {
if (T = p.Ys, W = p.pt, ea = Ca.width, R = Ca.height, null === T || null === W || h !== Xp(p))T = dq(a, 2), W = dq(a, 2), T[0].q(0, 0), T[1].q(0, R), W[0].q(ea, 0), W[1].q(ea, R)
} else R = gq(a, b, p, T, W, ea, R), ob = R[0], T = R[1], W = R[2], ea = R[3], R = R[4], xa < Ca.width && 0 > ob && (hq(b, -ob, 0, ya, n - 1), iq(T, -ob, 0), iq(W, -ob, 0), ob = 0);
p.la.q(ob, Ja);
L = Math.max(L, ea);
N = Math.max(N, V + (0 === Ma ? 0 : F) + Ca.height);
xa = ea
} else {
0 < v && 0 < Na && Ja + x + Ca.height > v && (Ja < k && eq(b, q, 0, k - Ja, ya, n - 1), Ma++, Na = 0, ya = n, V = L, Ja = 0, xa = 135 < h ? -L -
F : L + F);
fq(a, p, xa, 0);
ob = 0;
if (0 === Na) {
if (T = p.Ys, W = p.pt, ea = Ca.width, R = Ca.height, null === T || null === W || h !== Xp(p))T = dq(a, 2), W = dq(a, 2), T[0].q(0, 0), T[1].q(ea, 0), W[0].q(0, R), W[1].q(ea, R)
} else R = gq(a, b, p, T, W, ea, R), ob = R[0], T = R[1], W = R[2], ea = R[3], R = R[4], Ja < Ca.height && 0 > ob && (hq(b, 0, -ob, ya, n - 1), iq(T, 0, -ob), iq(W, 0, -ob), ob = 0);
p.la.q(xa, ob);
N = Math.max(N, R);
L = Math.max(L, V + (0 === Ma ? 0 : F) + Ca.width);
Ja = R
}
Na++
}
0 < Ma && (c ? (N += Math.max(0, d), xa < L && eq(b, q, L - xa, 0, ya, m - 1), 0 < G && (r || hq(b, G, 0, 0, m - 1), L += G)) : (L += Math.max(0, d), Ja < N && eq(b,
q, 0, N - Ja, ya, m - 1), 0 < G && (r || hq(b, 0, G, 0, m - 1), N += G)));
r = k = 0;
switch (q) {
case jq:
c ? k += L / 2 - b.P.x - E / 2 : r += N / 2 - b.P.y - E / 2;
break;
case Np:
0 < Ma ? c ? k += L / 2 - b.P.x - E / 2 : r += N / 2 - b.P.y - E / 2 : c ? (n = l[0].la.x + l[0].Ma.x, Ra = l[m - 1].la.x + l[m - 1].Ma.x + 2 * l[m - 1].P.x, k += n + (Ra - n) / 2 - b.P.x - E / 2) : (n = l[0].la.y + l[0].Ma.y, Ra = l[m - 1].la.y + l[m - 1].Ma.y + 2 * l[m - 1].P.y, r += n + (Ra - n) / 2 - b.P.y - E / 2);
break;
case Yp:
c ? (k -= E, L += E) : (r -= E, N += E);
break;
case Zp:
c ? (k += L - b.width + E, L += E) : (r += N - b.height + E, N += E);
break;
case Pp:
c ? k = 1 < m ? k + (Ra + x / 2 - b.P.x) : k + (l[0].P.x - b.P.x +
l[0].Ma.x) : r = 1 < m ? r + (Ra + x / 2 - b.P.y) : r + (l[0].P.y - b.P.y + l[0].Ma.y);
break;
case Qp:
c ? k += L + x / 2 - b.P.x : r += N + x / 2 - b.P.y;
break;
case Rp:
break;
default:
t.m("Unhandled alignment value " + q.toString())
}
for (n = 0; n < m; n++)p = l[n], c ? p.la.q(p.la.x + p.Ma.x - k, p.la.y + (135 < h ? (s ? -N : -p.$a.height) + p.Ma.y - d : g + d + p.Ma.y)) : p.la.q(p.la.x + (135 < h ? (s ? -L : -p.$a.width) + p.Ma.x - d : e + d + p.Ma.x), p.la.y + p.Ma.y - r);
m = l = 0;
s ? c ? (L = kq(b, L, k), 0 > k && (k = 0), 135 < h && (r += N + d), N += g + d, q === Rp && (l += x / 2 + b.P.x), m += g + d) : (135 < h && (k += L + d), L += e + d, N = lq(b, N, r), 0 > r && (r = 0),
q === Rp && (m += x / 2 + b.P.y), l += e + d) : c ? (null === b.comments ? e > L && (q = mq(q, e - L, 0), l = q[0], m = q[1], L = e, k = 0) : L = kq(b, L, k), 0 > k && (l -= k, k = 0), 135 < h && (r += N + d), N = Math.max(Math.max(N, g), N + g + d), m += g + d) : (135 < h && (k += L + d), L = Math.max(Math.max(L, e), L + e + d), null === b.comments ? g > N && (q = mq(q, 0, g - N), l = q[0], m = q[1], N = g, r = 0) : N = lq(b, N, r), 0 > r && (m -= r, r = 0), l += e + d);
if (0 < Ma)h = dq(a, 4), q = dq(a, 4), c ? (h[2].q(0, g + d), h[3].q(h[2].x, N), q[2].q(L, h[2].y), q[3].q(q[2].x, h[3].y)) : (h[2].q(e + d, 0), h[3].q(L, h[2].y), q[2].q(h[2].x, N), q[3].q(h[3].x, q[2].y)); else {
h =
dq(a, T.length + 2);
q = dq(a, W.length + 2);
for (n = 0; n < T.length; n++)s = T[n], h[n + 2].q(s.x + l, s.y + m);
for (n = 0; n < W.length; n++)s = W[n], q[n + 2].q(s.x + l, s.y + m)
}
c ? (h[0].q(k, 0), h[1].q(h[0].x, g), h[2].y < h[1].y && (h[2].x > h[0].x ? h[2].assign(h[1]) : h[1].assign(h[2])), h[3].y < h[2].y && (h[3].x > h[0].x ? h[3].assign(h[2]) : h[2].assign(h[3])), q[0].q(k + e, 0), q[1].q(q[0].x, g), q[2].y < q[1].y && (q[2].x < q[0].x ? q[2].assign(q[1]) : q[1].assign(q[2])), q[3].y < q[2].y && (q[3].x < q[0].x ? q[3].assign(q[2]) : q[2].assign(q[3])), h[2].y -= d / 2, q[2].y -= d / 2) : (h[0].q(0,
r), h[1].q(e, h[0].y), h[2].x < h[1].x && (h[2].y > h[0].y ? h[2].assign(h[1]) : h[1].assign(h[2])), h[3].x < h[2].x && (h[3].y > h[0].y ? h[3].assign(h[2]) : h[2].assign(h[3])), q[0].q(0, r + g), q[1].q(e, q[0].y), q[2].x < q[1].x && (q[2].y < q[0].y ? q[2].assign(q[1]) : q[1].assign(q[2])), q[3].x < q[2].x && (q[3].y < q[0].y ? q[3].assign(q[2]) : q[2].assign(q[3])), h[2].x -= d / 2, q[2].x -= d / 2);
nq(a, T);
nq(a, W);
b.Ys = h;
b.pt = q;
b.Ma.q(k, r);
b.$a.q(L, N)
}
break;
default:
t.m("Unhandled compaction value " + b.compaction.toString())
}
}
}
function Vp(a, b) {
f && t.k(b, tp, Z, "layoutTreeNone:v");
if (0 === b.Cm) {
var c = !1, d = 0, e = Np;
null !== b.parent && (d = b.parent.angle, e = b.parent.alignment, c = Op(e));
e = Tp(b);
b.la.q(0, 0);
b.$a.q(b.width, b.height);
null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Ma.q(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Ma.q(b.width - 2 * b.P.x, 0) : b.Ma.q(0, b.height - 2 * b.P.y)
} else {
for (var c = Xp(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.$a.width : l.$a.height);
var m = b.alignment, n =
m === Yp, p = m === Zp, q = Op(m), r = Math.max(0, b.breadthLimit), s = $p(b), v = b.nodeSpacing, x = aq(b), E = n || p ? 0 : x / 2, F = b.rowSpacing, G = 0;
if (n || p || b.Bp || b.Cp && 1 === b.maxGenerationCount)G = Math.max(0, b.rowIndent);
var n = b.width, L = b.height, N = 0, V = 0, T = 0, W = 0, ea = 0, R = 0, xa = 0, Ja = 0, Ma = 0, Na = 0;
q && !Sp(m) && 135 < c && e.reverse();
if (Sp(m))if (1 < h)for (k = 0; k < h; k++) {
var l = e[k], ya = l.$a;
0 === k % 2 && k !== h - 1 ? Ma = Math.max(Ma, (d ? ya.width : ya.height) + oq(l) - v) : 0 !== k % 2 && (Na = Math.max(Na, (d ? ya.width : ya.height) + oq(l) - v))
} else 1 === h && (Ma = d ? e[0].$a.width : e[0].$a.height);
if (q)switch (m) {
case Pp:
case Ep:
V = 135 > c ? bq(b, e, Ma, N, V) : cq(b, e, Ma, N, V);
Ma = V[0];
N = V[1];
V = V[2];
break;
case Qp:
for (k = 0; k < h; k++)l = e[k], ya = l.$a, r = 0 === xa ? 0 : F, d ? (l.la.q(g - ya.width, ea + r), N = Math.max(N, ya.width), V = Math.max(V, ea + r + ya.height), ea += r + ya.height) : (l.la.q(W + r, g - ya.height), N = Math.max(N, W + r + ya.width), V = Math.max(V, ya.height), W += r + ya.width), xa++;
break;
case Rp:
for (g = 0; g < h; g++)l = e[g], ya = l.$a, r = 0 === xa ? 0 : F, d ? (l.la.q(v / 2 + b.P.x, ea + r), N = Math.max(N, ya.width), V = Math.max(V, ea + r + ya.height), ea += r + ya.height) : (l.la.q(W +
r, v / 2 + b.P.y), N = Math.max(N, W + r + ya.width), V = Math.max(V, ya.height), W += r + ya.width), xa++
} else for (k = 0; k < h; k++)l = e[k], ya = l.$a, d ? (0 < r && 0 < xa && W + v + ya.width > r && (W < g && eq(b, m, g - W, 0, Ja, k - 1), R++, xa = 0, Ja = k, T = V, W = 0, ea = 135 < c ? -V - F : V + F), Na = 0 === xa ? E : v, fq(a, l, 0, ea), l.la.q(W + Na, ea), N = Math.max(N, W + Na + ya.width), V = Math.max(V, T + (0 === R ? 0 : F) + ya.height), W += Na + ya.width) : (0 < r && 0 < xa && ea + v + ya.height > r && (ea < g && eq(b, m, 0, g - ea, Ja, k - 1), R++, xa = 0, Ja = k, T = N, ea = 0, W = 135 < c ? -N - F : N + F), Na = 0 === xa ? E : v, fq(a, l, W, 0), l.la.q(W, ea + Na), V = Math.max(V, ea +
Na + ya.height), N = Math.max(N, T + (0 === R ? 0 : F) + ya.width), ea += Na + ya.height), xa++;
0 < R && (d ? (V += Math.max(0, s), W < N && eq(b, m, N - W, 0, Ja, h - 1), 0 < G && (p || hq(b, G, 0, 0, h - 1), N += G)) : (N += Math.max(0, s), ea < V && eq(b, m, 0, V - ea, Ja, h - 1), 0 < G && (p || hq(b, 0, G, 0, h - 1), V += G)));
G = p = 0;
switch (m) {
case jq:
d ? p += N / 2 - b.P.x - x / 2 : G += V / 2 - b.P.y - x / 2;
break;
case Np:
0 < R ? d ? p += N / 2 - b.P.x - x / 2 : G += V / 2 - b.P.y - x / 2 : d ? (m = e[0].la.x + e[0].Ma.x, v = e[h - 1].la.x + e[h - 1].Ma.x + 2 * e[h - 1].P.x, p += m + (v - m) / 2 - b.P.x - x / 2) : (m = e[0].la.y + e[0].Ma.y, v = e[h - 1].la.y + e[h - 1].Ma.y + 2 * e[h - 1].P.y,
G += m + (v - m) / 2 - b.P.y - x / 2);
break;
case Yp:
d ? (p -= x, N += x) : (G -= x, V += x);
break;
case Zp:
d ? (p += N - b.width + x, N += x) : (G += V - b.height + x, V += x);
break;
case Pp:
case Ep:
d ? p = 1 < h ? p + (Ma + v / 2 - b.P.x) : p + (e[0].P.x - b.P.x + e[0].Ma.x) : G = 1 < h ? G + (Ma + v / 2 - b.P.y) : G + (e[0].P.y - b.P.y + e[0].Ma.y);
break;
case Qp:
d ? p += N + v / 2 - b.P.x : G += V + v / 2 - b.P.y;
break;
case Rp:
break;
default:
t.m("Unhandled alignment value " + m.toString())
}
for (k = 0; k < h; k++)l = e[k], d ? l.la.q(l.la.x + l.Ma.x - p, l.la.y + (135 < c ? (q ? -V : -l.$a.height) + l.Ma.y - s : L + s + l.Ma.y)) : l.la.q(l.la.x + (135 < c ? (q ?
-N : -l.$a.width) + l.Ma.x - s : n + s + l.Ma.x), l.la.y + l.Ma.y - G);
d ? (N = kq(b, N, p), 0 > p && (p = 0), 135 < c && (G += V + s), V += L + s) : (135 < c && (p += N + s), N += n + s, V = lq(b, V, G), 0 > G && (G = 0));
b.Ma.q(p, G);
b.$a.q(N, V)
}
}
function bq(a, b, c, d, e) {
f && t.k(a, tp, Z, "layoutBusChildrenPosDir:v");
var g = b.length;
if (0 === g)return a = [], a[0] = c, a[1] = d, a[2] = e, a;
if (1 === g) {
var h = b[0];
d = h.$a.width;
e = h.$a.height;
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
for (var k = a.nodeSpacing, l = a.rowSpacing, m = 90 === Xp(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.$a, v = 0 === n ? 0 : l;
if (m) {
var x = oq(h) - k;
h.la.q(c - (s.width + x), q + v);
d = Math.max(d, s.width + x);
e = Math.max(e, q + v + s.height);
q += v + s.height
} else x = oq(h) - k, h.la.q(p + v, c - (s.height + x)), e = Math.max(e,
s.height + x), d = Math.max(d, p + v + s.width), p += v + s.width;
n++
}
var n = 0, E = p, F = 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.$a, v = 0 === n ? 0 : l, m ? (x = oq(h) - k, h.la.q(p + x, q + v), d = Math.max(d, p + s.width + x), e = Math.max(e, q + v + s.height), q += v + s.height) : (x = oq(h) - k, h.la.q(p + v, q + x), d = Math.max(d, p + v + s.width), e = Math.max(e, q + s.height + x), p += v + s.width), n++);
1 < g && 1 === g % 2 && (h = b[g - 1], s = h.$a, b = pq(h, m ? Math.max(Math.abs(F), Math.abs(q)) : Math.max(Math.abs(E), Math.abs(p))), m ? (h.la.q(c + k / 2 - h.P.x - h.Ma.x, e + b), m = c + k / 2 - h.P.x -
h.Ma.x, d = Math.max(d, m + s.width), 0 > m && (d -= m), e = Math.max(e, Math.max(F, q) + b + s.height), 0 > h.la.x && (c = vq(a, h.la.x, !1, c, k))) : (h.la.q(d + b, c + k / 2 - h.P.y - h.Ma.y), d = Math.max(d, Math.max(E, p) + b + s.width), m = c + k / 2 - h.P.y - h.Ma.y, e = Math.max(e, m + s.height), 0 > m && (e -= m), 0 > h.la.y && (c = vq(a, h.la.y, !0, c, k))));
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
function cq(a, b, c, d, e) {
f && t.k(a, tp, Z, "layoutBusChildrenNegDir:v");
var g = b.length;
if (0 === g)return a = [], a[0] = c, a[1] = d, a[2] = e, a;
if (1 === g) {
var h = b[0];
d = h.$a.width;
e = h.$a.height;
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
for (var k = a.nodeSpacing, l = a.rowSpacing, m = 270 === Xp(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.$a, v = 0 === n ? 0 : l;
if (m) {
var x = oq(h) - k, q = q - (v + s.height);
h.la.q(c - (s.width + x), q);
d = Math.max(d, s.width + x);
e = Math.max(e, Math.abs(q))
} else x = oq(h) - k, p -= v + s.width, h.la.q(p, c - (s.height +
x)), e = Math.max(e, s.height + x), d = Math.max(d, Math.abs(p));
n++
}
var n = 0, E = p, F = 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.$a, v = 0 === n ? 0 : l, m ? (x = oq(h) - k, q -= v + s.height, h.la.q(p + x, q), d = Math.max(d, p + s.width + x), e = Math.max(e, Math.abs(q))) : (x = oq(h) - k, p -= v + s.width, h.la.q(p, q + x), e = Math.max(e, q + s.height + x), d = Math.max(d, Math.abs(p))), n++);
1 < g && 1 === g % 2 && (h = b[g - 1], s = h.$a, l = pq(h, m ? Math.max(Math.abs(F), Math.abs(q)) : Math.max(Math.abs(E), Math.abs(p))), m ? (h.la.q(c + k / 2 - h.P.x - h.Ma.x, -e - s.height - l), p = c +
k / 2 - h.P.x - h.Ma.x, d = Math.max(d, p + s.width), 0 > p && (d -= p), e = Math.max(e, Math.abs(Math.min(F, q)) + l + s.height), 0 > h.la.x && (c = vq(a, h.la.x, !1, c, k))) : (h.la.q(-d - s.width - l, c + k / 2 - h.P.y - h.Ma.y), d = Math.max(d, Math.abs(Math.min(E, p)) + l + s.width), p = c + k / 2 - h.P.y - h.Ma.y, e = Math.max(e, p + s.height), 0 > p && (e -= p), 0 > h.la.y && (c = vq(a, h.la.y, !0, c, k))));
for (r = 0; r < g; r++)h = b[r], m ? h.la.q(h.la.x, h.la.y + e) : h.la.q(h.la.x + d, h.la.y);
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
return a
}
function oq(a) {
f && t.k(a, tp, Z, "fixRelativePostions:child");
return null === a.parent ? 0 : a.parent.nodeSpacing
}
function pq(a) {
f && t.k(a, tp, Z, "fixRelativePostions:lastchild");
return null === a.parent ? 0 : a.parent.rowSpacing
}
function vq(a, b, c, d, e) {
f && t.k(a, tp, Z, "fixRelativePostions:v");
a = a.children;
for (var g = a.length, h = 0; h < g; h++)c ? a[h].la.q(a[h].la.x, a[h].la.y - b) : a[h].la.q(a[h].la.x - b, a[h].la.y);
b = a[g - 1];
return Math.max(d, c ? b.Ma.y + b.P.y - e / 2 : b.Ma.x + b.P.x - e / 2)
}
function kq(a, b, c) {
f && t.k(a, tp, Z, "calculateSubwidth:v");
switch (a.alignment) {
case Np:
case jq:
var d = b;
c + a.width > d && (d = c + a.width);
0 > c && (d -= c);
return d;
case Yp:
return a.width > b ? a.width : b;
case Zp:
return 2 * a.P.x > b ? a.width : b + a.width - 2 * a.P.x;
case Pp:
case Ep:
return d = Math.min(0, c), c = Math.max(b, c + a.width), Math.max(a.width, c - d);
case Qp:
return a.width - a.P.x + a.nodeSpacing / 2 + b;
case Rp:
return Math.max(a.width, a.P.x + a.nodeSpacing / 2 + b);
default:
return b
}
}
function lq(a, b, c) {
f && t.k(a, tp, Z, "calculateSubheight:v");
switch (a.alignment) {
case Np:
case jq:
var d = b;
c + a.height > d && (d = c + a.height);
0 > c && (d -= c);
return d;
case Yp:
return a.height > b ? a.height : b;
case Zp:
return 2 * a.P.y > b ? a.height : b + a.height - 2 * a.P.y;
case Pp:
case Ep:
return d = Math.min(0, c), c = Math.max(b, c + a.height), Math.max(a.height, c - d);
case Qp:
return a.height - a.P.y + a.nodeSpacing / 2 + b;
case Rp:
return Math.max(a.height, a.P.y + a.nodeSpacing / 2 + b);
default:
return b
}
}
function mq(a, b, c) {
f && t.k(a, la, Z, "alignOffset:align");
switch (a) {
case jq:
b /= 2;
c /= 2;
break;
case Np:
b /= 2;
c /= 2;
break;
case Yp:
c = b = 0;
break;
case Zp:
break;
default:
t.m("Unhandled alignment value " + a.toString())
}
a = [];
a[0] = b;
a[1] = c;
return a
}
function eq(a, b, c, d, e, g) {
f && t.k(a, tp, Z, "shiftRelPosAlign:v");
f && t.k(b, la, Z, "shiftRelPosAlign:align");
b = mq(b, c, d);
hq(a, b[0], b[1], e, g)
}
function hq(a, b, c, d, e) {
f && t.k(a, tp, Z, "shiftRelPos:v");
if (0 !== b || 0 !== c)for (a = a.children; d <= e; d++) {
var g = a[d].la;
g.x += b;
g.y += c
}
}
function fq(a, b, c, d) {
f && (t.k(b, tp, Z, "recordMidPoints:v"), t.j(c, "number", Z, "recordMidPoints:x"), t.j(d, "number", Z, "recordMidPoints:y"));
var e = b.parent;
switch (a.yf) {
case qp:
for (a = b.hc; a.next();)b = a.value, b.fromVertex === e && b.Cr.q(c, d);
break;
case xp:
for (a = b.Zb; a.next();)b = a.value, b.toVertex === e && b.Cr.q(c, d);
break;
default:
t.m("Unhandled path value " + a.yf.toString())
}
}
function iq(a, b, c) {
for (var d = 0; d < a.length; d++) {
var e = a[d];
e.x += b;
e.y += c
}
}
function gq(a, b, c, d, e, g, h) {
f && t.k(b, tp, Z, "mergeFringes:parent");
f && t.k(c, tp, Z, "mergeFringes:child");
var k = Xp(b), l = 90 === k || 270 === k, m = b.nodeSpacing;
b = d;
var n = e;
d = g;
e = h;
var p = c.Ys, q = c.pt;
h = c.$a;
var r = l ? Math.max(e, h.height) : Math.max(d, h.width);
if (null === p || k !== Xp(c))p = dq(a, 2), q = dq(a, 2), l ? (p[0].q(0, 0), p[1].q(0, h.height), q[0].q(h.width, 0), q[1].q(q[0].x, p[1].y)) : (p[0].q(0, 0), p[1].q(h.width, 0), q[0].q(0, h.height), q[1].q(p[1].x, q[0].y));
if (l) {
c = d;
d = 9999999;
if (!(null === n || 2 > n.length || null === p || 2 > p.length))for (g =
e = 0; e < n.length && g < p.length;) {
var k = n[e], s = p[g], l = s.x, v = s.y, l = l + c, x = k;
e + 1 < n.length && (x = n[e + 1]);
var E = s, s = E.x, E = E.y;
g + 1 < p.length && (E = p[g + 1], s = E.x, E = E.y, s += c);
var F = d;
k.y === v ? F = l - k.x : k.y > v && k.y < E ? F = l + (k.y - v) / (E - v) * (s - l) - k.x : v > k.y && v < x.y && (F = l - (k.x + (v - k.y) / (x.y - k.y) * (x.x - k.x)));
F < d && (d = F);
x.y <= k.y ? e++ : E <= v ? g++ : (x.y <= E && e++, E <= x.y && g++)
}
c -= d;
c += m;
e = p;
g = c;
if (null === b || 2 > b.length || null === e || 2 > e.length)d = null; else {
m = dq(a, b.length + e.length);
for (d = l = k = 0; l < e.length && e[l].y < b[0].y;)v = e[l++], m[d++].q(v.x + g, v.y);
for (; k < b.length;)v = b[k++], m[d++].q(v.x, v.y);
for (k = b[b.length - 1].y; l < e.length && e[l].y <= k;)l++;
for (; l < e.length && e[l].y > k;)v = e[l++], m[d++].q(v.x + g, v.y);
e = dq(a, d);
for (k = 0; k < d; k++)e[k].assign(m[k]);
nq(a, m);
d = e
}
l = q;
v = c;
if (null === n || 2 > n.length || null === l || 2 > l.length)e = null; else {
m = dq(a, n.length + l.length);
for (g = x = e = 0; e < n.length && n[e].y < l[0].y;)k = n[e++], m[g++].q(k.x, k.y);
for (; x < l.length;)k = l[x++], m[g++].q(k.x + v, k.y);
for (l = l[l.length - 1].y; e < n.length && n[e].y <= l;)e++;
for (; e < n.length && n[e].y > l;)k = n[e++], m[g++].q(k.x,
k.y);
k = dq(a, g);
for (e = 0; e < g; e++)k[e].assign(m[e]);
nq(a, m);
e = k
}
g = Math.max(0, c) + h.width;
h = r
} else {
c = e;
d = 9999999;
if (!(null === n || 2 > n.length || null === p || 2 > p.length))for (g = e = 0; e < n.length && g < p.length;)k = n[e], s = p[g], l = s.x, v = s.y, v += c, x = k, e + 1 < n.length && (x = n[e + 1]), E = s, s = E.x, E = E.y, g + 1 < p.length && (E = p[g + 1], s = E.x, E = E.y, E += c), F = d, k.x === l ? F = v - k.y : k.x > l && k.x < s ? F = v + (k.x - l) / (s - l) * (E - v) - k.y : l > k.x && l < x.x && (F = v - (k.y + (l - k.x) / (x.x - k.x) * (x.y - k.y))), F < d && (d = F), x.x <= k.x ? e++ : s <= l ? g++ : (x.x <= s && e++, s <= x.x && g++);
c -= d;
c += m;
e = p;
g = c;
if (null === b || 2 > b.length || null === e || 2 > e.length)d = null; else {
m = dq(a, b.length + e.length);
for (d = l = k = 0; l < e.length && e[l].x < b[0].x;)v = e[l++], m[d++].q(v.x, v.y + g);
for (; k < b.length;)v = b[k++], m[d++].q(v.x, v.y);
for (k = b[b.length - 1].x; l < e.length && e[l].x <= k;)l++;
for (; l < e.length && e[l].x > k;)v = e[l++], m[d++].q(v.x, v.y + g);
e = dq(a, d);
for (k = 0; k < d; k++)e[k].assign(m[k]);
nq(a, m);
d = e
}
l = q;
v = c;
if (null === n || 2 > n.length || null === l || 2 > l.length)e = null; else {
m = dq(a, n.length + l.length);
for (g = x = e = 0; e < n.length && n[e].x < l[0].x;)k = n[e++], m[g++].q(k.x,
k.y);
for (; x < l.length;)k = l[x++], m[g++].q(k.x, k.y + v);
for (l = l[l.length - 1].x; e < n.length && n[e].x <= l;)e++;
for (; e < n.length && n[e].x > l;)k = n[e++], m[g++].q(k.x, k.y);
k = dq(a, g);
for (e = 0; e < g; e++)k[e].assign(m[e]);
nq(a, m);
e = k
}
g = r;
h = Math.max(0, c) + h.height
}
nq(a, b);
nq(a, p);
nq(a, n);
nq(a, q);
a = [];
a[0] = c;
a[1] = d;
a[2] = e;
a[3] = g;
a[4] = h;
return a
}
function dq(a, b) {
a.es || (a.es = []);
var c = a.es[b];
if (void 0 !== c && (c = c.pop(), void 0 !== c))return c;
for (var c = [], d = 0; d < b; d++)c[d] = new C;
return c
}
function nq(a, b) {
if (a.es) {
var c = b.length, d = a.es[c];
void 0 === d && (d = [], a.es[c] = d);
d.push(b)
}
}
Z.prototype.arrangeTrees = function () {
if (this.hd === wp)for (var a = this.Nc.l; a.next();) {
var b = a.value, c = b.Ic;
if (null !== c) {
var d = c.position, c = d.x, d = d.y;
isFinite(c) || (c = 0);
isFinite(d) || (d = 0);
wq(this, b, c, d)
}
} else for (a = this.yd, c = a.x, d = a.y, a = this.Nc.l; a.next();)switch (b = a.value, wq(this, b, c + b.Ma.x, d + b.Ma.y), this.hd) {
case sp:
d += b.$a.height + this.Sf.height;
break;
case xq:
c += b.$a.width + this.Sf.width;
break;
default:
t.m("Unhandled arrangement value " + this.hd.toString())
}
};
function wq(a, b, c, d) {
if (null !== b) {
f && t.k(b, tp, Z, "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];
wq(a, h, c + h.la.x, d + h.la.y)
}
}
}
Z.prototype.commitLayout = function () {
this.bB();
this.commitNodes();
this.Vs && this.commitLinks()
};
Z.prototype.commitNodes = function () {
for (var a = this.network.vertexes.l, b; a.next();)b = a.value, b.commit();
for (a.reset(); a.next();)b = a.value, this.layoutComments(b)
};
Z.prototype.commitLinks = function () {
for (var a = this.network.edges.l; a.next();)a.value.commit()
};
Z.prototype.bB = function () {
for (var a = this.Nc.l; a.next();)yq(this, a.value)
};
function yq(a, b) {
if (null !== b) {
f && t.k(b, tp, Z, "setPortSpotsTree:v");
a.setPortSpots(b);
for (var c = b.children, d = c.length, e = 0; e < d; e++)yq(a, c[e])
}
}
Z.prototype.setPortSpots = function (a) {
f && t.k(a, tp, Z, "setPortSpots:v");
var b = a.alignment;
if (Op(b)) {
f && t.k(a, tp, Z, "setPortSpotsBus:v");
f && t.k(b, la, Z, "setPortSpots:align");
var c = this.yf === qp, d = Xp(a), e;
switch (d) {
case 0:
e = bc;
break;
case 90:
e = cc;
break;
case 180:
e = ac;
break;
default:
e = $b
}
var g = a.children, h = g.length;
switch (b) {
case Pp:
case Ep:
for (b = 0; b < h; b++) {
var k = g[b], k = c ? k.hc : k.Zb;
if (k.next()) {
var l = k.value, l = l.link;
if (null !== l) {
var m = 90 === d || 270 === d ? ac : $b;
if (1 === h || b === h - 1 && 1 === h % 2)switch (d) {
case 0:
m = ac;
break;
case 90:
m = $b;
break;
case 180:
m = bc;
break;
default:
m = cc
} else 0 === b % 2 && (m = 90 === d || 270 === d ? bc : cc);
c ? (a.setsPortSpot && (l.lb = e), a.setsChildPortSpot && (l.mb = m)) : (a.setsPortSpot && (l.lb = m), a.setsChildPortSpot && (l.mb = e))
}
}
}
break;
case Qp:
m = 90 === d || 270 === d ? bc : cc;
for (k = c ? a.Zb : a.hc; k.next();)l = k.value, l = l.link, null !== l && (c ? (a.setsPortSpot && (l.lb = e), a.setsChildPortSpot && (l.mb = m)) : (a.setsPortSpot && (l.lb = m), a.setsChildPortSpot && (l.mb = e)));
break;
case Rp:
for (m = 90 === d || 270 === d ? ac : $b, k = c ? a.Zb : a.hc; k.next();)l = k.value, l =
l.link, null !== l && (c ? (a.setsPortSpot && (l.lb = e), a.setsChildPortSpot && (l.mb = m)) : (a.setsPortSpot && (l.lb = m), a.setsChildPortSpot && (l.mb = e)))
}
} else if (c = Xp(a), this.yf === qp)for (d = a.Zb; d.next();) {
if (e = d.value, e = e.link, null !== e) {
if (a.setsPortSpot)if (a.portSpot.Gc())switch (c) {
case 0:
e.lb = bc;
break;
case 90:
e.lb = cc;
break;
case 180:
e.lb = ac;
break;
default:
e.lb = $b
} else e.lb = a.portSpot;
if (a.setsChildPortSpot)if (a.childPortSpot.Gc())switch (c) {
case 0:
e.mb = ac;
break;
case 90:
e.mb = $b;
break;
case 180:
e.mb = bc;
break;
default:
e.mb =
cc
} else e.mb = a.childPortSpot
}
} else for (d = a.hc; d.next();)if (e = d.value, e = e.link, null !== e) {
if (a.setsPortSpot)if (a.portSpot.Gc())switch (c) {
case 0:
e.mb = bc;
break;
case 90:
e.mb = cc;
break;
case 180:
e.mb = ac;
break;
default:
e.mb = $b
} else e.mb = a.portSpot;
if (a.setsChildPortSpot)if (a.childPortSpot.Gc())switch (c) {
case 0:
e.lb = ac;
break;
case 90:
e.lb = $b;
break;
case 180:
e.lb = bc;
break;
default:
e.lb = cc
} else e.lb = a.childPortSpot
}
};
function Xp(a) {
a = a.angle;
return 45 >= a ? 0 : 135 >= a ? 90 : 225 >= a ? 180 : 315 >= a ? 270 : 0
}
function $p(a) {
f && t.k(a, tp, Z, "computeLayerSpacing:v");
var b = Xp(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 aq(a) {
f && t.k(a, tp, Z, "computeNodeIndent:v");
var b = Xp(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)
}
t.g(Z, "roots", Z.prototype.aJ);
t.defineProperty(Z, {aJ: "roots"}, function () {
return this.Nc
}, function (a) {
this.Nc !== a && (t.k(a, ta, Z, "roots"), this.Nc = a, this.K())
});
t.g(Z, "path", Z.prototype.path);
t.defineProperty(Z, {path: "path"}, function () {
return this.si
}, function (a) {
this.si !== a && (t.k(a, la, Z, "path"), this.si = a, this.K())
});
t.g(Z, "treeStyle", Z.prototype.XF);
t.defineProperty(Z, {XF: "treeStyle"}, function () {
return this.ks
}, function (a) {
this.hd !== a && (f && t.k(a, la, Z, "treeStyle"), a === rp || a === Hp || a === Ip || a === Gp) && (this.ks = a, this.K())
});
t.g(Z, "comments", Z.prototype.comments);
t.defineProperty(Z, {comments: "comments"}, function () {
return this.hh
}, function (a) {
this.hh !== a && (this.hh = a, this.K())
});
t.g(Z, "arrangement", Z.prototype.Oe);
t.defineProperty(Z, {Oe: "arrangement"}, function () {
return this.hd
}, function (a) {
this.hd !== a && (f && t.k(a, la, Z, "arrangement"), a === sp || a === xq || a === wp) && (this.hd = a, this.K())
});
t.g(Z, "arrangementSpacing", Z.prototype.Hv);
t.defineProperty(Z, {Hv: "arrangementSpacing"}, function () {
return this.Sf
}, function (a) {
this.Sf.N(a) || (this.Sf.assign(a), this.K())
});
t.g(Z, "rootDefaults", Z.prototype.$I);
t.defineProperty(Z, {$I: "rootDefaults"}, function () {
return this.ta
}, function (a) {
this.ta !== a && (f && t.k(a, tp, Z, "rootDefaults"), this.ta = a, this.K())
});
t.g(Z, "alternateDefaults", Z.prototype.ZG);
t.defineProperty(Z, {ZG: "alternateDefaults"}, function () {
return this.sa
}, function (a) {
this.sa !== a && (f && t.k(a, tp, Z, "alternateDefaults"), this.sa = a, this.K())
});
t.g(Z, "sorting", Z.prototype.sorting);
t.defineProperty(Z, {sorting: "sorting"}, function () {
return this.ta.sorting
}, function (a) {
this.ta.sorting !== a && (f && t.k(a, la, Z, "sorting"), a === Jp || a === Kp || a === Lp || Mp) && (this.ta.sorting = a, this.K())
});
t.g(Z, "comparer", Z.prototype.comparer);
t.defineProperty(Z, {comparer: "comparer"}, function () {
return this.ta.comparer
}, function (a) {
this.ta.comparer !== a && (f && t.j(a, "function", Z, "comparer"), this.ta.comparer = a, this.K())
});
t.g(Z, "angle", Z.prototype.angle);
t.defineProperty(Z, {angle: "angle"}, function () {
return this.ta.angle
}, function (a) {
this.ta.angle === a || 0 !== a && 90 !== a && 180 !== a && 270 !== a || (this.ta.angle = a, this.K())
});
t.g(Z, "alignment", Z.prototype.alignment);
t.defineProperty(Z, {alignment: "alignment"}, function () {
return this.ta.alignment
}, function (a) {
this.ta.alignment !== a && (f && t.tb(a, Z, Z, "alignment"), this.ta.alignment = a, this.K())
});
t.g(Z, "nodeIndent", Z.prototype.nodeIndent);
t.defineProperty(Z, {nodeIndent: "nodeIndent"}, function () {
return this.ta.nodeIndent
}, function (a) {
this.ta.nodeIndent !== a && 0 <= a && (this.ta.nodeIndent = a, this.K())
});
t.g(Z, "nodeIndentPastParent", Z.prototype.nodeIndentPastParent);
t.defineProperty(Z, {nodeIndentPastParent: "nodeIndentPastParent"}, function () {
return this.ta.nodeIndentPastParent
}, function (a) {
this.ta.nodeIndentPastParent !== a && 0 <= a && 1 >= a && (this.ta.nodeIndentPastParent = a, this.K())
});
t.g(Z, "nodeSpacing", Z.prototype.nodeSpacing);
t.defineProperty(Z, {nodeSpacing: "nodeSpacing"}, function () {
return this.ta.nodeSpacing
}, function (a) {
this.ta.nodeSpacing !== a && (this.ta.nodeSpacing = a, this.K())
});
t.g(Z, "layerSpacing", Z.prototype.layerSpacing);
t.defineProperty(Z, {layerSpacing: "layerSpacing"}, function () {
return this.ta.layerSpacing
}, function (a) {
this.ta.layerSpacing !== a && (this.ta.layerSpacing = a, this.K())
});
t.g(Z, "layerSpacingParentOverlap", Z.prototype.layerSpacingParentOverlap);
t.defineProperty(Z, {layerSpacingParentOverlap: "layerSpacingParentOverlap"}, function () {
return this.ta.layerSpacingParentOverlap
}, function (a) {
this.ta.layerSpacingParentOverlap !== a && 0 <= a && 1 >= a && (this.ta.layerSpacingParentOverlap = a, this.K())
});
t.g(Z, "compaction", Z.prototype.compaction);
t.defineProperty(Z, {compaction: "compaction"}, function () {
return this.ta.compaction
}, function (a) {
this.ta.compaction !== a && (f && t.k(a, la, Z, "compaction"), a === Up || a === Wp) && (this.ta.compaction = a, this.K())
});
t.g(Z, "breadthLimit", Z.prototype.breadthLimit);
t.defineProperty(Z, {breadthLimit: "breadthLimit"}, function () {
return this.ta.breadthLimit
}, function (a) {
this.ta.breadthLimit !== a && 0 <= a && (this.ta.breadthLimit = a, this.K())
});
t.g(Z, "rowSpacing", Z.prototype.rowSpacing);
t.defineProperty(Z, {rowSpacing: "rowSpacing"}, function () {
return this.ta.rowSpacing
}, function (a) {
this.ta.rowSpacing !== a && (this.ta.rowSpacing = a, this.K())
});
t.g(Z, "rowIndent", Z.prototype.rowIndent);
t.defineProperty(Z, {rowIndent: "rowIndent"}, function () {
return this.ta.rowIndent
}, function (a) {
this.ta.rowIndent !== a && 0 <= a && (this.ta.rowIndent = a, this.K())
});
t.g(Z, "commentSpacing", Z.prototype.commentSpacing);
t.defineProperty(Z, {commentSpacing: "commentSpacing"}, function () {
return this.ta.commentSpacing
}, function (a) {
this.ta.commentSpacing !== a && (this.ta.commentSpacing = a, this.K())
});
t.g(Z, "commentMargin", Z.prototype.commentMargin);
t.defineProperty(Z, {commentMargin: "commentMargin"}, function () {
return this.ta.commentMargin
}, function (a) {
this.ta.commentMargin !== a && (this.ta.commentMargin = a, this.K())
});
t.g(Z, "setsPortSpot", Z.prototype.setsPortSpot);
t.defineProperty(Z, {setsPortSpot: "setsPortSpot"}, function () {
return this.ta.setsPortSpot
}, function (a) {
this.ta.setsPortSpot !== a && (this.ta.setsPortSpot = a, this.K())
});
t.g(Z, "portSpot", Z.prototype.portSpot);
t.defineProperty(Z, {portSpot: "portSpot"}, function () {
return this.ta.portSpot
}, function (a) {
this.ta.portSpot.N(a) || (this.ta.portSpot = a, this.K())
});
t.g(Z, "setsChildPortSpot", Z.prototype.setsChildPortSpot);
t.defineProperty(Z, {setsChildPortSpot: "setsChildPortSpot"}, function () {
return this.ta.setsChildPortSpot
}, function (a) {
this.ta.setsChildPortSpot !== a && (this.ta.setsChildPortSpot = a, this.K())
});
t.g(Z, "childPortSpot", Z.prototype.childPortSpot);
t.defineProperty(Z, {childPortSpot: "childPortSpot"}, function () {
return this.ta.childPortSpot
}, function (a) {
this.ta.childPortSpot.N(a) || (this.ta.childPortSpot = a, this.K())
});
t.g(Z, "alternateSorting", Z.prototype.jH);
t.defineProperty(Z, {jH: "alternateSorting"}, function () {
return this.sa.sorting
}, function (a) {
this.sa.sorting !== a && (f && t.k(a, la, Z, "alternateSorting"), a === Jp || a === Kp || a === Lp || Mp) && (this.sa.sorting = a, this.K())
});
t.g(Z, "alternateComparer", Z.prototype.YG);
t.defineProperty(Z, {YG: "alternateComparer"}, function () {
return this.sa.comparer
}, function (a) {
this.sa.comparer !== a && (f && t.j(a, "function", Z, "alternateComparer"), this.sa.comparer = a, this.K())
});
t.g(Z, "alternateAngle", Z.prototype.SG);
t.defineProperty(Z, {SG: "alternateAngle"}, function () {
return this.sa.angle
}, function (a) {
this.sa.angle === a || 0 !== a && 90 !== a && 180 !== a && 270 !== a || (this.sa.angle = a, this.K())
});
t.g(Z, "alternateAlignment", Z.prototype.RG);
t.defineProperty(Z, {RG: "alternateAlignment"}, function () {
return this.sa.alignment
}, function (a) {
this.sa.alignment !== a && (f && t.tb(a, Z, Z, "alternateAlignment"), this.sa.alignment = a, this.K())
});
t.g(Z, "alternateNodeIndent", Z.prototype.bH);
t.defineProperty(Z, {bH: "alternateNodeIndent"}, function () {
return this.sa.nodeIndent
}, function (a) {
this.sa.nodeIndent !== a && 0 <= a && (this.sa.nodeIndent = a, this.K())
});
t.g(Z, "alternateNodeIndentPastParent", Z.prototype.cH);
t.defineProperty(Z, {cH: "alternateNodeIndentPastParent"}, function () {
return this.sa.nodeIndentPastParent
}, function (a) {
this.sa.nodeIndentPastParent !== a && 0 <= a && 1 >= a && (this.sa.nodeIndentPastParent = a, this.K())
});
t.g(Z, "alternateNodeSpacing", Z.prototype.dH);
t.defineProperty(Z, {dH: "alternateNodeSpacing"}, function () {
return this.sa.nodeSpacing
}, function (a) {
this.sa.nodeSpacing !== a && (this.sa.nodeSpacing = a, this.K())
});
t.g(Z, "alternateLayerSpacing", Z.prototype.$G);
t.defineProperty(Z, {$G: "alternateLayerSpacing"}, function () {
return this.sa.layerSpacing
}, function (a) {
this.sa.layerSpacing !== a && (this.sa.layerSpacing = a, this.K())
});
t.g(Z, "alternateLayerSpacingParentOverlap", Z.prototype.aH);
t.defineProperty(Z, {aH: "alternateLayerSpacingParentOverlap"}, function () {
return this.sa.layerSpacingParentOverlap
}, function (a) {
this.sa.layerSpacingParentOverlap !== a && 0 <= a && 1 >= a && (this.sa.layerSpacingParentOverlap = a, this.K())
});
t.g(Z, "alternateCompaction", Z.prototype.XG);
t.defineProperty(Z, {XG: "alternateCompaction"}, function () {
return this.sa.compaction
}, function (a) {
this.sa.compaction !== a && (f && t.k(a, la, Z, "alternateCompaction"), a === Up || a === Wp) && (this.sa.compaction = a, this.K())
});
t.g(Z, "alternateBreadthLimit", Z.prototype.TG);
t.defineProperty(Z, {TG: "alternateBreadthLimit"}, function () {
return this.sa.breadthLimit
}, function (a) {
this.sa.breadthLimit !== a && 0 <= a && (this.sa.breadthLimit = a, this.K())
});
t.g(Z, "alternateRowSpacing", Z.prototype.gH);
t.defineProperty(Z, {gH: "alternateRowSpacing"}, function () {
return this.sa.rowSpacing
}, function (a) {
this.sa.rowSpacing !== a && (this.sa.rowSpacing = a, this.K())
});
t.g(Z, "alternateRowIndent", Z.prototype.fH);
t.defineProperty(Z, {fH: "alternateRowIndent"}, function () {
return this.sa.rowIndent
}, function (a) {
this.sa.rowIndent !== a && 0 <= a && (this.sa.rowIndent = a, this.K())
});
t.g(Z, "alternateCommentSpacing", Z.prototype.WG);
t.defineProperty(Z, {WG: "alternateCommentSpacing"}, function () {
return this.sa.commentSpacing
}, function (a) {
this.sa.commentSpacing !== a && (this.sa.commentSpacing = a, this.K())
});
t.g(Z, "alternateCommentMargin", Z.prototype.VG);
t.defineProperty(Z, {VG: "alternateCommentMargin"}, function () {
return this.sa.commentMargin
}, function (a) {
this.sa.commentMargin !== a && (this.sa.commentMargin = a, this.K())
});
t.g(Z, "alternateSetsPortSpot", Z.prototype.iH);
t.defineProperty(Z, {iH: "alternateSetsPortSpot"}, function () {
return this.sa.setsPortSpot
}, function (a) {
this.sa.setsPortSpot !== a && (this.sa.setsPortSpot = a, this.K())
});
t.g(Z, "alternatePortSpot", Z.prototype.eH);
t.defineProperty(Z, {eH: "alternatePortSpot"}, function () {
return this.sa.portSpot
}, function (a) {
this.sa.portSpot.N(a) || (this.sa.portSpot = a, this.K())
});
t.g(Z, "alternateSetsChildPortSpot", Z.prototype.hH);
t.defineProperty(Z, {hH: "alternateSetsChildPortSpot"}, function () {
return this.sa.setsChildPortSpot
}, function (a) {
this.sa.setsChildPortSpot !== a && (this.sa.setsChildPortSpot = a, this.K())
});
t.g(Z, "alternateChildPortSpot", Z.prototype.UG);
t.defineProperty(Z, {UG: "alternateChildPortSpot"}, function () {
return this.sa.childPortSpot
}, function (a) {
this.sa.childPortSpot.N(a) || (this.sa.childPortSpot = a, this.K())
});
var pp;
Z.PathDefault = pp = t.w(Z, "PathDefault", -1);
var qp;
Z.PathDestination = qp = t.w(Z, "PathDestination", 0);
var xp;
Z.PathSource = xp = t.w(Z, "PathSource", 1);
var Jp;
Z.SortingForwards = Jp = t.w(Z, "SortingForwards", 10);
var Kp;
Z.SortingReverse = Kp = t.w(Z, "SortingReverse", 11);
var Lp;
Z.SortingAscending = Lp = t.w(Z, "SortingAscending", 12);
var Mp;
Z.SortingDescending = Mp = t.w(Z, "SortingDescending", 13);
var jq;
Z.AlignmentCenterSubtrees = jq = t.w(Z, "AlignmentCenterSubtrees", 20);
var Np;
Z.AlignmentCenterChildren = Np = t.w(Z, "AlignmentCenterChildren", 21);
var Yp;
Z.AlignmentStart = Yp = t.w(Z, "AlignmentStart", 22);
var Zp;
Z.AlignmentEnd = Zp = t.w(Z, "AlignmentEnd", 23);
var Pp;
Z.AlignmentBus = Pp = t.w(Z, "AlignmentBus", 24);
var Ep;
Z.AlignmentBusBranching = Ep = t.w(Z, "AlignmentBusBranching", 25);
var Qp;
Z.AlignmentTopLeftBus = Qp = t.w(Z, "AlignmentTopLeftBus", 26);
var Rp;
Z.AlignmentBottomRightBus = Rp = t.w(Z, "AlignmentBottomRightBus", 27);
var Up;
Z.CompactionNone = Up = t.w(Z, "CompactionNone", 30);
var Wp;
Z.CompactionBlock = Wp = t.w(Z, "CompactionBlock", 31);
var rp;
Z.StyleLayered = rp = t.w(Z, "StyleLayered", 40);
var Ip;
Z.StyleLastParents = Ip = t.w(Z, "StyleLastParents", 41);
var Hp;
Z.StyleAlternating = Hp = t.w(Z, "StyleAlternating", 42);
var Gp;
Z.StyleRootOnly = Gp = t.w(Z, "StyleRootOnly", 43);
var sp;
Z.ArrangementVertical = sp = t.w(Z, "ArrangementVertical", 50);
var xq;
Z.ArrangementHorizontal = xq = t.w(Z, "ArrangementHorizontal", 51);
var wp;
Z.ArrangementFixedRoots = wp = t.w(Z, "ArrangementFixedRoots", 52);
function up() {
Aa.call(this)
}
t.ia("TreeNetwork", up);
t.Oa(up, Aa);
up.prototype.createVertex = function () {
return new tp
};
up.prototype.createEdge = function () {
return new zq
};
function tp() {
Ba.call(this);
this.initialized = !1;
this.parent = null;
this.children = [];
this.maxGenerationCount = this.maxChildrenCount = this.descendantCount = this.level = 0;
this.comments = null;
this.la = new C(0, 0);
this.$a = new oa(0, 0);
this.Ma = new C(0, 0);
this.Cp = this.Bp = this.bJ = !1;
this.pt = this.Ys = null;
this.sorting = Jp;
this.comparer = un;
this.angle = 0;
this.alignment = Np;
this.nodeIndentPastParent = this.nodeIndent = 0;
this.nodeSpacing = 20;
this.layerSpacing = 50;
this.layerSpacingParentOverlap = 0;
this.compaction = Wp;
this.breadthLimit =
0;
this.rowSpacing = 25;
this.commentSpacing = this.rowIndent = 10;
this.commentMargin = 20;
this.setsPortSpot = !0;
this.portSpot = Pb;
this.setsChildPortSpot = !0;
this.childPortSpot = Pb
}
t.ia("TreeVertex", tp);
t.Oa(tp, Ba);
tp.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)
};
t.A(tp, {Cm: "childrenCount"}, function () {
return this.children.length
});
t.g(tp, "relativePosition", tp.prototype.WI);
t.defineProperty(tp, {WI: "relativePosition"}, function () {
return this.la
}, function (a) {
t.k(a, C, tp, "relativePosition");
this.la.set(a)
});
t.g(tp, "subtreeSize", tp.prototype.jJ);
t.defineProperty(tp, {jJ: "subtreeSize"}, function () {
return this.$a
}, function (a) {
t.k(a, oa, tp, "subtreeSize");
this.$a.set(a)
});
t.g(tp, "subtreeOffset", tp.prototype.iJ);
t.defineProperty(tp, {iJ: "subtreeOffset"}, function () {
return this.Ma
}, function (a) {
t.k(a, C, tp, "subtreeOffset");
this.Ma.set(a)
});
function zq() {
Da.call(this);
this.Cr = new C(0, 0)
}
t.ia("TreeEdge", zq);
t.Oa(zq, Da);
zq.prototype.commit = function () {
var a = this.link;
if (null !== a && !a.Qi) {
var b = this.network.Tb, c = null, d = null;
switch (b.yf) {
case qp:
c = this.fromVertex;
d = this.toVertex;
break;
case xp:
c = this.toVertex;
d = this.fromVertex;
break;
default:
t.m("Unhandled path value " + b.yf.toString())
}
if (null !== c && null !== d)if (b = this.Cr, 0 !== b.x || 0 !== b.y || c.bJ) {
var d = c.Mb, e = Xp(c), g = $p(c), h = c.rowSpacing;
a.updateRoute();
var k = a.De === Pg, l = a.ac, m, n, p, q;
a.wl();
if (l || k) {
for (m = 2; 4 < a.ma;)a.gF(2);
n = a.n(1);
p = a.n(2)
} else {
for (m = 1; 3 < a.ma;)a.gF(1);
n =
a.n(0);
p = a.n(a.ma - 1)
}
q = a.n(a.ma - 1);
0 === e ? (c.alignment === Zp ? (e = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (e = Math.min(e, Math.max(n.y, e - aq(c))))) : c.alignment === Yp ? (e = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (e = Math.max(e, Math.min(n.y, e + aq(c))))) : e = c.Bp || c.Cp && 1 === c.maxGenerationCount ? d.top - c.Ma.y + b.y : d.y + d.height / 2 + b.y, k ? (a.C(m, n.x, e), m++, a.C(m, d.right + g, e), m++, a.C(m, d.right + g + (b.x - h) / 3, e), m++, a.C(m, d.right + g + 2 * (b.x - h) / 3, e), m++, a.C(m, d.right + g + (b.x - h), e), m++, a.C(m, p.x, e)) : (l && (a.C(m, d.right + g / 2, n.y),
m++), a.C(m, d.right + g / 2, e), m++, a.C(m, d.right + g + b.x - (l ? h / 2 : h), e), m++, l && a.C(m, a.n(m - 1).x, p.y))) : 90 === e ? (c.alignment === Zp ? (e = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (e = Math.min(e, Math.max(n.x, e - aq(c))))) : c.alignment === Yp ? (e = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (e = Math.max(e, Math.min(n.x, e + aq(c))))) : e = c.Bp || c.Cp && 1 === c.maxGenerationCount ? d.left - c.Ma.x + b.x : d.x + d.width / 2 + b.x, k ? (a.C(m, e, n.y), m++, a.C(m, e, d.bottom + g), m++, a.C(m, e, d.bottom + g + (b.y - h) / 3), m++, a.C(m, e, d.bottom + g + 2 * (b.y - h) / 3), m++, a.C(m, e, d.bottom +
g + (b.y - h)), m++, a.C(m, e, p.y)) : (l && (a.C(m, n.x, d.bottom + g / 2), m++), a.C(m, e, d.bottom + g / 2), m++, a.C(m, e, d.bottom + g + b.y - (l ? h / 2 : h)), m++, l && a.C(m, p.x, a.n(m - 1).y))) : 180 === e ? (c.alignment === Zp ? (e = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (e = Math.min(e, Math.max(n.y, e - aq(c))))) : c.alignment === Yp ? (e = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (e = Math.max(e, Math.min(n.y, e + aq(c))))) : e = c.Bp || c.Cp && 1 === c.maxGenerationCount ? d.top - c.Ma.y + b.y : d.y + d.height / 2 + b.y, k ? (a.C(m, n.x, e), m++, a.C(m, d.left - g, e), m++, a.C(m, d.left - g + (b.x +
h) / 3, e), m++, a.C(m, d.left - g + 2 * (b.x + h) / 3, e), m++, a.C(m, d.left - g + (b.x + h), e), m++, a.C(m, p.x, e)) : (l && (a.C(m, d.left - g / 2, n.y), m++), a.C(m, d.left - g / 2, e), m++, a.C(m, d.left - g + b.x + (l ? h / 2 : h), e), m++, l && a.C(m, a.n(m - 1).x, p.y))) : 270 === e ? (c.alignment === Zp ? (e = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (e = Math.min(e, Math.max(n.x, e - aq(c))))) : c.alignment === Yp ? (e = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (e = Math.max(e, Math.min(n.x, e + aq(c))))) : e = c.Bp || c.Cp && 1 === c.maxGenerationCount ? d.left - c.Ma.x + b.x : d.x + d.width / 2 + b.x, k ? (a.C(m,
e, n.y), m++, a.C(m, e, d.top - g), m++, a.C(m, e, d.top - g + (b.y + h) / 3), m++, a.C(m, e, d.top - g + 2 * (b.y + h) / 3), m++, a.C(m, e, d.top - g + (b.y + h)), m++, a.C(m, e, p.y)) : (l && (a.C(m, n.x, d.top - g / 2), m++), a.C(m, e, d.top - g / 2), m++, a.C(m, e, d.top - g + b.y + (l ? h / 2 : h)), m++, l && a.C(m, p.x, a.n(m - 1).y))) : t.m("Invalid angle " + e);
a.Gi()
} else g = c, h = d, f && t.k(g, tp, zq, "adjustRouteForAngleChange:parent"), f && t.k(h, tp, zq, "adjustRouteForAngleChange:child"), a = this.link, c = Xp(g), c !== Xp(h) && (b = $p(g), d = g.Mb, g = h.Mb, 0 === c && g.left - d.right < b + 1 || 90 === c && g.top - d.bottom <
b + 1 || 180 === c && d.left - g.right < b + 1 || 270 === c && d.top - g.bottom < b + 1 || (a.updateRoute(), g = a.De === Pg, h = a.ac, k = Op(this.fromVertex.alignment), a.wl(), 0 === c ? (c = d.right + b / 2, g ? 4 === a.ma && (b = a.n(3).y, a.Y(1, c - 20, a.n(1).y), a.C(2, c - 20, b), a.C(3, c, b), a.C(4, c + 20, b), a.Y(5, a.n(5).x, b)) : h ? k ? a.Y(3, a.n(2).x, a.n(4).y) : 6 === a.ma && (a.Y(2, c, a.n(2).y), a.Y(3, c, a.n(3).y)) : 4 === a.ma ? a.C(2, c, a.n(2).y) : 3 === a.ma ? a.Y(1, c, a.n(2).y) : 2 === a.ma && a.C(1, c, a.n(1).y)) : 90 === c ? (b = d.bottom + b / 2, g ? 4 === a.ma && (c = a.n(3).x, a.Y(1, a.n(1).x, b - 20), a.C(2, c, b - 20),
a.C(3, c, b), a.C(4, c, b + 20), a.Y(5, c, a.n(5).y)) : h ? k ? a.Y(3, a.n(2).x, a.n(4).y) : 6 === a.ma && (a.Y(2, a.n(2).x, b), a.Y(3, a.n(3).x, b)) : 4 === a.ma ? a.C(2, a.n(2).x, b) : 3 === a.ma ? a.Y(1, a.n(2).x, b) : 2 === a.ma && a.C(1, a.n(1).x, b)) : 180 === c ? (c = d.left - b / 2, g ? 4 === a.ma && (b = a.n(3).y, a.Y(1, c + 20, a.n(1).y), a.C(2, c + 20, b), a.C(3, c, b), a.C(4, c - 20, b), a.Y(5, a.n(5).x, b)) : h ? k ? a.Y(3, a.n(2).x, a.n(4).y) : 6 === a.ma && (a.Y(2, c, a.n(2).y), a.Y(3, c, a.n(3).y)) : 4 === a.ma ? a.C(2, c, a.n(2).y) : 3 === a.ma ? a.Y(1, c, a.n(2).y) : 2 === a.ma && a.C(1, c, a.n(1).y)) : 270 === c && (b =
d.top - b / 2, g ? 4 === a.ma && (c = a.n(3).x, a.Y(1, a.n(1).x, b + 20), a.C(2, c, b + 20), a.C(3, c, b), a.C(4, c, b - 20), a.Y(5, c, a.n(5).y)) : h ? k ? a.Y(3, a.n(2).x, a.n(4).y) : 6 === a.ma && (a.Y(2, a.n(2).x, b), a.Y(3, a.n(3).x, b)) : 4 === a.ma ? a.C(2, a.n(2).x, b) : 3 === a.ma ? a.Y(1, a.n(2).x, b) : 2 === a.ma && a.C(1, a.n(1).x, b)), a.Gi()))
}
};
t.g(zq, "relativePoint", zq.prototype.VI);
t.defineProperty(zq, {VI: "relativePoint"}, function () {
return this.Cr
}, function (a) {
this.Cr.set(a)
});
function Aq() {
this.Kn = []
}
function Ak(a) {
var b = new Aq, c;
if ("string" === typeof a)c = (new DOMParser).parseFromString(a, "text/xml"); else if (a instanceof Document)c = a.implementation.createDocument("http://www.w3.org/2000/svg", "svg", null), c.appendChild(c.importNode(a.documentElement, !0)); else return null;
a = c.getElementsByTagName("svg");
if (0 === a.length)return null;
var d = a[0], e = c.getElementsByTagName("linearGradient"), g = c.getElementsByTagName("radialGradient");
for (a = 0; a < e.length; a++) {
for (var h = e[a], k = Bk(Td, he, {start: fc, end: gc}), l =
h.childNodes, m = 0; m < l.length; m++)if ("stop" === l[m].tagName) {
var n = Bq(b, l[m], "stop-color");
if (n) {
var p = Bq(b, l[m], "offset");
p || (p = "0");
var q = parseFloat(p);
isNaN(q) && (q = 0);
k.addColorStop((-1 !== p.indexOf("%") ? 0.01 : 1) * q, n)
}
}
h = h.getAttribute("id");
"string" === typeof h && (b["_brush" + h] = k)
}
for (a = 0; a < g.length; a++) {
h = g[a];
k = Bk(Td, ie, {start: Ub, end: Ub});
l = h.childNodes;
for (m = 0; m < l.length; m++)"stop" === l[m].tagName && (n = Bq(b, l[m], "stop-color")) && ((p = Bq(b, l[m], "offset")) || (p = "0"), q = parseFloat(p), isNaN(q) && (q = 0), k.addColorStop((-1 !==
p.indexOf("%") ? 0.01 : 1) * q, n));
h = h.getAttribute("id");
"string" === typeof h && (b["_brush" + h] = k)
}
for (e = !0; e;)for (e = !1, g = c.getElementsByTagName("use"), a = 0; a < g.length; a++)k = g[a], 0 === k.childNodes.length && (h = k.href, void 0 !== h && (h = c.getElementById(h.baseVal.substring(1)), null !== h && (h = h.cloneNode(!0), h.removeAttribute("id"), l = parseFloat(k.getAttribute("x")), isNaN(l) && (l = 0), m = parseFloat(k.getAttribute("y")), isNaN(m) && (m = 0), n = k.getAttribute("transform"), null === n && (n = ""), k.setAttribute("transform", n + " translate(" +
l + "," + m + ")"), k.appendChild(h), "use" === h.tagName && (e = !0))));
Cq(b, d, null);
c = new B;
if (0 === b.Kn.length)return c;
if (1 === b.Kn.length)return b.Kn[0];
for (a = 0; a < b.Kn.length; a++)c.add(b.Kn[a]);
return c
}
function Dq(a, b) {
var c = a.getAttribute(b);
"string" !== typeof c && a.style && (c = a.style[b]);
return"string" !== typeof c ? null : c
}
function Bq(a, b, c) {
var d = b.getAttribute(c);
"string" !== typeof d && b.style && (d = b.style[c]);
return"string" !== typeof d || "" === d || "inherit" === d ? (b = b.parentNode, "g" === b.tagName || "use" === b.tagName ? Bq(a, b, c) : null) : d
}
function Cq(a, b, c) {
var d = b.tagName;
if (("g" === d || "svg" === d || "use" === d || "symbol" === d) && "none" !== Bq(a, b, "display")) {
for (var d = b.childNodes, e = 0; e < d.length; e++) {
var g = d[e], h = null;
if (void 0 !== g.getAttribute) {
var k = g.getAttribute("transform");
switch (g.tagName) {
case "g":
null === k ? Cq(a, g, null) : (h = new B, Cq(a, g, h));
break;
case "use":
null === k ? Cq(a, g, null) : (h = new B, Cq(a, g, h));
break;
case "symbol":
if ("use" !== b.tagName)break;
h = new B;
Cq(a, g, h);
var l = h, m = a, n = g;
Bq(m, n, "preserveAspectRatio");
Bq(m, n, "viewBox");
l.scale =
1;
break;
case "path":
l = g;
h = new Y;
l = l.getAttribute("d");
"string" === typeof l && (h.fE = Yc(l));
break;
case "line":
var p = g, h = new Y, l = parseFloat(p.getAttribute("x1"));
isNaN(l) && (l = 0);
m = parseFloat(p.getAttribute("y1"));
isNaN(m) && (m = 0);
n = parseFloat(p.getAttribute("x2"));
isNaN(n) && (n = 0);
p = parseFloat(p.getAttribute("y2"));
isNaN(p) && (p = 0);
var q = new M(Nc);
h.position = new C(Math.min(l, n), Math.min(m, p));
0 < (n - l) / (p - m) ? (q.na = 0, q.oa = 0, q.D = Math.abs(n - l), q.F = Math.abs(p - m)) : (q.na = 0, q.oa = Math.abs(p - m), q.D = Math.abs(n - l), q.F =
0);
h.dd = q;
break;
case "circle":
n = g;
h = new Y;
l = parseFloat(n.getAttribute("r"));
isNaN(l) || 0 > l ? h = null : (m = parseFloat(n.getAttribute("cx")), isNaN(m) && (m = 0), n = parseFloat(n.getAttribute("cy")), isNaN(n) && (n = 0), p = new M(Uc), p.na = 0, p.oa = 0, p.D = 2 * l, p.F = 2 * l, h.position = new C(m - l, n - l), h.dd = p);
break;
case "ellipse":
p = g;
h = new Y;
l = parseFloat(p.getAttribute("rx"));
isNaN(l) || 0 > l ? h = null : (m = parseFloat(p.getAttribute("ry")), isNaN(m) || 0 > m ? h = null : (n = parseFloat(p.getAttribute("cx")), isNaN(n) && (n = 0), p = parseFloat(p.getAttribute("cy")),
isNaN(p) && (p = 0), q = new M(Uc), q.na = 0, q.oa = 0, q.D = 2 * l, q.F = 2 * m, h.position = new C(n - l, p - m), h.dd = q));
break;
case "rect":
q = g;
h = new Y;
l = parseFloat(q.getAttribute("width"));
if (isNaN(l) || 0 > l)h = null; else if (m = parseFloat(q.getAttribute("height")), isNaN(m) || 0 > m)h = null; else {
n = parseFloat(q.getAttribute("x"));
isNaN(n) && (n = 0);
p = parseFloat(q.getAttribute("y"));
isNaN(p) && (p = 0);
var r = q.getAttribute("rx"), s = q.getAttribute("ry"), q = parseFloat(r);
if (isNaN(q) || 0 > q)q = 0;
var v = parseFloat(s);
if (isNaN(v) || 0 > v)v = 0;
!r && s ? q = v : r && !s &&
(v = q);
q = Math.min(q, l / 2);
v = Math.min(v, m / 2);
s = void 0;
0 === q && 0 === v ? (s = new M(Tc), s.na = 0, s.oa = 0, s.D = l, s.F = m) : (s = J.va / 2, r = t.u(), O(r, q, 0, !0), r.lineTo(l - q, 0), P(r, l - q * s, 0, l, v * s, l, v), r.lineTo(l, m - v), P(r, l, m - v * s, l - q * s, m, l - q, m), r.lineTo(q, m), P(r, q * s, m, 0, m - v * s, 0, m - v), r.lineTo(0, v), P(r, 0, v * s, q * s, 0, q, 0), Q(r), s = r.s, t.v(r));
h.position = new C(n, p);
h.dd = s
}
break;
case "polygon":
h = Eq(g);
break;
case "polyline":
h = Eq(g)
}
if (null !== h) {
if (h instanceof Y) {
l = Bq(a, g, "fill");
null !== l && -1 !== l.indexOf("url") ? (l = l.substring(l.indexOf("#") +
1, l.length - 1), l = a["_brush" + l], h.fill = l instanceof Td ? l : "black") : h.fill = null === l ? "black" : "none" === l ? null : l;
l = Bq(a, g, "stroke");
null !== l && -1 !== l.indexOf("url") ? (l = l.substring(l.indexOf("#") + 1, l.length - 1), l = a["_brush" + l], h.stroke = l instanceof Td ? l : "black") : h.stroke = "none" === l ? null : l;
l = parseFloat(Bq(a, g, "stroke-width"));
isNaN(l) || (h.ib = l);
l = Bq(a, g, "stroke-linecap");
null !== l && (h.IF = l);
if (l = Bq(a, g, "stroke-dasharray")) {
m = l.split(",");
n = [];
for (l = 0; l < m.length; l++)p = parseFloat(m[l]), !isNaN(p) && 0 < p && n.push(p);
h.Ow = n
}
if (g = Bq(a, g, "stroke-dashoffset"))g = parseFloat(g), isNaN(g) || (h.JF = g);
h.jA = !0
}
if (null !== k) {
k = k.split(")");
g = !0;
for (l = 0; l < k.length; l++)/\(.*[^0-9\.,\s-]/.test(k[l]) && (g = !1), /\(.*[0-9]-[0-9]/.test(k[l]) && (g = !1);
if (g)for (l = k.length - 1; 0 <= l; l--)if (m = k[l], "" !== m)switch (n = m.indexOf("("), g = m.substring(0, n).replace(/\s*/, ""), n = m.substring(n + 1).split(/\s*[\s,]\s*/), g) {
case "rotate":
Fq(a, h, n);
break;
case "translate":
g = h;
m = parseFloat(n[0]);
isNaN(m) && (m = 0);
n = parseFloat(n[1]);
isNaN(n) && (n = 0);
if (0 !== m || 0 !==
n)p = g.position.copy(), isNaN(p.x) && (p.x = 0), isNaN(p.y) && (p.y = 0), g.position = new C(m + p.x, n + p.y);
break;
case "scale":
Gq(a, h, n);
break;
case "skewX":
Hq(a, h, n);
break;
case "skewY":
Iq(a, h, n);
break;
case "matrix":
Jq(a, h, n)
}
}
if (h instanceof B) {
k = h.elements.l;
l = g = 0;
m = h.position.copy();
isNaN(m.x) && (m.x = 0);
isNaN(m.y) && (m.y = 0);
for (; k.next();)n = k.value.position.copy(), isNaN(n.x) && (n.x = 0), isNaN(n.y) && (n.y = 0), n.x < g && (g = n.x), n.y < l && (l = n.y);
m.x += g;
m.y += l;
h.position = m
}
null === c ? a.Kn.push(h) : c.add(h)
}
}
}
if (null !== h) {
a = Dq(b,
"visibility");
if ("hidden" === a || "collapse" === a)h.visible = !1;
if (b = Dq(b, "opacity"))b = parseFloat(b), isNaN(b) || (h.opacity = b)
}
}
}
function Jq(a, b, c) {
var d = parseFloat(c[0]), e = parseFloat(c[1]), g = parseFloat(c[2]), h = parseFloat(c[3]), k = parseFloat(c[4]), l = parseFloat(c[5]);
if (!isNaN(d + e + g + h + k + l)) {
var m = b.position.copy();
isNaN(m.x) && (m.x = 0);
isNaN(m.y) && (m.y = 0);
if (b instanceof Y) {
c = b.dd.copy();
if (c.type === Tc)c = a.ls(c); else if (c.type === Uc)c = Kq(c); else if (c.type === Nc) {
c.type = Kc;
a = new Lc(c.na, c.oa);
var n = new S(Wc, c.D, c.F);
a.Ga.add(n);
c.ub.add(a)
}
c.offset(m.x, m.y);
c.transform(d, e, g, h, k - m.x, l - m.y);
a = c.normalize();
b.dd = c;
m.x -= a.x;
m.y -= a.y;
b.position = m
} else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += m.x, d.y += m.y, b.value.position = d;
for (b.reset(); b.next();)Jq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= m.x, d.y -= m.y, b.value.position = d
}
}
}
function Fq(a, b, c) {
var d = parseFloat(c[0]);
isNaN(d) && (d = 0);
var e = parseFloat(c[1]);
isNaN(e) && (e = 0);
var g = parseFloat(c[2]);
isNaN(g) && (g = 0);
if (0 !== d) {
var h = d * Math.PI / 180, k = b.position.copy();
isNaN(k.x) && (k.x = 0);
isNaN(k.y) && (k.y = 0);
if (b instanceof Y) {
c = b.dd.copy();
c.type === Uc ? c = Kq(c) : c.type === Tc && (c = a.ls(c));
if (c.type === Kc)c.rotate(d, e - k.x, g - k.y), g = c.normalize(), b.dd = c, k.x -= g.x, k.y -= g.y, b.position = k; else {
var d = c.na - e + k.x, l = c.oa - g + k.y, m = c.D - e + k.x, n = c.F - g + k.y;
a = d * Math.cos(h) - l * Math.sin(h) + e - k.x;
d = l * Math.cos(h) +
d * Math.sin(h) + g - k.y;
e = m * Math.cos(h) - n * Math.sin(h) + e - k.x;
g = n * Math.cos(h) + m * Math.sin(h) + g - k.y;
m = Math.min(a, e);
n = Math.min(d, g);
c.na = a - m;
c.oa = d - n;
c.D = e - m;
c.F = g - n;
k.x += m;
k.y += n;
b.position = k;
b.dd = c
}
b.fill instanceof Td && (k = b.fill.copy(), c = Math.atan((0.5 - k.start.y) / (0.5 - k.start.x)), isNaN(c) || (c += h, k.start = new K((1 - Math.cos(c)) / 2, (1 - Math.sin(c)) / 2), k.end = new K((1 + Math.cos(c)) / 2, (1 + Math.sin(c)) / 2)), b.fill = k);
b.stroke instanceof Td && (k = b.stroke.copy(), c = Math.atan((0.5 - k.start.y) / (0.5 - k.start.x)), isNaN(c) ||
(c += h, k.start = new K((1 - Math.cos(c)) / 2, (1 - Math.sin(c)) / 2), k.end = new K((1 + Math.cos(c)) / 2, (1 + Math.sin(c)) / 2)), b.stroke = k)
} else {
for (b = b.elements.l; b.next();)h = b.value.position.copy(), h.x += k.x, h.y += k.y, b.value.position = h;
for (b.reset(); b.next();)Fq(a, b.value, c);
for (b.reset(); b.next();)h = b.value.position.copy(), h.x -= k.x, h.y -= k.y, b.value.position = h
}
}
}
function Gq(a, b, c) {
var d = parseFloat(c[0]);
isNaN(d) && (d = 1);
var e = parseFloat(c[1]);
isNaN(e) && (e = d);
if (1 !== d || 1 !== e) {
var g = b.position.copy();
isNaN(g.x) && (g.x = 0);
isNaN(g.y) && (g.y = 0);
if (b instanceof Y)a = b.dd.copy(), g.x *= d, g.y *= e, b.position = g, a.scale(d, e), b.dd = a; else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += g.x, d.y += g.y, b.value.position = d;
for (b.reset(); b.next();)Gq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= g.x, d.y -= g.y, b.value.position = d
}
}
}
function Hq(a, b, c) {
var d = parseFloat(c[0]);
if (!isNaN(d)) {
var d = d * Math.PI / 180, e = b.position.copy();
isNaN(e.x) && (e.x = 0);
isNaN(e.y) && (e.y = 0);
if (b instanceof Y) {
c = b.dd.copy();
if (c.type === Tc)c = a.ls(c); else if (c.type === Uc)c = Kq(c); else if (c.type === Nc) {
c.type = Kc;
a = new Lc(c.na, c.oa);
var g = new S(Wc, c.D, c.F);
a.Ga.add(g);
c.ub.add(a)
}
c.offset(e.x, e.y);
c.transform(1, 0, Math.tan(d), 1, -e.x, -e.y);
a = c.normalize();
b.dd = c;
e.x -= a.x;
e.y -= a.y;
b.position = e
} else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += e.x,
d.y += e.y, b.value.position = d;
for (b.reset(); b.next();)Hq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= e.x, d.y -= e.y, b.value.position = d
}
}
}
function Iq(a, b, c) {
var d = parseFloat(c[0]);
if (!isNaN(d)) {
var d = d * Math.PI / 180, e = b.position.copy();
isNaN(e.x) && (e.x = 0);
isNaN(e.y) && (e.y = 0);
if (b instanceof Y) {
c = b.dd.copy();
if (c.type === Tc)c = a.ls(c); else if (c.type === Uc)c = Kq(c); else if (c.type === Nc) {
c.type = Kc;
a = new Lc(c.na, c.oa);
var g = new S(Wc, c.D, c.F);
a.Ga.add(g);
c.ub.add(a)
}
c.offset(e.x, e.y);
c.transform(1, Math.tan(d), 0, 1, -e.x, -e.y);
a = c.normalize();
b.dd = c;
e.x -= a.x;
e.y -= a.y;
b.position = e
} else {
for (b = b.elements.l; b.next();)d = b.value.position.copy(), d.x += e.x,
d.y += e.y, b.value.position = d;
for (b.reset(); b.next();)Iq(a, b.value, c);
for (b.reset(); b.next();)d = b.value.position.copy(), d.x -= e.x, d.y -= e.y, b.value.position = d
}
}
}
function Eq(a) {
var b = !1;
if ("polygon" === a.tagName)b = !0; else if ("polyline" !== a.tagName)return null;
var c = new Y, d = a.getAttribute("points");
a = new M;
var e = new H(Lc), g = d.split(/\s*[\s,]\s*/);
if (4 > g.length)return null;
for (var h, d = new H(S), k, l, m = 1; m < g.length; m += 2) {
k = eval(g[m - 1]);
l = eval(g[m]);
if ("number" !== typeof k || isNaN(k) || "number" !== typeof l || isNaN(l))return null;
1 === m ? h = new Lc(k, l) : d.add(new S(Wc, k, l))
}
b && (b = new S(Wc, h.na, h.oa), b.close(), d.add(b));
h.Ga = d;
e.add(h);
a.ub = e;
h = a.normalize();
c.position = new C(-h.x,
-h.y);
c.dd = a;
return c
}
function Kq(a) {
var b = a.na, c = a.oa, d = a.D, e = a.F, g = Math.abs(d - b) / 2, h = Math.abs(e - c) / 2, b = Math.min(b, d) + g, c = Math.min(c, e) + h;
new C;
e = new Lc(b, c - h);
d = new S(ld);
d.vb = b + J.va * g;
d.Lb = c - h;
d.oe = b + g;
d.pe = c - J.va * h;
d.D = b + g;
d.F = c;
e.Ga.add(d);
d = new S(ld);
d.vb = b + g;
d.Lb = c + J.va * h;
d.oe = b + J.va * g;
d.pe = c + h;
d.D = b;
d.F = c + h;
e.Ga.add(d);
d = new S(ld);
d.vb = b - J.va * g;
d.Lb = c + h;
d.oe = b - g;
d.pe = c + J.va * h;
d.D = b - g;
d.F = c;
e.Ga.add(d);
d = new S(ld);
d.vb = b - g;
d.Lb = c - J.va * h;
d.oe = b - J.va * g;
d.pe = c - h;
d.D = b;
d.F = c - h;
e.Ga.add(d);
a.type = Kc;
a.ub.add(e);
return a
}
Aq.prototype.ls = function (a) {
var b = a.na, c = a.oa, d = a.D, e = a.F, g = Math.min(b, d), h = Math.min(c, e), b = Math.abs(d - b), c = Math.abs(e - c), e = new Lc(g, h);
e.Ga.add(new S(Wc, g + b, h));
e.Ga.add(new S(Wc, g + b, h + c));
e.Ga.add((new S(Wc, g, h + c)).close());
a.type = Kc;
a.ub.add(e);
return a
};
ba.version = "1.3.6";
window && (window.module && "object" === typeof window.module && "object" === typeof window.module.exports ? window.module.exports = ba : window.define && "function" === typeof window.define && window.define.amd ? (window.go = ba, window.define(ba)) : window.go = ba);
})(window);