40332 lines
1.5 MiB
40332 lines
1.5 MiB
/*
|
|
* GoJS v1.6.18 JavaScript Library for HTML Diagrams
|
|
* Northwoods Software, https://www.nwoods.com/
|
|
* GoJS and Northwoods Software are registered trademarks of Northwoods Software Corporation.
|
|
* Copyright (C) 1998-2016 by Northwoods Software Corporation. All Rights Reserved.
|
|
* THIS SOFTWARE IS LICENSED. THE LICENSE AGREEMENT IS AT: https://gojs.net/1.6.18/doc/license.html.
|
|
*/
|
|
(function(window) {
|
|
var f, aa = {};
|
|
if (!window.document || void 0 === window.document.createElement("canvas").getContext) throw window.console && window.console.log("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode."), Error("The HTML Canvas element is not supported in this browser,or this browser is in Compatibility mode.");
|
|
if (!Object.defineProperty) throw Error("GoJS requires a newer version of JavaScript");
|
|
Function.prototype.bind || (Function.prototype.bind = function(a) {
|
|
function b() {
|
|
return g.apply(a, e.concat(d.call(arguments)))
|
|
}
|
|
|
|
function c() {}
|
|
var d = Array.prototype.slice,
|
|
e = d.call(arguments, 1),
|
|
g = this;
|
|
c.prototype = this.prototype;
|
|
b.prototype = new c;
|
|
return b
|
|
});
|
|
(function() {
|
|
for (var a = 0, b = ["ms", "moz", "webkit", "o"], c = 0; c < b.length && !window.requestAnimationFrame; ++c) window.requestAnimationFrame = window[b[c] + "RequestAnimationFrame"], window.cancelAnimationFrame = window[b[c] + "CancelAnimationFrame"] || window[b[c] + "CancelRequestAnimationFrame"];
|
|
window.requestAnimationFrame || (window.requestAnimationFrame = function(b) {
|
|
var c = (new Date).getTime(),
|
|
g = Math.max(8, 16 - (c - a)),
|
|
h = window.setTimeout(function() {
|
|
b(c + g)
|
|
}, g);
|
|
a = c + g;
|
|
return h
|
|
});
|
|
window.cancelAnimationFrame || (window.cancelAnimationFrame =
|
|
function(a) {
|
|
window.clearTimeout(a)
|
|
})
|
|
})();
|
|
var u = {
|
|
bj: !1,
|
|
Rz: !1,
|
|
mE: !1,
|
|
BH: !1,
|
|
fF: !1,
|
|
EE: !1,
|
|
ut: null,
|
|
enableBoundsInfo: function(a) {
|
|
u.bj = !0;
|
|
a && a.Sp()
|
|
},
|
|
disableBoundsInfo: function(a) {
|
|
u.bj = !1;
|
|
a && (ca(a.gd, !0), a.Sp())
|
|
},
|
|
jE: function(a, b) {
|
|
void 0 === a && (a = u.ut);
|
|
void 0 === b && (b = a.Fl("").mb);
|
|
var c = b.length,
|
|
d = a.gd;
|
|
d.fillStyle = "rgba(255,255,0,.3)";
|
|
for (var e = 0; e < c; e++) {
|
|
var g = b.ea(e),
|
|
h = g.W;
|
|
if (null !== g.va) u.jE(a, g.va);
|
|
else {
|
|
var k = g.zk.copy();
|
|
k.vA(g.Hd);
|
|
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()
|
|
}
|
|
}
|
|
},
|
|
kE: function(a,
|
|
b) {
|
|
a || (a = u.ut);
|
|
b || (b = a.Fl("").mb);
|
|
var c = a.gd,
|
|
d = b.length;
|
|
c.fillStyle = "rgba(0,0,255,.3)";
|
|
for (var e = 0; e < d; e++) {
|
|
var g = b.ea(e),
|
|
h = g.Ga,
|
|
k = g.zk;
|
|
null !== g.va ? u.kE(a, g.va) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy), c.fillRect(h.x, h.y, h.width, h.height), c.restore())
|
|
}
|
|
},
|
|
wH: function(a, b) {
|
|
a || (a = u.ut);
|
|
b || (b = a.Fl("").mb);
|
|
var c = a.gd,
|
|
d = b.length;
|
|
c.fillStyle = "rgba(0,0,255,.3)";
|
|
for (var e = 0; e < d; e++) {
|
|
var g = b.ea(e),
|
|
h = g.Ia,
|
|
k = g.zk;
|
|
null !== g.va ? u.wH(a, g.va) : (c.save(), c.transform(k.m11, k.m12, k.m21, k.m22, k.dx, k.dy),
|
|
c.fillRect(h.x || 0, h.y || 0, h.width, h.height), c.restore())
|
|
}
|
|
},
|
|
vK: function() {
|
|
u.kE();
|
|
u.jE()
|
|
},
|
|
wK: function(a) {
|
|
a || (a = u.ut);
|
|
var b = a.ad;
|
|
a = a.gd;
|
|
a.strokeStyle = "rgba(0,255,0,.9)";
|
|
a.rect(b.x, b.y, b.width, b.height);
|
|
a.stroke()
|
|
},
|
|
lE: function(a, b) {
|
|
b.fillStyle = "red";
|
|
b.fillRect(0, 0, 8, 8);
|
|
b.lineWidth = 8;
|
|
b.strokeStyle = "rgba(255,255,0,.6)";
|
|
var c = a.xb;
|
|
b.rect(c.x, c.y, c.width, c.height);
|
|
b.stroke();
|
|
b.fillStyle = "rgba(0,255,0,.2)";
|
|
b.fillRect(a.ad.x, a.ad.y, a.ad.width, a.ad.height)
|
|
},
|
|
xH: function(a, b) {
|
|
b instanceof da || (a.lineWidth = 2, a.strokeStyle =
|
|
"rgba(255,0,0,.5)", a.rect(b.Xb.x, b.Xb.y, b.Xb.width, b.Xb.height), a.stroke(), void 0 !== b.stroke && (a.strokeStyle = b.stroke), void 0 !== b.Oe && (a.lineWidth = b.Oe), null !== b.U && b.U.type === ga && (a.lineWidth = 1, a.strokeStyle = "rgba(10,200,10,.6)", void 0 !== b.stroke && (a.strokeStyle = b.stroke), void 0 !== b.Oe && (a.lineWidth = b.Oe)))
|
|
},
|
|
yH: function(a, b) {
|
|
a.lineWidth = 1;
|
|
a.strokeStyle = "rgba(0,0,255,.5)";
|
|
a.rect(b.Ga.x, b.Ga.y, b.Ga.width, b.Ga.height);
|
|
a.stroke();
|
|
void 0 !== b.stroke && (a.strokeStyle = b.stroke);
|
|
void 0 !== b.Oe && (a.lineWidth =
|
|
b.Oe)
|
|
},
|
|
Qz: function(a, b, c) {
|
|
a.setTransform(1, 0, 0, 1, 0, 0);
|
|
a.scale(b.jd, b.jd);
|
|
a.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy);
|
|
c = b.Yb.length;
|
|
for (var d = 0; d < c; d++)
|
|
for (var e = b.Yb.ea(d), g = e.mb.length, h = 0; h < g; h++) {
|
|
var k = e.mb.ea(h);
|
|
if (void 0 !== k.location && null !== k.location) {
|
|
if (k.location.F()) {
|
|
var l = k.location.x,
|
|
m = k.location.y;
|
|
a.beginPath();
|
|
a.strokeStyle = "limegreen";
|
|
a.lineWidth = 2;
|
|
a.moveTo(l, m + 6);
|
|
a.lineTo(l, m);
|
|
a.lineTo(l + 6, m);
|
|
a.moveTo(l, m);
|
|
a.lineTo(l + 10, m + 20);
|
|
a.stroke()
|
|
}
|
|
l = k.position.x;
|
|
m = k.position.y;
|
|
a.beginPath();
|
|
a.strokeStyle = "red";
|
|
a.lineWidth = 2;
|
|
a.moveTo(l, m + 6);
|
|
a.lineTo(l, m);
|
|
a.lineTo(l + 6, m);
|
|
a.moveTo(l, m);
|
|
a.lineTo(l + 20, m + 10);
|
|
a.stroke()
|
|
}
|
|
}
|
|
a.setTransform(1, 0, 0, 1, 0, 0)
|
|
},
|
|
xK: function(a, b, c) {
|
|
var d = a.length;
|
|
b.fillStyle = "rgba(255,0,0,.1)";
|
|
for (var e = 0; e < d; e++) {
|
|
var g, h = a[e];
|
|
g = c.Hd;
|
|
var k = h.x,
|
|
l = h.y,
|
|
m = k + h.width,
|
|
n = l + h.height,
|
|
p = g.m11,
|
|
q = g.m12,
|
|
r = g.m21,
|
|
s = g.m22,
|
|
t = g.dx,
|
|
v = g.dy,
|
|
x = k * p + l * r + t,
|
|
h = k * q + l * s + v;
|
|
g = m * p + l * r + t;
|
|
var l = m * q + l * s + v,
|
|
y = k * p + n * r + t,
|
|
k = k * q + n * s + v,
|
|
p = m * p + n * r + t,
|
|
m = m * q + n * s + v,
|
|
n = x,
|
|
q = h,
|
|
n = Math.min(n, g),
|
|
x = Math.max(x, g),
|
|
q = Math.min(q,
|
|
l),
|
|
h = Math.max(h, l),
|
|
n = Math.min(n, y),
|
|
x = Math.max(x, y),
|
|
q = Math.min(q, k),
|
|
h = Math.max(h, k),
|
|
n = Math.min(n, p),
|
|
x = Math.max(x, p),
|
|
q = Math.min(q, m),
|
|
h = Math.max(h, m);
|
|
g = new w(n, q, x - n, h - q);
|
|
b.fillRect(g.x, g.y, g.width, g.height)
|
|
}
|
|
},
|
|
zH: function(a, b, c, d, e) {
|
|
a.fillStyle = "rgba(0,255,0,.2)";
|
|
a.fillRect(b, c, d, e)
|
|
},
|
|
AH: function(a, b, c) {
|
|
a.save();
|
|
var d = b.Hd;
|
|
d.reset();
|
|
1 !== b.scale && d.scale(b.scale);
|
|
b = b.position;
|
|
0 === b.x && 0 === b.y || d.translate(-b.x, -b.y);
|
|
a.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
|
|
c = c.Yc.o;
|
|
d = c.length;
|
|
for (b = 0; b < d; b++) {
|
|
var e =
|
|
c[b];
|
|
a.beginPath();
|
|
a.moveTo(e.x - 4, e.y);
|
|
a.lineTo(e.x + 4, e.y);
|
|
a.moveTo(e.x, e.y - 4);
|
|
a.lineTo(e.x, e.y + 4);
|
|
a.lineWidth = 2;
|
|
a.strokeStyle = "rgba(255,0,0,.9)";
|
|
a.stroke()
|
|
}
|
|
a.restore()
|
|
},
|
|
tK: function(a) {
|
|
a || (a = u.ut);
|
|
for (a = a.mn; a.next();) z.trace(a.value.toString())
|
|
},
|
|
nL: function(a, b) {
|
|
var c = b.lo(a),
|
|
d = b.Qb;
|
|
d.te = b.aB(c);
|
|
d.ga = c;
|
|
return ha(b, d, a)
|
|
},
|
|
iL: function(a, b) {
|
|
b.pe(a.ga) && (b.gd.fillStyle = "lime", b.gd.fillRect(a.te.x, a.te.y, 1 * b.scale, 1 * b.scale))
|
|
},
|
|
jL: function(a) {
|
|
var b = ja(a, !1, null, null);
|
|
if (!b.yp) {
|
|
a = a.gd;
|
|
for (var c = 0; c <= b.Om; c++)
|
|
for (var d =
|
|
0; d <= b.Pm; d++) {
|
|
var e = b.lc[c][d];
|
|
if (0 !== e) {
|
|
var g = c * b.Rd + b.Sf,
|
|
h = d * b.zd + b.Tf;
|
|
0 !== e && (a.fillStyle = "rgba(255, 0, 0, .2)", a.fillRect(g, h, b.Rd, b.zd));
|
|
999999 <= e || (e %= 10, a.fillStyle = "blue", a.fillText(e.toString(), g, h + b.zd))
|
|
}
|
|
}
|
|
}
|
|
},
|
|
dumpReferences: function(a) {
|
|
if (a instanceof C)
|
|
for (a = a.mn; a.next();) {
|
|
var b = a.value;
|
|
z.trace(b.toString());
|
|
for (b = b.ni; b.next();) u.dumpReferences(b.value)
|
|
} else if (a instanceof D) {
|
|
z.trace("References for " + a);
|
|
null !== a.layer && z.trace(" " + a.layer.toString() + ' LayerName: "' + a.If + '"');
|
|
a.vn !==
|
|
a && z.trace(" SelectionObject: " + a.vn.toString() + ' SelectionObjectName: "' + a.Ix + '"');
|
|
a.Zb !== a && z.trace(" LocationObject: " + a.Zb.toString() + ' LocationObjectName: "' + a.sx + '"');
|
|
if (a.Wg) {
|
|
for (var c = "", b = a.Wg.i; b.next();) c += b.key + " ";
|
|
z.trace(" Adornments: " + c)
|
|
}
|
|
null !== a.Va && z.trace(" ContainingGroup: " + a.Va.toString());
|
|
if (a instanceof E) {
|
|
if (a.Dd)
|
|
for (b = a.Dd.i; b.next(););
|
|
if (0 < a.ee.count) {
|
|
c = "";
|
|
for (b = a.ee; b.next();) c += b.value.toString() + ", ";
|
|
z.trace(" Links: " + c)
|
|
}
|
|
null !== a.Nd && z.trace(" LabeledLink: " + a.Nd.toString());
|
|
if (a instanceof F) {
|
|
z.trace(" Placeholder: " + a.placeholder);
|
|
c = "";
|
|
for (b = a.Hc; b.next();) c += b.value.toString() + ", ";
|
|
z.trace(" Members: " + c);
|
|
c = "";
|
|
for (b = a.wm.i; b.next();) c += b.value.toString() + ", ";
|
|
z.trace(" NestedGroups: " + c);
|
|
z.trace(" Layout: " + a.Sb)
|
|
}
|
|
} else if (a instanceof G) {
|
|
z.trace(" Path: " + a.path);
|
|
z.trace(" From: " + a.Y + " " + a.md + ' "' + a.$f + '"');
|
|
z.trace(" To: " + a.da + " " + a.Qd + ' "' + a.Ug + '"');
|
|
c = "";
|
|
for (b = a.Hf; b.next();) c += b.value.toString() + ", ";
|
|
z.trace(" LabelNodes: " + c)
|
|
}
|
|
}
|
|
},
|
|
dumpVisualTree: function(a) {
|
|
if (a instanceof C)
|
|
for (a = a.mn; a.next();) {
|
|
var b = a.value;
|
|
z.trace(b.toString());
|
|
for (b = b.ni; b.next();) u.dumpVisualTree(b.value)
|
|
} else a instanceof D && (b = " ", a.$D && (b += "c"), a.dE && (b += "d"), a.CE && (b += "g"), a.dF && (b += "m"), a.sF && (b += "h"), a.tF && (b += "z"), a.yF && (b += "o"), a.vk && (b += "s"), a.RF && (b += "t"), a.GF && (b += "A"), a.jx && (b += "B"), a.jA && (b += "L"), a.kb && (b += "S"), a.sk && (b += "H"), u.bC(a, 1, b))
|
|
},
|
|
bC: function(a, b, c) {
|
|
for (var d = "", e = 0; e < b; e++) d += " ";
|
|
d += a.toString();
|
|
c && (d += c);
|
|
c = " ";
|
|
c = a.visible ? c + "v" : c + "~";
|
|
a.ig && (c += "p");
|
|
a.Ff && (c += "m");
|
|
a.Mt &&
|
|
(c += "a");
|
|
d += c;
|
|
if (0 !== a.Vb || 0 !== a.column) d += " [" + a.Vb + "," + a.column + "]";
|
|
d += " " + a.W.toString();
|
|
a.Aa.F() && (d += " d:" + a.Aa.toString());
|
|
a.Ga.F() && (d += " n:" + a.Ga.toString());
|
|
1 !== a.scale && (d += " s:" + a.scale);
|
|
0 !== a.angle && (d += " a:" + a.angle);
|
|
null !== a.background && (d += " b:" + a.background.toString());
|
|
null !== a.vl && (d += " a:" + a.background.toString());
|
|
a instanceof I && (d += " elts:" + a.va.count, 0 !== a.WF && (d += " top:" + a.WF), 0 !== a.XE && (d += " left:" + a.XE), null !== a.Tt && (d += " itemArray#:" + z.bb(a.Tt)), a.lI && (d += " cat:" + a.lI), null !==
|
|
a.data && (d += " data:" + a.data));
|
|
null !== a.yd && (d += ' portId: "' + a.yd + '"');
|
|
z.trace(d);
|
|
if (a instanceof I)
|
|
for (a = a.elements; a.next();) u.bC(a.value, b + 1, "")
|
|
},
|
|
zK: function(a) {
|
|
z.trace("DelayedReferences (" + a.ng.count + ")");
|
|
for (a = a.ng.i; a.next();) {
|
|
for (var b = "", c = a.value.i; c.next();) b += ka(c.value) + ", ";
|
|
z.trace(" " + a.key + ": " + b)
|
|
}
|
|
},
|
|
OD: function(a, b) {
|
|
if (!z.Za(b) || b instanceof Element || b instanceof CanvasRenderingContext2D || b instanceof la || b instanceof ma) return "";
|
|
var c = "",
|
|
d;
|
|
for (d in b)
|
|
if ("string" !== typeof d) "" === c &&
|
|
(c = b + "\n"), c += " " + d + " is not a string property\n";
|
|
else if ("_" !== d.charAt(0) && !(2 >= d.length)) {
|
|
var e = z.tb(b, d);
|
|
if (null !== e && "function" !== typeof e) {
|
|
if (b.hasOwnProperty(d)) {
|
|
var g = Object.getPrototypeOf(b);
|
|
if (g && g.Yv && g.Yv[d]) continue
|
|
} else if (z.ex(b, d)) continue;
|
|
"" === c && (c = b + "\n");
|
|
c += ' unknown property "' + d + '" has value: ' + e + " at " + a + "\n"
|
|
}
|
|
}
|
|
return c
|
|
},
|
|
Lw: function(a, b) {
|
|
if (null !== b && void 0 !== b && "number" !== typeof b && "string" !== typeof b && "boolean" !== typeof b && "function" !== typeof b)
|
|
if (void 0 !== z.nd(b)) {
|
|
if (!u.mw.contains(b))
|
|
if (u.mw.add(b),
|
|
u.Mv.add(u.OD(a, b)), b instanceof J || b instanceof K || b instanceof na)
|
|
for (var c = b.i; c.next();) u.Lw(a + "[" + c.key + "]", c.value);
|
|
else
|
|
for (c in b) {
|
|
var d = z.tb(b, c);
|
|
if (void 0 !== d && null !== d && z.Za(d) && d !== b.Yv) {
|
|
if (b instanceof qa) {
|
|
if (d === b.Nj) continue
|
|
} else if (b instanceof I) {
|
|
if ("data" === c || d === b.fe) continue;
|
|
if ("itemArray" === c || d === b.Ii) continue;
|
|
if (b instanceof D && d === b.il) continue
|
|
} else if (!(b instanceof C))
|
|
if (b instanceof ra) {
|
|
if ("archetypeGroupData" === c || d === b.iy) continue
|
|
} else if (b instanceof ta) {
|
|
if ("archetypeLinkData" ===
|
|
c || d === b.ky) continue;
|
|
if ("archetypeLabelNodeData" === c || d === b.jy) continue
|
|
} else if (b instanceof va) {
|
|
if ("archetypeNodeData" === c || d === b.Mk) continue
|
|
} else if (b instanceof M) {
|
|
if ("nodeDataArray" === c || d === b.wf) continue;
|
|
if ("linkDataArray" === c || d === b.vf || d === b.sm) continue;
|
|
if (d === b.vc) continue;
|
|
if (d === b.ng) continue
|
|
} else if (b instanceof wa || b instanceof xa || b instanceof ya) continue;
|
|
u.Lw(a + "." + c, d)
|
|
}
|
|
}
|
|
} else if (Array.isArray(b))
|
|
for (c = 0; c < b.length; c++) u.Lw(a + "[" + c + "]", b[c]);
|
|
else u.Mv.add(u.OD(a, b))
|
|
},
|
|
checkProperties: function(a) {
|
|
void 0 ===
|
|
u.mw ? u.mw = new K(Object) : u.mw.clear();
|
|
u.Mv = new za;
|
|
u.Lw("", a);
|
|
a = u.Mv.toString();
|
|
u.Mv = null;
|
|
return a
|
|
}
|
|
};
|
|
aa.Debug = u;
|
|
var z = {
|
|
pd: 1,
|
|
Tc: 2,
|
|
fd: 4,
|
|
ed: 8,
|
|
jn: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("534.30") && 0 < window.navigator.userAgent.indexOf("Android"),
|
|
NE: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("MSIE 10.0"),
|
|
OE: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Trident/7"),
|
|
GK: void 0 !== window.navigator && 0 < window.navigator.userAgent.indexOf("Edge/"),
|
|
rk: void 0 !== window.navigator && void 0 !== window.navigator.platform && 0 <= window.navigator.platform.toUpperCase().indexOf("MAC"),
|
|
PE: void 0 !== window.navigator && void 0 !== window.navigator.platform && null !== window.navigator.platform.match(/(iPhone|iPod|iPad)/i),
|
|
aE: function(a, b, c) {
|
|
var d = -1;
|
|
return function() {
|
|
var e = this,
|
|
g = arguments; - 1 !== d && z.clearTimeout(d);
|
|
d = z.setTimeout(function() {
|
|
d = -1;
|
|
c || a.apply(e, g)
|
|
}, b);
|
|
c && !d && a.apply(e, g)
|
|
}
|
|
},
|
|
setTimeout: function(a, b) {
|
|
return window.setTimeout(a, b)
|
|
},
|
|
clearTimeout: function(a) {
|
|
window.clearTimeout(a)
|
|
},
|
|
createElement: function(a) {
|
|
return window.document.createElement(a)
|
|
},
|
|
k: function(a) {
|
|
throw Error(a);
|
|
},
|
|
oa: function(a,
|
|
b) {
|
|
var c = "The object is frozen, so its properties cannot be set: " + a.toString();
|
|
void 0 !== b && (c += " to value: " + b);
|
|
z.k(c)
|
|
},
|
|
l: function(a, b, c, d) {
|
|
a instanceof b || (c = z.getTypeName(c), void 0 !== d && (c += "." + d), z.ic(a, b, c))
|
|
},
|
|
g: function(a, b, c, d) {
|
|
typeof a !== b && (c = z.getTypeName(c), void 0 !== d && (c += "." + d), z.ic(a, b, c))
|
|
},
|
|
p: function(a, b, c) {
|
|
"number" === typeof a && isFinite(a) || (b = z.getTypeName(b), void 0 !== c && (b += "." + c), z.k(b + " must be a real number type, and not NaN or Infinity: " + a))
|
|
},
|
|
Ba: function(a, b, c, d) {
|
|
a instanceof
|
|
Ba && a.ze === b || (c = z.getTypeName(c), void 0 !== d && (c += "." + d), z.ic(a, "a constant of class " + z.kf(b), c))
|
|
},
|
|
ot: function(a, b) {
|
|
"string" === typeof a ? Ca(a) || z.k('Color "' + a + '" is not a valid color string for ' + b) : a instanceof Da || z.k("Value for " + b + " must be a color string or a Brush, not " + a)
|
|
},
|
|
ic: function(a, b, c, d) {
|
|
b = z.getTypeName(b);
|
|
c = z.getTypeName(c);
|
|
void 0 !== d && (c += "." + d);
|
|
"string" === typeof a ? z.k(c + " value is not an instance of " + b + ': "' + a + '"') : z.k(c + " value is not an instance of " + b + ": " + a)
|
|
},
|
|
ka: function(a,
|
|
b, c, d) {
|
|
c = z.getTypeName(c);
|
|
void 0 !== d && (c += "." + d);
|
|
z.k(c + " is not in the range " + b + ": " + a)
|
|
},
|
|
od: function(a) {
|
|
z.k(z.kf(a) + " constructor cannot take any arguments.")
|
|
},
|
|
Sa: function(a) {
|
|
z.k("Collection was modified during iteration: " + a.toString() + "\n Perhaps you should iterate over a copy of the collection,\n or you could collect items to be removed from the collection after the iteration.")
|
|
},
|
|
trace: function(a) {
|
|
window.console && window.console.log(a)
|
|
},
|
|
Za: function(a) {
|
|
return "object" === typeof a && null !== a
|
|
},
|
|
isArray: function(a) {
|
|
return Array.isArray(a) ||
|
|
a instanceof NodeList || a instanceof HTMLCollection
|
|
},
|
|
gI: function(a) {
|
|
return Array.isArray(a)
|
|
},
|
|
nt: function(a, b, c) {
|
|
z.isArray(a) || z.ic(a, "Array or NodeList or HTMLCollection", b, c)
|
|
},
|
|
bb: function(a) {
|
|
return a.length
|
|
},
|
|
zl: function(a) {
|
|
return Array.prototype.slice.call(a)
|
|
},
|
|
Ya: function(a, b) {
|
|
Array.isArray(a);
|
|
return a[b]
|
|
},
|
|
LD: function(a, b, c) {
|
|
Array.isArray(a) ? a[b] = c : z.k("Cannot replace an object in an HTMLCollection or NodeList at " + b)
|
|
},
|
|
Dz: function(a, b) {
|
|
if (Array.isArray(a)) return a.indexOf(b);
|
|
for (var c = a.length, d =
|
|
0; d < c; d++)
|
|
if (a[d] === b) return d;
|
|
return -1
|
|
},
|
|
aj: function(a, b, c) {
|
|
Array.isArray(a) ? b >= a.length ? a.push(c) : a.splice(b, 0, c) : z.k("Cannot insert an object into an HTMLCollection or NodeList: " + c + " at " + b)
|
|
},
|
|
hi: function(a, b) {
|
|
Array.isArray(a) ? b >= a.length ? a.pop() : a.splice(b, 1) : z.k("Cannot remove an object from an HTMLCollection or NodeList at " + b)
|
|
},
|
|
Yx: [],
|
|
O: function() {
|
|
var a = z.Yx.pop();
|
|
return void 0 === a ? new N : a
|
|
},
|
|
Tb: function(a, b) {
|
|
var c = z.Yx.pop();
|
|
if (void 0 === c) return new N(a, b);
|
|
c.x = a;
|
|
c.y = b;
|
|
return c
|
|
},
|
|
A: function(a) {
|
|
z.Yx.push(a)
|
|
},
|
|
nB: [],
|
|
Xl: function() {
|
|
var a = z.nB.pop();
|
|
return void 0 === a ? new Ea : a
|
|
},
|
|
pk: function(a) {
|
|
z.nB.push(a)
|
|
},
|
|
Zx: [],
|
|
kg: function() {
|
|
var a = z.Zx.pop();
|
|
return void 0 === a ? new w : a
|
|
},
|
|
yk: function(a, b, c, d) {
|
|
var e = z.Zx.pop();
|
|
if (void 0 === e) return new w(a, b, c, d);
|
|
e.x = a;
|
|
e.y = b;
|
|
e.width = c;
|
|
e.height = d;
|
|
return e
|
|
},
|
|
dc: function(a) {
|
|
z.Zx.push(a)
|
|
},
|
|
oB: [],
|
|
Fh: function() {
|
|
var a = z.oB.pop();
|
|
return void 0 === a ? new Fa : a
|
|
},
|
|
jf: function(a) {
|
|
z.oB.push(a)
|
|
},
|
|
$x: null,
|
|
v: function() {
|
|
var a = z.$x;
|
|
return null !== a ? (z.$x = null, a) : new Ga
|
|
},
|
|
u: function(a) {
|
|
a.reset();
|
|
z.$x = a
|
|
},
|
|
mB: [],
|
|
rb: function() {
|
|
var a = z.mB.pop();
|
|
return void 0 === a ? [] : a
|
|
},
|
|
xa: function(a) {
|
|
a.length = 0;
|
|
z.mB.push(a)
|
|
},
|
|
xj: Object.freeze([]),
|
|
am: 1,
|
|
kc: function(a) {
|
|
a.__gohashid = z.am++
|
|
},
|
|
It: function(a) {
|
|
var b = a.__gohashid;
|
|
void 0 === b && (b = z.am++, a.__gohashid = b);
|
|
return b
|
|
},
|
|
nd: function(a) {
|
|
return a.__gohashid
|
|
},
|
|
ia: function(a, b) {
|
|
b.py = a;
|
|
aa[a] = b
|
|
},
|
|
Qa: function(a, b) {
|
|
function c() {}
|
|
c.prototype = b.prototype;
|
|
a.prototype = new c;
|
|
a.prototype.constructor = a
|
|
},
|
|
ii: function(a) {
|
|
a.CG = !0
|
|
},
|
|
defineProperty: function(a, b, c, d, e) {
|
|
z.g(a, "function", "Util.defineProperty:classfunc");
|
|
z.g(b, "object", "Util.defineProperty:propobj");
|
|
z.g(c, "function", "Util.defineProperty:getter");
|
|
z.g(d, "function", "Util.defineProperty:setter");
|
|
for (var g in b) {
|
|
b = b[g];
|
|
c = {
|
|
get: c,
|
|
set: d,
|
|
enumerable: !0
|
|
};
|
|
if (void 0 !== e)
|
|
for (var h in e) c[h] = e[h];
|
|
Object.defineProperty(a.prototype, g, c);
|
|
e = Object.getOwnPropertyDescriptor(a.prototype, g);
|
|
b && e && Object.defineProperty(a.prototype, b, e);
|
|
break
|
|
}
|
|
},
|
|
GJ: !1,
|
|
w: function(a, b, c, d) {
|
|
z.g(a, "function", "Util.defineReadOnlyProperty:classfunc");
|
|
z.g(b, "object", "Util.defineReadOnlyProperty:propobj");
|
|
z.g(c, "function", "Util.defineReadOnlyProperty:getter");
|
|
for (var e in b) {
|
|
var g = b[e];
|
|
b = {
|
|
get: c,
|
|
set: function(a) {
|
|
z.k('The property "' + g + '" is read-only and cannot be set to ' + a)
|
|
},
|
|
enumerable: !0
|
|
};
|
|
if (void 0 !== d)
|
|
for (var h in d) b[h] = d[h];
|
|
Object.defineProperty(a.prototype, e, b);
|
|
d = Object.getOwnPropertyDescriptor(a.prototype, e);
|
|
g && d && Object.defineProperty(a.prototype, g, d);
|
|
break
|
|
}
|
|
},
|
|
Yd: function(a, b) {
|
|
for (var c in b) b[c] = !0;
|
|
a.prototype.Yv = b
|
|
},
|
|
getTypeName: function(a) {
|
|
return void 0 === a ? "" : "string" === typeof a ? a : "function" ===
|
|
typeof a ? z.kf(a) : null === a ? "*" : ""
|
|
},
|
|
kf: function(a) {
|
|
if ("function" === typeof a) {
|
|
if (a.py) return a.py;
|
|
if (a.name) return a.name;
|
|
var b = a.toString(),
|
|
c = b.indexOf("("),
|
|
b = b.substring(9, c).trim();
|
|
if ("" !== b) return a.py = b
|
|
} else if ("object" === typeof a && a.constructor) return z.kf(a.constructor);
|
|
return typeof a
|
|
},
|
|
s: function(a, b, c) {
|
|
z.g(a, "function", "Util.defineEnumValue:classfunc");
|
|
z.g(b, "string", "Util.defineEnumValue:name");
|
|
z.g(c, "number", "Util.defineEnumValue:num");
|
|
c = new Ba(a, b, c);
|
|
Object.freeze(c);
|
|
a[b] = c;
|
|
var d = a.Fu;
|
|
d instanceof
|
|
na || (d = new na("string", Ba), a.Fu = d);
|
|
d.add(b, c);
|
|
return c
|
|
},
|
|
tb: function(a, b) {
|
|
if (!a || !b) return null;
|
|
var c = void 0;
|
|
try {
|
|
"function" === typeof b ? c = b(a) : "function" === typeof a.getAttribute ? (c = a.getAttribute(b), null === c && (c = void 0)) : c = a[b]
|
|
} catch (d) {
|
|
u && z.trace("property get error: " + d.toString())
|
|
}
|
|
return c
|
|
},
|
|
Ra: function(a, b, c) {
|
|
if (a && b) try {
|
|
"function" === typeof b ? b(a, c) : "function" === typeof a.setAttribute ? a.setAttribute(b, c) : a[b] = c
|
|
} catch (d) {
|
|
u && z.trace("property set error: " + d.toString())
|
|
}
|
|
},
|
|
qu: function(a, b) {
|
|
z.g(a, "object",
|
|
"Setting properties requires Objects as arguments");
|
|
z.g(b, "object", "Setting properties requires Objects as arguments");
|
|
var c = a instanceof I,
|
|
d = a instanceof C,
|
|
e;
|
|
for (e in b) {
|
|
"" === e && z.k("Setting properties requires non-empty property names");
|
|
var g = a,
|
|
h = e;
|
|
if (c || d) {
|
|
var k = e.indexOf(".");
|
|
if (0 < k) {
|
|
var l = e.substring(0, k);
|
|
if (c) g = a.oe(l);
|
|
else if (g = a[l], void 0 === g || null === g) g = a.hb[l];
|
|
z.Za(g) ? h = e.substr(k + 1) : z.k("Unable to find object named: " + l + " in " + a.toString() + " when trying to set property: " + e)
|
|
}
|
|
}
|
|
if ("_" !==
|
|
h[0] && !z.ex(g, h))
|
|
if (d && "ModelChanged" === h) {
|
|
a.QG(b[h]);
|
|
continue
|
|
} else if (d && "Changed" === h) {
|
|
a.Rm(b[h]);
|
|
continue
|
|
} else if (d && z.ex(a.hb, h)) g = a.hb;
|
|
else if (d && Ia(a, h)) {
|
|
a.yz(h, b[h]);
|
|
continue
|
|
} else if (a instanceof M && "Changed" === h) {
|
|
a.Rm(b[h]);
|
|
continue
|
|
} else z.k('Trying to set undefined property "' + h + '" on object: ' + g.toString());
|
|
g[h] = b[e];
|
|
"_" === h[0] && g instanceof O && g.NG(h)
|
|
}
|
|
},
|
|
ex: function(a, b) {
|
|
if (a.hasOwnProperty(b)) return !0;
|
|
for (var c = Object.getPrototypeOf(a); c && c !== Function;) {
|
|
if (c.hasOwnProperty(b)) return !0;
|
|
var d = c.Yv;
|
|
if (d && d[b]) return !0;
|
|
c = Object.getPrototypeOf(c)
|
|
}
|
|
return !1
|
|
},
|
|
VI: function(a) {
|
|
for (var b = [], c = 0; 256 > c; c++) b[c] = c;
|
|
for (var d = 0, e = 0, c = 0; 256 > c; c++) d = (d + b[c] + 119) % 256, e = b[c], b[c] = b[d], b[d] = e;
|
|
for (var d = c = 0, g = "", h = 0; h < a.length; h++) c = (c + 1) % 256, d = (d + b[c]) % 256, e = b[c], b[c] = b[d], b[d] = e, g += String.fromCharCode(a.charCodeAt(h) ^ b[(b[c] + b[d]) % 256]);
|
|
return g
|
|
},
|
|
VH: 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
|
|
},
|
|
Fg: function(a) {
|
|
return z.VI(z.VH(a))
|
|
},
|
|
Zl: null,
|
|
adym: "70a114bcad351489",
|
|
vfo: "2be640fdb26e",
|
|
bH: "28fc4e",
|
|
cH: "2bfb40"
|
|
};
|
|
z.Zl = function() {
|
|
var a = window.document.createElement("canvas"),
|
|
b = a.getContext("2d");
|
|
b[z.Fg("7ca11abfd022028846")] = z.Fg("398c3597c01238");
|
|
for (var c = ["5da73c80a3330d854f9e5e671d6633", "32ab5ff3b26f42dc0ed90f22422913b54ae6247590da4bb21c324ba3a84e385776", "54a702f3e53909c447824c6706603faf4cfb236cdfda5de14c134ba1a95a2d4c7cc6f93c1387", "74bf19bce72555874c86"], d = 1; 5 > d; d++) b[z.Fg("7ca11abfd7330390")](z.Fg(c[d - 1]), 10, 15 * d + 0);
|
|
b[z.Fg("7ca11abfd022028846")] = z.Fg("39f046ebb36e4b");
|
|
for (d = 1; 5 > d; d++) b[z.Fg("7ca11abfd7330390")](z.Fg(c[d -
|
|
1]), 10, 15 * d + 0);
|
|
if (4 !== c.length || "5" !== c[0][0] || "7" !== c[3][0]) z.s = function(a, b) {
|
|
var c = new Ba(a, b, 2);
|
|
Object.freeze(c);
|
|
a[b] = c;
|
|
var d = a.Fu;
|
|
d instanceof na || (d = new na("string", Ba), a.Fu = d);
|
|
d.add(b, c);
|
|
return c
|
|
};
|
|
return a
|
|
}();
|
|
|
|
function Ba(a, b, c) {
|
|
z.kc(this);
|
|
this.xB = a;
|
|
this.Ub = b;
|
|
this.HG = c
|
|
}
|
|
z.ia("EnumValue", Ba);
|
|
Ba.prototype.toString = function() {
|
|
return z.kf(this.xB) + "." + this.Ub
|
|
};
|
|
z.w(Ba, {
|
|
ze: "classType"
|
|
}, function() {
|
|
return this.xB
|
|
});
|
|
z.w(Ba, {
|
|
name: "name"
|
|
}, function() {
|
|
return this.Ub
|
|
});
|
|
z.w(Ba, {
|
|
value: "value"
|
|
}, function() {
|
|
return this.HG
|
|
});
|
|
var Ja;
|
|
Ba.findName = Ja = function(a, b) {
|
|
if (void 0 === b || null === b || "" === b) return null;
|
|
z.g(a, "function", "findName:classfunc");
|
|
z.g(b, "string", "EnumValue.findName:name");
|
|
var c = a.Fu;
|
|
return c instanceof na ? c.na(b) : null
|
|
};
|
|
|
|
function za() {
|
|
this.wB = []
|
|
}
|
|
za.prototype.toString = function() {
|
|
return this.wB.join("")
|
|
};
|
|
za.prototype.add = function(a) {
|
|
"" !== a && this.wB.push(a)
|
|
};
|
|
|
|
function ma() {}
|
|
|
|
function Ka(a) {
|
|
void 0 === a && (a = 42);
|
|
this.seed = a;
|
|
this.Ux = 48271;
|
|
this.Eu = 2147483647;
|
|
this.lB = this.Eu / this.Ux;
|
|
this.lG = this.Eu % this.Ux;
|
|
this.kG = 1 / this.Eu;
|
|
this.random()
|
|
}
|
|
Ka.prototype.random = function() {
|
|
var a = this.seed % this.lB * this.Ux - this.seed / this.lB * this.lG;
|
|
this.seed = 0 < a ? a : a + this.Eu;
|
|
return this.seed * this.kG
|
|
};
|
|
|
|
function Ma() {}
|
|
z.w(Ma, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
Ma.prototype.reset = Ma.prototype.reset = function() {};
|
|
Ma.prototype.next = Ma.prototype.hasNext = Ma.prototype.next = function() {
|
|
return !1
|
|
};
|
|
Ma.prototype.first = Ma.prototype.first = function() {
|
|
return null
|
|
};
|
|
Ma.prototype.any = function() {
|
|
return !1
|
|
};
|
|
Ma.prototype.all = function() {
|
|
return !0
|
|
};
|
|
Ma.prototype.each = function() {
|
|
return this
|
|
};
|
|
Ma.prototype.map = function() {
|
|
return this
|
|
};
|
|
Ma.prototype.filter = function() {
|
|
return this
|
|
};
|
|
Ma.prototype.concat = function(a) {
|
|
return a.i
|
|
};
|
|
z.w(Ma, {
|
|
count: "count"
|
|
}, function() {
|
|
return 0
|
|
});
|
|
Ma.prototype.Nf = function() {};
|
|
Ma.prototype.toString = function() {
|
|
return "EmptyIterator"
|
|
};
|
|
var Pa = new Ma;
|
|
|
|
function Ra(a) {
|
|
this.key = -1;
|
|
this.value = a
|
|
}
|
|
z.Yd(Ra, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(Ra, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
Ra.prototype.reset = Ra.prototype.reset = function() {
|
|
this.key = -1
|
|
};
|
|
Ra.prototype.next = Ra.prototype.hasNext = Ra.prototype.next = function() {
|
|
return -1 === this.key ? (this.key = 0, !0) : !1
|
|
};
|
|
Ra.prototype.first = Ra.prototype.first = function() {
|
|
this.key = 0;
|
|
return this.value
|
|
};
|
|
Ra.prototype.any = function(a) {
|
|
this.key = -1;
|
|
return a(this.value)
|
|
};
|
|
Ra.prototype.all = function(a) {
|
|
this.key = -1;
|
|
return a(this.value)
|
|
};
|
|
Ra.prototype.each = function(a) {
|
|
this.key = -1;
|
|
a(this.value);
|
|
return this
|
|
};
|
|
Ra.prototype.map = function(a) {
|
|
return new Ra(a(this.value))
|
|
};
|
|
Ra.prototype.filter = function(a) {
|
|
return a(this.value) ? new Ra(this.value) : Pa
|
|
};
|
|
Ra.prototype.concat = function(a) {
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(Ra, {
|
|
count: "count"
|
|
}, function() {
|
|
return 1
|
|
});
|
|
Ra.prototype.Nf = function() {
|
|
this.value = null
|
|
};
|
|
Ra.prototype.toString = function() {
|
|
return "SingletonIterator(" + this.value + ")"
|
|
};
|
|
|
|
function Sa(a, b) {
|
|
this.$k = a;
|
|
this.al = b;
|
|
this.Gu = !1
|
|
}
|
|
z.Yd(Sa, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(Sa, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
Sa.prototype.reset = Sa.prototype.reset = function() {
|
|
this.$k.reset();
|
|
this.al.reset();
|
|
this.Gu = !1
|
|
};
|
|
Sa.prototype.next = Sa.prototype.hasNext = Sa.prototype.next = function() {
|
|
if (!this.Gu) {
|
|
var a = this.$k;
|
|
if (a.next()) return this.key = a.key, this.value = a.value, !0;
|
|
this.Gu = !0
|
|
}
|
|
return this.Gu && (a = this.al, a.next()) ? (this.key = a.key, this.value = a.value, !0) : !1
|
|
};
|
|
Sa.prototype.first = Sa.prototype.first = function() {
|
|
this.reset();
|
|
return this.next() ? this.value : null
|
|
};
|
|
Sa.prototype.any = function(a) {
|
|
return this.$k.any(a) || this.al.any(a) ? !0 : !1
|
|
};
|
|
Sa.prototype.all = function(a) {
|
|
return this.$k.all(a) && this.al.all(a) ? !0 : !1
|
|
};
|
|
Sa.prototype.each = function(a) {
|
|
this.$k.each(a);
|
|
this.al.each(a);
|
|
return this
|
|
};
|
|
Sa.prototype.map = function(a) {
|
|
return new Sa(this.$k.map(a), this.al.map(a))
|
|
};
|
|
Sa.prototype.filter = function(a) {
|
|
return new Sa(this.$k.filter(a), this.al.filter(a))
|
|
};
|
|
Sa.prototype.concat = function(a) {
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(Sa, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.$k.count + this.al.count
|
|
});
|
|
Sa.prototype.Nf = function() {
|
|
this.value = this.key = null
|
|
};
|
|
Sa.prototype.toString = function() {
|
|
return "ConcatIterator()"
|
|
};
|
|
|
|
function Ta(a) {
|
|
this.Bc = a;
|
|
this.Vh = null;
|
|
this.reset()
|
|
}
|
|
z.Yd(Ta, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(Ta, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
z.defineProperty(Ta, {
|
|
rn: "predicate"
|
|
}, function() {
|
|
return this.Vh
|
|
}, function(a) {
|
|
this.Vh = a
|
|
});
|
|
Ta.prototype.reset = Ta.prototype.reset = function() {
|
|
var a = this.Bc;
|
|
a.ec = null;
|
|
this.nb = a.H;
|
|
this.Uc = -1
|
|
};
|
|
Ta.prototype.next = Ta.prototype.hasNext = Ta.prototype.next = function() {
|
|
var a = this.Bc;
|
|
if (a.H !== this.nb) {
|
|
if (0 > this.key) return !1;
|
|
z.Sa(a)
|
|
}
|
|
var a = a.o,
|
|
b = a.length,
|
|
c = ++this.Uc,
|
|
d = this.Vh;
|
|
if (null !== d)
|
|
for (; c < b;) {
|
|
var e = a[c];
|
|
if (d(e)) return this.key = this.Uc = c, this.value = e, !0;
|
|
c++
|
|
} else {
|
|
if (c < b) return this.key = c, this.value = a[c], !0;
|
|
this.Nf()
|
|
}
|
|
return !1
|
|
};
|
|
Ta.prototype.first = Ta.prototype.first = function() {
|
|
var a = this.Bc;
|
|
this.nb = a.H;
|
|
this.Uc = 0;
|
|
var a = a.o,
|
|
b = a.length,
|
|
c = this.Vh;
|
|
if (null !== c) {
|
|
for (var d = 0; d < b;) {
|
|
var e = a[d];
|
|
if (c(e)) return this.key = this.Uc = d, this.value = e;
|
|
d++
|
|
}
|
|
return null
|
|
}
|
|
return 0 < b ? (e = a[0], this.key = 0, this.value = e) : null
|
|
};
|
|
Ta.prototype.any = function(a) {
|
|
var b = this.Bc;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.Uc = -1;
|
|
for (var d = b.o, e = d.length, g = this.Vh, h = 0; h < e; h++) {
|
|
var k = d[h];
|
|
if (null === g || g(k)) {
|
|
if (a(k)) return !0;
|
|
b.H !== c && z.Sa(b)
|
|
}
|
|
}
|
|
return !1
|
|
};
|
|
Ta.prototype.all = function(a) {
|
|
var b = this.Bc;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.Uc = -1;
|
|
for (var d = b.o, e = d.length, g = this.Vh, h = 0; h < e; h++) {
|
|
var k = d[h];
|
|
if (null === g || g(k)) {
|
|
if (!a(k)) return !1;
|
|
b.H !== c && z.Sa(b)
|
|
}
|
|
}
|
|
return !0
|
|
};
|
|
Ta.prototype.each = function(a) {
|
|
var b = this.Bc;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.Uc = -1;
|
|
for (var d = b.o, e = d.length, g = this.Vh, h = 0; h < e; h++) {
|
|
var k = d[h];
|
|
if (null === g || g(k)) a(k), b.H !== c && z.Sa(b)
|
|
}
|
|
return this
|
|
};
|
|
Ta.prototype.map = function(a) {
|
|
var b = this.Bc;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.Uc = -1;
|
|
for (var d = [], e = b.o, g = e.length, h = this.Vh, k = 0; k < g; k++) {
|
|
var l = e[k];
|
|
if (null === h || h(l)) d.push(a(l)), b.H !== c && z.Sa(b)
|
|
}
|
|
a = new J;
|
|
a.o = d;
|
|
a.Jc();
|
|
return a.i
|
|
};
|
|
Ta.prototype.filter = function(a) {
|
|
var b = this.Bc;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.Uc = -1;
|
|
for (var d = [], e = b.o, g = e.length, h = this.Vh, k = 0; k < g; k++) {
|
|
var l = e[k];
|
|
if (null === h || h(l)) a(l) && d.push(l), b.H !== c && z.Sa(b)
|
|
}
|
|
a = new J(b.ba);
|
|
a.o = d;
|
|
a.Jc();
|
|
return a.i
|
|
};
|
|
Ta.prototype.concat = function(a) {
|
|
this.Bc.ec = null;
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(Ta, {
|
|
count: "count"
|
|
}, function() {
|
|
var a = this.Vh;
|
|
if (null !== a) {
|
|
for (var b = 0, c = this.Bc.o, d = c.length, e = 0; e < d; e++) a(c[e]) && b++;
|
|
return b
|
|
}
|
|
return this.Bc.o.length
|
|
});
|
|
Ta.prototype.Nf = function() {
|
|
this.key = -1;
|
|
this.value = null;
|
|
this.nb = -1;
|
|
this.Vh = null;
|
|
this.Bc.ec = this
|
|
};
|
|
Ta.prototype.toString = function() {
|
|
return "ListIterator@" + this.Uc + "/" + this.Bc.count
|
|
};
|
|
|
|
function Ua(a) {
|
|
this.Bc = a;
|
|
this.reset()
|
|
}
|
|
z.Yd(Ua, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(Ua, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
Ua.prototype.reset = Ua.prototype.reset = function() {
|
|
var a = this.Bc;
|
|
a.Lj = null;
|
|
this.nb = a.H;
|
|
this.Uc = a.o.length
|
|
};
|
|
Ua.prototype.next = Ua.prototype.hasNext = Ua.prototype.next = function() {
|
|
var a = this.Bc;
|
|
if (a.H !== this.nb) {
|
|
if (0 > this.key) return !1;
|
|
z.Sa(a)
|
|
}
|
|
var b = --this.Uc;
|
|
if (0 <= b) return this.key = b, this.value = a.o[b], !0;
|
|
this.Nf();
|
|
return !1
|
|
};
|
|
Ua.prototype.first = Ua.prototype.first = function() {
|
|
var a = this.Bc;
|
|
this.nb = a.H;
|
|
var b = a.o;
|
|
this.Uc = a = b.length - 1;
|
|
return 0 <= a ? (b = b[a], this.key = a, this.value = b) : null
|
|
};
|
|
Ua.prototype.any = function(a) {
|
|
var b = this.Bc;
|
|
b.Lj = null;
|
|
var c = b.H,
|
|
d = b.o,
|
|
e = d.length;
|
|
this.Uc = e;
|
|
for (e -= 1; 0 <= e; e--) {
|
|
if (a(d[e])) return !0;
|
|
b.H !== c && z.Sa(b)
|
|
}
|
|
return !1
|
|
};
|
|
Ua.prototype.all = function(a) {
|
|
var b = this.Bc;
|
|
b.Lj = null;
|
|
var c = b.H,
|
|
d = b.o,
|
|
e = d.length;
|
|
this.Uc = e;
|
|
for (e -= 1; 0 <= e; e--) {
|
|
if (!a(d[e])) return !1;
|
|
b.H !== c && z.Sa(b)
|
|
}
|
|
return !0
|
|
};
|
|
Ua.prototype.each = function(a) {
|
|
var b = this.Bc;
|
|
b.Lj = null;
|
|
var c = b.H,
|
|
d = b.o,
|
|
e = d.length;
|
|
this.Uc = e;
|
|
for (e -= 1; 0 <= e; e--) a(d[e]), b.H !== c && z.Sa(b);
|
|
return this
|
|
};
|
|
Ua.prototype.map = function(a) {
|
|
var b = this.Bc;
|
|
b.Lj = null;
|
|
var c = b.H,
|
|
d = [],
|
|
e = b.o,
|
|
g = e.length;
|
|
this.Uc = g;
|
|
for (g -= 1; 0 <= g; g--) d.push(a(e[g])), b.H !== c && z.Sa(b);
|
|
a = new J;
|
|
a.o = d;
|
|
a.Jc();
|
|
return a.i
|
|
};
|
|
Ua.prototype.filter = function(a) {
|
|
var b = this.Bc;
|
|
b.Lj = null;
|
|
var c = b.H,
|
|
d = [],
|
|
e = b.o,
|
|
g = e.length;
|
|
this.Uc = g;
|
|
for (g -= 1; 0 <= g; g--) {
|
|
var h = e[g];
|
|
a(h) && d.push(h);
|
|
b.H !== c && z.Sa(b)
|
|
}
|
|
a = new J(b.ba);
|
|
a.o = d;
|
|
a.Jc();
|
|
return a.i
|
|
};
|
|
Ua.prototype.concat = function(a) {
|
|
this.Bc.Lj = null;
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(Ua, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.Bc.o.length
|
|
});
|
|
Ua.prototype.Nf = function() {
|
|
this.key = -1;
|
|
this.value = null;
|
|
this.nb = -1;
|
|
this.Bc.Lj = this
|
|
};
|
|
Ua.prototype.toString = function() {
|
|
return "ListIteratorBackwards(" + this.Uc + "/" + this.Bc.count + ")"
|
|
};
|
|
|
|
function J(a) {
|
|
z.kc(this);
|
|
this.G = !1;
|
|
this.o = [];
|
|
this.H = 0;
|
|
this.Lj = this.ec = null;
|
|
void 0 === a || null === a ? this.ba = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a || "boolean" === a || "function" === a ? this.ba = a : z.ka(a, "the string 'object', 'number', 'string', 'boolean', or 'function'", "List constructor: type") : "function" === typeof a ? this.ba = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a === Boolean ? "boolean" : a === Function ? "function" : a : z.ka(a, "null, a primitive type name, or a class type",
|
|
"List constructor: type")
|
|
}
|
|
z.ia("List", J);
|
|
J.prototype.Yg = function(a) {
|
|
null !== this.ba && ("string" === typeof this.ba ? typeof a === this.ba && null !== a || z.ic(a, this.ba) : a instanceof this.ba || z.ic(a, this.ba))
|
|
};
|
|
J.prototype.Jc = function() {
|
|
var a = this.H;
|
|
a++;
|
|
999999999 < a && (a = 0);
|
|
this.H = a
|
|
};
|
|
J.prototype.freeze = J.prototype.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
J.prototype.thaw = J.prototype.Wa = function() {
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
J.prototype.toString = function() {
|
|
return "List(" + z.getTypeName(this.ba) + ")#" + z.nd(this)
|
|
};
|
|
J.prototype.add = J.prototype.push = J.prototype.add = function(a) {
|
|
null !== a && (u && this.Yg(a), this.G && z.oa(this, a), this.o.push(a), this.Jc())
|
|
};
|
|
J.prototype.addAll = J.prototype.$c = function(a) {
|
|
if (null === a) return this;
|
|
this.G && z.oa(this);
|
|
var b = this.o;
|
|
if (z.isArray(a))
|
|
for (var c = z.bb(a), d = 0; d < c; d++) {
|
|
var e = z.Ya(a, d);
|
|
u && this.Yg(e);
|
|
b.push(e)
|
|
} else
|
|
for (a = a.i; a.next();) e = a.value, u && this.Yg(e), b.push(e);
|
|
this.Jc();
|
|
return this
|
|
};
|
|
J.prototype.clear = J.prototype.clear = function() {
|
|
this.G && z.oa(this);
|
|
this.o.length = 0;
|
|
this.Jc()
|
|
};
|
|
J.prototype.contains = J.prototype.has = J.prototype.contains = function(a) {
|
|
if (null === a) return !1;
|
|
u && this.Yg(a);
|
|
return -1 !== this.o.indexOf(a)
|
|
};
|
|
J.prototype.indexOf = J.prototype.indexOf = function(a) {
|
|
if (null === a) return -1;
|
|
u && this.Yg(a);
|
|
return this.o.indexOf(a)
|
|
};
|
|
J.prototype.elt = J.prototype.get = J.prototype.ea = function(a) {
|
|
u && z.p(a, J, "elt:i");
|
|
var b = this.o;
|
|
(0 > a || a >= b.length) && z.ka(a, "0 <= i < length", J, "elt:i");
|
|
return b[a]
|
|
};
|
|
J.prototype.setElt = J.prototype.set = J.prototype.Rg = function(a, b) {
|
|
u && (this.Yg(b), z.p(a, J, "setElt:i"));
|
|
var c = this.o;
|
|
(0 > a || a >= c.length) && z.ka(a, "0 <= i < length", J, "setElt:i");
|
|
this.G && z.oa(this, a);
|
|
c[a] = b
|
|
};
|
|
J.prototype.first = J.prototype.first = function() {
|
|
var a = this.o;
|
|
return 0 === a.length ? null : a[0]
|
|
};
|
|
J.prototype.last = J.prototype.de = function() {
|
|
var a = this.o,
|
|
b = a.length;
|
|
return 0 < b ? a[b - 1] : null
|
|
};
|
|
J.prototype.pop = J.prototype.pop = function() {
|
|
this.G && z.oa(this);
|
|
var a = this.o;
|
|
return 0 < a.length ? a.pop() : null
|
|
};
|
|
J.prototype.any = function(a) {
|
|
for (var b = this.o, c = this.H, d = b.length, e = 0; e < d; e++) {
|
|
if (a(b[e])) return !0;
|
|
this.H !== c && z.Sa(this)
|
|
}
|
|
return !1
|
|
};
|
|
J.prototype.all = function(a) {
|
|
for (var b = this.o, c = this.H, d = b.length, e = 0; e < d; e++) {
|
|
if (!a(b[e])) return !1;
|
|
this.H !== c && z.Sa(this)
|
|
}
|
|
return !0
|
|
};
|
|
J.prototype.each = function(a) {
|
|
for (var b = this.o, c = this.H, d = b.length, e = 0; e < d; e++) a(b[e]), this.H !== c && z.Sa(this);
|
|
return this
|
|
};
|
|
J.prototype.map = function(a) {
|
|
for (var b = new J, c = [], d = this.o, e = this.H, g = d.length, h = 0; h < g; h++) c.push(a(d[h])), this.H !== e && z.Sa(this);
|
|
b.o = c;
|
|
b.Jc();
|
|
return b
|
|
};
|
|
J.prototype.filter = function(a) {
|
|
for (var b = new J(this.ba), c = [], d = this.o, e = this.H, g = d.length, h = 0; h < g; h++) {
|
|
var k = d[h];
|
|
a(k) && c.push(k);
|
|
this.H !== e && z.Sa(this)
|
|
}
|
|
b.o = c;
|
|
b.Jc();
|
|
return b
|
|
};
|
|
J.prototype.concat = function(a) {
|
|
return this.copy().$c(a)
|
|
};
|
|
J.prototype.insertAt = J.prototype.Ld = function(a, b) {
|
|
u && (this.Yg(b), z.p(a, J, "insertAt:i"));
|
|
0 > a && z.ka(a, ">= 0", J, "insertAt:i");
|
|
this.G && z.oa(this, a);
|
|
var c = this.o;
|
|
a >= c.length ? c.push(b) : c.splice(a, 0, b);
|
|
this.Jc();
|
|
return !0
|
|
};
|
|
J.prototype.remove = J.prototype["delete"] = J.prototype.remove = function(a) {
|
|
if (null === a) return !1;
|
|
u && this.Yg(a);
|
|
this.G && z.oa(this, a);
|
|
var b = this.o;
|
|
a = b.indexOf(a);
|
|
if (-1 === a) return !1;
|
|
a === b.length - 1 ? b.pop() : b.splice(a, 1);
|
|
this.Jc();
|
|
return !0
|
|
};
|
|
J.prototype.removeAt = J.prototype.dd = function(a) {
|
|
u && z.p(a, J, "removeAt:i");
|
|
var b = this.o;
|
|
(0 > a || a >= b.length) && z.ka(a, "0 <= i < length", J, "removeAt:i");
|
|
this.G && z.oa(this, a);
|
|
a === b.length - 1 ? b.pop() : b.splice(a, 1);
|
|
this.Jc()
|
|
};
|
|
J.prototype.removeRange = J.prototype.removeRange = function(a, b) {
|
|
u && (z.p(a, J, "removeRange:from"), z.p(b, J, "removeRange:to"));
|
|
var c = this.o;
|
|
(0 > a || a >= c.length) && z.ka(a, "0 <= from < length", J, "elt:from");
|
|
(0 > b || b >= c.length) && z.ka(b, "0 <= to < length", J, "elt:to");
|
|
this.G && z.oa(this, a);
|
|
var d = c.slice((b || a) + 1 || c.length);
|
|
c.length = 0 > a ? c.length + a : a;
|
|
c.push.apply(c, d);
|
|
this.Jc()
|
|
};
|
|
J.prototype.copy = function() {
|
|
var a = new J(this.ba),
|
|
b = this.o;
|
|
0 < b.length && (a.o = Array.prototype.slice.call(b));
|
|
return a
|
|
};
|
|
J.prototype.toArray = J.prototype.jc = function() {
|
|
for (var a = this.o, b = this.count, c = Array(b), d = 0; d < b; d++) c[d] = a[d];
|
|
return c
|
|
};
|
|
J.prototype.toSet = J.prototype.VF = function() {
|
|
for (var a = new K(this.ba), b = this.o, c = this.count, d = 0; d < c; d++) a.add(b[d]);
|
|
return a
|
|
};
|
|
J.prototype.sort = J.prototype.sort = function(a) {
|
|
u && z.g(a, "function", J, "sort:sortfunc");
|
|
this.G && z.oa(this);
|
|
this.o.sort(a);
|
|
this.Jc();
|
|
return this
|
|
};
|
|
J.prototype.sortRange = J.prototype.dq = function(a, b, c) {
|
|
var d = this.o,
|
|
e = d.length;
|
|
void 0 === b && (b = 0);
|
|
void 0 === c && (c = e);
|
|
u && (z.g(a, "function", J, "sortRange:sortfunc"), z.p(b, J, "sortRange:from"), z.p(c, J, "sortRange:to"));
|
|
this.G && z.oa(this);
|
|
var g = c - b;
|
|
if (1 >= g) return this;
|
|
(0 > b || b >= e - 1) && z.ka(b, "0 <= from < length", J, "sortRange:from");
|
|
if (2 === g) return c = d[b], e = d[b + 1], 0 < a(c, e) && (d[b] = e, d[b + 1] = c, this.Jc()), this;
|
|
if (0 === b)
|
|
if (c >= e) d.sort(a);
|
|
else
|
|
for (g = d.slice(0, c), g.sort(a), a = 0; a < c; a++) d[a] = g[a];
|
|
else if (c >= e)
|
|
for (g = d.slice(b),
|
|
g.sort(a), a = b; a < e; a++) d[a] = g[a - b];
|
|
else
|
|
for (g = d.slice(b, c), g.sort(a), a = b; a < c; a++) d[a] = g[a - b];
|
|
this.Jc();
|
|
return this
|
|
};
|
|
J.prototype.reverse = J.prototype.reverse = function() {
|
|
this.G && z.oa(this);
|
|
this.o.reverse();
|
|
this.Jc();
|
|
return this
|
|
};
|
|
z.w(J, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.o.length
|
|
});
|
|
z.w(J, {
|
|
size: "size"
|
|
}, function() {
|
|
return this.o.length
|
|
});
|
|
z.w(J, {
|
|
length: "length"
|
|
}, function() {
|
|
return this.o.length
|
|
});
|
|
z.w(J, {
|
|
i: "iterator"
|
|
}, function() {
|
|
if (0 >= this.o.length) return Pa;
|
|
var a = this.ec;
|
|
return null !== a ? (a.reset(), a) : new Ta(this)
|
|
});
|
|
z.w(J, {
|
|
ln: "iteratorBackwards"
|
|
}, function() {
|
|
if (0 >= this.o.length) return Pa;
|
|
var a = this.Lj;
|
|
return null !== a ? (a.reset(), a) : new Ua(this)
|
|
});
|
|
|
|
function Wa(a) {
|
|
this.Xh = a;
|
|
this.reset()
|
|
}
|
|
z.Yd(Wa, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(Wa, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
Wa.prototype.reset = Wa.prototype.reset = function() {
|
|
var a = this.Xh;
|
|
a.ec = null;
|
|
this.nb = a.H;
|
|
this.lb = null
|
|
};
|
|
Wa.prototype.next = Wa.prototype.hasNext = Wa.prototype.next = function() {
|
|
var a = this.Xh;
|
|
if (a.H !== this.nb) {
|
|
if (null === this.key) return !1;
|
|
z.Sa(a)
|
|
}
|
|
var b = this.lb,
|
|
b = null === b ? a.Ka : b.cb;
|
|
if (null !== b) return this.lb = b, this.value = b.value, this.key = b.key, !0;
|
|
this.Nf();
|
|
return !1
|
|
};
|
|
Wa.prototype.first = Wa.prototype.first = function() {
|
|
var a = this.Xh;
|
|
this.nb = a.H;
|
|
a = a.Ka;
|
|
if (null !== a) {
|
|
this.lb = a;
|
|
var b = a.value;
|
|
this.key = a.key;
|
|
return this.value = b
|
|
}
|
|
return null
|
|
};
|
|
Wa.prototype.any = function(a) {
|
|
var b = this.Xh;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (a(d.value)) return !0;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !1
|
|
};
|
|
Wa.prototype.all = function(a) {
|
|
var b = this.Xh;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (!a(d.value)) return !1;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !0
|
|
};
|
|
Wa.prototype.each = function(a) {
|
|
var b = this.Xh;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) a(d.value), b.H !== c && z.Sa(b), d = d.cb;
|
|
return this
|
|
};
|
|
Wa.prototype.map = function(a) {
|
|
var b = this.Xh;
|
|
b.ec = null;
|
|
for (var c = new J, d = b.H, e = b.Ka; null !== e;) c.add(a(e.value)), b.H !== d && z.Sa(b), e = e.cb;
|
|
return c.i
|
|
};
|
|
Wa.prototype.filter = function(a) {
|
|
var b = this.Xh;
|
|
b.ec = null;
|
|
for (var c = new J(b.ba), d = b.H, e = b.Ka; null !== e;) {
|
|
var g = e.value;
|
|
a(g) && c.add(g);
|
|
b.H !== d && z.Sa(b);
|
|
e = e.cb
|
|
}
|
|
return c.i
|
|
};
|
|
Wa.prototype.concat = function(a) {
|
|
this.Xh.ec = null;
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(Wa, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.Xh.rd
|
|
});
|
|
Wa.prototype.Nf = function() {
|
|
this.value = this.key = null;
|
|
this.nb = -1;
|
|
this.Xh.ec = this
|
|
};
|
|
Wa.prototype.toString = function() {
|
|
return null !== this.lb ? "SetIterator@" + this.lb.value : "SetIterator"
|
|
};
|
|
|
|
function K(a) {
|
|
z.kc(this);
|
|
this.G = !1;
|
|
void 0 === a || null === a ? this.ba = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.ba = a : z.ka(a, "the string 'object', 'number' or 'string'", "Set constructor: type") : "function" === typeof a ? this.ba = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : z.ka(a, "null, a primitive type name, or a class type", "Set constructor: type");
|
|
this.sd = {};
|
|
this.rd = 0;
|
|
this.ec = null;
|
|
this.H = 0;
|
|
this.Sh = this.Ka = null
|
|
}
|
|
z.ia("Set", K);
|
|
K.prototype.Yg = function(a) {
|
|
null !== this.ba && ("string" === typeof this.ba ? typeof a === this.ba && null !== a || z.ic(a, this.ba) : a instanceof this.ba || z.ic(a, this.ba))
|
|
};
|
|
K.prototype.Jc = function() {
|
|
var a = this.H;
|
|
a++;
|
|
999999999 < a && (a = 0);
|
|
this.H = a
|
|
};
|
|
K.prototype.freeze = K.prototype.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
K.prototype.thaw = K.prototype.Wa = function() {
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
K.prototype.toString = function() {
|
|
return "Set(" + z.getTypeName(this.ba) + ")#" + z.nd(this)
|
|
};
|
|
K.prototype.add = K.prototype.add = function(a) {
|
|
if (null === a) return !1;
|
|
u && this.Yg(a);
|
|
this.G && z.oa(this, a);
|
|
var b = a;
|
|
z.Za(a) && (b = z.It(a));
|
|
return void 0 === this.sd[b] ? (this.rd++, a = new Ya(a, a), this.sd[b] = a, b = this.Sh, null === b ? this.Ka = a : (a.Ho = b, b.cb = a), this.Sh = a, this.Jc(), !0) : !1
|
|
};
|
|
K.prototype.addAll = K.prototype.$c = function(a) {
|
|
if (null === a) return this;
|
|
this.G && z.oa(this);
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) this.add(z.Ya(a, c));
|
|
else
|
|
for (a = a.i; a.next();) this.add(a.value);
|
|
return this
|
|
};
|
|
K.prototype.contains = K.prototype.has = K.prototype.contains = function(a) {
|
|
if (null === a) return !1;
|
|
u && this.Yg(a);
|
|
var b = a;
|
|
return z.Za(a) && (b = z.nd(a), void 0 === b) ? !1 : void 0 !== this.sd[b]
|
|
};
|
|
K.prototype.containsAll = function(a) {
|
|
if (null === a) return !0;
|
|
for (a = a.i; a.next();)
|
|
if (!this.contains(a.value)) return !1;
|
|
return !0
|
|
};
|
|
K.prototype.containsAny = function(a) {
|
|
if (null === a) return !0;
|
|
for (a = a.i; a.next();)
|
|
if (this.contains(a.value)) return !0;
|
|
return !1
|
|
};
|
|
K.prototype.first = K.prototype.first = function() {
|
|
var a = this.Ka;
|
|
return null === a ? null : a.value
|
|
};
|
|
K.prototype.any = function(a) {
|
|
for (var b = this.H, c = this.Ka; null !== c;) {
|
|
if (a(c.value)) return !0;
|
|
this.H !== b && z.Sa(this);
|
|
c = c.cb
|
|
}
|
|
return !1
|
|
};
|
|
K.prototype.all = function(a) {
|
|
for (var b = this.H, c = this.Ka; null !== c;) {
|
|
if (!a(c.value)) return !1;
|
|
this.H !== b && z.Sa(this);
|
|
c = c.cb
|
|
}
|
|
return !0
|
|
};
|
|
K.prototype.each = function(a) {
|
|
for (var b = this.H, c = this.Ka; null !== c;) a(c.value), this.H !== b && z.Sa(this), c = c.cb;
|
|
return this
|
|
};
|
|
K.prototype.map = function(a) {
|
|
for (var b = new K, c = this.H, d = this.Ka; null !== d;) b.add(a(d.value)), this.H !== c && z.Sa(this), d = d.cb;
|
|
return b
|
|
};
|
|
K.prototype.filter = function(a) {
|
|
for (var b = new K(this.ba), c = this.H, d = this.Ka; null !== d;) {
|
|
var e = d.value;
|
|
a(e) && b.add(e);
|
|
this.H !== c && z.Sa(this);
|
|
d = d.cb
|
|
}
|
|
return b
|
|
};
|
|
K.prototype.concat = function(a) {
|
|
return this.copy().$c(a)
|
|
};
|
|
K.prototype.remove = K.prototype["delete"] = K.prototype.remove = function(a) {
|
|
if (null === a) return !1;
|
|
u && this.Yg(a);
|
|
this.G && z.oa(this, a);
|
|
var b = a;
|
|
if (z.Za(a) && (b = z.nd(a), void 0 === b)) return !1;
|
|
a = this.sd[b];
|
|
if (void 0 === a) return !1;
|
|
var c = a.cb,
|
|
d = a.Ho;
|
|
null !== c && (c.Ho = d);
|
|
null !== d && (d.cb = c);
|
|
this.Ka === a && (this.Ka = c);
|
|
this.Sh === a && (this.Sh = d);
|
|
delete this.sd[b];
|
|
this.rd--;
|
|
this.Jc();
|
|
return !0
|
|
};
|
|
K.prototype.removeAll = K.prototype.IA = function(a) {
|
|
if (null === a) return this;
|
|
this.G && z.oa(this);
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) this.remove(z.Ya(a, c));
|
|
else
|
|
for (a = a.i; a.next();) this.remove(a.value);
|
|
return this
|
|
};
|
|
K.prototype.retainAll = function(a) {
|
|
if (null === a || 0 === this.count) return this;
|
|
this.G && z.oa(this);
|
|
var b = new K(this.ba);
|
|
b.$c(a);
|
|
a = [];
|
|
for (var c = this.i; c.next();) {
|
|
var d = c.value;
|
|
b.contains(d) || a.push(d)
|
|
}
|
|
this.IA(a);
|
|
return this
|
|
};
|
|
K.prototype.clear = K.prototype.clear = function() {
|
|
this.G && z.oa(this);
|
|
this.sd = {};
|
|
this.rd = 0;
|
|
this.Sh = this.Ka = null;
|
|
this.Jc()
|
|
};
|
|
K.prototype.copy = function() {
|
|
var a = new K(this.ba),
|
|
b = this.sd,
|
|
c;
|
|
for (c in b) a.add(b[c].value);
|
|
return a
|
|
};
|
|
K.prototype.toArray = K.prototype.jc = function() {
|
|
var a = Array(this.rd),
|
|
b = this.sd,
|
|
c = 0,
|
|
d;
|
|
for (d in b) a[c] = b[d].value, c++;
|
|
return a
|
|
};
|
|
K.prototype.toList = function() {
|
|
var a = new J(this.ba),
|
|
b = this.sd,
|
|
c;
|
|
for (c in b) a.add(b[c].value);
|
|
return a
|
|
};
|
|
z.w(K, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.rd
|
|
});
|
|
z.w(K, {
|
|
size: "size"
|
|
}, function() {
|
|
return this.rd
|
|
});
|
|
z.w(K, {
|
|
i: "iterator"
|
|
}, function() {
|
|
if (0 >= this.rd) return Pa;
|
|
var a = this.ec;
|
|
return null !== a ? (a.reset(), a) : new Wa(this)
|
|
});
|
|
|
|
function Za(a) {
|
|
this.Na = a;
|
|
this.reset()
|
|
}
|
|
z.Yd(Za, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(Za, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
Za.prototype.reset = Za.prototype.reset = function() {
|
|
this.nb = this.Na.H;
|
|
this.lb = null
|
|
};
|
|
Za.prototype.next = Za.prototype.hasNext = Za.prototype.next = function() {
|
|
var a = this.Na;
|
|
if (a.H !== this.nb) {
|
|
if (null === this.key) return !1;
|
|
z.Sa(a)
|
|
}
|
|
var b = this.lb,
|
|
b = null === b ? a.Ka : b.cb;
|
|
if (null !== b) return this.lb = b, this.value = this.key = a = b.key, !0;
|
|
this.Nf();
|
|
return !1
|
|
};
|
|
Za.prototype.first = Za.prototype.first = function() {
|
|
var a = this.Na;
|
|
this.nb = a.H;
|
|
a = a.Ka;
|
|
return null !== a ? (this.lb = a, this.value = this.key = a = a.key) : null
|
|
};
|
|
Za.prototype.any = function(a) {
|
|
var b = this.Na,
|
|
c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (a(d.key)) return !0;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !1
|
|
};
|
|
Za.prototype.all = function(a) {
|
|
var b = this.Na,
|
|
c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (!a(d.key)) return !1;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !0
|
|
};
|
|
Za.prototype.each = function(a) {
|
|
var b = this.Na,
|
|
c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) a(d.key), b.H !== c && z.Sa(b), d = d.cb;
|
|
return this
|
|
};
|
|
Za.prototype.map = function(a) {
|
|
var b = this.Na,
|
|
c = b.H;
|
|
this.lb = null;
|
|
for (var d = new J, e = b.Ka; null !== e;) d.add(a(e.key)), b.H !== c && z.Sa(b), e = e.cb;
|
|
return d.i
|
|
};
|
|
Za.prototype.filter = function(a) {
|
|
var b = this.Na,
|
|
c = b.H;
|
|
this.lb = null;
|
|
for (var d = new J(b.bf), e = b.Ka; null !== e;) {
|
|
var g = e.key;
|
|
a(g) && d.add(g);
|
|
b.H !== c && z.Sa(b);
|
|
e = e.cb
|
|
}
|
|
return d.i
|
|
};
|
|
Za.prototype.concat = function(a) {
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(Za, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.Na.rd
|
|
});
|
|
Za.prototype.Nf = function() {
|
|
this.value = this.key = null;
|
|
this.nb = -1
|
|
};
|
|
Za.prototype.toString = function() {
|
|
return null !== this.lb ? "MapKeySetIterator@" + this.lb.value : "MapKeySetIterator"
|
|
};
|
|
|
|
function $a(a) {
|
|
z.kc(this);
|
|
this.G = !0;
|
|
this.Na = a
|
|
}
|
|
z.Qa($a, K);
|
|
$a.prototype.freeze = function() {
|
|
return this
|
|
};
|
|
$a.prototype.Wa = function() {
|
|
return this
|
|
};
|
|
$a.prototype.toString = function() {
|
|
return "MapKeySet(" + this.Na.toString() + ")"
|
|
};
|
|
$a.prototype.add = $a.prototype.set = $a.prototype.add = function() {
|
|
z.k("This Set is read-only: " + this.toString());
|
|
return !1
|
|
};
|
|
$a.prototype.contains = $a.prototype.has = $a.prototype.contains = function(a) {
|
|
return this.Na.contains(a)
|
|
};
|
|
$a.prototype.remove = $a.prototype["delete"] = $a.prototype.remove = function() {
|
|
z.k("This Set is read-only: " + this.toString());
|
|
return !1
|
|
};
|
|
$a.prototype.clear = $a.prototype.clear = function() {
|
|
z.k("This Set is read-only: " + this.toString())
|
|
};
|
|
$a.prototype.first = $a.prototype.first = function() {
|
|
var a = this.Na.Ka;
|
|
return null !== a ? a.key : null
|
|
};
|
|
$a.prototype.any = function(a) {
|
|
for (var b = this.Na.Ka; null !== b;) {
|
|
if (a(b.key)) return !0;
|
|
b = b.cb
|
|
}
|
|
return !1
|
|
};
|
|
$a.prototype.all = function(a) {
|
|
for (var b = this.Na.Ka; null !== b;) {
|
|
if (!a(b.key)) return !1;
|
|
b = b.cb
|
|
}
|
|
return !0
|
|
};
|
|
$a.prototype.each = function(a) {
|
|
for (var b = this.Na.Ka; null !== b;) a(b.key), b = b.cb;
|
|
return this
|
|
};
|
|
$a.prototype.map = function(a) {
|
|
for (var b = new K, c = this.Na.Ka; null !== c;) b.add(a(c.key)), c = c.cb;
|
|
return b
|
|
};
|
|
$a.prototype.filter = function(a) {
|
|
for (var b = new K(this.Na.bf), c = this.Na.Ka; null !== c;) {
|
|
var d = c.key;
|
|
a(d) && b.add(d);
|
|
c = c.cb
|
|
}
|
|
return b
|
|
};
|
|
$a.prototype.concat = function(a) {
|
|
return this.VF().$c(a)
|
|
};
|
|
$a.prototype.copy = function() {
|
|
return new $a(this.Na)
|
|
};
|
|
$a.prototype.toSet = $a.prototype.VF = function() {
|
|
var a = new K(this.Na.bf),
|
|
b = this.Na.sd,
|
|
c;
|
|
for (c in b) a.add(b[c].key);
|
|
return a
|
|
};
|
|
$a.prototype.toArray = $a.prototype.jc = function() {
|
|
var a = this.Na.sd,
|
|
b = Array(this.Na.rd),
|
|
c = 0,
|
|
d;
|
|
for (d in a) b[c] = a[d].key, c++;
|
|
return b
|
|
};
|
|
$a.prototype.toList = function() {
|
|
var a = new J(this.ba),
|
|
b = this.Na.sd,
|
|
c;
|
|
for (c in b) a.add(b[c].key);
|
|
return a
|
|
};
|
|
z.w($a, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.Na.rd
|
|
});
|
|
z.w($a, {
|
|
size: "size"
|
|
}, function() {
|
|
return this.Na.rd
|
|
});
|
|
z.w($a, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return 0 >= this.Na.rd ? Pa : new Za(this.Na)
|
|
});
|
|
|
|
function ab(a) {
|
|
this.Na = a;
|
|
this.reset()
|
|
}
|
|
z.Yd(ab, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(ab, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
ab.prototype.reset = ab.prototype.reset = function() {
|
|
var a = this.Na;
|
|
a.Mj = null;
|
|
this.nb = a.H;
|
|
this.lb = null
|
|
};
|
|
ab.prototype.next = ab.prototype.hasNext = ab.prototype.next = function() {
|
|
var a = this.Na;
|
|
if (a.H !== this.nb) {
|
|
if (null === this.key) return !1;
|
|
z.Sa(a)
|
|
}
|
|
var b = this.lb,
|
|
b = null === b ? a.Ka : b.cb;
|
|
if (null !== b) return this.lb = b, this.value = b.value, this.key = b.key, !0;
|
|
this.Nf();
|
|
return !1
|
|
};
|
|
ab.prototype.first = ab.prototype.first = function() {
|
|
var a = this.Na;
|
|
this.nb = a.H;
|
|
a = a.Ka;
|
|
if (null !== a) {
|
|
this.lb = a;
|
|
var b = a.value;
|
|
this.key = a.key;
|
|
return this.value = b
|
|
}
|
|
return null
|
|
};
|
|
ab.prototype.any = function(a) {
|
|
var b = this.Na;
|
|
b.Mj = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (a(d.value)) return !0;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !1
|
|
};
|
|
ab.prototype.all = function(a) {
|
|
var b = this.Na;
|
|
b.Mj = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (!a(d.value)) return !1;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !0
|
|
};
|
|
ab.prototype.each = function(a) {
|
|
var b = this.Na;
|
|
b.Mj = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) a(d.value), b.H !== c && z.Sa(b), d = d.cb;
|
|
return this
|
|
};
|
|
ab.prototype.map = function(a) {
|
|
var b = this.Na;
|
|
b.Mj = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = new J, e = b.Ka; null !== e;) d.add(a(e.value)), b.H !== c && z.Sa(b), e = e.cb;
|
|
return d.i
|
|
};
|
|
ab.prototype.filter = function(a) {
|
|
var b = this.Na;
|
|
b.Mj = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = new J(b.bf), e = b.Ka; null !== e;) {
|
|
var g = e.value;
|
|
a(g) && d.add(g);
|
|
b.H !== c && z.Sa(b);
|
|
e = e.cb
|
|
}
|
|
return d.i
|
|
};
|
|
ab.prototype.concat = function(a) {
|
|
this.Na.Mj = null;
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(ab, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.Na.rd
|
|
});
|
|
ab.prototype.Nf = function() {
|
|
this.value = this.key = null;
|
|
this.nb = -1;
|
|
this.Na.Mj = this
|
|
};
|
|
ab.prototype.toString = function() {
|
|
return null !== this.lb ? "MapValueSetIterator@" + this.lb.value : "MapValueSetIterator"
|
|
};
|
|
|
|
function Ya(a, b) {
|
|
this.key = a;
|
|
this.value = b;
|
|
this.Ho = this.cb = null
|
|
}
|
|
z.Yd(Ya, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
Ya.prototype.toString = function() {
|
|
return "{" + this.key + ":" + this.value + "}"
|
|
};
|
|
|
|
function bb(a) {
|
|
this.Na = a;
|
|
this.reset()
|
|
}
|
|
z.Yd(bb, {
|
|
key: !0,
|
|
value: !0
|
|
});
|
|
z.w(bb, {
|
|
i: "iterator"
|
|
}, function() {
|
|
return this
|
|
});
|
|
bb.prototype.reset = bb.prototype.reset = function() {
|
|
var a = this.Na;
|
|
a.ec = null;
|
|
this.nb = a.H;
|
|
this.lb = null
|
|
};
|
|
bb.prototype.next = bb.prototype.hasNext = bb.prototype.next = function() {
|
|
var a = this.Na;
|
|
if (a.H !== this.nb) {
|
|
if (null === this.key) return !1;
|
|
z.Sa(a)
|
|
}
|
|
var b = this.lb,
|
|
b = null === b ? a.Ka : b.cb;
|
|
if (null !== b) return this.lb = b, this.key = b.key, this.value = b.value, !0;
|
|
this.Nf();
|
|
return !1
|
|
};
|
|
bb.prototype.first = bb.prototype.first = function() {
|
|
var a = this.Na;
|
|
this.nb = a.H;
|
|
a = a.Ka;
|
|
return null !== a ? (this.lb = a, this.key = a.key, this.value = a.value, a) : null
|
|
};
|
|
bb.prototype.any = function(a) {
|
|
var b = this.Na;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (a(d)) return !0;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !1
|
|
};
|
|
bb.prototype.all = function(a) {
|
|
var b = this.Na;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) {
|
|
if (!a(d)) return !1;
|
|
b.H !== c && z.Sa(b);
|
|
d = d.cb
|
|
}
|
|
return !0
|
|
};
|
|
bb.prototype.each = function(a) {
|
|
var b = this.Na;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = b.Ka; null !== d;) a(d), b.H !== c && z.Sa(b), d = d.cb;
|
|
return this
|
|
};
|
|
bb.prototype.map = function(a) {
|
|
var b = this.Na;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = new J, e = b.Ka; null !== e;) d.add(a(e)), b.H !== c && z.Sa(b), e = e.cb;
|
|
return d.i
|
|
};
|
|
bb.prototype.filter = function(a) {
|
|
var b = this.Na;
|
|
b.ec = null;
|
|
var c = b.H;
|
|
this.lb = null;
|
|
for (var d = new J, e = b.Ka; null !== e;) a(e) && d.add(e), b.H !== c && z.Sa(b), e = e.cb;
|
|
return d.i
|
|
};
|
|
bb.prototype.concat = function(a) {
|
|
this.Na.ec = null;
|
|
return new Sa(this, a.i)
|
|
};
|
|
z.w(bb, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.Na.rd
|
|
});
|
|
bb.prototype.Nf = function() {
|
|
this.value = this.key = null;
|
|
this.nb = -1;
|
|
this.Na.ec = this
|
|
};
|
|
bb.prototype.toString = function() {
|
|
return null !== this.lb ? "MapIterator@" + this.lb : "MapIterator"
|
|
};
|
|
|
|
function na(a, b) {
|
|
z.kc(this);
|
|
this.G = !1;
|
|
void 0 === a || null === a ? this.bf = null : "string" === typeof a ? "object" === a || "string" === a || "number" === a ? this.bf = a : z.ka(a, "the string 'object', 'number' or 'string'", "Map constructor: keytype") : "function" === typeof a ? this.bf = a === Object ? "object" : a === String ? "string" : a === Number ? "number" : a : z.ka(a, "null, a primitive type name, or a class type", "Map constructor: keytype");
|
|
void 0 === b || null === b ? this.fi = null : "string" === typeof b ? "object" === b || "string" === b || "boolean" === b || "number" ===
|
|
b || "function" === b ? this.fi = b : z.ka(b, "the string 'object', 'number', 'string', 'boolean', or 'function'", "Map constructor: valtype") : "function" === typeof b ? this.fi = b === Object ? "object" : b === String ? "string" : b === Number ? "number" : b === Boolean ? "boolean" : b === Function ? "function" : b : z.ka(b, "null, a primitive type name, or a class type", "Map constructor: valtype");
|
|
this.sd = {};
|
|
this.rd = 0;
|
|
this.Mj = this.ec = null;
|
|
this.H = 0;
|
|
this.Sh = this.Ka = null
|
|
}
|
|
z.ia("Map", na);
|
|
|
|
function db(a, b) {
|
|
null !== a.bf && ("string" === typeof a.bf ? typeof b === a.bf && null !== b || z.ic(b, a.bf) : b instanceof a.bf || z.ic(b, a.bf))
|
|
}
|
|
na.prototype.Jc = function() {
|
|
var a = this.H;
|
|
a++;
|
|
999999999 < a && (a = 0);
|
|
this.H = a
|
|
};
|
|
na.prototype.freeze = na.prototype.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
na.prototype.thaw = na.prototype.Wa = function() {
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
na.prototype.toString = function() {
|
|
return "Map(" + z.getTypeName(this.bf) + "," + z.getTypeName(this.fi) + ")#" + z.nd(this)
|
|
};
|
|
na.prototype.add = na.prototype.set = na.prototype.add = function(a, b) {
|
|
u && (db(this, a), null !== this.fi && ("string" === typeof this.fi ? typeof b === this.fi && null !== b || z.ic(b, this.fi) : b instanceof this.fi || z.ic(b, this.fi)));
|
|
this.G && z.oa(this, a);
|
|
var c = a;
|
|
z.Za(a) && (c = z.It(a));
|
|
var d = this.sd[c];
|
|
if (void 0 === d) return this.rd++, d = new Ya(a, b), this.sd[c] = d, c = this.Sh, null === c ? this.Ka = d : (d.Ho = c, c.cb = d), this.Sh = d, this.Jc(), !0;
|
|
d.value = b;
|
|
return !1
|
|
};
|
|
na.prototype.addAll = na.prototype.$c = function(a) {
|
|
if (null === a) return this;
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) {
|
|
var d = z.Ya(a, c);
|
|
this.add(d.key, d.value)
|
|
} else
|
|
for (a = a.i; a.next();) this.add(a.key, a.value);
|
|
return this
|
|
};
|
|
na.prototype.first = na.prototype.first = function() {
|
|
return this.Ka
|
|
};
|
|
na.prototype.any = function(a) {
|
|
for (var b = this.H, c = this.Ka; null !== c;) {
|
|
if (a(c)) return !0;
|
|
this.H !== b && z.Sa(this);
|
|
c = c.cb
|
|
}
|
|
return !1
|
|
};
|
|
na.prototype.all = function(a) {
|
|
for (var b = this.H, c = this.Ka; null !== c;) {
|
|
if (!a(c)) return !1;
|
|
this.H !== b && z.Sa(this);
|
|
c = c.cb
|
|
}
|
|
return !0
|
|
};
|
|
na.prototype.each = function(a) {
|
|
for (var b = this.H, c = this.Ka; null !== c;) a(c), this.H !== b && z.Sa(this), c = c.cb;
|
|
return this
|
|
};
|
|
na.prototype.map = function(a) {
|
|
for (var b = new na(this.bf), c = this.H, d = this.Ka; null !== d;) b.add(d.key, a(d)), this.H !== c && z.Sa(this), d = d.cb;
|
|
return b
|
|
};
|
|
na.prototype.filter = function(a) {
|
|
for (var b = new na(this.bf, this.fi), c = this.H, d = this.Ka; null !== d;) a(d) && b.add(d.key, d.value), this.H !== c && z.Sa(this), d = d.cb;
|
|
return b
|
|
};
|
|
na.prototype.concat = function(a) {
|
|
return this.copy().$c(a)
|
|
};
|
|
na.prototype.contains = na.prototype.has = na.prototype.contains = function(a) {
|
|
u && db(this, a);
|
|
var b = a;
|
|
return z.Za(a) && (b = z.nd(a), void 0 === b) ? !1 : void 0 !== this.sd[b]
|
|
};
|
|
na.prototype.getValue = na.prototype.get = na.prototype.na = function(a) {
|
|
u && db(this, a);
|
|
var b = a;
|
|
if (z.Za(a) && (b = z.nd(a), void 0 === b)) return null;
|
|
a = this.sd[b];
|
|
return void 0 === a ? null : a.value
|
|
};
|
|
na.prototype.remove = na.prototype["delete"] = na.prototype.remove = function(a) {
|
|
if (null === a) return !1;
|
|
u && db(this, a);
|
|
this.G && z.oa(this, a);
|
|
var b = a;
|
|
if (z.Za(a) && (b = z.nd(a), void 0 === b)) return !1;
|
|
a = this.sd[b];
|
|
if (void 0 === a) return !1;
|
|
var c = a.cb,
|
|
d = a.Ho;
|
|
null !== c && (c.Ho = d);
|
|
null !== d && (d.cb = c);
|
|
this.Ka === a && (this.Ka = c);
|
|
this.Sh === a && (this.Sh = d);
|
|
delete this.sd[b];
|
|
this.rd--;
|
|
this.Jc();
|
|
return !0
|
|
};
|
|
na.prototype.clear = na.prototype.clear = function() {
|
|
this.G && z.oa(this);
|
|
this.sd = {};
|
|
this.rd = 0;
|
|
this.Sh = this.Ka = null;
|
|
this.Jc()
|
|
};
|
|
na.prototype.copy = function() {
|
|
var a = new na(this.bf, this.fi),
|
|
b = this.sd,
|
|
c;
|
|
for (c in b) {
|
|
var d = b[c];
|
|
a.add(d.key, d.value)
|
|
}
|
|
return a
|
|
};
|
|
na.prototype.toArray = na.prototype.jc = function() {
|
|
var a = this.sd,
|
|
b = Array(this.rd),
|
|
c = 0,
|
|
d;
|
|
for (d in a) {
|
|
var e = a[d];
|
|
b[c] = new Ya(e.key, e.value);
|
|
c++
|
|
}
|
|
return b
|
|
};
|
|
na.prototype.toKeySet = na.prototype.uj = function() {
|
|
return new $a(this)
|
|
};
|
|
z.w(na, {
|
|
count: "count"
|
|
}, function() {
|
|
return this.rd
|
|
});
|
|
z.w(na, {
|
|
size: "size"
|
|
}, function() {
|
|
return this.rd
|
|
});
|
|
z.w(na, {
|
|
i: "iterator"
|
|
}, function() {
|
|
if (0 >= this.count) return Pa;
|
|
var a = this.ec;
|
|
return null !== a ? (a.reset(), a) : new bb(this)
|
|
});
|
|
z.w(na, {
|
|
UE: "iteratorKeys"
|
|
}, function() {
|
|
return 0 >= this.count ? Pa : new Za(this)
|
|
});
|
|
z.w(na, {
|
|
VE: "iteratorValues"
|
|
}, function() {
|
|
if (0 >= this.count) return Pa;
|
|
var a = this.Mj;
|
|
return null !== a ? (a.reset(), a) : new ab(this)
|
|
});
|
|
|
|
function N(a, b) {
|
|
void 0 === a ? this.K = this.J = 0 : "number" === typeof a && "number" === typeof b ? (this.J = a, this.K = b) : z.k("Invalid arguments to Point constructor: " + a + ", " + b);
|
|
this.G = !1
|
|
}
|
|
z.ia("Point", N);
|
|
z.ii(N);
|
|
z.Yd(N, {
|
|
x: !0,
|
|
y: !0
|
|
});
|
|
N.prototype.assign = function(a) {
|
|
this.J = a.J;
|
|
this.K = a.K
|
|
};
|
|
N.prototype.setTo = N.prototype.n = function(a, b) {
|
|
u && (z.g(a, "number", N, "setTo:x"), z.g(b, "number", N, "setTo:y"));
|
|
this.J = a;
|
|
this.K = b;
|
|
return this
|
|
};
|
|
N.prototype.set = N.prototype.set = function(a) {
|
|
u && z.l(a, N, N, "set:p");
|
|
this.Pa();
|
|
this.J = a.J;
|
|
this.K = a.K;
|
|
return this
|
|
};
|
|
N.prototype.copy = function() {
|
|
var a = new N;
|
|
a.J = this.J;
|
|
a.K = this.K;
|
|
return a
|
|
};
|
|
f = N.prototype;
|
|
f.La = function() {
|
|
this.G = !0;
|
|
Object.freeze(this);
|
|
return this
|
|
};
|
|
f.V = function() {
|
|
return Object.isFrozen(this) ? this : this.copy().freeze()
|
|
};
|
|
f.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
f.Wa = function() {
|
|
Object.isFrozen(this) && z.k("cannot thaw constant: " + this);
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
f.Pa = function(a) {
|
|
if (this.G) {
|
|
var b = "The Point is frozen, so its properties cannot be set: " + this.toString();
|
|
void 0 !== a && (b += " to value: " + a);
|
|
z.k(b)
|
|
}
|
|
};
|
|
N.parse = function(a) {
|
|
if ("string" === typeof a) {
|
|
a = a.split(" ");
|
|
for (var b = 0, c = 0;
|
|
"" === a[b];) b++;
|
|
var d = a[b++];
|
|
d && (c = parseFloat(d));
|
|
for (var e = 0;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (e = parseFloat(d));
|
|
return new N(c, e)
|
|
}
|
|
return new N
|
|
};
|
|
N.stringify = function(a) {
|
|
return a instanceof N ? a.x.toString() + " " + a.y.toString() : a.toString()
|
|
};
|
|
N.prototype.toString = function() {
|
|
return "Point(" + this.x + "," + this.y + ")"
|
|
};
|
|
N.prototype.equals = N.prototype.N = function(a) {
|
|
return a instanceof N ? this.J === a.x && this.K === a.y : !1
|
|
};
|
|
N.prototype.equalTo = N.prototype.Vw = function(a, b) {
|
|
return this.J === a && this.K === b
|
|
};
|
|
N.prototype.equalsApprox = N.prototype.Mc = function(a) {
|
|
return eb(this.J, a.x) && eb(this.K, a.y)
|
|
};
|
|
N.prototype.add = N.prototype.add = function(a) {
|
|
u && z.l(a, N, N, "add:p");
|
|
this.Pa();
|
|
this.J += a.x;
|
|
this.K += a.y;
|
|
return this
|
|
};
|
|
N.prototype.subtract = N.prototype.xu = function(a) {
|
|
u && z.l(a, N, N, "subtract:p");
|
|
this.Pa();
|
|
this.J -= a.x;
|
|
this.K -= a.y;
|
|
return this
|
|
};
|
|
N.prototype.offset = N.prototype.offset = function(a, b) {
|
|
u && (z.p(a, N, "offset:dx"), z.p(b, N, "offset:dy"));
|
|
this.Pa();
|
|
this.J += a;
|
|
this.K += b;
|
|
return this
|
|
};
|
|
N.prototype.rotate = N.prototype.rotate = function(a) {
|
|
u && z.p(a, N, "rotate:angle");
|
|
this.Pa();
|
|
if (0 === a) return this;
|
|
var b = this.J,
|
|
c = this.K;
|
|
if (0 === b && 0 === c) return this;
|
|
var d = 0,
|
|
e = 0;
|
|
360 <= a ? a -= 360 : 0 > a && (a += 360);
|
|
90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (a = a * Math.PI / 180, d = Math.cos(a), e = Math.sin(a));
|
|
this.J = d * b - e * c;
|
|
this.K = e * b + d * c;
|
|
return this
|
|
};
|
|
N.prototype.scale = N.prototype.scale = function(a, b) {
|
|
u && (z.p(a, N, "scale:sx"), z.p(b, N, "scale:sy"));
|
|
this.J *= a;
|
|
this.K *= b;
|
|
return this
|
|
};
|
|
N.prototype.distanceSquaredPoint = N.prototype.Af = function(a) {
|
|
u && z.l(a, N, N, "distanceSquaredPoint:p");
|
|
var b = a.x - this.J;
|
|
a = a.y - this.K;
|
|
return b * b + a * a
|
|
};
|
|
N.prototype.distanceSquared = N.prototype.kp = function(a, b) {
|
|
u && (z.p(a, N, "distanceSquared:px"), z.p(b, N, "distanceSquared:py"));
|
|
var c = a - this.J,
|
|
d = b - this.K;
|
|
return c * c + d * d
|
|
};
|
|
N.prototype.normalize = N.prototype.normalize = function() {
|
|
this.Pa();
|
|
var a = this.J,
|
|
b = this.K,
|
|
c = Math.sqrt(a * a + b * b);
|
|
0 < c && (this.J = a / c, this.K = b / c);
|
|
return this
|
|
};
|
|
N.prototype.directionPoint = N.prototype.Ec = function(a) {
|
|
u && z.l(a, N, N, "directionPoint:p");
|
|
return fb(a.x - this.J, a.y - this.K)
|
|
};
|
|
N.prototype.direction = N.prototype.direction = function(a, b) {
|
|
u && (z.p(a, N, "direction:px"), z.p(b, N, "direction:py"));
|
|
return fb(a - this.J, b - this.K)
|
|
};
|
|
|
|
function fb(a, b) {
|
|
if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0;
|
|
if (0 === b) return 0 < a ? 0 : 180;
|
|
if (isNaN(a) || isNaN(b)) return 0;
|
|
var c = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
|
|
0 > a ? c = 0 > b ? c + 180 : 180 - c : 0 > b && (c = 360 - c);
|
|
return c
|
|
}
|
|
N.prototype.projectOntoLineSegment = function(a, b, c, d) {
|
|
u && (z.p(a, N, "projectOntoLineSegment:px"), z.p(b, N, "projectOntoLineSegment:py"), z.p(c, N, "projectOntoLineSegment:qx"), z.p(d, N, "projectOntoLineSegment:qy"));
|
|
ib(a, b, c, d, this.J, this.K, this);
|
|
return this
|
|
};
|
|
N.prototype.projectOntoLineSegmentPoint = function(a, b) {
|
|
u && (z.l(a, N, N, "projectOntoLineSegmentPoint:p"), z.l(b, N, N, "projectOntoLineSegmentPoint:q"));
|
|
ib(a.x, a.y, b.x, b.y, this.J, this.K, this);
|
|
return this
|
|
};
|
|
N.prototype.snapToGrid = function(a, b, c, d) {
|
|
u && (z.p(a, N, "snapToGrid:originx"), z.p(b, N, "snapToGrid:originy"), z.p(c, N, "snapToGrid:cellwidth"), z.p(d, N, "snapToGrid:cellheight"));
|
|
jb(this.J, this.K, a, b, c, d, this);
|
|
return this
|
|
};
|
|
N.prototype.snapToGridPoint = function(a, b) {
|
|
u && (z.l(a, N, N, "snapToGridPoint:p"), z.l(b, Ea, N, "snapToGridPoint:q"));
|
|
jb(this.J, this.K, a.x, a.y, b.width, b.height, this);
|
|
return this
|
|
};
|
|
N.prototype.setRectSpot = N.prototype.ru = function(a, b) {
|
|
u && (z.l(a, w, N, "setRectSpot:r"), z.l(b, Q, N, "setRectSpot:spot"));
|
|
this.Pa();
|
|
this.J = a.x + b.x * a.width + b.offsetX;
|
|
this.K = a.y + b.y * a.height + b.offsetY;
|
|
return this
|
|
};
|
|
N.prototype.setSpot = N.prototype.tu = function(a, b, c, d, e) {
|
|
u && (z.p(a, N, "setSpot:x"), z.p(b, N, "setSpot:y"), z.p(c, N, "setSpot:w"), z.p(d, N, "setSpot:h"), (0 > c || 0 > d) && z.k("Point.setSpot:Width and height cannot be negative"), z.l(e, Q, N, "setSpot:spot"));
|
|
this.Pa();
|
|
this.J = a + e.x * c + e.offsetX;
|
|
this.K = b + e.y * d + e.offsetY;
|
|
return this
|
|
};
|
|
N.prototype.transform = function(a) {
|
|
u && z.l(a, Fa, N, "transform:t");
|
|
a.Cb(this);
|
|
return this
|
|
};
|
|
|
|
function ub(a, b) {
|
|
u && z.l(b, Fa, N, "transformInverted:t");
|
|
b.ki(a);
|
|
return a
|
|
}
|
|
var vb;
|
|
N.distanceLineSegmentSquared = vb = function(a, b, c, d, e, g) {
|
|
u && (z.p(a, N, "distanceLineSegmentSquared:px"), z.p(b, N, "distanceLineSegmentSquared:py"), z.p(c, N, "distanceLineSegmentSquared:ax"), z.p(d, N, "distanceLineSegmentSquared:ay"), z.p(e, N, "distanceLineSegmentSquared:bx"), z.p(g, N, "distanceLineSegmentSquared:by"));
|
|
var h = e - c,
|
|
k = g - d,
|
|
l = h * h + k * k;
|
|
c -= a;
|
|
d -= b;
|
|
var m = -c * h - d * k;
|
|
if (0 >= m || m >= l) return h = e - a, k = g - b, Math.min(c * c + d * d, h * h + k * k);
|
|
a = h * d - k * c;
|
|
return a * a / l
|
|
};
|
|
var wb;
|
|
N.distanceSquared = wb = function(a, b, c, d) {
|
|
u && (z.p(a, N, "distanceSquared:px"), z.p(b, N, "distanceSquared:py"), z.p(c, N, "distanceSquared:qx"), z.p(d, N, "distanceSquared:qy"));
|
|
a = c - a;
|
|
b = d - b;
|
|
return a * a + b * b
|
|
};
|
|
var xb;
|
|
N.direction = xb = function(a, b, c, d) {
|
|
u && (z.p(a, N, "direction:px"), z.p(b, N, "direction:py"), z.p(c, N, "direction:qx"), z.p(d, N, "direction:qy"));
|
|
a = c - a;
|
|
b = d - b;
|
|
if (0 === a) return 0 < b ? 90 : 0 > b ? 270 : 0;
|
|
if (0 === b) return 0 < a ? 0 : 180;
|
|
if (isNaN(a) || isNaN(b)) return 0;
|
|
d = 180 * Math.atan(Math.abs(b / a)) / Math.PI;
|
|
0 > a ? d = 0 > b ? d + 180 : 180 - d : 0 > b && (d = 360 - d);
|
|
return d
|
|
};
|
|
z.defineProperty(N, {
|
|
x: "x"
|
|
}, function() {
|
|
return this.J
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", N, "x");
|
|
this.J = a
|
|
});
|
|
z.defineProperty(N, {
|
|
y: "y"
|
|
}, function() {
|
|
return this.K
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", N, "y");
|
|
this.K = a
|
|
});
|
|
N.prototype.isReal = N.prototype.F = function() {
|
|
return isFinite(this.x) && isFinite(this.y)
|
|
};
|
|
|
|
function Ea(a, b) {
|
|
void 0 === a ? this.Ea = this.Fa = 0 : "number" === typeof a && (0 <= a || isNaN(a)) && "number" === typeof b && (0 <= b || isNaN(b)) ? (this.Fa = a, this.Ea = b) : z.k("Invalid arguments to Size constructor: " + a + ", " + b);
|
|
this.G = !1
|
|
}
|
|
z.ia("Size", Ea);
|
|
z.ii(Ea);
|
|
z.Yd(Ea, {
|
|
width: !0,
|
|
height: !0
|
|
});
|
|
Ea.prototype.assign = function(a) {
|
|
this.Fa = a.Fa;
|
|
this.Ea = a.Ea
|
|
};
|
|
Ea.prototype.setTo = Ea.prototype.n = function(a, b) {
|
|
u && (z.g(a, "number", Ea, "setTo:w"), z.g(b, "number", Ea, "setTo:h"), 0 > a && z.ka(a, ">= 0", Ea, "setTo:w"), 0 > b && z.ka(b, ">= 0", Ea, "setTo:h"));
|
|
this.Fa = a;
|
|
this.Ea = b;
|
|
return this
|
|
};
|
|
Ea.prototype.set = Ea.prototype.set = function(a) {
|
|
u && z.l(a, Ea, Ea, "set:s");
|
|
this.Pa();
|
|
this.Fa = a.Fa;
|
|
this.Ea = a.Ea;
|
|
return this
|
|
};
|
|
Ea.prototype.copy = function() {
|
|
var a = new Ea;
|
|
a.Fa = this.Fa;
|
|
a.Ea = this.Ea;
|
|
return a
|
|
};
|
|
f = Ea.prototype;
|
|
f.La = function() {
|
|
this.G = !0;
|
|
Object.freeze(this);
|
|
return this
|
|
};
|
|
f.V = function() {
|
|
return Object.isFrozen(this) ? this : this.copy().freeze()
|
|
};
|
|
f.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
f.Wa = function() {
|
|
Object.isFrozen(this) && z.k("cannot thaw constant: " + this);
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
f.Pa = function(a) {
|
|
if (this.G) {
|
|
var b = "The Size is frozen, so its properties cannot be set: " + this.toString();
|
|
void 0 !== a && (b += " to value: " + a);
|
|
z.k(b)
|
|
}
|
|
};
|
|
Ea.parse = function(a) {
|
|
if ("string" === typeof a) {
|
|
a = a.split(" ");
|
|
for (var b = 0, c = 0;
|
|
"" === a[b];) b++;
|
|
var d = a[b++];
|
|
d && (c = parseFloat(d));
|
|
for (var e = 0;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (e = parseFloat(d));
|
|
return new Ea(c, e)
|
|
}
|
|
return new Ea
|
|
};
|
|
Ea.stringify = function(a) {
|
|
return a instanceof Ea ? a.width.toString() + " " + a.height.toString() : a.toString()
|
|
};
|
|
Ea.prototype.toString = function() {
|
|
return "Size(" + this.width + "," + this.height + ")"
|
|
};
|
|
Ea.prototype.equals = Ea.prototype.N = function(a) {
|
|
return a instanceof Ea ? this.Fa === a.width && this.Ea === a.height : !1
|
|
};
|
|
Ea.prototype.equalTo = Ea.prototype.Vw = function(a, b) {
|
|
return this.Fa === a && this.Ea === b
|
|
};
|
|
Ea.prototype.equalsApprox = Ea.prototype.Mc = function(a) {
|
|
return eb(this.Fa, a.width) && eb(this.Ea, a.height)
|
|
};
|
|
z.defineProperty(Ea, {
|
|
width: "width"
|
|
}, function() {
|
|
return this.Fa
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", Ea, "width");
|
|
0 > a && z.ka(a, ">= 0", Ea, "width");
|
|
this.Fa = a
|
|
});
|
|
z.defineProperty(Ea, {
|
|
height: "height"
|
|
}, function() {
|
|
return this.Ea
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", Ea, "height");
|
|
0 > a && z.ka(a, ">= 0", Ea, "height");
|
|
this.Ea = a
|
|
});
|
|
Ea.prototype.isReal = Ea.prototype.F = function() {
|
|
return isFinite(this.width) && isFinite(this.height)
|
|
};
|
|
|
|
function w(a, b, c, d) {
|
|
void 0 === a ? this.Ea = this.Fa = this.K = this.J = 0 : a instanceof N ? b instanceof N ? (this.J = Math.min(a.J, b.J), this.K = Math.min(a.K, b.K), this.Fa = Math.abs(a.J - b.J), this.Ea = Math.abs(a.K - b.K)) : b instanceof Ea ? (this.J = a.J, this.K = a.K, this.Fa = b.Fa, this.Ea = b.Ea) : z.k("Incorrect arguments supplied to Rect constructor") : "number" === typeof a && "number" === typeof b && "number" === typeof c && (0 <= c || isNaN(c)) && "number" === typeof d && (0 <= d || isNaN(d)) ? (this.J = a, this.K = b, this.Fa = c, this.Ea = d) : z.k("Invalid arguments to Rect constructor: " +
|
|
a + ", " + b + ", " + c + ", " + d);
|
|
this.G = !1
|
|
}
|
|
z.ia("Rect", w);
|
|
z.ii(w);
|
|
z.Yd(w, {
|
|
x: !0,
|
|
y: !0,
|
|
width: !0,
|
|
height: !0
|
|
});
|
|
w.prototype.assign = function(a) {
|
|
this.J = a.J;
|
|
this.K = a.K;
|
|
this.Fa = a.Fa;
|
|
this.Ea = a.Ea
|
|
};
|
|
|
|
function yb(a, b, c) {
|
|
a.Fa = b;
|
|
a.Ea = c
|
|
}
|
|
w.prototype.setTo = w.prototype.n = function(a, b, c, d) {
|
|
u && (z.g(a, "number", w, "setTo:x"), z.g(b, "number", w, "setTo:y"), z.g(c, "number", w, "setTo:w"), z.g(d, "number", w, "setTo:h"), 0 > c && z.ka(c, ">= 0", w, "setTo:w"), 0 > d && z.ka(d, ">= 0", w, "setTo:h"));
|
|
this.J = a;
|
|
this.K = b;
|
|
this.Fa = c;
|
|
this.Ea = d;
|
|
return this
|
|
};
|
|
w.prototype.set = w.prototype.set = function(a) {
|
|
u && z.l(a, w, w, "set:r");
|
|
this.Pa();
|
|
this.J = a.J;
|
|
this.K = a.K;
|
|
this.Fa = a.Fa;
|
|
this.Ea = a.Ea;
|
|
return this
|
|
};
|
|
w.prototype.setPoint = w.prototype.Kf = function(a) {
|
|
u && z.l(a, N, w, "setPoint:p");
|
|
this.Pa();
|
|
this.J = a.J;
|
|
this.K = a.K;
|
|
return this
|
|
};
|
|
w.prototype.setSize = function(a) {
|
|
u && z.l(a, Ea, w, "setSize:s");
|
|
this.Pa();
|
|
this.Fa = a.Fa;
|
|
this.Ea = a.Ea;
|
|
return this
|
|
};
|
|
w.prototype.copy = function() {
|
|
var a = new w;
|
|
a.J = this.J;
|
|
a.K = this.K;
|
|
a.Fa = this.Fa;
|
|
a.Ea = this.Ea;
|
|
return a
|
|
};
|
|
f = w.prototype;
|
|
f.La = function() {
|
|
this.G = !0;
|
|
Object.freeze(this);
|
|
return this
|
|
};
|
|
f.V = function() {
|
|
return Object.isFrozen(this) ? this : this.copy().freeze()
|
|
};
|
|
f.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
f.Wa = function() {
|
|
Object.isFrozen(this) && z.k("cannot thaw constant: " + this);
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
f.Pa = function(a) {
|
|
if (this.G) {
|
|
var b = "The Rect is frozen, so its properties cannot be set: " + this.toString();
|
|
void 0 !== a && (b += " to value: " + a);
|
|
z.k(b)
|
|
}
|
|
};
|
|
w.parse = function(a) {
|
|
if ("string" === typeof a) {
|
|
a = a.split(" ");
|
|
for (var b = 0, c = 0;
|
|
"" === a[b];) b++;
|
|
var d = a[b++];
|
|
d && (c = parseFloat(d));
|
|
for (var e = 0;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (e = parseFloat(d));
|
|
for (var g = 0;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (g = parseFloat(d));
|
|
for (var h = 0;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (h = parseFloat(d));
|
|
return new w(c, e, g, h)
|
|
}
|
|
return new w
|
|
};
|
|
w.stringify = function(a) {
|
|
return a instanceof w ? a.x.toString() + " " + a.y.toString() + " " + a.width.toString() + " " + a.height.toString() : a.toString()
|
|
};
|
|
w.prototype.toString = function() {
|
|
return "Rect(" + this.x + "," + this.y + "," + this.width + "," + this.height + ")"
|
|
};
|
|
w.prototype.equals = w.prototype.N = function(a) {
|
|
return a instanceof w ? this.J === a.x && this.K === a.y && this.Fa === a.width && this.Ea === a.height : !1
|
|
};
|
|
w.prototype.equalTo = w.prototype.Vw = function(a, b, c, d) {
|
|
return this.J === a && this.K === b && this.Fa === c && this.Ea === d
|
|
};
|
|
w.prototype.equalsApprox = w.prototype.Mc = function(a) {
|
|
return eb(this.J, a.x) && eb(this.K, a.y) && eb(this.Fa, a.width) && eb(this.Ea, a.height)
|
|
};
|
|
w.prototype.containsPoint = w.prototype.Ma = function(a) {
|
|
u && z.l(a, N, w, "containsPoint:p");
|
|
return this.J <= a.x && this.J + this.Fa >= a.x && this.K <= a.y && this.K + this.Ea >= a.y
|
|
};
|
|
w.prototype.containsRect = w.prototype.mk = function(a) {
|
|
u && z.l(a, w, w, "containsRect:r");
|
|
return this.J <= a.x && a.x + a.width <= this.J + this.Fa && this.K <= a.y && a.y + a.height <= this.K + this.Ea
|
|
};
|
|
w.prototype.contains = w.prototype.contains = function(a, b, c, d) {
|
|
u ? (z.p(a, w, "contains:x"), z.p(b, w, "contains:y"), void 0 === c ? c = 0 : z.p(c, w, "contains:w"), void 0 === d ? d = 0 : z.p(d, w, "contains:h"), (0 > c || 0 > d) && z.k("Rect.contains:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
|
|
return this.J <= a && a + c <= this.J + this.Fa && this.K <= b && b + d <= this.K + this.Ea
|
|
};
|
|
w.prototype.reset = function() {
|
|
this.Pa();
|
|
this.Ea = this.Fa = this.K = this.J = 0
|
|
};
|
|
w.prototype.offset = w.prototype.offset = function(a, b) {
|
|
u && (z.p(a, w, "offset:dx"), z.p(b, w, "offset:dy"));
|
|
this.Pa();
|
|
this.J += a;
|
|
this.K += b;
|
|
return this
|
|
};
|
|
w.prototype.inflate = w.prototype.ag = function(a, b) {
|
|
u && (z.p(a, w, "inflate:w"), z.p(b, w, "inflate:h"));
|
|
return zb(this, b, a, b, a)
|
|
};
|
|
w.prototype.addMargin = w.prototype.Cw = function(a) {
|
|
u && z.l(a, Db, w, "addMargin:m");
|
|
return zb(this, a.top, a.right, a.bottom, a.left)
|
|
};
|
|
w.prototype.subtractMargin = w.prototype.rJ = function(a) {
|
|
u && z.l(a, Db, w, "subtractMargin:m");
|
|
return zb(this, -a.top, -a.right, -a.bottom, -a.left)
|
|
};
|
|
w.prototype.grow = function(a, b, c, d) {
|
|
u && (z.p(a, w, "grow:t"), z.p(b, w, "grow:r"), z.p(c, w, "grow:b"), z.p(d, w, "grow:l"));
|
|
return zb(this, a, b, c, d)
|
|
};
|
|
|
|
function zb(a, b, c, d, e) {
|
|
a.Pa();
|
|
var g = a.Fa;
|
|
c + e <= -g ? (a.J += g / 2, a.Fa = 0) : (a.J -= e, a.Fa += c + e);
|
|
c = a.Ea;
|
|
b + d <= -c ? (a.K += c / 2, a.Ea = 0) : (a.K -= b, a.Ea += b + d);
|
|
return a
|
|
}
|
|
w.prototype.intersectRect = function(a) {
|
|
u && z.l(a, w, w, "intersectRect:r");
|
|
return Eb(this, a.x, a.y, a.width, a.height)
|
|
};
|
|
w.prototype.intersect = function(a, b, c, d) {
|
|
u && (z.p(a, w, "intersect:x"), z.p(b, w, "intersect:y"), z.p(c, w, "intersect:w"), z.p(d, w, "intersect:h"), (0 > c || 0 > d) && z.k("Rect.intersect:Width and height cannot be negative"));
|
|
return Eb(this, a, b, c, d)
|
|
};
|
|
|
|
function Eb(a, b, c, d, e) {
|
|
a.Pa();
|
|
var g = Math.max(a.J, b),
|
|
h = Math.max(a.K, c);
|
|
b = Math.min(a.J + a.Fa, b + d);
|
|
c = Math.min(a.K + a.Ea, c + e);
|
|
a.J = g;
|
|
a.K = h;
|
|
a.Fa = Math.max(0, b - g);
|
|
a.Ea = Math.max(0, c - h);
|
|
return a
|
|
}
|
|
w.prototype.intersectsRect = w.prototype.Ig = function(a) {
|
|
u && z.l(a, w, w, "intersectsRect:r");
|
|
return this.GE(a.x, a.y, a.width, a.height)
|
|
};
|
|
w.prototype.intersects = w.prototype.GE = function(a, b, c, d) {
|
|
u && (z.p(a, w, "intersects:x"), z.p(b, w, "intersects:y"), z.p(a, w, "intersects:w"), z.p(b, w, "intersects:h"), (0 > c || 0 > d) && z.k("Rect.intersects:Width and height cannot be negative"));
|
|
var e = this.Fa,
|
|
g = this.J;
|
|
if (Infinity !== e && Infinity !== c && (e += g, c += a, isNaN(c) || isNaN(e) || g > c || a > e)) return !1;
|
|
a = this.Ea;
|
|
c = this.K;
|
|
return Infinity !== a && Infinity !== d && (a += c, d += b, isNaN(d) || isNaN(a) || c > d || b > a) ? !1 : !0
|
|
};
|
|
|
|
function Hb(a, b) {
|
|
var c = a.Fa,
|
|
d = b.width + 10 + 10,
|
|
e = a.J,
|
|
g = b.x - 10;
|
|
if (e > d + g || g > c + e) return !1;
|
|
c = a.Ea;
|
|
d = b.height + 10 + 10;
|
|
e = a.K;
|
|
g = b.y - 10;
|
|
return e > d + g || g > c + e ? !1 : !0
|
|
}
|
|
w.prototype.unionPoint = w.prototype.vj = function(a) {
|
|
u && z.l(a, N, w, "unionPoint:p");
|
|
return Ib(this, a.x, a.y, 0, 0)
|
|
};
|
|
w.prototype.unionRect = w.prototype.qi = function(a) {
|
|
u && z.l(a, w, w, "unionRect:r");
|
|
return Ib(this, a.J, a.K, a.Fa, a.Ea)
|
|
};
|
|
w.prototype.union = w.prototype.dG = function(a, b, c, d) {
|
|
this.Pa();
|
|
u ? (z.p(a, w, "union:x"), z.p(b, w, "union:y"), void 0 === c ? c = 0 : z.p(c, w, "union:w"), void 0 === d ? d = 0 : z.p(d, w, "union:h"), (0 > c || 0 > d) && z.k("Rect.union:Width and height cannot be negative")) : (void 0 === c && (c = 0), void 0 === d && (d = 0));
|
|
return Ib(this, a, b, c, d)
|
|
};
|
|
|
|
function Ib(a, b, c, d, e) {
|
|
var g = Math.min(a.J, b),
|
|
h = Math.min(a.K, c);
|
|
b = Math.max(a.J + a.Fa, b + d);
|
|
c = Math.max(a.K + a.Ea, c + e);
|
|
a.J = g;
|
|
a.K = h;
|
|
a.Fa = b - g;
|
|
a.Ea = c - h;
|
|
return a
|
|
}
|
|
w.prototype.setSpot = w.prototype.tu = function(a, b, c) {
|
|
u && (z.p(a, w, "setSpot:x"), z.p(b, w, "setSpot:y"), z.l(c, Q, w, "setSpot:spot"));
|
|
this.Pa();
|
|
this.J = a - c.offsetX - c.x * this.Fa;
|
|
this.K = b - c.offsetY - c.y * this.Ea;
|
|
return this
|
|
};
|
|
var Jb;
|
|
w.contains = Jb = function(a, b, c, d, e, g, h, k) {
|
|
u ? (z.p(a, w, "contains:rx"), z.p(b, w, "contains:ry"), z.p(c, w, "contains:rw"), z.p(d, w, "contains:rh"), z.p(e, w, "contains:x"), z.p(g, w, "contains:y"), void 0 === h ? h = 0 : z.p(h, w, "contains:w"), void 0 === k ? k = 0 : z.p(k, w, "contains:h"), (0 > c || 0 > d || 0 > h || 0 > k) && z.k("Rect.contains:Width and height cannot be negative")) : (void 0 === h && (h = 0), void 0 === k && (k = 0));
|
|
return a <= e && e + h <= a + c && b <= g && g + k <= b + d
|
|
};
|
|
w.intersects = function(a, b, c, d, e, g, h, k) {
|
|
u && (z.p(a, w, "intersects:rx"), z.p(b, w, "intersects:ry"), z.p(c, w, "intersects:rw"), z.p(d, w, "intersects:rh"), z.p(e, w, "intersects:x"), z.p(g, w, "intersects:y"), z.p(h, w, "intersects:w"), z.p(k, w, "intersects:h"), (0 > c || 0 > d || 0 > h || 0 > k) && z.k("Rect.intersects:Width and height cannot be negative"));
|
|
c += a;
|
|
h += e;
|
|
if (a > h || e > c) return !1;
|
|
a = d + b;
|
|
k += g;
|
|
return b > k || g > a ? !1 : !0
|
|
};
|
|
z.defineProperty(w, {
|
|
x: "x"
|
|
}, function() {
|
|
return this.J
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", w, "x");
|
|
this.J = a
|
|
});
|
|
z.defineProperty(w, {
|
|
y: "y"
|
|
}, function() {
|
|
return this.K
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", w, "y");
|
|
this.K = a
|
|
});
|
|
z.defineProperty(w, {
|
|
width: "width"
|
|
}, function() {
|
|
return this.Fa
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", w, "width");
|
|
0 > a && z.ka(a, ">= 0", w, "width");
|
|
this.Fa = a
|
|
});
|
|
z.defineProperty(w, {
|
|
height: "height"
|
|
}, function() {
|
|
return this.Ea
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", w, "height");
|
|
0 > a && z.ka(a, ">= 0", w, "height");
|
|
this.Ea = a
|
|
});
|
|
z.defineProperty(w, {
|
|
left: "left"
|
|
}, function() {
|
|
return this.J
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", w, "left");
|
|
this.J = a
|
|
});
|
|
z.defineProperty(w, {
|
|
top: "top"
|
|
}, function() {
|
|
return this.K
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.g(a, "number", w, "top");
|
|
this.K = a
|
|
});
|
|
z.defineProperty(w, {
|
|
right: "right"
|
|
}, function() {
|
|
return this.J + this.Fa
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, w, "right");
|
|
this.J += a - (this.J + this.Fa)
|
|
});
|
|
z.defineProperty(w, {
|
|
bottom: "bottom"
|
|
}, function() {
|
|
return this.K + this.Ea
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, w, "top");
|
|
this.K += a - (this.K + this.Ea)
|
|
});
|
|
z.defineProperty(w, {
|
|
position: "position"
|
|
}, function() {
|
|
return new N(this.J, this.K)
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.l(a, N, w, "position");
|
|
this.J = a.x;
|
|
this.K = a.y
|
|
});
|
|
z.defineProperty(w, {
|
|
size: "size"
|
|
}, function() {
|
|
return new Ea(this.Fa, this.Ea)
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.l(a, Ea, w, "size");
|
|
this.Fa = a.width;
|
|
this.Ea = a.height
|
|
});
|
|
z.defineProperty(w, {
|
|
xl: "center"
|
|
}, function() {
|
|
return new N(this.J + this.Fa / 2, this.K + this.Ea / 2)
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.l(a, N, w, "center");
|
|
this.J = a.x - this.Fa / 2;
|
|
this.K = a.y - this.Ea / 2
|
|
});
|
|
z.defineProperty(w, {
|
|
ra: "centerX"
|
|
}, function() {
|
|
return this.J + this.Fa / 2
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, w, "centerX");
|
|
this.J = a - this.Fa / 2
|
|
});
|
|
z.defineProperty(w, {
|
|
za: "centerY"
|
|
}, function() {
|
|
return this.K + this.Ea / 2
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, w, "centerY");
|
|
this.K = a - this.Ea / 2
|
|
});
|
|
w.prototype.isReal = w.prototype.F = function() {
|
|
return isFinite(this.x) && isFinite(this.y) && isFinite(this.width) && isFinite(this.height)
|
|
};
|
|
w.prototype.isEmpty = function() {
|
|
return 0 === this.width && 0 === this.height
|
|
};
|
|
|
|
function Db(a, b, c, d) {
|
|
void 0 === a ? this.fh = this.Xg = this.nh = this.oh = 0 : void 0 === b ? this.left = this.bottom = this.right = this.top = a : void 0 === c ? (d = b, this.top = a, this.right = b, this.bottom = a, this.left = d) : void 0 !== d ? (this.top = a, this.right = b, this.bottom = c, this.left = d) : z.k("Invalid arguments to Margin constructor: " + a + ", " + b + ", " + c + ", " + d);
|
|
this.G = !1
|
|
}
|
|
z.ia("Margin", Db);
|
|
z.ii(Db);
|
|
z.Yd(Db, {
|
|
top: !0,
|
|
right: !0,
|
|
bottom: !0,
|
|
left: !0
|
|
});
|
|
Db.prototype.assign = function(a) {
|
|
this.oh = a.oh;
|
|
this.nh = a.nh;
|
|
this.Xg = a.Xg;
|
|
this.fh = a.fh
|
|
};
|
|
Db.prototype.setTo = Db.prototype.n = function(a, b, c, d) {
|
|
u && (z.g(a, "number", Db, "setTo:t"), z.g(b, "number", Db, "setTo:r"), z.g(c, "number", Db, "setTo:b"), z.g(d, "number", Db, "setTo:l"));
|
|
this.Pa();
|
|
this.oh = a;
|
|
this.nh = b;
|
|
this.Xg = c;
|
|
this.fh = d;
|
|
return this
|
|
};
|
|
Db.prototype.set = Db.prototype.set = function(a) {
|
|
u && z.l(a, Db, Db, "assign:m");
|
|
this.Pa();
|
|
this.oh = a.oh;
|
|
this.nh = a.nh;
|
|
this.Xg = a.Xg;
|
|
this.fh = a.fh;
|
|
return this
|
|
};
|
|
Db.prototype.copy = function() {
|
|
var a = new Db;
|
|
a.oh = this.oh;
|
|
a.nh = this.nh;
|
|
a.Xg = this.Xg;
|
|
a.fh = this.fh;
|
|
return a
|
|
};
|
|
f = Db.prototype;
|
|
f.La = function() {
|
|
this.G = !0;
|
|
Object.freeze(this);
|
|
return this
|
|
};
|
|
f.V = function() {
|
|
return Object.isFrozen(this) ? this : this.copy().freeze()
|
|
};
|
|
f.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
f.Wa = function() {
|
|
Object.isFrozen(this) && z.k("cannot thaw constant: " + this);
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
f.Pa = function(a) {
|
|
if (this.G) {
|
|
var b = "The Margin is frozen, so its properties cannot be set: " + this.toString();
|
|
void 0 !== a && (b += " to value: " + a);
|
|
z.k(b)
|
|
}
|
|
};
|
|
Db.parse = function(a) {
|
|
if ("string" === typeof a) {
|
|
a = a.split(" ");
|
|
for (var b = 0, c = NaN;
|
|
"" === a[b];) b++;
|
|
var d = a[b++];
|
|
d && (c = parseFloat(d));
|
|
if (isNaN(c)) return new Db;
|
|
for (var e = NaN;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (e = parseFloat(d));
|
|
if (isNaN(e)) return new Db(c);
|
|
for (var g = NaN;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (g = parseFloat(d));
|
|
if (isNaN(g)) return new Db(c, e);
|
|
for (var h = NaN;
|
|
"" === a[b];) b++;
|
|
(d = a[b++]) && (h = parseFloat(d));
|
|
return isNaN(h) ? new Db(c, e) : new Db(c, e, g, h)
|
|
}
|
|
return new Db
|
|
};
|
|
Db.stringify = function(a) {
|
|
return a instanceof Db ? a.top.toString() + " " + a.right.toString() + " " + a.bottom.toString() + " " + a.left.toString() : a.toString()
|
|
};
|
|
Db.prototype.toString = function() {
|
|
return "Margin(" + this.top + "," + this.right + "," + this.bottom + "," + this.left + ")"
|
|
};
|
|
Db.prototype.equals = Db.prototype.N = function(a) {
|
|
return a instanceof Db ? this.oh === a.top && this.nh === a.right && this.Xg === a.bottom && this.fh === a.left : !1
|
|
};
|
|
Db.prototype.equalTo = Db.prototype.Vw = function(a, b, c, d) {
|
|
return this.oh === a && this.nh === b && this.Xg === c && this.fh === d
|
|
};
|
|
Db.prototype.equalsApprox = Db.prototype.Mc = function(a) {
|
|
return eb(this.oh, a.top) && eb(this.nh, a.right) && eb(this.Xg, a.bottom) && eb(this.fh, a.left)
|
|
};
|
|
z.defineProperty(Db, {
|
|
top: "top"
|
|
}, function() {
|
|
return this.oh
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, Db, "top");
|
|
this.oh = a
|
|
});
|
|
z.defineProperty(Db, {
|
|
right: "right"
|
|
}, function() {
|
|
return this.nh
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, Db, "right");
|
|
this.nh = a
|
|
});
|
|
z.defineProperty(Db, {
|
|
bottom: "bottom"
|
|
}, function() {
|
|
return this.Xg
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, Db, "bottom");
|
|
this.Xg = a
|
|
});
|
|
z.defineProperty(Db, {
|
|
left: "left"
|
|
}, function() {
|
|
return this.fh
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && z.p(a, Db, "left");
|
|
this.fh = a
|
|
});
|
|
Db.prototype.isReal = Db.prototype.F = function() {
|
|
return isFinite(this.top) && isFinite(this.right) && isFinite(this.bottom) && isFinite(this.left)
|
|
};
|
|
|
|
function Fa() {
|
|
this.m11 = 1;
|
|
this.m21 = this.m12 = 0;
|
|
this.m22 = 1;
|
|
this.dy = this.dx = 0
|
|
}
|
|
z.ii(Fa);
|
|
z.Yd(Fa, {
|
|
m11: !0,
|
|
m12: !0,
|
|
m21: !0,
|
|
m22: !0,
|
|
dx: !0,
|
|
dy: !0
|
|
});
|
|
Fa.prototype.set = Fa.prototype.set = function(a) {
|
|
u && z.l(a, Fa, Fa, "set:t");
|
|
this.m11 = a.m11;
|
|
this.m12 = a.m12;
|
|
this.m21 = a.m21;
|
|
this.m22 = a.m22;
|
|
this.dx = a.dx;
|
|
this.dy = a.dy;
|
|
return this
|
|
};
|
|
Fa.prototype.copy = function() {
|
|
var a = new Fa;
|
|
a.m11 = this.m11;
|
|
a.m12 = this.m12;
|
|
a.m21 = this.m21;
|
|
a.m22 = this.m22;
|
|
a.dx = this.dx;
|
|
a.dy = this.dy;
|
|
return a
|
|
};
|
|
Fa.prototype.toString = function() {
|
|
return "Transform(" + this.m11 + "," + this.m12 + "," + this.m21 + "," + this.m22 + "," + this.dx + "," + this.dy + ")"
|
|
};
|
|
Fa.prototype.equals = Fa.prototype.N = function(a) {
|
|
return a instanceof Fa ? this.m11 === a.m11 && this.m12 === a.m12 && this.m21 === a.m21 && this.m22 === a.m22 && this.dx === a.dx && this.dy === a.dy : !1
|
|
};
|
|
Fa.prototype.isIdentity = Fa.prototype.Pt = function() {
|
|
return 1 === this.m11 && 0 === this.m12 && 0 === this.m21 && 1 === this.m22 && 0 === this.dx && 0 === this.dy
|
|
};
|
|
Fa.prototype.reset = Fa.prototype.reset = function() {
|
|
this.m11 = 1;
|
|
this.m21 = this.m12 = 0;
|
|
this.m22 = 1;
|
|
this.dy = this.dx = 0;
|
|
return this
|
|
};
|
|
Fa.prototype.multiply = Fa.prototype.multiply = function(a) {
|
|
u && z.l(a, Fa, Fa, "multiply:matrix");
|
|
var b = this.m12 * a.m11 + this.m22 * a.m12,
|
|
c = this.m11 * a.m21 + this.m21 * a.m22,
|
|
d = this.m12 * a.m21 + this.m22 * a.m22,
|
|
e = this.m11 * a.dx + this.m21 * a.dy + this.dx,
|
|
g = this.m12 * a.dx + this.m22 * a.dy + this.dy;
|
|
this.m11 = this.m11 * a.m11 + this.m21 * a.m12;
|
|
this.m12 = b;
|
|
this.m21 = c;
|
|
this.m22 = d;
|
|
this.dx = e;
|
|
this.dy = g;
|
|
return this
|
|
};
|
|
Fa.prototype.multiplyInverted = Fa.prototype.vA = function(a) {
|
|
u && z.l(a, Fa, Fa, "multiplyInverted:matrix");
|
|
var b = 1 / (a.m11 * a.m22 - a.m12 * a.m21),
|
|
c = a.m22 * b,
|
|
d = -a.m12 * b,
|
|
e = -a.m21 * b,
|
|
g = a.m11 * b,
|
|
h = b * (a.m21 * a.dy - a.m22 * a.dx),
|
|
k = b * (a.m12 * a.dx - a.m11 * a.dy);
|
|
a = this.m12 * c + this.m22 * d;
|
|
b = this.m11 * e + this.m21 * g;
|
|
e = this.m12 * e + this.m22 * g;
|
|
g = this.m11 * h + this.m21 * k + this.dx;
|
|
h = this.m12 * h + this.m22 * k + this.dy;
|
|
this.m11 = this.m11 * c + this.m21 * d;
|
|
this.m12 = a;
|
|
this.m21 = b;
|
|
this.m22 = e;
|
|
this.dx = g;
|
|
this.dy = h;
|
|
return this
|
|
};
|
|
Fa.prototype.invert = Fa.prototype.fA = function() {
|
|
var a = 1 / (this.m11 * this.m22 - this.m12 * this.m21),
|
|
b = -this.m12 * a,
|
|
c = -this.m21 * a,
|
|
d = this.m11 * a,
|
|
e = a * (this.m21 * this.dy - this.m22 * this.dx),
|
|
g = a * (this.m12 * this.dx - this.m11 * this.dy);
|
|
this.m11 = this.m22 * a;
|
|
this.m12 = b;
|
|
this.m21 = c;
|
|
this.m22 = d;
|
|
this.dx = e;
|
|
this.dy = g;
|
|
return this
|
|
};
|
|
Fa.prototype.rotate = Fa.prototype.rotate = function(a, b, c) {
|
|
u && (z.p(a, Fa, "rotate:angle"), z.p(b, Fa, "rotate:rx"), z.p(c, Fa, "rotate:ry"));
|
|
360 <= a ? a -= 360 : 0 > a && (a += 360);
|
|
if (0 === a) return this;
|
|
this.translate(b, c);
|
|
var d = 0,
|
|
e = 0;
|
|
90 === a ? (d = 0, e = 1) : 180 === a ? (d = -1, e = 0) : 270 === a ? (d = 0, e = -1) : (e = a * Math.PI / 180, d = Math.cos(e), e = Math.sin(e));
|
|
a = this.m12 * d + this.m22 * e;
|
|
var g = this.m11 * -e + this.m21 * d,
|
|
h = this.m12 * -e + this.m22 * d;
|
|
this.m11 = this.m11 * d + this.m21 * e;
|
|
this.m12 = a;
|
|
this.m21 = g;
|
|
this.m22 = h;
|
|
this.translate(-b, -c);
|
|
return this
|
|
};
|
|
Fa.prototype.translate = Fa.prototype.translate = function(a, b) {
|
|
u && (z.p(a, Fa, "translate:x"), z.p(b, Fa, "translate:y"));
|
|
this.dx += this.m11 * a + this.m21 * b;
|
|
this.dy += this.m12 * a + this.m22 * b;
|
|
return this
|
|
};
|
|
Fa.prototype.scale = Fa.prototype.scale = function(a, b) {
|
|
void 0 === b && (b = a);
|
|
u && (z.p(a, Fa, "translate:sx"), z.p(b, Fa, "translate:sy"));
|
|
this.m11 *= a;
|
|
this.m12 *= a;
|
|
this.m21 *= b;
|
|
this.m22 *= b;
|
|
return this
|
|
};
|
|
Fa.prototype.transformPoint = Fa.prototype.Cb = function(a) {
|
|
u && z.l(a, N, Fa, "transformPoint:p");
|
|
var b = a.J,
|
|
c = a.K;
|
|
a.J = b * this.m11 + c * this.m21 + this.dx;
|
|
a.K = b * this.m12 + c * this.m22 + this.dy;
|
|
return a
|
|
};
|
|
Fa.prototype.invertedTransformPoint = Fa.prototype.ki = function(a) {
|
|
u && z.l(a, N, Fa, "invertedTransformPoint:p");
|
|
var b = 1 / (this.m11 * this.m22 - this.m12 * this.m21),
|
|
c = -this.m12 * b,
|
|
d = this.m11 * b,
|
|
e = b * (this.m12 * this.dx - this.m11 * this.dy),
|
|
g = a.J,
|
|
h = a.K;
|
|
a.J = g * this.m22 * b + h * -this.m21 * b + b * (this.m21 * this.dy - this.m22 * this.dx);
|
|
a.K = g * c + h * d + e;
|
|
return a
|
|
};
|
|
Fa.prototype.transformRect = Fa.prototype.bG = function(a) {
|
|
u && z.l(a, w, Fa, "transformRect:rect");
|
|
var b = a.J,
|
|
c = a.K,
|
|
d = b + a.Fa,
|
|
e = c + a.Ea,
|
|
g = this.m11,
|
|
h = this.m12,
|
|
k = this.m21,
|
|
l = this.m22,
|
|
m = this.dx,
|
|
n = this.dy,
|
|
p = b * g + c * k + m,
|
|
q = b * h + c * l + n,
|
|
r = d * g + c * k + m,
|
|
c = d * h + c * l + n,
|
|
s = b * g + e * k + m,
|
|
b = b * h + e * l + n,
|
|
g = d * g + e * k + m,
|
|
d = d * h + e * l + n,
|
|
e = p,
|
|
h = q,
|
|
p = Math.min(p, r),
|
|
e = Math.max(e, r),
|
|
h = Math.min(h, c),
|
|
q = Math.max(q, c),
|
|
p = Math.min(p, s),
|
|
e = Math.max(e, s),
|
|
h = Math.min(h, b),
|
|
q = Math.max(q, b),
|
|
p = Math.min(p, g),
|
|
e = Math.max(e, g),
|
|
h = Math.min(h, d),
|
|
q = Math.max(q, d);
|
|
a.J = p;
|
|
a.K = h;
|
|
a.Fa =
|
|
e - p;
|
|
a.Ea = q - h;
|
|
return a
|
|
};
|
|
|
|
function Q(a, b, c, d) {
|
|
void 0 === a ? this.xg = this.wg = this.K = this.J = 0 : (void 0 === b && (b = 0), void 0 === c && (c = 0), void 0 === d && (d = 0), this.x = a, this.y = b, this.offsetX = c, this.offsetY = d);
|
|
this.G = !1
|
|
}
|
|
z.ia("Spot", Q);
|
|
z.ii(Q);
|
|
z.Yd(Q, {
|
|
x: !0,
|
|
y: !0,
|
|
offsetX: !0,
|
|
offsetY: !0
|
|
});
|
|
Q.prototype.assign = function(a) {
|
|
this.J = a.J;
|
|
this.K = a.K;
|
|
this.wg = a.wg;
|
|
this.xg = a.xg
|
|
};
|
|
Q.prototype.setTo = Q.prototype.n = function(a, b, c, d) {
|
|
u && (Kb(a, "setTo:x"), Kb(b, "setTo:y"), Pb(c, "setTo:offx"), Pb(d, "setTo:offy"));
|
|
this.Pa();
|
|
this.J = a;
|
|
this.K = b;
|
|
this.wg = c;
|
|
this.xg = d;
|
|
return this
|
|
};
|
|
Q.prototype.set = Q.prototype.set = function(a) {
|
|
u && z.l(a, Q, Q, "set:s");
|
|
this.Pa();
|
|
this.J = a.J;
|
|
this.K = a.K;
|
|
this.wg = a.wg;
|
|
this.xg = a.xg;
|
|
return this
|
|
};
|
|
Q.prototype.copy = function() {
|
|
var a = new Q;
|
|
a.J = this.J;
|
|
a.K = this.K;
|
|
a.wg = this.wg;
|
|
a.xg = this.xg;
|
|
return a
|
|
};
|
|
f = Q.prototype;
|
|
f.La = function() {
|
|
this.G = !0;
|
|
Object.freeze(this);
|
|
return this
|
|
};
|
|
f.V = function() {
|
|
return Object.isFrozen(this) ? this : this.copy().freeze()
|
|
};
|
|
f.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
f.Wa = function() {
|
|
Object.isFrozen(this) && z.k("cannot thaw constant: " + this);
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
f.Pa = function(a) {
|
|
if (this.G) {
|
|
var b = "The Spot is frozen, so its properties cannot be set: " + this.toString();
|
|
void 0 !== a && (b += " to value: " + a);
|
|
z.k(b)
|
|
}
|
|
};
|
|
|
|
function Tb(a, b) {
|
|
a.J = NaN;
|
|
a.K = NaN;
|
|
a.wg = b;
|
|
return a
|
|
}
|
|
|
|
function Kb(a, b) {
|
|
(isNaN(a) || 1 < a || 0 > a) && z.ka(a, "0 <= " + b + " <= 1", Q, b)
|
|
}
|
|
|
|
function Pb(a, b) {
|
|
(isNaN(a) || Infinity === a || -Infinity === a) && z.ka(a, "real number, not NaN or Infinity", Q, b)
|
|
}
|
|
var Ub;
|
|
Q.parse = Ub = function(a) {
|
|
if ("string" === typeof a) {
|
|
a = a.trim();
|
|
if ("None" === a) return Yb;
|
|
if ("TopLeft" === a) return Zb;
|
|
if ("Top" === a || "TopCenter" === a || "MiddleTop" === a) return $b;
|
|
if ("TopRight" === a) return cc;
|
|
if ("Left" === a || "LeftCenter" === a || "MiddleLeft" === a) return dc;
|
|
if ("Center" === a) return ec;
|
|
if ("Right" === a || "RightCenter" === a || "MiddleRight" === a) return fc;
|
|
if ("BottomLeft" === a) return gc;
|
|
if ("Bottom" === a || "BottomCenter" === a || "MiddleBottom" === a) return hc;
|
|
if ("BottomRight" === a) return ic;
|
|
if ("TopSide" === a) return pc;
|
|
if ("LeftSide" ===
|
|
a) return qc;
|
|
if ("RightSide" === a) return sc;
|
|
if ("BottomSide" === a) return tc;
|
|
if ("TopBottomSides" === a) return uc;
|
|
if ("LeftRightSides" === a) return vc;
|
|
if ("TopLeftSides" === a) return wc;
|
|
if ("TopRightSides" === a) return xc;
|
|
if ("BottomLeftSides" === a) return Cc;
|
|
if ("BottomRightSides" === a) return Dc;
|
|
if ("NotTopSide" === a) return Ec;
|
|
if ("NotLeftSide" === a) return Fc;
|
|
if ("NotRightSide" === a) return Gc;
|
|
if ("NotBottomSide" === a) return Hc;
|
|
if ("AllSides" === a) return Ic;
|
|
if ("Default" === a) return Pc;
|
|
a = a.split(" ");
|
|
for (var b = 0, c = 0;
|
|
"" === a[b];) b++;
|
|
var d = a[b++];
|
|
void 0 !== d && 0 < d.length && (c = parseFloat(d));
|
|
for (var e = 0;
|
|
"" === a[b];) b++;
|
|
d = a[b++];
|
|
void 0 !== d && 0 < d.length && (e = parseFloat(d));
|
|
for (var g = 0;
|
|
"" === a[b];) b++;
|
|
d = a[b++];
|
|
void 0 !== d && 0 < d.length && (g = parseFloat(d));
|
|
for (var h = 0;
|
|
"" === a[b];) b++;
|
|
d = a[b++];
|
|
void 0 !== d && 0 < d.length && (h = parseFloat(d));
|
|
return new Q(c, e, g, h)
|
|
}
|
|
return new Q
|
|
};
|
|
Q.stringify = function(a) {
|
|
return a instanceof Q ? a.cd() ? a.x.toString() + " " + a.y.toString() + " " + a.offsetX.toString() + " " + a.offsetY.toString() : a.toString() : a.toString()
|
|
};
|
|
Q.prototype.toString = function() {
|
|
return this.cd() ? 0 === this.wg && 0 === this.xg ? "Spot(" + this.x + "," + this.y + ")" : "Spot(" + this.x + "," + this.y + "," + this.offsetX + "," + this.offsetY + ")" : this.N(Yb) ? "None" : this.N(Zb) ? "TopLeft" : this.N($b) ? "Top" : this.N(cc) ? "TopRight" : this.N(dc) ? "Left" : this.N(ec) ? "Center" : this.N(fc) ? "Right" : this.N(gc) ? "BottomLeft" : this.N(hc) ? "Bottom" : this.N(ic) ? "BottomRight" : this.N(pc) ? "TopSide" : this.N(qc) ? "LeftSide" : this.N(sc) ? "RightSide" : this.N(tc) ? "BottomSide" : this.N(uc) ? "TopBottomSides" : this.N(vc) ?
|
|
"LeftRightSides" : this.N(wc) ? "TopLeftSides" : this.N(xc) ? "TopRightSides" : this.N(Cc) ? "BottomLeftSides" : this.N(Dc) ? "BottomRightSides" : this.N(Ec) ? "NotTopSide" : this.N(Fc) ? "NotLeftSide" : this.N(Gc) ? "NotRightSide" : this.N(Hc) ? "NotBottomSide" : this.N(Ic) ? "AllSides" : this.N(Pc) ? "Default" : "None"
|
|
};
|
|
Q.prototype.equals = Q.prototype.N = function(a) {
|
|
return a instanceof Q ? (this.J === a.x || isNaN(this.J) && isNaN(a.x)) && (this.K === a.y || isNaN(this.K) && isNaN(a.y)) && this.wg === a.offsetX && this.xg === a.offsetY : !1
|
|
};
|
|
Q.prototype.opposite = function() {
|
|
return new Q(.5 - (this.J - .5), .5 - (this.K - .5), -this.wg, -this.xg)
|
|
};
|
|
Q.prototype.includesSide = Q.prototype.vp = function(a) {
|
|
if (!this.kj()) return !1;
|
|
if (!a.kj())
|
|
if (a.N(Qc)) a = qc;
|
|
else if (a.N(Rc)) a = sc;
|
|
else if (a.N(Sc)) a = pc;
|
|
else if (a.N(Tc)) a = tc;
|
|
else return !1;
|
|
a = a.offsetY;
|
|
return (this.xg & a) === a
|
|
};
|
|
z.defineProperty(Q, {
|
|
x: "x"
|
|
}, function() {
|
|
return this.J
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && Kb(a, "x");
|
|
this.J = a
|
|
});
|
|
z.defineProperty(Q, {
|
|
y: "y"
|
|
}, function() {
|
|
return this.K
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && Kb(a, "y");
|
|
this.K = a
|
|
});
|
|
z.defineProperty(Q, {
|
|
offsetX: "offsetX"
|
|
}, function() {
|
|
return this.wg
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && Pb(a, "offsetX");
|
|
this.wg = a
|
|
});
|
|
z.defineProperty(Q, {
|
|
offsetY: "offsetY"
|
|
}, function() {
|
|
return this.xg
|
|
}, function(a) {
|
|
this.Pa(a);
|
|
u && Pb(a, "offsetY");
|
|
this.xg = a
|
|
});
|
|
Q.prototype.isSpot = Q.prototype.cd = function() {
|
|
return !isNaN(this.x) && !isNaN(this.y)
|
|
};
|
|
Q.prototype.isNoSpot = Q.prototype.Be = function() {
|
|
return isNaN(this.x) || isNaN(this.y)
|
|
};
|
|
Q.prototype.isSide = Q.prototype.kj = function() {
|
|
return this.Be() && 1 === this.offsetX && 0 !== this.offsetY
|
|
};
|
|
Q.prototype.isDefault = Q.prototype.bd = function() {
|
|
return isNaN(this.x) && isNaN(this.y) && -1 === this.offsetX && 0 === this.offsetY
|
|
};
|
|
var Yb;
|
|
Q.None = Yb = Tb(new Q(0, 0, 0, 0), 0).La();
|
|
var Pc;
|
|
Q.Default = Pc = Tb(new Q(0, 0, -1, 0), -1).La();
|
|
var Zb;
|
|
Q.TopLeft = Zb = (new Q(0, 0, 0, 0)).La();
|
|
var $b;
|
|
Q.TopCenter = $b = (new Q(.5, 0, 0, 0)).La();
|
|
var cc;
|
|
Q.TopRight = cc = (new Q(1, 0, 0, 0)).La();
|
|
var dc;
|
|
Q.LeftCenter = dc = (new Q(0, .5, 0, 0)).La();
|
|
var ec;
|
|
Q.Center = ec = (new Q(.5, .5, 0, 0)).La();
|
|
var fc;
|
|
Q.RightCenter = fc = (new Q(1, .5, 0, 0)).La();
|
|
var gc;
|
|
Q.BottomLeft = gc = (new Q(0, 1, 0, 0)).La();
|
|
var hc;
|
|
Q.BottomCenter = hc = (new Q(.5, 1, 0, 0)).La();
|
|
var ic;
|
|
Q.BottomRight = ic = (new Q(1, 1, 0, 0)).La();
|
|
var Zc;
|
|
Q.MiddleTop = Zc = $b;
|
|
var $c;
|
|
Q.MiddleLeft = $c = dc;
|
|
var ad;
|
|
Q.MiddleRight = ad = fc;
|
|
var bd;
|
|
Q.MiddleBottom = bd = hc;
|
|
var Sc;
|
|
Q.Top = Sc = $b;
|
|
var Qc;
|
|
Q.Left = Qc = dc;
|
|
var Rc;
|
|
Q.Right = Rc = fc;
|
|
var Tc;
|
|
Q.Bottom = Tc = hc;
|
|
var pc;
|
|
Q.TopSide = pc = Tb(new Q(0, 0, 1, z.pd), 1).La();
|
|
var qc;
|
|
Q.LeftSide = qc = Tb(new Q(0, 0, 1, z.Tc), 1).La();
|
|
var sc;
|
|
Q.RightSide = sc = Tb(new Q(0, 0, 1, z.fd), 1).La();
|
|
var tc;
|
|
Q.BottomSide = tc = Tb(new Q(0, 0, 1, z.ed), 1).La();
|
|
var uc;
|
|
Q.TopBottomSides = uc = Tb(new Q(0, 0, 1, z.pd | z.ed), 1).La();
|
|
var vc;
|
|
Q.LeftRightSides = vc = Tb(new Q(0, 0, 1, z.Tc | z.fd), 1).La();
|
|
var wc;
|
|
Q.TopLeftSides = wc = Tb(new Q(0, 0, 1, z.pd | z.Tc), 1).La();
|
|
var xc;
|
|
Q.TopRightSides = xc = Tb(new Q(0, 0, 1, z.pd | z.fd), 1).La();
|
|
var Cc;
|
|
Q.BottomLeftSides = Cc = Tb(new Q(0, 0, 1, z.ed | z.Tc), 1).La();
|
|
var Dc;
|
|
Q.BottomRightSides = Dc = Tb(new Q(0, 0, 1, z.ed | z.fd), 1).La();
|
|
var Ec;
|
|
Q.NotTopSide = Ec = Tb(new Q(0, 0, 1, z.Tc | z.fd | z.ed), 1).La();
|
|
var Fc;
|
|
Q.NotLeftSide = Fc = Tb(new Q(0, 0, 1, z.pd | z.fd | z.ed), 1).La();
|
|
var Gc;
|
|
Q.NotRightSide = Gc = Tb(new Q(0, 0, 1, z.pd | z.Tc | z.ed), 1).La();
|
|
var Hc;
|
|
Q.NotBottomSide = Hc = Tb(new Q(0, 0, 1, z.pd | z.Tc | z.fd), 1).La();
|
|
var Ic;
|
|
Q.AllSides = Ic = Tb(new Q(0, 0, 1, z.pd | z.Tc | z.fd | z.ed), 1).La();
|
|
|
|
function cd() {
|
|
this.pf = [1, 0, 0, 1, 0, 0]
|
|
}
|
|
cd.prototype.copy = function() {
|
|
var a = new cd;
|
|
a.pf[0] = this.pf[0];
|
|
a.pf[1] = this.pf[1];
|
|
a.pf[2] = this.pf[2];
|
|
a.pf[3] = this.pf[3];
|
|
a.pf[4] = this.pf[4];
|
|
a.pf[5] = this.pf[5];
|
|
return a
|
|
};
|
|
|
|
function dd(a) {
|
|
this.type = a;
|
|
this.r2 = this.y2 = this.x2 = this.r1 = this.y1 = this.x1 = 0;
|
|
this.RD = [];
|
|
this.pattern = null
|
|
}
|
|
dd.prototype.addColorStop = function(a, b) {
|
|
this.RD.push({
|
|
offset: a,
|
|
color: b
|
|
})
|
|
};
|
|
|
|
function ed(a, b, c) {
|
|
this.fillStyle = "#000000";
|
|
this.font = "10px sans-serif";
|
|
this.globalAlpha = 1;
|
|
this.lineCap = "butt";
|
|
this.nn = 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.Nw = !1;
|
|
this.zg = this.Is = this.Hs = 0;
|
|
this.document = b || document;
|
|
this.nE = c;
|
|
this.nx = null;
|
|
this.path = [];
|
|
this.ej = new cd;
|
|
this.stack = [];
|
|
this.Cf = [];
|
|
this.Tw = a;
|
|
this.NI = "http://www.w3.org/2000/svg";
|
|
this.width = this.Tw.width;
|
|
this.height = this.Tw.height;
|
|
this.Vl = pd(this, "svg", {
|
|
width: this.width + "px",
|
|
height: this.height + "px",
|
|
EL: "0 0 " + this.Tw.width + " " + this.Tw.height
|
|
});
|
|
this.Vl.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns", "http://www.w3.org/2000/svg");
|
|
this.Vl.setAttributeNS("http://www.w3.org/2000/xmlns/", "xmlns:xlink", "http://www.w3.org/1999/xlink");
|
|
qd(this, 1, 0, 0, 1, 0, 0);
|
|
a = z.am++;
|
|
b = pd(this, "clipPath", {
|
|
id: "mainClip" + a
|
|
});
|
|
b.appendChild(pd(this, "rect", {
|
|
x: 0,
|
|
y: 0,
|
|
width: this.width,
|
|
height: this.height
|
|
}));
|
|
this.Vl.appendChild(b);
|
|
this.Cf[0].setAttributeNS(null, "clip-path", "url(#mainClip" + a + ")")
|
|
}
|
|
f = ed.prototype;
|
|
f.arc = function(a, b, c, d, e, g) {
|
|
rd(this, a, b, c, d, e, g)
|
|
};
|
|
f.beginPath = function() {
|
|
this.path = []
|
|
};
|
|
f.bezierCurveTo = function(a, b, c, d, e, g) {
|
|
this.path.push(["C", a, b, c, d, e, g])
|
|
};
|
|
f.clearRect = function() {};
|
|
f.clip = function() {
|
|
sd(this, "clipPath", this.path, new cd)
|
|
};
|
|
f.closePath = function() {
|
|
this.path.push(["z"])
|
|
};
|
|
f.createLinearGradient = function(a, b, c, d) {
|
|
var e = new dd("linear");
|
|
e.x1 = a;
|
|
e.y1 = b;
|
|
e.x2 = c;
|
|
e.y2 = d;
|
|
return e
|
|
};
|
|
f.createPattern = function(a) {
|
|
var b = new dd("pattern");
|
|
b.pattern = a;
|
|
return b
|
|
};
|
|
f.createRadialGradient = function(a, b, c, d, e, g) {
|
|
var h = new dd("radial");
|
|
h.x1 = a;
|
|
h.y1 = b;
|
|
h.r1 = c;
|
|
h.x2 = d;
|
|
h.y2 = e;
|
|
h.r2 = g;
|
|
return h
|
|
};
|
|
f.drawImage = function(a, b, c, d, e, g, h, k, l) {
|
|
var m = "";
|
|
a instanceof HTMLCanvasElement && (m = a.toDataURL());
|
|
a instanceof HTMLImageElement && (m = a.src);
|
|
m = {
|
|
x: 0,
|
|
y: 0,
|
|
width: a.naturalWidth,
|
|
height: a.naturalHeight,
|
|
href: m
|
|
};
|
|
m.preserveAspectRatio = td(d, k) && td(e, l) ? "xMidYMid slice" : "none";
|
|
var n = "";
|
|
k /= d;
|
|
l /= e;
|
|
if (0 !== g || 0 !== h) n += " translate(" + g + ", " + h + ")";
|
|
if (1 !== k || 1 !== l) n += " scale(" + k + ", " + l + ")";
|
|
if (0 !== b || 0 !== c) n += " translate(" + -b + ", " + -c + ")";
|
|
if (0 !== b || 0 !== c || d !== a.naturalWidth || e !== a.naturalHeight) a = "CLIP" + z.am++, g = pd(this,
|
|
"clipPath", {
|
|
id: a
|
|
}), g.appendChild(pd(this, "rect", {
|
|
x: b,
|
|
y: c,
|
|
width: d,
|
|
height: e
|
|
})), this.Vl.appendChild(g), m["clip-path"] = "url(#" + a + ")";
|
|
ud(this, "image", m, this.ej, n);
|
|
this.addElement("image", m)
|
|
};
|
|
f.fill = function() {
|
|
sd(this, "fill", this.path, this.ej)
|
|
};
|
|
f.Gg = function() {
|
|
this.Nw ? this.clip() : this.fill()
|
|
};
|
|
f.fillRect = function(a, b, c, d) {
|
|
vd(this, "fill", [a, b, c, d], this.ej)
|
|
};
|
|
f.fillText = function(a, b, c) {
|
|
a = [a, b, c];
|
|
b = this.textAlign;
|
|
"left" === b ? b = "start" : "right" === b ? b = "end" : "center" === b && (b = "middle");
|
|
b = {
|
|
x: a[1],
|
|
y: a[2],
|
|
style: "font: " + this.font,
|
|
"text-anchor": b
|
|
};
|
|
ud(this, "fill", b, this.ej);
|
|
this.addElement("text", b, a[0])
|
|
};
|
|
f.lineTo = function(a, b) {
|
|
this.path.push(["L", a, b])
|
|
};
|
|
f.moveTo = function(a, b) {
|
|
this.path.push(["M", a, b])
|
|
};
|
|
f.quadraticCurveTo = function(a, b, c, d) {
|
|
this.path.push(["Q", a, b, c, d])
|
|
};
|
|
f.rect = function(a, b, c, d) {
|
|
this.path.push(["M", a, b], ["L", a + c, b], ["L", a + c, b + d], ["L", a, b + d], ["z"])
|
|
};
|
|
f.restore = function() {
|
|
this.ej = 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.nn = a.nn;
|
|
this.lineJoin = a.lineJoin;
|
|
this.lineWidth = a.lineWidth;
|
|
this.miterLimit = a.miterLimit;
|
|
this.shadowBlur = a.shadowBlur;
|
|
this.shadowColor = a.shadowColor;
|
|
this.shadowOffsetX = a.shadowOffsetX;
|
|
this.shadowOffsetY = a.shadowOffsetY;
|
|
this.strokeStyle = a.strokeStyle;
|
|
this.textAlign = a.textAlign
|
|
};
|
|
f.save = function() {
|
|
this.stack.push({
|
|
fillStyle: this.fillStyle,
|
|
font: this.font,
|
|
globalAlpha: this.globalAlpha,
|
|
lineCap: this.lineCap,
|
|
nn: this.nn,
|
|
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.ej.copy())
|
|
};
|
|
f.setTransform = function(a, b, c, d, e, g) {
|
|
1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || qd(this, a, b, c, d, e, g)
|
|
};
|
|
f.scale = function() {};
|
|
f.stroke = function() {
|
|
sd(this, "stroke", this.path, this.ej)
|
|
};
|
|
f.tj = function() {
|
|
this.Kn || this.stroke()
|
|
};
|
|
f.strokeRect = function(a, b, c, d) {
|
|
vd(this, "stroke", [a, b, c, d], this.ej)
|
|
};
|
|
|
|
function pd(a, b, c, d) {
|
|
a = a.document.createElementNS(a.NI, b);
|
|
if (z.Za(c))
|
|
for (var e in c) a.setAttributeNS("href" === e ? "http://www.w3.org/1999/xlink" : "", e, c[e]);
|
|
void 0 !== d && (a.textContent = d);
|
|
return a
|
|
}
|
|
f.addElement = function(a, b, c) {
|
|
a = pd(this, a, b, c);
|
|
0 < this.Cf.length ? this.Cf[this.Cf.length - 1].appendChild(a) : this.Vl.appendChild(a);
|
|
return this.nx = a
|
|
};
|
|
|
|
function ud(a, b, c, d, e) {
|
|
1 !== a.globalAlpha && (c.opacity = a.globalAlpha);
|
|
"fill" === b ? (/^rgba\(/.test(a.fillStyle) ? (a = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.fillStyle), c.fill = "rgb(" + a[1] + "," + a[2] + "," + a[3] + ")", c["fill-opacity"] = a[4]) : c.fill = a.fillStyle instanceof dd ? wd(a, a.fillStyle) : a.fillStyle, c.stroke = "none") : "stroke" === b && (c.fill = "none", /^rgba\(/.test(a.strokeStyle) ? (b = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(a.strokeStyle),
|
|
c.stroke = "rgb(" + b[1] + "," + b[2] + "," + b[3] + ")", c["stroke-opacity"] = b[4]) : c.stroke = a.strokeStyle instanceof dd ? wd(a, a.strokeStyle) : a.strokeStyle, c["stroke-width"] = a.lineWidth, c["stroke-linecap"] = a.lineCap, c["stroke-linejoin"] = a.lineJoin, c["stroke-miterlimit"] = a.miterLimit);
|
|
d = d.pf;
|
|
d = "matrix(" + d[0] + ", " + d[1] + ", " + d[2] + ", " + d[3] + ", " + d[4] + ", " + d[5] + ")";
|
|
void 0 !== e && (d += e);
|
|
c.transform = d
|
|
}
|
|
|
|
function wd(a, b) {
|
|
var c = "GRAD" + z.am++,
|
|
d;
|
|
if ("linear" === b.type) d = {
|
|
x1: b.x1,
|
|
x2: b.x2,
|
|
y1: b.y1,
|
|
y2: b.y2,
|
|
id: c,
|
|
gradientUnits: "userSpaceOnUse"
|
|
}, d = pd(a, "linearGradient", d);
|
|
else if ("radial" === b.type) d = {
|
|
x1: b.x1,
|
|
x2: b.x2,
|
|
y1: b.y1,
|
|
y2: b.y2,
|
|
r1: b.r1,
|
|
r2: b.r2,
|
|
id: c
|
|
}, d = pd(a, "radialGradient", d);
|
|
else if ("pattern" === b.type) {
|
|
var e = b.pattern;
|
|
d = {
|
|
width: e.width,
|
|
height: e.height,
|
|
id: c,
|
|
patternUnits: "userSpaceOnUse"
|
|
};
|
|
var g = "";
|
|
e instanceof HTMLCanvasElement && (g = e.toDataURL());
|
|
e instanceof HTMLImageElement && (g = e.src);
|
|
e = {
|
|
x: 0,
|
|
y: 0,
|
|
width: e.width,
|
|
height: e.height,
|
|
href: g
|
|
};
|
|
d = pd(a, "pattern", d);
|
|
d.appendChild(pd(a, "image", e))
|
|
} else throw Error("invalid gradient");
|
|
for (var e = b.RD, g = e.length, h = [], k = 0; k < g; k++) {
|
|
var l = e[k],
|
|
m = l.color,
|
|
l = {
|
|
offset: l.offset,
|
|
"stop-color": m
|
|
};
|
|
/^rgba\(/.test(m) && (m = /^\s*rgba\s*\(([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\s*,\s*([^,\s]+)\)\s*$/i.exec(m), l["stop-color"] = "rgb(" + m[1] + "," + m[2] + "," + m[3] + ")", l["stop-opacity"] = m[4]);
|
|
h.push(l)
|
|
}
|
|
h.sort(function(a, b) {
|
|
return a.offset > b.offset ? 1 : -1
|
|
});
|
|
for (k = 0; k < g; k++) d.appendChild(pd(a, "stop",
|
|
h[k]));
|
|
a.Vl.appendChild(d);
|
|
return "url(#" + c + ")"
|
|
}
|
|
|
|
function vd(a, b, c, d) {
|
|
c = {
|
|
x: c[0],
|
|
y: c[1],
|
|
width: c[2],
|
|
height: c[3]
|
|
};
|
|
ud(a, b, c, d);
|
|
a.addElement("rect", c)
|
|
}
|
|
|
|
function sd(a, b, c, d) {
|
|
for (var e = [], g = 0; g < c.length; g++) {
|
|
var h = z.zl(c[g]),
|
|
k = [h.shift()];
|
|
if ("A" === k[0]) k.push(h.shift() + "," + h.shift(), h.shift(), h.shift() + "," + h.shift(), h.shift() + "," + h.shift());
|
|
else
|
|
for (; h.length;) k.push(h.shift() + "," + h.shift());
|
|
e.push(k.join(" "))
|
|
}
|
|
c = {
|
|
d: e.join(" ")
|
|
};
|
|
ud(a, b, c, d);
|
|
"clipPath" === b ? (b = "CLIP" + z.am++, d = pd(a, "clipPath", {
|
|
id: b
|
|
}), d.appendChild(pd(a, "path", c)), a.Vl.appendChild(d), 0 < a.Cf.length && a.Cf[a.Cf.length - 1].setAttributeNS(null, "clip-path", "url(#" + b + ")")) : a.addElement("path",
|
|
c)
|
|
}
|
|
|
|
function rd(a, b, c, d, e, g, h) {
|
|
var k = Math.abs(e - g);
|
|
if (e !== g) {
|
|
var l = b + d * Math.cos(g);
|
|
g = c + d * Math.sin(g);
|
|
k >= 2 * Math.PI ? (rd(a, b, c, d, e, e + Math.PI, h), rd(a, b, c, d, e + Math.PI, e + 2 * Math.PI, h), a.path.push(["M", l, g])) : (b += d * Math.cos(e), c += d * Math.sin(e), k = 180 * k / Math.PI, e = h ? 0 : 1, h = 180 <= k === !!h ? 0 : 1, 0 !== a.path.length ? a.path.push(["L", b, c]) : a.path.push(["M", b, c]), a.path.push(["A", d, d, k, h, e, l, g]))
|
|
}
|
|
}
|
|
|
|
function qd(a, b, c, d, e, g, h) {
|
|
var k = new cd;
|
|
k.pf = [b, c, d, e, g, h];
|
|
b = {};
|
|
ud(a, "g", b, k);
|
|
k = a.addElement("g", b);
|
|
a.Cf.push(k)
|
|
}
|
|
f.gb = function() {
|
|
if (0 !== this.shadowOffsetX || 0 !== this.shadowOffsetY || 0 !== this.shadowBlur) {
|
|
var a = "SHADOW" + z.am++,
|
|
b = this.addElement("filter", {
|
|
id: a,
|
|
x: "-100%",
|
|
y: "-100%",
|
|
width: "300%",
|
|
height: "300%"
|
|
}, null),
|
|
c, d, e, g, h;
|
|
c = pd(this, "feGaussianBlur", {
|
|
"in": "SourceAlpha",
|
|
result: "blur",
|
|
vL: this.shadowBlur / 2
|
|
});
|
|
d = pd(this, "feFlood", {
|
|
"in": "blur",
|
|
result: "flood",
|
|
"flood-color": this.shadowColor
|
|
});
|
|
e = pd(this, "feComposite", {
|
|
"in": "flood",
|
|
in2: "blur",
|
|
operator: "in",
|
|
result: "comp"
|
|
});
|
|
g = pd(this, "feOffset", {
|
|
"in": "comp",
|
|
result: "offsetBlur",
|
|
dx: this.shadowOffsetX,
|
|
dy: this.shadowOffsetY
|
|
});
|
|
h = pd(this, "feMerge", {});
|
|
h.appendChild(pd(this, "feMergeNode", {
|
|
"in": "offsetBlur"
|
|
}));
|
|
h.appendChild(pd(this, "feMergeNode", {
|
|
"in": "SourceGraphic"
|
|
}));
|
|
b.appendChild(c);
|
|
b.appendChild(d);
|
|
b.appendChild(e);
|
|
b.appendChild(g);
|
|
b.appendChild(h);
|
|
0 < this.Cf.length && this.Cf[this.Cf.length - 1].setAttributeNS(null, "filter", "url(#" + a + ")")
|
|
}
|
|
};
|
|
f.TA = function(a, b, c) {
|
|
this.Hs = a;
|
|
this.Is = b;
|
|
this.zg = c
|
|
};
|
|
f.wn = function() {
|
|
this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0
|
|
};
|
|
f.xn = function() {
|
|
this.shadowOffsetX = this.Hs;
|
|
this.shadowOffsetY = this.Is;
|
|
this.shadowBlur = this.zg
|
|
};
|
|
f.Tz = function() {
|
|
return !1
|
|
};
|
|
f.Pz = function() {};
|
|
|
|
function la(a, b) {
|
|
this.ownerDocument = void 0 === b ? document : b;
|
|
var c = this.ownerDocument.createElement("canvas");
|
|
c.tabIndex = 0;
|
|
this.Kd = c;
|
|
this.yl = new xd(c);
|
|
c.Z = a;
|
|
Object.seal(this)
|
|
}
|
|
f = la.prototype;
|
|
f.toDataURL = function(a, b) {
|
|
return this.Kd.toDataURL(a, b)
|
|
};
|
|
f.getBoundingClientRect = function() {
|
|
return this.Kd.getBoundingClientRect()
|
|
};
|
|
f.focus = function() {
|
|
return this.Kd.focus()
|
|
};
|
|
f.addEventListener = function(a, b, c) {
|
|
this.Kd.addEventListener(a, b, c)
|
|
};
|
|
f.removeEventListener = function(a, b, c) {
|
|
this.Kd.removeEventListener(a, b, c)
|
|
};
|
|
z.defineProperty(la, {
|
|
width: "width"
|
|
}, function() {
|
|
return this.Kd.width
|
|
}, function(a) {
|
|
this.Kd.width = a
|
|
});
|
|
z.defineProperty(la, {
|
|
height: "height"
|
|
}, function() {
|
|
return this.Kd.height
|
|
}, function(a) {
|
|
this.Kd.height = a
|
|
});
|
|
z.defineProperty(la, {
|
|
style: "style"
|
|
}, function() {
|
|
return this.Kd.style
|
|
}, function(a) {
|
|
this.Kd.style = a
|
|
});
|
|
|
|
function xd(a) {
|
|
a.getContext && a.getContext("2d") || z.k("Browser does not support HTML Canvas Element");
|
|
this.Ca = a.getContext("2d");
|
|
this.ly = this.ny = this.my = "";
|
|
this.Kn = !1;
|
|
this.zg = this.Is = this.Hs = 0;
|
|
Object.seal(this)
|
|
}
|
|
z.defineProperty(xd, {
|
|
fillStyle: "fillStyle"
|
|
}, function() {
|
|
return this.Ca.fillStyle
|
|
}, function(a) {
|
|
this.ly !== a && (this.ly = this.Ca.fillStyle = a)
|
|
});
|
|
z.defineProperty(xd, {
|
|
font: "font"
|
|
}, function() {
|
|
return this.Ca.font
|
|
}, function(a) {
|
|
this.my !== a && (this.my = this.Ca.font = a)
|
|
});
|
|
z.defineProperty(xd, {
|
|
globalAlpha: "globalAlpha"
|
|
}, function() {
|
|
return this.Ca.globalAlpha
|
|
}, function(a) {
|
|
this.Ca.globalAlpha = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
lineCap: "lineCap"
|
|
}, function() {
|
|
return this.Ca.lineCap
|
|
}, function(a) {
|
|
this.Ca.lineCap = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
nn: "lineDashOffset"
|
|
}, function() {
|
|
return this.Ca.nn
|
|
}, function(a) {
|
|
this.Ca.nn = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
lineJoin: "lineJoin"
|
|
}, function() {
|
|
return this.Ca.lineJoin
|
|
}, function(a) {
|
|
this.Ca.lineJoin = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
lineWidth: "lineWidth"
|
|
}, function() {
|
|
return this.Ca.lineWidth
|
|
}, function(a) {
|
|
this.Ca.lineWidth = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
miterLimit: "miterLimit"
|
|
}, function() {
|
|
return this.Ca.miterLimit
|
|
}, function(a) {
|
|
this.Ca.miterLimit = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
shadowBlur: "shadowBlur"
|
|
}, function() {
|
|
return this.Ca.shadowBlur
|
|
}, function(a) {
|
|
this.Ca.shadowBlur = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
shadowColor: "shadowColor"
|
|
}, function() {
|
|
return this.Ca.shadowColor
|
|
}, function(a) {
|
|
this.Ca.shadowColor = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
shadowOffsetX: "shadowOffsetX"
|
|
}, function() {
|
|
return this.Ca.shadowOffsetX
|
|
}, function(a) {
|
|
this.Ca.shadowOffsetX = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
shadowOffsetY: "shadowOffsetY"
|
|
}, function() {
|
|
return this.Ca.shadowOffsetY
|
|
}, function(a) {
|
|
this.Ca.shadowOffsetY = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
strokeStyle: "strokeStyle"
|
|
}, function() {
|
|
return this.Ca.strokeStyle
|
|
}, function(a) {
|
|
this.ny !== a && (this.ny = this.Ca.strokeStyle = a)
|
|
});
|
|
z.defineProperty(xd, {
|
|
textAlign: "textAlign"
|
|
}, function() {
|
|
return this.Ca.textAlign
|
|
}, function(a) {
|
|
this.Ca.textAlign = a
|
|
});
|
|
z.defineProperty(xd, {
|
|
Jt: "imageSmoothingEnabled"
|
|
}, function() {
|
|
return this.Ca.Jt
|
|
}, function(a) {
|
|
this.Ca.Jt = a
|
|
});
|
|
f = xd.prototype;
|
|
f.arc = function(a, b, c, d, e, g) {
|
|
this.Ca.arc(a, b, c, d, e, g)
|
|
};
|
|
f.beginPath = function() {
|
|
this.Ca.beginPath()
|
|
};
|
|
f.bezierCurveTo = function(a, b, c, d, e, g) {
|
|
this.Ca.bezierCurveTo(a, b, c, d, e, g)
|
|
};
|
|
f.clearRect = function(a, b, c, d) {
|
|
this.Ca.clearRect(a, b, c, d)
|
|
};
|
|
f.clip = function() {
|
|
this.Ca.clip()
|
|
};
|
|
f.closePath = function() {
|
|
this.Ca.closePath()
|
|
};
|
|
f.createLinearGradient = function(a, b, c, d) {
|
|
return this.Ca.createLinearGradient(a, b, c, d)
|
|
};
|
|
f.createPattern = function(a, b) {
|
|
return this.Ca.createPattern(a, b)
|
|
};
|
|
f.createRadialGradient = function(a, b, c, d, e, g) {
|
|
return this.Ca.createRadialGradient(a, b, c, d, e, g)
|
|
};
|
|
f.drawImage = function(a, b, c, d, e, g, h, k, l) {
|
|
void 0 === d ? this.Ca.drawImage(a, b, c) : this.Ca.drawImage(a, b, c, d, e, g, h, k, l)
|
|
};
|
|
f.fill = function() {
|
|
this.Ca.fill()
|
|
};
|
|
f.fillRect = function(a, b, c, d) {
|
|
this.Ca.fillRect(a, b, c, d)
|
|
};
|
|
f.fillText = function(a, b, c) {
|
|
this.Ca.fillText(a, b, c)
|
|
};
|
|
f.getImageData = function(a, b, c, d) {
|
|
return this.Ca.getImageData(a, b, c, d)
|
|
};
|
|
f.lineTo = function(a, b) {
|
|
this.Ca.lineTo(a, b)
|
|
};
|
|
f.measureText = function(a) {
|
|
return this.Ca.measureText(a)
|
|
};
|
|
f.moveTo = function(a, b) {
|
|
this.Ca.moveTo(a, b)
|
|
};
|
|
f.quadraticCurveTo = function(a, b, c, d) {
|
|
this.Ca.quadraticCurveTo(a, b, c, d)
|
|
};
|
|
f.rect = function(a, b, c, d) {
|
|
this.Ca.rect(a, b, c, d)
|
|
};
|
|
f.restore = function() {
|
|
this.Ca.restore()
|
|
};
|
|
xd.prototype.rotate = function(a) {
|
|
this.Ca.rotate(a)
|
|
};
|
|
f = xd.prototype;
|
|
f.save = function() {
|
|
this.Ca.save()
|
|
};
|
|
f.setTransform = function(a, b, c, d, e, g) {
|
|
this.Ca.setTransform(a, b, c, d, e, g)
|
|
};
|
|
f.scale = function(a, b) {
|
|
this.Ca.scale(a, b)
|
|
};
|
|
f.stroke = function() {
|
|
this.Ca.stroke()
|
|
};
|
|
f.transform = function(a, b, c, d, e, g) {
|
|
1 === a && 0 === b && 0 === c && 1 === d && 0 === e && 0 === g || this.Ca.transform(a, b, c, d, e, g)
|
|
};
|
|
f.translate = function(a, b) {
|
|
this.Ca.translate(a, b)
|
|
};
|
|
f.Gg = function(a) {
|
|
if (a instanceof Da && a.type === yd) {
|
|
var b = a.On;
|
|
a = a.ty;
|
|
a > b ? (this.scale(b / a, 1), this.translate((a - b) / 2, 0)) : b > a && (this.scale(1, a / b), this.translate(0, (b - a) / 2));
|
|
this.Kn ? this.clip() : this.fill();
|
|
a > b ? (this.translate(-(a - b) / 2, 0), this.scale(1 / (b / a), 1)) : b > a && (this.translate(0, -(b - a) / 2), this.scale(1, 1 / (a / b)))
|
|
} else this.Kn ? this.clip() : this.fill()
|
|
};
|
|
f.tj = function() {
|
|
this.Kn || this.stroke()
|
|
};
|
|
z.defineProperty(xd, {
|
|
Nw: "clipInsteadOfFill"
|
|
}, function() {
|
|
return this.Kn
|
|
}, function(a) {
|
|
this.Kn = a
|
|
});
|
|
f = xd.prototype;
|
|
f.TA = function(a, b, c) {
|
|
this.Hs = a;
|
|
this.Is = b;
|
|
this.zg = c
|
|
};
|
|
f.wn = function() {
|
|
this.shadowBlur = this.shadowOffsetY = this.shadowOffsetX = 0
|
|
};
|
|
f.xn = function() {
|
|
this.shadowOffsetX = this.Hs;
|
|
this.shadowOffsetY = this.Is;
|
|
this.shadowBlur = this.zg
|
|
};
|
|
f.Tz = function(a, b) {
|
|
var c = this.Ca;
|
|
if (void 0 !== c.setLineDash) c.setLineDash(a), c.lineDashOffset = b;
|
|
else if (void 0 !== c.webkitLineDash) c.webkitLineDash = a, c.webkitLineDashOffset = b;
|
|
else if (void 0 !== c.mozDash) c.mozDash = a, c.mozDashOffset = b;
|
|
else return !1;
|
|
return !0
|
|
};
|
|
f.Pz = function() {
|
|
var a = this.Ca;
|
|
void 0 !== a.setLineDash ? (a.setLineDash(z.xj), a.lineDashOffset = 0) : void 0 !== a.webkitLineDash ? (a.webkitLineDash = z.xj, a.webkitLineDashOffset = 0) : void 0 !== a.mozDash && (a.mozDash = null, a.mozDashOffset = 0)
|
|
};
|
|
|
|
function ca(a, b) {
|
|
b && (a.my = "");
|
|
a.ny = "";
|
|
a.ly = ""
|
|
}
|
|
var Hd = (Math.sqrt(2) - 1) / 3 * 4,
|
|
Id = (new N(0, 0)).La(),
|
|
Jd = (new w(0, 0, 0, 0)).La(),
|
|
Kd = (new Db(0, 0, 0, 0)).La(),
|
|
Ld = (new Db(2, 2, 2, 2)).La(),
|
|
Md = (new N(6, 6)).La(),
|
|
Nd = (new N(-Infinity, -Infinity)).La(),
|
|
Od = (new N(Infinity, Infinity)).La(),
|
|
Pd = (new Ea(0, 0)).La(),
|
|
Qd = (new Ea(1, 1)).La(),
|
|
ae = (new Ea(6, 6)).La(),
|
|
be = (new Ea(8, 8)).La(),
|
|
ce = (new Ea(10, 10)).La(),
|
|
de = (new Ea(Infinity, Infinity)).La(),
|
|
ee = (new N(NaN, NaN)).La(),
|
|
fe = (new Ea(NaN, NaN)).La(),
|
|
ge = (new w(NaN, NaN, NaN, NaN)).La(),
|
|
he = (new Q(.156, .156)).La(),
|
|
ie = (new Q(.844, .844)).La(),
|
|
je = new ma,
|
|
ke = new ma,
|
|
le = null;
|
|
|
|
function se(a) {
|
|
if (0 >= a) return 0;
|
|
var b = le;
|
|
if (null === b) {
|
|
for (var b = [], c = 0; 2E3 >= c; c++) b[c] = Math.sqrt(c);
|
|
le = b
|
|
}
|
|
return 1 > a ? (c = 1 / a, 2E3 >= c ? 1 / b[c | 0] : Math.sqrt(a)) : 2E3 >= a ? b[a | 0] : Math.sqrt(a)
|
|
}
|
|
|
|
function eb(a, b) {
|
|
var c = a - b;
|
|
return .5 > c && -.5 < c
|
|
}
|
|
|
|
function td(a, b) {
|
|
var c = a - b;
|
|
return 5E-8 > c && -5E-8 < c
|
|
}
|
|
|
|
function te(a, b, c, d, e, g, h) {
|
|
0 >= e && (e = 1E-6);
|
|
var k = 0,
|
|
l = 0,
|
|
m = 0,
|
|
n = 0;
|
|
a < c ? (l = a, k = c) : (l = c, k = a);
|
|
b < d ? (n = b, m = d) : (n = d, m = b);
|
|
if (a === c) return n <= h && h <= m && a - e <= g && g <= a + e;
|
|
if (b === d) return l <= g && g <= k && b - e <= h && h <= b + e;
|
|
k += e;
|
|
l -= e;
|
|
if (l <= g && g <= k && (m += e, n -= e, n <= h && h <= m))
|
|
if (k - l > m - n)
|
|
if (a - c > e || c - a > e) {
|
|
if (g = (d - b) / (c - a) * (g - a) + b, g - e <= h && h <= g + e) return !0
|
|
} else return !0;
|
|
else if (b - d > e || d - b > e) {
|
|
if (h = (c - a) / (d - b) * (h - b) + a, h - e <= g && g <= h + e) return !0
|
|
} else return !0;
|
|
return !1
|
|
}
|
|
|
|
function ue(a, b, c, d, e, g, h, k, l, m, n, p) {
|
|
if (te(a, b, h, k, p, c, d) && te(a, b, h, k, p, e, g)) return te(a, b, h, k, p, m, n);
|
|
var q = (a + c) / 2,
|
|
r = (b + d) / 2,
|
|
s = (c + e) / 2,
|
|
t = (d + g) / 2;
|
|
e = (e + h) / 2;
|
|
g = (g + k) / 2;
|
|
d = (q + s) / 2;
|
|
c = (r + t) / 2;
|
|
var s = (s + e) / 2,
|
|
t = (t + g) / 2,
|
|
v = (d + s) / 2,
|
|
x = (c + t) / 2;
|
|
return ue(a, b, q, r, d, c, v, x, l, m, n, p) || ue(v, x, s, t, e, g, h, k, l, m, n, p)
|
|
}
|
|
|
|
function ve(a, b, c, d, e, g, h, k, l, m) {
|
|
if (te(a, b, h, k, l, c, d) && te(a, b, h, k, l, e, g)) Ib(m, a, b, 0, 0), Ib(m, h, k, 0, 0);
|
|
else {
|
|
var n = (a + c) / 2,
|
|
p = (b + d) / 2,
|
|
q = (c + e) / 2,
|
|
r = (d + g) / 2;
|
|
e = (e + h) / 2;
|
|
g = (g + k) / 2;
|
|
d = (n + q) / 2;
|
|
c = (p + r) / 2;
|
|
var q = (q + e) / 2,
|
|
r = (r + g) / 2,
|
|
s = (d + q) / 2,
|
|
t = (c + r) / 2;
|
|
ve(a, b, n, p, d, c, s, t, l, m);
|
|
ve(s, t, q, r, e, g, h, k, l, m)
|
|
}
|
|
}
|
|
|
|
function we(a, b, c, d, e, g, h, k, l, m) {
|
|
if (te(a, b, h, k, l, c, d) && te(a, b, h, k, l, e, g)) 0 === m.length && (m.push(a), m.push(b)), m.push(h), m.push(k);
|
|
else {
|
|
var n = (a + c) / 2,
|
|
p = (b + d) / 2,
|
|
q = (c + e) / 2,
|
|
r = (d + g) / 2;
|
|
e = (e + h) / 2;
|
|
g = (g + k) / 2;
|
|
d = (n + q) / 2;
|
|
c = (p + r) / 2;
|
|
var q = (q + e) / 2,
|
|
r = (r + g) / 2,
|
|
s = (d + q) / 2,
|
|
t = (c + r) / 2;
|
|
we(a, b, n, p, d, c, s, t, l, m);
|
|
we(s, t, q, r, e, g, h, k, l, m)
|
|
}
|
|
}
|
|
|
|
function xe(a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
|
|
var s = 1 - l;
|
|
a = a * s + c * l;
|
|
b = b * s + d * l;
|
|
c = c * s + e * l;
|
|
d = d * s + g * l;
|
|
e = e * s + h * l;
|
|
g = g * s + k * l;
|
|
k = a * s + c * l;
|
|
h = b * s + d * l;
|
|
c = c * s + e * l;
|
|
d = d * s + g * l;
|
|
m.x = a;
|
|
m.y = b;
|
|
n.x = k;
|
|
n.y = h;
|
|
p.x = k * s + c * l;
|
|
p.y = h * s + d * l;
|
|
q.x = c;
|
|
q.y = d;
|
|
r.x = e;
|
|
r.y = g
|
|
}
|
|
|
|
function ye(a, b, c, d, e, g, h, k, l, m) {
|
|
if (te(a, b, e, g, m, c, d)) return te(a, b, e, g, m, k, l);
|
|
var n = (a + c) / 2,
|
|
p = (b + d) / 2;
|
|
c = (c + e) / 2;
|
|
d = (d + g) / 2;
|
|
var q = (n + c) / 2,
|
|
r = (p + d) / 2;
|
|
return ye(a, b, n, p, q, r, h, k, l, m) || ye(q, r, c, d, e, g, h, k, l, m)
|
|
}
|
|
|
|
function ze(a, b, c, d, e, g, h, k) {
|
|
if (te(a, b, e, g, h, c, d)) Ib(k, a, b, 0, 0), Ib(k, e, g, 0, 0);
|
|
else {
|
|
var l = (a + c) / 2,
|
|
m = (b + d) / 2;
|
|
c = (c + e) / 2;
|
|
d = (d + g) / 2;
|
|
var n = (l + c) / 2,
|
|
p = (m + d) / 2;
|
|
ze(a, b, l, m, n, p, h, k);
|
|
ze(n, p, c, d, e, g, h, k)
|
|
}
|
|
}
|
|
|
|
function Je(a, b, c, d, e, g, h, k) {
|
|
if (te(a, b, e, g, h, c, d)) 0 === k.length && (k.push(a), k.push(b)), k.push(e), k.push(g);
|
|
else {
|
|
var l = (a + c) / 2,
|
|
m = (b + d) / 2;
|
|
c = (c + e) / 2;
|
|
d = (d + g) / 2;
|
|
var n = (l + c) / 2,
|
|
p = (m + d) / 2;
|
|
Je(a, b, l, m, n, p, h, k);
|
|
Je(n, p, c, d, e, g, h, k)
|
|
}
|
|
}
|
|
|
|
function Ke(a, b, c, d, e, g, h, k, l, m, n, p, q, r) {
|
|
0 >= q && (q = 1E-6);
|
|
if (te(a, b, h, k, q, c, d) && te(a, b, h, k, q, e, g)) {
|
|
var s = (a - h) * (m - p) - (b - k) * (l - n);
|
|
if (0 === s) return !1;
|
|
q = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / s;
|
|
s = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / s;
|
|
if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) {
|
|
if (h = l = 0, b < k ? (l = b, h = k) : (l = k, h = b), s < l || s > h) return !1
|
|
} else if (a < h ? l = a : (l = h, h = a), q < l || q > h) return !1;
|
|
r.x = q;
|
|
r.y = s;
|
|
return !0
|
|
}
|
|
var s = (a + c) / 2,
|
|
t = (b + d) / 2;
|
|
c = (c + e) / 2;
|
|
d = (d + g) / 2;
|
|
e = (e + h) / 2;
|
|
g = (g + k) / 2;
|
|
var v = (s + c) / 2,
|
|
x = (t + d) / 2;
|
|
c = (c + e) / 2;
|
|
d = (d + g) / 2;
|
|
var y = (v + c) / 2,
|
|
A = (x + d) / 2,
|
|
B = (n - l) * (n - l) + (p - m) * (p - m),
|
|
L = !1;
|
|
Ke(a, b, s, t, v, x, y, A, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B && (B = b, L = !0));
|
|
a = r.x;
|
|
s = r.y;
|
|
Ke(y, A, c, d, e, g, h, k, l, m, n, p, q, r) && (b = (r.x - l) * (r.x - l) + (r.y - m) * (r.y - m), b < B ? L = !0 : (r.x = a, r.y = s));
|
|
return L
|
|
}
|
|
|
|
function Le(a, b, c, d, e, g, h, k, l, m, n, p, q) {
|
|
var r = 0;
|
|
0 >= q && (q = 1E-6);
|
|
if (te(a, b, h, k, q, c, d) && te(a, b, h, k, q, e, g)) {
|
|
q = (a - h) * (m - p) - (b - k) * (l - n);
|
|
if (0 === q) return r;
|
|
var s = ((a * k - b * h) * (l - n) - (a - h) * (l * p - m * n)) / q,
|
|
t = ((a * k - b * h) * (m - p) - (b - k) * (l * p - m * n)) / q;
|
|
if (s >= n) return r;
|
|
if ((l > n ? l - n : n - l) < (m > p ? m - p : p - m)) {
|
|
if (a = l = 0, b < k ? (l = b, a = k) : (l = k, a = b), t < l || t > a) return r
|
|
} else if (a < h ? (l = a, a = h) : l = h, s < l || s > a) return r;
|
|
0 < q ? r++ : 0 > q && r--
|
|
} else {
|
|
var s = (a + c) / 2,
|
|
t = (b + d) / 2,
|
|
v = (c + e) / 2,
|
|
x = (d + g) / 2;
|
|
e = (e + h) / 2;
|
|
g = (g + k) / 2;
|
|
d = (s + v) / 2;
|
|
c = (t + x) / 2;
|
|
var v = (v + e) / 2,
|
|
x = (x + g) / 2,
|
|
y = (d + v) / 2,
|
|
A = (c + x) / 2,
|
|
r = r + Le(a, b, s, t, d, c, y, A, l, m, n, p, q),
|
|
r = r + Le(y, A, v, x, e, g, h, k, l, m, n, p, q)
|
|
}
|
|
return r
|
|
}
|
|
|
|
function ib(a, b, c, d, e, g, h) {
|
|
if (td(a, c)) {
|
|
var k = 0;
|
|
c = 0;
|
|
b < d ? (k = b, c = d) : (k = d, c = b);
|
|
d = g;
|
|
if (d < k) return h.x = a, h.y = k, !1;
|
|
if (d > c) return h.x = a, h.y = c, !1;
|
|
h.x = a;
|
|
h.y = d;
|
|
return !0
|
|
}
|
|
if (td(b, d)) {
|
|
a < c ? k = a : (k = c, c = a);
|
|
d = e;
|
|
if (d < k) return h.x = k, h.y = b, !1;
|
|
if (d > c) return h.x = c, h.y = b, !1;
|
|
h.x = d;
|
|
h.y = b;
|
|
return !0
|
|
}
|
|
k = ((a - e) * (a - c) + (b - g) * (b - d)) / ((c - a) * (c - a) + (d - b) * (d - b));
|
|
if (-5E-6 > k) return h.x = a, h.y = b, !1;
|
|
if (1.000005 < k) return h.x = c, h.y = d, !1;
|
|
h.x = a + k * (c - a);
|
|
h.y = b + k * (d - b);
|
|
return !0
|
|
}
|
|
|
|
function Me(a, b, c, d, e, g, h, k, l) {
|
|
if (eb(a, c) && eb(b, d)) return l.x = a, l.y = b, !1;
|
|
if (td(e, h)) {
|
|
if (td(a, c)) return ib(a, b, c, d, e, g, l), !1;
|
|
g = (d - b) / (c - a) * (e - a) + b;
|
|
return ib(a, b, c, d, e, g, l)
|
|
}
|
|
k = (k - g) / (h - e);
|
|
if (td(a, c)) {
|
|
g = k * (a - e) + g;
|
|
c = h = 0;
|
|
b < d ? (h = b, c = d) : (h = d, c = b);
|
|
if (g < h) return l.x = a, l.y = h, !1;
|
|
if (g > c) return l.x = a, l.y = c, !1;
|
|
l.x = a;
|
|
l.y = g;
|
|
return !0
|
|
}
|
|
h = (d - b) / (c - a);
|
|
if (td(k, h)) return ib(a, b, c, d, e, g, l), !1;
|
|
e = (h * a - k * e + g - b) / (h - k);
|
|
if (td(h, 0)) {
|
|
a < c ? h = a : (h = c, c = a);
|
|
if (e < h) return l.x = h, l.y = b, !1;
|
|
if (e > c) return l.x = c, l.y = b, !1;
|
|
l.x = e;
|
|
l.y = b;
|
|
return !0
|
|
}
|
|
g =
|
|
h * (e - a) + b;
|
|
return ib(a, b, c, d, e, g, l)
|
|
}
|
|
|
|
function Ne(a, b, c, d, e, g, h, k, l) {
|
|
var m = 1E21,
|
|
n = a,
|
|
p = b;
|
|
if (Me(a, b, a, d, e, g, h, k, l)) {
|
|
var q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g);
|
|
q < m && (m = q, n = l.x, p = l.y)
|
|
}
|
|
Me(c, b, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
|
|
Me(a, b, c, b, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
|
|
Me(a, d, c, d, e, g, h, k, l) && (q = (l.x - e) * (l.x - e) + (l.y - g) * (l.y - g), q < m && (m = q, n = l.x, p = l.y));
|
|
l.x = n;
|
|
l.y = p;
|
|
return 1E21 > m
|
|
}
|
|
|
|
function Oe(a, b, c, d, e, g, h, k, l) {
|
|
c = a - c;
|
|
var m = e - h,
|
|
n = h = 0;
|
|
0 === c || 0 === m ? 0 === c ? (k = (g - k) / m, h = a, n = k * h + (g - k * e)) : (d = (b - d) / c, h = e, n = d * h + (b - d * a)) : (d = (b - d) / c, k = (g - k) / m, a = b - d * a, h = (g - k * e - a) / (d - k), n = d * h + a);
|
|
l.n(h, n);
|
|
return l
|
|
}
|
|
|
|
function Pe(a, b, c) {
|
|
var d = b.x,
|
|
e = b.y,
|
|
g = c.x,
|
|
h = c.y,
|
|
k = a.left,
|
|
l = a.right,
|
|
m = a.top,
|
|
n = a.bottom;
|
|
return d === g ? (g = a = 0, e < h ? (a = e, g = h) : (a = h, g = e), k <= d && d <= l && a <= n && g >= m) : e === h ? (d < g ? a = d : (a = g, g = d), m <= e && e <= n && a <= l && g >= k) : a.Ma(b) || a.Ma(c) || bf(k, m, l, m, d, e, g, h) || bf(l, m, l, n, d, e, g, h) || bf(l, n, k, n, d, e, g, h) || bf(k, n, k, m, d, e, g, h) ? !0 : !1
|
|
}
|
|
|
|
function bf(a, b, c, d, e, g, h, k) {
|
|
return 0 >= cf(a, b, c, d, e, g) * cf(a, b, c, d, h, k) && 0 >= cf(e, g, h, k, a, b) * cf(e, g, h, k, c, d)
|
|
}
|
|
|
|
function cf(a, b, c, d, e, g) {
|
|
c -= a;
|
|
d -= b;
|
|
a = e - a;
|
|
b = g - b;
|
|
g = a * d - b * c;
|
|
0 === g && (g = a * c + b * d, 0 < g && (g = (a - c) * c + (b - d) * d, 0 > g && (g = 0)));
|
|
return 0 > g ? -1 : 0 < g ? 1 : 0
|
|
}
|
|
|
|
function df(a) {
|
|
0 > a && (a += 360);
|
|
360 <= a && (a -= 360);
|
|
return a
|
|
}
|
|
|
|
function ef(a, b, c, d) {
|
|
var e = Math.PI;
|
|
d || (b *= e / 180, c *= e / 180);
|
|
d = b < c ? 1 : -1;
|
|
var g = [],
|
|
h = e / 2,
|
|
k = b;
|
|
for (b = Math.min(2 * e, Math.abs(c - b)); 1E-5 < b;) {
|
|
c = k + d * Math.min(b, h);
|
|
var e = (c - k) / 2,
|
|
l = a * Math.cos(e),
|
|
m = a * Math.sin(e),
|
|
n = -m,
|
|
p = l * l + n * n,
|
|
q = p + l * l + n * m,
|
|
p = 4 / 3 * (Math.sqrt(2 * p * q) - q) / (l * m - n * l),
|
|
m = l - p * n,
|
|
l = n + p * l,
|
|
n = -l,
|
|
p = e + k,
|
|
e = Math.cos(p),
|
|
p = Math.sin(p);
|
|
g.push([0 + a * Math.cos(k), 0 + a * Math.sin(k), 0 + m * e - l * p, 0 + m * p + l * e, 0 + m * e - n * p, 0 + m * p + n * e, 0 + a * Math.cos(c), 0 + a * Math.sin(c)]);
|
|
b -= Math.abs(c - k);
|
|
k = c
|
|
}
|
|
return g
|
|
}
|
|
|
|
function jb(a, b, c, d, e, g, h) {
|
|
c = Math.floor((a - c) / e) * e + c;
|
|
d = Math.floor((b - d) / g) * g + d;
|
|
var k = c;
|
|
c + e - a < e / 2 && (k = c + e);
|
|
a = d;
|
|
d + g - b < g / 2 && (a = d + g);
|
|
h.n(k, a)
|
|
}
|
|
|
|
function ff(a, b) {
|
|
var c = Math.max(a, b),
|
|
d = Math.min(a, b),
|
|
e = 1,
|
|
g = 1;
|
|
do e = c % d, c = g = d, d = e; while (0 < e);
|
|
return g
|
|
}
|
|
|
|
function gf(a, b, c, d) {
|
|
var e = 0 > c,
|
|
g = 0 > d,
|
|
h = 0,
|
|
k = h = 0;
|
|
a < b ? (h = 1, k = 0) : (h = 0, k = 1);
|
|
var l = 0,
|
|
m = 0,
|
|
n = 0,
|
|
p = 0,
|
|
l = 0 === h ? a : b,
|
|
n = 0 === h ? c : d;
|
|
if (0 === h ? e : g) n = -n;
|
|
h = k;
|
|
m = 0 === h ? a : b;
|
|
p = 0 === h ? c : d;
|
|
if (0 === h ? e : g) p = -p;
|
|
a = a = 0;
|
|
if (0 < p)
|
|
if (0 < n) {
|
|
b = l * l;
|
|
a = m * m;
|
|
l *= n;
|
|
c = m * p;
|
|
d = -a + c;
|
|
e = -a + Math.sqrt(l * l + c * c);
|
|
m = d;
|
|
for (g = 0; 9999999999 > g; ++g) {
|
|
m = .5 * (d + e);
|
|
if (m === d || m === e) break;
|
|
k = l / (m + b);
|
|
h = c / (m + a);
|
|
k = k * k + h * h - 1;
|
|
if (0 < k) d = m;
|
|
else if (0 > k) e = m;
|
|
else break
|
|
}
|
|
n = b * n / (m + b) - n;
|
|
p = a * p / (m + a) - p;
|
|
a = Math.sqrt(n * n + p * p)
|
|
} else a = Math.abs(p - m);
|
|
else p = l * l - m * m, a = l * n, a < p ? (p = a / p, a = m * Math.sqrt(Math.abs(1 -
|
|
p * p)), n = l * p - n, a = Math.sqrt(n * n + a * a)) : a = Math.abs(n - l);
|
|
return a
|
|
}
|
|
|
|
function hf(a) {
|
|
1 < arguments.length && z.k("Geometry constructor can take at most one optional argument, the Geometry type.");
|
|
z.kc(this);
|
|
this.G = !1;
|
|
void 0 === a ? a = jf : u && z.Ba(a, hf, hf, "constructor:type");
|
|
this.ba = a;
|
|
this.Gb = this.zb = this.Cc = this.xc = 0;
|
|
this.Cj = new J(kf);
|
|
this.mv = this.Cj.H;
|
|
this.Xu = (new w).freeze();
|
|
this.ib = !0;
|
|
this.bi = Zb;
|
|
this.ci = ic;
|
|
this.po = this.ro = NaN;
|
|
this.Bi = lf
|
|
}
|
|
z.ia("Geometry", hf);
|
|
z.ii(hf);
|
|
hf.prototype.copy = function() {
|
|
var a = new hf;
|
|
a.ba = this.ba;
|
|
a.xc = this.xc;
|
|
a.Cc = this.Cc;
|
|
a.zb = this.zb;
|
|
a.Gb = this.Gb;
|
|
for (var b = this.Cj.o, c = b.length, d = a.Cj, e = 0; e < c; e++) {
|
|
var g = b[e].copy();
|
|
d.add(g)
|
|
}
|
|
a.mv = this.mv;
|
|
a.Xu.assign(this.Xu);
|
|
a.ib = this.ib;
|
|
a.bi = this.bi.V();
|
|
a.ci = this.ci.V();
|
|
a.ro = this.ro;
|
|
a.po = this.po;
|
|
a.Bi = this.Bi;
|
|
return a
|
|
};
|
|
var mf;
|
|
hf.Line = mf = z.s(hf, "Line", 0);
|
|
var nf;
|
|
hf.Rectangle = nf = z.s(hf, "Rectangle", 1);
|
|
var of;
|
|
hf.Ellipse = of = z.s(hf, "Ellipse", 2);
|
|
var jf;
|
|
hf.Path = jf = z.s(hf, "Path", 3);
|
|
hf.prototype.La = function() {
|
|
this.freeze();
|
|
Object.freeze(this);
|
|
return this
|
|
};
|
|
hf.prototype.freeze = function() {
|
|
this.G = !0;
|
|
var a = this.cc;
|
|
a.freeze();
|
|
for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].freeze();
|
|
return this
|
|
};
|
|
hf.prototype.Wa = function() {
|
|
Object.isFrozen(this) && z.k("cannot thaw constant: " + this);
|
|
this.G = !1;
|
|
var a = this.cc;
|
|
a.Wa();
|
|
for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Wa();
|
|
return this
|
|
};
|
|
hf.prototype.equalsApprox = hf.prototype.Mc = function(a) {
|
|
if (!(a instanceof hf)) return !1;
|
|
if (this.type !== a.type) return this.type === mf && a.type === jf ? pf(this, a) : a.type === mf && this.type === jf ? pf(a, this) : !1;
|
|
if (this.type === jf) {
|
|
var b = this.cc.o;
|
|
a = a.cc.o;
|
|
var c = b.length;
|
|
if (c !== a.length) return !1;
|
|
for (var d = 0; d < c; d++)
|
|
if (!b[d].Mc(a[d])) return !1;
|
|
return !0
|
|
}
|
|
return eb(this.Ha, a.Ha) && eb(this.Da, a.Da) && eb(this.L, a.L) && eb(this.M, a.M)
|
|
};
|
|
|
|
function pf(a, b) {
|
|
if (a.type !== mf || b.type !== jf) return !1;
|
|
if (1 === b.cc.count) {
|
|
var c = b.cc.ea(0);
|
|
if (1 === c.Ab.count && eb(a.Ha, c.Ha) && eb(a.Da, c.Da) && (c = c.Ab.ea(0), c.type === qf && eb(a.L, c.L) && eb(a.M, c.M))) return !0
|
|
}
|
|
return !1
|
|
}
|
|
var rf;
|
|
hf.stringify = rf = function(a) {
|
|
return a.toString()
|
|
};
|
|
hf.prototype.toString = function(a) {
|
|
void 0 === a && (a = -1);
|
|
switch (this.type) {
|
|
case mf:
|
|
return 0 > a ? "M" + this.Ha.toString() + " " + this.Da.toString() + "L" + this.L.toString() + " " + this.M.toString() : "M" + this.Ha.toFixed(a) + " " + this.Da.toFixed(a) + "L" + this.L.toFixed(a) + " " + this.M.toFixed(a);
|
|
case nf:
|
|
var b = new w(this.Ha, this.Da, 0, 0);
|
|
b.dG(this.L, this.M, 0, 0);
|
|
return 0 > a ? "M" + b.x.toString() + " " + b.y.toString() + "H" + b.right.toString() + "V" + b.bottom.toString() + "H" + b.left.toString() + "z" : "M" + b.x.toFixed(a) + " " + b.y.toFixed(a) + "H" + b.right.toFixed(a) +
|
|
"V" + b.bottom.toFixed(a) + "H" + b.left.toFixed(a) + "z";
|
|
case of:
|
|
b = new w(this.Ha, this.Da, 0, 0);
|
|
b.dG(this.L, this.M, 0, 0);
|
|
if (0 > a) {
|
|
var c = b.left.toString() + " " + (b.y + b.height / 2).toString(),
|
|
d = b.right.toString() + " " + (b.y + b.height / 2).toString();
|
|
return "M" + c + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + d + "A" + (b.width / 2).toString() + " " + (b.height / 2).toString() + " 0 0 1 " + c
|
|
}
|
|
c = b.left.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a);
|
|
d = b.right.toFixed(a) + " " + (b.y + b.height / 2).toFixed(a);
|
|
return "M" + c + "A" + (b.width /
|
|
2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + d + "A" + (b.width / 2).toFixed(a) + " " + (b.height / 2).toFixed(a) + " 0 0 1 " + c;
|
|
case jf:
|
|
for (var b = "", c = this.cc.o, d = c.length, e = 0; e < d; e++) {
|
|
var g = c[e];
|
|
0 < e && (b += " x ");
|
|
g.Ot && (b += "F ");
|
|
b += g.toString(a)
|
|
}
|
|
return b;
|
|
default:
|
|
return this.type.toString()
|
|
}
|
|
};
|
|
hf.fillPath = function(a) {
|
|
"string" !== typeof a && z.ic(a, "string", hf, "fillPath:str");
|
|
a = a.split(/[Xx]/);
|
|
for (var b = a.length, c = "", d = 0; d < b; d++) var e = a[d],
|
|
c = null !== e.match(/[Ff]/) ? 0 === d ? c + e : c + ("X" + (" " === e[0] ? "" : " ") + e) : c + ((0 === d ? "" : "X ") + "F" + (" " === e[0] ? "" : " ") + e);
|
|
return c
|
|
};
|
|
var sf;
|
|
hf.parse = sf = function(a, b) {
|
|
function c() {
|
|
return m >= t - 1 ? !0 : null !== l[m + 1].match(/[A-Za-z]/)
|
|
}
|
|
|
|
function d() {
|
|
m++;
|
|
return l[m]
|
|
}
|
|
|
|
function e() {
|
|
var a = new N(parseFloat(d()), parseFloat(d()));
|
|
n === n.toLowerCase() && (a.x = s.x + a.x, a.y = s.y + a.y);
|
|
return a
|
|
}
|
|
|
|
function g() {
|
|
return s = e()
|
|
}
|
|
|
|
function h() {
|
|
return r = e()
|
|
}
|
|
|
|
function k() {
|
|
return "c" !== p.toLowerCase() && "s" !== p.toLowerCase() ? s : new N(2 * s.x - r.x, 2 * s.y - r.y)
|
|
}
|
|
void 0 === b && (b = !1);
|
|
"string" !== typeof a && z.ic(a, "string", hf, "parse:str");
|
|
a = a.replace(/,/gm, " ");
|
|
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm,
|
|
"$1 $2");
|
|
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2");
|
|
a = a.replace(/([UuBbMmZzLlHhVvCcSsQqTtAaFf])([^\s])/gm, "$1 $2");
|
|
a = a.replace(/([^\s])([UuBbMmZzLlHhVvCcSsQqTtAaFf])/gm, "$1 $2");
|
|
a = a.replace(/([0-9])([+\-])/gm, "$1 $2");
|
|
a = a.replace(/(\.[0-9]*)(\.)/gm, "$1 $2");
|
|
a = a.replace(/([Aa](\s+[0-9]+){3})\s+([01])\s*([01])/gm, "$1 $3 $4 ");
|
|
a = a.replace(/[\s\r\t\n]+/gm, " ");
|
|
a = a.replace(/^\s+|\s+$/g, "");
|
|
for (var l = a.split(" "), m = -1, n = "", p = "", q = new N(0, 0), r = new N(0, 0), s = new N(0,
|
|
0), t = l.length, v = z.v(), x = !1, y = !1, A = !0; !(m >= t - 1);)
|
|
if (p = n, n = d(), "" !== n) switch (n.toUpperCase()) {
|
|
case "X":
|
|
A = !0;
|
|
y = x = !1;
|
|
break;
|
|
case "M":
|
|
var B = g();
|
|
null === v.$b || !0 === A ? (R(v, B.x, B.y, x, !1, !y), A = !1) : v.moveTo(B.x, B.y);
|
|
for (q = s; !c();) B = g(), v.lineTo(B.x, B.y);
|
|
break;
|
|
case "L":
|
|
for (; !c();) B = g(), v.lineTo(B.x, B.y);
|
|
break;
|
|
case "H":
|
|
for (; !c();) s = B = new N((n === n.toLowerCase() ? s.x : 0) + parseFloat(d()), s.y), v.lineTo(s.x, s.y);
|
|
break;
|
|
case "V":
|
|
for (; !c();) s = B = new N(s.x, (n === n.toLowerCase() ? s.y : 0) + parseFloat(d())), v.lineTo(s.x, s.y);
|
|
break;
|
|
case "C":
|
|
for (; !c();) {
|
|
var L = e(),
|
|
H = h(),
|
|
B = g();
|
|
S(v, L.x, L.y, H.x, H.y, B.x, B.y)
|
|
}
|
|
break;
|
|
case "S":
|
|
for (; !c();) L = k(), H = h(), B = g(), S(v, L.x, L.y, H.x, H.y, B.x, B.y);
|
|
break;
|
|
case "Q":
|
|
for (; !c();) H = h(), B = g(), yf(v, H.x, H.y, B.x, B.y);
|
|
break;
|
|
case "T":
|
|
for (; !c();) r = H = k(), B = g(), yf(v, H.x, H.y, B.x, B.y);
|
|
break;
|
|
case "B":
|
|
for (; !c();) {
|
|
var B = parseFloat(d()),
|
|
L = parseFloat(d()),
|
|
H = parseFloat(d()),
|
|
U = parseFloat(d()),
|
|
ea = parseFloat(d()),
|
|
W = ea,
|
|
P = !1;
|
|
c() || (W = parseFloat(d()), c() || (P = 0 !== parseFloat(d())));
|
|
n === n.toLowerCase() && (H += s.x, U += s.y);
|
|
v.arcTo(B, L,
|
|
H, U, ea, W, P)
|
|
}
|
|
break;
|
|
case "A":
|
|
for (; !c();) L = Math.abs(parseFloat(d())), H = Math.abs(parseFloat(d())), U = parseFloat(d()), ea = !!parseFloat(d()), W = !!parseFloat(d()), B = g(), zf(v, L, H, U, ea, W, B.x, B.y);
|
|
break;
|
|
case "Z":
|
|
B = v.q.cc.o[v.q.cc.length - 1];
|
|
T(v);
|
|
s = q;
|
|
break;
|
|
case "F":
|
|
B = "";
|
|
for (L = 1; l[m + L];)
|
|
if (null !== l[m + L].match(/[Uu]/)) L++;
|
|
else if (null === l[m + L].match(/[A-Za-z]/)) L++;
|
|
else {
|
|
B = l[m + L];
|
|
break
|
|
}
|
|
B.match(/[Mm]/) ? x = !0 : Af(v);
|
|
break;
|
|
case "U":
|
|
B = "";
|
|
for (L = 1; l[m + L];)
|
|
if (null !== l[m + L].match(/[Ff]/)) L++;
|
|
else if (null === l[m + L].match(/[A-Za-z]/)) L++;
|
|
else {
|
|
B = l[m + L];
|
|
break
|
|
}
|
|
B.match(/[Mm]/) ? y = !0 : v.gb(!1)
|
|
}
|
|
q = v.q;
|
|
z.u(v);
|
|
if (b)
|
|
for (v = q.cc.i; v.next();) B = v.value, B.Ot = !0;
|
|
return q
|
|
};
|
|
|
|
function Bf(a, b) {
|
|
for (var c = a.length, d = z.O(), e = 0; e < c; e++) {
|
|
var g = a[e];
|
|
d.x = g[0];
|
|
d.y = g[1];
|
|
b.Cb(d);
|
|
g[0] = d.x;
|
|
g[1] = d.y;
|
|
d.x = g[2];
|
|
d.y = g[3];
|
|
b.Cb(d);
|
|
g[2] = d.x;
|
|
g[3] = d.y;
|
|
d.x = g[4];
|
|
d.y = g[5];
|
|
b.Cb(d);
|
|
g[4] = d.x;
|
|
g[5] = d.y;
|
|
d.x = g[6];
|
|
d.y = g[7];
|
|
b.Cb(d);
|
|
g[6] = d.x;
|
|
g[7] = d.y
|
|
}
|
|
z.A(d)
|
|
}
|
|
hf.prototype.iA = function() {
|
|
if (this.ib || this.mv !== this.cc.H) return !0;
|
|
for (var a = this.cc.o, b = a.length, c = 0; c < b; c++)
|
|
if (a[c].iA()) return !0;
|
|
return !1
|
|
};
|
|
hf.prototype.eB = function() {
|
|
this.ib = !1;
|
|
this.mv = this.cc.H;
|
|
for (var a = this.cc.o, b = a.length, c = 0; c < b; c++) a[c].eB()
|
|
};
|
|
hf.prototype.rh = function() {
|
|
var a = this.Xu;
|
|
a.Wa();
|
|
isNaN(this.ro) || isNaN(this.po) ? a.n(0, 0, 0, 0) : a.n(0, 0, this.ro, this.po);
|
|
Cf(this, a, !1);
|
|
Ib(a, 0, 0, 0, 0);
|
|
a.freeze()
|
|
};
|
|
hf.prototype.computeBoundsWithoutOrigin = hf.prototype.fH = function() {
|
|
var a = new w;
|
|
Cf(this, a, !0);
|
|
return a
|
|
};
|
|
|
|
function Cf(a, b, c) {
|
|
switch (a.type) {
|
|
case mf:
|
|
case nf:
|
|
case of:
|
|
c ? b.n(a.xc, a.Cc, 0, 0) : Ib(b, a.xc, a.Cc, 0, 0);
|
|
Ib(b, a.zb, a.Gb, 0, 0);
|
|
break;
|
|
case jf:
|
|
var d = a.cc;
|
|
a = d.o;
|
|
for (var d = d.length, e = 0; e < d; e++) {
|
|
var g = a[e];
|
|
c && 0 === e ? b.n(g.Ha, g.Da, 0, 0) : Ib(b, g.Ha, g.Da, 0, 0);
|
|
for (var h = g.Ab.o, k = h.length, l = g.Ha, m = g.Da, n = 0; n < k; n++) {
|
|
var p = h[n];
|
|
switch (p.type) {
|
|
case qf:
|
|
case Df:
|
|
l = p.L;
|
|
m = p.M;
|
|
Ib(b, l, m, 0, 0);
|
|
break;
|
|
case Ef:
|
|
ve(l, m, p.zc, p.Qc, p.Ah, p.Bh, p.L, p.M, .5, b);
|
|
l = p.L;
|
|
m = p.M;
|
|
break;
|
|
case Ff:
|
|
ze(l, m, p.zc, p.Qc, p.L, p.M, .5, b);
|
|
l = p.L;
|
|
m = p.M;
|
|
break;
|
|
case Gf:
|
|
case Hf:
|
|
var q =
|
|
p.type === Gf ? If(p, g) : Jf(p, g, l, m),
|
|
r = q.length;
|
|
if (0 === r) {
|
|
l = p.ra;
|
|
m = p.za;
|
|
Ib(b, l, m, 0, 0);
|
|
break
|
|
}
|
|
for (var p = null, s = 0; s < r; s++) p = q[s], ve(p[0], p[1], p[2], p[3], p[4], p[5], p[6], p[7], .5, b);
|
|
null !== p && (l = p[6], m = p[7]);
|
|
break;
|
|
default:
|
|
z.k("Unknown Segment type: " + p.type)
|
|
}
|
|
}
|
|
}
|
|
break;
|
|
default:
|
|
z.k("Unknown Geometry type: " + a.type)
|
|
}
|
|
}
|
|
hf.prototype.normalize = hf.prototype.normalize = function() {
|
|
this.G && z.oa(this);
|
|
var a = this.fH();
|
|
this.offset(-a.x, -a.y);
|
|
return new N(-a.x, -a.y)
|
|
};
|
|
hf.prototype.offset = hf.prototype.offset = function(a, b) {
|
|
this.G && z.oa(this);
|
|
u && (z.p(a, hf, "offset"), z.p(b, hf, "offset"));
|
|
this.transform(1, 0, 0, 1, a, b);
|
|
return this
|
|
};
|
|
hf.prototype.scale = hf.prototype.scale = function(a, b) {
|
|
this.G && z.oa(this);
|
|
u && (z.p(a, hf, "scale:x"), z.p(b, hf, "scale:y"), 0 === a && z.ka(a, "scale must be non-zero", hf, "scale:x"), 0 === b && z.ka(b, "scale must be non-zero", hf, "scale:y"));
|
|
this.transform(a, 0, 0, b, 0, 0);
|
|
return this
|
|
};
|
|
hf.prototype.rotate = hf.prototype.rotate = function(a, b, c) {
|
|
this.G && z.oa(this);
|
|
void 0 === b && (b = 0);
|
|
void 0 === c && (c = 0);
|
|
u && (z.p(a, hf, "rotate:angle"), z.p(b, hf, "rotate:x"), z.p(c, hf, "rotate:y"));
|
|
var d = z.Fh();
|
|
d.reset();
|
|
d.rotate(a, b, c);
|
|
this.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
|
|
z.jf(d);
|
|
return this
|
|
};
|
|
hf.prototype.transform = hf.prototype.transform = function(a, b, c, d, e, g) {
|
|
var h = 0,
|
|
k = 0;
|
|
switch (this.type) {
|
|
case mf:
|
|
case nf:
|
|
case of:
|
|
h = this.xc;
|
|
k = this.Cc;
|
|
this.xc = h * a + k * c + e;
|
|
this.Cc = h * b + k * d + g;
|
|
h = this.zb;
|
|
k = this.Gb;
|
|
this.zb = h * a + k * c + e;
|
|
this.Gb = h * b + k * d + g;
|
|
break;
|
|
case jf:
|
|
for (var l = this.cc.o, m = l.length, n = 0; n < m; n++) {
|
|
var p = l[n],
|
|
h = p.Ha,
|
|
k = p.Da;
|
|
p.Ha = h * a + k * c + e;
|
|
p.Da = h * b + k * d + g;
|
|
for (var p = p.Ab.o, q = p.length, r = 0; r < q; r++) {
|
|
var s = p[r];
|
|
switch (s.type) {
|
|
case qf:
|
|
case Df:
|
|
h = s.L;
|
|
k = s.M;
|
|
s.L = h * a + k * c + e;
|
|
s.M = h * b + k * d + g;
|
|
break;
|
|
case Ef:
|
|
h = s.zc;
|
|
k = s.Qc;
|
|
s.zc =
|
|
h * a + k * c + e;
|
|
s.Qc = h * b + k * d + g;
|
|
h = s.Ah;
|
|
k = s.Bh;
|
|
s.Ah = h * a + k * c + e;
|
|
s.Bh = h * b + k * d + g;
|
|
h = s.L;
|
|
k = s.M;
|
|
s.L = h * a + k * c + e;
|
|
s.M = h * b + k * d + g;
|
|
break;
|
|
case Ff:
|
|
h = s.zc;
|
|
k = s.Qc;
|
|
s.zc = h * a + k * c + e;
|
|
s.Qc = h * b + k * d + g;
|
|
h = s.L;
|
|
k = s.M;
|
|
s.L = h * a + k * c + e;
|
|
s.M = h * b + k * d + g;
|
|
break;
|
|
case Gf:
|
|
h = s.ra;
|
|
k = s.za;
|
|
s.ra = h * a + k * c + e;
|
|
s.za = h * b + k * d + g;
|
|
0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.Fe += h);
|
|
0 > a && (s.Fe = 180 - s.Fe, s.Lf = -s.Lf);
|
|
0 > d && (s.Fe = -s.Fe, s.Lf = -s.Lf);
|
|
s.radiusX *= Math.sqrt(a * a + c * c);
|
|
void 0 !== s.radiusY && (s.radiusY *= Math.sqrt(b * b + d * d));
|
|
break;
|
|
case Hf:
|
|
h = s.L;
|
|
k = s.M;
|
|
s.L = h *
|
|
a + k * c + e;
|
|
s.M = h * b + k * d + g;
|
|
0 !== b && (h = 180 * Math.atan2(b, a) / Math.PI, 0 > h && (h += 360), s.wj += h);
|
|
0 > a && (s.wj = 180 - s.wj, s.Ol = !s.Ol);
|
|
0 > d && (s.wj = -s.wj, s.Ol = !s.Ol);
|
|
s.radiusX *= Math.sqrt(a * a + c * c);
|
|
s.radiusY *= Math.sqrt(b * b + d * d);
|
|
break;
|
|
default:
|
|
z.k("Unknown Segment type: " + s.type)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
this.ib = !0;
|
|
return this
|
|
};
|
|
hf.prototype.Ma = function(a, b, c, d) {
|
|
var e = a.x,
|
|
g = a.y,
|
|
h = this.vb.x - 20;
|
|
a = a.y;
|
|
for (var k = 0, l = 0, m = 0, n = 0, p = 0, q = 0, r = this.cc.o, s = r.length, t = 0; t < s; t++) {
|
|
var v = r[t];
|
|
if (v.Ot) {
|
|
if (c && v.Ma(e, g, b)) return !0;
|
|
for (var x = v.Ab, l = v.Ha, m = v.Da, y = l, A = m, B = x.o, L = 0; L <= x.length; L++) {
|
|
var H, U;
|
|
L !== x.length ? (H = B[L], U = H.type, p = H.L, q = H.M) : (U = qf, p = y, q = A);
|
|
switch (U) {
|
|
case Df:
|
|
n = Kf(e, g, h, a, l, m, y, A);
|
|
if (isNaN(n)) return !0;
|
|
k += n;
|
|
y = p;
|
|
A = q;
|
|
break;
|
|
case qf:
|
|
n = Kf(e, g, h, a, l, m, p, q);
|
|
if (isNaN(n)) return !0;
|
|
k += n;
|
|
break;
|
|
case Ef:
|
|
n = Le(l, m, H.zc, H.Qc, H.Ah, H.Bh, p, q, h,
|
|
a, e, g, .5);
|
|
k += n;
|
|
break;
|
|
case Ff:
|
|
n = Le(l, m, (l + 2 * H.zc) / 3, (m + 2 * H.Qc) / 3, (2 * H.zc + p) / 3, (2 * H.Qc + q) / 3, p, q, h, a, e, g, .5);
|
|
k += n;
|
|
break;
|
|
case Gf:
|
|
case Hf:
|
|
U = H.type === Gf ? If(H, v) : Jf(H, v, l, m);
|
|
var ea = U.length;
|
|
if (0 === ea) {
|
|
n = Kf(e, g, h, a, l, m, H.ra, H.za);
|
|
if (isNaN(n)) return !0;
|
|
k += n;
|
|
break
|
|
}
|
|
for (var W = null, P = 0; P < ea; P++) {
|
|
W = U[P];
|
|
if (0 === P) {
|
|
n = Kf(e, g, h, a, l, m, W[0], W[1]);
|
|
if (isNaN(n)) return !0;
|
|
k += n
|
|
}
|
|
n = Le(W[0], W[1], W[2], W[3], W[4], W[5], W[6], W[7], h, a, e, g, .5);
|
|
k += n
|
|
}
|
|
null !== W && (p = W[6], q = W[7]);
|
|
break;
|
|
default:
|
|
z.k("Unknown Segment type: " + H.type)
|
|
}
|
|
l = p;
|
|
m = q
|
|
}
|
|
if (0 !==
|
|
k) return !0;
|
|
k = 0
|
|
} else if (v.Ma(e, g, d ? b : b + 2)) return !0
|
|
}
|
|
return 0 !== k
|
|
};
|
|
|
|
function Kf(a, b, c, d, e, g, h, k) {
|
|
if (te(e, g, h, k, .05, a, b)) return NaN;
|
|
var l = (a - c) * (g - k);
|
|
if (0 === l) return 0;
|
|
var m = ((a * d - b * c) * (e - h) - (a - c) * (e * k - g * h)) / l;
|
|
b = (a * d - b * c) * (g - k) / l;
|
|
if (m >= a) return 0;
|
|
if ((e > h ? e - h : h - e) < (g > k ? g - k : k - g)) {
|
|
if (e = a = 0, g < k ? (a = g, e = k) : (a = k, e = g), b < a || b > e) return 0
|
|
} else if (e < h ? (a = e, e = h) : a = h, m < a || m > e) return 0;
|
|
return 0 < l ? 1 : -1
|
|
}
|
|
|
|
function Nf(a, b, c, d) {
|
|
a = a.cc.o;
|
|
for (var e = a.length, g = 0; g < e; g++)
|
|
if (a[g].Ma(b, c, d)) return !0;
|
|
return !1
|
|
}
|
|
hf.prototype.getPointAlongPath = function(a) {
|
|
(0 > a || 1 < a) && z.ka(a, "0 <= fraction <= 1", hf, "getPointAlongPath:fraction");
|
|
var b = this.cc.first(),
|
|
c = z.rb(),
|
|
d = [];
|
|
d.push(b.Ha);
|
|
d.push(b.Da);
|
|
for (var e = b.Ha, g = b.Da, h = e, k = g, l = b.Ab.o, m = l.length, n = 0; n < m; n++) {
|
|
var p = l[n];
|
|
switch (p.ba) {
|
|
case Df:
|
|
c.push(d);
|
|
d = [];
|
|
d.push(p.L);
|
|
d.push(p.M);
|
|
e = p.L;
|
|
g = p.M;
|
|
h = e;
|
|
k = g;
|
|
break;
|
|
case qf:
|
|
d.push(p.L);
|
|
d.push(p.M);
|
|
e = p.L;
|
|
g = p.M;
|
|
break;
|
|
case Ef:
|
|
we(e, g, p.Cd, p.Ne, p.mh, p.yg, p.zb, p.Gb, .5, d);
|
|
e = p.L;
|
|
g = p.M;
|
|
break;
|
|
case Ff:
|
|
Je(e, g, p.Cd, p.Ne, p.zb, p.Gb, .5, d);
|
|
e = p.L;
|
|
g = p.M;
|
|
break;
|
|
case Gf:
|
|
var q = If(p, b),
|
|
r = q.length;
|
|
if (0 === r) {
|
|
d.push(p.ra);
|
|
d.push(p.za);
|
|
e = p.ra;
|
|
g = p.za;
|
|
break
|
|
}
|
|
for (var s = 0; s < r; s++) {
|
|
var t = q[s];
|
|
we(e, g, t[2], t[3], t[4], t[5], t[6], t[7], .5, d);
|
|
e = t[6];
|
|
g = t[7]
|
|
}
|
|
break;
|
|
case Hf:
|
|
q = Jf(p, b, e, g);
|
|
r = q.length;
|
|
for (s = 0; s < r; s++) t = q[s], we(e, g, t[2], t[3], t[4], t[5], t[6], t[7], .5, d), e = t[6], g = t[7];
|
|
break;
|
|
default:
|
|
z.k("Segment not of valid type")
|
|
}
|
|
p.Rh && (d.push(h), d.push(k))
|
|
}
|
|
c.push(d);
|
|
q = 0;
|
|
h = c.length;
|
|
for (k = d = b = 0; k < h; k++)
|
|
for (l = c[k], m = l.length, n = 0; n < m; n += 2) e = l[n], g = l[n + 1], 0 !== n && (p = Math.sqrt(wb(b,
|
|
d, e, g)), q += p), b = e, d = g;
|
|
a *= q;
|
|
for (k = q = 0; k < h; k++)
|
|
for (l = c[k], m = l.length, n = 0; n < m; n++) {
|
|
e = l[n];
|
|
g = l[n + 1];
|
|
if (0 !== n) {
|
|
p = Math.sqrt(wb(b, d, e, g));
|
|
if (q + p > a) return n = (a - q) / p, z.xa(c), new N(b + (e - b) * n, d + (g - d) * n);
|
|
q += p
|
|
}
|
|
b = e;
|
|
d = g
|
|
}
|
|
z.xa(c);
|
|
return null
|
|
};
|
|
z.defineProperty(hf, {
|
|
type: "type"
|
|
}, function() {
|
|
return this.ba
|
|
}, function(a) {
|
|
this.ba !== a && (u && z.Ba(a, hf, hf, "type"), this.G && z.oa(this, a), this.ba = a, this.ib = !0)
|
|
});
|
|
z.defineProperty(hf, {
|
|
Ha: "startX"
|
|
}, function() {
|
|
return this.xc
|
|
}, function(a) {
|
|
this.xc !== a && (u && z.p(a, hf, "startX"), this.G && z.oa(this, a), this.xc = a, this.ib = !0)
|
|
});
|
|
z.defineProperty(hf, {
|
|
Da: "startY"
|
|
}, function() {
|
|
return this.Cc
|
|
}, function(a) {
|
|
this.Cc !== a && (u && z.p(a, hf, "startY"), this.G && z.oa(this, a), this.Cc = a, this.ib = !0)
|
|
});
|
|
z.defineProperty(hf, {
|
|
L: "endX"
|
|
}, function() {
|
|
return this.zb
|
|
}, function(a) {
|
|
this.zb !== a && (u && z.p(a, hf, "endX"), this.G && z.oa(this, a), this.zb = a, this.ib = !0)
|
|
});
|
|
z.defineProperty(hf, {
|
|
M: "endY"
|
|
}, function() {
|
|
return this.Gb
|
|
}, function(a) {
|
|
this.Gb !== a && (u && z.p(a, hf, "endY"), this.G && z.oa(this, a), this.Gb = a, this.ib = !0)
|
|
});
|
|
z.defineProperty(hf, {
|
|
cc: "figures"
|
|
}, function() {
|
|
return this.Cj
|
|
}, function(a) {
|
|
this.Cj !== a && (u && z.l(a, J, hf, "figures"), this.G && z.oa(this, a), this.Cj = a, this.ib = !0)
|
|
});
|
|
hf.prototype.add = hf.prototype.add = function(a) {
|
|
this.Cj.add(a);
|
|
return this
|
|
};
|
|
hf.prototype.setSpots = function(a, b, c, d, e, g, h, k) {
|
|
this.G && z.oa(this);
|
|
this.bi = (new Q(a, b, e, g)).freeze();
|
|
this.ci = (new Q(c, d, h, k)).freeze();
|
|
return this
|
|
};
|
|
z.defineProperty(hf, {
|
|
C: "spot1"
|
|
}, function() {
|
|
return this.bi
|
|
}, function(a) {
|
|
u && z.l(a, Q, hf, "spot1");
|
|
this.G && z.oa(this, a);
|
|
this.bi = a.V()
|
|
});
|
|
z.defineProperty(hf, {
|
|
D: "spot2"
|
|
}, function() {
|
|
return this.ci
|
|
}, function(a) {
|
|
u && z.l(a, Q, hf, "spot2");
|
|
this.G && z.oa(this, a);
|
|
this.ci = a.V()
|
|
});
|
|
z.defineProperty(hf, {
|
|
Xd: "defaultStretch"
|
|
}, function() {
|
|
return this.Bi
|
|
}, function(a) {
|
|
u && z.Ba(a, O, hf, "stretch");
|
|
this.G && z.oa(this, a);
|
|
this.Bi = a
|
|
});
|
|
z.w(hf, {
|
|
vb: "bounds"
|
|
}, function() {
|
|
this.iA() && (this.eB(), this.rh());
|
|
return this.Xu
|
|
});
|
|
|
|
function kf(a, b, c, d) {
|
|
z.kc(this);
|
|
this.G = !1;
|
|
void 0 === c && (c = !0);
|
|
this.jm = c;
|
|
void 0 === d && (d = !0);
|
|
this.so = d;
|
|
void 0 !== a ? (u && z.p(a, kf, "sx"), this.xc = a) : this.xc = 0;
|
|
void 0 !== b ? (u && z.p(b, kf, "sy"), this.Cc = b) : this.Cc = 0;
|
|
this.Lo = new J(Of);
|
|
this.nw = this.Lo.H;
|
|
this.ib = !0
|
|
}
|
|
z.ia("PathFigure", kf);
|
|
z.ii(kf);
|
|
kf.prototype.copy = function() {
|
|
var a = new kf;
|
|
a.jm = this.jm;
|
|
a.so = this.so;
|
|
a.xc = this.xc;
|
|
a.Cc = this.Cc;
|
|
for (var b = this.Lo.o, c = b.length, d = a.Lo, e = 0; e < c; e++) {
|
|
var g = b[e].copy();
|
|
d.add(g)
|
|
}
|
|
a.nw = this.nw;
|
|
a.ib = this.ib;
|
|
return a
|
|
};
|
|
kf.prototype.equalsApprox = kf.prototype.Mc = function(a) {
|
|
if (!(a instanceof kf && eb(this.Ha, a.Ha) && eb(this.Da, a.Da))) return !1;
|
|
var b = this.Ab.o;
|
|
a = a.Ab.o;
|
|
var c = b.length;
|
|
if (c !== a.length) return !1;
|
|
for (var d = 0; d < c; d++)
|
|
if (!b[d].Mc(a[d])) return !1;
|
|
return !0
|
|
};
|
|
f = kf.prototype;
|
|
f.toString = function(a) {
|
|
void 0 === a && (a = -1);
|
|
for (var b = 0 > a ? "M" + this.Ha.toString() + " " + this.Da.toString() : "M" + this.Ha.toFixed(a) + " " + this.Da.toFixed(a), c = this.Ab.o, d = c.length, e = 0; e < d; e++) b += " " + c[e].toString(a);
|
|
return b
|
|
};
|
|
f.freeze = function() {
|
|
this.G = !0;
|
|
var a = this.Ab;
|
|
a.freeze();
|
|
for (var b = a.o, a = a.length, c = 0; c < a; c++) b[c].freeze();
|
|
return this
|
|
};
|
|
f.Wa = function() {
|
|
this.G = !1;
|
|
var a = this.Ab;
|
|
a.Wa();
|
|
for (var a = a.o, b = a.length, c = 0; c < b; c++) a[c].Wa();
|
|
return this
|
|
};
|
|
f.iA = function() {
|
|
if (this.ib) return !0;
|
|
var a = this.Ab;
|
|
if (this.nw !== a.H) return !0;
|
|
for (var a = a.o, b = a.length, c = 0; c < b; c++)
|
|
if (a[c].ib) return !0;
|
|
return !1
|
|
};
|
|
f.eB = function() {
|
|
this.ib = !1;
|
|
var a = this.Ab;
|
|
this.nw = a.H;
|
|
for (var a = a.o, b = a.length, c = 0; c < b; c++) {
|
|
var d = a[c];
|
|
d.ib = !1;
|
|
d.mg = null
|
|
}
|
|
};
|
|
z.defineProperty(kf, {
|
|
Ot: "isFilled"
|
|
}, function() {
|
|
return this.jm
|
|
}, function(a) {
|
|
u && z.g(a, "boolean", kf, "isFilled");
|
|
this.G && z.oa(this, a);
|
|
this.jm = a
|
|
});
|
|
z.defineProperty(kf, {
|
|
sk: "isShadowed"
|
|
}, function() {
|
|
return this.so
|
|
}, function(a) {
|
|
u && z.g(a, "boolean", kf, "isShadowed");
|
|
this.G && z.oa(this, a);
|
|
this.so = a
|
|
});
|
|
z.defineProperty(kf, {
|
|
Ha: "startX"
|
|
}, function() {
|
|
return this.xc
|
|
}, function(a) {
|
|
u && z.p(a, kf, "startX");
|
|
this.G && z.oa(this, a);
|
|
this.xc = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(kf, {
|
|
Da: "startY"
|
|
}, function() {
|
|
return this.Cc
|
|
}, function(a) {
|
|
u && z.p(a, kf, "startY");
|
|
this.G && z.oa(this, a);
|
|
this.Cc = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(kf, {
|
|
Ab: "segments"
|
|
}, function() {
|
|
return this.Lo
|
|
}, function(a) {
|
|
u && z.l(a, J, kf, "segments");
|
|
this.G && z.oa(this, a);
|
|
this.Lo = a;
|
|
this.ib = !0
|
|
});
|
|
kf.prototype.add = kf.prototype.add = function(a) {
|
|
this.Lo.add(a);
|
|
return this
|
|
};
|
|
kf.prototype.Ma = function(a, b, c) {
|
|
for (var d = this.Ha, e = this.Da, g = d, h = e, k = this.Ab.o, l = k.length, m = 0; m < l; m++) {
|
|
var n = k[m];
|
|
switch (n.type) {
|
|
case Df:
|
|
g = n.L;
|
|
h = n.M;
|
|
d = n.L;
|
|
e = n.M;
|
|
break;
|
|
case qf:
|
|
if (te(d, e, n.L, n.M, c, a, b)) return !0;
|
|
d = n.L;
|
|
e = n.M;
|
|
break;
|
|
case Ef:
|
|
if (ue(d, e, n.zc, n.Qc, n.Ah, n.Bh, n.L, n.M, .5, a, b, c)) return !0;
|
|
d = n.L;
|
|
e = n.M;
|
|
break;
|
|
case Ff:
|
|
if (ye(d, e, n.zc, n.Qc, n.L, n.M, .5, a, b, c)) return !0;
|
|
d = n.L;
|
|
e = n.M;
|
|
break;
|
|
case Gf:
|
|
case Hf:
|
|
var p = n.type === Gf ? If(n, this) : Jf(n, this, d, e),
|
|
q = p.length;
|
|
if (0 === q) {
|
|
if (te(d, e, n.ra, n.za, c, a, b)) return !0;
|
|
d = n.ra;
|
|
e = n.za;
|
|
break
|
|
}
|
|
for (var r = null, s = 0; s < q; s++)
|
|
if (r = p[s], 0 === s && te(d, e, r[0], r[1], c, a, b) || ue(r[0], r[1], r[2], r[3], r[4], r[5], r[6], r[7], .5, a, b, c)) return !0;
|
|
null !== r && (d = r[6], e = r[7]);
|
|
break;
|
|
default:
|
|
z.k("Unknown Segment type: " + n.type)
|
|
}
|
|
if (n.gx && (d !== g || e !== h) && te(d, e, g, h, c, a, b)) return !0
|
|
}
|
|
return !1
|
|
};
|
|
|
|
function Of(a, b, c, d, e, g, h, k) {
|
|
z.kc(this);
|
|
this.G = !1;
|
|
void 0 === a ? a = qf : u && z.Ba(a, Of, Of, "constructor:type");
|
|
this.ba = a;
|
|
void 0 !== b ? (u && z.p(b, Of, "ex"), this.zb = b) : this.zb = 0;
|
|
void 0 !== c ? (u && z.p(c, Of, "ey"), this.Gb = c) : this.Gb = 0;
|
|
void 0 === d && (d = 0);
|
|
void 0 === e && (e = 0);
|
|
void 0 === g && (g = 0);
|
|
void 0 === h && (h = 0);
|
|
a === Hf ? (a = g % 360, 0 > a && (a += 360), this.Cd = a, this.Ne = 0, u && z.p(d, Of, "x1"), this.mh = Math.max(d, 0), u && z.p(e, Of, "y1"), this.yg = Math.max(e, 0), this.xo = "boolean" === typeof h ? !!h : !1, this.Ln = !!k) : (u && z.p(d, Of, "x1"), this.Cd = d, u && z.p(e,
|
|
Of, "y1"), this.Ne = e, u && z.p(g, Of, "x2"), a === Gf && (g = Math.max(g, 0)), this.mh = g, "number" === typeof h ? (a === Gf && (h = Math.max(h, 0)), this.yg = h) : this.yg = 0, this.Ln = this.xo = !1);
|
|
this.Rh = !1;
|
|
this.ib = !0;
|
|
this.mg = null
|
|
}
|
|
z.ia("PathSegment", Of);
|
|
z.ii(Of);
|
|
Of.prototype.copy = function() {
|
|
var a = new Of;
|
|
a.ba = this.ba;
|
|
a.zb = this.zb;
|
|
a.Gb = this.Gb;
|
|
a.Cd = this.Cd;
|
|
a.Ne = this.Ne;
|
|
a.mh = this.mh;
|
|
a.yg = this.yg;
|
|
a.xo = this.xo;
|
|
a.Ln = this.Ln;
|
|
a.Rh = this.Rh;
|
|
a.ib = this.ib;
|
|
return a
|
|
};
|
|
Of.prototype.equalsApprox = Of.prototype.Mc = function(a) {
|
|
if (!(a instanceof Of) || this.type !== a.type || this.gx !== a.gx) return !1;
|
|
switch (this.type) {
|
|
case Df:
|
|
case qf:
|
|
return eb(this.L, a.L) && eb(this.M, a.M);
|
|
case Ef:
|
|
return eb(this.L, a.L) && eb(this.M, a.M) && eb(this.zc, a.zc) && eb(this.Qc, a.Qc) && eb(this.Ah, a.Ah) && eb(this.Bh, a.Bh);
|
|
case Ff:
|
|
return eb(this.L, a.L) && eb(this.M, a.M) && eb(this.zc, a.zc) && eb(this.Qc, a.Qc);
|
|
case Gf:
|
|
return eb(this.Fe, a.Fe) && eb(this.Lf, a.Lf) && eb(this.ra, a.ra) && eb(this.za, a.za) && eb(this.radiusX, a.radiusX) &&
|
|
eb(this.radiusY, a.radiusY);
|
|
case Hf:
|
|
return this.Ol === a.Ol && this.kx === a.kx && eb(this.wj, a.wj) && eb(this.L, a.L) && eb(this.M, a.M) && eb(this.radiusX, a.radiusX) && eb(this.radiusY, a.radiusY);
|
|
default:
|
|
return !1
|
|
}
|
|
};
|
|
Of.prototype.toString = function(a) {
|
|
void 0 === a && (a = -1);
|
|
var b = "";
|
|
switch (this.type) {
|
|
case Df:
|
|
b = 0 > a ? "M" + this.L.toString() + " " + this.M.toString() : "M" + this.L.toFixed(a) + " " + this.M.toFixed(a);
|
|
break;
|
|
case qf:
|
|
b = 0 > a ? "L" + this.L.toString() + " " + this.M.toString() : "L" + this.L.toFixed(a) + " " + this.M.toFixed(a);
|
|
break;
|
|
case Ef:
|
|
b = 0 > a ? "C" + this.zc.toString() + " " + this.Qc.toString() + " " + this.Ah.toString() + " " + this.Bh.toString() + " " + this.L.toString() + " " + this.M.toString() : "C" + this.zc.toFixed(a) + " " + this.Qc.toFixed(a) + " " + this.Ah.toFixed(a) +
|
|
" " + this.Bh.toFixed(a) + " " + this.L.toFixed(a) + " " + this.M.toFixed(a);
|
|
break;
|
|
case Ff:
|
|
b = 0 > a ? "Q" + this.zc.toString() + " " + this.Qc.toString() + " " + this.L.toString() + " " + this.M.toString() : "Q" + this.zc.toFixed(a) + " " + this.Qc.toFixed(a) + " " + this.L.toFixed(a) + " " + this.M.toFixed(a);
|
|
break;
|
|
case Gf:
|
|
b = 0 > a ? "B" + this.Fe.toString() + " " + this.Lf.toString() + " " + this.ra.toString() + " " + this.za.toString() + " " + this.radiusX : "B" + this.Fe.toFixed(a) + " " + this.Lf.toFixed(a) + " " + this.ra.toFixed(a) + " " + this.za.toFixed(a) + " " + this.radiusX;
|
|
break;
|
|
case Hf:
|
|
b = 0 > a ? "A" + this.radiusX.toString() + " " + this.radiusY.toString() + " " + this.wj.toString() + " " + (this.kx ? 1 : 0) + " " + (this.Ol ? 1 : 0) + " " + this.L.toString() + " " + this.M.toString() : "A" + this.radiusX.toFixed(a) + " " + this.radiusY.toFixed(a) + " " + this.wj.toFixed(a) + " " + (this.kx ? 1 : 0) + " " + (this.Ol ? 1 : 0) + " " + this.L.toFixed(a) + " " + this.M.toFixed(a);
|
|
break;
|
|
default:
|
|
b = this.type.toString()
|
|
}
|
|
return b + (this.Rh ? "z" : "")
|
|
};
|
|
var Df;
|
|
Of.Move = Df = z.s(Of, "Move", 0);
|
|
var qf;
|
|
Of.Line = qf = z.s(Of, "Line", 1);
|
|
var Ef;
|
|
Of.Bezier = Ef = z.s(Of, "Bezier", 2);
|
|
var Ff;
|
|
Of.QuadraticBezier = Ff = z.s(Of, "QuadraticBezier", 3);
|
|
var Gf;
|
|
Of.Arc = Gf = z.s(Of, "Arc", 4);
|
|
var Hf;
|
|
Of.SvgArc = Hf = z.s(Of, "SvgArc", 4);
|
|
Of.prototype.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
Of.prototype.Wa = function() {
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
Of.prototype.close = Of.prototype.close = function() {
|
|
this.Rh = !0;
|
|
return this
|
|
};
|
|
|
|
function If(a, b) {
|
|
if (null !== a.mg && !1 === b.ib) return a.mg;
|
|
var c = a.radiusX,
|
|
d = a.radiusY;
|
|
void 0 === d && (d = c);
|
|
if (0 === c || 0 === d) return a.mg = [], a.mg;
|
|
var e = a.Cd,
|
|
g = a.Ne,
|
|
h = ef(c < d ? c : d, a.Fe, a.Fe + a.Lf, !1);
|
|
if (c !== d) {
|
|
var k = z.Fh();
|
|
k.reset();
|
|
c < d ? k.scale(1, d / c) : k.scale(c / d, 1);
|
|
Bf(h, k);
|
|
z.jf(k)
|
|
}
|
|
c = h.length;
|
|
for (d = 0; d < c; d++) k = h[d], k[0] += e, k[1] += g, k[2] += e, k[3] += g, k[4] += e, k[5] += g, k[6] += e, k[7] += g;
|
|
a.mg = h;
|
|
return a.mg
|
|
}
|
|
|
|
function Jf(a, b, c, d) {
|
|
function e(a, b, c, d) {
|
|
return (a * d < b * c ? -1 : 1) * Math.acos((a * c + b * d) / (Math.sqrt(a * a + b * b) * Math.sqrt(c * c + d * d)))
|
|
}
|
|
if (null !== a.mg && !1 === b.ib) return a.mg;
|
|
b = a.mh;
|
|
var g = a.yg;
|
|
if (0 === b || 0 === g) return a.mg = [], a.mg;
|
|
var h = Math.PI / 180 * a.Cd,
|
|
k = a.xo,
|
|
l = a.Ln,
|
|
m = a.zb,
|
|
n = a.Gb,
|
|
p = Math.cos(h),
|
|
q = Math.sin(h),
|
|
r = p * (c - m) / 2 + q * (d - n) / 2,
|
|
h = -q * (c - m) / 2 + p * (d - n) / 2,
|
|
s = r * r / (b * b) + h * h / (g * g);
|
|
1 < s && (b *= Math.sqrt(s), g *= Math.sqrt(s));
|
|
s = (k === l ? -1 : 1) * Math.sqrt((b * b * g * g - b * b * h * h - g * g * r * r) / (b * b * h * h + g * g * r * r));
|
|
isNaN(s) && (s = 0);
|
|
k = s * b * h / g;
|
|
s = s * -g *
|
|
r / b;
|
|
isNaN(k) && (k = 0);
|
|
isNaN(s) && (s = 0);
|
|
c = (c + m) / 2 + p * k - q * s;
|
|
d = (d + n) / 2 + q * k + p * s;
|
|
n = e(1, 0, (r - k) / b, (h - s) / g);
|
|
p = (r - k) / b;
|
|
m = (h - s) / g;
|
|
r = (-r - k) / b;
|
|
k = (-h - s) / g;
|
|
h = e(p, m, r, k);
|
|
r = (p * r + m * k) / (Math.sqrt(p * p + m * m) * Math.sqrt(r * r + k * k)); - 1 >= r ? h = Math.PI : 1 <= r && (h = 0);
|
|
!l && 0 < h && (h -= 2 * Math.PI);
|
|
l && 0 > h && (h += 2 * Math.PI);
|
|
l = b > g ? 1 : b / g;
|
|
r = b > g ? g / b : 1;
|
|
b = ef(b > g ? b : g, n, n + h, !0);
|
|
g = z.Fh();
|
|
g.reset();
|
|
g.translate(c, d);
|
|
g.rotate(a.Cd, 0, 0);
|
|
g.scale(l, r);
|
|
Bf(b, g);
|
|
z.jf(g);
|
|
a.mg = b;
|
|
return a.mg
|
|
}
|
|
z.defineProperty(Of, {
|
|
gx: "isClosed"
|
|
}, function() {
|
|
return this.Rh
|
|
}, function(a) {
|
|
this.Rh !== a && (this.Rh = a, this.ib = !0)
|
|
});
|
|
z.defineProperty(Of, {
|
|
type: "type"
|
|
}, function() {
|
|
return this.ba
|
|
}, function(a) {
|
|
u && z.Ba(a, Of, Of, "type");
|
|
this.G && z.oa(this, a);
|
|
this.ba = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
L: "endX"
|
|
}, function() {
|
|
return this.zb
|
|
}, function(a) {
|
|
u && z.p(a, Of, "endX");
|
|
this.G && z.oa(this, a);
|
|
this.zb = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
M: "endY"
|
|
}, function() {
|
|
return this.Gb
|
|
}, function(a) {
|
|
u && z.p(a, Of, "endY");
|
|
this.G && z.oa(this, a);
|
|
this.Gb = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
zc: "point1X"
|
|
}, function() {
|
|
return this.Cd
|
|
}, function(a) {
|
|
u && z.p(a, Of, "point1X");
|
|
this.G && z.oa(this, a);
|
|
this.Cd = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
Qc: "point1Y"
|
|
}, function() {
|
|
return this.Ne
|
|
}, function(a) {
|
|
u && z.p(a, Of, "point1Y");
|
|
this.G && z.oa(this, a);
|
|
this.Ne = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
Ah: "point2X"
|
|
}, function() {
|
|
return this.mh
|
|
}, function(a) {
|
|
u && z.p(a, Of, "point2X");
|
|
this.G && z.oa(this, a);
|
|
this.mh = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
Bh: "point2Y"
|
|
}, function() {
|
|
return this.yg
|
|
}, function(a) {
|
|
u && z.p(a, Of, "point2Y");
|
|
this.G && z.oa(this, a);
|
|
this.yg = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
ra: "centerX"
|
|
}, function() {
|
|
return this.Cd
|
|
}, function(a) {
|
|
u && z.p(a, Of, "centerX");
|
|
this.G && z.oa(this, a);
|
|
this.Cd = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
za: "centerY"
|
|
}, function() {
|
|
return this.Ne
|
|
}, function(a) {
|
|
u && z.p(a, Of, "centerY");
|
|
this.G && z.oa(this, a);
|
|
this.Ne = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
radiusX: "radiusX"
|
|
}, function() {
|
|
return this.mh
|
|
}, function(a) {
|
|
u && z.p(a, Of, "radiusX");
|
|
0 > a && z.ka(a, ">= zero", Of, "radiusX");
|
|
this.G && z.oa(this, a);
|
|
this.mh = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
radiusY: "radiusY"
|
|
}, function() {
|
|
return this.yg
|
|
}, function(a) {
|
|
u && z.p(a, Of, "radiusY");
|
|
0 > a && z.ka(a, ">= zero", Of, "radiusY");
|
|
this.G && z.oa(this, a);
|
|
this.yg = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
Fe: "startAngle"
|
|
}, function() {
|
|
return this.zb
|
|
}, function(a) {
|
|
this.zb !== a && (this.G && z.oa(this, a), u && z.p(a, Of, "startAngle"), a %= 360, 0 > a && (a += 360), this.zb = a, this.ib = !0)
|
|
});
|
|
z.defineProperty(Of, {
|
|
Lf: "sweepAngle"
|
|
}, function() {
|
|
return this.Gb
|
|
}, function(a) {
|
|
u && z.p(a, Of, "sweepAngle");
|
|
this.G && z.oa(this, a);
|
|
360 < a && (a = 360); - 360 > a && (a = -360);
|
|
this.Gb = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
Ol: "isClockwiseArc"
|
|
}, function() {
|
|
return this.Ln
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
this.Ln = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
kx: "isLargeArc"
|
|
}, function() {
|
|
return this.xo
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
this.xo = a;
|
|
this.ib = !0
|
|
});
|
|
z.defineProperty(Of, {
|
|
wj: "xAxisRotation"
|
|
}, function() {
|
|
return this.Cd
|
|
}, function(a) {
|
|
u && z.p(a, Of, "xAxisRotation");
|
|
a %= 360;
|
|
0 > a && (a += 360);
|
|
this.G && z.oa(this, a);
|
|
this.Cd = a;
|
|
this.ib = !0
|
|
});
|
|
|
|
function Pf() {
|
|
this.Z = null;
|
|
this.uz = (new N(0, 0)).freeze();
|
|
this.By = (new N(0, 0)).freeze();
|
|
this.Tu = this.Pv = 0;
|
|
this.Uu = 1;
|
|
this.Dv = "";
|
|
this.xw = this.jv = !1;
|
|
this.fv = this.Wu = 0;
|
|
this.yj = this.qv = this.Av = !1;
|
|
this.Yq = null;
|
|
this.vw = 0;
|
|
this.Ag = this.uw = null
|
|
}
|
|
z.ia("InputEvent", Pf);
|
|
Pf.prototype.copy = function() {
|
|
var a = new Pf;
|
|
a.Z = this.Z;
|
|
a.uz.assign(this.te);
|
|
a.By.assign(this.ga);
|
|
a.Pv = this.Pv;
|
|
a.Tu = this.Tu;
|
|
a.Uu = this.Uu;
|
|
a.Dv = this.Dv;
|
|
a.jv = this.jv;
|
|
a.xw = this.xw;
|
|
a.Wu = this.Wu;
|
|
a.fv = this.fv;
|
|
a.Av = this.Av;
|
|
a.qv = this.qv;
|
|
a.yj = this.yj;
|
|
a.Yq = this.Yq;
|
|
a.vw = this.vw;
|
|
a.uw = this.uw;
|
|
a.Ag = this.Ag;
|
|
return a
|
|
};
|
|
Pf.prototype.toString = function() {
|
|
var a = "^";
|
|
0 !== this.xd && (a += "M:" + this.xd);
|
|
0 !== this.button && (a += "B:" + this.button);
|
|
"" !== this.key && (a += "K:" + this.key);
|
|
0 !== this.Pe && (a += "C:" + this.Pe);
|
|
0 !== this.Cl && (a += "D:" + this.Cl);
|
|
this.Gc && (a += "h");
|
|
this.bubbles && (a += "b");
|
|
null !== this.ga && (a += "@" + this.ga.toString());
|
|
return a
|
|
};
|
|
z.defineProperty(Pf, {
|
|
h: "diagram"
|
|
}, function() {
|
|
return this.Z
|
|
}, function(a) {
|
|
this.Z = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
te: "viewPoint"
|
|
}, function() {
|
|
return this.uz
|
|
}, function(a) {
|
|
z.l(a, N, Pf, "viewPoint");
|
|
this.uz.assign(a)
|
|
});
|
|
z.defineProperty(Pf, {
|
|
ga: "documentPoint"
|
|
}, function() {
|
|
return this.By
|
|
}, function(a) {
|
|
z.l(a, N, Pf, "documentPoint");
|
|
this.By.assign(a)
|
|
});
|
|
z.defineProperty(Pf, {
|
|
xd: "modifiers"
|
|
}, function() {
|
|
return this.Pv
|
|
}, function(a) {
|
|
this.Pv = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
button: "button"
|
|
}, function() {
|
|
return this.Tu
|
|
}, function(a) {
|
|
this.Tu = a;
|
|
if (null === this.event) switch (a) {
|
|
case 0:
|
|
this.buttons = 1;
|
|
break;
|
|
case 1:
|
|
this.buttons = 4;
|
|
break;
|
|
case 2:
|
|
this.buttons = 2
|
|
}
|
|
});
|
|
z.defineProperty(Pf, {
|
|
buttons: "buttons"
|
|
}, function() {
|
|
return this.Uu
|
|
}, function(a) {
|
|
this.Uu = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
key: "key"
|
|
}, function() {
|
|
return this.Dv
|
|
}, function(a) {
|
|
this.Dv = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
El: "down"
|
|
}, function() {
|
|
return this.jv
|
|
}, function(a) {
|
|
this.jv = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
up: "up"
|
|
}, function() {
|
|
return this.xw
|
|
}, function(a) {
|
|
this.xw = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
Pe: "clickCount"
|
|
}, function() {
|
|
return this.Wu
|
|
}, function(a) {
|
|
this.Wu = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
Cl: "delta"
|
|
}, function() {
|
|
return this.fv
|
|
}, function(a) {
|
|
this.fv = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
Qt: "isMultiTouch"
|
|
}, function() {
|
|
return this.Av
|
|
}, function(a) {
|
|
this.Av = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
Gc: "handled"
|
|
}, function() {
|
|
return this.qv
|
|
}, function(a) {
|
|
this.qv = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
bubbles: "bubbles"
|
|
}, function() {
|
|
return this.yj
|
|
}, function(a) {
|
|
this.yj = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
event: "event"
|
|
}, function() {
|
|
return this.Yq
|
|
}, function(a) {
|
|
this.Yq = a
|
|
});
|
|
z.w(Pf, {
|
|
lj: "isTouchEvent"
|
|
}, function() {
|
|
var a = window.TouchEvent;
|
|
return a && this.event instanceof a ? !0 : (a = window.PointerEvent) && this.event instanceof a && "touch" === this.event.pointerType
|
|
});
|
|
z.w(Pf, {
|
|
rk: "isMac"
|
|
}, function() {
|
|
return z.rk
|
|
});
|
|
z.defineProperty(Pf, {
|
|
timestamp: "timestamp"
|
|
}, function() {
|
|
return this.vw
|
|
}, function(a) {
|
|
this.vw = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
Sg: "targetDiagram"
|
|
}, function() {
|
|
return this.uw
|
|
}, function(a) {
|
|
this.uw = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
Ge: "targetObject"
|
|
}, function() {
|
|
return this.Ag
|
|
}, function(a) {
|
|
this.Ag = a
|
|
});
|
|
z.defineProperty(Pf, {
|
|
control: "control"
|
|
}, function() {
|
|
return 0 !== (this.xd & 1)
|
|
}, function(a) {
|
|
this.xd = a ? this.xd | 1 : this.xd & -2
|
|
});
|
|
z.defineProperty(Pf, {
|
|
shift: "shift"
|
|
}, function() {
|
|
return 0 !== (this.xd & 4)
|
|
}, function(a) {
|
|
this.xd = a ? this.xd | 4 : this.xd & -5
|
|
});
|
|
z.defineProperty(Pf, {
|
|
alt: "alt"
|
|
}, function() {
|
|
return 0 !== (this.xd & 2)
|
|
}, function(a) {
|
|
this.xd = a ? this.xd | 2 : this.xd & -3
|
|
});
|
|
z.defineProperty(Pf, {
|
|
$t: "meta"
|
|
}, function() {
|
|
return 0 !== (this.xd & 8)
|
|
}, function(a) {
|
|
this.xd = a ? this.xd | 8 : this.xd & -9
|
|
});
|
|
z.defineProperty(Pf, {
|
|
left: "left"
|
|
}, function() {
|
|
var a = this.event;
|
|
return null !== a && a instanceof MouseEvent && ("mousedown" === a.type || "mouseup" === a.type) ? 0 === this.button : 0 !== (this.buttons & 1)
|
|
}, function(a) {
|
|
this.buttons = a ? this.buttons | 1 : this.buttons & -2
|
|
});
|
|
z.defineProperty(Pf, {
|
|
right: "right"
|
|
}, function() {
|
|
var a = this.event;
|
|
return null !== a && a instanceof MouseEvent && ("mousedown" === a.type || "mouseup" === a.type) ? 2 === this.button : 0 !== (this.buttons & 2)
|
|
}, function(a) {
|
|
this.buttons = a ? this.buttons | 2 : this.buttons & -3
|
|
});
|
|
z.defineProperty(Pf, {
|
|
VK: "middle"
|
|
}, function() {
|
|
var a = this.event;
|
|
return null !== a && a instanceof MouseEvent && ("mousedown" === a.type || "mouseup" === a.type) ? 1 === this.button : 0 !== (this.buttons & 4)
|
|
}, function(a) {
|
|
this.buttons = a ? this.buttons | 4 : this.buttons & -5
|
|
});
|
|
|
|
function Qf() {
|
|
this.Z = null;
|
|
this.Ub = "";
|
|
this.Zv = this.sw = null;
|
|
this.Vu = !1
|
|
}
|
|
z.ia("DiagramEvent", Qf);
|
|
Qf.prototype.copy = function() {
|
|
var a = new Qf;
|
|
a.Z = this.Z;
|
|
a.Ub = this.Ub;
|
|
a.sw = this.sw;
|
|
a.Zv = this.Zv;
|
|
a.Vu = this.Vu;
|
|
return a
|
|
};
|
|
Qf.prototype.toString = function() {
|
|
var a = "*" + this.name;
|
|
this.cancel && (a += "x");
|
|
null !== this.WA && (a += ":" + this.WA.toString());
|
|
null !== this.CA && (a += "(" + this.CA.toString() + ")");
|
|
return a
|
|
};
|
|
z.defineProperty(Qf, {
|
|
h: "diagram"
|
|
}, function() {
|
|
return this.Z
|
|
}, function(a) {
|
|
this.Z = a
|
|
});
|
|
z.defineProperty(Qf, {
|
|
name: "name"
|
|
}, function() {
|
|
return this.Ub
|
|
}, function(a) {
|
|
this.Ub = a
|
|
});
|
|
z.defineProperty(Qf, {
|
|
WA: "subject"
|
|
}, function() {
|
|
return this.sw
|
|
}, function(a) {
|
|
this.sw = a
|
|
});
|
|
z.defineProperty(Qf, {
|
|
CA: "parameter"
|
|
}, function() {
|
|
return this.Zv
|
|
}, function(a) {
|
|
this.Zv = a
|
|
});
|
|
z.defineProperty(Qf, {
|
|
cancel: "cancel"
|
|
}, function() {
|
|
return this.Vu
|
|
}, function(a) {
|
|
this.Vu = a
|
|
});
|
|
|
|
function Rf() {
|
|
this.vq = Sf;
|
|
this.Cm = this.Ov = "";
|
|
this.Wr = this.Xr = this.$r = this.as = this.Zr = this.Z = this.ie = null
|
|
}
|
|
z.ia("ChangedEvent", Rf);
|
|
var Tf;
|
|
Rf.Transaction = Tf = z.s(Rf, "Transaction", -1);
|
|
var Sf;
|
|
Rf.Property = Sf = z.s(Rf, "Property", 0);
|
|
var Uf;
|
|
Rf.Insert = Uf = z.s(Rf, "Insert", 1);
|
|
var Vf;
|
|
Rf.Remove = Vf = z.s(Rf, "Remove", 2);
|
|
Rf.prototype.clear = Rf.prototype.clear = function() {
|
|
this.Wr = this.Xr = this.$r = this.as = this.Zr = this.Z = this.ie = null
|
|
};
|
|
Rf.prototype.copy = function() {
|
|
var a = new Rf;
|
|
a.vq = this.vq;
|
|
a.Ov = this.Ov;
|
|
a.Cm = this.Cm;
|
|
a.ie = this.ie;
|
|
a.Z = this.Z;
|
|
a.Zr = this.Zr;
|
|
var b = this.as;
|
|
a.as = z.Za(b) && "function" === typeof b.V ? b.V() : b;
|
|
b = this.$r;
|
|
a.$r = z.Za(b) && "function" === typeof b.V ? b.V() : b;
|
|
b = this.Xr;
|
|
a.Xr = z.Za(b) && "function" === typeof b.V ? b.V() : b;
|
|
b = this.Wr;
|
|
a.Wr = z.Za(b) && "function" === typeof b.V ? b.V() : b;
|
|
return a
|
|
};
|
|
Rf.prototype.toString = function() {
|
|
var a = "",
|
|
a = this.Dc === Tf ? a + "* " : this.Dc === Sf ? a + (null !== this.ha ? "!m" : "!d") : a + ((null !== this.ha ? "!m" : "!d") + this.Dc);
|
|
this.propertyName && "string" === typeof this.propertyName && (a += " " + this.propertyName);
|
|
this.rf && this.rf !== this.propertyName && (a += " " + this.rf);
|
|
a += ": ";
|
|
this.Dc === Tf ? null !== this.oldValue && (a += " " + this.oldValue) : (null !== this.object && (a += ka(this.object)), null !== this.oldValue && (a += " old: " + ka(this.oldValue)), null !== this.Mg && (a += " " + this.Mg), null !== this.newValue &&
|
|
(a += " new: " + ka(this.newValue)), null !== this.Kg && (a += " " + this.Kg));
|
|
return a
|
|
};
|
|
Rf.prototype.getValue = Rf.prototype.na = function(a) {
|
|
return a ? this.oldValue : this.newValue
|
|
};
|
|
Rf.prototype.getParam = function(a) {
|
|
return a ? this.Mg : this.Kg
|
|
};
|
|
Rf.prototype.canUndo = Rf.prototype.canUndo = function() {
|
|
return null !== this.ha || null !== this.h ? !0 : !1
|
|
};
|
|
Rf.prototype.undo = Rf.prototype.undo = function() {
|
|
this.canUndo() && (null !== this.ha ? this.ha.Vm(this, !0) : null !== this.h && this.h.Vm(this, !0))
|
|
};
|
|
Rf.prototype.canRedo = Rf.prototype.canRedo = function() {
|
|
return null !== this.ha || null !== this.h ? !0 : !1
|
|
};
|
|
Rf.prototype.redo = Rf.prototype.redo = function() {
|
|
this.canRedo() && (null !== this.ha ? this.ha.Vm(this, !1) : null !== this.h && this.h.Vm(this, !1))
|
|
};
|
|
z.defineProperty(Rf, {
|
|
ha: "model"
|
|
}, function() {
|
|
return this.ie
|
|
}, function(a) {
|
|
this.ie = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
h: "diagram"
|
|
}, function() {
|
|
return this.Z
|
|
}, function(a) {
|
|
this.Z = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
Dc: "change"
|
|
}, function() {
|
|
return this.vq
|
|
}, function(a) {
|
|
u && z.Ba(a, Rf, Rf, "change");
|
|
this.vq = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
rf: "modelChange"
|
|
}, function() {
|
|
return this.Ov
|
|
}, function(a) {
|
|
u && z.g(a, "string", Rf, "modelChange");
|
|
this.Ov = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
propertyName: "propertyName"
|
|
}, function() {
|
|
return this.Cm
|
|
}, function(a) {
|
|
u && "string" !== typeof a && z.g(a, "function", Rf, "propertyName");
|
|
this.Cm = a
|
|
});
|
|
z.w(Rf, {
|
|
TE: "isTransactionFinished"
|
|
}, function() {
|
|
return this.vq === Tf && ("CommittedTransaction" === this.Cm || "FinishedUndo" === this.Cm || "FinishedRedo" === this.Cm)
|
|
});
|
|
z.defineProperty(Rf, {
|
|
object: "object"
|
|
}, function() {
|
|
return this.Zr
|
|
}, function(a) {
|
|
this.Zr = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
oldValue: "oldValue"
|
|
}, function() {
|
|
return this.as
|
|
}, function(a) {
|
|
this.as = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
Mg: "oldParam"
|
|
}, function() {
|
|
return this.$r
|
|
}, function(a) {
|
|
this.$r = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
newValue: "newValue"
|
|
}, function() {
|
|
return this.Xr
|
|
}, function(a) {
|
|
this.Xr = a
|
|
});
|
|
z.defineProperty(Rf, {
|
|
Kg: "newParam"
|
|
}, function() {
|
|
return this.Wr
|
|
}, function(a) {
|
|
this.Wr = a
|
|
});
|
|
|
|
function M(a) {
|
|
1 < arguments.length && z.k("Model constructor can only take one optional argument, the Array of node data.");
|
|
z.kc(this);
|
|
this.Kq = this.Ub = "";
|
|
this.Gi = !1;
|
|
this.az = {};
|
|
this.wf = [];
|
|
this.vc = new na(null, Object);
|
|
this.Vj = "key";
|
|
this.Rn = this.Ao = null;
|
|
this.Cq = this.Zu = !1;
|
|
this.nq = null;
|
|
this.xm = "category";
|
|
this.ng = new na(null, K);
|
|
this.Pj = null;
|
|
this.Vi = !1;
|
|
this.sz = null;
|
|
this.pa = new Wf;
|
|
void 0 !== a && (this.gg = a)
|
|
}
|
|
z.ia("Model", M);
|
|
M.prototype.cloneProtected = function(a) {
|
|
a.Ub = this.Ub;
|
|
a.Kq = this.Kq;
|
|
a.Gi = this.Gi;
|
|
a.Vj = this.Vj;
|
|
a.Ao = this.Ao;
|
|
a.Rn = this.Rn;
|
|
a.FJ = this.Zu;
|
|
a.Cq = this.Cq;
|
|
a.nq = this.nq;
|
|
a.xm = this.xm
|
|
};
|
|
M.prototype.copy = function() {
|
|
var a = new this.constructor;
|
|
this.cloneProtected(a);
|
|
return a
|
|
};
|
|
M.prototype.clear = M.prototype.clear = function() {
|
|
this.wf = [];
|
|
this.vc.clear();
|
|
this.ng.clear();
|
|
this.pa.clear()
|
|
};
|
|
f = M.prototype;
|
|
f.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
if (1 < a) return this.ZA();
|
|
var b = ("" !== this.name ? this.name : "") + " Model";
|
|
if (0 < a) {
|
|
b += "\n node data:";
|
|
a = this.gg;
|
|
for (var c = z.bb(a), d = 0; d < c; d++) var e = z.Ya(a, d),
|
|
b = b + (" " + this.pb(e) + ":" + ka(e))
|
|
}
|
|
return b
|
|
};
|
|
f.Cn = function() {
|
|
var a = "";
|
|
"" !== this.name && (a += ',\n "name": ' + this.quote(this.name));
|
|
"" !== this.Al && (a += ',\n "dataFormat": ' + this.quote(this.Al));
|
|
this.jb && (a += ',\n "isReadOnly": ' + this.jb);
|
|
"key" !== this.qj && "string" === typeof this.qj && (a += ',\n "nodeKeyProperty": ' + this.quote(this.qj));
|
|
this.Jz && (a += ',\n "copiesArrays": true');
|
|
this.Iz && (a += ',\n "copiesArrayObjects": true');
|
|
"category" !== this.qn && "string" === typeof this.qn && (a += ',\n "nodeCategoryProperty": ' + this.quote(this.qn));
|
|
return a
|
|
};
|
|
f.hu = function(a) {
|
|
a.name && (this.name = a.name);
|
|
a.dataFormat && (this.Al = a.dataFormat);
|
|
a.isReadOnly && (this.jb = a.isReadOnly);
|
|
a.nodeKeyProperty && (this.qj = a.nodeKeyProperty);
|
|
a.copiesArrays && (this.Jz = a.copiesArrays);
|
|
a.copiesArrayObjects && (this.Iz = a.copiesArrayObjects);
|
|
a.nodeCategoryProperty && (this.qn = a.nodeCategoryProperty)
|
|
};
|
|
|
|
function Xf(a) {
|
|
return ',\n "modelData": ' + Yf(a, a.tk)
|
|
}
|
|
|
|
function Zf(a, b) {
|
|
var c = b.modelData;
|
|
z.Za(c) && (a.ku(c), a.tk = c)
|
|
}
|
|
f.hB = function() {
|
|
var a = this.tk,
|
|
b = !1,
|
|
c;
|
|
for (c in a)
|
|
if (!$f(c, a[c])) {
|
|
b = !0;
|
|
break
|
|
}
|
|
a = "";
|
|
b && (a = Xf(this));
|
|
return a + ',\n "nodeDataArray": ' + ag(this, this.gg, !0)
|
|
};
|
|
f.FA = function(a) {
|
|
Zf(this, a);
|
|
a = a.nodeDataArray;
|
|
z.isArray(a) && (this.ku(a), this.gg = a)
|
|
};
|
|
|
|
function bg(a, b, c, d) {
|
|
if (b === c) return !0;
|
|
if (typeof b !== typeof c || "function" === typeof b || "function" === typeof c) return !1;
|
|
if (Array.isArray(b) && Array.isArray(c)) {
|
|
if (d.na(b) === c) return !0;
|
|
d.add(b, c);
|
|
if (b.length !== c.length) return !1;
|
|
for (var e = 0; e < b.length; e++)
|
|
if (!bg(a, b[e], c[e], d)) return !1;
|
|
return !0
|
|
}
|
|
if (z.Za(b) && z.Za(c)) {
|
|
if (d.na(b) === c) return !0;
|
|
d.add(b, c);
|
|
for (e in b) {
|
|
var g = b[e];
|
|
if (!$f(e, g)) {
|
|
var h = c[e];
|
|
if (void 0 === h || !bg(a, g, h, d)) return !1
|
|
}
|
|
}
|
|
for (var k in c)
|
|
if (h = c[k], !$f(k, h) && (g = b[k], void 0 === g || !bg(a, g, h, d))) return !1;
|
|
return !0
|
|
}
|
|
return !1
|
|
}
|
|
|
|
function mg(a, b, c) {
|
|
a[c] !== b[c] && z.k("Model.computeJsonDifference: Model." + c + ' is not the same in both models: "' + a[c] + '" and "' + b[c] + '"')
|
|
}
|
|
f.iB = function(a) {
|
|
mg(this, a, "nodeKeyProperty");
|
|
this instanceof ng && mg(this, a, "nodeParentKeyProperty");
|
|
for (var b = new K, c = new K, d = (new K).$c(this.vc.UE), e = new na, g = a.gg, h = 0; h < g.length; h++) {
|
|
var k = g[h],
|
|
l = a.pb(k);
|
|
if (void 0 !== l) {
|
|
d.remove(l);
|
|
var m = this.ne(l);
|
|
null === m ? (b.add(l), c.add(k)) : bg(this, m, k, e) || c.add(k)
|
|
} else this.oA(k), l = this.pb(k), b.add(l), c.add(k)
|
|
}
|
|
g = "";
|
|
bg(this, this.tk, a.tk, e) || (g += Xf(this));
|
|
0 < b.count && (g += this.by + ag(this, b.jc(), !0));
|
|
0 < c.count && (g += this.qB + ag(this, c.jc(), !0));
|
|
0 < d.count && (g += this.gy +
|
|
ag(this, d.jc(), !0));
|
|
return g
|
|
};
|
|
M.prototype.computeJsonDifference = M.prototype.computeJSONDifference = function(a, b) {
|
|
z.l(a, M, M, "computeJsonDifference:newmodel");
|
|
void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === V ? "go.GraphLinksModel" : this.constructor === ng ? "go.TreeModel" : z.kf(this));
|
|
return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Cn() + this.iB(a) + "}"
|
|
};
|
|
f = M.prototype;
|
|
f.by = ',\n "insertedNodeKeys": ';
|
|
f.qB = ',\n "modifiedNodeData": ';
|
|
f.gy = ',\n "removedNodeKeys": ';
|
|
f.gB = function(a, b) {
|
|
var c = this,
|
|
d = !1,
|
|
e = new K,
|
|
g = new K,
|
|
h = new K;
|
|
a.Yf.each(function(a) {
|
|
a.ha === c && ("nodeDataArray" === a.rf ? a.Dc === Uf ? e.add(a.newValue) : a.Dc === Vf && h.add(a.oldValue) : c.le(a.object) ? g.add(a.object) : c.tk === a.object && a.Dc === Sf && (d = !0))
|
|
});
|
|
var k = new K;
|
|
e.each(function(a) {
|
|
k.add(c.pb(a));
|
|
b || g.add(a)
|
|
});
|
|
var l = new K;
|
|
h.each(function(a) {
|
|
l.add(c.pb(a));
|
|
b && g.add(a)
|
|
});
|
|
var m = "";
|
|
d && (m += Xf(this));
|
|
0 < k.count && (m += (b ? this.gy : this.by) + ag(this, k.jc(), !0));
|
|
0 < g.count && (m += this.qB + ag(this, g.jc(), !0));
|
|
0 < l.count && (m += (b ?
|
|
this.by : this.gy) + ag(this, l.jc(), !0));
|
|
return m
|
|
};
|
|
f.EA = function(a) {
|
|
Zf(this, a);
|
|
var b = a.insertedNodeKeys;
|
|
if (z.isArray(b))
|
|
for (var c = z.bb(b), d = 0; d < c; d++) {
|
|
var e = z.Ya(b, d),
|
|
g = this.ne(e);
|
|
null === g && (g = this.copyNodeData({}), this.Mx(g, e), this.rl(g))
|
|
}
|
|
b = a.modifiedNodeData;
|
|
if (z.isArray(b))
|
|
for (c = z.bb(b), d = 0; d < c; d++) {
|
|
var h = z.Ya(b, d),
|
|
e = this.pb(h),
|
|
g = this.ne(e);
|
|
if (null !== g)
|
|
for (var k in h) "__gohashid" !== k && k !== this.qj && this.setDataProperty(g, k, h[k])
|
|
}
|
|
a = a.removedNodeKeys;
|
|
if (z.isArray(a))
|
|
for (c = z.bb(a), d = 0; d < c; d++) e = z.Ya(a, d), g = this.ne(e), null !== g && this.Ex(g)
|
|
};
|
|
M.prototype.toIncrementalJson = M.prototype.toIncrementalJSON = function(a, b) {
|
|
z.l(a, Rf, M, "toIncrementalJson:e");
|
|
a.Dc !== Tf && z.k("Model.toIncrementalJson argument is not a Transaction ChangedEvent:" + a.toString());
|
|
var c = a.object;
|
|
if (!(a.TE && c instanceof og)) return '{ "incremental": 0 }';
|
|
void 0 === b && (b = this.constructor === M ? "go.Model" : this.constructor === V ? "go.GraphLinksModel" : this.constructor === ng ? "go.TreeModel" : z.kf(this));
|
|
return '{ "class": ' + this.quote(b) + ', "incremental": 1' + this.Cn() + this.gB(c, "FinishedUndo" ===
|
|
a.propertyName) + "}"
|
|
};
|
|
M.prototype.toJson = M.prototype.toJSON = M.prototype.ZA = function(a) {
|
|
void 0 === a && (a = this.constructor === M ? "go.Model" : this.constructor === V ? "go.GraphLinksModel" : this.constructor === ng ? "go.TreeModel" : z.kf(this));
|
|
return '{ "class": ' + this.quote(a) + this.Cn() + this.hB() + "}"
|
|
};
|
|
M.prototype.applyIncrementalJson = M.prototype.applyIncrementalJSON = function(a) {
|
|
var b = null;
|
|
if ("string" === typeof a)
|
|
if (window.JSON && window.JSON.parse) try {
|
|
b = window.JSON.parse(a)
|
|
} catch (c) {
|
|
u && z.trace("JSON.parse error: " + c.toString())
|
|
} else z.trace("WARNING: no JSON.parse available");
|
|
else "object" === typeof a ? b = a : z.k("Unable to modify a Model from: " + a);
|
|
var d = b.incremental;
|
|
"number" !== typeof d && z.k("Unable to apply non-incremental changes to Model: " + a);
|
|
0 !== d && (this.Wb("applyIncrementalJson"), this.EA(b), this.Jd("applyIncrementalJson"))
|
|
};
|
|
M.fromJson = M.fromJSON = function(a, b) {
|
|
void 0 === b && (b = null);
|
|
null !== b && z.l(b, M, M, "fromJson:model");
|
|
var c = null;
|
|
if ("string" === typeof a)
|
|
if (window.JSON && window.JSON.parse) try {
|
|
c = window.JSON.parse(a)
|
|
} catch (d) {
|
|
u && z.trace("JSON.parse error: " + d.toString())
|
|
} else z.trace("WARNING: no JSON.parse available");
|
|
else "object" === typeof a ? c = a : z.k("Unable to construct a Model from: " + a);
|
|
if (null === b) {
|
|
var e;
|
|
e = null;
|
|
var g = c["class"];
|
|
if ("string" === typeof g) try {
|
|
var h = null;
|
|
0 === g.indexOf("go.") ? (g = g.substr(3), h = aa[g]) : (h = aa[g],
|
|
void 0 === h && (h = window[g]));
|
|
"function" === typeof h && (e = new h)
|
|
} catch (k) {}
|
|
null === e || e instanceof M ? b = e : z.k("Unable to construct a Model of declared class: " + c["class"])
|
|
}
|
|
null === b && (b = new V);
|
|
b.hu(c);
|
|
b.FA(c);
|
|
return b
|
|
};
|
|
M.prototype.replaceJsonObjects = M.prototype.ku = function(a) {
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) {
|
|
var d = z.Ya(a, c);
|
|
z.Za(d) && z.LD(a, c, this.ku(d))
|
|
} else if (z.Za(a)) {
|
|
for (c in a)
|
|
if (d = a[c], z.Za(d) && (d = this.ku(d), a[c] = d, "points" === c && Array.isArray(d))) {
|
|
for (var e = 0 === d.length % 2, g = 0; g < d.length; g++)
|
|
if ("number" !== typeof d[g]) {
|
|
e = !1;
|
|
break
|
|
}
|
|
if (e) {
|
|
e = new J(N);
|
|
for (g = 0; g < d.length / 2; g++) {
|
|
var h = new N(d[2 * g], d[2 * g + 1]);
|
|
e.add(h)
|
|
}
|
|
e.freeze();
|
|
a[c] = e
|
|
}
|
|
}
|
|
if ("object" === typeof a) {
|
|
c = a;
|
|
d = a["class"];
|
|
if ("NaN" === d) c = NaN;
|
|
else if ("Date" ===
|
|
d) c = new Date(a.value);
|
|
else if ("go.Point" === d) c = new N(pg(a.x), pg(a.y));
|
|
else if ("go.Size" === d) c = new Ea(pg(a.width), pg(a.height));
|
|
else if ("go.Rect" === d) c = new w(pg(a.x), pg(a.y), pg(a.width), pg(a.height));
|
|
else if ("go.Margin" === d) c = new Db(pg(a.top), pg(a.right), pg(a.bottom), pg(a.left));
|
|
else if ("go.Spot" === d) c = "string" === typeof a["enum"] ? Ub(a["enum"]) : new Q(pg(a.x), pg(a.y), pg(a.offsetX), pg(a.offsetY));
|
|
else if ("go.Brush" === d) {
|
|
if (c = new Da, c.type = Ja(Da, a.type), "string" === typeof a.color && (c.color = a.color), a.start instanceof Q && (c.start = a.start), a.end instanceof Q && (c.end = a.end), "number" === typeof a.startRadius && (c.wu = pg(a.startRadius)), "number" === typeof a.endRadius && (c.xt = pg(a.endRadius)), a = a.colorStops, z.Za(a))
|
|
for (b in a) c.addColorStop(parseFloat(b), a[b])
|
|
} else "go.Geometry" === d ? (b = null, b = "string" === typeof a.path ? sf(a.path) : new hf, b.type = Ja(hf, a.type), "number" === typeof a.startX && (b.Ha = pg(a.startX)), "number" === typeof a.startY && (b.Da = pg(a.startY)), "number" === typeof a.endX && (b.L = pg(a.endX)), "number" === typeof a.endY && (b.M =
|
|
pg(a.endY)), a.spot1 instanceof Q && (b.C = a.spot1), a.spot2 instanceof Q && (b.D = a.spot2), c = b) : "go.EnumValue" === d && (b = a.classType, 0 === b.indexOf("go.") && (b = b.substr(3)), c = Ja(aa[b], a.name));
|
|
a = c
|
|
}
|
|
}
|
|
return a
|
|
};
|
|
M.prototype.quote = function(a) {
|
|
for (var b = "", c = a.length, d = 0; d < c; d++) {
|
|
var e = a[d];
|
|
if ('"' === e || "\\" === e) b += "\\" + e;
|
|
else if ("\b" === e) b += "\\b";
|
|
else if ("\f" === e) b += "\\f";
|
|
else if ("\n" === e) b += "\\n";
|
|
else if ("\r" === e) b += "\\r";
|
|
else if ("\t" === e) b += "\\t";
|
|
else var g = a.charCodeAt(d),
|
|
b = 16 > g ? b + ("\\u000" + a.charCodeAt(d).toString(16)) : 32 > g ? b + ("\\u00" + a.charCodeAt(d).toString(16)) : 8232 === g ? b + "\\u2028" : 8233 === g ? b + "\\u2029" : b + e
|
|
}
|
|
return '"' + b + '"'
|
|
};
|
|
M.prototype.writeJsonValue = M.prototype.Du = function(a) {
|
|
return void 0 === a ? "undefined" : null === a ? "null" : !0 === a ? "true" : !1 === a ? "false" : "string" === typeof a ? this.quote(a) : "number" === typeof a ? Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : isNaN(a) ? '{"class":"NaN"}' : a.toString() : a instanceof Date ? '{"class":"Date", "value":"' + a.toJSON() + '"}' : a instanceof Number ? this.Du(a.valueOf()) : z.isArray(a) ? ag(this, a) : z.Za(a) ? Yf(this, a) : "function" === typeof a ? "null" : a.toString()
|
|
};
|
|
|
|
function ag(a, b, c) {
|
|
void 0 === c && (c = !1);
|
|
var d = z.bb(b);
|
|
if (0 >= d) return "[]";
|
|
var e = new za;
|
|
e.add("[ ");
|
|
c && 1 < d && e.add("\n");
|
|
for (var g = 0; g < d; g++) {
|
|
var h = z.Ya(b, g);
|
|
void 0 !== h && (0 < g && (e.add(","), c && e.add("\n")), e.add(a.Du(h)))
|
|
}
|
|
c && 1 < d && e.add("\n");
|
|
e.add(" ]");
|
|
return e.toString()
|
|
}
|
|
|
|
function $f(a, b) {
|
|
return void 0 === b || "__gohashid" === a || "_" === a[0] || "function" === typeof b ? !0 : !1
|
|
}
|
|
|
|
function qg(a) {
|
|
return isNaN(a) ? "NaN" : Infinity === a ? "9e9999" : -Infinity === a ? "-9e9999" : a
|
|
}
|
|
|
|
function Yf(a, b) {
|
|
var c = b;
|
|
if (c instanceof N) {
|
|
var d = c;
|
|
b = {
|
|
"class": "go.Point",
|
|
x: qg(d.x),
|
|
y: qg(d.y)
|
|
}
|
|
} else if (c instanceof Ea) {
|
|
var e = c;
|
|
b = {
|
|
"class": "go.Size",
|
|
width: qg(e.width),
|
|
height: qg(e.height)
|
|
}
|
|
} else if (c instanceof w) b = {
|
|
"class": "go.Rect",
|
|
x: qg(c.x),
|
|
y: qg(c.y),
|
|
width: qg(c.width),
|
|
height: qg(c.height)
|
|
};
|
|
else if (c instanceof Db) b = {
|
|
"class": "go.Margin",
|
|
top: qg(c.top),
|
|
right: qg(c.right),
|
|
bottom: qg(c.bottom),
|
|
left: qg(c.left)
|
|
};
|
|
else if (c instanceof Q) e = c, b = e.cd() ? {
|
|
"class": "go.Spot",
|
|
x: qg(e.x),
|
|
y: qg(e.y),
|
|
offsetX: qg(e.offsetX),
|
|
offsetY: qg(e.offsetY)
|
|
} : {
|
|
"class": "go.Spot",
|
|
"enum": e.toString()
|
|
};
|
|
else if (c instanceof Da) {
|
|
b = {
|
|
"class": "go.Brush",
|
|
type: c.type.name
|
|
};
|
|
if (c.type === rg) b.color = c.color;
|
|
else if (c.type === sg || c.type === yd) b.start = c.start, b.end = c.end, c.type === yd && (0 !== c.wu && (b.startRadius = qg(c.wu)), isNaN(c.xt) || (b.endRadius = qg(c.xt)));
|
|
if (null !== c.st) {
|
|
for (var g = {}, h = c.st.i; h.next();) g[h.key] = h.value;
|
|
b.colorStops = g
|
|
}
|
|
} else if (c instanceof hf) b = {
|
|
"class": "go.Geometry",
|
|
type: c.type.name
|
|
}, 0 !== c.Ha && (b.startX = qg(c.Ha)), 0 !== c.Da && (b.startY =
|
|
qg(c.Da)), 0 !== c.L && (b.endX = qg(c.L)), 0 !== c.M && (b.endY = qg(c.M)), c.C.N(Zb) || (b.spot1 = c.C), c.D.N(ic) || (b.spot2 = c.D), c.type === jf && (b.path = rf(c));
|
|
else if (c instanceof Ba) b = {
|
|
"class": "go.EnumValue",
|
|
classType: z.kf(c.ze),
|
|
name: c.name
|
|
};
|
|
else if (c instanceof O || c instanceof C || c instanceof tg || c instanceof M || c instanceof ug || c instanceof ra || c instanceof vg || c instanceof wa || c instanceof Wf || c instanceof og) return z.trace("ERROR: trying to convert a GraphObject or Diagram or Model or Tool or Layout or UndoManager into JSON text: " +
|
|
c.toString()), "{}";
|
|
g = "{";
|
|
c = !0;
|
|
for (d in b)
|
|
if (e = z.tb(b, d), !$f(d, e))
|
|
if (c ? c = !1 : g += ", ", g += '"' + d + '":', "points" === d && e instanceof J && e.ba === N) {
|
|
h = e;
|
|
e = "[";
|
|
for (h = h.i; h.next();) {
|
|
var k = h.value;
|
|
1 < e.length && (e += ",");
|
|
e += a.Du(k.x);
|
|
e += ",";
|
|
e += a.Du(k.y)
|
|
}
|
|
e += "]";
|
|
g += e
|
|
} else g += a.Du(e);
|
|
return g + "}"
|
|
}
|
|
|
|
function pg(a) {
|
|
return "number" === typeof a ? a : "NaN" === a ? NaN : "9e9999" === a ? Infinity : "-9e9999" === a ? -Infinity : parseFloat(a)
|
|
}
|
|
z.defineProperty(M, {
|
|
name: "name"
|
|
}, function() {
|
|
return this.Ub
|
|
}, function(a) {
|
|
var b = this.Ub;
|
|
b !== a && (z.g(a, "string", M, "name"), this.Ub = a, this.j("name", b, a))
|
|
});
|
|
z.defineProperty(M, {
|
|
Al: "dataFormat"
|
|
}, function() {
|
|
return this.Kq
|
|
}, function(a) {
|
|
var b = this.Kq;
|
|
b !== a && (z.g(a, "string", M, "dataFormat"), this.Kq = a, this.j("dataFormat", b, a))
|
|
});
|
|
z.defineProperty(M, {
|
|
jb: "isReadOnly"
|
|
}, function() {
|
|
return this.Gi
|
|
}, function(a) {
|
|
var b = this.Gi;
|
|
b !== a && (z.g(a, "boolean", M, "isReadOnly"), this.Gi = a, this.j("isReadOnly", b, a))
|
|
});
|
|
z.defineProperty(M, {
|
|
tk: "modelData"
|
|
}, function() {
|
|
return this.az
|
|
}, function(a) {
|
|
var b = this.az;
|
|
b !== a && (z.g(a, "object", M, "modelData"), this.az = a, this.j("modelData", b, a), this.Mb(a))
|
|
});
|
|
M.prototype.addChangedListener = M.prototype.Rm = function(a) {
|
|
z.g(a, "function", M, "addChangedListener:listener");
|
|
null === this.Pj && (this.Pj = new J("function"));
|
|
this.Pj.add(a)
|
|
};
|
|
M.prototype.removeChangedListener = M.prototype.iu = function(a) {
|
|
z.g(a, "function", M, "removeChangedListener:listener");
|
|
null !== this.Pj && (this.Pj.remove(a), 0 === this.Pj.count && (this.Pj = null))
|
|
};
|
|
M.prototype.Kw = function(a) {
|
|
this.Bb || this.pa.DE(a);
|
|
if (null !== this.Pj) {
|
|
var b = this.Pj,
|
|
c = b.length;
|
|
if (1 === c) b = b.ea(0), b(a);
|
|
else if (0 !== c)
|
|
for (var d = b.jc(), e = 0; e < c; e++) b = d[e], b(a)
|
|
}
|
|
};
|
|
M.prototype.raiseChangedEvent = M.prototype.Rc = function(a, b, c, d, e, g, h) {
|
|
wg(this, "", a, b, c, d, e, g, h)
|
|
};
|
|
M.prototype.raiseChanged = M.prototype.j = function(a, b, c, d, e) {
|
|
wg(this, "", Sf, a, this, b, c, d, e)
|
|
};
|
|
M.prototype.raiseDataChanged = M.prototype.DA = function(a, b, c, d, e, g) {
|
|
wg(this, "", Sf, b, a, c, d, e, g)
|
|
};
|
|
|
|
function wg(a, b, c, d, e, g, h, k, l) {
|
|
void 0 === k && (k = null);
|
|
void 0 === l && (l = null);
|
|
var m = new Rf;
|
|
m.ha = a;
|
|
m.Dc = c;
|
|
m.rf = b;
|
|
m.propertyName = d;
|
|
m.object = e;
|
|
m.oldValue = g;
|
|
m.Mg = k;
|
|
m.newValue = h;
|
|
m.Kg = l;
|
|
a.Kw(m)
|
|
}
|
|
z.defineProperty(M, {
|
|
pa: "undoManager"
|
|
}, function() {
|
|
return this.sz
|
|
}, function(a) {
|
|
var b = this.sz;
|
|
b !== a && (z.l(a, Wf, M, "undoManager"), null !== b && b.YI(this), this.sz = a, null !== a && a.PG(this))
|
|
});
|
|
z.defineProperty(M, {
|
|
Bb: "skipsUndoManager"
|
|
}, function() {
|
|
return this.Vi
|
|
}, function(a) {
|
|
z.g(a, "boolean", M, "skipsUndoManager");
|
|
this.Vi = a
|
|
});
|
|
M.prototype.Vm = function(a, b) {
|
|
if (null !== a && a.ha === this)
|
|
if (a.Dc === Sf) {
|
|
var c = a.object,
|
|
d = a.propertyName,
|
|
e = a.na(b);
|
|
z.Ra(c, d, e)
|
|
} else a.Dc === Uf ? "nodeDataArray" === a.rf ? (c = a.newValue, z.Za(c) && (d = this.pb(c), void 0 !== d && (b ? (z.hi(this.wf, a.Kg), this.vc.remove(d)) : (z.aj(this.wf, a.Kg, c), this.vc.add(d, c))))) : "" === a.rf ? (c = a.object, !z.isArray(c) && a.propertyName && (c = z.tb(a.object, a.propertyName)), z.isArray(c) && (d = a.newValue, e = a.Kg, b ? z.hi(c, e) : z.aj(c, e, d))) : z.k("unknown ChangedEvent.Insert object: " + a.toString()) : a.Dc ===
|
|
Vf ? "nodeDataArray" === a.rf ? (c = a.oldValue, z.Za(c) && (d = this.pb(c), void 0 !== d && (b ? (z.aj(this.wf, a.Mg, c), this.vc.add(d, c)) : (z.hi(this.wf, a.Mg), this.vc.remove(d))))) : "" === a.rf ? (c = a.object, !z.isArray(c) && a.propertyName && (c = z.tb(a.object, a.propertyName)), z.isArray(c) && (d = a.oldValue, e = a.Mg, b ? z.aj(c, e, d) : z.hi(c, e))) : z.k("unknown ChangedEvent.Remove object: " + a.toString()) : a.Dc !== Tf && z.k("unknown ChangedEvent: " + a.toString())
|
|
};
|
|
M.prototype.startTransaction = M.prototype.Wb = function(a) {
|
|
return this.pa.Wb(a)
|
|
};
|
|
M.prototype.commitTransaction = M.prototype.Jd = function(a) {
|
|
return this.pa.Jd(a)
|
|
};
|
|
M.prototype.rollbackTransaction = M.prototype.Vp = function() {
|
|
return this.pa.Vp()
|
|
};
|
|
M.prototype.updateTargetBindings = M.prototype.Mb = function(a, b) {
|
|
void 0 === b && (b = "");
|
|
wg(this, "SourceChanged", Tf, b, a, null, null)
|
|
};
|
|
z.defineProperty(M, {
|
|
qj: "nodeKeyProperty"
|
|
}, function() {
|
|
return this.Vj
|
|
}, function(a) {
|
|
var b = this.Vj;
|
|
b !== a && (xg(a, M, "nodeKeyProperty"), "" === a && z.k("Model.nodeKeyProperty may not be the empty string"), 0 < this.vc.count && z.k("Cannot set Model.nodeKeyProperty when there is existing node data"), this.Vj = a, this.j("nodeKeyProperty", b, a))
|
|
});
|
|
|
|
function xg(a, b, c) {
|
|
"string" !== typeof a && "function" !== typeof a && z.ic(a, "string or function", b, c)
|
|
}
|
|
M.prototype.getKeyForNodeData = M.prototype.pb = function(a) {
|
|
if (null !== a) {
|
|
var b = this.Vj;
|
|
if ("" !== b && (b = z.tb(a, b), void 0 !== b)) {
|
|
if (yg(b)) return b;
|
|
z.k("Key value for node data " + a + " is not a number or a string: " + b)
|
|
}
|
|
}
|
|
};
|
|
M.prototype.setKeyForNodeData = M.prototype.Mx = function(a, b) {
|
|
void 0 !== b && null !== b && yg(b) || z.ic(b, "number or string", M, "setKeyForNodeData:key");
|
|
if (null !== a) {
|
|
var c = this.Vj;
|
|
if ("" !== c)
|
|
if (this.le(a)) {
|
|
var d = z.tb(a, c);
|
|
d !== b && null === this.ne(b) && (z.Ra(a, c, b), this.vc.remove(d), this.vc.add(b, a), wg(this, "nodeKey", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c), this.ju(d, b))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
z.defineProperty(M, {
|
|
OK: "makeUniqueKeyFunction"
|
|
}, function() {
|
|
return this.Ao
|
|
}, function(a) {
|
|
var b = this.Ao;
|
|
b !== a && (null !== a && z.g(a, "function", M, "makeUniqueKeyFunction"), this.Ao = a, this.j("makeUniqueKeyFunction", b, a))
|
|
});
|
|
|
|
function yg(a) {
|
|
return "number" === typeof a || "string" === typeof a
|
|
}
|
|
M.prototype.containsNodeData = M.prototype.le = function(a) {
|
|
var b = this.pb(a);
|
|
return void 0 === b ? !1 : this.vc.na(b) === a
|
|
};
|
|
M.prototype.findNodeDataForKey = M.prototype.ne = function(a) {
|
|
null === a && z.k("Model.findNodeDataForKey:key must not be null");
|
|
return void 0 !== a && yg(a) ? this.vc.na(a) : null
|
|
};
|
|
z.defineProperty(M, {
|
|
gg: "nodeDataArray"
|
|
}, function() {
|
|
return this.wf
|
|
}, function(a) {
|
|
var b = this.wf;
|
|
if (b !== a) {
|
|
z.nt(a, M, "nodeDataArray");
|
|
this.vc.clear();
|
|
this.cB();
|
|
for (var c = z.bb(a), d = 0; d < c; d++) {
|
|
var e = z.Ya(a, d);
|
|
if (!z.Za(e)) {
|
|
z.k("Model.nodeDataArray must only contain Objects, not: " + e);
|
|
return
|
|
}
|
|
z.It(e)
|
|
}
|
|
this.wf = a;
|
|
for (var g = new J(Object), d = 0; d < c; d++) {
|
|
var e = z.Ya(a, d),
|
|
h = this.pb(e);
|
|
void 0 === h ? g.add(e) : null !== this.vc.na(h) ? g.add(e) : this.vc.add(h, e)
|
|
}
|
|
for (d = g.i; d.next();) e = d.value, this.oA(e), g = this.pb(e), void 0 !== g &&
|
|
this.vc.add(g, e);
|
|
wg(this, "nodeDataArray", Sf, "nodeDataArray", this, b, a);
|
|
for (d = 0; d < c; d++) e = z.Ya(a, d), this.Up(e), this.Tp(e);
|
|
this.QD();
|
|
z.gI(a) || (this.jb = !0)
|
|
}
|
|
});
|
|
M.prototype.makeNodeDataKeyUnique = M.prototype.oA = function(a) {
|
|
if (null !== a) {
|
|
var b = this.Vj;
|
|
if ("" !== b) {
|
|
var c = this.pb(a);
|
|
if (void 0 === c || this.vc.contains(c)) {
|
|
var d = this.Ao;
|
|
if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.vc.contains(c))) {
|
|
z.Ra(a, b, c);
|
|
return
|
|
}
|
|
if ("string" === typeof c) {
|
|
for (d = 2; this.vc.contains(c + d);) d++;
|
|
z.Ra(a, b, c + d)
|
|
} else if (void 0 === c || "number" === typeof c) {
|
|
for (d = -this.vc.count - 1; this.vc.contains(d);) d--;
|
|
z.Ra(a, b, d)
|
|
} else z.k("Model.getKeyForNodeData returned something other than a string or a number: " +
|
|
c)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
M.prototype.addNodeData = M.prototype.rl = function(a) {
|
|
null !== a && (z.It(a), zg(this, a, !0))
|
|
};
|
|
|
|
function zg(a, b, c) {
|
|
var d = a.pb(b);
|
|
if (void 0 === d || a.vc.na(d) !== b)
|
|
if (a.oA(b), d = a.pb(b), void 0 === d) z.k("Model.makeNodeDataKeyUnique failed on " + b + ". Data not added to Model.");
|
|
else {
|
|
a.vc.add(d, b);
|
|
if (c) {
|
|
var e = z.bb(a.wf);
|
|
z.aj(a.wf, e, b)
|
|
}
|
|
wg(a, "nodeDataArray", Uf, "nodeDataArray", a, null, b, null, e);
|
|
a.Up(b);
|
|
a.Tp(b)
|
|
}
|
|
}
|
|
M.prototype.addNodeDataCollection = function(a) {
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) this.rl(z.Ya(a, c));
|
|
else
|
|
for (a = a.i; a.next();) this.rl(a.value)
|
|
};
|
|
M.prototype.removeNodeData = M.prototype.Ex = function(a) {
|
|
null !== a && Ag(this, a, !0)
|
|
};
|
|
|
|
function Ag(a, b, c) {
|
|
var d = a.pb(b);
|
|
if (void 0 !== d && a.vc.contains(d)) {
|
|
a.vc.remove(d);
|
|
if (c) {
|
|
var e = z.Dz(a.wf, b);
|
|
if (0 > e) return;
|
|
z.hi(a.wf, e)
|
|
}
|
|
wg(a, "nodeDataArray", Vf, "nodeDataArray", a, b, null, e, null);
|
|
a.Bu(b)
|
|
}
|
|
}
|
|
M.prototype.removeNodeDataCollection = function(a) {
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) this.Ex(z.Ya(a, c));
|
|
else
|
|
for (a = a.i; a.next();) this.Ex(a.value)
|
|
};
|
|
f = M.prototype;
|
|
f.ju = function(a, b) {
|
|
var c = Bg(this, a);
|
|
c instanceof K && this.ng.add(b, c)
|
|
};
|
|
f.cB = function() {};
|
|
f.Up = function() {};
|
|
f.Tp = function() {};
|
|
f.Bu = function() {};
|
|
|
|
function Cg(a, b, c) {
|
|
if (void 0 !== b) {
|
|
var d = a.ng.na(b);
|
|
null === d && (d = new K(Object), a.ng.add(b, d));
|
|
d.add(c)
|
|
}
|
|
}
|
|
|
|
function Dg(a, b, c) {
|
|
if (void 0 !== b) {
|
|
var d = a.ng.na(b);
|
|
d instanceof K && (void 0 === c || null === c ? a.ng.remove(b) : (d.remove(c), 0 === d.count && a.ng.remove(b)))
|
|
}
|
|
}
|
|
|
|
function Bg(a, b) {
|
|
if (void 0 === b) return null;
|
|
var c = a.ng.na(b);
|
|
return c instanceof K ? c : null
|
|
}
|
|
M.prototype.clearUnresolvedReferences = M.prototype.QD = function(a) {
|
|
void 0 === a ? this.ng.clear() : this.ng.remove(a)
|
|
};
|
|
z.defineProperty(M, {
|
|
fK: "copyNodeDataFunction"
|
|
}, function() {
|
|
return this.Rn
|
|
}, function(a) {
|
|
var b = this.Rn;
|
|
b !== a && (null !== a && z.g(a, "function", M, "copyNodeDataFunction"), this.Rn = a, this.j("copyNodeDataFunction", b, a))
|
|
});
|
|
z.defineProperty(M, {
|
|
Jz: "copiesArrays"
|
|
}, function() {
|
|
return this.Zu
|
|
}, function(a) {
|
|
var b = this.Zu;
|
|
b !== a && (null !== a && z.g(a, "boolean", M, "copiesArrays"), this.Zu = a, this.j("copiesArrays", b, a))
|
|
});
|
|
z.defineProperty(M, {
|
|
Iz: "copiesArrayObjects"
|
|
}, function() {
|
|
return this.Cq
|
|
}, function(a) {
|
|
var b = this.Cq;
|
|
b !== a && (null !== a && z.g(a, "boolean", M, "copiesArrayObjects"), this.Cq = a, this.j("copiesArrayObjects", b, a))
|
|
});
|
|
M.prototype.copyNodeData = function(a) {
|
|
if (null === a) return null;
|
|
var b = null,
|
|
b = this.Rn,
|
|
b = null !== b ? b(a, this) : Eg(this, a, !0);
|
|
z.Za(b) && z.kc(b);
|
|
return b
|
|
};
|
|
|
|
function Eg(a, b, c) {
|
|
if (a.Jz && Array.isArray(b)) {
|
|
var d = [];
|
|
for (c = 0; c < b.length; c++) {
|
|
var e = Eg(a, b[c], a.Iz);
|
|
d.push(e)
|
|
}
|
|
z.kc(d);
|
|
return d
|
|
}
|
|
if (c && z.Za(b)) {
|
|
c = (c = b.constructor) ? new c : {};
|
|
for (d in b)
|
|
if ("__gohashid" !== d) {
|
|
var e = z.tb(b, d),
|
|
g;
|
|
g = e;
|
|
g instanceof O || g instanceof C || g instanceof tg || g instanceof Fg || g instanceof Gg || g instanceof ug || g instanceof ra || g instanceof vg || g instanceof Pf || g instanceof Qf ? ("_" !== d[0] && z.trace('Warning: found GraphObject or Diagram reference when copying model data on property "' +
|
|
d + '" of data object: ' + b.toString() + " \nModel data should not have any references to a Diagram or any part of a diagram, such as: " + g.toString()), g = !0) : g = g instanceof M || g instanceof Wf || g instanceof og || g instanceof Rf ? !0 : !1;
|
|
g || (e = Eg(a, e, !1));
|
|
z.Ra(c, d, e)
|
|
}
|
|
z.kc(c);
|
|
return c
|
|
}
|
|
return b instanceof N ? b.copy() : b instanceof Ea ? b.copy() : b instanceof w ? b.copy() : b instanceof Q ? b.copy() : b instanceof Db ? b.copy() : b
|
|
}
|
|
z.defineProperty(M, {
|
|
RG: "afterCopyFunction"
|
|
}, function() {
|
|
return this.nq
|
|
}, function(a) {
|
|
var b = this.nq;
|
|
b !== a && (null !== a && z.g(a, "function", M, "afterCopyFunction"), this.nq = a, this.j("afterCopyFunction", b, a))
|
|
});
|
|
var Hg = !1;
|
|
M.prototype.setDataProperty = function(a, b, c) {
|
|
u && (z.g(a, "object", M, "setDataProperty:data"), z.g(b, "string", M, "setDataProperty:propname"), "" === b && z.k("Model.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
|
|
if (this.le(a))
|
|
if (b === this.qj) this.Mx(a, c);
|
|
else {
|
|
if (b === this.qn) {
|
|
this.Jx(a, c);
|
|
return
|
|
}
|
|
}
|
|
else !Hg && a instanceof O && (Hg = !0, z.trace('Model.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), z.trace(" Is that really your intent?"));
|
|
var d = z.tb(a, b);
|
|
d !== c &&
|
|
(z.Ra(a, b, c), this.DA(a, b, d, c))
|
|
};
|
|
M.prototype.addArrayItem = function(a, b) {
|
|
this.cI(a, -1, b)
|
|
};
|
|
M.prototype.insertArrayItem = M.prototype.cI = function(a, b, c) {
|
|
u && (z.nt(a, M, "insertArrayItem:arr"), z.p(b, M, "insertArrayItem:idx"));
|
|
a === this.wf && z.k("Model.insertArrayItem or Model.addArrayItem should not be called on the Model.nodeDataArray");
|
|
0 > b && (b = z.bb(a));
|
|
z.aj(a, b, c);
|
|
wg(this, "", Uf, "", a, null, c, null, b)
|
|
};
|
|
M.prototype.removeArrayItem = function(a, b) {
|
|
void 0 === b && (b = -1);
|
|
u && (z.nt(a, M, "removeArrayItem:arr"), z.p(b, M, "removeArrayItem:idx"));
|
|
a === this.wf && z.k("Model.removeArrayItem should not be called on the Model.nodeDataArray"); - 1 === b && (b = z.bb(a) - 1);
|
|
var c = z.Ya(a, b);
|
|
z.hi(a, b);
|
|
wg(this, "", Vf, "", a, c, null, b, null)
|
|
};
|
|
z.defineProperty(M, {
|
|
qn: "nodeCategoryProperty"
|
|
}, function() {
|
|
return this.xm
|
|
}, function(a) {
|
|
var b = this.xm;
|
|
b !== a && (xg(a, M, "nodeCategoryProperty"), this.xm = a, this.j("nodeCategoryProperty", b, a))
|
|
});
|
|
M.prototype.getCategoryForNodeData = M.prototype.$z = function(a) {
|
|
if (null === a) return "";
|
|
var b = this.xm;
|
|
if ("" === b) return "";
|
|
b = z.tb(a, b);
|
|
if (void 0 === b) return "";
|
|
if ("string" === typeof b) return b;
|
|
z.k("getCategoryForNodeData found a non-string category for " + a + ": " + b);
|
|
return ""
|
|
};
|
|
M.prototype.setCategoryForNodeData = M.prototype.Jx = function(a, b) {
|
|
z.g(b, "string", M, "setCategoryForNodeData:cat");
|
|
if (null !== a) {
|
|
var c = this.xm;
|
|
if ("" !== c)
|
|
if (this.le(a)) {
|
|
var d = z.tb(a, c);
|
|
void 0 === d && (d = "");
|
|
d !== b && (z.Ra(a, c, b), wg(this, "nodeCategory", Sf, c, a, d, b))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
|
|
function V(a, b) {
|
|
2 < arguments.length && z.k("GraphLinksModel constructor can only take two optional arguments, the Array of node data and the Array of link data.");
|
|
M.call(this);
|
|
this.vf = [];
|
|
this.sm = new K(Object);
|
|
this.hd = new na(null, Object);
|
|
this.dl = "";
|
|
this.Mk = this.Qn = this.Bo = null;
|
|
this.Th = "from";
|
|
this.Uh = "to";
|
|
this.um = this.tm = "";
|
|
this.rm = "category";
|
|
this.ug = "";
|
|
this.Eo = "isGroup";
|
|
this.jh = "group";
|
|
this.Dq = !1;
|
|
void 0 !== a && (this.gg = a);
|
|
void 0 !== b && (this.Jg = b)
|
|
}
|
|
z.Qa(V, M);
|
|
z.ia("GraphLinksModel", V);
|
|
V.prototype.cloneProtected = function(a) {
|
|
M.prototype.cloneProtected.call(this, a);
|
|
a.dl = this.dl;
|
|
a.Bo = this.Bo;
|
|
a.Qn = this.Qn;
|
|
a.Th = this.Th;
|
|
a.Uh = this.Uh;
|
|
a.tm = this.tm;
|
|
a.um = this.um;
|
|
a.rm = this.rm;
|
|
a.ug = this.ug;
|
|
a.Eo = this.Eo;
|
|
a.jh = this.jh;
|
|
a.Dq = this.Dq
|
|
};
|
|
V.prototype.clear = V.prototype.clear = function() {
|
|
M.prototype.clear.call(this);
|
|
this.vf = [];
|
|
this.hd.clear();
|
|
this.sm.clear()
|
|
};
|
|
f = V.prototype;
|
|
f.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
if (2 <= a) return this.ZA();
|
|
var b = ("" !== this.name ? this.name : "") + " GraphLinksModel";
|
|
if (0 < a) {
|
|
b += "\n node data:";
|
|
a = this.gg;
|
|
for (var c = z.bb(a), d = 0, d = 0; d < c; d++) var e = z.Ya(a, d),
|
|
b = b + (" " + this.pb(e) + ":" + ka(e));
|
|
b += "\n link data:";
|
|
a = this.Jg;
|
|
c = z.bb(a);
|
|
for (d = 0; d < c; d++) e = z.Ya(a, d), b += " " + this.Ll(e) + "--\x3e" + this.Ml(e)
|
|
}
|
|
return b
|
|
};
|
|
f.Cn = function() {
|
|
var a = M.prototype.Cn.call(this),
|
|
b = "";
|
|
"category" !== this.Wt && "string" === typeof this.Wt && (b += ',\n "linkCategoryProperty": ' + this.quote(this.Wt));
|
|
"" !== this.oj && "string" === typeof this.oj && (b += ',\n "linkKeyProperty": ' + this.quote(this.oj));
|
|
"from" !== this.Ep && "string" === typeof this.Ep && (b += ',\n "linkFromKeyProperty": ' + this.quote(this.Ep));
|
|
"to" !== this.Gp && "string" === typeof this.Gp && (b += ',\n "linkToKeyProperty": ' + this.quote(this.Gp));
|
|
"" !== this.Xt && "string" === typeof this.Xt && (b += ',\n "linkFromPortIdProperty": ' +
|
|
this.quote(this.Xt));
|
|
"" !== this.Zt && "string" === typeof this.Zt && (b += ',\n "linkToPortIdProperty": ' + this.quote(this.Zt));
|
|
"" !== this.Yt && "string" === typeof this.Yt && (b += ',\n "linkLabelKeysProperty": ' + this.quote(this.Yt));
|
|
"isGroup" !== this.eu && "string" === typeof this.eu && (b += ',\n "nodeIsGroupProperty": ' + this.quote(this.eu));
|
|
"group" !== this.Pp && "string" === typeof this.Pp && (b += ',\n "nodeGroupKeyProperty": ' + this.quote(this.Pp));
|
|
return a + b
|
|
};
|
|
f.hu = function(a) {
|
|
M.prototype.hu.call(this, a);
|
|
a.linkKeyProperty && (this.oj = a.linkKeyProperty);
|
|
a.linkFromKeyProperty && (this.Ep = a.linkFromKeyProperty);
|
|
a.linkToKeyProperty && (this.Gp = a.linkToKeyProperty);
|
|
a.linkFromPortIdProperty && (this.Xt = a.linkFromPortIdProperty);
|
|
a.linkToPortIdProperty && (this.Zt = a.linkToPortIdProperty);
|
|
a.linkCategoryProperty && (this.Wt = a.linkCategoryProperty);
|
|
a.linkLabelKeysProperty && (this.Yt = a.linkLabelKeysProperty);
|
|
a.nodeIsGroupProperty && (this.eu = a.nodeIsGroupProperty);
|
|
a.nodeGroupKeyProperty &&
|
|
(this.Pp = a.nodeGroupKeyProperty)
|
|
};
|
|
f.hB = function() {
|
|
var a = M.prototype.hB.call(this),
|
|
b = ',\n "linkDataArray": ' + ag(this, this.Jg, !0);
|
|
return a + b
|
|
};
|
|
f.FA = function(a) {
|
|
M.prototype.FA.call(this, a);
|
|
a = a.linkDataArray;
|
|
z.isArray(a) && (this.ku(a), this.Jg = a)
|
|
};
|
|
f.iB = function(a) {
|
|
a instanceof V || z.k("Model.computeJsonDifference: newmodel must be a GraphLinksModel");
|
|
"" === this.oj && z.k("GraphLinksModel.linkKeyProperty must not be an empty string for .computeJsonDifference() to succeed.");
|
|
var b = M.prototype.iB.call(this, a);
|
|
mg(this, a, "linkKeyProperty");
|
|
mg(this, a, "linkFromKeyProperty");
|
|
mg(this, a, "linkToKeyProperty");
|
|
mg(this, a, "linkLabelKeysProperty");
|
|
mg(this, a, "nodeIsGroupProperty");
|
|
mg(this, a, "nodeGroupKeyProperty");
|
|
for (var c = new K, d = new K, e = (new K).$c(this.hd.UE),
|
|
g = new na, h = a.Jg, k = 0; k < h.length; k++) {
|
|
var l = h[k],
|
|
m = a.lf(l);
|
|
if (void 0 !== m) {
|
|
e.remove(m);
|
|
var n = this.zt(m);
|
|
null === n ? (c.add(m), d.add(l)) : bg(this, n, l, g) || d.add(l)
|
|
} else this.nA(l), m = this.lf(l), c.add(m), d.add(l)
|
|
}
|
|
a = b;
|
|
0 < c.count && (a += this.ay + ag(this, c.jc(), !0));
|
|
0 < d.count && (a += this.pB + ag(this, d.jc(), !0));
|
|
0 < e.count && (a += this.ey + ag(this, e.jc(), !0));
|
|
return a
|
|
};
|
|
f.ay = ',\n "insertedLinkKeys": ';
|
|
f.pB = ',\n "modifiedLinkData": ';
|
|
f.ey = ',\n "removedLinkKeys": ';
|
|
f.gB = function(a, b) {
|
|
"" === this.oj && z.k("GraphLinksModel.linkKeyProperty must not be an empty string for .toIncrementalJson() to succeed.");
|
|
var c = M.prototype.gB.call(this, a, b),
|
|
d = this,
|
|
e = new K,
|
|
g = new K,
|
|
h = new K;
|
|
a.Yf.each(function(a) {
|
|
a.ha === d && ("linkDataArray" === a.rf ? a.Dc === Uf ? e.add(a.newValue) : a.Dc === Vf && h.add(a.oldValue) : d.sh(a.object) && g.add(a.object))
|
|
});
|
|
var k = new K;
|
|
e.each(function(a) {
|
|
k.add(d.lf(a));
|
|
b || g.add(a)
|
|
});
|
|
var l = new K;
|
|
h.each(function(a) {
|
|
l.add(d.lf(a));
|
|
b && g.add(a)
|
|
});
|
|
0 < k.count && (c += (b ? this.ey : this.ay) +
|
|
ag(this, k.jc(), !0));
|
|
0 < g.count && (c += this.pB + ag(this, g.jc(), !0));
|
|
0 < l.count && (c += (b ? this.ay : this.ey) + ag(this, l.jc(), !0));
|
|
return c
|
|
};
|
|
f.EA = function(a) {
|
|
M.prototype.EA.call(this, a);
|
|
var b = a.insertedLinkKeys;
|
|
if (z.isArray(b))
|
|
for (var c = z.bb(b), d = 0; d < c; d++) {
|
|
var e = z.Ya(b, d),
|
|
g = this.zt(e);
|
|
null === g && (g = this.Pw({}), this.JF(g, e), this.gt(g))
|
|
}
|
|
b = a.modifiedLinkData;
|
|
if (z.isArray(b))
|
|
for (c = z.bb(b), d = 0; d < c; d++) {
|
|
var h = z.Ya(b, d),
|
|
e = this.lf(h),
|
|
g = this.zt(e);
|
|
if (null !== g)
|
|
for (var k in h) "__gohashid" !== k && k !== this.oj && this.setDataProperty(g, k, h[k])
|
|
}
|
|
a = a.removedLinkKeys;
|
|
if (z.isArray(a))
|
|
for (c = z.bb(a), d = 0; d < c; d++) e = z.Ya(a, d), g = this.zt(e), null !== g && this.Dx(g)
|
|
};
|
|
f.Vm = function(a, b) {
|
|
var c = null;
|
|
if (a.Dc === Uf) {
|
|
if ("linkDataArray" === a.rf ? c = this.vf : "linkLabelKeys" === a.rf && (c = this.qk(a.object)), z.isArray(c)) {
|
|
if (b) z.hi(c, a.Kg), c === this.vf && (c = this.lf(a.newValue), void 0 !== c && this.hd.remove(c));
|
|
else if (z.aj(c, a.Kg, a.newValue), c === this.vf) {
|
|
var d = a.newValue,
|
|
c = this.lf(d);
|
|
void 0 !== c && this.hd.add(c, d)
|
|
}
|
|
return
|
|
}
|
|
} else if (a.Dc === Vf && ("linkDataArray" === a.rf ? c = this.vf : "linkLabelKeys" === a.rf && (c = this.qk(a.object)), z.isArray(c))) {
|
|
b ? (z.aj(c, a.Mg, a.oldValue), c === this.vf && (d = a.newValue,
|
|
c = this.lf(d), void 0 !== c && this.hd.add(c, d))) : (z.hi(c, a.Mg), c === this.vf && (c = this.lf(a.newValue), void 0 !== c && this.hd.remove(c)));
|
|
return
|
|
}
|
|
M.prototype.Vm.call(this, a, b)
|
|
};
|
|
z.defineProperty(V, {
|
|
Cz: "archetypeNodeData"
|
|
}, function() {
|
|
return this.Mk
|
|
}, function(a) {
|
|
var b = this.Mk;
|
|
b !== a && (null !== a && z.l(a, Object, V, "archetypeNodeData"), this.Mk = a, this.j("archetypeNodeData", b, a))
|
|
});
|
|
V.prototype.pn = function(a) {
|
|
if (void 0 !== a) {
|
|
var b = this.Mk;
|
|
if (null !== b) {
|
|
var c = this.ne(a);
|
|
null === c && (c = this.copyNodeData(b), z.Ra(c, this.Vj, a), this.rl(c))
|
|
}
|
|
return a
|
|
}
|
|
};
|
|
z.defineProperty(V, {
|
|
Ep: "linkFromKeyProperty"
|
|
}, function() {
|
|
return this.Th
|
|
}, function(a) {
|
|
var b = this.Th;
|
|
b !== a && (xg(a, V, "linkFromKeyProperty"), this.Th = a, this.j("linkFromKeyProperty", b, a))
|
|
});
|
|
V.prototype.getFromKeyForLinkData = V.prototype.Ll = function(a) {
|
|
if (null !== a) {
|
|
var b = this.Th;
|
|
if ("" !== b && (b = z.tb(a, b), void 0 !== b)) {
|
|
if (yg(b)) return b;
|
|
z.k("FromKey value for link data " + a + " is not a number or a string: " + b)
|
|
}
|
|
}
|
|
};
|
|
V.prototype.setFromKeyForLinkData = V.prototype.Kx = function(a, b) {
|
|
null === b && (b = void 0);
|
|
void 0 === b || yg(b) || z.ic(b, "number or string", V, "setFromKeyForLinkData:key");
|
|
if (null !== a) {
|
|
var c = this.Th;
|
|
if ("" !== c)
|
|
if (b = this.pn(b), this.sh(a)) {
|
|
var d = z.tb(a, c);
|
|
d !== b && (Dg(this, d, a), z.Ra(a, c, b), null === this.ne(b) && Cg(this, b, a), wg(this, "linkFromKey", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
z.defineProperty(V, {
|
|
Gp: "linkToKeyProperty"
|
|
}, function() {
|
|
return this.Uh
|
|
}, function(a) {
|
|
var b = this.Uh;
|
|
b !== a && (xg(a, V, "linkToKeyProperty"), this.Uh = a, this.j("linkToKeyProperty", b, a))
|
|
});
|
|
V.prototype.getToKeyForLinkData = V.prototype.Ml = function(a) {
|
|
if (null !== a) {
|
|
var b = this.Uh;
|
|
if ("" !== b && (b = z.tb(a, b), void 0 !== b)) {
|
|
if (yg(b)) return b;
|
|
z.k("ToKey value for link data " + a + " is not a number or a string: " + b)
|
|
}
|
|
}
|
|
};
|
|
V.prototype.setToKeyForLinkData = V.prototype.Ox = function(a, b) {
|
|
null === b && (b = void 0);
|
|
void 0 === b || yg(b) || z.ic(b, "number or string", V, "setToKeyForLinkData:key");
|
|
if (null !== a) {
|
|
var c = this.Uh;
|
|
if ("" !== c)
|
|
if (b = this.pn(b), this.sh(a)) {
|
|
var d = z.tb(a, c);
|
|
d !== b && (Dg(this, d, a), z.Ra(a, c, b), null === this.ne(b) && Cg(this, b, a), wg(this, "linkToKey", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
z.defineProperty(V, {
|
|
Xt: "linkFromPortIdProperty"
|
|
}, function() {
|
|
return this.tm
|
|
}, function(a) {
|
|
var b = this.tm;
|
|
b !== a && (xg(a, V, "linkFromPortIdProperty"), this.tm = a, this.j("linkFromPortIdProperty", b, a))
|
|
});
|
|
V.prototype.getFromPortIdForLinkData = V.prototype.MH = function(a) {
|
|
if (null === a) return "";
|
|
var b = this.tm;
|
|
if ("" === b) return "";
|
|
a = z.tb(a, b);
|
|
return void 0 === a ? "" : a
|
|
};
|
|
V.prototype.setFromPortIdForLinkData = V.prototype.PA = function(a, b) {
|
|
z.g(b, "string", V, "setFromPortIdForLinkData:portname");
|
|
if (null !== a) {
|
|
var c = this.tm;
|
|
if ("" !== c)
|
|
if (this.sh(a)) {
|
|
var d = z.tb(a, c);
|
|
void 0 === d && (d = "");
|
|
d !== b && (z.Ra(a, c, b), wg(this, "linkFromPortId", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
z.defineProperty(V, {
|
|
Zt: "linkToPortIdProperty"
|
|
}, function() {
|
|
return this.um
|
|
}, function(a) {
|
|
var b = this.um;
|
|
b !== a && (xg(a, V, "linkToPortIdProperty"), this.um = a, this.j("linkToPortIdProperty", b, a))
|
|
});
|
|
V.prototype.getToPortIdForLinkData = V.prototype.PH = function(a) {
|
|
if (null === a) return "";
|
|
var b = this.um;
|
|
if ("" === b) return "";
|
|
a = z.tb(a, b);
|
|
return void 0 === a ? "" : a
|
|
};
|
|
V.prototype.setToPortIdForLinkData = V.prototype.SA = function(a, b) {
|
|
z.g(b, "string", V, "setToPortIdForLinkData:portname");
|
|
if (null !== a) {
|
|
var c = this.um;
|
|
if ("" !== c)
|
|
if (this.sh(a)) {
|
|
var d = z.tb(a, c);
|
|
void 0 === d && (d = "");
|
|
d !== b && (z.Ra(a, c, b), wg(this, "linkToPortId", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
z.defineProperty(V, {
|
|
Yt: "linkLabelKeysProperty"
|
|
}, function() {
|
|
return this.ug
|
|
}, function(a) {
|
|
var b = this.ug;
|
|
b !== a && (xg(a, V, "linkLabelKeysProperty"), this.ug = a, this.j("linkLabelKeysProperty", b, a))
|
|
});
|
|
V.prototype.getLabelKeysForLinkData = V.prototype.qk = function(a) {
|
|
if (null === a) return z.xj;
|
|
var b = this.ug;
|
|
if ("" === b) return z.xj;
|
|
a = z.tb(a, b);
|
|
return void 0 === a ? z.xj : a
|
|
};
|
|
V.prototype.setLabelKeysForLinkData = V.prototype.KF = function(a, b) {
|
|
z.nt(b, V, "setLabelKeysForLinkData:arr");
|
|
if (null !== a) {
|
|
var c = this.ug;
|
|
if ("" !== c)
|
|
if (this.sh(a)) {
|
|
var d = z.tb(a, c);
|
|
void 0 === d && (d = z.xj);
|
|
if (d !== b) {
|
|
for (var e = z.bb(d), g = 0; g < e; g++) {
|
|
var h = z.Ya(d, g);
|
|
Dg(this, h, a)
|
|
}
|
|
z.Ra(a, c, b);
|
|
e = z.bb(b);
|
|
for (g = 0; g < e; g++) h = z.Ya(b, g), null === this.ne(h) && Cg(this, h, a);
|
|
wg(this, "linkLabelKeys", Sf, c, a, d, b);
|
|
"string" === typeof c && this.Mb(a, c)
|
|
}
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
V.prototype.addLabelKeyForLinkData = V.prototype.zz = function(a, b) {
|
|
if (null !== b && void 0 !== b && (yg(b) || z.ic(b, "number or string", V, "addLabelKeyForLinkData:key"), null !== a)) {
|
|
var c = this.ug;
|
|
if ("" !== c) {
|
|
var d = z.tb(a, c);
|
|
void 0 === d ? (c = [], c.push(b), this.KF(a, c)) : z.isArray(d) ? 0 <= z.Dz(d, b) || (z.aj(d, Infinity, b), this.sh(a) && (null === this.ne(b) && Cg(this, b, a), wg(this, "linkLabelKeys", Uf, c, a, null, b))) : z.k(c + " property is not an Array; cannot addLabelKeyForLinkData: " + a)
|
|
}
|
|
}
|
|
};
|
|
V.prototype.removeLabelKeyForLinkData = V.prototype.nF = function(a, b) {
|
|
if (null !== b && void 0 !== b && (yg(b) || z.ic(b, "number or string", V, "removeLabelKeyForLinkData:key"), null !== a)) {
|
|
var c = this.ug;
|
|
if ("" !== c) {
|
|
var d = z.tb(a, c);
|
|
if (z.isArray(d)) {
|
|
var e = z.Dz(d, b);
|
|
0 > e || (z.hi(d, e), this.sh(a) && (Dg(this, b, a), wg(this, "linkLabelKeys", Vf, c, a, b, null)))
|
|
} else void 0 !== d && z.k(c + " property is not an Array; cannot removeLabelKeyforLinkData: " + a)
|
|
}
|
|
}
|
|
};
|
|
z.defineProperty(V, {
|
|
Jg: "linkDataArray"
|
|
}, function() {
|
|
return this.vf
|
|
}, function(a) {
|
|
var b = this.vf;
|
|
if (b !== a) {
|
|
z.nt(a, V, "linkDataArray");
|
|
this.hd.clear();
|
|
for (var c = z.bb(a), d = 0; d < c; d++) {
|
|
var e = z.Ya(a, d);
|
|
if (!z.Za(e)) {
|
|
z.k("GraphLinksModel.linkDataArray must only contain Objects, not: " + e);
|
|
return
|
|
}
|
|
z.It(e)
|
|
}
|
|
this.vf = a;
|
|
if ("" !== this.oj) {
|
|
for (var g = new J(Object), d = 0; d < c; d++) {
|
|
var e = z.Ya(a, d),
|
|
h = this.lf(e);
|
|
void 0 === h ? g.add(e) : null !== this.hd.na(h) ? g.add(e) : this.hd.add(h, e)
|
|
}
|
|
for (d = g.i; d.next();) e = d.value, this.nA(e), g = this.lf(e),
|
|
void 0 !== g && this.hd.add(g, e)
|
|
}
|
|
g = new K(Object);
|
|
for (d = 0; d < c; d++) e = z.Ya(a, d), g.add(e);
|
|
this.sm = g;
|
|
wg(this, "linkDataArray", Sf, "linkDataArray", this, b, a);
|
|
for (d = 0; d < c; d++) e = z.Ya(a, d), Ug(this, e)
|
|
}
|
|
});
|
|
z.defineProperty(V, {
|
|
oj: "linkKeyProperty"
|
|
}, function() {
|
|
return this.dl
|
|
}, function(a) {
|
|
var b = this.dl;
|
|
if (b !== a) {
|
|
xg(a, V, "linkKeyProperty");
|
|
this.dl = a;
|
|
this.hd.clear();
|
|
for (var c = z.bb(this.Jg), d = 0; d < c; d++) {
|
|
var e = z.Ya(this.Jg, d),
|
|
g = this.lf(e);
|
|
void 0 !== g && this.hd.add(g, e)
|
|
}
|
|
this.j("linkKeyProperty", b, a)
|
|
}
|
|
});
|
|
V.prototype.getKeyForLinkData = V.prototype.lf = function(a) {
|
|
if (null !== a) {
|
|
var b = this.dl;
|
|
if ("" !== b && (b = z.tb(a, b), void 0 !== b)) {
|
|
if (yg(b)) return b;
|
|
z.k("Key value for link data " + a + " is not a number or a string: " + b)
|
|
}
|
|
}
|
|
};
|
|
V.prototype.setKeyForLinkData = V.prototype.JF = function(a, b) {
|
|
void 0 !== b && null !== b && yg(b) || z.ic(b, "number or string", V, "setKeyForLinkData:key");
|
|
if (null !== a) {
|
|
var c = this.dl;
|
|
if ("" !== c)
|
|
if (this.sh(a)) {
|
|
var d = z.tb(a, c);
|
|
d !== b && null === this.zt(b) && (z.Ra(a, c, b), this.hd.remove(d), this.hd.add(b, a), wg(this, "linkKey", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
z.defineProperty(V, {
|
|
PK: "makeUniqueLinkKeyFunction"
|
|
}, function() {
|
|
return this.Bo
|
|
}, function(a) {
|
|
var b = this.Bo;
|
|
b !== a && (null !== a && z.g(a, "function", V, "makeUniqueLinkKeyFunction"), this.Bo = a, this.j("makeUniqueLinkKeyFunction", b, a))
|
|
});
|
|
V.prototype.findLinkDataForKey = V.prototype.zt = function(a) {
|
|
null === a && z.k("GraphLinksModel.findLinkDataForKey:key must not be null");
|
|
return void 0 !== a && yg(a) ? this.hd.na(a) : null
|
|
};
|
|
V.prototype.makeLinkDataKeyUnique = V.prototype.nA = function(a) {
|
|
if (null !== a) {
|
|
var b = this.dl;
|
|
if ("" !== b) {
|
|
var c = this.lf(a);
|
|
if (void 0 === c || this.hd.contains(c)) {
|
|
var d = this.Bo;
|
|
if (null !== d && (c = d(this, a), void 0 !== c && null !== c && !this.hd.contains(c))) {
|
|
z.Ra(a, b, c);
|
|
return
|
|
}
|
|
if ("string" === typeof c) {
|
|
for (d = 2; this.hd.contains(c + d);) d++;
|
|
z.Ra(a, b, c + d)
|
|
} else if (void 0 === c || "number" === typeof c) {
|
|
for (d = -this.hd.count - 1; this.hd.contains(d);) d--;
|
|
z.Ra(a, b, d)
|
|
} else z.k("GraphLinksModel.getKeyForLinkData returned something other than a string or a number: " +
|
|
c)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
V.prototype.containsLinkData = V.prototype.sh = function(a) {
|
|
return null === a ? !1 : this.sm.contains(a)
|
|
};
|
|
V.prototype.addLinkData = V.prototype.gt = function(a) {
|
|
if (null !== a) {
|
|
if (void 0 === z.nd(a)) z.kc(a);
|
|
else if (this.sh(a)) return;
|
|
Vg(this, a, !0)
|
|
}
|
|
};
|
|
|
|
function Vg(a, b, c) {
|
|
if ("" !== a.oj) {
|
|
var d = a.lf(b);
|
|
if (void 0 !== d && a.hd.na(d) === b) return;
|
|
a.nA(b);
|
|
d = a.lf(b);
|
|
if (void 0 === d) {
|
|
z.k("GraphLinksModel.makeLinkDataKeyUnique failed on " + b + ". Data not added to model.");
|
|
return
|
|
}
|
|
a.hd.add(d, b)
|
|
}
|
|
a.sm.add(b);
|
|
if (c) {
|
|
var e = z.bb(a.vf);
|
|
z.aj(a.vf, e, b)
|
|
}
|
|
wg(a, "linkDataArray", Uf, "linkDataArray", a, null, b, null, e);
|
|
Ug(a, b)
|
|
}
|
|
V.prototype.addLinkDataCollection = function(a) {
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) this.gt(z.Ya(a, c));
|
|
else
|
|
for (a = a.i; a.next();) this.gt(a.value)
|
|
};
|
|
V.prototype.removeLinkData = V.prototype.Dx = function(a) {
|
|
null !== a && Wg(this, a, !0)
|
|
};
|
|
|
|
function Wg(a, b, c) {
|
|
a.sm.remove(b);
|
|
var d = a.lf(b);
|
|
void 0 !== d && a.hd.remove(d);
|
|
if (c) {
|
|
var e = a.vf.indexOf(b);
|
|
if (0 > e) return;
|
|
z.hi(a.vf, e)
|
|
}
|
|
wg(a, "linkDataArray", Vf, "linkDataArray", a, b, null, e, null);
|
|
c = a.Ll(b);
|
|
Dg(a, c, b);
|
|
c = a.Ml(b);
|
|
Dg(a, c, b);
|
|
d = a.qk(b);
|
|
if (z.isArray(d))
|
|
for (var e = z.bb(d), g = 0; g < e; g++) c = z.Ya(d, g), Dg(a, c, b)
|
|
}
|
|
V.prototype.removeLinkDataCollection = function(a) {
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) this.Dx(z.Ya(a, c));
|
|
else
|
|
for (a = a.i; a.next();) this.Dx(a.value)
|
|
};
|
|
|
|
function Ug(a, b) {
|
|
var c = a.Ll(b),
|
|
c = a.pn(c);
|
|
null === a.ne(c) && Cg(a, c, b);
|
|
c = a.Ml(b);
|
|
c = a.pn(c);
|
|
null === a.ne(c) && Cg(a, c, b);
|
|
var d = a.qk(b);
|
|
if (z.isArray(d))
|
|
for (var e = z.bb(d), g = 0; g < e; g++) c = z.Ya(d, g), null === a.ne(c) && Cg(a, c, b)
|
|
}
|
|
z.defineProperty(V, {
|
|
eK: "copyLinkDataFunction"
|
|
}, function() {
|
|
return this.Qn
|
|
}, function(a) {
|
|
var b = this.Qn;
|
|
b !== a && (null !== a && z.g(a, "function", V, "copyLinkDataFunction"), this.Qn = a, this.j("copyLinkDataFunction", b, a))
|
|
});
|
|
V.prototype.copyLinkData = V.prototype.Pw = function(a) {
|
|
if (null === a) return null;
|
|
var b = null,
|
|
b = this.Qn,
|
|
b = null !== b ? b(a, this) : Eg(this, a, !0);
|
|
z.Za(b) && (z.kc(b), "" !== this.Th && z.Ra(b, this.Th, void 0), "" !== this.Uh && z.Ra(b, this.Uh, void 0), "" !== this.ug && z.Ra(b, this.ug, []));
|
|
return b
|
|
};
|
|
z.defineProperty(V, {
|
|
eu: "nodeIsGroupProperty"
|
|
}, function() {
|
|
return this.Eo
|
|
}, function(a) {
|
|
var b = this.Eo;
|
|
b !== a && (xg(a, V, "nodeIsGroupProperty"), this.Eo = a, this.j("nodeIsGroupProperty", b, a))
|
|
});
|
|
V.prototype.isGroupForNodeData = V.prototype.hA = function(a) {
|
|
if (null === a) return !1;
|
|
var b = this.Eo;
|
|
return "" === b ? !1 : z.tb(a, b) ? !0 : !1
|
|
};
|
|
z.defineProperty(V, {
|
|
Pp: "nodeGroupKeyProperty"
|
|
}, function() {
|
|
return this.jh
|
|
}, function(a) {
|
|
var b = this.jh;
|
|
b !== a && (xg(a, V, "nodeGroupKeyProperty"), this.jh = a, this.j("nodeGroupKeyProperty", b, a))
|
|
});
|
|
z.defineProperty(V, {
|
|
Zm: "copiesGroupKeyOfNodeData"
|
|
}, function() {
|
|
return this.Dq
|
|
}, function(a) {
|
|
this.Dq !== a && (z.g(a, "boolean", V, "copiesGroupKeyOfNodeData"), this.Dq = a)
|
|
});
|
|
V.prototype.getGroupKeyForNodeData = V.prototype.fn = function(a) {
|
|
if (null !== a) {
|
|
var b = this.jh;
|
|
if ("" !== b && (b = z.tb(a, b), void 0 !== b)) {
|
|
if (yg(b)) return b;
|
|
z.k("GroupKey value for node data " + a + " is not a number or a string: " + b)
|
|
}
|
|
}
|
|
};
|
|
V.prototype.setGroupKeyForNodeData = V.prototype.Lx = function(a, b) {
|
|
null === b && (b = void 0);
|
|
void 0 === b || yg(b) || z.ic(b, "number or string", V, "setGroupKeyForNodeData:key");
|
|
if (null !== a) {
|
|
var c = this.jh;
|
|
if ("" !== c)
|
|
if (this.le(a)) {
|
|
var d = z.tb(a, c);
|
|
d !== b && (Dg(this, d, a), z.Ra(a, c, b), null === this.ne(b) && Cg(this, b, a), wg(this, "nodeGroupKey", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
V.prototype.copyNodeData = function(a) {
|
|
if (null === a) return null;
|
|
a = M.prototype.copyNodeData.call(this, a);
|
|
this.Zm || "" === this.jh || void 0 === z.tb(a, this.jh) || z.Ra(a, this.jh, void 0);
|
|
return a
|
|
};
|
|
V.prototype.setDataProperty = function(a, b, c) {
|
|
u && (z.g(a, "object", V, "setDataProperty:data"), z.g(b, "string", V, "setDataProperty:propname"), "" === b && z.k("GraphLinksModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
|
|
if (this.le(a))
|
|
if (b === this.qj) this.Mx(a, c);
|
|
else {
|
|
if (b === this.qn) {
|
|
this.Jx(a, c);
|
|
return
|
|
}
|
|
if (b === this.Pp) {
|
|
this.Lx(a, c);
|
|
return
|
|
}
|
|
b === this.eu && z.k("GraphLinksModel.setDataProperty: property name must not be the nodeIsGroupProperty: " + b)
|
|
}
|
|
else if (this.sh(a)) {
|
|
if (b ===
|
|
this.Ep) {
|
|
this.Kx(a, c);
|
|
return
|
|
}
|
|
if (b === this.Gp) {
|
|
this.Ox(a, c);
|
|
return
|
|
}
|
|
if (b === this.Xt) {
|
|
this.PA(a, c);
|
|
return
|
|
}
|
|
if (b === this.Zt) {
|
|
this.SA(a, c);
|
|
return
|
|
}
|
|
if (b === this.oj) {
|
|
this.JF(a, c);
|
|
return
|
|
}
|
|
if (b === this.Wt) {
|
|
this.IF(a, c);
|
|
return
|
|
}
|
|
if (b === this.Yt) {
|
|
this.KF(a, c);
|
|
return
|
|
}
|
|
} else !Hg && a instanceof O && (Hg = !0, z.trace('GraphLinksModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), z.trace(" Is that really your intent?"));
|
|
var d = z.tb(a, b);
|
|
d !== c && (z.Ra(a, b, c), this.DA(a, b, d, c))
|
|
};
|
|
f = V.prototype;
|
|
f.ju = function(a, b) {
|
|
M.prototype.ju.call(this, a, b);
|
|
for (var c = this.vc.i; c.next();) this.KA(c.value, a, b);
|
|
for (c = this.sm.i; c.next();) {
|
|
var d = c.value,
|
|
e = a,
|
|
g = b;
|
|
if (this.Ll(d) === e) {
|
|
var h = this.Th;
|
|
z.Ra(d, h, g);
|
|
wg(this, "linkFromKey", Sf, h, d, e, g);
|
|
"string" === typeof h && this.Mb(d, h)
|
|
}
|
|
this.Ml(d) === e && (h = this.Uh, z.Ra(d, h, g), wg(this, "linkToKey", Sf, h, d, e, g), "string" === typeof h && this.Mb(d, h));
|
|
var k = this.qk(d);
|
|
if (z.isArray(k))
|
|
for (var l = z.bb(k), h = this.ug, m = 0; m < l; m++) z.Ya(k, m) === e && (z.LD(k, m, g), wg(this, "linkLabelKeys", Uf, h, d, e,
|
|
g))
|
|
}
|
|
};
|
|
f.KA = function(a, b, c) {
|
|
if (this.fn(a) === b) {
|
|
var d = this.jh;
|
|
z.Ra(a, d, c);
|
|
wg(this, "nodeGroupKey", Sf, d, a, b, c);
|
|
"string" === typeof d && this.Mb(a, d)
|
|
}
|
|
};
|
|
f.cB = function() {
|
|
M.prototype.cB.call(this);
|
|
for (var a = this.Jg, b = z.bb(a), c = 0; c < b; c++) {
|
|
var d = z.Ya(a, c);
|
|
Ug(this, d)
|
|
}
|
|
};
|
|
f.Up = function(a) {
|
|
M.prototype.Up.call(this, a);
|
|
a = this.pb(a);
|
|
var b = Bg(this, a);
|
|
if (null !== b) {
|
|
for (var c = new J(Object), b = b.i; b.next();) {
|
|
var d = b.value;
|
|
if (this.le(d)) {
|
|
if (this.fn(d) === a) {
|
|
var e = this.jh;
|
|
wg(this, "nodeGroupKey", Sf, e, d, a, a);
|
|
"string" === typeof e && this.Mb(d, e);
|
|
c.add(d)
|
|
}
|
|
} else {
|
|
this.Ll(d) === a && (e = this.Th, wg(this, "linkFromKey", Sf, e, d, a, a), "string" === typeof e && this.Mb(d, e), c.add(d));
|
|
this.Ml(d) === a && (e = this.Uh, wg(this, "linkToKey", Sf, e, d, a, a), "string" === typeof e && this.Mb(d, e), c.add(d));
|
|
var g = this.qk(d);
|
|
if (z.isArray(g))
|
|
for (var h =
|
|
z.bb(g), e = this.ug, k = 0; k < h; k++) z.Ya(g, k) === a && (wg(this, "linkLabelKeys", Uf, e, d, a, a), c.add(d))
|
|
}
|
|
}
|
|
for (c = c.i; c.next();) Dg(this, a, c.value)
|
|
}
|
|
};
|
|
f.Tp = function(a) {
|
|
M.prototype.Tp.call(this, a);
|
|
var b = this.fn(a);
|
|
null === this.ne(b) && Cg(this, b, a)
|
|
};
|
|
f.Bu = function(a) {
|
|
M.prototype.Bu.call(this, a);
|
|
var b = this.fn(a);
|
|
Dg(this, b, a)
|
|
};
|
|
z.defineProperty(V, {
|
|
Wt: "linkCategoryProperty"
|
|
}, function() {
|
|
return this.rm
|
|
}, function(a) {
|
|
var b = this.rm;
|
|
b !== a && (xg(a, V, "linkCategoryProperty"), this.rm = a, this.j("linkCategoryProperty", b, a))
|
|
});
|
|
V.prototype.getCategoryForLinkData = V.prototype.ax = function(a) {
|
|
if (null === a) return "";
|
|
var b = this.rm;
|
|
if ("" === b) return "";
|
|
b = z.tb(a, b);
|
|
if (void 0 === b) return "";
|
|
if ("string" === typeof b) return b;
|
|
z.k("getCategoryForLinkData found a non-string category for " + a + ": " + b);
|
|
return ""
|
|
};
|
|
V.prototype.setCategoryForLinkData = V.prototype.IF = function(a, b) {
|
|
z.g(b, "string", V, "setCategoryForLinkData:cat");
|
|
if (null !== a) {
|
|
var c = this.rm;
|
|
if ("" !== c)
|
|
if (this.sh(a)) {
|
|
var d = z.tb(a, c);
|
|
void 0 === d && (d = "");
|
|
d !== b && (z.Ra(a, c, b), wg(this, "linkCategory", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
|
|
function ng(a) {
|
|
1 < arguments.length && z.k("TreeModel constructor can only take one optional argument, the Array of node data.");
|
|
M.call(this);
|
|
this.kh = "parent";
|
|
this.Eq = !1;
|
|
this.Am = "parentLinkCategory";
|
|
void 0 !== a && (this.gg = a)
|
|
}
|
|
z.Qa(ng, M);
|
|
z.ia("TreeModel", ng);
|
|
ng.prototype.cloneProtected = function(a) {
|
|
M.prototype.cloneProtected.call(this, a);
|
|
a.kh = this.kh;
|
|
a.Eq = this.Eq;
|
|
a.Am = this.Am
|
|
};
|
|
ng.prototype.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
if (2 <= a) return this.ZA();
|
|
var b = ("" !== this.name ? this.name : "") + " TreeModel";
|
|
if (0 < a) {
|
|
b += "\n node data:";
|
|
a = this.gg;
|
|
for (var c = z.bb(a), d = 0; d < c; d++) var e = z.Ya(a, d),
|
|
b = b + (" " + this.pb(e) + ":" + ka(e))
|
|
}
|
|
return b
|
|
};
|
|
ng.prototype.Cn = function() {
|
|
var a = M.prototype.Cn.call(this),
|
|
b = "";
|
|
"parent" !== this.Qp && "string" === typeof this.Qp && (b += ',\n "nodeParentKeyProperty": ' + this.quote(this.Qp));
|
|
return a + b
|
|
};
|
|
ng.prototype.hu = function(a) {
|
|
M.prototype.hu.call(this, a);
|
|
a.nodeParentKeyProperty && (this.Qp = a.nodeParentKeyProperty)
|
|
};
|
|
ng.prototype.pn = function(a) {
|
|
return a
|
|
};
|
|
z.defineProperty(ng, {
|
|
Qp: "nodeParentKeyProperty"
|
|
}, function() {
|
|
return this.kh
|
|
}, function(a) {
|
|
var b = this.kh;
|
|
b !== a && (xg(a, ng, "nodeParentKeyProperty"), this.kh = a, this.j("nodeParentKeyProperty", b, a))
|
|
});
|
|
z.defineProperty(ng, {
|
|
$m: "copiesParentKeyOfNodeData"
|
|
}, function() {
|
|
return this.Eq
|
|
}, function(a) {
|
|
this.Eq !== a && (z.g(a, "boolean", ng, "copiesParentKeyOfNodeData"), this.Eq = a)
|
|
});
|
|
ng.prototype.getParentKeyForNodeData = ng.prototype.gn = function(a) {
|
|
if (null !== a) {
|
|
var b = this.kh;
|
|
if ("" !== b && (b = z.tb(a, b), void 0 !== b)) {
|
|
if (yg(b)) return b;
|
|
z.k("ParentKey value for node data " + a + " is not a number or a string: " + b)
|
|
}
|
|
}
|
|
};
|
|
ng.prototype.setParentKeyForNodeData = ng.prototype.Eh = function(a, b) {
|
|
null === b && (b = void 0);
|
|
void 0 === b || yg(b) || z.ic(b, "number or string", ng, "setParentKeyForNodeData:key");
|
|
if (null !== a) {
|
|
var c = this.kh;
|
|
if ("" !== c)
|
|
if (b = this.pn(b), this.le(a)) {
|
|
var d = z.tb(a, c);
|
|
d !== b && (Dg(this, d, a), z.Ra(a, c, b), null === this.ne(b) && Cg(this, b, a), wg(this, "nodeParentKey", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
z.defineProperty(ng, {
|
|
kL: "parentLinkCategoryProperty"
|
|
}, function() {
|
|
return this.Am
|
|
}, function(a) {
|
|
var b = this.Am;
|
|
b !== a && (xg(a, ng, "parentLinkCategoryProperty"), this.Am = a, this.j("parentLinkCategoryProperty", b, a))
|
|
});
|
|
ng.prototype.getParentLinkCategoryForNodeData = ng.prototype.OH = function(a) {
|
|
if (null === a) return "";
|
|
var b = this.Am;
|
|
if ("" === b) return "";
|
|
b = z.tb(a, b);
|
|
if (void 0 === b) return "";
|
|
if ("string" === typeof b) return b;
|
|
z.k("getParentLinkCategoryForNodeData found a non-string category for " + a + ": " + b);
|
|
return ""
|
|
};
|
|
ng.prototype.setParentLinkCategoryForNodeData = ng.prototype.jJ = function(a, b) {
|
|
z.g(b, "string", ng, "setParentLinkCategoryForNodeData:cat");
|
|
if (null !== a) {
|
|
var c = this.Am;
|
|
if ("" !== c)
|
|
if (this.le(a)) {
|
|
var d = z.tb(a, c);
|
|
void 0 === d && (d = "");
|
|
d !== b && (z.Ra(a, c, b), wg(this, "parentLinkCategory", Sf, c, a, d, b), "string" === typeof c && this.Mb(a, c))
|
|
} else z.Ra(a, c, b)
|
|
}
|
|
};
|
|
ng.prototype.copyNodeData = function(a) {
|
|
if (null === a) return null;
|
|
a = M.prototype.copyNodeData.call(this, a);
|
|
this.$m || "" === this.kh || void 0 === z.tb(a, this.kh) || z.Ra(a, this.kh, void 0);
|
|
return a
|
|
};
|
|
ng.prototype.setDataProperty = function(a, b, c) {
|
|
u && (z.g(a, "object", ng, "setDataProperty:data"), z.g(b, "string", ng, "setDataProperty:propname"), "" === b && z.k("TreeModel.setDataProperty: property name must not be an empty string when setting " + a + " to " + c));
|
|
if (this.le(a))
|
|
if (b === this.qj) this.Mx(a, c);
|
|
else {
|
|
if (b === this.qn) {
|
|
this.Jx(a, c);
|
|
return
|
|
}
|
|
if (b === this.Qp) {
|
|
this.Eh(a, c);
|
|
return
|
|
}
|
|
}
|
|
else !Hg && a instanceof O && (Hg = !0, z.trace('TreeModel.setDataProperty is modifying a GraphObject, "' + a.toString() + '"'), z.trace(" Is that really your intent?"));
|
|
var d = z.tb(a, b);
|
|
d !== c && (z.Ra(a, b, c), this.DA(a, b, d, c))
|
|
};
|
|
f = ng.prototype;
|
|
f.ju = function(a, b) {
|
|
M.prototype.ju.call(this, a, b);
|
|
for (var c = this.vc.i; c.next();) this.KA(c.value, a, b)
|
|
};
|
|
f.KA = function(a, b, c) {
|
|
if (this.gn(a) === b) {
|
|
var d = this.kh;
|
|
z.Ra(a, d, c);
|
|
wg(this, "nodeParentKey", Sf, d, a, b, c);
|
|
"string" === typeof d && this.Mb(a, d)
|
|
}
|
|
};
|
|
f.Up = function(a) {
|
|
M.prototype.Up.call(this, a);
|
|
a = this.pb(a);
|
|
var b = Bg(this, a);
|
|
if (null !== b) {
|
|
for (var c = new J(Object), b = b.i; b.next();) {
|
|
var d = b.value;
|
|
if (this.le(d) && this.gn(d) === a) {
|
|
var e = this.kh;
|
|
wg(this, "nodeParentKey", Sf, e, d, a, a);
|
|
"string" === typeof e && this.Mb(d, e);
|
|
c.add(d)
|
|
}
|
|
}
|
|
for (c = c.i; c.next();) Dg(this, a, c.value)
|
|
}
|
|
};
|
|
f.Tp = function(a) {
|
|
M.prototype.Tp.call(this, a);
|
|
var b = this.gn(a),
|
|
b = this.pn(b);
|
|
null === this.ne(b) && Cg(this, b, a)
|
|
};
|
|
f.Bu = function(a) {
|
|
M.prototype.Bu.call(this, a);
|
|
var b = this.gn(a);
|
|
Dg(this, b, a)
|
|
};
|
|
|
|
function Xg(a, b, c) {
|
|
z.kc(this);
|
|
this.G = !1;
|
|
void 0 === a ? a = "" : z.g(a, "string", Xg, "constructor:targetprop");
|
|
void 0 === b ? b = a : z.g(b, "string", Xg, "constructor:sourceprop");
|
|
void 0 === c ? c = null : null !== c && z.g(c, "function", Xg, "constructor:conv");
|
|
this.fD = -1;
|
|
this.Ag = null;
|
|
this.Xo = a;
|
|
this.Wo = this.Ts = 0;
|
|
this.pw = null;
|
|
this.qr = !1;
|
|
this.No = b;
|
|
this.Bq = c;
|
|
this.Nr = Yg;
|
|
this.uq = null
|
|
}
|
|
z.ia("Binding", Xg);
|
|
Xg.prototype.copy = function() {
|
|
var a = new Xg;
|
|
a.Xo = this.Xo;
|
|
a.Ts = this.Ts;
|
|
a.Wo = this.Wo;
|
|
a.pw = this.pw;
|
|
a.qr = this.qr;
|
|
a.No = this.No;
|
|
a.Bq = this.Bq;
|
|
a.Nr = this.Nr;
|
|
a.uq = this.uq;
|
|
return a
|
|
};
|
|
var Yg;
|
|
Xg.OneWay = Yg = z.s(Xg, "OneWay", 1);
|
|
var Zg;
|
|
Xg.TwoWay = Zg = z.s(Xg, "TwoWay", 2);
|
|
Xg.parseEnum = function(a, b) {
|
|
z.g(a, "function", Xg, "parseEnum:ctor");
|
|
z.Ba(b, a, Xg, "parseEnum:defval");
|
|
return function(c) {
|
|
c = Ja(a, c);
|
|
return null === c ? b : c
|
|
}
|
|
};
|
|
var ka;
|
|
Xg.toString = ka = function(a) {
|
|
var b = a;
|
|
z.Za(a) && (a.text ? b = a.text : a.name ? b = a.name : void 0 !== a.key ? b = a.key : void 0 !== a.id ? b = a.id : a.constructor === Object && (a.Text ? b = a.Text : a.Name ? b = a.Name : void 0 !== a.Key ? b = a.Key : void 0 !== a.Id ? b = a.Id : void 0 !== a.ID && (b = a.ID)));
|
|
return void 0 === b ? "undefined" : null === b ? "null" : b.toString()
|
|
};
|
|
Xg.prototype.toString = function() {
|
|
return "Binding(" + this.yu + ":" + this.OF + (-1 !== this.Wl ? " " + this.Wl : "") + " " + this.mode.name + ")"
|
|
};
|
|
Xg.prototype.freeze = function() {
|
|
this.G = !0;
|
|
return this
|
|
};
|
|
Xg.prototype.Wa = function() {
|
|
this.G = !1;
|
|
return this
|
|
};
|
|
z.defineProperty(Xg, {
|
|
Wl: null
|
|
}, function() {
|
|
return this.fD
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
z.g(a, "number", Xg, "targetId");
|
|
this.fD = a
|
|
});
|
|
z.defineProperty(Xg, {
|
|
yu: "targetProperty"
|
|
}, function() {
|
|
return this.Xo
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
z.g(a, "string", Xg, "targetProperty");
|
|
this.Xo = a
|
|
});
|
|
z.defineProperty(Xg, {
|
|
yn: "sourceName"
|
|
}, function() {
|
|
return this.pw
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
null !== a && z.g(a, "string", Xg, "sourceName");
|
|
this.pw = a;
|
|
null !== a && (this.qr = !1)
|
|
});
|
|
z.defineProperty(Xg, {
|
|
St: "isToModel"
|
|
}, function() {
|
|
return this.qr
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
z.g(a, "boolean", Xg, "isToModel");
|
|
this.qr = a
|
|
});
|
|
z.defineProperty(Xg, {
|
|
OF: "sourceProperty"
|
|
}, function() {
|
|
return this.No
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
z.g(a, "string", Xg, "sourceProperty");
|
|
this.No = a
|
|
});
|
|
z.defineProperty(Xg, {
|
|
hH: "converter"
|
|
}, function() {
|
|
return this.Bq
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
null !== a && z.g(a, "function", Xg, "converter");
|
|
this.Bq = a
|
|
});
|
|
z.defineProperty(Xg, {
|
|
XG: "backConverter"
|
|
}, function() {
|
|
return this.uq
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
null !== a && z.g(a, "function", Xg, "backConverter");
|
|
this.uq = a
|
|
});
|
|
z.defineProperty(Xg, {
|
|
mode: "mode"
|
|
}, function() {
|
|
return this.Nr
|
|
}, function(a) {
|
|
this.G && z.oa(this);
|
|
z.Ba(a, Xg, Xg, "mode");
|
|
this.Nr = a
|
|
});
|
|
Xg.prototype.makeTwoWay = Xg.prototype.yI = function(a) {
|
|
void 0 === a && (a = null);
|
|
null !== a && z.g(a, "function", Xg, "makeTwoWay");
|
|
this.mode = Zg;
|
|
this.XG = a;
|
|
return this
|
|
};
|
|
Xg.prototype.ofObject = Xg.prototype.ux = function(a) {
|
|
void 0 === a && (a = "");
|
|
u && z.g(a, "string", Xg, "ofObject:srcname");
|
|
this.yn = a;
|
|
this.St = !1;
|
|
return this
|
|
};
|
|
Xg.prototype.ofModel = function() {
|
|
this.yn = null;
|
|
this.St = !0;
|
|
return this
|
|
};
|
|
Xg.prototype.ofData = function() {
|
|
this.yn = null;
|
|
this.St = !1;
|
|
return this
|
|
};
|
|
|
|
function $g(a, b, c) {
|
|
a = a.yn;
|
|
var d = null;
|
|
return d = null === a || "" === a ? b : "." === a ? c : ".." === a ? c.U : b.oe(a)
|
|
}
|
|
Xg.prototype.updateTarget = Xg.prototype.fG = function(a, b, c) {
|
|
var d = this.No;
|
|
if (void 0 === c || "" === d || d === c) {
|
|
c = this.Xo;
|
|
var e = this.Bq;
|
|
if (null === e && "" === c) z.trace("Binding error: target property is the empty string: " + this.toString());
|
|
else {
|
|
u && "string" === typeof c && ("function" !== typeof a.setAttribute && 0 < c.length && "_" !== c[0] && !z.ex(a, c) ? z.trace("Binding error: undefined target property: " + c + " on " + a.toString()) : "name" === c && a instanceof O && z.trace("Binding error: cannot modify GraphObject.name on " + a.toString()));
|
|
var g = b;
|
|
"" !== d && (g = z.tb(b, d));
|
|
if (void 0 !== g)
|
|
if (null === e) "" !== c && z.Ra(a, c, g);
|
|
else try {
|
|
if ("" !== c) {
|
|
var h = e(g, a);
|
|
u && void 0 === h && z.trace('Binding warning: conversion function returned undefined when setting target property "' + c + '" on ' + a.toString() + ", function is: " + e);
|
|
z.Ra(a, c, h)
|
|
} else e(g, a)
|
|
} catch (k) {
|
|
u && z.trace("Binding error: " + k.toString() + ' setting target property "' + c + '" on ' + a.toString() + " with conversion function: " + e)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
Xg.prototype.updateSource = Xg.prototype.Rx = function(a, b, c, d) {
|
|
void 0 === d && (d = null);
|
|
if (this.Nr === Zg) {
|
|
var e = this.Xo;
|
|
if (void 0 === c || e === c) {
|
|
c = this.No;
|
|
var g = this.uq;
|
|
if (null !== g || "" !== c) {
|
|
var h = a;
|
|
"" !== e && (h = z.tb(a, e));
|
|
if (void 0 !== h)
|
|
if (a = null !== d ? d.ha : null, null === g) null !== a ? (u && a.qj === c && a.le(b) && z.trace("Binding error: cannot have TwoWay Binding on node data key property: " + this.toString()), a.setDataProperty(b, c, h)) : z.Ra(b, c, h);
|
|
else try {
|
|
if ("" !== c) {
|
|
var k = g(h, b, a);
|
|
null !== a ? (u && (a.qj === c && a.le(b) && z.trace("Binding error: cannot have TwoWay Binding on node data key property: " +
|
|
this.toString()), void 0 === k && z.trace('Binding warning: conversion function returned undefined when setting source property "' + c + '" on ' + b.toString() + ", function is: " + g)), a.setDataProperty(b, c, k)) : z.Ra(b, c, k)
|
|
} else g(h, b, a)
|
|
} catch (l) {
|
|
u && z.trace("Binding error: " + l.toString() + ' setting source property "' + c + '" on ' + b.toString() + " with conversion function: " + g)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
function og() {
|
|
this.mG = (new J(Rf)).freeze();
|
|
this.Ub = "";
|
|
this.mC = !1
|
|
}
|
|
z.ia("Transaction", og);
|
|
og.prototype.toString = function(a) {
|
|
var b = "Transaction: " + this.name + " " + this.Yf.count.toString() + (this.Nt ? "" : ", incomplete");
|
|
if (void 0 !== a && 0 < a) {
|
|
a = this.Yf.count;
|
|
for (var c = 0; c < a; c++) {
|
|
var d = this.Yf.ea(c);
|
|
null !== d && (b += "\n " + d.toString())
|
|
}
|
|
}
|
|
return b
|
|
};
|
|
og.prototype.clear = og.prototype.clear = function() {
|
|
var a = this.Yf;
|
|
a.Wa();
|
|
for (var b = a.count - 1; 0 <= b; b--) {
|
|
var c = a.ea(b);
|
|
null !== c && c.clear()
|
|
}
|
|
a.clear();
|
|
a.freeze()
|
|
};
|
|
og.prototype.canUndo = og.prototype.canUndo = function() {
|
|
return this.Nt
|
|
};
|
|
og.prototype.undo = og.prototype.undo = function() {
|
|
if (this.canUndo())
|
|
for (var a = this.Yf.count - 1; 0 <= a; a--) {
|
|
var b = this.Yf.ea(a);
|
|
null !== b && b.undo()
|
|
}
|
|
};
|
|
og.prototype.canRedo = og.prototype.canRedo = function() {
|
|
return this.Nt
|
|
};
|
|
og.prototype.redo = og.prototype.redo = function() {
|
|
if (this.canRedo())
|
|
for (var a = this.Yf.count, b = 0; b < a; b++) {
|
|
var c = this.Yf.ea(b);
|
|
null !== c && c.redo()
|
|
}
|
|
};
|
|
z.w(og, {
|
|
Yf: "changes"
|
|
}, function() {
|
|
return this.mG
|
|
});
|
|
z.defineProperty(og, {
|
|
name: "name"
|
|
}, function() {
|
|
return this.Ub
|
|
}, function(a) {
|
|
this.Ub = a
|
|
});
|
|
z.defineProperty(og, {
|
|
Nt: "isComplete"
|
|
}, function() {
|
|
return this.mC
|
|
}, function(a) {
|
|
this.mC = a
|
|
});
|
|
|
|
function Wf() {
|
|
this.bz = new K(M);
|
|
this.af = !1;
|
|
this.qG = (new J(og)).freeze();
|
|
this.bh = -1;
|
|
this.BC = 999;
|
|
this.Hi = !1;
|
|
this.ev = null;
|
|
this.pl = 0;
|
|
this.oy = !1;
|
|
u && (this.oy = !0);
|
|
this.ih = (new J("string")).freeze();
|
|
this.Do = new J("number");
|
|
this.Ky = !0;
|
|
this.Wy = !1
|
|
}
|
|
z.ia("UndoManager", Wf);
|
|
Wf.prototype.toString = function(a) {
|
|
for (var b = "UndoManager " + this.ij + "<" + this.history.count + "<=" + this.$E, b = b + "[", c = this.eF.count, d = 0; d < c; d++) 0 < d && (b += " "), b += this.eF.ea(d);
|
|
b += "]";
|
|
if (void 0 !== a && 0 < a)
|
|
for (c = this.history.count, d = 0; d < c; d++) b += "\n " + this.history.ea(d).toString(a - 1);
|
|
return b
|
|
};
|
|
Wf.prototype.clear = Wf.prototype.clear = function() {
|
|
var a = this.history;
|
|
a.Wa();
|
|
for (var b = a.count - 1; 0 <= b; b--) {
|
|
var c = a.ea(b);
|
|
null !== c && c.clear()
|
|
}
|
|
a.clear();
|
|
this.bh = -1;
|
|
a.freeze();
|
|
this.Hi = !1;
|
|
this.ev = null;
|
|
this.pl = 0;
|
|
this.ih.Wa();
|
|
this.ih.clear();
|
|
this.ih.freeze();
|
|
this.Do.clear()
|
|
};
|
|
Wf.prototype.addModel = Wf.prototype.PG = function(a) {
|
|
this.bz.add(a)
|
|
};
|
|
Wf.prototype.removeModel = Wf.prototype.YI = function(a) {
|
|
this.bz.remove(a)
|
|
};
|
|
Wf.prototype.startTransaction = Wf.prototype.Wb = function(a) {
|
|
void 0 === a && (a = "");
|
|
null === a && (a = "");
|
|
if (this.qb) return !1;
|
|
!0 === this.Ky && (this.Ky = !1, this.pl++, this.kd("StartingFirstTransaction", a, this.dj), 0 < this.pl && this.pl--);
|
|
this.isEnabled && (this.ih.Wa(), this.ih.add(a), this.ih.freeze(), null === this.dj ? this.Do.add(0) : this.Do.add(this.dj.Yf.count));
|
|
this.pl++;
|
|
var b = 1 === this.Gh;
|
|
b && this.kd("StartedTransaction", a, this.dj);
|
|
return b
|
|
};
|
|
Wf.prototype.commitTransaction = Wf.prototype.Jd = function(a) {
|
|
void 0 === a && (a = "");
|
|
return ah(this, !0, a)
|
|
};
|
|
Wf.prototype.rollbackTransaction = Wf.prototype.Vp = function() {
|
|
return ah(this, !1, "")
|
|
};
|
|
|
|
function ah(a, b, c) {
|
|
if (a.qb) return !1;
|
|
a.Ez && 1 > a.Gh && z.trace("Ending transaction without having started a transaction: " + c);
|
|
var d = 1 === a.Gh;
|
|
d && b && a.isEnabled && a.kd("CommittingTransaction", c, a.dj);
|
|
var e = 0;
|
|
if (0 < a.Gh && (a.pl--, a.isEnabled)) {
|
|
var g = a.ih.count;
|
|
0 < g && ("" === c && (c = a.ih.ea(0)), a.ih.Wa(), a.ih.dd(g - 1), a.ih.freeze());
|
|
g = a.Do.count;
|
|
0 < g && (e = a.Do.ea(g - 1), a.Do.dd(g - 1))
|
|
}
|
|
g = a.dj;
|
|
if (d) {
|
|
if (b) {
|
|
a.Wy = !1;
|
|
if (a.isEnabled && null !== g) {
|
|
b = g;
|
|
b.Nt = !0;
|
|
b.name = c;
|
|
d = a.history;
|
|
d.Wa();
|
|
for (e = d.count - 1; e > a.ij; e--) g = d.ea(e), null !==
|
|
g && g.clear(), d.dd(e), a.Wy = !0;
|
|
e = a.$E;
|
|
0 === e && (e = 1);
|
|
0 < e && d.count >= e && (g = d.ea(0), null !== g && g.clear(), d.dd(0), a.bh--);
|
|
d.add(b);
|
|
a.bh++;
|
|
d.freeze();
|
|
g = b
|
|
}
|
|
a.kd("CommittedTransaction", c, g)
|
|
} else {
|
|
a.Hi = !0;
|
|
try {
|
|
a.isEnabled && null !== g && (g.Nt = !0, g.undo())
|
|
} finally {
|
|
a.kd("RolledBackTransaction", c, g), a.Hi = !1
|
|
}
|
|
null !== g && g.clear()
|
|
}
|
|
a.ev = null;
|
|
return !0
|
|
}
|
|
if (a.isEnabled && !b && null !== g) {
|
|
a = e;
|
|
c = g.Yf;
|
|
for (b = c.count - 1; b >= a; b--) d = c.ea(b), null !== d && d.undo(), c.Wa(), c.dd(b);
|
|
c.freeze()
|
|
}
|
|
return !1
|
|
}
|
|
Wf.prototype.canUndo = Wf.prototype.canUndo = function() {
|
|
if (!this.isEnabled || 0 < this.Gh || this.qb) return !1;
|
|
var a = this.aG;
|
|
return null !== a && a.canUndo() ? !0 : !1
|
|
};
|
|
Wf.prototype.undo = Wf.prototype.undo = function() {
|
|
if (this.canUndo()) {
|
|
var a = this.aG;
|
|
try {
|
|
this.kd("StartingUndo", "Undo", a), this.Hi = !0, this.bh--, a.undo()
|
|
} catch (b) {
|
|
z.trace("undo error: " + b.toString())
|
|
} finally {
|
|
this.Hi = !1, this.kd("FinishedUndo", "Undo", a)
|
|
}
|
|
}
|
|
};
|
|
Wf.prototype.canRedo = Wf.prototype.canRedo = function() {
|
|
if (!this.isEnabled || 0 < this.Gh || this.qb) return !1;
|
|
var a = this.$F;
|
|
return null !== a && a.canRedo() ? !0 : !1
|
|
};
|
|
Wf.prototype.redo = Wf.prototype.redo = function() {
|
|
if (this.canRedo()) {
|
|
var a = this.$F;
|
|
try {
|
|
this.kd("StartingRedo", "Redo", a), this.Hi = !0, this.bh++, a.redo()
|
|
} catch (b) {
|
|
z.trace("redo error: " + b.toString())
|
|
} finally {
|
|
this.Hi = !1, this.kd("FinishedRedo", "Redo", a)
|
|
}
|
|
}
|
|
};
|
|
Wf.prototype.kd = function(a, b, c) {
|
|
void 0 === c && (c = null);
|
|
var d = new Rf;
|
|
d.Dc = Tf;
|
|
d.propertyName = a;
|
|
d.object = c;
|
|
d.oldValue = b;
|
|
for (a = this.HI; a.next();) b = a.value, d.ha = b, b.Kw(d)
|
|
};
|
|
Wf.prototype.handleChanged = Wf.prototype.DE = function(a) {
|
|
if (this.isEnabled && !this.qb && !this.skipsEvent(a)) {
|
|
var b = this.dj;
|
|
null === b && (this.ev = b = new og);
|
|
var c = a.copy(),
|
|
b = b.Yf;
|
|
b.Wa();
|
|
b.add(c);
|
|
b.freeze();
|
|
this.Ez && 0 >= this.Gh && !this.Ky && (a = a.h, null !== a && !1 === a.kn || z.trace("Change not within a transaction: " + c.toString()))
|
|
}
|
|
};
|
|
Wf.prototype.skipsEvent = function(a) {
|
|
if (null === a || 0 > a.Dc.value) return !0;
|
|
a = a.object;
|
|
if (a instanceof O) {
|
|
if (a = a.layer, null !== a && a.Nc) return !0
|
|
} else if (a instanceof tg && a.Nc) return !0;
|
|
return !1
|
|
};
|
|
z.w(Wf, {
|
|
HI: "models"
|
|
}, function() {
|
|
return this.bz.i
|
|
});
|
|
z.defineProperty(Wf, {
|
|
isEnabled: "isEnabled"
|
|
}, function() {
|
|
return this.af
|
|
}, function(a) {
|
|
this.af = a
|
|
});
|
|
z.w(Wf, {
|
|
aG: "transactionToUndo"
|
|
}, function() {
|
|
return 0 <= this.ij && this.ij <= this.history.count - 1 ? this.history.ea(this.ij) : null
|
|
});
|
|
z.w(Wf, {
|
|
$F: "transactionToRedo"
|
|
}, function() {
|
|
return this.ij < this.history.count - 1 ? this.history.ea(this.ij + 1) : null
|
|
});
|
|
z.w(Wf, {
|
|
qb: "isUndoingRedoing"
|
|
}, function() {
|
|
return this.Hi
|
|
});
|
|
z.w(Wf, {
|
|
history: "history"
|
|
}, function() {
|
|
return this.qG
|
|
});
|
|
z.defineProperty(Wf, {
|
|
$E: "maxHistoryLength"
|
|
}, function() {
|
|
return this.BC
|
|
}, function(a) {
|
|
this.BC = a
|
|
});
|
|
z.w(Wf, {
|
|
ij: "historyIndex"
|
|
}, function() {
|
|
return this.bh
|
|
});
|
|
z.w(Wf, {
|
|
dj: "currentTransaction"
|
|
}, function() {
|
|
return this.ev
|
|
});
|
|
z.w(Wf, {
|
|
Gh: "transactionLevel"
|
|
}, function() {
|
|
return this.pl
|
|
});
|
|
z.w(Wf, {
|
|
QE: "isInTransaction"
|
|
}, function() {
|
|
return 0 < this.pl
|
|
});
|
|
z.defineProperty(Wf, {
|
|
Ez: "checksTransactionLevel"
|
|
}, function() {
|
|
return this.oy
|
|
}, function(a) {
|
|
this.oy = a
|
|
});
|
|
z.w(Wf, {
|
|
eF: "nestedTransactionNames"
|
|
}, function() {
|
|
return this.ih
|
|
});
|
|
|
|
function ra() {
|
|
0 < arguments.length && z.od(ra);
|
|
z.kc(this);
|
|
this.Z = null;
|
|
this.zB = !1;
|
|
this.TB = this.AB = !0;
|
|
this.CB = this.DB = this.UB = this.EB = !1;
|
|
this.hl = this.iy = null;
|
|
this.yD = 1.05;
|
|
this.RB = 1;
|
|
this.Xy = NaN;
|
|
this.yC = null;
|
|
this.xz = NaN;
|
|
this.wz = Jd;
|
|
this.Ui = null
|
|
}
|
|
z.ia("CommandHandler", ra);
|
|
var bh = null,
|
|
ch = "";
|
|
ra.prototype.toString = function() {
|
|
return "CommandHandler"
|
|
};
|
|
z.w(ra, {
|
|
h: "diagram"
|
|
}, function() {
|
|
return this.Z
|
|
});
|
|
ra.prototype.Sc = function(a) {
|
|
u && null !== a && z.l(a, C, ra, "setDiagram");
|
|
this.Z = a
|
|
};
|
|
ra.prototype.doKeyDown = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q,
|
|
c = z.rk ? b.$t : b.control,
|
|
d = b.shift,
|
|
e = b.alt,
|
|
g = b.key;
|
|
!c || "C" !== g && "Insert" !== g ? c && "X" === g || d && "Del" === g ? this.canCutSelection() && this.cutSelection() : c && "V" === g || d && "Insert" === g ? this.canPasteSelection() && this.pasteSelection() : c && "Y" === g || e && d && "Backspace" === g ? this.canRedo() && this.redo() : c && "Z" === g || e && "Backspace" === g ? this.canUndo() && this.undo() : "Del" === g || "Backspace" === g ? this.canDeleteSelection() && this.deleteSelection() : c && "A" === g ? this.canSelectAll() &&
|
|
this.selectAll() : "Esc" === g ? this.canStopCommand() && this.stopCommand() : "Up" === g ? a.ye && (c ? a.scroll("pixel", "up") : a.scroll("line", "up")) : "Down" === g ? a.ye && (c ? a.scroll("pixel", "down") : a.scroll("line", "down")) : "Left" === g ? a.xe && (c ? a.scroll("pixel", "left") : a.scroll("line", "left")) : "Right" === g ? a.xe && (c ? a.scroll("pixel", "right") : a.scroll("line", "right")) : "PageUp" === g ? d && a.xe ? a.scroll("page", "left") : a.ye && a.scroll("page", "up") : "PageDown" === g ? d && a.xe ? a.scroll("page", "right") : a.ye && a.scroll("page", "down") : "Home" ===
|
|
g ? c && a.ye ? a.scroll("document", "up") : !c && a.xe && a.scroll("document", "left") : "End" === g ? c && a.ye ? a.scroll("document", "down") : !c && a.xe && a.scroll("document", "right") : " " === g ? this.canScrollToPart() && this.scrollToPart() : "Subtract" === g ? this.canDecreaseZoom() && this.decreaseZoom() : "Add" === g ? this.canIncreaseZoom() && this.increaseZoom() : c && "0" === g ? this.canResetZoom() && this.resetZoom() : d && "Z" === g ? this.canZoomToFit() && this.zoomToFit() : c && !d && "G" === g ? this.canGroupSelection() && this.groupSelection() : c && d && "G" === g ? this.canUngroupSelection() &&
|
|
this.ungroupSelection() : b.event && 113 === b.event.which ? this.canEditTextBlock() && this.editTextBlock() : b.event && 93 === b.event.which ? this.canShowContextMenu() && this.showContextMenu() : b.bubbles = !0 : this.canCopySelection() && this.copySelection()
|
|
}
|
|
};
|
|
ra.prototype.doKeyUp = function() {
|
|
var a = this.h;
|
|
null !== a && (a.Q.bubbles = !0)
|
|
};
|
|
ra.prototype.stopCommand = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.eb;
|
|
b instanceof dh && a.xf && a.Mw();
|
|
null !== b && b.doCancel()
|
|
}
|
|
};
|
|
ra.prototype.canStopCommand = function() {
|
|
return !0
|
|
};
|
|
ra.prototype.selectAll = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
a.ta();
|
|
try {
|
|
a.gc = "wait";
|
|
a.Ja("ChangingSelection");
|
|
for (var b = a.ni; b.next();) b.value.kb = !0;
|
|
for (var c = a.Lg; c.next();) c.value.kb = !0;
|
|
for (var d = a.links; d.next();) d.value.kb = !0
|
|
} finally {
|
|
a.Ja("ChangedSelection"), a.gc = ""
|
|
}
|
|
}
|
|
};
|
|
ra.prototype.canSelectAll = function() {
|
|
var a = this.h;
|
|
return null !== a && a.xf
|
|
};
|
|
ra.prototype.deleteSelection = function() {
|
|
var a = this.h;
|
|
if (null !== a && !a.Ja("SelectionDeleting", a.selection)) try {
|
|
a.gc = "wait";
|
|
a.Wb("Delete");
|
|
a.Ja("ChangingSelection");
|
|
for (var b = new K(D), c = a.selection.i; c.next();) eh(b, c.value, !0, this.qH ? Infinity : 0, this.hE, function(a) {
|
|
return a.canDelete()
|
|
});
|
|
a.JA(b, !0);
|
|
a.Ja("SelectionDeleted", b)
|
|
} finally {
|
|
a.Ja("ChangedSelection"), a.Jd("Delete"), a.gc = ""
|
|
}
|
|
};
|
|
ra.prototype.canDeleteSelection = function() {
|
|
var a = this.h;
|
|
return null === a || a.jb || a.Ef || !a.Sm || 0 === a.selection.count ? !1 : !0
|
|
};
|
|
|
|
function eh(a, b, c, d, e, g) {
|
|
void 0 === g && (g = null);
|
|
if (!(a.contains(b) || null !== g && !g(b) || b instanceof da))
|
|
if (a.add(b), b instanceof E) {
|
|
if (c && b instanceof F)
|
|
for (var h = b.Hc; h.next();) eh(a, h.value, c, d, e, g);
|
|
if (e)
|
|
for (h = b.ee; h.next();) {
|
|
var k = h.value;
|
|
if (!a.contains(k)) {
|
|
var l = k.Y,
|
|
m = k.da;
|
|
null !== l && a.contains(l) && null !== m && a.contains(m) ? eh(a, k, c, d, e, g) : null !== l && null !== m || eh(a, k, c, d, e, g)
|
|
}
|
|
}
|
|
if (1 < d)
|
|
for (b = b.tE(); b.next();) eh(a, b.value, c, d - 1, e, g)
|
|
} else if (b instanceof G)
|
|
for (h = b.Hf; h.next();) eh(a, h.value, c, d, e, g)
|
|
}
|
|
ra.prototype.hp = function(a, b, c) {
|
|
var d = new na(D, D);
|
|
for (a = a.i; a.next();) fh(this, a.value, b, d, c);
|
|
if (null !== b) {
|
|
c = b.ha;
|
|
a = !1;
|
|
null !== b.hb.me && (a = b.hb.me.fj);
|
|
for (var e = new K(G), g = new na(G, G), h = d.i; h.next();) {
|
|
var k = h.value;
|
|
if (k instanceof G) {
|
|
var l = k;
|
|
a || null !== l.Y && null !== l.da || e.add(l)
|
|
} else if (c instanceof ng && k instanceof E && null !== k.data) {
|
|
var l = c,
|
|
m = k,
|
|
k = h.key,
|
|
n = k.Hl();
|
|
null !== n && (n = d.na(n), null !== n ? (l.Eh(m.data, l.pb(n.data)), l = b.Zf(m.data), k = k.pp(), null !== k && null !== l && g.add(k, l)) : l.Eh(m.data, void 0))
|
|
}
|
|
}
|
|
0 < e.count &&
|
|
b.JA(e, !1);
|
|
if (0 < g.count)
|
|
for (c = g.i; c.next();) d.add(c.key, c.value)
|
|
}
|
|
if (null !== b && (b = b.ha, c = b.RG, null !== c)) {
|
|
var p = new na;
|
|
d.each(function(a) {
|
|
null !== a.key.data && p.add(a.key.data, a.value.data)
|
|
});
|
|
c(p, b, this.h.ha)
|
|
}
|
|
for (b = d.i; b.next();) b.value.Mb();
|
|
return d
|
|
};
|
|
|
|
function fh(a, b, c, d, e) {
|
|
if (null === b || e && !b.canCopy()) return null;
|
|
if (d.contains(b)) return d.na(b);
|
|
var g = null,
|
|
h = b.data;
|
|
if (null !== h && null !== c) {
|
|
var k = c.ha;
|
|
b instanceof G ? k instanceof V && (h = k.Pw(h), z.Za(h) && (k.gt(h), g = c.Zf(h))) : (h = k.copyNodeData(h), z.Za(h) && (k.rl(h), g = c.uh(h)))
|
|
} else gh(b), g = b.copy(), null !== g && (null !== c ? c.add(g) : null !== h && a.iH && (k = a.h.ha, h = g instanceof G && k instanceof V ? k.Pw(h) : k.copyNodeData(h), z.Za(h) && (g.data = h)));
|
|
if (!(g instanceof D)) return null;
|
|
g.kb = !1;
|
|
g.wh = !1;
|
|
d.add(b, g);
|
|
if (b instanceof E) {
|
|
for (h = b.ee; h.next();) {
|
|
k = h.value;
|
|
if (k.Y === b) {
|
|
var l = d.na(k);
|
|
null !== l && (l.Y = g)
|
|
}
|
|
k.da === b && (l = d.na(k), null !== l && (l.da = g))
|
|
}
|
|
if (b instanceof F && g instanceof F)
|
|
for (h = g, b = b.Hc; b.next();) k = fh(a, b.value, c, d, e), k instanceof G || null === k || (k.Va = h)
|
|
} else if (b instanceof G)
|
|
for (h = b.Y, null !== h && (h = d.na(h), null !== h && (g.Y = h)), h = b.da, null !== h && (h = d.na(h), null !== h && (g.da = h)), b = b.Hf; b.next();) h = fh(a, b.value, c, d, e), null !== h && (h.Nd = g);
|
|
return g
|
|
}
|
|
ra.prototype.copySelection = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
for (var b = new K(D), a = a.selection.i; a.next();) eh(b, a.value, !0, this.lH ? Infinity : 0, this.jH, function(a) {
|
|
return a.canCopy()
|
|
});
|
|
this.copyToClipboard(b)
|
|
}
|
|
};
|
|
ra.prototype.canCopySelection = function() {
|
|
var a = this.h;
|
|
return null !== a && a.kk && a.Az && 0 !== a.selection.count ? !0 : !1
|
|
};
|
|
ra.prototype.cutSelection = function() {
|
|
this.copySelection();
|
|
this.deleteSelection()
|
|
};
|
|
ra.prototype.canCutSelection = function() {
|
|
var a = this.h;
|
|
return null !== a && !a.jb && !a.Ef && a.kk && a.Sm && a.Az && 0 !== a.selection.count ? !0 : !1
|
|
};
|
|
ra.prototype.copyToClipboard = function(a) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = null;
|
|
if (null === a) bh = null, ch = "";
|
|
else {
|
|
var c = b.ha,
|
|
d = !1,
|
|
e = !1,
|
|
g = null;
|
|
try {
|
|
if (c instanceof ng) {
|
|
var h = c,
|
|
d = h.$m;
|
|
h.$m = this.ZD
|
|
}
|
|
c instanceof V && (h = c, e = h.Zm, h.Zm = this.YD);
|
|
g = b.hp(a, null, !0)
|
|
} finally {
|
|
c instanceof ng && (c.$m = d), c instanceof V && (c.Zm = e), c = new J(D), c.$c(g), bh = c, ch = b.ha.Al
|
|
}
|
|
}
|
|
b.Ja("ClipboardChanged", c)
|
|
}
|
|
};
|
|
ra.prototype.pasteFromClipboard = function() {
|
|
var a = new K(D),
|
|
b = bh;
|
|
if (null === b) return a;
|
|
var c = this.h;
|
|
if (null === c || ch !== c.ha.Al) return a;
|
|
var d = c.ha,
|
|
e = !1,
|
|
g = !1,
|
|
h = null;
|
|
try {
|
|
if (d instanceof ng) {
|
|
var k = d,
|
|
e = k.$m;
|
|
k.$m = this.ZD
|
|
}
|
|
d instanceof V && (k = d, g = k.Zm, k.Zm = this.YD);
|
|
h = c.hp(b, c, !1)
|
|
} finally {
|
|
for (d instanceof ng && (d.$m = e), d instanceof V && (d.Zm = g), b = h.i; b.next();) c = b.value, d = b.key, c.location.F() || (d.location.F() ? c.location = d.location : !c.position.F() && d.position.F() && (c.position = d.position)), a.add(c)
|
|
}
|
|
return a
|
|
};
|
|
ra.prototype.pasteSelection = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null !== b) try {
|
|
b.gc = "wait";
|
|
b.Wb("Paste");
|
|
b.Ja("ChangingSelection");
|
|
var c = this.pasteFromClipboard();
|
|
0 < c.count && hh(b);
|
|
for (var d = c.i; d.next();) d.value.kb = !0;
|
|
b.Ja("ChangedSelection");
|
|
if (null !== a) {
|
|
var e = b.computePartsBounds(b.selection);
|
|
if (e) {
|
|
var g = b.hb.me;
|
|
null === g && (g = new ih, g.Sc(b));
|
|
var h = g.computeEffectiveCollection(b.selection);
|
|
g.moveParts(h, new N(a.x - e.ra, a.y - e.za), !1)
|
|
}
|
|
}
|
|
b.Ja("ClipboardPasted", c)
|
|
} finally {
|
|
b.Jd("Paste"), b.gc =
|
|
""
|
|
}
|
|
};
|
|
ra.prototype.canPasteSelection = function() {
|
|
var a = this.h;
|
|
return null === a || a.jb || a.Ef || !a.ap || !a.Az || null === bh || ch !== a.ha.Al ? !1 : !0
|
|
};
|
|
ra.prototype.undo = function() {
|
|
var a = this.h;
|
|
null !== a && a.pa.undo()
|
|
};
|
|
ra.prototype.canUndo = function() {
|
|
var a = this.h;
|
|
return null === a || a.jb || a.Ef ? !1 : a.GD && a.pa.canUndo()
|
|
};
|
|
ra.prototype.redo = function() {
|
|
var a = this.h;
|
|
null !== a && a.pa.redo()
|
|
};
|
|
ra.prototype.canRedo = function() {
|
|
var a = this.h;
|
|
return null === a || a.jb || a.Ef ? !1 : a.GD && a.pa.canRedo()
|
|
};
|
|
ra.prototype.decreaseZoom = function(a) {
|
|
void 0 === a && (a = 1 / this.Tx);
|
|
z.p(a, ra, "decreaseZoom:factor");
|
|
var b = this.h;
|
|
null !== b && b.wl === jh && (a *= b.scale, a < b.yh || a > b.xh || (b.scale = a))
|
|
};
|
|
ra.prototype.canDecreaseZoom = function(a) {
|
|
void 0 === a && (a = 1 / this.Tx);
|
|
z.p(a, ra, "canDecreaseZoom:factor");
|
|
var b = this.h;
|
|
if (null === b || b.wl !== jh) return !1;
|
|
a *= b.scale;
|
|
return a < b.yh || a > b.xh ? !1 : b.Jw
|
|
};
|
|
ra.prototype.increaseZoom = function(a) {
|
|
void 0 === a && (a = this.Tx);
|
|
z.p(a, ra, "increaseZoom:factor");
|
|
var b = this.h;
|
|
null !== b && b.wl === jh && (a *= b.scale, a < b.yh || a > b.xh || (b.scale = a))
|
|
};
|
|
ra.prototype.canIncreaseZoom = function(a) {
|
|
void 0 === a && (a = this.Tx);
|
|
z.p(a, ra, "canIncreaseZoom:factor");
|
|
var b = this.h;
|
|
if (null === b || b.wl !== jh) return !1;
|
|
a *= b.scale;
|
|
return a < b.yh || a > b.xh ? !1 : b.Jw
|
|
};
|
|
ra.prototype.resetZoom = function(a) {
|
|
void 0 === a && (a = this.Rw);
|
|
z.p(a, ra, "resetZoom:newscale");
|
|
var b = this.h;
|
|
null === b || a < b.yh || a > b.xh || (b.scale = a)
|
|
};
|
|
ra.prototype.canResetZoom = function(a) {
|
|
void 0 === a && (a = this.Rw);
|
|
z.p(a, ra, "canResetZoom:newscale");
|
|
var b = this.h;
|
|
return null === b || a < b.yh || a > b.xh ? !1 : b.Jw
|
|
};
|
|
ra.prototype.zoomToFit = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.scale,
|
|
c = a.position;
|
|
b === this.xz && !isNaN(this.Xy) && a.ad.N(this.wz) ? (a.scale = this.Xy, a.position = this.yC, this.xz = NaN, this.wz = Jd) : (this.Xy = b, this.yC = c.copy(), a.zoomToFit(), this.xz = a.scale, this.wz = a.ad.copy())
|
|
}
|
|
};
|
|
ra.prototype.canZoomToFit = function() {
|
|
var a = this.h;
|
|
return null === a ? !1 : a.Jw
|
|
};
|
|
ra.prototype.scrollToPart = function(a) {
|
|
void 0 === a && (a = null);
|
|
null !== a && z.l(a, D, ra, "part");
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
if (null === a) {
|
|
try {
|
|
null !== this.Ui && (this.Ui.next() ? a = this.Ui.value : this.Ui = null)
|
|
} catch (c) {
|
|
this.Ui = null
|
|
}
|
|
null === a && (0 < b.hn.count ? this.Ui = b.hn.i : 0 < b.selection.count && (this.Ui = b.selection.i), null !== this.Ui && this.Ui.next() && (a = this.Ui.value))
|
|
}
|
|
if (null !== a) {
|
|
var d = b.Ua;
|
|
d.sn("Scroll To Part");
|
|
var e = b.position.copy();
|
|
b.YG(a.W);
|
|
e.Mc(b.position) && d.oi()
|
|
}
|
|
}
|
|
};
|
|
ra.prototype.canScrollToPart = function(a) {
|
|
void 0 === a && (a = null);
|
|
null !== a && z.l(a, D, ra, "part");
|
|
a = this.h;
|
|
return null === a || 0 === a.selection.count && 0 === a.hn.count ? !1 : a.xe && a.ye
|
|
};
|
|
ra.prototype.collapseTree = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null !== b) try {
|
|
b.Wb("Collapse Tree");
|
|
b.Ua.sn("Collapse Tree");
|
|
var c = new J(E);
|
|
if (null !== a && a.vd) a.collapseTree(), c.add(a);
|
|
else
|
|
for (var d = b.selection.i; d.next();) {
|
|
var e = d.value;
|
|
e instanceof E && (a = e, a.vd && (a.collapseTree(), c.add(a)))
|
|
}
|
|
b.Ja("TreeCollapsed", c)
|
|
} finally {
|
|
b.Jd("Collapse Tree")
|
|
}
|
|
};
|
|
ra.prototype.canCollapseTree = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null === b || b.jb) return !1;
|
|
if (null !== a) {
|
|
if (!a.vd) return !1;
|
|
if (0 < a.$w().count) return !0
|
|
} else
|
|
for (a = b.selection.i; a.next();)
|
|
if (b = a.value, b instanceof E && b.vd && 0 < b.$w().count) return !0; return !1
|
|
};
|
|
ra.prototype.expandTree = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null !== b) try {
|
|
b.Wb("Expand Tree");
|
|
b.Ua.sn("Expand Tree");
|
|
var c = new J(E);
|
|
if (null === a || a.vd)
|
|
for (var d = b.selection.i; d.next();) {
|
|
var e = d.value;
|
|
e instanceof E && (a = e, a.vd || (a.expandTree(), c.add(a)))
|
|
} else a.expandTree(), c.add(a);
|
|
b.Ja("TreeExpanded", c)
|
|
} finally {
|
|
b.Jd("Expand Tree")
|
|
}
|
|
};
|
|
ra.prototype.canExpandTree = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null === b || b.jb) return !1;
|
|
if (null !== a) {
|
|
if (a.vd) return !1;
|
|
if (0 < a.$w().count) return !0
|
|
} else
|
|
for (a = b.selection.i; a.next();)
|
|
if (b = a.value, b instanceof E && !b.vd && 0 < b.$w().count) return !0; return !1
|
|
};
|
|
ra.prototype.groupSelection = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.ha;
|
|
if (b instanceof V) {
|
|
var c = this.HD;
|
|
if (null !== c) {
|
|
var d = null;
|
|
try {
|
|
a.gc = "wait";
|
|
a.Wb("Group");
|
|
a.Ja("ChangingSelection");
|
|
for (var e = new J(D), g = a.selection.i; g.next();) {
|
|
var h = g.value;
|
|
h.be() && h.canGroup() && e.add(h)
|
|
}
|
|
for (var k = new J(D), l = e.i; l.next();) {
|
|
for (var m = l.value, g = !1, n = e.i; n.next();)
|
|
if (m.li(n.value)) {
|
|
g = !0;
|
|
break
|
|
}
|
|
g || k.add(m)
|
|
}
|
|
if (0 < k.count) {
|
|
var p = k.first().Va;
|
|
if (null !== p)
|
|
for (; null !== p;) {
|
|
for (var e = !1, q = k.i; q.next();)
|
|
if (!q.value.li(p)) {
|
|
e = !0;
|
|
break
|
|
}
|
|
if (e) p = p.Va;
|
|
else break
|
|
}
|
|
if (c instanceof F) gh(c), d = c.copy(), null !== d && a.add(d);
|
|
else if (b.hA(c)) {
|
|
var r = b.copyNodeData(c);
|
|
z.Za(r) && (b.rl(r), d = a.Zw(r))
|
|
}
|
|
if (null !== d) {
|
|
null !== p && this.isValidMember(p, d) && (d.Va = p);
|
|
for (var s = k.i; s.next();) {
|
|
var t = s.value;
|
|
this.isValidMember(d, t) && (t.Va = d)
|
|
}
|
|
a.select(d)
|
|
}
|
|
}
|
|
a.Ja("ChangedSelection");
|
|
a.Ja("SelectionGrouped", d)
|
|
} finally {
|
|
a.Jd("Group"), a.gc = ""
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
ra.prototype.canGroupSelection = function() {
|
|
var a = this.h;
|
|
if (null === a || a.jb || a.Ef || !a.ap || !a.Ew || !(a.ha instanceof V) || null === this.HD) return !1;
|
|
for (a = a.selection.i; a.next();) {
|
|
var b = a.value;
|
|
if (b.be() && b.canGroup()) return !0
|
|
}
|
|
return !1
|
|
};
|
|
|
|
function kh(a) {
|
|
var b = z.rb();
|
|
for (a = a.i; a.next();) {
|
|
var c = a.value;
|
|
c instanceof G || b.push(c)
|
|
}
|
|
a = new K(D);
|
|
for (var c = b.length, d = 0; d < c; d++) {
|
|
for (var e = b[d], g = !0, h = 0; h < c; h++)
|
|
if (e.li(b[h])) {
|
|
g = !1;
|
|
break
|
|
}
|
|
g && a.add(e)
|
|
}
|
|
z.xa(b);
|
|
return a
|
|
}
|
|
ra.prototype.isValidMember = function(a, b) {
|
|
if (null === b || a === b || b instanceof G) return !1;
|
|
if (null !== a) {
|
|
if (a === b || a.li(b)) return !1;
|
|
var c = a.qA;
|
|
if (null !== c && !c(a, b) || null === a.data && null !== b.data || null !== a.data && null === b.data) return !1
|
|
}
|
|
c = this.qA;
|
|
return null !== c ? c(a, b) : !0
|
|
};
|
|
ra.prototype.ungroupSelection = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.ha;
|
|
if (c instanceof V) try {
|
|
b.gc = "wait";
|
|
b.Wb("Ungroup");
|
|
b.Ja("ChangingSelection");
|
|
var d = new J(F);
|
|
if (null !== a) d.add(a);
|
|
else
|
|
for (var e = b.selection.i; e.next();) {
|
|
var g = e.value;
|
|
g instanceof F && (a = g, a.canUngroup() && d.add(a))
|
|
}
|
|
if (0 < d.count) {
|
|
b.Mw();
|
|
for (var h = d.i; h.next();) {
|
|
var k = h.value;
|
|
k.expandSubGraph();
|
|
var l = k.Va,
|
|
m = null !== l && null !== l.data ? c.pb(l.data) : void 0,
|
|
n = new J(D);
|
|
n.$c(k.Hc);
|
|
for (var p = n.i; p.next();) {
|
|
var q =
|
|
p.value;
|
|
q.kb = !0;
|
|
if (!(q instanceof G)) {
|
|
var r = q.data;
|
|
null !== r ? c.Lx(r, m) : q.Va = l
|
|
}
|
|
}
|
|
b.remove(k)
|
|
}
|
|
}
|
|
b.Ja("ChangedSelection");
|
|
b.Ja("SelectionUngrouped", d, n)
|
|
} finally {
|
|
b.Jd("Ungroup"), b.gc = ""
|
|
}
|
|
}
|
|
};
|
|
ra.prototype.canUngroupSelection = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null === b || b.jb || b.Ef || !b.Sm || !b.Iw || !(b.ha instanceof V)) return !1;
|
|
if (null !== a) {
|
|
if (a.canUngroup()) return !0
|
|
} else
|
|
for (a = b.selection.i; a.next();)
|
|
if (b = a.value, b instanceof F && b.canUngroup()) return !0; return !1
|
|
};
|
|
ra.prototype.addTopLevelParts = function(a, b) {
|
|
for (var c = !0, d = kh(a).i; d.next();) {
|
|
var e = d.value;
|
|
null !== e.Va && (!b || this.isValidMember(null, e) ? e.Va = null : c = !1)
|
|
}
|
|
return c
|
|
};
|
|
ra.prototype.collapseSubGraph = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null !== b) try {
|
|
b.Wb("Collapse SubGraph");
|
|
b.Ua.sn("Collapse SubGraph");
|
|
var c = new J(F);
|
|
if (null !== a && a.re) a.collapseSubGraph(), c.add(a);
|
|
else
|
|
for (var d = b.selection.i; d.next();) {
|
|
var e = d.value;
|
|
e instanceof F && (a = e, a.re && (a.collapseSubGraph(), c.add(a)))
|
|
}
|
|
b.Ja("SubGraphCollapsed", c)
|
|
} finally {
|
|
b.Jd("Collapse SubGraph")
|
|
}
|
|
};
|
|
ra.prototype.canCollapseSubGraph = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null === b || b.jb) return !1;
|
|
if (null !== a) return a.re ? !0 : !1;
|
|
for (a = b.selection.i; a.next();)
|
|
if (b = a.value, b instanceof F && b.re) return !0;
|
|
return !1
|
|
};
|
|
ra.prototype.expandSubGraph = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null !== b) try {
|
|
b.Wb("Expand SubGraph");
|
|
b.Ua.sn("Expand SubGraph");
|
|
var c = new J(F);
|
|
if (null === a || a.re)
|
|
for (var d = b.selection.i; d.next();) {
|
|
var e = d.value;
|
|
e instanceof F && (a = e, a.re || (a.expandSubGraph(), c.add(a)))
|
|
} else a.expandSubGraph(), c.add(a);
|
|
b.Ja("SubGraphExpanded", c)
|
|
} finally {
|
|
b.Jd("Expand SubGraph")
|
|
}
|
|
};
|
|
ra.prototype.canExpandSubGraph = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null === b || b.jb) return !1;
|
|
if (null !== a) return a.re ? !1 : !0;
|
|
for (a = b.selection.i; a.next();)
|
|
if (b = a.value, b instanceof F && !b.re) return !0;
|
|
return !1
|
|
};
|
|
ra.prototype.editTextBlock = function(a) {
|
|
void 0 === a && (a = null);
|
|
null !== a && z.l(a, qa, ra, "editTextBlock");
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.hb.XA;
|
|
if (null !== c) {
|
|
if (null === a) {
|
|
a = null;
|
|
for (var d = b.selection.i; d.next();) {
|
|
var e = d.value;
|
|
if (e.canEdit()) {
|
|
a = e;
|
|
break
|
|
}
|
|
}
|
|
if (null === a) return;
|
|
a = a.yt(function(a) {
|
|
return a instanceof qa && a.Sz
|
|
})
|
|
}
|
|
null !== a && (b.eb = null, c.He = a, b.eb = c)
|
|
}
|
|
}
|
|
};
|
|
ra.prototype.canEditTextBlock = function(a) {
|
|
void 0 === a && (a = null);
|
|
null !== a && z.l(a, qa, ra, "canEditTextBlock");
|
|
var b = this.h;
|
|
if (null === b || b.jb || b.Ef || !b.Hw || null === b.hb.XA) return !1;
|
|
if (null !== a) {
|
|
if (a = a.ca, null !== a && a.canEdit()) return !0
|
|
} else
|
|
for (b = b.selection.i; b.next();)
|
|
if (a = b.value, a.canEdit() && (a = a.yt(function(a) {
|
|
return a instanceof qa && a.Sz
|
|
}), null !== a)) return !0; return !1
|
|
};
|
|
ra.prototype.showContextMenu = function(a) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.hb.Hz;
|
|
if (null !== c && (void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b), a = c.findObjectWithContextMenu(a), null !== a)) {
|
|
var d = new Pf,
|
|
e = null;
|
|
a instanceof O ? e = a.fb(ec) : b.hI || (e = b.xb, e = new N(e.x + e.width / 2, e.y + e.height / 2));
|
|
null !== e && (d.h = b, d.te = b.aB(e), d.ga = e, d.left = !1, d.right = !0, d.up = !0, b.Q = d);
|
|
b.eb = c;
|
|
uh(c, !1, a)
|
|
}
|
|
}
|
|
};
|
|
ra.prototype.canShowContextMenu = function(a) {
|
|
var b = this.h;
|
|
if (null === b) return !1;
|
|
var c = b.hb.Hz;
|
|
if (null === c) return !1;
|
|
void 0 === a && (a = 0 < b.selection.count ? b.selection.first() : b);
|
|
return null === c.findObjectWithContextMenu(a) ? !1 : !0
|
|
};
|
|
z.defineProperty(ra, {
|
|
iH: "copiesClipboardData"
|
|
}, function() {
|
|
return this.zB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ra, "copiesClipboardData");
|
|
this.zB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
jH: "copiesConnectedLinks"
|
|
}, function() {
|
|
return this.AB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ra, "copiesConnectedLinks");
|
|
this.AB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
hE: "deletesConnectedLinks"
|
|
}, function() {
|
|
return this.TB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ra, "deletesConnectedLinks");
|
|
this.TB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
lH: "copiesTree"
|
|
}, function() {
|
|
return this.EB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ra, "copiesTree");
|
|
this.EB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
qH: "deletesTree"
|
|
}, function() {
|
|
return this.UB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ra, "deletesTree");
|
|
this.UB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
ZD: "copiesParentKey"
|
|
}, function() {
|
|
return this.DB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ra, "copiesParentKey");
|
|
this.DB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
YD: "copiesGroupKey"
|
|
}, function() {
|
|
return this.CB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ra, "copiesGroupKey");
|
|
this.CB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
HD: "archetypeGroupData"
|
|
}, function() {
|
|
return this.iy
|
|
}, function(a) {
|
|
null !== a && z.l(a, Object, ra, "archetypeGroupData");
|
|
var b = this.h;
|
|
null !== b && (b = b.ha, b instanceof V && (a instanceof F || b.hA(a) || z.k("CommandHandler.archetypeGroupData must be either a Group or a data object for which GraphLinksModel.isGroupForNodeData is true: " + a)));
|
|
this.iy = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
qA: "memberValidation"
|
|
}, function() {
|
|
return this.hl
|
|
}, function(a) {
|
|
null !== a && z.g(a, "function", ra, "memberValidation");
|
|
this.hl = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
Rw: "defaultScale"
|
|
}, function() {
|
|
return this.RB
|
|
}, function(a) {
|
|
z.p(a, ra, "defaultScale");
|
|
0 < a || z.k("defaultScale must be larger than zero, not: " + a);
|
|
this.RB = a
|
|
});
|
|
z.defineProperty(ra, {
|
|
Tx: "zoomFactor"
|
|
}, function() {
|
|
return this.yD
|
|
}, function(a) {
|
|
z.p(a, ra, "zoomFactor");
|
|
1 < a || z.k("zoomFactor must be larger than 1.0, not: " + a);
|
|
this.yD = a
|
|
});
|
|
|
|
function ug() {
|
|
0 < arguments.length && z.od(ug);
|
|
z.kc(this);
|
|
this.Z = null;
|
|
this.Ub = "";
|
|
this.af = !0;
|
|
this.kC = !1;
|
|
this.uD = null;
|
|
this.Aw = -1
|
|
}
|
|
z.ia("Tool", ug);
|
|
ug.prototype.Sc = function(a) {
|
|
u && null !== a && z.l(a, C, ug, "setDiagram");
|
|
this.Z = a
|
|
};
|
|
ug.prototype.toString = function() {
|
|
return "" !== this.name ? this.name + " Tool" : z.kf(Object.getPrototypeOf(this))
|
|
};
|
|
ug.prototype.updateAdornments = function() {};
|
|
ug.prototype.canStart = function() {
|
|
return this.isEnabled
|
|
};
|
|
ug.prototype.doStart = function() {};
|
|
ug.prototype.doActivate = function() {
|
|
this.ua = !0
|
|
};
|
|
ug.prototype.doDeactivate = function() {
|
|
this.ua = !1
|
|
};
|
|
ug.prototype.doStop = function() {};
|
|
ug.prototype.doCancel = function() {
|
|
this.stopTool()
|
|
};
|
|
ug.prototype.stopTool = function() {
|
|
var a = this.h;
|
|
null !== a && a.eb === this && (a.eb = null, a.gc = "")
|
|
};
|
|
ug.prototype.doMouseDown = function() {
|
|
!this.ua && this.canStart() && this.doActivate()
|
|
};
|
|
ug.prototype.doMouseMove = function() {};
|
|
ug.prototype.doMouseUp = function() {
|
|
this.stopTool()
|
|
};
|
|
ug.prototype.doMouseWheel = function() {};
|
|
ug.prototype.canStartMultiTouch = function() {
|
|
return !0
|
|
};
|
|
ug.prototype.standardPinchZoomStart = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q.event,
|
|
c = null,
|
|
d = null;
|
|
if (void 0 !== b.targetTouches) {
|
|
if (2 > b.targetTouches.length) return;
|
|
c = b.targetTouches[0];
|
|
d = b.targetTouches[1]
|
|
} else if (null !== a.Uf[0]) c = a.Uf[0], d = a.Uf[1];
|
|
else return;
|
|
this.doCancel();
|
|
if (a.sp("hasGestureZoom")) {
|
|
a.Ly = !0;
|
|
a.KC = a.scale;
|
|
var e = Bh(a),
|
|
g = c,
|
|
h = g.clientX - e.x,
|
|
c = g.clientY - e.y,
|
|
g = d,
|
|
d = g.clientX - e.x,
|
|
g = g.clientY - e.y;
|
|
z.A(e);
|
|
e = d - h;
|
|
c = g - c;
|
|
a.cD = Math.sqrt(e * e + c * c);
|
|
b.preventDefault();
|
|
b.cancelBubble = !0
|
|
}
|
|
}
|
|
};
|
|
ug.prototype.standardPinchZoomMove = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q.event;
|
|
this.doCancel();
|
|
var c = null,
|
|
d = null;
|
|
if (void 0 !== b.targetTouches) {
|
|
if (2 > b.targetTouches.length) return;
|
|
c = b.targetTouches[0];
|
|
d = b.targetTouches[1]
|
|
} else if (null !== a.Uf[0]) c = a.Uf[0], d = a.Uf[1];
|
|
else return;
|
|
if (a.sp("hasGestureZoom") && a.Ly) {
|
|
var e = Bh(a),
|
|
g = c,
|
|
c = g.clientX - e.x,
|
|
h = g.clientY - e.y,
|
|
g = d,
|
|
d = g.clientX - e.x,
|
|
g = g.clientY - e.y;
|
|
z.A(e);
|
|
var e = d - c,
|
|
k = g - h,
|
|
e = Math.sqrt(e * e + k * k) / a.cD,
|
|
c = new N((Math.min(d, c) + Math.max(d, c)) / 2, (Math.min(g,
|
|
h) + Math.max(g, h)) / 2),
|
|
h = a.KC * e,
|
|
d = a.wb;
|
|
h !== a.scale && d.canResetZoom(h) && (e = a.$l, a.$l = c, d.resetZoom(h), a.$l = e);
|
|
b.preventDefault();
|
|
b.cancelBubble = !0
|
|
}
|
|
}
|
|
};
|
|
ug.prototype.doKeyDown = function() {
|
|
var a = this.h;
|
|
null !== a && "Esc" === a.Q.key && this.doCancel()
|
|
};
|
|
ug.prototype.doKeyUp = function() {};
|
|
ug.prototype.startTransaction = ug.prototype.Wb = function(a) {
|
|
void 0 === a && (a = this.name);
|
|
this.Mf = null;
|
|
var b = this.h;
|
|
return null === b ? !1 : b.Wb(a)
|
|
};
|
|
ug.prototype.stopTransaction = ug.prototype.xk = function() {
|
|
var a = this.h;
|
|
return null === a ? !1 : null === this.Mf ? a.Vp() : a.Jd(this.Mf)
|
|
};
|
|
ug.prototype.standardMouseSelect = function() {
|
|
var a = this.h;
|
|
if (null !== a && a.xf) {
|
|
var b = a.Q,
|
|
c = a.At(b.ga, !1);
|
|
if (null !== c)
|
|
if (z.rk ? b.$t : b.control) {
|
|
a.Ja("ChangingSelection");
|
|
for (b = c; null !== b && !b.canSelect();) b = b.Va;
|
|
null !== b && (b.kb = !b.kb);
|
|
a.Ja("ChangedSelection")
|
|
} else if (b.shift) {
|
|
if (!c.kb) {
|
|
a.Ja("ChangingSelection");
|
|
for (b = c; null !== b && !b.canSelect();) b = b.Va;
|
|
null !== b && (b.kb = !0);
|
|
a.Ja("ChangedSelection")
|
|
}
|
|
} else {
|
|
if (!c.kb) {
|
|
for (b = c; null !== b && !b.canSelect();) b = b.Va;
|
|
null !== b && a.select(b)
|
|
}
|
|
} else !b.left || (z.rk ? b.$t : b.control) ||
|
|
b.shift || a.Mw()
|
|
}
|
|
};
|
|
ug.prototype.standardMouseClick = function(a, b) {
|
|
void 0 === a && (a = null);
|
|
void 0 === b && (b = function(a) {
|
|
return !a.layer.Nc
|
|
});
|
|
var c = this.h;
|
|
if (null === c) return !1;
|
|
var d = c.Q,
|
|
e = c.pe(d.ga, a, b);
|
|
d.Ge = e;
|
|
Ch(e, d, c);
|
|
return d.Gc
|
|
};
|
|
|
|
function Ch(a, b, c) {
|
|
b.Gc = !1;
|
|
var d = 0;
|
|
b.left ? d = 1 === b.Pe ? 1 : 2 === b.Pe ? 2 : 1 : b.right && 1 === b.Pe && (d = 3);
|
|
var e = "";
|
|
if (null !== a) {
|
|
switch (d) {
|
|
case 1:
|
|
e = "ObjectSingleClicked";
|
|
break;
|
|
case 2:
|
|
e = "ObjectDoubleClicked";
|
|
break;
|
|
case 3:
|
|
e = "ObjectContextClicked"
|
|
}
|
|
0 !== d && c.Ja(e, a)
|
|
} else {
|
|
switch (d) {
|
|
case 1:
|
|
e = "BackgroundSingleClicked";
|
|
break;
|
|
case 2:
|
|
e = "BackgroundDoubleClicked";
|
|
break;
|
|
case 3:
|
|
e = "BackgroundContextClicked"
|
|
}
|
|
0 !== d && c.Ja(e)
|
|
}
|
|
if (null !== a)
|
|
for (; null !== a;) {
|
|
c = null;
|
|
switch (d) {
|
|
case 1:
|
|
c = a.click;
|
|
break;
|
|
case 2:
|
|
c = a.wt ? a.wt : a.click;
|
|
break;
|
|
case 3:
|
|
c =
|
|
a.Gz
|
|
}
|
|
if (null !== c && (c(b, a), b.Gc)) break;
|
|
a = a.U
|
|
} else {
|
|
a = null;
|
|
switch (d) {
|
|
case 1:
|
|
a = c.click;
|
|
break;
|
|
case 2:
|
|
a = c.wt ? c.wt : c.click;
|
|
break;
|
|
case 3:
|
|
a = c.Gz
|
|
}
|
|
null !== a && a(b)
|
|
}
|
|
}
|
|
ug.prototype.standardMouseOver = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q;
|
|
if (null !== b.h && !0 !== a.Ua.wc) {
|
|
var c = a.Bb;
|
|
a.Bb = !0;
|
|
var d = a.pe(b.ga, null, null);
|
|
b.Ge = d;
|
|
var e = !1;
|
|
if (d !== a.Sn) {
|
|
var g = a.Sn,
|
|
h = g;
|
|
a.Sn = d;
|
|
this.doCurrentObjectChanged(g, d);
|
|
for (b.Gc = !1; null !== g;) {
|
|
var k = g.bu;
|
|
if (null !== k) {
|
|
if (d === g) break;
|
|
if (null !== d && d.Pl(g)) break;
|
|
k(b, g, d);
|
|
e = !0;
|
|
if (b.Gc) break
|
|
}
|
|
g = g.U
|
|
}
|
|
g = h;
|
|
for (b.Gc = !1; null !== d;) {
|
|
k = d.au;
|
|
if (null !== k) {
|
|
if (g === d) break;
|
|
if (null !== g && g.Pl(d)) break;
|
|
k(b, d, g);
|
|
e = !0;
|
|
if (b.Gc) break
|
|
}
|
|
d = d.U
|
|
}
|
|
d = a.Sn
|
|
}
|
|
if (null !== d) {
|
|
g =
|
|
d;
|
|
for (k = ""; null !== g;) {
|
|
k = g.cursor;
|
|
if ("" !== k) break;
|
|
g = g.U
|
|
}
|
|
a.gc = k;
|
|
b.Gc = !1;
|
|
for (g = d; null !== g;) {
|
|
k = g.uA;
|
|
if (null !== k && (k(b, g), e = !0, b.Gc)) break;
|
|
g = g.U
|
|
}
|
|
} else a.gc = "", k = a.uA, null !== k && (k(b), e = !0);
|
|
e && a.Ce();
|
|
a.Bb = c
|
|
}
|
|
}
|
|
};
|
|
ug.prototype.doCurrentObjectChanged = function() {};
|
|
ug.prototype.standardMouseWheel = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q,
|
|
c = b.Cl;
|
|
if (0 !== c && a.ad.F()) {
|
|
var d = a.wb,
|
|
e = a.hb.cu;
|
|
if ((e === Dh && !b.shift || e === Eh && b.control) && (0 < c ? d.canIncreaseZoom() : d.canDecreaseZoom())) e = a.$l, a.$l = b.te, 0 < c ? d.increaseZoom() : d.decreaseZoom(), a.$l = e, b.bubbles = !1;
|
|
else if (e === Dh && b.shift || e === Eh && !b.control) {
|
|
var d = a.position.copy(),
|
|
e = 0 < c ? c : -c,
|
|
g = b.event.deltaX,
|
|
h = b.event.deltaY;
|
|
void 0 === g || void 0 === h || 0 === g && 0 === h ? !b.shift && a.ye ? (g = a.ou, e = e / 40 * g, 0 < c ? a.scroll("pixel", "up", e) :
|
|
a.scroll("pixel", "down", e)) : b.shift && a.xe && (g = a.nu, e = e / 40 * g, 0 < c ? a.scroll("pixel", "left", e) : a.scroll("pixel", "right", e)) : (0 !== g && a.xe && (0 < g ? a.scroll("pixel", "left", -g) : a.scroll("pixel", "right", g)), 0 !== h && a.ye && (0 < h ? a.scroll("pixel", "up", -h) : a.scroll("pixel", "down", h)));
|
|
a.position.N(d) || (b.bubbles = !1)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
ug.prototype.standardWaitAfter = function(a, b) {
|
|
z.g(a, "number", ug, "standardWaitAfter:delay");
|
|
this.cancelWaitAfter();
|
|
var c = this,
|
|
d = b.copy();
|
|
this.Aw = z.setTimeout(function() {
|
|
c.doWaitAfter(d)
|
|
}, a)
|
|
};
|
|
ug.prototype.cancelWaitAfter = function() {
|
|
-1 !== this.Aw && z.clearTimeout(this.Aw);
|
|
this.Aw = -1
|
|
};
|
|
ug.prototype.doWaitAfter = function() {};
|
|
ug.prototype.findToolHandleAt = function(a, b) {
|
|
var c = this.h;
|
|
if (null === c) return null;
|
|
c = c.pe(a, function(a) {
|
|
for (; null !== a && !(a.U instanceof da);) a = a.U;
|
|
return a
|
|
});
|
|
return null === c ? null : c.U.nc === b ? c : null
|
|
};
|
|
ug.prototype.isBeyondDragSize = function(a, b) {
|
|
var c = this.h;
|
|
if (null === c) return !1;
|
|
void 0 === a && (a = c.Fc.te);
|
|
void 0 === b && (b = c.Q.te);
|
|
var d = c.hb.uH,
|
|
e = d.width,
|
|
d = d.height;
|
|
c.Fc.lj && (e += 6, d += 6);
|
|
return Math.abs(b.x - a.x) > e || Math.abs(b.y - a.y) > d
|
|
};
|
|
z.w(ug, {
|
|
h: "diagram"
|
|
}, function() {
|
|
return this.Z
|
|
});
|
|
z.defineProperty(ug, {
|
|
name: "name"
|
|
}, function() {
|
|
return this.Ub
|
|
}, function(a) {
|
|
z.g(a, "string", ug, "name");
|
|
this.Ub = a
|
|
});
|
|
z.defineProperty(ug, {
|
|
isEnabled: "isEnabled"
|
|
}, function() {
|
|
return this.af
|
|
}, function(a) {
|
|
z.g(a, "boolean", ug, "isEnabled");
|
|
this.af = a
|
|
});
|
|
z.defineProperty(ug, {
|
|
ua: "isActive"
|
|
}, function() {
|
|
return this.kC
|
|
}, function(a) {
|
|
z.g(a, "boolean", ug, "isActive");
|
|
this.kC = a
|
|
});
|
|
z.defineProperty(ug, {
|
|
Mf: "transactionResult"
|
|
}, function() {
|
|
return this.uD
|
|
}, function(a) {
|
|
null !== a && z.g(a, "string", ug, "transactionResult");
|
|
this.uD = a
|
|
});
|
|
|
|
function ih() {
|
|
0 < arguments.length && z.od(ih);
|
|
ug.call(this);
|
|
this.name = "Dragging";
|
|
this.BB = this.oC = !0;
|
|
this.jr = this.$B = !1;
|
|
this.tC = !0;
|
|
this.My = (new Ea(NaN, NaN)).freeze();
|
|
this.Ny = Zb;
|
|
this.Oy = (new N(NaN, NaN)).freeze();
|
|
this.ZB = !1;
|
|
this.XB = this.yB = this.YB = this.JB = this.Si = null;
|
|
this.Uq = this.rC = !1;
|
|
this.Qo = new N(NaN, NaN);
|
|
this.qw = new N;
|
|
this.tw = !1;
|
|
this.nC = !0;
|
|
this.ao = 100;
|
|
this.Bj = [];
|
|
this.pG = (new K(D)).freeze()
|
|
}
|
|
z.Qa(ih, ug);
|
|
z.ia("DraggingTool", ih);
|
|
z.defineProperty(ih, {
|
|
LE: "isCopyEnabled"
|
|
}, function() {
|
|
return this.oC
|
|
}, function(a) {
|
|
z.g(a, "boolean", ih, "isCopyEnabled");
|
|
this.oC = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
kH: "copiesEffectiveCollection"
|
|
}, function() {
|
|
return this.BB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ih, "copiesEffectiveCollection");
|
|
this.BB = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
vH: "dragsTree"
|
|
}, function() {
|
|
return this.$B
|
|
}, function(a) {
|
|
z.g(a, "boolean", ih, "dragsTree");
|
|
this.$B = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
ix: "isGridSnapEnabled"
|
|
}, function() {
|
|
return this.jr
|
|
}, function(a) {
|
|
z.g(a, "boolean", ih, "isGridSnapEnabled");
|
|
this.jr = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
dI: "isComplexRoutingRealtime"
|
|
}, function() {
|
|
return this.nC
|
|
}, function(a) {
|
|
z.g(a, "boolean", ih, "isComplexRoutingRealtime");
|
|
this.nC = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
fI: "isGridSnapRealtime"
|
|
}, function() {
|
|
return this.tC
|
|
}, function(a) {
|
|
z.g(a, "boolean", ih, "isGridSnapRealtime");
|
|
this.tC = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
BE: "gridSnapCellSize"
|
|
}, function() {
|
|
return this.My
|
|
}, function(a) {
|
|
z.l(a, Ea, ih, "gridSnapCellSize");
|
|
this.My.N(a) || (this.My = a = a.V())
|
|
});
|
|
z.defineProperty(ih, {
|
|
QH: "gridSnapCellSpot"
|
|
}, function() {
|
|
return this.Ny
|
|
}, function(a) {
|
|
z.l(a, Q, ih, "gridSnapCellSpot");
|
|
this.Ny.N(a) || (this.Ny = a = a.V())
|
|
});
|
|
z.defineProperty(ih, {
|
|
RH: "gridSnapOrigin"
|
|
}, function() {
|
|
return this.Oy
|
|
}, function(a) {
|
|
z.l(a, N, ih, "gridSnapOrigin");
|
|
this.Oy.N(a) || (this.Oy = a = a.V())
|
|
});
|
|
z.defineProperty(ih, {
|
|
fj: "dragsLink"
|
|
}, function() {
|
|
return this.ZB
|
|
}, function(a) {
|
|
z.g(a, "boolean", ih, "dragsLink");
|
|
this.ZB = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
bn: "currentPart"
|
|
}, function() {
|
|
return this.JB
|
|
}, function(a) {
|
|
null !== a && z.l(a, D, ih, "currentPart");
|
|
this.JB = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
oc: "copiedParts"
|
|
}, function() {
|
|
return this.yB
|
|
}, function(a) {
|
|
this.yB = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
hc: "draggedParts"
|
|
}, function() {
|
|
return this.YB
|
|
}, function(a) {
|
|
this.YB = a
|
|
});
|
|
z.w(ih, {
|
|
uK: "draggingParts"
|
|
}, function() {
|
|
return null !== this.oc ? this.oc.uj() : null !== this.hc ? this.hc.uj() : this.pG
|
|
});
|
|
z.defineProperty(ih, {
|
|
ld: "draggedLink"
|
|
}, function() {
|
|
return this.XB
|
|
}, function(a) {
|
|
null !== a && z.l(a, G, ih, "draggedLink");
|
|
this.XB = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
hx: "isDragOutStarted"
|
|
}, function() {
|
|
return this.rC
|
|
}, function(a) {
|
|
this.rC = a
|
|
});
|
|
z.defineProperty(ih, {
|
|
wk: "startPoint"
|
|
}, function() {
|
|
return this.qw
|
|
}, function(a) {
|
|
z.l(a, N, ih, "startPoint");
|
|
this.qw.N(a) || (this.qw = a = a.V())
|
|
});
|
|
z.defineProperty(ih, {
|
|
cE: "delay"
|
|
}, function() {
|
|
return this.ao
|
|
}, function(a) {
|
|
z.g(a, "number", ih, "delay");
|
|
this.ao = a
|
|
});
|
|
ih.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
if (null === a || a.jb && !a.kt || !a.ul && !a.kk && !a.kt || !a.xf) return !1;
|
|
var b = a.Q;
|
|
return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.lj && b.timestamp - a.Fc.timestamp < this.ao) ? !1 : null !== this.findDraggablePart()
|
|
};
|
|
ih.prototype.findDraggablePart = function() {
|
|
var a = this.h;
|
|
if (null === a) return null;
|
|
a = a.At(a.Fc.ga, !1);
|
|
if (null === a) return null;
|
|
for (; null !== a && !a.canSelect();) a = a.Va;
|
|
return null !== a && (a.canMove() || a.canCopy()) ? a : null
|
|
};
|
|
ih.prototype.standardMouseSelect = function() {
|
|
var a = this.h;
|
|
if (null !== a && a.xf) {
|
|
var b = a.At(a.Fc.ga, !1);
|
|
if (null !== b) {
|
|
for (; null !== b && !b.canSelect();) b = b.Va;
|
|
this.bn = b;
|
|
this.bn.kb || (a.Ja("ChangingSelection"), b = a.Q, (z.rk ? b.$t : b.control) || b.shift || hh(a), this.bn.kb = !0, a.Ja("ChangedSelection"))
|
|
}
|
|
}
|
|
};
|
|
ih.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
null === this.bn && this.standardMouseSelect();
|
|
var b = this.bn;
|
|
null !== b && (b.canMove() || b.canCopy()) && (this.ua = !0, this.Qo.set(a.position), Fh(this, a.selection), this.Bj.length = 0, this.hc = this.computeEffectiveCollection(a.selection), a.vu = !0, Gh(this, this.hc), this.Wb("Drag"), this.wk = a.Fc.ga, a.We = !0, a.kt && (this.hx = !0, this.Uq = !1, Hh = this, Ih = this.h, this.doSimulatedDragOut()))
|
|
}
|
|
};
|
|
|
|
function Fh(a, b) {
|
|
if (a.fj) {
|
|
var c = a.h;
|
|
null !== c && c.Tm && (c.ha instanceof V && 1 === b.count && b.first() instanceof G ? (a.ld = b.first(), a.ld.canRelinkFrom() && a.ld.canRelinkTo() && a.ld.pt(), a.Si = c.hb.kF, null === a.Si && (a.Si = new Jh, a.Si.Sc(c))) : (a.ld = null, a.Si = null))
|
|
}
|
|
}
|
|
ih.prototype.computeEffectiveCollection = function(a) {
|
|
var b = null !== this.h && this.h.eb === this,
|
|
c = new na(D);
|
|
if (null === a) return c;
|
|
for (var d = a.i; d.next();) Kh(this, c, d.value, b);
|
|
if (null !== this.ld && this.fj) return c;
|
|
for (d = a.i; d.next();) a = d.value, a instanceof G && (b = a.Y, null === b || c.contains(b) ? (b = a.da, null === b || c.contains(b) || c.remove(a)) : c.remove(a));
|
|
return c
|
|
};
|
|
|
|
function Lh(a) {
|
|
return void 0 === a ? new Mh(Id) : new Mh(a.copy())
|
|
}
|
|
|
|
function Kh(a, b, c, d) {
|
|
if (!b.contains(c) && (!d || c.canMove() || c.canCopy()))
|
|
if (c instanceof E) {
|
|
b.add(c, Lh(c.location));
|
|
if (c instanceof F)
|
|
for (var e = c.Hc; e.next();) Kh(a, b, e.value, d);
|
|
for (e = c.ee; e.next();) {
|
|
var g = e.value;
|
|
if (!b.contains(g)) {
|
|
var h = g.Y,
|
|
k = g.da;
|
|
null !== h && b.contains(h) && null !== k && b.contains(k) && Kh(a, b, g, d)
|
|
}
|
|
}
|
|
if (a.vH)
|
|
for (c = c.tE(); c.next();) Kh(a, b, c.value, d)
|
|
} else if (c instanceof G)
|
|
for (g = c, b.add(g, Lh()), e = g.Hf; e.next();) Kh(a, b, e.value, d);
|
|
else c instanceof da || b.add(c, Lh(c.location))
|
|
}
|
|
ih.prototype.doDeactivate = function() {
|
|
this.ua = !1;
|
|
var a = this.h;
|
|
null !== a && Nh(a);
|
|
Oh(this);
|
|
Ph(this, this.hc);
|
|
this.hc = this.bn = null;
|
|
this.Uq = this.hx = !1;
|
|
if (0 < Qh.count) {
|
|
for (var b = Qh.length, c = 0; c < b; c++) {
|
|
var d = Qh.ea(c);
|
|
Rh(d);
|
|
Sh(d);
|
|
Oh(d);
|
|
null !== d.h && Nh(d.h)
|
|
}
|
|
Qh.clear()
|
|
}
|
|
Rh(this);
|
|
this.Qo.n(NaN, NaN);
|
|
Hh = Ih = null;
|
|
Sh(this);
|
|
a.We = !1;
|
|
a.gc = "";
|
|
a.vu = !1;
|
|
this.xk()
|
|
};
|
|
|
|
function Oh(a) {
|
|
var b = a.h;
|
|
if (null !== b) {
|
|
var c = b.Bb;
|
|
b.Bb = !0;
|
|
Th(a, b.Q, null);
|
|
b.Bb = c
|
|
}
|
|
a.Bj.length = 0
|
|
}
|
|
|
|
function Uh() {
|
|
var a = Hh;
|
|
Sh(a);
|
|
Vh(a);
|
|
var b = a.h;
|
|
null !== b && a.Qo.F() && (b.position = a.Qo);
|
|
null !== b && Nh(b)
|
|
}
|
|
ih.prototype.doCancel = function() {
|
|
Sh(this);
|
|
Vh(this);
|
|
var a = this.h;
|
|
null !== a && this.Qo.F() && (a.position = this.Qo);
|
|
this.stopTool()
|
|
};
|
|
|
|
function Gh(a, b) {
|
|
if (null !== b) {
|
|
a.tw = !0;
|
|
for (var c = b.i; c.next();) {
|
|
var d = c.key;
|
|
d instanceof G && (d.eq = !0)
|
|
}
|
|
}
|
|
}
|
|
|
|
function Ph(a, b) {
|
|
if (null !== b) {
|
|
for (var c = b.i; c.next();) {
|
|
var d = c.key;
|
|
d instanceof G && (d.eq = !1, d.jj && Wh(d) && d.qc())
|
|
}
|
|
a.tw = !1
|
|
}
|
|
}
|
|
ih.prototype.doKeyDown = function() {
|
|
var a = this.h;
|
|
null !== a && (a = a.Q, null !== a && this.ua && ("Esc" === a.key ? this.doCancel() : this.doMouseMove()))
|
|
};
|
|
ih.prototype.doKeyUp = function() {
|
|
var a = this.h;
|
|
null !== a && null !== a.Q && this.ua && this.doMouseMove()
|
|
};
|
|
|
|
function Xh(a, b) {
|
|
for (var c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = a.i; h.next();) {
|
|
var k = h.value;
|
|
if (k.be() && k.isVisible()) {
|
|
var l = k.location,
|
|
k = l.x,
|
|
l = l.y;
|
|
isNaN(k) || isNaN(l) || (k < c && (c = k), l < d && (d = l), k > e && (e = k), l > g && (g = l))
|
|
}
|
|
}
|
|
Infinity === c ? b.n(0, 0, 0, 0) : b.n(c, d, e - c, g - d)
|
|
}
|
|
|
|
function Yh(a, b) {
|
|
if (null === a.oc) {
|
|
var c = a.h;
|
|
if (!(null === c || b && (c.jb || c.Ef)) && null !== a.hc) {
|
|
var d = c.pa;
|
|
d.isEnabled && d.QE ? null !== d.dj && 0 < d.dj.Yf.count && (c.pa.Vp(), c.Wb("Drag")) : Vh(a);
|
|
c.Bb = !b;
|
|
c.lq = !b;
|
|
a.wk = c.Fc.ga;
|
|
d = a.kH ? a.hc.uj() : c.selection;
|
|
d = c.hp(d, c, !0);
|
|
for (c = d.i; c.next();) c.value.location = c.key.location;
|
|
c = z.kg();
|
|
Xh(d, c);
|
|
z.dc(c);
|
|
for (var c = new na(D), e = a.hc.i; e.next();) {
|
|
var g = e.key;
|
|
g.be() && g.canCopy() && (g = d.na(g), null !== g && (g.Bf(), c.add(g, Lh(g.location))))
|
|
}
|
|
for (d = d.i; d.next();) e = d.value, e instanceof G &&
|
|
e.canCopy() && c.add(e, Lh());
|
|
a.oc = c;
|
|
Fh(a, c.uj());
|
|
null !== a.ld && (c = a.ld, d = c.un, c.Rl(a.wk.x - (d.x + d.width / 2), a.wk.y - (d.y + d.height / 2)))
|
|
}
|
|
}
|
|
}
|
|
|
|
function Sh(a) {
|
|
var b = a.h;
|
|
if (null !== b) {
|
|
if (null !== a.oc && (b.JA(a.oc.uj(), !1), a.oc = null, null !== a.hc))
|
|
for (var c = a.hc.i; c.next();) c.key instanceof G && (c.value.point = new N(0, 0));
|
|
b.Bb = !1;
|
|
b.lq = !1;
|
|
a.wk = b.Fc.ga
|
|
}
|
|
}
|
|
|
|
function Rh(a) {
|
|
if (null !== a.ld) {
|
|
if (a.fj && null !== a.Si) {
|
|
var b = a.Si;
|
|
b.h.remove(b.Od);
|
|
b.h.remove(b.Pd)
|
|
}
|
|
a.ld = null;
|
|
a.Si = null
|
|
}
|
|
}
|
|
|
|
function Zh(a, b, c) {
|
|
var d = a.h;
|
|
if (null !== d) {
|
|
var e = a.wk,
|
|
g = z.O();
|
|
g.assign(d.Q.ga);
|
|
a.moveParts(b, g.xu(e), c);
|
|
z.A(g)
|
|
}
|
|
}
|
|
ih.prototype.moveParts = function(a, b, c) {
|
|
if (null !== a && (z.l(a, na, ih, "moveParts:parts"), 0 !== a.count)) {
|
|
var d = z.O(),
|
|
e = z.O();
|
|
e.assign(b);
|
|
isNaN(e.x) && (e.x = 0);
|
|
isNaN(e.y) && (e.y = 0);
|
|
(b = this.tw) || Gh(this, a);
|
|
for (var g = new J($h), h = new J(Ya), k = a.i; k.next();) {
|
|
var l = k.key;
|
|
if (l.be()) {
|
|
var m = ai(this, l, a);
|
|
if (null !== m) g.add(new $h(l, k.value, m));
|
|
else if (!c || l.canMove()) {
|
|
m = k.value.point;
|
|
d.assign(m);
|
|
var n = z.O(),
|
|
p = this.computeMove(l, d.add(e), a, n);
|
|
l.location = p;
|
|
k.value.LF = n.xu(m);
|
|
z.A(n)
|
|
}
|
|
} else k.key instanceof G && h.add(k.lb)
|
|
}
|
|
for (c =
|
|
g.i; c.next();) g = c.value, m = g.info.point, d.assign(m), g.Pc.location = d.add(g.SH.LF);
|
|
c = z.O();
|
|
m = z.O();
|
|
for (h = h.i; h.next();)
|
|
if (k = h.value, g = k.key, g instanceof G)
|
|
if (g.eq) l = g.Y, n = g.da, null !== this.ld && this.fj ? (k = k.value.point, a.add(g, Lh(e)), l = e.x - k.x, k = e.y - k.y, g.Rl(l, k)) : (null !== l && (c.assign(l.location), p = a.na(l), null !== p && c.xu(p.point)), null !== n && (m.assign(n.location), p = a.na(n), null !== p && m.xu(p.point)), null !== l && null !== n ? c.Mc(m) ? (k = k.value.point, l = d, l.assign(c), l.xu(k), a.add(g, Lh(c)), g.Rl(l.x, l.y)) : (g.eq = !1,
|
|
g.qc()) : (k = k.value.point, n = null !== l ? c : null !== n ? m : e, a.add(g, Lh(n)), l = n.x - k.x, k = n.y - k.y, g.Rl(l, k)));
|
|
else if (null === g.Y || null === g.da) k = k.value.point, a.add(g, Lh(e)), l = e.x - k.x, k = e.y - k.y, g.Rl(l, k);
|
|
z.A(d);
|
|
z.A(e);
|
|
z.A(c);
|
|
z.A(m);
|
|
b || Ph(this, a)
|
|
}
|
|
};
|
|
|
|
function ai(a, b, c) {
|
|
b = b.Va;
|
|
if (null !== b) {
|
|
a = ai(a, b, c);
|
|
if (null !== a) return a;
|
|
a = c.na(b);
|
|
if (null !== a) return a
|
|
}
|
|
return null
|
|
}
|
|
|
|
function Vh(a) {
|
|
if (null !== a.hc) {
|
|
for (var b = a.h, c = a.hc.i; c.next();) {
|
|
var d = c.key;
|
|
d.be() && (d.location = c.value.point)
|
|
}
|
|
for (c = a.hc.i; c.next();)
|
|
if (d = c.key, d instanceof G && d.eq) {
|
|
var e = c.value.point;
|
|
a.hc.add(d, Lh());
|
|
d.Rl(-e.x, -e.y)
|
|
}
|
|
b.bg()
|
|
}
|
|
}
|
|
ih.prototype.computeMove = function(a, b, c, d) {
|
|
void 0 === d && (d = new N);
|
|
d.assign(b);
|
|
if (null === a) return d;
|
|
void 0 === c && (c = null);
|
|
var e = b;
|
|
if (this.ix && (this.fI || null === c || this.h.Q.up) && (e = z.O(), c = e, c.assign(b), null !== a)) {
|
|
var g = this.h;
|
|
if (null !== g) {
|
|
var h = g.Gt,
|
|
k = this.BE,
|
|
g = k.width,
|
|
k = k.height,
|
|
l = this.RH,
|
|
m = l.x,
|
|
l = l.y,
|
|
n = this.QH;
|
|
if (null !== h) {
|
|
var p = h.bx;
|
|
isNaN(g) && (g = p.width);
|
|
isNaN(k) && (k = p.height);
|
|
h = h.AE;
|
|
isNaN(m) && (m = h.x);
|
|
isNaN(l) && (l = h.y)
|
|
}
|
|
h = z.Tb(0, 0);
|
|
h.tu(0, 0, g, k, n);
|
|
jb(b.x, b.y, m + h.x, l + h.y, g, k, c);
|
|
z.A(h)
|
|
}
|
|
}
|
|
c = null !== a.iE ?
|
|
a.iE(a, b, e) : e;
|
|
k = a.GI;
|
|
g = k.x;
|
|
isNaN(g) && (g = a.location.x);
|
|
k = k.y;
|
|
isNaN(k) && (k = a.location.y);
|
|
h = a.BI;
|
|
m = h.x;
|
|
isNaN(m) && (m = a.location.x);
|
|
h = h.y;
|
|
isNaN(h) && (h = a.location.y);
|
|
d.n(Math.max(g, Math.min(c.x, m)), Math.max(k, Math.min(c.y, h)));
|
|
e !== b && z.A(e);
|
|
return d
|
|
};
|
|
|
|
function bi(a, b) {
|
|
if (null === b) return !0;
|
|
var c = b.ca;
|
|
return null === c || c instanceof da || c.layer.Nc || a.hc && a.hc.contains(c) || a.oc && a.oc.contains(c) ? !0 : !1
|
|
}
|
|
|
|
function ci(a, b, c, d) {
|
|
var e = a.h;
|
|
if (null !== e) {
|
|
a.fj && (null !== a.ld && (a.ld.Y = null, a.ld.da = null), di(a, !1));
|
|
var g = ei(e, b, null, function(b) {
|
|
return !bi(a, b)
|
|
}),
|
|
h = e.Q;
|
|
h.Ge = g;
|
|
var k = e.Bb,
|
|
l = !1;
|
|
try {
|
|
e.Bb = !0;
|
|
l = Th(a, h, g);
|
|
if (!a.ua && null === Hh) return;
|
|
if (null === g) {
|
|
var m = e.KI;
|
|
null !== m && (m(h), l = !0)
|
|
}
|
|
if (!a.ua && null === Hh) return;
|
|
a.doDragOver(b, g);
|
|
if (!a.ua && null === Hh) return
|
|
} finally {
|
|
e.Bb = k, l && e.bg()
|
|
}(e.xe || e.ye) && (c || d) && fi(e, h.te)
|
|
}
|
|
}
|
|
|
|
function Th(a, b, c) {
|
|
var d = !1,
|
|
e = a.Bj.length,
|
|
g = 0 < e ? a.Bj[0] : null;
|
|
if (c === g) return !1;
|
|
b.Gc = !1;
|
|
for (var h = 0; h < e; h++) {
|
|
var k = a.Bj[h],
|
|
l = k.JI;
|
|
if (null !== l && (l(b, k, c), d = !0, b.Gc)) break
|
|
}
|
|
a.Bj.length = 0;
|
|
if (!a.ua && null === Hh || null === c) return d;
|
|
for (b.Gc = !1; null !== c;) a.Bj.push(c), c = gi(c);
|
|
e = a.Bj.length;
|
|
for (h = 0; h < e && (k = a.Bj[h], l = k.II, null === l || (l(b, k, g), d = !0, !b.Gc)); h++);
|
|
return d
|
|
}
|
|
|
|
function gi(a) {
|
|
var b = a.U;
|
|
return null !== b ? b : a instanceof D && !(a instanceof F) && (a = a.Va, null !== a && a.UH) ? a : null
|
|
}
|
|
|
|
function hi(a, b, c) {
|
|
var d = a.Si;
|
|
if (null === d) return null;
|
|
var e = a.h.dn(b, d.iF, function(a) {
|
|
return d.findValidLinkablePort(a, c)
|
|
});
|
|
a = z.O();
|
|
for (var g = Infinity, h = null, e = e.i; e.next();) {
|
|
var k = e.value;
|
|
if (null !== k.ca) {
|
|
var l = k.fb(ec, a),
|
|
l = b.Af(l);
|
|
l < g && (h = k, g = l)
|
|
}
|
|
}
|
|
z.A(a);
|
|
return h
|
|
}
|
|
|
|
function di(a, b) {
|
|
var c = a.ld;
|
|
if (null !== c && !(2 > c.sa)) {
|
|
var d = a.h;
|
|
if (null !== d && !d.jb && (d = a.Si, null !== d)) {
|
|
var e = null,
|
|
g = null;
|
|
null === c.Y && (e = hi(a, c.m(0), !1), null !== e && (g = e.ca));
|
|
var h = null,
|
|
k = null;
|
|
null === c.da && (h = hi(a, c.m(c.sa - 1), !0), null !== h && (k = h.ca));
|
|
d.isValidLink(g, e, k, h) ? b ? (c.Vn = c.m(0).copy(), c.Zn = c.m(c.sa - 1).copy(), c.eq = !1, c.Y = g, null !== e && (c.$f = e.yd), c.da = k, null !== h && (c.Ug = h.yd)) : ii(d, g, e, k, h) : ii(d, null, null, null, null)
|
|
}
|
|
}
|
|
}
|
|
ih.prototype.doDragOver = function() {};
|
|
|
|
function ji(a, b) {
|
|
var c = a.h;
|
|
if (null !== c) {
|
|
a.fj && di(a, !0);
|
|
Oh(a);
|
|
var d = ei(c, b, null, function(b) {
|
|
return !bi(a, b)
|
|
}),
|
|
e = c.Q;
|
|
e.Ge = d;
|
|
if (null !== d) {
|
|
e.Gc = !1;
|
|
for (var g = d; null !== g;) {
|
|
var h = g.rA;
|
|
if (null !== h && (h(e, g), e.Gc)) break;
|
|
g = gi(g)
|
|
}
|
|
} else h = c.rA, null !== h && h(e);
|
|
if (a.ua || null !== Hh)
|
|
if (a.doDropOnto(b, d), a.ua || null !== Hh)
|
|
for (d = c.selection.i; d.next();) e = d.value, e instanceof E && ki(c, e.W)
|
|
}
|
|
}
|
|
ih.prototype.doDropOnto = function() {};
|
|
ih.prototype.doMouseMove = function() {
|
|
if (this.ua) {
|
|
var a = this.h;
|
|
if (null !== a && null !== this.bn && null !== this.hc) {
|
|
var b = !1,
|
|
c = !1;
|
|
this.mayCopy() ? (b = !0, a.gc = "copy", Yh(this, !1), Gh(this, this.oc), Zh(this, this.oc, !1), Ph(this, this.oc)) : this.mayMove() ? (c = !0, a.gc = "default", Sh(this), Zh(this, this.hc, !0)) : this.mayDragOut() ? (a.gc = "no-drop", Yh(this, !1), Zh(this, this.oc, !1)) : Sh(this);
|
|
ci(this, a.Q.ga, c, b)
|
|
}
|
|
}
|
|
};
|
|
ih.prototype.doMouseUp = function() {
|
|
if (this.ua) {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = !1,
|
|
c = this.mayCopy();
|
|
c && null !== this.oc ? (Sh(this), Yh(this, !0), Gh(this, this.oc), Zh(this, this.oc, !1), Ph(this, this.oc), null !== this.oc && a.FF(this.oc.uj())) : (b = !0, Sh(this), this.mayMove() && (Zh(this, this.hc, !0), ci(this, a.Q.ga, !0, !1)));
|
|
this.Uq = !0;
|
|
ji(this, a.Q.ga);
|
|
if (this.ua) {
|
|
this.oc = null;
|
|
if (b && null !== this.hc)
|
|
for (b = this.hc.i; b.next();) {
|
|
var d = b.key;
|
|
d instanceof E && (d = d.Va, null === d || null === d.placeholder || this.hc.contains(d) || d.VD && d.S())
|
|
}
|
|
a.yc();
|
|
Ph(this, this.hc);
|
|
this.Mf = c ? "Copy" : "Move";
|
|
a.Ja(c ? "SelectionCopied" : "SelectionMoved", a.selection)
|
|
}
|
|
this.stopTool()
|
|
}
|
|
}
|
|
};
|
|
ih.prototype.mayCopy = function() {
|
|
if (!this.LE) return !1;
|
|
var a = this.h;
|
|
if (null === a || a.jb || a.Ef || !a.ap || !a.kk || (z.rk ? !a.Q.alt : !a.Q.control)) return !1;
|
|
for (a = a.selection.i; a.next();) {
|
|
var b = a.value;
|
|
if (b.be() && b.canCopy()) return !0
|
|
}
|
|
return null !== this.ld && this.fj && this.ld.canCopy() ? !0 : !1
|
|
};
|
|
ih.prototype.mayDragOut = function() {
|
|
if (!this.LE) return !1;
|
|
var a = this.h;
|
|
if (null === a || !a.kt || !a.kk || a.ul) return !1;
|
|
for (a = a.selection.i; a.next();) {
|
|
var b = a.value;
|
|
if (b.be() && b.canCopy()) return !0
|
|
}
|
|
return null !== this.ld && this.fj && this.ld.canCopy() ? !0 : !1
|
|
};
|
|
ih.prototype.mayMove = function() {
|
|
var a = this.h;
|
|
if (null === a || a.jb || !a.ul) return !1;
|
|
for (a = a.selection.i; a.next();) {
|
|
var b = a.value;
|
|
if (b.be() && b.canMove()) return !0
|
|
}
|
|
return null !== this.ld && this.fj && this.ld.canMove() ? !0 : !1
|
|
};
|
|
var Qh = new J(ih),
|
|
Hh = null,
|
|
Ih = null;
|
|
ih.prototype.mayDragIn = function() {
|
|
var a = this.h;
|
|
if (null === a || !a.FD || a.jb || a.Ef || !a.ap) return !1;
|
|
var b = Hh;
|
|
return null === b || b.h.ha.Al !== a.ha.Al ? !1 : !0
|
|
};
|
|
ih.prototype.doSimulatedDragEnter = function() {
|
|
if (this.mayDragIn()) {
|
|
var a = this.h;
|
|
a.Ua.oi();
|
|
li(a);
|
|
a = Hh;
|
|
null !== a && (a.h.gc = "copy")
|
|
}
|
|
};
|
|
ih.prototype.doSimulatedDragLeave = function() {
|
|
var a = Hh;
|
|
null !== a && a.doSimulatedDragOut();
|
|
this.doCancel()
|
|
};
|
|
ih.prototype.doSimulatedDragOver = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = Hh;
|
|
null !== b && null !== b.hc && this.mayDragIn() && (a.gc = "copy", mi(this, b.hc.uj(), !1), Zh(this, this.oc, !1), ci(this, a.Q.ga, !1, !0))
|
|
}
|
|
};
|
|
ih.prototype.doSimulatedDrop = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = Hh;
|
|
if (null !== b) {
|
|
var c = b.h;
|
|
b.Uq = !0;
|
|
Sh(this);
|
|
this.mayDragIn() && (this.Wb("Drop"), mi(this, b.hc.uj(), !0), Zh(this, this.oc, !1), null !== this.oc && a.FF(this.oc.uj()), ji(this, a.Q.ga), a.yc(), b = a.selection, null !== this.oc ? this.Mf = "ExternalCopy" : b = new K(D), this.oc = null, a.focus(), a.Ja("ExternalObjectsDropped", b, c), this.xk())
|
|
}
|
|
}
|
|
};
|
|
|
|
function mi(a, b, c) {
|
|
if (null === a.oc) {
|
|
var d = a.h;
|
|
if (null !== d && !d.jb && !d.Ef) {
|
|
d.Bb = !c;
|
|
d.lq = !c;
|
|
a.wk = d.Q.ga;
|
|
d = d.hp(b, d, !0);
|
|
c = z.kg();
|
|
Xh(b, c);
|
|
var e = c.x + c.width / 2,
|
|
g = c.y + c.height / 2;
|
|
z.dc(c);
|
|
var h = a.qw;
|
|
c = new na(D);
|
|
var k = z.O();
|
|
for (b = b.i; b.next();) {
|
|
var l = b.value;
|
|
if (l.be() && l.canCopy()) {
|
|
var m = l.location,
|
|
l = d.na(l);
|
|
k.n(h.x - (e - m.x), h.y - (g - m.y));
|
|
l.location = k;
|
|
l.Bf();
|
|
c.add(l, Lh(k))
|
|
}
|
|
}
|
|
z.A(k);
|
|
for (d = d.i; d.next();) e = d.value, e instanceof G && e.canCopy() && c.add(e, Lh());
|
|
a.oc = c;
|
|
Fh(a, c.uj());
|
|
null !== a.ld && (c = a.ld, d = c.un, c.Rl(a.wk.x -
|
|
(d.x + d.width / 2), a.wk.y - (d.y + d.height / 2)))
|
|
}
|
|
}
|
|
}
|
|
ih.prototype.doSimulatedDragOut = function() {
|
|
var a = this.h;
|
|
null !== a && (this.mayCopy() || this.mayMove() ? a.gc = "" : a.gc = "no-drop")
|
|
};
|
|
|
|
function Mh(a) {
|
|
this.point = a;
|
|
this.LF = Id
|
|
}
|
|
z.ia("DraggingInfo", Mh);
|
|
|
|
function $h(a, b, c) {
|
|
this.Pc = a;
|
|
this.info = b;
|
|
this.SH = c
|
|
}
|
|
|
|
function ni() {
|
|
0 < arguments.length && z.od(ni);
|
|
ug.call(this);
|
|
this.UC = 100;
|
|
this.wC = !1;
|
|
var a = new G,
|
|
b = new X;
|
|
b.Ff = !0;
|
|
b.stroke = "blue";
|
|
a.add(b);
|
|
b = new X;
|
|
b.fq = "Standard";
|
|
b.fill = "blue";
|
|
b.stroke = "blue";
|
|
a.add(b);
|
|
a.If = "Tool";
|
|
this.mD = a;
|
|
a = new E;
|
|
b = new X;
|
|
b.yd = "";
|
|
b.Hb = "Rectangle";
|
|
b.fill = null;
|
|
b.stroke = "magenta";
|
|
b.ub = 2;
|
|
b.Aa = Qd;
|
|
a.add(b);
|
|
a.vk = !1;
|
|
a.If = "Tool";
|
|
this.kD = a;
|
|
this.lD = b;
|
|
a = new E;
|
|
b = new X;
|
|
b.yd = "";
|
|
b.Hb = "Rectangle";
|
|
b.fill = null;
|
|
b.stroke = "magenta";
|
|
b.ub = 2;
|
|
b.Aa = Qd;
|
|
a.add(b);
|
|
a.vk = !1;
|
|
a.If = "Tool";
|
|
this.nD = a;
|
|
this.oD = b;
|
|
this.RC = this.QC =
|
|
this.MC = this.LC = this.NC = null;
|
|
this.sC = !0;
|
|
this.GG = new na(O, "boolean");
|
|
this.VC = this.el = this.gD = null
|
|
}
|
|
z.Qa(ni, ug);
|
|
z.ia("LinkingBaseTool", ni);
|
|
ni.prototype.doStop = function() {
|
|
var a = this.h;
|
|
null !== a && Nh(a);
|
|
this.Qg = this.Pg = this.Og = this.Ng = this.sc = null;
|
|
this.Sx.clear();
|
|
this.jg = null
|
|
};
|
|
z.defineProperty(ni, {
|
|
iF: "portGravity"
|
|
}, function() {
|
|
return this.UC
|
|
}, function(a) {
|
|
z.g(a, "number", ni, "portGravity");
|
|
0 <= a && (this.UC = a)
|
|
});
|
|
z.defineProperty(ni, {
|
|
Cp: "isUnconnectedLinkValid"
|
|
}, function() {
|
|
return this.wC
|
|
}, function(a) {
|
|
z.g(a, "boolean", ni, "isUnconnectedLinkValid");
|
|
this.wC = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Tg: "temporaryLink"
|
|
}, function() {
|
|
return this.mD
|
|
}, function(a) {
|
|
z.l(a, G, ni, "temporaryLink");
|
|
this.mD = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Od: "temporaryFromNode"
|
|
}, function() {
|
|
return this.kD
|
|
}, function(a) {
|
|
z.l(a, E, ni, "temporaryFromNode");
|
|
this.kD = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
zn: "temporaryFromPort"
|
|
}, function() {
|
|
return this.lD
|
|
}, function(a) {
|
|
z.l(a, O, ni, "temporaryFromPort");
|
|
this.lD = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Pd: "temporaryToNode"
|
|
}, function() {
|
|
return this.nD
|
|
}, function(a) {
|
|
z.l(a, E, ni, "temporaryToNode");
|
|
this.nD = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
An: "temporaryToPort"
|
|
}, function() {
|
|
return this.oD
|
|
}, function(a) {
|
|
z.l(a, O, ni, "temporaryToPort");
|
|
this.oD = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
sc: "originalLink"
|
|
}, function() {
|
|
return this.NC
|
|
}, function(a) {
|
|
null !== a && z.l(a, G, ni, "originalLink");
|
|
this.NC = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Ng: "originalFromNode"
|
|
}, function() {
|
|
return this.LC
|
|
}, function(a) {
|
|
null !== a && z.l(a, E, ni, "originalFromNode");
|
|
this.LC = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Og: "originalFromPort"
|
|
}, function() {
|
|
return this.MC
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, ni, "originalFromPort");
|
|
this.MC = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Pg: "originalToNode"
|
|
}, function() {
|
|
return this.QC
|
|
}, function(a) {
|
|
null !== a && z.l(a, E, ni, "originalToNode");
|
|
this.QC = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Qg: "originalToPort"
|
|
}, function() {
|
|
return this.RC
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, ni, "originalToPort");
|
|
this.RC = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Md: "isForwards"
|
|
}, function() {
|
|
return this.sC
|
|
}, function(a) {
|
|
z.g(a, "boolean", ni, "isForwards");
|
|
this.sC = a
|
|
});
|
|
z.w(ni, {
|
|
Sx: "validPortsCache"
|
|
}, function() {
|
|
return this.GG
|
|
});
|
|
z.defineProperty(ni, {
|
|
jg: "targetPort"
|
|
}, function() {
|
|
return this.gD
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, ni, "targetPort");
|
|
this.gD = a
|
|
});
|
|
ni.prototype.copyPortProperties = function(a, b, c, d, e) {
|
|
if (null !== a && null !== b && null !== c && null !== d) {
|
|
d.Aa = b.W.size;
|
|
e ? (d.Eb = b.Eb, d.Yl = b.Yl) : (d.Db = b.Db, d.Il = b.Il);
|
|
c.of = ec;
|
|
var g = z.O();
|
|
c.location = b.fb(ec, g);
|
|
z.A(g);
|
|
d.angle = b.Kl();
|
|
null !== this.Ax && this.Ax(a, b, c, d, e)
|
|
}
|
|
};
|
|
ni.prototype.setNoTargetPortProperties = function(a, b, c) {
|
|
null !== b && (b.Aa = Qd, b.Db = Yb, b.Eb = Yb);
|
|
null !== a && (a.location = this.h.Q.ga);
|
|
null !== this.Ax && this.Ax(null, null, a, b, c)
|
|
};
|
|
ni.prototype.doMouseDown = function() {
|
|
this.ua && this.doMouseMove()
|
|
};
|
|
ni.prototype.doMouseMove = function() {
|
|
if (this.ua) {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
this.jg = this.findTargetPort(this.Md);
|
|
if (null !== this.jg) {
|
|
var b = this.jg.ca;
|
|
if (b instanceof E) {
|
|
this.Md ? this.copyPortProperties(b, this.jg, this.Pd, this.An, !0) : this.copyPortProperties(b, this.jg, this.Od, this.zn, !1);
|
|
return
|
|
}
|
|
}
|
|
this.Md ? this.setNoTargetPortProperties(this.Pd, this.An, !0) : this.setNoTargetPortProperties(this.Od, this.zn, !1);
|
|
(a.xe || a.ye) && fi(a, a.Q.te)
|
|
}
|
|
}
|
|
};
|
|
ni.prototype.findValidLinkablePort = function(a, b) {
|
|
if (null === a) return null;
|
|
var c = a.ca;
|
|
if (!(c instanceof E)) return null;
|
|
for (; null !== a;) {
|
|
var d = b ? a.TF : a.vE;
|
|
if (!0 === d && (null !== a.yd || a instanceof E) && (b ? this.isValidTo(c, a) : this.isValidFrom(c, a))) return a;
|
|
if (!1 === d) break;
|
|
a = a.U
|
|
}
|
|
return null
|
|
};
|
|
ni.prototype.findTargetPort = function(a) {
|
|
var b = this.h,
|
|
c = b.Q.ga,
|
|
d = this.iF;
|
|
0 >= d && (d = .1);
|
|
for (var e = this, g = b.dn(c, d, function(b) {
|
|
return e.findValidLinkablePort(b, a)
|
|
}, null, !0), d = Infinity, b = null, g = g.i; g.next();) {
|
|
var h = g.value,
|
|
k = h.ca;
|
|
if (k instanceof E) {
|
|
var l = h.fb(ec, z.O()),
|
|
m = c.x - l.x,
|
|
n = c.y - l.y;
|
|
z.A(l);
|
|
l = m * m + n * n;
|
|
l < d && (m = this.Sx.na(h), null !== m ? m && (b = h, d = l) : a && this.isValidLink(this.Ng, this.Og, k, h) || !a && this.isValidLink(k, h, this.Pg, this.Qg) ? (this.Sx.add(h, !0), b = h, d = l) : this.Sx.add(h, !1))
|
|
}
|
|
}
|
|
return null !== b && (c = b.ca,
|
|
c instanceof E && (null === c.layer || c.layer.lt)) ? b : null
|
|
};
|
|
ni.prototype.isValidFrom = function(a, b) {
|
|
if (null === a || null === b) return this.Cp;
|
|
if (this.h.eb === this && (null !== a.layer && !a.layer.lt || !0 !== b.vE)) return !1;
|
|
var c = b.Yz;
|
|
if (Infinity > c) {
|
|
if (null !== this.sc && a === this.Ng && b === this.Og) return !0;
|
|
var d = b.yd;
|
|
null === d && (d = "");
|
|
if (a.Yw(d).count >= c) return !1
|
|
}
|
|
return !0
|
|
};
|
|
ni.prototype.isValidTo = function(a, b) {
|
|
if (null === a || null === b) return this.Cp;
|
|
if (this.h.eb === this && (null !== a.layer && !a.layer.lt || !0 !== b.TF)) return !1;
|
|
var c = b.wJ;
|
|
if (Infinity > c) {
|
|
if (null !== this.sc && a === this.Pg && b === this.Qg) return !0;
|
|
var d = b.yd;
|
|
null === d && (d = "");
|
|
if (a.Hg(d).count >= c) return !1
|
|
}
|
|
return !0
|
|
};
|
|
ni.prototype.isInSameNode = function(a, b) {
|
|
if (null === a || null === b) return !1;
|
|
if (a === b) return !0;
|
|
var c = a.ca,
|
|
d = b.ca;
|
|
return null !== c && c === d
|
|
};
|
|
ni.prototype.isLinked = function(a, b) {
|
|
if (null === a || null === b) return !1;
|
|
var c = a.ca;
|
|
if (!(c instanceof E)) return !1;
|
|
var d = a.yd;
|
|
null === d && (d = "");
|
|
var e = b.ca;
|
|
if (!(e instanceof E)) return !1;
|
|
var g = b.yd;
|
|
null === g && (g = "");
|
|
for (e = e.Hg(g); e.next();)
|
|
if (g = e.value, g.Y === c && g.$f === d) return !0;
|
|
return !1
|
|
};
|
|
ni.prototype.isValidLink = function(a, b, c, d) {
|
|
if (!this.isValidFrom(a, b) || !this.isValidTo(c, d) || !(null === b || null === d || (b.KH && d.vJ || !this.isInSameNode(b, d)) && (b.JH && d.uJ || !this.isLinked(b, d))) || null !== this.sc && (null !== a && this.isLabelDependentOnLink(a, this.sc) || null !== c && this.isLabelDependentOnLink(c, this.sc)) || null !== a && null !== c && (null === a.data && null !== c.data || null !== a.data && null === c.data) || !this.isValidCycle(a, c, this.sc)) return !1;
|
|
if (null !== a) {
|
|
var e = a.px;
|
|
if (null !== e && !e(a, b, c, d, this.sc)) return !1
|
|
}
|
|
if (null !==
|
|
c && (e = c.px, null !== e && !e(a, b, c, d, this.sc))) return !1;
|
|
e = this.px;
|
|
return null !== e ? e(a, b, c, d, this.sc) : !0
|
|
};
|
|
ni.prototype.isLabelDependentOnLink = function(a, b) {
|
|
if (null === a) return !1;
|
|
var c = a.Nd;
|
|
if (null === c) return !1;
|
|
if (c === b) return !0;
|
|
var d = new K(E);
|
|
d.add(a);
|
|
return oi(this, c, b, d)
|
|
};
|
|
|
|
function oi(a, b, c, d) {
|
|
if (b === c) return !0;
|
|
var e = b.Y;
|
|
if (null !== e && e.Df && (d.add(e), oi(a, e.Nd, c, d))) return !0;
|
|
b = b.da;
|
|
return null !== b && b.Df && (d.add(b), oi(a, b.Nd, c, d)) ? !0 : !1
|
|
}
|
|
ni.prototype.isValidCycle = function(a, b, c) {
|
|
void 0 === c && (c = null);
|
|
if (null === a || null === b) return this.Cp;
|
|
var d = this.h.CJ;
|
|
if (d !== yi) {
|
|
if (d === zi) {
|
|
if (null !== c && !c.Oc) return !0;
|
|
for (d = b.ee; d.next();) {
|
|
var e = d.value;
|
|
if (e !== c && e.Oc && e.da === b) return !1
|
|
}
|
|
return !Ai(this, a, b, c, !0)
|
|
}
|
|
if (d === Bi) {
|
|
if (null !== c && !c.Oc) return !0;
|
|
for (d = a.ee; d.next();)
|
|
if (e = d.value, e !== c && e.Oc && e.Y === a) return !1;
|
|
return !Ai(this, a, b, c, !0)
|
|
}
|
|
if (d === Ci) return a === b ? a = !0 : (d = new K(E), d.add(b), a = Di(this, d, a, b, c)), !a;
|
|
if (d === Ei) return !Ai(this, a, b, c, !1);
|
|
if (d ===
|
|
Fi) return a === b ? a = !0 : (d = new K(E), d.add(b), a = Gi(this, d, a, b, c)), !a
|
|
}
|
|
return !0
|
|
};
|
|
|
|
function Ai(a, b, c, d, e) {
|
|
if (b === c) return !0;
|
|
if (null === b || null === c) return !1;
|
|
for (var g = b.ee; g.next();) {
|
|
var h = g.value;
|
|
if (h !== d && (!e || h.Oc) && h.da === b && (h = h.Y, h !== b && Ai(a, h, c, d, e))) return !0
|
|
}
|
|
return !1
|
|
}
|
|
|
|
function Di(a, b, c, d, e) {
|
|
if (c === d) return !0;
|
|
if (null === c || null === d || b.contains(c)) return !1;
|
|
b.add(c);
|
|
for (var g = c.ee; g.next();) {
|
|
var h = g.value;
|
|
if (h !== e && h.da === c && (h = h.Y, h !== c && Di(a, b, h, d, e))) return !0
|
|
}
|
|
return !1
|
|
}
|
|
|
|
function Gi(a, b, c, d, e) {
|
|
if (c === d) return !0;
|
|
if (null === c || null === d || b.contains(c)) return !1;
|
|
b.add(c);
|
|
for (var g = c.ee; g.next();) {
|
|
var h = g.value;
|
|
if (h !== e) {
|
|
var k = h.Y,
|
|
h = h.da,
|
|
k = k === c ? h : k;
|
|
if (k !== c && Gi(a, b, k, d, e)) return !0
|
|
}
|
|
}
|
|
return !1
|
|
}
|
|
z.defineProperty(ni, {
|
|
px: "linkValidation"
|
|
}, function() {
|
|
return this.el
|
|
}, function(a) {
|
|
null !== a && z.g(a, "function", ni, "linkValidation");
|
|
this.el = a
|
|
});
|
|
z.defineProperty(ni, {
|
|
Ax: "portTargeted"
|
|
}, function() {
|
|
return this.VC
|
|
}, function(a) {
|
|
null !== a && z.g(a, "function", ni, "portTargeted");
|
|
this.VC = a
|
|
});
|
|
|
|
function ta() {
|
|
0 < arguments.length && z.od(ta);
|
|
ni.call(this);
|
|
this.name = "Linking";
|
|
this.ky = {};
|
|
this.jy = null;
|
|
this.fa = Hi;
|
|
this.dD = null
|
|
}
|
|
z.Qa(ta, ni);
|
|
z.ia("LinkingTool", ta);
|
|
var Hi;
|
|
ta.Either = Hi = z.s(ta, "Either", 0);
|
|
var Ii;
|
|
ta.ForwardsOnly = Ii = z.s(ta, "ForwardsOnly", 0);
|
|
var Ji;
|
|
ta.BackwardsOnly = Ji = z.s(ta, "BackwardsOnly", 0);
|
|
z.defineProperty(ta, {
|
|
TG: "archetypeLinkData"
|
|
}, function() {
|
|
return this.ky
|
|
}, function(a) {
|
|
null !== a && z.l(a, Object, ta, "archetypeLinkData");
|
|
a instanceof O && z.l(a, G, ta, "archetypeLinkData");
|
|
this.ky = a
|
|
});
|
|
z.defineProperty(ta, {
|
|
JD: "archetypeLabelNodeData"
|
|
}, function() {
|
|
return this.jy
|
|
}, function(a) {
|
|
null !== a && z.l(a, Object, ta, "archetypeLabelNodeData");
|
|
a instanceof O && z.l(a, E, ta, "archetypeLabelNodeData");
|
|
this.jy = a
|
|
});
|
|
z.defineProperty(ta, {
|
|
direction: "direction"
|
|
}, function() {
|
|
return this.fa
|
|
}, function(a) {
|
|
z.Ba(a, ta, ta, "direction");
|
|
this.fa = a
|
|
});
|
|
z.defineProperty(ta, {
|
|
PF: "startObject"
|
|
}, function() {
|
|
return this.dD
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, ta, "startObject");
|
|
this.dD = a
|
|
});
|
|
ta.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
if (null === a || a.jb || a.Ef || !a.lt) return !1;
|
|
var b = a.ha;
|
|
return (b instanceof V || b instanceof ng) && a.Q.left && (a.eb === this || this.isBeyondDragSize()) ? null !== this.findLinkablePort() : !1
|
|
};
|
|
ta.prototype.findLinkablePort = function() {
|
|
var a = this.h;
|
|
if (null === a) return null;
|
|
var b = this.PF;
|
|
null === b && (b = a.pe(a.Fc.ga, null, null));
|
|
if (null === b || !(b.ca instanceof E)) return null;
|
|
a = this.direction;
|
|
if (a === Hi || a === Ii) {
|
|
var c = this.findValidLinkablePort(b, !1);
|
|
if (null !== c) return this.Md = !0, c
|
|
}
|
|
if (a === Hi || a === Ji)
|
|
if (c = this.findValidLinkablePort(b, !0), null !== c) return this.Md = !1, c;
|
|
return null
|
|
};
|
|
ta.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = this.findLinkablePort();
|
|
null !== b && (this.Wb(this.name), a.We = !0, a.gc = "pointer", this.Md ? (null === this.Pd || this.Pd.location.F() || (this.Pd.location = a.Q.ga), this.Og = b, b = this.Og.ca, b instanceof E && (this.Ng = b), this.copyPortProperties(this.Ng, this.Og, this.Od, this.zn, !1)) : (null === this.Od || this.Od.location.F() || (this.Od.location = a.Q.ga), this.Qg = b, b = this.Qg.ca, b instanceof E && (this.Pg = b), this.copyPortProperties(this.Pg, this.Qg, this.Pd, this.An, !0)), a.add(this.Od), a.add(this.Pd), null !== this.Tg && (null !== this.Od && (this.Tg.Y = this.Od), null !== this.Pd && (this.Tg.da = this.Pd), this.Tg.qc(), a.add(this.Tg)), this.ua = !0)
|
|
}
|
|
};
|
|
ta.prototype.doDeactivate = function() {
|
|
this.ua = !1;
|
|
var a = this.h;
|
|
null !== a && (a.remove(this.Tg), a.remove(this.Od), a.remove(this.Pd), a.We = !1, a.gc = "", this.xk())
|
|
};
|
|
ta.prototype.doStop = function() {
|
|
ni.prototype.doStop.call(this);
|
|
this.PF = null
|
|
};
|
|
ta.prototype.doMouseUp = function() {
|
|
if (this.ua) {
|
|
var a = this.h;
|
|
if (null === a) return;
|
|
var b = this.Mf = null,
|
|
c = null,
|
|
d = null,
|
|
e = null,
|
|
g = this.jg = this.findTargetPort(this.Md);
|
|
if (null !== g) {
|
|
var h = g.ca;
|
|
h instanceof E && (this.Md ? (null !== this.Ng && (b = this.Ng, c = this.Og), d = h, e = g) : (b = h, c = g, null !== this.Pg && (d = this.Pg, e = this.Qg)))
|
|
} else this.Md ? null !== this.Ng && this.Cp && (b = this.Ng, c = this.Og) : null !== this.Pg && this.Cp && (d = this.Pg, e = this.Qg);
|
|
null !== b || null !== d ? (h = this.insertLink(b, c, d, e), null !== h ? (null === g && (this.Md ? h.Zn = a.Q.ga.copy() :
|
|
h.Vn = a.Q.ga.copy()), a.xf && a.select(h), this.Mf = this.name, a.Ja("LinkDrawn", h)) : (a.ha.QD(), this.doNoLink(b, c, d, e))) : this.Md ? this.doNoLink(this.Ng, this.Og, null, null) : this.doNoLink(null, null, this.Pg, this.Qg)
|
|
}
|
|
this.stopTool()
|
|
};
|
|
ta.prototype.insertLink = function(a, b, c, d) {
|
|
var e = this.h;
|
|
if (null === e) return null;
|
|
var g = e.ha;
|
|
if (g instanceof ng) {
|
|
var h = a;
|
|
b = c;
|
|
e.ce || (h = c, b = a);
|
|
if (null !== h && null !== b) return g.Eh(b.data, g.pb(h.data)), b.pp()
|
|
} else if (g instanceof V)
|
|
if (h = "", null !== a && (null === b && (b = a), h = b.yd, null === h && (h = "")), b = "", null !== c && (null === d && (d = c), b = d.yd, null === b && (b = "")), d = this.TG, d instanceof G) {
|
|
if (gh(d), g = d.copy(), null !== g) return g.Y = a, g.$f = h, g.da = c, g.Ug = b, e.add(g), a = this.JD, a instanceof E && (gh(a), a = a.copy(), null !== a && (a.Nd = g, e.add(a))),
|
|
g
|
|
} else if (null !== d && (d = g.Pw(d), z.Za(d))) return null !== a && g.Kx(d, g.pb(a.data)), g.PA(d, h), null !== c && g.Ox(d, g.pb(c.data)), g.SA(d, b), g.gt(d), a = this.JD, null === a || a instanceof E || (a = g.copyNodeData(a), z.Za(a) && (g.rl(a), a = g.pb(a), void 0 !== a && g.zz(d, a))), g = e.Zf(d);
|
|
return null
|
|
};
|
|
ta.prototype.doNoLink = function() {};
|
|
|
|
function Jh() {
|
|
0 < arguments.length && z.od(Jh);
|
|
ni.call(this);
|
|
this.name = "Relinking";
|
|
var a = new X;
|
|
a.Hb = "Diamond";
|
|
a.Aa = be;
|
|
a.fill = "lightblue";
|
|
a.stroke = "dodgerblue";
|
|
a.cursor = "pointer";
|
|
a.De = 0;
|
|
this.eC = a;
|
|
a = new X;
|
|
a.Hb = "Diamond";
|
|
a.Aa = be;
|
|
a.fill = "lightblue";
|
|
a.stroke = "dodgerblue";
|
|
a.cursor = "pointer";
|
|
a.De = -1;
|
|
this.pD = a;
|
|
this.ac = null;
|
|
this.OC = new w
|
|
}
|
|
z.Qa(Jh, ni);
|
|
z.ia("RelinkingTool", Jh);
|
|
Jh.prototype.updateAdornments = function(a) {
|
|
if (null !== a && a instanceof G) {
|
|
var b = "RelinkFrom",
|
|
c = null;
|
|
if (a.kb && !this.h.jb) {
|
|
var d = a.vn;
|
|
null !== d && a.canRelinkFrom() && a.W.F() && a.isVisible() && d.W.F() && d.nj() && (c = a.lp(b), null === c && (c = this.makeAdornment(d, !1), null !== c && (c.nc = b), a.ql(b, c)))
|
|
}
|
|
null === c && a.rj(b);
|
|
b = "RelinkTo";
|
|
c = null;
|
|
a.kb && !this.h.jb && (d = a.vn, null !== d && a.canRelinkTo() && a.W.F() && a.isVisible() && d.W.F() && d.nj() && (c = a.lp(b), null === c && (c = this.makeAdornment(d, !0), null !== c && (c.nc = b), a.ql(b, c))));
|
|
null === c &&
|
|
a.rj(b)
|
|
}
|
|
};
|
|
Jh.prototype.makeAdornment = function(a, b) {
|
|
var c = new da;
|
|
c.type = Ki;
|
|
var d = b ? this.tJ : this.IH;
|
|
null !== d && c.add(d.copy());
|
|
c.fc = a;
|
|
return c
|
|
};
|
|
z.defineProperty(Jh, {
|
|
IH: "fromHandleArchetype"
|
|
}, function() {
|
|
return this.eC
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, Jh, "fromHandleArchetype");
|
|
this.eC = a
|
|
});
|
|
z.defineProperty(Jh, {
|
|
tJ: "toHandleArchetype"
|
|
}, function() {
|
|
return this.pD
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, Jh, "toHandleArchetype");
|
|
this.pD = a
|
|
});
|
|
z.w(Jh, {
|
|
handle: "handle"
|
|
}, function() {
|
|
return this.ac
|
|
});
|
|
Jh.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
if (null === a || a.jb || a.Ef || !a.Tm) return !1;
|
|
var b = a.ha;
|
|
if (!(b instanceof V || b instanceof ng) || !a.Q.left) return !1;
|
|
b = this.findToolHandleAt(a.Fc.ga, "RelinkFrom");
|
|
null === b && (b = this.findToolHandleAt(a.Fc.ga, "RelinkTo"));
|
|
return null !== b
|
|
};
|
|
Jh.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
if (null === this.sc) {
|
|
var b = this.findToolHandleAt(a.Fc.ga, "RelinkFrom");
|
|
null === b && (b = this.findToolHandleAt(a.Fc.ga, "RelinkTo"));
|
|
if (null === b) return;
|
|
var c = b.ca;
|
|
if (!(c instanceof da && c.Wf instanceof G)) return;
|
|
this.ac = b;
|
|
this.Md = null === c || "RelinkTo" === c.nc;
|
|
this.sc = c.Wf
|
|
}
|
|
this.Wb(this.name);
|
|
a.We = !0;
|
|
a.gc = "pointer";
|
|
this.Og = this.sc.md;
|
|
this.Ng = this.sc.Y;
|
|
this.Qg = this.sc.Qd;
|
|
this.Pg = this.sc.da;
|
|
this.OC.set(this.sc.W);
|
|
null !== this.sc && 0 < this.sc.sa && (null ===
|
|
this.sc.Y && (null !== this.zn && (this.zn.Aa = Pd), null !== this.Od && (this.Od.location = this.sc.m(0))), null === this.sc.da && (null !== this.An && (this.An.Aa = Pd), null !== this.Pd && (this.Pd.location = this.sc.m(this.sc.sa - 1))));
|
|
this.copyPortProperties(this.Ng, this.Og, this.Od, this.zn, !1);
|
|
this.copyPortProperties(this.Pg, this.Qg, this.Pd, this.An, !0);
|
|
a.add(this.Od);
|
|
a.add(this.Pd);
|
|
null !== this.Tg && (null !== this.Od && (this.Tg.Y = this.Od), null !== this.Pd && (this.Tg.da = this.Pd), this.copyLinkProperties(this.sc, this.Tg), this.Tg.qc(), a.add(this.Tg));
|
|
this.ua = !0
|
|
}
|
|
};
|
|
Jh.prototype.copyLinkProperties = function(a, b) {
|
|
if (null !== a && null !== b) {
|
|
b.it = a.it;
|
|
b.Kz = a.Kz;
|
|
var c = a.Se;
|
|
if (c === Li || c === Mi) c = Ni;
|
|
b.Se = c;
|
|
b.Qw = a.Qw;
|
|
b.Gx = a.Gx;
|
|
b.cq = a.cq;
|
|
b.Db = a.Db;
|
|
b.Il = a.Il;
|
|
b.Et = a.Et;
|
|
b.Ft = a.Ft;
|
|
b.Eb = a.Eb;
|
|
b.Yl = a.Yl;
|
|
b.zu = a.zu;
|
|
b.Au = a.Au
|
|
}
|
|
};
|
|
Jh.prototype.doDeactivate = function() {
|
|
this.ua = !1;
|
|
var a = this.h;
|
|
null !== a && (a.remove(this.Tg), a.remove(this.Od), a.remove(this.Pd), a.We = !1, a.gc = "", this.xk())
|
|
};
|
|
Jh.prototype.doStop = function() {
|
|
ni.prototype.doStop.call(this);
|
|
this.ac = null
|
|
};
|
|
Jh.prototype.doMouseUp = function() {
|
|
if (this.ua) {
|
|
var a = this.h;
|
|
if (null === a) return;
|
|
this.Mf = null;
|
|
var b = this.Ng,
|
|
c = this.Og,
|
|
d = this.Pg,
|
|
e = this.Qg,
|
|
g = this.sc;
|
|
this.jg = this.findTargetPort(this.Md);
|
|
if (null !== this.jg) {
|
|
var h = this.jg.ca;
|
|
h instanceof E && (this.Md ? (d = h, e = this.jg) : (b = h, c = this.jg))
|
|
} else this.Cp ? this.Md ? e = d = null : c = b = null : g = null;
|
|
null !== g ? (this.reconnectLink(g, this.Md ? d : b, this.Md ? e : c, this.Md), null === this.jg && (this.Md ? g.Zn = a.Q.ga.copy() : g.Vn = a.Q.ga.copy(), g.qc()), a.xf && (g.kb = !0), this.Mf = this.name, a.Ja("LinkRelinked",
|
|
g, this.Md ? this.Qg : this.Og)) : this.doNoRelink(this.sc, this.Md);
|
|
Oi(this.sc, this.OC)
|
|
}
|
|
this.stopTool()
|
|
};
|
|
Jh.prototype.reconnectLink = function(a, b, c, d) {
|
|
if (null === this.h) return !1;
|
|
c = null !== c && null !== c.yd ? c.yd : "";
|
|
d ? (a.da = b, a.Ug = c) : (a.Y = b, a.$f = c);
|
|
return !0
|
|
};
|
|
Jh.prototype.doNoRelink = function() {};
|
|
|
|
function ii(a, b, c, d, e) {
|
|
null !== b ? (a.copyPortProperties(b, c, a.Od, a.zn, !1), a.h.add(a.Od)) : a.h.remove(a.Od);
|
|
null !== d ? (a.copyPortProperties(d, e, a.Pd, a.An, !0), a.h.add(a.Pd)) : a.h.remove(a.Pd)
|
|
}
|
|
|
|
function Pi() {
|
|
0 < arguments.length && z.od(Pi);
|
|
ug.call(this);
|
|
this.name = "LinkReshaping";
|
|
var a = new X;
|
|
a.Hb = "Rectangle";
|
|
a.Aa = ae;
|
|
a.fill = "lightblue";
|
|
a.stroke = "dodgerblue";
|
|
this.Uk = a;
|
|
a = new X;
|
|
a.Hb = "Diamond";
|
|
a.Aa = ae;
|
|
a.fill = "lightblue";
|
|
a.stroke = "dodgerblue";
|
|
this.CC = a;
|
|
this.WC = 3;
|
|
this.hy = this.ac = null;
|
|
this.PC = new N;
|
|
this.Vv = null
|
|
}
|
|
z.Qa(Pi, ug);
|
|
z.ia("LinkReshapingTool", Pi);
|
|
var Qi;
|
|
Pi.None = Qi = z.s(Pi, "None", 0);
|
|
var Ri;
|
|
Pi.Horizontal = Ri = z.s(Pi, "Horizontal", 1);
|
|
var Si;
|
|
Pi.Vertical = Si = z.s(Pi, "Vertical", 2);
|
|
var Ti;
|
|
Pi.All = Ti = z.s(Pi, "All", 3);
|
|
Pi.prototype.getReshapingBehavior = Pi.prototype.zE = function(a) {
|
|
return a && a.XC ? a.XC : Qi
|
|
};
|
|
Pi.prototype.setReshapingBehavior = Pi.prototype.su = function(a, b) {
|
|
z.l(a, O, Pi, "setReshapingBehavior:obj");
|
|
z.Ba(b, Pi, Pi, "setReshapingBehavior:behavior");
|
|
a.XC = b
|
|
};
|
|
Pi.prototype.updateAdornments = function(a) {
|
|
if (null !== a && a instanceof G) {
|
|
if (a.kb && !this.h.jb) {
|
|
var b = a.path;
|
|
if (null !== b && a.canReshape() && a.W.F() && a.isVisible() && b.W.F() && b.nj()) {
|
|
var c = a.lp(this.name);
|
|
if (null === c || c.wG !== a.sa || c.IG !== a.lu) c = this.makeAdornment(b), null !== c && (c.wG = a.sa, c.IG = a.lu, a.ql(this.name, c));
|
|
if (null !== c) {
|
|
c.location = a.position;
|
|
return
|
|
}
|
|
}
|
|
}
|
|
a.rj(this.name)
|
|
}
|
|
};
|
|
Pi.prototype.makeAdornment = function(a) {
|
|
var b = a.ca,
|
|
c = b.sa,
|
|
d = b.rc,
|
|
e = null;
|
|
if (null !== b.points && 1 < c) {
|
|
e = new da;
|
|
e.type = Ki;
|
|
var c = b.Bt,
|
|
g = b.ox,
|
|
h = d ? 1 : 0;
|
|
if (b.lu && b.Se !== Ui)
|
|
for (var k = c + h; k < g - h; k++) {
|
|
var l = this.makeResegmentHandle(a, k);
|
|
null !== l && (l.De = k, l.NA = .5, l.Yz = 999, e.add(l))
|
|
}
|
|
for (k = c + 1; k < g; k++)
|
|
if (l = this.makeHandle(a, k), null !== l) {
|
|
l.De = k;
|
|
if (k !== c)
|
|
if (k === c + 1 && d) {
|
|
var h = b.m(c),
|
|
m = b.m(c + 1);
|
|
eb(h.x, m.x) && eb(h.y, m.y) && (m = b.m(c - 1));
|
|
eb(h.x, m.x) ? (this.su(l, Si), l.cursor = "n-resize") : eb(h.y, m.y) && (this.su(l, Ri), l.cursor = "w-resize")
|
|
} else k ===
|
|
g - 1 && d ? (h = b.m(g - 1), m = b.m(g), eb(h.x, m.x) && eb(h.y, m.y) && (h = b.m(g + 1)), eb(h.x, m.x) ? (this.su(l, Si), l.cursor = "n-resize") : eb(h.y, m.y) && (this.su(l, Ri), l.cursor = "w-resize")) : k !== g && (this.su(l, Ti), l.cursor = "move");
|
|
e.add(l)
|
|
}
|
|
e.nc = this.name;
|
|
e.fc = a
|
|
}
|
|
return e
|
|
};
|
|
Pi.prototype.makeHandle = function() {
|
|
var a = this.Ht;
|
|
return null === a ? null : a.copy()
|
|
};
|
|
z.defineProperty(Pi, {
|
|
Ht: "handleArchetype"
|
|
}, function() {
|
|
return this.Uk
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, Pi, "handleArchetype");
|
|
this.Uk = a
|
|
});
|
|
Pi.prototype.makeResegmentHandle = function() {
|
|
var a = this.FI;
|
|
return null === a ? null : a.copy()
|
|
};
|
|
z.defineProperty(Pi, {
|
|
FI: "midHandleArchetype"
|
|
}, function() {
|
|
return this.CC
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, Pi, "midHandleArchetype");
|
|
this.CC = a
|
|
});
|
|
z.w(Pi, {
|
|
handle: "handle"
|
|
}, function() {
|
|
return this.ac
|
|
});
|
|
z.w(Pi, {
|
|
jt: "adornedLink"
|
|
}, function() {
|
|
return this.hy
|
|
});
|
|
Pi.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
return null !== a && !a.jb && a.Fw && a.Q.left ? null !== this.findToolHandleAt(a.Fc.ga, this.name) : !1
|
|
};
|
|
Pi.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
if (null !== a && (this.ac = this.findToolHandleAt(a.Fc.ga, this.name), null !== this.ac)) {
|
|
var b = this.ac.ca.Wf;
|
|
if (b instanceof G) {
|
|
this.hy = b;
|
|
a.We = !0;
|
|
this.Wb(this.name);
|
|
if (b.lu && 999 === this.ac.Yz) {
|
|
var c = b.points.copy(),
|
|
d = this.ac.fb(ec);
|
|
c.Ld(this.ac.De + 1, d);
|
|
b.rc && c.Ld(this.ac.De + 1, d);
|
|
b.points = c;
|
|
b.ae();
|
|
this.ac = this.findToolHandleAt(a.Fc.ga, this.name);
|
|
if (null === this.ac) {
|
|
this.doDeactivate();
|
|
return
|
|
}
|
|
}
|
|
this.PC = b.m(this.ac.De);
|
|
this.Vv = b.points.copy();
|
|
this.ua = !0
|
|
}
|
|
}
|
|
};
|
|
Pi.prototype.doDeactivate = function() {
|
|
this.xk();
|
|
this.hy = this.ac = null;
|
|
var a = this.h;
|
|
null !== a && (a.We = !1);
|
|
this.ua = !1
|
|
};
|
|
Pi.prototype.doCancel = function() {
|
|
var a = this.jt;
|
|
null !== a && (a.points = this.Vv);
|
|
this.stopTool()
|
|
};
|
|
Pi.prototype.doMouseMove = function() {
|
|
var a = this.h;
|
|
this.ua && null !== a && (a = this.computeReshape(a.Q.ga), this.reshape(a))
|
|
};
|
|
Pi.prototype.doMouseUp = function() {
|
|
var a = this.h;
|
|
if (this.ua && null !== a) {
|
|
var b = this.computeReshape(a.Q.ga);
|
|
this.reshape(b);
|
|
b = this.jt;
|
|
if (null !== b && b.lu) {
|
|
var c = this.handle.De,
|
|
d = b.m(c - 1),
|
|
e = b.m(c),
|
|
g = b.m(c + 1);
|
|
if (b.rc) {
|
|
if (c > b.Bt + 1 && c < b.ox - 1) {
|
|
var h = b.m(c - 2);
|
|
if (Math.abs(d.x - e.x) < this.Ch && Math.abs(d.y - e.y) < this.Ch && (Vi(this, h, d, e, g, !0) || Vi(this, h, d, e, g, !1))) {
|
|
var k = b.points.copy();
|
|
Vi(this, h, d, e, g, !0) ? (k.Rg(c - 2, new N(h.x, (g.y + h.y) / 2)), k.Rg(c + 1, new N(g.x, (g.y + h.y) / 2))) : (k.Rg(c - 2, new N((g.x + h.x) / 2, h.y)), k.Rg(c + 1,
|
|
new N((g.x + h.x) / 2, g.y)));
|
|
k.dd(c);
|
|
k.dd(c - 1);
|
|
b.points = k;
|
|
b.ae()
|
|
} else h = b.m(c + 2), Math.abs(e.x - g.x) < this.Ch && Math.abs(e.y - g.y) < this.Ch && (Vi(this, d, e, g, h, !0) || Vi(this, d, e, g, h, !1)) && (k = b.points.copy(), Vi(this, d, e, g, h, !0) ? (k.Rg(c - 1, new N(d.x, (d.y + h.y) / 2)), k.Rg(c + 2, new N(h.x, (d.y + h.y) / 2))) : (k.Rg(c - 1, new N((d.x + h.x) / 2, d.y)), k.Rg(c + 2, new N((d.x + h.x) / 2, h.y))), k.dd(c + 1), k.dd(c), b.points = k, b.ae())
|
|
}
|
|
} else h = z.O(), ib(d.x, d.y, g.x, g.y, e.x, e.y, h) && h.Af(e) < this.Ch * this.Ch && (k = b.points.copy(), k.dd(c), b.points = k, b.ae()),
|
|
z.A(h)
|
|
}
|
|
a.yc();
|
|
this.Mf = this.name;
|
|
a.Ja("LinkReshaped", this.jt, this.Vv)
|
|
}
|
|
this.stopTool()
|
|
};
|
|
|
|
function Vi(a, b, c, d, e, g) {
|
|
return g ? Math.abs(b.y - c.y) < a.Ch && Math.abs(c.y - d.y) < a.Ch && Math.abs(d.y - e.y) < a.Ch : Math.abs(b.x - c.x) < a.Ch && Math.abs(c.x - d.x) < a.Ch && Math.abs(d.x - e.x) < a.Ch
|
|
}
|
|
z.defineProperty(Pi, {
|
|
Ch: "resegmentingDistance"
|
|
}, function() {
|
|
return this.WC
|
|
}, function(a) {
|
|
z.g(a, "number", Pi, "resegmentingDistance");
|
|
this.WC = a
|
|
});
|
|
Pi.prototype.reshape = function(a) {
|
|
var b = this.jt;
|
|
b.Ul();
|
|
var c = this.handle.De,
|
|
d = this.zE(this.handle);
|
|
if (b.rc)
|
|
if (c === b.Bt + 1) c = b.Bt + 1, d === Si ? (b.aa(c, b.m(c - 1).x, a.y), b.aa(c + 1, b.m(c + 2).x, a.y)) : d === Ri && (b.aa(c, a.x, b.m(c - 1).y), b.aa(c + 1, a.x, b.m(c + 2).y));
|
|
else if (c === b.ox - 1) c = b.ox - 1, d === Si ? (b.aa(c - 1, b.m(c - 2).x, a.y), b.aa(c, b.m(c + 1).x, a.y)) : d === Ri && (b.aa(c - 1, a.x, b.m(c - 2).y), b.aa(c, a.x, b.m(c + 1).y));
|
|
else {
|
|
var d = c,
|
|
e = b.m(d),
|
|
g = b.m(d - 1),
|
|
h = b.m(d + 1);
|
|
eb(g.x, e.x) && eb(e.y, h.y) ? (eb(g.x, b.m(d - 2).x) && !eb(g.y, b.m(d - 2).y) ? (b.B(d,
|
|
a.x, g.y), c++, d++) : b.aa(d - 1, a.x, g.y), eb(h.y, b.m(d + 2).y) && !eb(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.aa(d + 1, h.x, a.y)) : eb(g.y, e.y) && eb(e.x, h.x) ? (eb(g.y, b.m(d - 2).y) && !eb(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.aa(d - 1, g.x, a.y), eb(h.x, b.m(d + 2).x) && !eb(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.aa(d + 1, a.x, h.y)) : eb(g.x, e.x) && eb(e.x, h.x) ? (eb(g.x, b.m(d - 2).x) && !eb(g.y, b.m(d - 2).y) ? (b.B(d, a.x, g.y), c++, d++) : b.aa(d - 1, a.x, g.y), eb(h.x, b.m(d + 2).x) && !eb(h.y, b.m(d + 2).y) ? b.B(d + 1, a.x, h.y) : b.aa(d + 1, a.x, h.y)) : eb(g.y, e.y) && eb(e.y,
|
|
h.y) && (eb(g.y, b.m(d - 2).y) && !eb(g.x, b.m(d - 2).x) ? (b.B(d, g.x, a.y), c++, d++) : b.aa(d - 1, g.x, a.y), eb(h.y, b.m(d + 2).y) && !eb(h.x, b.m(d + 2).x) ? b.B(d + 1, h.x, a.y) : b.aa(d + 1, h.x, a.y));
|
|
b.aa(c, a.x, a.y)
|
|
} else b.aa(c, a.x, a.y), 1 === c && b.computeSpot(!0).Be() && (e = b.Y, g = b.md, null === e || e.isVisible() || (e = e.findVisibleNode(), e !== b.Y && (g = e.Gl(""))), d = g.fb(ec, z.O()), e = b.getLinkPointFromPoint(e, g, d, a, !0, z.O()), b.aa(0, e.x, e.y), z.A(d), z.A(e)), c === b.sa - 2 && b.computeSpot(!1).Be() && (c = b.da, e = b.Qd, null === c || c.isVisible() || (c = c.findVisibleNode(),
|
|
c !== b.da && (e = c.Gl(""))), d = e.fb(ec, z.O()), e = b.getLinkPointFromPoint(c, e, d, a, !1, z.O()), b.aa(b.sa - 1, e.x, e.y), z.A(d), z.A(e));
|
|
b.cj()
|
|
};
|
|
Pi.prototype.computeReshape = function(a) {
|
|
var b = this.jt,
|
|
c = this.handle.De;
|
|
switch (this.zE(this.handle)) {
|
|
case Ti:
|
|
return a;
|
|
case Si:
|
|
return b = b.m(c), new N(b.x, a.y);
|
|
case Ri:
|
|
return b = b.m(c), new N(a.x, b.y);
|
|
default:
|
|
case Qi:
|
|
return b.m(c)
|
|
}
|
|
};
|
|
z.w(Pi, {
|
|
eL: "originalPoint"
|
|
}, function() {
|
|
return this.PC
|
|
});
|
|
z.w(Pi, {
|
|
fL: "originalPoints"
|
|
}, function() {
|
|
return this.Vv
|
|
});
|
|
|
|
function Wi() {
|
|
0 < arguments.length && z.od(Wi);
|
|
ug.call(this);
|
|
this.name = "Resizing";
|
|
this.Tj = (new Ea(1, 1)).freeze();
|
|
this.Rj = (new Ea(9999, 9999)).freeze();
|
|
this.zj = (new Ea(NaN, NaN)).freeze();
|
|
this.jr = !1;
|
|
this.Ib = null;
|
|
var a = new X;
|
|
a.jk = ec;
|
|
a.Hb = "Rectangle";
|
|
a.Aa = ae;
|
|
a.fill = "lightblue";
|
|
a.stroke = "dodgerblue";
|
|
a.ub = 1;
|
|
a.cursor = "pointer";
|
|
this.Uk = a;
|
|
this.ac = null;
|
|
this.Uv = new Ea;
|
|
this.fz = new N;
|
|
this.Jy = new Ea(0, 0);
|
|
this.Iy = new Ea(Infinity, Infinity);
|
|
this.Hy = new Ea(1, 1);
|
|
this.IC = !0
|
|
}
|
|
z.Qa(Wi, ug);
|
|
z.ia("ResizingTool", Wi);
|
|
Wi.prototype.updateAdornments = function(a) {
|
|
if (!(null === a || a instanceof G)) {
|
|
if (a.kb && !this.h.jb) {
|
|
var b = a.vF;
|
|
if (null !== b && a.canResize() && a.W.F() && a.isVisible() && b.W.F() && b.nj()) {
|
|
var c = a.lp(this.name);
|
|
if (null === c || c.fc !== b) c = this.makeAdornment(b);
|
|
if (null !== c) {
|
|
var d = b.Kl();
|
|
c.angle = d;
|
|
var e = b.fb(c.of, z.O()),
|
|
g = b.gj();
|
|
c.location = e;
|
|
z.A(e);
|
|
e = c.placeholder;
|
|
if (null !== e) {
|
|
var b = b.Ga,
|
|
h = z.Xl();
|
|
h.n(b.width * g, b.height * g);
|
|
e.Aa = h;
|
|
z.pk(h)
|
|
}
|
|
Xi(this, c, d);
|
|
a.ql(this.name, c);
|
|
return
|
|
}
|
|
}
|
|
}
|
|
a.rj(this.name)
|
|
}
|
|
};
|
|
Wi.prototype.makeAdornment = function(a) {
|
|
var b = null,
|
|
b = a.ca.uF;
|
|
if (null === b) {
|
|
b = new da;
|
|
b.type = Yi;
|
|
b.of = ec;
|
|
var c = new Zi;
|
|
c.Ff = !0;
|
|
b.add(c);
|
|
b.add(this.makeHandle(a, Zb));
|
|
b.add(this.makeHandle(a, cc));
|
|
b.add(this.makeHandle(a, ic));
|
|
b.add(this.makeHandle(a, gc));
|
|
b.add(this.makeHandle(a, Zc));
|
|
b.add(this.makeHandle(a, ad));
|
|
b.add(this.makeHandle(a, bd));
|
|
b.add(this.makeHandle(a, $c))
|
|
} else if (gh(b), b = b.copy(), null === b) return null;
|
|
b.nc = this.name;
|
|
b.fc = a;
|
|
return b
|
|
};
|
|
Wi.prototype.makeHandle = function(a, b) {
|
|
var c = this.Ht;
|
|
if (null === c) return null;
|
|
c = c.copy();
|
|
c.alignment = b;
|
|
return c
|
|
};
|
|
|
|
function Xi(a, b, c) {
|
|
if (null !== b)
|
|
if (!b.alignment.bd() && "" !== b.cursor) a: {
|
|
a = b.alignment;a.Be() && (a = ec);
|
|
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 I)
|
|
for (b = b.elements; b.next();) Xi(a,
|
|
b.value, c)
|
|
}
|
|
z.defineProperty(Wi, {
|
|
Ht: "handleArchetype"
|
|
}, function() {
|
|
return this.Uk
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, Wi, "handleArchetype");
|
|
this.Uk = a
|
|
});
|
|
z.w(Wi, {
|
|
handle: "handle"
|
|
}, function() {
|
|
return this.ac
|
|
});
|
|
z.defineProperty(Wi, {
|
|
fc: "adornedObject"
|
|
}, function() {
|
|
return this.Ib
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, Wi, "adornedObject");
|
|
this.Ib = a
|
|
});
|
|
Wi.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
return null !== a && !a.jb && a.mt && a.Q.left ? null !== this.findToolHandleAt(a.Fc.ga, this.name) ? !0 : !1 : !1
|
|
};
|
|
Wi.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
null !== a && (this.ac = this.findToolHandleAt(a.Fc.ga, this.name), null !== this.ac && (this.Ib = this.ac.ca.fc, this.fz.set(this.Ib.ca.location), this.Uv.set(this.Ib.Aa), this.Hy = this.computeCellSize(), this.Jy = this.computeMinSize(), this.Iy = this.computeMaxSize(), a.We = !0, this.IC = a.Ua.isEnabled, a.Ua.isEnabled = !1, this.Wb(this.name), this.ua = !0))
|
|
};
|
|
Wi.prototype.doDeactivate = function() {
|
|
var a = this.h;
|
|
null !== a && (this.xk(), this.Ib = this.ac = null, this.ua = a.We = !1, a.Ua.isEnabled = this.IC)
|
|
};
|
|
Wi.prototype.doCancel = function() {
|
|
this.Ib.Aa = this.Uv;
|
|
this.Ib.ca.location = this.fz;
|
|
this.stopTool()
|
|
};
|
|
Wi.prototype.doMouseMove = function() {
|
|
var a = this.h;
|
|
if (this.ua && null !== a) {
|
|
var b = this.Jy,
|
|
c = this.Iy,
|
|
d = this.Hy,
|
|
e = this.Ib.xE(a.Q.ga, z.O()),
|
|
g = $i;
|
|
this.Ib instanceof X && (g = aj(this.Ib));
|
|
b = this.computeResize(e, this.ac.alignment, b, c, d, !(g === bj || g === cj || a.Q.shift));
|
|
this.resize(b);
|
|
a.bg();
|
|
z.A(e)
|
|
}
|
|
};
|
|
Wi.prototype.doMouseUp = function() {
|
|
var a = this.h;
|
|
if (this.ua && null !== a) {
|
|
var b = this.Jy,
|
|
c = this.Iy,
|
|
d = this.Hy,
|
|
e = this.Ib.xE(a.Q.ga, z.O()),
|
|
g = $i;
|
|
this.Ib instanceof X && (g = aj(this.Ib));
|
|
b = this.computeResize(e, this.ac.alignment, b, c, d, !(g === bj || g === cj || a.Q.shift));
|
|
this.resize(b);
|
|
z.A(e);
|
|
a.yc();
|
|
this.Mf = this.name;
|
|
a.Ja("PartResized", this.Ib, this.Uv)
|
|
}
|
|
this.stopTool()
|
|
};
|
|
Wi.prototype.resize = function(a) {
|
|
if (null !== this.h) {
|
|
var b = this.fc,
|
|
c = b.ca,
|
|
d = b.Kl(),
|
|
e = b.gj(),
|
|
g = Math.PI * d / 180,
|
|
h = Math.cos(g),
|
|
g = Math.sin(g),
|
|
k = 0 < d && 180 > d ? 1 : 0,
|
|
l = 90 < d && 270 > d ? 1 : 0,
|
|
d = 180 < d && 360 > d ? 1 : 0,
|
|
m = b.Ga.width,
|
|
n = b.Ga.height;
|
|
b.Aa = a.size;
|
|
var p = c.position.copy();
|
|
c.Bf();
|
|
m = b.Ga.width - m;
|
|
n = b.Ga.height - n;
|
|
if (0 !== m || 0 !== n) 0 !== m && (p.x += e * ((a.x + m * l) * h - (a.y + n * k) * g)), 0 !== n && (p.y += e * ((a.x + m * d) * g + (a.y + n * l) * h)), c.move(p), c instanceof E && c.mf()
|
|
}
|
|
};
|
|
Wi.prototype.computeResize = function(a, b, c, d, e, g) {
|
|
b.Be() && (b = ec);
|
|
var h = this.fc.Ga,
|
|
k = h.x,
|
|
l = h.y,
|
|
m = h.x + h.width,
|
|
n = h.y + h.height,
|
|
p = 1;
|
|
if (!g) {
|
|
var p = h.width,
|
|
q = h.height;
|
|
0 >= p && (p = 1);
|
|
0 >= q && (q = 1);
|
|
p = q / p
|
|
}
|
|
q = z.O();
|
|
jb(a.x, a.y, k, l, e.width, e.height, q);
|
|
a = h.copy();
|
|
0 >= b.x ? 0 >= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : (a.width =
|
|
a.height / p, a.x = m - a.width))) : 1 <= b.y ? (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = Math.max(m - a.x, c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : (a.width = a.height / p, a.x = m - a.width))) : (a.x = Math.max(q.x, m - d.width), a.x = Math.min(a.x, m - c.width), a.width = m - a.x, g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 1 <= b.x ? 0 >= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height),
|
|
a.height = Math.max(n - a.y, c.height), g || (b = a.height / a.width, p < b ? (a.height = p * a.width, a.y = n - a.height) : a.width = a.height / p)) : 1 <= b.y ? (a.width = Math.max(Math.min(q.x - k, d.width), c.width), a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (b = a.height / a.width, p < b ? a.height = p * a.width : a.width = a.height / p)) : (a.width = Math.max(Math.min(q.x - k, d.width), c.width), g || (a.height = p * a.width, a.y = l + .5 * (n - l - a.height))) : 0 >= b.y ? (a.y = Math.max(q.y, n - d.height), a.y = Math.min(a.y, n - c.height), a.height = n - a.y, g || (a.width = a.height / p, a.x =
|
|
k + .5 * (m - k - a.width))) : 1 <= b.y && (a.height = Math.max(Math.min(q.y - l, d.height), c.height), g || (a.width = a.height / p, a.x = k + .5 * (m - k - a.width)));
|
|
z.A(q);
|
|
return a
|
|
};
|
|
Wi.prototype.computeMinSize = function() {
|
|
var a = this.fc.cg.copy(),
|
|
b = this.cg;
|
|
!isNaN(b.width) && b.width > a.width && (a.width = b.width);
|
|
!isNaN(b.height) && b.height > a.height && (a.height = b.height);
|
|
return a
|
|
};
|
|
Wi.prototype.computeMaxSize = function() {
|
|
var a = this.fc.Xe.copy(),
|
|
b = this.Xe;
|
|
!isNaN(b.width) && b.width < a.width && (a.width = b.width);
|
|
!isNaN(b.height) && b.height < a.height && (a.height = b.height);
|
|
return a
|
|
};
|
|
Wi.prototype.computeCellSize = function() {
|
|
var a = new Ea(NaN, NaN),
|
|
b = this.fc.ca;
|
|
if (null !== b) {
|
|
var c = b.ZI;
|
|
!isNaN(c.width) && 0 < c.width && (a.width = c.width);
|
|
!isNaN(c.height) && 0 < c.height && (a.height = c.height)
|
|
}
|
|
c = this.dp;
|
|
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.hb.me, null !== c && c.ix && (c = c.BE, 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.Gt, null !== b && b.visible && this.ix && (c = b.bx, isNaN(a.width) && !isNaN(c.width) && 0 < c.width && (a.width = c.width), isNaN(a.height) && !isNaN(c.height) && 0 < c.height && (a.height = c.height)));
|
|
if (isNaN(a.width) || 0 === a.width || Infinity === a.width) a.width = 1;
|
|
if (isNaN(a.height) || 0 === a.height || Infinity === a.height) a.height = 1;
|
|
return a
|
|
};
|
|
z.defineProperty(Wi, {
|
|
cg: "minSize"
|
|
}, function() {
|
|
return this.Tj
|
|
}, function(a) {
|
|
z.l(a, Ea, Wi, "minSize");
|
|
if (!this.Tj.N(a)) {
|
|
var b = a.width;
|
|
isNaN(b) && (b = 0);
|
|
a = a.height;
|
|
isNaN(a) && (a = 0);
|
|
this.Tj.n(b, a)
|
|
}
|
|
});
|
|
z.defineProperty(Wi, {
|
|
Xe: "maxSize"
|
|
}, function() {
|
|
return this.Rj
|
|
}, function(a) {
|
|
z.l(a, Ea, Wi, "maxSize");
|
|
if (!this.Rj.N(a)) {
|
|
var b = a.width;
|
|
isNaN(b) && (b = Infinity);
|
|
a = a.height;
|
|
isNaN(a) && (a = Infinity);
|
|
this.Rj.n(b, a)
|
|
}
|
|
});
|
|
z.defineProperty(Wi, {
|
|
dp: "cellSize"
|
|
}, function() {
|
|
return this.zj
|
|
}, function(a) {
|
|
z.l(a, Ea, Wi, "cellSize");
|
|
this.zj.N(a) || this.zj.assign(a)
|
|
});
|
|
z.defineProperty(Wi, {
|
|
ix: "isGridSnapEnabled"
|
|
}, function() {
|
|
return this.jr
|
|
}, function(a) {
|
|
z.g(a, "boolean", Wi, "isGridSnapEnabled");
|
|
this.jr = a
|
|
});
|
|
z.w(Wi, {
|
|
cL: "originalDesiredSize"
|
|
}, function() {
|
|
return this.Uv
|
|
});
|
|
z.w(Wi, {
|
|
dL: "originalLocation"
|
|
}, function() {
|
|
return this.fz
|
|
});
|
|
|
|
function dj() {
|
|
0 < arguments.length && z.od(dj);
|
|
ug.call(this);
|
|
this.name = "Rotating";
|
|
this.bD = 45;
|
|
this.aD = 2;
|
|
this.Ib = null;
|
|
var a = new X;
|
|
a.Hb = "Ellipse";
|
|
a.Aa = be;
|
|
a.fill = "lightblue";
|
|
a.stroke = "dodgerblue";
|
|
a.ub = 1;
|
|
a.cursor = "pointer";
|
|
this.Uk = a;
|
|
this.ac = null;
|
|
this.Tv = 0;
|
|
this.YC = new N
|
|
}
|
|
z.Qa(dj, ug);
|
|
z.ia("RotatingTool", dj);
|
|
dj.prototype.updateAdornments = function(a) {
|
|
if (!(null === a || a instanceof G)) {
|
|
if (a.kb && !this.h.jb) {
|
|
var b = a.zF;
|
|
if (null !== b && a.canRotate() && a.W.F() && a.isVisible() && b.W.F() && b.nj()) {
|
|
var c = a.lp(this.name);
|
|
if (null === c || c.fc !== b) c = this.makeAdornment(b);
|
|
if (null !== c) {
|
|
c.angle = b.Kl();
|
|
var d = null,
|
|
e = null;
|
|
b === a || b === a.Zb ? (d = a.Zb, e = a.of) : (d = b, e = ec);
|
|
for (var g = d.Ga, e = z.Tb(g.width * e.x + e.offsetX, g.height * e.y + e.offsetY); null !== d && d !== b;) d.transform.Cb(e), d = d.U;
|
|
var d = e.y,
|
|
g = Math.max(e.x - b.Ga.width, 0),
|
|
h = z.O();
|
|
c.location = b.fb(new Q(1,
|
|
0, 50 + g, d), h);
|
|
z.A(h);
|
|
z.A(e);
|
|
a.ql(this.name, c);
|
|
return
|
|
}
|
|
}
|
|
}
|
|
a.rj(this.name)
|
|
}
|
|
};
|
|
dj.prototype.makeAdornment = function(a) {
|
|
var b = null,
|
|
b = a.ca.aJ;
|
|
if (null === b) {
|
|
b = new da;
|
|
b.type = ej;
|
|
b.of = ec;
|
|
var c = this.Ht;
|
|
null !== c && b.add(c.copy())
|
|
} else if (gh(b), b = b.copy(), null === b) return null;
|
|
b.nc = this.name;
|
|
b.fc = a;
|
|
return b
|
|
};
|
|
z.defineProperty(dj, {
|
|
Ht: "handleArchetype"
|
|
}, function() {
|
|
return this.Uk
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, dj, "handleArchetype");
|
|
this.Uk = a
|
|
});
|
|
z.w(dj, {
|
|
handle: "handle"
|
|
}, function() {
|
|
return this.ac
|
|
});
|
|
z.defineProperty(dj, {
|
|
fc: "adornedObject"
|
|
}, function() {
|
|
return this.Ib
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, dj, "adornedObject");
|
|
this.Ib = a
|
|
});
|
|
dj.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
return null !== a && !a.jb && a.Gw && a.Q.left ? null !== this.findToolHandleAt(a.Fc.ga, this.name) ? !0 : !1 : !1
|
|
};
|
|
dj.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
if (null !== a && (this.ac = this.findToolHandleAt(a.Fc.ga, this.name), null !== this.ac)) {
|
|
this.Ib = this.ac.ca.fc;
|
|
var b = this.Ib.ca,
|
|
c = b.Zb;
|
|
this.YC = this.Ib === b || this.Ib === c ? c.fb(b.of) : this.Ib.fb(ec);
|
|
this.Tv = this.Ib.angle;
|
|
a.We = !0;
|
|
a.Oz = !0;
|
|
this.Wb(this.name);
|
|
this.ua = !0
|
|
}
|
|
};
|
|
dj.prototype.doDeactivate = function() {
|
|
var a = this.h;
|
|
null !== a && (this.xk(), this.Ib = this.ac = null, this.ua = a.We = !1)
|
|
};
|
|
dj.prototype.doCancel = function() {
|
|
var a = this.h;
|
|
null !== a && (a.Oz = !1);
|
|
this.rotate(this.Tv);
|
|
this.stopTool()
|
|
};
|
|
dj.prototype.doMouseMove = function() {
|
|
var a = this.h;
|
|
this.ua && null !== a && (a = this.computeRotate(a.Q.ga), this.rotate(a))
|
|
};
|
|
dj.prototype.doMouseUp = function() {
|
|
var a = this.h;
|
|
if (this.ua && null !== a) {
|
|
a.Oz = !1;
|
|
var b = this.computeRotate(a.Q.ga);
|
|
this.rotate(b);
|
|
a.yc();
|
|
this.Mf = this.name;
|
|
a.Ja("PartRotated", this.Ib, this.Tv)
|
|
}
|
|
this.stopTool()
|
|
};
|
|
dj.prototype.rotate = function(a) {
|
|
u && z.p(a, dj, "rotate:newangle");
|
|
null !== this.Ib && (this.Ib.angle = a)
|
|
};
|
|
dj.prototype.computeRotate = function(a) {
|
|
a = this.YC.Ec(a);
|
|
var b = this.Ib.U;
|
|
null !== b && (a -= b.Kl(), 360 <= a ? a -= 360 : 0 > a && (a += 360));
|
|
var b = Math.min(Math.abs(this.nJ), 180),
|
|
c = Math.min(Math.abs(this.mJ), b / 2);
|
|
!this.h.Q.shift && 0 < b && 0 < c && (a % b < c ? a = Math.floor(a / b) * b : a % b > b - c && (a = (Math.floor(a / b) + 1) * b));
|
|
360 <= a ? a -= 360 : 0 > a && (a += 360);
|
|
return a
|
|
};
|
|
z.defineProperty(dj, {
|
|
nJ: "snapAngleMultiple"
|
|
}, function() {
|
|
return this.bD
|
|
}, function(a) {
|
|
z.g(a, "number", dj, "snapAngleMultiple");
|
|
this.bD = a
|
|
});
|
|
z.defineProperty(dj, {
|
|
mJ: "snapAngleEpsilon"
|
|
}, function() {
|
|
return this.aD
|
|
}, function(a) {
|
|
z.g(a, "number", dj, "snapAngleEpsilon");
|
|
this.aD = a
|
|
});
|
|
z.w(dj, {
|
|
bL: "originalAngle"
|
|
}, function() {
|
|
return this.Tv
|
|
});
|
|
|
|
function fj() {
|
|
0 < arguments.length && z.od(fj);
|
|
ug.call(this);
|
|
this.name = "ClickSelecting"
|
|
}
|
|
z.Qa(fj, ug);
|
|
z.ia("ClickSelectingTool", fj);
|
|
fj.prototype.canStart = function() {
|
|
return !this.isEnabled || null === this.h || this.isBeyondDragSize() ? !1 : !0
|
|
};
|
|
fj.prototype.doMouseUp = function() {
|
|
this.ua && (this.standardMouseSelect(), !this.standardMouseClick() && this.h.Q.lj && this.h.hb.doToolTip());
|
|
this.stopTool()
|
|
};
|
|
|
|
function gj() {
|
|
0 < arguments.length && z.od(gj);
|
|
ug.call(this);
|
|
this.name = "Action";
|
|
this.Fn = null
|
|
}
|
|
z.Qa(gj, ug);
|
|
z.ia("ActionTool", gj);
|
|
gj.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
if (null === a) return !1;
|
|
var b = a.Q,
|
|
c = a.pe(b.ga, function(a) {
|
|
for (; null !== a.U && !a.Mt;) a = a.U;
|
|
return a
|
|
});
|
|
if (null !== c) {
|
|
if (!c.Mt) return !1;
|
|
this.Fn = c;
|
|
a.Sn = a.pe(b.ga, null, null);
|
|
return !0
|
|
}
|
|
return !1
|
|
};
|
|
gj.prototype.doMouseDown = function() {
|
|
if (this.ua) {
|
|
var a = this.h.Q,
|
|
b = this.Fn;
|
|
null !== b && (a.Ge = b, null !== b.AD && b.AD(a, b))
|
|
} else this.canStart() && this.doActivate()
|
|
};
|
|
gj.prototype.doMouseMove = function() {
|
|
if (this.ua) {
|
|
var a = this.h.Q,
|
|
b = this.Fn;
|
|
null !== b && (a.Ge = b, null !== b.BD && b.BD(a, b))
|
|
}
|
|
};
|
|
gj.prototype.doMouseUp = function() {
|
|
if (this.ua) {
|
|
var a = this.h,
|
|
b = a.Q,
|
|
c = this.Fn;
|
|
if (null === c) return;
|
|
b.Ge = c;
|
|
null !== c.CD && c.CD(b, c);
|
|
this.isBeyondDragSize() || Ch(c, b, a)
|
|
}
|
|
this.stopTool()
|
|
};
|
|
gj.prototype.doCancel = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var a = a.Q,
|
|
b = this.Fn;
|
|
if (null === b) return;
|
|
a.Ge = b;
|
|
null !== b.zD && b.zD(a, b)
|
|
}
|
|
this.stopTool()
|
|
};
|
|
gj.prototype.doStop = function() {
|
|
this.Fn = null
|
|
};
|
|
|
|
function va() {
|
|
0 < arguments.length && z.od(va);
|
|
ug.call(this);
|
|
this.name = "ClickCreating";
|
|
this.Mk = null;
|
|
this.qC = !0;
|
|
this.dC = new N(0, 0)
|
|
}
|
|
z.Qa(va, ug);
|
|
z.ia("ClickCreatingTool", va);
|
|
va.prototype.canStart = function() {
|
|
if (!this.isEnabled || null === this.Cz) return !1;
|
|
var a = this.h;
|
|
if (null === a || a.jb || a.Ef || !a.ap || !a.Q.left || this.isBeyondDragSize()) return !1;
|
|
if (this.eI) {
|
|
if (1 === a.Q.Pe && (this.dC = a.Q.te.copy()), 2 !== a.Q.Pe || this.isBeyondDragSize(this.dC)) return !1
|
|
} else if (1 !== a.Q.Pe) return !1;
|
|
return a.eb !== this && null !== a.At(a.Q.ga, !0) ? !1 : !0
|
|
};
|
|
va.prototype.doMouseUp = function() {
|
|
var a = this.h;
|
|
this.ua && null !== a && this.insertPart(a.Q.ga);
|
|
this.stopTool()
|
|
};
|
|
va.prototype.insertPart = function(a) {
|
|
var b = this.h;
|
|
if (null === b) return null;
|
|
var c = this.Cz;
|
|
if (null === c) return null;
|
|
this.Wb(this.name);
|
|
var d = null;
|
|
c instanceof D ? c.be() && (gh(c), d = c.copy(), null !== d && b.add(d)) : null !== c && (c = b.ha.copyNodeData(c), z.Za(c) && (b.ha.rl(c), d = b.uh(c)));
|
|
null !== d && (d.location = a, b.xf && b.select(d));
|
|
b.yc();
|
|
this.Mf = this.name;
|
|
b.Ja("PartCreated", d);
|
|
this.xk();
|
|
return d
|
|
};
|
|
z.defineProperty(va, {
|
|
Cz: "archetypeNodeData"
|
|
}, function() {
|
|
return this.Mk
|
|
}, function(a) {
|
|
null !== a && z.l(a, Object, va, "archetypeNodeData");
|
|
this.Mk = a
|
|
});
|
|
z.defineProperty(va, {
|
|
eI: "isDoubleClick"
|
|
}, function() {
|
|
return this.qC
|
|
}, function(a) {
|
|
z.g(a, "boolean", va, "isDoubleClick");
|
|
this.qC = a
|
|
});
|
|
|
|
function hj(a, b, c) {
|
|
this.text = a;
|
|
this.TD = b;
|
|
this.visible = c
|
|
}
|
|
|
|
function ij() {
|
|
0 < arguments.length && z.od(ij);
|
|
ug.call(this);
|
|
this.name = "ContextMenu";
|
|
this.IB = this.uy = this.FB = null;
|
|
this.GC = new N;
|
|
this.wy = this.$n = null;
|
|
jj(this)
|
|
}
|
|
z.Qa(ij, ug);
|
|
z.ia("ContextMenuTool", ij);
|
|
z.bE = !1;
|
|
z.qt = null;
|
|
z.rt = null;
|
|
|
|
function jj(a) {
|
|
a.$n = new da;
|
|
a.qD = function() {
|
|
a.stopTool()
|
|
};
|
|
if (!1 === z.bE) {
|
|
var b = z.createElement("div"),
|
|
c = z.createElement("div");
|
|
b.style.cssText = "top: 0px;z-index:300;position: fixed;display: none;text-align: center;left: 25%;width: 50%;background-color: #F5F5F5;padding: 16px;border: 16px solid #444;border-radius: 10px;margin-top: 10px";
|
|
c.style.cssText = "z-index:299;position: fixed;display: none;top: 0;left: 0;width: 100%;height: 100%;background-color: black;-moz-opacity: 0.8;opacity:.80;filter: alpha(opacity=80);";
|
|
var d =
|
|
z.createElement("style");
|
|
window.document.getElementsByTagName("head")[0].appendChild(d);
|
|
d.sheet.insertRule(".defaultCXul { list-style: none; }", 0);
|
|
d.sheet.insertRule(".defaultCXli {font:700 1.5em Helvetica, Arial, sans-serif;position: relative;min-width: 60px; }", 0);
|
|
d.sheet.insertRule(".defaultCXa {color: #444;display: inline-block;padding: 4px;text-decoration: none;margin: 2px;border: 1px solid gray;border-radius: 10px; }", 0);
|
|
b.addEventListener("contextmenu", function(a) {
|
|
a.preventDefault();
|
|
return !1
|
|
}, !1);
|
|
b.addEventListener("selectstart", function(a) {
|
|
a.preventDefault();
|
|
return !1
|
|
}, !1);
|
|
c.addEventListener("contextmenu", function(a) {
|
|
a.preventDefault();
|
|
return !1
|
|
}, !1);
|
|
window.document.body && (window.document.body.appendChild(b), window.document.body.appendChild(c));
|
|
z.rt = b;
|
|
z.qt = c;
|
|
z.bE = !0
|
|
}
|
|
}
|
|
ij.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
return null === a || this.isBeyondDragSize() || !a.Q.right ? !1 : null !== this.$n && a.Q.lj || null !== this.findObjectWithContextMenu() ? !0 : !1
|
|
};
|
|
ij.prototype.doStart = function() {
|
|
var a = this.h;
|
|
null !== a && this.GC.set(a.Fc.ga)
|
|
};
|
|
ij.prototype.doStop = function() {
|
|
this.hideDefaultContextMenu();
|
|
this.hideContextMenu();
|
|
this.Nz = null
|
|
};
|
|
ij.prototype.findObjectWithContextMenu = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.h;
|
|
if (null === b) return null;
|
|
var c = b.Q,
|
|
d = null;
|
|
a instanceof C || (d = a instanceof O ? a : b.pe(c.ga, null, function(a) {
|
|
return !a.layer.Nc
|
|
}));
|
|
if (null !== d) {
|
|
for (a = d; null !== a;) {
|
|
if (null !== a.contextMenu) return a;
|
|
a = a.U
|
|
}
|
|
if (null !== this.$n && b.Q.lj) return d.ca
|
|
} else if (null !== b.contextMenu) return b;
|
|
return null
|
|
};
|
|
ij.prototype.doActivate = function() {};
|
|
ij.prototype.doMouseDown = function() {
|
|
ug.prototype.doMouseDown.call(this);
|
|
null !== this.h && this.h.hb.Ye.contains(this) && kj(this)
|
|
};
|
|
ij.prototype.doMouseUp = function() {
|
|
kj(this)
|
|
};
|
|
|
|
function kj(a) {
|
|
var b = a.h;
|
|
if (null !== b)
|
|
if (!a.ua) a.canStart() && (uh(a, !0), a.ua || a.stopTool());
|
|
else if (null !== a.yf) {
|
|
var c = b.pe(b.Q.ga, null, null);
|
|
null !== c && c.Pl(a.yf) && a.standardMouseClick(null, null);
|
|
a.stopTool();
|
|
a.canStart() && (b.eb = a, a.doMouseUp())
|
|
}
|
|
}
|
|
|
|
function uh(a, b, c) {
|
|
void 0 === c && (c = null);
|
|
b && a.standardMouseSelect();
|
|
a.standardMouseClick() || (a.ua = !0, null === c && (c = a.findObjectWithContextMenu()), null !== c ? (b = c.contextMenu, null !== b ? (a.Nz = c instanceof O ? c : null, a.showContextMenu(b, a.Nz)) : a.showDefaultContextMenu()) : a.showDefaultContextMenu())
|
|
}
|
|
ij.prototype.doMouseMove = function() {
|
|
this.ua && this.h.hb.doMouseMove()
|
|
};
|
|
ij.prototype.showContextMenu = function(a, b) {
|
|
z.l(a, da, ij, "showContextMenu:contextmenu");
|
|
null !== b && z.l(b, O, ij, "showContextMenu:obj");
|
|
var c = this.h;
|
|
if (null !== c) {
|
|
a !== this.yf && this.hideContextMenu();
|
|
a.If = "Tool";
|
|
a.vk = !1;
|
|
a.scale = 1 / c.scale;
|
|
a.nc = this.name;
|
|
null !== a.placeholder && (a.placeholder.scale = c.scale);
|
|
c.add(a);
|
|
if (null !== b) {
|
|
var c = null,
|
|
d = b.op();
|
|
null !== d && (c = d.data);
|
|
a.fc = b;
|
|
a.data = c
|
|
} else a.data = c.ha;
|
|
a.Bf();
|
|
this.positionContextMenu(a, b);
|
|
this.yf = a
|
|
}
|
|
};
|
|
ij.prototype.positionContextMenu = function(a) {
|
|
if (null === a.placeholder) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.Q.ga.copy(),
|
|
d = a.Ia,
|
|
e = b.xb;
|
|
b.Q.lj && (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
|
|
}
|
|
}
|
|
};
|
|
ij.prototype.hideContextMenu = function() {
|
|
var a = this.h;
|
|
null !== a && null !== this.yf && (a.remove(this.yf), null !== this.uy && this.uy.rj(this.yf.nc), this.yf.data = null, this.yf = this.yf.fc = null, this.standardMouseOver())
|
|
};
|
|
|
|
function lj(a) {
|
|
if (null === a.h) return null;
|
|
a = new J(hj);
|
|
a.add(new hj("Copy", function(a) {
|
|
a.wb.copySelection()
|
|
}, function(a) {
|
|
return a.wb.canCopySelection()
|
|
}));
|
|
a.add(new hj("Cut", function(a) {
|
|
a.wb.cutSelection()
|
|
}, function(a) {
|
|
return a.wb.canCutSelection()
|
|
}));
|
|
a.add(new hj("Delete", function(a) {
|
|
a.wb.deleteSelection()
|
|
}, function(a) {
|
|
return a.wb.canDeleteSelection()
|
|
}));
|
|
a.add(new hj("Paste", function(a) {
|
|
a.wb.pasteSelection(a.Q.ga)
|
|
}, function(a) {
|
|
return a.wb.canPasteSelection()
|
|
}));
|
|
a.add(new hj("Select All", function(a) {
|
|
a.wb.selectAll()
|
|
},
|
|
function(a) {
|
|
return a.wb.canSelectAll()
|
|
}));
|
|
a.add(new hj("Undo", function(a) {
|
|
a.wb.undo()
|
|
}, function(a) {
|
|
return a.wb.canUndo()
|
|
}));
|
|
a.add(new hj("Redo", function(a) {
|
|
a.wb.redo()
|
|
}, function(a) {
|
|
return a.wb.canRedo()
|
|
}));
|
|
a.add(new hj("Scroll To Part", function(a) {
|
|
a.wb.scrollToPart()
|
|
}, function(a) {
|
|
return a.wb.canScrollToPart()
|
|
}));
|
|
a.add(new hj("Zoom To Fit", function(a) {
|
|
a.wb.zoomToFit()
|
|
}, function(a) {
|
|
return a.wb.canZoomToFit()
|
|
}));
|
|
a.add(new hj("Reset Zoom", function(a) {
|
|
a.wb.resetZoom()
|
|
}, function(a) {
|
|
return a.wb.canResetZoom()
|
|
}));
|
|
a.add(new hj("Group Selection", function(a) {
|
|
a.wb.groupSelection()
|
|
}, function(a) {
|
|
return a.wb.canGroupSelection()
|
|
}));
|
|
a.add(new hj("Ungroup Selection", function(a) {
|
|
a.wb.ungroupSelection()
|
|
}, function(a) {
|
|
return a.wb.canUngroupSelection()
|
|
}));
|
|
a.add(new hj("Edit Text", function(a) {
|
|
a.wb.editTextBlock()
|
|
}, function(a) {
|
|
return a.wb.canEditTextBlock()
|
|
}));
|
|
return a
|
|
}
|
|
ij.prototype.showDefaultContextMenu = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
null === this.wy && (this.wy = lj(this));
|
|
this.$n !== this.yf && this.hideContextMenu();
|
|
z.rt.innerHTML = "";
|
|
z.qt.addEventListener("click", this.qD, !1);
|
|
var b = this,
|
|
c = z.createElement("ul");
|
|
c.className = "defaultCXul";
|
|
z.rt.appendChild(c);
|
|
c.innerHTML = "";
|
|
for (var d = this.wy.i; d.next();) {
|
|
var e = d.value,
|
|
g = e.text,
|
|
h = e.visible;
|
|
if ("function" === typeof e.TD && ("function" !== typeof h || h(a))) {
|
|
h = z.createElement("li");
|
|
h.className = "defaultCXli";
|
|
var k = z.createElement("a");
|
|
k.className = "defaultCXa";
|
|
k.href = "#";
|
|
k.nG = e.TD;
|
|
k.addEventListener("click", function(c) {
|
|
this.nG(a);
|
|
b.stopTool();
|
|
c.preventDefault();
|
|
return !1
|
|
}, !1);
|
|
k.textContent = g;
|
|
h.appendChild(k);
|
|
c.appendChild(h)
|
|
}
|
|
}
|
|
z.rt.style.display = "block";
|
|
z.qt.style.display = "block";
|
|
this.yf = this.$n
|
|
}
|
|
};
|
|
ij.prototype.hideDefaultContextMenu = function() {
|
|
null !== this.yf && this.yf === this.$n && (z.rt.style.display = "none", z.qt.style.display = "none", z.qt.removeEventListener("click", this.qD, !1), this.yf = null)
|
|
};
|
|
z.defineProperty(ij, {
|
|
yf: "currentContextMenu"
|
|
}, function() {
|
|
return this.FB
|
|
}, function(a) {
|
|
null !== a && z.l(a, da, ij, "currentContextMenu");
|
|
this.FB = a;
|
|
this.uy = null !== a ? a.Wf : null
|
|
});
|
|
z.defineProperty(ij, {
|
|
Nz: "currentObject"
|
|
}, function() {
|
|
return this.IB
|
|
}, function(a) {
|
|
null !== a && z.l(a, O, ij, "currentObject");
|
|
this.IB = a
|
|
});
|
|
z.w(ij, {
|
|
XK: "mouseDownPoint"
|
|
}, function() {
|
|
return this.GC
|
|
});
|
|
|
|
function mj() {
|
|
0 < arguments.length && z.od(mj);
|
|
ug.call(this);
|
|
this.name = "DragSelecting";
|
|
this.ao = 175;
|
|
this.vC = !1;
|
|
var a = new D;
|
|
a.If = "Tool";
|
|
a.vk = !1;
|
|
var b = new X;
|
|
b.name = "SHAPE";
|
|
b.Hb = "Rectangle";
|
|
b.fill = null;
|
|
b.stroke = "magenta";
|
|
a.add(b);
|
|
this.em = a
|
|
}
|
|
z.Qa(mj, ug);
|
|
z.ia("DragSelectingTool", mj);
|
|
mj.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
if (null === a || !a.xf) return !1;
|
|
var b = a.Q;
|
|
return !b.left || a.eb !== this && (!this.isBeyondDragSize() || b.timestamp - a.Fc.timestamp < this.cE || null !== a.At(b.ga, !0)) ? !1 : !0
|
|
};
|
|
mj.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
null !== a && (this.ua = !0, a.We = !0, a.Bb = !0, a.add(this.qh), this.doMouseMove())
|
|
};
|
|
mj.prototype.doDeactivate = function() {
|
|
var a = this.h;
|
|
null !== a && (a.remove(this.qh), a.Bb = !1, this.ua = a.We = !1)
|
|
};
|
|
mj.prototype.doMouseMove = function() {
|
|
if (null !== this.h && this.ua && null !== this.qh) {
|
|
var a = this.computeBoxBounds(),
|
|
b = this.qh.oe("SHAPE");
|
|
null === b && (b = this.qh.gf());
|
|
b.Aa = a.size;
|
|
this.qh.position = a.position
|
|
}
|
|
};
|
|
mj.prototype.doMouseUp = function() {
|
|
if (this.ua) {
|
|
var a = this.h;
|
|
a.remove(this.qh);
|
|
try {
|
|
a.gc = "wait", this.selectInRect(this.computeBoxBounds())
|
|
} finally {
|
|
a.gc = ""
|
|
}
|
|
}
|
|
this.stopTool()
|
|
};
|
|
mj.prototype.computeBoxBounds = function() {
|
|
var a = this.h;
|
|
return null === a ? new w(0, 0, 0, 0) : new w(a.Fc.ga, a.Q.ga)
|
|
};
|
|
mj.prototype.selectInRect = function(a) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.Q;
|
|
b.Ja("ChangingSelection");
|
|
a = b.ok(a, null, function(a) {
|
|
return a instanceof D ? a.canSelect() : !1
|
|
}, this.jI);
|
|
if (z.rk ? c.$t : c.control)
|
|
if (c.shift)
|
|
for (a = a.i; a.next();) c = a.value, c.kb && (c.kb = !1);
|
|
else
|
|
for (a = a.i; a.next();) c = a.value, c.kb = !c.kb;
|
|
else {
|
|
if (!c.shift) {
|
|
for (var c = new J(D), d = b.selection.i; d.next();) {
|
|
var e = d.value;
|
|
a.contains(e) || c.add(e)
|
|
}
|
|
for (c = c.i; c.next();) c.value.kb = !1
|
|
}
|
|
for (a = a.i; a.next();) c = a.value, c.kb || (c.kb = !0)
|
|
}
|
|
b.Ja("ChangedSelection")
|
|
}
|
|
};
|
|
z.defineProperty(mj, {
|
|
cE: "delay"
|
|
}, function() {
|
|
return this.ao
|
|
}, function(a) {
|
|
z.g(a, "number", mj, "delay");
|
|
this.ao = a
|
|
});
|
|
z.defineProperty(mj, {
|
|
jI: "isPartialInclusion"
|
|
}, function() {
|
|
return this.vC
|
|
}, function(a) {
|
|
z.g(a, "boolean", mj, "isPartialInclusion");
|
|
this.vC = a
|
|
});
|
|
z.defineProperty(mj, {
|
|
qh: "box"
|
|
}, function() {
|
|
return this.em
|
|
}, function(a) {
|
|
null !== a && z.l(a, D, mj, "box");
|
|
this.em = a
|
|
});
|
|
|
|
function nj() {
|
|
0 < arguments.length && z.od(nj);
|
|
ug.call(this);
|
|
this.name = "Panning";
|
|
this.gz = new N;
|
|
this.yj = !1;
|
|
var a = this;
|
|
this.eD = function() {
|
|
window.document.removeEventListener("scroll", a.eD, !1);
|
|
a.stopTool()
|
|
}
|
|
}
|
|
z.Qa(nj, ug);
|
|
z.ia("PanningTool", nj);
|
|
nj.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
return null === a || !a.xe && !a.ye || !a.Q.left || a.eb !== this && !this.isBeyondDragSize() ? !1 : !0
|
|
};
|
|
nj.prototype.doActivate = function() {
|
|
var a = this.h;
|
|
null !== a && (this.yj ? (a.Q.bubbles = !0, window.document.addEventListener("scroll", this.eD, !1)) : (a.gc = "move", a.We = !0, this.gz = a.position.copy()), this.ua = !0)
|
|
};
|
|
nj.prototype.doDeactivate = function() {
|
|
var a = this.h;
|
|
null !== a && (a.gc = "", this.ua = a.We = !1)
|
|
};
|
|
nj.prototype.doCancel = function() {
|
|
var a = this.h;
|
|
null !== a && (a.position = this.gz, a.We = !1);
|
|
this.stopTool()
|
|
};
|
|
nj.prototype.doMouseMove = function() {
|
|
this.move()
|
|
};
|
|
nj.prototype.doMouseUp = function() {
|
|
this.move();
|
|
this.stopTool()
|
|
};
|
|
nj.prototype.move = function() {
|
|
var a = this.h;
|
|
if (this.ua && a)
|
|
if (this.yj) a.Q.bubbles = !0;
|
|
else {
|
|
var b = a.position,
|
|
c = a.Fc.ga,
|
|
d = a.Q.ga,
|
|
e = b.x + c.x - d.x,
|
|
c = b.y + c.y - d.y;
|
|
a.xe || (e = b.x);
|
|
a.ye || (c = b.y);
|
|
a.position = new N(e, c)
|
|
}
|
|
};
|
|
z.defineProperty(nj, {
|
|
bubbles: "bubbles"
|
|
}, function() {
|
|
return this.yj
|
|
}, function(a) {
|
|
z.g(a, "boolean", nj, "bubbles");
|
|
this.yj = a
|
|
});
|
|
z.w(nj, {
|
|
gL: "originalPosition"
|
|
}, function() {
|
|
return this.gz
|
|
});
|
|
|
|
function oj() {
|
|
0 < arguments.length && z.od(oj);
|
|
ug.call(this);
|
|
this.name = "TextEditing";
|
|
this.LB = this.qz = this.iD = null;
|
|
this.Ro = pj;
|
|
this.nl = null;
|
|
this.nb = qj;
|
|
this.kl = null;
|
|
this.DC = 1;
|
|
this.ZC = !0;
|
|
var a = z.createElement("textarea");
|
|
a.pC = !0;
|
|
this.SB = a;
|
|
a.addEventListener("input", function() {
|
|
var a = this.textEditingTool;
|
|
if (null !== a && void 0 !== a && null !== a.He) {
|
|
var c = a.iD;
|
|
c.text = this.value;
|
|
var d = this.sJ;
|
|
rj(c, a.He.Ev, Infinity);
|
|
this.style.width = 20 + c.Ia.width * d + "px";
|
|
this.style.height = 10 + c.Ia.height * d + "px";
|
|
this.rows = c.sI
|
|
}
|
|
}, !1);
|
|
a.addEventListener("keydown",
|
|
function(a) {
|
|
var c = a.which,
|
|
d = this.textEditingTool;
|
|
null !== d && void 0 !== d && null !== d.He && (13 === c ? (!1 === d.He.lx && a.preventDefault(), d.acceptText(sj)) : 9 === c ? (d.acceptText(tj), a.preventDefault()) : 27 === c && (d.doCancel(), null !== d.h && d.h.focus()))
|
|
}, !1);
|
|
a.addEventListener("focus", function(a) {
|
|
var c = this.textEditingTool;
|
|
null !== c && void 0 !== c && c.doFocus(a)
|
|
}, !1);
|
|
a.addEventListener("blur", function(a) {
|
|
var c = this.textEditingTool;
|
|
null !== c && void 0 !== c && c.doBlur(a)
|
|
}, !1)
|
|
}
|
|
z.ia("TextEditingTool", oj);
|
|
z.Qa(oj, ug);
|
|
var uj;
|
|
oj.LostFocus = uj = z.s(oj, "LostFocus", 0);
|
|
var Ej;
|
|
oj.MouseDown = Ej = z.s(oj, "MouseDown", 1);
|
|
var tj;
|
|
oj.Tab = tj = z.s(oj, "Tab", 2);
|
|
var sj;
|
|
oj.Enter = sj = z.s(oj, "Enter", 3);
|
|
oj.SingleClick = z.s(oj, "SingleClick", 0);
|
|
var pj;
|
|
oj.SingleClickSelected = pj = z.s(oj, "SingleClickSelected", 1);
|
|
var qj = z.s(oj, "StateNone", 0),
|
|
Fj = z.s(oj, "StateActive", 1),
|
|
Gj = z.s(oj, "StateEditing", 2),
|
|
Hj = z.s(oj, "StateEditing2", 3),
|
|
Ij = z.s(oj, "StateValidating", 4),
|
|
Jj = z.s(oj, "StateValidated", 5);
|
|
z.defineProperty(oj, {
|
|
He: "textBlock"
|
|
}, function() {
|
|
return this.qz
|
|
}, function(a) {
|
|
null !== a && z.l(a, qa, oj, "textBlock");
|
|
this.qz = a
|
|
});
|
|
z.defineProperty(oj, {
|
|
zf: "currentTextEditor"
|
|
}, function() {
|
|
return this.LB
|
|
}, function(a) {
|
|
this.LB = a
|
|
});
|
|
z.defineProperty(oj, {
|
|
pH: "defaultTextEditor"
|
|
}, function() {
|
|
return this.SB
|
|
}, function(a) {
|
|
z.l(a, Element, oj, "defaultTextEditor");
|
|
this.SB = a
|
|
});
|
|
z.defineProperty(oj, {
|
|
VA: "starting"
|
|
}, function() {
|
|
return this.Ro
|
|
}, function(a) {
|
|
z.Ba(a, oj, oj, "starting");
|
|
this.Ro = a
|
|
});
|
|
oj.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
if (null === a || a.jb || !a.Q.left || this.isBeyondDragSize()) return !1;
|
|
a = a.pe(a.Q.ga, null, function(a) {
|
|
return a instanceof qa
|
|
});
|
|
if (null === a || !a.Sz || !a.ca.canEdit()) return !1;
|
|
a = a.ca;
|
|
return null === a || this.VA === pj && !a.kb ? !1 : !0
|
|
};
|
|
oj.prototype.doStart = function() {
|
|
this.ua || null === this.He || this.doActivate()
|
|
};
|
|
oj.prototype.doActivate = function() {
|
|
if (!this.ua) {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = this.He;
|
|
null === b && (b = a.pe(a.Q.ga, function(a) {
|
|
return a instanceof qa ? a : null
|
|
}));
|
|
if (null !== b && (this.He = b, null !== b.ca)) {
|
|
this.ua = !0;
|
|
this.nb = Fj;
|
|
var c = this.pH,
|
|
d = !1;
|
|
null !== b.SF && (c = b.SF);
|
|
null === c || c.pC || (d = !0);
|
|
this.iD = this.He.copy();
|
|
var e = new w(this.He.fb(Zb), this.He.fb(ic));
|
|
a.fJ(e);
|
|
if (c.pC) {
|
|
var g = b.fb(ec),
|
|
h = a.position,
|
|
k = a.scale,
|
|
l = b.gj() * k;
|
|
l < this.cF && (l = this.cF);
|
|
var e = b.Ga.width * l,
|
|
m = b.Ga.height * l,
|
|
n = (g.x - h.x) * k,
|
|
g = (g.y - h.y) * k;
|
|
c.value =
|
|
b.text;
|
|
a.Dl.style.font = b.font;
|
|
c.style.font = "inherit";
|
|
c.style.fontSize = 100 * l + "%";
|
|
c.style.lineHeight = "normal";
|
|
c.style.width = e + 6 + "px";
|
|
c.style.height = m + 2 + "px";
|
|
c.style.left = (n - e / 2 | 0) - 1 + "px";
|
|
c.style.top = (g - m / 2 | 0) - 1 + "px";
|
|
c.style.textAlign = b.textAlign;
|
|
c.style.margin = "0";
|
|
c.style.padding = "1px";
|
|
c.style.border = "0";
|
|
c.style.outline = "none";
|
|
c.style["white-space"] = "pre-wrap";
|
|
c.style.overflow = "hidden"
|
|
}
|
|
a.Dl.appendChild(c);
|
|
c.style.position = "absolute";
|
|
c.style.zIndex = 100;
|
|
c.className = "start";
|
|
c.textEditingTool = this;
|
|
c.sJ =
|
|
l;
|
|
if (d && "function" === typeof c.onActivate) c.onActivate();
|
|
this.zf = c;
|
|
"function" === typeof c.focus && c.focus();
|
|
"function" === typeof c.select && this.OA && (c.select(), c.setSelectionRange(0, 9999))
|
|
}
|
|
}
|
|
}
|
|
};
|
|
oj.prototype.doCancel = function() {
|
|
null !== this.kl && (this.zf.style.border = this.kl, this.kl = null);
|
|
this.stopTool()
|
|
};
|
|
oj.prototype.doMouseUp = function() {
|
|
!this.ua && this.canStart() && this.doActivate()
|
|
};
|
|
oj.prototype.doMouseDown = function() {
|
|
this.ua && this.acceptText(Ej)
|
|
};
|
|
oj.prototype.acceptText = function(a) {
|
|
switch (a) {
|
|
case Ej:
|
|
if (this.nb === Jj || this.nb === Hj) "function" === typeof this.zf.focus && this.zf.focus();
|
|
else if (this.nb === Fj || this.nb === Gj) this.nb = Ij, Kj(this);
|
|
break;
|
|
case uj:
|
|
case sj:
|
|
case tj:
|
|
if (sj === a && !0 === this.qz.lx) break;
|
|
if (this.nb === Fj || this.nb === Gj) this.nb = Ij, Kj(this)
|
|
}
|
|
};
|
|
|
|
function Kj(a) {
|
|
if (null !== a.He && null !== a.zf) {
|
|
var b = a.He,
|
|
c = a.He.text,
|
|
d = a.zf.value,
|
|
e = "",
|
|
e = "function" === typeof d ? d() : d;
|
|
if (!a.isValidText(a.He, c, e)) {
|
|
a.nb = Gj;
|
|
null !== b.Uz && b.Uz(a, c, e);
|
|
null === a.kl && (a.kl = a.zf.style.border, a.zf.style.border = "3px solid red");
|
|
"function" === typeof a.zf.focus && a.zf.focus();
|
|
return
|
|
}
|
|
a.Wb(a.name);
|
|
a.nb = Jj;
|
|
c !== e && (a.He.text = e);
|
|
a.Mf = a.name;
|
|
b = a.h;
|
|
null !== b && b.Ja("TextEdited", a.He, c);
|
|
a.xk();
|
|
a.stopTool();
|
|
null !== b && b.focus()
|
|
}
|
|
null !== a.kl && (a.zf.style.border = a.kl, a.kl = null)
|
|
}
|
|
oj.prototype.doDeactivate = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
this.nb = qj;
|
|
this.He = null;
|
|
if (null !== this.zf) {
|
|
var b = this.zf;
|
|
if ("function" === typeof b.onDeactivate) b.onDeactivate();
|
|
null !== b && a.Dl.removeChild(b)
|
|
}
|
|
this.ua = !1
|
|
}
|
|
};
|
|
oj.prototype.doFocus = function() {
|
|
var a = this.zf;
|
|
null !== a && (this.nb === Fj ? this.nb = Gj : this.nb === Jj ? this.nb = Hj : this.nb === Hj && (this.nb = Gj), "function" === typeof a.select && this.OA && (a.select(), a.setSelectionRange(0, 9999)))
|
|
};
|
|
oj.prototype.doBlur = function() {
|
|
var a = this.zf;
|
|
null !== a && ("function" === typeof a.focus && a.focus(), "function" === typeof a.select && this.OA && (a.select(), a.setSelectionRange(0, 9999)))
|
|
};
|
|
oj.prototype.isValidText = function(a, b, c) {
|
|
z.l(a, qa, oj, "isValidText:textblock");
|
|
var d = this.YA;
|
|
if (null !== d && !d(a, b, c)) return !1;
|
|
d = a.YA;
|
|
return null === d || d(a, b, c) ? !0 : !1
|
|
};
|
|
z.defineProperty(oj, {
|
|
YA: "textValidation"
|
|
}, function() {
|
|
return this.nl
|
|
}, function(a) {
|
|
null !== a && z.g(a, "function", oj, "textValidation");
|
|
this.nl = a
|
|
});
|
|
z.defineProperty(oj, {
|
|
cF: "minimumEditorScale"
|
|
}, function() {
|
|
return this.DC
|
|
}, function(a) {
|
|
null !== a && z.g(a, "number", oj, "minimumEditorScale");
|
|
this.DC = a
|
|
});
|
|
z.defineProperty(oj, {
|
|
OA: "selectsTextOnActivate"
|
|
}, function() {
|
|
return this.ZC
|
|
}, function(a) {
|
|
null !== a && z.g(a, "boolean", oj, "selectsTextOnActivate");
|
|
this.ZC = a
|
|
});
|
|
|
|
function dh() {
|
|
ug.call(this);
|
|
this.name = "ToolManager";
|
|
this.sG = new J(ug);
|
|
this.tG = new J(ug);
|
|
this.uG = new J(ug);
|
|
this.hC = this.iC = 850;
|
|
this.WB = (new Ea(2, 2)).La();
|
|
this.rD = 5E3;
|
|
this.HC = Eh;
|
|
this.fC = Lj;
|
|
this.dv = this.MB = null;
|
|
this.Nm = -1
|
|
}
|
|
z.Qa(dh, ug);
|
|
z.ia("ToolManager", dh);
|
|
var Eh;
|
|
dh.WheelScroll = Eh = z.s(dh, "WheelScroll", 0);
|
|
var Dh;
|
|
dh.WheelZoom = Dh = z.s(dh, "WheelZoom", 1);
|
|
dh.WheelNone = z.s(dh, "WheelNone", 2);
|
|
var Lj;
|
|
dh.GestureZoom = Lj = z.s(dh, "GestureZoom", 3);
|
|
var Mj;
|
|
dh.GestureCancel = Mj = z.s(dh, "GestureCancel", 4);
|
|
var Nj;
|
|
dh.GestureNone = Nj = z.s(dh, "GestureNone", 5);
|
|
z.defineProperty(dh, {
|
|
cu: "mouseWheelBehavior"
|
|
}, function() {
|
|
return this.HC
|
|
}, function(a) {
|
|
z.Ba(a, dh, dh, "mouseWheelBehavior");
|
|
this.HC = a
|
|
});
|
|
z.defineProperty(dh, {
|
|
rp: "gestureBehavior"
|
|
}, function() {
|
|
return this.fC
|
|
}, function(a) {
|
|
z.Ba(a, dh, dh, "gestureBehavior");
|
|
this.fC = a
|
|
});
|
|
dh.prototype.initializeStandardTools = function() {
|
|
this.JG = new gj;
|
|
this.kF = new Jh;
|
|
this.vI = new Pi;
|
|
this.xF = new Wi;
|
|
this.cJ = new dj;
|
|
this.ZE = new ta;
|
|
this.me = new ih;
|
|
this.tH = new mj;
|
|
this.OI = new nj;
|
|
this.Hz = new ij;
|
|
this.XA = new oj;
|
|
this.ZG = new va;
|
|
this.$G = new fj
|
|
};
|
|
dh.prototype.updateAdornments = function(a) {
|
|
var b = this.th;
|
|
if (null !== b && this.dv === a) {
|
|
var c = b.fc;
|
|
(null !== a ? c.ca === a : null === c) ? this.showToolTip(b, c): this.hideToolTip()
|
|
}
|
|
};
|
|
dh.prototype.doMouseDown = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q;
|
|
b.lj && this.rp === Mj && (b.bubbles = !1);
|
|
if (b.Qt) {
|
|
if (this.rp === Nj) {
|
|
b.bubbles = !0;
|
|
return
|
|
}
|
|
if (this.rp === Mj) return;
|
|
if (a.eb.canStartMultiTouch()) {
|
|
a.eb.standardPinchZoomStart();
|
|
return
|
|
}
|
|
}
|
|
var c = a.pa;
|
|
c.Ez && 0 !== c.Gh && z.trace("WARNING: In ToolManager.doMouseDown: UndoManager.transactionLevel is not zero");
|
|
for (var c = this.Ye.length, d = 0; d < c; d++) {
|
|
var e = this.Ye.ea(d);
|
|
null === e.h && e.Sc(this.h);
|
|
if (e.canStart()) {
|
|
a.doFocus();
|
|
a.eb = e;
|
|
a.eb === e && (e.ua || e.doActivate(),
|
|
e.doMouseDown());
|
|
return
|
|
}
|
|
}
|
|
1 === a.Q.button && (this.cu === Eh ? this.cu = Dh : this.cu === Dh && (this.cu = Eh));
|
|
this.doActivate();
|
|
this.standardWaitAfter(this.FE, b)
|
|
}
|
|
};
|
|
dh.prototype.doMouseMove = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q;
|
|
if (b.Qt) {
|
|
if (this.rp === Nj) {
|
|
b.bubbles = !0;
|
|
return
|
|
}
|
|
if (this.rp === Mj) return;
|
|
if (a.eb.canStartMultiTouch()) {
|
|
a.eb.standardPinchZoomMove();
|
|
return
|
|
}
|
|
}
|
|
if (this.ua)
|
|
for (var c = this.dg.length, d = 0; d < c; d++) {
|
|
var e = this.dg.ea(d);
|
|
null === e.h && e.Sc(this.h);
|
|
if (e.canStart()) {
|
|
a.doFocus();
|
|
a.eb = e;
|
|
a.eb === e && (e.ua || e.doActivate(), e.doMouseMove());
|
|
return
|
|
}
|
|
}
|
|
Oj(this, a);
|
|
null === b.event || "mousemove" !== b.event.type && b.event.cancelable || (b.bubbles = !0)
|
|
}
|
|
};
|
|
|
|
function Oj(a, b) {
|
|
a.standardMouseOver();
|
|
a.isBeyondDragSize() && a.standardWaitAfter(a.ua ? a.FE : a.WH, b.Q)
|
|
}
|
|
dh.prototype.doCurrentObjectChanged = function(a, b) {
|
|
var c = this.th;
|
|
null === c || null !== b && (b === c || b.Pl(c)) || this.hideToolTip()
|
|
};
|
|
dh.prototype.doWaitAfter = function(a) {
|
|
var b = this.h;
|
|
null !== b && b.Fb && (this.doMouseHover(), this.ua || this.doToolTip(), a.lj && !b.Q.Gc && (a = a.copy(), a.button = 2, a.buttons = 2, b.Q = a, b.Ss = !0, b.doMouseUp()))
|
|
};
|
|
dh.prototype.doMouseHover = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q;
|
|
null === b.Ge && (b.Ge = a.pe(b.ga, null, null));
|
|
var c = b.Ge;
|
|
if (null !== c)
|
|
for (b.Gc = !1; null !== c;) {
|
|
a = this.ua ? c.sA : c.tA;
|
|
if (null !== a && (a(b, c), b.Gc)) break;
|
|
c = c.U
|
|
} else a = this.ua ? a.sA : a.tA, null !== a && a(b)
|
|
}
|
|
};
|
|
dh.prototype.doToolTip = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
var b = a.Q;
|
|
null === b.Ge && (b.Ge = a.pe(b.ga, null, null));
|
|
b = b.Ge;
|
|
if (null !== b) {
|
|
if (b !== this.th && !b.Pl(this.th)) {
|
|
for (; null !== b;) {
|
|
a = b.$A;
|
|
if (null !== a) {
|
|
this.showToolTip(a, b);
|
|
return
|
|
}
|
|
b = b.U
|
|
}
|
|
this.hideToolTip()
|
|
}
|
|
} else a = a.$A, null !== a ? this.showToolTip(a, null) : this.hideToolTip()
|
|
}
|
|
};
|
|
dh.prototype.showToolTip = function(a, b) {
|
|
z.l(a, da, dh, "showToolTip:tooltip");
|
|
null !== b && z.l(b, O, dh, "showToolTip:obj");
|
|
var c = this.h;
|
|
if (null !== c) {
|
|
a !== this.th && this.hideToolTip();
|
|
a.If = "Tool";
|
|
a.vk = !1;
|
|
a.scale = 1 / c.scale;
|
|
a.nc = "ToolTip";
|
|
null !== a.placeholder && (a.placeholder.scale = c.scale);
|
|
c.add(a);
|
|
if (null !== b) {
|
|
var c = null,
|
|
d = b.op();
|
|
null !== d && (c = d.data);
|
|
a.fc = b;
|
|
a.data = c
|
|
} else a.data = c.ha;
|
|
a.Bf();
|
|
this.positionToolTip(a, b);
|
|
this.th = a; - 1 !== this.Nm && (z.clearTimeout(this.Nm), this.Nm = -1);
|
|
c = this.xJ;
|
|
if (0 < c && Infinity !== c) {
|
|
var e =
|
|
this;
|
|
this.Nm = z.setTimeout(function() {
|
|
e.hideToolTip()
|
|
}, c)
|
|
}
|
|
}
|
|
};
|
|
dh.prototype.positionToolTip = function(a) {
|
|
if (null === a.placeholder) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.Q.ga.copy(),
|
|
d = a.Ia,
|
|
e = b.xb;
|
|
b.Q.lj && (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
|
|
}
|
|
}
|
|
};
|
|
dh.prototype.hideToolTip = function() {
|
|
-1 !== this.Nm && (z.clearTimeout(this.Nm), this.Nm = -1);
|
|
var a = this.h;
|
|
null !== a && null !== this.th && (a.remove(this.th), null !== this.dv && this.dv.rj(this.th.nc), this.th.data = null, this.th = this.th.fc = null)
|
|
};
|
|
z.defineProperty(dh, {
|
|
th: "currentToolTip"
|
|
}, function() {
|
|
return this.MB
|
|
}, function(a) {
|
|
null !== a && z.l(a, da, dh, "currentToolTip");
|
|
this.MB = a;
|
|
this.dv = null !== a ? a.Wf : null
|
|
});
|
|
dh.prototype.doMouseUp = function() {
|
|
this.cancelWaitAfter();
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
if (this.ua)
|
|
for (var b = this.eg.length, c = 0; c < b; c++) {
|
|
var d = this.eg.ea(c);
|
|
null === d.h && d.Sc(this.h);
|
|
if (d.canStart()) {
|
|
a.doFocus();
|
|
a.eb = d;
|
|
a.eb === d && (d.ua || d.doActivate(), d.doMouseUp());
|
|
return
|
|
}
|
|
}
|
|
a.doFocus();
|
|
this.doDeactivate()
|
|
}
|
|
};
|
|
dh.prototype.doMouseWheel = function() {
|
|
this.standardMouseWheel()
|
|
};
|
|
dh.prototype.doKeyDown = function() {
|
|
var a = this.h;
|
|
null !== a && a.wb.doKeyDown()
|
|
};
|
|
dh.prototype.doKeyUp = function() {
|
|
var a = this.h;
|
|
null !== a && a.wb.doKeyUp()
|
|
};
|
|
dh.prototype.doCancel = function() {
|
|
null !== Hh && Hh.doCancel();
|
|
ug.prototype.doCancel.call(this)
|
|
};
|
|
dh.prototype.findTool = function(a) {
|
|
z.g(a, "string", dh, "findTool:name");
|
|
for (var b = this.Ye.length, c = 0; c < b; c++) {
|
|
var d = this.Ye.ea(c);
|
|
if (d.name === a) return d
|
|
}
|
|
b = this.dg.length;
|
|
for (c = 0; c < b; c++)
|
|
if (d = this.dg.ea(c), d.name === a) return d;
|
|
b = this.eg.length;
|
|
for (c = 0; c < b; c++)
|
|
if (d = this.eg.ea(c), d.name === a) return d;
|
|
return null
|
|
};
|
|
dh.prototype.replaceTool = function(a, b) {
|
|
z.g(a, "string", dh, "replaceTool:name");
|
|
null !== b && (z.l(b, ug, dh, "replaceTool:newtool"), b.h && b.h !== this.h && z.k("Cannot share tools between Diagrams: " + b.toString()), b.Sc(this.h));
|
|
for (var c = this.Ye.length, d = 0; d < c; d++) {
|
|
var e = this.Ye.ea(d);
|
|
if (e.name === a) return null !== b ? this.Ye.Rg(d, b) : this.Ye.dd(d), e
|
|
}
|
|
c = this.dg.length;
|
|
for (d = 0; d < c; d++)
|
|
if (e = this.dg.ea(d), e.name === a) return null !== b ? this.dg.Rg(d, b) : this.dg.dd(d), e;
|
|
c = this.eg.length;
|
|
for (d = 0; d < c; d++)
|
|
if (e = this.eg.ea(d), e.name ===
|
|
a) return null !== b ? this.eg.Rg(d, b) : this.eg.dd(d), e;
|
|
return null
|
|
};
|
|
|
|
function Pj(a, b, c, d) {
|
|
z.g(b, "string", dh, "replaceStandardTool:name");
|
|
z.l(d, J, dh, "replaceStandardTool:list");
|
|
null !== c && (z.l(c, ug, dh, "replaceStandardTool:newtool"), c.h && c.h !== a.h && z.k("Cannot share tools between Diagrams: " + c.toString()), c.name = b, c.Sc(a.h));
|
|
a.findTool(b) ? a.replaceTool(b, c) : null !== c && d.add(c)
|
|
}
|
|
z.w(dh, {
|
|
Ye: "mouseDownTools"
|
|
}, function() {
|
|
return this.sG
|
|
});
|
|
z.w(dh, {
|
|
dg: "mouseMoveTools"
|
|
}, function() {
|
|
return this.tG
|
|
});
|
|
z.w(dh, {
|
|
eg: "mouseUpTools"
|
|
}, function() {
|
|
return this.uG
|
|
});
|
|
z.defineProperty(dh, {
|
|
WH: "hoverDelay"
|
|
}, function() {
|
|
return this.iC
|
|
}, function(a) {
|
|
z.g(a, "number", dh, "hoverDelay");
|
|
this.iC = a
|
|
});
|
|
z.defineProperty(dh, {
|
|
FE: "holdDelay"
|
|
}, function() {
|
|
return this.hC
|
|
}, function(a) {
|
|
z.g(a, "number", dh, "holdDelay");
|
|
this.hC = a
|
|
});
|
|
z.defineProperty(dh, {
|
|
uH: "dragSize"
|
|
}, function() {
|
|
return this.WB
|
|
}, function(a) {
|
|
z.l(a, Ea, dh, "dragSize");
|
|
this.WB = a.V()
|
|
});
|
|
z.defineProperty(dh, {
|
|
xJ: "toolTipDuration"
|
|
}, function() {
|
|
return this.rD
|
|
}, function(a) {
|
|
z.g(a, "number", dh, "toolTipDuration");
|
|
this.rD = a
|
|
});
|
|
z.defineProperty(dh, {
|
|
JG: "actionTool"
|
|
}, function() {
|
|
return this.findTool("Action")
|
|
}, function(a) {
|
|
Pj(this, "Action", a, this.Ye)
|
|
});
|
|
z.defineProperty(dh, {
|
|
kF: "relinkingTool"
|
|
}, function() {
|
|
return this.findTool("Relinking")
|
|
}, function(a) {
|
|
Pj(this, "Relinking", a, this.Ye)
|
|
});
|
|
z.defineProperty(dh, {
|
|
vI: "linkReshapingTool"
|
|
}, function() {
|
|
return this.findTool("LinkReshaping")
|
|
}, function(a) {
|
|
Pj(this, "LinkReshaping", a, this.Ye)
|
|
});
|
|
z.defineProperty(dh, {
|
|
xF: "resizingTool"
|
|
}, function() {
|
|
return this.findTool("Resizing")
|
|
}, function(a) {
|
|
Pj(this, "Resizing", a, this.Ye)
|
|
});
|
|
z.defineProperty(dh, {
|
|
cJ: "rotatingTool"
|
|
}, function() {
|
|
return this.findTool("Rotating")
|
|
}, function(a) {
|
|
Pj(this, "Rotating", a, this.Ye)
|
|
});
|
|
z.defineProperty(dh, {
|
|
ZE: "linkingTool"
|
|
}, function() {
|
|
return this.findTool("Linking")
|
|
}, function(a) {
|
|
Pj(this, "Linking", a, this.dg)
|
|
});
|
|
z.defineProperty(dh, {
|
|
me: "draggingTool"
|
|
}, function() {
|
|
return this.findTool("Dragging")
|
|
}, function(a) {
|
|
Pj(this, "Dragging", a, this.dg)
|
|
});
|
|
z.defineProperty(dh, {
|
|
tH: "dragSelectingTool"
|
|
}, function() {
|
|
return this.findTool("DragSelecting")
|
|
}, function(a) {
|
|
Pj(this, "DragSelecting", a, this.dg)
|
|
});
|
|
z.defineProperty(dh, {
|
|
OI: "panningTool"
|
|
}, function() {
|
|
return this.findTool("Panning")
|
|
}, function(a) {
|
|
Pj(this, "Panning", a, this.dg)
|
|
});
|
|
z.defineProperty(dh, {
|
|
Hz: "contextMenuTool"
|
|
}, function() {
|
|
return this.findTool("ContextMenu")
|
|
}, function(a) {
|
|
Pj(this, "ContextMenu", a, this.eg)
|
|
});
|
|
z.defineProperty(dh, {
|
|
XA: "textEditingTool"
|
|
}, function() {
|
|
return this.findTool("TextEditing")
|
|
}, function(a) {
|
|
Pj(this, "TextEditing", a, this.eg)
|
|
});
|
|
z.defineProperty(dh, {
|
|
ZG: "clickCreatingTool"
|
|
}, function() {
|
|
return this.findTool("ClickCreating")
|
|
}, function(a) {
|
|
Pj(this, "ClickCreating", a, this.eg)
|
|
});
|
|
z.defineProperty(dh, {
|
|
$G: "clickSelectingTool"
|
|
}, function() {
|
|
return this.findTool("ClickSelecting")
|
|
}, function(a) {
|
|
Pj(this, "ClickSelecting", a, this.eg)
|
|
});
|
|
|
|
function Gg() {
|
|
this.NB = Qj;
|
|
this.Pq = this.Qq = this.Z = null;
|
|
this.Hn = this.Rq = this.Sq = 0;
|
|
this.cm = this.wc = this.to = this.Jj = !1;
|
|
this.Kj = this.af = !0;
|
|
this.cv = this.bv = this.HB = null;
|
|
this.GB = 0;
|
|
this.Ro = null;
|
|
this.Pu = new K("string");
|
|
this.Ey = 600;
|
|
this.yG = new N(0, 0);
|
|
this.vB = this.uB = this.vD = !1;
|
|
this.ym = new na(O, Rj)
|
|
}
|
|
z.ia("AnimationManager", Gg);
|
|
Gg.prototype.Sc = function(a) {
|
|
this.Z = a
|
|
};
|
|
|
|
function Qj(a, b, c, d) {
|
|
a /= d / 2;
|
|
return 1 > a ? c / 2 * a * a + b : -c / 2 * (--a * (a - 2) - 1) + b
|
|
}
|
|
z.defineProperty(Gg, {
|
|
VA: "starting"
|
|
}, function() {
|
|
return this.Ro
|
|
}, function(a) {
|
|
this.Ro !== a && (null !== a && z.g(a, "function", Gg, "starting"), this.Ro = a)
|
|
});
|
|
z.w(Gg, {
|
|
bK: "animationReasons"
|
|
}, function() {
|
|
return this.Pu
|
|
});
|
|
Gg.prototype.prepareAutomaticAnimation = Gg.prototype.sn = function(a) {
|
|
if (this.af && (this.Kj || this.Z.kn)) {
|
|
this.Pu.add(a);
|
|
var b = this.VA;
|
|
if (null === b || b(this, a)) this.Jj && this.oi(), this.wc = !0, this.cm = !1
|
|
}
|
|
};
|
|
|
|
function Sj(a) {
|
|
if (a.af && (a.Pu.clear(), a.wc))
|
|
if (!a.cm) a.wc = !1;
|
|
else if (0 === a.Hn) {
|
|
var b = +new Date;
|
|
a.Hn = b;
|
|
requestAnimationFrame(function() {
|
|
if (!1 !== a.wc && !a.Jj && a.Hn === b) {
|
|
var c = a.Z;
|
|
c.hj("temporaryPixelRatio") && (c.ck = 1);
|
|
Tj(c);
|
|
a.wc = !1;
|
|
c.Ja("AnimationStarting");
|
|
Uj(a, b)
|
|
}
|
|
})
|
|
}
|
|
}
|
|
|
|
function Vj(a, b, c, d, e, g) {
|
|
if (a.wc && (u && z.l(b, O, Gg, "addPropToAnimation:obj"), !("position" === c && d.N(e) || b instanceof D && !b.IE))) {
|
|
var h = a.ym;
|
|
if (h.contains(b)) {
|
|
b = h.na(b);
|
|
var k = b.start,
|
|
l = b.end;
|
|
void 0 === k[c] && (k[c] = Wj(d));
|
|
b.Lz && void 0 !== l[c] ? b.Vz[c] = Wj(e) : (g || (b.Vz[c] = Wj(e)), l[c] = Wj(e))
|
|
} else k = new ma, l = new ma, k[c] = Wj(d), l[c] = Wj(e), c = l, d = k.position, d instanceof N && !d.F() && a.Pu.contains("Expand SubGraph") && d.assign(c.position), h.add(b, new Rj(k, l, g));
|
|
a.cm = !0
|
|
}
|
|
}
|
|
|
|
function Wj(a) {
|
|
return a instanceof N ? a.copy() : a instanceof Ea ? a.copy() : a
|
|
}
|
|
|
|
function Uj(a, b) {
|
|
var c;
|
|
|
|
function d() {
|
|
if (!1 !== g.Jj && g.Hn === b) {
|
|
var a = +new Date,
|
|
c = a > s ? m : a - r;
|
|
Xj(g);
|
|
Yj(g, e, q, h, c, m);
|
|
g.bv && g.bv();
|
|
li(e);
|
|
Zj(g);
|
|
a > s ? ak(g) : requestAnimationFrame(d)
|
|
}
|
|
}
|
|
void 0 === c && (c = new ma);
|
|
var e = a.Z;
|
|
if (null !== e) {
|
|
a.Jj = !0;
|
|
var g = a,
|
|
h = c.AK || a.NB,
|
|
k = c.$K || null,
|
|
l = c.aL || null,
|
|
m = c.duration || a.Ey,
|
|
n = a.yG;
|
|
for (c = a.ym.i; c.next();) {
|
|
var p = c.value.start.position;
|
|
p instanceof N && (p.F() || p.assign(n))
|
|
}
|
|
a.HB = h;
|
|
a.bv = k;
|
|
a.cv = l;
|
|
a.GB = m;
|
|
a.KB = a.ym;
|
|
var q = a.KB;
|
|
for (c = q.i; c.next();) k = c.value.end, k["position:placeholder"] && (l =
|
|
k["position:placeholder"], n = l.fb(Zb), n.x += l.padding.left, n.y += l.padding.top, k["position:placeholder"] = n);
|
|
Xj(a);
|
|
Yj(a, e, q, h, 0, m);
|
|
li(a.Z);
|
|
Zj(a);
|
|
var r = +new Date,
|
|
s = r + m;
|
|
g.Hn === b && requestAnimationFrame(function() {
|
|
d()
|
|
})
|
|
}
|
|
}
|
|
var bk = {
|
|
opacity: function(a, b, c, d, e, g) {
|
|
a.opacity = d(e, b, c - b, g)
|
|
},
|
|
position: function(a, b, c, d, e, g) {
|
|
e !== g ? a.Nx(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) : a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g))
|
|
},
|
|
"position:node": function(a, b, c, d, e, g) {
|
|
var h = a.W,
|
|
k = c.W;
|
|
c = k.x + k.width / 2 - h.width / 2;
|
|
h = k.y + k.height / 2 - h.height / 2;
|
|
e !== g ? a.Nx(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g)) : a.position = new N(d(e, b.x, c - b.x, g), d(e, b.y, h - b.y, g))
|
|
},
|
|
"position:placeholder": function(a, b, c, d, e, g) {
|
|
e !== g ? a.Nx(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g)) :
|
|
a.position = new N(d(e, b.x, c.x - b.x, g), d(e, b.y, c.y - b.y, g))
|
|
},
|
|
scale: function(a, b, c, d, e, g) {
|
|
a.scale = d(e, b, c - b, g)
|
|
},
|
|
visible: function(a, b, c, d, e, g) {
|
|
a.visible = e !== g ? b : c
|
|
}
|
|
};
|
|
|
|
function Xj(a) {
|
|
if (!a.to) {
|
|
var b = a.Z;
|
|
a.vD = b.Bb;
|
|
a.uB = b.Ee;
|
|
a.vB = b.vu;
|
|
b.Bb = !0;
|
|
b.Ee = !0;
|
|
b.vu = !0;
|
|
a.to = !0
|
|
}
|
|
}
|
|
|
|
function Zj(a) {
|
|
var b = a.Z;
|
|
b.Bb = a.vD;
|
|
b.Ee = a.uB;
|
|
b.vu = a.vB;
|
|
a.to = !1
|
|
}
|
|
|
|
function Yj(a, b, c, d, e, g) {
|
|
for (c = c.i; c.next();) {
|
|
var h = c.key,
|
|
k = c.value,
|
|
l = k.start,
|
|
k = k.end,
|
|
m;
|
|
for (m in k)
|
|
if (("position" !== m || !k["position:placeholder"] && !k["position:node"]) && void 0 !== bk[m]) bk[m](h, l[m], k[m], d, e, g)
|
|
}
|
|
d = b.gA;
|
|
b.gA = !0;
|
|
m = a.NB;
|
|
0 !== a.Sq && 0 !== a.Rq && (c = a.Sq, b.bc = m(e, c, a.Rq - c, g));
|
|
null !== a.Qq && null !== a.Pq && (c = a.Qq, a = a.Pq, b.sb = new N(m(e, c.x, a.x - c.x, g), m(e, c.y, a.y - c.y, g)));
|
|
b.gA = d
|
|
}
|
|
Gg.prototype.stopAnimation = Gg.prototype.oi = function() {
|
|
!0 === this.wc && (this.wc = !1, this.cm && this.Z.Ce());
|
|
this.Jj && this.af && ak(this)
|
|
};
|
|
|
|
function ak(a) {
|
|
a.Jj = !1;
|
|
a.Hn = 0;
|
|
a.cm = !1;
|
|
a.Qq = null;
|
|
a.Pq = null;
|
|
a.Sq = 0;
|
|
a.Rq = 0;
|
|
Xj(a);
|
|
for (var b = a.Z, c = a.HB, d = a.GB, e = a.KB.i; e.next();) {
|
|
var g = e.key,
|
|
h = e.value,
|
|
k = h.start,
|
|
l = h.end,
|
|
m = h.Vz,
|
|
n;
|
|
for (n in l)
|
|
if (void 0 !== bk[n]) {
|
|
var p = n;
|
|
!h.Lz || "position:node" !== p && "position:placeholder" !== p || (p = "position");
|
|
bk[p](g, k[n], void 0 !== m[n] ? m[n] : h.Lz ? k[n] : l[n], c, d, d)
|
|
}
|
|
h.Cx && g.wd(!1)
|
|
}
|
|
for (c = a.Z.links; c.next();) d = c.value, null !== d.Ko && (d.points = d.Ko, d.Ko = null);
|
|
b.qx.clear();
|
|
b.ck = null;
|
|
b.yc();
|
|
b.bg();
|
|
ck(b);
|
|
Zj(a);
|
|
a.ym = new na(O, Rj);
|
|
a.cv &&
|
|
a.cv();
|
|
a.cv = null;
|
|
a.bv = null;
|
|
b.Ja("AnimationFinished");
|
|
b.Ce()
|
|
}
|
|
|
|
function dk(a, b, c) {
|
|
var d = b.W,
|
|
e = c.W,
|
|
g = null;
|
|
c instanceof F && (g = c.placeholder);
|
|
null !== g ? (d = g.fb(Zb), d.x += g.padding.left, d.y += g.padding.top, Vj(a, b, "position", d, b.position, !1)) : Vj(a, b, "position", new N(e.x + e.width / 2 - d.width / 2, e.y + e.height / 2 - d.height / 2), b.position, !1);
|
|
Vj(a, b, "scale", .01, b.scale, !1);
|
|
if (b instanceof F)
|
|
for (b = b.Hc; b.next();) g = b.value, g instanceof E && dk(a, g, c)
|
|
}
|
|
|
|
function ek(a, b, c) {
|
|
if (b.isVisible()) {
|
|
var d = null;
|
|
c instanceof F && (d = c.placeholder);
|
|
null !== d ? Vj(a, b, "position:placeholder", b.position, d, !0) : Vj(a, b, "position:node", b.position, c, !0);
|
|
Vj(a, b, "scale", b.scale, .01, !0);
|
|
a.wc && (d = a.ym, d.contains(b) && (d.na(b).Cx = !0));
|
|
if (b instanceof F)
|
|
for (b = b.Hc; b.next();) d = b.value, d instanceof E && ek(a, d, c)
|
|
}
|
|
}
|
|
|
|
function fk(a, b, c) {
|
|
a.wc && (null === a.Qq && b.F() && null === a.Pq && (a.Qq = b.copy()), a.Pq = c.copy(), a.cm = !0)
|
|
}
|
|
|
|
function gk(a, b, c) {
|
|
a.wc && a.Z.kn && (0 === a.Sq && 0 === a.Rq && (a.Sq = b), a.Rq = c, a.cm = !0)
|
|
}
|
|
z.defineProperty(Gg, {
|
|
isEnabled: "isEnabled"
|
|
}, function() {
|
|
return this.af
|
|
}, function(a) {
|
|
z.g(a, "boolean", Gg, "isEnabled");
|
|
this.af = a
|
|
});
|
|
z.defineProperty(Gg, {
|
|
duration: "duration"
|
|
}, function() {
|
|
return this.Ey
|
|
}, function(a) {
|
|
z.g(a, "number", Gg, "duration");
|
|
1 > a && z.ka(a, ">= 1", Gg, "duration");
|
|
this.Ey = a
|
|
});
|
|
z.w(Gg, {
|
|
nf: "isAnimating"
|
|
}, function() {
|
|
return this.Jj
|
|
});
|
|
z.w(Gg, {
|
|
kI: "isTicking"
|
|
}, function() {
|
|
return this.to
|
|
});
|
|
z.defineProperty(Gg, {
|
|
RE: "isInitial"
|
|
}, function() {
|
|
return this.Kj
|
|
}, function(a) {
|
|
z.g(a, "boolean", Gg, "isInitial");
|
|
this.Kj = a
|
|
});
|
|
|
|
function Rj(a, b, c) {
|
|
this.start = a;
|
|
this.end = b;
|
|
this.Vz = new ma;
|
|
this.Lz = c;
|
|
this.Cx = !1
|
|
}
|
|
|
|
function tg() {
|
|
0 < arguments.length && z.od(tg);
|
|
z.kc(this);
|
|
this.Z = null;
|
|
this.mb = new J(D);
|
|
this.Ub = "";
|
|
this.Xc = 1;
|
|
this.Vy = !1;
|
|
this.ml = this.vz = this.Jk = this.Ik = this.Hk = this.Gk = this.Ek = this.Fk = this.Dk = this.Lk = this.Ck = this.Kk = this.Bk = this.Ak = !0;
|
|
this.Qy = !1;
|
|
this.Wv = []
|
|
}
|
|
z.ia("Layer", tg);
|
|
tg.prototype.Sc = function(a) {
|
|
this.Z = a
|
|
};
|
|
tg.prototype.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
var b = 'Layer "' + this.name + '"';
|
|
if (0 >= a) return b;
|
|
for (var c = 0, d = 0, e = 0, g = 0, h = 0, k = this.mb.i; k.next();) {
|
|
var l = k.value;
|
|
l instanceof F ? e++ : l instanceof E ? d++ : l instanceof G ? g++ : l instanceof da ? h++ : c++
|
|
}
|
|
k = "";
|
|
0 < c && (k += c + " Parts ");
|
|
0 < d && (k += d + " Nodes ");
|
|
0 < e && (k += e + " Groups ");
|
|
0 < g && (k += g + " Links ");
|
|
0 < h && (k += h + " Adornments ");
|
|
if (1 < a)
|
|
for (a = this.mb.i; a.next();) c = a.value, k += "\n " + c.toString(), d = c.data, null !== d && z.nd(d) && (k += " #" + z.nd(d)), c instanceof E ? k += " " +
|
|
ka(d) : c instanceof G && (k += " " + ka(c.Y) + " " + ka(c.da));
|
|
return b + " " + this.mb.count + ": " + k
|
|
};
|
|
tg.prototype.findObjectAt = tg.prototype.pe = function(a, b, c) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
if (!1 === this.ml) return null;
|
|
u && !a.F() && z.k("findObjectAt: Point must have a real value, not: " + a.toString());
|
|
var d = !1;
|
|
this.h.xb.Ma(a) && (d = !0);
|
|
for (var e = z.O(), g = this.mb.o, h = g.length; h--;) {
|
|
var k = g[h];
|
|
if ((!0 !== d || !1 !== hk(k)) && k.isVisible() && (e.assign(a), ub(e, k.ph), k = k.pe(e, b, c), null !== k && (null !== b && (k = b(k)), null !== k && (null === c || c(k))))) return z.A(e), k
|
|
}
|
|
z.A(e);
|
|
return null
|
|
};
|
|
tg.prototype.findObjectsAt = tg.prototype.mp = function(a, b, c, d) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
d instanceof J || d instanceof K || (d = new K(O));
|
|
if (!1 === this.ml) return d;
|
|
u && !a.F() && z.k("findObjectsAt: Point must have a real value, not: " + a.toString());
|
|
var e = !1;
|
|
this.h.xb.Ma(a) && (e = !0);
|
|
for (var g = z.O(), h = this.mb.o, k = h.length; k--;) {
|
|
var l = h[k];
|
|
!0 === e && !1 === hk(l) || !l.isVisible() || (g.assign(a), ub(g, l.ph), l.mp(g, b, c, d) && (null !== b && (l = b(l)), null === l || null !== c && !c(l) || d.add(l)))
|
|
}
|
|
z.A(g);
|
|
return d
|
|
};
|
|
tg.prototype.findObjectsIn = tg.prototype.ok = function(a, b, c, d, e) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
void 0 === d && (d = !1);
|
|
e instanceof J || e instanceof K || (e = new K(O));
|
|
if (!1 === this.ml) return e;
|
|
u && !a.F() && z.k("findObjectsIn: Rect must have a real value, not: " + a.toString());
|
|
var g = !1;
|
|
this.h.xb.mk(a) && (g = !0);
|
|
for (var h = this.mb.o, k = h.length; k--;) {
|
|
var l = h[k];
|
|
(!0 !== g || !1 !== hk(l)) && l.isVisible() && l.ok(a, b, c, d, e) && (null !== b && (l = b(l)), null === l || null !== c && !c(l) || e.add(l))
|
|
}
|
|
return e
|
|
};
|
|
tg.prototype.Wz = function(a, b, c, d, e, g, h) {
|
|
if (!1 === this.ml) return e;
|
|
for (var k = this.mb.o, l = k.length; l--;) {
|
|
var m = k[l];
|
|
(!0 !== h || !1 !== hk(m)) && g(m) && m.isVisible() && m.ok(a, b, c, d, e) && (null !== b && (m = b(m)), null === m || null !== c && !c(m) || e.add(m))
|
|
}
|
|
return e
|
|
};
|
|
tg.prototype.findObjectsNear = tg.prototype.dn = function(a, b, c, d, e, g) {
|
|
void 0 === c && (c = null);
|
|
void 0 === d && (d = null);
|
|
void 0 === e && (e = !0);
|
|
if (!1 !== e && !0 !== e) {
|
|
if (e instanceof J || e instanceof K) g = e;
|
|
e = !0
|
|
}
|
|
g instanceof J || g instanceof K || (g = new K(O));
|
|
if (!1 === this.ml) return g;
|
|
u && !a.F() && z.k("findObjectsNear: Point must have a real value, not: " + a.toString());
|
|
var h = !1;
|
|
this.h.xb.Ma(a) && (h = !0);
|
|
for (var k = z.O(), l = z.O(), m = this.mb.o, n = m.length; n--;) {
|
|
var p = m[n];
|
|
!0 === h && !1 === hk(p) || !p.isVisible() || (k.assign(a), ub(k, p.ph),
|
|
l.n(a.x + b, a.y), ub(l, p.ph), p.dn(k, l, c, d, e, g) && (null !== c && (p = c(p)), null === p || null !== d && !d(p) || g.add(p)))
|
|
}
|
|
z.A(k);
|
|
z.A(l);
|
|
return g
|
|
};
|
|
f = tg.prototype;
|
|
f.Jf = function(a, b) {
|
|
if (this.visible) {
|
|
var c;
|
|
c = void 0 === b ? a.xb : b;
|
|
for (var d = this.mb.o, e = d.length, g = 0; g < e; g++) {
|
|
var h = d[g];
|
|
h.AC = g;
|
|
if (!(h instanceof G && !1 === h.Cg)) {
|
|
if (h instanceof da) {
|
|
var k = h;
|
|
if (null !== k.Wf) continue
|
|
}
|
|
if (Hb(h.W, c))
|
|
for (h.Jf(!0), ik(h), h = h.Dw; h.next();) k = h.value, rj(k, Infinity, Infinity), k.Lc(), k.Jf(!0);
|
|
else h.Jf(!1), null !== h.Dw && 0 < h.Dw.count && ik(h)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
f.ff = function(a, b, c) {
|
|
if (this.visible && 0 !== this.Xc && (void 0 === c && (c = !0), c || !this.Nc)) {
|
|
c = this.mb.o;
|
|
var d = c.length;
|
|
if (0 !== d) {
|
|
1 !== this.Xc && (a.globalAlpha = this.Xc);
|
|
var e = this.Wv;
|
|
e.length = 0;
|
|
for (var g = b.scale, h = 0; h < d; h++) {
|
|
var k = c[h];
|
|
if (hk(k)) {
|
|
if (k instanceof G) {
|
|
var l = k;
|
|
l.rc && e.push(l);
|
|
if (!1 === l.Cg) continue
|
|
}
|
|
l = k.W;
|
|
1 < l.width * g || 1 < l.height * g ? k.ff(a, b) : jk(k, a)
|
|
}
|
|
}
|
|
a.globalAlpha = 1
|
|
}
|
|
}
|
|
};
|
|
|
|
function kk(a, b, c, d) {
|
|
if (a.visible && 0 !== a.Xc) {
|
|
1 !== a.Xc && (b.globalAlpha = a.Xc);
|
|
var e = a.Wv;
|
|
e.length = 0;
|
|
var g = c.scale;
|
|
a = a.mb.o;
|
|
for (var h = a.length, k = d.length, l = 0; l < h; l++) {
|
|
var m = a[l];
|
|
if (hk(m)) {
|
|
if (m instanceof G) {
|
|
var n = m;
|
|
n.rc && e.push(n);
|
|
if (!1 === n.Cg) continue
|
|
}
|
|
var n = lk(m, m.W),
|
|
p;
|
|
a: {
|
|
p = n;
|
|
for (var q = d, r = k, s = 2 / g, t = 4 / g, v = 0; v < r; v++) {
|
|
var x = q[v];
|
|
if (0 !== x.width && 0 !== x.height && p.GE(x.x - s, x.y - s, x.width + t, x.height + t)) {
|
|
p = !0;
|
|
break a
|
|
}
|
|
}
|
|
p = !1
|
|
}
|
|
p && (1 < n.width * g || 1 < n.height * g ? m.ff(b, c) : jk(m, b))
|
|
}
|
|
}
|
|
b.globalAlpha = 1
|
|
}
|
|
}
|
|
f.j = function(a, b, c, d, e) {
|
|
var g = this.h;
|
|
null !== g && g.Rc(Sf, a, this, b, c, d, e)
|
|
};
|
|
f.xp = function(a, b, c) {
|
|
var d = this.mb;
|
|
b.Fv = this;
|
|
if (a >= d.count) a = d.count;
|
|
else if (d.ea(a) === b) return -1;
|
|
d.Ld(a, b);
|
|
b.Kt(c);
|
|
d = this.h;
|
|
null !== d && (c ? d.ta() : d.xp(b));
|
|
mk(this, a, b);
|
|
return a
|
|
};
|
|
f.Ve = function(a, b, c) {
|
|
if (!c && b.layer !== this && null !== b.layer) return b.layer.Ve(a, b, c);
|
|
var d = this.mb;
|
|
if (0 > a || a >= d.length) {
|
|
if (a = d.indexOf(b), 0 > a) return -1
|
|
} else if (d.ea(a) !== b && (a = d.indexOf(b), 0 > a)) return -1;
|
|
b.Lt(c);
|
|
d.dd(a);
|
|
d = this.h;
|
|
null !== d && (c ? d.ta() : d.Ve(b));
|
|
b.Fv = null;
|
|
return a
|
|
};
|
|
|
|
function mk(a, b, c) {
|
|
b = nk(a, b, c);
|
|
if (c instanceof F && null !== c && isNaN(c.En)) {
|
|
if (0 !== c.Hc.count) {
|
|
for (var d = -1, e = a.mb.o, g = e.length, h = 0; h < g; h++) {
|
|
var k = e[h];
|
|
if (k === c && (b = h, 0 <= d)) break;
|
|
if (0 > d && k.Va === c && (d = h, 0 <= b)) break
|
|
}!(0 > d) && d < b && (e = a.mb, e.dd(b), e.Ld(d, c))
|
|
}
|
|
c = c.Va;
|
|
null !== c && mk(a, -1, c)
|
|
}
|
|
}
|
|
|
|
function nk(a, b, c) {
|
|
var d = c.En;
|
|
if (isNaN(d)) return b;
|
|
a = a.mb;
|
|
var e = a.count;
|
|
if (1 >= e) return b;
|
|
0 > b && (b = a.indexOf(c));
|
|
if (0 > b) return -1;
|
|
for (var g = b - 1, h = NaN; 0 <= g;) {
|
|
h = a.ea(g).En;
|
|
if (!isNaN(h)) break;
|
|
g--
|
|
}
|
|
for (var k = b + 1, l = NaN; k < e;) {
|
|
l = a.ea(k).En;
|
|
if (!isNaN(l)) break;
|
|
k++
|
|
}
|
|
if (!isNaN(h) && h > d)
|
|
for (;;) {
|
|
if (-1 === g || h <= d) {
|
|
g++;
|
|
if (g === b) break;
|
|
a.dd(b);
|
|
a.Ld(g, c);
|
|
return g
|
|
}
|
|
for (h = NaN; 0 <= --g && (h = a.ea(g).En, isNaN(h)););
|
|
} else if (!isNaN(l) && l < d)
|
|
for (;;) {
|
|
if (k === e || l >= d) {
|
|
k--;
|
|
if (k === b) break;
|
|
a.dd(b);
|
|
a.Ld(k, c);
|
|
return k
|
|
}
|
|
for (l = NaN; ++k < e && (l = a.ea(k).En,
|
|
isNaN(l)););
|
|
}
|
|
return b
|
|
}
|
|
f.clear = function() {
|
|
for (var a = this.mb.jc(), b = a.length, c = 0; c < b; c++) a[c].Jf(!1), this.Ve(-1, a[c], !1)
|
|
};
|
|
z.w(tg, {
|
|
ni: "parts"
|
|
}, function() {
|
|
return this.mb.i
|
|
});
|
|
z.w(tg, {
|
|
lL: "partsBackwards"
|
|
}, function() {
|
|
return this.mb.ln
|
|
});
|
|
z.w(tg, {
|
|
h: "diagram"
|
|
}, function() {
|
|
return this.Z
|
|
});
|
|
z.defineProperty(tg, {
|
|
name: "name"
|
|
}, function() {
|
|
return this.Ub
|
|
}, function(a) {
|
|
z.g(a, "string", tg, "name");
|
|
var b = this.Ub;
|
|
if (b !== a) {
|
|
var c = this.h;
|
|
if (null !== c)
|
|
for ("" === b && z.k("Cannot rename default Layer to: " + a), c = c.mn; c.next();) c.value.name === a && z.k("Layer.name is already present in this diagram: " + a);
|
|
this.Ub = a;
|
|
this.j("name", b, a);
|
|
for (a = this.mb.i; a.next();) a.value.If = this.Ub
|
|
}
|
|
});
|
|
z.defineProperty(tg, {
|
|
opacity: "opacity"
|
|
}, function() {
|
|
return this.Xc
|
|
}, function(a) {
|
|
var b = this.Xc;
|
|
b !== a && (z.g(a, "number", tg, "opacity"), (0 > a || 1 < a) && z.ka(a, "0 <= value <= 1", tg, "opacity"), this.Xc = a, this.j("opacity", b, a), a = this.h, null !== a && a.ta())
|
|
});
|
|
z.defineProperty(tg, {
|
|
Nc: "isTemporary"
|
|
}, function() {
|
|
return this.Vy
|
|
}, function(a) {
|
|
var b = this.Vy;
|
|
b !== a && (z.g(a, "boolean", tg, "isTemporary"), this.Vy = a, this.j("isTemporary", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
visible: "visible"
|
|
}, function() {
|
|
return this.vz
|
|
}, function(a) {
|
|
var b = this.vz;
|
|
if (b !== a) {
|
|
z.g(a, "boolean", tg, "visible");
|
|
this.vz = a;
|
|
this.j("visible", b, a);
|
|
for (b = this.mb.i; b.next();) b.value.wd(a);
|
|
a = this.h;
|
|
null !== a && a.ta()
|
|
}
|
|
});
|
|
z.defineProperty(tg, {
|
|
ig: "pickable"
|
|
}, function() {
|
|
return this.ml
|
|
}, function(a) {
|
|
var b = this.ml;
|
|
b !== a && (z.g(a, "boolean", tg, "pickable"), this.ml = a, this.j("pickable", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
JE: "isBoundsIncluded"
|
|
}, function() {
|
|
return this.Qy
|
|
}, function(a) {
|
|
this.Qy !== a && (this.Qy = a, null !== this.h && this.h.yc())
|
|
});
|
|
z.defineProperty(tg, {
|
|
kk: "allowCopy"
|
|
}, function() {
|
|
return this.Ak
|
|
}, function(a) {
|
|
var b = this.Ak;
|
|
b !== a && (z.g(a, "boolean", tg, "allowCopy"), this.Ak = a, this.j("allowCopy", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
Sm: "allowDelete"
|
|
}, function() {
|
|
return this.Bk
|
|
}, function(a) {
|
|
var b = this.Bk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowDelete"), this.Bk = a, this.j("allowDelete", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
Hw: "allowTextEdit"
|
|
}, function() {
|
|
return this.Kk
|
|
}, function(a) {
|
|
var b = this.Kk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowTextEdit"), this.Kk = a, this.j("allowTextEdit", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
Ew: "allowGroup"
|
|
}, function() {
|
|
return this.Ck
|
|
}, function(a) {
|
|
var b = this.Ck;
|
|
b !== a && (z.g(a, "boolean", tg, "allowGroup"), this.Ck = a, this.j("allowGroup", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
Iw: "allowUngroup"
|
|
}, function() {
|
|
return this.Lk
|
|
}, function(a) {
|
|
var b = this.Lk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowUngroup"), this.Lk = a, this.j("allowUngroup", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
lt: "allowLink"
|
|
}, function() {
|
|
return this.Dk
|
|
}, function(a) {
|
|
var b = this.Dk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowLink"), this.Dk = a, this.j("allowLink", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
Tm: "allowRelink"
|
|
}, function() {
|
|
return this.Fk
|
|
}, function(a) {
|
|
var b = this.Fk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowRelink"), this.Fk = a, this.j("allowRelink", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
ul: "allowMove"
|
|
}, function() {
|
|
return this.Ek
|
|
}, function(a) {
|
|
var b = this.Ek;
|
|
b !== a && (z.g(a, "boolean", tg, "allowMove"), this.Ek = a, this.j("allowMove", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
Fw: "allowReshape"
|
|
}, function() {
|
|
return this.Gk
|
|
}, function(a) {
|
|
var b = this.Gk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowReshape"), this.Gk = a, this.j("allowReshape", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
mt: "allowResize"
|
|
}, function() {
|
|
return this.Hk
|
|
}, function(a) {
|
|
var b = this.Hk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowResize"), this.Hk = a, this.j("allowResize", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
Gw: "allowRotate"
|
|
}, function() {
|
|
return this.Ik
|
|
}, function(a) {
|
|
var b = this.Ik;
|
|
b !== a && (z.g(a, "boolean", tg, "allowRotate"), this.Ik = a, this.j("allowRotate", b, a))
|
|
});
|
|
z.defineProperty(tg, {
|
|
xf: "allowSelect"
|
|
}, function() {
|
|
return this.Jk
|
|
}, function(a) {
|
|
var b = this.Jk;
|
|
b !== a && (z.g(a, "boolean", tg, "allowSelect"), this.Jk = a, this.j("allowSelect", b, a))
|
|
});
|
|
|
|
function C(a) {
|
|
function b() {
|
|
window.document.removeEventListener("DOMContentLoaded", b, !1);
|
|
ok(c)
|
|
}
|
|
1 < arguments.length && z.k("Diagram constructor can only take one optional argument, the DIV HTML element or its id.");
|
|
z.kc(this);
|
|
pk = [];
|
|
this.Vc = !0;
|
|
this.sB = new Gg;
|
|
this.sB.Sc(this);
|
|
this.Gd = 17;
|
|
this.mr = !1;
|
|
this.hz = "default";
|
|
var c = this;
|
|
null !== window.document.body ? ok(this) : window.document.addEventListener("DOMContentLoaded", b, !1);
|
|
this.Yb = new J(tg);
|
|
this.Ob = this.Jb = 0;
|
|
this.Xj = this.Pb = this.gd = this.Fb = null;
|
|
this.rF();
|
|
this.qo =
|
|
null;
|
|
this.qF();
|
|
this.sb = (new N(NaN, NaN)).freeze();
|
|
this.bc = 1;
|
|
this.wv = (new N(NaN, NaN)).freeze();
|
|
this.xv = NaN;
|
|
this.Nv = 1E-4;
|
|
this.Kv = 100;
|
|
this.Hd = new Fa;
|
|
this.Bw = (new N(NaN, NaN)).freeze();
|
|
this.nv = (new w(NaN, NaN, NaN, NaN)).freeze();
|
|
this.iw = (new Db(0, 0, 0, 0)).freeze();
|
|
this.jw = qk;
|
|
this.fw = this.bw = null;
|
|
this.dm = jh;
|
|
this.Pn = Pc;
|
|
this.Xk = jh;
|
|
this.no = Pc;
|
|
this.yv = this.vv = Zb;
|
|
this.ue = !0;
|
|
this.gr = !1;
|
|
this.qg = new K(O);
|
|
this.Rk = new na(G, w);
|
|
this.bo = !0;
|
|
this.tB = 250;
|
|
this.In = -1;
|
|
this.Su = (new Db(16, 16, 16, 16)).freeze();
|
|
this.gv = this.Vf = !1;
|
|
this.io = !0;
|
|
this.Ei = new Pf;
|
|
this.Zc = new Pf;
|
|
this.Qb = new Pf;
|
|
this.gh = this.ti = null;
|
|
this.Ss = !1;
|
|
this.zy = this.Ay = null;
|
|
rk(this);
|
|
this.Fo = new K(E);
|
|
this.ol = new K(F);
|
|
this.zo = new K(G);
|
|
this.mb = new K(D);
|
|
this.Cv = !0;
|
|
this.ww = sk;
|
|
this.lC = !1;
|
|
this.yw = yi;
|
|
this.vy = this.xy = this.rz = null;
|
|
this.av = "";
|
|
this.Oq = "auto";
|
|
this.yi = this.Wi = this.Mi = this.Qv = this.Ni = this.Oi = this.Pi = this.xi = this.Ci = this.ui = null;
|
|
this.cz = !1;
|
|
this.TC = {};
|
|
this.aw = 0;
|
|
this.Uf = [null, null];
|
|
this.qy = null;
|
|
this.lq = this.yy = this.lz = this.$C = this.Vi = !1;
|
|
this.xC = !0;
|
|
this.Sy = this.Vd = !1;
|
|
this.ie = null;
|
|
var d = this;
|
|
this.EC = function(a) {
|
|
if (a.ha === d.ha && d.$a) {
|
|
d.$a = !1;
|
|
try {
|
|
var b = a.Dc;
|
|
"" === a.rf && b === Sf && tk(d, a.object, a.propertyName)
|
|
} finally {
|
|
d.$a = !0
|
|
}
|
|
}
|
|
};
|
|
this.FC = function(a) {
|
|
uk(d, a)
|
|
};
|
|
this.xD = !0;
|
|
this.bh = -2;
|
|
this.zi = new na(Object, D);
|
|
this.Qk = new na(Object, G);
|
|
this.nm = new na(Object, Array);
|
|
this.Go = new na("string", Array);
|
|
this.SC = new J(vk);
|
|
this.Gi = !1;
|
|
this.Bk = this.Ak = this.Hu = this.af = !0;
|
|
this.Ju = this.Iu = !1;
|
|
this.Ou = this.Mu = this.Jk = this.Ik = this.Hk = this.Gk = this.Ek = this.Fk = this.Dk = this.Lu = this.Lk = this.Ck = this.Kk = !0;
|
|
this.km = this.uC = !1;
|
|
this.Nu = this.Ku = this.tv = this.sv = !0;
|
|
this.lw = this.hw = 16;
|
|
this.iz = this.gw = !1;
|
|
this.xs = this.kw = null;
|
|
this.jz = this.kz = 0;
|
|
this.df = (new Db(5)).freeze();
|
|
this.ow = (new K(D)).freeze();
|
|
this.Lv = 999999999;
|
|
this.uv = (new K(D)).freeze();
|
|
this.Yk = this.im = this.Ij = !0;
|
|
this.Vk = this.Hj = !1;
|
|
this.he = null;
|
|
this.Qu = !0;
|
|
this.eh = !1;
|
|
this.rG = new K(G);
|
|
this.jC = new K(wk);
|
|
this.Ed = null;
|
|
this.KC = 1;
|
|
this.Ly = !1;
|
|
this.cD = 0;
|
|
this.wD = (new w(NaN, NaN, NaN, NaN)).freeze();
|
|
this.hv = (new w(NaN, NaN, NaN, NaN)).freeze();
|
|
this.Xv = new K(xk);
|
|
yk(this);
|
|
this.Hv = this.pv = this.Rv = this.PB = this.OB = this.QB = this.Oj = this.Tk = this.Qi = null;
|
|
zk(this);
|
|
this.td = null;
|
|
this.ov = !1;
|
|
this.Sn = null;
|
|
this.hb = new dh;
|
|
this.hb.initializeStandardTools();
|
|
this.eb = this.vt = this.hb;
|
|
this.wb = new ra;
|
|
this.ha = new V;
|
|
this.Vi = !0;
|
|
this.Sb = new vg;
|
|
this.Vi = !1;
|
|
this.aC = this.Cy = null;
|
|
this.jd = 1;
|
|
this.ck = null;
|
|
this.Wk = new Ak;
|
|
void 0 !== a && Bk(this, a);
|
|
this.bl = 1;
|
|
this.pm = 0;
|
|
this.zC = new N;
|
|
this.tD = 500;
|
|
this.Ru = new N;
|
|
this.Ks = null;
|
|
this.Vc = this.Zk = !1
|
|
}
|
|
z.ia("Diagram", C);
|
|
|
|
function zk(a) {
|
|
a.Qi = new na("string", D);
|
|
var b = new E,
|
|
c = new qa;
|
|
c.bind(new Xg("text", "", ka));
|
|
b.add(c);
|
|
a.QB = b;
|
|
a.Qi.add("", b);
|
|
b = new E;
|
|
c = new qa;
|
|
c.stroke = "brown";
|
|
c.bind(new Xg("text", "", ka));
|
|
b.add(c);
|
|
a.Qi.add("Comment", b);
|
|
b = new E;
|
|
b.vk = !1;
|
|
b.ND = !1;
|
|
c = new X;
|
|
c.Hb = "Ellipse";
|
|
c.fill = "black";
|
|
c.stroke = null;
|
|
c.Aa = (new Ea(3, 3)).La();
|
|
b.add(c);
|
|
a.Qi.add("LinkLabel", b);
|
|
a.Tk = new na("string", F);
|
|
b = new F;
|
|
b.Ix = "GROUPPANEL";
|
|
b.type = Ck;
|
|
c = new qa;
|
|
c.font = "bold 12pt sans-serif";
|
|
c.bind(new Xg("text", "", ka));
|
|
b.add(c);
|
|
c = new I(Dk);
|
|
c.name =
|
|
"GROUPPANEL";
|
|
var d = new X;
|
|
d.Hb = "Rectangle";
|
|
d.fill = "rgba(128,128,128,0.2)";
|
|
d.stroke = "black";
|
|
c.add(d);
|
|
d = new Zi;
|
|
d.padding = (new Db(5, 5, 5, 5)).La();
|
|
c.add(d);
|
|
b.add(c);
|
|
a.OB = b;
|
|
a.Tk.add("", b);
|
|
a.Oj = new na("string", G);
|
|
b = new G;
|
|
c = new X;
|
|
c.Ff = !0;
|
|
b.add(c);
|
|
c = new X;
|
|
c.fq = "Standard";
|
|
c.fill = "black";
|
|
c.stroke = null;
|
|
c.ub = 0;
|
|
b.add(c);
|
|
a.PB = b;
|
|
a.Oj.add("", b);
|
|
b = new G;
|
|
c = new X;
|
|
c.Ff = !0;
|
|
c.stroke = "brown";
|
|
b.add(c);
|
|
a.Oj.add("Comment", b);
|
|
b = new da;
|
|
b.type = Dk;
|
|
c = new X;
|
|
c.fill = null;
|
|
c.stroke = "dodgerblue";
|
|
c.ub = 3;
|
|
b.add(c);
|
|
c = new Zi;
|
|
c.margin = (new Db(1.5,
|
|
1.5, 1.5, 1.5)).La();
|
|
b.add(c);
|
|
a.Rv = b;
|
|
a.pv = b;
|
|
b = new da;
|
|
b.type = Ki;
|
|
c = new X;
|
|
c.Ff = !0;
|
|
c.fill = null;
|
|
c.stroke = "dodgerblue";
|
|
c.ub = 3;
|
|
b.add(c);
|
|
a.Hv = b
|
|
}
|
|
|
|
function ok(a) {
|
|
var b = z.createElement("p");
|
|
b.style.width = "100%";
|
|
b.style.height = "200px";
|
|
b.style.boxSizing = "content-box";
|
|
var c = z.createElement("div");
|
|
c.style.position = "absolute";
|
|
c.style.visibility = "hidden";
|
|
c.style.width = "200px";
|
|
c.style.height = "150px";
|
|
c.style.overflow = "hidden";
|
|
c.style.boxSizing = "content-box";
|
|
c.appendChild(b);
|
|
window.document.body.appendChild(c);
|
|
var d = b.offsetWidth;
|
|
c.style.overflow = "scroll";
|
|
b = b.offsetWidth;
|
|
d === b && (b = c.clientWidth);
|
|
window.document.body.removeChild(c);
|
|
c = d - b;
|
|
0 !== c || z.PE ||
|
|
(c = 11);
|
|
a.Gd = c;
|
|
c = z.createElement("div");
|
|
c.dir = "rtl";
|
|
c.style.cssText = "font-size: 14px; width: 1px; height: 1px; position: absolute; top: -1000px; overflow: scroll;";
|
|
c.textContent = "A";
|
|
window.document.body.appendChild(c);
|
|
d = "reverse";
|
|
0 < c.scrollLeft ? d = "default" : (c.scrollLeft = 1, 0 === c.scrollLeft && (d = "negative"));
|
|
window.document.body.removeChild(c);
|
|
a.hz = d
|
|
}
|
|
C.prototype.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
var b = "";
|
|
this.id && (b = this.id);
|
|
this.Dl && this.Dl.id && (b = this.Dl.id);
|
|
b = 'Diagram "' + b + '"';
|
|
if (0 >= a) return b;
|
|
for (var c = this.Yb.i; c.next();) b += "\n " + c.value.toString(a - 1);
|
|
return b
|
|
};
|
|
C.fromDiv = function(a) {
|
|
var b = a;
|
|
"string" === typeof a && (b = window.document.getElementById(a));
|
|
return b instanceof HTMLDivElement && b.Z instanceof C ? b.Z : null
|
|
};
|
|
z.defineProperty(C, {
|
|
Dl: "div"
|
|
}, function() {
|
|
return this.Pb
|
|
}, function(a) {
|
|
null !== a && z.l(a, HTMLDivElement, C, "div");
|
|
if (this.Pb !== a) {
|
|
pk = [];
|
|
var b = this.Pb;
|
|
null !== b ? (b.Z = void 0, b.innerHTML = "", null !== this.Fb && (this.Fb.removeEventListener("touchstart", this.ZF, !1), this.Fb.removeEventListener("touchmove", this.YF, !1), this.Fb.removeEventListener("touchend", this.XF, !1), this.Fb.Kd.Z = null), b = this.hb, null !== b && (b.Ye.each(function(a) {
|
|
a.cancelWaitAfter()
|
|
}), b.dg.each(function(a) {
|
|
a.cancelWaitAfter()
|
|
}), b.eg.each(function(a) {
|
|
a.cancelWaitAfter()
|
|
})),
|
|
b.cancelWaitAfter(), this.eb.doCancel(), this.gd = this.Fb = null, window.removeEventListener("resize", this.hG, !1), window.removeEventListener("mousemove", this.Kp, !0), window.removeEventListener("mousedown", this.Jp, !0), window.removeEventListener("mouseup", this.Mp, !0), window.removeEventListener("mousewheel", this.zh, !0), window.removeEventListener("DOMMouseScroll", this.zh, !0), window.removeEventListener("mouseout", this.Lp, !0)) : this.eh = !1;
|
|
this.Pb = null;
|
|
if (null !== a) {
|
|
if (b = a.Z) b.Dl = null;
|
|
Bk(this, a);
|
|
this.Sp()
|
|
}
|
|
}
|
|
});
|
|
|
|
function Ek(a) {
|
|
var b = a.Fb;
|
|
b.addEventListener("touchstart", a.ZF, !1);
|
|
b.addEventListener("touchmove", a.YF, !1);
|
|
b.addEventListener("touchend", a.XF, !1);
|
|
b.addEventListener("mousemove", a.Kp, !1);
|
|
b.addEventListener("mousedown", a.Jp, !1);
|
|
b.addEventListener("mouseup", a.Mp, !1);
|
|
b.addEventListener("mousewheel", a.zh, !1);
|
|
b.addEventListener("DOMMouseScroll", a.zh, !1);
|
|
b.addEventListener("mouseout", a.Lp, !1);
|
|
b.addEventListener("keydown", a.oI, !1);
|
|
b.addEventListener("keyup", a.pI, !1);
|
|
b.addEventListener("selectstart", function(a) {
|
|
a.preventDefault();
|
|
return !1
|
|
}, !1);
|
|
b.addEventListener("contextmenu", function(a) {
|
|
a.preventDefault();
|
|
return !1
|
|
}, !1);
|
|
b.addEventListener("gesturechange", function(b) {
|
|
a.hb.rp === Mj && b.preventDefault()
|
|
}, !1);
|
|
b.addEventListener("pointerdown", a.QI, !1);
|
|
b.addEventListener("pointermove", a.SI, !1);
|
|
b.addEventListener("pointerleave", a.RI, !1);
|
|
window.addEventListener("resize", a.hG, !1)
|
|
}
|
|
C.prototype.computePixelRatio = function() {
|
|
return null !== this.ck ? this.ck : this.vG
|
|
};
|
|
C.prototype.doMouseMove = function() {
|
|
this.eb.doMouseMove()
|
|
};
|
|
C.prototype.doMouseDown = function() {
|
|
this.eb.doMouseDown()
|
|
};
|
|
C.prototype.doMouseUp = function() {
|
|
this.eb.doMouseUp()
|
|
};
|
|
C.prototype.doMouseWheel = function() {
|
|
this.eb.doMouseWheel()
|
|
};
|
|
C.prototype.doKeyDown = function() {
|
|
this.eb.doKeyDown()
|
|
};
|
|
C.prototype.doKeyUp = function() {
|
|
this.eb.doKeyUp()
|
|
};
|
|
C.prototype.doFocus = function() {
|
|
this.focus()
|
|
};
|
|
C.prototype.focus = C.prototype.focus = function() {
|
|
this.Fb && this.Fb.focus()
|
|
};
|
|
|
|
function Tj(a) {
|
|
if (null !== a.Fb) {
|
|
var b = a.Pb;
|
|
if (0 !== b.clientWidth && 0 !== b.clientHeight) {
|
|
var c = a.Vk ? a.Gd : 0,
|
|
d = a.Hj ? a.Gd : 0,
|
|
e = a.jd;
|
|
a.jd = a.computePixelRatio();
|
|
a.jd !== e && (a.gr = !0, a.Ce());
|
|
if (b.clientWidth !== a.Jb + c || b.clientHeight !== a.Ob + d) a.im = !0, a.ue = !0, b = a.Sb, null !== b && b.mx && a.wl === jh && b.I(), a.Vd || a.Ce()
|
|
}
|
|
}
|
|
}
|
|
|
|
function yk(a) {
|
|
var b = new tg;
|
|
b.name = "Background";
|
|
a.ft(b);
|
|
b = new tg;
|
|
b.name = "";
|
|
a.ft(b);
|
|
b = new tg;
|
|
b.name = "Foreground";
|
|
a.ft(b);
|
|
b = new tg;
|
|
b.name = "Adornment";
|
|
b.Nc = !0;
|
|
a.ft(b);
|
|
b = new tg;
|
|
b.name = "Tool";
|
|
b.Nc = !0;
|
|
b.JE = !0;
|
|
a.ft(b);
|
|
b = new tg;
|
|
b.name = "Grid";
|
|
b.xf = !1;
|
|
b.ig = !1;
|
|
b.Nc = !0;
|
|
a.OG(b, a.Fl("Background"))
|
|
}
|
|
|
|
function Fk(a) {
|
|
a.td = new I(Gk);
|
|
a.td.name = "GRID";
|
|
var b = new X;
|
|
b.Hb = "LineH";
|
|
b.stroke = "lightgray";
|
|
b.ub = .5;
|
|
b.interval = 1;
|
|
a.td.add(b);
|
|
b = new X;
|
|
b.Hb = "LineH";
|
|
b.stroke = "gray";
|
|
b.ub = .5;
|
|
b.interval = 5;
|
|
a.td.add(b);
|
|
b = new X;
|
|
b.Hb = "LineH";
|
|
b.stroke = "gray";
|
|
b.ub = 1;
|
|
b.interval = 10;
|
|
a.td.add(b);
|
|
b = new X;
|
|
b.Hb = "LineV";
|
|
b.stroke = "lightgray";
|
|
b.ub = .5;
|
|
b.interval = 1;
|
|
a.td.add(b);
|
|
b = new X;
|
|
b.Hb = "LineV";
|
|
b.stroke = "gray";
|
|
b.ub = .5;
|
|
b.interval = 5;
|
|
a.td.add(b);
|
|
b = new X;
|
|
b.Hb = "LineV";
|
|
b.stroke = "gray";
|
|
b.ub = 1;
|
|
b.interval = 10;
|
|
a.td.add(b);
|
|
b = new D;
|
|
b.add(a.td);
|
|
b.If = "Grid";
|
|
b.En = 0;
|
|
b.jx = !1;
|
|
b.IE = !1;
|
|
b.ig = !1;
|
|
b.sx = "GRID";
|
|
a.add(b);
|
|
a.mb.remove(b);
|
|
a.td.visible = !1
|
|
}
|
|
C.prototype.xG = function() {
|
|
this.Z.isEnabled ? this.Z.sH(this) : Hk(this.Z)
|
|
};
|
|
C.prototype.JC = function(a) {
|
|
this.Z.isEnabled ? (this.Z.iz = !0, this.Z.kz = a.target.scrollTop, this.Z.jz = a.target.scrollLeft) : Hk(this.Z)
|
|
};
|
|
C.prototype.diagramScroll = C.prototype.sH = function(a) {
|
|
if (this.iz && null !== this.Fb) {
|
|
this.gw = !0;
|
|
var b = this.ad,
|
|
c = this.xb,
|
|
d = b.width,
|
|
e = c.width,
|
|
g = b.height,
|
|
h = c.height,
|
|
k = b.right,
|
|
l = c.right,
|
|
m = b.bottom,
|
|
n = c.bottom,
|
|
p = b.x,
|
|
q = c.x,
|
|
b = b.y,
|
|
c = c.y,
|
|
r = this.scale,
|
|
s;
|
|
s = a.scrollLeft;
|
|
if (this.mr) switch (this.hz) {
|
|
case "negative":
|
|
s = s + a.scrollWidth - a.clientWidth;
|
|
break;
|
|
case "reverse":
|
|
s = a.scrollWidth - s - a.clientWidth
|
|
}
|
|
var t = s;
|
|
e < d || h < g ? (s = z.Tb(this.position.x, this.position.y), this.xe && this.jz !== t && (s.x = t / r + p, this.jz = t), this.ye && this.kz !==
|
|
a.scrollTop && (s.y = a.scrollTop / r + b, this.kz = a.scrollTop), this.position = s, z.A(s), this.im = this.gw = !1) : (s = z.O(), a.AG && this.xe && (p < q && (this.position = s.n(t + p, this.position.y)), k > l && (this.position = s.n(-(this.kw.scrollWidth - this.Jb) + t - this.Jb / r + k, this.position.y))), a.BG && this.ye && (b < c && (this.position = s.n(this.position.x, a.scrollTop + b)), m > n && (this.position = s.n(this.position.x, -(this.kw.scrollHeight - this.Ob) + a.scrollTop - this.Ob / r + m))), z.A(s), Ik(this), this.im = this.gw = !1, b = this.ad, c = this.xb, k = b.right, l = c.right,
|
|
m = b.bottom, n = c.bottom, p = b.x, q = c.x, b = b.y, c = c.y, e >= d && p >= q && k <= l && (this.xs.style.width = "1px"), h >= g && b >= c && m <= n && (this.xs.style.height = "1px"))
|
|
}
|
|
};
|
|
C.prototype.computeBounds = C.prototype.rh = function() {
|
|
0 < this.qg.count && Jk(this);
|
|
return Kk(this)
|
|
};
|
|
|
|
function Kk(a) {
|
|
if (a.uE.F()) {
|
|
var b = a.uE.copy();
|
|
b.Cw(a.padding);
|
|
return b
|
|
}
|
|
for (var c = !0, d = a.Yb.o, e = d.length, g = 0; g < e; g++) {
|
|
var h = d[g];
|
|
if (h.visible && (!h.Nc || h.JE))
|
|
for (var h = h.mb.o, k = h.length, l = 0; l < k; l++) {
|
|
var m = h[l];
|
|
m.jx && m.isVisible() && (m = m.W, m.F() && (c ? (c = !1, b = m.copy()) : b.qi(m)))
|
|
}
|
|
}
|
|
c && (b = new w(0, 0, 0, 0));
|
|
b.Cw(a.padding);
|
|
return b
|
|
}
|
|
C.prototype.computePartsBounds = function(a) {
|
|
var b = null;
|
|
for (a = a.i; a.next();) {
|
|
var c = a.value;
|
|
c instanceof G || (c.Bf(), null === b ? b = c.W.copy() : b.qi(c.W))
|
|
}
|
|
return null === b ? new w(NaN, NaN, 0, 0) : b
|
|
};
|
|
|
|
function Lk(a, b) {
|
|
if ((b || a.eh) && !a.Vc && null !== a.Fb && !a.Ua.nf && a.ad.F()) {
|
|
a.Vc = !0;
|
|
var c = a.dm;
|
|
b && a.Xk !== jh && (c = a.Xk);
|
|
var d = c !== jh ? Mk(a, c) : a.scale,
|
|
c = a.xb.copy(),
|
|
e = a.Jb / d,
|
|
g = a.Ob / d,
|
|
h = null,
|
|
k = a.Ua;
|
|
k.wc && (h = a.sb.copy());
|
|
a.position.Wa();
|
|
var l = a.Pn;
|
|
b && !l.cd() && a.no.cd() && (l = a.no);
|
|
Nk(a, a.sb, a.ad, e, g, l, b);
|
|
a.position.freeze();
|
|
null !== h && fk(k, h, a.sb);
|
|
a.scale = d;
|
|
a.Vc = !1;
|
|
d = a.xb;
|
|
d.Mc(c) || a.fu(c, d)
|
|
}
|
|
}
|
|
|
|
function Mk(a, b) {
|
|
var c = a.wb.Rw;
|
|
if (null === a.Fb) return c;
|
|
a.Ij && Ok(a, a.rh());
|
|
var d = a.ad;
|
|
if (!d.F()) return c;
|
|
var e = d.width,
|
|
d = d.height,
|
|
g = a.Jb,
|
|
h = a.Ob,
|
|
k = g / e,
|
|
l = h / d;
|
|
return b === Pk ? (e = Math.min(l, k), e > c && (e = c), e < a.yh && (e = a.yh), e > a.xh && (e = a.xh), e) : b === Qk ? (e = l > k ? (h - a.Gd) / d : (g - a.Gd) / e, e > c && (e = c), e < a.yh && (e = a.yh), e > a.xh && (e = a.xh), e) : a.scale
|
|
}
|
|
C.prototype.zoomToFit = C.prototype.zoomToFit = function() {
|
|
this.scale = Mk(this, Pk)
|
|
};
|
|
C.prototype.zoomToRect = function(a, b) {
|
|
void 0 === b && (b = Pk);
|
|
var c = a.width,
|
|
d = a.height;
|
|
if (!(0 === c || 0 === d || isNaN(c) && isNaN(d))) {
|
|
var e = 1;
|
|
if (b === Pk || b === Qk)
|
|
if (isNaN(c)) e = this.xb.height * this.scale / d;
|
|
else if (isNaN(d)) e = this.xb.width * this.scale / c;
|
|
else var e = this.Jb,
|
|
g = this.Ob,
|
|
e = b === Qk ? g / d > e / c ? (g - (this.Hj ? this.Gd : 0)) / d : (e - (this.Vk ? this.Gd : 0)) / c : Math.min(g / d, e / c);
|
|
this.scale = e;
|
|
this.position = new N(a.x, a.y)
|
|
}
|
|
};
|
|
z.defineProperty(C, {
|
|
gA: null
|
|
}, function() {
|
|
return this.Vc
|
|
}, function(a) {
|
|
this.Vc = a
|
|
});
|
|
C.prototype.alignDocument = function(a, b) {
|
|
this.Ij && Ok(this, this.rh());
|
|
var c = this.ad,
|
|
d = this.xb;
|
|
this.position = new N(c.x + (a.x * c.width + a.offsetX) - (b.x * d.width - b.offsetX), c.y + (a.y * c.height + a.offsetY) - (b.y * d.height - b.offsetY))
|
|
};
|
|
|
|
function Nk(a, b, c, d, e, g, h) {
|
|
var k = b.x,
|
|
l = b.y;
|
|
if (h || a.MA === qk) g.cd() && (d > c.width && (k = c.x + (g.x * c.width + g.offsetX) - (g.x * d - g.offsetX)), e > c.height && (l = c.y + (g.y * c.height + g.offsetY) - (g.y * e - g.offsetY))), g = a.BF, h = d - c.width, d < c.width + g.left + g.right ? (k = Math.min(k + d / 2, c.right + Math.max(h, g.right) - d / 2), k = Math.max(k, c.left - Math.max(h, g.left) + d / 2), k -= d / 2) : k > c.left ? k = c.left : k < c.right - d && (k = c.right - d), d = e - c.height, e < c.height + g.top + g.bottom ? (l = Math.min(l + e / 2, c.bottom + Math.max(d, g.bottom) - e / 2), l = Math.max(l, c.top - Math.max(d,
|
|
g.top) + e / 2), l -= e / 2) : l > c.top ? l = c.top : l < c.bottom - e && (l = c.bottom - e);
|
|
b.x = isFinite(k) ? k : -a.padding.left;
|
|
b.y = isFinite(l) ? l : -a.padding.top;
|
|
null !== a.jF && (a = a.jF(a, b), b.x = a.x, b.y = a.y)
|
|
}
|
|
C.prototype.findPartAt = C.prototype.At = function(a, b) {
|
|
var c = b ? ei(this, a, function(a) {
|
|
return a.ca
|
|
}, function(a) {
|
|
return a.canSelect()
|
|
}) : ei(this, a, function(a) {
|
|
return a.ca
|
|
});
|
|
return c instanceof D ? c : null
|
|
};
|
|
C.prototype.findObjectAt = C.prototype.pe = function(a, b, c) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
Jk(this);
|
|
for (var d = this.Yb.ln; d.next();) {
|
|
var e = d.value;
|
|
if (e.visible && (e = e.pe(a, b, c), null !== e)) return e
|
|
}
|
|
return null
|
|
};
|
|
|
|
function ei(a, b, c, d) {
|
|
void 0 === c && (c = null);
|
|
void 0 === d && (d = null);
|
|
Jk(a);
|
|
for (a = a.Yb.ln; a.next();) {
|
|
var e = a.value;
|
|
if (e.visible && !e.Nc && (e = e.pe(b, c, d), null !== e)) return e
|
|
}
|
|
return null
|
|
}
|
|
C.prototype.findObjectsAt = C.prototype.mp = function(a, b, c, d) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
d instanceof J || d instanceof K || (d = new K(O));
|
|
Jk(this);
|
|
for (var e = this.Yb.ln; e.next();) {
|
|
var g = e.value;
|
|
g.visible && g.mp(a, b, c, d)
|
|
}
|
|
return d
|
|
};
|
|
C.prototype.findObjectsIn = C.prototype.ok = function(a, b, c, d, e) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
void 0 === d && (d = !1);
|
|
e instanceof J || e instanceof K || (e = new K(O));
|
|
Jk(this);
|
|
for (var g = this.Yb.ln; g.next();) {
|
|
var h = g.value;
|
|
h.visible && h.ok(a, b, c, d, e)
|
|
}
|
|
return e
|
|
};
|
|
C.prototype.Wz = function(a, b, c, d, e, g) {
|
|
var h = new K(O);
|
|
Jk(this);
|
|
for (var k = this.Yb.ln; k.next();) {
|
|
var l = k.value;
|
|
l.visible && l.Wz(a, b, c, d, h, e, g)
|
|
}
|
|
return h
|
|
};
|
|
C.prototype.findObjectsNear = C.prototype.dn = function(a, b, c, d, e, g) {
|
|
void 0 === c && (c = null);
|
|
void 0 === d && (d = null);
|
|
void 0 === e && (e = !0);
|
|
if (!1 !== e && !0 !== e) {
|
|
if (e instanceof J || e instanceof K) g = e;
|
|
e = !0
|
|
}
|
|
g instanceof J || g instanceof K || (g = new K(O));
|
|
Jk(this);
|
|
for (var h = this.Yb.ln; h.next();) {
|
|
var k = h.value;
|
|
k.visible && k.dn(a, b, c, d, e, g)
|
|
}
|
|
return g
|
|
};
|
|
C.prototype.acceptEvent = function(a) {
|
|
var b = this.Zc;
|
|
this.Zc = this.Qb;
|
|
this.Qb = b;
|
|
Rk(this, this, a, b, a instanceof MouseEvent);
|
|
return b
|
|
};
|
|
|
|
function Rk(a, b, c, d, e) {
|
|
d.h = b;
|
|
d.event = c;
|
|
e ? Sk(a, c, d) : (d.te = b.Qb.te, d.ga = b.Qb.ga);
|
|
a = 0;
|
|
c.ctrlKey && (a += 1);
|
|
c.altKey && (a += 2);
|
|
c.shiftKey && (a += 4);
|
|
c.metaKey && (a += 8);
|
|
d.xd = a;
|
|
d.button = c.button;
|
|
c.buttons && (d.buttons = c.buttons);
|
|
z.rk && 0 === c.button && c.ctrlKey && (d.button = 2);
|
|
d.El = !1;
|
|
d.up = !1;
|
|
d.Pe = 1;
|
|
d.Cl = 0;
|
|
d.Gc = !1;
|
|
d.bubbles = !1;
|
|
d.timestamp = Date.now();
|
|
d.Qt = !1;
|
|
d.Sg = c.target.Z ? c.target.Z : null;
|
|
d.Ge = null
|
|
}
|
|
|
|
function Tk(a, b, c, d, e) {
|
|
d.h = a;
|
|
Sk(a, c, d);
|
|
d.xd = 0;
|
|
d.button = 0;
|
|
d.buttons = 1;
|
|
d.El = !0;
|
|
d.up = !1;
|
|
d.Pe = 1;
|
|
d.Cl = 0;
|
|
d.Gc = !1;
|
|
d.bubbles = !0;
|
|
d.event = b;
|
|
d.timestamp = Date.now();
|
|
d.Qt = e;
|
|
d.Sg = b.target.Z ? b.target.Z : null;
|
|
d.Ge = null;
|
|
a.Ei = d.copy();
|
|
Hh = null
|
|
}
|
|
|
|
function Uk(a, b, c, d, e) {
|
|
var g = null;
|
|
d.h = a;
|
|
null !== c ? ((g = window.document.elementFromPoint(c.clientX, c.clientY)) && g.Z ? g = g.Z : (c = b.changedTouches[0], g = a), d.Sg = g, Sk(a, c, d)) : null !== a.Zc ? (d.ga = a.Zc.ga, d.te = a.Zc.te, d.Sg = a.Zc.Sg) : null !== a.Ei && (d.ga = a.Ei.ga, d.te = a.Ei.te, d.Sg = a.Ei.Sg);
|
|
d.xd = 0;
|
|
d.button = 0;
|
|
d.buttons = 1;
|
|
d.El = !1;
|
|
d.up = !1;
|
|
d.Pe = 1;
|
|
d.Cl = 0;
|
|
d.Gc = !1;
|
|
d.bubbles = !1;
|
|
d.event = b;
|
|
d.timestamp = Date.now();
|
|
d.Qt = e;
|
|
d.Ge = null
|
|
}
|
|
|
|
function ha(a, b, c) {
|
|
if (b.bubbles) return u && u.EE && z.trace("NOT handled " + c.type + " " + b.toString()), !0;
|
|
u && u.EE && z.trace("handled " + c.type + " " + a.eb.name + " " + b.toString());
|
|
void 0 !== c.stopPropagation && c.stopPropagation();
|
|
(void 0 === c.touches || 2 > c.touches.length) && c.preventDefault();
|
|
c.cancelBubble = !0;
|
|
return !1
|
|
}
|
|
C.prototype.oI = function(a) {
|
|
if (!this.Z.isEnabled) return !1;
|
|
var b = this.Z.Qb;
|
|
Rk(this.Z, this.Z, a, b, !1);
|
|
b.key = String.fromCharCode(a.which);
|
|
b.El = !0;
|
|
switch (a.which) {
|
|
case 8:
|
|
b.key = "Backspace";
|
|
break;
|
|
case 33:
|
|
b.key = "PageUp";
|
|
break;
|
|
case 34:
|
|
b.key = "PageDown";
|
|
break;
|
|
case 35:
|
|
b.key = "End";
|
|
break;
|
|
case 36:
|
|
b.key = "Home";
|
|
break;
|
|
case 37:
|
|
b.key = "Left";
|
|
break;
|
|
case 38:
|
|
b.key = "Up";
|
|
break;
|
|
case 39:
|
|
b.key = "Right";
|
|
break;
|
|
case 40:
|
|
b.key = "Down";
|
|
break;
|
|
case 45:
|
|
b.key = "Insert";
|
|
break;
|
|
case 46:
|
|
b.key = "Del";
|
|
break;
|
|
case 48:
|
|
b.key = "0";
|
|
break;
|
|
case 187:
|
|
case 61:
|
|
case 107:
|
|
b.key =
|
|
"Add";
|
|
break;
|
|
case 189:
|
|
case 173:
|
|
case 109:
|
|
b.key = "Subtract";
|
|
break;
|
|
case 27:
|
|
b.key = "Esc"
|
|
}
|
|
this.Z.doKeyDown();
|
|
return 187 !== a.which && 189 !== a.which && 48 !== a.which && 107 !== a.which && 109 !== a.which && 61 !== a.which && 173 !== a.which || !0 !== a.ctrlKey ? ha(this.Z, b, a) : (a.cancelBubble = !0, a.preventDefault(), a.stopPropagation(), !1)
|
|
};
|
|
C.prototype.pI = function(a) {
|
|
if (!this.Z.isEnabled) return !1;
|
|
var b = this.Z.Qb;
|
|
Rk(this.Z, this.Z, a, b, !1);
|
|
b.key = String.fromCharCode(a.which);
|
|
b.up = !0;
|
|
switch (a.which) {
|
|
case 8:
|
|
b.key = "Backspace";
|
|
break;
|
|
case 33:
|
|
b.key = "PageUp";
|
|
break;
|
|
case 34:
|
|
b.key = "PageDown";
|
|
break;
|
|
case 35:
|
|
b.key = "End";
|
|
break;
|
|
case 36:
|
|
b.key = "Home";
|
|
break;
|
|
case 37:
|
|
b.key = "Left";
|
|
break;
|
|
case 38:
|
|
b.key = "Up";
|
|
break;
|
|
case 39:
|
|
b.key = "Right";
|
|
break;
|
|
case 40:
|
|
b.key = "Down";
|
|
break;
|
|
case 45:
|
|
b.key = "Insert";
|
|
break;
|
|
case 46:
|
|
b.key = "Del";
|
|
break;
|
|
case 93:
|
|
a.preventDefault()
|
|
}
|
|
this.Z.doKeyUp();
|
|
return ha(this.Z, b, a)
|
|
};
|
|
C.prototype.lo = function(a) {
|
|
var b = this.Fb;
|
|
if (null === b) return new N(0, 0);
|
|
var c = this.Jb,
|
|
d = this.Ob,
|
|
b = b.getBoundingClientRect(),
|
|
c = a.clientX - c / b.width * b.left;
|
|
a = a.clientY - d / b.height * b.top;
|
|
return null !== this.Hd ? (a = new N(c, a), ub(a, this.Hd), a) : new N(c, a)
|
|
};
|
|
|
|
function Sk(a, b, c) {
|
|
var d = a.Fb,
|
|
e = a.Jb,
|
|
g = a.Ob,
|
|
h = 0,
|
|
k = 0;
|
|
null !== d && (d = d.getBoundingClientRect(), h = b.clientX - e / d.width * d.left, k = b.clientY - g / d.height * d.top);
|
|
c.te.n(h, k);
|
|
null !== a.Hd ? (b = z.Tb(h, k), a.Hd.ki(b), c.ga.assign(b), z.A(b)) : c.ga.n(h, k)
|
|
}
|
|
C.prototype.invalidateDocumentBounds = C.prototype.yc = function() {
|
|
this.Ij || (this.Ij = !0, this.Ce(!0))
|
|
};
|
|
|
|
function ck(a) {
|
|
a.Vd || Jk(a);
|
|
a.Ij && Ok(a, a.rh())
|
|
}
|
|
C.prototype.redraw = C.prototype.Sp = function() {
|
|
this.Vc || this.Vd || (this.ta(), Vk(this), Ik(this), this.yc(), this.bg())
|
|
};
|
|
C.prototype.isUpdateRequested = function() {
|
|
return this.Vf
|
|
};
|
|
C.prototype.delayInitialization = function(a) {
|
|
void 0 === a && (a = null);
|
|
var b = this.Ua,
|
|
c = b.isEnabled;
|
|
b.oi();
|
|
b.isEnabled = !1;
|
|
li(this);
|
|
this.eh = !1;
|
|
b.isEnabled = c;
|
|
null !== a && z.setTimeout(a, 1)
|
|
};
|
|
C.prototype.requestUpdate = C.prototype.Ce = function(a) {
|
|
void 0 === a && (a = !1);
|
|
if (!0 !== this.Vf && !(this.Vc || !1 === a && this.Vd)) {
|
|
this.Vf = !0;
|
|
var b = this;
|
|
requestAnimationFrame(function() {
|
|
b.Vf && b.bg()
|
|
})
|
|
}
|
|
};
|
|
C.prototype.maybeUpdate = C.prototype.bg = function() {
|
|
if (!this.io || this.Vf) this.io && (this.io = !1), li(this)
|
|
};
|
|
|
|
function Wk(a, b) {
|
|
a.Ua.nf || a.Vc || !a.im || Hk(a) || (b && Jk(a), Lk(a, !1))
|
|
}
|
|
|
|
function li(a) {
|
|
if (!a.Vd && (a.Vf = !1, null !== a.Pb)) {
|
|
a.Vd = !0;
|
|
var b = a.Ua,
|
|
c = a.SC;
|
|
if (!b.to && 0 !== c.length) {
|
|
for (var d = c.o, e = d.length, g = 0; g < e; g++) {
|
|
var h = d[g];
|
|
Yk(h, !1);
|
|
h.S()
|
|
}
|
|
c.clear()
|
|
}
|
|
c = a.jC;
|
|
0 < c.count && (c.each(function(a) {
|
|
a.dB()
|
|
}), c.clear());
|
|
d = c = !1;
|
|
b.nf && (d = !0, c = a.Bb, a.Bb = !0);
|
|
b.wc || Tj(a);
|
|
Wk(a, !1);
|
|
null !== a.td && (a.td.visible && !a.ov && (hl(a), a.ov = !0), !a.td.visible && a.ov && (a.ov = !1));
|
|
Jk(a);
|
|
e = !1;
|
|
if (!a.eh || a.Qu) a.eh ? il(a, !a.gv) : (a.Wb("Initial Layout"), !1 === b.isEnabled && b.oi(), il(a, !1)), e = !0;
|
|
a.gv = !1;
|
|
Jk(a);
|
|
a.lz || b.nf ||
|
|
ck(a);
|
|
Wk(a, !0);
|
|
e && (a.eh || jl(a), a.Ja("LayoutCompleted"));
|
|
Jk(a);
|
|
e && !a.eh && (a.eh = !0, a.Jd("Initial Layout"), a.Bb || a.pa.clear(), z.setTimeout(function() {
|
|
a.mi = !1
|
|
}, 1));
|
|
kl(a);
|
|
Sj(b);
|
|
a.ff();
|
|
d && (a.Bb = c);
|
|
a.Vd = !1
|
|
}
|
|
}
|
|
z.w(C, {
|
|
kn: null
|
|
}, function() {
|
|
return this.eh
|
|
});
|
|
|
|
function jl(a) {
|
|
var b = a.Yb.o;
|
|
a.Jf(b, b.length, a);
|
|
a.Xk !== jh ? a.scale = Mk(a, a.Xk) : a.dm !== jh ? a.scale = Mk(a, a.dm) : (b = a.$H, isFinite(b) && 0 < b && (a.scale = b));
|
|
b = a.ZH;
|
|
if (b.F()) a.position = b;
|
|
else {
|
|
b = z.O();
|
|
b.ru(a.ad, a.YH);
|
|
var c = a.xb,
|
|
c = z.yk(0, 0, c.width, c.height),
|
|
d = z.O();
|
|
d.ru(c, a.aI);
|
|
d.n(b.x - d.x, b.y - d.y);
|
|
a.position = d;
|
|
z.dc(c);
|
|
z.A(d);
|
|
z.A(b);
|
|
Wk(a, !0);
|
|
Lk(a, !0)
|
|
}
|
|
a.Ja("InitialLayoutCompleted");
|
|
hl(a)
|
|
}
|
|
|
|
function Jk(a) {
|
|
if ((a.Vd || !a.Ua.nf) && 0 !== a.qg.count)
|
|
for (var b = 0; 23 > b; b++) {
|
|
var c = a.qg.i;
|
|
if (null === c || 0 === a.qg.count) break;
|
|
a.qg = new K(O);
|
|
a.dB(c, a.qg);
|
|
u && 22 === b && z.trace("failure to validate parts")
|
|
}
|
|
}
|
|
C.prototype.dB = function(a, b) {
|
|
for (a.reset(); a.next();) {
|
|
var c = a.value;
|
|
!c.be() || c instanceof F || !c.isVisible() || (c.Ql() ? (rj(c, Infinity, Infinity), c.Lc()) : b.add(c))
|
|
}
|
|
for (a.reset(); a.next();) c = a.value, c instanceof F && c.isVisible() && ll(this, c);
|
|
for (a.reset(); a.next();) c = a.value, c instanceof G && c.isVisible() && (c.Ql() ? (rj(c, Infinity, Infinity), c.Lc()) : b.add(c));
|
|
for (a.reset(); a.next();) c = a.value, c instanceof da && c.isVisible() && (c.Ql() ? (rj(c, Infinity, Infinity), c.Lc()) : b.add(c))
|
|
};
|
|
|
|
function ll(a, b) {
|
|
for (var c = z.rb(), d = z.rb(), e = b.Hc; e.next();) {
|
|
var g = e.value;
|
|
g.isVisible() && (g instanceof F ? (ml(g) || nl(g) || ol(g)) && ll(a, g) : g instanceof G ? g.Y === b || g.da === b ? d.push(g) : c.push(g) : (rj(g, Infinity, Infinity), g.Lc()))
|
|
}
|
|
for (var e = c.length, h = 0; h < e; h++) g = c[h], rj(g, Infinity, Infinity), g.Lc();
|
|
z.xa(c);
|
|
rj(b, Infinity, Infinity);
|
|
b.Lc();
|
|
e = d.length;
|
|
for (h = 0; h < e; h++) g = d[h], rj(g, Infinity, Infinity), g.Lc();
|
|
z.xa(d)
|
|
}
|
|
C.prototype.Jf = function(a, b, c, d) {
|
|
var e = this.Ua;
|
|
if (this.Yk || e.nf)
|
|
for (e = 0; e < b; e++) a[e].Jf(c, d)
|
|
};
|
|
C.prototype.ff = function(a, b) {
|
|
void 0 === a && (a = this.gd);
|
|
void 0 === b && (b = null);
|
|
null === this.Pb && z.k("No div specified");
|
|
var c = this.Fb;
|
|
null === c && z.k("No canvas specified");
|
|
var d = this.Ua;
|
|
if (!d.wc && (pl(this), "0" !== this.Pb.style.opacity)) {
|
|
var e = a !== this.gd,
|
|
g = this.Yb.o,
|
|
h = g.length,
|
|
k = this;
|
|
this.Jf(g, h, k);
|
|
if (e) ca(a, !0), Ik(this);
|
|
else if (!this.ue && null === b && !d.Jj) return;
|
|
var h = this.sb,
|
|
l = this.bc,
|
|
m = Math.round(h.x * l) / l,
|
|
n = Math.round(h.y * l) / l,
|
|
d = this.Hd;
|
|
d.reset();
|
|
1 !== l && d.scale(l);
|
|
0 === h.x && 0 === h.y || d.translate(-m, -n);
|
|
l =
|
|
this.jd;
|
|
z.jn ? (c.width = c.width, ca(a, !0), a.scale(l, l)) : (a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.clearRect(0, 0, this.Jb, this.Ob));
|
|
a.setTransform(1, 0, 0, 1, 0, 0);
|
|
a.scale(l, l);
|
|
a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
|
|
u && u.bj && u.lE(this, a);
|
|
c = null !== b ? function(c) {
|
|
var d = a,
|
|
e = b;
|
|
if (c.visible && 0 !== c.Xc) {
|
|
var g = c.mb.o,
|
|
h = g.length;
|
|
if (0 !== h) {
|
|
1 !== c.Xc && (d.globalAlpha = c.Xc);
|
|
c = c.Wv;
|
|
c.length = 0;
|
|
for (var l = k.scale, m = 0; m < h; m++) {
|
|
var n = g[m];
|
|
if (hk(n) && !e.contains(n)) {
|
|
if (n instanceof G) {
|
|
var A = n;
|
|
A.rc && c.push(A);
|
|
if (!1 === A.Cg) continue
|
|
}
|
|
A =
|
|
n.W;
|
|
1 < A.width * l || 1 < A.height * l ? n.ff(d, k) : jk(n, d)
|
|
}
|
|
}
|
|
d.globalAlpha = 1
|
|
}
|
|
}
|
|
} : function(b) {
|
|
b.ff(a, k)
|
|
};
|
|
ql(this, a);
|
|
h = g.length;
|
|
for (m = 0; m < h; m++) a.setTransform(1, 0, 0, 1, 0, 0), a.scale(l, l), a.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c(g[m]);
|
|
this.Wk ? this.Wk.Zl(this) && this.Dy() : this.lo = function() {
|
|
return new N(0, 0)
|
|
};
|
|
u && (u.Rz || u.bj) && u.Qz(a, this, d);
|
|
e ? (ca(this.gd, !0), Ik(this)) : this.ue = this.Yk = !1
|
|
}
|
|
};
|
|
|
|
function rl(a, b, c, d, e) {
|
|
null === a.Pb && z.k("No div specified");
|
|
var g = a.Fb;
|
|
null === g && z.k("No canvas specified");
|
|
if (!a.Ua.wc) {
|
|
var h = a.gd;
|
|
if (a.ue) {
|
|
pl(a);
|
|
var k = a.jd;
|
|
z.jn ? (g.width = g.width, ca(h, !0)) : (h.setTransform(1, 0, 0, 1, 0, 0), h.clearRect(0, 0, a.Jb * k, a.Ob * k));
|
|
h.Jt = !1;
|
|
h.drawImage(a.Cy.Kd, 0 < d ? 0 : Math.round(-d), 0 < e ? 0 : Math.round(-e));
|
|
e = a.sb;
|
|
var g = a.bc,
|
|
l = Math.round(e.x * g) / g,
|
|
m = Math.round(e.y * g) / g;
|
|
d = a.Hd;
|
|
d.reset();
|
|
1 !== g && d.scale(g);
|
|
0 === e.x && 0 === e.y || d.translate(-l, -m);
|
|
h.save();
|
|
h.beginPath();
|
|
e = c.length;
|
|
for (g = 0; g < e; g++) l =
|
|
c[g], 0 !== l.width && 0 !== l.height && h.rect(Math.floor(l.x), Math.floor(l.y), Math.ceil(l.width), Math.ceil(l.height));
|
|
h.clip();
|
|
h.setTransform(1, 0, 0, 1, 0, 0);
|
|
h.scale(k, k);
|
|
h.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
|
|
u && u.bj && u.lE(a, h);
|
|
c = a.Yb.o;
|
|
e = c.length;
|
|
a.Jf(c, e, a);
|
|
ql(a, h);
|
|
for (g = 0; g < e; g++) kk(c[g], h, a, b);
|
|
h.restore();
|
|
ca(h, !0);
|
|
u && (u.Rz || u.bj) && u.Qz(h, a, d);
|
|
a.Wk ? a.Wk.Zl(a) && a.Dy() : a.lo = function() {
|
|
return new N(0, 0)
|
|
};
|
|
a.Yk = !1;
|
|
a.ue = !1;
|
|
a.HA()
|
|
}
|
|
}
|
|
}
|
|
|
|
function sl(a, b, c, d, e, g, h, k, l, m) {
|
|
null === a.Pb && z.k("No div specified");
|
|
null === a.Fb && z.k("No canvas specified");
|
|
void 0 === h && (h = null);
|
|
void 0 === k && (k = null);
|
|
void 0 === l && (l = !1);
|
|
void 0 === m && (m = !1);
|
|
pl(a);
|
|
ca(a.gd, !0);
|
|
Ik(a);
|
|
a.Sy = !0;
|
|
var n = new w(g.x, g.y, d.width / e, d.height / e),
|
|
p = n.copy();
|
|
p.Cw(c);
|
|
hl(a, p);
|
|
Jk(a);
|
|
var p = a.Yb.o,
|
|
q = p.length;
|
|
a.Jf(p, q, a, n);
|
|
n = a.jd;
|
|
b.setTransform(1, 0, 0, 1, 0, 0);
|
|
b.scale(n, n);
|
|
b.clearRect(0, 0, d.width, d.height);
|
|
null !== k && "" !== k && (b.fillStyle = k, b.fillRect(0, 0, d.width, d.height));
|
|
d = z.Fh();
|
|
d.reset();
|
|
d.translate(c.left, c.top);
|
|
d.scale(e);
|
|
0 === g.x && 0 === g.y || d.translate(-g.x, -g.y);
|
|
b.setTransform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy);
|
|
z.jf(d);
|
|
ql(a, b);
|
|
if (null !== h) {
|
|
var r = new K(O);
|
|
c = h.i;
|
|
for (c.reset(); c.next();) e = c.value, !1 === m && "Grid" === e.layer.name || null === e || r.add(e);
|
|
c = function(c) {
|
|
var d = l;
|
|
if (c.visible && 0 !== c.Xc && (void 0 === d && (d = !0), d || !c.Nc)) {
|
|
var d = c.mb.o,
|
|
e = d.length;
|
|
if (0 !== e) {
|
|
1 !== c.Xc && (b.globalAlpha = c.Xc);
|
|
c = c.Wv;
|
|
c.length = 0;
|
|
for (var g = a.scale, h = 0; h < e; h++) {
|
|
var k = d[h];
|
|
if (hk(k) && r.contains(k)) {
|
|
if (k instanceof G) {
|
|
var m = k;
|
|
m.rc && c.push(m);
|
|
if (!1 === m.Cg) continue
|
|
}
|
|
m = k.W;
|
|
1 < m.width * g || 1 < m.height * g ? k.ff(b, a) : jk(k, b)
|
|
}
|
|
}
|
|
b.globalAlpha = 1
|
|
}
|
|
}
|
|
}
|
|
} else if (!l && m) {
|
|
var s = a.Gt.ca,
|
|
t = s.layer;
|
|
c = function(c) {
|
|
c === t ? s.ff(b, a) : c.ff(b, a, l, m)
|
|
}
|
|
} else c = function(c) {
|
|
c.ff(b, a, l, m)
|
|
};
|
|
for (e = 0; e < q; e++) c(p[e]);
|
|
a.Sy = !1;
|
|
a.Wk ? a.Wk.Zl(a) && a.Dy() : a.lo = function() {
|
|
return new N(0, 0)
|
|
};
|
|
ca(a.gd, !0);
|
|
Ik(a);
|
|
a.Jf(p, q, a);
|
|
hl(a)
|
|
}
|
|
C.prototype.getRenderingHint = C.prototype.hj = function(a) {
|
|
return this.Xj[a]
|
|
};
|
|
C.prototype.setRenderingHint = C.prototype.kJ = function(a, b) {
|
|
this.Xj[a] = b;
|
|
this.Sp()
|
|
};
|
|
C.prototype.resetRenderingHints = C.prototype.rF = function() {
|
|
this.Xj = new ma;
|
|
this.Xj.drawShadows = !0;
|
|
this.Xj.textGreeking = !0;
|
|
this.Xj.viewportOptimizations = z.PE ? !1 : !0;
|
|
this.Xj.temporaryPixelRatio = !0;
|
|
this.Xj.pictureRatioOptimization = !0
|
|
};
|
|
|
|
function ql(a, b) {
|
|
var c = a.Xj;
|
|
if (null !== c) {
|
|
if (void 0 !== c.imageSmoothingEnabled) {
|
|
var d = !!c.imageSmoothingEnabled;
|
|
b.Jt = d;
|
|
b.YK = d
|
|
}
|
|
c = c.defaultFont;
|
|
void 0 !== c && null !== c && (b.font = c)
|
|
}
|
|
}
|
|
C.prototype.getInputOption = C.prototype.sp = function(a) {
|
|
return this.qo[a]
|
|
};
|
|
C.prototype.setInputOption = function(a, b) {
|
|
this.qo[a] = b
|
|
};
|
|
C.prototype.resetInputOptions = C.prototype.qF = function() {
|
|
this.qo = new ma;
|
|
this.qo.extraTouchArea = 10;
|
|
this.qo.extraTouchThreshold = 10;
|
|
this.qo.hasGestureZoom = !0
|
|
};
|
|
C.prototype.setProperties = function(a) {
|
|
z.qu(this, a)
|
|
};
|
|
|
|
function kl(a) {
|
|
if (0 === a.pa.Gh && 0 !== a.Rk.count) {
|
|
for (; 0 < a.Rk.count;) {
|
|
var b = a.Rk;
|
|
a.Rk = new na(G, w);
|
|
for (b = b.i; b.next();) {
|
|
var c = b.key;
|
|
Oi(c, b.value);
|
|
c.Ae()
|
|
}
|
|
}
|
|
a.ta()
|
|
}
|
|
}
|
|
C.prototype.ta = function(a) {
|
|
void 0 === a && (a = null);
|
|
if (null === a) this.ue = !0, this.Ce();
|
|
else {
|
|
var b = this.xb;
|
|
null !== a && a.F() && b.Ig(a) && (this.ue = !0, this.Ce())
|
|
}
|
|
for (b = this.Xv.i; b.next();) b.value.ta(a)
|
|
};
|
|
C.prototype.HE = function(a, b) {
|
|
if (!0 !== this.ue) {
|
|
this.ue = !0;
|
|
var c = !0 === this.hj("temporaryPixelRatio");
|
|
if (!0 === this.hj("viewportOptimizations") && this.MA !== tl && this.BF.Vw(0, 0, 0, 0) && b.width === a.width && b.height === a.height) {
|
|
var d = this.scale,
|
|
e = z.kg(),
|
|
g = Math.max(a.x, b.x),
|
|
h = Math.max(a.y, b.y),
|
|
k = Math.min(a.x + a.width, b.x + b.width),
|
|
l = Math.min(a.y + a.height, b.y + b.height);
|
|
e.x = g;
|
|
e.y = h;
|
|
e.width = Math.max(0, k - g) * d;
|
|
e.height = Math.max(0, l - h) * d;
|
|
if (0 < e.width && 0 < e.height) {
|
|
if (!this.Vd && (this.Vf = !1, null !== this.Pb)) {
|
|
this.Vd = !0;
|
|
kl(this);
|
|
this.ad.F() || Ok(this, this.rh());
|
|
var m = this.Fb;
|
|
if (null !== m) {
|
|
var n = this.jd,
|
|
h = this.Jb * n,
|
|
k = this.Ob * n,
|
|
g = this.scale * n,
|
|
d = Math.round(Math.round(b.x * g) - Math.round(a.x * g)),
|
|
g = Math.round(Math.round(b.y * g) - Math.round(a.y * g)),
|
|
l = this.Cy,
|
|
p = this.aC;
|
|
l.width !== h && (l.width = h);
|
|
l.height !== k && (l.height = k);
|
|
p.clearRect(0, 0, h, k);
|
|
var l = 190 * this.jd,
|
|
q = 70 * this.jd,
|
|
r = Math.max(d, 0),
|
|
s = Math.max(g, 0),
|
|
t = Math.floor(h - r),
|
|
v = Math.floor(k - s);
|
|
p.Jt = !1;
|
|
p.drawImage(m.Kd, r, s, t, v, 0, 0, t, v);
|
|
this.Wk.Zl(this) && p.clearRect(0, 0, l, q);
|
|
var m = z.rb(),
|
|
p = z.rb(),
|
|
v = Math.abs(d),
|
|
t = Math.abs(g),
|
|
x = 0 === r ? 0 : h - v,
|
|
r = z.Tb(x, 0),
|
|
v = z.Tb(v + x, k);
|
|
p.push(new w(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y)));
|
|
var y = this.Hd;
|
|
y.reset();
|
|
y.scale(n, n);
|
|
1 !== this.bc && y.scale(this.bc);
|
|
n = this.sb;
|
|
(0 !== n.x || 0 !== n.y) && isFinite(n.x) && isFinite(n.y) && y.translate(-n.x, -n.y);
|
|
ub(r, y);
|
|
ub(v, y);
|
|
m.push(new w(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y)));
|
|
x = 0 === s ? 0 : k - t;
|
|
r.n(0, x);
|
|
v.n(h, t + x);
|
|
p.push(new w(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x -
|
|
v.x), Math.abs(r.y - v.y)));
|
|
ub(r, y);
|
|
ub(v, y);
|
|
m.push(new w(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y)));
|
|
this.Wk.Zl(this) && (h = 0 < d ? 0 : -d, k = 0 < g ? 0 : -g, r.n(h, k), v.n(l + h, q + k), p.push(new w(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y))), ub(r, y), ub(v, y), m.push(new w(Math.min(r.x, v.x), Math.min(r.y, v.y), Math.abs(r.x - v.x), Math.abs(r.y - v.y))));
|
|
z.A(r);
|
|
z.A(v);
|
|
Wk(this, !1);
|
|
rl(this, m, p, d, g);
|
|
z.xa(m);
|
|
z.xa(p);
|
|
this.Vd = !1
|
|
}
|
|
}
|
|
} else this.bg();
|
|
z.dc(e);
|
|
c && (this.ck = 1, this.bg(),
|
|
this.ck = null, this.HA())
|
|
} else c ? (this.ck = 1, this.bg(), this.ck = null, this.HA()) : this.bg()
|
|
}
|
|
};
|
|
|
|
function Vk(a) {
|
|
!1 === a.im && (a.im = !0)
|
|
}
|
|
|
|
function Ik(a) {
|
|
!1 === a.Yk && (a.Yk = !0)
|
|
}
|
|
|
|
function pl(a) {
|
|
!1 !== a.gr && (a.gr = !1, ul(a, a.Jb, a.Ob))
|
|
}
|
|
|
|
function ul(a, b, c) {
|
|
var d = a.Fb,
|
|
e = a.jd,
|
|
g = b * e,
|
|
e = c * e;
|
|
if (d.width !== g || d.height !== e) d.width = g, d.height = e, d.style.width = b + "px", d.style.height = c + "px", a.ue = !0, ca(a.gd, !0)
|
|
}
|
|
|
|
function Bh(a) {
|
|
var b = a.Jb,
|
|
c = a.Ob;
|
|
a = a.Fb.getBoundingClientRect();
|
|
return z.Tb(b / a.width * a.left, c / a.height * a.top)
|
|
}
|
|
|
|
function Hk(a) {
|
|
var b = a.Fb;
|
|
if (null === b) return !0;
|
|
var c = a.Pb,
|
|
d = a.Jb,
|
|
e = a.Ob,
|
|
g = a.wD.copy();
|
|
if (!g.F()) return !0;
|
|
var h = !1,
|
|
k = a.Vk ? a.Gd : 0,
|
|
l = a.Hj ? a.Gd : 0,
|
|
m = c.clientWidth || d + k,
|
|
c = c.clientHeight || e + l;
|
|
if (m !== d + k || c !== e + l) a.Vk = !1, a.Hj = !1, l = k = 0, a.Jb = m, a.Ob = c, h = a.gr = !0;
|
|
a.im = !1;
|
|
var n = a.xb,
|
|
p = a.ad,
|
|
m = p.width,
|
|
c = p.height,
|
|
q = n.width,
|
|
r = n.height,
|
|
s = p.x,
|
|
t = n.x,
|
|
v = p.right,
|
|
x = n.right + k,
|
|
y = p.y,
|
|
A = n.y,
|
|
p = p.bottom,
|
|
n = n.bottom + l,
|
|
B = "1px",
|
|
L = "1px",
|
|
H = a.scale;
|
|
a.MA === qk && m < q + k && c < r + l || (a.cA && a.xe && (B = 1, s + 1 < t && (B = Math.max((t - s) * H + a.Jb, B)), v > x + 1 &&
|
|
(B = Math.max((v - x) * H + a.Jb, B)), q + k + 1 < m && (B = Math.max((m - q + k) * H + a.Jb, B)), B += "px"), a.dA && a.ye && (L = 1, y + 1 < A && (L = Math.max((A - y) * H + a.Ob, L)), p > n + 1 && (L = Math.max((p - n) * H + a.Ob, L)), r + l + 1 < c && (L = Math.max((c - r + l) * H + a.Ob, L)), L += "px"));
|
|
k = "1px" !== B;
|
|
l = "1px" !== L;
|
|
k && l || !k && !l || (l && (x -= a.Gd), k && (n -= a.Gd), a.cA && a.xe && (B = 1, s + 1 < t && (B = Math.max((t - s) * H + a.Jb, B)), v > x + 1 && (B = Math.max((v - x) * H + a.Jb, B)), q + 1 < m && (B = Math.max((m - q) * H + a.Jb, B)), B += "px"), k = "1px" !== B, l = k !== a.Hj ? a.Ob - a.Gd : a.Ob, a.dA && a.ye && (L = 1, y + 1 < A && (L = Math.max((A - y) * H + l, L)),
|
|
p > n + 1 && (L = Math.max((p - n) * H + l, L)), r + 1 < c && (L = Math.max((c - r) * H + l, L)), L += "px"), l = "1px" !== L);
|
|
if (a.gw && k === a.Hj && l === a.Vk) return d === a.Jb && e === a.Ob || a.bg(), !1;
|
|
k !== a.Hj && (a.Ob = "1px" === B ? a.Ob + a.Gd : Math.max(a.Ob - a.Gd, 1), h = !0);
|
|
a.Hj = k;
|
|
a.xs.style.width = B;
|
|
l !== a.Vk && (a.Jb = "1px" === L ? a.Jb + a.Gd : Math.max(a.Jb - a.Gd, 1), h = !0, a.mr && (k = z.O(), l ? (b.style.left = a.Gd + "px", a.position = k.n(a.sb.x + a.Gd / a.scale, a.sb.y)) : (b.style.left = "0px", a.position = k.n(a.sb.x - a.Gd / a.scale, a.sb.y)), z.A(k)));
|
|
a.Vk = l;
|
|
a.xs.style.height = L;
|
|
b = a.kw;
|
|
k = b.scrollLeft;
|
|
a.cA && a.xe && (q + 1 < m ? k = (a.position.x - s) * H : s + 1 < t ? k = b.scrollWidth - b.clientWidth : v > x + 1 && (k = a.position.x * H));
|
|
if (a.mr) switch (a.hz) {
|
|
case "negative":
|
|
k = -(b.scrollWidth - k - b.clientWidth);
|
|
break;
|
|
case "reverse":
|
|
k = b.scrollWidth - k - b.clientWidth
|
|
}
|
|
b.scrollLeft = k;
|
|
a.dA && a.ye && (r + 1 < c ? b.scrollTop = (a.position.y - y) * H : y + 1 < A ? b.scrollTop = b.scrollHeight - b.clientHeight : p > n + 1 && (b.scrollTop = a.position.y * H));
|
|
h && (a.gr = !0);
|
|
m = a.Jb;
|
|
c = a.Ob;
|
|
b.style.width = m + (a.Vk ? a.Gd : 0) + "px";
|
|
b.style.height = c + (a.Hj ? a.Gd : 0) + "px";
|
|
a.iz = !1;
|
|
return d !== m || e !==
|
|
c || a.Ua.wc ? (n = a.xb, a.fu(g, n, h), !1) : !0
|
|
}
|
|
C.prototype.add = C.prototype.add = function(a) {
|
|
z.l(a, D, C, "add:part");
|
|
var b = a.h;
|
|
if (b !== this) {
|
|
null !== b && z.k("Cannot add part " + a.toString() + " to " + this.toString() + ". It is already a part of " + b.toString());
|
|
this.lq && (a.cl = "Tool");
|
|
var c = a.If,
|
|
b = this.Fl(c);
|
|
null === b && (b = this.Fl(""));
|
|
null === b && z.k('Cannot add a Part when unable find a Layer named "' + c + '" and there is no default Layer');
|
|
a.layer !== b && (c = b.xp(99999999, a, a.h === this), 0 <= c && this.Rc(Uf, "parts", b, null, a, null, c), b.Nc || this.yc(), a.I(vl), c = a.Ut, null !==
|
|
c && c(a, null, b))
|
|
}
|
|
};
|
|
C.prototype.xp = function(a) {
|
|
if (a instanceof E) {
|
|
if (this.Fo.add(a), a instanceof F) {
|
|
var b = a.Va;
|
|
null === b ? this.ol.add(a) : b.wm.add(a);
|
|
b = a.Sb;
|
|
null !== b && (b.h = this)
|
|
}
|
|
} else a instanceof G ? this.zo.add(a) : a instanceof da || this.mb.add(a);
|
|
var c = this;
|
|
wl(a, function(a) {
|
|
xl(c, a)
|
|
});
|
|
a.Lb && a.S();
|
|
b = a.data;
|
|
null !== b && (a instanceof da || (a instanceof G ? this.Qk.add(b, a) : this.zi.add(b, a)), wl(a, function(a) {
|
|
yl(c, a)
|
|
}));
|
|
!0 !== nl(a) && !0 !== ol(a) || this.qg.add(a);
|
|
zl(a, !0, this);
|
|
Al(a) ? (a.W.F() && this.ta(lk(a, a.W)), this.yc()) : a.isVisible() &&
|
|
a.W.F() && this.ta(lk(a, a.W));
|
|
this.Ce()
|
|
};
|
|
C.prototype.Ve = function(a) {
|
|
a.pt();
|
|
if (a instanceof E) {
|
|
if (this.Fo.remove(a), a instanceof F) {
|
|
var b = a.Va;
|
|
null === b ? this.ol.remove(a) : b.wm.remove(a);
|
|
b = a.Sb;
|
|
null !== b && (b.h = null)
|
|
}
|
|
} else a instanceof G ? this.zo.remove(a) : a instanceof da || this.mb.remove(a);
|
|
var c = this;
|
|
wl(a, function(a) {
|
|
Bl(c, a)
|
|
});
|
|
b = a.data;
|
|
null !== b && (a instanceof da || (a instanceof G ? this.Qk.remove(b) : this.zi.remove(b)), wl(a, function(a) {
|
|
Cl(c, a)
|
|
}));
|
|
this.qg.remove(a);
|
|
Al(a) ? (a.W.F() && this.ta(lk(a, a.W)), this.yc()) : a.isVisible() && a.W.F() && this.ta(lk(a,
|
|
a.W));
|
|
this.Ce()
|
|
};
|
|
C.prototype.remove = C.prototype.remove = function(a) {
|
|
z.l(a, D, C, "remove:part");
|
|
a.kb = !1;
|
|
a.wh = !1;
|
|
var b = a.layer;
|
|
if (null !== b && b.h === this) {
|
|
a.I(Dl);
|
|
a.cn();
|
|
var c = b.Ve(-1, a, !1);
|
|
0 <= c && this.Rc(Vf, "parts", b, a, null, c, null);
|
|
c = a.Ut;
|
|
null !== c && c(a, b, null)
|
|
}
|
|
};
|
|
C.prototype.removeParts = C.prototype.JA = function(a, b) {
|
|
if (z.isArray(a))
|
|
for (var c = z.bb(a), d = 0; d < c; d++) {
|
|
var e = z.Ya(a, d);
|
|
b && !e.canDelete() || this.remove(e)
|
|
} else
|
|
for (e = new K(D), e.$c(a), c = e.i; c.next();) e = c.value, b && !e.canDelete() || this.remove(e)
|
|
};
|
|
C.prototype.copyParts = C.prototype.hp = function(a, b, c) {
|
|
return this.wb.hp(a, b, c)
|
|
};
|
|
C.prototype.moveParts = C.prototype.moveParts = function(a, b, c) {
|
|
z.l(b, N, C, "moveParts:offset");
|
|
var d = this.hb;
|
|
if (null !== d) {
|
|
d = d.me;
|
|
null === d && (d = new ih, d.Sc(this));
|
|
var e = new na(D, Object);
|
|
if (null !== a) a = a.i;
|
|
else {
|
|
for (a = this.ni; a.next();) Kh(d, e, a.value, c);
|
|
for (a = this.Lg; a.next();) Kh(d, e, a.value, c);
|
|
a = this.links
|
|
}
|
|
for (; a.next();) Kh(d, e, a.value, c);
|
|
d.moveParts(e, b, c)
|
|
}
|
|
};
|
|
|
|
function El(a, b, c) {
|
|
z.l(b, tg, C, "addLayer:layer");
|
|
null !== b.h && b.h !== a && z.k("Cannot share a Layer with another Diagram: " + b + " of " + b.h);
|
|
null === c ? null !== b.h && z.k("Cannot add an existing Layer to this Diagram again: " + b) : (z.l(c, tg, C, "addLayer:existingLayer"), c.h !== a && z.k("Existing Layer must be in this Diagram: " + c + " not in " + c.h), b === c && z.k("Cannot move a Layer before or after itself: " + b));
|
|
if (b.h !== a) {
|
|
b = b.name;
|
|
a = a.Yb;
|
|
c = a.count;
|
|
for (var d = 0; d < c; d++) a.ea(d).name === b && z.k("Cannot add Layer with the name '" +
|
|
b + "'; a Layer with the same name is already present in this Diagram.")
|
|
}
|
|
}
|
|
C.prototype.addLayer = C.prototype.ft = function(a) {
|
|
El(this, a, null);
|
|
a.Sc(this);
|
|
var b = this.Yb,
|
|
c = b.count - 1;
|
|
if (!a.Nc)
|
|
for (; 0 <= c && b.ea(c).Nc;) c--;
|
|
b.Ld(c + 1, a);
|
|
null !== this.ie && this.Rc(Uf, "layers", this, null, a, null, c + 1);
|
|
this.ta();
|
|
this.yc()
|
|
};
|
|
C.prototype.addLayerBefore = C.prototype.OG = function(a, b) {
|
|
El(this, a, b);
|
|
a.Sc(this);
|
|
var c = this.Yb,
|
|
d = c.indexOf(a);
|
|
0 <= d && (c.remove(a), null !== this.ie && this.Rc(Vf, "layers", this, a, null, d, null));
|
|
for (var e = c.count, g = 0; g < e; g++)
|
|
if (c.ea(g) === b) {
|
|
c.Ld(g, a);
|
|
break
|
|
}
|
|
null !== this.ie && this.Rc(Uf, "layers", this, null, a, null, g);
|
|
this.ta();
|
|
0 > d && this.yc()
|
|
};
|
|
C.prototype.addLayerAfter = function(a, b) {
|
|
El(this, a, b);
|
|
a.Sc(this);
|
|
var c = this.Yb,
|
|
d = c.indexOf(a);
|
|
0 <= d && (c.remove(a), null !== this.ie && this.Rc(Vf, "layers", this, a, null, d, null));
|
|
for (var e = c.count, g = 0; g < e; g++)
|
|
if (c.ea(g) === b) {
|
|
c.Ld(g + 1, a);
|
|
break
|
|
}
|
|
null !== this.ie && this.Rc(Uf, "layers", this, null, a, null, g + 1);
|
|
this.ta();
|
|
0 > d && this.yc()
|
|
};
|
|
C.prototype.removeLayer = function(a) {
|
|
z.l(a, tg, C, "removeLayer:layer");
|
|
a.h !== this && z.k("Cannot remove a Layer from another Diagram: " + a + " of " + a.h);
|
|
if ("" !== a.name) {
|
|
var b = this.Yb,
|
|
c = b.indexOf(a);
|
|
if (b.remove(a)) {
|
|
for (b = a.mb.copy().i; b.next();) {
|
|
var d = b.value,
|
|
e = d.If;
|
|
d.If = e !== a.name ? e : ""
|
|
}
|
|
null !== this.ie && this.Rc(Vf, "layers", this, a, null, c, null);
|
|
this.ta();
|
|
this.yc()
|
|
}
|
|
}
|
|
};
|
|
C.prototype.findLayer = C.prototype.Fl = function(a) {
|
|
for (var b = this.mn; b.next();) {
|
|
var c = b.value;
|
|
if (c.name === a) return c
|
|
}
|
|
return null
|
|
};
|
|
C.prototype.addModelChangedListener = C.prototype.QG = function(a) {
|
|
z.g(a, "function", C, "addModelChangedListener:listener");
|
|
null === this.gh && (this.gh = new J("function"));
|
|
this.gh.add(a);
|
|
this.ha.Rm(a)
|
|
};
|
|
C.prototype.removeModelChangedListener = function(a) {
|
|
z.g(a, "function", C, "removeModelChangedListener:listener");
|
|
null !== this.gh && (this.gh.remove(a), 0 === this.gh.count && (this.gh = null));
|
|
this.ha.iu(a)
|
|
};
|
|
C.prototype.addChangedListener = C.prototype.Rm = function(a) {
|
|
z.g(a, "function", C, "addChangedListener:listener");
|
|
null === this.ti && (this.ti = new J("function"));
|
|
this.ti.add(a)
|
|
};
|
|
C.prototype.removeChangedListener = C.prototype.iu = function(a) {
|
|
z.g(a, "function", C, "removeChangedListener:listener");
|
|
null !== this.ti && (this.ti.remove(a), 0 === this.ti.count && (this.ti = null))
|
|
};
|
|
C.prototype.Kw = function(a) {
|
|
this.Bb || this.pa.DE(a);
|
|
a.Dc !== Tf && (this.mi = !0);
|
|
if (null !== this.ti) {
|
|
var b = this.ti,
|
|
c = b.length;
|
|
if (1 === c) b = b.ea(0), b(a);
|
|
else if (0 !== c)
|
|
for (var d = b.jc(), e = 0; e < c; e++) b = d[e], b(a)
|
|
}
|
|
};
|
|
C.prototype.raiseChangedEvent = C.prototype.Rc = function(a, b, c, d, e, g, h) {
|
|
void 0 === g && (g = null);
|
|
void 0 === h && (h = null);
|
|
var k = new Rf;
|
|
k.h = this;
|
|
k.Dc = a;
|
|
k.propertyName = b;
|
|
k.object = c;
|
|
k.oldValue = d;
|
|
k.Mg = g;
|
|
k.newValue = e;
|
|
k.Kg = h;
|
|
this.Kw(k)
|
|
};
|
|
C.prototype.raiseChanged = C.prototype.j = function(a, b, c, d, e) {
|
|
this.Rc(Sf, a, this, b, c, d, e)
|
|
};
|
|
z.w(C, {
|
|
Ua: "animationManager"
|
|
}, function() {
|
|
return this.sB
|
|
});
|
|
z.w(C, {
|
|
pa: "undoManager"
|
|
}, function() {
|
|
return this.ie.pa
|
|
});
|
|
z.defineProperty(C, {
|
|
Bb: "skipsUndoManager"
|
|
}, function() {
|
|
return this.Vi
|
|
}, function(a) {
|
|
z.g(a, "boolean", C, "skipsUndoManager");
|
|
this.Vi = a;
|
|
this.ie.Vi = a
|
|
});
|
|
z.defineProperty(C, {
|
|
Oz: "delaysLayout"
|
|
}, function() {
|
|
return this.yy
|
|
}, function(a) {
|
|
this.yy = a
|
|
});
|
|
C.prototype.Vm = function(a, b) {
|
|
if (null !== a && a.h === this) {
|
|
var c = this.Ee;
|
|
try {
|
|
this.Ee = !0;
|
|
var d = a.Dc,
|
|
e;
|
|
if (d === Sf) {
|
|
var g = a.object,
|
|
h = a.propertyName,
|
|
k = a.na(b);
|
|
z.Ra(g, h, k);
|
|
if (g instanceof O) {
|
|
var l, m = g.ca;
|
|
null !== m && m.ae()
|
|
}
|
|
this.mi = !0
|
|
} else if (d === Uf) {
|
|
var n = a.object,
|
|
p = a.Kg,
|
|
g = a.newValue;
|
|
if (n instanceof I)
|
|
if ("number" === typeof p && g instanceof O) {
|
|
l = g;
|
|
var q = n;
|
|
b ? q.Ve(p) : q.Ld(p, l);
|
|
m = n.ca;
|
|
null !== m && m.ae()
|
|
} else {
|
|
if ("number" === typeof p && g instanceof Fg) {
|
|
var r = g,
|
|
q = n;
|
|
b ? r.qe ? q.pF(p) : q.lF(p) : (e = r.qe ? q.$d(r.index) : q.Zd(r.index),
|
|
e.tt(r))
|
|
}
|
|
}
|
|
else if (n instanceof tg) {
|
|
var s = !0 === a.Mg;
|
|
if ("number" === typeof p && g instanceof D) {
|
|
var m = g,
|
|
t = n;
|
|
b ? (m.ae(), t.Ve(s ? p : -1, m, s)) : t.xp(p, m, s)
|
|
}
|
|
} else if (n instanceof C) {
|
|
if ("number" === typeof p && g instanceof tg) {
|
|
var v = g;
|
|
b ? this.Yb.dd(p) : (d = v, d.Sc(this), this.Yb.Ld(p, d))
|
|
}
|
|
} else z.k("unknown ChangedEvent.Insert object: " + a.toString());
|
|
this.mi = !0
|
|
} else d === Vf ? (n = a.object, p = a.Mg, g = a.oldValue, n instanceof I ? "number" === typeof p && g instanceof O ? (q = n, b ? q.Ld(p, g) : q.Ve(p)) : "number" === typeof p && g instanceof Fg && (r =
|
|
g, q = n, b ? (e = r.qe ? q.$d(r.index) : q.Zd(r.index), e.tt(r)) : r.qe ? q.pF(p) : q.lF(p)) : n instanceof tg ? (s = !0 === a.Kg, "number" === typeof p && g instanceof D && (m = g, t = n, b ? t.xp(p, m, s) : (m.ae(), t.Ve(s ? p : -1, m, s)))) : n instanceof C ? "number" === typeof p && g instanceof tg && (v = g, b ? (d = v, d.Sc(this), this.Yb.Ld(p, d)) : this.Yb.dd(p)) : z.k("unknown ChangedEvent.Remove object: " + a.toString()), this.mi = !0) : d !== Tf && z.k("unknown ChangedEvent: " + a.toString())
|
|
} finally {
|
|
this.Ee = c
|
|
}
|
|
}
|
|
};
|
|
C.prototype.startTransaction = C.prototype.Wb = function(a) {
|
|
return this.pa.Wb(a)
|
|
};
|
|
C.prototype.commitTransaction = C.prototype.Jd = function(a) {
|
|
return this.pa.Jd(a)
|
|
};
|
|
C.prototype.rollbackTransaction = C.prototype.Vp = function() {
|
|
return this.pa.Vp()
|
|
};
|
|
C.prototype.updateAllTargetBindings = C.prototype.eG = function(a) {
|
|
void 0 === a && (a = "");
|
|
for (var b = this.ni; b.next();) b.value.Mb(a);
|
|
for (b = this.Lg; b.next();) b.value.Mb(a);
|
|
for (b = this.links; b.next();) b.value.Mb(a)
|
|
};
|
|
C.prototype.updateAllRelationshipsFromData = C.prototype.BJ = function() {
|
|
if (0 < arguments.length) {
|
|
for (var a = this.ha, b = new K, c = a.gg, d = 0; d < c.length; d++) {
|
|
var e = c[d];
|
|
b.add(e)
|
|
}
|
|
var g = [];
|
|
this.Lg.each(function(a) {
|
|
null === a.data || b.contains(a.data) || g.push(a.data)
|
|
});
|
|
this.ni.each(function(a) {
|
|
null === a.data || b.contains(a.data) || g.push(a.data)
|
|
});
|
|
g.forEach(function(b) {
|
|
Ag(a, b, !1)
|
|
});
|
|
for (d = 0; d < c.length; d++) {
|
|
var e = c[d],
|
|
h = this.uh(e);
|
|
null === h && zg(a, e, !1)
|
|
}
|
|
if (a instanceof V) {
|
|
for (var k = new K, c = a.Jg, d = 0; d < c.length; d++) e = c[d], k.add(e);
|
|
var l = [];
|
|
this.links.each(function(a) {
|
|
null === a.data || k.contains(a.data) || l.push(a.data)
|
|
});
|
|
l.forEach(function(b) {
|
|
Wg(a, b, !1)
|
|
});
|
|
for (d = 0; d < c.length; d++) e = c[d], h = this.Zf(e), null === h && Vg(a, e, !1)
|
|
}
|
|
}
|
|
for (d = this.ni; d.next();) h = d.value, h.updateRelationshipsFromData();
|
|
for (d = this.Lg; d.next();) d.value.updateRelationshipsFromData();
|
|
for (d = this.links; d.next();) h = d.value, h.updateRelationshipsFromData()
|
|
};
|
|
|
|
function Fl(a, b, c) {
|
|
if (a.Vc || a.Vd) a.bc = c, c = a.Ua, c.wc && gk(c, b, a.bc);
|
|
else if (a.Vc = !0, null === a.Fb) a.bc = c;
|
|
else {
|
|
var d = a.xb.copy(),
|
|
e = a.Jb,
|
|
g = a.Ob;
|
|
d.width = a.Jb / b;
|
|
d.height = a.Ob / b;
|
|
var h = a.$l.x,
|
|
k = a.$l.y,
|
|
l = a.XD;
|
|
isNaN(h) && (l.kj() ? l.vp(qc) ? h = 0 : l.vp(sc) && (h = e - 1) : h = l.cd() ? l.x * (e - 1) : e / 2);
|
|
isNaN(k) && (l.kj() ? l.vp(pc) ? k = 0 : l.vp(tc) && (k = g - 1) : k = l.cd() ? l.y * (g - 1) : g / 2);
|
|
null !== a.AF && (c = a.AF(a, c));
|
|
c < a.yh && (c = a.yh);
|
|
c > a.xh && (c = a.xh);
|
|
e = z.Tb(a.sb.x + h / b - h / c, a.sb.y + k / b - k / c);
|
|
a.position = e;
|
|
z.A(e);
|
|
a.bc = c;
|
|
a.fu(d, a.xb);
|
|
a.Vc = !1;
|
|
Lk(a, !1);
|
|
c =
|
|
a.Ua;
|
|
c.wc && gk(c, b, a.bc);
|
|
a.ta();
|
|
Vk(a)
|
|
}
|
|
}
|
|
C.prototype.fu = function(a, b, c) {
|
|
if (!a.N(b)) {
|
|
void 0 === c && (c = !1);
|
|
c || Vk(this);
|
|
Ik(this);
|
|
var d = this.Sb;
|
|
null === d || !d.mx || this.wl !== jh || c || a.width === b.width && a.height === b.height || d.I();
|
|
d = this.eb;
|
|
!0 === this.km && d instanceof dh && (this.Q.ga = this.cG(this.Q.te), Oj(d, this));
|
|
this.Vc || this.HE(a, b);
|
|
hl(this);
|
|
this.Ja("ViewportBoundsChanged", c ? z.xj : null, a)
|
|
}
|
|
};
|
|
|
|
function hl(a, b) {
|
|
void 0 === b && (b = null);
|
|
var c = a.td;
|
|
if (null !== c && c.visible) {
|
|
for (var d = z.Xl(), e = 1, g = 1, h = c.va.o, k = h.length, l = 0; l < k; l++) {
|
|
var m = h[l],
|
|
n = m.interval;
|
|
2 > n || (Gl(m.Hb) ? g = g * n / ff(g, n) : e = e * n / ff(e, n))
|
|
}
|
|
h = c.bx;
|
|
d.n(g * h.width, e * h.height);
|
|
h = g = l = k = 0;
|
|
if (null !== b) k = b.width, l = b.height, g = b.x, h = b.y;
|
|
else {
|
|
e = z.kg();
|
|
g = a.xb;
|
|
e.n(g.x, g.y, g.width, g.height);
|
|
for (h = a.Xv.i; h.next();) g = h.value.xb, g.F() && Ib(e, g.x, g.y, g.width, g.height);
|
|
if (!e.F()) {
|
|
z.dc(e);
|
|
return
|
|
}
|
|
k = e.width;
|
|
l = e.height;
|
|
g = e.x;
|
|
h = e.y;
|
|
z.dc(e)
|
|
}
|
|
c.width = k + 2 * d.width;
|
|
c.height =
|
|
l + 2 * d.height;
|
|
e = z.O();
|
|
jb(g, h, 0, 0, d.width, d.height, e);
|
|
e.offset(-d.width, -d.height);
|
|
z.pk(d);
|
|
c.ca.location = e;
|
|
z.A(e)
|
|
}
|
|
}
|
|
C.prototype.clearSelection = C.prototype.Mw = function() {
|
|
var a = 0 < this.selection.count;
|
|
a && this.Ja("ChangingSelection");
|
|
hh(this);
|
|
a && this.Ja("ChangedSelection")
|
|
};
|
|
|
|
function hh(a) {
|
|
a = a.selection;
|
|
if (0 < a.count) {
|
|
for (var b = a.jc(), c = b.length, d = 0; d < c; d++) b[d].kb = !1;
|
|
a.Wa();
|
|
a.clear();
|
|
a.freeze()
|
|
}
|
|
}
|
|
C.prototype.select = C.prototype.select = function(a) {
|
|
null !== a && (z.l(a, D, C, "select:part"), a.layer.h === this && (!a.kb || 1 < this.selection.count) && (this.Ja("ChangingSelection"), hh(this), a.kb = !0, this.Ja("ChangedSelection")))
|
|
};
|
|
C.prototype.selectCollection = C.prototype.FF = function(a) {
|
|
this.Ja("ChangingSelection");
|
|
hh(this);
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) {
|
|
var d = z.Ya(a, c);
|
|
d instanceof D || z.k("Diagram.selectCollection given something that is not a Part: " + d);
|
|
d.kb = !0
|
|
} else
|
|
for (a = a.i; a.next();) d = a.value, d instanceof D || z.k("Diagram.selectCollection given something that is not a Part: " + d), d.kb = !0;
|
|
this.Ja("ChangedSelection")
|
|
};
|
|
C.prototype.clearHighlighteds = C.prototype.PD = function() {
|
|
var a = this.hn;
|
|
if (0 < a.count) {
|
|
for (var b = a.jc(), c = b.length, d = 0; d < c; d++) b[d].wh = !1;
|
|
a.Wa();
|
|
a.clear();
|
|
a.freeze()
|
|
}
|
|
};
|
|
C.prototype.highlight = function(a) {
|
|
null !== a && a.layer.h === this && (z.l(a, D, C, "highlight:part"), !a.wh || 1 < this.hn.count) && (this.PD(), a.wh = !0)
|
|
};
|
|
C.prototype.highlightCollection = function(a) {
|
|
this.PD();
|
|
if (z.isArray(a))
|
|
for (var b = z.bb(a), c = 0; c < b; c++) {
|
|
var d = z.Ya(a, c);
|
|
d instanceof D || z.k("Diagram.highlightCollection given something that is not a Part: " + d);
|
|
d.wh = !0
|
|
} else
|
|
for (a = a.i; a.next();) d = a.value, d instanceof D || z.k("Diagram.highlightCollection given something that is not a Part: " + d), d.wh = !0
|
|
};
|
|
C.prototype.scroll = C.prototype.scroll = function(a, b, c) {
|
|
void 0 === c && (c = 1);
|
|
var d = "up" === b || "down" === b,
|
|
e = 0;
|
|
if ("pixel" === a) e = c;
|
|
else if ("line" === a) e = c * (d ? this.ou : this.nu);
|
|
else if ("page" === a) a = d ? this.xb.height : this.xb.width, a *= this.scale, 0 !== a && (e = Math.max(a - (d ? this.ou : this.nu), 0), e *= c);
|
|
else {
|
|
if ("document" === a) {
|
|
e = this.ad;
|
|
d = this.xb;
|
|
c = z.O();
|
|
"up" === b ? this.position = c.n(d.x, e.y) : "left" === b ? this.position = c.n(e.x, d.y) : "down" === b ? this.position = c.n(d.x, e.bottom - d.height) : "right" === b && (this.position = c.n(e.right - d.width,
|
|
d.y));
|
|
z.A(c);
|
|
return
|
|
}
|
|
z.k("scrolling unit must be 'pixel', 'line', 'page', or 'document', not: " + a)
|
|
}
|
|
e /= this.scale;
|
|
c = this.position.copy();
|
|
"up" === b ? c.y = this.position.y - e : "down" === b ? c.y = this.position.y + e : "left" === b ? c.x = this.position.x - e : "right" === b ? c.x = this.position.x + e : z.k("scrolling direction must be 'up', 'down', 'left', or 'right', not: " + b);
|
|
this.position = c
|
|
};
|
|
C.prototype.scrollToRect = C.prototype.fJ = function(a) {
|
|
var b = this.xb;
|
|
b.mk(a) || (a = a.xl, a.x -= b.width / 2, a.y -= b.height / 2, this.position = a)
|
|
};
|
|
C.prototype.centerRect = C.prototype.YG = function(a) {
|
|
var b = this.xb;
|
|
a = a.xl;
|
|
a.x -= b.width / 2;
|
|
a.y -= b.height / 2;
|
|
this.position = a
|
|
};
|
|
C.prototype.transformDocToView = C.prototype.aB = function(a) {
|
|
var b = this.Hd;
|
|
b.reset();
|
|
1 !== this.bc && b.scale(this.bc);
|
|
var c = this.sb;
|
|
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
|
|
return a.copy().transform(this.Hd)
|
|
};
|
|
C.prototype.transformViewToDoc = C.prototype.cG = function(a) {
|
|
var b = this.Hd;
|
|
b.reset();
|
|
1 !== this.bc && b.scale(this.bc);
|
|
var c = this.sb;
|
|
(0 !== c.x || 0 !== c.y) && isFinite(c.x) && isFinite(c.y) && b.translate(-c.x, -c.y);
|
|
return ub(a.copy(), this.Hd)
|
|
};
|
|
var jh;
|
|
C.None = jh = z.s(C, "None", 0);
|
|
var Pk;
|
|
C.Uniform = Pk = z.s(C, "Uniform", 1);
|
|
var Qk;
|
|
C.UniformToFill = Qk = z.s(C, "UniformToFill", 2);
|
|
var yi;
|
|
C.CycleAll = yi = z.s(C, "CycleAll", 10);
|
|
var Ci;
|
|
C.CycleNotDirected = Ci = z.s(C, "CycleNotDirected", 11);
|
|
var Ei;
|
|
C.CycleNotDirectedFast = Ei = z.s(C, "CycleNotDirectedFast", 12);
|
|
var Fi;
|
|
C.CycleNotUndirected = Fi = z.s(C, "CycleNotUndirected", 13);
|
|
var zi;
|
|
C.CycleDestinationTree = zi = z.s(C, "CycleDestinationTree", 14);
|
|
var Bi;
|
|
C.CycleSourceTree = Bi = z.s(C, "CycleSourceTree", 15);
|
|
var qk;
|
|
C.DocumentScroll = qk = z.s(C, "DocumentScroll", 1);
|
|
var tl;
|
|
C.InfiniteScroll = tl = z.s(C, "InfiniteScroll", 2);
|
|
var sk;
|
|
C.TreeParentCollapsed = sk = z.s(C, "TreeParentCollapsed", 1);
|
|
C.AllParentsCollapsed = z.s(C, "AllParentsCollapsed", 2);
|
|
z.defineProperty(C, {
|
|
CJ: "validCycle"
|
|
}, function() {
|
|
return this.yw
|
|
}, function(a) {
|
|
var b = this.yw;
|
|
b !== a && (z.Ba(a, C, C, "validCycle"), this.yw = a, this.j("validCycle", b, a))
|
|
});
|
|
z.w(C, {
|
|
mn: "layers"
|
|
}, function() {
|
|
return this.Yb.i
|
|
});
|
|
z.defineProperty(C, {
|
|
Ef: "isModelReadOnly"
|
|
}, function() {
|
|
var a = this.ie;
|
|
return null === a ? !1 : a.jb
|
|
}, function(a) {
|
|
var b = this.ie;
|
|
null !== b && (b.jb = a)
|
|
});
|
|
z.defineProperty(C, {
|
|
jb: "isReadOnly"
|
|
}, function() {
|
|
return this.Gi
|
|
}, function(a) {
|
|
var b = this.Gi;
|
|
b !== a && (z.g(a, "boolean", C, "isReadOnly"), this.Gi = a, this.j("isReadOnly", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
isEnabled: "isEnabled"
|
|
}, function() {
|
|
return this.af
|
|
}, function(a) {
|
|
var b = this.af;
|
|
b !== a && (z.g(a, "boolean", C, "isEnabled"), this.af = a, this.j("isEnabled", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Az: "allowClipboard"
|
|
}, function() {
|
|
return this.Hu
|
|
}, function(a) {
|
|
var b = this.Hu;
|
|
b !== a && (z.g(a, "boolean", C, "allowClipboard"), this.Hu = a, this.j("allowClipboard", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
kk: "allowCopy"
|
|
}, function() {
|
|
return this.Ak
|
|
}, function(a) {
|
|
var b = this.Ak;
|
|
b !== a && (z.g(a, "boolean", C, "allowCopy"), this.Ak = a, this.j("allowCopy", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Sm: "allowDelete"
|
|
}, function() {
|
|
return this.Bk
|
|
}, function(a) {
|
|
var b = this.Bk;
|
|
b !== a && (z.g(a, "boolean", C, "allowDelete"), this.Bk = a, this.j("allowDelete", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
kt: "allowDragOut"
|
|
}, function() {
|
|
return this.Iu
|
|
}, function(a) {
|
|
var b = this.Iu;
|
|
b !== a && (z.g(a, "boolean", C, "allowDragOut"), this.Iu = a, this.j("allowDragOut", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
FD: "allowDrop"
|
|
}, function() {
|
|
return this.Ju
|
|
}, function(a) {
|
|
var b = this.Ju;
|
|
b !== a && (z.g(a, "boolean", C, "allowDrop"), this.Ju = a, this.j("allowDrop", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Hw: "allowTextEdit"
|
|
}, function() {
|
|
return this.Kk
|
|
}, function(a) {
|
|
var b = this.Kk;
|
|
b !== a && (z.g(a, "boolean", C, "allowTextEdit"), this.Kk = a, this.j("allowTextEdit", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Ew: "allowGroup"
|
|
}, function() {
|
|
return this.Ck
|
|
}, function(a) {
|
|
var b = this.Ck;
|
|
b !== a && (z.g(a, "boolean", C, "allowGroup"), this.Ck = a, this.j("allowGroup", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Iw: "allowUngroup"
|
|
}, function() {
|
|
return this.Lk
|
|
}, function(a) {
|
|
var b = this.Lk;
|
|
b !== a && (z.g(a, "boolean", C, "allowUngroup"), this.Lk = a, this.j("allowUngroup", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
ap: "allowInsert"
|
|
}, function() {
|
|
return this.Lu
|
|
}, function(a) {
|
|
var b = this.Lu;
|
|
b !== a && (z.g(a, "boolean", C, "allowInsert"), this.Lu = a, this.j("allowInsert", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
lt: "allowLink"
|
|
}, function() {
|
|
return this.Dk
|
|
}, function(a) {
|
|
var b = this.Dk;
|
|
b !== a && (z.g(a, "boolean", C, "allowLink"), this.Dk = a, this.j("allowLink", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Tm: "allowRelink"
|
|
}, function() {
|
|
return this.Fk
|
|
}, function(a) {
|
|
var b = this.Fk;
|
|
b !== a && (z.g(a, "boolean", C, "allowRelink"), this.Fk = a, this.j("allowRelink", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
ul: "allowMove"
|
|
}, function() {
|
|
return this.Ek
|
|
}, function(a) {
|
|
var b = this.Ek;
|
|
b !== a && (z.g(a, "boolean", C, "allowMove"), this.Ek = a, this.j("allowMove", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Fw: "allowReshape"
|
|
}, function() {
|
|
return this.Gk
|
|
}, function(a) {
|
|
var b = this.Gk;
|
|
b !== a && (z.g(a, "boolean", C, "allowReshape"), this.Gk = a, this.j("allowReshape", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
mt: "allowResize"
|
|
}, function() {
|
|
return this.Hk
|
|
}, function(a) {
|
|
var b = this.Hk;
|
|
b !== a && (z.g(a, "boolean", C, "allowResize"), this.Hk = a, this.j("allowResize", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Gw: "allowRotate"
|
|
}, function() {
|
|
return this.Ik
|
|
}, function(a) {
|
|
var b = this.Ik;
|
|
b !== a && (z.g(a, "boolean", C, "allowRotate"), this.Ik = a, this.j("allowRotate", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
xf: "allowSelect"
|
|
}, function() {
|
|
return this.Jk
|
|
}, function(a) {
|
|
var b = this.Jk;
|
|
b !== a && (z.g(a, "boolean", C, "allowSelect"), this.Jk = a, this.j("allowSelect", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
GD: "allowUndo"
|
|
}, function() {
|
|
return this.Mu
|
|
}, function(a) {
|
|
var b = this.Mu;
|
|
b !== a && (z.g(a, "boolean", C, "allowUndo"), this.Mu = a, this.j("allowUndo", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Jw: "allowZoom"
|
|
}, function() {
|
|
return this.Ou
|
|
}, function(a) {
|
|
var b = this.Ou;
|
|
b !== a && (z.g(a, "boolean", C, "allowZoom"), this.Ou = a, this.j("allowZoom", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
dA: "hasVerticalScrollbar"
|
|
}, function() {
|
|
return this.tv
|
|
}, function(a) {
|
|
var b = this.tv;
|
|
b !== a && (z.g(a, "boolean", C, "hasVerticalScrollbar"), this.tv = a, Vk(this), this.ta(), this.j("hasVerticalScrollbar", b, a), Lk(this, !1))
|
|
});
|
|
z.defineProperty(C, {
|
|
cA: "hasHorizontalScrollbar"
|
|
}, function() {
|
|
return this.sv
|
|
}, function(a) {
|
|
var b = this.sv;
|
|
b !== a && (z.g(a, "boolean", C, "hasHorizontalScrollbar"), this.sv = a, Vk(this), this.ta(), this.j("hasHorizontalScrollbar", b, a), Lk(this, !1))
|
|
});
|
|
z.defineProperty(C, {
|
|
xe: "allowHorizontalScroll"
|
|
}, function() {
|
|
return this.Ku
|
|
}, function(a) {
|
|
var b = this.Ku;
|
|
b !== a && (z.g(a, "boolean", C, "allowHorizontalScroll"), this.Ku = a, this.j("allowHorizontalScroll", b, a), Lk(this, !1))
|
|
});
|
|
z.defineProperty(C, {
|
|
ye: "allowVerticalScroll"
|
|
}, function() {
|
|
return this.Nu
|
|
}, function(a) {
|
|
var b = this.Nu;
|
|
b !== a && (z.g(a, "boolean", C, "allowVerticalScroll"), this.Nu = a, this.j("allowVerticalScroll", b, a), Lk(this, !1))
|
|
});
|
|
z.defineProperty(C, {
|
|
nu: "scrollHorizontalLineChange"
|
|
}, function() {
|
|
return this.hw
|
|
}, function(a) {
|
|
var b = this.hw;
|
|
b !== a && (z.g(a, "number", C, "scrollHorizontalLineChange"), 0 > a && z.ka(a, ">= 0", C, "scrollHorizontalLineChange"), this.hw = a, this.j("scrollHorizontalLineChange", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
ou: "scrollVerticalLineChange"
|
|
}, function() {
|
|
return this.lw
|
|
}, function(a) {
|
|
var b = this.lw;
|
|
b !== a && (z.g(a, "number", C, "scrollVerticalLineChange"), 0 > a && z.ka(a, ">= 0", C, "scrollVerticalLineChange"), this.lw = a, this.j("scrollVerticalLineChange", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Q: "lastInput"
|
|
}, function() {
|
|
return this.Qb
|
|
}, function(a) {
|
|
u && z.l(a, Pf, C, "lastInput");
|
|
this.Qb = a
|
|
});
|
|
z.defineProperty(C, {
|
|
Fc: "firstInput"
|
|
}, function() {
|
|
return this.Ei
|
|
}, function(a) {
|
|
u && z.l(a, Pf, C, "firstInput");
|
|
this.Ei = a
|
|
});
|
|
z.defineProperty(C, {
|
|
gc: "currentCursor"
|
|
}, function() {
|
|
return this.av
|
|
}, function(a) {
|
|
"" === a && (a = this.Oq);
|
|
this.av !== a && (z.g(a, "string", C, "currentCursor"), null !== this.Fb && (this.av = a, this.Fb.style.cursor = a, this.Pb.style.cursor = a))
|
|
});
|
|
z.defineProperty(C, {
|
|
kK: "defaultCursor"
|
|
}, function() {
|
|
return this.Oq
|
|
}, function(a) {
|
|
"" === a && (a = "auto");
|
|
var b = this.Oq;
|
|
b !== a && (z.g(a, "string", C, "defaultCursor"), this.Oq = a, this.j("defaultCursor", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
click: "click"
|
|
}, function() {
|
|
return this.ui
|
|
}, function(a) {
|
|
var b = this.ui;
|
|
b !== a && (null !== a && z.g(a, "function", C, "click"), this.ui = a, this.j("click", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
wt: "doubleClick"
|
|
}, function() {
|
|
return this.Ci
|
|
}, function(a) {
|
|
var b = this.Ci;
|
|
b !== a && (null !== a && z.g(a, "function", C, "doubleClick"), this.Ci = a, this.j("doubleClick", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
Gz: "contextClick"
|
|
}, function() {
|
|
return this.xi
|
|
}, function(a) {
|
|
var b = this.xi;
|
|
b !== a && (null !== a && z.g(a, "function", C, "contextClick"), this.xi = a, this.j("contextClick", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
uA: "mouseOver"
|
|
}, function() {
|
|
return this.Pi
|
|
}, function(a) {
|
|
var b = this.Pi;
|
|
b !== a && (null !== a && z.g(a, "function", C, "mouseOver"), this.Pi = a, this.j("mouseOver", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
tA: "mouseHover"
|
|
}, function() {
|
|
return this.Oi
|
|
}, function(a) {
|
|
var b = this.Oi;
|
|
b !== a && (null !== a && z.g(a, "function", C, "mouseHover"), this.Oi = a, this.j("mouseHover", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
sA: "mouseHold"
|
|
}, function() {
|
|
return this.Ni
|
|
}, function(a) {
|
|
var b = this.Ni;
|
|
b !== a && (null !== a && z.g(a, "function", C, "mouseHold"), this.Ni = a, this.j("mouseHold", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
KI: "mouseDragOver"
|
|
}, function() {
|
|
return this.Qv
|
|
}, function(a) {
|
|
var b = this.Qv;
|
|
b !== a && (null !== a && z.g(a, "function", C, "mouseDragOver"), this.Qv = a, this.j("mouseDragOver", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
rA: "mouseDrop"
|
|
}, function() {
|
|
return this.Mi
|
|
}, function(a) {
|
|
var b = this.Mi;
|
|
b !== a && (null !== a && z.g(a, "function", C, "mouseDrop"), this.Mi = a, this.j("mouseDrop", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
$A: "toolTip"
|
|
}, function() {
|
|
return this.Wi
|
|
}, function(a) {
|
|
var b = this.Wi;
|
|
b !== a && (null !== a && z.l(a, da, C, "toolTip"), this.Wi = a, this.j("toolTip", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
contextMenu: "contextMenu"
|
|
}, function() {
|
|
return this.yi
|
|
}, function(a) {
|
|
var b = this.yi;
|
|
b !== a && (null !== a && z.l(a, da, C, "contextMenu"), this.yi = a, this.j("contextMenu", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
wb: "commandHandler"
|
|
}, function() {
|
|
return this.qy
|
|
}, function(a) {
|
|
var b = this.qy;
|
|
b !== a && (z.l(a, ra, C, "commandHandler"), null !== a.h && z.k("Cannot share CommandHandlers between Diagrams: " + a.toString()), null !== b && b.Sc(null), this.qy = a, a.Sc(this))
|
|
});
|
|
z.defineProperty(C, {
|
|
hb: "toolManager"
|
|
}, function() {
|
|
return this.rz
|
|
}, function(a) {
|
|
var b = this.rz;
|
|
b !== a && (z.l(a, dh, C, "toolManager"), null !== a.h && z.k("Cannot share ToolManagers between Diagrams: " + a.toString()), null !== b && b.Sc(null), this.rz = a, a.Sc(this))
|
|
});
|
|
z.defineProperty(C, {
|
|
vt: "defaultTool"
|
|
}, function() {
|
|
return this.xy
|
|
}, function(a) {
|
|
var b = this.xy;
|
|
b !== a && (z.l(a, ug, C, "defaultTool"), this.xy = a, this.eb === b && (this.eb = a))
|
|
});
|
|
z.defineProperty(C, {
|
|
eb: "currentTool"
|
|
}, function() {
|
|
return this.vy
|
|
}, function(a) {
|
|
var b = this.vy;
|
|
null !== b && (b.ua && b.doDeactivate(), b.cancelWaitAfter(), b.doStop());
|
|
null === a && (a = this.vt);
|
|
null !== a && (z.l(a, ug, C, "currentTool"), this.vy = a, a.Sc(this), a.doStart())
|
|
});
|
|
z.w(C, {
|
|
selection: "selection"
|
|
}, function() {
|
|
return this.ow
|
|
});
|
|
z.defineProperty(C, {
|
|
CI: "maxSelectionCount"
|
|
}, function() {
|
|
return this.Lv
|
|
}, function(a) {
|
|
var b = this.Lv;
|
|
if (b !== a)
|
|
if (z.g(a, "number", C, "maxSelectionCount"), 0 <= a && !isNaN(a)) {
|
|
if (this.Lv = a, this.j("maxSelectionCount", b, a), !this.pa.qb && (a = this.selection.count - a, 0 < a)) {
|
|
this.Ja("ChangingSelection");
|
|
for (var b = this.selection.jc(), c = 0; c < a; c++) b[c].kb = !1;
|
|
this.Ja("ChangedSelection")
|
|
}
|
|
} else z.ka(a, ">= 0", C, "maxSelectionCount")
|
|
});
|
|
z.defineProperty(C, {
|
|
MI: "nodeSelectionAdornmentTemplate"
|
|
}, function() {
|
|
return this.Rv
|
|
}, function(a) {
|
|
var b = this.Rv;
|
|
b !== a && (z.l(a, da, C, "nodeSelectionAdornmentTemplate"), this.Rv = a, this.j("nodeSelectionAdornmentTemplate", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
TH: "groupSelectionAdornmentTemplate"
|
|
}, function() {
|
|
return this.pv
|
|
}, function(a) {
|
|
var b = this.pv;
|
|
b !== a && (z.l(a, da, C, "groupSelectionAdornmentTemplate"), this.pv = a, this.j("groupSelectionAdornmentTemplate", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
wI: "linkSelectionAdornmentTemplate"
|
|
}, function() {
|
|
return this.Hv
|
|
}, function(a) {
|
|
var b = this.Hv;
|
|
b !== a && (z.l(a, da, C, "linkSelectionAdornmentTemplate"), this.Hv = a, this.j("linkSelectionAdornmentTemplate", b, a))
|
|
});
|
|
z.w(C, {
|
|
hn: "highlighteds"
|
|
}, function() {
|
|
return this.uv
|
|
});
|
|
z.defineProperty(C, {
|
|
mi: "isModified"
|
|
}, function() {
|
|
var a = this.pa;
|
|
return a.isEnabled ? null !== a.dj ? !0 : this.Uy && this.bh !== a.ij : this.Uy
|
|
}, function(a) {
|
|
if (this.Uy !== a) {
|
|
z.g(a, "boolean", C, "isModified");
|
|
this.Uy = a;
|
|
var b = this.pa;
|
|
!a && b.isEnabled && (this.bh = b.ij);
|
|
a || Hl(this)
|
|
}
|
|
});
|
|
|
|
function Hl(a) {
|
|
var b = a.mi;
|
|
a.xD !== b && (a.xD = b, a.Ja("Modified"))
|
|
}
|
|
z.defineProperty(C, {
|
|
ha: "model"
|
|
}, function() {
|
|
return this.ie
|
|
}, function(a) {
|
|
var b = this.ie;
|
|
if (b !== a) {
|
|
z.l(a, M, C, "model");
|
|
this.eb.doCancel();
|
|
null !== b && b.pa !== a.pa && b.pa.QE && z.k("Do not replace a Diagram.model while a transaction is in progress.");
|
|
this.Ua.oi();
|
|
this.Mw();
|
|
this.eh = !1;
|
|
this.io = !0;
|
|
this.bh = -2;
|
|
this.Vf = !1;
|
|
var c = this.Vd;
|
|
this.Vd = !0;
|
|
this.Ua.sn("Model");
|
|
null !== b && (null !== this.gh && this.gh.each(function(a) {
|
|
b.iu(a)
|
|
}), b.iu(this.FC), b instanceof V && Il(this, b.Jg), Il(this, b.gg));
|
|
this.ie = a;
|
|
a.Rm(this.EC);
|
|
Jl(this,
|
|
a.gg);
|
|
a instanceof V && Kl(this, a.Jg);
|
|
a.iu(this.EC);
|
|
a.Rm(this.FC);
|
|
null !== this.gh && this.gh.each(function(b) {
|
|
a.Rm(b)
|
|
});
|
|
this.Vd = c;
|
|
this.Vc || this.ta();
|
|
null !== b && (a.pa.isEnabled = b.pa.isEnabled)
|
|
}
|
|
});
|
|
z.defineProperty(C, {
|
|
$a: null
|
|
}, function() {
|
|
return this.xC
|
|
}, function(a) {
|
|
this.xC = a
|
|
});
|
|
z.w(C, {
|
|
qx: null
|
|
}, function() {
|
|
return this.rG
|
|
});
|
|
|
|
function uk(a, b) {
|
|
if (b.ha === a.ha) {
|
|
var c = b.Dc,
|
|
d = b.propertyName;
|
|
if (c === Tf && "S" === d[0])
|
|
if ("StartingFirstTransaction" === d) c = a.hb, c.Ye.each(function(b) {
|
|
b.Sc(a)
|
|
}), c.dg.each(function(b) {
|
|
b.Sc(a)
|
|
}), c.eg.each(function(b) {
|
|
b.Sc(a)
|
|
}), a.Vd || a.eh || (a.gv = !0, a.io && (a.Vf = !0));
|
|
else if ("StartingUndo" === d || "StartingRedo" === d) {
|
|
var e = a.Ua;
|
|
e.nf && !a.Bb && e.oi();
|
|
a.Ja("ChangingSelection")
|
|
} else "StartedTransaction" === d && (e = a.Ua, e.nf && !a.Bb && e.oi());
|
|
else if (a.$a) {
|
|
a.$a = !1;
|
|
try {
|
|
var g = b.rf;
|
|
if ("" !== g)
|
|
if (c === Sf) {
|
|
if ("linkFromKey" === g) {
|
|
var h =
|
|
b.object,
|
|
k = a.Zf(h);
|
|
if (null !== k) {
|
|
var l = b.newValue,
|
|
m = a.hf(l);
|
|
k.Y = m
|
|
}
|
|
} else if ("linkToKey" === g) h = b.object, k = a.Zf(h), null !== k && (l = b.newValue, m = a.hf(l), k.da = m);
|
|
else if ("linkFromPortId" === g) {
|
|
if (h = b.object, k = a.Zf(h), null !== k) {
|
|
var n = b.newValue;
|
|
"string" === typeof n && (k.$f = n)
|
|
}
|
|
} else if ("linkToPortId" === g) h = b.object, k = a.Zf(h), null !== k && (n = b.newValue, "string" === typeof n && (k.Ug = n));
|
|
else if ("nodeGroupKey" === g) {
|
|
var h = b.object,
|
|
p = a.uh(h);
|
|
if (null !== p) {
|
|
var q = b.newValue;
|
|
if (void 0 !== q) {
|
|
var r = a.hf(q);
|
|
p.Va = r instanceof F ? r :
|
|
null
|
|
} else p.Va = null
|
|
}
|
|
} else if ("linkLabelKeys" === g) {
|
|
if (h = b.object, k = a.Zf(h), null !== k) {
|
|
var s = b.oldValue,
|
|
t = b.newValue;
|
|
if (z.isArray(s))
|
|
for (var v = z.bb(s), x = 0; x < v; x++) {
|
|
var y = z.Ya(s, x),
|
|
m = a.hf(y);
|
|
null !== m && (m.Nd = null)
|
|
}
|
|
if (z.isArray(t))
|
|
for (v = z.bb(t), x = 0; x < v; x++) y = z.Ya(t, x), m = a.hf(y), null !== m && (m.Nd = k)
|
|
}
|
|
} else if ("nodeParentKey" === g) {
|
|
var A = b.object,
|
|
B = a.hf(b.newValue),
|
|
L = a.Zw(A);
|
|
if (null !== L) {
|
|
var H = L.pp();
|
|
null !== H ? null === B ? a.remove(H) : a.ce ? H.Y = B : H.da = B : Ll(a, B, L)
|
|
}
|
|
} else if ("parentLinkCategory" === g) {
|
|
var A = b.object,
|
|
L =
|
|
a.Zw(A),
|
|
U = b.newValue;
|
|
null !== L && "string" === typeof U && (H = L.pp(), null !== H && (H.nc = U))
|
|
} else if ("nodeCategory" === g) {
|
|
var h = b.object,
|
|
ea = a.uh(h),
|
|
U = b.newValue;
|
|
null !== ea && "string" === typeof U && (ea.nc = U)
|
|
} else if ("linkCategory" === g) {
|
|
var h = b.object,
|
|
W = a.Zf(h),
|
|
U = b.newValue;
|
|
null !== W && "string" === typeof U && (W.nc = U)
|
|
} else if ("nodeDataArray" === g) {
|
|
var P = b.oldValue;
|
|
Il(a, P);
|
|
var ba = b.newValue;
|
|
Jl(a, ba)
|
|
} else "linkDataArray" === g && (P = b.oldValue, Il(a, P), ba = b.newValue, Kl(a, ba));
|
|
a.mi = !0
|
|
} else c === Uf ? (ba = b.newValue, "nodeDataArray" ===
|
|
g && z.Za(ba) ? Ml(a, ba) : "linkDataArray" === g && z.Za(ba) ? Nl(a, ba) : "linkLabelKeys" === g && yg(ba) && (k = a.Zf(b.object), m = a.hf(ba), null !== k && null !== m && (m.Nd = k)), a.mi = !0) : c === Vf ? (P = b.oldValue, "nodeDataArray" === g && z.Za(P) ? Ol(a, P) : "linkDataArray" === g && z.Za(P) ? Ol(a, P) : "linkLabelKeys" === g && yg(P) && (m = a.hf(P), null !== m && (m.Nd = null)), a.mi = !0) : c === Tf && ("SourceChanged" === g ? null !== b.object ? tk(a, b.object, b.propertyName) : (a.BJ(), a.eG()) : "ModelDisplaced" === g && a.Sl());
|
|
else if (c === Sf) {
|
|
var Oa = b.propertyName,
|
|
h = b.object;
|
|
if (h === a.ha) {
|
|
if ("nodeKeyProperty" ===
|
|
Oa || "nodeCategoryProperty" === Oa || "linkFromKeyProperty" === Oa || "linkToKeyProperty" === Oa || "linkFromPortIdProperty" === Oa || "linkToPortIdProperty" === Oa || "linkLabelKeysProperty" === Oa || "nodeIsGroupProperty" === Oa || "nodeGroupKeyProperty" === Oa || "nodeParentKeyProperty" === Oa || "linkCategoryProperty" === Oa) a.pa.qb || a.Sl()
|
|
} else tk(a, h, Oa);
|
|
a.mi = !0
|
|
} else if (c === Uf || c === Vf) Pl(a, b), a.mi = !0;
|
|
else if (c === Tf) {
|
|
if ("FinishedUndo" === d || "FinishedRedo" === d) a.pa.Hi = !0, a.Ja("ChangedSelection"), Jk(a), a.pa.Hi = !1;
|
|
e = a.Ua;
|
|
"RolledBackTransaction" ===
|
|
d && e.oi();
|
|
a.gv = !0;
|
|
a.bg();
|
|
0 === a.pa.Gh && Sj(e);
|
|
"CommittedTransaction" === d && a.pa.Wy && (a.bh = Math.min(a.bh, a.pa.ij - 1));
|
|
var sa = b.TE;
|
|
sa && (Hl(a), a.qx.clear());
|
|
!a.cz && sa && (a.cz = !0, z.setTimeout(function() {
|
|
a.eb.standardMouseOver();
|
|
a.cz = !1
|
|
}, 10))
|
|
}
|
|
} finally {
|
|
a.$a = !0
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function tk(a, b, c) {
|
|
if ("string" === typeof c) {
|
|
var d = a.uh(b);
|
|
if (null !== d) d.Mb(c), a.ha instanceof ng && (d = a.Zf(b), null !== d && d.Mb(c));
|
|
else {
|
|
for (var d = null, e = a.nm.i; e.next();) {
|
|
for (var g = e.value, h = 0; h < g.length; h++) {
|
|
var k = g[h].EH(b);
|
|
null !== k && (null === d && (d = z.rb()), d.push(k))
|
|
}
|
|
if (null !== d) break
|
|
}
|
|
if (null !== d) {
|
|
for (e = 0; e < d.length; e++) d[e].Mb(c);
|
|
z.xa(d)
|
|
}
|
|
}
|
|
b === a.ha.tk && a.eG(c)
|
|
}
|
|
}
|
|
z.defineProperty(C, {
|
|
Ee: "skipsModelSourceBindings"
|
|
}, function() {
|
|
return this.$C
|
|
}, function(a) {
|
|
this.$C = a
|
|
});
|
|
z.defineProperty(C, {
|
|
vu: null
|
|
}, function() {
|
|
return this.lz
|
|
}, function(a) {
|
|
this.lz = a
|
|
});
|
|
|
|
function Pl(a, b) {
|
|
var c = b.Dc === Uf,
|
|
d = c ? b.Kg : b.Mg,
|
|
e = c ? b.newValue : b.oldValue,
|
|
g = a.nm.na(b.object);
|
|
if (Array.isArray(g))
|
|
for (var h = 0; h < g.length; h++) {
|
|
var k = g[h];
|
|
if (c) Ql(k, e, d);
|
|
else {
|
|
var l = d;
|
|
if (!(0 > l)) {
|
|
var m = l;
|
|
Rl(k) && m++;
|
|
k.Ve(m);
|
|
Sl(k, m, l)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function yl(a, b) {
|
|
var c = b.Ii;
|
|
if (z.isArray(c)) {
|
|
var d = a.nm.na(c);
|
|
if (null === d) d = [], d.push(b), a.nm.add(c, d);
|
|
else {
|
|
for (c = 0; c < d.length; c++)
|
|
if (d[c] === b) return;
|
|
d.push(b)
|
|
}
|
|
}
|
|
}
|
|
|
|
function Cl(a, b) {
|
|
var c = b.Ii;
|
|
if (z.isArray(c)) {
|
|
var d = a.nm.na(c);
|
|
if (null !== d)
|
|
for (var e = 0; e < d.length; e++)
|
|
if (d[e] === b) {
|
|
d.splice(e, 1);
|
|
0 === d.length && a.nm.remove(c);
|
|
break
|
|
}
|
|
}
|
|
}
|
|
|
|
function xl(a, b) {
|
|
for (var c = b.va.o, d = c.length, e = 0; e < d; e++) {
|
|
var g = c[e];
|
|
g instanceof vk && Tl(a, g)
|
|
}
|
|
}
|
|
|
|
function Tl(a, b) {
|
|
var c = b.element;
|
|
if (null !== c && c instanceof HTMLImageElement) {
|
|
var c = c.src,
|
|
d = a.Go.na(c);
|
|
if (null === d) d = [], d.push(b), a.Go.add(c, d);
|
|
else {
|
|
for (c = 0; c < d.length; c++)
|
|
if (d[c] === b) return;
|
|
d.push(b)
|
|
}
|
|
}
|
|
}
|
|
|
|
function Bl(a, b) {
|
|
for (var c = b.va.o, d = c.length, e = 0; e < d; e++) {
|
|
var g = c[e];
|
|
g instanceof vk && Ul(a, g)
|
|
}
|
|
}
|
|
|
|
function Ul(a, b) {
|
|
var c = b.element;
|
|
if (null !== c && c instanceof HTMLImageElement) {
|
|
var c = c.src,
|
|
d = a.Go.na(c);
|
|
if (null !== d)
|
|
for (var e = 0; e < d.length; e++)
|
|
if (d[e] === b) {
|
|
d.splice(e, 1);
|
|
0 === d.length && a.Go.remove(c);
|
|
break
|
|
}
|
|
}
|
|
}
|
|
C.prototype.clear = C.prototype.clear = function() {
|
|
var a = null;
|
|
null !== this.td && (a = this.td.ca);
|
|
this.ha.clear();
|
|
for (var b = this.Yb.length, c = 0; c < b; c++) this.Yb.o[c].clear();
|
|
this.qg.clear();
|
|
this.Rk.clear();
|
|
this.Fo.clear();
|
|
this.ol.clear();
|
|
this.zo.clear();
|
|
this.mb.clear();
|
|
this.zi.clear();
|
|
this.Qk.clear();
|
|
this.nm.clear();
|
|
this.ow.Wa();
|
|
this.ow.clear();
|
|
this.ow.freeze();
|
|
this.uv.Wa();
|
|
this.uv.clear();
|
|
this.uv.freeze();
|
|
bh = this.Sn = null;
|
|
ch = "";
|
|
this.hv = (new w(NaN, NaN, NaN, NaN)).freeze();
|
|
null !== a && (this.add(a), this.mb.remove(a));
|
|
this.ta()
|
|
};
|
|
C.prototype.reset = C.prototype.reset = function() {
|
|
this.Vc = !0;
|
|
this.clear();
|
|
this.Yb = new J(tg);
|
|
this.rF();
|
|
this.qF();
|
|
this.sb = (new N(NaN, NaN)).freeze();
|
|
this.bc = 1;
|
|
this.wv = (new N(NaN, NaN)).freeze();
|
|
this.xv = NaN;
|
|
this.Nv = 1E-4;
|
|
this.Kv = 100;
|
|
this.Bw = (new N(NaN, NaN)).freeze();
|
|
this.nv = (new w(NaN, NaN, NaN, NaN)).freeze();
|
|
this.iw = (new Db(0, 0, 0, 0)).freeze();
|
|
this.jw = qk;
|
|
this.fw = this.bw = null;
|
|
this.dm = jh;
|
|
this.Pn = Pc;
|
|
this.Xk = jh;
|
|
this.no = Pc;
|
|
this.yv = this.vv = Zb;
|
|
this.tB = 250;
|
|
this.Su = (new Db(16, 16, 16, 16)).freeze();
|
|
this.Cv = !0;
|
|
this.ww = sk;
|
|
this.yw = yi;
|
|
this.Oq = "auto";
|
|
this.yi = this.Wi = this.Mi = this.Qv = this.Ni = this.Oi = this.Pi = this.xi = this.Ci = this.ui = null;
|
|
this.Gi = !1;
|
|
this.Bk = this.Ak = this.Hu = this.af = !0;
|
|
this.Ju = this.Iu = !1;
|
|
this.Nu = this.Ku = this.tv = this.sv = this.Ou = this.Mu = this.Jk = this.Ik = this.Hk = this.Gk = this.Ek = this.Fk = this.Dk = this.Lu = this.Lk = this.Ck = this.Kk = !0;
|
|
this.lw = this.hw = 16;
|
|
this.df = (new Db(5)).freeze();
|
|
this.Lv = 999999999;
|
|
this.he = null;
|
|
zk(this);
|
|
this.td = null;
|
|
this.hb = new dh;
|
|
this.hb.initializeStandardTools();
|
|
this.eb = this.vt = this.hb;
|
|
this.wb = new ra;
|
|
this.Vi = !0;
|
|
yk(this);
|
|
this.Sb = new vg;
|
|
this.Vi = !1;
|
|
this.ha = new V;
|
|
this.eh = !1;
|
|
this.io = !0;
|
|
this.Vc = this.Vf = !1;
|
|
this.ta();
|
|
this.gh = this.ti = null;
|
|
rk(this);
|
|
this.av = ""
|
|
};
|
|
C.prototype.rebuildParts = C.prototype.Sl = function() {
|
|
for (var a = this.zA.i; a.next();) {
|
|
var b = a.value,
|
|
c = a.key;
|
|
(!b.be() || b instanceof F) && z.k('Invalid node template in Diagram.nodeTemplateMap: template for "' + c + '" must be a Node or a simple Part, not a Group or Link: ' + b)
|
|
}
|
|
for (a = this.bA.i; a.next();) b = a.value, c = a.key, b instanceof F || z.k('Invalid group template in Diagram.groupTemplateMap: template for "' + c + '" must be a Group, not a normal Node or Link: ' + b);
|
|
for (a = this.lA.i; a.next();) b = a.value, c = a.key, b instanceof
|
|
G || z.k('Invalid link template in Diagram.linkTemplateMap: template for "' + c + '" must be a Link, not a normal Node or simple Part: ' + b);
|
|
a = z.rb();
|
|
for (b = this.selection.i; b.next();)(c = b.value.data) && a.push(c);
|
|
for (var b = z.rb(), d = this.hn.i; d.next();)(c = d.value.data) && b.push(c);
|
|
c = z.rb();
|
|
for (d = this.Lg.i; d.next();) {
|
|
var e = d.value;
|
|
null !== e.data && (c.push(e.data), c.push(e.location))
|
|
}
|
|
for (d = this.links.i; d.next();) e = d.value, null !== e.data && (c.push(e.data), c.push(e.location));
|
|
for (d = this.ni.i; d.next();) e = d.value, null !==
|
|
e.data && (c.push(e.data), c.push(e.location));
|
|
d = this.ha;
|
|
d instanceof V && Il(this, d.Jg);
|
|
Il(this, d.gg);
|
|
Jl(this, d.gg);
|
|
d instanceof V && Kl(this, d.Jg);
|
|
for (d = 0; d < a.length; d++) e = this.uh(a[d]), null !== e && (e.kb = !0);
|
|
for (d = 0; d < b.length; d++) e = this.uh(b[d]), null !== e && (e.wh = !0);
|
|
for (d = 0; d < c.length; d += 2) e = this.uh(c[d]), null !== e && (e.location = c[d + 1]);
|
|
z.xa(a);
|
|
z.xa(b);
|
|
z.xa(c)
|
|
};
|
|
|
|
function Jl(a, b) {
|
|
if (null !== b) {
|
|
for (var c = a.ha, d = z.bb(b), e = 0; e < d; e++) {
|
|
var g = z.Ya(b, e);
|
|
c.le(g) ? Ml(a, g, !1) : c instanceof V && Nl(a, g)
|
|
}
|
|
if (c instanceof V || c instanceof ng) {
|
|
for (e = 0; e < d; e++) g = z.Ya(b, e), c.le(g) && Vl(a, g);
|
|
if (c instanceof V)
|
|
for (c = a.links; c.next();) Wl(c.value)
|
|
}
|
|
Xl(a, !1)
|
|
}
|
|
}
|
|
|
|
function Ml(a, b, c) {
|
|
if (void 0 !== b && null !== b && !a.pa.qb && !a.zi.contains(b)) {
|
|
void 0 === c && (c = !0);
|
|
var d = a.$z(b),
|
|
e = Yl(a, b, d);
|
|
if (null !== e && (gh(e), e = e.copy(), null !== e)) {
|
|
var g = a.Ee;
|
|
a.Ee = !0;
|
|
e.si = d;
|
|
e.fe = b;
|
|
a.add(e);
|
|
e.fe = null;
|
|
e.data = b;
|
|
c && Vl(a, b);
|
|
a.Ee = g
|
|
}
|
|
}
|
|
}
|
|
C.prototype.$z = function(a) {
|
|
return this.ha.$z(a)
|
|
};
|
|
var Zl = !1,
|
|
$l = !1;
|
|
|
|
function Yl(a, b, c) {
|
|
var d = !1,
|
|
e = a.ha;
|
|
e instanceof V && (d = e.hA(b));
|
|
d ? (b = a.bA.na(c), null === b && (b = a.bA.na(""), null === b && ($l || ($l = !0, z.trace('No Group template found for category "' + c + '"'), z.trace(" Using default group template")), b = a.OB))) : (b = a.zA.na(c), null === b && (b = a.zA.na(""), null === b && (Zl || (Zl = !0, z.trace('No Node template found for category "' + c + '"'), z.trace(" Using default node template")), b = a.QB)));
|
|
return b
|
|
}
|
|
|
|
function Vl(a, b) {
|
|
var c = a.ha;
|
|
if (c instanceof V || c instanceof ng) {
|
|
var d = c.pb(b);
|
|
if (void 0 !== d) {
|
|
var e = Bg(c, d),
|
|
g = a.uh(b);
|
|
if (null !== e && null !== g) {
|
|
for (e = e.i; e.next();) {
|
|
var h = e.value;
|
|
if (c instanceof V) {
|
|
var k = c;
|
|
if (k.le(h)) {
|
|
if (g instanceof F && k.fn(h) === d) {
|
|
var l = g,
|
|
h = a.uh(h);
|
|
null !== h && (h.Va = l)
|
|
}
|
|
} else {
|
|
var m = a.Zf(h);
|
|
if (null !== m && g instanceof E && (l = g, k.Ll(h) === d && (m.Y = l), k.Ml(h) === d && (m.da = l), h = k.qk(h), z.isArray(h)))
|
|
for (k = 0; k < z.bb(h); k++)
|
|
if (z.Ya(h, k) === d) {
|
|
l.Nd = m;
|
|
break
|
|
}
|
|
}
|
|
} else c instanceof ng && (m = c, m.le(h) && g instanceof E && (l = g, m.gn(h) === d && (h = a.Zw(h), Ll(a, l, h))))
|
|
}
|
|
Dg(c, d)
|
|
}
|
|
c instanceof V ? (c = c.fn(b), void 0 !== c && (c = a.hf(c), c instanceof F && (g.Va = c))) : c instanceof ng && (c = c.gn(b), void 0 !== c && g instanceof E && (l = g, g = a.hf(c), Ll(a, g, l)))
|
|
}
|
|
}
|
|
}
|
|
|
|
function Ll(a, b, c) {
|
|
if (null !== b && null !== c) {
|
|
var d = a.hb.ZE,
|
|
e = b,
|
|
g = c;
|
|
if (a.ce)
|
|
for (b = g.ee; b.next();) {
|
|
if (b.value.da === g) return
|
|
} else
|
|
for (e = c, g = b, b = e.ee; b.next();)
|
|
if (b.value.Y === e) return;
|
|
if (null === d || !Ai(d, e, g, null, !0))
|
|
if (d = a.ax(c.data), b = am(a, d), null !== b && (gh(b), b = b.copy(), null !== b)) {
|
|
var h = a.Ee;
|
|
a.Ee = !0;
|
|
b.si = d;
|
|
b.fe = c.data;
|
|
b.Y = e;
|
|
b.da = g;
|
|
a.add(b);
|
|
b.fe = null;
|
|
b.data = c.data;
|
|
a.Ee = h
|
|
}
|
|
}
|
|
}
|
|
|
|
function Kl(a, b) {
|
|
if (null !== b) {
|
|
for (var c = z.bb(b), d = 0; d < c; d++) {
|
|
var e = z.Ya(b, d);
|
|
Nl(a, e)
|
|
}
|
|
Xl(a, !1)
|
|
}
|
|
}
|
|
|
|
function Nl(a, b) {
|
|
if (void 0 !== b && null !== b && !a.pa.qb && !a.Qk.contains(b)) {
|
|
var c = a.ax(b),
|
|
d = am(a, c);
|
|
if (null !== d && (gh(d), d = d.copy(), null !== d)) {
|
|
var e = a.Ee;
|
|
a.Ee = !0;
|
|
d.si = c;
|
|
d.fe = b;
|
|
var c = a.ha,
|
|
g = c.MH(b);
|
|
"" !== g && (d.$f = g);
|
|
g = c.Ll(b);
|
|
void 0 !== g && (g = a.hf(g), g instanceof E && (d.Y = g));
|
|
g = c.PH(b);
|
|
"" !== g && (d.Ug = g);
|
|
g = c.Ml(b);
|
|
void 0 !== g && (g = a.hf(g), g instanceof E && (d.da = g));
|
|
c = c.qk(b);
|
|
if (z.isArray(c))
|
|
for (var g = z.bb(c), h = 0; h < g; h++) {
|
|
var k = z.Ya(c, h),
|
|
k = a.hf(k);
|
|
null !== k && (k.Nd = d)
|
|
}
|
|
a.add(d);
|
|
d.fe = null;
|
|
d.data = b;
|
|
a.Ee = e
|
|
}
|
|
}
|
|
}
|
|
C.prototype.ax = function(a) {
|
|
var b = this.ha,
|
|
c = "";
|
|
b instanceof V ? c = b.ax(a) : b instanceof ng && (c = b.OH(a));
|
|
return c
|
|
};
|
|
var bm = !1;
|
|
|
|
function am(a, b) {
|
|
var c = a.lA.na(b);
|
|
null === c && (c = a.lA.na(""), null === c && (bm || (bm = !0, z.trace('No Link template found for category "' + b + '"'), z.trace(" Using default link template")), c = a.PB));
|
|
return c
|
|
}
|
|
|
|
function Il(a, b) {
|
|
for (var c = z.bb(b), d = 0; d < c; d++) {
|
|
var e = z.Ya(b, d);
|
|
Ol(a, e)
|
|
}
|
|
}
|
|
|
|
function Ol(a, b) {
|
|
if (void 0 !== b && null !== b) {
|
|
var c = a.uh(b);
|
|
if (null !== c) {
|
|
c.kb = !1;
|
|
c.wh = !1;
|
|
var d = c.layer;
|
|
if (null !== d && d.h === a) {
|
|
var e = a.ha;
|
|
if (e instanceof V && c instanceof E) {
|
|
var g = c,
|
|
h = e.pb(g.data);
|
|
if (void 0 !== h) {
|
|
for (var k = g.ee; k.next();) Cg(e, h, k.value.data);
|
|
g.Df && (k = g.Nd, null !== k && Cg(e, h, k.data));
|
|
if (g instanceof F)
|
|
for (g = g.Hc; g.next();) k = g.value.data, e.le(k) && Cg(e, h, k)
|
|
}
|
|
} else if (e instanceof ng && c instanceof E) {
|
|
g = c;
|
|
k = a.Zf(g.data);
|
|
if (null !== k) {
|
|
k.kb = !1;
|
|
k.wh = !1;
|
|
var l = k.layer;
|
|
if (null !== l) {
|
|
var m = l.Ve(-1, k, !1);
|
|
0 <= m && a.Rc(Vf, "parts", l, k, null, m, null);
|
|
m = k.Ut;
|
|
null !== m && m(k, l, null)
|
|
}
|
|
}
|
|
k = a.ce;
|
|
for (g = g.ee; g.next();) l = g.value, l = (k ? l.da : l.Y).data, e.le(l) && Cg(e, h, l)
|
|
}
|
|
e = d.Ve(-1, c, !1);
|
|
0 <= e && a.Rc(Vf, "parts", d, c, null, e, null);
|
|
e = c.Ut;
|
|
null !== e && e(c, d, null)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
C.prototype.findPartForKey = C.prototype.HH = function(a) {
|
|
if (null === a || void 0 === a) return null;
|
|
a = this.ha.ne(a);
|
|
return null === a ? null : this.zi.na(a)
|
|
};
|
|
C.prototype.findNodeForKey = C.prototype.hf = function(a) {
|
|
if (null === a || void 0 === a) return null;
|
|
a = this.ha.ne(a);
|
|
if (null === a) return null;
|
|
a = this.zi.na(a);
|
|
return a instanceof E ? a : null
|
|
};
|
|
C.prototype.findPartForData = C.prototype.uh = function(a) {
|
|
if (null === a) return null;
|
|
var b = this.zi.na(a);
|
|
return null !== b ? b : b = this.Qk.na(a)
|
|
};
|
|
C.prototype.findNodeForData = C.prototype.Zw = function(a) {
|
|
if (null === a) return null;
|
|
a = this.zi.na(a);
|
|
return a instanceof E ? a : null
|
|
};
|
|
C.prototype.findLinkForData = C.prototype.Zf = function(a) {
|
|
return null === a ? null : this.Qk.na(a)
|
|
};
|
|
C.prototype.findNodesByExample = function(a) {
|
|
for (var b = new K, c = this.Fo.i; c.next();) {
|
|
var d = c.value,
|
|
e = d.data;
|
|
if (null !== e)
|
|
for (var g = 0; g < arguments.length; g++) {
|
|
var h = arguments[g];
|
|
if (z.Za(h) && cm(this, e, h)) {
|
|
b.add(d);
|
|
break
|
|
}
|
|
}
|
|
}
|
|
return b.i
|
|
};
|
|
C.prototype.findLinksByExample = function(a) {
|
|
for (var b = new K, c = this.zo.i; c.next();) {
|
|
var d = c.value,
|
|
e = d.data;
|
|
if (null !== e)
|
|
for (var g = 0; g < arguments.length; g++) {
|
|
var h = arguments[g];
|
|
if (z.Za(h) && cm(this, e, h)) {
|
|
b.add(d);
|
|
break
|
|
}
|
|
}
|
|
}
|
|
return b.i
|
|
};
|
|
|
|
function cm(a, b, c) {
|
|
for (var d in c) {
|
|
var e = b[d],
|
|
g = c[d];
|
|
if (z.isArray(g)) {
|
|
if (!z.isArray(e) || e.length < g.length) return !1;
|
|
for (var h = 0; h < e.length; h++) {
|
|
var k = e[h],
|
|
l = g[h];
|
|
if (void 0 !== l && !dm(a, k, l)) return !1
|
|
}
|
|
} else if (!dm(a, e, g)) return !1
|
|
}
|
|
return !0
|
|
}
|
|
|
|
function dm(a, b, c) {
|
|
if ("function" === typeof c) {
|
|
if (!c(b)) return !1
|
|
} else if (c instanceof RegExp) {
|
|
if (!b || !c.test(b.toString())) return !1
|
|
} else if (z.Za(b) && z.Za(c)) {
|
|
if (!cm(a, b, c)) return !1
|
|
} else if (b !== c) return !1;
|
|
return !0
|
|
}
|
|
z.defineProperty(C, {
|
|
ZK: "nodeTemplate"
|
|
}, function() {
|
|
return this.Qi.na("")
|
|
}, function(a) {
|
|
var b = this.Qi.na("");
|
|
b !== a && (z.l(a, D, C, "nodeTemplate"), this.Qi.add("", a), this.j("nodeTemplate", b, a), this.pa.qb || this.Sl())
|
|
});
|
|
z.defineProperty(C, {
|
|
zA: "nodeTemplateMap"
|
|
}, function() {
|
|
return this.Qi
|
|
}, function(a) {
|
|
var b = this.Qi;
|
|
b !== a && (z.l(a, na, C, "nodeTemplateMap"), this.Qi = a, this.j("nodeTemplateMap", b, a), this.pa.qb || this.Sl())
|
|
});
|
|
z.defineProperty(C, {
|
|
BK: "groupTemplate"
|
|
}, function() {
|
|
return this.Tk.na("")
|
|
}, function(a) {
|
|
var b = this.Tk.na("");
|
|
b !== a && (z.l(a, F, C, "groupTemplate"), this.Tk.add("", a), this.j("groupTemplate", b, a), this.pa.qb || this.Sl())
|
|
});
|
|
z.defineProperty(C, {
|
|
bA: "groupTemplateMap"
|
|
}, function() {
|
|
return this.Tk
|
|
}, function(a) {
|
|
var b = this.Tk;
|
|
b !== a && (z.l(a, na, C, "groupTemplateMap"), this.Tk = a, this.j("groupTemplateMap", b, a), this.pa.qb || this.Sl())
|
|
});
|
|
z.defineProperty(C, {
|
|
NK: "linkTemplate"
|
|
}, function() {
|
|
return this.Oj.na("")
|
|
}, function(a) {
|
|
var b = this.Oj.na("");
|
|
b !== a && (z.l(a, G, C, "linkTemplate"), this.Oj.add("", a), this.j("linkTemplate", b, a), this.pa.qb || this.Sl())
|
|
});
|
|
z.defineProperty(C, {
|
|
lA: "linkTemplateMap"
|
|
}, function() {
|
|
return this.Oj
|
|
}, function(a) {
|
|
var b = this.Oj;
|
|
b !== a && (z.l(a, na, C, "linkTemplateMap"), this.Oj = a, this.j("linkTemplateMap", b, a), this.pa.qb || this.Sl())
|
|
});
|
|
z.defineProperty(C, {
|
|
hI: null
|
|
}, function() {
|
|
return this.km
|
|
}, function(a) {
|
|
this.km = a
|
|
});
|
|
z.defineProperty(C, {
|
|
We: "isMouseCaptured"
|
|
}, function() {
|
|
return this.uC
|
|
}, function(a) {
|
|
var b = this.Fb;
|
|
null !== b && (a ? (this.Q.bubbles = !1, b.removeEventListener("mousemove", this.Kp, !1), b.removeEventListener("mousedown", this.Jp, !1), b.removeEventListener("mouseup", this.Mp, !1), b.removeEventListener("mousewheel", this.zh, !1), b.removeEventListener("DOMMouseScroll", this.zh, !1), b.removeEventListener("mouseout", this.Lp, !1), window.addEventListener("mousemove", this.Kp, !0), window.addEventListener("mousedown", this.Jp, !0),
|
|
window.addEventListener("mouseup", this.Mp, !0), window.addEventListener("mousewheel", this.zh, !0), window.addEventListener("DOMMouseScroll", this.zh, !0), window.addEventListener("mouseout", this.Lp, !0), window.addEventListener("selectstart", this.preventDefault, !1)) : (window.removeEventListener("mousemove", this.Kp, !0), window.removeEventListener("mousedown", this.Jp, !0), window.removeEventListener("mouseup", this.Mp, !0), window.removeEventListener("mousewheel", this.zh, !0), window.removeEventListener("DOMMouseScroll",
|
|
this.zh, !0), window.removeEventListener("mouseout", this.Lp, !0), window.removeEventListener("selectstart", this.preventDefault, !1), b.addEventListener("mousemove", this.Kp, !1), b.addEventListener("mousedown", this.Jp, !1), b.addEventListener("mouseup", this.Mp, !1), b.addEventListener("mousewheel", this.zh, !1), b.addEventListener("DOMMouseScroll", this.zh, !1), b.addEventListener("mouseout", this.Lp, !1)), this.uC = a)
|
|
});
|
|
z.defineProperty(C, {
|
|
position: "position"
|
|
}, function() {
|
|
return this.sb
|
|
}, function(a) {
|
|
var b = this.sb;
|
|
if (!b.N(a)) {
|
|
z.l(a, N, C, "position");
|
|
var c = this.xb.copy();
|
|
a = a.copy();
|
|
if (!this.Vc && null !== this.Fb) {
|
|
this.Vc = !0;
|
|
var d = this.scale;
|
|
Nk(this, a, this.ad, this.Jb / d, this.Ob / d, this.Pn, !1);
|
|
this.Vc = !1
|
|
}
|
|
this.sb = a.V();
|
|
a = this.Ua;
|
|
a.wc && fk(a, b, this.sb);
|
|
this.Vc || this.fu(c, this.xb)
|
|
}
|
|
});
|
|
z.defineProperty(C, {
|
|
ZH: "initialPosition"
|
|
}, function() {
|
|
return this.wv
|
|
}, function(a) {
|
|
this.wv.N(a) || (z.l(a, N, C, "initialPosition"), this.wv = a.V())
|
|
});
|
|
z.defineProperty(C, {
|
|
$H: "initialScale"
|
|
}, function() {
|
|
return this.xv
|
|
}, function(a) {
|
|
this.xv !== a && (z.g(a, "number", C, "initialScale"), this.xv = a)
|
|
});
|
|
z.defineProperty(C, {
|
|
Gt: "grid"
|
|
}, function() {
|
|
null === this.td && Fk(this);
|
|
return this.td
|
|
}, function(a) {
|
|
var b = this.td;
|
|
if (b !== a) {
|
|
null === b && (Fk(this), b = this.td);
|
|
z.l(a, I, C, "grid");
|
|
a.type !== Gk && z.k("Diagram.grid must be a Panel of type Panel.Grid");
|
|
var c = b.U;
|
|
null !== c && c.remove(b);
|
|
this.td = a;
|
|
a.name = "GRID";
|
|
null !== c && c.add(a);
|
|
hl(this);
|
|
this.ta();
|
|
this.j("grid", b, a)
|
|
}
|
|
});
|
|
z.w(C, {
|
|
xb: "viewportBounds"
|
|
}, function() {
|
|
var a = this.wD;
|
|
if (null === this.Fb) return a;
|
|
var b = this.sb,
|
|
c = this.bc;
|
|
a.n(b.x, b.y, Math.max(this.Jb, 0) / c, Math.max(this.Ob, 0) / c);
|
|
return a
|
|
});
|
|
z.defineProperty(C, {
|
|
uE: "fixedBounds"
|
|
}, function() {
|
|
return this.nv
|
|
}, function(a) {
|
|
var b = this.nv;
|
|
b.N(a) || (z.l(a, w, C, "fixedBounds"), (u && Infinity === a.width || -Infinity === a.width || Infinity === a.height || -Infinity === a.height) && z.k("fixedBounds width/height must not be Infinity"), this.nv = a = a.V(), this.yc(), this.j("fixedBounds", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
BF: "scrollMargin"
|
|
}, function() {
|
|
return this.iw
|
|
}, function(a) {
|
|
"number" === typeof a ? a = new Db(a) : z.l(a, Db, C, "scrollMargin");
|
|
var b = this.iw;
|
|
b.N(a) || (this.iw = a = a.V(), this.yc(), this.j("scrollMargin", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
MA: "scrollMode"
|
|
}, function() {
|
|
return this.jw
|
|
}, function(a) {
|
|
var b = this.jw;
|
|
b !== a && (z.Ba(a, C, C, "scrollMode"), this.jw = a, a === qk && Lk(this, !1), this.j("scrollMode", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
jF: "positionComputation"
|
|
}, function() {
|
|
return this.bw
|
|
}, function(a) {
|
|
var b = this.bw;
|
|
b !== a && (null !== a && z.g(a, "function", C, "positionComputation"), this.bw = a, Lk(this, !1), this.j("positionComputation", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
AF: "scaleComputation"
|
|
}, function() {
|
|
return this.fw
|
|
}, function(a) {
|
|
var b = this.fw;
|
|
b !== a && (null !== a && z.g(a, "function", C, "scaleComputation"), this.fw = a, Fl(this, this.scale, this.scale), this.j("scaleComputation", b, a))
|
|
});
|
|
z.w(C, {
|
|
ad: "documentBounds"
|
|
}, function() {
|
|
return this.hv
|
|
});
|
|
|
|
function Ok(a, b) {
|
|
a.Ij = !1;
|
|
var c = a.hv;
|
|
c.N(b) || (b = b.V(), a.hv = b, Lk(a, !1), a.Ja("DocumentBoundsChanged", null, c.copy()), Vk(a))
|
|
}
|
|
z.defineProperty(C, {
|
|
scale: "scale"
|
|
}, function() {
|
|
return this.bc
|
|
}, function(a) {
|
|
var b = this.bc;
|
|
z.p(a, C, "scale");
|
|
b !== a && Fl(this, b, a)
|
|
});
|
|
z.defineProperty(C, {
|
|
wl: "autoScale"
|
|
}, function() {
|
|
return this.dm
|
|
}, function(a) {
|
|
var b = this.dm;
|
|
b !== a && (z.Ba(a, C, C, "autoScale"), this.dm = a, this.j("autoScale", b, a), a !== jh && Lk(this, !1))
|
|
});
|
|
z.defineProperty(C, {
|
|
DK: "initialAutoScale"
|
|
}, function() {
|
|
return this.Xk
|
|
}, function(a) {
|
|
var b = this.Xk;
|
|
b !== a && (z.Ba(a, C, C, "initialAutoScale"), this.Xk = a, this.j("initialAutoScale", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
aI: "initialViewportSpot"
|
|
}, function() {
|
|
return this.yv
|
|
}, function(a) {
|
|
var b = this.yv;
|
|
b !== a && (z.l(a, Q, C, "initialViewportSpot"), a.cd() || z.k("initialViewportSpot must be a specific Spot: " + a), this.yv = a, this.j("initialViewportSpot", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
YH: "initialDocumentSpot"
|
|
}, function() {
|
|
return this.vv
|
|
}, function(a) {
|
|
var b = this.vv;
|
|
b !== a && (z.l(a, Q, C, "initialDocumentSpot"), a.cd() || z.k("initialViewportSpot must be a specific Spot: " + a), this.vv = a, this.j("initialDocumentSpot", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
yh: "minScale"
|
|
}, function() {
|
|
return this.Nv
|
|
}, function(a) {
|
|
z.p(a, C, "minScale");
|
|
var b = this.Nv;
|
|
b !== a && (0 < a ? (this.Nv = a, this.j("minScale", b, a), a > this.scale && (this.scale = a)) : z.ka(a, "> 0", C, "minScale"))
|
|
});
|
|
z.defineProperty(C, {
|
|
xh: "maxScale"
|
|
}, function() {
|
|
return this.Kv
|
|
}, function(a) {
|
|
z.p(a, C, "maxScale");
|
|
var b = this.Kv;
|
|
b !== a && (0 < a ? (this.Kv = a, this.j("maxScale", b, a), a < this.scale && (this.scale = a)) : z.ka(a, "> 0", C, "maxScale"))
|
|
});
|
|
z.defineProperty(C, {
|
|
$l: "zoomPoint"
|
|
}, function() {
|
|
return this.Bw
|
|
}, function(a) {
|
|
this.Bw.N(a) || (z.l(a, N, C, "zoomPoint"), this.Bw = a = a.V())
|
|
});
|
|
z.defineProperty(C, {
|
|
XD: "contentAlignment"
|
|
}, function() {
|
|
return this.Pn
|
|
}, function(a) {
|
|
var b = this.Pn;
|
|
b.N(a) || (z.l(a, Q, C, "contentAlignment"), this.Pn = a = a.V(), this.j("contentAlignment", b, a), Lk(this, !1))
|
|
});
|
|
z.defineProperty(C, {
|
|
EK: "initialContentAlignment"
|
|
}, function() {
|
|
return this.no
|
|
}, function(a) {
|
|
var b = this.no;
|
|
b.N(a) || (z.l(a, Q, C, "initialContentAlignment"), this.no = a = a.V(), this.j("initialContentAlignment", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
padding: "padding"
|
|
}, function() {
|
|
return this.df
|
|
}, function(a) {
|
|
"number" === typeof a ? a = new Db(a) : z.l(a, Db, C, "padding");
|
|
var b = this.df;
|
|
b.N(a) || (this.df = a = a.V(), this.yc(), this.j("padding", b, a))
|
|
});
|
|
z.w(C, {
|
|
Lg: "nodes"
|
|
}, function() {
|
|
return this.Fo.i
|
|
});
|
|
z.w(C, {
|
|
links: "links"
|
|
}, function() {
|
|
return this.zo.i
|
|
});
|
|
z.w(C, {
|
|
ni: "parts"
|
|
}, function() {
|
|
return this.mb.i
|
|
});
|
|
C.prototype.findTopLevelNodesAndLinks = function() {
|
|
for (var a = new K(D), b = this.Fo.i; b.next();) {
|
|
var c = b.value;
|
|
c.Bp && a.add(c)
|
|
}
|
|
for (b = this.zo.i; b.next();) c = b.value, c.Bp && a.add(c);
|
|
return a.i
|
|
};
|
|
C.prototype.findTopLevelGroups = function() {
|
|
return this.ol.i
|
|
};
|
|
z.defineProperty(C, {
|
|
Sb: "layout"
|
|
}, function() {
|
|
return this.he
|
|
}, function(a) {
|
|
var b = this.he;
|
|
b !== a && (z.l(a, vg, C, "layout"), null !== b && (b.h = null, b.group = null), this.he = a, a.h = this, a.group = null, this.Qu = !0, this.j("layout", b, a), this.Ce())
|
|
});
|
|
C.prototype.layoutDiagram = function(a) {
|
|
Jk(this);
|
|
a && Xl(this, !0);
|
|
il(this, !1)
|
|
};
|
|
|
|
function Xl(a, b) {
|
|
for (var c = a.ol.i; c.next();) em(a, c.value, b);
|
|
null !== a.Sb && (b ? a.Sb.Gf = !1 : a.Sb.I())
|
|
}
|
|
|
|
function em(a, b, c) {
|
|
if (null !== b) {
|
|
for (var d = b.wm.i; d.next();) em(a, d.value, c);
|
|
null !== b.Sb && (c ? b.Sb.Gf = !1 : b.Sb.I())
|
|
}
|
|
}
|
|
|
|
function il(a, b) {
|
|
if (!a.yy) {
|
|
var c = a.Sb,
|
|
d = a.$a;
|
|
a.$a = !0;
|
|
try {
|
|
a.Wb("Layout");
|
|
var e = a.Ua;
|
|
1 !== a.pa.Gh || e.nf || e.wc || e.sn("Layout");
|
|
for (var g = a.ol.i; g.next();) fm(a, g.value, b);
|
|
c.Gf || b && !c.SE && 1 !== a.pa.Gh || (c.doLayout(a), Jk(a), c.Gf = !0)
|
|
} finally {
|
|
a.Jd("Layout"), a.Qu = !c.Gf, a.$a = d
|
|
}
|
|
}
|
|
}
|
|
|
|
function fm(a, b, c) {
|
|
if (null !== b) {
|
|
for (var d = b.wm.i; d.next();) fm(a, d.value, c);
|
|
d = b.Sb;
|
|
null === d || d.Gf || c && !d.SE || (b.dz = !b.location.F(), d.doLayout(b), b.I(gm), d.Gf = !0, ll(a, b))
|
|
}
|
|
}
|
|
z.defineProperty(C, {
|
|
ce: "isTreePathToChildren"
|
|
}, function() {
|
|
return this.Cv
|
|
}, function(a) {
|
|
var b = this.Cv;
|
|
if (b !== a && (z.g(a, "boolean", C, "isTreePathToChildren"), this.Cv = a, this.j("isTreePathToChildren", b, a), !this.pa.qb))
|
|
for (a = this.Lg; a.next();) hm(a.value)
|
|
});
|
|
C.prototype.findTreeRoots = function() {
|
|
for (var a = new J(E), b = this.Lg; b.next();) {
|
|
var c = b.value;
|
|
c.Bp && null === c.pp() && a.add(c)
|
|
}
|
|
return a.i
|
|
};
|
|
z.defineProperty(C, {
|
|
bB: "treeCollapsePolicy"
|
|
}, function() {
|
|
return this.ww
|
|
}, function(a) {
|
|
var b = this.ww;
|
|
b !== a && (z.Ba(a, C, C, "treeCollapsePolicy"), this.ww = a, this.j("treeCollapsePolicy", b, a))
|
|
});
|
|
z.defineProperty(C, {
|
|
vh: null
|
|
}, function() {
|
|
return this.lC
|
|
}, function(a) {
|
|
this.lC = a
|
|
});
|
|
|
|
function rk(a) {
|
|
function b(a) {
|
|
var b = a.toLowerCase(),
|
|
h = new J("function");
|
|
c.add(a, h);
|
|
c.add(b, h);
|
|
d.add(a, a);
|
|
d.add(b, a)
|
|
}
|
|
var c = new na("string", J),
|
|
d = new na("string", "string");
|
|
b("AnimationStarting");
|
|
b("AnimationFinished");
|
|
b("BackgroundSingleClicked");
|
|
b("BackgroundDoubleClicked");
|
|
b("BackgroundContextClicked");
|
|
b("ClipboardChanged");
|
|
b("ClipboardPasted");
|
|
b("DocumentBoundsChanged");
|
|
b("ExternalObjectsDropped");
|
|
b("InitialLayoutCompleted");
|
|
b("LayoutCompleted");
|
|
b("LinkDrawn");
|
|
b("LinkRelinked");
|
|
b("LinkReshaped");
|
|
b("Modified");
|
|
b("ObjectSingleClicked");
|
|
b("ObjectDoubleClicked");
|
|
b("ObjectContextClicked");
|
|
b("PartCreated");
|
|
b("PartResized");
|
|
b("PartRotated");
|
|
b("SelectionMoved");
|
|
b("SelectionCopied");
|
|
b("SelectionDeleting");
|
|
b("SelectionDeleted");
|
|
b("SelectionGrouped");
|
|
b("SelectionUngrouped");
|
|
b("ChangingSelection");
|
|
b("ChangedSelection");
|
|
b("SubGraphCollapsed");
|
|
b("SubGraphExpanded");
|
|
b("TextEdited");
|
|
b("TreeCollapsed");
|
|
b("TreeExpanded");
|
|
b("ViewportBoundsChanged");
|
|
a.Ay = c;
|
|
a.zy = d
|
|
}
|
|
|
|
function Ia(a, b) {
|
|
var c = a.zy.na(b);
|
|
return null !== c ? c : a.zy.na(b.toLowerCase())
|
|
}
|
|
|
|
function im(a, b) {
|
|
var c = a.Ay.na(b);
|
|
if (null !== c) return c;
|
|
c = a.Ay.na(b.toLowerCase());
|
|
if (null !== c) return c;
|
|
z.k("Unknown DiagramEvent name: " + b);
|
|
return null
|
|
}
|
|
C.prototype.addDiagramListener = C.prototype.yz = function(a, b) {
|
|
z.g(a, "string", C, "addDiagramListener:name");
|
|
z.g(b, "function", C, "addDiagramListener:listener");
|
|
var c = im(this, a);
|
|
null !== c && c.add(b)
|
|
};
|
|
C.prototype.removeDiagramListener = C.prototype.mF = function(a, b) {
|
|
z.g(a, "string", C, "removeDiagramListener:name");
|
|
z.g(b, "function", C, "addDiagramListener:listener");
|
|
var c = im(this, a);
|
|
null !== c && c.remove(b)
|
|
};
|
|
C.prototype.raiseDiagramEvent = C.prototype.Ja = function(a, b, c) {
|
|
u && z.g(a, "string", C, "raiseDiagramEvent:name");
|
|
var d = im(this, a),
|
|
e = new Qf;
|
|
e.h = this;
|
|
e.name = Ia(this, a);
|
|
void 0 !== b && (e.WA = b);
|
|
void 0 !== c && (e.CA = c);
|
|
a = d.length;
|
|
if (1 === a) d = d.ea(0), d(e);
|
|
else if (0 !== a)
|
|
for (b = d.jc(), c = 0; c < a; c++) d = b[c], d(e);
|
|
return e.cancel
|
|
};
|
|
|
|
function ki(a, b) {
|
|
var c = !1;
|
|
a.xb.mk(b) && (c = !0);
|
|
c = a.Wz(b, function(a) {
|
|
return a.ca
|
|
}, function(a) {
|
|
return a instanceof G
|
|
}, !0, function(a) {
|
|
return a instanceof G
|
|
}, c);
|
|
if (0 !== c.count)
|
|
for (c = c.i; c.next();) {
|
|
var d = c.value;
|
|
d.jj && d.qc()
|
|
}
|
|
}
|
|
C.prototype.isUnoccupied = C.prototype.Dp = function(a, b) {
|
|
void 0 === b && (b = null);
|
|
return ja(this, !1, null, b).Dp(a.x, a.y, a.width, a.height)
|
|
};
|
|
|
|
function ja(a, b, c, d) {
|
|
null === a.Ed && (a.Ed = new jm);
|
|
if (a.Ed.yp || a.Ed.group !== c || a.Ed.UA !== d) {
|
|
if (null === c) {
|
|
b = a.Ij ? Kk(a) : a.ad.copy();
|
|
b.ag(100, 100);
|
|
a.Ed.initialize(b);
|
|
b = z.kg();
|
|
for (var e = a.Lg; e.next();) {
|
|
var g = e.value,
|
|
h = g.layer;
|
|
null !== h && h.visible && !h.Nc && km(a, g, d, b)
|
|
}
|
|
} else
|
|
for (c.W.F() || c.Bf(), b = c.W.copy(), b.ag(20, 20), a.Ed.initialize(b), b = z.kg(), e = c.Hc; e.next();) g = e.value, g instanceof E && km(a, g, d, b);
|
|
z.dc(b);
|
|
a.Ed.group = c;
|
|
a.Ed.UA = d;
|
|
a.Ed.yp = !1
|
|
} else b && lm(a.Ed);
|
|
return a.Ed
|
|
}
|
|
|
|
function km(a, b, c, d) {
|
|
if (b !== c)
|
|
if (b.isVisible() && b.canAvoid()) {
|
|
c = b.getAvoidableRect(d);
|
|
d = a.Ed.ep;
|
|
b = a.Ed.cp;
|
|
for (var e = c.x + c.width, g = c.y + c.height, h = c.x; h < e; h += d) {
|
|
for (var k = c.y; k < g; k += b) mm(a.Ed, h, k);
|
|
mm(a.Ed, h, g)
|
|
}
|
|
for (k = c.y; k < g; k += b) mm(a.Ed, e, k);
|
|
mm(a.Ed, e, g)
|
|
} else if (b instanceof F)
|
|
for (b = b.Hc; b.next();) e = b.value, e instanceof E && km(a, e, c, d)
|
|
}
|
|
|
|
function nm(a, b) {
|
|
null === a.Ed || a.Ed.yp || null !== b && !b.canAvoid() || (a.Ed.yp = !0)
|
|
}
|
|
C.prototype.simulatedMouseMove = C.prototype.Px = function(a, b, c) {
|
|
if (null !== Hh) {
|
|
var d = Hh.h;
|
|
c instanceof C || (c = null);
|
|
var e = Ih;
|
|
c !== e && (null !== e && e !== d && null !== e.hb.me && (Nh(e), Hh.hx = !1, e.hb.me.doSimulatedDragLeave()), Ih = c, null !== c && c !== d && null !== c.hb.me && (Uh(), e = c.hb.me, Qh.contains(e) || Qh.add(e), c.hb.me.doSimulatedDragEnter()));
|
|
if (null === c || c === d || !c.FD || c.jb || !c.ap) return !1;
|
|
d = c.hb.me;
|
|
null !== d && (null !== a ? b = c.lo(a) : null === b && (b = new N), c.Qb.ga = b, c.Qb.El = !1, c.Qb.up = !1, d.doSimulatedDragOver());
|
|
return !0
|
|
}
|
|
return !1
|
|
};
|
|
C.prototype.simulatedMouseUp = C.prototype.MF = function(a, b, c, d) {
|
|
if (null !== Hh) {
|
|
null === d && (d = b);
|
|
b = Ih;
|
|
var e = Hh.h;
|
|
if (d !== b) {
|
|
if (null !== b && b !== e && null !== b.hb.me) return Nh(b), Hh.hx = !1, b.hb.me.doSimulatedDragLeave(), !1;
|
|
Ih = d;
|
|
null !== d && null !== d.hb.me && (Uh(), b = d.hb.me, Qh.contains(b) || Qh.add(b), d.hb.me.doSimulatedDragEnter())
|
|
}
|
|
if (null === d) return Hh.doCancel(), !0;
|
|
if (d !== this) return null !== a && (c = d.lo(a)), d.Qb.ga = c, d.Qb.El = !1, d.Qb.up = !0, a = d.hb.me, null !== a && a.doSimulatedDrop(), a = Hh, null !== a && (d = a.mayCopy(), a.Mf = d ? "Copy" :
|
|
"Move", a.stopTool()), !0
|
|
}
|
|
return !1
|
|
};
|
|
z.defineProperty(C, {
|
|
MD: "autoScrollRegion"
|
|
}, function() {
|
|
return this.Su
|
|
}, function(a) {
|
|
"number" === typeof a ? a = new Db(a) : z.l(a, Db, C, "autoScrollRegion");
|
|
var b = this.Su;
|
|
b.N(a) || (this.Su = a = a.V(), this.yc(), this.j("autoScrollRegion", b, a))
|
|
});
|
|
|
|
function fi(a, b) {
|
|
a.Ru.assign(b);
|
|
om(a, a.Ru).Mc(a.position) ? Nh(a) : pm(a)
|
|
}
|
|
|
|
function pm(a) {
|
|
-1 === a.In && (a.In = z.setTimeout(function() {
|
|
if (-1 !== a.In) {
|
|
Nh(a);
|
|
var b = a.Q.event;
|
|
if (null !== b) {
|
|
var c = om(a, a.Ru);
|
|
c.Mc(a.position) || (a.position = c, a.Q.ga = a.cG(a.Ru), a.Px(b, null, b.target.Z) || a.doMouseMove(), a.Ij = !0, Ok(a, a.rh()), a.ue = !0, a.bg(), pm(a))
|
|
}
|
|
}
|
|
}, a.tB))
|
|
}
|
|
|
|
function Nh(a) {
|
|
-1 !== a.In && (z.clearTimeout(a.In), a.In = -1)
|
|
}
|
|
|
|
function om(a, b) {
|
|
var c = a.position,
|
|
d = a.MD;
|
|
if (0 >= d.top && 0 >= d.left && 0 >= d.right && 0 >= d.bottom) return c;
|
|
var e = a.xb,
|
|
g = a.scale,
|
|
e = z.yk(0, 0, e.width * g, e.height * g),
|
|
h = z.Tb(0, 0);
|
|
if (b.x >= e.x && b.x < e.x + d.left) {
|
|
var k = Math.max(a.nu, 1),
|
|
k = k | 0;
|
|
h.x -= k;
|
|
b.x < e.x + d.left / 2 && (h.x -= k);
|
|
b.x < e.x + d.left / 4 && (h.x -= 4 * k)
|
|
} else b.x <= e.x + e.width && b.x > e.x + e.width - d.right && (k = Math.max(a.nu, 1), k |= 0, h.x += k, b.x > e.x + e.width - d.right / 2 && (h.x += k), b.x > e.x + e.width - d.right / 4 && (h.x += 4 * k));
|
|
b.y >= e.y && b.y < e.y + d.top ? (k = Math.max(a.ou, 1), k |= 0, h.y -= k, b.y < e.y +
|
|
d.top / 2 && (h.y -= k), b.y < e.y + d.top / 4 && (h.y -= 4 * k)) : b.y <= e.y + e.height && b.y > e.y + e.height - d.bottom && (k = Math.max(a.ou, 1), k |= 0, h.y += k, b.y > e.y + e.height - d.bottom / 2 && (h.y += k), b.y > e.y + e.height - d.bottom / 4 && (h.y += 4 * k));
|
|
h.Mc(Id) || (c = new N(c.x + h.x / g, c.y + h.y / g));
|
|
z.dc(e);
|
|
z.A(h);
|
|
return c
|
|
}
|
|
C.prototype.makeSVG = C.prototype.makeSvg = function(a) {
|
|
void 0 === a && (a = new ma);
|
|
a.context = "svg";
|
|
a = qm(this, a);
|
|
return null !== a ? a.Vl : null
|
|
};
|
|
C.prototype.makeImage = function(a) {
|
|
void 0 === a && (a = new ma);
|
|
var b = (a.document || document).createElement("img");
|
|
b.src = this.xI(a);
|
|
return b
|
|
};
|
|
C.prototype.makeImageData = C.prototype.xI = function(a) {
|
|
void 0 === a && (a = new ma);
|
|
var b = qm(this, a);
|
|
return null !== b ? b.toDataURL(a.type, a.details) : ""
|
|
};
|
|
var rm = !1;
|
|
|
|
function qm(a, b) {
|
|
a.Ua.oi();
|
|
a.bg();
|
|
if (null === a.Fb) return null;
|
|
"object" !== typeof b && z.k("properties argument must be an Object.");
|
|
var c = !1,
|
|
d = b.size || null,
|
|
e = b.scale || null;
|
|
void 0 !== b.scale && isNaN(b.scale) && (e = "NaN");
|
|
var g = b.maxSize;
|
|
void 0 === b.maxSize && (c = !0, g = "svg" === b.context ? new Ea(Infinity, Infinity) : new Ea(2E3, 2E3));
|
|
var h = b.position || null,
|
|
k = b.parts || null,
|
|
l = void 0 === b.padding ? 1 : b.padding,
|
|
m = b.background || null,
|
|
n = b.omitTemporary;
|
|
void 0 === n && (n = !0);
|
|
var p = b.document || document,
|
|
q = b.elementFinished || null,
|
|
r =
|
|
b.showTemporary;
|
|
void 0 === r && (r = !n);
|
|
n = b.showGrid;
|
|
void 0 === n && (n = r);
|
|
null !== d && isNaN(d.width) && isNaN(d.height) && (d = null);
|
|
"number" === typeof l ? l = new Db(l) : l instanceof Db || (l = new Db(0));
|
|
l.left = Math.max(l.left, 0);
|
|
l.right = Math.max(l.right, 0);
|
|
l.top = Math.max(l.top, 0);
|
|
l.bottom = Math.max(l.bottom, 0);
|
|
a.bo = !1;
|
|
ca(a.gd, !0);
|
|
var s = new la(null, p),
|
|
t = s.yl,
|
|
v = s;
|
|
if (!(d || e || k || h)) return s.width = a.Jb + Math.ceil(l.left + l.right), s.height = a.Ob + Math.ceil(l.top + l.bottom), "svg" === b.context && (t = v = new ed(s.Kd, p, q), t instanceof ed &&
|
|
(a.bo = !0)), sl(a, t, l, new Ea(s.width, s.height), a.bc, a.sb, k, m, r, n), a.bo = !0, v;
|
|
var x = a.wb.Rw,
|
|
y = new N(0, 0),
|
|
A = a.ad.copy();
|
|
A.rJ(a.padding);
|
|
if (r)
|
|
for (var B = !0, B = a.Yb.o, L = B.length, H = 0; H < L; H++) {
|
|
var U = B[H];
|
|
if (U.visible && U.Nc)
|
|
for (var ea = U.mb.o, U = ea.length, W = 0; W < U; W++) {
|
|
var P = ea[W];
|
|
P.jx && P.isVisible() && (P = P.W, P.F() && A.qi(P))
|
|
}
|
|
}
|
|
y.x = A.x;
|
|
y.y = A.y;
|
|
if (null !== k) {
|
|
var ba, B = !0,
|
|
ea = k.i;
|
|
for (ea.reset(); ea.next();) L = ea.value, L instanceof D && (P = L, U = P.layer, null !== U && !U.visible || null !== U && !r && U.Nc || !P.isVisible() || (P = P.W, P.F() && (B ?
|
|
(B = !1, ba = P.copy()) : ba.qi(P))));
|
|
B && (ba = new w(0, 0, 0, 0));
|
|
A.width = ba.width;
|
|
A.height = ba.height;
|
|
y.x = ba.x;
|
|
y.y = ba.y
|
|
}
|
|
null !== h && h.F() && (y = h, e || (e = x));
|
|
B = ea = 0;
|
|
null !== l && (ea = l.left + l.right, B = l.top + l.bottom);
|
|
H = L = 0;
|
|
null !== d && (L = d.width, H = d.height, isFinite(L) && (L = Math.max(0, L - ea)), isFinite(H) && (H = Math.max(0, H - B)));
|
|
ba = h = 0;
|
|
null !== d && null !== e ? ("NaN" === e && (e = x), d.F() ? (h = L, ba = H) : isNaN(H) ? (h = L, ba = A.height * e) : (h = A.width * e, ba = H)) : null !== d ? d.F() ? (e = Math.min(L / A.width, H / A.height), h = L, ba = H) : isNaN(H) ? (e = L / A.width, h = L, ba = A.height *
|
|
e) : (e = H / A.height, h = A.width * e, ba = H) : null !== e ? "NaN" === e && g.F() ? (e = Math.min((g.width - ea) / A.width, (g.height - B) / A.height), e > x ? (e = x, h = A.width, ba = A.height) : (h = g.width, ba = g.height)) : (h = A.width * e, ba = A.height * e) : (e = x, h = A.width, ba = A.height);
|
|
null !== l ? (h += ea, ba += B) : l = new Db(0);
|
|
null !== g && (d = g.width, g = g.height, "svg" !== b.context && c && !rm && (h > d || ba > g) && (z.trace("Diagram.makeImage(data): Diagram width or height is larger than the default max size. (" + Math.ceil(h) + "x" + Math.ceil(ba) + " vs 2000x2000) Consider increasing the max size."),
|
|
rm = !0), isNaN(d) && (d = 2E3), isNaN(g) && (g = 2E3), isFinite(d) && (h = Math.min(h, d)), isFinite(g) && (ba = Math.min(ba, g)));
|
|
s.width = Math.ceil(h);
|
|
s.height = Math.ceil(ba);
|
|
"svg" === b.context && (t = v = new ed(s.Kd, p, q), t instanceof ed && (a.bo = !0));
|
|
sl(a, t, l, new Ea(Math.ceil(h), Math.ceil(ba)), e, y, k, m, r, n);
|
|
a.bo = !0;
|
|
return v
|
|
}
|
|
C.inherit = function(a, b) {
|
|
z.g(a, "function", C, "inherit");
|
|
z.g(b, "function", C, "inherit");
|
|
b.CG && z.k("Cannot inherit from " + z.kf(b));
|
|
z.Qa(a, b)
|
|
};
|
|
|
|
function Ak() {
|
|
this.FG = "63ad05bbe23a1786468a4c741b6d2";
|
|
this.og = this.FG === this._tk ? !0 : null
|
|
}
|
|
Ak.prototype.Zl = function(a) {
|
|
a.gd.setTransform(a.jd, 0, 0, a.jd, 0, 0);
|
|
if (null === this.og) a: {
|
|
var b = "f",
|
|
c = window[z.Fg("76a715b2f73f148a")][z.Fg("72ba13b5")];a = z.Fg;
|
|
if (window[a("7da7")] && window[a("7da7")][a("76a115b6ed251eaf4692")]) {
|
|
this.og = !0;
|
|
var d = window[a("7da7")][a("76a115b6ed251eaf4692")],
|
|
d = a(d).split(a("39e9")),
|
|
e = a(d[1]).split("."),
|
|
g = z[a("6cae19")].split(".");
|
|
if (e[0] > g[0] || e[0] === g[0] && e[1] >= g[1]) {
|
|
e = c[a("76ad18b4f73e")];
|
|
for (g = c[a("73a612b6fb191d")](a("35e7")) + 2; g < e; g++) b += c[g];
|
|
c = b[a("73a612b6fb191d")](a(d[2]));
|
|
0 > c && a(d[2]) !== a("7da71ca0ad381e90") && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));
|
|
0 > c && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));
|
|
this.og = !(0 <= c && c < b[a("73a612b6fb191d")](a("35")))
|
|
}
|
|
} else {
|
|
if (a("77bb5bb2f32603de") === window[a("76a715b2f73f148a")][a("6aba19a7ec351488")]) try {
|
|
this.og = !window[a("4da118b7ec2108")]([a("5bb806bfea351a904a84515e1b6d38b6")])([a("49bc19a1e6")])([a("59bd04a1e6380fa5539b")])([a("7bb8069ae7")] === a(z.adym));
|
|
if (!1 === this.og) break a;
|
|
this.og = !window[a("4da118b7ec2108")]([a("5bb806bfea351a904a84515e1b6d38b6")])([a("49bc19a1e6")])([a("59bd04a1e6380fa5539b6c7a197c31bb4cfd3e")])([a("7bb8069ae7")] ===
|
|
a(z.adym));
|
|
if (!1 === this.og) break a
|
|
} catch (h) {}
|
|
e = c[a("76ad18b4f73e")];
|
|
for (g = c[a("73a612b6fb191d")](a("35e7")) + 2; g < e; g++) b += c[g];
|
|
c = b[a("73a612b6fb191d")](a(z.adym));
|
|
0 > c && a(z.adym) !== a("7da71ca0ad381e90") && (c = b[a("73a612b6fb191d")](a("76a715b2ef3e149757")));
|
|
if (this.og = !(0 <= c && c < b[a("73a612b6fb191d")](a("35")))) b = window.document[a("79ba13b2f7333e8846865a7d00")]("div"), c = a("34af05b5c137188f449950661a6d"), "." === c[0] && (c = c[a("69bd14a0f724128a44")](1)), b[a("79a417a0f0181a8946")] = c, window.document[a("78a712aa")] ? (window.document[a("78a712aa")][a("7bb806b6ed32388c4a875b")](b),
|
|
c = window[a("7dad0290ec3b0b91578e5b40007031bf")](b)[a("7dad0283f1390b81519f4645156528bf")](a("78a704b7e62456904c9b12701b6532a8")), window.document[a("78a712aa")][a("68ad1bbcf533388c4a875b")](b), c && -1 !== c.indexOf(a(z.bH)) && -1 !== c.indexOf(a(z.cH)) && (this.og = !1)) : (this.og = null, this.og = !1)
|
|
}
|
|
}
|
|
return 0 < this.og && this !== this.DG ? !0 : !1
|
|
};
|
|
Ak.prototype.t = function() {
|
|
this.DG = null
|
|
};
|
|
|
|
function Bk(a, b) {
|
|
void 0 !== b && null !== b || z.k("Diagram setup requires an argument DIV.");
|
|
null !== a.Pb && z.k("Diagram has already completed setup.");
|
|
"string" === typeof b ? a.Pb = window.document.getElementById(b) : b instanceof HTMLDivElement ? a.Pb = b : z.k("No DIV or DIV id supplied: " + b);
|
|
null === a.Pb && z.k("Invalid DIV id; could not get element with id: " + b);
|
|
void 0 !== a.Pb.Z && z.k("Invalid div id; div already has a Diagram associated with it.");
|
|
"static" === window.getComputedStyle(a.Pb, null).position && (a.Pb.style.position =
|
|
"relative");
|
|
a.Pb.style["-webkit-tap-highlight-color"] = "rgba(255, 255, 255, 0)";
|
|
a.Pb.style["-ms-touch-action"] = "none";
|
|
a.Pb.innerHTML = "";
|
|
a.Pb.Z = a;
|
|
var c = new la(a);
|
|
c.Kd.innerHTML = "This text is displayed if your browser does not support the Canvas HTML element.";
|
|
void 0 !== c.style && (c.style.position = "absolute", c.style.top = "0px", c.style.left = "0px", "rtl" === window.getComputedStyle(a.Pb, null).getPropertyValue("direction") && (a.mr = !0), c.style.zIndex = "2", c.style.DL = "none", c.style.webkitUserSelect = "none", c.style.MozUserSelect =
|
|
"none");
|
|
a.Jb = a.Pb.clientWidth || 1;
|
|
a.Ob = a.Pb.clientHeight || 1;
|
|
a.Fb = c;
|
|
a.gd = c.yl;
|
|
var d = a.gd;
|
|
a.vG = (window.devicePixelRatio || 1) / (d.webkitBackingStorePixelRatio || d.mozBackingStorePixelRatio || d.msBackingStorePixelRatio || d.oBackingStorePixelRatio || d.backingStorePixelRatio || 1);
|
|
a.jd = a.computePixelRatio();
|
|
ul(a, a.Jb, a.Ob);
|
|
a.Dy = d[z.Fg("7eba17a4ca3b1a8346")][z.Fg("78a118b7")](d, z.Zl, 4, 4);
|
|
a.Pb.insertBefore(c.Kd, a.Pb.firstChild);
|
|
c = new la(null);
|
|
c.width = 1;
|
|
c.height = 1;
|
|
a.Cy = c;
|
|
a.aC = c.yl;
|
|
var c = z.createElement("div"),
|
|
e = z.createElement("div");
|
|
c.style.position = "absolute";
|
|
c.style.overflow = "auto";
|
|
c.style.width = a.Jb + "px";
|
|
c.style.height = a.Ob + "px";
|
|
c.style.zIndex = "1";
|
|
e.style.position = "absolute";
|
|
e.style.width = "1px";
|
|
e.style.height = "1px";
|
|
a.Pb.appendChild(c);
|
|
c.appendChild(e);
|
|
c.onscroll = a.xG;
|
|
c.onmousedown = a.JC;
|
|
c.ontouchstart = a.JC;
|
|
c.Z = a;
|
|
c.AG = !0;
|
|
c.BG = !0;
|
|
a.kw = c;
|
|
a.xs = e;
|
|
a.HA = z.aE(function() {
|
|
a.ck = null;
|
|
a.ta()
|
|
}, 300, !1);
|
|
a.hG = z.aE(function() {
|
|
Tj(a)
|
|
}, 250, !1);
|
|
a.preventDefault = function(a) {
|
|
a.preventDefault();
|
|
return !1
|
|
};
|
|
a.Kp = function(b) {
|
|
if (a.isEnabled) {
|
|
a.km = !0;
|
|
var c =
|
|
a.Zc;
|
|
z.jn && c.lj ? (b.preventDefault(), b.simulated = !0, a.Ks = b) : (a.Zc = a.Qb, a.Qb = c, Rk(a, a, b, c, !0), a.Px(b, null, b.target.Z) || (a.doMouseMove(), a.eb.isBeyondDragSize() && (a.bl = 0), ha(a, c, b)))
|
|
}
|
|
};
|
|
a.Jp = function(b) {
|
|
if (a.isEnabled) {
|
|
a.km = !0;
|
|
var c = a.Zc;
|
|
if (z.jn && null !== a.Ks) a.Ks = b, b.preventDefault();
|
|
else if (z.jn && 400 > b.timeStamp - a.pm) b.preventDefault();
|
|
else if (a.Zk) b.preventDefault();
|
|
else {
|
|
a.Zc = a.Qb;
|
|
a.Qb = c;
|
|
Rk(a, a, b, c, !0);
|
|
c.El = !0;
|
|
c.Pe = b.detail;
|
|
if (z.NE || z.OE) b.timeStamp - a.pm < a.tD && !a.eb.isBeyondDragSize() ? a.bl++ : a.bl = 1,
|
|
a.pm = b.timeStamp, c.Pe = a.bl;
|
|
a.Ei = c;
|
|
!0 === c.Yq.simulated ? (b.preventDefault(), b.simulated = !0) : (u && u.fF && (window.fF = a.mp(c.ga)), Hh = null, a.doMouseDown(), a.Ei = a.Ei.copy(), 1 === b.button ? b.preventDefault() : ha(a, c, b))
|
|
}
|
|
}
|
|
};
|
|
a.Mp = function(b) {
|
|
if (a.isEnabled)
|
|
if (a.Zk && 2 === b.button) b.preventDefault();
|
|
else if (a.Zk && 0 === b.button && (a.Zk = !1), a.Ss) b.preventDefault();
|
|
else {
|
|
a.km = !0;
|
|
var c = a.Zc;
|
|
if (z.jn) {
|
|
if (400 > b.timeStamp - a.pm) {
|
|
b.preventDefault();
|
|
return
|
|
}
|
|
a.pm = b.timeStamp
|
|
}
|
|
if (z.jn && null !== a.Ks) a.Ks = null, b.preventDefault();
|
|
else {
|
|
a.Zc =
|
|
a.Qb;
|
|
a.Qb = c;
|
|
Rk(a, a, b, c, !0);
|
|
c.up = !0;
|
|
c.Pe = b.detail;
|
|
if (z.NE || z.OE) c.Pe = a.bl;
|
|
c.bubbles = b.bubbles;
|
|
b.target.Z && (c.Sg = b.target.Z);
|
|
a.MF(b, null, new N, c.Sg) || (a.doMouseUp(), Nh(a), ha(a, c, b))
|
|
}
|
|
}
|
|
};
|
|
a.zh = function(b) {
|
|
if (a.isEnabled) {
|
|
var c = a.Zc;
|
|
a.Zc = a.Qb;
|
|
a.Qb = c;
|
|
Rk(a, a, b, c, !0);
|
|
c.bubbles = !0;
|
|
c.Cl = void 0 !== b.wheelDelta ? b.wheelDelta : -40 * b.detail;
|
|
a.doMouseWheel();
|
|
ha(a, c, b)
|
|
}
|
|
};
|
|
a.Lp = function() {
|
|
if (a.isEnabled) {
|
|
a.km = !1;
|
|
var b = a.eb;
|
|
b.cancelWaitAfter();
|
|
b instanceof dh && b.hideToolTip()
|
|
}
|
|
};
|
|
a.ZF = function(b) {
|
|
if (a.isEnabled) {
|
|
a.Ss = !1;
|
|
a.Zk = !0;
|
|
var c = a.Zc;
|
|
a.Zc = a.Qb;
|
|
a.Qb = c;
|
|
Tk(a, b, b.targetTouches[0], c, 1 < b.touches.length);
|
|
a.doMouseDown();
|
|
ha(a, c, b)
|
|
}
|
|
};
|
|
a.YF = function(b) {
|
|
if (a.isEnabled) {
|
|
var c = a.Zc;
|
|
a.Zc = a.Qb;
|
|
a.Qb = c;
|
|
var d = null;
|
|
0 < b.changedTouches.length ? d = b.changedTouches[0] : 0 < b.targetTouches.length && (d = b.targetTouches[0]);
|
|
Uk(a, b, d, c, 1 < b.touches.length);
|
|
a.Px(d ? d : b, null, c.Sg) || a.doMouseMove();
|
|
ha(a, c, b)
|
|
}
|
|
};
|
|
a.XF = function(b) {
|
|
if (a.isEnabled)
|
|
if (a.Ss) b.preventDefault();
|
|
else {
|
|
var c = a.Zc;
|
|
a.Zc = a.Qb;
|
|
a.Qb = c;
|
|
if (1 < b.touches.length) a.sp("hasGestureZoom") &&
|
|
(a.Ly = !1);
|
|
else {
|
|
var d = null,
|
|
e = null;
|
|
0 < b.changedTouches.length ? e = b.changedTouches[0] : 0 < b.targetTouches.length && (e = b.targetTouches[0]);
|
|
c.h = a;
|
|
c.Pe = 1;
|
|
if (null !== e) {
|
|
d = window.document.elementFromPoint(e.clientX, e.clientY);
|
|
null !== d && d.Z instanceof C && d.Z !== a && Sk(d.Z, e, c);
|
|
Sk(a, b.changedTouches[0], c);
|
|
var m = e.screenX,
|
|
n = e.screenY,
|
|
p = a.zC;
|
|
b.timeStamp - a.pm < a.tD && !(25 < Math.abs(p.x - m) || 25 < Math.abs(p.y - n)) ? a.bl++ : a.bl = 1;
|
|
c.Pe = a.bl;
|
|
a.pm = b.timeStamp;
|
|
a.zC.n(m, n)
|
|
}
|
|
c.xd = 0;
|
|
c.button = 0;
|
|
c.buttons = 1;
|
|
c.El = !1;
|
|
c.up = !0;
|
|
c.Cl = 0;
|
|
c.Gc = !1;
|
|
c.bubbles = !1;
|
|
c.event = b;
|
|
c.timestamp = Date.now();
|
|
c.Sg = null === d ? b.target.Z : d.Z ? d.Z : null;
|
|
c.Ge = null;
|
|
a.MF(e ? e : b, null, new N, c.Sg) || a.doMouseUp();
|
|
ha(a, c, b);
|
|
a.Zk = !1
|
|
}
|
|
}
|
|
};
|
|
a.QI = function(b) {
|
|
if ("touch" === b.pointerType) {
|
|
var c = a.TC;
|
|
void 0 === c[b.pointerId] && (a.aw++, c[b.pointerId] = b);
|
|
a.Uf[0] = null;
|
|
a.Uf[1] = null;
|
|
for (var d in c)
|
|
if (null === a.Uf[0]) a.Uf[0] = c[d];
|
|
else if (null === a.Uf[1]) {
|
|
a.Uf[1] = c[d];
|
|
break
|
|
}
|
|
a.isEnabled && (a.Ss = !1, a.Zk = !0, c = a.Zc, a.Zc = a.Qb, a.Qb = c, Tk(a, b, b, c, 1 < a.aw), a.doMouseDown(), ha(a, c, b))
|
|
}
|
|
};
|
|
a.SI = function(b) {
|
|
if ("touch" ===
|
|
b.pointerType && !(2 > a.aw)) {
|
|
var c = a.Uf;
|
|
c[0].pointerId === b.pointerId && (c[0] = b);
|
|
c[1].pointerId === b.pointerId && (c[1] = b);
|
|
a.isEnabled && (c = a.Zc, a.Zc = a.Qb, a.Qb = c, Uk(a, b, b, c, !0), a.Px(b, null, c.Sg) || (a.doMouseMove(), ha(a, c, b)))
|
|
}
|
|
};
|
|
a.RI = function(b) {
|
|
if ("touch" === b.pointerType) {
|
|
var c = a.TC;
|
|
void 0 !== c[b.pointerId] && (a.aw--, delete c[b.pointerId], c = a.Uf, null !== c[0] && c[0].pointerId === b.pointerId && (c[0] = null), null !== c[1] && c[1].pointerId === b.pointerId && (c[1] = null))
|
|
}
|
|
};
|
|
ca(d, !0);
|
|
Ek(a)
|
|
}
|
|
|
|
function sm(a) {
|
|
1 < arguments.length && z.k("Palette constructor can only take one optional argument, the DIV HTML element or its id.");
|
|
C.call(this, a);
|
|
this.kt = !0;
|
|
this.ul = !1;
|
|
this.jb = !0;
|
|
this.XD = $b;
|
|
this.Sb = new tm
|
|
}
|
|
z.Qa(sm, C);
|
|
z.ia("Palette", sm);
|
|
|
|
function xk(a) {
|
|
1 < arguments.length && z.k("Overview constructor can only take one optional argument, the DIV HTML element or its id.");
|
|
C.call(this, a);
|
|
this.Ua.isEnabled = !1;
|
|
this.Vc = !0;
|
|
this.Wj = null;
|
|
this.kv = !0;
|
|
this.kJ("drawShadows", !1);
|
|
var b = new D,
|
|
c = new X;
|
|
c.stroke = "magenta";
|
|
c.ub = 2;
|
|
c.fill = "transparent";
|
|
c.name = "BOXSHAPE";
|
|
b.vk = !0;
|
|
b.Ix = "BOXSHAPE";
|
|
b.sx = "BOXSHAPE";
|
|
b.wF = "BOXSHAPE";
|
|
b.cursor = "move";
|
|
b.add(c);
|
|
this.em = b;
|
|
c = new da;
|
|
c.type = Yi;
|
|
c.of = ec;
|
|
var d = new Zi;
|
|
d.Ff = !0;
|
|
c.add(d);
|
|
d = new X;
|
|
d.jk = ec;
|
|
d.Hb = "Rectangle";
|
|
d.Aa = new Ea(64,
|
|
64);
|
|
d.cursor = "se-resize";
|
|
d.alignment = ic;
|
|
c.add(d);
|
|
b.uF = c;
|
|
this.Sm = this.kk = !1;
|
|
this.xf = this.mt = !0;
|
|
this.MD = 0;
|
|
this.oz = new la(null);
|
|
this.EG = this.oz.yl;
|
|
this.hb.me = new um;
|
|
this.hb.xF = new vm;
|
|
var e = this;
|
|
this.click = function() {
|
|
var a = e.Wj;
|
|
if (null !== a) {
|
|
var b = a.xb,
|
|
c = e.Q.ga;
|
|
a.position = new N(c.x - b.width / 2, c.y - b.height / 2)
|
|
}
|
|
};
|
|
this.hF = function() {
|
|
wm(e)
|
|
};
|
|
this.gF = function() {
|
|
null !== e.Wj && (e.yc(), e.ta())
|
|
};
|
|
this.wl = Pk;
|
|
this.Vc = !1
|
|
}
|
|
z.Qa(xk, C);
|
|
z.ia("Overview", xk);
|
|
|
|
function xm(a) {
|
|
a.Vc || a.Vd || !1 !== a.Vf || (a.Vf = !0, requestAnimationFrame(function() {
|
|
if (a.Vf && !a.Vd && (a.Vf = !1, null !== a.Pb)) {
|
|
a.Vd = !0;
|
|
Jk(a);
|
|
a.ad.F() || Ok(a, a.rh());
|
|
null === a.Pb && z.k("No div specified");
|
|
null === a.Fb && z.k("No canvas specified");
|
|
if (a.ue) {
|
|
var b = a.Wj;
|
|
if (null !== b && !b.Ua.nf && !b.Ua.wc) {
|
|
var b = a.gd,
|
|
c = a.oz;
|
|
b.setTransform(1, 0, 0, 1, 0, 0);
|
|
b.clearRect(0, 0, a.Fb.width, a.Fb.height);
|
|
b.drawImage(c.Kd, 0, 0);
|
|
c = a.Hd;
|
|
c.reset();
|
|
1 !== a.scale && c.scale(a.scale);
|
|
0 === a.position.x && 0 === a.position.y || c.translate(-a.position.x, -a.position.y);
|
|
b.scale(a.jd, a.jd);
|
|
b.transform(c.m11, c.m12, c.m21, c.m22, c.dx, c.dy);
|
|
for (var c = a.Yb.o, d = c.length, e = 0; e < d; e++) c[e].ff(b, a);
|
|
a.Yk = !1;
|
|
a.ue = !1
|
|
}
|
|
}
|
|
a.Vd = !1
|
|
}
|
|
}))
|
|
}
|
|
xk.prototype.computePixelRatio = function() {
|
|
return 1
|
|
};
|
|
xk.prototype.ff = function() {
|
|
null === this.Pb && z.k("No div specified");
|
|
null === this.Fb && z.k("No canvas specified");
|
|
if (this.ue) {
|
|
var a = this.Wj;
|
|
if (null !== a && !a.Ua.nf) {
|
|
pl(this);
|
|
var b = a.Gt;
|
|
(null !== b && b.visible && isNaN(b.width) || isNaN(b.height)) && hl(a);
|
|
var c = this.Fb,
|
|
b = this.gd,
|
|
d = this.oz,
|
|
e = this.EG;
|
|
d.width = c.width;
|
|
d.height = c.height;
|
|
ca(b, !0);
|
|
b.setTransform(1, 0, 0, 1, 0, 0);
|
|
b.clearRect(0, 0, c.width, c.height);
|
|
var g = this.Hd;
|
|
g.reset();
|
|
1 !== this.scale && g.scale(this.scale);
|
|
0 === this.position.x && 0 === this.position.y || g.translate(-this.position.x, -this.position.y);
|
|
b.scale(this.jd, this.jd);
|
|
b.transform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
|
|
for (var h = this.kv, k = this.xb, l = a.Yb.o, m = l.length, a = 0; a < m; a++) {
|
|
var n = l[a],
|
|
p = b,
|
|
q = k,
|
|
r = h;
|
|
if (n.visible && 0 !== n.Xc && (void 0 === r && (r = !0), r || !n.Nc)) {
|
|
1 !== n.Xc && (p.globalAlpha = n.Xc);
|
|
for (var r = this.scale, n = n.mb.o, s = n.length, t = 0; t < s; t++) {
|
|
var v = n[t],
|
|
x = v.W;
|
|
x.Ig(q) && (1 < x.width * r || 1 < x.height * r ? v.ff(p, this) : jk(v, p))
|
|
}
|
|
p.globalAlpha = 1
|
|
}
|
|
}
|
|
e.drawImage(c.Kd, 0, 0);
|
|
u && u.bj && (e.fillStyle = "red", e.fillRect(0, d.height / 2, d.width, 4));
|
|
c = this.Yb.o;
|
|
d = c.length;
|
|
for (a = 0; a < d; a++) c[a].ff(b, this);
|
|
u && (u.Rz || u.bj) && u.Qz(b, this, g);
|
|
this.ue = this.Yk = !1
|
|
}
|
|
}
|
|
};
|
|
z.defineProperty(xk, {
|
|
BA: "observed"
|
|
}, function() {
|
|
return this.Wj
|
|
}, function(a) {
|
|
var b = this.Wj;
|
|
null !== a && z.l(a, C, xk, "observed");
|
|
a instanceof xk && z.k("Overview.observed Diagram may not be an Overview itself: " + a);
|
|
b !== a && (null !== b && (this.remove(this.qh), b.mF("ViewportBoundsChanged", this.hF), b.mF("DocumentBoundsChanged", this.gF), b.Xv.remove(this)), this.Wj = a, null !== a && (a.yz("ViewportBoundsChanged", this.hF), a.yz("DocumentBoundsChanged", this.gF), a.Xv.add(this), this.add(this.qh), wm(this)), this.yc(), this.j("observed",
|
|
b, a))
|
|
});
|
|
z.defineProperty(xk, {
|
|
qh: "box"
|
|
}, function() {
|
|
return this.em
|
|
}, function(a) {
|
|
var b = this.em;
|
|
b !== a && (this.em = a, this.remove(b), this.add(this.em), wm(this), this.j("box", b, a))
|
|
});
|
|
z.defineProperty(xk, {
|
|
yK: "drawsTemporaryLayers"
|
|
}, function() {
|
|
return this.kv
|
|
}, function(a) {
|
|
this.kv !== a && (this.kv = a, this.Sp())
|
|
});
|
|
|
|
function wm(a) {
|
|
var b = a.qh;
|
|
if (null !== b) {
|
|
var c = a.Wj;
|
|
if (null !== c) {
|
|
a.ue = !0;
|
|
var c = c.xb,
|
|
d = b.vn,
|
|
e = z.Xl();
|
|
e.n(c.width, c.height);
|
|
d.Aa = e;
|
|
z.pk(e);
|
|
a = 2 / a.scale;
|
|
d instanceof X && (d.ub = a);
|
|
b.location = new N(c.x - a / 2, c.y - a / 2)
|
|
}
|
|
}
|
|
}
|
|
xk.prototype.rh = function() {
|
|
var a = this.Wj;
|
|
return null === a ? Jd : a.ad
|
|
};
|
|
xk.prototype.HE = function() {
|
|
!0 !== this.ue && (this.ue = !0, xm(this))
|
|
};
|
|
xk.prototype.fu = function(a) {
|
|
this.Vc || (Ik(this), this.ta(), Vk(this), this.yc(), wm(this), this.Ja("ViewportBoundsChanged", null, a))
|
|
};
|
|
|
|
function um() {
|
|
ih.call(this);
|
|
this.jl = null
|
|
}
|
|
z.Qa(um, ih);
|
|
um.prototype.canStart = function() {
|
|
if (!this.isEnabled) return !1;
|
|
var a = this.h;
|
|
if (null === a || !a.ul || !a.xf) return !1;
|
|
var b = a.BA;
|
|
if (null === b) return !1;
|
|
if (null === this.findDraggablePart()) {
|
|
var c = b.xb;
|
|
this.jl = new N(c.width / 2, c.height / 2);
|
|
a = a.Fc.ga;
|
|
b.position = new N(a.x - this.jl.x, a.y - this.jl.y)
|
|
}
|
|
return !0
|
|
};
|
|
um.prototype.doActivate = function() {
|
|
this.jl = null;
|
|
ih.prototype.doActivate.call(this)
|
|
};
|
|
um.prototype.moveParts = function() {
|
|
var a = this.h,
|
|
b = a.BA;
|
|
if (null !== b) {
|
|
var c = a.qh;
|
|
if (null !== c) {
|
|
if (null === this.jl) {
|
|
var d = a.Fc.ga,
|
|
c = c.location;
|
|
this.jl = new N(d.x - c.x, d.y - c.y)
|
|
}
|
|
a = a.Q.ga;
|
|
b.position = new N(a.x - this.jl.x, a.y - this.jl.y)
|
|
}
|
|
}
|
|
};
|
|
|
|
function vm() {
|
|
Wi.call(this)
|
|
}
|
|
z.Qa(vm, Wi);
|
|
vm.prototype.resize = function(a) {
|
|
var b = this.h.BA;
|
|
if (null !== b) {
|
|
var c = b.xb.copy();
|
|
b.position = a.position;
|
|
(c.width !== a.width || c.height !== a.height) && 0 < a.width && 0 < a.height && (b.scale = Math.min(c.width / a.width, c.height / a.height))
|
|
}
|
|
};
|
|
|
|
function Da(a) {
|
|
1 < arguments.length && z.k("Brush constructor can take at most one optional argument, the Brush type.");
|
|
z.kc(this);
|
|
this.G = !1;
|
|
void 0 === a ? (this.ba = rg, this.Mn = "black") : "string" === typeof a ? (this.ba = rg, u && !Ca(a) && z.k('Color "' + a + '" is not a valid color string for Brush constructor'), this.Mn = a) : (u && z.Ba(a, Da, Da, "constructor:type"), this.ba = a, this.Mn = "black");
|
|
var b = this.ba;
|
|
b === sg ? (this.Po = $b, this.eo = hc) : this.eo = b === yd ? this.Po = ec : this.Po = Yb;
|
|
this.rw = 0;
|
|
this.lv = NaN;
|
|
this.ah = this.$v = this.$g = null;
|
|
this.ty =
|
|
this.On = 0
|
|
}
|
|
z.ia("Brush", Da);
|
|
var rg;
|
|
Da.Solid = rg = z.s(Da, "Solid", 0);
|
|
var sg;
|
|
Da.Linear = sg = z.s(Da, "Linear", 1);
|
|
var yd;
|
|
Da.Radial = yd = z.s(Da, "Radial", 2);
|
|
var ym;
|
|
Da.Pattern = ym = z.s(Da, "Pattern", 4);
|
|
Da.prototype.copy = function() {
|
|
var a = new Da;
|
|
a.ba = this.ba;
|
|
a.Mn = this.Mn;
|
|
a.Po = this.Po.V();
|
|
a.eo = this.eo.V();
|
|
a.rw = this.rw;
|
|
a.lv = this.lv;
|
|
null !== this.$g && (a.$g = this.$g.copy());
|
|
a.$v = this.$v;
|
|
return a
|
|
};
|
|
Da.prototype.La = function() {
|
|
this.freeze();
|
|
Object.freeze(this);
|
|
return this
|
|
};
|
|
Da.prototype.freeze = function() {
|
|
this.G = !0;
|
|
null !== this.$g && this.$g.freeze();
|
|
return this
|
|
};
|
|
Da.prototype.Wa = function() {
|
|
Object.isFrozen(this) && z.k("cannot thaw constant: " + this);
|
|
this.G = !1;
|
|
null !== this.$g && this.$g.Wa();
|
|
return this
|
|
};
|
|
Da.prototype.toString = function() {
|
|
var a = "Brush(";
|
|
if (this.type === rg) a += this.color;
|
|
else if (a = this.type === sg ? a + "Linear " : this.type === yd ? a + "Radial " : this.type === ym ? a + "Pattern " : a + "(unknown) ", a += this.start + " " + this.end, null !== this.st)
|
|
for (var b = this.st.i; b.next();) a += " " + b.key + ":" + b.value;
|
|
return a + ")"
|
|
};
|
|
Da.prototype.addColorStop = Da.prototype.addColorStop = function(a, b) {
|
|
this.G && z.oa(this);
|
|
("number" !== typeof a || !isFinite(a) || 1 < a || 0 > a) && z.ka(a, "0 <= loc <= 1", Da, "addColorStop:loc");
|
|
z.g(b, "string", Da, "addColorStop:color");
|
|
u && !Ca(b) && z.k('Color "' + b + '" is not a valid color string for Brush.addColorStop');
|
|
null === this.$g && (this.$g = new na("number", "string"));
|
|
this.$g.add(a, b);
|
|
this.ba === rg && (this.type = sg);
|
|
this.ah = null
|
|
};
|
|
z.defineProperty(Da, {
|
|
type: "type"
|
|
}, function() {
|
|
return this.ba
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
z.Ba(a, Da, Da, "type");
|
|
this.ba = a;
|
|
this.start.Be() && (a === sg ? this.start = $b : a === yd && (this.start = ec));
|
|
this.end.Be() && (a === sg ? this.end = hc : a === yd && (this.end = ec));
|
|
this.ah = null
|
|
});
|
|
z.defineProperty(Da, {
|
|
color: "color"
|
|
}, function() {
|
|
return this.Mn
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
u && !Ca(a) && z.k('Color "' + a + '" is not a valid color string for Brush.color');
|
|
this.Mn = a;
|
|
this.ah = null
|
|
});
|
|
z.defineProperty(Da, {
|
|
start: "start"
|
|
}, function() {
|
|
return this.Po
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
z.l(a, Q, Da, "start");
|
|
this.Po = a.V();
|
|
this.ah = null
|
|
});
|
|
z.defineProperty(Da, {
|
|
end: "end"
|
|
}, function() {
|
|
return this.eo
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
z.l(a, Q, Da, "end");
|
|
this.eo = a.V();
|
|
this.ah = null
|
|
});
|
|
z.defineProperty(Da, {
|
|
wu: "startRadius"
|
|
}, function() {
|
|
return this.rw
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
z.p(a, Da, "startRadius");
|
|
0 > a && z.ka(a, ">= zero", Da, "startRadius");
|
|
this.rw = a;
|
|
this.ah = null
|
|
});
|
|
z.defineProperty(Da, {
|
|
xt: "endRadius"
|
|
}, function() {
|
|
return this.lv
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
z.p(a, Da, "endRadius");
|
|
0 > a && z.ka(a, ">= zero", Da, "endRadius");
|
|
this.lv = a;
|
|
this.ah = null
|
|
});
|
|
z.defineProperty(Da, {
|
|
st: "colorStops"
|
|
}, function() {
|
|
return this.$g
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
u && z.l(a, na, Da, "colorStops");
|
|
this.$g = a;
|
|
this.ah = null
|
|
});
|
|
z.defineProperty(Da, {
|
|
pattern: "pattern"
|
|
}, function() {
|
|
return this.$v
|
|
}, function(a) {
|
|
this.G && z.oa(this, a);
|
|
this.$v = a;
|
|
this.ah = null
|
|
});
|
|
Da.randomColor = function(a, b) {
|
|
void 0 === a && (a = 128);
|
|
u && (z.p(a, Da, "randomColor:min"), (0 > a || 255 < a) && z.ka(a, "0 <= min <= 255", Da, "randomColor:min"));
|
|
void 0 === b && (b = Math.max(a, 255));
|
|
u && (z.p(b, Da, "randomColor:max"), (b < a || 255 < b) && z.ka(b, "min <= max <= 255", Da, "randomColor:max"));
|
|
var c = Math.abs(b - a),
|
|
d = Math.floor(a + Math.random() * c).toString(16),
|
|
e = Math.floor(a + Math.random() * c).toString(16),
|
|
c = Math.floor(a + Math.random() * c).toString(16);
|
|
2 > d.length && (d = "0" + d);
|
|
2 > e.length && (e = "0" + e);
|
|
2 > c.length && (c = "0" + c);
|
|
return "#" +
|
|
d + e + c
|
|
};
|
|
var zm = (new la(null)).yl,
|
|
Ca;
|
|
Da.isValidColor = Ca = function(a) {
|
|
if ("black" === a) return !0;
|
|
if ("" === a) return !1;
|
|
u && z.g(a, "string", Da, "isValidColor");
|
|
zm.fillStyle = "#000000";
|
|
var b = zm.fillStyle;
|
|
zm.fillStyle = a;
|
|
if (zm.fillStyle !== b) return !0;
|
|
zm.fillStyle = "#FFFFFF";
|
|
b = zm.fillStyle;
|
|
zm.fillStyle = a;
|
|
return zm.fillStyle !== b
|
|
};
|
|
|
|
function O() {
|
|
z.kc(this);
|
|
this.ja = 30723;
|
|
this.Xc = 1;
|
|
this.lh = null;
|
|
this.Ub = "";
|
|
this.uc = this.Nb = null;
|
|
this.sb = (new N(NaN, NaN)).freeze();
|
|
this.tf = fe;
|
|
this.Tj = Pd;
|
|
this.Rj = de;
|
|
this.Hd = new Fa;
|
|
this.zk = new Fa;
|
|
this.fl = new Fa;
|
|
this.bc = this.iv = 1;
|
|
this.bm = 0;
|
|
this.di = Am;
|
|
this.Er = Kd;
|
|
this.ud = (new w(NaN, NaN, NaN, NaN)).freeze();
|
|
this.Xb = (new w(NaN, NaN, NaN, NaN)).freeze();
|
|
this.Wc = (new w(0, 0, NaN, NaN)).freeze();
|
|
this.Vs = this.Zq = this.la = this.fs = this.gs = null;
|
|
this.Ws = this.$q = Infinity;
|
|
this.oq = this.Ie = Pc;
|
|
this.us = 0;
|
|
this.Ti = 1;
|
|
this.wq = 0;
|
|
this.wi =
|
|
1;
|
|
this.Os = null;
|
|
this.zs = -Infinity;
|
|
this.ys = 0;
|
|
this.As = Id;
|
|
this.Bs = Ni;
|
|
this.Hq = "";
|
|
this.Ac = this.ma = null;
|
|
this.Jn = -1;
|
|
this.Bm = this.Js = this.vi = this.Pk = this.Oo = null
|
|
}
|
|
z.ii(O);
|
|
z.ia("GraphObject", O);
|
|
O.prototype.cloneProtected = function(a) {
|
|
a.ja = this.ja | 6144;
|
|
a.Xc = this.Xc;
|
|
a.Ub = this.Ub;
|
|
a.Nb = this.Nb;
|
|
a.uc = this.uc;
|
|
a.sb.assign(this.sb);
|
|
a.tf = this.tf.V();
|
|
a.Tj = this.Tj.V();
|
|
a.Rj = this.Rj.V();
|
|
a.fl = this.fl.copy();
|
|
a.bc = this.bc;
|
|
a.bm = this.bm;
|
|
a.di = this.di;
|
|
a.Er = this.Er.V();
|
|
a.ud.assign(this.ud);
|
|
a.Xb.assign(this.Xb);
|
|
a.Wc.assign(this.Wc);
|
|
a.fs = this.fs;
|
|
null !== this.la && (a.la = this.la.copy());
|
|
a.Zq = this.Zq;
|
|
a.Vs = this.Vs;
|
|
a.$q = this.$q;
|
|
a.Ws = this.Ws;
|
|
a.Ie = this.Ie.V();
|
|
a.oq = this.oq.V();
|
|
a.us = this.us;
|
|
a.Ti = this.Ti;
|
|
a.wq = this.wq;
|
|
a.wi =
|
|
this.wi;
|
|
a.Os = this.Os;
|
|
a.zs = this.zs;
|
|
a.ys = this.ys;
|
|
a.As = this.As.V();
|
|
a.Bs = this.Bs;
|
|
a.Hq = this.Hq;
|
|
null !== this.ma && (a.ma = this.ma.copy());
|
|
a.Ac = this.Ac;
|
|
a.Jn = this.Jn;
|
|
null !== this.Pk && (a.Pk = z.zl(this.Pk));
|
|
null !== this.vi && (a.vi = this.vi.copy());
|
|
a.Js = this.Js
|
|
};
|
|
O.prototype.addCopyProperty = O.prototype.NG = function(a) {
|
|
var b = this.Pk;
|
|
if (z.isArray(b))
|
|
for (var c = 0; c < b.length; c++) {
|
|
if (b[c] === a) return
|
|
} else this.Pk = b = [];
|
|
b.push(a)
|
|
};
|
|
O.prototype.ji = function(a) {
|
|
a.gs = null;
|
|
a.Bm = null;
|
|
a.S()
|
|
};
|
|
O.prototype.clone = function() {
|
|
var a = new this.constructor;
|
|
this.cloneProtected(a);
|
|
if (null !== this.Pk)
|
|
for (var b = 0; b < this.Pk.length; b++) {
|
|
var c = this.Pk[b];
|
|
a[c] = this[c]
|
|
}
|
|
return a
|
|
};
|
|
O.prototype.copy = function() {
|
|
return this.clone()
|
|
};
|
|
O.prototype.toString = function() {
|
|
return z.kf(Object.getPrototypeOf(this)) + "#" + z.nd(this)
|
|
};
|
|
var $i;
|
|
O.None = $i = z.s(O, "None", 0);
|
|
var Am;
|
|
O.Default = Am = z.s(O, "Default", 0);
|
|
var Bm;
|
|
O.Vertical = Bm = z.s(O, "Vertical", 4);
|
|
var Cm;
|
|
O.Horizontal = Cm = z.s(O, "Horizontal", 5);
|
|
var lf;
|
|
O.Fill = lf = z.s(O, "Fill", 3);
|
|
var bj;
|
|
O.Uniform = bj = z.s(O, "Uniform", 1);
|
|
var cj;
|
|
O.UniformToFill = cj = z.s(O, "UniformToFill", 2);
|
|
|
|
function Dm(a) {
|
|
null === a.ma && (a.ma = new Em)
|
|
}
|
|
O.prototype.Ue = function() {
|
|
if (null === this.la) {
|
|
var a = new Fm;
|
|
a.Gj = Yb;
|
|
a.gk = Yb;
|
|
a.Ej = 10;
|
|
a.ek = 10;
|
|
a.Dj = Gm;
|
|
a.dk = Gm;
|
|
a.Fj = 0;
|
|
a.fk = 0;
|
|
this.la = a
|
|
}
|
|
};
|
|
|
|
function Hm(a, b, c, d, e, g, h) {
|
|
var k = .001,
|
|
l = g.length;
|
|
a.moveTo(b, c);
|
|
d -= b;
|
|
k = e - c;
|
|
0 === d && (d = .001);
|
|
e = k / d;
|
|
for (var m = Math.sqrt(d * d + k * k), n = 0, p = !0, q = 0 === h ? !1 : !0; .1 <= m;) {
|
|
if (q) {
|
|
k = g[n++ % l];
|
|
for (k -= h; 0 > k;) k += g[n++ % l], p = !p;
|
|
q = !1
|
|
} else k = g[n++ % l];
|
|
k > m && (k = m);
|
|
var r = Math.sqrt(k * k / (1 + e * e));
|
|
0 > d && (r = -r);
|
|
b += r;
|
|
c += e * r;
|
|
p ? a.lineTo(b, c) : a.moveTo(b, c);
|
|
m -= k;
|
|
p = !p
|
|
}
|
|
}
|
|
O.prototype.raiseChangedEvent = O.prototype.Rc = function(a, b, c, d, e, g, h) {
|
|
var k = this.ca;
|
|
null !== k && (k.tn(a, b, c, d, e, g, h), 0 !== (this.ja & 1024) && c === this && a === Sf && Im(this, k, b))
|
|
};
|
|
|
|
function Im(a, b, c) {
|
|
var d = a.op();
|
|
if (null !== d)
|
|
for (var e = a.Ac.i; e.next();) {
|
|
var g = e.value,
|
|
h = null;
|
|
if (null !== g.yn) {
|
|
h = $g(g, d, a);
|
|
if (null === h) continue;
|
|
g.Rx(a, h, c, null)
|
|
} else if (g.St) {
|
|
var k = b.h;
|
|
null === k || k.Ee || g.Rx(a, k.ha.tk, c, k)
|
|
} else {
|
|
var l = d.data;
|
|
if (null === l) continue;
|
|
k = b.h;
|
|
null === k || k.Ee || g.Rx(a, l, c, k)
|
|
}
|
|
null !== h && (k = d.Xw(g.Wl), null !== k && g.fG(k, h, c))
|
|
}
|
|
}
|
|
O.prototype.Xw = function(a) {
|
|
return this.Jn === a ? this : null
|
|
};
|
|
O.prototype.raiseChanged = O.prototype.j = function(a, b, c) {
|
|
this.Rc(Sf, a, this, b, c)
|
|
};
|
|
|
|
function Jm(a, b, c, d, e) {
|
|
var g = a.ud,
|
|
h = a.fl;
|
|
h.reset();
|
|
Km(a, h, b, c, d, e);
|
|
a.fl = h;
|
|
g.x = b;
|
|
g.y = c;
|
|
g.width = d;
|
|
g.height = e;
|
|
h.Pt() || h.bG(g)
|
|
}
|
|
|
|
function Lm(a, b, c, d) {
|
|
if (!1 === a.ig) return !1;
|
|
d.multiply(a.transform);
|
|
return c ? a.Ig(b, d) : a.Ym(b, d)
|
|
}
|
|
O.prototype.sE = function(a, b, c) {
|
|
if (!1 === this.ig) return !1;
|
|
var d = this.Ga;
|
|
b = a.Af(b);
|
|
var e = !1;
|
|
c && (e = vb(a.x, a.y, 0, 0, 0, d.height) < b || vb(a.x, a.y, 0, d.height, d.width, d.height) < b || vb(a.x, a.y, d.width, d.height, d.width, 0) < b || vb(a.x, a.y, d.width, 0, 0, 0) < b);
|
|
c || (e = vb(a.x, a.y, 0, 0, 0, d.height) < b && vb(a.x, a.y, 0, d.height, d.width, d.height) < b && vb(a.x, a.y, d.width, d.height, d.width, 0) < b && vb(a.x, a.y, d.width, 0, 0, 0) < b);
|
|
return e
|
|
};
|
|
O.prototype.Vg = function() {
|
|
return !0
|
|
};
|
|
O.prototype.containsPoint = O.prototype.Ma = function(a) {
|
|
u && z.l(a, N, O, "containsPoint:p");
|
|
var b = z.O();
|
|
b.assign(a);
|
|
this.transform.Cb(b);
|
|
var c = this.W;
|
|
if (!c.F()) return z.A(b), !1;
|
|
var d = this.h;
|
|
if (null !== d && d.Zk) {
|
|
var e = d.sp("extraTouchThreshold"),
|
|
g = d.sp("extraTouchArea"),
|
|
h = g / 2,
|
|
k = this.Ga,
|
|
d = this.gj() * d.scale,
|
|
l = 1 / d;
|
|
if (k.width * d < e && k.height * d < e) return a = Jb(c.x - h * l, c.y - h * l, c.width + g * l, c.height + g * l, b.x, b.y), z.A(b), a
|
|
}
|
|
if (this instanceof da || this instanceof X ? Jb(c.x - 5, c.y - 5, c.width + 10, c.height + 10, b.x, b.y) : c.Ma(b)) return e = !1, e = this.vi && !this.vi.Ma(b) ? !1 : null !== this.uc && c.Ma(b) ? !0 : null !== this.Nb && this.Wc.Ma(a) ? !0 : this.lk(a), z.A(b), e;
|
|
z.A(b);
|
|
return !1
|
|
};
|
|
O.prototype.lk = function(a) {
|
|
var b = this.Ga;
|
|
return Jb(0, 0, b.width, b.height, a.x, a.y)
|
|
};
|
|
O.prototype.containsRect = O.prototype.mk = function(a) {
|
|
u && z.l(a, w, O, "containsRect:r");
|
|
if (0 === this.angle) return this.W.mk(a);
|
|
var b = this.Ga,
|
|
b = z.yk(0, 0, b.width, b.height),
|
|
c = this.transform,
|
|
d = !1,
|
|
e = z.Tb(a.x, a.y);
|
|
b.Ma(c.ki(e)) && (e.n(a.x, a.bottom), b.Ma(c.ki(e)) && (e.n(a.right, a.bottom), b.Ma(c.ki(e)) && (e.n(a.right, a.y), b.Ma(c.ki(e)) && (d = !0))));
|
|
z.A(e);
|
|
z.dc(b);
|
|
return d
|
|
};
|
|
O.prototype.containedInRect = O.prototype.Ym = function(a, b) {
|
|
u && z.l(a, w, O, "containedInRect:r");
|
|
if (void 0 === b) return a.mk(this.W);
|
|
var c = this.Ga,
|
|
d = !1,
|
|
e = z.Tb(0, 0);
|
|
a.Ma(b.Cb(e)) && (e.n(0, c.height), a.Ma(b.Cb(e)) && (e.n(c.width, c.height), a.Ma(b.Cb(e)) && (e.n(c.width, 0), a.Ma(b.Cb(e)) && (d = !0))));
|
|
z.A(e);
|
|
return d
|
|
};
|
|
O.prototype.intersectsRect = O.prototype.Ig = function(a, b) {
|
|
u && z.l(a, w, O, "intersectsRect:r");
|
|
if (void 0 === b && (b = this.transform, 0 === this.angle)) return a.Ig(this.W);
|
|
var c = this.Ga,
|
|
d = b,
|
|
e = z.Tb(0, 0),
|
|
g = z.Tb(0, c.height),
|
|
h = z.Tb(c.width, c.height),
|
|
k = z.Tb(c.width, 0),
|
|
l = !1;
|
|
if (a.Ma(d.Cb(e)) || a.Ma(d.Cb(g)) || a.Ma(d.Cb(h)) || a.Ma(d.Cb(k))) l = !0;
|
|
else {
|
|
var c = z.yk(0, 0, c.width, c.height),
|
|
m = z.Tb(a.x, a.y);
|
|
c.Ma(d.ki(m)) ? l = !0 : (m.n(a.x, a.bottom), c.Ma(d.ki(m)) ? l = !0 : (m.n(a.right, a.bottom), c.Ma(d.ki(m)) ? l = !0 : (m.n(a.right, a.y), c.Ma(d.ki(m)) &&
|
|
(l = !0))));
|
|
z.A(m);
|
|
z.dc(c);
|
|
!l && (Pe(a, e, g) || Pe(a, g, h) || Pe(a, h, k) || Pe(a, k, e)) && (l = !0)
|
|
}
|
|
z.A(e);
|
|
z.A(g);
|
|
z.A(h);
|
|
z.A(k);
|
|
return l
|
|
};
|
|
O.prototype.getDocumentPoint = O.prototype.fb = function(a, b) {
|
|
void 0 === b && (b = new N);
|
|
a.Be() && z.k("getDocumentPoint:s Spot must be specific: " + a.toString());
|
|
var c = this.Ga;
|
|
b.n(a.x * c.width + a.offsetX, a.y * c.height + a.offsetY);
|
|
this.ph.Cb(b);
|
|
return b
|
|
};
|
|
O.prototype.getDocumentAngle = O.prototype.Kl = function() {
|
|
var a;
|
|
a = this.ph;
|
|
1 === a.m11 && 0 === a.m12 ? a = 0 : (a = 180 * Math.atan2(a.m12, a.m11) / Math.PI, 0 > a && (a += 360));
|
|
return a
|
|
};
|
|
O.prototype.getDocumentScale = O.prototype.gj = function() {
|
|
if (0 !== (this.ja & 4096) === !1) return this.iv;
|
|
var a = this.bc;
|
|
return null !== this.U ? a * this.U.gj() : a
|
|
};
|
|
O.prototype.getLocalPoint = O.prototype.xE = function(a, b) {
|
|
void 0 === b && (b = new N);
|
|
b.assign(a);
|
|
this.ph.ki(b);
|
|
return b
|
|
};
|
|
O.prototype.getNearestIntersectionPoint = O.prototype.yE = function(a, b, c) {
|
|
return this.tp(a.x, a.y, b.x, b.y, c)
|
|
};
|
|
f = O.prototype;
|
|
f.tp = 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.vl) return g = this.W, Ne(g.left, g.top, g.right, g.bottom, a, b, c, d, e);
|
|
h = a * k + b * m + p;
|
|
a = a * l + b * n + q;
|
|
b = c * k + d * m + p;
|
|
c = c * l + d * n + q;
|
|
e.n(0, 0);
|
|
d = this.Ga;
|
|
c = Ne(0, 0, d.width, d.height, h, a, b, c, e);
|
|
e.transform(g);
|
|
return c
|
|
};
|
|
|
|
function rj(a, b, c, d, e) {
|
|
if (!1 !== ml(a)) {
|
|
var g = a.margin,
|
|
h = g.right + g.left,
|
|
g = g.top + g.bottom;
|
|
b = Math.max(b - h, 0);
|
|
c = Math.max(c - g, 0);
|
|
e = e || 0;
|
|
d = Math.max((d || 0) - h, 0);
|
|
e = Math.max(e - g, 0);
|
|
var h = a.angle,
|
|
g = 0,
|
|
g = a.Aa,
|
|
k = 0;
|
|
a.ub && (k = a.ub);
|
|
90 === h || 270 === h ? (b = isFinite(g.height) ? g.height + k : b, c = isFinite(g.width) ? g.width + k : c) : (b = isFinite(g.width) ? g.width + k : b, c = isFinite(g.height) ? g.height + k : c);
|
|
var g = d || 0,
|
|
k = e || 0,
|
|
l = a instanceof I;
|
|
switch (Mm(a, !0)) {
|
|
case $i:
|
|
k = g = 0;
|
|
l && (c = b = Infinity);
|
|
break;
|
|
case lf:
|
|
isFinite(b) && b > d && (g = b);
|
|
isFinite(c) &&
|
|
c > e && (k = c);
|
|
break;
|
|
case Cm:
|
|
isFinite(b) && b > d && (g = b);
|
|
k = 0;
|
|
l && (c = Infinity);
|
|
break;
|
|
case Bm:
|
|
isFinite(c) && c > e && (k = c), g = 0, l && (b = Infinity)
|
|
}
|
|
var l = a.Xe,
|
|
m = a.cg;
|
|
g > l.width && m.width < l.width && (g = l.width);
|
|
k > l.height && m.height < l.height && (k = l.height);
|
|
d = Math.max(g / a.scale, m.width);
|
|
e = Math.max(k / a.scale, m.height);
|
|
l.width < d && (d = Math.min(m.width, d));
|
|
l.height < e && (e = Math.min(m.height, e));
|
|
b = Math.min(l.width, b);
|
|
c = Math.min(l.height, c);
|
|
b = Math.max(d, b);
|
|
c = Math.max(e, c);
|
|
if (90 === h || 270 === h) g = b, b = c, c = g, g = d, d = e, e = g;
|
|
a.ud.Wa();
|
|
a.Ip(b, c,
|
|
d, e);
|
|
a.ud.freeze();
|
|
a.ud.F() || z.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.ud.toString());
|
|
Yk(a, !1)
|
|
}
|
|
}
|
|
f.Lc = function(a, b, c, d, e) {
|
|
this.Fi();
|
|
var g = z.kg();
|
|
g.assign(this.Xb);
|
|
this.Xb.Wa();
|
|
if (!1 === nl(this)) {
|
|
var h = this.Xb;
|
|
h.x = a;
|
|
h.y = b;
|
|
h.width = c;
|
|
h.height = d
|
|
} else this.$i(a, b, c, d);
|
|
this.Xb.freeze();
|
|
this.vi = void 0 === e ? null : e;
|
|
c = !1;
|
|
void 0 !== e ? c = !0 : null !== this.U && (e = this.U.Wc, d = this.Ia, null !== this.vl && (d = this.Xb), c = b + d.height, d = a + d.width, c = !(0 <= a + .05 && d <= e.width + .05 && 0 <= b + .05 && c <= e.height + .05), this instanceof qa && (a = this.Wc, this.Jv > a.height || this.Nj.cf > a.width)) && (c = !0);
|
|
this.ja = c ? this.ja | 256 : this.ja & -257;
|
|
this.Xb.F() ||
|
|
z.k("Non-real actualBounds has been set. Object " + this + ", actualBounds: " + this.Xb.toString());
|
|
this.vx(g, this.Xb);
|
|
z.dc(g)
|
|
};
|
|
f.$i = function() {};
|
|
|
|
function Nm(a, b, c, d, e) {
|
|
var g = a.W;
|
|
g.x = b;
|
|
g.y = c;
|
|
g.width = d;
|
|
g.height = e;
|
|
if (!a.Aa.F()) {
|
|
g = a.ud;
|
|
c = a.margin;
|
|
b = c.right + c.left;
|
|
var h = c.top + c.bottom;
|
|
c = g.width + b;
|
|
g = g.height + h;
|
|
d += b;
|
|
e += h;
|
|
b = Mm(a, !0);
|
|
c === d && g === e && (b = $i);
|
|
switch (b) {
|
|
case $i:
|
|
if (c > d || g > e) Yk(a, !0), rj(a, c > d ? d : c, g > e ? e : g);
|
|
break;
|
|
case lf:
|
|
Yk(a, !0);
|
|
rj(a, d, e, 0, 0);
|
|
break;
|
|
case Cm:
|
|
Yk(a, !0);
|
|
rj(a, d, g, 0, 0);
|
|
break;
|
|
case Bm:
|
|
Yk(a, !0), rj(a, c, e, 0, 0)
|
|
}
|
|
}
|
|
}
|
|
f.vx = function(a, b) {
|
|
Om(this, !1);
|
|
var c = this.ca;
|
|
if (null !== c && null !== c.h) {
|
|
var d = this.ca;
|
|
null !== d && (d.vn !== this && d.vF !== this && d.zF !== this || Pm(d, !0));
|
|
this.ta();
|
|
a.N(b) || (c.Nl(), this.Sv(c))
|
|
}
|
|
};
|
|
f.Sv = function(a) {
|
|
null !== this.yd && Pm(a, !0)
|
|
};
|
|
z.defineProperty(O, {
|
|
bq: "shadowVisible"
|
|
}, function() {
|
|
return this.Js
|
|
}, function(a) {
|
|
var b = this.Js;
|
|
b !== a && (u && null !== a && z.g(a, "boolean", O, "shadowVisible"), this.Js = a, this.j("shadowVisible", b, a))
|
|
});
|
|
O.prototype.ff = function(a, b) {
|
|
if (this.visible) {
|
|
var c = this.Xb;
|
|
if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y)) {
|
|
var d = this.opacity,
|
|
e = 1;
|
|
if (1 !== d) {
|
|
if (0 === d) return;
|
|
e = a.globalAlpha;
|
|
a.globalAlpha = e * d
|
|
}
|
|
if (a instanceof ed) a: {
|
|
if (this.visible) {
|
|
var g = null,
|
|
h = a.nx;
|
|
if (this instanceof I && (this.type === Qm || this.type === Rm)) Sm(this, a, b);
|
|
else {
|
|
var k = this.Xb;
|
|
if (0 !== k.width && 0 !== k.height && !isNaN(k.x) && !isNaN(k.y)) {
|
|
var l = this.transform,
|
|
m = this.U;
|
|
0 !== (this.ja & 4096) === !0 && Tm(this);
|
|
var c = 0 !== (this.ja & 256),
|
|
n = !1;
|
|
this instanceof
|
|
qa && (a.font = this.font);
|
|
if (c) {
|
|
n = m.Vg() ? m.Ga : m.W;
|
|
if (null !== this.vi) var p = this.vi,
|
|
q = p.x,
|
|
r = p.y,
|
|
s = p.width,
|
|
p = p.height;
|
|
else q = Math.max(k.x, n.x), r = Math.max(k.y, n.y), s = Math.min(k.right, n.right) - q, p = Math.min(k.bottom, n.bottom) - r;
|
|
if (q > k.width + k.x || k.x > n.width + n.x || r > k.height + k.y || k.y > n.height + n.y) break a;
|
|
n = !0;
|
|
qd(a, 1, 0, 0, 1, 0, 0);
|
|
a.save();
|
|
a.beginPath();
|
|
a.rect(q, r, s, p);
|
|
a.clip()
|
|
}
|
|
q = !1;
|
|
if (this instanceof D) {
|
|
var t = this,
|
|
q = !0;
|
|
if (!t.isVisible()) break a
|
|
}
|
|
a.ej.pf = [1, 0, 0, 1, 0, 0];
|
|
r = !1;
|
|
q && this.sk && b.hj("drawShadows") && (s = this.Jm,
|
|
a.TA(s.x * b.scale * b.jd, s.y * b.scale * b.jd, t.zg), a.xn(), a.shadowColor = t.Im);
|
|
t = !1;
|
|
this.ca && b.hj("drawShadows") && (t = this.ca.sk);
|
|
!0 === this.bq ? (a.xn(), !1 === r && t && (qd(a, 1, 0, 0, 1, 0, 0), a.gb(), r = !0)) : !1 === this.bq && a.wn();
|
|
null !== this.uc && (Um(this, a, this.uc, !0, !0), !1 === r && t && (qd(a, 1, 0, 0, 1, 0, 0), a.gb(), r = !0), this.uc instanceof Da && this.uc.type === yd ? (a.beginPath(), a.rect(k.x, k.y, k.width, k.height), a.Gg(this.uc)) : a.fillRect(k.x, k.y, k.width, k.height));
|
|
this instanceof I ? qd(a, l.m11, l.m12, l.m21, l.m22, l.dx, l.dy) : a.ej.pf = [l.m11, l.m12, l.m21, l.m22, l.dx, l.dy];
|
|
if (null !== this.Nb) {
|
|
!1 === r && t && (qd(a, 1, 0, 0, 1, 0, 0), a.gb(), r = !0);
|
|
var p = this.Ga,
|
|
l = k = 0,
|
|
s = p.width,
|
|
p = p.height,
|
|
v = 0;
|
|
this instanceof X && (p = this.ab.vb, k = p.x, l = p.y, s = p.width, p = p.height, v = this.Oe);
|
|
Um(this, a, this.Nb, !0, !1);
|
|
this.Nb instanceof Da && this.Nb.type === yd ? (a.beginPath(), a.rect(k - v / 2, l - v / 2, s + v, p + v), a.Gg(this.Nb)) : a.fillRect(k - v / 2, l - v / 2, s + v, p + v)
|
|
}
|
|
t && (null !== this.Nb || null !== this.uc || null !== m && 0 !== (m.ja & 512) || null !== m && (m.type === Dk || m.type === Yi) && m.gf() !== this) ? (Vm(this, !0),
|
|
null === this.bq && a.wn()) : Vm(this, !1);
|
|
this.nk(a, b);
|
|
t && 0 !== (this.ja & 512) === !0 && a.xn();
|
|
q && t && a.wn();
|
|
c && (a.restore(), n && a.Cf.pop());
|
|
this instanceof I && (g = a.Cf.pop());
|
|
!0 === r && a.Cf.pop();
|
|
null !== a.nE && (null === g && (h === a.nx ? (qd(a, 1, 0, 0, 1, 0, 0), g = a.Cf.pop()) : g = a.nx), a.nE(this, g))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
else {
|
|
if (this instanceof I && (this.type === Qm || this.type === Rm)) {
|
|
Sm(this, a, b);
|
|
1 !== d && (a.globalAlpha = e);
|
|
return
|
|
}
|
|
this instanceof G && this.on(!1);
|
|
u && u.bj && u.xH(a, this);
|
|
g = this.transform;
|
|
h = this.U;
|
|
0 !== (this.ja & 4096) === !0 && Tm(this);
|
|
m = 0 !== (this.ja &
|
|
256);
|
|
this instanceof qa && (a.font = this.font);
|
|
if (m) {
|
|
u && u.mE && z.trace("clip" + this.toString());
|
|
n = h.Vg() ? h.Ga : h.W;
|
|
null !== this.vi ? (t = this.vi, k = t.x, l = t.y, q = t.width, t = t.height) : (k = Math.max(c.x, n.x), l = Math.max(c.y, n.y), q = Math.min(c.right, n.right) - k, t = Math.min(c.bottom, n.bottom) - l);
|
|
if (k > c.width + c.x || c.x > n.width + n.x || l > c.height + c.y || c.y > n.height + n.y) {
|
|
1 !== d && (a.globalAlpha = e);
|
|
return
|
|
}
|
|
u && u.mE && u.zH(a, k, l, q, t);
|
|
a.save();
|
|
a.beginPath();
|
|
a.rect(k, l, q, t);
|
|
a.clip()
|
|
}
|
|
n = !1;
|
|
if (this instanceof D) {
|
|
n = !0;
|
|
if (!this.isVisible()) {
|
|
1 !==
|
|
d && (a.globalAlpha = e);
|
|
return
|
|
}
|
|
this.sk && b.hj("drawShadows") && (k = this.Jm, a.TA(k.x * b.scale * b.jd, k.y * b.scale * b.jd, this.zg), a.xn(), a.shadowColor = this.Im)
|
|
}
|
|
k = !1;
|
|
this.ca && b.hj("drawShadows") && (k = this.ca.sk);
|
|
!0 === this.bq ? a.xn() : !1 === this.bq && a.wn();
|
|
null !== this.uc && (Um(this, a, this.uc, !0, !0), this.uc instanceof Da && this.uc.type === yd ? (a.beginPath(), a.rect(c.x, c.y, c.width, c.height), a.Gg(this.uc)) : a.fillRect(c.x, c.y, c.width, c.height));
|
|
g.Pt() || a.transform(g.m11, g.m12, g.m21, g.m22, g.dx, g.dy);
|
|
null !== this.Nb && (t = this.Ga,
|
|
l = c = 0, q = t.width, t = t.height, r = 0, this instanceof X && (t = this.ab.vb, c = t.x, l = t.y, q = t.width, t = t.height, r = this.Oe), Um(this, a, this.Nb, !0, !1), this.Nb instanceof Da && this.Nb.type === yd ? (a.beginPath(), a.rect(c - r / 2, l - r / 2, q + r, t + r), a.Gg(this.Nb)) : a.fillRect(c - r / 2, l - r / 2, q + r, t + r));
|
|
u && u.bj && u.yH(a, this);
|
|
k && (null !== this.Nb || null !== this.uc || null !== h && 0 !== (h.ja & 512) || null !== h && (h.type === Dk || h.type === Yi) && h.gf() !== this) ? (Vm(this, !0), null === this.bq && a.wn()) : Vm(this, !1);
|
|
this.nk(a, b);
|
|
k && 0 !== (this.ja & 512) === !0 && a.xn();
|
|
n &&
|
|
k && a.wn();
|
|
m ? (a.restore(), this instanceof I ? ca(a, !0) : ca(a, !1)) : g.Pt() || (h = 1 / (g.m11 * g.m22 - g.m12 * g.m21), a.transform(g.m22 * h, -g.m12 * h, -g.m21 * h, g.m11 * h, h * (g.m21 * g.dy - g.m22 * g.dx), h * (g.m12 * g.dx - g.m11 * g.dy)))
|
|
}
|
|
1 !== d && (a.globalAlpha = e)
|
|
}
|
|
}
|
|
};
|
|
|
|
function Sm(a, b, c) {
|
|
var d = a.Xb;
|
|
0 === d.width || 0 === d.height || isNaN(d.x) || isNaN(d.y) || (null !== a.uc && (Um(a, b, a.uc, !0, !0), a.uc instanceof Da && a.uc.type === yd ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Gg(a.uc)) : b.fillRect(d.x, d.y, d.width, d.height)), null !== a.Nb && (Um(a, b, a.Nb, !0, !1), a.Nb instanceof Da && a.Nb.type === yd ? (b.beginPath(), b.rect(d.x, d.y, d.width, d.height), b.Gg(a.Nb)) : b.fillRect(d.x, d.y, d.width, d.height)), a.nk(b, c))
|
|
}
|
|
O.prototype.nk = function() {};
|
|
|
|
function Um(a, b, c, d, e) {
|
|
if (null !== c) {
|
|
var g = 1,
|
|
h = 1;
|
|
if ("string" === typeof c) d ? b.fillStyle = c : b.strokeStyle = c;
|
|
else if (c.type === rg) d ? b.fillStyle = c.color : b.strokeStyle = c.color;
|
|
else {
|
|
var k, h = a.Ga,
|
|
g = h.width,
|
|
h = h.height;
|
|
if (e) var l = a.W,
|
|
g = l.width,
|
|
h = l.height;
|
|
var m = b instanceof xd;
|
|
if (m && c.ah && (c.type === ym || c.On === g && c.ty === h)) k = c.ah;
|
|
else {
|
|
var n = l = 0,
|
|
p = 0,
|
|
q = 0,
|
|
r = 0,
|
|
s = 0,
|
|
s = r = 0;
|
|
e && (l = a.W, g = l.width, h = l.height, r = l.x, s = l.y);
|
|
l = c.start.x * g + c.start.offsetX;
|
|
n = c.start.y * h + c.start.offsetY;
|
|
p = c.end.x * g + c.end.offsetX;
|
|
q = c.end.y * h + c.end.offsetY;
|
|
l += r;
|
|
p += r;
|
|
n += s;
|
|
q += s;
|
|
if (c.type === sg) k = b.createLinearGradient(l, n, p, q);
|
|
else if (c.type === yd) s = isNaN(c.xt) ? Math.max(g, h) / 2 : c.xt, isNaN(c.wu) ? (r = 0, s = Math.max(g, h) / 2) : r = c.wu, k = b.createRadialGradient(l, n, r, p, q, s);
|
|
else if (c.type === ym) try {
|
|
k = b.createPattern(c.pattern, "repeat")
|
|
} catch (t) {
|
|
k = null
|
|
} else z.ic(c.type, "Brush type");
|
|
if (c.type !== ym && (e = c.st, null !== e))
|
|
for (e = e.i; e.next();) k.addColorStop(e.key, e.value);
|
|
if (m && (c.ah = k, null !== k && (c.On = g, c.ty = h), null === k && c.type === ym && -1 !== c.On)) {
|
|
c.On = -1;
|
|
var v = a.h;
|
|
null !== v &&
|
|
-1 === c.On && z.setTimeout(function() {
|
|
v.Sp()
|
|
}, 600)
|
|
}
|
|
}
|
|
d ? b.fillStyle = k : b.strokeStyle = k
|
|
}
|
|
}
|
|
}
|
|
O.prototype.isContainedBy = O.prototype.Pl = function(a) {
|
|
if (a instanceof I) a: {
|
|
if (this !== a && null !== a)
|
|
for (var b = this.U; null !== b;) {
|
|
if (b === a) {
|
|
a = !0;
|
|
break a
|
|
}
|
|
b = b.U
|
|
}
|
|
a = !1
|
|
}
|
|
else a = !1;
|
|
return a
|
|
};
|
|
O.prototype.isVisibleObject = O.prototype.nj = function() {
|
|
if (!this.visible) return !1;
|
|
var a = this.U;
|
|
return null !== a ? a.nj() : !0
|
|
};
|
|
|
|
function Tm(a) {
|
|
if (0 !== (a.ja & 2048) === !0) {
|
|
var b = a.Hd;
|
|
b.reset();
|
|
if (!a.Xb.F() || !a.ud.F()) {
|
|
Wm(a, !1);
|
|
return
|
|
}
|
|
b.translate(a.Xb.x, a.Xb.y);
|
|
b.translate(-a.Ia.x, -a.Ia.y);
|
|
var c = a.Ga;
|
|
Km(a, b, c.x, c.y, c.width, c.height);
|
|
Wm(a, !1);
|
|
Xm(a, !0)
|
|
}
|
|
0 !== (a.ja & 4096) === !0 && (b = a.U, null === b ? (a.zk.set(a.Hd), a.iv = a.scale, Xm(a, !1)) : null !== b.ph && (c = a.zk, c.reset(), b.Vg() ? c.multiply(b.zk) : null !== b.U && c.multiply(b.U.zk), c.multiply(a.Hd), a.iv = a.scale * b.iv, Xm(a, !1)))
|
|
}
|
|
|
|
function Km(a, b, c, d, e, g) {
|
|
1 !== a.scale && b.scale(a.scale);
|
|
if (0 !== a.angle) {
|
|
var h = ec;
|
|
a.of && a.of.cd() && (h = a.of);
|
|
var k = z.O();
|
|
if (a instanceof D && a.Zb !== a)
|
|
for (c = a.Zb, d = c.Ga, k.tu(d.x, d.y, d.width, d.height, h), c.fl.Cb(k), k.offset(-c.Ia.x, -c.Ia.y), h = c.U; null !== h && h !== a;) h.fl.Cb(k), k.offset(-h.Ia.x, -h.Ia.y), h = h.U;
|
|
else k.tu(c, d, e, g, h);
|
|
b.rotate(a.angle, k.x, k.y);
|
|
z.A(k)
|
|
}
|
|
}
|
|
f = O.prototype;
|
|
f.S = function(a) {
|
|
void 0 === a && (a = !1);
|
|
if (!0 !== ml(this)) {
|
|
Yk(this, !0);
|
|
Om(this, !0);
|
|
var b = this.U;
|
|
null !== b ? a || b.S() : (a = this.h, null !== a && (a.qg.add(this), this instanceof E && (a.pa.qb || this.mf(), null !== this.Nd && Ym(this.Nd)), a.Ce(!0)));
|
|
if (this instanceof I) {
|
|
if (this.ba === Dk || this.ba === Ki) a = this.gf(), null !== a && a.S(!0);
|
|
a = this.va.o;
|
|
for (var b = a.length, c = 0; c < b; c++) {
|
|
var d = a[c];
|
|
!0 !== ml(d) && (d.Aa.F() || (d instanceof Zi || d instanceof I || d instanceof qa || Mm(d, !1) !== $i) && d.S(!0))
|
|
}
|
|
}
|
|
}
|
|
};
|
|
f.Ap = function() {
|
|
!1 === ml(this) && (Yk(this, !0), Om(this, !0))
|
|
};
|
|
|
|
function Ym(a) {
|
|
if (!1 === nl(a)) {
|
|
if (null !== a.U) a.U.S();
|
|
else {
|
|
var b = a.h;
|
|
null !== b && (b.qg.add(a), a instanceof E && a.mf(), b.Ce())
|
|
}
|
|
Om(a, !0)
|
|
}
|
|
}
|
|
f.Fi = function() {
|
|
0 !== (this.ja & 2048) === !1 && (Wm(this, !0), Xm(this, !0))
|
|
};
|
|
f.eA = function() {
|
|
Xm(this, !0)
|
|
};
|
|
f.ta = function() {
|
|
var a = this.ca;
|
|
null !== a && a.ta()
|
|
};
|
|
|
|
function Mm(a, b) {
|
|
var c = a.stretch,
|
|
d = a.U;
|
|
if (null !== d && d.ba === ga) return Zm(a, d.$d(a.Vb), d.Zd(a.column), b);
|
|
if (null !== d && d.ba === Dk && d.gf() === a) return $m(a, lf, b);
|
|
if (c === Am) {
|
|
if (null !== d) {
|
|
if (d.ba === Yi && d.gf() === a) return $m(a, lf, b);
|
|
c = d.Xd;
|
|
return c === Am ? $m(a, $i, b) : $m(a, c, b)
|
|
}
|
|
return $m(a, $i, b)
|
|
}
|
|
return $m(a, c, b)
|
|
}
|
|
|
|
function Zm(a, b, c, d) {
|
|
var e = a.stretch;
|
|
if (e !== Am) return $m(a, e, d);
|
|
var g = e = null;
|
|
switch (b.stretch) {
|
|
case Bm:
|
|
g = !0;
|
|
break;
|
|
case lf:
|
|
g = !0
|
|
}
|
|
switch (c.stretch) {
|
|
case Cm:
|
|
e = !0;
|
|
break;
|
|
case lf:
|
|
e = !0
|
|
}
|
|
b = a.U.Xd;
|
|
null === e && (e = b === Cm || b === lf);
|
|
null === g && (g = b === Bm || b === lf);
|
|
return !0 === e && !0 === g ? $m(a, lf, d) : !0 === e ? $m(a, Cm, d) : !0 === g ? $m(a, Bm, d) : $m(a, $i, d)
|
|
}
|
|
|
|
function $m(a, b, c) {
|
|
if (c) return b;
|
|
if (b === $i) return $i;
|
|
c = a.Aa;
|
|
if (c.F()) return $i;
|
|
a = a.angle;
|
|
if (!isNaN(c.width))
|
|
if (90 !== a && 270 !== a) {
|
|
if (b === Cm) return $i;
|
|
if (b === lf) return Bm
|
|
} else {
|
|
if (b === Bm) return $i;
|
|
if (b === lf) return Cm
|
|
}
|
|
if (!isNaN(c.height))
|
|
if (90 !== a && 270 !== a) {
|
|
if (b === Bm) return $i;
|
|
if (b === lf) return Cm
|
|
} else {
|
|
if (b === Cm) return $i;
|
|
if (b === lf) return Bm
|
|
}
|
|
return b
|
|
}
|
|
z.defineProperty(O, {
|
|
pu: "segmentOrientation"
|
|
}, function() {
|
|
return this.Bs
|
|
}, function(a) {
|
|
var b = this.Bs;
|
|
b !== a && (u && z.Ba(a, G, O, "segmentOrientation"), this.Bs = a, this.S(), this.j("segmentOrientation", b, a), a === Ni && (this.angle = 0))
|
|
});
|
|
z.defineProperty(O, {
|
|
De: "segmentIndex"
|
|
}, function() {
|
|
return this.zs
|
|
}, function(a) {
|
|
u && z.g(a, "number", O, "segmentIndex");
|
|
a = Math.round(a);
|
|
var b = this.zs;
|
|
b !== a && (this.zs = a, this.S(), this.j("segmentIndex", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
NA: "segmentFraction"
|
|
}, function() {
|
|
return this.ys
|
|
}, function(a) {
|
|
u && z.g(a, "number", O, "segmentFraction");
|
|
isNaN(a) ? a = 0 : 0 > a ? a = 0 : 1 < a && (a = 1);
|
|
var b = this.ys;
|
|
b !== a && (this.ys = a, this.S(), this.j("segmentFraction", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
EF: "segmentOffset"
|
|
}, function() {
|
|
return this.As
|
|
}, function(a) {
|
|
var b = this.As;
|
|
b.N(a) || (u && z.l(a, N, O, "segmentOffset"), this.As = a = a.V(), this.S(), this.j("segmentOffset", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
stretch: "stretch"
|
|
}, function() {
|
|
return this.di
|
|
}, function(a) {
|
|
var b = this.di;
|
|
b !== a && (u && z.Ba(a, O, O, "stretch"), this.di = a, this.S(), this.j("stretch", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
name: "name"
|
|
}, function() {
|
|
return this.Ub
|
|
}, function(a) {
|
|
var b = this.Ub;
|
|
b !== a && (u && z.g(a, "string", O, "name"), this.Ub = a, null !== this.ca && (this.ca.il = null), this.j("name", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
opacity: "opacity"
|
|
}, function() {
|
|
return this.Xc
|
|
}, function(a) {
|
|
var b = this.Xc;
|
|
b !== a && (z.g(a, "number", O, "opacity"), (0 > a || 1 < a) && z.ka(a, "0 <= value <= 1", O, "opacity"), this.Xc = a, this.j("opacity", b, a), a = this.h, b = this.ca, null !== a && null !== b && a.ta(lk(b, b.W)))
|
|
});
|
|
z.defineProperty(O, {
|
|
visible: "visible"
|
|
}, function() {
|
|
return 0 !== (this.ja & 1)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 1);
|
|
b !== a && (u && z.g(a, "boolean", O, "visible"), this.ja ^= 1, this.j("visible", b, a), b = this.U, null !== b ? b.S() : this instanceof D && this.wd(a), this.ta(), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
ig: "pickable"
|
|
}, function() {
|
|
return 0 !== (this.ja & 2)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 2);
|
|
b !== a && (u && z.g(a, "boolean", O, "pickable"), this.ja ^= 2, this.j("pickable", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
JH: "fromLinkableDuplicates"
|
|
}, function() {
|
|
return 0 !== (this.ja & 4)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 4);
|
|
b !== a && (u && z.g(a, "boolean", O, "fromLinkableDuplicates"), this.ja ^= 4, this.j("fromLinkableDuplicates", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
KH: "fromLinkableSelfNode"
|
|
}, function() {
|
|
return 0 !== (this.ja & 8)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 8);
|
|
b !== a && (u && z.g(a, "boolean", O, "fromLinkableSelfNode"), this.ja ^= 8, this.j("fromLinkableSelfNode", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
uJ: "toLinkableDuplicates"
|
|
}, function() {
|
|
return 0 !== (this.ja & 16)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 16);
|
|
b !== a && (u && z.g(a, "boolean", O, "toLinkableDuplicates"), this.ja ^= 16, this.j("toLinkableDuplicates", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
vJ: "toLinkableSelfNode"
|
|
}, function() {
|
|
return 0 !== (this.ja & 32)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 32);
|
|
b !== a && (u && z.g(a, "boolean", O, "toLinkableSelfNode"), this.ja ^= 32, this.j("toLinkableSelfNode", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Ff: "isPanelMain"
|
|
}, function() {
|
|
return 0 !== (this.ja & 64)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 64);
|
|
b !== a && (u && z.g(a, "boolean", O, "isPanelMain"), this.ja ^= 64, this.S(), this.j("isPanelMain", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Mt: "isActionable"
|
|
}, function() {
|
|
return 0 !== (this.ja & 128)
|
|
}, function(a) {
|
|
var b = 0 !== (this.ja & 128);
|
|
b !== a && (u && z.g(a, "boolean", O, "isActionable"), this.ja ^= 128, this.j("isActionable", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
vl: "areaBackground"
|
|
}, function() {
|
|
return this.uc
|
|
}, function(a) {
|
|
var b = this.uc;
|
|
b !== a && (u && null !== a && z.ot(a, "GraphObject.areaBackground"), a instanceof Da && a.freeze(), this.uc = a, this.ta(), this.j("areaBackground", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
background: "background"
|
|
}, function() {
|
|
return this.Nb
|
|
}, function(a) {
|
|
var b = this.Nb;
|
|
b !== a && (u && null !== a && z.ot(a, "GraphObject.background"), a instanceof Da && a.freeze(), this.Nb = a, this.ta(), this.j("background", b, a))
|
|
});
|
|
|
|
function Vm(a, b) {
|
|
a.ja = b ? a.ja | 512 : a.ja & -513
|
|
}
|
|
|
|
function bn(a, b) {
|
|
a.ja = b ? a.ja | 1024 : a.ja & -1025
|
|
}
|
|
|
|
function Wm(a, b) {
|
|
a.ja = b ? a.ja | 2048 : a.ja & -2049
|
|
}
|
|
|
|
function Xm(a, b) {
|
|
a.ja = b ? a.ja | 4096 : a.ja & -4097
|
|
}
|
|
|
|
function ml(a) {
|
|
return 0 !== (a.ja & 8192)
|
|
}
|
|
|
|
function Yk(a, b) {
|
|
a.ja = b ? a.ja | 8192 : a.ja & -8193
|
|
}
|
|
|
|
function nl(a) {
|
|
return 0 !== (a.ja & 16384)
|
|
}
|
|
|
|
function Om(a, b) {
|
|
a.ja = b ? a.ja | 16384 : a.ja & -16385
|
|
}
|
|
z.w(O, {
|
|
ca: "part"
|
|
}, function() {
|
|
if (this instanceof D) return this;
|
|
if (null !== this.Bm) return this.Bm;
|
|
var a;
|
|
for (a = this.U; a;) {
|
|
if (a instanceof D) return this.Bm = a;
|
|
a = a.U
|
|
}
|
|
return null
|
|
});
|
|
z.w(O, {
|
|
U: "panel"
|
|
}, function() {
|
|
return this.lh
|
|
});
|
|
O.prototype.Tl = function(a) {
|
|
this.lh = a
|
|
};
|
|
z.w(O, {
|
|
layer: "layer"
|
|
}, function() {
|
|
var a = this.ca;
|
|
return null !== a ? a.layer : null
|
|
}, {
|
|
configurable: !0
|
|
});
|
|
z.w(O, {
|
|
h: "diagram"
|
|
}, function() {
|
|
var a = this.ca;
|
|
return null !== a ? a.h : null
|
|
}, {
|
|
configurable: !0
|
|
});
|
|
z.defineProperty(O, {
|
|
position: "position"
|
|
}, function() {
|
|
return this.sb
|
|
}, function(a) {
|
|
var b = this.sb;
|
|
b.N(a) || (u && z.l(a, N, O, "position"), a = a.V(), this.RA(a, b) && this.j("position", b, a))
|
|
});
|
|
O.prototype.RA = function(a) {
|
|
this.sb = a;
|
|
Ym(this);
|
|
this.Fi();
|
|
return !0
|
|
};
|
|
O.prototype.Nx = function(a, b) {
|
|
this.sb.n(a, b);
|
|
cn(this);
|
|
this.Fi()
|
|
};
|
|
z.w(O, {
|
|
W: "actualBounds"
|
|
}, function() {
|
|
return this.Xb
|
|
});
|
|
z.defineProperty(O, {
|
|
scale: "scale"
|
|
}, function() {
|
|
return this.bc
|
|
}, function(a) {
|
|
var b = this.bc;
|
|
b !== a && (u && z.p(a, O, "scale"), 0 >= a && z.k("GraphObject.scale for " + this + " must be greater than zero, not: " + a), this.bc = a, this.Fi(), this.S(), this.j("scale", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
angle: "angle"
|
|
}, function() {
|
|
return this.bm
|
|
}, function(a) {
|
|
var b = this.bm;
|
|
b !== a && (u && z.p(a, O, "angle"), a %= 360, 0 > a && (a += 360), b !== a && (this.bm = a, this.S(), this.Fi(), this.j("angle", b, a)))
|
|
});
|
|
z.defineProperty(O, {
|
|
Aa: "desiredSize"
|
|
}, function() {
|
|
return this.tf
|
|
}, function(a) {
|
|
var b = this.tf;
|
|
b.N(a) || (u && z.l(a, Ea, O, "desiredSize"), this.tf = a = a.V(), this.S(), this instanceof X && this.Ae(), this.j("desiredSize", b, a), a = this.ca, null !== a && 0 !== (this.ja & 1024) && (Im(this, a, "width"), Im(this, a, "height")))
|
|
});
|
|
z.defineProperty(O, {
|
|
width: "width"
|
|
}, function() {
|
|
return this.tf.width
|
|
}, function(a) {
|
|
if (this.tf.width !== a) {
|
|
u && z.g(a, "number", O, "width");
|
|
var b = this.tf;
|
|
this.tf = a = (new Ea(a, this.tf.height)).freeze();
|
|
this.S();
|
|
this instanceof X && this.Ae();
|
|
this.j("desiredSize", b, a);
|
|
b = this.ca;
|
|
null !== b && 0 !== (this.ja & 1024) && Im(this, b, "width")
|
|
}
|
|
});
|
|
z.defineProperty(O, {
|
|
height: "height"
|
|
}, function() {
|
|
return this.tf.height
|
|
}, function(a) {
|
|
if (this.tf.height !== a) {
|
|
u && z.g(a, "number", O, "height");
|
|
var b = this.tf;
|
|
this.tf = a = (new Ea(this.tf.width, a)).freeze();
|
|
this.S();
|
|
this instanceof X && this.Ae();
|
|
this.j("desiredSize", b, a);
|
|
b = this.ca;
|
|
null !== b && 0 !== (this.ja & 1024) && Im(this, b, "height")
|
|
}
|
|
});
|
|
z.defineProperty(O, {
|
|
cg: "minSize"
|
|
}, function() {
|
|
return this.Tj
|
|
}, function(a) {
|
|
var b = this.Tj;
|
|
b.N(a) || (u && z.l(a, Ea, O, "minSize"), a = a.copy(), isNaN(a.width) && (a.width = 0), isNaN(a.height) && (a.height = 0), a.freeze(), this.Tj = a, this.S(), this.j("minSize", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Xe: "maxSize"
|
|
}, function() {
|
|
return this.Rj
|
|
}, function(a) {
|
|
var b = this.Rj;
|
|
b.N(a) || (u && z.l(a, Ea, O, "maxSize"), a = a.copy(), isNaN(a.width) && (a.width = Infinity), isNaN(a.height) && (a.height = Infinity), a.freeze(), this.Rj = a, this.S(), this.j("maxSize", b, a))
|
|
});
|
|
z.w(O, {
|
|
Ia: "measuredBounds"
|
|
}, function() {
|
|
return this.ud
|
|
});
|
|
z.w(O, {
|
|
Ga: "naturalBounds"
|
|
}, function() {
|
|
return this.Wc
|
|
}, {
|
|
configurable: !0
|
|
});
|
|
z.defineProperty(O, {
|
|
margin: "margin"
|
|
}, function() {
|
|
return this.Er
|
|
}, function(a) {
|
|
"number" === typeof a ? a = new Db(a) : u && z.l(a, Db, O, "margin");
|
|
var b = this.Er;
|
|
b.N(a) || (this.Er = a = a.V(), this.S(), this.j("margin", b, a))
|
|
});
|
|
z.w(O, {
|
|
transform: null
|
|
}, function() {
|
|
0 !== (this.ja & 2048) === !0 && Tm(this);
|
|
return this.Hd
|
|
});
|
|
z.w(O, {
|
|
ph: null
|
|
}, function() {
|
|
0 !== (this.ja & 4096) === !0 && Tm(this);
|
|
return this.zk
|
|
});
|
|
z.defineProperty(O, {
|
|
alignment: "alignment"
|
|
}, function() {
|
|
return this.Ie
|
|
}, function(a) {
|
|
var b = this.Ie;
|
|
b.N(a) || (u && z.l(a, Q, O, "alignment"), a.Be() && !a.bd() && z.k("GraphObject.alignment for " + this + " must be a real Spot or Spot.Default, not: " + a), this.Ie = a = a.V(), Ym(this), this.j("alignment", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
column: "column"
|
|
}, function() {
|
|
return this.wq
|
|
}, function(a) {
|
|
u && z.p(a, O, "column");
|
|
a = Math.round(a);
|
|
var b = this.wq;
|
|
b !== a && (0 > a && z.ka(a, ">= 0", O, "column"), this.wq = a, this.S(), this.j("column", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
eH: "columnSpan"
|
|
}, function() {
|
|
return this.wi
|
|
}, function(a) {
|
|
u && z.g(a, "number", O, "columnSpan");
|
|
a = Math.round(a);
|
|
var b = this.wi;
|
|
b !== a && (1 > a && z.ka(a, ">= 1", O, "columnSpan"), this.wi = a, this.S(), this.j("columnSpan", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Vb: "row"
|
|
}, function() {
|
|
return this.us
|
|
}, function(a) {
|
|
u && z.p(a, O, "row");
|
|
a = Math.round(a);
|
|
var b = this.us;
|
|
b !== a && (0 > a && z.ka(a, ">= 0", O, "row"), this.us = a, this.S(), this.j("row", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
rowSpan: "rowSpan"
|
|
}, function() {
|
|
return this.Ti
|
|
}, function(a) {
|
|
u && z.g(a, "number", O, "rowSpan");
|
|
a = Math.round(a);
|
|
var b = this.Ti;
|
|
b !== a && (1 > a && z.ka(a, ">= 1", O, "rowSpan"), this.Ti = a, this.S(), this.j("rowSpan", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Qx: "spanAllocation"
|
|
}, function() {
|
|
return this.Os
|
|
}, function(a) {
|
|
var b = this.Os;
|
|
b !== a && (null !== a && z.g(a, "function", O, "spanAllocation"), this.Os = a, this.j("spanAllocation", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
jk: "alignmentFocus"
|
|
}, function() {
|
|
return this.oq
|
|
}, function(a) {
|
|
var b = this.oq;
|
|
b.N(a) || (u && z.l(a, Q, O, "alignmentFocus"), !a.Be() || a.bd() || a.N(Yb) && this instanceof E || z.k("GraphObject.alignmentFocus must be a real Spot or Spot.Default, not: " + a), this.oq = a = a.V(), this.S(), this.j("alignmentFocus", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
yd: "portId"
|
|
}, function() {
|
|
return this.fs
|
|
}, function(a) {
|
|
var b = this.fs;
|
|
if (b !== a) {
|
|
u && null !== a && z.g(a, "string", O, "portId");
|
|
var c = this.ca;
|
|
null === c || c instanceof E || (z.k("Cannot set portID on a Link: " + a), c = null);
|
|
null !== b && null !== c && dn(c, this);
|
|
this.fs = a;
|
|
if (null !== a && c) {
|
|
c.Ph = !0;
|
|
null === c.Dd && en(c);
|
|
var d = this.yd;
|
|
null !== d && c.Dd.add(d, this)
|
|
}
|
|
this.j("portId", b, a)
|
|
}
|
|
});
|
|
|
|
function an(a) {
|
|
var b = a.ca;
|
|
b instanceof E && (a = a.h, null === a || a.pa.qb || b.mf())
|
|
}
|
|
z.defineProperty(O, {
|
|
Eb: "toSpot"
|
|
}, function() {
|
|
return null !== this.la ? this.la.gk : Yb
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.gk;
|
|
b.N(a) || (u && z.l(a, Q, O, "toSpot"), a = a.V(), this.la.gk = a, this.j("toSpot", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
Yl: "toEndSegmentLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.ek : 10
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.ek;
|
|
b !== a && (u && z.g(a, "number", O, "toEndSegmentLength"), 0 > a && z.ka(a, ">= 0", O, "toEndSegmentLength"), this.la.ek = a, this.j("toEndSegmentLength", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
zu: "toEndSegmentDirection"
|
|
}, function() {
|
|
return null !== this.la ? this.la.dk : Gm
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.dk;
|
|
b !== a && (u && z.Ba(a, E, O, "toEndSegmentDirection"), this.la.dk = a, this.j("toEndSegmentDirection", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
Au: "toShortLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.fk : 0
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.fk;
|
|
b !== a && (u && z.g(a, "number", O, "toShortLength"), this.la.fk = a, this.j("toShortLength", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
TF: "toLinkable"
|
|
}, function() {
|
|
return this.Vs
|
|
}, function(a) {
|
|
var b = this.Vs;
|
|
b !== a && (u && null !== a && z.g(a, "boolean", O, "toLinkable"), this.Vs = a, this.j("toLinkable", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
wJ: "toMaxLinks"
|
|
}, function() {
|
|
return this.Ws
|
|
}, function(a) {
|
|
var b = this.Ws;
|
|
b !== a && (u && z.g(a, "number", O, "toMaxLinks"), 0 > a && z.ka(a, ">= 0", O, "toMaxLinks"), this.Ws = a, this.j("toMaxLinks", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Db: "fromSpot"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Gj : Yb
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Gj;
|
|
b.N(a) || (u && z.l(a, Q, O, "fromSpot"), a = a.V(), this.la.Gj = a, this.j("fromSpot", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
Il: "fromEndSegmentLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Ej : 10
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Ej;
|
|
b !== a && (u && z.g(a, "number", O, "fromEndSegmentLength"), 0 > a && z.ka(a, ">= 0", O, "fromEndSegmentLength"), this.la.Ej = a, this.j("fromEndSegmentLength", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
Et: "fromEndSegmentDirection"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Dj : Gm
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Dj;
|
|
b !== a && (u && z.Ba(a, E, O, "fromEndSegmentDirection"), this.la.Dj = a, this.j("fromEndSegmentDirection", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
Ft: "fromShortLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Fj : 0
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Fj;
|
|
b !== a && (u && z.g(a, "number", O, "fromShortLength"), this.la.Fj = a, this.j("fromShortLength", b, a), an(this))
|
|
});
|
|
z.defineProperty(O, {
|
|
vE: "fromLinkable"
|
|
}, function() {
|
|
return this.Zq
|
|
}, function(a) {
|
|
var b = this.Zq;
|
|
b !== a && (u && null !== a && z.g(a, "boolean", O, "fromLinkable"), this.Zq = a, this.j("fromLinkable", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Yz: "fromMaxLinks"
|
|
}, function() {
|
|
return this.$q
|
|
}, function(a) {
|
|
var b = this.$q;
|
|
b !== a && (u && z.g(a, "number", O, "fromMaxLinks"), 0 > a && z.ka(a, ">= 0", O, "fromMaxLinks"), this.$q = a, this.j("fromMaxLinks", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
cursor: "cursor"
|
|
}, function() {
|
|
return this.Hq
|
|
}, function(a) {
|
|
var b = this.Hq;
|
|
b !== a && (z.g(a, "string", O, "cursor"), this.Hq = a, this.j("cursor", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
click: "click"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.ui : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.ui;
|
|
b !== a && (null !== a && z.g(a, "function", O, "click"), this.ma.ui = a, this.j("click", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
wt: "doubleClick"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Ci : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Ci;
|
|
b !== a && (null !== a && z.g(a, "function", O, "doubleClick"), this.ma.Ci = a, this.j("doubleClick", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
Gz: "contextClick"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.xi : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.xi;
|
|
b !== a && (null !== a && z.g(a, "function", O, "contextClick"), this.ma.xi = a, this.j("contextClick", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
au: "mouseEnter"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Rr : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Rr;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseEnter"), this.ma.Rr = a, this.j("mouseEnter", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
bu: "mouseLeave"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Sr : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Sr;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseLeave"), this.ma.Sr = a, this.j("mouseLeave", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
uA: "mouseOver"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Pi : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Pi;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseOver"), this.ma.Pi = a, this.j("mouseOver", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
tA: "mouseHover"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Oi : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Oi;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseHover"), this.ma.Oi = a, this.j("mouseHover", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
sA: "mouseHold"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Ni : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Ni;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseHold"), this.ma.Ni = a, this.j("mouseHold", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
II: "mouseDragEnter"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Pr : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Pr;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseDragEnter"), this.ma.Pr = a, this.j("mouseDragEnter", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
JI: "mouseDragLeave"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Qr : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Qr;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseDragLeave"), this.ma.Qr = a, this.j("mouseDragLeave", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
rA: "mouseDrop"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Mi : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Mi;
|
|
b !== a && (null !== a && z.g(a, "function", O, "mouseDrop"), this.ma.Mi = a, this.j("mouseDrop", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
AD: "actionDown"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.iq : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.iq;
|
|
b !== a && (null !== a && z.g(a, "function", O, "actionDown"), this.ma.iq = a, this.j("actionDown", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
BD: "actionMove"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.jq : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.jq;
|
|
b !== a && (null !== a && z.g(a, "function", O, "actionMove"), this.ma.jq = a, this.j("actionMove", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
CD: "actionUp"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.kq : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.kq;
|
|
b !== a && (null !== a && z.g(a, "function", O, "actionUp"), this.ma.kq = a, this.j("actionUp", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
zD: "actionCancel"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.hq : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.hq;
|
|
b !== a && (null !== a && z.g(a, "function", O, "actionCancel"), this.ma.hq = a, this.j("actionCancel", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
$A: "toolTip"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.Wi : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.Wi;
|
|
b !== a && (null !== a && z.l(a, da, O, "toolTip"), this.ma.Wi = a, this.j("toolTip", b, a))
|
|
});
|
|
z.defineProperty(O, {
|
|
contextMenu: "contextMenu"
|
|
}, function() {
|
|
return null !== this.ma ? this.ma.yi : null
|
|
}, function(a) {
|
|
Dm(this);
|
|
var b = this.ma.yi;
|
|
b !== a && (null !== a && z.l(a, da, O, "contextMenu"), this.ma.yi = a, this.j("contextMenu", b, a))
|
|
});
|
|
O.prototype.bind = O.prototype.bind = function(a) {
|
|
a.Ag = this;
|
|
var b = this.op();
|
|
null !== b && fn(b) && z.k("Cannot add a Binding to a template that has already been copied: " + a);
|
|
null === this.Ac && (this.Ac = new J(Xg));
|
|
this.Ac.add(a)
|
|
};
|
|
O.prototype.findTemplateBinder = O.prototype.op = function() {
|
|
for (var a = this instanceof I ? this : this.U; null !== a;) {
|
|
if (null !== a.Nk) return a;
|
|
a = a.U
|
|
}
|
|
return null
|
|
};
|
|
O.prototype.setProperties = function(a) {
|
|
z.qu(this, a)
|
|
};
|
|
var gn;
|
|
O.make = gn = function(a, b) {
|
|
var c = arguments,
|
|
d = null,
|
|
e = null;
|
|
if ("function" === typeof a) e = a;
|
|
else if ("string" === typeof a) {
|
|
var g = hn.na(a);
|
|
"function" === typeof g ? (c = z.zl(arguments), d = g(c)) : e = aa[a]
|
|
}
|
|
null === d && (void 0 === e && (d = window.$, void 0 !== d && void 0 !== d.noop && z.k("GraphObject.make failed to complete. Is it conflicting with another $ var? (such as jQuery)"), z.k("GraphObject.make failed to complete, it may be conflicting with another var.")), null !== e && e.constructor || z.k("GraphObject.make requires a class function or class name, not: " +
|
|
a), d = new e);
|
|
g = 1;
|
|
if (d instanceof C && 1 < c.length) {
|
|
var h = d,
|
|
e = c[1];
|
|
if ("string" === typeof e || e instanceof HTMLDivElement) Bk(h, e), g++
|
|
}
|
|
for (; g < c.length; g++) e = c[g], void 0 === e ? z.k("Undefined value at argument " + g + " for object being constructed by GraphObject.make: " + d) : jn(d, e);
|
|
return d
|
|
};
|
|
|
|
function jn(a, b) {
|
|
if ("string" === typeof b)
|
|
if (a instanceof qa) a.text = b;
|
|
else if (a instanceof X) a.Hb = b;
|
|
else if (a instanceof vk) a.source = b;
|
|
else if (a instanceof I) {
|
|
var c = Ja(I, b);
|
|
null !== c ? a.type = c : z.k("Unknown Panel type as an argument to GraphObject.make: " + b)
|
|
} else a instanceof Da ? (c = Ja(Da, b), null !== c ? a.type = c : z.k("Unknown Brush type as an argument to GraphObject.make: " + b)) : a instanceof hf ? (c = Ja(hf, b), null !== c ? a.type = c : z.k("Unknown Geometry type as an argument to GraphObject.make: " + b)) : a instanceof Of ?
|
|
(c = Ja(Of, b), null !== c ? a.type = c : z.k("Unknown PathSegment type as an argument to GraphObject.make: " + b)) : z.k("Unable to use a string as an argument to GraphObject.make: " + b);
|
|
else if (b instanceof O) c = b, a instanceof I || z.k("A GraphObject can only be added to a Panel, not to: " + a), a.add(c);
|
|
else if (b instanceof Fg) {
|
|
var d = b,
|
|
c = a,
|
|
e;
|
|
d.qe && c.getRowDefinition ? e = c.getRowDefinition(d.index) : !d.qe && c.getColumnDefinition ? e = c.getColumnDefinition(d.index) : z.k("A RowColumnDefinition can only be added to a Panel, not to: " +
|
|
a);
|
|
e.tt(d)
|
|
} else if (b instanceof Ba) a instanceof G && b.ze === G ? 2 === (b.value & 2) ? a.Gx = b : b === Ui || b === Mi || b === Li ? a.Se = b : b === kn || b === ln || b === mn ? a.it = b : b !== nn && b !== Ni && z.k("Unknown Link enum value for a Link property: " + b) : a instanceof I && b.ze === I ? a.type = b : a instanceof qa && b.ze === qa ? a.iG = b : a instanceof X && (b === $i || b === bj || b === cj || b === Am) ? a.Zz = b : a instanceof vk && (b === $i || b === bj || b === cj) ? a.XH = b : a instanceof O && b.ze === G ? (c = a, 0 === b.name.indexOf("Orient") ? c.pu = b : z.k("Unknown Link enum value for GraphObject.segmentOrientation property: " +
|
|
b)) : a instanceof O && b.ze === O ? a.stretch = b : a instanceof Fg && b.ze === Fg ? a.uu = b : a instanceof C && b.ze === C ? a.wl = b : a instanceof Da && b.ze === Da ? a.type = b : a instanceof hf && b.ze === hf ? a.type = b : a instanceof Of && b.ze === Of ? a.type = b : a instanceof Xg && b.ze === Xg ? a.mode = b : a instanceof Rf && b.ze === Rf ? a.Dc = b : a instanceof Y && b.ze === Y ? 0 === b.name.indexOf("Alignment") ? a.alignment = b : 0 === b.name.indexOf("Arrangement") ? a.Xf = b : 0 === b.name.indexOf("Compaction") ? a.compaction = b : 0 === b.name.indexOf("Path") ? a.path = b : 0 === b.name.indexOf("Sorting") ?
|
|
a.sorting = b : 0 === b.name.indexOf("Style") ? a.zJ = b : z.k("Unknown enum value: " + b) : a instanceof on && b.ze === on ? 0 === b.name.indexOf("Aggressive") ? a.SG = b : 0 === b.name.indexOf("Cycle") ? a.mH = b : 0 === b.name.indexOf("Init") ? a.bI = b : 0 === b.name.indexOf("Layer") ? a.qI = b : z.k("Unknown enum value: " + b) : a instanceof tm && b.ze === tm ? b === pn || b === qn || b === rn || b === sn ? a.sorting = b : b === tn || b === zn ? a.Xf = b : b === An || b === Bn ? a.alignment = b : z.k("Unknown enum value: " + b) : a instanceof Cn && b.ze === Cn ? b === Dn || b === En || b === Fn || b === Gn || b === Hn ? a.sorting =
|
|
b : b === In || b === Jn || b === Kn || b === Ln ? a.direction = b : b === Mn || b === Nn || b === On || b === Pn ? a.Xf = b : b === Qn || b === Rn ? a.tx = b : z.k("Unknown enum value: " + b) : z.k("No property to set for this enum value: " + b);
|
|
else if (b instanceof Xg) a instanceof O ? a.bind(b) : a instanceof Fg ? a.bind(b) : z.k("A Binding can only be applied to a GraphObject or RowColumnDefinition, not to: " + a);
|
|
else if (b instanceof kf) a instanceof hf ? a.cc.add(b) : z.k("A PathFigure can only be added to a Geometry, not to: " + a);
|
|
else if (b instanceof Of) a instanceof
|
|
kf ? a.Ab.add(b) : z.k("A PathSegment can only be added to a PathFigure, not to: " + a);
|
|
else if (b instanceof vg) a instanceof C ? a.Sb = b : a instanceof F ? a.Sb = b : z.k("A Layout can only be assigned to a Diagram or a Group, not to: " + a);
|
|
else if (Array.isArray(b))
|
|
for (c = 0; c < b.length; c++) jn(a, b[c]);
|
|
else if ("object" === typeof b && null !== b)
|
|
if (a instanceof Da) {
|
|
e = new ma;
|
|
for (c in b) d = parseFloat(c), isNaN(d) ? e[c] = b[c] : a.addColorStop(d, b[c]);
|
|
z.qu(a, e)
|
|
} else if (a instanceof Fg) {
|
|
void 0 !== b.row ? (e = b.row, (void 0 === e || null === e || Infinity ===
|
|
e || isNaN(e) || 0 > e) && z.k("Must specify non-negative integer row for RowColumnDefinition " + b + ", not: " + e), a.qe = !0, a.index = e) : void 0 !== b.column && (e = b.column, (void 0 === e || null === e || Infinity === e || isNaN(e) || 0 > e) && z.k("Must specify non-negative integer column for RowColumnDefinition " + b + ", not: " + e), a.qe = !1, a.index = e);
|
|
e = new ma;
|
|
for (c in b) "row" !== c && "column" !== c && (e[c] = b[c]);
|
|
z.qu(a, e)
|
|
} else z.qu(a, b);
|
|
else z.k('Unknown initializer "' + b + '" for object being constructed by GraphObject.make: ' + a)
|
|
}
|
|
var hn = new na("string", "function");
|
|
O.getBuilders = function() {
|
|
var a = new na("string", "function"),
|
|
b;
|
|
for (b in hn)
|
|
if (b !== b.toLowerCase()) {
|
|
var c = hn[b];
|
|
"function" === typeof c && a.add(b, c)
|
|
}
|
|
a.freeze();
|
|
return a
|
|
};
|
|
var Sn;
|
|
O.defineBuilder = Sn = function(a, b) {
|
|
z.g(a, "string", O, "defineBuilder:name");
|
|
z.g(b, "function", O, "defineBuilder:func");
|
|
var c = a.toLowerCase();
|
|
"" !== a && "none" !== c && a !== c || z.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a);
|
|
hn.add(a, b)
|
|
};
|
|
var Tn;
|
|
O.takeBuilderArgument = Tn = function(a, b, c) {
|
|
void 0 === c && (c = null);
|
|
var d = a[1];
|
|
if ("function" === typeof c ? c(d) : "string" === typeof d) return a.splice(1, 1), d;
|
|
if (void 0 === b) throw Error("no " + ("function" === typeof c ? "satisfactory" : "string") + " argument for GraphObject builder " + a[0]);
|
|
return b
|
|
};
|
|
Sn("Button", function() {
|
|
var a = new Da(sg);
|
|
a.addColorStop(0, "white");
|
|
a.addColorStop(1, "lightgray");
|
|
var b = new Da(sg);
|
|
b.addColorStop(0, "white");
|
|
b.addColorStop(1, "dodgerblue");
|
|
a = gn(I, Dk, {
|
|
Mt: !0
|
|
}, {
|
|
_buttonFillNormal: a,
|
|
_buttonStrokeNormal: "gray",
|
|
_buttonFillOver: b,
|
|
_buttonStrokeOver: "blue"
|
|
}, gn(X, {
|
|
name: "ButtonBorder",
|
|
Hb: "Rectangle",
|
|
C: new Q(0, 0, 2.761423749153968, 2.761423749153968),
|
|
D: new Q(1, 1, -2.761423749153968, -2.761423749153968),
|
|
fill: a,
|
|
stroke: "gray"
|
|
}));
|
|
a.au = function(a, b) {
|
|
var e = b.oe("ButtonBorder");
|
|
if (e instanceof X) {
|
|
var g = b._buttonFillOver;
|
|
b._buttonFillNormal = e.fill;
|
|
e.fill = g;
|
|
g = b._buttonStrokeOver;
|
|
b._buttonStrokeNormal = e.stroke;
|
|
e.stroke = g
|
|
}
|
|
};
|
|
a.bu = function(a, b) {
|
|
var e = b.oe("ButtonBorder");
|
|
e instanceof X && (e.fill = b._buttonFillNormal, e.stroke = b._buttonStrokeNormal)
|
|
};
|
|
return a
|
|
});
|
|
Sn("TreeExpanderButton", function() {
|
|
var a = gn("Button", {
|
|
_treeExpandedFigure: "MinusLine",
|
|
_treeCollapsedFigure: "PlusLine"
|
|
}, gn(X, {
|
|
name: "ButtonIcon",
|
|
Hb: "MinusLine",
|
|
Aa: ae
|
|
}, (new Xg("figure", "isTreeExpanded", function(a, c) {
|
|
var d = c.U;
|
|
return a ? d._treeExpandedFigure : d._treeCollapsedFigure
|
|
})).ux()), {
|
|
visible: !1
|
|
}, (new Xg("visible", "isTreeLeaf", function(a) {
|
|
return !a
|
|
})).ux());
|
|
a.click = function(a, c) {
|
|
var d = c.ca;
|
|
d instanceof da && (d = d.Wf);
|
|
if (d instanceof E) {
|
|
var e = d.h;
|
|
if (null !== e) {
|
|
e = e.wb;
|
|
if (d.vd) {
|
|
if (!e.canCollapseTree(d)) return
|
|
} else if (!e.canExpandTree(d)) return;
|
|
a.Gc = !0;
|
|
d.vd ? e.collapseTree(d) : e.expandTree(d)
|
|
}
|
|
}
|
|
};
|
|
return a
|
|
});
|
|
Sn("SubGraphExpanderButton", function() {
|
|
var a = gn("Button", {
|
|
_subGraphExpandedFigure: "MinusLine",
|
|
_subGraphCollapsedFigure: "PlusLine"
|
|
}, gn(X, {
|
|
name: "ButtonIcon",
|
|
Hb: "MinusLine",
|
|
Aa: ae
|
|
}, (new Xg("figure", "isSubGraphExpanded", function(a, c) {
|
|
var d = c.U;
|
|
return a ? d._subGraphExpandedFigure : d._subGraphCollapsedFigure
|
|
})).ux()));
|
|
a.click = function(a, c) {
|
|
var d = c.ca;
|
|
d instanceof da && (d = d.Wf);
|
|
if (d instanceof F) {
|
|
var e = d.h;
|
|
if (null !== e) {
|
|
e = e.wb;
|
|
if (d.re) {
|
|
if (!e.canCollapseSubGraph(d)) return
|
|
} else if (!e.canExpandSubGraph(d)) return;
|
|
a.Gc = !0;
|
|
d.re ? e.collapseSubGraph(d) : e.expandSubGraph(d)
|
|
}
|
|
}
|
|
};
|
|
return a
|
|
});
|
|
Sn("ContextMenuButton", function() {
|
|
var a = gn("Button");
|
|
a.stretch = Cm;
|
|
var b = a.oe("ButtonBorder");
|
|
b instanceof X && (b.Hb = "Rectangle", b.C = new Q(0, 0, 2, 3), b.D = new Q(1, 1, -2, -2));
|
|
return a
|
|
});
|
|
Sn("PanelExpanderButton", function(a) {
|
|
var b = Tn(a, "COLLAPSIBLE");
|
|
a = gn("Button", gn(X, "TriangleUp", {
|
|
Aa: new Ea(6, 4)
|
|
}, (new Xg("figure", "visible", function(a) {
|
|
return a ? "TriangleUp" : "TriangleDown"
|
|
})).ux(b)));
|
|
var c = a.oe("ButtonBorder");
|
|
c instanceof X && (c.stroke = null, c.fill = "transparent");
|
|
a.click = function(a, c) {
|
|
var g = c.h;
|
|
if (null !== g && !g.jb) {
|
|
var h = c.ca.oe(b);
|
|
null !== h && (g.Wb("Collapse/Expand Panel"), h.visible = !h.visible, g.Jd("Collapse/Expand Panel"))
|
|
}
|
|
};
|
|
return a
|
|
});
|
|
Sn("CheckBoxButton", function(a) {
|
|
var b = Tn(a);
|
|
a = gn("Button", {
|
|
"ButtonBorder.fill": "white",
|
|
"ButtonBorder.stroke": "gray",
|
|
width: 14,
|
|
height: 14
|
|
}, gn(X, {
|
|
name: "ButtonIcon",
|
|
LH: "M0 4 L3 9 9 0",
|
|
ub: 2,
|
|
stretch: lf,
|
|
Zz: bj,
|
|
visible: !1
|
|
}, "" !== b ? (new Xg("visible", b)).yI() : []));
|
|
a.click = function(a, d) {
|
|
if (!(a.h.jb || "" !== b && a.h.ha.jb)) {
|
|
a.Gc = !0;
|
|
var e = d.oe("ButtonIcon");
|
|
e.h.Wb("checkbox");
|
|
e.visible = !e.visible;
|
|
"function" === typeof d._doClick && d._doClick(a, d);
|
|
e.h.Jd("checkbox")
|
|
}
|
|
};
|
|
return a
|
|
});
|
|
Sn("CheckBox", function(a) {
|
|
a = Tn(a);
|
|
a = gn("CheckBoxButton", a, {
|
|
name: "Button",
|
|
margin: new Db(0, 1, 0, 0)
|
|
});
|
|
var b = gn(I, "Horizontal", a, {
|
|
Mt: !0,
|
|
margin: 1,
|
|
_buttonFillNormal: a._buttonFillNormal,
|
|
_buttonStrokeNormal: a._buttonStrokeNormal,
|
|
_buttonFillOver: a._buttonFillOver,
|
|
_buttonStrokeOver: a._buttonStrokeOver,
|
|
au: a.au,
|
|
bu: a.bu,
|
|
click: a.click,
|
|
_buttonClick: a.click
|
|
});
|
|
a.au = null;
|
|
a.bu = null;
|
|
a.click = null;
|
|
return b
|
|
});
|
|
|
|
function Em() {
|
|
this.yi = this.Wi = this.hq = this.kq = this.jq = this.iq = this.Mi = this.Qr = this.Pr = this.Ni = this.Oi = this.Pi = this.Sr = this.Rr = this.xi = this.Ci = this.ui = null
|
|
}
|
|
Em.prototype.copy = function() {
|
|
var a = new Em;
|
|
a.ui = this.ui;
|
|
a.Ci = this.Ci;
|
|
a.xi = this.xi;
|
|
a.Rr = this.Rr;
|
|
a.Sr = this.Sr;
|
|
a.Pi = this.Pi;
|
|
a.Oi = this.Oi;
|
|
a.Ni = this.Ni;
|
|
a.Pr = this.Pr;
|
|
a.Qr = this.Qr;
|
|
a.Mi = this.Mi;
|
|
a.iq = this.iq;
|
|
a.jq = this.jq;
|
|
a.kq = this.kq;
|
|
a.hq = this.hq;
|
|
a.Wi = this.Wi;
|
|
a.yi = this.yi;
|
|
return a
|
|
};
|
|
|
|
function I(a) {
|
|
O.call(this);
|
|
void 0 === a ? 0 === arguments.length ? this.ba = ej : z.k("invalid argument to Panel constructor: undefined") : (z.Ba(a, I, I, "type"), this.ba = a);
|
|
this.va = new J(O);
|
|
this.df = Kd;
|
|
this.dh = !1;
|
|
this.ba === Gk && (this.dh = !0);
|
|
this.hr = !1;
|
|
this.Lq = Pc;
|
|
this.Bi = Am;
|
|
this.ba === ga && Un(this);
|
|
this.Zo = bj;
|
|
this.cr = ce;
|
|
this.dr = Id;
|
|
this.Nk = this.fe = null;
|
|
this.vr = NaN;
|
|
this.sg = this.Ii = null;
|
|
this.vo = "category";
|
|
this.rg = null;
|
|
this.Yi = new w(NaN, NaN, NaN, NaN);
|
|
this.Lm = null;
|
|
this.Ph = !1;
|
|
this.vs = null
|
|
}
|
|
z.Qa(I, O);
|
|
z.ii(I);
|
|
z.ia("Panel", I);
|
|
|
|
function Un(a) {
|
|
a.Aj = Kd;
|
|
a.Mh = 1;
|
|
a.Ai = null;
|
|
a.hm = null;
|
|
a.Lh = 1;
|
|
a.Kh = null;
|
|
a.gm = null;
|
|
a.Wd = [];
|
|
a.Sd = [];
|
|
a.Gm = Vn;
|
|
a.fm = Vn;
|
|
a.Xi = 0;
|
|
a.Ji = 0
|
|
}
|
|
I.prototype.cloneProtected = function(a) {
|
|
O.prototype.cloneProtected.call(this, a);
|
|
a.ba = this.ba;
|
|
a.df = this.df.V();
|
|
a.dh = this.dh;
|
|
a.hr = this.hr;
|
|
a.Lq = this.Lq.V();
|
|
a.Bi = this.Bi;
|
|
if (a.ba === ga) {
|
|
a.Aj = this.Aj.V();
|
|
a.Mh = this.Mh;
|
|
a.Ai = this.Ai;
|
|
a.hm = this.hm;
|
|
a.Lh = this.Lh;
|
|
a.Kh = this.Kh;
|
|
a.gm = this.gm;
|
|
var b = [];
|
|
if (0 < this.Wd.length)
|
|
for (var c = this.Wd, d = c.length, e = 0; e < d; e++)
|
|
if (void 0 !== c[e]) {
|
|
var g = c[e].copy();
|
|
g.Tl(a);
|
|
b[e] = g
|
|
}
|
|
a.Wd = b;
|
|
b = [];
|
|
if (0 < this.Sd.length)
|
|
for (c = this.Sd, d = c.length, e = 0; e < d; e++) void 0 !== c[e] && (g = c[e].copy(), g.Tl(a),
|
|
b[e] = g);
|
|
a.Sd = b;
|
|
a.Gm = this.Gm;
|
|
a.fm = this.fm;
|
|
a.Xi = this.Xi;
|
|
a.Ji = this.Ji
|
|
}
|
|
a.Zo = this.Zo;
|
|
a.cr = this.cr.V();
|
|
a.dr = this.dr.V();
|
|
a.fe = this.fe;
|
|
a.Nk = this.Nk;
|
|
a.vr = this.vr;
|
|
a.Ii = this.Ii;
|
|
a.sg = this.sg;
|
|
a.vo = this.vo;
|
|
a.Yi.assign(this.Yi);
|
|
a.Ph = this.Ph;
|
|
null !== this.vs && (a.vs = this.vs)
|
|
};
|
|
I.prototype.ji = function(a) {
|
|
O.prototype.ji.call(this, a);
|
|
a.va = this.va;
|
|
for (var b = a.va.o, c = b.length, d = 0; d < c; d++) b[d].lh = a;
|
|
a.Lm = null
|
|
};
|
|
I.prototype.copy = function() {
|
|
var a = O.prototype.copy.call(this);
|
|
if (null !== a) {
|
|
for (var b = this.va.o, c = b.length, d = 0; d < c; d++) {
|
|
var e = b[d].copy(),
|
|
g = a;
|
|
e.Tl(g);
|
|
e.Bm = null;
|
|
var h = g.va,
|
|
k = h.count;
|
|
h.Ld(k, e);
|
|
h = g.ca;
|
|
if (null !== h) {
|
|
h.il = null;
|
|
null !== e.yd && h instanceof E && (h.Ph = !0);
|
|
var l = g.h;
|
|
null !== l && l.pa.qb || h.Rc(Uf, "elements", g, null, e, null, k)
|
|
}
|
|
}
|
|
return a
|
|
}
|
|
return null
|
|
};
|
|
I.prototype.toString = function() {
|
|
return "Panel(" + this.type + ")#" + z.nd(this)
|
|
};
|
|
var ej;
|
|
I.Position = ej = z.s(I, "Position", 0);
|
|
I.Horizontal = z.s(I, "Horizontal", 1);
|
|
var Ck;
|
|
I.Vertical = Ck = z.s(I, "Vertical", 2);
|
|
var Yi;
|
|
I.Spot = Yi = z.s(I, "Spot", 3);
|
|
var Dk;
|
|
I.Auto = Dk = z.s(I, "Auto", 4);
|
|
var ga;
|
|
I.Table = ga = z.s(I, "Table", 5);
|
|
I.Viewbox = z.s(I, "Viewbox", 6);
|
|
var Qm;
|
|
I.TableRow = Qm = z.s(I, "TableRow", 7);
|
|
var Rm;
|
|
I.TableColumn = Rm = z.s(I, "TableColumn", 8);
|
|
var Ki;
|
|
I.Link = Ki = z.s(I, "Link", 9);
|
|
var Gk;
|
|
I.Grid = Gk = z.s(I, "Grid", 10);
|
|
z.defineProperty(I, {
|
|
type: "type"
|
|
}, function() {
|
|
return this.ba
|
|
}, function(a) {
|
|
var b = this.ba;
|
|
b !== a && (u && z.Ba(a, I, I, "type"), b !== Qm && b !== Rm || z.k("Cannot change Panel.type when it is already a TableRow or a TableColumn: " + a), this.ba = a, this.ba === Gk ? this.dh = !0 : this.ba === ga && Un(this), this.S(), this.j("type", b, a))
|
|
});
|
|
z.w(I, {
|
|
elements: "elements"
|
|
}, function() {
|
|
return this.va.i
|
|
});
|
|
z.w(I, {
|
|
Ga: "naturalBounds"
|
|
}, function() {
|
|
return this.Wc
|
|
});
|
|
z.defineProperty(I, {
|
|
padding: "padding"
|
|
}, function() {
|
|
return this.df
|
|
}, function(a) {
|
|
"number" === typeof a ? (0 > a && z.ka(a, ">= 0", I, "padding"), a = new Db(a)) : (z.l(a, Db, I, "padding"), 0 > a.left && z.ka(a.left, ">= 0", I, "padding:value.left"), 0 > a.right && z.ka(a.right, ">= 0", I, "padding:value.right"), 0 > a.top && z.ka(a.top, ">= 0", I, "padding:value.top"), 0 > a.bottom && z.ka(a.bottom, ">= 0", I, "padding:value.bottom"));
|
|
var b = this.df;
|
|
b.N(a) || (this.df = a = a.V(), this.S(), this.j("padding", b, a))
|
|
});
|
|
z.defineProperty(I, {
|
|
Bl: "defaultAlignment"
|
|
}, function() {
|
|
return this.Lq
|
|
}, function(a) {
|
|
var b = this.Lq;
|
|
b.N(a) || (u && z.l(a, Q, I, "defaultAlignment"), this.Lq = a = a.V(), this.S(), this.j("defaultAlignment", b, a))
|
|
});
|
|
z.defineProperty(I, {
|
|
Xd: "defaultStretch"
|
|
}, function() {
|
|
return this.Bi
|
|
}, function(a) {
|
|
var b = this.Bi;
|
|
b !== a && (z.Ba(a, O, I, "defaultStretch"), this.Bi = a, this.S(), this.j("defaultStretch", b, a))
|
|
});
|
|
z.defineProperty(I, {
|
|
qK: "defaultSeparatorPadding"
|
|
}, function() {
|
|
return void 0 === this.Aj ? Kd : this.Aj
|
|
}, function(a) {
|
|
if (void 0 !== this.Aj) {
|
|
"number" === typeof a ? a = new Db(a) : u && z.l(a, Db, I, "defaultSeparatorPadding");
|
|
var b = this.Aj;
|
|
b.N(a) || (this.Aj = a = a.V(), this.j("defaultSeparatorPadding", b, a))
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
oK: "defaultRowSeparatorStroke"
|
|
}, function() {
|
|
return void 0 === this.Ai ? null : this.Ai
|
|
}, function(a) {
|
|
var b = this.Ai;
|
|
b !== a && (null === a || "string" === typeof a || a instanceof Da) && (a instanceof Da && a.freeze(), this.Ai = a, this.j("defaultRowSeparatorStroke", b, a))
|
|
});
|
|
z.defineProperty(I, {
|
|
pK: "defaultRowSeparatorStrokeWidth"
|
|
}, function() {
|
|
return void 0 === this.Mh ? 1 : this.Mh
|
|
}, function(a) {
|
|
if (void 0 !== this.Mh) {
|
|
var b = this.Mh;
|
|
b !== a && isFinite(a) && 0 <= a && (this.Mh = a, this.j("defaultRowSeparatorStrokeWidth", b, a))
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
nK: "defaultRowSeparatorDashArray"
|
|
}, function() {
|
|
return void 0 === this.hm ? null : this.hm
|
|
}, function(a) {
|
|
if (void 0 !== this.hm) {
|
|
var b = this.hm;
|
|
if (b !== a) {
|
|
null === a || Array.isArray(a) || z.ic(a, "Array", I, "defaultRowSeparatorDashArray:value");
|
|
if (null !== a) {
|
|
for (var c = a.length, d = 0, e = 0; e < c; e++) {
|
|
var g = a[e];
|
|
"number" === typeof g && 0 <= g && isFinite(g) || z.k("defaultRowSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
|
|
d += g
|
|
}
|
|
if (0 === d) {
|
|
if (null === b) return;
|
|
a = null
|
|
}
|
|
}
|
|
this.hm = a;
|
|
this.ta();
|
|
this.j("defaultRowSeparatorDashArray", b, a)
|
|
}
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
iK: "defaultColumnSeparatorStroke"
|
|
}, function() {
|
|
return void 0 === this.Kh ? null : this.Kh
|
|
}, function(a) {
|
|
if (void 0 !== this.Kh) {
|
|
var b = this.Kh;
|
|
b !== a && (null === a || "string" === typeof a || a instanceof Da) && (a instanceof Da && a.freeze(), this.Kh = a, this.j("defaultColumnSeparatorStroke", b, a))
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
jK: "defaultColumnSeparatorStrokeWidth"
|
|
}, function() {
|
|
return void 0 === this.Lh ? 1 : this.Lh
|
|
}, function(a) {
|
|
if (void 0 !== this.Lh) {
|
|
var b = this.Lh;
|
|
b !== a && isFinite(a) && 0 <= a && (this.Lh = a, this.j("defaultColumnSeparatorStrokeWidth", b, a))
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
hK: "defaultColumnSeparatorDashArray"
|
|
}, function() {
|
|
return void 0 === this.gm ? null : this.gm
|
|
}, function(a) {
|
|
if (void 0 !== this.gm) {
|
|
var b = this.gm;
|
|
if (b !== a) {
|
|
null === a || Array.isArray(a) || z.ic(a, "Array", I, "defaultColumnSeparatorDashArray:value");
|
|
if (null !== a) {
|
|
for (var c = a.length, d = 0, e = 0; e < c; e++) {
|
|
var g = a[e];
|
|
"number" === typeof g && 0 <= g && isFinite(g) || z.k("defaultColumnSeparatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
|
|
d += g
|
|
}
|
|
if (0 === d) {
|
|
if (null === b) return;
|
|
a = null
|
|
}
|
|
}
|
|
this.gm =
|
|
a;
|
|
this.ta();
|
|
this.j("defaultColumnSeparatorDashArray", b, a)
|
|
}
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
FL: "viewboxStretch"
|
|
}, function() {
|
|
return this.Zo
|
|
}, function(a) {
|
|
var b = this.Zo;
|
|
b !== a && (z.Ba(a, O, I, "viewboxStretch"), this.Zo = a, this.j("viewboxStretch", b, a))
|
|
});
|
|
z.defineProperty(I, {
|
|
bx: "gridCellSize"
|
|
}, function() {
|
|
return this.cr
|
|
}, function(a) {
|
|
var b = this.cr;
|
|
b.N(a) || (z.l(a, Ea, I, "gridCellSize"), a.F() && 0 !== a.width && 0 !== a.height || z.k("Invalid Panel.gridCellSize: " + a), this.cr = a.V(), null !== this.h && this === this.h.Gt && hl(this.h), this.ta(), this.j("gridCellSize", b, a))
|
|
});
|
|
z.defineProperty(I, {
|
|
AE: "gridOrigin"
|
|
}, function() {
|
|
return this.dr
|
|
}, function(a) {
|
|
var b = this.dr;
|
|
b.N(a) || (z.l(a, N, I, "gridOrigin"), a.F() || z.k("Invalid Panel.gridOrigin: " + a), this.dr = a.V(), null !== this.h && hl(this.h), this.ta(), this.j("gridOrigin", b, a))
|
|
});
|
|
f = I.prototype;
|
|
f.Sv = function(a) {
|
|
O.prototype.Sv.call(this, a);
|
|
for (var b = this.va.o, c = b.length, d = 0; d < c; d++) b[d].Sv(a)
|
|
};
|
|
f.nk = function(a, b) {
|
|
if (this.ba === Gk) {
|
|
var c = this.gj() * b.scale;
|
|
0 >= c && (c = 1);
|
|
var d = this.bx,
|
|
e = d.width,
|
|
d = d.height,
|
|
g = this.Ga,
|
|
h = g.width,
|
|
g = g.height,
|
|
k = Math.ceil(h / e),
|
|
l = Math.ceil(g / d),
|
|
m = this.AE;
|
|
a.save();
|
|
a.beginPath();
|
|
a.rect(0, 0, h, g);
|
|
a.clip();
|
|
for (var n = [], p = this.va.o, q = p.length, r = 0; r < q; r++) {
|
|
var s = p[r],
|
|
t = [];
|
|
n.push(t);
|
|
if (s.visible)
|
|
for (var s = Gl(s.Hb), v = r + 1; v < q; v++) {
|
|
var x = p[v];
|
|
x.visible && Gl(x.Hb) === s && (x = x.interval, 2 <= x && t.push(x))
|
|
}
|
|
}
|
|
p = this.va.o;
|
|
q = p.length;
|
|
for (r = 0; r < q; r++) {
|
|
var y = p[r];
|
|
if (y.visible && (t = y.interval, !(2 >
|
|
e * t * c))) {
|
|
var s = n[r],
|
|
v = !1,
|
|
A = !0,
|
|
B = y.QF;
|
|
null !== B && (v = !0, A = a.Tz(B, y.ve));
|
|
if ("LineV" === y.Hb) {
|
|
a.lineWidth = y.ub;
|
|
Um(this, a, y.stroke, !1, !1);
|
|
a.beginPath();
|
|
for (var L = x = Math.floor(-m.x / e); L <= x + k; L++) {
|
|
var H = L * e + m.x;
|
|
0 <= H && H < h && Wn(L, t, s) && (v && !A ? Hm(a, H, 0, H, g, B, y.ve) : (a.moveTo(H, 0), a.lineTo(H, g)))
|
|
}
|
|
a.stroke()
|
|
} else if ("LineH" === y.Hb) {
|
|
a.lineWidth = y.ub;
|
|
Um(this, a, y.stroke, !1, !1);
|
|
a.beginPath();
|
|
for (L = x = Math.floor(-m.y / d); L <= x + l; L++) H = L * d + m.y, 0 <= H && H <= g && Wn(L, t, s) && (v && !A ? Hm(a, 0, H, h, H, B, y.ve) : (a.moveTo(0, H), a.lineTo(h, H)));
|
|
a.stroke()
|
|
} else if ("BarV" === y.Hb)
|
|
for (Um(this, a, y.fill, !0, !1), y = y.width, isNaN(y) && (y = e), L = x = Math.floor(-m.x / e); L <= x + k; L++) H = L * e + m.x, 0 <= H && H < h && Wn(L, t, s) && a.fillRect(H, 0, y, g);
|
|
else if ("BarH" === y.Hb)
|
|
for (Um(this, a, y.fill, !0, !1), y = y.height, isNaN(y) && (y = d), L = x = Math.floor(-m.y / d); L <= x + l; L++) H = L * d + m.y, 0 <= H && H <= g && Wn(L, t, s) && a.fillRect(0, H, h, y);
|
|
v && a.Pz()
|
|
}
|
|
}
|
|
a.restore();
|
|
ca(a, !1)
|
|
} else {
|
|
this.ba === ga && (a.lineCap = "butt", Xn(this, a, !0, this.Wd, !0), Xn(this, a, !1, this.Sd, !0), Yn(this, a, !0, this.Wd), Yn(this, a, !1, this.Sd), Xn(this,
|
|
a, !0, this.Wd, !1), Xn(this, a, !1, this.Sd, !1));
|
|
(c = this.KE) && a.save();
|
|
e = this.gf();
|
|
d = this.va.o;
|
|
h = d.length;
|
|
for (g = 0; g < h; g++) k = d[g], c && k === e && (a.Nw = !0), k.ff(a, b), c && k === e && (a.Nw = !1);
|
|
c && (a.restore(), ca(a, !0));
|
|
u && u.BH && this instanceof G && u.AH(a, b, this)
|
|
}
|
|
};
|
|
|
|
function Yn(a, b, c, d) {
|
|
for (var e = d.length, g = a.W, h = c ? a.$d(0) : a.Zd(0), k = 0; k < e; k++) {
|
|
var l = d[k];
|
|
if (void 0 !== l && l !== h && 0 !== l.Oa) {
|
|
if (c) {
|
|
if (l.position > g.height) continue
|
|
} else if (l.position > g.width) continue;
|
|
var m = l.$p;
|
|
isNaN(m) && (m = c ? a.Mh : a.Lh);
|
|
var n = l.Zp;
|
|
null === n && (n = c ? a.Ai : a.Kh);
|
|
if (0 !== m && null !== n) {
|
|
Um(a, b, n, !1, !1);
|
|
var n = !1,
|
|
p = !0,
|
|
q = l.iJ;
|
|
null !== q && (n = !0, void 0 !== b.setLineDash ? (b.setLineDash(q), b.lineDashOffset = a.ve) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = q, b.webkitLineDashOffset = a.ve) : void 0 !== b.mozDash ?
|
|
(b.mozDash = q, b.mozDashOffset = a.ve) : p = !1);
|
|
b.beginPath();
|
|
var r = l.position + m;
|
|
c ? r > g.height && (m -= r - g.height) : r > g.width && (m -= r - g.width);
|
|
l = l.position + m / 2;
|
|
b.lineWidth = m;
|
|
r = a.padding;
|
|
c ? (l += r.top, m = r.left, r = g.width - r.right, n && !p ? Hm(b, m, l, r, l, q, 0) : (b.moveTo(m, l), b.lineTo(r, l))) : (l += r.left, m = r.top, r = g.height - r.bottom, n && !p ? Hm(b, l, m, l, r, q, 0) : (b.moveTo(l, m), b.lineTo(l, r)));
|
|
b.stroke();
|
|
n && (void 0 !== b.setLineDash ? (b.setLineDash(z.xj), b.lineDashOffset = 0) : void 0 !== b.webkitLineDash ? (b.webkitLineDash = z.xj, b.webkitLineDashOffset =
|
|
0) : void 0 !== b.mozDash && (b.mozDash = null, b.mozDashOffset = 0))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function Xn(a, b, c, d, e) {
|
|
for (var g = d.length, h = a.W, k = 0; k < g; k++) {
|
|
var l = d[k];
|
|
if (void 0 !== l && null !== l.background && l.Mz !== e && 0 !== l.Oa) {
|
|
var m = c ? h.height : h.width;
|
|
if (!(l.position > m)) {
|
|
var n = l.Re(),
|
|
p = l.$p;
|
|
isNaN(p) && (p = c ? a.Mh : a.Lh);
|
|
var q = l.Zp;
|
|
null === q && (q = c ? a.Ai : a.Kh);
|
|
null === q && (p = 0);
|
|
n -= p;
|
|
p = l.position + p;
|
|
n += l.Oa;
|
|
p + n > m && (n = m - p);
|
|
0 >= n || (m = a.padding, Um(a, b, l.background, !0, !1), c ? b.fillRect(m.left, p + m.top, h.width - (m.left + m.right), n) : b.fillRect(p + m.left, m.top, n, h.height - (m.top + m.bottom)))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function Wn(a, b, c) {
|
|
if (0 !== a % b) return !1;
|
|
b = c.length;
|
|
for (var d = 0; d < b; d++)
|
|
if (0 === a % c[d]) return !1;
|
|
return !0
|
|
}
|
|
|
|
function Gl(a) {
|
|
return "LineV" === a || "BarV" === a
|
|
}
|
|
f.tp = function(a, b, c, d, e) {
|
|
var g = this.Vg(),
|
|
h = this.transform,
|
|
k = 1 / (h.m11 * h.m22 - h.m12 * h.m21),
|
|
l = h.m22 * k,
|
|
m = -h.m12 * k,
|
|
n = -h.m21 * k,
|
|
p = h.m11 * k,
|
|
q = k * (h.m21 * h.dy - h.m22 * h.dx),
|
|
r = k * (h.m12 * h.dx - h.m11 * h.dy);
|
|
if (null !== this.vl) return h = this.W, Ne(h.left, h.top, h.right, h.bottom, a, b, c, d, e);
|
|
if (null !== this.background) g = a * l + b * n + q, k = a * m + b * p + r, a = c * l + d * n + q, c = c * m + d * p + r, e.n(0, 0), d = this.Ga, c = Ne(0, 0, d.width, d.height, g, k, a, c, e), e.transform(h);
|
|
else {
|
|
g || (l = 1, n = m = 0, p = 1, r = q = 0);
|
|
k = a * l + b * n + q;
|
|
a = a * m + b * p + r;
|
|
l = c * l + d * n + q;
|
|
d = c * m + d * p + r;
|
|
e.n(l, d);
|
|
m = (l -
|
|
k) * (l - k) + (d - a) * (d - a);
|
|
c = !1;
|
|
p = this.va.o;
|
|
r = p.length;
|
|
n = z.O();
|
|
for (q = 0; q < r; q++) b = p[q], b.visible && b.tp(k, a, l, d, n) && (c = !0, b = (k - n.x) * (k - n.x) + (a - n.y) * (a - n.y), b < m && (m = b, e.set(n)));
|
|
z.A(n);
|
|
g && e.transform(h)
|
|
}
|
|
return c
|
|
};
|
|
f.S = function(a) {
|
|
O.prototype.S.call(this, a);
|
|
this.ba === Dk && (a = this.gf(), null !== a && a.S(!0));
|
|
a = this.va.o;
|
|
for (var b = a.length, c = 0; c < b; c++) {
|
|
var d = a[c];
|
|
!0 !== ml(d) && (d.Aa.F() || (d instanceof Zi || d instanceof I || d instanceof qa || Mm(d, !1) !== $i) && d.S(!0))
|
|
}
|
|
};
|
|
f.Ap = function() {
|
|
if (!1 === ml(this)) {
|
|
Yk(this, !0);
|
|
Om(this, !0);
|
|
for (var a = this.va.o, b = a.length, c = 0; c < b; c++) a[c].Ap()
|
|
}
|
|
};
|
|
f.Fi = function() {
|
|
if (0 !== (this.ja & 2048) === !1) {
|
|
Wm(this, !0);
|
|
Xm(this, !0);
|
|
for (var a = this.va.o, b = a.length, c = 0; c < b; c++) a[c].eA()
|
|
}
|
|
};
|
|
f.eA = function() {
|
|
Xm(this, !0);
|
|
for (var a = this.va.o, b = a.length, c = 0; c < b; c++) a[c].eA()
|
|
};
|
|
f.Ip = function(a, b, c, d) {
|
|
var e = this.Yi;
|
|
e.width = 0;
|
|
e.height = 0;
|
|
var g = this.Aa,
|
|
h = this.cg;
|
|
void 0 === c && (c = h.width, d = h.height);
|
|
c = Math.max(c, h.width);
|
|
d = Math.max(d, h.height);
|
|
var k = this.Xe;
|
|
isNaN(g.width) || (a = Math.min(g.width, k.width));
|
|
isNaN(g.height) || (b = Math.min(g.height, k.height));
|
|
a = Math.max(c, a);
|
|
b = Math.max(d, b);
|
|
var l = this.padding;
|
|
a = Math.max(a - l.left - l.right, 0);
|
|
b = Math.max(b - l.top - l.bottom, 0);
|
|
var m = this.va.o;
|
|
if (0 !== m.length) {
|
|
var n = this.ba.Ub;
|
|
switch (n) {
|
|
case "Position":
|
|
var p = a,
|
|
q = b,
|
|
r = c,
|
|
s = d,
|
|
t = m.length;
|
|
e.x = 0;
|
|
e.y =
|
|
0;
|
|
e.width = 0;
|
|
for (var v = e.height = 0; v < t; v++) {
|
|
var x = m[v];
|
|
if (x.visible || x === this.Zb) {
|
|
var y = x.margin,
|
|
A = y.right + y.left,
|
|
B = y.top + y.bottom;
|
|
rj(x, p, q, r, s);
|
|
var L = x.Ia,
|
|
H = Math.max(L.width + A, 0),
|
|
U = Math.max(L.height + B, 0),
|
|
ea = x.position.x,
|
|
W = x.position.y;
|
|
isFinite(ea) || (ea = 0);
|
|
isFinite(W) || (W = 0);
|
|
if (x instanceof X) {
|
|
var P = x;
|
|
if (P.ME) var ba = P.ub / 2,
|
|
ea = ea - ba,
|
|
W = W - ba
|
|
}
|
|
Ib(e, ea, W, H, U)
|
|
}
|
|
}
|
|
break;
|
|
case "Vertical":
|
|
for (var Oa = a, sa = c, Na = m.length, ua = z.rb(), Ha = 0; Ha < Na; Ha++) {
|
|
var Aa = m[Ha];
|
|
if (Aa.visible || Aa === this.Zb) {
|
|
var jc = Mm(Aa, !1);
|
|
if (jc !==
|
|
$i && jc !== Bm) ua.push(Aa);
|
|
else {
|
|
var zd = Aa.margin,
|
|
Ad = zd.right + zd.left,
|
|
Qe = zd.top + zd.bottom;
|
|
rj(Aa, Oa, Infinity, sa, 0);
|
|
var ac = Aa.Ia,
|
|
Ig = Math.max(ac.width + Ad, 0),
|
|
Bd = Math.max(ac.height + Qe, 0);
|
|
e.width = Math.max(e.width, Ig);
|
|
e.height += Bd
|
|
}
|
|
}
|
|
}
|
|
var sb = ua.length;
|
|
if (0 !== sb) {
|
|
this.Aa.width ? Oa = Math.min(this.Aa.width, this.Xe.width) : 0 !== e.width && (Oa = Math.min(e.width, this.Xe.width));
|
|
for (Ha = 0; Ha < sb; Ha++)
|
|
if (Aa = ua[Ha], Aa.visible || Aa === this.Zb) zd = Aa.margin, Ad = zd.right + zd.left, Qe = zd.top + zd.bottom, rj(Aa, Oa, Infinity, sa, 0), ac = Aa.Ia, Ig =
|
|
Math.max(ac.width + Ad, 0), Bd = Math.max(ac.height + Qe, 0), e.width = Math.max(e.width, Ig), e.height += Bd;
|
|
z.xa(ua)
|
|
}
|
|
break;
|
|
case "Horizontal":
|
|
for (var gb = b, oa = d, pa = m.length, tb = z.rb(), Xa = 0; Xa < pa; Xa++) {
|
|
var Va = m[Xa];
|
|
if (Va.visible || Va === this.Zb) {
|
|
var Ae = Mm(Va, !1);
|
|
if (Ae !== $i && Ae !== Cm) tb.push(Va);
|
|
else {
|
|
var Cd = Va.margin,
|
|
me = Cd.right + Cd.left,
|
|
Rd = Cd.top + Cd.bottom;
|
|
rj(Va, Infinity, gb, 0, oa);
|
|
var ne = Va.Ia,
|
|
Jg = Math.max(ne.width + me, 0),
|
|
fd = Math.max(ne.height + Rd, 0);
|
|
e.width += Jg;
|
|
e.height = Math.max(e.height, fd)
|
|
}
|
|
}
|
|
}
|
|
var pi = tb.length;
|
|
if (0 !== pi) {
|
|
this.Aa.height ?
|
|
gb = Math.min(this.Aa.height, this.Xe.height) : 0 !== e.height && (gb = Math.min(e.height, this.Xe.height));
|
|
for (Xa = 0; Xa < pi; Xa++)
|
|
if (Va = tb[Xa], Va.visible || Va === this.Zb) Cd = Va.margin, me = Cd.right + Cd.left, Rd = Cd.top + Cd.bottom, rj(Va, Infinity, gb, 0, oa), ne = Va.Ia, Jg = Math.max(ne.width + me, 0), fd = Math.max(ne.height + Rd, 0), e.width += Jg, e.height = Math.max(e.height, fd);
|
|
z.xa(tb)
|
|
}
|
|
break;
|
|
case "Spot":
|
|
a: {
|
|
var Ab = a,
|
|
Qb = b,
|
|
gd = c,
|
|
lh = d,
|
|
Lb = m.length,
|
|
kb = this.gf(),
|
|
cb = kb.margin,
|
|
Re = 0,
|
|
Sd = 0,
|
|
Kg = cb.right + cb.left,
|
|
Lg = cb.top + cb.bottom;rj(kb, Ab, Qb, gd, lh);
|
|
var kc =
|
|
kb.Ia,
|
|
lc = kc.width,
|
|
oe = kc.height,
|
|
hd = Math.max(lc + Kg, 0),
|
|
nb = Math.max(oe + Lg, 0);e.x = -cb.left;e.y = -cb.top;e.width = hd;e.height = nb;
|
|
for (var Uc = 0; Uc < Lb; Uc++) {
|
|
var Qa = m[Uc];
|
|
if (Qa !== kb && (Qa.visible || Qa === this.Zb)) {
|
|
cb = Qa.margin;
|
|
Re = cb.right + cb.left;
|
|
Sd = cb.top + cb.bottom;
|
|
rj(Qa, Ab, Qb, 0, 0);
|
|
var kc = Qa.Ia,
|
|
hd = Math.max(kc.width + Re, 0),
|
|
nb = Math.max(kc.height + Sd, 0),
|
|
ob = Qa.alignment;
|
|
ob.bd() && (ob = this.Bl);
|
|
ob.cd() || (ob = ec);
|
|
var yc = Qa.jk;
|
|
yc.bd() && (yc = ec);
|
|
Ib(e, ob.x * lc + ob.offsetX - (yc.x * kc.width - yc.offsetX) - cb.left, ob.y * oe + ob.offsetY - (yc.y *
|
|
kc.height - yc.offsetY) - cb.top, hd, nb)
|
|
}
|
|
}
|
|
var Dd = kb.stretch;Dd === Am && (Dd = Mm(kb, !1));
|
|
switch (Dd) {
|
|
case $i:
|
|
break a;
|
|
case lf:
|
|
if (!isFinite(Ab) && !isFinite(Qb)) break a;
|
|
break;
|
|
case Cm:
|
|
if (!isFinite(Ab)) break a;
|
|
break;
|
|
case Bm:
|
|
if (!isFinite(Qb)) break a
|
|
}
|
|
kc = kb.Ia;lc = kc.width;oe = kc.height;hd = Math.max(lc + Kg, 0);nb = Math.max(oe + Lg, 0);cb = kb.margin;e.x = -cb.left;e.y = -cb.top;e.width = hd;e.height = nb;
|
|
for (Uc = 0; Uc < Lb; Uc++) Qa = m[Uc],
|
|
Qa === kb || !Qa.visible && Qa !== this.Zb || (cb = Qa.margin, Re = cb.right + cb.left, Sd = cb.top + cb.bottom, kc = Qa.Ia, hd = Math.max(kc.width +
|
|
Re, 0), nb = Math.max(kc.height + Sd, 0), ob = Qa.alignment, ob.bd() && (ob = this.Bl), ob.cd() || (ob = ec), yc = Qa.jk, yc.bd() && (yc = ec), Ib(e, ob.x * lc + ob.offsetX - (yc.x * kc.width - yc.offsetX) - cb.left, ob.y * oe + ob.offsetY - (yc.y * kc.height - yc.offsetY) - cb.top, hd, nb))
|
|
}
|
|
break;
|
|
case "Auto":
|
|
var Mb = a,
|
|
pe = b,
|
|
tf = c,
|
|
Se = d,
|
|
Lf = m.length,
|
|
Fb = this.gf(),
|
|
Be = Fb.margin,
|
|
Rb = Be.right + Be.left,
|
|
Vb = Be.top + Be.bottom;
|
|
rj(Fb, Mb, pe, tf, Se);
|
|
var Nb = Fb.Ia,
|
|
Jc = 0;
|
|
if (Fb instanceof X) var lb = Fb,
|
|
Jc = lb.ub * lb.scale;
|
|
var Gb = Math.max(Nb.width + Rb, 0),
|
|
Ob = Math.max(Nb.height + Vb, 0),
|
|
Td =
|
|
Zn(Fb),
|
|
Mg = Td.x * Gb + Td.offsetX,
|
|
mh = Td.y * Ob + Td.offsetY,
|
|
Td = $n(Fb),
|
|
nh = Td.x * Gb + Td.offsetX,
|
|
Ce = Td.y * Ob + Td.offsetY,
|
|
Kc = Mb,
|
|
De = pe;
|
|
isFinite(Mb) && (Kc = Math.max(Math.abs(Mg - nh) - Jc, 0));
|
|
isFinite(pe) && (De = Math.max(Math.abs(mh - Ce) - Jc, 0));
|
|
var mc = z.Xl();
|
|
mc.n(0, 0);
|
|
for (var Bb = 0; Bb < Lf; Bb++) {
|
|
var Cb = m[Bb];
|
|
if (Cb !== Fb && (Cb.visible || Cb === this.Zb)) {
|
|
var Be = Cb.margin,
|
|
Lc = Be.right + Be.left,
|
|
Ng = Be.top + Be.bottom;
|
|
rj(Cb, Kc, De, 0, 0);
|
|
Nb = Cb.Ia;
|
|
Gb = Math.max(Nb.width + Lc, 0);
|
|
Ob = Math.max(Nb.height + Ng, 0);
|
|
mc.n(Math.max(Gb, mc.width), Math.max(Ob, mc.height))
|
|
}
|
|
}
|
|
if (1 ===
|
|
Lf) e.width = Gb, e.height = Ob, z.pk(mc);
|
|
else {
|
|
var Vc = Zn(Fb),
|
|
Wc = $n(Fb),
|
|
mb = 0,
|
|
Mc = 0;
|
|
Wc.x !== Vc.x && Wc.y !== Vc.y && (mb = mc.width / Math.abs(Wc.x - Vc.x), Mc = mc.height / Math.abs(Wc.y - Vc.y));
|
|
z.pk(mc);
|
|
Jc = 0;
|
|
Fb instanceof X && (lb = Fb, Jc = lb.ub * lb.scale, aj(lb) === bj && (mb = Mc = Math.max(mb, Mc)));
|
|
var mb = mb + (Math.abs(Vc.offsetX) + Math.abs(Wc.offsetX) + Jc),
|
|
Mc = Mc + (Math.abs(Vc.offsetY) + Math.abs(Wc.offsetY) + Jc),
|
|
Ud = Fb.stretch;
|
|
Ud === Am && (Ud = Mm(Fb, !1));
|
|
switch (Ud) {
|
|
case $i:
|
|
Se = tf = 0;
|
|
break;
|
|
case lf:
|
|
isFinite(Mb) && (mb = Mb);
|
|
isFinite(pe) && (Mc = pe);
|
|
break;
|
|
case Cm:
|
|
isFinite(Mb) &&
|
|
(mb = Mb);
|
|
Se = 0;
|
|
break;
|
|
case Bm:
|
|
tf = 0, isFinite(pe) && (Mc = pe)
|
|
}
|
|
Fb instanceof X && !Fb.Aa.F() && (lb = Fb, lb.Yh ? lb.Nn = null : lb.ab = null);
|
|
Fb.Ap();
|
|
rj(Fb, mb, Mc, tf, Se);
|
|
e.width = Fb.Ia.width + Rb;
|
|
e.height = Fb.Ia.height + Vb
|
|
}
|
|
break;
|
|
case "Table":
|
|
for (var Vd = a, uf = b, Og = c, vj = d, La = m.length, Te = z.rb(), qe = z.rb(), ia = 0; ia < La; ia++) {
|
|
var fa = m[ia],
|
|
id = fa instanceof I ? fa : null;
|
|
if (null === id || id.type !== Qm && id.type !== Rm || !fa.visible) Te.push(fa);
|
|
else {
|
|
u && (id.Aa.F() && z.k(id.toString() + " TableRow/TableColumn Panels cannot set a desiredSize: " + id.Aa.toString()),
|
|
id.cg.N(Pd) || z.k(id.toString() + " TableRow/TableColumn Panels cannot set a minSize: " + id.cg.toString()), id.Xe.N(de) || z.k(id.toString() + " TableRow/TableColumn Panels cannot set a maxSize: " + id.Xe.toString()));
|
|
qe.push(fa);
|
|
for (var oh = id.va.o, qi = oh.length, zc = 0; zc < qi; zc++) {
|
|
var ri = oh[zc];
|
|
id.type === Qm ? ri.Vb = fa.Vb : id.type === Rm && (ri.column = fa.column);
|
|
Te.push(ri)
|
|
}
|
|
}
|
|
}
|
|
La = Te.length;
|
|
0 === La && (this.$d(0), this.Zd(0));
|
|
for (var bc = [], ia = 0; ia < La; ia++) fa = Te[ia], Yk(fa, !0), Om(fa, !0), bc[fa.Vb] || (bc[fa.Vb] = []), bc[fa.Vb][fa.column] ||
|
|
(bc[fa.Vb][fa.column] = []), bc[fa.Vb][fa.column].push(fa);
|
|
z.xa(Te);
|
|
for (var ph = z.rb(), jd = z.rb(), Ee = z.rb(), Nc = {
|
|
count: 0
|
|
}, kd = {
|
|
count: 0
|
|
}, Ac = Vd, ld = uf, cg = this.Wd, La = cg.length, ia = 0; ia < La; ia++) {
|
|
var Z = cg[ia];
|
|
void 0 !== Z && (Z.Oa = 0)
|
|
}
|
|
cg = this.Sd;
|
|
La = cg.length;
|
|
for (ia = 0; ia < La; ia++) Z = cg[ia], void 0 !== Z && (Z.Oa = 0);
|
|
for (var Fe = bc.length, Ue = 0, ia = 0; ia < Fe; ia++) bc[ia] && (Ue = Math.max(Ue, bc[ia].length));
|
|
for (var si = Math.min(this.Xi, Fe - 1), ti = Math.min(this.Ji, Ue - 1), Oc = 0, Fe = bc.length, ia = 0; ia < Fe; ia++)
|
|
if (bc[ia])
|
|
for (var Ue = bc[ia].length,
|
|
pb = this.$d(ia), zc = pb.Oa = 0; zc < Ue; zc++)
|
|
if (bc[ia][zc]) {
|
|
var qb = this.Zd(zc);
|
|
void 0 === ph[zc] && (qb.Oa = 0, ph[zc] = !0);
|
|
for (var Xk = bc[ia][zc], dg = Xk.length, Pg = 0; Pg < dg; Pg++)
|
|
if (fa = Xk[Pg], fa.visible || fa === this.Zb) {
|
|
var Qg = 1 < fa.Ti || 1 < fa.wi;
|
|
Qg && (ia < si || zc < ti || jd.push(fa));
|
|
var Wb = fa.margin,
|
|
eg = Wb.right + Wb.left,
|
|
fg = Wb.top + Wb.bottom,
|
|
Xc = Zm(fa, pb, qb, !1),
|
|
Ge = fa.Aa,
|
|
un = !isNaN(Ge.height),
|
|
ui = !isNaN(Ge.width) && un;
|
|
Qg || Xc === $i || ui || ia < si || zc < ti || (void 0 !== Nc[zc] || Xc !== lf && Xc !== Cm || (Nc[zc] = -1, Nc.count++), void 0 !== kd[ia] || Xc !== lf && Xc !==
|
|
Bm || (kd[ia] = -1, kd.count++), Ee.push(fa));
|
|
rj(fa, Infinity, Infinity, 0, 0);
|
|
if (!(ia < si || zc < ti)) {
|
|
var Ve = fa.Ia,
|
|
We = Math.max(Ve.width + eg, 0),
|
|
Ed = Math.max(Ve.height + fg, 0);
|
|
if (1 === fa.Ti && (Xc === $i || Xc === Cm)) {
|
|
var Z = this.$d(ia),
|
|
md = Z.Re(),
|
|
Oc = Math.max(Ed - Z.Oa, 0);
|
|
Oc + md > ld && (Oc = Math.max(ld - md, 0));
|
|
var qh = 0 === Z.Oa;
|
|
Z.Oa += Oc;
|
|
ld = Math.max(ld - (Oc + (qh ? md : 0)), 0)
|
|
}
|
|
1 !== fa.wi || Xc !== $i && Xc !== Bm || (Z = this.Zd(zc), md = Z.Re(), Oc = Math.max(We - Z.Oa, 0), Oc + md > Ac && (Oc = Math.max(Ac - md, 0)), qh = 0 === Z.Oa, Z.Oa += Oc, Ac = Math.max(Ac - (Oc + (qh ? md : 0)), 0));
|
|
Qg &&
|
|
fa.Ap()
|
|
}
|
|
}
|
|
}
|
|
z.xa(ph);
|
|
for (var Wd = 0, Xd = 0, La = this.gp, ia = 0; ia < La; ia++) {
|
|
var rh = this.Sd[ia];
|
|
void 0 !== rh && (Wd += rh.Xa, 0 !== rh.Xa && (Wd += rh.Re()))
|
|
}
|
|
La = this.Yp;
|
|
for (ia = 0; ia < La; ia++) {
|
|
var sh = this.Wd[ia];
|
|
void 0 !== sh && (Xd += sh.Xa, 0 !== sh.Xa && (Xd += sh.Re()))
|
|
}
|
|
for (var Ac = Math.max(Vd - Wd, 0), nd = ld = Math.max(uf - Xd, 0), Rg = Ac, La = Ee.length, ia = 0; ia < La; ia++) {
|
|
var fa = Ee[ia],
|
|
pb = this.$d(fa.Vb),
|
|
qb = this.Zd(fa.column),
|
|
vf = fa.Ia,
|
|
Wb = fa.margin,
|
|
eg = Wb.right + Wb.left,
|
|
fg = Wb.top + Wb.bottom;
|
|
Nc[fa.column] = 0 === qb.Oa && void 0 !== Nc[fa.column] ? Math.max(vf.width +
|
|
eg, Nc[fa.column]) : null;
|
|
kd[fa.Vb] = 0 === pb.Oa && void 0 !== kd[fa.Vb] ? Math.max(vf.height + fg, kd[fa.Vb]) : null
|
|
}
|
|
var nc = 0,
|
|
th = 0;
|
|
for (ia in kd) "count" !== ia && (nc += kd[ia]);
|
|
for (ia in Nc) "count" !== ia && (th += Nc[ia]);
|
|
for (var rb = z.Xl(), ia = 0; ia < La; ia++)
|
|
if (fa = Ee[ia], fa.visible || fa === this.Zb) {
|
|
var pb = this.$d(fa.Vb),
|
|
qb = this.Zd(fa.column),
|
|
He = 0;
|
|
isFinite(qb.width) ? He = qb.width : (He = isFinite(Ac) && null !== Nc[fa.column] ? 0 === th ? qb.Oa + Ac : Nc[fa.column] / th * Rg : null !== Nc[fa.column] ? Ac : qb.Oa || Ac, He = Math.max(0, He - qb.Re()));
|
|
var Mf = 0;
|
|
isFinite(pb.height) ?
|
|
Mf = pb.height : (Mf = isFinite(ld) && null !== kd[fa.Vb] ? 0 === nc ? pb.Oa + ld : kd[fa.Vb] / nc * nd : null !== kd[fa.Vb] ? ld : pb.Oa || ld, Mf = Math.max(0, Mf - pb.Re()));
|
|
rb.n(Math.max(qb.pj, Math.min(He, qb.qf)), Math.max(pb.pj, Math.min(Mf, pb.qf)));
|
|
Xc = Zm(fa, pb, qb, !1);
|
|
switch (Xc) {
|
|
case Cm:
|
|
rb.height = Math.max(rb.height, pb.Oa + ld);
|
|
break;
|
|
case Bm:
|
|
rb.width = Math.max(rb.width, qb.Oa + Ac)
|
|
}
|
|
Wb = fa.margin;
|
|
eg = Wb.right + Wb.left;
|
|
fg = Wb.top + Wb.bottom;
|
|
fa.Ap();
|
|
rj(fa, rb.width, rb.height, qb.pj, pb.pj);
|
|
Ve = fa.Ia;
|
|
We = Math.max(Ve.width + eg, 0);
|
|
Ed = Math.max(Ve.height + fg,
|
|
0);
|
|
isFinite(Ac) && (We = Math.min(We, rb.width));
|
|
isFinite(ld) && (Ed = Math.min(Ed, rb.height));
|
|
var wf = 0,
|
|
wf = pb.Oa;
|
|
pb.Oa = Math.max(pb.Oa, Ed);
|
|
Oc = pb.Oa - wf;
|
|
ld = Math.max(ld - Oc, 0);
|
|
wf = qb.Oa;
|
|
qb.Oa = Math.max(qb.Oa, We);
|
|
Oc = qb.Oa - wf;
|
|
Ac = Math.max(Ac - Oc, 0)
|
|
}
|
|
z.xa(Ee);
|
|
for (var Yd = z.Xl(), La = jd.length, ia = 0; ia < La; ia++)
|
|
if (fa = jd[ia], fa.visible || fa === this.Zb) {
|
|
pb = this.$d(fa.Vb);
|
|
qb = this.Zd(fa.column);
|
|
rb.n(Math.max(qb.pj, Math.min(Vd, qb.qf)), Math.max(pb.pj, Math.min(uf, pb.qf)));
|
|
Xc = Zm(fa, pb, qb, !1);
|
|
switch (Xc) {
|
|
case lf:
|
|
0 !== qb.Oa && (rb.width = Math.min(rb.width,
|
|
qb.Oa));
|
|
0 !== pb.Oa && (rb.height = Math.min(rb.height, pb.Oa));
|
|
break;
|
|
case Cm:
|
|
0 !== qb.Oa && (rb.width = Math.min(rb.width, qb.Oa));
|
|
break;
|
|
case Bm:
|
|
0 !== pb.Oa && (rb.height = Math.min(rb.height, pb.Oa))
|
|
}
|
|
isFinite(qb.width) && (rb.width = qb.width);
|
|
isFinite(pb.height) && (rb.height = pb.height);
|
|
Yd.n(0, 0);
|
|
for (var hb = 1; hb < fa.Ti && !(fa.Vb + hb >= this.Yp); hb++) Z = this.$d(fa.Vb + hb), Yd.height += Math.max(Z.pj, isNaN(Z.ef) ? Z.qf : Math.min(Z.ef, Z.qf));
|
|
for (hb = 1; hb < fa.wi && !(fa.column + hb >= this.gp); hb++) Z = this.Zd(fa.column + hb), Yd.width += Math.max(Z.pj,
|
|
isNaN(Z.ef) ? Z.qf : Math.min(Z.ef, Z.qf));
|
|
rb.width += Yd.width;
|
|
rb.height += Yd.height;
|
|
Wb = fa.margin;
|
|
eg = Wb.right + Wb.left;
|
|
fg = Wb.top + Wb.bottom;
|
|
rj(fa, rb.width, rb.height, Og, vj);
|
|
for (var Ve = fa.Ia, We = Math.max(Ve.width + eg, 0), Ed = Math.max(Ve.height + fg, 0), Sg = 0, hb = 0; hb < fa.Ti && !(fa.Vb + hb >= this.Yp); hb++) Z = this.$d(fa.Vb + hb), Sg += Z.total || 0;
|
|
if (Sg < Ed) {
|
|
var rc = Ed - Sg,
|
|
Bc = Ed - Sg;
|
|
if (null !== fa.Qx)
|
|
for (var Fd = fa.Qx, hb = 0; hb < fa.Ti && !(0 >= rc) && !(fa.Vb + hb >= this.Yp); hb++) {
|
|
var Z = this.$d(fa.Vb + hb),
|
|
Sb = Z.Xa || 0,
|
|
Zd = Fd(fa, Z, Bc);
|
|
u && "number" !== typeof Zd &&
|
|
z.k(fa + " spanAllocation does not return a number: " + Zd);
|
|
Z.Oa = Math.min(Z.qf, Sb + Zd);
|
|
Z.Xa !== Sb && (rc -= Z.Xa - Sb)
|
|
}
|
|
for (; 0 < rc;) {
|
|
Sb = Z.Xa || 0;
|
|
isNaN(Z.height) && Z.qf > Sb && (Z.Oa = Math.min(Z.qf, Sb + rc), Z.Xa !== Sb && (rc -= Z.Xa - Sb));
|
|
if (0 === Z.index) break;
|
|
Z = this.$d(Z.index - 1)
|
|
}
|
|
}
|
|
for (var Ie = 0, hb = 0; hb < fa.wi && !(fa.column + hb >= this.gp); hb++) Z = this.Zd(fa.column + hb), Ie += Z.total || 0;
|
|
if (Ie < We) {
|
|
rc = We - Ie;
|
|
Bc = We - Ie;
|
|
if (null !== fa.Qx)
|
|
for (Fd = fa.Qx, hb = 0; hb < fa.wi && !(0 >= rc) && !(fa.column + hb >= this.gp); hb++) Z = this.Zd(fa.column + hb), Sb = Z.Xa || 0, Zd = Fd(fa,
|
|
Z, Bc), u && "number" !== typeof Zd && z.k(fa + " spanAllocation does not return a number: " + Zd), Z.Oa = Math.min(Z.qf, Sb + Zd), Z.Xa !== Sb && (rc -= Z.Xa - Sb);
|
|
for (; 0 < rc;) {
|
|
Sb = Z.Xa || 0;
|
|
isNaN(Z.width) && Z.qf > Sb && (Z.Oa = Math.min(Z.qf, Sb + rc), Z.Xa !== Sb && (rc -= Z.Xa - Sb));
|
|
if (0 === Z.index) break;
|
|
Z = this.Zd(Z.index - 1)
|
|
}
|
|
}
|
|
}
|
|
z.xa(jd);
|
|
z.pk(Yd);
|
|
z.pk(rb);
|
|
for (var gg = 0, hg = 0, Xc = Mm(this, !0), xf = this.Aa, wj = this.Xe, $d = Xd = Wd = 0, Yc = 0, La = this.gp, ia = 0; ia < La; ia++) void 0 !== this.Sd[ia] && (Z = this.Zd(ia), isFinite(Z.width) ? ($d += Z.width, $d += Z.Re()) : ao(Z) === bo ? ($d +=
|
|
Z.Xa, $d += Z.Re()) : 0 !== Z.Xa && (Wd += Z.Xa, Wd += Z.Re()));
|
|
var gg = isFinite(xf.width) ? Math.min(xf.width, wj.width) : Xc !== $i && isFinite(Vd) ? Vd : Wd,
|
|
gg = Math.max(gg, this.cg.width),
|
|
gg = Math.max(gg - $d, 0),
|
|
vh = Math.max(gg / Wd, 1);
|
|
isFinite(vh) || (vh = 1);
|
|
for (ia = 0; ia < La; ia++) void 0 !== this.Sd[ia] && (Z = this.Zd(ia), isFinite(Z.width) || ao(Z) === bo || (Z.Oa = Z.Xa * vh), Z.position = e.width, 0 !== Z.Xa && (e.width += Z.Xa, e.width += Z.Re()));
|
|
La = this.Yp;
|
|
for (ia = 0; ia < La; ia++) void 0 !== this.Wd[ia] && (Z = this.$d(ia), isFinite(Z.height) ? (Yc += Z.height, Yc += Z.Re()) :
|
|
ao(Z) === bo ? (Yc += Z.Xa, Yc += Z.Re()) : 0 !== Z.Xa && (Xd += Z.Xa, 0 !== Z.Xa && (Xd += Z.Re())));
|
|
var hg = isFinite(xf.height) ? Math.min(xf.height, wj.height) : Xc !== $i && isFinite(uf) ? uf : Xd,
|
|
hg = Math.max(hg, this.cg.height),
|
|
hg = Math.max(hg - Yc, 0),
|
|
wh = Math.max(hg / Xd, 1);
|
|
isFinite(wh) || (wh = 1);
|
|
for (ia = 0; ia < La; ia++) void 0 !== this.Wd[ia] && (Z = this.$d(ia), isFinite(Z.height) || ao(Z) === bo || (Z.Oa = Z.Xa * wh), Z.position = e.height, 0 !== Z.Xa && (e.height += Z.Xa, 0 !== Z.Xa && (e.height += Z.Re())));
|
|
La = qe.length;
|
|
for (ia = 0; ia < La; ia++) {
|
|
var oc = qe[ia];
|
|
oc.type === Qm ? (He =
|
|
e.width, Z = this.$d(oc.Vb), Mf = Z.Oa) : (Z = this.Zd(oc.column), He = Z.Oa, Mf = e.height);
|
|
oc.ud.n(0, 0, He, Mf);
|
|
Yk(oc, !1);
|
|
bc[oc.Vb] || (bc[oc.Vb] = []);
|
|
bc[oc.Vb][oc.column] || (bc[oc.Vb][oc.column] = []);
|
|
bc[oc.Vb][oc.column].push(oc)
|
|
}
|
|
z.xa(qe);
|
|
this.vs = bc;
|
|
break;
|
|
case "Viewbox":
|
|
var xh = a,
|
|
Zk = b,
|
|
Xq = c,
|
|
Yq = d;
|
|
1 < m.length && z.k("Viewbox Panel cannot contain more than one GraphObject.");
|
|
var Xe = m[0];
|
|
Xe.bc = 1;
|
|
Xe.Ap();
|
|
rj(Xe, Infinity, Infinity, Xq, Yq);
|
|
var xj = Xe.Ia,
|
|
$k = Xe.margin,
|
|
Zq = $k.right + $k.left,
|
|
$q = $k.top + $k.bottom;
|
|
if (isFinite(xh) || isFinite(Zk)) {
|
|
var kt =
|
|
Xe.scale,
|
|
al = xj.width,
|
|
bl = xj.height,
|
|
ar = Math.max(xh - Zq, 0),
|
|
br = Math.max(Zk - $q, 0),
|
|
yj = 1;
|
|
this.Zo === bj ? 0 !== al && 0 !== bl && (yj = Math.min(ar / al, br / bl)) : 0 !== al && 0 !== bl && (yj = Math.max(ar / al, br / bl));
|
|
0 === yj && (yj = 1E-4);
|
|
Xe.bc *= yj;
|
|
kt !== Xe.scale && (Yk(Xe, !0), rj(Xe, Infinity, Infinity, Xq, Yq))
|
|
}
|
|
xj = Xe.Ia;
|
|
e.width = isFinite(xh) ? xh : Math.max(xj.width + Zq, 0);
|
|
e.height = isFinite(Zk) ? Zk : Math.max(xj.height + $q, 0);
|
|
break;
|
|
case "Link":
|
|
var cr = m.length,
|
|
ig = this instanceof da ? this.Wf : this;
|
|
if (ig instanceof G)
|
|
if (0 === cr) {
|
|
var cl = this.Wc;
|
|
yb(cl, 0, 0);
|
|
var re =
|
|
this.Ia;
|
|
re.n(0, 0, 0, 0)
|
|
} else {
|
|
var dl = this instanceof da ? null : ig.path,
|
|
jg = ig.un,
|
|
Ye = this.Yi;
|
|
Ye.assign(jg);
|
|
Ye.x = 0;
|
|
var Tg = Ye.y = 0,
|
|
kg = ig.points,
|
|
Tg = void 0 !== this.sa ? this.sa : kg.count;
|
|
this instanceof da ? this.on(!1) : ig.on(!1);
|
|
var dr = jg.width,
|
|
er = jg.height;
|
|
this.Ki.n(jg.x, jg.y);
|
|
null === this.Zg && (this.Zg = new J(w));
|
|
this.Zg.clear();
|
|
null !== dl && (co(dl, dr, er, this), re = dl.Ia, Ye.qi(re), this.Zg.add(re));
|
|
for (var vi = z.Fh(), zj = z.O(), lg = z.O(), vn = 0; vn < cr; vn++) {
|
|
var Xb = m[vn];
|
|
if (Xb !== dl)
|
|
if (Xb.Ff && Xb instanceof X) co(Xb, dr, er, this), re =
|
|
Xb.Ia, Ye.qi(re), this.Zg.add(re);
|
|
else if (2 > Tg) rj(Xb, Infinity, Infinity), re = Xb.Ia, Ye.qi(re), this.Zg.add(re);
|
|
else {
|
|
var od = Xb.De,
|
|
gr = Xb.NA,
|
|
wn = Xb.jk;
|
|
wn.Be() && (wn = ec);
|
|
var Aj = Xb.pu,
|
|
lt = Xb.EF,
|
|
Bj = 0,
|
|
Cj = 0,
|
|
el = 0;
|
|
if (od < -Tg || od >= Tg) {
|
|
var hr = ig.bF,
|
|
wi = ig.aF;
|
|
Aj !== Ni && (el = ig.computeAngle(Xb, Aj, wi), Xb.bm = el);
|
|
Bj = hr.x - jg.x;
|
|
Cj = hr.y - jg.y
|
|
} else {
|
|
var Gd, Ze;
|
|
if (0 <= od) Gd = kg.ea(od), Ze = od < Tg - 1 ? kg.ea(od + 1) : Gd;
|
|
else {
|
|
var yh = Tg + od;
|
|
Gd = kg.ea(yh);
|
|
Ze = 0 < yh ? kg.ea(yh - 1) : Gd
|
|
}
|
|
if (Gd.Mc(Ze)) {
|
|
var zh, Ah;
|
|
0 <= od ? (zh = 0 < od ? kg.ea(od - 1) : Gd, Ah = od < Tg - 2 ? kg.ea(od +
|
|
2) : Ze) : (zh = yh < Tg - 1 ? kg.ea(yh + 1) : Gd, Ah = 1 < yh ? kg.ea(yh - 2) : Ze);
|
|
var ir = zh.Af(Gd),
|
|
jr = Ze.Af(Ah),
|
|
wi = ir > jr + 10 ? 0 <= od ? zh.Ec(Gd) : Gd.Ec(zh) : jr > ir + 10 ? 0 <= od ? Ze.Ec(Ah) : Ah.Ec(Ze) : 0 <= od ? zh.Ec(Ah) : Ah.Ec(zh)
|
|
} else wi = 0 <= od ? Gd.Ec(Ze) : Ze.Ec(Gd);
|
|
Aj !== Ni && (el = ig.computeAngle(Xb, Aj, wi), Xb.bm = el);
|
|
Bj = Gd.x + (Ze.x - Gd.x) * gr - jg.x;
|
|
Cj = Gd.y + (Ze.y - Gd.y) * gr - jg.y
|
|
}
|
|
rj(Xb, Infinity, Infinity);
|
|
var re = Xb.Ia,
|
|
cl = Xb.Ga,
|
|
Dj = 0;
|
|
Xb instanceof X && (Dj = Xb.ub);
|
|
var fl = cl.width + Dj,
|
|
xn = cl.height + Dj;
|
|
vi.reset();
|
|
vi.translate(-re.x, -re.y);
|
|
vi.scale(Xb.scale, Xb.scale);
|
|
vi.rotate(Aj === Ni ? Xb.angle : wi, fl / 2, xn / 2);
|
|
var xi = new w(0, 0, fl, xn);
|
|
zj.ru(xi, wn);
|
|
vi.Cb(zj);
|
|
var mt = -zj.x + Dj / 2,
|
|
nt = -zj.y + Dj / 2;
|
|
lg.assign(lt);
|
|
isNaN(lg.x) && (lg.x = 0 <= od ? fl / 2 + 3 : -(fl / 2 + 3));
|
|
isNaN(lg.y) && (lg.y = -(xn / 2 + 3));
|
|
lg.rotate(wi);
|
|
Bj += lg.x;
|
|
Cj += lg.y;
|
|
xi.set(re);
|
|
xi.x = Bj + mt;
|
|
xi.y = Cj + nt;
|
|
this.Zg.add(xi);
|
|
Ye.qi(xi)
|
|
}
|
|
}
|
|
if (this.Ke)
|
|
for (var kr = this.Hf; kr.next();) rj(kr.value, Infinity, Infinity);
|
|
this.Yi = Ye;
|
|
var yn = this.Ki;
|
|
yn.n(yn.x + Ye.x, yn.y + Ye.y);
|
|
yb(e, Ye.width || 0, Ye.height || 0);
|
|
z.jf(vi);
|
|
z.A(zj);
|
|
z.A(lg)
|
|
}
|
|
break;
|
|
case "Grid":
|
|
break;
|
|
case "TableRow":
|
|
case "TableColumn":
|
|
z.k(this.toString() + " is not an element of a Table Panel. TableRow and TableColumn Panels can only be elements of a Table Panel.");
|
|
break;
|
|
default:
|
|
z.k("Unknown panel type: " + n)
|
|
}
|
|
}
|
|
var $e = e.width,
|
|
af = e.height,
|
|
gl = this.padding,
|
|
ot = gl.top + gl.bottom,
|
|
$e = $e + (gl.left + gl.right),
|
|
af = af + ot;
|
|
isFinite(g.width) && ($e = g.width);
|
|
isFinite(g.height) && (af = g.height);
|
|
$e = Math.min(k.width, $e);
|
|
af = Math.min(k.height, af);
|
|
$e = Math.max(h.width, $e);
|
|
af = Math.max(h.height, af);
|
|
$e = Math.max(c, $e);
|
|
af = Math.max(d,
|
|
af);
|
|
e.width = $e;
|
|
e.height = af;
|
|
yb(this.Wc, $e, af);
|
|
Jm(this, 0, 0, $e, af)
|
|
};
|
|
I.prototype.findMainElement = I.prototype.gf = function() {
|
|
if (null === this.Lm) {
|
|
var a = this.va.o,
|
|
b = a.length;
|
|
if (0 === b) return null;
|
|
for (var c = 0; c < b; c++) {
|
|
var d = a[c];
|
|
if (!0 === d.Ff) return this.Lm = d
|
|
}
|
|
this.Lm = a[0]
|
|
}
|
|
return this.Lm
|
|
};
|
|
I.prototype.$i = function(a, b, c, d) {
|
|
var e = this.Yi,
|
|
g = this.va.o,
|
|
h = z.yk(0, 0, 0, 0);
|
|
if (0 === g.length) {
|
|
var k = this.W;
|
|
k.x = a;
|
|
k.y = b;
|
|
k.width = c;
|
|
k.height = d
|
|
} else {
|
|
if (!this.Aa.F()) {
|
|
var l = Mm(this, !0),
|
|
m = this.ud,
|
|
n = m.width,
|
|
p = m.height,
|
|
q = this.margin,
|
|
r = q.left + q.right,
|
|
s = q.top + q.bottom;
|
|
n === c && p === d && (l = $i);
|
|
switch (l) {
|
|
case $i:
|
|
if (n > c || p > d) this.S(), rj(this, n > c ? c : n, p > d ? d : p);
|
|
break;
|
|
case lf:
|
|
this.S(!0);
|
|
rj(this, c + r, d + s, 0, 0);
|
|
break;
|
|
case Cm:
|
|
this.S(!0);
|
|
rj(this, c + r, p + s, 0, 0);
|
|
break;
|
|
case Bm:
|
|
this.S(!0), rj(this, n + r, d + s, 0, 0)
|
|
}
|
|
}
|
|
k = this.W;
|
|
k.x = a;
|
|
k.y = b;
|
|
k.width = c;
|
|
k.height = d;
|
|
var t = this.ba.Ub;
|
|
switch (t) {
|
|
case "Position":
|
|
for (var v = g.length, x = e.x - this.padding.left, y = e.y - this.padding.top, A = 0; A < v; A++) {
|
|
var B = g[A],
|
|
L = B.Ia,
|
|
H = B.margin,
|
|
U = B.position.x,
|
|
ea = B.position.y;
|
|
h.x = isNaN(U) ? -x : U - x;
|
|
h.y = isNaN(ea) ? -y : ea - y;
|
|
if (B instanceof X) {
|
|
var W = B;
|
|
if (W.ME) {
|
|
var P = W.ub / 2;
|
|
h.x -= P;
|
|
h.y -= P
|
|
}
|
|
}
|
|
h.x += H.left;
|
|
h.y += H.top;
|
|
h.width = L.width;
|
|
h.height = L.height;
|
|
B.visible && B.Lc(h.x, h.y, h.width, h.height)
|
|
}
|
|
break;
|
|
case "Vertical":
|
|
for (var ba = g.length, Oa = this.padding.left, sa = this.padding.top, Na = 0; Na < ba; Na++) {
|
|
var ua =
|
|
Oa,
|
|
Ha = g[Na];
|
|
if (Ha.visible) {
|
|
var Aa = Ha.Ia,
|
|
jc = Ha.margin,
|
|
zd = jc.left + jc.right,
|
|
Ad = Oa + this.padding.right,
|
|
Qe = Aa.width,
|
|
ac = Mm(Ha, !1);
|
|
if (isNaN(Ha.Aa.width) && ac === lf || ac === Cm) Qe = Math.max(e.width - zd - Ad, 0);
|
|
var Ig = Qe + zd + Ad,
|
|
Bd = Ha.alignment;
|
|
Bd.bd() && (Bd = this.Bl);
|
|
Bd.cd() || (Bd = ec);
|
|
Ha.Lc(ua + Bd.offsetX + jc.left + (e.width * Bd.x - Ig * Bd.x), sa + Bd.offsetY + jc.top, Qe, Aa.height);
|
|
sa += Aa.height + jc.bottom + jc.top
|
|
}
|
|
}
|
|
break;
|
|
case "Horizontal":
|
|
for (var sb = g.length, gb = this.padding.top, oa = this.padding.left, pa = 0; pa < sb; pa++) {
|
|
var tb = gb,
|
|
Xa = g[pa];
|
|
if (Xa.visible) {
|
|
var Va = Xa.Ia,
|
|
Ae = Xa.margin,
|
|
Cd = Ae.top + Ae.bottom,
|
|
me = gb + this.padding.bottom,
|
|
Rd = Va.height,
|
|
ne = Mm(Xa, !1);
|
|
if (isNaN(Xa.Aa.height) && ne === lf || ne === Bm) Rd = Math.max(e.height - Cd - me, 0);
|
|
var Jg = Rd + Cd + me,
|
|
fd = Xa.alignment;
|
|
fd.bd() && (fd = this.Bl);
|
|
fd.cd() || (fd = ec);
|
|
Xa.Lc(oa + fd.offsetX + Ae.left, tb + fd.offsetY + Ae.top + (e.height * fd.y - Jg * fd.y), Va.width, Rd);
|
|
oa += Va.width + Ae.left + Ae.right
|
|
}
|
|
}
|
|
break;
|
|
case "Spot":
|
|
var pi = g.length,
|
|
Ab = this.gf(),
|
|
Qb = Ab.Ia,
|
|
gd = Qb.width,
|
|
lh = Qb.height,
|
|
Lb = this.padding,
|
|
kb = Lb.left,
|
|
cb = Lb.top;
|
|
h.x = kb - e.x;
|
|
h.y = cb - e.y;
|
|
Ab.Lc(h.x, h.y, gd, lh);
|
|
for (var Re = 0; Re < pi; Re++) {
|
|
var Sd = g[Re];
|
|
if (Sd !== Ab) {
|
|
var Kg = Sd.Ia,
|
|
Lg = Kg.width,
|
|
kc = Kg.height,
|
|
lc = Sd.alignment;
|
|
lc.bd() && (lc = this.Bl);
|
|
lc.cd() || (lc = ec);
|
|
var oe = Sd.jk;
|
|
oe.bd() && (oe = ec);
|
|
h.x = lc.x * gd + lc.offsetX - (oe.x * Lg - oe.offsetX);
|
|
h.y = lc.y * lh + lc.offsetY - (oe.y * kc - oe.offsetY);
|
|
h.x -= e.x;
|
|
h.y -= e.y;
|
|
Sd.visible && Sd.Lc(kb + h.x, cb + h.y, Lg, kc)
|
|
}
|
|
}
|
|
break;
|
|
case "Auto":
|
|
var hd = g.length,
|
|
nb = this.gf(),
|
|
Uc = nb.Ia,
|
|
Qa = z.kg();
|
|
Qa.n(0, 0, 1, 1);
|
|
var ob = nb.margin,
|
|
yc = ob.left,
|
|
Dd = ob.top,
|
|
Mb = this.padding,
|
|
pe = Mb.left,
|
|
tf = Mb.top;
|
|
h.x = yc;
|
|
h.y = Dd;
|
|
h.width = Uc.width;
|
|
h.height = Uc.height;
|
|
nb.Lc(pe + h.x, tf + h.y, h.width, h.height);
|
|
var Se = Zn(nb),
|
|
Lf = $n(nb),
|
|
Fb = 0 + Se.y * Uc.height + Se.offsetY,
|
|
Be = 0 + Lf.x * Uc.width + Lf.offsetX,
|
|
Rb = 0 + Lf.y * Uc.height + Lf.offsetY;
|
|
Qa.x = 0 + Se.x * Uc.width + Se.offsetX;
|
|
Qa.y = Fb;
|
|
Ib(Qa, Be, Rb, 0, 0);
|
|
Qa.x += yc + pe;
|
|
Qa.y += Dd + tf;
|
|
for (var Vb = 0; Vb < hd; Vb++) {
|
|
var Nb = g[Vb];
|
|
if (Nb !== nb) {
|
|
var Jc = Nb.Ia,
|
|
ob = Nb.margin,
|
|
lb = Math.max(Jc.width + ob.right + ob.left, 0),
|
|
Gb = Math.max(Jc.height + ob.top + ob.bottom, 0),
|
|
Ob = Nb.alignment;
|
|
Ob.bd() && (Ob = this.Bl);
|
|
Ob.cd() || (Ob = ec);
|
|
h.x =
|
|
Qa.width * Ob.x + Ob.offsetX - lb * Ob.x + ob.left + Qa.x;
|
|
h.y = Qa.height * Ob.y + Ob.offsetY - Gb * Ob.y + ob.top + Qa.y;
|
|
h.width = Qa.width;
|
|
h.height = Qa.height;
|
|
Nb.visible && (Jb(Qa.x, Qa.y, Qa.width, Qa.height, h.x, h.y, Jc.width, Jc.height) ? Nb.Lc(h.x, h.y, Jc.width, Jc.height) : Nb.Lc(h.x, h.y, Jc.width, Jc.height, new w(Qa.x, Qa.y, Qa.width, Qa.height)))
|
|
}
|
|
}
|
|
z.dc(Qa);
|
|
break;
|
|
case "Table":
|
|
for (var Td = g.length, Mg = this.padding, mh = Mg.left, nh = Mg.top, Ce = this.vs, Kc = 0, De = 0, mc = Ce.length, Bb = 0, Cb = 0; Cb < mc; Cb++) Ce[Cb] && (Bb = Math.max(Bb, Ce[Cb].length));
|
|
for (var Lc =
|
|
Math.min(this.Xi, mc - 1); Lc !== mc && (void 0 === this.Wd[Lc] || 0 === this.Wd[Lc].Xa);) Lc++;
|
|
for (var Lc = Math.min(Lc, mc - 1), Ng = -this.Wd[Lc].sb, Vc = Math.min(this.Ji, Bb - 1); Vc !== Bb && (void 0 === this.Sd[Vc] || 0 === this.Sd[Vc].Xa);) Vc++;
|
|
for (var Vc = Math.min(Vc, Bb - 1), Wc = -this.Sd[Vc].sb, mb = z.Xl(), Cb = 0; Cb < mc; Cb++)
|
|
if (Ce[Cb]) {
|
|
var Bb = Ce[Cb].length,
|
|
Mc = this.$d(Cb),
|
|
De = Mc.sb + Ng + nh;
|
|
0 !== Mc.Xa && (De += Mc.UD());
|
|
for (var Ud = 0; Ud < Bb; Ud++)
|
|
if (Ce[Cb][Ud]) {
|
|
var Vd = this.Zd(Ud),
|
|
Kc = Vd.sb + Wc + mh;
|
|
0 !== Vd.Xa && (Kc += Vd.UD());
|
|
for (var uf = Ce[Cb][Ud], Og = uf.length,
|
|
vj = 0; vj < Og; vj++) {
|
|
var La = uf[vj],
|
|
Te = La.Ia,
|
|
qe = La instanceof I ? La : null;
|
|
if (null === qe || qe.type !== Qm && qe.type !== Rm) {
|
|
mb.n(0, 0);
|
|
for (var ia = 1; ia < La.rowSpan && !(Cb + ia >= this.Yp); ia++) {
|
|
var fa = this.$d(Cb + ia);
|
|
mb.height += fa.total
|
|
}
|
|
for (ia = 1; ia < La.eH && !(Ud + ia >= this.gp); ia++) {
|
|
var id = this.Zd(Ud + ia);
|
|
mb.width += id.total
|
|
}
|
|
var oh = Vd.Xa + mb.width,
|
|
qi = Mc.Xa + mb.height;
|
|
h.x = Kc;
|
|
h.y = De;
|
|
h.width = oh;
|
|
h.height = qi;
|
|
var zc = Kc,
|
|
ri = De,
|
|
bc = oh,
|
|
ph = qi;
|
|
Kc + oh > e.width && (bc = Math.max(e.width - Kc, 0));
|
|
De + qi > e.height && (ph = Math.max(e.height - De, 0));
|
|
var jd = La.alignment,
|
|
Ee = 0,
|
|
Nc = 0,
|
|
kd = 0,
|
|
Ac = 0;
|
|
if (jd.bd()) {
|
|
jd = this.Bl;
|
|
jd.cd() || (jd = ec);
|
|
var Ee = jd.x,
|
|
Nc = jd.y,
|
|
kd = jd.offsetX,
|
|
Ac = jd.offsetY,
|
|
ld = Vd.alignment,
|
|
cg = Mc.alignment;
|
|
ld.cd() && (Ee = ld.x, kd = ld.offsetX);
|
|
cg.cd() && (Nc = cg.y, Ac = cg.offsetY)
|
|
} else Ee = jd.x, Nc = jd.y, kd = jd.offsetX, Ac = jd.offsetY;
|
|
if (isNaN(Ee) || isNaN(Nc)) Nc = Ee = .5, Ac = kd = 0;
|
|
var Z = Te.width,
|
|
Fe = Te.height,
|
|
Ue = La.margin,
|
|
si = Ue.left + Ue.right,
|
|
ti = Ue.top + Ue.bottom,
|
|
Oc = Zm(La, Mc, Vd, !1);
|
|
!isNaN(La.Aa.width) || Oc !== lf && Oc !== Cm || (Z = Math.max(oh - si, 0));
|
|
!isNaN(La.Aa.height) || Oc !== lf && Oc !== Bm || (Fe =
|
|
Math.max(qi - ti, 0));
|
|
var pb = La.Xe,
|
|
qb = La.cg,
|
|
Z = Math.min(pb.width, Z),
|
|
Fe = Math.min(pb.height, Fe),
|
|
Z = Math.max(qb.width, Z),
|
|
Fe = Math.max(qb.height, Fe),
|
|
Xk = Fe + ti;
|
|
h.x += h.width * Ee - (Z + si) * Ee + kd + Ue.left;
|
|
h.y += h.height * Nc - Xk * Nc + Ac + Ue.top;
|
|
La.visible && (Jb(zc, ri, bc, ph, h.x, h.y, Te.width, Te.height) ? La.Lc(h.x, h.y, Z, Fe) : La.Lc(h.x, h.y, Z, Fe, new w(zc, ri, bc, ph)))
|
|
} else {
|
|
La.Fi();
|
|
La.Xb.Wa();
|
|
var dg = La.Xb;
|
|
dg.x = qe.type === Qm ? mh : Kc;
|
|
dg.y = qe.type === Rm ? nh : De;
|
|
dg.width = Te.width;
|
|
dg.height = Te.height;
|
|
La.Xb.freeze();
|
|
Om(La, !1)
|
|
}
|
|
}
|
|
}
|
|
}
|
|
z.pk(mb);
|
|
for (Cb =
|
|
0; Cb < Td; Cb++) La = g[Cb], qe = La instanceof I ? La : null, null === qe || qe.type !== Qm && qe.type !== Rm || (dg = La.Xb, La.Wc.Wa(), La.Wc.n(0, 0, dg.width, dg.height), La.Wc.freeze());
|
|
break;
|
|
case "Viewbox":
|
|
var Pg = g[0],
|
|
Qg = Pg.Ia,
|
|
Wb = Pg.margin,
|
|
eg = Wb.top + Wb.bottom,
|
|
fg = Math.max(Qg.width + (Wb.right + Wb.left), 0),
|
|
Xc = Math.max(Qg.height + eg, 0),
|
|
Ge = Pg.alignment;
|
|
Ge.bd() && (Ge = this.Bl);
|
|
Ge.cd() || (Ge = ec);
|
|
h.x = e.width * Ge.x - fg * Ge.x + Ge.offsetX;
|
|
h.y = e.height * Ge.y - Xc * Ge.y + Ge.offsetY;
|
|
h.width = Qg.width;
|
|
h.height = Qg.height;
|
|
Pg.Lc(h.x, h.y, h.width, h.height);
|
|
break;
|
|
case "Link":
|
|
var un = g.length,
|
|
ui = this instanceof da ? this.Wf : this;
|
|
if (ui instanceof G) {
|
|
var Ve = this instanceof da ? null : ui.path;
|
|
if (null !== this.Zg) {
|
|
var We = this.Zg.o,
|
|
Ed = 0;
|
|
if (null !== Ve && Ed < this.Zg.count) {
|
|
var md = We[Ed];
|
|
Ed++;
|
|
Ve.Lc(md.x - this.Yi.x, md.y - this.Yi.y, md.width, md.height)
|
|
}
|
|
for (var qh = 0; qh < un; qh++) {
|
|
var Wd = g[qh];
|
|
Wd !== Ve && Ed < this.Zg.count && (md = We[Ed], Ed++, Wd.Lc(md.x - this.Yi.x, md.y - this.Yi.y, md.width, md.height))
|
|
}
|
|
}
|
|
var Xd = ui.points,
|
|
rh = Xd.count;
|
|
if (2 <= rh && this.Ke)
|
|
for (var sh = this.Hf; sh.next();) {
|
|
var nd = sh.value,
|
|
Rg = rh,
|
|
vf = Xd,
|
|
nc = nd.De,
|
|
th = nd.NA,
|
|
rb = nd.jk,
|
|
He = nd.pu,
|
|
Mf = nd.EF,
|
|
wf = 0,
|
|
Yd = 0,
|
|
hb = 0;
|
|
if (nc < -Rg || nc >= Rg) {
|
|
var Sg = this.bF,
|
|
rc = this.aF;
|
|
He !== Ni && (hb = this.computeAngle(nd, He, rc), nd.angle = hb);
|
|
wf = Sg.x;
|
|
Yd = Sg.y
|
|
} else {
|
|
var Bc = void 0,
|
|
Fd = void 0;
|
|
if (0 <= nc) Bc = vf.o[nc], Fd = nc < Rg - 1 ? vf.o[nc + 1] : Bc;
|
|
else var Sb = Rg + nc,
|
|
Bc = vf.o[Sb],
|
|
Fd = 0 < Sb ? vf.o[Sb - 1] : Bc;
|
|
if (Bc.Mc(Fd)) {
|
|
var Zd = void 0,
|
|
Ie = void 0;
|
|
0 <= nc ? (Zd = 0 < nc ? vf.o[nc - 1] : Bc, Ie = nc < Rg - 2 ? vf.o[nc + 2] : Fd) : (Zd = Sb < Rg - 1 ? vf.o[Sb + 1] : Bc, Ie = 1 < Sb ? vf.o[Sb - 2] : Fd);
|
|
var gg = Zd.Af(Bc),
|
|
hg = Fd.Af(Ie),
|
|
rc = gg > hg + 10 ? 0 <=
|
|
nc ? Zd.Ec(Bc) : Bc.Ec(Zd) : hg > gg + 10 ? 0 <= nc ? Fd.Ec(Ie) : Ie.Ec(Fd) : 0 <= nc ? Zd.Ec(Ie) : Ie.Ec(Zd)
|
|
} else rc = 0 <= nc ? Bc.Ec(Fd) : Fd.Ec(Bc);
|
|
He !== Ni && (hb = this.computeAngle(nd, He, rc), nd.angle = hb);
|
|
wf = Bc.x + (Fd.x - Bc.x) * th;
|
|
Yd = Bc.y + (Fd.y - Bc.y) * th
|
|
}
|
|
if (rb.N(Yb)) nd.location = new N(wf, Yd);
|
|
else {
|
|
rb.Be() && (rb = ec);
|
|
var xf = z.Fh();
|
|
xf.reset();
|
|
xf.scale(nd.scale, nd.scale);
|
|
xf.rotate(nd.angle, 0, 0);
|
|
var wj = nd.Ga,
|
|
$d = z.yk(0, 0, wj.width, wj.height),
|
|
Yc = z.O();
|
|
Yc.ru($d, rb);
|
|
xf.Cb(Yc);
|
|
var vh = -Yc.x,
|
|
wh = -Yc.y,
|
|
oc = Mf.copy();
|
|
isNaN(oc.x) && (oc.x = 0 <= nc ? Yc.x + 3 : -(Yc.x +
|
|
3));
|
|
isNaN(oc.y) && (oc.y = -(Yc.y + 3));
|
|
oc.rotate(rc);
|
|
wf += oc.x;
|
|
Yd += oc.y;
|
|
xf.bG($d);
|
|
var vh = vh + $d.x,
|
|
wh = wh + $d.y,
|
|
xh = z.Tb(wf + vh, Yd + wh);
|
|
nd.move(xh);
|
|
z.A(xh);
|
|
z.A(Yc);
|
|
z.dc($d);
|
|
z.jf(xf)
|
|
}
|
|
}
|
|
this instanceof da ? this.on(!1) : ui.on(!1)
|
|
}
|
|
break;
|
|
case "Grid":
|
|
break;
|
|
case "TableRow":
|
|
case "TableColumn":
|
|
z.k(this.toString() + " is not an element of a Table Panel.TableRow and TableColumn panels can only be elements of a Table Panel.");
|
|
break;
|
|
default:
|
|
z.k("Unknown panel type: " + t)
|
|
}
|
|
z.dc(h)
|
|
}
|
|
};
|
|
I.prototype.lk = function(a) {
|
|
var b = this.Ga;
|
|
if (Jb(0, 0, b.width, b.height, a.x, a.y)) {
|
|
for (var b = this.va.o, c = b.length, d = z.Tb(0, 0); c--;) {
|
|
var e = b[c];
|
|
if (e.visible || e === this.Zb)
|
|
if (ub(d.set(a), e.transform), e.Ma(d)) return z.A(d), !0
|
|
}
|
|
z.A(d);
|
|
return null === this.Nb && null === this.uc ? !1 : !0
|
|
}
|
|
return !1
|
|
};
|
|
I.prototype.Xw = function(a) {
|
|
if (this.Jn === a) return this;
|
|
for (var b = this.va.o, c = b.length, d = 0; d < c; d++) {
|
|
var e = b[d].Xw(a);
|
|
if (null !== e) return e
|
|
}
|
|
return null
|
|
};
|
|
|
|
function eo(a, b, c) {
|
|
c(a, b);
|
|
if (b instanceof I) {
|
|
b = b.va.o;
|
|
for (var d = b.length, e = 0; e < d; e++) eo(a, b[e], c)
|
|
}
|
|
}
|
|
|
|
function wl(a, b) {
|
|
fo(a, a, b)
|
|
}
|
|
|
|
function fo(a, b, c) {
|
|
c(b);
|
|
b = b.va.o;
|
|
for (var d = b.length, e = 0; e < d; e++) {
|
|
var g = b[e];
|
|
g instanceof I && fo(a, g, c)
|
|
}
|
|
}
|
|
I.prototype.walkVisualTree = I.prototype.DJ = function(a) {
|
|
ho(this, this, a)
|
|
};
|
|
|
|
function ho(a, b, c) {
|
|
c(b);
|
|
if (b instanceof I) {
|
|
b = b.va.o;
|
|
for (var d = b.length, e = 0; e < d; e++) ho(a, b[e], c)
|
|
}
|
|
}
|
|
I.prototype.findInVisualTree = I.prototype.yt = function(a) {
|
|
return io(this, this, a)
|
|
};
|
|
|
|
function io(a, b, c) {
|
|
if (c(b)) return b;
|
|
if (b instanceof I) {
|
|
b = b.va.o;
|
|
for (var d = b.length, e = 0; e < d; e++) {
|
|
var g = io(a, b[e], c);
|
|
if (null !== g) return g
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
I.prototype.findObject = I.prototype.oe = function(a) {
|
|
if (this.name === a) return this;
|
|
for (var b = this.va.o, c = b.length, d = 0; d < c; d++) {
|
|
var e = b[d];
|
|
if (e.name === a) return e;
|
|
if (e instanceof I)
|
|
if (null === e.Ii && null === e.sg) {
|
|
if (e = e.oe(a), null !== e) return e
|
|
} else if (Rl(e) && (e = e.va.first(), null !== e && (e = e.oe(a), null !== e))) return e
|
|
}
|
|
return null
|
|
};
|
|
|
|
function jo(a) {
|
|
a = a.va.o;
|
|
for (var b = a.length, c = 0, d = 0; d < b; d++) {
|
|
var e = a[d];
|
|
if (e instanceof I) c = Math.max(c, jo(e));
|
|
else if (e instanceof X) {
|
|
a: {
|
|
if (!e.Yh) switch (e.fo) {
|
|
case "None":
|
|
case "Square":
|
|
case "Ellipse":
|
|
case "Circle":
|
|
case "LineH":
|
|
case "LineV":
|
|
case "FramedRectangle":
|
|
case "RoundedRectangle":
|
|
case "Line1":
|
|
case "Line2":
|
|
case "Border":
|
|
case "Cube1":
|
|
case "Cube2":
|
|
case "Junction":
|
|
case "Cylinder1":
|
|
case "Cylinder2":
|
|
case "Cylinder3":
|
|
case "Cylinder4":
|
|
case "PlusLine":
|
|
case "XLine":
|
|
case "ThinCross":
|
|
case "ThickCross":
|
|
e =
|
|
0;
|
|
break a
|
|
}
|
|
e = e.Oe / 2 * e.Km * e.gj()
|
|
}
|
|
c = Math.max(c, e)
|
|
}
|
|
}
|
|
return c
|
|
}
|
|
f = I.prototype;
|
|
f.Vg = function() {
|
|
return !(this.type === Qm || this.type === Rm)
|
|
};
|
|
f.pe = function(a, b, c) {
|
|
if (!1 === this.ig) return null;
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
if (nl(this)) return null;
|
|
var d = this.Ga,
|
|
e = 1 / this.gj(),
|
|
g = this.Vg(),
|
|
h = g ? a : ub(z.Tb(a.x, a.y), this.transform),
|
|
k = this.h,
|
|
l = 10,
|
|
m = 5;
|
|
null !== k && (l = k.sp("extraTouchArea"), m = l / 2);
|
|
if (Jb(-(m * e), -(m * e), d.width + l * e, d.height + l * e, h.x, h.y)) {
|
|
if (!this.dh) {
|
|
var e = this.va.o,
|
|
n = e.length,
|
|
k = z.O(),
|
|
m = (l = this.KE) ? this.gf() : null;
|
|
if (l && (m.Vg() ? ub(k.set(a), m.transform) : k.set(a), !m.Ma(k))) return z.A(k), g || z.A(h), null;
|
|
for (; n--;) {
|
|
var p = e[n];
|
|
if (p.visible ||
|
|
p === this.Zb)
|
|
if (p.Vg() ? ub(k.set(a), p.transform) : k.set(a), !l || p !== m) {
|
|
var q = null;
|
|
p instanceof I ? q = p.pe(k, b, c) : !0 === p.ig && p.Ma(k) && (q = p);
|
|
if (null !== q && (null !== b && (q = b(q)), null !== q && (null === c || c(q)))) return z.A(k), g || z.A(h), q
|
|
}
|
|
}
|
|
z.A(k)
|
|
}
|
|
if (null === this.background && null === this.vl) return g || z.A(h), null;
|
|
a = Jb(0, 0, d.width, d.height, h.x, h.y) ? this : null;
|
|
g || z.A(h);
|
|
return a
|
|
}
|
|
g || z.A(h);
|
|
return null
|
|
};
|
|
f.mp = function(a, b, c, d) {
|
|
if (!1 === this.ig) return !1;
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
d instanceof J || d instanceof K || (d = new J(O));
|
|
var e = this.Ga,
|
|
g = this.Vg(),
|
|
h = g ? a : ub(z.Tb(a.x, a.y), this.transform);
|
|
if (Jb(0, 0, e.width, e.height, h.x, h.y)) {
|
|
if (!this.dh) {
|
|
for (var e = this.va.o, k = e.length, l = z.O(); k--;) {
|
|
var m = e[k];
|
|
if (m.visible || m === this.Zb) {
|
|
m.Vg() ? ub(l.set(a), m.transform) : l.set(a);
|
|
var n = m,
|
|
m = m instanceof I ? m : null;
|
|
(null !== m ? m.mp(l, b, c, d) : n.Ma(l)) && !1 !== n.ig && (null !== b && (n = b(n)), null === n || null !== c && !c(n) || d.add(n))
|
|
}
|
|
}
|
|
z.A(l)
|
|
}
|
|
g ||
|
|
z.A(h);
|
|
return null !== this.background || null !== this.vl
|
|
}
|
|
g || z.A(h);
|
|
return !1
|
|
};
|
|
f.ok = function(a, b, c, d, e, g) {
|
|
if (!1 === this.ig) return !1;
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
var h = g;
|
|
void 0 === g && (h = z.Fh(), h.reset());
|
|
h.multiply(this.transform);
|
|
if (this.Ym(a, h)) return ko(this, b, c, e), void 0 === g && z.jf(h), !0;
|
|
if (this.Ig(a, h)) {
|
|
if (!this.dh)
|
|
for (var k = this.va.o, l = k.length; l--;) {
|
|
var m = k[l];
|
|
if (m.visible || m === this.Zb) {
|
|
var n = m.W,
|
|
p = this.Ga;
|
|
if (!(n.x > p.width || n.y > p.height || 0 > n.x + n.width || 0 > n.y + n.height)) {
|
|
n = m;
|
|
m = m instanceof I ? m : null;
|
|
p = z.Fh();
|
|
p.set(h);
|
|
if (null !== m ? m.ok(a, b, c, d, e, p) : Lm(n, a, d, p)) null !==
|
|
b && (n = b(n)), null === n || null !== c && !c(n) || e.add(n);
|
|
z.jf(p)
|
|
}
|
|
}
|
|
}
|
|
void 0 === g && z.jf(h);
|
|
return d
|
|
}
|
|
void 0 === g && z.jf(h);
|
|
return !1
|
|
};
|
|
|
|
function ko(a, b, c, d) {
|
|
for (var e = a.va.o, g = e.length; g--;) {
|
|
var h = e[g];
|
|
if (h.visible) {
|
|
var k = h.W,
|
|
l = a.Ga;
|
|
k.x > l.width || k.y > l.height || 0 > k.x + k.width || 0 > k.y + k.height || (h instanceof I && ko(h, b, c, d), null !== b && (h = b(h)), null === h || null !== c && !c(h) || d.add(h))
|
|
}
|
|
}
|
|
}
|
|
f.dn = function(a, b, c, d, e, g) {
|
|
if (!1 === this.ig) return !1;
|
|
void 0 === c && (c = null);
|
|
void 0 === d && (d = null);
|
|
var h = this.Ga,
|
|
k = this.Vg(),
|
|
l = k ? a : ub(z.Tb(a.x, a.y), this.transform),
|
|
m = k ? b : ub(z.Tb(b.x, b.y), this.transform),
|
|
n = l.Af(m),
|
|
p = 0 < l.x && l.x < h.width && 0 < l.y && l.y < h.height || vb(l.x, l.y, 0, 0, 0, h.height) < n || vb(l.x, l.y, 0, h.height, h.width, h.height) < n || vb(l.x, l.y, h.width, h.height, h.width, 0) < n || vb(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 && vb(l.x, l.y, 0, 0, 0, h.height) < n && vb(l.x, l.y, 0, h.height, h.width, h.height) <
|
|
n && vb(l.x, l.y, h.width, h.height, h.width, 0) < n && vb(l.x, l.y, h.width, 0, 0, 0) < n;
|
|
k || (z.A(l), z.A(m));
|
|
if (p) {
|
|
if (!this.dh) {
|
|
k = z.O();
|
|
l = z.O();
|
|
m = this.va.o;
|
|
for (n = m.length; n--;) {
|
|
var q = m[n];
|
|
if (q.visible || q === this.Zb) {
|
|
var r = q.W,
|
|
s = this.Ga;
|
|
r.x > s.width || r.y > s.height || 0 > r.x + r.width || 0 > r.y + r.height || (q.Vg() ? (r = q.transform, ub(k.set(a), r), ub(l.set(b), r)) : (k.set(a), l.set(b)), r = q, q = q instanceof I ? q : null, null !== q ? !q.dn(k, l, c, d, e, g) : !r.sE(k, l, e)) || (null !== c && (r = c(r)), null === r || null !== d && !d(r) || g.add(r))
|
|
}
|
|
}
|
|
z.A(k);
|
|
z.A(l)
|
|
}
|
|
return e ?
|
|
p : h
|
|
}
|
|
return !1
|
|
};
|
|
|
|
function Zn(a) {
|
|
var b = a.C;
|
|
if (void 0 === b || b === Pc) b = null;
|
|
null === b && a instanceof X && (a = a.ab, null !== a && (b = a.C));
|
|
null === b && (b = Zb);
|
|
return b
|
|
}
|
|
|
|
function $n(a) {
|
|
var b = a.D;
|
|
if (void 0 === b || b === Pc) b = null;
|
|
null === b && a instanceof X && (a = a.ab, null !== a && (b = a.D));
|
|
null === b && (b = ic);
|
|
return b
|
|
}
|
|
I.prototype.add = I.prototype.add = function(a) {
|
|
z.l(a, O, I, "add:element");
|
|
this.Ld(this.va.count, a)
|
|
};
|
|
I.prototype.elt = I.prototype.ea = function(a) {
|
|
return this.va.ea(a)
|
|
};
|
|
I.prototype.insertAt = I.prototype.Ld = function(a, b) {
|
|
b instanceof D && z.k("Cannot add a Part to a Panel: " + b);
|
|
if (this === b || this.Pl(b)) this === b && z.k("Cannot make a Panel contain itself: " + this.toString()), z.k("Cannot make a Panel indirectly contain itself: " + this.toString() + " already contains " + b.toString());
|
|
var c = b.U;
|
|
null !== c && c !== this && z.k("Cannot add a GraphObject that already belongs to another Panel to this Panel: " + b.toString() + ", already contained by " + c.toString() + ", cannot be shared by this Panel: " +
|
|
this.toString());
|
|
this.ba !== Gk || b instanceof X || z.k("Can only add Shapes to a Grid Panel, not: " + b);
|
|
b.Tl(this);
|
|
b.Bm = null;
|
|
if (null !== this.Tt) {
|
|
var d = b.data;
|
|
null !== d && "object" === typeof d && (null === this.rg && (this.rg = new na(Object, I)), this.rg.add(d, b))
|
|
}
|
|
var e = this.va,
|
|
d = -1;
|
|
if (c === this) {
|
|
for (var g = -1, h = this.va.o, k = h.length, l = 0; l < k; l++)
|
|
if (h[l] === b) {
|
|
g = l;
|
|
break
|
|
}
|
|
if (-1 !== g) {
|
|
if (g === a || g + 1 >= e.count && a >= e.count) return;
|
|
e.dd(g);
|
|
d = g
|
|
} else z.k("element " + b.toString() + " has panel " + c.toString() + " but is not contained by it.")
|
|
}
|
|
if (0 >
|
|
a || a > e.count) a = e.count;
|
|
e.Ld(a, b);
|
|
this.S();
|
|
b.S();
|
|
null !== b.yd ? this.Ph = !0 : b instanceof I && !0 === b.Ph && (this.Ph = !0);
|
|
c = this.ca;
|
|
null !== c && (c.il = null, c.Qj = NaN, this.Ph && c instanceof E && (c.Ph = !0), c.Ph && (c.Dd = null), e = this.h, null !== e && e.pa.qb || (-1 !== d && c.Rc(Vf, "elements", this, b, null, d, null), c.Rc(Uf, "elements", this, null, b, null, a)))
|
|
};
|
|
I.prototype.remove = I.prototype.remove = function(a) {
|
|
z.l(a, O, I, "remove:element");
|
|
for (var b = this.va.o, c = b.length, d = -1, e = 0; e < c; e++)
|
|
if (b[e] === a) {
|
|
d = e;
|
|
break
|
|
} - 1 !== d && this.Ve(d)
|
|
};
|
|
I.prototype.removeAt = I.prototype.dd = function(a) {
|
|
u && z.p(a, I, "removeAt:idx");
|
|
0 <= a && this.Ve(a)
|
|
};
|
|
I.prototype.Ve = function(a) {
|
|
var b = this.va,
|
|
c = b.ea(a);
|
|
c.Bm = null;
|
|
c.Tl(null);
|
|
if (null !== this.rg) {
|
|
var d = c.data;
|
|
"object" === typeof d && this.rg.remove(d)
|
|
}
|
|
b.dd(a);
|
|
Yk(this, !1);
|
|
this.S();
|
|
this.Lm === c && (this.Lm = null);
|
|
b = this.ca;
|
|
null !== b && (b.il = null, b.Qj = NaN, b.ae(), d = this.h, null !== d && d.pa.qb || b.Rc(Vf, "elements", this, c, null, a, null))
|
|
};
|
|
z.w(I, {
|
|
Yp: "rowCount"
|
|
}, function() {
|
|
return void 0 === this.Wd ? 0 : this.Wd.length
|
|
});
|
|
I.prototype.getRowDefinition = I.prototype.$d = function(a) {
|
|
u && z.p(a, I, "getRowDefinition:idx");
|
|
0 > a && z.ka(a, ">= 0", I, "getRowDefinition:idx");
|
|
a = Math.round(a);
|
|
var b = this.Wd;
|
|
if (void 0 === b[a]) {
|
|
var c = new Fg;
|
|
c.Tl(this);
|
|
c.qe = !0;
|
|
c.index = a;
|
|
b[a] = c
|
|
}
|
|
return b[a]
|
|
};
|
|
I.prototype.removeRowDefinition = I.prototype.pF = function(a) {
|
|
u && z.p(a, I, "removeRowDefinition:idx");
|
|
0 > a && z.ka(a, ">= 0", I, "removeRowDefinition:idx");
|
|
a = Math.round(a);
|
|
var b = this.Wd;
|
|
this.Rc(Vf, "coldefs", this, b[a], null, a, null);
|
|
b[a] && delete b[a];
|
|
this.S()
|
|
};
|
|
z.w(I, {
|
|
gp: "columnCount"
|
|
}, function() {
|
|
return void 0 === this.Sd ? 0 : this.Sd.length
|
|
});
|
|
I.prototype.getColumnDefinition = I.prototype.Zd = function(a) {
|
|
u && z.p(a, I, "getColumnDefinition:idx");
|
|
0 > a && z.ka(a, ">= 0", I, "getColumnDefinition:idx");
|
|
a = Math.round(a);
|
|
var b = this.Sd;
|
|
if (void 0 === b[a]) {
|
|
var c = new Fg;
|
|
c.Tl(this);
|
|
c.qe = !1;
|
|
c.index = a;
|
|
b[a] = c
|
|
}
|
|
return b[a]
|
|
};
|
|
I.prototype.removeColumnDefinition = I.prototype.lF = function(a) {
|
|
u && z.p(a, I, "removeColumnDefinition:idx");
|
|
0 > a && z.ka(a, ">= 0", I, "removeColumnDefinition:idx");
|
|
a = Math.round(a);
|
|
var b = this.Sd;
|
|
this.Rc(Vf, "coldefs", this, b[a], null, a, null);
|
|
b[a] && delete b[a];
|
|
this.S()
|
|
};
|
|
z.defineProperty(I, {
|
|
eJ: "rowSizing"
|
|
}, function() {
|
|
return void 0 === this.Gm ? Vn : this.Gm
|
|
}, function(a) {
|
|
if (void 0 !== this.Gm) {
|
|
var b = this.Gm;
|
|
b !== a && (a !== Vn && a !== bo && z.k("Panel.rowSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.Gm = a, this.S(), this.j("rowSizing", b, a))
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
dH: "columnSizing"
|
|
}, function() {
|
|
return void 0 === this.fm ? Vn : this.fm
|
|
}, function(a) {
|
|
if (void 0 !== this.fm) {
|
|
var b = this.fm;
|
|
b !== a && (a !== Vn && a !== bo && z.k("Panel.columnSizing must be RowColumnDefinition.ProportionalExtra or RowColumnDefinition.None, not: " + a), this.fm = a, this.S(), this.j("columnSizing", b, a))
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
WF: "topIndex"
|
|
}, function() {
|
|
return void 0 === this.Xi ? 0 : this.Xi
|
|
}, function(a) {
|
|
if (void 0 !== this.Xi) {
|
|
var b = this.Xi;
|
|
b !== a && ((!isFinite(a) || 0 > a) && z.k("Panel.topIndex must be greater than zero and a real number, not: " + a), this.Xi = a, this.S(), this.j("topIndex", b, a))
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
XE: "leftIndex"
|
|
}, function() {
|
|
return void 0 === this.Ji ? 0 : this.Ji
|
|
}, function(a) {
|
|
if (void 0 !== this.Ji) {
|
|
var b = this.Ji;
|
|
b !== a && ((!isFinite(a) || 0 > a) && z.k("Panel.leftIndex must be greater than zero and a real number, not: " + a), this.Ji = a, this.S(), this.j("leftIndex", b, a))
|
|
}
|
|
});
|
|
I.prototype.findRowForLocalY = function(a) {
|
|
if (0 > a) return -1;
|
|
if (this.type !== ga) return NaN;
|
|
for (var b = 0, c = this.Wd, d = c.length, e = this.Xi; e < d; e++) {
|
|
var g = c[e];
|
|
if (void 0 !== g && (b += g.total, a < b)) return e
|
|
}
|
|
return -1
|
|
};
|
|
I.prototype.findColumnForLocalX = function(a) {
|
|
if (0 > a) return -1;
|
|
if (this.type !== ga) return NaN;
|
|
for (var b = 0, c = this.Sd, d = c.length, e = this.Ji; e < d; e++) {
|
|
var g = c[e];
|
|
if (void 0 !== g && (b += g.total, a < b)) return e
|
|
}
|
|
return -1
|
|
};
|
|
z.defineProperty(I, {
|
|
data: "data"
|
|
}, function() {
|
|
return this.fe
|
|
}, function(a) {
|
|
var b = this.fe;
|
|
if (b !== a) {
|
|
var c = this instanceof D && !(this instanceof da);
|
|
c && z.g(a, "object", I, "data");
|
|
gh(this);
|
|
this.fe = a;
|
|
var d = this.h;
|
|
null !== d && (c ? this instanceof G ? (null !== b && d.Qk.remove(b), null !== a && d.Qk.add(a, this)) : this instanceof D && (null !== b && d.zi.remove(b), null !== a && d.zi.add(a, this)) : (c = this.U, null !== c && null !== c.rg && (null !== b && c.rg.remove(b), null !== a && c.rg.add(a, this))));
|
|
this.j("data", b, a);
|
|
null !== d && d.pa.qb || null !== a && this.Mb()
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
mI: "itemIndex"
|
|
}, function() {
|
|
return this.vr
|
|
}, function(a) {
|
|
var b = this.vr;
|
|
b !== a && (this.vr = a, this.j("itemIndex", b, a))
|
|
});
|
|
|
|
function fn(a) {
|
|
a = a.Nk;
|
|
return null !== a && a.G
|
|
}
|
|
|
|
function gh(a) {
|
|
var b = a.Nk;
|
|
if (null === b) null !== a.data && z.k("Template cannot have .data be non-null: " + a), a.Nk = b = new J(Xg);
|
|
else if (b.G) return;
|
|
var c = new J(O);
|
|
eo(a, a, function(a, d) {
|
|
var e = d.Ac;
|
|
if (null !== e)
|
|
for (bn(d, !1), e = e.i; e.next();) {
|
|
var g = e.value;
|
|
g.mode === Zg && bn(d, !0);
|
|
if (null !== g.yn) {
|
|
var h = $g(g, a, d);
|
|
null !== h && (c.add(h), null === h.Oo && (h.Oo = new J(Xg)), h.Oo.add(g))
|
|
}
|
|
b.add(g)
|
|
}
|
|
if (d instanceof I && d.type === ga) {
|
|
if (0 < d.Wd.length)
|
|
for (e = d.Wd, g = e.length, h = 0; h < g; h++) {
|
|
var k = e[h];
|
|
if (void 0 !== k && null !== k.Ac)
|
|
for (var l = k.Ac.i; l.next();) {
|
|
var v =
|
|
l.value;
|
|
v.Ag = k;
|
|
v.Ts = 2;
|
|
v.Wo = k.index;
|
|
b.add(v)
|
|
}
|
|
}
|
|
if (0 < d.Sd.length)
|
|
for (e = d.Sd, g = e.length, h = 0; h < g; h++)
|
|
if (k = e[h], void 0 !== k && null !== k.Ac)
|
|
for (l = k.Ac.i; l.next();) v = l.value, v.Ag = k, v.Ts = 1, v.Wo = k.index, b.add(v)
|
|
}
|
|
});
|
|
for (var d = c.i; d.next();) {
|
|
var e = d.value;
|
|
if (null !== e.Oo) {
|
|
bn(e, !0);
|
|
for (var g = e.Oo.i; g.next();) {
|
|
var h = g.value;
|
|
null === e.Ac && (e.Ac = new J(Xg));
|
|
e.Ac.add(h)
|
|
}
|
|
}
|
|
e.Oo = null
|
|
}
|
|
for (d = b.i; d.next();)
|
|
if (e = d.value, g = e.Ag, null !== g) {
|
|
e.Ag = null;
|
|
var k = e.yu,
|
|
l = k.indexOf(".");
|
|
0 < l && g instanceof I && (h = k.substring(0, l), k = k.substr(l +
|
|
1), l = g.oe(h), null !== l ? (g = l, e.yu = k) : z.trace('Warning: unable to find GraphObject named "' + h + '" for Binding: ' + e.toString()));
|
|
g instanceof Fg ? (e.Wl = z.nd(g.U), g.U.Jn = e.Wl) : (e.Wl = z.nd(g), g.Jn = e.Wl)
|
|
}
|
|
b.freeze();
|
|
a instanceof D && (a.be() && (rj(a, Infinity, Infinity), a.Lc()), u && !lo && eo(a, a, function(a, c) {
|
|
if (c instanceof I && (c.type === Dk || c.type === Yi) && 1 >= c.elements.count && !(c instanceof D)) {
|
|
if (1 === c.elements.count) {
|
|
var d = null !== c.Tt;
|
|
if (!d)
|
|
for (var e = b.i; e.next();)
|
|
if ("itemArray" === e.value.yu) {
|
|
d = !0;
|
|
break
|
|
}
|
|
}
|
|
d || (z.trace("Auto or Spot Panel should not have zero or one elements: " +
|
|
c.toString() + " in " + a.toString()), lo = !0)
|
|
}
|
|
}))
|
|
}
|
|
var lo = !1;
|
|
I.prototype.copyTemplate = function() {
|
|
var a = this.copy();
|
|
a.DJ(function(a) {
|
|
a instanceof I && (a.Nk = null, a.fe = null);
|
|
var c = a.Ac;
|
|
null !== c && (a.Ac = null, c.each(function(c) {
|
|
a.bind(c.copy())
|
|
}))
|
|
});
|
|
return a
|
|
};
|
|
I.prototype.updateTargetBindings = I.prototype.Mb = function(a) {
|
|
var b = this.Nk;
|
|
if (null !== b)
|
|
for (void 0 === a && (a = ""), b = b.i; b.next();) {
|
|
var c = b.value,
|
|
d = c.OF;
|
|
if ("" === a || "" === d || d === a)
|
|
if (d = c.yu, null !== c.hH || "" !== d) {
|
|
var d = this.data,
|
|
e = c.yn;
|
|
if (null !== e) d = "" === e ? this : "." === e ? this : ".." === e ? this : this.oe(e);
|
|
else {
|
|
var g = this.h;
|
|
null !== g && c.St && (d = g.ha.tk)
|
|
}
|
|
if (null === d) u && z.trace("Binding error: missing GraphObject named " + e + " in " + this.toString());
|
|
else {
|
|
var g = this,
|
|
h = c.Wl;
|
|
if (-1 !== h) {
|
|
if (g = this.Xw(h), null === g) continue
|
|
} else null !==
|
|
c.Ag && (g = c.Ag);
|
|
"." === e ? d = g : ".." === e && (d = g.U);
|
|
e = c.Ts;
|
|
if (0 !== e) {
|
|
if (!(g instanceof I)) continue;
|
|
h = g;
|
|
1 === e ? g = h.Zd(c.Wo) : 2 === e && (g = h.$d(c.Wo))
|
|
}
|
|
void 0 !== g && c.fG(g, d)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
z.defineProperty(I, {
|
|
Tt: "itemArray"
|
|
}, function() {
|
|
return this.Ii
|
|
}, function(a) {
|
|
var b = this.Ii;
|
|
if (b !== a) {
|
|
u && null !== a && !z.isArray(a) && z.k("Panel.itemArray must be an Array-like object or null, not: " + a);
|
|
var c = this.h;
|
|
null !== c && null !== b && Cl(c, this);
|
|
this.Ii = a;
|
|
null !== c && null !== a && yl(c, this);
|
|
this.j("itemArray", b, a);
|
|
null !== c && c.pa.qb || this.GA()
|
|
}
|
|
});
|
|
|
|
function Rl(a) {
|
|
return a.type === Yi || a.type === Dk || a.type === Ki || a.type === ga && 0 < a.va.length && (a = a.va.ea(0), a.Ff && a instanceof I && (a.type === Qm || a.type === Rm)) ? !0 : !1
|
|
}
|
|
I.prototype.rebuildItemElements = I.prototype.GA = function() {
|
|
var a = 0;
|
|
for (Rl(this) && (a = 1); this.va.length > a;) this.Ve(this.va.length - 1);
|
|
a = this.Tt;
|
|
if (null !== a)
|
|
for (var b = z.bb(a), c = 0; c < b; c++) Ql(this, z.Ya(a, c), c)
|
|
};
|
|
I.prototype.findItemPanelForData = I.prototype.EH = function(a) {
|
|
if (void 0 === a || null === a || null === this.rg) return null;
|
|
z.g(a, "object", I, "findItemPanelForData");
|
|
return this.rg.na(a)
|
|
};
|
|
|
|
function Ql(a, b, c) {
|
|
if (!(void 0 === b || null === b || 0 > c)) {
|
|
var d;
|
|
d = mo(a, b);
|
|
var e = a.nI,
|
|
g = null;
|
|
null !== e && (g = e.na(d));
|
|
null === g && (no || (no = !0, z.trace('No item template Panel found for category "' + d + '" on ' + a), z.trace(" Using default item template."), d = new I, e = new qa, e.bind(new Xg("text", "", ka)), d.add(e), oo = d), g = oo);
|
|
d = g;
|
|
null !== d && (gh(d), d = d.copy(), "object" === typeof b && (null === a.rg && (a.rg = new na(Object, I)), a.rg.add(b, d)), e = c, Rl(a) && e++, a.Ld(e, d), Sl(a, e, c), d.fe = null, d.data = b)
|
|
}
|
|
}
|
|
|
|
function Sl(a, b, c) {
|
|
for (a = a.va; b < a.length;) {
|
|
var d = a.ea(b);
|
|
if (d instanceof I) {
|
|
var e = b,
|
|
g = c;
|
|
d.type === Qm ? d.Vb = e : d.type === Rm && (d.column = e);
|
|
d.mI = g
|
|
}
|
|
b++;
|
|
c++
|
|
}
|
|
}
|
|
z.defineProperty(I, {
|
|
LK: "itemTemplate"
|
|
}, function() {
|
|
return null === this.sg ? null : this.sg.na("")
|
|
}, function(a) {
|
|
if (null === this.sg) {
|
|
if (null === a) return;
|
|
this.sg = new na("string", I)
|
|
}
|
|
var b = this.sg.na("");
|
|
b !== a && (z.l(a, I, I, "itemTemplate"), (a instanceof D || a.Ff) && z.k("Panel.itemTemplate must not be a Part or be Panel.isPanelMain: " + a), this.sg.add("", a), this.j("itemTemplate", b, a), a = this.h, null !== a && a.pa.qb || this.GA())
|
|
});
|
|
z.defineProperty(I, {
|
|
nI: "itemTemplateMap"
|
|
}, function() {
|
|
return this.sg
|
|
}, function(a) {
|
|
var b = this.sg;
|
|
if (b !== a) {
|
|
z.l(a, na, I, "itemTemplateMap");
|
|
for (var c = a.i; c.next();) {
|
|
var d = c.value;
|
|
(d instanceof D || d.Ff) && z.k("Template in Panel.itemTemplateMap must not be a Part or be Panel.isPanelMain: " + d)
|
|
}
|
|
this.sg = a;
|
|
this.j("itemTemplateMap", b, a);
|
|
a = this.h;
|
|
null !== a && a.pa.qb || this.GA()
|
|
}
|
|
});
|
|
z.defineProperty(I, {
|
|
KK: "itemCategoryProperty"
|
|
}, function() {
|
|
return this.vo
|
|
}, function(a) {
|
|
var b = this.vo;
|
|
b !== a && ("string" !== typeof a && "function" !== typeof a && z.ic(a, "string or function", I, "itemCategoryProperty"), this.vo = a, this.j("itemCategoryProperty", b, a))
|
|
});
|
|
|
|
function mo(a, b) {
|
|
if (null === b) return "";
|
|
var c = a.vo,
|
|
d = "";
|
|
if ("function" === typeof c) d = c(b);
|
|
else if ("string" === typeof c && "object" === typeof b) {
|
|
if ("" === c) return "";
|
|
d = z.tb(b, c)
|
|
} else return "";
|
|
if (void 0 === d) return "";
|
|
if ("string" === typeof d) return d;
|
|
z.k("Panel.getCategoryForItemData found a non-string category for " + b + ": " + d);
|
|
return ""
|
|
}
|
|
var no = !1,
|
|
oo = null;
|
|
z.defineProperty(I, {
|
|
FK: "isAtomic"
|
|
}, function() {
|
|
return this.dh
|
|
}, function(a) {
|
|
var b = this.dh;
|
|
b !== a && (z.g(a, "boolean", I, "isAtomic"), this.dh = a, this.j("isAtomic", b, a))
|
|
});
|
|
z.defineProperty(I, {
|
|
KE: "isClipping"
|
|
}, function() {
|
|
return this.hr
|
|
}, function(a) {
|
|
var b = this.hr;
|
|
b !== a && (z.g(a, "boolean", I, "isClipping"), this.hr = a, this.j("isClipping", b, a))
|
|
});
|
|
|
|
function Fg() {
|
|
z.kc(this);
|
|
this.lh = null;
|
|
this.Bv = !0;
|
|
this.Uc = 0;
|
|
this.ef = NaN;
|
|
this.Uj = 0;
|
|
this.Sj = Infinity;
|
|
this.Ie = Pc;
|
|
this.sb = this.Xa = 0;
|
|
this.Ac = null;
|
|
this.Ls = po;
|
|
this.di = Am;
|
|
this.Fs = this.Yj = null;
|
|
this.Gs = NaN;
|
|
this.Nb = this.Wh = null;
|
|
this.Gq = !1
|
|
}
|
|
z.ia("RowColumnDefinition", Fg);
|
|
Fg.prototype.copy = function() {
|
|
var a = new Fg;
|
|
a.Bv = this.Bv;
|
|
a.Uc = this.Uc;
|
|
a.ef = this.ef;
|
|
a.Uj = this.Uj;
|
|
a.Sj = this.Sj;
|
|
a.Ie = this.Ie;
|
|
a.Xa = this.Xa;
|
|
a.sb = this.sb;
|
|
a.di = this.di;
|
|
a.Ls = this.Ls;
|
|
a.Yj = null === this.Yj ? null : this.Yj.V();
|
|
a.Fs = this.Fs;
|
|
a.Gs = this.Gs;
|
|
a.Wh = null;
|
|
null !== this.Wh && (a.Wh = z.zl(this.Wh));
|
|
a.Nb = this.Nb;
|
|
a.Gq = this.Gq;
|
|
a.Ac = this.Ac;
|
|
return a
|
|
};
|
|
Fg.prototype.tt = function(a) {
|
|
z.l(a, Fg, Fg, "copyFrom:pd");
|
|
a.qe ? this.height = a.height : this.width = a.width;
|
|
this.pj = a.pj;
|
|
this.qf = a.qf;
|
|
this.alignment = a.alignment;
|
|
this.stretch = a.stretch;
|
|
this.uu = a.uu;
|
|
this.Yj = null === a.Yj ? null : a.Yj.V();
|
|
this.Zp = a.Zp;
|
|
this.$p = a.$p;
|
|
this.Wh = null;
|
|
a.Wh && (this.Wh = z.zl(a.Wh));
|
|
this.background = a.background;
|
|
this.Mz = a.Mz;
|
|
this.Ac = a.Ac
|
|
};
|
|
Fg.prototype.toString = function() {
|
|
return "RowColumnDefinition " + (this.qe ? "(Row " : "(Column ") + this.index + ") #" + z.nd(this)
|
|
};
|
|
var po;
|
|
Fg.Default = po = z.s(Fg, "Default", 0);
|
|
var bo;
|
|
Fg.None = bo = z.s(Fg, "None", 1);
|
|
var Vn;
|
|
Fg.ProportionalExtra = Vn = z.s(Fg, "ProportionalExtra", 2);
|
|
Fg.prototype.Tl = function(a) {
|
|
this.lh = a
|
|
};
|
|
Fg.prototype.computeEffectiveSpacingTop = Fg.prototype.UD = function() {
|
|
var a = 0;
|
|
if (0 !== this.index) {
|
|
var b = this.lh,
|
|
c = this.Zp;
|
|
null === c && null !== b && (c = this.qe ? b.Ai : b.Kh);
|
|
null !== c && (a = this.$p, isNaN(a) && (a = null !== b ? this.qe ? b.Mh : b.Lh : 0))
|
|
}
|
|
b = this.HF;
|
|
if (null === b)
|
|
if (b = this.lh, null !== b) b = b.Aj;
|
|
else return a;
|
|
return a + (this.qe ? b.top : b.left)
|
|
};
|
|
Fg.prototype.computeEffectiveSpacing = Fg.prototype.Re = function() {
|
|
var a = 0;
|
|
if (0 !== this.index) {
|
|
var b = this.lh,
|
|
c = this.Zp;
|
|
null === c && null !== b && (c = this.qe ? b.Ai : b.Kh);
|
|
null !== c && (a = this.$p, isNaN(a) && (a = null !== b ? this.qe ? b.Mh : b.Lh : 0))
|
|
}
|
|
b = this.HF;
|
|
if (null === b)
|
|
if (b = this.lh, null !== b) b = b.Aj;
|
|
else return a;
|
|
return a + (this.qe ? b.top + b.bottom : b.left + b.right)
|
|
};
|
|
Fg.prototype.kd = function(a, b, c, d, e) {
|
|
var g = this.lh;
|
|
if (null !== g && (g.Rc(Sf, a, this, b, c, d, e), null !== this.Ac && (b = g.h, null !== b && !b.Ee && (g = g.op(), null !== g && (g = g.data, null !== g)))))
|
|
for (c = this.Ac.i; c.next();) c.value.Rx(this, g, a, b)
|
|
};
|
|
z.w(Fg, {
|
|
U: "panel"
|
|
}, function() {
|
|
return this.lh
|
|
});
|
|
z.defineProperty(Fg, {
|
|
qe: "isRow"
|
|
}, function() {
|
|
return this.Bv
|
|
}, function(a) {
|
|
this.Bv = a
|
|
});
|
|
z.defineProperty(Fg, {
|
|
index: "index"
|
|
}, function() {
|
|
return this.Uc
|
|
}, function(a) {
|
|
this.Uc = a
|
|
});
|
|
z.defineProperty(Fg, {
|
|
height: "height"
|
|
}, function() {
|
|
return this.ef
|
|
}, function(a) {
|
|
var b = this.ef;
|
|
b !== a && (u && z.g(a, "number", Fg, "height"), 0 > a && z.ka(a, ">= 0", Fg, "height"), this.ef = a, this.Oa = this.Xa, null !== this.U && this.U.S(), this.kd("height", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
width: "width"
|
|
}, function() {
|
|
return this.ef
|
|
}, function(a) {
|
|
var b = this.ef;
|
|
b !== a && (u && z.g(a, "number", Fg, "width"), 0 > a && z.ka(a, ">= 0", Fg, "width"), this.ef = a, this.Oa = this.Xa, null !== this.U && this.U.S(), this.kd("width", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
pj: "minimum"
|
|
}, function() {
|
|
return this.Uj
|
|
}, function(a) {
|
|
var b = this.Uj;
|
|
b !== a && (u && z.g(a, "number", Fg, "minimum"), (0 > a || !isFinite(a)) && z.ka(a, ">= 0", Fg, "minimum"), this.Uj = a, this.Oa = this.Xa, null !== this.U && this.U.S(), this.kd("minimum", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
qf: "maximum"
|
|
}, function() {
|
|
return this.Sj
|
|
}, function(a) {
|
|
var b = this.Sj;
|
|
b !== a && (u && z.g(a, "number", Fg, "maximum"), 0 > a && z.ka(a, ">= 0", Fg, "maximum"), this.Sj = a, this.Oa = this.Xa, null !== this.U && this.U.S(), this.kd("maximum", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
alignment: "alignment"
|
|
}, function() {
|
|
return this.Ie
|
|
}, function(a) {
|
|
var b = this.Ie;
|
|
b.N(a) || (u && z.l(a, Q, Fg, "alignment"), this.Ie = a.V(), null !== this.U && this.U.S(), this.kd("alignment", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
stretch: "stretch"
|
|
}, function() {
|
|
return this.di
|
|
}, function(a) {
|
|
var b = this.di;
|
|
b !== a && (u && z.Ba(a, O, Fg, "stretch"), this.di = a, null !== this.U && this.U.S(), this.kd("stretch", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
HF: "separatorPadding"
|
|
}, function() {
|
|
return this.Yj
|
|
}, function(a) {
|
|
"number" === typeof a ? a = new Db(a) : null !== a && u && z.l(a, Db, Fg, "separatorPadding");
|
|
var b = this.Yj;
|
|
null !== a && null !== b && b.N(a) || (null !== a && (a = a.V()), this.Yj = a, null !== this.U && this.U.S(), this.kd("separatorPadding", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
Zp: "separatorStroke"
|
|
}, function() {
|
|
return this.Fs
|
|
}, function(a) {
|
|
var b = this.Fs;
|
|
b !== a && (null === a || "string" === typeof a || a instanceof Da) && (a instanceof Da && a.freeze(), this.Fs = a, null !== this.U && this.U.S(), this.kd("separatorStroke", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
$p: "separatorStrokeWidth"
|
|
}, function() {
|
|
return this.Gs
|
|
}, function(a) {
|
|
var b = this.Gs;
|
|
b !== a && (this.Gs = a, null !== this.U && this.U.S(), this.kd("separatorStrokeWidth", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
iJ: "separatorDashArray"
|
|
}, function() {
|
|
return this.Wh
|
|
}, function(a) {
|
|
var b = this.Wh;
|
|
if (b !== a) {
|
|
null === a || Array.isArray(a) || z.ic(a, "Array", Fg, "separatorDashArray:value");
|
|
if (null !== a) {
|
|
for (var c = a.length, d = 0, e = 0; e < c; e++) {
|
|
var g = a[e];
|
|
"number" === typeof g && 0 <= g && isFinite(g) || z.k("separatorDashArray value " + g + " at index " + e + " must be a positive number or zero.");
|
|
d += g
|
|
}
|
|
if (0 === d) {
|
|
if (null === b) return;
|
|
a = null
|
|
}
|
|
}
|
|
this.Wh = a;
|
|
null !== this.U && this.U.ta();
|
|
this.kd("separatorDashArray", b, a)
|
|
}
|
|
});
|
|
z.defineProperty(Fg, {
|
|
background: "background"
|
|
}, function() {
|
|
return this.Nb
|
|
}, function(a) {
|
|
var b = this.Nb;
|
|
b !== a && (null === a || "string" === typeof a || a instanceof Da) && (a instanceof Da && a.freeze(), this.Nb = a, null !== this.U && this.U.ta(), this.kd("background", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
Mz: "coversSeparators"
|
|
}, function() {
|
|
return this.Gq
|
|
}, function(a) {
|
|
var b = this.Gq;
|
|
b !== a && (z.g(a, "boolean", Fg, "coversSeparators"), this.Gq = a, null !== this.U && this.U.ta(), this.kd("coversSeparators", b, a))
|
|
});
|
|
z.defineProperty(Fg, {
|
|
uu: "sizing"
|
|
}, function() {
|
|
return this.Ls
|
|
}, function(a) {
|
|
var b = this.Ls;
|
|
b !== a && (u && z.Ba(a, Fg, Fg, "sizing"), this.Ls = a, null !== this.U && this.U.S(), this.kd("sizing", b, a))
|
|
});
|
|
|
|
function ao(a) {
|
|
if (a.uu === po) {
|
|
var b = a.lh;
|
|
return a.qe ? b.eJ : b.dH
|
|
}
|
|
return a.uu
|
|
}
|
|
z.defineProperty(Fg, {
|
|
Oa: "actual"
|
|
}, function() {
|
|
return this.Xa
|
|
}, function(a) {
|
|
this.Xa = isNaN(this.ef) ? Math.max(Math.min(this.Sj, a), this.Uj) : Math.max(Math.min(this.Sj, this.ef), this.Uj)
|
|
});
|
|
z.defineProperty(Fg, {
|
|
total: "total"
|
|
}, function() {
|
|
return this.Xa + this.Re()
|
|
}, function(a) {
|
|
this.Xa = isNaN(this.ef) ? Math.max(Math.min(this.Sj, a), this.Uj) : Math.max(Math.min(this.Sj, this.ef), this.Uj);
|
|
this.Xa = Math.max(0, this.Xa - this.Re())
|
|
});
|
|
z.defineProperty(Fg, {
|
|
position: "position"
|
|
}, function() {
|
|
return this.sb
|
|
}, function(a) {
|
|
this.sb = a
|
|
});
|
|
Fg.prototype.bind = Fg.prototype.bind = function(a) {
|
|
a.Ag = this;
|
|
var b = this.U;
|
|
if (null !== b) {
|
|
var c = b.op();
|
|
null !== c && fn(c) && z.k("Cannot add a Binding to a RowColumnDefinition that is already frozen: " + a + " on " + b)
|
|
}
|
|
null === this.Ac && (this.Ac = new J(Xg));
|
|
this.Ac.add(a)
|
|
};
|
|
|
|
function X() {
|
|
O.call(this);
|
|
this.ab = null;
|
|
this.fo = "None";
|
|
this.Yh = !1;
|
|
this.br = Am;
|
|
this.Nn = null;
|
|
this.Kc = this.Ad = "black";
|
|
this.Oe = 1;
|
|
this.So = "butt";
|
|
this.Uo = "miter";
|
|
this.Km = 10;
|
|
this.To = null;
|
|
this.ve = 0;
|
|
this.ci = this.bi = Pc;
|
|
this.cs = this.bs = NaN;
|
|
this.ir = !1;
|
|
this.es = null;
|
|
this.ko = this.Yo = "None";
|
|
this.fr = 1
|
|
}
|
|
z.Qa(X, O);
|
|
z.ia("Shape", X);
|
|
X.prototype.cloneProtected = function(a) {
|
|
O.prototype.cloneProtected.call(this, a);
|
|
a.ab = this.ab;
|
|
a.fo = this.fo;
|
|
a.Yh = this.Yh;
|
|
a.br = this.br;
|
|
a.Nn = this.Nn;
|
|
a.Ad = this.Ad;
|
|
a.Kc = this.Kc;
|
|
a.Oe = this.Oe;
|
|
a.So = this.So;
|
|
a.Uo = this.Uo;
|
|
a.Km = this.Km;
|
|
null !== this.To && (a.To = z.zl(this.To));
|
|
a.ve = this.ve;
|
|
a.bi = this.bi.V();
|
|
a.ci = this.ci.V();
|
|
a.bs = this.bs;
|
|
a.cs = this.cs;
|
|
a.ir = this.ir;
|
|
a.es = this.es;
|
|
a.Yo = this.Yo;
|
|
a.ko = this.ko;
|
|
a.fr = this.fr
|
|
};
|
|
X.prototype.toString = function() {
|
|
return "Shape(" + ("None" !== this.Hb ? this.Hb : "None" !== this.fq ? this.fq : this.Xz) + ")#" + z.nd(this)
|
|
};
|
|
|
|
function qo(a, b, c, d) {
|
|
var e = c.length;
|
|
if (!(4 > e)) {
|
|
for (var g = d.Ia, h = Math.max(1, g.width), g = g.height, k = c[0], l = c[1], m = 0, n = 0, p = 0, q = 0, r = 0, s = 0, t = q = 0, v = z.rb(), x = 2; x < e; x += 2) m = c[x], n = c[x + 1], p = m - k, q = n - l, 0 === p && (p = .001), r = q / p, s = Math.atan2(q, p), q = Math.sqrt(p * p + q * q), v.push([p, s, r, q]), t += q, k = m, l = n;
|
|
k = c[0];
|
|
l = c[1];
|
|
p = d.Ia.width;
|
|
d instanceof X && (p -= d.ub);
|
|
1 > p && (p = 1);
|
|
c = p;
|
|
for (var e = 0, m = c, n = h / 2, x = 0 === n ? !1 : !0, y = 0, q = v[y], p = q[0], s = q[1], r = q[2], q = q[3], A = 0; .1 <= t;) {
|
|
0 === A && (x ? (m = c, e++, m -= n, t -= n, x = !1) : (m = c, e++), 0 === m && (m = 1));
|
|
if (m > t) {
|
|
z.xa(v);
|
|
return
|
|
}
|
|
m > q ? (A = m - q, m = q) : A = 0;
|
|
var B = Math.sqrt(m * m / (1 + r * r));
|
|
0 > p && (B = -B);
|
|
k += B;
|
|
l += r * B;
|
|
a.translate(k, l);
|
|
a.rotate(s);
|
|
a.translate(-(h / 2), -(g / 2));
|
|
0 === A && d.nk(a, b);
|
|
a.translate(h / 2, g / 2);
|
|
a.rotate(-s);
|
|
a.translate(-k, -l);
|
|
t -= m;
|
|
q -= m;
|
|
if (0 !== A) {
|
|
y++;
|
|
if (y === v.length) {
|
|
z.xa(v);
|
|
return
|
|
}
|
|
q = v[y];
|
|
p = q[0];
|
|
s = q[1];
|
|
r = q[2];
|
|
q = q[3];
|
|
m = A
|
|
}
|
|
}
|
|
z.xa(v)
|
|
}
|
|
}
|
|
X.prototype.nk = function(a, b) {
|
|
if (null !== this.Kc || null !== this.Ad) {
|
|
null !== this.Ad && Um(this, a, this.Ad, !0, !1);
|
|
null !== this.Kc && Um(this, a, this.Kc, !1, !1);
|
|
var c = this.Oe;
|
|
if (0 === c) {
|
|
var d = this.ca;
|
|
d instanceof da && d.type === Ki && "Selection" === d.nc && d.fc instanceof X && d.Wf.gf() === d.fc && (c = d.fc.ub)
|
|
}
|
|
a.lineWidth = c;
|
|
a.lineJoin = this.Uo;
|
|
a.lineCap = this.So;
|
|
a.miterLimit = this.Km;
|
|
var e = !1;
|
|
this.ca && b.hj("drawShadows") && (e = this.ca.sk);
|
|
var g = !0;
|
|
null !== this.Kc && null === this.Ad && (g = !1);
|
|
var d = !1,
|
|
h = !0,
|
|
k = this.QF;
|
|
null !== k && (d = !0, h = a.Tz(k,
|
|
this.ve));
|
|
var l = this.ab;
|
|
if (null !== l) {
|
|
if (l.ba === mf) a.beginPath(), d && !h ? Hm(a, l.xc, l.Cc, l.zb, l.Gb, k, this.ve) : (a.moveTo(l.xc, l.Cc), a.lineTo(l.zb, l.Gb)), null !== this.Ad && a.Gg(this.Ad), 0 !== c && null !== this.Kc && a.tj();
|
|
else if (l.ba === nf) {
|
|
var m = l.xc,
|
|
n = l.Cc,
|
|
p = l.zb,
|
|
q = l.Gb,
|
|
l = Math.min(m, p),
|
|
r = Math.min(n, q),
|
|
m = Math.abs(p - m),
|
|
n = Math.abs(q - n);
|
|
null !== this.Ad && (a.beginPath(), a.rect(l, r, m, n), a.Gg(this.Ad));
|
|
if (null !== this.Kc) {
|
|
var s = p = 0,
|
|
t = 0;
|
|
g && e && (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY =
|
|
0, a.shadowBlur = 0);
|
|
d && !h ? (h = z.rb(), h.push(l), h.push(r), h.push(l + m), h.push(r), h.push(l + m), h.push(r + n), h.push(l), h.push(r + n), h.push(l), h.push(r), a.beginPath(), ro(a, h, k, this.ve), a.tj(), z.xa(h)) : 0 !== c && (a.beginPath(), a.rect(l, r, m, n), a.tj());
|
|
g && e && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t)
|
|
}
|
|
} else if (l.ba === of) m = l.xc, n = l.Cc, p = l.zb, q = l.Gb, l = Math.abs(p - m) / 2, r = Math.abs(q - n) / 2, m = Math.min(m, p) + l, n = Math.min(n, q) + r, a.beginPath(), a.moveTo(m, n - r), a.bezierCurveTo(m + Hd * l, n - r, m + l, n - Hd * r, m + l, n), a.bezierCurveTo(m +
|
|
l, n + Hd * r, m + Hd * l, n + r, m, n + r), a.bezierCurveTo(m - Hd * l, n + r, m - l, n + Hd * r, m - l, n), a.bezierCurveTo(m - l, n - Hd * r, m - Hd * l, n - r, m, n - r), a.closePath(), null !== this.Ad && a.Gg(this.Ad), d && !h && (h = z.rb(), we(m, n - r, m + Hd * l, n - r, m + l, n - Hd * r, m + l, n, .5, h), we(m + l, n, m + l, n + Hd * r, m + Hd * l, n + r, m, n + r, .5, h), we(m, n + r, m - Hd * l, n + r, m - l, n + Hd * r, m - l, n, .5, h), we(m - l, n, m - l, n - Hd * r, m - Hd * l, n - r, m, n - r, .5, h), a.beginPath(), ro(a, h, k, this.ve), z.xa(h)), 0 !== c && null !== this.Kc && (g && e ? (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY =
|
|
0, a.shadowBlur = 0, a.tj(), a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t) : a.tj());
|
|
else if (l.ba === jf) {
|
|
r = l.Cj;
|
|
n = r.length;
|
|
for (q = 0; q < n; q++) {
|
|
m = r.o[q];
|
|
a.beginPath();
|
|
a.moveTo(m.Ha, m.Da);
|
|
for (var p = m.Ab.o, s = p.length, v = null, t = 0; t < s; t++) {
|
|
var x = p[t];
|
|
switch (x.ba) {
|
|
case Df:
|
|
a.moveTo(x.L, x.M);
|
|
break;
|
|
case qf:
|
|
a.lineTo(x.L, x.M);
|
|
break;
|
|
case Ef:
|
|
a.bezierCurveTo(x.Cd, x.Ne, x.mh, x.yg, x.zb, x.Gb);
|
|
break;
|
|
case Ff:
|
|
a.quadraticCurveTo(x.Cd, x.Ne, x.zb, x.Gb);
|
|
break;
|
|
case Gf:
|
|
if (x.radiusX === x.radiusY) v = Math.PI / 180, a.arc(x.Cd, x.Ne, x.radiusX,
|
|
x.Fe * v, (x.Fe + x.Lf) * v, 0 > x.Lf);
|
|
else {
|
|
var v = If(x, m),
|
|
y = v.length;
|
|
if (0 === y) {
|
|
a.lineTo(x.ra, x.za);
|
|
break
|
|
}
|
|
for (var A = 0; A < y; A++) {
|
|
var B = v[A];
|
|
0 === A && a.lineTo(B[0], B[1]);
|
|
a.bezierCurveTo(B[2], B[3], B[4], B[5], B[6], B[7])
|
|
}
|
|
}
|
|
break;
|
|
case Hf:
|
|
A = y = 0;
|
|
if (null !== v && v.type === Gf) {
|
|
v = If(v, m);
|
|
B = v.length;
|
|
if (0 === B) {
|
|
a.lineTo(x.ra, x.za);
|
|
break
|
|
}
|
|
v = v[B - 1] || null;
|
|
null !== v && (y = v[6], A = v[7])
|
|
} else y = null !== v ? v.L : m.Ha, A = null !== v ? v.M : m.Da;
|
|
v = Jf(x, m, y, A);
|
|
y = v.length;
|
|
if (0 === y) {
|
|
a.lineTo(x.ra, x.za);
|
|
break
|
|
}
|
|
for (A = 0; A < y; A++) B = v[A], a.bezierCurveTo(B[2], B[3],
|
|
B[4], B[5], B[6], B[7]);
|
|
break;
|
|
default:
|
|
z.k("Segment not of valid type: " + x.ba)
|
|
}
|
|
x.Rh && a.closePath();
|
|
v = x
|
|
}
|
|
e ? (t = s = p = 0, m.so ? (!0 === m.jm && null !== this.Ad ? (a.Gg(this.Ad), g = !0) : g = !1, 0 !== c && null !== this.Kc && (g && (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), d && !h || a.tj(), g && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t))) : (g && (p = a.shadowOffsetX, s = a.shadowOffsetY, t = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), !0 === m.jm && null !== this.Ad &&
|
|
a.Gg(this.Ad), 0 !== c && null !== this.Kc && (d && !h || a.tj()), g && (a.shadowOffsetX = p, a.shadowOffsetY = s, a.shadowBlur = t))) : (!0 === m.jm && null !== this.Ad && a.Gg(this.Ad), 0 === c || null === this.Kc || d && !h || a.tj())
|
|
}
|
|
if (d && !h)
|
|
for (c = g, g = l.Cj, h = g.length, l = 0; l < h; l++) {
|
|
r = g.o[l];
|
|
a.beginPath();
|
|
n = z.rb();
|
|
n.push(r.Ha);
|
|
n.push(r.Da);
|
|
q = r.Ha;
|
|
m = r.Da;
|
|
p = q;
|
|
s = m;
|
|
t = r.Ab.o;
|
|
x = t.length;
|
|
for (v = 0; v < x; v++) {
|
|
y = t[v];
|
|
switch (y.ba) {
|
|
case Df:
|
|
ro(a, n, k, this.ve);
|
|
n.length = 0;
|
|
n.push(y.L);
|
|
n.push(y.M);
|
|
q = y.L;
|
|
m = y.M;
|
|
p = q;
|
|
s = m;
|
|
break;
|
|
case qf:
|
|
n.push(y.L);
|
|
n.push(y.M);
|
|
q = y.L;
|
|
m = y.M;
|
|
break;
|
|
case Ef:
|
|
we(q, m, y.Cd, y.Ne, y.mh, y.yg, y.zb, y.Gb, .5, n);
|
|
q = y.L;
|
|
m = y.M;
|
|
break;
|
|
case Ff:
|
|
Je(q, m, y.Cd, y.Ne, y.zb, y.Gb, .5, n);
|
|
q = y.L;
|
|
m = y.M;
|
|
break;
|
|
case Gf:
|
|
A = If(y, r);
|
|
B = A.length;
|
|
if (0 === B) {
|
|
n.push(y.ra);
|
|
n.push(y.za);
|
|
q = y.ra;
|
|
m = y.za;
|
|
break
|
|
}
|
|
for (var L = 0; L < B; L++) {
|
|
var H = A[L];
|
|
we(q, m, H[2], H[3], H[4], H[5], H[6], H[7], .5, n);
|
|
q = H[6];
|
|
m = H[7]
|
|
}
|
|
break;
|
|
case Hf:
|
|
A = Jf(y, r, q, m);
|
|
B = A.length;
|
|
if (0 === B) {
|
|
n.push(y.ra);
|
|
n.push(y.za);
|
|
q = y.ra;
|
|
m = y.za;
|
|
break
|
|
}
|
|
for (L = 0; L < B; L++) H = A[L], we(q, m, H[2], H[3], H[4], H[5], H[6], H[7], .5, n), q = H[6], m = H[7];
|
|
break;
|
|
default:
|
|
z.k("Segment not of valid type: " +
|
|
y.ba)
|
|
}
|
|
y.Rh && (n.push(p), n.push(s), ro(a, n, k, this.ve))
|
|
}
|
|
ro(a, n, k, this.ve);
|
|
z.xa(n);
|
|
null !== this.Kc && (q = n = r = 0, c && e && (r = a.shadowOffsetX, n = a.shadowOffsetY, q = a.shadowBlur, a.shadowOffsetX = 0, a.shadowOffsetY = 0, a.shadowBlur = 0), a.tj(), c && e && (a.shadowOffsetX = r, a.shadowOffsetY = n, a.shadowBlur = q))
|
|
}
|
|
}
|
|
d && a.Pz();
|
|
if (null !== this.xx) {
|
|
d = this.xx;
|
|
rj(d, Infinity, Infinity);
|
|
k = d.Ia;
|
|
d.Lc(0, 0, k.width, k.height);
|
|
c = this.Jl;
|
|
a.save();
|
|
a.beginPath();
|
|
k = z.rb();
|
|
if (c.type === mf) k.push(c.Ha), k.push(c.Da), k.push(c.L), k.push(c.M), qo(a, b, k, d);
|
|
else if (c.type ===
|
|
jf)
|
|
for (h = c.cc.i; h.next();) {
|
|
l = h.value;
|
|
k.length = 0;
|
|
k.push(l.Ha);
|
|
k.push(l.Da);
|
|
g = l.Ha;
|
|
r = l.Da;
|
|
n = g;
|
|
q = r;
|
|
m = l.Ab.o;
|
|
p = m.length;
|
|
for (s = 0; s < p; s++) {
|
|
t = m[s];
|
|
switch (t.ba) {
|
|
case Df:
|
|
qo(a, b, k, d);
|
|
k.length = 0;
|
|
k.push(t.L);
|
|
k.push(t.M);
|
|
g = t.L;
|
|
r = t.M;
|
|
n = g;
|
|
q = r;
|
|
break;
|
|
case qf:
|
|
k.push(t.L);
|
|
k.push(t.M);
|
|
g = t.L;
|
|
r = t.M;
|
|
break;
|
|
case Ef:
|
|
we(g, r, t.Cd, t.Ne, t.mh, t.yg, t.zb, t.Gb, .5, k);
|
|
g = t.L;
|
|
r = t.M;
|
|
break;
|
|
case Ff:
|
|
Je(g, r, t.Cd, t.Ne, t.zb, t.Gb, .5, k);
|
|
g = t.L;
|
|
r = t.M;
|
|
break;
|
|
case Gf:
|
|
c = If(t, l);
|
|
e = c.length;
|
|
if (0 === e) {
|
|
k.push(t.ra);
|
|
k.push(t.za);
|
|
g = t.ra;
|
|
r = t.za;
|
|
break
|
|
}
|
|
for (x =
|
|
0; x < e; x++) v = c[x], we(g, r, v[2], v[3], v[4], v[5], v[6], v[7], .5, k), g = v[6], r = v[7];
|
|
break;
|
|
case Hf:
|
|
c = Jf(t, l, g, r);
|
|
e = c.length;
|
|
if (0 === e) {
|
|
k.push(t.ra);
|
|
k.push(t.za);
|
|
g = t.ra;
|
|
r = t.za;
|
|
break
|
|
}
|
|
for (x = 0; x < e; x++) v = c[x], we(g, r, v[2], v[3], v[4], v[5], v[6], v[7], .5, k), g = v[6], r = v[7];
|
|
break;
|
|
default:
|
|
z.k("Segment not of valid type: " + t.ba)
|
|
}
|
|
t.Rh && (k.push(n), k.push(q), qo(a, b, k, d))
|
|
}
|
|
qo(a, b, k, d)
|
|
} else if (c.type === nf) k.push(c.Ha), k.push(c.Da), k.push(c.L), k.push(c.Da), k.push(c.L), k.push(c.M), k.push(c.Ha), k.push(c.M), k.push(c.Ha), k.push(c.Da),
|
|
qo(a, b, k, d);
|
|
else if (c.type === of) {
|
|
h = new kf;
|
|
h.Ha = c.L;
|
|
h.Da = (c.Da + c.M) / 2;
|
|
g = new Of(Gf);
|
|
g.Fe = 0;
|
|
g.Lf = 360;
|
|
g.ra = (c.Ha + c.L) / 2;
|
|
g.za = (c.Da + c.M) / 2;
|
|
g.radiusX = Math.abs(c.Ha - c.L) / 2;
|
|
g.radiusY = Math.abs(c.Da - c.M) / 2;
|
|
h.add(g);
|
|
c = If(g, h);
|
|
e = c.length;
|
|
if (0 === e) k.push(g.ra), k.push(g.za);
|
|
else
|
|
for (g = h.Ha, r = h.Da, x = 0; x < e; x++) v = c[x], we(g, r, v[2], v[3], v[4], v[5], v[6], v[7], .5, k), g = v[6], r = v[7];
|
|
qo(a, b, k, d)
|
|
}
|
|
z.xa(k);
|
|
a.restore();
|
|
ca(a, !1)
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
function ro(a, b, c, d) {
|
|
var e = b.length;
|
|
if (!(4 > e)) {
|
|
var g = .001,
|
|
h = c.length,
|
|
k = b[0],
|
|
l = b[1];
|
|
if (4 === e) Hm(a, k, l, b[2], b[3], c, d);
|
|
else {
|
|
a.moveTo(k, l);
|
|
for (var m = g = 0, n = 0, p = 0, q = 0, r = p = 0, s = z.rb(), t = 2; t < e; t += 2) g = b[t], m = b[t + 1], n = g - k, p = m - l, 0 === n && (n = .001), q = p / n, p = Math.sqrt(n * n + p * p), s.push([n, q, p]), r += p, k = g, l = m;
|
|
k = b[0];
|
|
l = b[1];
|
|
b = 0;
|
|
for (var e = !0, g = c[b % h], m = 0 !== d, t = 0, p = s[t], n = p[0], q = p[1], p = p[2], v = 0; .1 <= r;) {
|
|
0 === v && (g = c[b % h], b++, m && (d %= g, g -= d, m = !1));
|
|
g > r && (g = r);
|
|
g > p ? (v = g - p, g = p) : v = 0;
|
|
var x = Math.sqrt(g * g / (1 + q * q));
|
|
0 > n && (x = -x);
|
|
k += x;
|
|
l +=
|
|
q * x;
|
|
e ? a.lineTo(k, l) : a.moveTo(k, l);
|
|
r -= g;
|
|
p -= g;
|
|
if (0 !== v) {
|
|
t++;
|
|
if (t === s.length) {
|
|
z.xa(s);
|
|
return
|
|
}
|
|
p = s[t];
|
|
n = p[0];
|
|
q = p[1];
|
|
p = p[2];
|
|
g = v
|
|
} else e = !e
|
|
}
|
|
z.xa(s)
|
|
}
|
|
}
|
|
}
|
|
X.prototype.getDocumentPoint = X.prototype.fb = function(a, b) {
|
|
void 0 === b && (b = new N);
|
|
a.Be() && z.k("getDocumentPoint Spot must be a real, specific Spot, not: " + a.toString());
|
|
var c = this.Ga,
|
|
d = this.ub;
|
|
b.n(a.x * (c.width + d) - d / 2 + c.x + a.offsetX, a.y * (c.height + d) - d / 2 + c.y + a.offsetY);
|
|
this.ph.Cb(b);
|
|
return b
|
|
};
|
|
X.prototype.lk = function(a, b) {
|
|
var c = this.ab;
|
|
if (null === c || null === this.fill && null === this.stroke) return !1;
|
|
var d = c.vb,
|
|
e = this.ub / 2;
|
|
c.type !== mf || b || (e += 2);
|
|
var g = z.kg();
|
|
g.assign(d);
|
|
g.ag(e + 2, e + 2);
|
|
if (!g.Ma(a)) return z.dc(g), !1;
|
|
d = e + 1E-4;
|
|
if (c.type === mf) {
|
|
if (null === this.stroke) return !1;
|
|
d = (c.L - c.Ha) * (a.x - c.Ha) + (c.M - c.Da) * (a.y - c.Da);
|
|
if (0 > (c.Ha - c.L) * (a.x - c.L) + (c.Da - c.M) * (a.y - c.M) || 0 > d) return !1;
|
|
z.dc(g);
|
|
return te(c.Ha, c.Da, c.L, c.M, e, a.x, a.y)
|
|
}
|
|
if (c.type === nf) {
|
|
var h = c.Ha,
|
|
k = c.Da,
|
|
l = c.L,
|
|
m = c.M;
|
|
g.x = Math.min(h, l);
|
|
g.y = Math.min(k,
|
|
m);
|
|
g.width = Math.abs(l - h);
|
|
g.height = Math.abs(m - k);
|
|
if (null === this.fill) {
|
|
g.ag(-d, -d);
|
|
if (g.Ma(a)) return z.dc(g), !1;
|
|
g.ag(d, d)
|
|
}
|
|
null !== this.stroke && g.ag(e, e);
|
|
e = g.Ma(a);
|
|
z.dc(g);
|
|
return e
|
|
}
|
|
if (c.type === of) {
|
|
var h = c.Ha,
|
|
k = c.Da,
|
|
l = c.L,
|
|
m = c.M,
|
|
c = Math.min(h, l),
|
|
n = Math.min(k, m),
|
|
h = Math.abs(l - h) / 2,
|
|
k = Math.abs(m - k) / 2,
|
|
c = a.x - (c + h),
|
|
n = a.y - (n + k);
|
|
if (null === this.fill) {
|
|
h -= d;
|
|
k -= d;
|
|
if (0 >= h || 0 >= k || 1 >= c * c / (h * h) + n * n / (k * k)) return z.dc(g), !1;
|
|
h += d;
|
|
k += d
|
|
}
|
|
null !== this.stroke && (h += e, k += e);
|
|
z.dc(g);
|
|
return 0 >= h || 0 >= k ? !1 : 1 >= c * c / (h * h) + n * n / (k * k)
|
|
}
|
|
if (c.type ===
|
|
jf) return z.dc(g), null === this.fill ? Nf(c, a.x, a.y, e) : c.Ma(a, e, 1 < this.ub, b);
|
|
z.k("Unknown Geometry type: " + c.type);
|
|
return !1
|
|
};
|
|
X.prototype.Ip = function(a, b, c, d) {
|
|
var e = this.Aa,
|
|
g = this.Oe;
|
|
a = Math.max(a, 0);
|
|
b = Math.max(b, 0);
|
|
var h;
|
|
if (this.Yh) h = this.Jl.vb;
|
|
else {
|
|
var k = this.Hb,
|
|
l = je[k];
|
|
if (void 0 === l) {
|
|
var m = so[k];
|
|
"string" === typeof m && (m = so[m]);
|
|
"function" === typeof m ? (l = m(null, 100, 100), je[k] = l) : z.k("Unsupported Figure: " + k)
|
|
}
|
|
h = l.vb
|
|
}
|
|
var k = h.width,
|
|
l = h.height,
|
|
m = h.width,
|
|
n = h.height;
|
|
switch (Mm(this, !0)) {
|
|
case $i:
|
|
d = c = 0;
|
|
break;
|
|
case lf:
|
|
m = Math.max(a - g, 0);
|
|
n = Math.max(b - g, 0);
|
|
break;
|
|
case Cm:
|
|
m = Math.max(a - g, 0);
|
|
d = 0;
|
|
break;
|
|
case Bm:
|
|
c = 0, n = Math.max(b - g, 0)
|
|
}
|
|
isFinite(e.width) &&
|
|
(m = e.width);
|
|
isFinite(e.height) && (n = e.height);
|
|
e = this.Xe;
|
|
h = this.cg;
|
|
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 = aj(this);
|
|
switch (c) {
|
|
case $i:
|
|
break;
|
|
case lf:
|
|
k = m;
|
|
l = n;
|
|
break;
|
|
case bj:
|
|
c = Math.min(m / k, n / l);
|
|
isFinite(c) || (c = 1);
|
|
k *= c;
|
|
l *= c;
|
|
break;
|
|
default:
|
|
z.k(c + " is not a valid geometryStretch.")
|
|
}
|
|
if (this.Yh) k = Math.max(k, .01), l = Math.max(l, .01), h = this.Jl, e = k, d = l, c = h.copy(), h = h.vb, e /= h.width,
|
|
d /= h.height, isFinite(e) || (e = 1), isFinite(d) || (d = 1), 1 === e && 1 === d || c.scale(e, d), this.ab = c;
|
|
else if (null === this.ab || this.ab.ro !== a - g || this.ab.po !== b - g) this.ab = X.makeGeometry(this, k, l);
|
|
h = this.ab.vb;
|
|
Infinity === a || Infinity === b ? Jm(this, h.x - g / 2, h.y - g / 2, 0 === a && 0 === k ? 0 : h.width + g, 0 === b && 0 === l ? 0 : h.height + g) : Jm(this, -(g / 2), -(g / 2), m + g, n + g)
|
|
};
|
|
|
|
function co(a, b, c, d) {
|
|
if (!1 !== ml(a)) {
|
|
a.ud.Wa();
|
|
var e = a.Oe;
|
|
0 === e && d instanceof da && d.type === Ki && d.fc instanceof X && (e = d.fc.ub);
|
|
e *= a.bc;
|
|
d instanceof G && null !== d.ab ? (b = d.ab.vb, Jm(a, b.x - e / 2, b.y - e / 2, b.width + e, b.height + e)) : Jm(a, -(e / 2), -(e / 2), b + e, c + e);
|
|
a.ud.freeze();
|
|
a.ud.F() || z.k("Non-real measuredBounds has been set. Object " + a + ", measuredBounds: " + a.ud.toString());
|
|
Yk(a, !1)
|
|
}
|
|
}
|
|
|
|
function aj(a) {
|
|
var b = a.Zz;
|
|
return a.Yh ? b === Am ? lf : b : b === Am ? je[a.Hb].Xd : b
|
|
}
|
|
X.prototype.$i = function(a, b, c, d) {
|
|
Nm(this, a, b, c, d)
|
|
};
|
|
X.prototype.getNearestIntersectionPoint = X.prototype.yE = function(a, b, c) {
|
|
return this.tp(a.x, a.y, b.x, b.y, c)
|
|
};
|
|
X.prototype.tp = function(a, b, c, d, e) {
|
|
var g = this.transform,
|
|
h = 1 / (g.m11 * g.m22 - g.m12 * g.m21),
|
|
k = g.m22 * h,
|
|
l = -g.m12 * h,
|
|
m = -g.m21 * h,
|
|
n = g.m11 * h,
|
|
p = h * (g.m21 * g.dy - g.m22 * g.dx),
|
|
q = h * (g.m12 * g.dx - g.m11 * g.dy),
|
|
g = a * k + b * m + p,
|
|
h = a * l + b * n + q,
|
|
k = c * k + d * m + p,
|
|
l = c * l + d * n + q,
|
|
m = this.ub / 2,
|
|
p = this.ab;
|
|
null === p && (rj(this, Infinity, Infinity), p = this.ab);
|
|
q = p.vb;
|
|
n = !1;
|
|
if (p.type === mf)
|
|
if (1.5 >= this.ub) n = Me(p.xc, p.Cc, p.zb, p.Gb, g, h, k, l, e);
|
|
else {
|
|
var r = 0,
|
|
s = 0;
|
|
p.xc === p.zb ? (r = m, s = 0) : (b = (p.Gb - p.Cc) / (p.zb - p.xc), s = m / Math.sqrt(1 + b * b), r = s * b);
|
|
d = z.rb();
|
|
b = new N;
|
|
Me(p.xc +
|
|
r, p.Cc + s, p.zb + r, p.Gb + s, g, h, k, l, b) && d.push(b);
|
|
b = new N;
|
|
Me(p.xc - r, p.Cc - s, p.zb - r, p.Gb - s, g, h, k, l, b) && d.push(b);
|
|
b = new N;
|
|
Me(p.xc + r, p.Cc + s, p.xc - r, p.Cc - s, g, h, k, l, b) && d.push(b);
|
|
b = new N;
|
|
Me(p.zb + r, p.Gb + s, p.zb - r, p.Gb - s, g, h, k, l, b) && d.push(b);
|
|
b = d.length;
|
|
if (0 === b) return z.xa(d), !1;
|
|
n = !0;
|
|
s = Infinity;
|
|
for (r = 0; r < b; r++) {
|
|
var k = d[r],
|
|
t = (k.x - g) * (k.x - g) + (k.y - h) * (k.y - h);
|
|
t < s && (s = t, e.x = k.x, e.y = k.y)
|
|
}
|
|
z.xa(d)
|
|
}
|
|
else if (p.type === nf) b = q.x - m, n = Ne(b, q.y - m, q.x + q.width + m, q.y + q.height + m, g, h, k, l, e);
|
|
else if (p.type === of) a: if (b = q.copy().ag(m,
|
|
m), 0 === b.width) n = Me(b.x, b.y, b.x, b.y + b.height, g, h, k, l, e);
|
|
else if (0 === b.height) n = Me(b.x, b.y, b.x + b.width, b.y, g, h, k, l, e);
|
|
else {
|
|
a = b.width / 2;
|
|
var v = b.height / 2;
|
|
d = b.x + a;
|
|
b = b.y + v;
|
|
c = 9999;
|
|
g !== k && (c = (h - l) / (g - k));
|
|
if (9999 > Math.abs(c)) {
|
|
n = h - b - c * (g - d);
|
|
if (0 > a * a * c * c + v * v - n * n) {
|
|
e.x = NaN;
|
|
e.y = NaN;
|
|
n = !1;
|
|
break a
|
|
}
|
|
m = Math.sqrt(a * a * c * c + v * v - n * n);
|
|
k = (-(a * a * c * n) + a * v * m) / (v * v + a * a * c * c) + d;
|
|
a = (-(a * a * c * n) - a * v * m) / (v * v + a * a * c * c) + d;
|
|
l = c * (k - d) + n + b;
|
|
b = c * (a - d) + n + b;
|
|
d = Math.abs((g - k) * (g - k)) + Math.abs((h - l) * (h - l));
|
|
h = Math.abs((g - a) * (g - a)) + Math.abs((h - b) * (h -
|
|
b));
|
|
d < h ? (e.x = k, e.y = l) : (e.x = a, e.y = b)
|
|
} else {
|
|
k = v * v;
|
|
l = g - d;
|
|
k -= k / (a * a) * l * l;
|
|
if (0 > k) {
|
|
e.x = NaN;
|
|
e.y = NaN;
|
|
n = !1;
|
|
break a
|
|
}
|
|
m = Math.sqrt(k);
|
|
l = b + m;
|
|
b -= m;
|
|
d = Math.abs(l - h);
|
|
h = Math.abs(b - h);
|
|
d < h ? (e.x = g, e.y = l) : (e.x = g, e.y = b)
|
|
}
|
|
n = !0
|
|
} else if (p.type === jf) {
|
|
var x = 0,
|
|
y = 0,
|
|
A = t = 0,
|
|
q = z.O(),
|
|
r = k - g,
|
|
s = l - h,
|
|
s = r * r + s * s;
|
|
e.x = k;
|
|
e.y = l;
|
|
for (r = 0; r < p.cc.count; r++)
|
|
for (var B = p.cc.o[r], L = B.Ab, x = B.Ha, y = B.Da, H = x, U = y, ea = 0; ea < L.count; ea++) {
|
|
var W = L.o[ea],
|
|
P = W.type,
|
|
t = W.L,
|
|
A = W.M,
|
|
ba = !1;
|
|
switch (P) {
|
|
case Df:
|
|
H = t;
|
|
U = A;
|
|
break;
|
|
case qf:
|
|
ba = to(x, y, t, A, g, h, k, l, q);
|
|
break;
|
|
case Ef:
|
|
var ba =
|
|
W.zc,
|
|
P = W.Qc,
|
|
Oa = W.Ah,
|
|
sa = W.Bh,
|
|
ba = Ke(x, y, ba, P, Oa, sa, t, A, g, h, k, l, .5, q);
|
|
break;
|
|
case Ff:
|
|
ba = (x + 2 * W.zc) / 3;
|
|
P = (y + 2 * W.Qc) / 3;
|
|
Oa = (2 * W.zc + t) / 3;
|
|
sa = (2 * W.zc + t) / 3;
|
|
ba = Ke(x, y, ba, P, Oa, sa, t, A, g, h, k, l, .5, q);
|
|
break;
|
|
case Gf:
|
|
case Hf:
|
|
P = W.type === Gf ? If(W, B) : Jf(W, B, x, y);
|
|
Oa = P.length;
|
|
if (0 === Oa) {
|
|
ba = to(x, y, W.ra, W.za, g, h, k, l, q);
|
|
break
|
|
}
|
|
for (A = 0; A < Oa; A++) v = P[A], 0 === A && to(x, y, v[0], v[1], g, h, k, l, q) && (t = uo(g, h, q, s, e), t < s && (s = t, n = !0)), Ke(v[0], v[1], v[2], v[3], v[4], v[5], v[6], v[7], g, h, k, l, .5, q) && (t = uo(g, h, q, s, e), t < s && (s = t, n = !0));
|
|
t = v[6];
|
|
A = v[7];
|
|
break;
|
|
default:
|
|
z.k("Unknown Segment type: " + P)
|
|
}
|
|
x = t;
|
|
y = A;
|
|
ba && (t = uo(g, h, q, s, e), t < s && (s = t, n = !0));
|
|
W.gx && (t = H, A = U, to(x, y, t, A, g, h, k, l, q) && (t = uo(g, h, q, s, e), t < s && (s = t, n = !0)))
|
|
}
|
|
g = c - a;
|
|
h = d - b;
|
|
b = Math.sqrt(g * g + h * h);
|
|
0 !== b && (g /= b, h /= b);
|
|
e.x -= g * m;
|
|
e.y -= h * m;
|
|
z.A(q)
|
|
} else z.k("Unknown Geometry type: " + p.type);
|
|
if (!n) return !1;
|
|
this.transform.Cb(e);
|
|
return !0
|
|
};
|
|
|
|
function uo(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 to(a, b, c, d, e, g, h, k, l) {
|
|
var m = !1,
|
|
n = (e - h) * (b - d) - (g - k) * (a - c);
|
|
if (0 === n) return !1;
|
|
l.x = ((e * k - g * h) * (a - c) - (e - h) * (a * d - b * c)) / n;
|
|
l.y = ((e * k - g * h) * (b - d) - (g - k) * (a * d - b * c)) / n;
|
|
(a > c ? a - c : c - a) < (b > d ? b - d : d - b) ? (e = b < d ? b : d, a = b < d ? d : b, (l.y > e || td(l.y, e)) && (l.y < a || td(l.y, a)) && (m = !0)) : (e = a < c ? a : c, a = a < c ? c : a, (l.x > e || td(l.x, e)) && (l.x < a || td(l.x, a)) && (m = !0));
|
|
return m
|
|
}
|
|
X.prototype.containedInRect = X.prototype.Ym = function(a, b) {
|
|
if (void 0 === b) return a.mk(this.W);
|
|
var c = this.ab;
|
|
null === c && (rj(this, Infinity, Infinity), c = this.ab);
|
|
var c = c.vb,
|
|
d = this.ub / 2,
|
|
e = !1,
|
|
g = z.O();
|
|
g.n(c.x - d, c.y - d);
|
|
a.Ma(b.Cb(g)) && (g.n(c.x - d, c.bottom + d), a.Ma(b.Cb(g)) && (g.n(c.right + d, c.bottom + d), a.Ma(b.Cb(g)) && (g.n(c.right + d, c.y - d), a.Ma(b.Cb(g)) && (e = !0))));
|
|
z.A(g);
|
|
return e
|
|
};
|
|
X.prototype.intersectsRect = X.prototype.Ig = function(a, b) {
|
|
if (this.Ym(a, b) || void 0 === b && (b = this.transform, a.mk(this.W))) return !0;
|
|
var c = z.Fh();
|
|
c.set(b);
|
|
c.fA();
|
|
var d = a.left,
|
|
e = a.right,
|
|
g = a.top,
|
|
h = a.bottom,
|
|
k = z.O();
|
|
k.n(d, g);
|
|
c.Cb(k);
|
|
if (this.lk(k, !0)) return z.A(k), !0;
|
|
k.n(e, g);
|
|
c.Cb(k);
|
|
if (this.lk(k, !0)) return z.A(k), !0;
|
|
k.n(d, h);
|
|
c.Cb(k);
|
|
if (this.lk(k, !0)) return z.A(k), !0;
|
|
k.n(e, h);
|
|
c.Cb(k);
|
|
if (this.lk(k, !0)) return z.A(k), !0;
|
|
var l = z.O(),
|
|
m = z.O();
|
|
c.set(b);
|
|
c.vA(this.transform);
|
|
c.fA();
|
|
l.x = e;
|
|
l.y = g;
|
|
l.transform(c);
|
|
k.x = d;
|
|
k.y =
|
|
g;
|
|
k.transform(c);
|
|
var n = !1;
|
|
vo(this, k, l, m) ? n = !0 : (k.x = e, k.y = h, k.transform(c), vo(this, k, l, m) ? n = !0 : (l.x = d, l.y = h, l.transform(c), vo(this, k, l, m) ? n = !0 : (k.x = d, k.y = g, k.transform(c), vo(this, k, l, m) && (n = !0))));
|
|
z.A(k);
|
|
z.jf(c);
|
|
z.A(l);
|
|
z.A(m);
|
|
return n
|
|
};
|
|
|
|
function vo(a, b, c, d) {
|
|
if (!a.yE(b, c, d)) return !1;
|
|
a = b.x;
|
|
b = b.y;
|
|
var e = c.x;
|
|
c = c.y;
|
|
var g = d.x;
|
|
d = d.y;
|
|
if (a === e) {
|
|
var h = 0;
|
|
a = 0;
|
|
b < c ? (h = b, a = c) : (h = c, a = b);
|
|
return d >= h && d <= a
|
|
}
|
|
a < e ? (h = a, a = e) : h = e;
|
|
return g >= h && g <= a
|
|
}
|
|
X.prototype.sE = function(a, b, c) {
|
|
function d(a, b) {
|
|
for (var c = a.length, d = 0; d < c; d += 2)
|
|
if (b.kp(a[d], a[d + 1]) > e) return !0;
|
|
return !1
|
|
}
|
|
if (c && null !== this.fill && this.lk(a, !0)) return !0;
|
|
var e = a.Af(b);
|
|
b = e;
|
|
1.5 < this.ub && (e = this.ub / 2 + Math.sqrt(e), e *= e);
|
|
var g = this.ab;
|
|
if (null === g && (rj(this, Infinity, Infinity), g = this.ab, null === g)) return !1;
|
|
if (!c) {
|
|
var h = g.vb,
|
|
k = h.x,
|
|
l = h.y,
|
|
m = h.x + h.width,
|
|
h = h.y + h.height;
|
|
if (wb(a.x, a.y, k, l) <= e && wb(a.x, a.y, m, l) <= e && wb(a.x, a.y, k, h) <= e && wb(a.x, a.y, m, h) <= e) return !0
|
|
}
|
|
k = g.xc;
|
|
l = g.Cc;
|
|
m = g.zb;
|
|
h = g.Gb;
|
|
if (g.type ===
|
|
mf) {
|
|
if (c = vb(a.x, a.y, k, l, m, h), g = (k - m) * (a.x - m) + (l - h) * (a.y - h), c <= (0 <= (m - k) * (a.x - k) + (h - l) * (a.y - l) && 0 <= g ? e : b)) return !0
|
|
} else {
|
|
if (g.type === nf) return b = !1, c && (b = vb(a.x, a.y, k, l, k, h) <= e || vb(a.x, a.y, k, l, m, l) <= e || vb(a.x, a.y, m, l, m, h) <= e || vb(a.x, a.y, k, h, m, h) <= e), b;
|
|
if (g.type === of) {
|
|
b = a.x - (k + m) / 2;
|
|
var g = a.y - (l + h) / 2,
|
|
n = Math.abs(m - k) / 2,
|
|
p = Math.abs(h - l) / 2;
|
|
if (0 === n || 0 === p) return c = vb(a.x, a.y, k, l, m, h), c <= e ? !0 : !1;
|
|
if (c) {
|
|
if (a = gf(n, p, b, g), a * a <= e) return !0
|
|
} else return wb(b, g, -n, 0) >= e || wb(b, g, 0, -p) >= e || wb(b, g, 0, p) >= e || wb(b, g, n, 0) >=
|
|
e ? !1 : !0
|
|
} else if (g.type === jf) {
|
|
h = g.vb;
|
|
k = h.x;
|
|
l = h.y;
|
|
m = h.x + h.width;
|
|
h = h.y + h.height;
|
|
if (a.x > m && a.x < k && a.y > h && a.y < l && vb(a.x, a.y, k, l, k, h) > e && vb(a.x, a.y, k, l, m, l) > e && vb(a.x, a.y, m, h, k, h) > e && vb(a.x, a.y, m, h, m, l) > e) return !1;
|
|
b = Math.sqrt(e);
|
|
if (c) {
|
|
if (null === this.fill ? Nf(g, a.x, a.y, b) : g.Ma(a, b, !0)) return !0
|
|
} else {
|
|
c = g.cc;
|
|
for (b = 0; b < c.count; b++) {
|
|
k = c.o[b];
|
|
n = k.Ha;
|
|
p = k.Da;
|
|
if (a.kp(n, p) > e) return !1;
|
|
l = k.Ab.o;
|
|
m = l.length;
|
|
for (h = 0; h < m; h++) {
|
|
var q = l[h];
|
|
switch (q.type) {
|
|
case Df:
|
|
case qf:
|
|
n = q.L;
|
|
p = q.M;
|
|
if (a.kp(n, p) > e) return !1;
|
|
break;
|
|
case Ef:
|
|
g = z.rb();
|
|
we(n, p, q.zc, q.Qc, q.Ah, q.Bh, q.L, q.M, .8, g);
|
|
n = d(g, a);
|
|
z.xa(g);
|
|
if (n) return !1;
|
|
n = q.L;
|
|
p = q.M;
|
|
if (a.kp(n, p) > e) return !1;
|
|
break;
|
|
case Ff:
|
|
g = z.rb();
|
|
Je(n, p, q.zc, q.Qc, q.L, q.M, .8, g);
|
|
n = d(g, a);
|
|
z.xa(g);
|
|
if (n) return !1;
|
|
n = q.L;
|
|
p = q.M;
|
|
if (a.kp(n, p) > e) return !1;
|
|
break;
|
|
case Gf:
|
|
case Hf:
|
|
var r = q.type === Gf ? If(q, k) : Jf(q, k, n, p),
|
|
s = r.length;
|
|
if (0 === s) {
|
|
n = q.ra;
|
|
p = q.za;
|
|
if (a.kp(n, p) > e) return !1;
|
|
break
|
|
}
|
|
q = null;
|
|
g = z.rb();
|
|
for (b = 0; b < s; b++)
|
|
if (q = r[b], g.length = 0, we(q[0], q[1], q[2], q[3], q[4], q[5], q[6], q[7], .8, g), d(g, a)) return z.xa(g), !1;
|
|
z.xa(g);
|
|
null !== q && (n =
|
|
q[6], p = q[7]);
|
|
break;
|
|
default:
|
|
z.k("Unknown Segment type: " + q.type)
|
|
}
|
|
}
|
|
}
|
|
return !0
|
|
}
|
|
}
|
|
}
|
|
return !1
|
|
};
|
|
z.defineProperty(X, {
|
|
Jl: "geometry"
|
|
}, function() {
|
|
return this.ab ? this.ab : this.Nn
|
|
}, function(a) {
|
|
var b = this.ab;
|
|
if (b !== a) {
|
|
null !== a ? (u && z.l(a, hf, X, "geometry"), this.Nn = this.ab = a.freeze()) : this.Nn = this.ab = null;
|
|
var c = this.ca;
|
|
null !== c && (c.Qj = NaN);
|
|
this.Yh = !0;
|
|
this.S();
|
|
this.j("geometry", b, a);
|
|
a = this.ca;
|
|
null !== a && 0 !== (this.ja & 1024) && Im(this, a, "geometryString")
|
|
}
|
|
});
|
|
z.defineProperty(X, {
|
|
LH: "geometryString"
|
|
}, function() {
|
|
return null === this.Jl ? "" : this.Jl.toString()
|
|
}, function(a) {
|
|
a = sf(a);
|
|
var b = a.normalize();
|
|
this.Jl = a;
|
|
this.position = a = z.Tb(-b.x, -b.y);
|
|
z.A(a)
|
|
});
|
|
z.defineProperty(X, {
|
|
ME: "isGeometryPositioned"
|
|
}, function() {
|
|
return this.ir
|
|
}, function(a) {
|
|
u && z.g(a, "boolean", X, "isGeometryPositioned");
|
|
var b = this.ir;
|
|
b !== a && (this.ir = a, this.S(), this.j("isGeometryPositioned", b, a))
|
|
});
|
|
X.prototype.Ae = function() {
|
|
this.ab = null;
|
|
this.S()
|
|
};
|
|
z.defineProperty(X, {
|
|
fill: "fill"
|
|
}, function() {
|
|
return this.Ad
|
|
}, function(a) {
|
|
var b = this.Ad;
|
|
b !== a && (u && null !== a && z.ot(a, "Shape.fill"), a instanceof Da && a.freeze(), this.Ad = a, this.ta(), this.j("fill", b, a))
|
|
});
|
|
z.defineProperty(X, {
|
|
stroke: "stroke"
|
|
}, function() {
|
|
return this.Kc
|
|
}, function(a) {
|
|
var b = this.Kc;
|
|
b !== a && (u && null !== a && z.ot(a, "Shape.stroke"), a instanceof Da && a.freeze(), this.Kc = a, this.ta(), this.j("stroke", b, a))
|
|
});
|
|
z.defineProperty(X, {
|
|
ub: "strokeWidth"
|
|
}, function() {
|
|
return this.Oe
|
|
}, function(a) {
|
|
var b = this.Oe;
|
|
if (b !== a)
|
|
if (u && z.p(a, X, "strokeWidth"), 0 <= a) {
|
|
this.Oe = a;
|
|
this.S();
|
|
var c = this.ca;
|
|
null !== c && (c.Qj = NaN);
|
|
this.j("strokeWidth", b, a)
|
|
} else z.ka(a, "value >= 0", X, "strokeWidth:value")
|
|
});
|
|
z.defineProperty(X, {
|
|
wL: "strokeCap"
|
|
}, function() {
|
|
return this.So
|
|
}, function(a) {
|
|
var b = this.So;
|
|
b !== a && ("string" !== typeof a || "butt" !== a && "round" !== a && "square" !== a ? z.ka(a, '"butt", "round", or "square"', X, "strokeCap") : (this.So = a, this.ta(), this.j("strokeCap", b, a)))
|
|
});
|
|
z.defineProperty(X, {
|
|
yL: "strokeJoin"
|
|
}, function() {
|
|
return this.Uo
|
|
}, function(a) {
|
|
var b = this.Uo;
|
|
b !== a && ("string" !== typeof a || "miter" !== a && "bevel" !== a && "round" !== a ? z.ka(a, '"miter", "bevel", or "round"', X, "strokeJoin") : (this.Uo = a, this.ta(), this.j("strokeJoin", b, a)))
|
|
});
|
|
z.defineProperty(X, {
|
|
zL: "strokeMiterLimit"
|
|
}, function() {
|
|
return this.Km
|
|
}, function(a) {
|
|
var b = this.Km;
|
|
if (b !== a)
|
|
if (u && z.p(a, X, "strokeMiterLimit"), 1 <= a) {
|
|
this.Km = a;
|
|
this.ta();
|
|
var c = this.ca;
|
|
null !== c && (c.Qj = NaN);
|
|
this.j("strokeMiterLimit", b, a)
|
|
} else z.ka(a, "value >= 1", X, "strokeWidth:value")
|
|
});
|
|
z.defineProperty(X, {
|
|
QF: "strokeDashArray"
|
|
}, function() {
|
|
return this.To
|
|
}, function(a) {
|
|
var b = this.To;
|
|
if (b !== a) {
|
|
null === a || Array.isArray(a) || z.ic(a, "Array", X, "strokeDashArray:value");
|
|
if (null !== a) {
|
|
for (var c = a.length, d = 0, e = 0; e < c; e++) {
|
|
var g = a[e];
|
|
"number" === typeof g && 0 <= g && isFinite(g) || z.k("strokeDashArray:value " + g + " at index " + e + " must be a positive number or zero.");
|
|
d += g
|
|
}
|
|
if (0 === d) {
|
|
if (null === b) return;
|
|
a = null
|
|
}
|
|
}
|
|
this.To = a;
|
|
this.ta();
|
|
this.j("strokeDashArray", b, a)
|
|
}
|
|
});
|
|
z.defineProperty(X, {
|
|
xL: "strokeDashOffset"
|
|
}, function() {
|
|
return this.ve
|
|
}, function(a) {
|
|
var b = this.ve;
|
|
b !== a && (u && z.p(a, X, "strokeDashOffset"), 0 <= a && (this.ve = a, this.ta(), this.j("strokeDashOffset", b, a)))
|
|
});
|
|
z.defineProperty(X, {
|
|
Hb: "figure"
|
|
}, function() {
|
|
return this.fo
|
|
}, function(a) {
|
|
var b = this.fo;
|
|
if (b !== a) {
|
|
u && z.g(a, "string", X, "figure");
|
|
var c = so[a];
|
|
"function" === typeof c ? c = a : (c = so[a.toLowerCase()]) || z.k("Unknown Shape.figure: " + a);
|
|
b !== c && (a = this.ca, null !== a && (a.Qj = NaN), this.fo = c, this.Yh = !1, this.Ae(), this.j("figure", b, c))
|
|
}
|
|
});
|
|
z.defineProperty(X, {
|
|
fq: "toArrow"
|
|
}, function() {
|
|
return this.Yo
|
|
}, function(a) {
|
|
var b = this.Yo;
|
|
!0 === a ? a = "Standard" : !1 === a && (a = "");
|
|
if (b !== a) {
|
|
u && z.g(a, "string", X, "toArrow");
|
|
var c = wo(a);
|
|
null === c ? z.k("Unknown Shape.toArrow: " + a) : b !== c && (this.Yo = c, this.Yh = !1, this.Ae(), xo(this), this.j("toArrow", b, c))
|
|
}
|
|
});
|
|
z.defineProperty(X, {
|
|
Xz: "fromArrow"
|
|
}, function() {
|
|
return this.ko
|
|
}, function(a) {
|
|
var b = this.ko;
|
|
!0 === a ? a = "Standard" : !1 === a && (a = "");
|
|
if (b !== a) {
|
|
u && z.g(a, "string", X, "fromArrow");
|
|
var c = wo(a);
|
|
null === c ? z.k("Unknown Shape.fromArrow: " + a) : b !== c && (this.ko = c, this.Yh = !1, this.Ae(), xo(this), this.j("fromArrow", b, c))
|
|
}
|
|
});
|
|
|
|
function xo(a) {
|
|
var b = a.h;
|
|
null !== b && b.pa.qb || (a.pu = yo, "None" !== a.Yo ? (a.De = -1, a.jk = ad) : "None" !== a.ko && (a.De = 0, a.jk = new Q(1 - ad.x, ad.y)))
|
|
}
|
|
z.defineProperty(X, {
|
|
C: "spot1"
|
|
}, function() {
|
|
return this.bi
|
|
}, function(a) {
|
|
z.l(a, Q, X, "spot1");
|
|
var b = this.bi;
|
|
b.N(a) || (this.bi = a = a.V(), this.S(), this.j("spot1", b, a))
|
|
});
|
|
z.defineProperty(X, {
|
|
D: "spot2"
|
|
}, function() {
|
|
return this.ci
|
|
}, function(a) {
|
|
z.l(a, Q, X, "spot2");
|
|
var b = this.ci;
|
|
b.N(a) || (this.ci = a = a.V(), this.S(), this.j("spot2", b, a))
|
|
});
|
|
z.defineProperty(X, {
|
|
Ic: "parameter1"
|
|
}, function() {
|
|
return this.bs
|
|
}, function(a) {
|
|
var b = this.bs;
|
|
b !== a && (this.bs = a, this.Ae(), this.j("parameter1", b, a))
|
|
});
|
|
z.defineProperty(X, {
|
|
gu: "parameter2"
|
|
}, function() {
|
|
return this.cs
|
|
}, function(a) {
|
|
var b = this.cs;
|
|
b !== a && (this.cs = a, this.Ae(), this.j("parameter2", b, a))
|
|
});
|
|
z.w(X, {
|
|
Ga: "naturalBounds"
|
|
}, function() {
|
|
if (null !== this.ab) return this.Wc.assign(this.ab.vb), this.Wc;
|
|
var a = this.Aa;
|
|
return new w(0, 0, a.width, a.height)
|
|
});
|
|
z.defineProperty(X, {
|
|
xx: "pathPattern"
|
|
}, function() {
|
|
return this.es
|
|
}, function(a) {
|
|
var b = this.es;
|
|
b !== a && (u && z.l(a, O, X, "pathPattern"), this.es = a, this.ta(), this.j("pathPattern", b, a))
|
|
});
|
|
z.defineProperty(X, {
|
|
mL: "pathObject"
|
|
}, function() {
|
|
return this.xx
|
|
}, function(a) {
|
|
this.xx = a
|
|
});
|
|
z.defineProperty(X, {
|
|
Zz: "geometryStretch"
|
|
}, function() {
|
|
return this.br
|
|
}, function(a) {
|
|
var b = this.br;
|
|
b !== a && (z.Ba(a, O, X, "geometryStretch"), this.br = a, this.j("geometryStretch", b, a))
|
|
});
|
|
z.defineProperty(X, {
|
|
interval: "interval"
|
|
}, function() {
|
|
return this.fr
|
|
}, function(a) {
|
|
var b = this.fr;
|
|
u && z.p(a, X, "interval");
|
|
a = Math.floor(a);
|
|
b !== a && 0 <= a && (this.fr = a, null !== this.h && hl(this.h), this.S(), this.j("interval", b, a))
|
|
});
|
|
X.makeGeometry = function(a, b, c) {
|
|
var d = a.Aa,
|
|
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);
|
|
b = null;
|
|
"None" !== a.fq ? b = ke[a.fq] : "None" !== a.Xz ? b = ke[a.Xz] : (c = so[a.Hb], "string" === typeof c && (c = so[c]), void 0 === c && z.k("Unknown Shape.figure: " + a.Hb), b = c(a, e, d), b.ro = e, b.po = d);
|
|
null === b && (c = so.Rectangle, "function" === typeof c && (b = c(a, e, d)));
|
|
return b
|
|
};
|
|
X.getFigureGenerators = function() {
|
|
var a = new na("string", "function"),
|
|
b;
|
|
for (b in so)
|
|
if (b !== b.toLowerCase()) {
|
|
var c = so[b];
|
|
"function" === typeof c && a.add(b, c)
|
|
}
|
|
a.freeze();
|
|
return a
|
|
};
|
|
X.defineFigureGenerator = function(a, b) {
|
|
z.g(a, "string", X, "defineFigureGenerator:name");
|
|
"string" === typeof b ? "" !== b && so[b] || z.k("Shape.defineFigureGenerator synonym must not be empty or None or not a defined figure name: " + b) : z.g(b, "function", X, "defineFigureGenerator:func");
|
|
var c = a.toLowerCase();
|
|
"" !== a && "none" !== c && a !== c || z.k("Shape.defineFigureGenerator name must not be empty or None or all-lower-case: " + a);
|
|
so[a] = b;
|
|
so[c] = a
|
|
};
|
|
X.getArrowheadGeometries = function() {
|
|
var a = new na("string", hf),
|
|
b;
|
|
for (b in ke)
|
|
if (b !== b.toLowerCase()) {
|
|
var c = ke[b];
|
|
c instanceof hf && a.add(b, c)
|
|
}
|
|
a.freeze();
|
|
return a
|
|
};
|
|
X.defineArrowheadGeometry = function(a, b) {
|
|
z.g(a, "string", X, "defineArrowheadGeometry:name");
|
|
var c = null;
|
|
"string" === typeof b ? (z.g(b, "string", X, "defineArrowheadGeometry:pathstr"), c = sf(b, !1)) : (z.l(b, hf, X, "defineArrowheadGeometry:pathstr"), c = b);
|
|
var d = a.toLowerCase();
|
|
"" !== a && "none" !== d && a !== d || z.k("Shape.defineArrowheadGeometry name must not be empty or None or all-lower-case: " + a);
|
|
ke[a] = c;
|
|
ke[d] = a
|
|
};
|
|
|
|
function qa() {
|
|
O.call(this);
|
|
this.we = "";
|
|
this.Kc = "black";
|
|
this.Nh = "13px sans-serif";
|
|
this.Mm = "start";
|
|
this.kr = !0;
|
|
this.lm = this.mm = !1;
|
|
this.ll = zo;
|
|
this.Qm = Ao;
|
|
this.Jv = this.Le = 0;
|
|
this.jo = this.Zy = this.$y = null;
|
|
this.Nj = new Bo;
|
|
this.Wq = !1;
|
|
this.uf = this.nl = this.Us = null;
|
|
this.ak = this.$j = 0;
|
|
this.Li = Infinity;
|
|
this.Ev = 0
|
|
}
|
|
z.Qa(qa, O);
|
|
z.ia("TextBlock", qa);
|
|
var Co = new ma,
|
|
Do = 0,
|
|
Eo = new ma,
|
|
Fo = 0,
|
|
Go = "...",
|
|
Ho = "",
|
|
Io = (new la(null)).yl;
|
|
qa.getEllipsis = function() {
|
|
return Go
|
|
};
|
|
qa.setEllipsis = function(a) {
|
|
Go = a;
|
|
Eo = new ma;
|
|
Fo = 0
|
|
};
|
|
qa.prototype.cloneProtected = function(a) {
|
|
O.prototype.cloneProtected.call(this, a);
|
|
a.we = this.we;
|
|
a.Kc = this.Kc;
|
|
a.Nh = this.Nh;
|
|
a.Mm = this.Mm;
|
|
a.kr = this.kr;
|
|
a.mm = this.mm;
|
|
a.lm = this.lm;
|
|
a.ll = this.ll;
|
|
a.Qm = this.Qm;
|
|
a.Le = this.Le;
|
|
a.Jv = this.Jv;
|
|
a.$y = this.$y;
|
|
a.Zy = this.Zy;
|
|
a.jo = this.jo;
|
|
a.Nj.tt(this.Nj);
|
|
a.Wq = this.Wq;
|
|
a.Us = this.Us;
|
|
a.nl = this.nl;
|
|
a.uf = this.uf;
|
|
a.$j = this.$j;
|
|
a.ak = this.ak;
|
|
a.Li = this.Li;
|
|
a.Ev = this.Ev
|
|
};
|
|
qa.prototype.toString = function() {
|
|
return 22 < this.we.length ? 'TextBlock("' + this.we.substring(0, 20) + '"...)' : 'TextBlock("' + this.we + '")'
|
|
};
|
|
var Jo;
|
|
qa.None = Jo = z.s(qa, "None", 0);
|
|
var Ko;
|
|
qa.WrapFit = Ko = z.s(qa, "WrapFit", 1);
|
|
var Ao;
|
|
qa.WrapDesiredSize = Ao = z.s(qa, "WrapDesiredSize", 2);
|
|
var zo;
|
|
qa.OverflowClip = zo = z.s(qa, "OverflowClip", 0);
|
|
var Lo;
|
|
qa.OverflowEllipsis = Lo = z.s(qa, "OverflowEllipsis", 1);
|
|
qa.prototype.S = function() {
|
|
O.prototype.S.call(this);
|
|
this.Zy = this.$y = null
|
|
};
|
|
z.defineProperty(qa, {
|
|
font: "font"
|
|
}, function() {
|
|
return this.Nh
|
|
}, function(a) {
|
|
var b = this.Nh;
|
|
b !== a && (u && (z.g(a, "string", qa, "font"), Mo(a) || z.k('Not a valid font: "' + a + '"')), this.Nh = a, this.jo = null, this.S(), this.j("font", b, a))
|
|
});
|
|
var Mo;
|
|
qa.isValidFont = Mo = function(a) {
|
|
var b = Io.font;
|
|
if (a === b || "10px sans-serif" === a) return !0;
|
|
Io.font = "10px sans-serif";
|
|
var c;
|
|
Io.font = a;
|
|
var d = Io.font;
|
|
if ("10px sans-serif" !== d) return Io.font = b, !0;
|
|
Io.font = "19px serif";
|
|
c = Io.font;
|
|
Io.font = a;
|
|
d = Io.font;
|
|
Io.font = b;
|
|
return d !== c
|
|
};
|
|
z.defineProperty(qa, {
|
|
text: "text"
|
|
}, function() {
|
|
return this.we
|
|
}, function(a) {
|
|
var b = this.we;
|
|
a = null !== a && void 0 !== a ? a.toString() : "";
|
|
b !== a && (this.we = a, this.S(), this.j("text", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
textAlign: "textAlign"
|
|
}, function() {
|
|
return this.Mm
|
|
}, function(a) {
|
|
var b = this.Mm;
|
|
b !== a && (u && z.g(a, "string", qa, "textAlign"), "start" === a || "end" === a || "left" === a || "right" === a || "center" === a ? (this.Mm = a, this.ta(), this.j("textAlign", b, a)) : z.ka(a, '"start", "end", "left", "right", or "center"', qa, "textAlign"))
|
|
});
|
|
z.w(qa, {
|
|
Ga: "naturalBounds"
|
|
}, function() {
|
|
if (!this.Wc.F()) {
|
|
var a = No(this, this.we, this.Nj, 999999).width,
|
|
b = Oo(this, a, this.Nj),
|
|
c = this.Aa;
|
|
isNaN(c.width) || (a = c.width);
|
|
isNaN(c.height) || (b = c.height);
|
|
yb(this.Wc, a, b)
|
|
}
|
|
return this.Wc
|
|
});
|
|
z.defineProperty(qa, {
|
|
lx: "isMultiline"
|
|
}, function() {
|
|
return this.kr
|
|
}, function(a) {
|
|
var b = this.kr;
|
|
b !== a && (u && z.g(a, "boolean", qa, "isMultiline"), this.kr = a, this.S(), this.j("isMultiline", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
JK: "isUnderline"
|
|
}, function() {
|
|
return this.mm
|
|
}, function(a) {
|
|
var b = this.mm;
|
|
b !== a && (u && z.g(a, "boolean", qa, "isUnderline"), this.mm = a, this.ta(), this.j("isUnderline", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
IK: "isStrikethrough"
|
|
}, function() {
|
|
return this.lm
|
|
}, function(a) {
|
|
var b = this.lm;
|
|
b !== a && (u && z.g(a, "boolean", qa, "isStrikethrough"), this.lm = a, this.ta(), this.j("isStrikethrough", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
iG: "wrap"
|
|
}, function() {
|
|
return this.Qm
|
|
}, function(a) {
|
|
var b = this.Qm;
|
|
b !== a && (u && z.Ba(a, qa, qa, "wrap"), this.Qm = a, this.S(), this.j("wrap", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
overflow: "overflow"
|
|
}, function() {
|
|
return this.ll
|
|
}, function(a) {
|
|
var b = this.ll;
|
|
b !== a && (u && z.Ba(a, qa, qa, "overflow"), this.ll = a, this.S(), this.j("overflow", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
stroke: "stroke"
|
|
}, function() {
|
|
return this.Kc
|
|
}, function(a) {
|
|
var b = this.Kc;
|
|
b !== a && (u && null !== a && z.ot(a, "TextBlock.stroke"), a instanceof Da && a.freeze(), this.Kc = a, this.ta(), this.j("stroke", b, a))
|
|
});
|
|
z.w(qa, {
|
|
sI: "lineCount"
|
|
}, function() {
|
|
return this.Le
|
|
});
|
|
z.defineProperty(qa, {
|
|
Sz: "editable"
|
|
}, function() {
|
|
return this.Wq
|
|
}, function(a) {
|
|
var b = this.Wq;
|
|
b !== a && (u && z.g(a, "boolean", qa, "editable"), this.Wq = a, this.j("editable", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
SF: "textEditor"
|
|
}, function() {
|
|
return this.Us
|
|
}, function(a) {
|
|
var b = this.Us;
|
|
b !== a && (a instanceof HTMLElement || z.k("textEditor must be an HTMLElement, not: " + a), this.Us = a, this.j("textEditor", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
Uz: "errorFunction"
|
|
}, function() {
|
|
return this.uf
|
|
}, function(a) {
|
|
var b = this.uf;
|
|
b !== a && (null !== a && z.g(a, "function", qa, "errorFunction"), this.uf = a, this.j("errorFunction", b, a))
|
|
});
|
|
qa.prototype.nk = function(a, b) {
|
|
if (null !== this.Kc && 0 !== this.we.length && null !== this.Nh) {
|
|
var c = this.Ga.width,
|
|
d = Po(this);
|
|
a.textAlign = this.Mm;
|
|
Um(this, a, this.Kc, !0, !1);
|
|
(this.mm || this.lm) && Um(this, a, this.Kc, !1, !1);
|
|
var e = this.Nj,
|
|
g = 0,
|
|
h = !1,
|
|
k = z.Tb(0, 0);
|
|
this.ph.Cb(k);
|
|
var l = z.Tb(0, d);
|
|
this.ph.Cb(l);
|
|
var m = k.Af(l);
|
|
z.A(k);
|
|
z.A(l);
|
|
k = b.scale;
|
|
8 > m * k * k && (h = !0);
|
|
b.gd !== a && (h = !1);
|
|
!1 === b.hj("textGreeking") && (h = !1);
|
|
for (var m = b.mr, k = this.$j, l = this.ak, n = this.Le, p = 0; p < n; p++) {
|
|
var q = e.sf[p],
|
|
r = e.Je[p];
|
|
q > c && (q = c);
|
|
var g = g + k,
|
|
s = r,
|
|
r = a,
|
|
t = g,
|
|
v = c,
|
|
x = d,
|
|
y = 0,
|
|
A = this.Mm;
|
|
"start" === A && (A = m ? "right" : "left");
|
|
"end" === A && (A = m ? "left" : "right");
|
|
h ? ("left" === A ? y = 0 : "right" === A ? y = v - q : "center" === A && (y = (v - q) / 2), r.fillRect(0 + y, t + .25 * x, q, 1)) : ("left" === A ? y = 0 : "right" === A ? y = v : "center" === A && (y = v / 2), r.fillText(s, 0 + y, t + x - .25 * x), s = x / 20 | 0, 0 === s && (s = 1), "right" === A ? y -= q : "center" === A && (y -= q / 2), this.mm && (r.beginPath(), r.lineWidth = s, r.moveTo(0 + y, t + x - .2 * x), r.lineTo(0 + y + q, t + x - .2 * x), r.stroke()), this.lm && (r.beginPath(), r.lineWidth = s, t = t + x - x / 2.2 | 0, 0 !== s % 2 && (t += .5), r.moveTo(0 +
|
|
y, t), r.lineTo(0 + y + q, t), r.stroke()));
|
|
g += d + l
|
|
}
|
|
}
|
|
};
|
|
qa.prototype.Ip = function(a, b, c, d) {
|
|
this.Ev = a;
|
|
var e = this.Nj;
|
|
e.reset();
|
|
var g = 0,
|
|
h = 0;
|
|
if (isNaN(this.Aa.width)) {
|
|
g = this.we.replace(/\r\n/g, "\n").replace(/\r/g, "\n");
|
|
if (0 === g.length) g = 0;
|
|
else if (this.lx) {
|
|
for (var k = h = 0, l = !1; !l;) {
|
|
var m = g.indexOf("\n", k); - 1 === m && (m = g.length, l = !0);
|
|
k = Qo(g.substr(k, m - k).replace(/^\s+|\s+$/g, ""), this.Nh);
|
|
k > h && (h = k);
|
|
k = m + 1
|
|
}
|
|
g = h
|
|
} else h = g.indexOf("\n", 0), 0 <= h && (g = g.substr(0, h)), g = k = Qo(g, this.Nh);
|
|
g = Math.min(g, a / this.scale);
|
|
g = Math.max(8, g)
|
|
} else g = this.Aa.width;
|
|
null !== this.U && (g = Math.min(g,
|
|
this.U.Xe.width), g = Math.max(g, this.U.cg.width));
|
|
h = Oo(this, g, e);
|
|
m = h = isNaN(this.Aa.height) ? Math.min(h, b / this.scale) : this.Aa.height;
|
|
if (0 !== e.cf && 1 !== e.Je.length && this.ll === Lo && (b = this.Nh, l = this.ll === Lo ? Ro(b) : 0, k = this.$j + this.ak, k = Math.max(0, Po(this) + k), m = Math.min(this.AI - 1, Math.max(Math.floor(m / k + .01) - 1, 0)), !(m + 1 >= e.Je.length))) {
|
|
k = e.Je[m];
|
|
for (a = Math.max(1, a - l); Qo(k, b) > a && 1 < k.length;) k = k.substr(0, k.length - 1);
|
|
k += Go;
|
|
a = Qo(k, b);
|
|
e.Je[m] = k;
|
|
e.Je = e.Je.slice(0, m + 1);
|
|
e.sf[m] = a;
|
|
e.sf = e.sf.slice(0, m + 1);
|
|
e.Zi = e.Je.length;
|
|
e.cf = Math.max(e.cf, a);
|
|
this.Le = e.Zi
|
|
}
|
|
if (this.iG === Ko || isNaN(this.Aa.width)) g = e.cf, isNaN(this.Aa.width) && (g = Math.max(8, g));
|
|
g = Math.max(c, g);
|
|
h = Math.max(d, h);
|
|
yb(this.Wc, g, h);
|
|
Jm(this, 0, 0, g, h)
|
|
};
|
|
qa.prototype.$i = function(a, b, c, d) {
|
|
Nm(this, a, b, c, d)
|
|
};
|
|
|
|
function No(a, b, c, d) {
|
|
b = b.replace(/^\s+|\s+$/g, "");
|
|
var e = 0,
|
|
g = 0,
|
|
h = 0,
|
|
k = a.Nh,
|
|
g = a.$j + a.ak,
|
|
l = Math.max(0, Po(a) + g),
|
|
h = a.ll === Lo ? Ro(k) : 0;
|
|
if (a.Le >= a.Li) return new Ea(0, l);
|
|
if (a.Qm === Jo) {
|
|
c.Zi = 1;
|
|
g = Qo(b, k);
|
|
if (0 === h || g <= d) return c.cf = g, c.sf.push(c.cf), c.Je.push(b), new Ea(g, l);
|
|
var m = So(b);
|
|
b = b.substr(m.length);
|
|
for (var n = So(b), g = Qo(m + n, k); 0 < n.length && g <= d;) m += n, b = b.substr(n.length), n = So(b), g = Qo((m + n).replace(/^\s+|\s+$/g, ""), k);
|
|
m += n.replace(/^\s+|\s+$/g, "");
|
|
for (d = Math.max(1, d - h); Qo(m, k) > d && 1 < m.length;) m = m.substr(0,
|
|
m.length - 1);
|
|
m += Go;
|
|
h = Qo(m, k);
|
|
c.sf.push(h);
|
|
c.cf = h;
|
|
c.Je.push(m);
|
|
return new Ea(h, l)
|
|
}
|
|
var p = 0;
|
|
0 === b.length && (p = 1, c.sf.push(0), c.Je.push(b));
|
|
for (; 0 < b.length;) {
|
|
m = So(b);
|
|
for (b = b.substr(m.length); Qo(m, k) > d;) {
|
|
n = 1;
|
|
g = Qo(m.substr(0, n), k);
|
|
for (h = 0; g <= d;) n++, h = g, g = Qo(m.substr(0, n), k);
|
|
1 === n ? (c.sf[a.Le + p] = g, e = Math.max(e, g)) : (c.sf[a.Le + p] = h, e = Math.max(e, h));
|
|
n--;
|
|
1 > n && (n = 1);
|
|
c.Je[a.Le + p] = m.substr(0, n);
|
|
p++;
|
|
m = m.substr(n);
|
|
if (a.Le + p > a.Li) break
|
|
}
|
|
n = So(b);
|
|
for (g = Qo(m + n, k); 0 < n.length && g <= d;) m += n, b = b.substr(n.length), n = So(b), g = Qo((m +
|
|
n).replace(/^\s+|\s+$/g, ""), k);
|
|
m = m.replace(/^\s+|\s+$/g, "");
|
|
if ("" !== m && (0 === n.length ? (c.sf.push(g), e = Math.max(e, g)) : (h = Qo(m, k), c.sf.push(h), e = Math.max(e, h)), c.Je.push(m), p++, a.Le + p > a.Li)) break
|
|
}
|
|
c.Zi = Math.min(a.Li, p);
|
|
c.cf = Math.max(c.cf, e);
|
|
return new Ea(c.cf, l * c.Zi)
|
|
}
|
|
|
|
function So(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 Qo(a, b) {
|
|
Ho !== b && (Ho = Io.font = b);
|
|
return Io.measureText(a).width
|
|
}
|
|
|
|
function Po(a) {
|
|
if (null !== a.jo) return a.jo;
|
|
var b = a.Nh;
|
|
Ho !== b && (Ho = Io.font = b);
|
|
var c = 0;
|
|
void 0 !== Co[b] && 5E3 > Do ? c = Co[b] : (c = 1.3 * Io.measureText("M").width, Co[b] = c, Do++);
|
|
return a.jo = c
|
|
}
|
|
|
|
function Ro(a) {
|
|
Ho !== a && (Ho = Io.font = a);
|
|
var b = 0;
|
|
void 0 !== Eo[a] && 5E3 > Fo ? b = Eo[a] : (b = Io.measureText(Go).width, Eo[a] = b, Fo++);
|
|
return b
|
|
}
|
|
|
|
function Oo(a, b, c) {
|
|
var d = a.we.replace(/\r\n/g, "\n").replace(/\r/g, "\n"),
|
|
e = a.$j + a.ak,
|
|
e = Math.max(0, Po(a) + e);
|
|
if (0 === d.length) return c.cf = 0, a.Le = 1, e;
|
|
if (!a.lx) {
|
|
var g = d.indexOf("\n", 0);
|
|
0 <= g && (d = d.substr(0, g))
|
|
}
|
|
for (var g = 0, h = a.Le = 0, k = -1, l = !1; !l;) k = d.indexOf("\n", h), -1 === k && (k = d.length, l = !0), h <= k && (h = d.substr(h, k - h), a.Qm !== Jo ? (c.Zi = 0, h = No(a, h, c, b), g += h.height, a.Le += c.Zi) : (No(a, h, c, b), g += e, a.Le++), a.Le === a.Li && (l = !0)), h = k + 1;
|
|
return a.Jv = g
|
|
}
|
|
z.defineProperty(qa, {
|
|
YA: "textValidation"
|
|
}, function() {
|
|
return this.nl
|
|
}, function(a) {
|
|
var b = this.nl;
|
|
b !== a && (null !== a && z.g(a, "function", qa, "textValidation"), this.nl = a, this.j("textValidation", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
tL: "spacingAbove"
|
|
}, function() {
|
|
return this.$j
|
|
}, function(a) {
|
|
var b = this.$j;
|
|
b !== a && (u && z.g(a, "number", qa, "spacingAbove"), this.$j = a, this.j("spacingAbove", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
uL: "spacingBelow"
|
|
}, function() {
|
|
return this.ak
|
|
}, function(a) {
|
|
var b = this.ak;
|
|
b !== a && (u && z.g(a, "number", qa, "spacingBelow"), this.ak = a, this.j("spacingBelow", b, a))
|
|
});
|
|
z.defineProperty(qa, {
|
|
AI: "maxLines"
|
|
}, function() {
|
|
return this.Li
|
|
}, function(a) {
|
|
var b = this.Li;
|
|
b !== a && (u && z.g(a, "number", qa, "maxLines"), a = Math.floor(a), 0 >= a && z.ka(a, "> 0", qa, "maxLines"), this.Li = a, this.j("maxLines", b, a), this.S())
|
|
});
|
|
z.w(qa, {
|
|
UK: "metrics"
|
|
}, function() {
|
|
return this.Nj
|
|
});
|
|
|
|
function Bo() {
|
|
this.cf = this.Zi = 0;
|
|
this.sf = [];
|
|
this.Je = []
|
|
}
|
|
Bo.prototype.reset = function() {
|
|
this.cf = this.Zi = 0;
|
|
this.sf = [];
|
|
this.Je = []
|
|
};
|
|
Bo.prototype.tt = function(a) {
|
|
this.Zi = a.Zi;
|
|
this.cf = a.cf;
|
|
this.sf = z.zl(a.sf);
|
|
this.Je = z.zl(a.Je)
|
|
};
|
|
z.w(Bo, {
|
|
cK: "arrSize"
|
|
}, function() {
|
|
return this.sf
|
|
});
|
|
z.w(Bo, {
|
|
dK: "arrText"
|
|
}, function() {
|
|
return this.Je
|
|
});
|
|
z.w(Bo, {
|
|
TK: "maxLineWidth"
|
|
}, function() {
|
|
return this.cf
|
|
});
|
|
|
|
function vk() {
|
|
O.call(this);
|
|
this.$e = null;
|
|
this.Ns = "";
|
|
this.Zj = ge;
|
|
this.mo = lf;
|
|
this.Vo = this.bk = this.uf = null;
|
|
this.Ry = !1;
|
|
this.ho = !0;
|
|
this.Mo = null
|
|
}
|
|
z.Qa(vk, O);
|
|
z.ia("Picture", vk);
|
|
vk.prototype.cloneProtected = function(a) {
|
|
O.prototype.cloneProtected.call(this, a);
|
|
a.element = this.$e;
|
|
a.Ns = this.Ns;
|
|
a.Zj = this.Zj.V();
|
|
a.mo = this.mo;
|
|
a.uf = this.uf;
|
|
a.bk = this.bk;
|
|
a.ho = this.ho;
|
|
a.Mo = this.Mo
|
|
};
|
|
var To = new ma,
|
|
Uo = 0,
|
|
pk = [];
|
|
|
|
function Vo() {
|
|
var a = pk;
|
|
if (0 === a.length)
|
|
for (var b = window.document.getElementsByTagName("canvas"), c = b.length, d = 0; d < c; d++) {
|
|
var e = b[d];
|
|
e.parentElement && e.parentElement.Z && a.push(e.parentElement.Z)
|
|
}
|
|
return a
|
|
}
|
|
var Wo;
|
|
vk.clearCache = Wo = function(a) {
|
|
void 0 === a && (a = "");
|
|
z.g(a, "string", vk, "clearCache:url");
|
|
"" !== a ? To[a] && (delete To[a], Uo--) : (To = new ma, Uo = 0)
|
|
};
|
|
vk.prototype.toString = function() {
|
|
return "Picture(" + this.source + ")#" + z.nd(this)
|
|
};
|
|
z.defineProperty(vk, {
|
|
element: "element"
|
|
}, function() {
|
|
return this.$e
|
|
}, function(a) {
|
|
var b = this.$e;
|
|
if (b !== a) {
|
|
null === a || a instanceof HTMLImageElement || a instanceof HTMLVideoElement || a instanceof HTMLCanvasElement || z.k("Picture.element must be an instance of Image, Canvas, or Video, not: " + a);
|
|
this.Ry = a instanceof HTMLCanvasElement;
|
|
this.$e = a;
|
|
if (null !== a)
|
|
if (!0 === a.complete || void 0 === a.complete) a.rv instanceof Event && null !== this.uf && this.uf(this, a.rv), !0 === a.Ty && null !== this.bk && this.bk(this, null), a.Ty = !0, this.Aa.F() ||
|
|
(Yk(this, !1), this.S());
|
|
else {
|
|
var c = this;
|
|
a.gC || (a.addEventListener("load", function(b) {
|
|
Xo(a, b);
|
|
c.Aa.F() || (Yk(c, !1), c.S())
|
|
}), a.addEventListener("error", function(b) {
|
|
Yo(a, b)
|
|
}), a.gC = !0)
|
|
}
|
|
this.j("element", b, a);
|
|
this.ta()
|
|
}
|
|
});
|
|
z.defineProperty(vk, {
|
|
source: "source"
|
|
}, function() {
|
|
return this.Ns
|
|
}, function(a) {
|
|
var b = this.Ns;
|
|
if (b !== a) {
|
|
z.g(a, "string", vk, "source");
|
|
this.Ns = a;
|
|
var c = To,
|
|
d = this.h;
|
|
if (void 0 !== c[a]) var e = c[a].bp[0].source;
|
|
else {
|
|
30 < Uo && (Wo(), c = To);
|
|
var e = z.createElement("img"),
|
|
g = this;
|
|
e.addEventListener("load", function(a) {
|
|
Xo(e, a);
|
|
g.Aa.F() || (Yk(g, !1), g.S())
|
|
});
|
|
e.addEventListener("error", function(a) {
|
|
Yo(e, a)
|
|
});
|
|
e.gC = !0;
|
|
e.src = a;
|
|
var h = this.Mo;
|
|
null !== h && (e.crossOrigin = h(this));
|
|
c[a] = new Zo(e);
|
|
Uo++
|
|
}
|
|
null !== d && Ul(d, this);
|
|
this.element = e;
|
|
null !== d && Tl(d, this);
|
|
this.S();
|
|
this.ta();
|
|
this.j("source", b, a)
|
|
}
|
|
});
|
|
|
|
function Xo(a, b) {
|
|
a.Ty = !0;
|
|
a.rv = !1;
|
|
for (var c = null, d = Vo(), e = d.length, g = 0; g < e; g++) {
|
|
var h = d[g],
|
|
k = h.Go.na(a.src);
|
|
if (null !== k)
|
|
for (e = k.length, g = 0; g < e; g++) c = k[g], h.SC.add(c), h.Ce(), null !== c.bk && c.bk(c, b)
|
|
}
|
|
}
|
|
|
|
function Yo(a, b) {
|
|
a.rv = b;
|
|
for (var c = null, d = Vo(), e = d.length, g = 0; g < e; g++)
|
|
if (c = d[g].Go.na(a.src), null !== c) {
|
|
for (var e = c.length, h = z.rb(), g = 0; g < e; g++) h.push(c[g]);
|
|
for (g = 0; g < e; g++) c = h[g], null !== c.uf && c.uf(c, b);
|
|
z.xa(h)
|
|
}
|
|
}
|
|
z.defineProperty(vk, {
|
|
sL: "sourceCrossOrigin"
|
|
}, function() {
|
|
return this.Mo
|
|
}, function(a) {
|
|
if (this.Mo !== a && (null !== a && z.g(a, "function", vk, "sourceCrossOrigin"), this.Mo = a, null !== this.element)) {
|
|
var b = this.element.src;
|
|
null === a && "string" === typeof b ? this.element.crossOrigin = null : null !== a && (this.element.crossOrigin = a(this))
|
|
}
|
|
});
|
|
z.defineProperty(vk, {
|
|
sj: "sourceRect"
|
|
}, function() {
|
|
return this.Zj
|
|
}, function(a) {
|
|
var b = this.Zj;
|
|
b.N(a) || (z.l(a, w, vk, "sourceRect"), this.Zj = a = a.V(), this.ta(), this.j("sourceRect", b, a))
|
|
});
|
|
z.defineProperty(vk, {
|
|
XH: "imageStretch"
|
|
}, function() {
|
|
return this.mo
|
|
}, function(a) {
|
|
var b = this.mo;
|
|
b !== a && (z.Ba(a, O, vk, "imageStretch"), this.mo = a, this.ta(), this.j("imageStretch", b, a))
|
|
});
|
|
z.defineProperty(vk, {
|
|
Uz: "errorFunction"
|
|
}, function() {
|
|
return this.uf
|
|
}, function(a) {
|
|
var b = this.uf;
|
|
b !== a && (null !== a && z.g(a, "function", vk, "errorFunction"), this.uf = a, this.j("errorFunction", b, a))
|
|
});
|
|
z.defineProperty(vk, {
|
|
CL: "successFunction"
|
|
}, function() {
|
|
return this.bk
|
|
}, function(a) {
|
|
var b = this.bk;
|
|
b !== a && (null !== a && z.g(a, "function", vk, "successFunction"), this.bk = a, this.j("successFunction", b, a))
|
|
});
|
|
vk.prototype.nk = function(a, b) {
|
|
var c = this.$e;
|
|
if (null !== c) {
|
|
var d = c.src;
|
|
null !== d && "" !== d || z.k('Element has no source ("src") attribute: ' + c);
|
|
if (!(c.rv instanceof Event) && !0 === c.Ty) {
|
|
var d = this.Ga,
|
|
e = 0,
|
|
g = 0,
|
|
h = this.Ry,
|
|
k = h ? +c.width : c.naturalWidth,
|
|
h = h ? +c.height : c.naturalHeight;
|
|
void 0 === k && c.videoWidth && (k = c.videoWidth);
|
|
void 0 === h && c.videoHeight && (h = c.videoHeight);
|
|
k = k || d.width;
|
|
h = h || d.height;
|
|
if (0 !== k && 0 !== h) {
|
|
var l = k,
|
|
m = h;
|
|
this.sj.F() && (e = this.Zj.x, g = this.Zj.y, k = this.Zj.width, h = this.Zj.height);
|
|
var n = k,
|
|
p = h,
|
|
q = this.mo;
|
|
switch (q) {
|
|
case $i:
|
|
if (this.sj.F()) break;
|
|
e += Math.max((n - d.width) / 2, 0);
|
|
g += Math.max((p - d.height) / 2, 0);
|
|
k = Math.min(d.width, n);
|
|
h = Math.min(d.height, p);
|
|
break;
|
|
case lf:
|
|
n = d.width;
|
|
p = d.height;
|
|
break;
|
|
case bj:
|
|
case cj:
|
|
var r = 0;
|
|
q === bj ? (r = Math.min(d.height / p, d.width / n), n *= r, p *= r) : q === cj && (r = Math.max(d.height / p, d.width / n), n *= r, p *= r, e += (n - d.width) / 2 / n * k, g += (p - d.height) / 2 / p * h, k *= 1 / (n / d.width), h *= 1 / (p / d.height), n = d.width, p = d.height)
|
|
}
|
|
var q = this.gj() * b.scale,
|
|
s = k * h / (n * q * p * q),
|
|
r = To[this.source],
|
|
q = null;
|
|
if (void 0 !== r && 16 < s) {
|
|
2 > r.bp.length &&
|
|
($o(r, 4, l, m), $o(r, 16, l, m));
|
|
for (var l = r.bp, m = l.length, q = l[0], t = 0; t < m; t++)
|
|
if (l[t].Rp * l[t].Rp < s) q = l[t];
|
|
else break
|
|
}
|
|
if (!b.bo) {
|
|
if (null === this.Vo)
|
|
if (null === this.$e) this.Vo = !1;
|
|
else {
|
|
l = (new la(null)).yl;
|
|
l.drawImage(this.$e, 0, 0);
|
|
try {
|
|
l.getImageData(0, 0, 1, 1).data[3] && (this.Vo = !1), this.Vo = !1
|
|
} catch (v) {
|
|
this.Vo = !0
|
|
}
|
|
}
|
|
if (this.Vo) return
|
|
}
|
|
if (b.hj("pictureRatioOptimization") && !b.Sy && void 0 !== r && null !== q && 1 !== q.Rp) {
|
|
a.save();
|
|
r = q.Rp;
|
|
try {
|
|
a.drawImage(q.source, e / r, g / r, Math.min(q.source.width, k / r), Math.min(q.source.height, h / r),
|
|
Math.max((d.width - n) / 2, 0), Math.max((d.height - p) / 2, 0), Math.min(d.width, n), Math.min(d.height, p))
|
|
} catch (x) {
|
|
u && this.ho && z.trace(x.toString()), this.ho = !1
|
|
}
|
|
a.restore()
|
|
} else try {
|
|
a.drawImage(c, e, g, k, h, Math.max((d.width - n) / 2, 0), Math.max((d.height - p) / 2, 0), Math.min(d.width, n), Math.min(d.height, p))
|
|
} catch (y) {
|
|
u && this.ho && z.trace(y.toString()), this.ho = !1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
z.w(vk, {
|
|
Ga: "naturalBounds"
|
|
}, function() {
|
|
return this.Wc
|
|
});
|
|
vk.prototype.Ip = function(a, b, c, d) {
|
|
var e = this.Aa,
|
|
g = Mm(this, !0),
|
|
h = this.$e,
|
|
k = this.Ry;
|
|
if (k || !this.Yy && h && h.complete) this.Yy = !0;
|
|
null === h && (isFinite(a) || (a = 0), isFinite(b) || (b = 0));
|
|
isFinite(e.width) || g === lf || g === Cm ? (isFinite(a) || (a = this.sj.F() ? this.sj.width : k ? +h.width : h.naturalWidth), c = 0) : null !== h && !1 !== this.Yy && (a = this.sj.F() ? this.sj.width : k ? +h.width : h.naturalWidth);
|
|
isFinite(e.height) || g === lf || g === Bm ? (isFinite(b) || (b = this.sj.F() ? this.sj.height : k ? +h.height : h.naturalHeight), d = 0) : null !== h && !1 !== this.Yy && (b =
|
|
this.sj.F() ? this.sj.height : k ? +h.height : h.naturalHeight);
|
|
isFinite(e.width) && (a = e.width);
|
|
isFinite(e.height) && (b = e.height);
|
|
e = this.Xe;
|
|
g = this.cg;
|
|
c = Math.max(c, g.width);
|
|
d = Math.max(d, g.height);
|
|
a = Math.min(e.width, a);
|
|
b = Math.min(e.height, b);
|
|
a = Math.max(c, a);
|
|
b = Math.max(d, b);
|
|
null === h || h.complete || (isFinite(a) || (a = 0), isFinite(b) || (b = 0));
|
|
yb(this.Wc, a, b);
|
|
Jm(this, 0, 0, a, b)
|
|
};
|
|
vk.prototype.$i = function(a, b, c, d) {
|
|
Nm(this, a, b, c, d)
|
|
};
|
|
|
|
function Zo(a) {
|
|
this.bp = [new ap(a, 1)]
|
|
}
|
|
|
|
function $o(a, b, c, d) {
|
|
var e = new la(null),
|
|
g = e.yl,
|
|
h = 1 / b;
|
|
e.width = c / b;
|
|
e.height = d / b;
|
|
b = new ap(e.Kd, b);
|
|
c = a.bp[a.bp.length - 1];
|
|
g.setTransform(h * c.Rp, 0, 0, h * c.Rp, 0, 0);
|
|
g.drawImage(c.source, 0, 0);
|
|
a.bp.push(b)
|
|
}
|
|
|
|
function ap(a, b) {
|
|
this.source = a;
|
|
this.Rp = b
|
|
}
|
|
|
|
function Ga() {
|
|
this.q = new hf;
|
|
this.$b = null
|
|
}
|
|
f = Ga.prototype;
|
|
f.reset = function() {
|
|
this.q = new hf;
|
|
this.$b = null
|
|
};
|
|
|
|
function R(a, b, c, d, e, g) {
|
|
null === a.q && z.k("StreamGeometryContext has been closed");
|
|
void 0 !== e && !0 === e ? (null === a.$b && z.k("Need to call beginFigure first"), d = new Of(Df), d.L = b, d.M = c, a.$b.Ab.add(d)) : (a.$b = new kf, a.$b.Ha = b, a.$b.Da = c, a.$b.Ot = d, a.q.cc.add(a.$b));
|
|
void 0 !== g && (a.$b.so = g)
|
|
}
|
|
|
|
function T(a) {
|
|
null === a.q && z.k("StreamGeometryContext has been closed");
|
|
null === a.$b && z.k("Need to call beginFigure first");
|
|
var b = a.$b.Ab.length;
|
|
0 < b && a.$b.Ab.ea(b - 1).close()
|
|
}
|
|
|
|
function Af(a) {
|
|
null === a.q && z.k("StreamGeometryContext has been closed");
|
|
null === a.$b && z.k("Need to call beginFigure first");
|
|
0 < a.$b.Ab.length && (a.$b.Ot = !0)
|
|
}
|
|
f.gb = function(a) {
|
|
null === this.q && z.k("StreamGeometryContext has been closed");
|
|
null === this.$b && z.k("Need to call beginFigure first");
|
|
this.$b.sk = a
|
|
};
|
|
f.moveTo = function(a, b, c) {
|
|
void 0 === c && (c = !1);
|
|
null === this.q && z.k("StreamGeometryContext has been closed");
|
|
null === this.$b && z.k("Need to call beginFigure first");
|
|
var d = new Of(Df);
|
|
d.L = a;
|
|
d.M = b;
|
|
c && d.close();
|
|
this.$b.Ab.add(d)
|
|
};
|
|
f.lineTo = function(a, b, c) {
|
|
void 0 === c && (c = !1);
|
|
null === this.q && z.k("StreamGeometryContext has been closed");
|
|
null === this.$b && z.k("Need to call beginFigure first");
|
|
var d = new Of(qf);
|
|
d.L = a;
|
|
d.M = b;
|
|
c && d.close();
|
|
this.$b.Ab.add(d)
|
|
};
|
|
|
|
function S(a, b, c, d, e, g, h, k) {
|
|
void 0 === k && (k = !1);
|
|
null === a.q && z.k("StreamGeometryContext has been closed");
|
|
null === a.$b && z.k("Need to call beginFigure first");
|
|
var l = new Of(Ef);
|
|
l.zc = b;
|
|
l.Qc = c;
|
|
l.Ah = d;
|
|
l.Bh = e;
|
|
l.L = g;
|
|
l.M = h;
|
|
k && l.close();
|
|
a.$b.Ab.add(l)
|
|
}
|
|
|
|
function yf(a, b, c, d, e) {
|
|
var g;
|
|
void 0 === g && (g = !1);
|
|
null === a.q && z.k("StreamGeometryContext has been closed");
|
|
null === a.$b && z.k("Need to call beginFigure first");
|
|
var h = new Of(Ff);
|
|
h.zc = b;
|
|
h.Qc = c;
|
|
h.L = d;
|
|
h.M = e;
|
|
g && h.close();
|
|
a.$b.Ab.add(h)
|
|
}
|
|
f.arcTo = function(a, b, c, d, e, g, h) {
|
|
void 0 === g && (g = 0);
|
|
void 0 === h && (h = !1);
|
|
null === this.q && z.k("StreamGeometryContext has been closed");
|
|
null === this.$b && z.k("Need to call beginFigure first");
|
|
var k = new Of(Gf);
|
|
k.Fe = a;
|
|
k.Lf = b;
|
|
k.ra = c;
|
|
k.za = d;
|
|
k.radiusX = e;
|
|
k.radiusY = 0 !== g ? g : e;
|
|
h && k.close();
|
|
this.$b.Ab.add(k)
|
|
};
|
|
|
|
function zf(a, b, c, d, e, g, h, k) {
|
|
var l;
|
|
void 0 === l && (l = !1);
|
|
null === a.q && z.k("StreamGeometryContext has been closed");
|
|
null === a.$b && z.k("Need to call beginFigure first");
|
|
b = new Of(Hf, h, k, b, c, d, e, g);
|
|
l && b.close();
|
|
a.$b.Ab.add(b)
|
|
}
|
|
|
|
function bp(a) {
|
|
a = cp(a);
|
|
var b = z.rb();
|
|
b[0] = a[0];
|
|
for (var c = 1, d = 1; d < a.length;) b[c] = a[d], b[c + 1] = a[d], b[c + 2] = a[d + 1], d += 2, c += 3;
|
|
z.xa(a);
|
|
return b
|
|
}
|
|
|
|
function cp(a) {
|
|
var b = dp(a),
|
|
c = z.rb(),
|
|
d = Math.floor(b.length / 2),
|
|
e = b.length - 1;
|
|
a = 0 === a % 2 ? 2 : 1;
|
|
for (var g = 0; g < e; g++) {
|
|
var h = b[g],
|
|
k = b[g + 1],
|
|
l = b[(d + g - 1) % e],
|
|
m = b[(d + g + a) % e];
|
|
c[2 * g] = h;
|
|
c[2 * g + 1] = Oe(h.x, h.y, l.x, l.y, k.x, k.y, m.x, m.y, new N)
|
|
}
|
|
c[c.length] = c[0];
|
|
z.xa(b);
|
|
return c
|
|
}
|
|
|
|
function dp(a) {
|
|
for (var b = z.rb(), c = 1.5 * Math.PI, d = 0, e = 0; e < a; e++) d = 2 * Math.PI / a * e + c, b[e] = new N(.5 + .5 * Math.cos(d), .5 + .5 * Math.sin(d));
|
|
b.push(b[0]);
|
|
return b
|
|
}
|
|
var so = {
|
|
None: "Rectangle",
|
|
Rectangle: function(a, b, c) {
|
|
a = new hf;
|
|
a.type = nf;
|
|
a.Ha = 0;
|
|
a.Da = 0;
|
|
a.L = b;
|
|
a.M = c;
|
|
return a
|
|
},
|
|
Square: function(a, b, c) {
|
|
a = new hf;
|
|
a.Xd = bj;
|
|
a.type = nf;
|
|
a.Ha = 0;
|
|
a.Da = 0;
|
|
a.L = Math.min(b, c);
|
|
a.M = Math.min(b, c);
|
|
return a
|
|
},
|
|
Ellipse: function(a, b, c) {
|
|
a = new hf;
|
|
a.type = of;
|
|
a.Ha = 0;
|
|
a.Da = 0;
|
|
a.L = b;
|
|
a.M = c;
|
|
a.C = he;
|
|
a.D = ie;
|
|
return a
|
|
},
|
|
Circle: function(a, b, c) {
|
|
a = new hf;
|
|
a.Xd = bj;
|
|
a.type = of;
|
|
a.Ha = 0;
|
|
a.Da = 0;
|
|
a.L = Math.min(b, c);
|
|
a.M = Math.min(b, c);
|
|
a.C = he;
|
|
a.D = ie;
|
|
return a
|
|
},
|
|
Connector: "Ellipse",
|
|
TriangleRight: function(a, b, c) {
|
|
a = new hf;
|
|
var d = new kf,
|
|
e = new Of;
|
|
e.L = b;
|
|
e.M = .5 * c;
|
|
d.Ab.add(e);
|
|
b = new Of;
|
|
b.L = 0;
|
|
b.M = c;
|
|
d.Ab.add(b.close());
|
|
a.cc.add(d);
|
|
a.C = new Q(0, .25);
|
|
a.D = new Q(.5, .75);
|
|
return a
|
|
},
|
|
TriangleDown: function(a, b, c) {
|
|
a = new hf;
|
|
var d = new kf,
|
|
e = new Of;
|
|
e.L = b;
|
|
e.M = 0;
|
|
d.Ab.add(e);
|
|
e = new Of;
|
|
e.L = .5 * b;
|
|
e.M = c;
|
|
d.Ab.add(e.close());
|
|
a.cc.add(d);
|
|
a.C = new Q(.25, 0);
|
|
a.D = new Q(.75, .5);
|
|
return a
|
|
},
|
|
TriangleLeft: function(a, b, c) {
|
|
a = new hf;
|
|
var d = new kf;
|
|
d.Ha = b;
|
|
d.Da = c;
|
|
var e = new Of;
|
|
e.L = 0;
|
|
e.M = .5 * c;
|
|
d.Ab.add(e);
|
|
c = new Of;
|
|
c.L = b;
|
|
c.M = 0;
|
|
d.Ab.add(c.close());
|
|
a.cc.add(d);
|
|
a.C = new Q(.5, .25);
|
|
a.D = new Q(1,
|
|
.75);
|
|
return a
|
|
},
|
|
TriangleUp: function(a, b, c) {
|
|
a = new hf;
|
|
var d = new kf;
|
|
d.Ha = b;
|
|
d.Da = c;
|
|
var e = new Of;
|
|
e.L = 0;
|
|
e.M = c;
|
|
d.Ab.add(e);
|
|
c = new Of;
|
|
c.L = .5 * b;
|
|
c.M = 0;
|
|
d.Ab.add(c.close());
|
|
a.cc.add(d);
|
|
a.C = new Q(.25, .5);
|
|
a.D = new Q(.75, 1);
|
|
return a
|
|
},
|
|
Line1: function(a, b, c) {
|
|
a = new hf;
|
|
a.type = mf;
|
|
a.Ha = 0;
|
|
a.Da = 0;
|
|
a.L = b;
|
|
a.M = c;
|
|
return a
|
|
},
|
|
Line2: function(a, b, c) {
|
|
a = new hf;
|
|
a.type = mf;
|
|
a.Ha = b;
|
|
a.Da = 0;
|
|
a.L = 0;
|
|
a.M = c;
|
|
return a
|
|
},
|
|
MinusLine: "LineH",
|
|
LineH: function(a, b, c) {
|
|
a = new hf;
|
|
a.type = mf;
|
|
a.Ha = 0;
|
|
a.Da = c / 2;
|
|
a.L = b;
|
|
a.M = c / 2;
|
|
return a
|
|
},
|
|
LineV: function(a, b, c) {
|
|
a = new hf;
|
|
a.type =
|
|
mf;
|
|
a.Ha = b / 2;
|
|
a.Da = 0;
|
|
a.L = b / 2;
|
|
a.M = c;
|
|
return a
|
|
},
|
|
BarH: "Rectangle",
|
|
BarV: "Rectangle",
|
|
Curve1: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
S(a, Hd * b, 0, 1 * b, (1 - Hd) * c, b, c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Curve2: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
S(a, 0, Hd * c, (1 - Hd) * b, c, b, c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Curve3: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, 0, !1);
|
|
S(a, 1 * b, Hd * c, Hd * b, 1 * c, 0, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Curve4: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, 0, !1);
|
|
S(a, (1 - Hd) * b, 0, 0, (1 - Hd) * c, 0, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Alternative: "Triangle",
|
|
Merge: "Triangle",
|
|
Triangle: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0 * c, !0);
|
|
a.lineTo(0 * b, 1 * c);
|
|
a.lineTo(1 * b, 1 * c, !0);
|
|
b = a.q;
|
|
b.C = new Q(.25, .5);
|
|
b.D = new Q(.75, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Decision: "Diamond",
|
|
Diamond: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !0);
|
|
a.lineTo(0, .5 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(1 * b, .5 * c, !0);
|
|
b = a.q;
|
|
b.C = new Q(.25, .25);
|
|
b.D = new Q(.75, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Pentagon: function(a, b, c) {
|
|
var d = dp(5);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 5 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.2, .22);
|
|
b.D = new Q(.8,
|
|
.9);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
DataTransmission: "Hexagon",
|
|
Hexagon: function(a, b, c) {
|
|
var d = dp(6);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 6 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.07, .25);
|
|
b.D = new Q(.93, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Heptagon: function(a, b, c) {
|
|
var d = dp(7);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 7 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.2, .15);
|
|
b.D = new Q(.8, .85);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Octagon: function(a, b, c) {
|
|
var d = dp(8);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 8 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.15, .15);
|
|
b.D = new Q(.85, .85);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Nonagon: function(a, b, c) {
|
|
var d = dp(9);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 9 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.17, .13);
|
|
b.D = new Q(.82, .82);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Decagon: function(a, b, c) {
|
|
var d = dp(10);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 10 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.16, .16);
|
|
b.D = new Q(.84, .84);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Dodecagon: function(a, b, c) {
|
|
var d = dp(12);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 12 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.16, .16);
|
|
b.D = new Q(.84, .84);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
FivePointedStar: function(a, b, c) {
|
|
var d = cp(5);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 10 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.312, .383);
|
|
b.D = new Q(.693, .765);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
SixPointedStar: function(a, b, c) {
|
|
var d = cp(6);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 12 > e; e++) a.lineTo(d[e].x *
|
|
b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.17, .251);
|
|
b.D = new Q(.833, .755);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
SevenPointedStar: function(a, b, c) {
|
|
var d = cp(7);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 14 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.363, .361);
|
|
b.D = new Q(.641, .709);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
EightPointedStar: function(a, b, c) {
|
|
var d = cp(8);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 16 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.252, .255);
|
|
b.D = new Q(.75, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
NinePointedStar: function(a,
|
|
b, c) {
|
|
var d = cp(9);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 18 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.355, .361);
|
|
b.D = new Q(.645, .651);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
TenPointedStar: function(a, b, c) {
|
|
var d = cp(10);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; 20 > e; e++) a.lineTo(d[e].x * b, d[e].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.281, .261);
|
|
b.D = new Q(.723, .748);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
FivePointedBurst: function(a, b, c) {
|
|
var d = bp(5);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; e < d.length; e += 3) S(a, d[e].x *
|
|
b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.312, .383);
|
|
b.D = new Q(.693, .765);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
SixPointedBurst: function(a, b, c) {
|
|
var d = bp(6);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; e < d.length; e += 3) S(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.17, .251);
|
|
b.D = new Q(.833, .755);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
SevenPointedBurst: function(a, b, c) {
|
|
var d = bp(7);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; e < d.length; e += 3) S(a, d[e].x *
|
|
b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.363, .361);
|
|
b.D = new Q(.641, .709);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
EightPointedBurst: function(a, b, c) {
|
|
var d = bp(8);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; e < d.length; e += 3) S(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.252, .255);
|
|
b.D = new Q(.75, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
NinePointedBurst: function(a, b, c) {
|
|
var d = bp(9);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; e < d.length; e += 3) S(a, d[e].x *
|
|
b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.355, .361);
|
|
b.D = new Q(.645, .651);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
TenPointedBurst: function(a, b, c) {
|
|
var d = bp(10);
|
|
a = z.v();
|
|
R(a, d[0].x * b, d[0].y * c, !0);
|
|
for (var e = 1; e < d.length; e += 3) S(a, d[e].x * b, d[e].y * c, d[e + 1].x * b, d[e + 1].y * c, d[e + 2].x * b, d[e + 2].y * c);
|
|
z.xa(d);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.281, .261);
|
|
b.D = new Q(.723, .748);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Cloud: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .08034461 * b, .1944299 * c, !0);
|
|
S(a, -.09239631 * b, .07836421 * c, .1406031 * b, -.0542823 * c, .2008615 *
|
|
b, .05349299 * c);
|
|
S(a, .2450511 * b, -.00697547 * c, .3776197 * b, -.01112067 * c, .4338609 * b, .074219 * c);
|
|
S(a, .4539471 * b, 0, .6066018 * b, -.02526587 * c, .6558228 * b, .07004196 * c);
|
|
S(a, .6914277 * b, -.01904177 * c, .8921095 * b, -.01220843 * c, .8921095 * b, .08370865 * c);
|
|
S(a, 1.036446 * b, .04105738 * c, 1.020377 * b, .3022052 * c, .9147671 * b, .3194596 * c);
|
|
S(a, 1.04448 * b, .360238 * c, .992256 * b, .5219009 * c, .9082935 * b, .562044 * c);
|
|
S(a, 1.032337 * b, .5771781 * c, 1.018411 * b, .8120651 * c, .9212406 * b, .8217117 * c);
|
|
S(a, 1.028411 * b, .9571472 * c, .8556702 * b, 1.052487 * c, .7592566 * b, .9156953 *
|
|
c);
|
|
S(a, .7431877 * b, 1.009325 * c, .5624123 * b, 1.021761 * c, .5101666 * b, .9310455 * c);
|
|
S(a, .4820677 * b, 1.031761 * c, .3030112 * b, 1.002796 * c, .2609328 * b, .9344623 * c);
|
|
S(a, .2329994 * b, 1.01518 * c, .03213784 * b, 1.01518 * c, .08034461 * b, .870098 * c);
|
|
S(a, -.02812061 * b, .9032597 * c, -.01205169 * b, .6835638 * c, .06829292 * b, .6545475 * c);
|
|
S(a, -.01812061 * b, .6089503 * c, -.00606892 * b, .4555777 * c, .06427569 * b, .4265613 * c);
|
|
S(a, -.01606892 * b, .3892545 * c, -.01205169 * b, .1944299 * c, .08034461 * b, .1944299 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.1, .1);
|
|
b.D = new Q(.9, .9);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Gate: "Crescent",
|
|
Crescent: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
S(a, 1 * b, 0, 1 * b, 1 * c, 0, 1 * c);
|
|
S(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.511, .19);
|
|
b.D = new Q(.776, .76);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
FramedRectangle: function(a, b, c) {
|
|
var d = z.v(),
|
|
e = a ? a.Ic : NaN;
|
|
a = a ? a.gu : NaN;
|
|
isNaN(e) && (e = .1);
|
|
isNaN(a) && (a = .1);
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0, 1 * c, !0);
|
|
R(d, e * b, a * c, !1, !0);
|
|
d.lineTo(e * b, (1 - a) * c);
|
|
d.lineTo((1 - e) * b, (1 - a) * c);
|
|
d.lineTo((1 - e) * b, a * c, !0);
|
|
b = d.q;
|
|
b.C = new Q(e, a);
|
|
b.D = new Q(1 - e, 1 - a);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
Delay: "HalfEllipse",
|
|
HalfEllipse: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
S(a, Hd * b, 0, 1 * b, (.5 - Hd / 2) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 + Hd / 2) * c, Hd * b, 1 * c, 0, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .2);
|
|
b.D = new Q(.75, .8);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Heart: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 1 * c, !0);
|
|
S(a, .1 * b, .8 * c, 0, .5 * c, 0 * b, .3 * c);
|
|
S(a, 0 * b, 0, .45 * b, 0, .5 * b, .3 * c);
|
|
S(a, .55 * b, 0, 1 * b, 0, 1 * b, .3 * c);
|
|
S(a, b, .5 * c, .9 * b, .8 * c, .5 * b, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.15, .29);
|
|
b.D = new Q(.86, .68);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Spade: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !0);
|
|
a.lineTo(.51 * b, .01 * c);
|
|
S(a, .6 * b, .2 * c, b, .25 * c, b, .5 * c);
|
|
S(a, b, .8 * c, .6 * b, .8 * c, .55 * b, .7 * c);
|
|
S(a, .5 * b, .75 * c, .55 * b, .95 * c, .75 * b, c);
|
|
a.lineTo(.25 * b, c);
|
|
S(a, .45 * b, .95 * c, .5 * b, .75 * c, .45 * b, .7 * c);
|
|
S(a, .4 * b, .8 * c, 0, .8 * c, 0, .5 * c);
|
|
S(a, 0, .25 * c, .4 * b, .2 * c, .49 * b, .01 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.19, .26);
|
|
b.D = new Q(.8, .68);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Club: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .4 * b, .6 * c, !0);
|
|
S(a, .5 * b, .75 * c, .45 * b, .95 * c, .15 * b, 1 * c);
|
|
a.lineTo(.85 * b, c);
|
|
S(a, .55 * b, .95 * c, .5 * b, .75 * c, .6 * b, .6 * c);
|
|
var d = .2,
|
|
e = .3,
|
|
g = 0,
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
S(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) *
|
|
b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
|
|
S(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e + .05) * b, (.5 - h + g - .02) * c, .65 * b, .36771243 * c);
|
|
d = .2;
|
|
e = 0;
|
|
g = -.3;
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
S(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 - d +
|
|
e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, .35 * b, .36771243 * c);
|
|
d = .2;
|
|
e = -.3;
|
|
g = 0;
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
S(a, (.5 + d + e - .05) * b, (.5 - h + g - .02) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
|
|
S(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, .4 * b, .6 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.06, .39);
|
|
b.D = new Q(.93, .58);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Ring: function(a, b, c) {
|
|
a = z.v();
|
|
var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
|
|
R(a, b, .5 *
|
|
c, !0);
|
|
S(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c);
|
|
S(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c);
|
|
d = 4 * (Math.SQRT2 - 1) / 3 * .4;
|
|
R(a, .5 * b, .1 * c, !0, !0);
|
|
S(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c);
|
|
S(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c);
|
|
S(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c);
|
|
S(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c);
|
|
b = a.q;
|
|
b.C = new Q(.146, .146);
|
|
b.D = new Q(.853, .853);
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
YinYang: function(a, b, c) {
|
|
var d = .5;
|
|
a = z.v();
|
|
d = .5;
|
|
R(a, .5 * b, 0, !0);
|
|
a.arcTo(270,
|
|
180, .5 * b, .5 * b, .5 * b);
|
|
S(a, 1 * b, d * c, 0, d * c, d * b, 0, !0);
|
|
var d = .1,
|
|
e = .25;
|
|
R(a, (.5 + d) * b, e * c, !0, !0);
|
|
a.arcTo(0, -360, .5 * b, c * e, d * b);
|
|
T(a);
|
|
R(a, .5 * b, 0, !1);
|
|
a.arcTo(270, -180, .5 * b, .5 * b, .5 * b);
|
|
a.gb(!1);
|
|
e = .75;
|
|
R(a, (.5 + d) * b, e * c, !0);
|
|
a.arcTo(0, 360, .5 * b, c * e, d * b);
|
|
T(a);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Peace: function(a, b, c) {
|
|
a = z.v();
|
|
var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
|
|
R(a, b, .5 * c, !0);
|
|
S(a, b, (.5 - d) * c, (.5 + d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 - d) * b, 0, 0, (.5 - d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 + d) * c, (.5 - d) * b, c, .5 * b, c);
|
|
S(a, (.5 + d) * b, c, b, (.5 + d) * c, b, .5 * c);
|
|
d = 4 * (Math.SQRT2 - 1) / 3 * .4;
|
|
R(a, .5 * b, .1 * c, !0, !0);
|
|
S(a, (.5 + d) * b, .1 * c, .9 * b, (.5 - d) * c, .9 * b, .5 * c);
|
|
S(a, .9 * b, (.5 + d) * c, (.5 + d) * b, .9 * c, .5 * b, .9 * c);
|
|
S(a, (.5 - d) * b, .9 * c, .1 * b, (.5 + d) * c, .1 * b, .5 * c);
|
|
S(a, .1 * b, (.5 - d) * c, (.5 - d) * b, .1 * c, .5 * b, .1 * c);
|
|
var d = .07,
|
|
e = 0,
|
|
g = -.707 * .11,
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
R(a, (.5 + d + e) * b, (.5 + g) * c, !0);
|
|
S(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
|
|
S(a, (.5 + h + e) * b, (.5 + d + g) *
|
|
c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
|
|
d = .07;
|
|
e = -.707 * .11;
|
|
g = .707 * .11;
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
R(a, (.5 + d + e) * b, (.5 + g) * c, !0);
|
|
S(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
|
|
S(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
|
|
d = .07;
|
|
e = .707 * .11;
|
|
g = .707 * .11;
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
R(a, (.5 + d + e) * b, (.5 + g) * c, !0);
|
|
S(a, (.5 + d + e) * b, (.5 - h +
|
|
g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
|
|
S(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
|
|
b = a.q;
|
|
b.C = new Q(.146, .146);
|
|
b.D = new Q(.853, .853);
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
NotAllowed: function(a, b, c) {
|
|
var d = .5 * Hd,
|
|
e = .5;
|
|
a = z.v();
|
|
R(a, .5 * b, (.5 - e) * c, !0);
|
|
S(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c);
|
|
S(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b,
|
|
(.5 + e) * c);
|
|
S(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c);
|
|
S(a, (.5 + e) * b, (.5 - d) * c, (.5 + d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
|
|
var e = .4,
|
|
d = .4 * Hd,
|
|
g = z.O(),
|
|
h = z.O(),
|
|
k = z.O(),
|
|
l = z.O();
|
|
xe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .42, g, h, k, l, l);
|
|
var m = z.O(),
|
|
n = z.O(),
|
|
p = z.O();
|
|
xe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .58, l, l, p, m, n);
|
|
var q = z.O(),
|
|
r = z.O(),
|
|
s = z.O();
|
|
xe(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .42, q, r, s, l, l);
|
|
var t = z.O(),
|
|
v = z.O(),
|
|
x = z.O();
|
|
xe(.5, .5 + e, .5 - d, .5 + e, .5 - e, .5 + d, .5 - e, .5, .58, l, l, x, t, v);
|
|
R(a, x.x * b, x.y * c, !0, !0);
|
|
S(a, t.x * b,
|
|
t.y * c, v.x * b, v.y * c, (.5 - e) * b, .5 * c);
|
|
S(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
|
|
S(a, g.x * b, g.y * c, h.x * b, h.y * c, k.x * b, k.y * c);
|
|
a.lineTo(x.x * b, x.y * c);
|
|
T(a);
|
|
R(a, s.x * b, s.y * c, !0, !0);
|
|
a.lineTo(p.x * b, p.y * c);
|
|
S(a, m.x * b, m.y * c, n.x * b, n.y * c, (.5 + e) * b, .5 * c);
|
|
S(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
|
|
S(a, q.x * b, q.y * c, r.x * b, r.y * c, s.x * b, s.y * c);
|
|
T(a);
|
|
z.A(g);
|
|
z.A(h);
|
|
z.A(k);
|
|
z.A(l);
|
|
z.A(m);
|
|
z.A(n);
|
|
z.A(p);
|
|
z.A(q);
|
|
z.A(r);
|
|
z.A(s);
|
|
z.A(t);
|
|
z.A(v);
|
|
z.A(x);
|
|
b = a.q;
|
|
z.u(a);
|
|
b.Xd = bj;
|
|
return b
|
|
},
|
|
Fragile: function(a, b, c) {
|
|
a = z.v();
|
|
R(a,
|
|
0, 0, !0);
|
|
a.lineTo(.25 * b, 0);
|
|
a.lineTo(.2 * b, .15 * c);
|
|
a.lineTo(.3 * b, .25 * c);
|
|
a.lineTo(.29 * b, .33 * c);
|
|
a.lineTo(.35 * b, .25 * c);
|
|
a.lineTo(.3 * b, .15 * c);
|
|
a.lineTo(.4 * b, 0);
|
|
a.lineTo(1 * b, 0);
|
|
S(a, 1 * b, .25 * c, .75 * b, .5 * c, .55 * b, .5 * c);
|
|
a.lineTo(.55 * b, .9 * c);
|
|
a.lineTo(.7 * b, .9 * c);
|
|
a.lineTo(.7 * b, 1 * c);
|
|
a.lineTo(.3 * b, 1 * c);
|
|
a.lineTo(.3 * b, .9 * c);
|
|
a.lineTo(.45 * b, .9 * c);
|
|
a.lineTo(.45 * b, .5 * c);
|
|
S(a, .25 * b, .5 * c, 0, .25 * c, 0, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.25, 0);
|
|
b.D = new Q(.75, .4);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
HourGlass: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .65 * b, .5 * c, !0);
|
|
a.lineTo(1 * b,
|
|
1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(.35 * b, .5 * c);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(1 * b, 0);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Lightning: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0 * b, .55 * c, !0);
|
|
a.lineTo(.75 * b, 0);
|
|
a.lineTo(.25 * b, .45 * c);
|
|
a.lineTo(.9 * b, .48 * c);
|
|
a.lineTo(.4 * b, 1 * c);
|
|
a.lineTo(.65 * b, .55 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Parallelogram1: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .1);
|
|
var d = z.v();
|
|
R(d, a * b, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo((1 - a) * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = new Q(a, 0);
|
|
b.D = new Q(1 - a, 1);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
Input: "Output",
|
|
Output: function(a,
|
|
b, c) {
|
|
a = z.v();
|
|
R(a, 0, 1 * c, !0);
|
|
a.lineTo(.1 * b, 0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(.9 * b, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.1, 0);
|
|
b.D = new Q(.9, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Parallelogram2: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .25);
|
|
var d = z.v();
|
|
R(d, a * b, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo((1 - a) * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = new Q(a, 0);
|
|
b.D = new Q(1 - a, 1);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
ThickCross: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .25);
|
|
var d = z.v();
|
|
R(d, (.5 - a / 2) * b, 0, !0);
|
|
d.lineTo((.5 + a / 2) * b, 0);
|
|
d.lineTo((.5 + a / 2) * b, (.5 - a / 2) * c);
|
|
d.lineTo(1 * b, (.5 -
|
|
a / 2) * c);
|
|
d.lineTo(1 * b, (.5 + a / 2) * c);
|
|
d.lineTo((.5 + a / 2) * b, (.5 + a / 2) * c);
|
|
d.lineTo((.5 + a / 2) * b, 1 * c);
|
|
d.lineTo((.5 - a / 2) * b, 1 * c);
|
|
d.lineTo((.5 - a / 2) * b, (.5 + a / 2) * c);
|
|
d.lineTo(0, (.5 + a / 2) * c);
|
|
d.lineTo(0, (.5 - a / 2) * c);
|
|
d.lineTo((.5 - a / 2) * b, (.5 - a / 2) * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = new Q(.5 - a / 2, .5 - a / 2);
|
|
b.D = new Q(.5 + a / 2, .5 + a / 2);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
ThickX: function(a, b, c) {
|
|
a = .25 / Math.SQRT2;
|
|
var d = z.v();
|
|
R(d, .3 * b, 0, !0);
|
|
d.lineTo(.5 * b, .2 * c);
|
|
d.lineTo(.7 * b, 0);
|
|
d.lineTo(1 * b, .3 * c);
|
|
d.lineTo(.8 * b, .5 * c);
|
|
d.lineTo(1 * b, .7 * c);
|
|
d.lineTo(.7 * b, 1 * c);
|
|
d.lineTo(.5 * b, .8 *
|
|
c);
|
|
d.lineTo(.3 * b, 1 * c);
|
|
d.lineTo(0, .7 * c);
|
|
d.lineTo(.2 * b, .5 * c);
|
|
d.lineTo(0, .3 * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = new Q(.5 - a, .5 - a);
|
|
b.D = new Q(.5 + a, .5 + a);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
ThinCross: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
isNaN(d) && (d = .1);
|
|
a = z.v();
|
|
R(a, (.5 - d / 2) * b, 0, !0);
|
|
a.lineTo((.5 + d / 2) * b, 0);
|
|
a.lineTo((.5 + d / 2) * b, (.5 - d / 2) * c);
|
|
a.lineTo(1 * b, (.5 - d / 2) * c);
|
|
a.lineTo(1 * b, (.5 + d / 2) * c);
|
|
a.lineTo((.5 + d / 2) * b, (.5 + d / 2) * c);
|
|
a.lineTo((.5 + d / 2) * b, 1 * c);
|
|
a.lineTo((.5 - d / 2) * b, 1 * c);
|
|
a.lineTo((.5 - d / 2) * b, (.5 + d / 2) * c);
|
|
a.lineTo(0, (.5 + d / 2) * c);
|
|
a.lineTo(0, (.5 - d / 2) * c);
|
|
a.lineTo((.5 -
|
|
d / 2) * b, (.5 - d / 2) * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
ThinX: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .1 * b, 0, !0);
|
|
a.lineTo(.5 * b, .4 * c);
|
|
a.lineTo(.9 * b, 0);
|
|
a.lineTo(1 * b, .1 * c);
|
|
a.lineTo(.6 * b, .5 * c);
|
|
a.lineTo(1 * b, .9 * c);
|
|
a.lineTo(.9 * b, 1 * c);
|
|
a.lineTo(.5 * b, .6 * c);
|
|
a.lineTo(.1 * b, 1 * c);
|
|
a.lineTo(0, .9 * c);
|
|
a.lineTo(.4 * b, .5 * c);
|
|
a.lineTo(0, .1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
RightTriangle: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .5);
|
|
b.D = new Q(.5, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
RoundedIBeam: function(a, b, c) {
|
|
a =
|
|
z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(1 * b, 0);
|
|
S(a, .5 * b, .25 * c, .5 * b, .75 * c, 1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
S(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
RoundedRectangle: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
isNaN(d) && (d = 5);
|
|
d = Math.min(d, b / 3);
|
|
d = Math.min(d, c / 3);
|
|
a = d * Hd;
|
|
var e = z.v();
|
|
R(e, d, 0, !0);
|
|
e.lineTo(b - d, 0);
|
|
S(e, b - a, 0, b, a, b, d);
|
|
e.lineTo(b, c - d);
|
|
S(e, b, c - a, b - a, c, b - d, c);
|
|
e.lineTo(d, c);
|
|
S(e, a, c, 0, c - a, 0, c - d);
|
|
e.lineTo(0, d);
|
|
S(e, 0, a, a, 0, d, 0);
|
|
T(e);
|
|
b = e.q;
|
|
1 < a ? (b.C = new Q(0, 0, a, a), b.D = new Q(1, 1, -a, -a)) : (b.C = Zb, b.D = ic);
|
|
z.u(e);
|
|
return b
|
|
},
|
|
Border: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
isNaN(d) && (d = 5);
|
|
d = Math.min(d, b / 3);
|
|
d = Math.min(d, c / 3);
|
|
a = z.v();
|
|
R(a, d, 0, !0);
|
|
a.lineTo(b - d, 0);
|
|
S(a, b - 0, 0, b, 0, b, d);
|
|
a.lineTo(b, c - d);
|
|
S(a, b, c - 0, b - 0, c, b - d, c);
|
|
a.lineTo(d, c);
|
|
S(a, 0, c, 0, c - 0, 0, c - d);
|
|
a.lineTo(0, d);
|
|
S(a, 0, 0, 0, 0, d, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = Zb;
|
|
b.D = ic;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
SquareIBeam: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
isNaN(d) && (d = .2);
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(1 * b, d * c);
|
|
a.lineTo((.5 + d / 2) * b, d * c);
|
|
a.lineTo((.5 + d / 2) * b, (1 - d) * c);
|
|
a.lineTo(1 * b, (1 - d) * c);
|
|
a.lineTo(1 * b, 1 *
|
|
c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, (1 - d) * c);
|
|
a.lineTo((.5 - d / 2) * b, (1 - d) * c);
|
|
a.lineTo((.5 - d / 2) * b, d * c);
|
|
a.lineTo(0, d * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Trapezoid: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .2);
|
|
var d = z.v();
|
|
R(d, a * b, 0, !0);
|
|
d.lineTo((1 - a) * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = new Q(a, 0);
|
|
b.D = new Q(1 - a, 1);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
ManualLoop: "ManualOperation",
|
|
ManualOperation: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
isNaN(d) && (d = 0);
|
|
a = z.v();
|
|
R(a, d, 0, !0);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(.9 * b, 1 * c);
|
|
a.lineTo(.1 *
|
|
b, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.1, 0);
|
|
b.D = new Q(.9, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
GenderMale: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .4 * Hd,
|
|
e = .4,
|
|
g = z.O(),
|
|
h = z.O(),
|
|
k = z.O(),
|
|
l = z.O();
|
|
R(a, (.5 - e) * b, .5 * c, !0);
|
|
S(a, (.5 - e) * b, (.5 - d) * c, (.5 - d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
|
|
xe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .44, k, l, h, g, g);
|
|
S(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c);
|
|
var m = z.Tb(h.x, h.y);
|
|
xe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .56, g, g, h, k, l);
|
|
var n = z.Tb(h.x, h.y);
|
|
a.lineTo((.1 * m.x + .855) * b, .1 * m.y * c);
|
|
a.lineTo(.85 * b, .1 * m.y * c);
|
|
a.lineTo(.85 * b, 0);
|
|
a.lineTo(1 *
|
|
b, 0);
|
|
a.lineTo(1 * b, .15 * c);
|
|
a.lineTo((.1 * n.x + .9) * b, .15 * c);
|
|
a.lineTo((.1 * n.x + .9) * b, (.1 * n.y + .05 * .9) * c);
|
|
a.lineTo(n.x * b, n.y * c);
|
|
S(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c);
|
|
S(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
|
|
S(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c);
|
|
e = .35;
|
|
d = .35 * Hd;
|
|
R(a, .5 * b, (.5 - e) * c, !0, !0);
|
|
S(a, (.5 - d) * b, (.5 - e) * c, (.5 - e) * b, (.5 - d) * c, (.5 - e) * b, .5 * c);
|
|
S(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
|
|
S(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 + e) * b, .5 * c);
|
|
S(a, (.5 + e) * b, (.5 - d) * c, (.5 +
|
|
d) * b, (.5 - e) * c, .5 * b, (.5 - e) * c);
|
|
R(a, (.5 - e) * b, .5 * c, !0);
|
|
z.A(g);
|
|
z.A(h);
|
|
z.A(k);
|
|
z.A(l);
|
|
z.A(m);
|
|
z.A(n);
|
|
b = a.q;
|
|
b.C = new Q(.202, .257);
|
|
b.D = new Q(.692, .839);
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
GenderFemale: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .375,
|
|
e = 0,
|
|
g = -.125,
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
R(a, (.525 + e) * b, (.5 + d + g) * c, !0);
|
|
S(a, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 - d + g) * c, (.5 - d + e) * b, (.5 - h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 - d + e) * b,
|
|
(.5 + h + g) * c, (.5 - h + e) * b, (.5 + d + g) * c, (.475 + e) * b, (.5 + d + g) * c);
|
|
a.lineTo(.475 * b, .85 * c);
|
|
a.lineTo(.425 * b, .85 * c);
|
|
a.lineTo(.425 * b, .9 * c);
|
|
a.lineTo(.475 * b, .9 * c);
|
|
a.lineTo(.475 * b, 1 * c);
|
|
a.lineTo(.525 * b, 1 * c);
|
|
a.lineTo(.525 * b, .9 * c);
|
|
a.lineTo(.575 * b, .9 * c);
|
|
a.lineTo(.575 * b, .85 * c);
|
|
a.lineTo(.525 * b, .85 * c);
|
|
T(a);
|
|
d = .325;
|
|
e = 0;
|
|
g = -.125;
|
|
h = 4 * (Math.SQRT2 - 1) / 3 * d;
|
|
R(a, (.5 + d + e) * b, (.5 + g) * c, !0, !0);
|
|
S(a, (.5 + d + e) * b, (.5 + h + g) * c, (.5 + h + e) * b, (.5 + d + g) * c, (.5 + e) * b, (.5 + d + g) * c);
|
|
S(a, (.5 - h + e) * b, (.5 + d + g) * c, (.5 - d + e) * b, (.5 + h + g) * c, (.5 - d + e) * b, (.5 + g) * c);
|
|
S(a, (.5 -
|
|
d + e) * b, (.5 - h + g) * c, (.5 - h + e) * b, (.5 - d + g) * c, (.5 + e) * b, (.5 - d + g) * c);
|
|
S(a, (.5 + h + e) * b, (.5 - d + g) * c, (.5 + d + e) * b, (.5 - h + g) * c, (.5 + d + e) * b, (.5 + g) * c);
|
|
R(a, (.525 + e) * b, (.5 + d + g) * c, !0);
|
|
b = a.q;
|
|
b.C = new Q(.232, .136);
|
|
b.D = new Q(.782, .611);
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
PlusLine: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, .5 * c, !1);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.moveTo(.5 * b, 0);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
XLine: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 1 * c, !1);
|
|
a.lineTo(1 * b, 0);
|
|
a.moveTo(0, 0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
AsteriskLine: function(a, b, c) {
|
|
a =
|
|
z.v();
|
|
var d = .2 / Math.SQRT2;
|
|
R(a, d * b, (1 - d) * c, !1);
|
|
a.lineTo((1 - d) * b, d * c);
|
|
a.moveTo(d * b, d * c);
|
|
a.lineTo((1 - d) * b, (1 - d) * c);
|
|
a.moveTo(0 * b, .5 * c);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.moveTo(.5 * b, 0 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
CircleLine: function(a, b, c) {
|
|
var d = .5 * Hd;
|
|
a = z.v();
|
|
R(a, 1 * b, .5 * c, !1);
|
|
S(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
b = a.q;
|
|
b.C = new Q(.146, .146);
|
|
b.D = new Q(.853, .853);
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Pie: function(a,
|
|
b, c) {
|
|
a = z.v();
|
|
var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
|
|
R(a, (.5 * Math.SQRT2 / 2 + .5) * b, (.5 - .5 * Math.SQRT2 / 2) * c, !0);
|
|
S(a, .7 * b, 0 * c, .5 * b, 0 * c, .5 * b, 0 * c);
|
|
S(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c);
|
|
S(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 + d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
PiePiece: function(a, b, c) {
|
|
var d = Hd / Math.SQRT2 * .5,
|
|
e = Math.SQRT2 / 2,
|
|
g = 1 - Math.SQRT2 / 2;
|
|
a = z.v();
|
|
R(a, b, c, !0);
|
|
S(a, b, (1 - d) * c, (e + d) * b, (g + d) * c, e * b, g * c);
|
|
a.lineTo(0, c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
StopSign: function(a,
|
|
b, c) {
|
|
a = 1 / (Math.SQRT2 + 2);
|
|
var d = z.v();
|
|
R(d, a * b, 0, !0);
|
|
d.lineTo((1 - a) * b, 0);
|
|
d.lineTo(1 * b, a * c);
|
|
d.lineTo(1 * b, (1 - a) * c);
|
|
d.lineTo((1 - a) * b, 1 * c);
|
|
d.lineTo(a * b, 1 * c);
|
|
d.lineTo(0, (1 - a) * c);
|
|
d.lineTo(0, a * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = new Q(a / 2, a / 2);
|
|
b.D = new Q(1 - a / 2, 1 - a / 2);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
LogicImplies: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
isNaN(d) && (d = .2);
|
|
a = z.v();
|
|
R(a, (1 - d) * b, 0 * c, !1);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo((1 - d) * b, c);
|
|
a.moveTo(0, .5 * c);
|
|
a.lineTo(b, .5 * c);
|
|
b = a.q;
|
|
b.C = Zb;
|
|
b.D = new Q(.8, .5);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicIff: function(a, b, c) {
|
|
var d = a ? a.Ic :
|
|
NaN;
|
|
isNaN(d) && (d = .2);
|
|
a = z.v();
|
|
R(a, (1 - d) * b, 0 * c, !1);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo((1 - d) * b, c);
|
|
a.moveTo(0, .5 * c);
|
|
a.lineTo(b, .5 * c);
|
|
a.moveTo(d * b, 0);
|
|
a.lineTo(0, .5 * c);
|
|
a.lineTo(d * b, c);
|
|
b = a.q;
|
|
b.C = new Q(.2, 0);
|
|
b.D = new Q(.8, .5);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicNot: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicAnd: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 1 * c, !1);
|
|
a.lineTo(.5 * b, 0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
b.C = new Q(.25, .5);
|
|
b.D = new Q(.75, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicOr: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(1 * b, 0);
|
|
b = a.q;
|
|
b.C = new Q(.219, 0);
|
|
b.D = new Q(.78, .409);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicXor: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !1);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.moveTo(0, .5 * c);
|
|
a.lineTo(1 * b, .5 * c);
|
|
var d = .5 * Hd;
|
|
S(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicTruth: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(1 * b, 0);
|
|
a.moveTo(.5 * b, 0);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicFalsity: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 1 * c, !1);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.moveTo(.5 * b, 1 * c);
|
|
a.lineTo(.5 * b, 0);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicThereExists: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(0, .5 * c);
|
|
a.moveTo(1 * b, .5 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicForAll: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(1 * b, 0);
|
|
a.moveTo(.25 * b, .5 * c);
|
|
a.lineTo(.75 * b, .5 * c);
|
|
b = a.q;
|
|
b.C = new Q(.25, 0);
|
|
b.D = new Q(.75, .5);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicIsDefinedAs: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(b, 0);
|
|
a.moveTo(0, .5 * c);
|
|
a.lineTo(b, .5 * c);
|
|
a.moveTo(0, c);
|
|
a.lineTo(b, c);
|
|
b = a.q;
|
|
b.C = new Q(.01, .01);
|
|
b.D = new Q(.99, .49);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicIntersect: function(a, b, c) {
|
|
var d = .5 * Hd;
|
|
a = z.v();
|
|
R(a, 0, 1 * c, !1);
|
|
a.lineTo(0, .5 * c);
|
|
S(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
b.C = new Q(0, .5);
|
|
b.D = ic;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LogicUnion: function(a, b, c) {
|
|
var d = .5 * Hd;
|
|
a = z.v();
|
|
R(a, 1 * b, 0, !1);
|
|
a.lineTo(1 * b, .5 * c);
|
|
S(a,
|
|
1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
|
|
a.lineTo(0, 0);
|
|
b = a.q;
|
|
b.C = Zb;
|
|
b.D = new Q(1, .5);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Arrow: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN,
|
|
e = a ? a.gu : NaN;
|
|
isNaN(d) && (d = .3);
|
|
isNaN(e) && (e = .3);
|
|
a = z.v();
|
|
R(a, 0, (.5 - e / 2) * c, !0);
|
|
a.lineTo((1 - d) * b, (.5 - e / 2) * c);
|
|
a.lineTo((1 - d) * b, 0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo((1 - d) * b, 1 * c);
|
|
a.lineTo((1 - d) * b, (.5 + e / 2) * c);
|
|
a.lineTo(0, (.5 + e / 2) * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .5 - e / 2);
|
|
d = Oe(0, .5 + e / 2, 1, .5 + e / 2, 1 - d, 1, 1, .5, z.O());
|
|
b.D = new Q(d.x, d.y);
|
|
z.A(d);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
ISOProcess: "Chevron",
|
|
Chevron: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(.5 * b, 0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
DoubleArrow: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(.3 * b, .214 * c);
|
|
a.lineTo(.3 * b, 0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(.3 * b, 1 * c);
|
|
a.lineTo(.3 * b, .786 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
R(a, .3 * b, .214 * c, !1);
|
|
a.lineTo(.3 * b, .786 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
DoubleEndArrow: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, .5 * c, !0);
|
|
a.lineTo(.7 * b, 1 * c);
|
|
a.lineTo(.7 * b, .7 * c);
|
|
a.lineTo(.3 * b, .7 * c);
|
|
a.lineTo(.3 * b, 1 * c);
|
|
a.lineTo(0, .5 * c);
|
|
a.lineTo(.3 * b, 0);
|
|
a.lineTo(.3 * b, .3 * c);
|
|
a.lineTo(.7 * b, .3 * c);
|
|
a.lineTo(.7 * b, 0);
|
|
T(a);
|
|
b = a.q;
|
|
c = Oe(0, .5, .3, 0, 0, .3, .3, .3, z.O());
|
|
b.C = new Q(c.x, c.y);
|
|
c = Oe(.7, 1, 1, .5, .7, .7, 1, .7, c);
|
|
b.D = new Q(c.x, c.y);
|
|
z.A(c);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
IBeamArrow: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, .5 * c, !0);
|
|
a.lineTo(.7 * b, 1 * c);
|
|
a.lineTo(.7 * b, .7 * c);
|
|
a.lineTo(.2 * b, .7 * c);
|
|
a.lineTo(.2 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(.2 * b, 0);
|
|
a.lineTo(.2 * b, .3 * c);
|
|
a.lineTo(.7 * b, .3 * c);
|
|
a.lineTo(.7 * b, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .3);
|
|
c = Oe(.7, 1, 1, .5, .7, .7, 1, .7, z.O());
|
|
b.D = new Q(c.x, c.y);
|
|
z.A(c);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Pointer: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, .5 * c, !0);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(.2 * b, .5 * c);
|
|
a.lineTo(0, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.2, .35);
|
|
c = Oe(.2, .65, 1, .65, 0, 1, 1, .5, z.O());
|
|
b.D = new Q(c.x, c.y);
|
|
z.A(c);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
RoundedPointer: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, .5 * c, !0);
|
|
a.lineTo(0, 1 * c);
|
|
S(a, .5 * b, .75 * c, .5 * b, .25 * c, 0, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.4, .35);
|
|
c = Oe(.2, .65, 1, .65, 0, 1, 1, .5, z.O());
|
|
b.D = new Q(c.x,
|
|
c.y);
|
|
z.A(c);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
SplitEndArrow: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, .5 * c, !0);
|
|
a.lineTo(.7 * b, 1 * c);
|
|
a.lineTo(.7 * b, .7 * c);
|
|
a.lineTo(0, .7 * c);
|
|
a.lineTo(.2 * b, .5 * c);
|
|
a.lineTo(0, .3 * c);
|
|
a.lineTo(.7 * b, .3 * c);
|
|
a.lineTo(.7 * b, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.2, .3);
|
|
c = Oe(.7, 1, 1, .5, .7, .7, 1, .7, z.O());
|
|
b.D = new Q(c.x, c.y);
|
|
z.A(c);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
MessageToUser: "SquareArrow",
|
|
SquareArrow: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, .5 * c, !0);
|
|
a.lineTo(.7 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(.7 * b, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = Zb;
|
|
b.D = new Q(.7, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Cone1: function(a, b, c) {
|
|
var d = .5 * Hd,
|
|
e = .1 * Hd;
|
|
a = z.v();
|
|
R(a, 0, .9 * c, !0);
|
|
a.lineTo(.5 * b, 0);
|
|
a.lineTo(1 * b, .9 * c);
|
|
S(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.25, .5);
|
|
b.D = new Q(.75, .97);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Cone2: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, .9 * c, !0);
|
|
S(a, (1 - .85 / .9) * b, 1 * c, .85 / .9 * b, 1 * c, 1 * b, .9 * c);
|
|
a.lineTo(.5 * b, 0);
|
|
a.lineTo(0, .9 * c);
|
|
T(a);
|
|
R(a, 0, .9 * c, !1);
|
|
S(a, (1 - .85 / .9) * b, .8 * c, .85 / .9 * b, .8 * c, 1 * b, .9 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.25, .5);
|
|
b.D = new Q(.75, .82);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Cube1: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 1 * c, !0);
|
|
a.lineTo(1 * b, .85 * c);
|
|
a.lineTo(1 * b, .15 * c);
|
|
a.lineTo(.5 * b, 0 * c);
|
|
a.lineTo(0 * b, .15 * c);
|
|
a.lineTo(0 * b, .85 * c);
|
|
T(a);
|
|
R(a, .5 * b, 1 * c, !1);
|
|
a.lineTo(.5 * b, .3 * c);
|
|
a.lineTo(0, .15 * c);
|
|
a.moveTo(.5 * b, .3 * c);
|
|
a.lineTo(1 * b, .15 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .3);
|
|
b.D = new Q(.5, .85);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Cube2: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, .3 * c, !0);
|
|
a.lineTo(0 * b, 1 * c);
|
|
a.lineTo(.7 * b, c);
|
|
a.lineTo(1 * b, .7 * c);
|
|
a.lineTo(1 * b, 0 * c);
|
|
a.lineTo(.3 * b, 0 * c);
|
|
T(a);
|
|
R(a, 0, .3 * c, !1);
|
|
a.lineTo(.7 * b, .3 * c);
|
|
a.lineTo(1 * b,
|
|
0 * c);
|
|
a.moveTo(.7 * b, .3 * c);
|
|
a.lineTo(.7 * b, 1 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .3);
|
|
b.D = new Q(.7, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
MagneticData: "Cylinder1",
|
|
Cylinder1: function(a, b, c) {
|
|
var d = .5 * Hd,
|
|
e = .1 * Hd;
|
|
a = z.v();
|
|
R(a, 0, .1 * c, !0);
|
|
S(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
|
|
a.lineTo(b, .9 * c);
|
|
S(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
|
|
a.lineTo(0, .1 * c);
|
|
R(a, 0, .1 * c, !1);
|
|
S(a, 0, (.1 + e) * c, (.5 - d) * b, .2 * c, .5 * b, .2 * c);
|
|
S(a, (.5 + d) * b, .2 * c, 1 * b, (.1 + e) * c, 1 * b, .1 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0,
|
|
.2);
|
|
b.D = new Q(1, .9);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Cylinder2: function(a, b, c) {
|
|
var d = .5 * Hd,
|
|
e = .1 * Hd;
|
|
a = z.v();
|
|
R(a, 0, .9 * c, !0);
|
|
a.lineTo(0, .1 * c);
|
|
S(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
|
|
a.lineTo(1 * b, .9 * c);
|
|
S(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
|
|
R(a, 0, .9 * c, !1);
|
|
S(a, 0, (.9 - e) * c, (.5 - d) * b, .8 * c, .5 * b, .8 * c);
|
|
S(a, (.5 + d) * b, .8 * c, 1 * b, (.9 - e) * c, 1 * b, .9 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .1);
|
|
b.D = new Q(1, .8);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Cylinder3: function(a, b, c) {
|
|
var d = .1 * Hd,
|
|
e = .5 * Hd;
|
|
a = z.v();
|
|
R(a, .1 * b, 0, !0);
|
|
a.lineTo(.9 * b, 0);
|
|
S(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 + e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c);
|
|
a.lineTo(.1 * b, 1 * c);
|
|
S(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0);
|
|
R(a, .1 * b, 0, !1);
|
|
S(a, (.1 + d) * b, 0, .2 * b, (.5 - e) * c, .2 * b, .5 * c);
|
|
S(a, .2 * b, (.5 + e) * c, (.1 + d) * b, 1 * c, .1 * b, 1 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.2, 0);
|
|
b.D = new Q(.9, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
DirectData: "Cylinder4",
|
|
Cylinder4: function(a, b, c) {
|
|
var d = .1 * Hd,
|
|
e = .5 * Hd;
|
|
a = z.v();
|
|
R(a, .9 * b, 0, !0);
|
|
S(a, (.9 + d) * b, 0, 1 * b, (.5 - e) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 +
|
|
e) * c, (.9 + d) * b, 1 * c, .9 * b, 1 * c);
|
|
a.lineTo(.1 * b, 1 * c);
|
|
S(a, (.1 - d) * b, 1 * c, 0, (.5 + e) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - e) * c, (.1 - d) * b, 0, .1 * b, 0);
|
|
a.lineTo(.9 * b, 0);
|
|
R(a, .9 * b, 0, !1);
|
|
S(a, (.9 - d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c);
|
|
S(a, .8 * b, (.5 + e) * c, (.9 - d) * b, 1 * c, .9 * b, 1 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.1, 0);
|
|
b.D = new Q(.8, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Prism1: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .25 * b, .25 * c, !0);
|
|
a.lineTo(.75 * b, 0);
|
|
a.lineTo(b, .5 * c);
|
|
a.lineTo(.5 * b, c);
|
|
a.lineTo(0, c);
|
|
T(a);
|
|
R(a, .25 * b, .25 * c, !1);
|
|
a.lineTo(.5 * b, c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.408, .172);
|
|
b.D = new Q(.833,
|
|
.662);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Prism2: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, .25 * c, !0);
|
|
a.lineTo(.75 * b, 0);
|
|
a.lineTo(1 * b, .25 * c);
|
|
a.lineTo(.75 * b, .75 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
R(a, 0, c, !1);
|
|
a.lineTo(.25 * b, .5 * c);
|
|
a.lineTo(b, .25 * c);
|
|
a.moveTo(0, .25 * c);
|
|
a.lineTo(.25 * b, .5 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.25, .5);
|
|
b.D = new Q(.75, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Pyramid1: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !0);
|
|
a.lineTo(b, .75 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(0, .75 * c);
|
|
T(a);
|
|
R(a, .5 * b, 0, !1);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.25, .367);
|
|
b.D = new Q(.75,
|
|
.875);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Pyramid2: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !0);
|
|
a.lineTo(b, .85 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(0, .85 * c);
|
|
T(a);
|
|
R(a, .5 * b, 0, !1);
|
|
a.lineTo(.5 * b, .7 * c);
|
|
a.lineTo(0, .85 * c);
|
|
a.moveTo(.5 * b, .7 * c);
|
|
a.lineTo(1 * b, .85 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.25, .367);
|
|
b.D = new Q(.75, .875);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Actor: function(a, b, c) {
|
|
var d = .2 * Hd,
|
|
e = .1 * Hd,
|
|
g = .5,
|
|
h = .1;
|
|
a = z.v();
|
|
R(a, g * b, (h + .1) * c, !0);
|
|
S(a, (g - d) * b, (h + .1) * c, (g - .2) * b, (h + e) * c, (g - .2) * b, h * c);
|
|
S(a, (g - .2) * b, (h - e) * c, (g - d) * b, (h - .1) * c, g * b, (h - .1) * c);
|
|
S(a, (g + d) * b, (h - .1) * c,
|
|
(g + .2) * b, (h - e) * c, (g + .2) * b, h * c);
|
|
S(a, (g + .2) * b, (h + e) * c, (g + d) * b, (h + .1) * c, g * b, (h + .1) * c);
|
|
d = .05;
|
|
e = Hd * d;
|
|
R(a, .5 * b, .2 * c, !0);
|
|
a.lineTo(.95 * b, .2 * c);
|
|
g = .95;
|
|
h = .25;
|
|
S(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
|
|
a.lineTo(1 * b, .6 * c);
|
|
a.lineTo(.85 * b, .6 * c);
|
|
a.lineTo(.85 * b, .35 * c);
|
|
d = .025;
|
|
e = Hd * d;
|
|
g = .825;
|
|
h = .35;
|
|
S(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c, g * b, (h - d) * c);
|
|
S(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
|
|
a.lineTo(.8 * b, 1 * c);
|
|
a.lineTo(.55 * b, 1 * c);
|
|
a.lineTo(.55 * b, .7 * c);
|
|
d = .05;
|
|
e = Hd * d;
|
|
g = .5;
|
|
h = .7;
|
|
S(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c,
|
|
g * b, (h - d) * c);
|
|
S(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
|
|
a.lineTo(.45 * b, 1 * c);
|
|
a.lineTo(.2 * b, 1 * c);
|
|
a.lineTo(.2 * b, .35 * c);
|
|
d = .025;
|
|
e = Hd * d;
|
|
g = .175;
|
|
h = .35;
|
|
S(a, (g + d) * b, (h - e) * c, (g + e) * b, (h - d) * c, g * b, (h - d) * c);
|
|
S(a, (g - e) * b, (h - d) * c, (g - d) * b, (h - e) * c, (g - d) * b, h * c);
|
|
a.lineTo(.15 * b, .6 * c);
|
|
a.lineTo(0 * b, .6 * c);
|
|
a.lineTo(0 * b, .25 * c);
|
|
d = .05;
|
|
e = Hd * d;
|
|
g = .05;
|
|
h = .25;
|
|
S(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
|
|
a.lineTo(.5 * b, .2 * c);
|
|
b = a.q;
|
|
b.C = new Q(.2, .2);
|
|
b.D = new Q(.8, .65);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Card: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, 0 * c, !0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0 * b, 1 * c);
|
|
a.lineTo(0 * b, .2 * c);
|
|
a.lineTo(.2 * b, 0 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .2);
|
|
b.D = ic;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Collate: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, .5 * c, !0);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
R(a, .5 * b, .5 * c, !0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
b = a.q;
|
|
b.C = new Q(.25, 0);
|
|
b.D = new Q(.75, .25);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
CreateRequest: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .1);
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
R(d, 0,
|
|
a * c, !1);
|
|
d.lineTo(1 * b, a * c);
|
|
d.moveTo(0, (1 - a) * c);
|
|
d.lineTo(1 * b, (1 - a) * c);
|
|
d.gb(!1);
|
|
b = d.q;
|
|
b.C = new Q(0, a);
|
|
b.D = new Q(1, 1 - a);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
Database: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd,
|
|
e = .1 * Hd;
|
|
R(a, 1 * b, .1 * c, !0);
|
|
a.lineTo(1 * b, .9 * c);
|
|
S(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
|
|
a.lineTo(0, .1 * c);
|
|
S(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
|
|
R(a, 1 * b, .1 * c, !1);
|
|
S(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c);
|
|
S(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c);
|
|
a.moveTo(1 * b, .2 * c);
|
|
S(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c);
|
|
S(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c);
|
|
a.moveTo(1 * b, .3 * c);
|
|
S(a, 1 * b, (.3 + e) * c, (.5 + d) * b, .4 * c, .5 * b, .4 * c);
|
|
S(a, (.5 - d) * b, .4 * c, 0, (.3 + e) * c, 0, .3 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .4);
|
|
b.D = new Q(1, .9);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
StoredData: "DataStorage",
|
|
DataStorage: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(.75 * b, 0);
|
|
S(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
S(a, .25 * b, .9 * c, .25 * b, .1 * c, 0, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.226, 0);
|
|
b.D = new Q(.81, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
DiskStorage: function(a, b, c) {
|
|
a =
|
|
z.v();
|
|
var d = .5 * Hd,
|
|
e = .1 * Hd;
|
|
R(a, 1 * b, .1 * c, !0);
|
|
a.lineTo(1 * b, .9 * c);
|
|
S(a, 1 * b, (.9 + e) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.9 + e) * c, 0, .9 * c);
|
|
a.lineTo(0, .1 * c);
|
|
S(a, 0, (.1 - e) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.1 - e) * c, 1 * b, .1 * c);
|
|
R(a, 1 * b, .1 * c, !1);
|
|
S(a, 1 * b, (.1 + e) * c, (.5 + d) * b, .2 * c, .5 * b, .2 * c);
|
|
S(a, (.5 - d) * b, .2 * c, 0, (.1 + e) * c, 0, .1 * c);
|
|
a.moveTo(1 * b, .2 * c);
|
|
S(a, 1 * b, (.2 + e) * c, (.5 + d) * b, .3 * c, .5 * b, .3 * c);
|
|
S(a, (.5 - d) * b, .3 * c, 0, (.2 + e) * c, 0, .2 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .3);
|
|
b.D = new Q(1, .9);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Display: function(a,
|
|
b, c) {
|
|
a = z.v();
|
|
R(a, .25 * b, 0, !0);
|
|
a.lineTo(.75 * b, 0);
|
|
S(a, 1 * b, 0, 1 * b, 1 * c, .75 * b, 1 * c);
|
|
a.lineTo(.25 * b, 1 * c);
|
|
a.lineTo(0, .5 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.25, 0);
|
|
b.D = new Q(.75, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
DividedEvent: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) ? a = .2 : .15 > a && (a = .15);
|
|
var d = z.v(),
|
|
e = .2 * Hd;
|
|
R(d, 0, .2 * c, !0);
|
|
S(d, 0, (.2 - e) * c, (.2 - e) * b, 0, .2 * b, 0);
|
|
d.lineTo(.8 * b, 0);
|
|
S(d, (.8 + e) * b, 0, 1 * b, (.2 - e) * c, 1 * b, .2 * c);
|
|
d.lineTo(1 * b, .8 * c);
|
|
S(d, 1 * b, (.8 + e) * c, (.8 + e) * b, 1 * c, .8 * b, 1 * c);
|
|
d.lineTo(.2 * b, 1 * c);
|
|
S(d, (.2 - e) * b, 1 * c, 0, (.8 + e) * c, 0, .8 * c);
|
|
d.lineTo(0, .2 * c);
|
|
R(d, 0, a * c, !1);
|
|
d.lineTo(1 * b, a * c);
|
|
d.gb(!1);
|
|
b = d.q;
|
|
b.C = new Q(0, a);
|
|
b.D = new Q(1, 1 - a);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
DividedProcess: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
if (isNaN(a) || .1 > a) a = .1;
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
R(d, 0, a * c, !1);
|
|
d.lineTo(1 * b, a * c);
|
|
d.gb(!1);
|
|
b = d.q;
|
|
b.C = new Q(0, a);
|
|
b.D = ic;
|
|
z.u(d);
|
|
return b
|
|
},
|
|
Document: function(a, b, c) {
|
|
c /= .8;
|
|
a = z.v();
|
|
R(a, 0, .7 * c, !0);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(1 * b, .7 * c);
|
|
S(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = Zb;
|
|
b.D = new Q(1, .6);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
ExternalOrganization: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
if (isNaN(a) || .2 > a) a = .2;
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
R(d, a * b, 0, !1);
|
|
d.lineTo(0, a * c);
|
|
d.moveTo(1 * b, a * c);
|
|
d.lineTo((1 - a) * b, 0);
|
|
d.moveTo(0, (1 - a) * c);
|
|
d.lineTo(a * b, 1 * c);
|
|
d.moveTo((1 - a) * b, 1 * c);
|
|
d.lineTo(1 * b, (1 - a) * c);
|
|
d.gb(!1);
|
|
b = d.q;
|
|
b.C = new Q(a / 2, a / 2);
|
|
b.D = new Q(1 - a / 2, 1 - a / 2);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
ExternalProcess: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(0, .5 * c);
|
|
T(a);
|
|
R(a, .1 * b, .4 * c, !1);
|
|
a.lineTo(.1 * b, .6 * c);
|
|
a.moveTo(.9 * b, .6 * c);
|
|
a.lineTo(.9 * b, .4 * c);
|
|
a.moveTo(.6 * b, .1 * c);
|
|
a.lineTo(.4 * b, .1 * c);
|
|
a.moveTo(.4 * b, .9 * c);
|
|
a.lineTo(.6 * b, .9 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.25, .25);
|
|
b.D = new Q(.75, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
File: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(.75 * b, 0);
|
|
a.lineTo(1 * b, .25 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
R(a, .75 * b, 0, !1);
|
|
a.lineTo(.75 * b, .25 * c);
|
|
a.lineTo(1 * b, .25 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = ic;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Interrupt: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b,
|
|
.5 * c, !0);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
R(a, 1 * b, .5 * c, !1);
|
|
a.lineTo(1 * b, 1 * c);
|
|
R(a, 1 * b, .5 * c, !1);
|
|
a.lineTo(1 * b, 0);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = new Q(.5, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
InternalStorage: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
a = a ? a.gu : NaN;
|
|
isNaN(d) && (d = .1);
|
|
isNaN(a) && (a = .1);
|
|
var e = z.v();
|
|
R(e, 0, 0, !0);
|
|
e.lineTo(1 * b, 0);
|
|
e.lineTo(1 * b, 1 * c);
|
|
e.lineTo(0, 1 * c);
|
|
T(e);
|
|
R(e, d * b, 0, !1);
|
|
e.lineTo(d * b, 1 * c);
|
|
e.moveTo(0, a * c);
|
|
e.lineTo(1 * b, a * c);
|
|
e.gb(!1);
|
|
b = e.q;
|
|
b.C = new Q(d, a);
|
|
b.D = ic;
|
|
z.u(e);
|
|
return b
|
|
},
|
|
Junction: function(a, b,
|
|
c) {
|
|
a = z.v();
|
|
var d = 1 / Math.SQRT2,
|
|
e = (1 - 1 / Math.SQRT2) / 2,
|
|
g = .5 * Hd;
|
|
R(a, 1 * b, .5 * c, !0);
|
|
S(a, 1 * b, (.5 + g) * c, (.5 + g) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - g) * b, 1 * c, 0, (.5 + g) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - g) * c, (.5 - g) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + g) * b, 0, 1 * b, (.5 - g) * c, 1 * b, .5 * c);
|
|
R(a, (e + d) * b, (e + d) * c, !1);
|
|
a.lineTo(e * b, e * c);
|
|
a.moveTo(e * b, (e + d) * c);
|
|
a.lineTo((e + d) * b, e * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LinedDocument: function(a, b, c) {
|
|
c /= .8;
|
|
a = z.v();
|
|
R(a, 0, .7 * c, !0);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(1 * b, .7 * c);
|
|
S(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
|
|
T(a);
|
|
R(a, .1 *
|
|
b, 0, !1);
|
|
a.lineTo(.1 * b, .75 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.1, 0);
|
|
b.D = new Q(1, .6);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
LoopLimit: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 1 * c, !0);
|
|
a.lineTo(0, .25 * c);
|
|
a.lineTo(.25 * b, 0);
|
|
a.lineTo(.75 * b, 0);
|
|
a.lineTo(1 * b, .25 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = ic;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
SequentialData: "MagneticTape",
|
|
MagneticTape: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, .5 * b, 1 * c, !0);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 +
|
|
d) * c, (.5 + d) * b, .9 * c, .6 * b, .9 * c);
|
|
a.lineTo(1 * b, .9 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
b = a.q;
|
|
b.C = new Q(.15, .15);
|
|
b.D = new Q(.85, .8);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
ManualInput: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, 0, !0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, .25 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = ic;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
MessageFromUser: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .7);
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(a * b, .5 * c);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = Zb;
|
|
b.D = new Q(a, 1);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
MicroformProcessing: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .25);
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(.5 * b, a * c);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(.5 * b, (1 - a) * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = new Q(0, a);
|
|
b.D = new Q(1, 1 - a);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
MicroformRecording: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(.75 * b, .25 * c);
|
|
a.lineTo(1 * b, .15 * c);
|
|
a.lineTo(1 * b, .85 * c);
|
|
a.lineTo(.75 * b, .75 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = new Q(1, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
MultiDocument: function(a, b, c) {
|
|
c /= .8;
|
|
a = z.v();
|
|
R(a, b, 0, !0);
|
|
a.lineTo(b, .5 * c);
|
|
S(a, .96 * b, .47 * c, .93 * b, .45 * c, .9 * b, .44 * c);
|
|
a.lineTo(.9 * b, .6 * c);
|
|
S(a, .86 * b, .57 * c, .83 * b, .55 * c, .8 * b, .54 * c);
|
|
a.lineTo(.8 * b, .7 * c);
|
|
S(a, .4 * b, .4 * c, .4 * b, 1 * c, 0, .7 * c);
|
|
a.lineTo(0, .2 * c);
|
|
a.lineTo(.1 * b, .2 * c);
|
|
a.lineTo(.1 * b, .1 * c);
|
|
a.lineTo(.2 * b, .1 * c);
|
|
a.lineTo(.2 * b, 0);
|
|
T(a);
|
|
R(a, .1 * b, .2 * c, !1);
|
|
a.lineTo(.8 * b, .2 * c);
|
|
a.lineTo(.8 * b, .54 * c);
|
|
a.moveTo(.2 * b, .1 * c);
|
|
a.lineTo(.9 * b, .1 * c);
|
|
a.lineTo(.9 * b, .44 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = new Q(.8, .77);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
MultiProcess: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .1 * b, .1 * c, !0);
|
|
a.lineTo(.2 * b, .1 * c);
|
|
a.lineTo(.2 * b, 0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(1 * b, .8 * c);
|
|
a.lineTo(.9 * b, .8 * c);
|
|
a.lineTo(.9 * b, .9 * c);
|
|
a.lineTo(.8 * b, .9 * c);
|
|
a.lineTo(.8 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, .2 * c);
|
|
a.lineTo(.1 * b, .2 * c);
|
|
T(a);
|
|
R(a, .2 * b, .1 * c, !1);
|
|
a.lineTo(.9 * b, .1 * c);
|
|
a.lineTo(.9 * b, .8 * c);
|
|
a.moveTo(.1 * b, .2 * c);
|
|
a.lineTo(.8 * b, .2 * c);
|
|
a.lineTo(.8 * b, .9 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(0, .2);
|
|
b.D = new Q(.8, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
OfflineStorage: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .1);
|
|
var d = 1 - a,
|
|
e = z.v();
|
|
R(e, 0, 0, !0);
|
|
e.lineTo(1 *
|
|
b, 0);
|
|
e.lineTo(.5 * b, 1 * c);
|
|
T(e);
|
|
R(e, .5 * a * b, a * c, !1);
|
|
e.lineTo((1 - .5 * a) * b, a * c);
|
|
e.gb(!1);
|
|
b = e.q;
|
|
b.C = new Q(d / 4 + .5 * a, a);
|
|
b.D = new Q(3 * d / 4 + .5 * a, a + .5 * d);
|
|
z.u(e);
|
|
return b
|
|
},
|
|
OffPageConnector: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(.75 * b, 0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(.75 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = Zb;
|
|
b.D = new Q(.75, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Or: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, 1 * b, .5 * c, !0);
|
|
S(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a,
|
|
(.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
R(a, 1 * b, .5 * c, !1);
|
|
a.lineTo(0, .5 * c);
|
|
a.moveTo(.5 * b, 1 * c);
|
|
a.lineTo(.5 * b, 0);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
PaperTape: function(a, b, c) {
|
|
c /= .8;
|
|
a = z.v();
|
|
R(a, 0, .7 * c, !0);
|
|
a.lineTo(0, .3 * c);
|
|
S(a, .5 * b, .6 * c, .5 * b, 0, 1 * b, .3 * c);
|
|
a.lineTo(1 * b, .7 * c);
|
|
S(a, .5 * b, .4 * c, .5 * b, 1 * c, 0, .7 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .49);
|
|
b.D = new Q(1, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
PrimitiveFromCall: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
a = a ? a.gu : NaN;
|
|
isNaN(d) && (d = .1);
|
|
isNaN(a) && (a = .3);
|
|
var e = z.v();
|
|
R(e, 0, 0, !0);
|
|
e.lineTo(1 * b, 0);
|
|
e.lineTo((1 -
|
|
a) * b, .5 * c);
|
|
e.lineTo(1 * b, 1 * c);
|
|
e.lineTo(0, 1 * c);
|
|
T(e);
|
|
b = e.q;
|
|
b.C = new Q(d, 0);
|
|
b.D = new Q(1 - a, 1);
|
|
z.u(e);
|
|
return b
|
|
},
|
|
PrimitiveToCall: function(a, b, c) {
|
|
var d = a ? a.Ic : NaN;
|
|
a = a ? a.gu : NaN;
|
|
isNaN(d) && (d = .1);
|
|
isNaN(a) && (a = .3);
|
|
var e = z.v();
|
|
R(e, 0, 0, !0);
|
|
e.lineTo((1 - a) * b, 0);
|
|
e.lineTo(1 * b, .5 * c);
|
|
e.lineTo((1 - a) * b, 1 * c);
|
|
e.lineTo(0, 1 * c);
|
|
T(e);
|
|
b = e.q;
|
|
b.C = new Q(d, 0);
|
|
b.D = new Q(1 - a, 1);
|
|
z.u(e);
|
|
return b
|
|
},
|
|
Subroutine: "Procedure",
|
|
Procedure: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .1);
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0,
|
|
1 * c);
|
|
T(d);
|
|
R(d, (1 - a) * b, 0, !1);
|
|
d.lineTo((1 - a) * b, 1 * c);
|
|
d.moveTo(a * b, 0);
|
|
d.lineTo(a * b, 1 * c);
|
|
d.gb(!1);
|
|
b = d.q;
|
|
b.C = new Q(a, 0);
|
|
b.D = new Q(1 - a, 1);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
Process: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .1);
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(0, 1 * c);
|
|
T(d);
|
|
R(d, a * b, 0, !1);
|
|
d.lineTo(a * b, 1 * c);
|
|
d.gb(!1);
|
|
b = d.q;
|
|
b.C = new Q(a, 0);
|
|
b.D = ic;
|
|
z.u(d);
|
|
return b
|
|
},
|
|
Sort: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.lineTo(0, .5 * c);
|
|
T(a);
|
|
R(a, 0, .5 * c, !1);
|
|
a.lineTo(1 * b, .5 *
|
|
c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.25, .25);
|
|
b.D = new Q(.75, .5);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Start: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .25 * b, 0, !0);
|
|
R(a, .25 * b, 0, !0);
|
|
a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c);
|
|
a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c);
|
|
R(a, .25 * b, 0, !1);
|
|
a.lineTo(.25 * b, 1 * c);
|
|
a.moveTo(.75 * b, 0);
|
|
a.lineTo(.75 * b, 1 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.C = new Q(.25, 0);
|
|
b.D = new Q(.75, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Terminator: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .25 * b, 0, !0);
|
|
a.arcTo(270, 180, .75 * b, .5 * c, .25 * b, .5 * c);
|
|
a.arcTo(90, 180, .25 * b, .5 * c, .25 * b, .5 * c);
|
|
b = a.q;
|
|
b.C = new Q(.23, 0);
|
|
b.D = new Q(.77, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
TransmittalTape: function(a, b, c) {
|
|
a = a ? a.Ic : NaN;
|
|
isNaN(a) && (a = .1);
|
|
var d = z.v();
|
|
R(d, 0, 0, !0);
|
|
d.lineTo(1 * b, 0);
|
|
d.lineTo(1 * b, 1 * c);
|
|
d.lineTo(.75 * b, (1 - a) * c);
|
|
d.lineTo(0, (1 - a) * c);
|
|
T(d);
|
|
b = d.q;
|
|
b.C = Zb;
|
|
b.D = new Q(1, 1 - a);
|
|
z.u(d);
|
|
return b
|
|
},
|
|
AndGate: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(.5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = Zb;
|
|
b.D = new Q(.55, 1);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Buffer: function(a, b, c) {
|
|
a = z.v();
|
|
R(a,
|
|
0, 0, !0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(0, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = new Q(.5, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Clock: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, 1 * b, .5 * c, !0);
|
|
S(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
R(a, 1 * b, .5 * c, !1);
|
|
a.lineTo(1 * b, .5 * c);
|
|
R(a, .8 * b, .75 * c, !1);
|
|
a.lineTo(.8 * b, .25 * c);
|
|
a.lineTo(.6 * b, .25 * c);
|
|
a.lineTo(.6 * b, .75 * c);
|
|
a.lineTo(.4 * b, .75 * c);
|
|
a.lineTo(.4 * b, .25 * c);
|
|
a.lineTo(.2 * b, .25 * c);
|
|
a.lineTo(.2 *
|
|
b, .75 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Ground: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .5 * b, 0, !1);
|
|
a.lineTo(.5 * b, .4 * c);
|
|
a.moveTo(.2 * b, .6 * c);
|
|
a.lineTo(.8 * b, .6 * c);
|
|
a.moveTo(.3 * b, .8 * c);
|
|
a.lineTo(.7 * b, .8 * c);
|
|
a.moveTo(.4 * b, 1 * c);
|
|
a.lineTo(.6 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Inverter: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .1 * Hd;
|
|
R(a, .8 * b, .5 * c, !0);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(.8 * b, .5 * c);
|
|
R(a, 1 * b, .5 * c, !0);
|
|
S(a, 1 * b, (.5 + d) * c, (.9 + d) * b, .6 * c, .9 * b, .6 * c);
|
|
S(a, (.9 - d) * b, .6 * c, .8 * b, (.5 + d) * c, .8 * b, .5 * c);
|
|
S(a, .8 * b, (.5 - d) * c, (.9 - d) * b, .4 *
|
|
c, .9 * b, .4 * c);
|
|
S(a, (.9 + d) * b, .4 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = new Q(.4, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
NandGate: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd,
|
|
e = .4 * Hd,
|
|
g = .1 * Hd;
|
|
R(a, .8 * b, .5 * c, !0);
|
|
S(a, .8 * b, (.5 + e) * c, (.4 + d) * b, 1 * c, .4 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(.4 * b, 0);
|
|
S(a, (.4 + d) * b, 0, .8 * b, (.5 - e) * c, .8 * b, .5 * c);
|
|
R(a, 1 * b, .5 * c, !0);
|
|
S(a, 1 * b, (.5 + g) * c, (.9 + g) * b, .6 * c, .9 * b, .6 * c);
|
|
S(a, (.9 - g) * b, .6 * c, .8 * b, (.5 + g) * c, .8 * b, .5 * c);
|
|
S(a, .8 * b, (.5 - g) * c, (.9 - g) * b, .4 * c, .9 * b, .4 * c);
|
|
S(a, (.9 + g) * b, .4 * c, 1 * b, (.5 - g) * c, 1 * b, .5 *
|
|
c);
|
|
b = a.q;
|
|
b.C = new Q(0, .05);
|
|
b.D = new Q(.55, .95);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
NorGate: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5,
|
|
e = Hd * d,
|
|
g = 0,
|
|
h = .5;
|
|
R(a, .8 * b, .5 * c, !0);
|
|
S(a, .7 * b, (h + e) * c, (g + e) * b, (h + d) * c, 0, 1 * c);
|
|
S(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0);
|
|
S(a, (g + e) * b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c);
|
|
d = .1;
|
|
e = .1 * Hd;
|
|
g = .9;
|
|
h = .5;
|
|
R(a, (g - d) * b, h * c, !0);
|
|
S(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
|
|
S(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
|
|
S(a, (g + d) * b, (h + e) * c, (g + e) * b, (h + d) * c, g * b, (h + d) * c);
|
|
S(a, (g - e) * b, (h + d) * c, (g - d) * b, (h + e) * c, (g - d) * b, h * c);
|
|
b = a.q;
|
|
b.C =
|
|
new Q(.2, .25);
|
|
b.D = new Q(.6, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
OrGate: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, 0, 0, !0);
|
|
S(a, (0 + d + d) * b, 0 * c, .8 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
S(a, .8 * b, (.5 + d) * c, (0 + d + d) * b, 1 * c, 0, 1 * c);
|
|
S(a, .25 * b, .75 * c, .25 * b, .25 * c, 0, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.2, .25);
|
|
b.D = new Q(.75, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
XnorGate: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5,
|
|
e = Hd * d,
|
|
g = .2,
|
|
h = .5;
|
|
R(a, .1 * b, 0, !1);
|
|
S(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c);
|
|
R(a, .8 * b, .5 * c, !0);
|
|
S(a, .7 * b, (h + e) * c, (g + e) * b, (h + d) * c, .2 * b, 1 * c);
|
|
S(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0);
|
|
S(a, (g + e) *
|
|
b, (h - d) * c, .7 * b, (h - e) * c, .8 * b, .5 * c);
|
|
d = .1;
|
|
e = .1 * Hd;
|
|
g = .9;
|
|
h = .5;
|
|
R(a, (g - d) * b, h * c, !0);
|
|
S(a, (g - d) * b, (h - e) * c, (g - e) * b, (h - d) * c, g * b, (h - d) * c);
|
|
S(a, (g + e) * b, (h - d) * c, (g + d) * b, (h - e) * c, (g + d) * b, h * c);
|
|
S(a, (g + d) * b, (h + e) * c, (g + e) * b, (h + d) * c, g * b, (h + d) * c);
|
|
S(a, (g - e) * b, (h + d) * c, (g - d) * b, (h + e) * c, (g - d) * b, h * c);
|
|
b = a.q;
|
|
b.C = new Q(.4, .25);
|
|
b.D = new Q(.65, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
XorGate: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, .1 * b, 0, !1);
|
|
S(a, .35 * b, .25 * c, .35 * b, .75 * c, .1 * b, 1 * c);
|
|
R(a, .2 * b, 0, !0);
|
|
S(a, (.2 + d) * b, 0 * c, .9 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
S(a, .9 * b, (.5 + d) *
|
|
c, (.2 + d) * b, 1 * c, .2 * b, 1 * c);
|
|
S(a, .45 * b, .75 * c, .45 * b, .25 * c, .2 * b, 0);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.4, .25);
|
|
b.D = new Q(.8, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Capacitor: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(0, 1 * c);
|
|
a.moveTo(1 * b, 0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Resistor: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, .5 * c, !1);
|
|
a.lineTo(.1 * b, 0);
|
|
a.lineTo(.2 * b, 1 * c);
|
|
a.lineTo(.3 * b, 0);
|
|
a.lineTo(.4 * b, 1 * c);
|
|
a.lineTo(.5 * b, 0);
|
|
a.lineTo(.6 * b, 1 * c);
|
|
a.lineTo(.7 * b, .5 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Inductor: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .1 * Hd,
|
|
e = .1;
|
|
R(a, (e - .5 *
|
|
d) * b, c, !1);
|
|
S(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
|
|
e = .3;
|
|
S(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
|
|
S(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
|
|
e = .5;
|
|
S(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
|
|
S(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
|
|
e = .7;
|
|
S(a, (e + .1) * b, 0, (e + d) * b, c, e * b, c);
|
|
S(a, (e - d) * b, c, (e - .1) * b, 0, (e + .1) * b, 0);
|
|
e = .9;
|
|
S(a, (e + .1) * b, 0, (e + d) * b, c, (e + .5 * d) * b, c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
ACvoltageSource: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, 0 * b, .5 * c, !1);
|
|
S(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c);
|
|
S(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 + d) *
|
|
c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b, .5 * c);
|
|
a.moveTo(.1 * b, .5 * c);
|
|
S(a, .5 * b, 0 * c, .5 * b, 1 * c, .9 * b, .5 * c);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
DCvoltageSource: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, .75 * c, !1);
|
|
a.lineTo(0, .25 * c);
|
|
a.moveTo(1 * b, 0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Diode: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 1 * b, 0, !1);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, 0);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
b.C = new Q(0, .25);
|
|
b.D = new Q(.5, .75);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Wifi: function(a, b, c) {
|
|
var d = b,
|
|
e = c;
|
|
b *= .38;
|
|
c *= .6;
|
|
a = z.v();
|
|
var g = .8 * Hd,
|
|
h = .8,
|
|
k = 0,
|
|
l = .5,
|
|
d = (d - b) / 2,
|
|
e = (e - c) / 2;
|
|
R(a, k * b + d, (l + h) * c + e, !0);
|
|
S(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
|
|
S(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
|
|
S(a, k * b + d, (l - h) * c + e, (k - h + .5 * g) * b + d, (l - g) * c + e, (k - h + .5 * g) * b + d, l * c + e);
|
|
S(a, (k - h + .5 * g) * b + d, (l + g) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
|
|
T(a);
|
|
g = .4 * Hd;
|
|
h = .4;
|
|
k = .2;
|
|
l = .5;
|
|
R(a, k * b + d, (l + h) * c + e, !0);
|
|
S(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
|
|
S(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k *
|
|
b + d, (l - h) * c + e);
|
|
S(a, k * b + d, (l - h) * c + e, (k - h + .5 * g) * b + d, (l - g) * c + e, (k - h + .5 * g) * b + d, l * c + e);
|
|
S(a, (k - h + .5 * g) * b + d, (l + g) * c + e, k * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
|
|
T(a);
|
|
g = .2 * Hd;
|
|
h = .2;
|
|
l = k = .5;
|
|
R(a, (k - h) * b + d, l * c + e, !0);
|
|
S(a, (k - h) * b + d, (l - g) * c + e, (k - g) * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
|
|
S(a, (k + g) * b + d, (l - h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
|
|
S(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
|
|
S(a, (k - g) * b + d, (l + h) * c + e, (k - h) * b + d, (l + g) * c + e, (k - h) * b + d, l * c + e);
|
|
g = .4 * Hd;
|
|
h = .4;
|
|
k = .8;
|
|
l = .5;
|
|
R(a, k * b + d, (l - h) * c + e, !0);
|
|
S(a, (k + g) * b + d, (l -
|
|
h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
|
|
S(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
|
|
S(a, k * b + d, (l + h) * c + e, (k + h - .5 * g) * b + d, (l + g) * c + e, (k + h - .5 * g) * b + d, l * c + e);
|
|
S(a, (k + h - .5 * g) * b + d, (l - g) * c + e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
|
|
T(a);
|
|
g = .8 * Hd;
|
|
h = .8;
|
|
k = 1;
|
|
l = .5;
|
|
R(a, k * b + d, (l - h) * c + e, !0);
|
|
S(a, (k + g) * b + d, (l - h) * c + e, (k + h) * b + d, (l - g) * c + e, (k + h) * b + d, l * c + e);
|
|
S(a, (k + h) * b + d, (l + g) * c + e, (k + g) * b + d, (l + h) * c + e, k * b + d, (l + h) * c + e);
|
|
S(a, k * b + d, (l + h) * c + e, (k + h - .5 * g) * b + d, (l + g) * c + e, (k + h - .5 * g) * b + d, l * c + e);
|
|
S(a, (k + h - .5 * g) * b + d, (l - g) * c +
|
|
e, k * b + d, (l - h) * c + e, k * b + d, (l - h) * c + e);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Email: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !0);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, 0);
|
|
T(a);
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(.5 * b, .6 * c);
|
|
a.lineTo(1 * b, 0);
|
|
a.moveTo(0, 1 * c);
|
|
a.lineTo(.45 * b, .54 * c);
|
|
a.moveTo(1 * b, 1 * c);
|
|
a.lineTo(.55 * b, .54 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Ethernet: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .35 * b, 0, !0);
|
|
a.lineTo(.65 * b, 0);
|
|
a.lineTo(.65 * b, .4 * c);
|
|
a.lineTo(.35 * b, .4 * c);
|
|
a.lineTo(.35 * b, 0);
|
|
T(a);
|
|
R(a, .1 * b, 1 * c, !0, !0);
|
|
a.lineTo(.4 * b, 1 * c);
|
|
a.lineTo(.4 * b, .6 * c);
|
|
a.lineTo(.1 * b, .6 * c);
|
|
a.lineTo(.1 * b, 1 * c);
|
|
T(a);
|
|
R(a, .6 * b, 1 * c, !0, !0);
|
|
a.lineTo(.9 * b, 1 * c);
|
|
a.lineTo(.9 * b, .6 * c);
|
|
a.lineTo(.6 * b, .6 * c);
|
|
a.lineTo(.6 * b, 1 * c);
|
|
T(a);
|
|
R(a, 0, .5 * c, !1);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.moveTo(.5 * b, .5 * c);
|
|
a.lineTo(.5 * b, .4 * c);
|
|
a.moveTo(.75 * b, .5 * c);
|
|
a.lineTo(.75 * b, .6 * c);
|
|
a.moveTo(.25 * b, .5 * c);
|
|
a.lineTo(.25 * b, .6 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Power: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .4 * Hd,
|
|
e = .4,
|
|
g = z.O(),
|
|
h = z.O(),
|
|
k = z.O(),
|
|
l = z.O();
|
|
xe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, g, g, h, k, l);
|
|
var m = z.Tb(h.x,
|
|
h.y);
|
|
R(a, h.x * b, h.y * c, !0);
|
|
S(a, k.x * b, k.y * c, l.x * b, l.y * c, (.5 + e) * b, .5 * c);
|
|
S(a, (.5 + e) * b, (.5 + d) * c, (.5 + d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
|
|
S(a, (.5 - d) * b, (.5 + e) * c, (.5 - e) * b, (.5 + d) * c, (.5 - e) * b, .5 * c);
|
|
xe(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, g, g);
|
|
S(a, k.x * b, k.y * c, l.x * b, l.y * c, h.x * b, h.y * c);
|
|
d = .3 * Hd;
|
|
e = .3;
|
|
xe(.5 - e, .5, .5 - e, .5 - d, .5 - d, .5 - e, .5, .5 - e, .5, k, l, h, g, g);
|
|
a.lineTo(h.x * b, h.y * c);
|
|
S(a, l.x * b, l.y * c, k.x * b, k.y * c, (.5 - e) * b, .5 * c);
|
|
S(a, (.5 - e) * b, (.5 + d) * c, (.5 - d) * b, (.5 + e) * c, .5 * b, (.5 + e) * c);
|
|
S(a, (.5 + d) * b, (.5 + e) * c, (.5 + e) * b, (.5 + d) * c, (.5 +
|
|
e) * b, .5 * c);
|
|
xe(.5, .5 - e, .5 + d, .5 - e, .5 + e, .5 - d, .5 + e, .5, .5, g, g, h, k, l);
|
|
S(a, l.x * b, l.y * c, k.x * b, k.y * c, h.x * b, h.y * c);
|
|
T(a);
|
|
R(a, .45 * b, 0, !0);
|
|
a.lineTo(.45 * b, .5 * c);
|
|
a.lineTo(.55 * b, .5 * c);
|
|
a.lineTo(.55 * b, 0);
|
|
T(a);
|
|
z.A(g);
|
|
z.A(h);
|
|
z.A(k);
|
|
z.A(l);
|
|
z.A(m);
|
|
b = a.q;
|
|
b.C = new Q(.25, .55);
|
|
b.D = new Q(.75, .8);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
Fallout: function(a, b, c) {
|
|
a = z.v();
|
|
var d = .5 * Hd;
|
|
R(a, 0 * b, .5 * c, !0);
|
|
S(a, 0 * b, (.5 - d) * c, (.5 - d) * b, 0 * c, .5 * b, 0 * c);
|
|
S(a, (.5 + d) * b, 0 * c, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0 * b, (.5 + d) * c, 0 * b,
|
|
.5 * c);
|
|
var e = d = 0;
|
|
R(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
|
|
a.lineTo((.5 + d) * b, (.5 + e) * c);
|
|
a.lineTo((.1 + d) * b, (.5 + e) * c);
|
|
a.lineTo((.3 + d) * b, (.8 + e) * c);
|
|
d = .4;
|
|
e = 0;
|
|
T(a);
|
|
R(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
|
|
a.lineTo((.5 + d) * b, (.5 + e) * c);
|
|
a.lineTo((.1 + d) * b, (.5 + e) * c);
|
|
a.lineTo((.3 + d) * b, (.8 + e) * c);
|
|
d = .2;
|
|
e = -.3;
|
|
T(a);
|
|
R(a, (.3 + d) * b, (.8 + e) * c, !0, !0);
|
|
a.lineTo((.5 + d) * b, (.5 + e) * c);
|
|
a.lineTo((.1 + d) * b, (.5 + e) * c);
|
|
a.lineTo((.3 + d) * b, (.8 + e) * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
IrritationHazard: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .2 * b, 0 * c, !0);
|
|
a.lineTo(.5 * b, .3 * c);
|
|
a.lineTo(.8 *
|
|
b, 0 * c);
|
|
a.lineTo(1 * b, .2 * c);
|
|
a.lineTo(.7 * b, .5 * c);
|
|
a.lineTo(1 * b, .8 * c);
|
|
a.lineTo(.8 * b, 1 * c);
|
|
a.lineTo(.5 * b, .7 * c);
|
|
a.lineTo(.2 * b, 1 * c);
|
|
a.lineTo(0 * b, .8 * c);
|
|
a.lineTo(.3 * b, .5 * c);
|
|
a.lineTo(0 * b, .2 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.3, .3);
|
|
b.D = new Q(.7, .7);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
ElectricalHazard: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .37 * b, 0 * c, !0);
|
|
a.lineTo(.5 * b, .11 * c);
|
|
a.lineTo(.77 * b, .04 * c);
|
|
a.lineTo(.33 * b, .49 * c);
|
|
a.lineTo(1 * b, .37 * c);
|
|
a.lineTo(.63 * b, .86 * c);
|
|
a.lineTo(.77 * b, .91 * c);
|
|
a.lineTo(.34 * b, 1 * c);
|
|
a.lineTo(.34 * b, .78 * c);
|
|
a.lineTo(.44 * b, .8 * c);
|
|
a.lineTo(.65 *
|
|
b, .56 * c);
|
|
a.lineTo(0 * b, .68 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
FireHazard: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .1 * b, 1 * c, !0);
|
|
S(a, -.25 * b, .63 * c, .45 * b, .44 * c, .29 * b, 0 * c);
|
|
S(a, .48 * b, .17 * c, .54 * b, .35 * c, .51 * b, .42 * c);
|
|
S(a, .59 * b, .29 * c, .58 * b, .28 * c, .59 * b, .18 * c);
|
|
S(a, .8 * b, .34 * c, .88 * b, .43 * c, .75 * b, .6 * c);
|
|
S(a, .87 * b, .48 * c, .88 * b, .43 * c, .88 * b, .31 * c);
|
|
S(a, 1.17 * b, .76 * c, .82 * b, .8 * c, .9 * b, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
b.C = new Q(.05, .645);
|
|
b.D = new Q(.884, .908);
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnActivityLoop: function(a, b, c) {
|
|
a = z.v();
|
|
var d = 4 * (Math.SQRT2 - 1) / 3 * .5;
|
|
R(a, .65 * b, 1 * c, !1);
|
|
S(a, (1 - d + 0) * b, 1 * c, 1 * b, (.5 + d + 0) * c, 1 * b, .5 * c);
|
|
S(a, 1 * b, (.5 - d + 0) * c, (.5 + d + 0) * b, 0 * c, .5 * b, 0 * c);
|
|
S(a, (.5 - d + 0) * b, 0 * c, 0 * b, (.5 - d + 0) * c, 0 * b, .5 * c);
|
|
S(a, 0 * b, (.5 + d + 0) * c, (.5 - d + 0) * b, 1 * c, .35 * b, .98 * c);
|
|
a.moveTo(.25 * b, .8 * c);
|
|
a.lineTo(.35 * b, 1 * c);
|
|
a.lineTo(.1 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnActivityParallel: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(0, 1 * c);
|
|
a.moveTo(.5 * b, 0);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
a.moveTo(1 * b, 0);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnActivitySequential: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
a.lineTo(1 *
|
|
b, 0);
|
|
a.moveTo(0, .5 * c);
|
|
a.lineTo(1 * b, .5 * c);
|
|
a.moveTo(0, 1 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnActivityAdHoc: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
R(a, 1 * b, 1 * c, !1);
|
|
R(a, 0, .5 * c, !1);
|
|
S(a, .2 * b, .35 * c, .3 * b, .35 * c, .5 * b, .5 * c);
|
|
S(a, .7 * b, .65 * c, .8 * b, .65 * c, 1 * b, .5 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnActivityCompensation: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, .5 * c, !0);
|
|
a.lineTo(.5 * b, 0);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
a.lineTo(.5 * b, 1 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnTaskMessage: function(a,
|
|
b, c) {
|
|
a = z.v();
|
|
R(a, 0, .2 * c, !0);
|
|
a.lineTo(1 * b, .2 * c);
|
|
a.lineTo(1 * b, .8 * c);
|
|
a.lineTo(0, .8 * c);
|
|
a.lineTo(0, .8 * c);
|
|
T(a);
|
|
R(a, 0, .2 * c, !1);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
a.lineTo(1 * b, .2 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnTaskScript: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .7 * b, 1 * c, !0);
|
|
a.lineTo(.3 * b, 1 * c);
|
|
S(a, .6 * b, .5 * c, 0, .5 * c, .3 * b, 0);
|
|
a.lineTo(.7 * b, 0);
|
|
S(a, .4 * b, .5 * c, 1 * b, .5 * c, .7 * b, 1 * c);
|
|
T(a);
|
|
R(a, .45 * b, .73 * c, !1);
|
|
a.lineTo(.7 * b, .73 * c);
|
|
a.moveTo(.38 * b, .5 * c);
|
|
a.lineTo(.63 * b, .5 * c);
|
|
a.moveTo(.31 * b, .27 * c);
|
|
a.lineTo(.56 * b, .27 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnTaskUser: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
R(a, .335 * b, (1 - .555) * c, !0);
|
|
a.lineTo(.335 * b, .595 * c);
|
|
a.lineTo(.665 * b, .595 * c);
|
|
a.lineTo(.665 * b, (1 - .555) * c);
|
|
S(a, .88 * b, .46 * c, .98 * b, .54 * c, 1 * b, .68 * c);
|
|
a.lineTo(1 * b, 1 * c);
|
|
a.lineTo(0, 1 * c);
|
|
a.lineTo(0, .68 * c);
|
|
S(a, .02 * b, .54 * c, .12 * b, .46 * c, .335 * b, (1 - .555) * c);
|
|
a.lineTo(.365 * b, .405 * c);
|
|
var d = .5 - .285,
|
|
e = Math.PI / 4,
|
|
g = 4 * (1 - Math.cos(e)) / (3 * Math.sin(e)),
|
|
e = g * d,
|
|
g = g * d;
|
|
S(a, (.5 - (e + d) / 2) * b, (d + (d + g) / 2) * c, (.5 - d) * b, (d + g) * c, (.5 - d) * b, d * c);
|
|
S(a, (.5 - d) * b, (d - g) * c, (.5 - e) * b, (d - d) * c, .5 * b, (d - d) * c);
|
|
S(a, (.5 + e) * b, (d - d) * c, (.5 + d) * b, (d - g) * c, (.5 + d) * b, d * c);
|
|
S(a, (.5 + d) * b, (d + g) * c, (.5 + (e + d) / 2) * b, (d + (d + g) / 2) * c, .635 * b, .405 * c);
|
|
a.lineTo(.635 * b, .405 * c);
|
|
a.lineTo(.665 * b, (1 - .555) * c);
|
|
a.lineTo(.665 * b, .595 * c);
|
|
a.lineTo(.335 * b, .595 * c);
|
|
R(a, .2 * b, 1 * c, !1);
|
|
a.lineTo(.2 * b, .8 * c);
|
|
R(a, .8 * b, 1 * c, !1);
|
|
a.lineTo(.8 * b, .8 * c);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnEventConditional: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, .1 * b, 0, !0);
|
|
a.lineTo(.9 * b, 0);
|
|
a.lineTo(.9 * b, 1 * c);
|
|
a.lineTo(.1 * b, 1 * c);
|
|
T(a);
|
|
R(a, .2 * b, .2 * c, !1);
|
|
a.lineTo(.8 * b, .2 * c);
|
|
a.moveTo(.2 * b, .4 * c);
|
|
a.lineTo(.8 *
|
|
b, .4 * c);
|
|
a.moveTo(.2 * b, .6 * c);
|
|
a.lineTo(.8 * b, .6 * c);
|
|
a.moveTo(.2 * b, .8 * c);
|
|
a.lineTo(.8 * b, .8 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnEventError: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 1 * c, !0);
|
|
a.lineTo(.33 * b, 0);
|
|
a.lineTo(.66 * b, .5 * c);
|
|
a.lineTo(1 * b, 0);
|
|
a.lineTo(.66 * b, 1 * c);
|
|
a.lineTo(.33 * b, .5 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnEventEscalation: function(a, b, c) {
|
|
a = z.v();
|
|
R(a, 0, 0, !1);
|
|
R(a, 1 * b, 1 * c, !1);
|
|
R(a, .1 * b, 1 * c, !0);
|
|
a.lineTo(.5 * b, 0);
|
|
a.lineTo(.9 * b, 1 * c);
|
|
a.lineTo(.5 * b, .5 * c);
|
|
T(a);
|
|
b = a.q;
|
|
z.u(a);
|
|
return b
|
|
},
|
|
BpmnEventTimer: function(a, b, c) {
|
|
a =
|
|
z.v();
|
|
var d = .5 * Hd;
|
|
R(a, 1 * b, .5 * c, !0);
|
|
S(a, 1 * b, (.5 + d) * c, (.5 + d) * b, 1 * c, .5 * b, 1 * c);
|
|
S(a, (.5 - d) * b, 1 * c, 0, (.5 + d) * c, 0, .5 * c);
|
|
S(a, 0, (.5 - d) * c, (.5 - d) * b, 0, .5 * b, 0);
|
|
S(a, (.5 + d) * b, 0, 1 * b, (.5 - d) * c, 1 * b, .5 * c);
|
|
R(a, .5 * b, 0, !1);
|
|
a.lineTo(.5 * b, .15 * c);
|
|
a.moveTo(.5 * b, 1 * c);
|
|
a.lineTo(.5 * b, .85 * c);
|
|
a.moveTo(0, .5 * c);
|
|
a.lineTo(.15 * b, .5 * c);
|
|
a.moveTo(1 * b, .5 * c);
|
|
a.lineTo(.85 * b, .5 * c);
|
|
a.moveTo(.5 * b, .5 * c);
|
|
a.lineTo(.58 * b, .1 * c);
|
|
a.moveTo(.5 * b, .5 * c);
|
|
a.lineTo(.78 * b, .54 * c);
|
|
a.gb(!1);
|
|
b = a.q;
|
|
b.Xd = bj;
|
|
z.u(a);
|
|
return b
|
|
}
|
|
},
|
|
ep;
|
|
for (ep in so) so[ep.toLowerCase()] = ep;
|
|
var fp = {
|
|
"": "",
|
|
Standard: "F1 m 0,0 l 8,4 -8,4 2,-4 z",
|
|
Backward: "F1 m 8,0 l -2,4 2,4 -8,-4 z",
|
|
Triangle: "F1 m 0,0 l 8,4.62 -8,4.62 z",
|
|
BackwardTriangle: "F1 m 8,4 l 0,4 -8,-4 8,-4 0,4 z",
|
|
Boomerang: "F1 m 0,0 l 8,4 -8,4 4,-4 -4,-4 z",
|
|
BackwardBoomerang: "F1 m 8,0 l -8,4 8,4 -4,-4 4,-4 z",
|
|
SidewaysV: "m 0,0 l 8,4 -8,4 0,-1 6,-3 -6,-3 0,-1 z",
|
|
BackwardV: "m 8,0 l -8,4 8,4 0,-1 -6,-3 6,-3 0,-1 z",
|
|
OpenTriangle: "m 0,0 l 8,4 -8,4",
|
|
BackwardOpenTriangle: "m 8,0 l -8,4 8,4",
|
|
OpenTriangleLine: "m 0,0 l 8,4 -8,4 m 8.5,0 l 0,-8",
|
|
BackwardOpenTriangleLine: "m 8,0 l -8,4 8,4 m -8.5,0 l 0,-8",
|
|
OpenTriangleTop: "m 0,0 l 8,4 m 0,4",
|
|
BackwardOpenTriangleTop: "m 8,0 l -8,4 m 0,4",
|
|
OpenTriangleBottom: "m 0,8 l 8,-4",
|
|
BackwardOpenTriangleBottom: "m 0,4 l 8,4",
|
|
HalfTriangleTop: "F1 m 0,0 l 0,4 8,0 z m 0,8",
|
|
BackwardHalfTriangleTop: "F1 m 8,0 l 0,4 -8,0 z m 0,8",
|
|
HalfTriangleBottom: "F1 m 0,4 l 0,4 8,-4 z",
|
|
BackwardHalfTriangleBottom: "F1 m 8,4 l 0,4 -8,-4 z",
|
|
ForwardSemiCircle: "m 4,0 b 270 180 0 4 4",
|
|
BackwardSemiCircle: "m 4,8 b 90 180 0 -4 4",
|
|
Feather: "m 0,0 l 3,4 -3,4",
|
|
BackwardFeather: "m 3,0 l -3,4 3,4",
|
|
DoubleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",
|
|
BackwardDoubleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4",
|
|
TripleFeathers: "m 0,0 l 3,4 -3,4 m 3,-8 l 3,4 -3,4 m 3,-8 l 3,4 -3,4",
|
|
BackwardTripleFeathers: "m 3,0 l -3,4 3,4 m 3,-8 l -3,4 3,4 m 3,-8 l -3,4 3,4",
|
|
ForwardSlash: "m 0,8 l 5,-8",
|
|
BackSlash: "m 0,0 l 5,8",
|
|
DoubleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8",
|
|
DoubleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8",
|
|
TripleForwardSlash: "m 0,8 l 4,-8 m -2,8 l 4,-8 m -2,8 l 4,-8",
|
|
TripleBackSlash: "m 0,0 l 4,8 m -2,-8 l 4,8 m -2,-8 l 4,8",
|
|
Fork: "m 0,4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",
|
|
BackwardFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4",
|
|
LineFork: "m 0,0 l 0,8 m 0,-4 l 8,0 m -8,0 l 8,-4 m -8,4 l 8,4",
|
|
BackwardLineFork: "m 8,4 l -8,0 m 8,0 l -8,-4 m 8,4 l -8,4 m 8,-8 l 0,8",
|
|
CircleFork: "F1 m 6,4 b 0 360 -3 0 3 z m 0,0 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
|
|
BackwardCircleFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 6,0 b 0 360 -3 0 3",
|
|
CircleLineFork: "F1 m 6,4 b 0 360 -3 0 3 z m 1,-4 l 0,8 m 0,-4 l 6,0 m -6,0 l 6,-4 m -6,4 l 6,4",
|
|
BackwardCircleLineFork: "F1 m 0,4 l 6,0 m -6,-4 l 6,4 m -6,4 l 6,-4 m 0,-4 l 0,8 m 7,-4 b 0 360 -3 0 3",
|
|
Circle: "F1 m 8,4 b 0 360 -4 0 4 z",
|
|
Block: "F1 m 0,0 l 0,8 8,0 0,-8 z",
|
|
StretchedDiamond: "F1 m 0,3 l 5,-3 5,3 -5,3 -5,-3 z",
|
|
Diamond: "F1 m 0,4 l 4,-4 4,4 -4,4 -4,-4 z",
|
|
Chevron: "F1 m 0,0 l 5,0 3,4 -3,4 -5,0 3,-4 -3,-4 z",
|
|
StretchedChevron: "F1 m 0,0 l 8,0 3,4 -3,4 -8,0 3,-4 -3,-4 z",
|
|
NormalArrow: "F1 m 0,2 l 4,0 0,-2 4,4 -4,4 0,-2 -4,0 z",
|
|
X: "m 0,0 l 8,8 m 0,-8 l -8,8",
|
|
TailedNormalArrow: "F1 m 0,0 l 2,0 1,2 3,0 0,-2 2,4 -2,4 0,-2 -3,0 -1,2 -2,0 1,-4 -1,-4 z",
|
|
DoubleTriangle: "F1 m 0,0 l 4,4 -4,4 0,-8 z m 4,0 l 4,4 -4,4 0,-8 z",
|
|
BigEndArrow: "F1 m 0,0 l 5,2 0,-2 3,4 -3,4 0,-2 -5,2 0,-8 z",
|
|
ConcaveTailArrow: "F1 m 0,2 h 4 v -2 l 4,4 -4,4 v -2 h -4 l 2,-2 -2,-2 z",
|
|
RoundedTriangle: "F1 m 0,1 a 1,1 0 0 1 1,-1 l 7,3 a 0.5,1 0 0 1 0,2 l -7,3 a 1,1 0 0 1 -1,-1 l 0,-6 z",
|
|
SimpleArrow: "F1 m 1,2 l -1,-2 2,0 1,2 -1,2 -2,0 1,-2 5,0 0,-2 2,2 -2,2 0,-2 z",
|
|
AccelerationArrow: "F1 m 0,0 l 0,8 0.2,0 0,-8 -0.2,0 z m 2,0 l 0,8 1,0 0,-8 -1,0 z m 3,0 l 2,0 2,4 -2,4 -2,0 0,-8 z",
|
|
BoxArrow: "F1 m 0,0 l 4,0 0,2 2,0 0,-2 2,4 -2,4 0,-2 -2,0 0,2 -4,0 0,-8 z",
|
|
TriangleLine: "F1 m 8,4 l -8,-4 0,8 8,-4 z m 0.5,4 l 0,-8",
|
|
CircleEndedArrow: "F1 m 10,4 l -2,-3 0,2 -2,0 0,2 2,0 0,2 2,-3 z m -4,0 b 0 360 -3 0 3 z",
|
|
DynamicWidthArrow: "F1 m 0,3 l 2,0 2,-1 2,-2 2,4 -2,4 -2,-2 -2,-1 -2,0 0,-2 z",
|
|
EquilibriumArrow: "m 0,3 l 8,0 -3,-3 m 3,5 l -8,0 3,3",
|
|
FastForward: "F1 m 0,0 l 3.5,4 0,-4 3.5,4 0,-4 1,0 0,8 -1,0 0,-4 -3.5,4 0,-4 -3.5,4 0,-8 z",
|
|
Kite: "F1 m 0,4 l 2,-4 6,4 -6,4 -2,-4 z",
|
|
HalfArrowTop: "F1 m 0,0 l 4,4 4,0 -8,-4 z m 0,8",
|
|
HalfArrowBottom: "F1 m 0,8 l 4,-4 4,0 -8,4 z",
|
|
OpposingDirectionDoubleArrow: "F1 m 0,4 l 2,-4 0,2 4,0 0,-2 2,4 -2,4 0,-2 -4,0 0,2 -2,-4 z",
|
|
PartialDoubleTriangle: "F1 m 0,0 4,3 0,-3 4,4 -4,4 0,-3 -4,3 0,-8 z",
|
|
LineCircle: "F1 m 0,0 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
|
|
DoubleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
|
|
TripleLineCircle: "F1 m 0,0 l 0,8 m 2,-8 l 0,8 m 2,-8 l 0,8 m 7 -4 b 0 360 -3 0 3 z",
|
|
CircleLine: "F1 m 6 4 b 0 360 -3 0 3 z m 1,-4 l 0,8",
|
|
DiamondCircle: "F1 m 8,4 l -4,4 -4,-4 4,-4 4,4 m 8,0 b 0 360 -4 0 4 z",
|
|
PlusCircle: "F1 m 8,4 b 0 360 -4 0 4 l -8 0 z m -4 -4 l 0 8",
|
|
OpenRightTriangleTop: "m 8,0 l 0,4 -8,0 m 0,4",
|
|
OpenRightTriangleBottom: "m 8,8 l 0,-4 -8,0",
|
|
Line: "m 0,0 l 0,8",
|
|
DoubleLine: "m 0,0 l 0,8 m 2,0 l 0,-8",
|
|
TripleLine: "m 0,0 l 0,8 m 2,0 l 0,-8 m 2,0 l 0,8",
|
|
PentagonArrow: "F1 m 8,4 l -4,-4 -4,0 0,8 4,0 4,-4 z"
|
|
};
|
|
|
|
function wo(a) {
|
|
if (null !== fp) {
|
|
for (var b in fp) {
|
|
var c = sf(fp[b], !1);
|
|
ke[b] = c;
|
|
b.toLowerCase() !== b && (ke[b.toLowerCase()] = b)
|
|
}
|
|
fp = null
|
|
}
|
|
b = ke[a];
|
|
if (void 0 === b) {
|
|
b = a.toLowerCase();
|
|
if ("none" === b) return "None";
|
|
b = ke[b]
|
|
}
|
|
return "string" === typeof b ? b : b instanceof hf ? a : null
|
|
}
|
|
|
|
function D(a) {
|
|
0 === arguments.length ? I.call(this) : I.call(this, a);
|
|
this.T = 311807;
|
|
this.cl = this.si = "";
|
|
this.ss = this.ps = this.Cs = this.xr = null;
|
|
this.Es = "";
|
|
this.Wg = this.Ds = this.Hm = null;
|
|
this.rs = "";
|
|
this.Io = null;
|
|
this.qs = fe;
|
|
this.ts = "";
|
|
this.Jo = null;
|
|
this.we = "";
|
|
this.Fv = this.Aq = this.Ok = null;
|
|
this.Ki = (new N(NaN, NaN)).freeze();
|
|
this.Cr = "";
|
|
this.gl = null;
|
|
this.Dr = Zb;
|
|
this.Mr = Nd;
|
|
this.Fr = Od;
|
|
this.Tq = null;
|
|
this.yr = gp;
|
|
this.Jm = Md;
|
|
this.Im = "gray";
|
|
this.zg = 4;
|
|
this.AC = -1;
|
|
this.et = NaN;
|
|
this.oG = new w;
|
|
this.il = null;
|
|
this.Qj = NaN
|
|
}
|
|
z.Qa(D, I);
|
|
z.ia("Part", D);
|
|
D.prototype.cloneProtected = function(a) {
|
|
I.prototype.cloneProtected.call(this, a);
|
|
a.T = this.T & -4097 | 49152;
|
|
a.si = this.si;
|
|
a.cl = this.cl;
|
|
a.xr = this.xr;
|
|
a.Cs = this.Cs;
|
|
a.ps = this.ps;
|
|
a.ss = this.ss;
|
|
a.Es = this.Es;
|
|
a.Ds = this.Ds;
|
|
a.Wg = null;
|
|
a.rs = this.rs;
|
|
a.qs = this.qs.V();
|
|
a.ts = this.ts;
|
|
a.we = this.we;
|
|
a.Aq = this.Aq;
|
|
a.Ki.assign(this.Ki);
|
|
a.Cr = this.Cr;
|
|
a.Dr = this.Dr.V();
|
|
a.Mr = this.Mr.V();
|
|
a.Fr = this.Fr.V();
|
|
a.Tq = this.Tq;
|
|
a.yr = this.yr;
|
|
a.Jm = this.Jm.V();
|
|
a.Im = this.Im;
|
|
a.zg = this.zg;
|
|
a.et = this.et
|
|
};
|
|
D.prototype.ji = function(a) {
|
|
I.prototype.ji.call(this, a);
|
|
a.Nl();
|
|
a.Hm = null;
|
|
a.Io = null;
|
|
a.Jo = null;
|
|
a.gl = null;
|
|
a.il = null
|
|
};
|
|
D.prototype.toString = function() {
|
|
var a = z.kf(Object.getPrototypeOf(this)) + "#" + z.nd(this);
|
|
null !== this.data && (a += "(" + ka(this.data) + ")");
|
|
return a
|
|
};
|
|
D.LayoutNone = 0;
|
|
var vl;
|
|
D.LayoutAdded = vl = 1;
|
|
var Dl;
|
|
D.LayoutRemoved = Dl = 2;
|
|
D.LayoutShown = 4;
|
|
D.LayoutHidden = 8;
|
|
D.LayoutNodeSized = 16;
|
|
var gm;
|
|
D.LayoutGroupLayout = gm = 32;
|
|
D.LayoutNodeReplaced = 64;
|
|
var gp;
|
|
D.LayoutStandard = gp = vl | Dl | 28 | gm | 64;
|
|
D.LayoutAll = 16777215;
|
|
D.prototype.tn = function(a, b, c, d, e, g, h) {
|
|
var k = this.h;
|
|
null !== k && (a === Uf && "elements" === b ? e instanceof I ? wl(e, function(a) {
|
|
yl(k, a);
|
|
xl(k, a)
|
|
}) : e instanceof vk && Tl(k, e) : a === Vf && "elements" === b && (e instanceof I ? wl(e, function(a) {
|
|
Cl(k, a);
|
|
Bl(k, a)
|
|
}) : e instanceof vk && Ul(k, e)), k.Rc(a, b, c, d, e, g, h))
|
|
};
|
|
D.prototype.updateTargetBindings = D.prototype.Mb = function(a) {
|
|
I.prototype.Mb.call(this, a);
|
|
if (null !== this.data) {
|
|
a = this.va.o;
|
|
for (var b = a.length, c = 0; c < b; c++) {
|
|
var d = a[c];
|
|
d instanceof I && wl(d, function(a) {
|
|
null !== a.data && a.Mb()
|
|
})
|
|
}
|
|
}
|
|
};
|
|
D.prototype.updateRelationshipsFromData = function() {
|
|
var a = this.data;
|
|
if (null !== a) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.ha;
|
|
if (c instanceof V) {
|
|
var d = c.fn(a),
|
|
b = b.HH(d),
|
|
e = this.Va;
|
|
b !== e && (b = null !== e ? c.pb(e.data) : void 0, e = c.Pp, "function" === typeof e ? e(a, b) : a[e] = b, c.Lx(a, d))
|
|
}
|
|
}
|
|
}
|
|
};
|
|
z.w(D, {
|
|
Dw: "adornments"
|
|
}, function() {
|
|
return null === this.Wg ? Pa : this.Wg.VE
|
|
});
|
|
D.prototype.findAdornment = D.prototype.lp = function(a) {
|
|
u && z.g(a, "string", D, "findAdornment:category");
|
|
var b = this.Wg;
|
|
return null === b ? null : b.na(a)
|
|
};
|
|
D.prototype.addAdornment = D.prototype.ql = function(a, b) {
|
|
if (null !== b) {
|
|
u && (z.g(a, "string", D, "addAdornment:category"), z.l(b, da, D, "addAdornment:ad"));
|
|
var c = null,
|
|
d = this.Wg;
|
|
null !== d && (c = d.na(a));
|
|
if (c !== b) {
|
|
if (null !== c) {
|
|
var e = c.h;
|
|
null !== e && e.remove(c)
|
|
}
|
|
null === d && (this.Wg = d = new na("string", da));
|
|
b.si !== a && (b.nc = a);
|
|
d.add(a, b);
|
|
c = this.h;
|
|
null !== c && (c.add(b), b.data = this.data)
|
|
}
|
|
}
|
|
};
|
|
D.prototype.removeAdornment = D.prototype.rj = function(a) {
|
|
u && z.g(a, "string", D, "removeAdornment:category");
|
|
var b = this.Wg;
|
|
if (null !== b) {
|
|
var c = b.na(a);
|
|
if (null !== c) {
|
|
var d = c.h;
|
|
null !== d && d.remove(c)
|
|
}
|
|
b.remove(a);
|
|
0 === b.count && (this.Wg = null)
|
|
}
|
|
};
|
|
D.prototype.clearAdornments = D.prototype.pt = function() {
|
|
var a = this.Wg;
|
|
if (null !== a) {
|
|
for (var b = z.rb(), a = a.i; a.next();) b.push(a.key);
|
|
for (var a = b.length, c = 0; c < a; c++) this.rj(b[c]);
|
|
z.xa(b)
|
|
}
|
|
};
|
|
D.prototype.updateAdornments = function() {
|
|
var a = this.h;
|
|
if (null !== a) {
|
|
a: {
|
|
if (this.kb && this.GF) {
|
|
var b = this.vn;
|
|
if (!(null !== b && this.W.F() && this.isVisible() && b.nj() && b.W.F())) break a;
|
|
var c = this.lp("Selection");
|
|
if (null === c) {
|
|
c = this.gJ;
|
|
null === c && (c = this instanceof G ? a.wI : this instanceof F ? a.TH : a.MI);
|
|
if (!(c instanceof da)) break a;
|
|
gh(c);
|
|
c = c.copy();
|
|
null !== c && (c.nc = "Selection", c.fc = b)
|
|
}
|
|
if (null !== c) {
|
|
var d = c.placeholder;
|
|
if (null !== d) {
|
|
var e = b.gj(),
|
|
g = 0;
|
|
b instanceof X && (g = b.ub);
|
|
var h = z.Xl();
|
|
h.n((b.Ga.width + g) * e, (b.Ga.height +
|
|
g) * e);
|
|
d.Aa = h;
|
|
z.pk(h)
|
|
}
|
|
c.angle = b.Kl();
|
|
c.type !== Ki && (d = z.O(), c.location = b.fb(Zb, d), z.A(d));
|
|
this.ql("Selection", c);
|
|
break a
|
|
}
|
|
}
|
|
this.rj("Selection")
|
|
}
|
|
hp(this, a);
|
|
for (a = this.Dw; a.next();) b = a.value,
|
|
b.Mb(),
|
|
b.S()
|
|
}
|
|
};
|
|
|
|
function hp(a, b) {
|
|
b.hb.Ye.each(function(b) {
|
|
b.isEnabled && b.updateAdornments(a)
|
|
});
|
|
b.hb.updateAdornments(a)
|
|
}
|
|
z.w(D, {
|
|
layer: "layer"
|
|
}, function() {
|
|
return this.Fv
|
|
});
|
|
z.w(D, {
|
|
h: "diagram"
|
|
}, function() {
|
|
var a = this.Fv;
|
|
return null !== a ? a.h : null
|
|
});
|
|
z.defineProperty(D, {
|
|
If: "layerName"
|
|
}, function() {
|
|
return this.cl
|
|
}, function(a) {
|
|
var b = this.cl;
|
|
if (b !== a) {
|
|
z.g(a, "string", D, "layerName");
|
|
var c = this.h;
|
|
if (null === c || null !== c.Fl(a) && !c.lq)
|
|
if (this.cl = a, null !== c && c.yc(), this.j("layerName", b, a), b = this.layer, null !== b && b.name !== a && (c = b.h, null !== c && (a = c.Fl(a), null !== a && a !== b))) {
|
|
var d = b.Ve(-1, this, !0);
|
|
0 <= d && c.Rc(Vf, "parts", b, this, null, d, !0);
|
|
b.visible !== a.visible && this.wd(a.visible);
|
|
d = a.xp(99999999, this, !0);
|
|
0 <= d && c.Rc(Uf, "parts", a, null, this, !0, d);
|
|
d = this.Ut;
|
|
if (null !==
|
|
d) {
|
|
var e = c.$a;
|
|
c.$a = !0;
|
|
d(this, b, a);
|
|
c.$a = e
|
|
}
|
|
}
|
|
}
|
|
});
|
|
z.defineProperty(D, {
|
|
Ut: "layerChanged"
|
|
}, function() {
|
|
return this.xr
|
|
}, function(a) {
|
|
var b = this.xr;
|
|
b !== a && (null !== a && z.g(a, "function", D, "layerChanged"), this.xr = a, this.j("layerChanged", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
En: "zOrder"
|
|
}, function() {
|
|
return this.et
|
|
}, function(a) {
|
|
var b = this.et;
|
|
if (b !== a) {
|
|
z.g(a, "number", D, "zOrder");
|
|
this.et = a;
|
|
var c = this.layer;
|
|
null !== c && mk(c, -1, this);
|
|
this.j("zOrder", b, a);
|
|
a = this.h;
|
|
null !== a && a.ta()
|
|
}
|
|
});
|
|
D.prototype.invalidateAdornments = D.prototype.ae = function() {
|
|
var a = this.h;
|
|
null !== a && (Ik(a), 0 !== (this.T & 16384) !== !0 && (this.T |= 16384, a.Ce()))
|
|
};
|
|
|
|
function ik(a) {
|
|
0 !== (a.T & 16384) !== !1 && (a.updateAdornments(), a.T &= -16385)
|
|
}
|
|
|
|
function cn(a) {
|
|
if (!1 === ol(a)) {
|
|
var b = a.h;
|
|
null !== b && (b.qg.add(a), a instanceof E && !b.pa.qb && a.mf(), b.Ce());
|
|
ip(a, !0);
|
|
a.Fi()
|
|
}
|
|
}
|
|
|
|
function jp(a) {
|
|
if (!1 !== ol(a)) {
|
|
var b = a.position,
|
|
c = a.location;
|
|
c.F() && b.F() || kp(a, b, c);
|
|
var c = a.Xb,
|
|
d = c.copy();
|
|
c.Wa();
|
|
c.x = b.x;
|
|
c.y = b.y;
|
|
c.freeze();
|
|
a.vx(d, c);
|
|
ip(a, !1)
|
|
}
|
|
}
|
|
z.w(D, {
|
|
Zb: "locationObject"
|
|
}, function() {
|
|
if (null === this.gl) {
|
|
var a = this.sx;
|
|
"" !== a ? (a = this.oe(a), this.gl = null !== a ? a : this) : this.gl = this instanceof da ? this.type !== Ki && null !== this.placeholder ? this.placeholder : this : this
|
|
}
|
|
return this.gl.visible ? this.gl : this
|
|
});
|
|
z.defineProperty(D, {
|
|
GI: "minLocation"
|
|
}, function() {
|
|
return this.Mr
|
|
}, function(a) {
|
|
var b = this.Mr;
|
|
b.N(a) || (u && z.l(a, N, D, "minLocation"), this.Mr = a = a.V(), this.j("minLocation", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
BI: "maxLocation"
|
|
}, function() {
|
|
return this.Fr
|
|
}, function(a) {
|
|
var b = this.Fr;
|
|
b.N(a) || (u && z.l(a, N, D, "maxLocation"), this.Fr = a = a.V(), this.j("maxLocation", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
sx: "locationObjectName"
|
|
}, function() {
|
|
return this.Cr
|
|
}, function(a) {
|
|
var b = this.Cr;
|
|
b !== a && (u && z.g(a, "string", D, "locationObjectName"), this.Cr = a, this.gl = null, Ym(this), this.j("locationObjectName", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
of: "locationSpot"
|
|
}, function() {
|
|
return this.Dr
|
|
}, function(a) {
|
|
var b = this.Dr;
|
|
b.N(a) || (u && (z.l(a, Q, D, "locationSpot"), a.cd() || z.k("Part.locationSpot must be a specific Spot value, not: " + a)), this.Dr = a = a.V(), Ym(this), this.j("locationSpot", b, a))
|
|
});
|
|
D.prototype.move = function(a) {
|
|
this.position = a
|
|
};
|
|
D.prototype.moveTo = D.prototype.moveTo = function(a, b) {
|
|
var c = z.Tb(a, b);
|
|
this.move(c);
|
|
z.A(c)
|
|
};
|
|
D.prototype.isVisible = function() {
|
|
if (!this.visible) return !1;
|
|
var a = this.layer;
|
|
if (null !== a && !a.visible) return !1;
|
|
a = this.h;
|
|
if (null !== a && (a = a.Ua, a.nf && (a = a.ym.na(this), null !== a && a.Cx))) return !0;
|
|
a = this.Va;
|
|
return null === a || a.re && a.isVisible() ? !0 : !1
|
|
};
|
|
D.prototype.wd = function(a) {
|
|
var b = this.h;
|
|
a ? (this.I(4), this.ae(), null !== b && b.qg.add(this)) : (this.I(8), this.pt());
|
|
this.Nl();
|
|
null !== b && (b.yc(), b.ta())
|
|
};
|
|
D.prototype.findObject = D.prototype.oe = function(a) {
|
|
if (this.name === a) return this;
|
|
var b = this.il;
|
|
null === b && (this.il = b = new ma);
|
|
if (void 0 !== b[a]) return b[a];
|
|
for (var c = this.va.o, d = c.length, e = 0; e < d; e++) {
|
|
var g = c[e];
|
|
if (g.name === a) return b[a] = g;
|
|
if (g instanceof I)
|
|
if (null === g.Ii && null === g.sg) {
|
|
if (g = g.oe(a), null !== g) return b[a] = g
|
|
} else if (Rl(g) && (g = g.va.first(), null !== g && g.name === a)) return b[a] = g
|
|
}
|
|
return b[a] = null
|
|
};
|
|
|
|
function lp(a, b, c, d) {
|
|
void 0 === d && (d = new N);
|
|
c = c.Be() ? ec : c;
|
|
var e = b.Ga;
|
|
d.n(e.width * c.x + c.offsetX, e.height * c.y + c.offsetY);
|
|
if (null === b || b === a) return d;
|
|
b.transform.Cb(d);
|
|
for (b = b.U; null !== b && b !== a;) b.transform.Cb(d), b = b.U;
|
|
a.fl.Cb(d);
|
|
d.offset(-a.ud.x, -a.ud.y);
|
|
return d
|
|
}
|
|
D.prototype.ensureBounds = D.prototype.Bf = function() {
|
|
rj(this, Infinity, Infinity);
|
|
this.Lc()
|
|
};
|
|
|
|
function lk(a, b) {
|
|
var c = a.oG,
|
|
d;
|
|
isNaN(a.Qj) && (a.Qj = jo(a));
|
|
d = a.Qj;
|
|
var e = 2 * d;
|
|
if (!a.sk) return c.n(b.x - 1 - d, b.y - 1 - d, b.width + 2 + e, b.height + 2 + e), c;
|
|
d = b.x;
|
|
var e = b.y,
|
|
g = b.width,
|
|
h = b.height,
|
|
k = a.shadowBlur,
|
|
l = a.lJ,
|
|
g = g + k,
|
|
h = h + k;
|
|
d -= k / 2;
|
|
e -= k / 2;
|
|
0 < l.x ? g += l.x : (d += l.x, g -= l.x);
|
|
0 < l.y ? h += l.y : (e += l.y, h -= l.y);
|
|
c.n(d - 1, e - 1, g + 2, h + 2);
|
|
return c
|
|
}
|
|
D.prototype.Lc = function() {
|
|
this.Fi();
|
|
if (!1 === nl(this)) jp(this);
|
|
else {
|
|
var a = this.Xb,
|
|
b = z.kg();
|
|
b.assign(a);
|
|
a.Wa();
|
|
var c = hk(this);
|
|
this.$i(0, 0, this.ud.width, this.ud.height);
|
|
var d = this.position;
|
|
kp(this, d, this.location);
|
|
a.x = d.x;
|
|
a.y = d.y;
|
|
a.freeze();
|
|
this.vx(b, a);
|
|
Om(this, !1);
|
|
b.N(a) ? this.Jf(c) : !this.be() || eb(b.width, a.width) && eb(b.height, a.height) || 0 <= this.AC && this.I(16);
|
|
z.dc(b);
|
|
ip(this, !1)
|
|
}
|
|
};
|
|
D.prototype.vx = function(a, b) {
|
|
var c = this.h;
|
|
if (null !== c) {
|
|
var d = !1;
|
|
if (!1 === c.Ij && a.F()) {
|
|
var e = c.ad,
|
|
g = c.padding,
|
|
h = e.x + g.left,
|
|
k = e.y + g.top,
|
|
l = e.width - 2 * g.right,
|
|
e = e.height - 2 * g.bottom;
|
|
a.x > h && a.y > k && a.right < l && a.bottom < e && b.x > h && b.y > k && b.right < l && b.bottom < e && (d = !0)
|
|
}
|
|
0 !== (this.T & 65536) !== !0 && a.N(b) || zl(this, d, c);
|
|
c.ta();
|
|
a.N(b) || this.Nl()
|
|
}
|
|
};
|
|
z.defineProperty(D, {
|
|
location: "location"
|
|
}, function() {
|
|
return this.Ki
|
|
}, function(a) {
|
|
var b = this.Ki;
|
|
if (!b.N(a)) {
|
|
u && z.l(a, N, D, "location");
|
|
a = a.V();
|
|
var c;
|
|
c = a;
|
|
if (this instanceof G) c = !1;
|
|
else {
|
|
this.Ki = c;
|
|
if (!1 === nl(this)) {
|
|
cn(this);
|
|
var d = this.sb;
|
|
if (d.F()) {
|
|
var e = d.copy();
|
|
d.n(d.x + (c.x - b.x), d.y + (c.y - b.y));
|
|
mp(this, this.h, d, e);
|
|
this.j("position", e, d)
|
|
}
|
|
}
|
|
c = !0
|
|
}
|
|
c && this.j("location", b, a)
|
|
}
|
|
});
|
|
D.prototype.RA = function(a, b) {
|
|
if (this instanceof G || !a.F()) return !1;
|
|
var c = this.h;
|
|
if (null !== c && (mp(this, c, a, b), !0 === c.pa.qb)) return !0;
|
|
this.sb = a;
|
|
c = this.Ki;
|
|
if (c.F()) {
|
|
var d = c.copy();
|
|
c.n(c.x + (a.x - b.x), c.y + (a.y - b.y));
|
|
this.j("location", d, c)
|
|
}!1 === ol(this) && !1 === nl(this) && (cn(this), jp(this));
|
|
return !0
|
|
};
|
|
|
|
function mp(a, b, c, d) {
|
|
null === b || a instanceof da || (b = b.Ua, b.wc && Vj(b, a, "position", d.copy(), c.copy(), !1))
|
|
}
|
|
D.prototype.Nx = function(a, b) {
|
|
var c = this.Ki,
|
|
d = this.sb;
|
|
ol(this) || nl(this) ? c.n(NaN, NaN) : c.n(c.x + a - d.x, c.y + b - d.y);
|
|
d.n(a, b);
|
|
cn(this)
|
|
};
|
|
|
|
function kp(a, b, c) {
|
|
var d = z.O(),
|
|
e = a.of,
|
|
g = a.Zb;
|
|
e.Be() && z.k("determineOffset: Part's locationSpot must be real: " + e.toString());
|
|
var h = g.Ga,
|
|
k = g instanceof X ? g.ub : 0;
|
|
d.tu(0, 0, h.width + k, h.height + k, e);
|
|
if (g !== a)
|
|
for (d.offset(-k / 2, -k / 2), g.transform.Cb(d), e = g.U; null !== e && e !== a;) e.transform.Cb(d), e = e.U;
|
|
a.fl.Cb(d);
|
|
d.offset(-a.ud.x, -a.ud.y);
|
|
e = a.h;
|
|
c.F() ? (g = b.x, h = b.y, b.n(c.x - d.x, c.y - d.y), null !== e && (c = e.Ua, (k = c.Jj) || !c.wc || a instanceof da || Vj(c, a, "position", new N(g, h), b, !1), k || b.x === g && b.y === h || (k = e.Bb, e.Bb = !0, a.j("position",
|
|
new N(g, h), b), e.Bb = k))) : b.F() && (g = c.copy(), c.n(b.x + d.x, b.y + d.y), c.N(g) || null === e || (k = e.Bb, e.Bb = !0, a.j("location", g, c), e.Bb = k));
|
|
z.A(d);
|
|
a.Fi()
|
|
}
|
|
|
|
function zl(a, b, c) {
|
|
Pm(a, !1);
|
|
a instanceof E && nm(c, a);
|
|
a.layer.Nc || b || c.yc();
|
|
b = a.Xb;
|
|
var d = c.xb;
|
|
d.F() ? (hk(a) ? Hb(b, d) || a.Jf(!1) : b.Ig(d) && a.Jf(!0), a.updateAdornments()) : c.Yk = !0
|
|
}
|
|
D.prototype.Ql = function() {
|
|
return !0
|
|
};
|
|
|
|
function jk(a, b) {
|
|
var c = a.Xb;
|
|
if (0 !== c.width && 0 !== c.height && !isNaN(c.x) && !isNaN(c.y) && a.isVisible()) {
|
|
var d = a.transform;
|
|
null !== a.uc && (Um(a, b, a.uc, !0, !0), b.fillRect(c.x, c.y, c.width, c.height));
|
|
null === a.uc && null === a.Nb && (Um(a, b, "rgba(0,0,0,0.4)", !0, !1), b.fillRect(c.x, c.y, c.width, c.height));
|
|
null !== a.Nb && (d.Pt() || b.transform(d.m11, d.m12, d.m21, d.m22, d.dx, d.dy), c = a.Ga, Um(a, b, a.Nb, !0, !1), b.fillRect(0, 0, c.width, c.height), d.Pt() || (c = 1 / (d.m11 * d.m22 - d.m12 * d.m21), b.transform(d.m22 * c, -d.m12 * c, -d.m21 * c, d.m11 * c, c * (d.m21 *
|
|
d.dy - d.m22 * d.dx), c * (d.m12 * d.dx - d.m11 * d.dy))))
|
|
}
|
|
}
|
|
D.prototype.be = function() {
|
|
return !0
|
|
};
|
|
z.defineProperty(D, {
|
|
nc: "category"
|
|
}, function() {
|
|
return this.si
|
|
}, function(a) {
|
|
var b = this.si;
|
|
if (b !== a) {
|
|
z.g(a, "string", D, "category");
|
|
var c = this.h,
|
|
d = this.data,
|
|
e = null;
|
|
if (null !== c && null !== d && !(this instanceof da)) {
|
|
var g = c.ha.pa;
|
|
g.isEnabled && !g.qb && (e = this.clone(), e.va.$c(this.va))
|
|
}
|
|
this.si = a;
|
|
this.j("category", b, a);
|
|
null === c || null === d || this instanceof da ? (e = this.Wf, null !== e && (a = e.Wg, null !== a && a.remove(b), e.ql(this.nc, this))) : (g = c.ha, g.pa.qb || (this instanceof G ? (g instanceof V ? g.IF(d, a) : g instanceof ng && g.jJ(d,
|
|
a), c = am(c, a), null !== c && (gh(c), c = c.copy(), null !== c && np(this, c, b, a))) : (null !== g && g.Jx(d, a), c = Yl(c, d, a), null !== c && (gh(c), c = c.copy(), null === c || c instanceof G || (c.location = this.location, np(this, c, b, a)))), null !== e && (b = this.clone(), b.va.$c(this.va), this.j("self", e, b))))
|
|
}
|
|
});
|
|
z.defineProperty(D, {
|
|
self: "self"
|
|
}, function() {
|
|
return this
|
|
}, function(a) {
|
|
np(this, a, this.nc, a.nc)
|
|
});
|
|
var op = !1;
|
|
|
|
function np(a, b, c, d) {
|
|
b.constructor === a.constructor || op || (op = !0, z.trace('Should not change the class of the Part when changing category from "' + c + '" to "' + d + '"'), z.trace(" Old class: " + z.kf(a) + ", new class: " + z.kf(b) + ", part: " + a.toString()));
|
|
a.pt();
|
|
var e = a.data;
|
|
c = a.If;
|
|
var g = a.kb,
|
|
h = a.wh,
|
|
k = !0,
|
|
l = !0,
|
|
m = !1;
|
|
if (a instanceof E) var n = a,
|
|
k = n.mj,
|
|
l = n.vd,
|
|
m = n.Cu;
|
|
b.ji(a);
|
|
b.cloneProtected(a);
|
|
a.si = d;
|
|
a.S();
|
|
a.ta();
|
|
b = a.h;
|
|
d = !0;
|
|
null !== b && (d = b.Bb, b.Bb = !0);
|
|
a.fe = e;
|
|
null !== e && a.Mb();
|
|
null !== b && (b.Bb = d);
|
|
e = a.If;
|
|
e !== c && (a.cl = c,
|
|
a.If = e);
|
|
a instanceof E && (n = a, n.mj = k, n.vd = l, n.Cu = m, n.be() && n.I(64));
|
|
a.kb = g;
|
|
a.wh = h
|
|
}
|
|
D.prototype.canCopy = function() {
|
|
if (!this.$D) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.kk) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.kk ? !0 : !1
|
|
};
|
|
D.prototype.canDelete = function() {
|
|
if (!this.dE) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.Sm) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.Sm ? !0 : !1
|
|
};
|
|
D.prototype.canEdit = function() {
|
|
if (!this.RF) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.Hw) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.Hw ? !0 : !1
|
|
};
|
|
D.prototype.canGroup = function() {
|
|
if (!this.CE) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.Ew) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.Ew ? !0 : !1
|
|
};
|
|
D.prototype.canMove = function() {
|
|
if (!this.dF) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.ul) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.ul ? !0 : !1
|
|
};
|
|
D.prototype.canReshape = function() {
|
|
if (!this.sF) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.Fw) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.Fw ? !0 : !1
|
|
};
|
|
D.prototype.canResize = function() {
|
|
if (!this.tF) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.mt) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.mt ? !0 : !1
|
|
};
|
|
D.prototype.canRotate = function() {
|
|
if (!this.yF) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.Gw) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.Gw ? !0 : !1
|
|
};
|
|
D.prototype.canSelect = function() {
|
|
if (!this.vk) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.xf) return !1;
|
|
a = a.h;
|
|
return null === a ? !0 : a.xf ? !0 : !1
|
|
};
|
|
z.defineProperty(D, {
|
|
$D: "copyable"
|
|
}, function() {
|
|
return 0 !== (this.T & 1)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 1);
|
|
b !== a && (u && z.g(a, "boolean", D, "copyable"), this.T ^= 1, this.j("copyable", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
dE: "deletable"
|
|
}, function() {
|
|
return 0 !== (this.T & 2)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 2);
|
|
b !== a && (u && z.g(a, "boolean", D, "deletable"), this.T ^= 2, this.j("deletable", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
RF: "textEditable"
|
|
}, function() {
|
|
return 0 !== (this.T & 4)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 4);
|
|
b !== a && (u && z.g(a, "boolean", D, "textEditable"), this.T ^= 4, this.j("textEditable", b, a), this.ae())
|
|
});
|
|
z.defineProperty(D, {
|
|
CE: "groupable"
|
|
}, function() {
|
|
return 0 !== (this.T & 8)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 8);
|
|
b !== a && (u && z.g(a, "boolean", D, "groupable"), this.T ^= 8, this.j("groupable", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
dF: "movable"
|
|
}, function() {
|
|
return 0 !== (this.T & 16)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 16);
|
|
b !== a && (u && z.g(a, "boolean", D, "movable"), this.T ^= 16, this.j("movable", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
GF: "selectionAdorned"
|
|
}, function() {
|
|
return 0 !== (this.T & 32)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 32);
|
|
b !== a && (u && z.g(a, "boolean", D, "selectionAdorned"), this.T ^= 32, this.j("selectionAdorned", b, a), this.ae())
|
|
});
|
|
z.defineProperty(D, {
|
|
jx: "isInDocumentBounds"
|
|
}, function() {
|
|
return 0 !== (this.T & 64)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 64);
|
|
if (b !== a) {
|
|
u && z.g(a, "boolean", D, "isInDocumentBounds");
|
|
this.T ^= 64;
|
|
var c = this.h;
|
|
null !== c && c.yc();
|
|
this.j("isInDocumentBounds", b, a)
|
|
}
|
|
});
|
|
z.defineProperty(D, {
|
|
jA: "isLayoutPositioned"
|
|
}, function() {
|
|
return 0 !== (this.T & 128)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 128);
|
|
b !== a && (u && z.g(a, "boolean", D, "isLayoutPositioned"), this.T ^= 128, this.j("isLayoutPositioned", b, a), this.I(a ? 4 : 8))
|
|
});
|
|
z.defineProperty(D, {
|
|
vk: "selectable"
|
|
}, function() {
|
|
return 0 !== (this.T & 256)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 256);
|
|
b !== a && (u && z.g(a, "boolean", D, "selectable"), this.T ^= 256, this.j("selectable", b, a), this.ae())
|
|
});
|
|
z.defineProperty(D, {
|
|
sF: "reshapable"
|
|
}, function() {
|
|
return 0 !== (this.T & 512)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 512);
|
|
b !== a && (u && z.g(a, "boolean", D, "reshapable"), this.T ^= 512, this.j("reshapable", b, a), this.ae())
|
|
});
|
|
z.defineProperty(D, {
|
|
tF: "resizable"
|
|
}, function() {
|
|
return 0 !== (this.T & 1024)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 1024);
|
|
b !== a && (u && z.g(a, "boolean", D, "resizable"), this.T ^= 1024, this.j("resizable", b, a), this.ae())
|
|
});
|
|
z.defineProperty(D, {
|
|
yF: "rotatable"
|
|
}, function() {
|
|
return 0 !== (this.T & 2048)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 2048);
|
|
b !== a && (u && z.g(a, "boolean", D, "rotatable"), this.T ^= 2048, this.j("rotatable", b, a), this.ae())
|
|
});
|
|
z.defineProperty(D, {
|
|
kb: "isSelected"
|
|
}, function() {
|
|
return 0 !== (this.T & 4096)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 4096);
|
|
if (b !== a) {
|
|
u && z.g(a, "boolean", D, "isSelected");
|
|
var c = this.h;
|
|
if (!a || this.canSelect() && !(null !== c && c.selection.count >= c.CI)) {
|
|
this.T ^= 4096;
|
|
var d = !1;
|
|
if (null !== c) {
|
|
d = c.Bb;
|
|
c.Bb = !0;
|
|
var e = c.selection;
|
|
e.Wa();
|
|
a ? e.add(this) : e.remove(this);
|
|
e.freeze()
|
|
}
|
|
this.j("isSelected", b, a);
|
|
this.ae();
|
|
a = this.hJ;
|
|
null !== a && a(this);
|
|
null !== c && (c.Ce(), c.Bb = d)
|
|
}
|
|
}
|
|
});
|
|
z.defineProperty(D, {
|
|
wh: "isHighlighted"
|
|
}, function() {
|
|
return 0 !== (this.T & 524288)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 524288);
|
|
if (b !== a) {
|
|
u && z.g(a, "boolean", D, "isHighlighted");
|
|
this.T ^= 524288;
|
|
var c = this.h;
|
|
null !== c && (c = c.hn, c.Wa(), a ? c.add(this) : c.remove(this), c.freeze());
|
|
this.j("isHighlighted", b, a);
|
|
this.ta()
|
|
}
|
|
});
|
|
z.defineProperty(D, {
|
|
sk: "isShadowed"
|
|
}, function() {
|
|
return 0 !== (this.T & 8192)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 8192);
|
|
b !== a && (u && z.g(a, "boolean", D, "isShadowed"), this.T ^= 8192, this.j("isShadowed", b, a), this.ta())
|
|
});
|
|
|
|
function ol(a) {
|
|
return 0 !== (a.T & 32768)
|
|
}
|
|
|
|
function ip(a, b) {
|
|
a.T = b ? a.T | 32768 : a.T & -32769
|
|
}
|
|
|
|
function Pm(a, b) {
|
|
a.T = b ? a.T | 65536 : a.T & -65537
|
|
}
|
|
|
|
function hk(a) {
|
|
return 0 !== (a.T & 131072)
|
|
}
|
|
D.prototype.Jf = function(a) {
|
|
this.T = a ? this.T | 131072 : this.T & -131073
|
|
};
|
|
|
|
function pp(a, b) {
|
|
a.T = b ? a.T | 1048576 : a.T & -1048577
|
|
}
|
|
z.defineProperty(D, {
|
|
IE: "isAnimated"
|
|
}, function() {
|
|
return 0 !== (this.T & 262144)
|
|
}, function(a) {
|
|
var b = 0 !== (this.T & 262144);
|
|
b !== a && (u && z.g(a, "boolean", D, "isAnimated"), this.T ^= 262144, this.j("isAnimated", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
Ix: "selectionObjectName"
|
|
}, function() {
|
|
return this.Es
|
|
}, function(a) {
|
|
var b = this.Es;
|
|
b !== a && (u && z.g(a, "string", D, "selectionObjectName"), this.Es = a, this.Hm = null, this.j("selectionObjectName", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
gJ: "selectionAdornmentTemplate"
|
|
}, function() {
|
|
return this.Cs
|
|
}, function(a) {
|
|
var b = this.Cs;
|
|
b !== a && (u && z.l(a, da, D, "selectionAdornmentTemplate"), this instanceof G && (a.type = Ki), this.Cs = a, this.j("selectionAdornmentTemplate", b, a))
|
|
});
|
|
z.w(D, {
|
|
vn: "selectionObject"
|
|
}, function() {
|
|
if (null === this.Hm) {
|
|
var a = this.Ix;
|
|
null !== a && "" !== a ? (a = this.oe(a), this.Hm = null !== a ? a : this) : this instanceof G ? (a = this.path, this.Hm = null !== a ? a : this) : this.Hm = this
|
|
}
|
|
return this.Hm
|
|
});
|
|
z.defineProperty(D, {
|
|
hJ: "selectionChanged"
|
|
}, function() {
|
|
return this.Ds
|
|
}, function(a) {
|
|
var b = this.Ds;
|
|
b !== a && (null !== a && z.g(a, "function", D, "selectionChanged"), this.Ds = a, this.j("selectionChanged", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
uF: "resizeAdornmentTemplate"
|
|
}, function() {
|
|
return this.ps
|
|
}, function(a) {
|
|
var b = this.ps;
|
|
b !== a && (u && z.l(a, da, D, "resizeAdornmentTemplate"), this.ps = a, this.j("resizeAdornmentTemplate", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
wF: "resizeObjectName"
|
|
}, function() {
|
|
return this.rs
|
|
}, function(a) {
|
|
var b = this.rs;
|
|
b !== a && (u && z.g(a, "string", D, "resizeObjectName"), this.rs = a, this.Io = null, this.j("resizeObjectName", b, a))
|
|
});
|
|
z.w(D, {
|
|
vF: "resizeObject"
|
|
}, function() {
|
|
if (null === this.Io) {
|
|
var a = this.wF;
|
|
null !== a && "" !== a ? (a = this.oe(a), this.Io = null !== a ? a : this) : this.Io = this
|
|
}
|
|
return this.Io
|
|
});
|
|
z.defineProperty(D, {
|
|
ZI: "resizeCellSize"
|
|
}, function() {
|
|
return this.qs
|
|
}, function(a) {
|
|
var b = this.qs;
|
|
b.N(a) || (u && z.l(a, Ea, D, "resizeCellSize"), this.qs = a = a.V(), this.j("resizeCellSize", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
aJ: "rotateAdornmentTemplate"
|
|
}, function() {
|
|
return this.ss
|
|
}, function(a) {
|
|
var b = this.ss;
|
|
b !== a && (u && z.l(a, da, D, "rotateAdornmentTemplate"), this.ss = a, this.j("rotateAdornmentTemplate", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
bJ: "rotateObjectName"
|
|
}, function() {
|
|
return this.ts
|
|
}, function(a) {
|
|
var b = this.ts;
|
|
b !== a && (u && z.g(a, "string", D, "rotateObjectName"), this.ts = a, this.Jo = null, this.j("rotateObjectName", b, a))
|
|
});
|
|
z.w(D, {
|
|
zF: "rotateObject"
|
|
}, function() {
|
|
if (null === this.Jo) {
|
|
var a = this.bJ;
|
|
null !== a && "" !== a ? (a = this.oe(a), this.Jo = null !== a ? a : this) : this.Jo = this
|
|
}
|
|
return this.Jo
|
|
});
|
|
z.defineProperty(D, {
|
|
text: "text"
|
|
}, function() {
|
|
return this.we
|
|
}, function(a) {
|
|
var b = this.we;
|
|
b !== a && (u && z.g(a, "string", D, "text"), this.we = a, this.j("text", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
Va: "containingGroup"
|
|
}, function() {
|
|
return this.Ok
|
|
}, function(a) {
|
|
if (this.be()) {
|
|
var b = this.Ok;
|
|
if (b !== a) {
|
|
u && null !== a && z.l(a, F, D, "containingGroup");
|
|
null === a || this !== a && !a.li(this) || (this === a && z.k("Cannot make a Group a member of itself: " + this.toString()), z.k("Cannot make a Group indirectly contain itself: " + this.toString() + " already contains " + a.toString()));
|
|
this.I(Dl);
|
|
var c = this.h;
|
|
null !== b ? qp(b, this) : this instanceof F && null !== c && c.ol.remove(this);
|
|
this.Ok = a;
|
|
null !== a ? rp(a, this) : this instanceof
|
|
F && null !== c && c.ol.add(this);
|
|
this.I(vl);
|
|
if (null !== c) {
|
|
var d = this.data,
|
|
e = c.ha;
|
|
null !== d && e instanceof V && e.Lx(d, e.pb(null !== a ? a.data : null))
|
|
}
|
|
d = this.WD;
|
|
null !== d && (e = !0, null !== c && (e = c.$a, c.$a = !0), d(this, b, a), null !== c && (c.$a = e));
|
|
if (this instanceof F)
|
|
for (c = new K(D), eh(c, this, !0, 0, !0), c = c.i; c.next();)
|
|
if (d = c.value, d instanceof E)
|
|
for (d = d.ee; d.next();) Wl(d.value);
|
|
if (this instanceof E)
|
|
for (d = this.ee; d.next();) Wl(d.value);
|
|
this.j("containingGroup", b, a);
|
|
null !== a && (b = a.layer, null !== b && mk(b, -1, a))
|
|
}
|
|
} else z.k("cannot set the Part.containingGroup of a Link or Adornment")
|
|
});
|
|
f = D.prototype;
|
|
f.Nl = function() {
|
|
var a = this.Va;
|
|
null !== a && (a.S(), null !== a.Lb && a.Lb.S(), a.mf())
|
|
};
|
|
f.ta = function() {
|
|
var a = this.h;
|
|
null !== a && !nl(this) && !ol(this) && this.isVisible() && this.Xb.F() && a.ta(lk(this, this.Xb))
|
|
};
|
|
f.Kt = function(a) {
|
|
a || (a = this.Ok, null !== a && rp(a, this))
|
|
};
|
|
f.Lt = function(a) {
|
|
a || (a = this.Ok, null !== a && qp(a, this))
|
|
};
|
|
f.cn = function() {
|
|
var a = this.data;
|
|
if (null !== a) {
|
|
var b = this.h;
|
|
null !== b && (b = b.ha, null !== b && b.Ex(a))
|
|
}
|
|
};
|
|
z.defineProperty(D, {
|
|
WD: "containingGroupChanged"
|
|
}, function() {
|
|
return this.Aq
|
|
}, function(a) {
|
|
var b = this.Aq;
|
|
b !== a && (null !== a && z.g(a, "function", D, "containingGroupChanged"), this.Aq = a, this.j("containingGroupChanged", b, a))
|
|
});
|
|
D.prototype.findSubGraphLevel = function() {
|
|
return sp(this, this)
|
|
};
|
|
|
|
function sp(a, b) {
|
|
var c = b.Va;
|
|
return null !== c ? 1 + sp(a, c) : b instanceof E && (c = b.Nd, null !== c) ? sp(a, c) : 0
|
|
}
|
|
D.prototype.findTopLevelPart = function() {
|
|
return tp(this, this)
|
|
};
|
|
|
|
function tp(a, b) {
|
|
var c = b.Va;
|
|
return null !== c ? tp(a, c) : b instanceof E && (c = b.Nd, null !== c) ? tp(a, c) : b
|
|
}
|
|
z.w(D, {
|
|
Bp: "isTopLevel"
|
|
}, function() {
|
|
return null !== this.Va || this instanceof E && this.Df ? !1 : !0
|
|
});
|
|
D.prototype.isMemberOf = D.prototype.li = function(a) {
|
|
return a instanceof F ? up(this, this, a) : !1
|
|
};
|
|
|
|
function up(a, b, c) {
|
|
if (b === c || null === c) return !1;
|
|
var d = b.Va;
|
|
return null === d || d !== c && !up(a, d, c) ? b instanceof E && (b = b.Nd, null !== b) ? up(a, b, c) : !1 : !0
|
|
}
|
|
D.prototype.findCommonContainingGroup = D.prototype.DH = function(a) {
|
|
if (null === a) return null;
|
|
u && z.l(a, D, D, "findCommonContainingGroup:other");
|
|
if (this === a) return this.Va;
|
|
for (var b = this; null !== b;) b instanceof F && pp(b, !0), b = b.Va;
|
|
for (var c = null, b = a; null !== b;) {
|
|
if (0 !== (b.T & 1048576)) {
|
|
c = b;
|
|
break
|
|
}
|
|
b = b.Va
|
|
}
|
|
for (b = this; null !== b;) b instanceof F && pp(b, !1), b = b.Va;
|
|
return c
|
|
};
|
|
z.defineProperty(D, {
|
|
rI: "layoutConditions"
|
|
}, function() {
|
|
return this.yr
|
|
}, function(a) {
|
|
var b = this.yr;
|
|
b !== a && (u && z.g(a, "number", D, "layoutConditions"), this.yr = a, this.j("layoutConditions", b, a))
|
|
});
|
|
D.prototype.canLayout = function() {
|
|
if (!this.jA || !this.isVisible()) return !1;
|
|
var a = this.layer;
|
|
return null !== a && a.Nc || this instanceof E && this.Df ? !1 : !0
|
|
};
|
|
D.prototype.invalidateLayout = D.prototype.I = function(a) {
|
|
void 0 === a && (a = 16777215);
|
|
var b;
|
|
this.jA && 0 !== (a & this.rI) ? (b = this.layer, null !== b && b.Nc || this instanceof E && this.Df ? b = !1 : (b = this.h, b = null !== b && b.pa.qb ? !1 : !0)) : b = !1;
|
|
if (b)
|
|
if (b = this.Ok, null !== b) {
|
|
var c = b.Sb;
|
|
null !== c ? c.I() : b.I(a)
|
|
} else a = this.h, null !== a && (c = a.Sb, null !== c && c.I())
|
|
};
|
|
|
|
function Al(a) {
|
|
if (!a.isVisible()) return !1;
|
|
a = a.layer;
|
|
return null !== a && a.Nc ? !1 : !0
|
|
}
|
|
z.defineProperty(D, {
|
|
iE: "dragComputation"
|
|
}, function() {
|
|
return this.Tq
|
|
}, function(a) {
|
|
var b = this.Tq;
|
|
b !== a && (null !== a && z.g(a, "function", D, "dragComputation"), this.Tq = a, this.j("dragComputation", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
lJ: "shadowOffset"
|
|
}, function() {
|
|
return this.Jm
|
|
}, function(a) {
|
|
var b = this.Jm;
|
|
b.N(a) || (u && z.l(a, N, D, "shadowOffset"), this.Jm = a = a.V(), this.ta(), this.j("shadowOffset", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
shadowColor: "shadowColor"
|
|
}, function() {
|
|
return this.Im
|
|
}, function(a) {
|
|
var b = this.Im;
|
|
b !== a && (u && z.g(a, "string", D, "shadowColor"), this.Im = a, this.ta(), this.j("shadowColor", b, a))
|
|
});
|
|
z.defineProperty(D, {
|
|
shadowBlur: "shadowBlur"
|
|
}, function() {
|
|
return this.zg
|
|
}, function(a) {
|
|
var b = this.zg;
|
|
b !== a && (u && z.g(a, "number", D, "shadowBlur"), this.zg = a, this.ta(), this.j("shadowBlur", b, a))
|
|
});
|
|
|
|
function da(a) {
|
|
0 === arguments.length ? D.call(this, ej) : D.call(this, a);
|
|
this.T &= -257;
|
|
this.cl = "Adornment";
|
|
this.Lb = this.Zg = this.Ib = null
|
|
}
|
|
z.Qa(da, D);
|
|
z.ia("Adornment", da);
|
|
da.prototype.toString = function() {
|
|
var a = this.Wf;
|
|
return "Adornment(" + this.nc + ")" + (null !== a ? a.toString() : "")
|
|
};
|
|
da.prototype.updateRelationshipsFromData = function() {};
|
|
da.prototype.on = function(a) {
|
|
var b = this.fc.ca,
|
|
c = this.fc;
|
|
if (b instanceof G && c instanceof X) {
|
|
var d = b.path,
|
|
c = d.ab;
|
|
b.on(a);
|
|
c = d.ab;
|
|
a = this.va.o;
|
|
b = a.length;
|
|
for (d = 0; d < b; d++) {
|
|
var e = a[d];
|
|
e.Ff && e instanceof X && (e.ab = c)
|
|
}
|
|
}
|
|
};
|
|
z.w(da, {
|
|
placeholder: "placeholder"
|
|
}, function() {
|
|
return this.Lb
|
|
});
|
|
z.defineProperty(da, {
|
|
fc: "adornedObject"
|
|
}, function() {
|
|
return this.Ib
|
|
}, function(a) {
|
|
u && null !== a && z.l(a, O, D, "adornedObject:value");
|
|
var b = this.Wf,
|
|
c = null;
|
|
null !== a && (c = a.ca);
|
|
null === b || null !== a && b === c || b.rj(this.nc);
|
|
this.Ib = a;
|
|
null !== c && c.ql(this.nc, this)
|
|
});
|
|
z.w(da, {
|
|
Wf: "adornedPart"
|
|
}, function() {
|
|
var a = this.Ib;
|
|
return null !== a ? a.ca : null
|
|
});
|
|
da.prototype.Ql = function() {
|
|
var a = this.Ib;
|
|
if (null === a) return !0;
|
|
a = a.ca;
|
|
return null === a || !nl(a)
|
|
};
|
|
da.prototype.be = function() {
|
|
return !1
|
|
};
|
|
z.w(da, {
|
|
Va: "containingGroup"
|
|
}, function() {
|
|
return null
|
|
});
|
|
da.prototype.tn = function(a, b, c, d, e, g, h) {
|
|
if (a === Uf && "elements" === b)
|
|
if (e instanceof Zi) {
|
|
var k = e;
|
|
null === this.Lb ? this.Lb = k : this.Lb !== k && z.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")
|
|
} else e instanceof I && (k = e.yt(function(a) {
|
|
return a instanceof Zi
|
|
}), k instanceof Zi && (null === this.Lb ? this.Lb = k : this.Lb !== k && z.k("Cannot insert a second Placeholder into the visual tree of an Adornment.")));
|
|
else a === Vf && "elements" === b && null !== this.Lb && (d === this.Lb ? this.Lb = null : d instanceof I &&
|
|
this.Lb.Pl(d) && (this.Lb = null));
|
|
D.prototype.tn.call(this, a, b, c, d, e, g, h)
|
|
};
|
|
da.prototype.updateAdornments = function() {};
|
|
da.prototype.cn = function() {};
|
|
|
|
function E(a) {
|
|
0 === arguments.length ? D.call(this, ej) : D.call(this, a);
|
|
this.mc = new J(G);
|
|
this.wo = this.el = this.Ar = this.zr = null;
|
|
this.rr = !0;
|
|
this.bt = !1;
|
|
this.Ys = null;
|
|
this.sq = this.sr = !0;
|
|
this.tq = Ld;
|
|
this.Dd = this.Hh = null;
|
|
this.hs = vp;
|
|
this.hk = !1
|
|
}
|
|
z.Qa(E, D);
|
|
z.ia("Node", E);
|
|
E.prototype.cloneProtected = function(a) {
|
|
D.prototype.cloneProtected.call(this, a);
|
|
a.zr = this.zr;
|
|
a.Ar = this.Ar;
|
|
a.el = this.el;
|
|
a.rr = this.rr;
|
|
a.bt = this.bt;
|
|
a.Ys = this.Ys;
|
|
a.sr = this.sr;
|
|
a.sq = this.sq;
|
|
a.tq = this.tq.V();
|
|
a.hs = this.hs
|
|
};
|
|
E.prototype.ji = function(a) {
|
|
D.prototype.ji.call(this, a);
|
|
a.mf();
|
|
a.Hh = this.Hh;
|
|
a.Dd = null
|
|
};
|
|
var wp;
|
|
E.DirectionDefault = wp = z.s(E, "DirectionDefault", 0);
|
|
E.DirectionAbsolute = z.s(E, "DirectionAbsolute", 1);
|
|
var xp;
|
|
E.DirectionRotatedNode = xp = z.s(E, "DirectionRotatedNode", 2);
|
|
var Gm;
|
|
E.DirectionRotatedNodeOrthogonal = Gm = z.s(E, "DirectionRotatedNodeOrthogonal", 3);
|
|
E.SpreadingNone = z.s(E, "SpreadingNone", 10);
|
|
var vp;
|
|
E.SpreadingEvenly = vp = z.s(E, "SpreadingEvenly", 11);
|
|
var yp;
|
|
E.SpreadingPacked = yp = z.s(E, "SpreadingPacked", 12);
|
|
|
|
function zp(a, b) {
|
|
null !== b && (null === a.Hh && (a.Hh = new K(wk)), a.Hh.add(b))
|
|
}
|
|
|
|
function Ap(a, b, c, d) {
|
|
if (null === b || null === a.Hh) return null;
|
|
for (var e = a.Hh.i; e.next();) {
|
|
var g = e.value;
|
|
if (g.Op === a && g.du === b && g.yx === c && g.zx === d || g.Op === b && g.du === a && g.yx === d && g.zx === c) return g
|
|
}
|
|
return null
|
|
}
|
|
E.prototype.invalidateLinkBundle = function(a, b, c) {
|
|
if (void 0 === b || null === b) b = "";
|
|
if (void 0 === c || null === c) c = "";
|
|
a = Ap(this, a, b, c);
|
|
null !== a && a.zp()
|
|
};
|
|
E.prototype.tn = function(a, b, c, d, e, g, h) {
|
|
a === Uf && "elements" === b ? this.Dd = null : a === Vf && "elements" === b && (null === this.h ? this.Dd = null : d instanceof O && eo(this, d, function(a, b) {
|
|
dn(a, b, !0)
|
|
}));
|
|
D.prototype.tn.call(this, a, b, c, d, e, g, h)
|
|
};
|
|
E.prototype.invalidateConnectedLinks = E.prototype.mf = function(a) {
|
|
void 0 === a && (a = null);
|
|
for (var b = this.ee; b.next();) {
|
|
var c = b.value;
|
|
null !== a && a.contains(c) || (Bp(this, c.md), Bp(this, c.Qd), c.qc())
|
|
}
|
|
};
|
|
|
|
function Bp(a, b) {
|
|
if (null !== b) {
|
|
var c = b.gs;
|
|
null !== c && c.zp();
|
|
c = a.Va;
|
|
null === c || c.re || Bp(c, c.Gl(""))
|
|
}
|
|
}
|
|
E.prototype.Ql = function() {
|
|
return !0
|
|
};
|
|
z.defineProperty(E, {
|
|
TI: "portSpreading"
|
|
}, function() {
|
|
return this.hs
|
|
}, function(a) {
|
|
var b = this.hs;
|
|
b !== a && (u && z.Ba(a, E, E, "portSpreading"), this.hs = a, this.j("portSpreading", b, a), a = this.h, null !== a && a.pa.qb || this.mf())
|
|
});
|
|
z.defineProperty(E, {
|
|
ND: "avoidable"
|
|
}, function() {
|
|
return this.sq
|
|
}, function(a) {
|
|
var b = this.sq;
|
|
if (b !== a) {
|
|
u && z.g(a, "boolean", E, "avoidable");
|
|
this.sq = a;
|
|
var c = this.h;
|
|
null !== c && nm(c, this);
|
|
this.j("avoidable", b, a)
|
|
}
|
|
});
|
|
z.defineProperty(E, {
|
|
WG: "avoidableMargin"
|
|
}, function() {
|
|
return this.tq
|
|
}, function(a) {
|
|
"number" === typeof a ? a = new Db(a) : z.l(a, Db, E, "avoidableMargin");
|
|
var b = this.tq;
|
|
if (!b.N(a)) {
|
|
this.tq = a = a.V();
|
|
var c = this.h;
|
|
null !== c && nm(c, this);
|
|
this.j("avoidableMargin", b, a)
|
|
}
|
|
});
|
|
E.prototype.canAvoid = function() {
|
|
return this.ND && !this.Df
|
|
};
|
|
E.prototype.getAvoidableRect = function(a) {
|
|
a.set(this.W);
|
|
a.Cw(this.WG);
|
|
return a
|
|
};
|
|
E.prototype.findVisibleNode = function() {
|
|
for (var a = this; null !== a && !a.isVisible();) a = a.Va;
|
|
return a
|
|
};
|
|
E.prototype.isVisible = function() {
|
|
if (!D.prototype.isVisible.call(this)) return !1;
|
|
var a = !0,
|
|
b = !0,
|
|
c = this.h;
|
|
if (null !== c) {
|
|
a = c.Ua;
|
|
if (a.nf && (a = a.ym.na(this), null !== a && a.Cx)) return !0;
|
|
a = c.ce;
|
|
b = c.bB === sk
|
|
}
|
|
if (b) {
|
|
if (c = this.Hl(), null !== c && !c.vd) return !1
|
|
} else if (c = a ? this.FH() : this.GH(), 0 < c.count && c.all(function(a) {
|
|
return !a.vd
|
|
})) return !1;
|
|
c = this.Nd;
|
|
return null !== c ? c.isVisible() : !0
|
|
};
|
|
E.prototype.wd = function(a) {
|
|
D.prototype.wd.call(this, a);
|
|
for (var b = this.ee; b.next();) b.value.wd(a)
|
|
};
|
|
z.w(E, {
|
|
ee: "linksConnected"
|
|
}, function() {
|
|
return this.mc.i
|
|
});
|
|
E.prototype.findLinksConnected = E.prototype.qE = function(a) {
|
|
void 0 === a && (a = null);
|
|
if (null === a) return this.mc.i;
|
|
u && z.g(a, "string", E, "findLinksConnected:pid");
|
|
var b = new Ta(this.mc),
|
|
c = this;
|
|
b.rn = function(b) {
|
|
return b.Y === c && b.$f === a || b.da === c && b.Ug === a
|
|
};
|
|
return b
|
|
};
|
|
E.prototype.findLinksOutOf = E.prototype.Yw = function(a) {
|
|
void 0 === a && (a = null);
|
|
u && null !== a && z.g(a, "string", E, "findLinksOutOf:pid");
|
|
var b = new Ta(this.mc),
|
|
c = this;
|
|
b.rn = function(b) {
|
|
return b.Y !== c ? !1 : null === a ? !0 : b.$f === a
|
|
};
|
|
return b
|
|
};
|
|
E.prototype.findLinksInto = E.prototype.Hg = function(a) {
|
|
void 0 === a && (a = null);
|
|
u && null !== a && z.g(a, "string", E, "findLinksInto:pid");
|
|
var b = new Ta(this.mc),
|
|
c = this;
|
|
b.rn = function(b) {
|
|
return b.da !== c ? !1 : null === a ? !0 : b.Ug === a
|
|
};
|
|
return b
|
|
};
|
|
E.prototype.findNodesConnected = E.prototype.rE = function(a) {
|
|
void 0 === a && (a = null);
|
|
u && null !== a && z.g(a, "string", E, "findNodesConnected:pid");
|
|
for (var b = null, c = null, d = this.mc.i; d.next();) {
|
|
var e = d.value;
|
|
if (e.Y === this) {
|
|
if (null === a || e.$f === a) e = e.da, null !== b ? b.add(e) : null !== c && c !== e ? (b = new K(E), b.add(c), b.add(e)) : c = e
|
|
} else e.da !== this || null !== a && e.Ug !== a || (e = e.Y, null !== b ? b.add(e) : null !== c && c !== e ? (b = new K(E), b.add(c), b.add(e)) : c = e)
|
|
}
|
|
return null !== b ? b.i : null !== c ? new Ra(c) : Pa
|
|
};
|
|
E.prototype.findNodesOutOf = E.prototype.GH = function(a) {
|
|
void 0 === a && (a = null);
|
|
u && null !== a && z.g(a, "string", E, "findNodesOutOf:pid");
|
|
for (var b = null, c = null, d = this.mc.i; d.next();) {
|
|
var e = d.value;
|
|
e.Y !== this || null !== a && e.$f !== a || (e = e.da, null !== b ? b.add(e) : null !== c && c !== e ? (b = new K(E), b.add(c), b.add(e)) : c = e)
|
|
}
|
|
return null !== b ? b.i : null !== c ? new Ra(c) : Pa
|
|
};
|
|
E.prototype.findNodesInto = E.prototype.FH = function(a) {
|
|
void 0 === a && (a = null);
|
|
u && null !== a && z.g(a, "string", E, "findNodesInto:pid");
|
|
for (var b = null, c = null, d = this.mc.i; d.next();) {
|
|
var e = d.value;
|
|
e.da !== this || null !== a && e.Ug !== a || (e = e.Y, null !== b ? b.add(e) : null !== c && c !== e ? (b = new K(E), b.add(c), b.add(e)) : c = e)
|
|
}
|
|
return null !== b ? b.i : null !== c ? new Ra(c) : Pa
|
|
};
|
|
E.prototype.findLinksBetween = function(a, b, c) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
u && (z.l(a, E, E, "findLinksBetween:othernode"), null !== b && z.g(b, "string", E, "findLinksBetween:pid"), null !== c && z.g(c, "string", E, "findLinksBetween:otherpid"));
|
|
var d = new Ta(this.mc),
|
|
e = this;
|
|
d.rn = function(d) {
|
|
return (d.Y !== e || d.da !== a || null !== b && d.$f !== b || null !== c && d.Ug !== c) && (d.Y !== a || d.da !== e || null !== c && d.$f !== c || null !== b && d.Ug !== b) ? !1 : !0
|
|
};
|
|
return d
|
|
};
|
|
E.prototype.findLinksTo = function(a, b, c) {
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
u && (z.l(a, E, E, "findLinksTo:othernode"), null !== b && z.g(b, "string", E, "findLinksTo:pid"), null !== c && z.g(c, "string", E, "findLinksTo:otherpid"));
|
|
var d = new Ta(this.mc),
|
|
e = this;
|
|
d.rn = function(d) {
|
|
return d.Y !== e || d.da !== a || null !== b && d.$f !== b || null !== c && d.Ug === c ? !1 : !0
|
|
};
|
|
return d
|
|
};
|
|
z.defineProperty(E, {
|
|
tI: "linkConnected"
|
|
}, function() {
|
|
return this.zr
|
|
}, function(a) {
|
|
var b = this.zr;
|
|
b !== a && (null !== a && z.g(a, "function", E, "linkConnected"), this.zr = a, this.j("linkConnected", b, a))
|
|
});
|
|
z.defineProperty(E, {
|
|
uI: "linkDisconnected"
|
|
}, function() {
|
|
return this.Ar
|
|
}, function(a) {
|
|
var b = this.Ar;
|
|
b !== a && (null !== a && z.g(a, "function", E, "linkDisconnected"), this.Ar = a, this.j("linkDisconnected", b, a))
|
|
});
|
|
z.defineProperty(E, {
|
|
px: "linkValidation"
|
|
}, function() {
|
|
return this.el
|
|
}, function(a) {
|
|
var b = this.el;
|
|
b !== a && (null !== a && z.g(a, "function", E, "linkValidation"), this.el = a, this.j("linkValidation", b, a))
|
|
});
|
|
|
|
function Cp(a, b, c) {
|
|
Bp(a, c);
|
|
if (!a.mc.contains(b)) {
|
|
a.mc.add(b);
|
|
var d = a.tI;
|
|
if (null !== d) {
|
|
var e = !0,
|
|
g = a.h;
|
|
null !== g && (e = g.$a, g.$a = !0);
|
|
d(a, b, c);
|
|
null !== g && (g.$a = e)
|
|
}
|
|
b.Oc && (c = b.Y, b = b.da, null !== c && null !== b && c !== b && (d = !0, g = a.h, null !== g && (d = g.ce), a = d ? b : c, e = d ? c : b, a.hk || (a.hk = e), !e.mj || null !== g && g.pa.qb || (d ? c === e && (e.mj = !1) : b === e && (e.mj = !1))))
|
|
}
|
|
}
|
|
|
|
function Dp(a, b, c) {
|
|
Bp(a, c);
|
|
if (a.mc.remove(b)) {
|
|
var d = a.uI,
|
|
e = a.h;
|
|
if (null !== d) {
|
|
var g = !0;
|
|
null !== e && (g = e.$a, e.$a = !0);
|
|
d(a, b, c);
|
|
null !== e && (e.$a = g)
|
|
}
|
|
b.Oc && (c = !0, null !== e && (c = e.ce), a = c ? b.da : b.Y, b = c ? b.Y : b.da, null !== a && (a.hk = !1), null === b || b.mj || (0 === b.mc.count ? (b.hk = null, null !== e && e.pa.qb || (b.mj = !0)) : hm(b)))
|
|
}
|
|
}
|
|
|
|
function hm(a) {
|
|
a.hk = !1;
|
|
if (0 !== a.mc.count) {
|
|
var b = !0,
|
|
c = a.h;
|
|
if (null === c || !c.pa.qb) {
|
|
null !== c && (b = c.ce);
|
|
for (c = a.mc.i; c.next();) {
|
|
var d = c.value;
|
|
if (d.Oc)
|
|
if (b) {
|
|
if (d.Y === a) {
|
|
a.mj = !1;
|
|
return
|
|
}
|
|
} else if (d.da === a) {
|
|
a.mj = !1;
|
|
return
|
|
}
|
|
}
|
|
a.mj = !0
|
|
}
|
|
}
|
|
}
|
|
E.prototype.updateRelationshipsFromData = function() {
|
|
D.prototype.updateRelationshipsFromData.call(this);
|
|
var a = this.data;
|
|
if (null !== a) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.ha;
|
|
if (c instanceof ng) {
|
|
var d = c.gn(a),
|
|
b = b.hf(d),
|
|
e = this.Hl();
|
|
b !== e && (b = null !== e ? c.pb(e.data) : void 0, e = c.Qp, "function" === typeof e ? e(a, b) : a[e] = b, c.Eh(a, d))
|
|
}
|
|
}
|
|
}
|
|
};
|
|
E.prototype.Kt = function(a) {
|
|
D.prototype.Kt.call(this, a);
|
|
a || (hm(this), a = this.wo, null !== a && Ep(a, this))
|
|
};
|
|
E.prototype.Lt = function(a) {
|
|
D.prototype.Lt.call(this, a);
|
|
a || (a = this.wo, null !== a && null !== a.Ke && (a.Ke.remove(this), a.S()))
|
|
};
|
|
E.prototype.cn = function() {
|
|
if (0 < this.mc.count) {
|
|
var a = this.h;
|
|
if (null !== a)
|
|
for (var b = a.wb.hE, c = this.mc.copy().i; c.next();) {
|
|
var d = c.value;
|
|
b ? a.remove(d) : (d.Y === this && (d.Y = null), d.da === this && (d.da = null))
|
|
}
|
|
}
|
|
this.Nd = null;
|
|
D.prototype.cn.call(this)
|
|
};
|
|
z.w(E, {
|
|
Df: "isLinkLabel"
|
|
}, function() {
|
|
return null !== this.wo
|
|
});
|
|
z.defineProperty(E, {
|
|
Nd: "labeledLink"
|
|
}, function() {
|
|
return this.wo
|
|
}, function(a) {
|
|
var b = this.wo;
|
|
if (b !== a) {
|
|
u && null !== a && z.l(a, G, E, "labeledLink");
|
|
var c = this.h,
|
|
d = this.data;
|
|
if (null !== b && (null !== b.Ke && (b.Ke.remove(this), b.S()), null !== c && null !== d && !c.pa.qb)) {
|
|
var e = b.data,
|
|
g = c.ha;
|
|
if (null !== e && g instanceof V) {
|
|
var h = g.pb(d);
|
|
void 0 !== h && g.nF(e, h)
|
|
}
|
|
}
|
|
this.wo = a;
|
|
null !== a && (Ep(a, this), null === c || null === d || c.pa.qb || (e = a.data, g = c.ha, null !== e && g instanceof V && (h = g.pb(d), void 0 !== h && g.zz(e, h))));
|
|
Ym(this);
|
|
this.j("labeledLink",
|
|
b, a)
|
|
}
|
|
});
|
|
E.prototype.findPort = E.prototype.Gl = function(a) {
|
|
u && z.g(a, "string", E, "findPort:pid");
|
|
if (null === this.Dd) {
|
|
if ("" === a && !1 === this.Ph) return this;
|
|
en(this)
|
|
}
|
|
var b = this.Dd.na(a);
|
|
return null !== b || "" !== a && (b = this.Dd.na(""), null !== b) ? b : this
|
|
};
|
|
z.w(E, {
|
|
port: "port"
|
|
}, function() {
|
|
return this.Gl("")
|
|
});
|
|
z.w(E, {
|
|
ports: "ports"
|
|
}, function() {
|
|
null === this.Dd && en(this);
|
|
return this.Dd.VE
|
|
});
|
|
|
|
function en(a) {
|
|
null === a.Dd ? a.Dd = new na("string", O) : a.Dd.clear();
|
|
eo(a, a, function(a, c) {
|
|
var d = c.yd;
|
|
null !== d && a.Dd.add(d, c)
|
|
});
|
|
0 === a.Dd.count && a.Dd.add("", a)
|
|
}
|
|
|
|
function dn(a, b, c) {
|
|
var d = b.yd;
|
|
if (null !== d && (null !== a.Dd && a.Dd.remove(d), b = a.h, null !== b && c)) {
|
|
c = null;
|
|
for (d = a.qE(d); d.next();) a = d.value, null === c && (c = z.rb()), c.push(a);
|
|
if (null !== c) {
|
|
for (d = 0; d < c.length; d++) a = c[d], b.remove(a);
|
|
z.xa(c)
|
|
}
|
|
}
|
|
}
|
|
E.prototype.isInTreeOf = function(a) {
|
|
if (null === a || a === this) return !1;
|
|
var b = !0,
|
|
c = this.h;
|
|
null !== c && (b = c.ce);
|
|
c = this;
|
|
if (b)
|
|
for (; c !== a;) {
|
|
for (var b = null, d = c.mc.i; d.next();) {
|
|
var e = d.value;
|
|
if (e.Oc && (b = e.Y, b !== c && b !== this)) break
|
|
}
|
|
if (b === this || null === b || b === c) return !1;
|
|
c = b
|
|
} else
|
|
for (; c !== a;) {
|
|
b = null;
|
|
for (d = c.mc.i; d.next() && (e = d.value, !e.Oc || (b = e.da, b === c || b === this)););
|
|
if (b === this || null === b || b === c) return !1;
|
|
c = b
|
|
}
|
|
return !0
|
|
};
|
|
E.prototype.findTreeRoot = function() {
|
|
var a = !0,
|
|
b = this.h;
|
|
null !== b && (a = b.ce);
|
|
b = this;
|
|
if (a)
|
|
for (;;) {
|
|
for (var a = null, c = b.mc.i; c.next();) {
|
|
var d = c.value;
|
|
if (d.Oc && (a = d.Y, a !== b && a !== this)) break
|
|
}
|
|
if (a === this) return this;
|
|
if (null === a || a === b) return b;
|
|
b = a
|
|
} else
|
|
for (;;) {
|
|
a = null;
|
|
for (c = b.mc.i; c.next() && (d = c.value, !d.Oc || (a = d.da, a === b || a === this)););
|
|
if (a === this) return this;
|
|
if (null === a || a === b) return b;
|
|
b = a
|
|
}
|
|
};
|
|
E.prototype.findCommonTreeParent = function(a) {
|
|
if (null === a) return null;
|
|
u && z.l(a, E, E, "findCommonTreeParent:other");
|
|
if (this === a) return this;
|
|
for (var b = this; null !== b;) pp(b, !0), b = b.Hl();
|
|
for (var c = null, b = a; null !== b;) {
|
|
if (0 !== (b.T & 1048576)) {
|
|
c = b;
|
|
break
|
|
}
|
|
b = b.Hl()
|
|
}
|
|
for (b = this; null !== b;) pp(b, !1), b = b.Hl();
|
|
return c
|
|
};
|
|
E.prototype.findTreeParentLink = E.prototype.pp = function() {
|
|
var a = !0,
|
|
b = this.h;
|
|
null !== b && (a = b.ce);
|
|
b = this.mc.i;
|
|
if (a)
|
|
for (; b.next();) {
|
|
if (a = b.value, a.Oc && a.Y !== this) return a
|
|
} else
|
|
for (; b.next();)
|
|
if (a = b.value, a.Oc && a.da !== this) return a;
|
|
return null
|
|
};
|
|
E.prototype.findTreeParentNode = E.prototype.Hl = function() {
|
|
var a = this.hk;
|
|
if (null === a) return null;
|
|
if (a instanceof E) return a;
|
|
var b = !0,
|
|
a = this.h;
|
|
null !== a && (b = a.ce);
|
|
a = this.mc.i;
|
|
if (b)
|
|
for (; a.next();) {
|
|
if (b = a.value, b.Oc && (b = b.Y, b !== this)) return this.hk = b
|
|
} else
|
|
for (; a.next();)
|
|
if (b = a.value, b.Oc && (b = b.da, b !== this)) return this.hk = b;
|
|
return this.hk = null
|
|
};
|
|
E.prototype.findTreeParentChain = function() {
|
|
function a(b, d) {
|
|
if (null !== b) {
|
|
d.add(b);
|
|
var e = b.pp();
|
|
null !== e && (d.add(e), a(b.Hl(), d))
|
|
}
|
|
}
|
|
var b = new K(D);
|
|
a(this, b);
|
|
return b
|
|
};
|
|
E.prototype.findTreeLevel = function() {
|
|
return Fp(this, this)
|
|
};
|
|
|
|
function Fp(a, b) {
|
|
var c = b.Hl();
|
|
return null === c ? 0 : 1 + Fp(a, c)
|
|
}
|
|
E.prototype.findTreeChildrenLinks = E.prototype.$w = function() {
|
|
var a = !0,
|
|
b = this.h;
|
|
null !== b && (a = b.ce);
|
|
if (a) {
|
|
var a = new Ta(this.mc),
|
|
c = this;
|
|
a.rn = function(a) {
|
|
return a.Oc && a.Y === c ? !0 : !1
|
|
}
|
|
} else a = new Ta(this.mc), c = this, a.rn = function(a) {
|
|
return a.Oc && a.da === c ? !0 : !1
|
|
};
|
|
return a
|
|
};
|
|
E.prototype.findTreeChildrenNodes = E.prototype.tE = function() {
|
|
var a = !0,
|
|
b = this.h;
|
|
null !== b && (a = b.ce);
|
|
var c = b = null,
|
|
d = this.mc.i;
|
|
if (a)
|
|
for (; d.next();) a = d.value, a.Oc && a.Y === this && (a = a.da, null !== b ? b.add(a) : null !== c && c !== a ? (b = new J(E), b.add(c), b.add(a)) : c = a);
|
|
else
|
|
for (; d.next();) a = d.value, a.Oc && a.da === this && (a = a.Y, null !== b ? b.add(a) : null !== c && c !== a ? (b = new J(E), b.add(c), b.add(a)) : c = a);
|
|
return null !== b ? b.i : null !== c ? new Ra(c) : Pa
|
|
};
|
|
E.prototype.findTreeParts = function(a) {
|
|
void 0 === a && (a = Infinity);
|
|
z.g(a, "number", E, "collapseTree:level");
|
|
var b = new K(D);
|
|
eh(b, this, !1, a, !0);
|
|
return b
|
|
};
|
|
E.prototype.collapseTree = E.prototype.collapseTree = function(a) {
|
|
void 0 === a && (a = 1);
|
|
z.p(a, E, "collapseTree:level");
|
|
1 > a && (a = 1);
|
|
var b = this.h;
|
|
if (null !== b && !b.vh) {
|
|
b.vh = !0;
|
|
var c = new K(E);
|
|
c.add(this);
|
|
Gp(this, c, b.ce, a, b.Ua, this, b.bB === sk);
|
|
b.vh = !1
|
|
}
|
|
};
|
|
|
|
function Gp(a, b, c, d, e, g, h) {
|
|
if (1 < d)
|
|
for (var k = c ? a.Yw() : a.Hg(); k.next();) {
|
|
var l = k.value;
|
|
l.Oc && (l = l.aA(a), null === l || l === a || b.contains(l) || (b.add(l), Gp(l, b, c, d - 1, e, g, h)))
|
|
} else Hp(a, b, c, e, g, h)
|
|
}
|
|
|
|
function Hp(a, b, c, d, e, g) {
|
|
for (var h = e === a ? !0 : a.vd, k = c ? a.Yw() : a.Hg(); k.next();) {
|
|
var l = k.value;
|
|
l.Oc && (l = l.aA(a), null === l || l === a || b.contains(l) || (b.add(l), h && (g && ek(d, l, e), l.Nl(), l.wd(!1)), l.vd && (l.Cu = l.vd, Hp(l, b, c, d, e, g))))
|
|
}
|
|
a.vd = !1
|
|
}
|
|
E.prototype.expandTree = E.prototype.expandTree = function(a) {
|
|
void 0 === a && (a = 2);
|
|
z.p(a, E, "expandTree:level");
|
|
2 > a && (a = 2);
|
|
var b = this.h;
|
|
if (null !== b && !b.vh) {
|
|
b.vh = !0;
|
|
var c = new K(E);
|
|
c.add(this);
|
|
Ip(this, c, b.ce, a, b.Ua, this, b.bB === sk);
|
|
b.vh = !1
|
|
}
|
|
};
|
|
|
|
function Ip(a, b, c, d, e, g, h) {
|
|
for (var k = g === a ? !1 : a.vd, l = c ? a.Yw() : a.Hg(); l.next();) {
|
|
var m = l.value;
|
|
m.Oc && (k || m.Cg || m.qc(), m = m.aA(a), null !== m && m !== a && !b.contains(m) && (b.add(m), k || (m.wd(!0), m.Nl(), h && dk(e, m, g)), 2 < d || m.Cu)) && (m.Cu = !1, Ip(m, b, c, d - 1, e, g, h))
|
|
}
|
|
a.vd = !0
|
|
}
|
|
z.defineProperty(E, {
|
|
vd: "isTreeExpanded"
|
|
}, function() {
|
|
return this.rr
|
|
}, function(a) {
|
|
var b = this.rr;
|
|
if (b !== a) {
|
|
u && z.g(a, "boolean", E, "isTreeExpanded");
|
|
this.rr = a;
|
|
var c = this.h;
|
|
this.j("isTreeExpanded", b, a);
|
|
b = this.yJ;
|
|
if (null !== b) {
|
|
var d = !0;
|
|
null !== c && (d = c.$a, c.$a = !0);
|
|
b(this);
|
|
null !== c && (c.$a = d)
|
|
}
|
|
null !== c && c.pa.qb ? this.wd(a) : a ? this.expandTree() : this.collapseTree()
|
|
}
|
|
});
|
|
z.defineProperty(E, {
|
|
Cu: "wasTreeExpanded"
|
|
}, function() {
|
|
return this.bt
|
|
}, function(a) {
|
|
var b = this.bt;
|
|
b !== a && (u && z.g(a, "boolean", E, "wasTreeExpanded"), this.bt = a, this.j("wasTreeExpanded", b, a))
|
|
});
|
|
z.defineProperty(E, {
|
|
yJ: "treeExpandedChanged"
|
|
}, function() {
|
|
return this.Ys
|
|
}, function(a) {
|
|
var b = this.Ys;
|
|
b !== a && (null !== a && z.g(a, "function", E, "treeExpandedChanged"), this.Ys = a, this.j("treeExpandedChanged", b, a))
|
|
});
|
|
z.defineProperty(E, {
|
|
mj: "isTreeLeaf"
|
|
}, function() {
|
|
return this.sr
|
|
}, function(a) {
|
|
var b = this.sr;
|
|
b !== a && (u && z.g(a, "boolean", E, "isTreeLeaf"), this.sr = a, this.j("isTreeLeaf", b, a))
|
|
});
|
|
|
|
function G() {
|
|
D.call(this, Ki);
|
|
this.pg = null;
|
|
this.Oh = "";
|
|
this.Bg = this.ar = null;
|
|
this.ei = "";
|
|
this.Xs = null;
|
|
this.os = this.ns = this.ms = !1;
|
|
this.tr = !0;
|
|
this.mq = Ni;
|
|
this.Fq = 0;
|
|
this.Iq = Ni;
|
|
this.Jq = NaN;
|
|
this.Dm = nn;
|
|
this.Ms = .5;
|
|
this.Ke = null;
|
|
this.Yc = (new J(N)).freeze();
|
|
this.Ko = this.Me = null;
|
|
this.Cg = !1;
|
|
this.cw = null;
|
|
this.mz = !1;
|
|
this.Zg = this.Zn = this.Vn = this.ri = this.Di = this.ab = null;
|
|
this.pz = new N;
|
|
this.jD = this.hD = null;
|
|
this.sy = !1;
|
|
this.la = null
|
|
}
|
|
z.Qa(G, D);
|
|
z.ia("Link", G);
|
|
G.prototype.cloneProtected = function(a) {
|
|
D.prototype.cloneProtected.call(this, a);
|
|
a.Oh = this.Oh;
|
|
a.ar = this.ar;
|
|
a.ei = this.ei;
|
|
a.Xs = this.Xs;
|
|
a.ms = this.ms;
|
|
a.ns = this.ns;
|
|
a.os = this.os;
|
|
a.tr = this.tr;
|
|
a.mq = this.mq;
|
|
a.Fq = this.Fq;
|
|
a.Iq = this.Iq;
|
|
a.Jq = this.Jq;
|
|
a.Dm = this.Dm;
|
|
a.Ms = this.Ms;
|
|
null !== this.la && (a.la = this.la.copy())
|
|
};
|
|
G.prototype.ji = function(a) {
|
|
D.prototype.ji.call(this, a);
|
|
this.Oh = a.Oh;
|
|
this.ei = a.ei;
|
|
a.Me = null;
|
|
a.qc();
|
|
a.ri = this.ri
|
|
};
|
|
var nn;
|
|
G.Normal = nn = z.s(G, "Normal", 1);
|
|
G.Orthogonal = z.s(G, "Orthogonal", 2);
|
|
G.AvoidsNodes = z.s(G, "AvoidsNodes", 6);
|
|
var Jp;
|
|
G.AvoidsNodesStraight = Jp = z.s(G, "AvoidsNodesStraight", 7);
|
|
var Ni;
|
|
G.None = Ni = z.s(G, "None", 0);
|
|
var Ui;
|
|
G.Bezier = Ui = z.s(G, "Bezier", 9);
|
|
var Mi;
|
|
G.JumpGap = Mi = z.s(G, "JumpGap", 10);
|
|
var Li;
|
|
G.JumpOver = Li = z.s(G, "JumpOver", 11);
|
|
var kn;
|
|
G.End = kn = z.s(G, "End", 17);
|
|
var ln;
|
|
G.Scale = ln = z.s(G, "Scale", 18);
|
|
var mn;
|
|
G.Stretch = mn = z.s(G, "Stretch", 19);
|
|
var yo;
|
|
G.OrientAlong = yo = z.s(G, "OrientAlong", 21);
|
|
var Kp;
|
|
G.OrientPlus90 = Kp = z.s(G, "OrientPlus90", 22);
|
|
var Lp;
|
|
G.OrientMinus90 = Lp = z.s(G, "OrientMinus90", 23);
|
|
var Mp;
|
|
G.OrientOpposite = Mp = z.s(G, "OrientOpposite", 24);
|
|
var Np;
|
|
G.OrientUpright = Np = z.s(G, "OrientUpright", 25);
|
|
var Op;
|
|
G.OrientPlus90Upright = Op = z.s(G, "OrientPlus90Upright", 26);
|
|
var Pp;
|
|
G.OrientMinus90Upright = Pp = z.s(G, "OrientMinus90Upright", 27);
|
|
var Qp;
|
|
G.OrientUpright45 = Qp = z.s(G, "OrientUpright45", 28);
|
|
G.prototype.Ue = function() {
|
|
null === this.la && (this.la = new Fm)
|
|
};
|
|
G.prototype.Ql = function() {
|
|
var a = this.Y;
|
|
if (null !== a) {
|
|
var b = a.findVisibleNode();
|
|
null !== b && (a = b);
|
|
if (nl(a) || ol(a)) return !1
|
|
}
|
|
a = this.da;
|
|
return null !== a && (b = a.findVisibleNode(), null !== b && (a = b), nl(a) || ol(a)) ? !1 : !0
|
|
};
|
|
G.prototype.RA = function() {
|
|
return !1
|
|
};
|
|
G.prototype.be = function() {
|
|
return !1
|
|
};
|
|
G.prototype.computeAngle = function(a, b, c) {
|
|
a = 0;
|
|
switch (b) {
|
|
default:
|
|
case Ni:
|
|
a = 0;
|
|
break;
|
|
case yo:
|
|
a = c;
|
|
break;
|
|
case Kp:
|
|
a = c + 90;
|
|
break;
|
|
case Lp:
|
|
a = c - 90;
|
|
break;
|
|
case Mp:
|
|
a = c + 180;
|
|
break;
|
|
case Np:
|
|
a = df(c);90 < a && 270 > a && (a -= 180);
|
|
break;
|
|
case Op:
|
|
a = df(c + 90);90 < a && 270 > a && (a -= 180);
|
|
break;
|
|
case Pp:
|
|
a = df(c - 90);90 < a && 270 > a && (a -= 180);
|
|
break;
|
|
case Qp:
|
|
a = df(c);
|
|
if (45 < a && 135 > a || 225 < a && 315 > a) return 0;90 < a && 270 > a && (a -= 180)
|
|
}
|
|
return df(a)
|
|
};
|
|
z.defineProperty(G, {
|
|
Y: "fromNode"
|
|
}, function() {
|
|
return this.pg
|
|
}, function(a) {
|
|
var b = this.pg;
|
|
if (b !== a) {
|
|
u && null !== a && z.l(a, E, G, "fromNode");
|
|
var c = this.md;
|
|
null !== b && (this.Bg !== b && Dp(b, this, c), Rp(this), this.I(Dl));
|
|
this.pg = a;
|
|
null !== a && this.wd(a.isVisible());
|
|
this.Di = null;
|
|
this.qc();
|
|
var d = this.h;
|
|
if (null !== d) {
|
|
var e = this.data,
|
|
g = d.ha;
|
|
if (null !== e)
|
|
if (g instanceof V) {
|
|
var h = null !== a ? a.data : null;
|
|
g.Kx(e, g.pb(h))
|
|
} else g instanceof ng && (h = null !== a ? a.data : null, d.ce ? g.Eh(e, g.pb(h)) : (null !== b && g.Eh(b.data, void 0), g.Eh(h, g.pb(null !==
|
|
this.Bg ? this.Bg.data : null))))
|
|
}
|
|
e = this.md;
|
|
g = this.wE;
|
|
null !== g && (h = !0, null !== d && (h = d.$a, d.$a = !0), g(this, c, e), null !== d && (d.$a = h));
|
|
null !== a && (this.Bg !== a && Cp(a, this, e), Sp(this), this.I(vl));
|
|
this.j("fromNode", b, a);
|
|
Wl(this)
|
|
}
|
|
});
|
|
z.defineProperty(G, {
|
|
$f: "fromPortId"
|
|
}, function() {
|
|
return this.Oh
|
|
}, function(a) {
|
|
var b = this.Oh;
|
|
if (b !== a) {
|
|
u && z.g(a, "string", G, "fromPortId");
|
|
var c = this.md;
|
|
null !== c && Bp(this.Y, c);
|
|
Rp(this);
|
|
this.Oh = a;
|
|
var d = this.md;
|
|
null !== d && Bp(this.Y, d);
|
|
var e = this.h;
|
|
if (null !== e) {
|
|
var g = this.data,
|
|
h = e.ha;
|
|
null !== g && h instanceof V && h.PA(g, a)
|
|
}
|
|
c !== d && (this.Di = null, this.qc(), g = this.wE, null !== g && (h = !0, null !== e && (h = e.$a, e.$a = !0), g(this, c, d), null !== e && (e.$a = h)));
|
|
Sp(this);
|
|
this.j("fromPortId", b, a)
|
|
}
|
|
});
|
|
z.w(G, {
|
|
md: "fromPort"
|
|
}, function() {
|
|
var a = this.pg;
|
|
return null === a ? null : a.Gl(this.Oh)
|
|
});
|
|
z.defineProperty(G, {
|
|
wE: "fromPortChanged"
|
|
}, function() {
|
|
return this.ar
|
|
}, function(a) {
|
|
var b = this.ar;
|
|
b !== a && (null !== a && z.g(a, "function", G, "fromPortChanged"), this.ar = a, this.j("fromPortChanged", b, a))
|
|
});
|
|
z.defineProperty(G, {
|
|
da: "toNode"
|
|
}, function() {
|
|
return this.Bg
|
|
}, function(a) {
|
|
var b = this.Bg;
|
|
if (b !== a) {
|
|
u && null !== a && z.l(a, E, G, "toNode");
|
|
var c = this.Qd;
|
|
null !== b && (this.pg !== b && Dp(b, this, c), Rp(this), this.I(Dl));
|
|
this.Bg = a;
|
|
null !== a && this.wd(a.isVisible());
|
|
this.Di = null;
|
|
this.qc();
|
|
var d = this.h;
|
|
if (null !== d) {
|
|
var e = this.data,
|
|
g = d.ha;
|
|
if (null !== e)
|
|
if (g instanceof V) {
|
|
var h = null !== a ? a.data : null;
|
|
g.Ox(e, g.pb(h))
|
|
} else g instanceof ng && (h = null !== a ? a.data : null, d.ce ? (null !== b && g.Eh(b.data, void 0), g.Eh(h, g.pb(null !== this.pg ? this.pg.data :
|
|
null))) : g.Eh(e, g.pb(h)))
|
|
}
|
|
e = this.Qd;
|
|
g = this.UF;
|
|
null !== g && (h = !0, null !== d && (h = d.$a, d.$a = !0), g(this, c, e), null !== d && (d.$a = h));
|
|
null !== a && (this.pg !== a && Cp(a, this, e), Sp(this), this.I(vl));
|
|
this.j("toNode", b, a);
|
|
Wl(this)
|
|
}
|
|
});
|
|
z.defineProperty(G, {
|
|
Ug: "toPortId"
|
|
}, function() {
|
|
return this.ei
|
|
}, function(a) {
|
|
var b = this.ei;
|
|
if (b !== a) {
|
|
u && z.g(a, "string", G, "toPortId");
|
|
var c = this.Qd;
|
|
null !== c && Bp(this.da, c);
|
|
Rp(this);
|
|
this.ei = a;
|
|
var d = this.Qd;
|
|
null !== d && Bp(this.da, d);
|
|
var e = this.h;
|
|
if (null !== e) {
|
|
var g = this.data,
|
|
h = e.ha;
|
|
null !== g && h instanceof V && h.SA(g, a)
|
|
}
|
|
c !== d && (this.Di = null, this.qc(), g = this.UF, null !== g && (h = !0, null !== e && (h = e.$a, e.$a = !0), g(this, c, d), null !== e && (e.$a = h)));
|
|
Sp(this);
|
|
this.j("toPortId", b, a)
|
|
}
|
|
});
|
|
z.w(G, {
|
|
Qd: "toPort"
|
|
}, function() {
|
|
var a = this.Bg;
|
|
return null === a ? null : a.Gl(this.ei)
|
|
});
|
|
z.defineProperty(G, {
|
|
UF: "toPortChanged"
|
|
}, function() {
|
|
return this.Xs
|
|
}, function(a) {
|
|
var b = this.Xs;
|
|
b !== a && (null !== a && z.g(a, "function", G, "toPortChanged"), this.Xs = a, this.j("toPortChanged", b, a))
|
|
});
|
|
z.defineProperty(G, {
|
|
Db: "fromSpot"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Gj : Pc
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Gj;
|
|
b.N(a) || (u && z.l(a, Q, G, "fromSpot"), a = a.V(), this.la.Gj = a, this.j("fromSpot", b, a), this.qc())
|
|
});
|
|
z.defineProperty(G, {
|
|
Il: "fromEndSegmentLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Ej : NaN
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Ej;
|
|
b !== a && (u && z.g(a, "number", G, "fromEndSegmentLength"), 0 > a && z.ka(a, ">= 0", G, "fromEndSegmentLength"), this.la.Ej = a, this.j("fromEndSegmentLength", b, a), this.qc())
|
|
});
|
|
z.defineProperty(G, {
|
|
Et: "fromEndSegmentDirection"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Dj : wp
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Dj;
|
|
b !== a && (u && z.Ba(a, E, G, "fromEndSegmentDirection"), this.la.Dj = a, this.j("fromEndSegmentDirection", b, a), this.qc())
|
|
});
|
|
z.defineProperty(G, {
|
|
Ft: "fromShortLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.Fj : NaN
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.Fj;
|
|
b !== a && (u && z.g(a, "number", G, "fromShortLength"), this.la.Fj = a, this.j("fromShortLength", b, a), this.qc())
|
|
});
|
|
z.defineProperty(G, {
|
|
Eb: "toSpot"
|
|
}, function() {
|
|
return null !== this.la ? this.la.gk : Pc
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.gk;
|
|
b.N(a) || (u && z.l(a, Q, G, "toSpot"), a = a.V(), this.la.gk = a, this.j("toSpot", b, a), this.qc())
|
|
});
|
|
z.defineProperty(G, {
|
|
Yl: "toEndSegmentLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.ek : NaN
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.ek;
|
|
b !== a && (u && z.g(a, "number", G, "toEndSegmentLength"), 0 > a && z.ka(a, ">= 0", G, "toEndSegmentLength"), this.la.ek = a, this.j("toEndSegmentLength", b, a), this.qc())
|
|
});
|
|
z.defineProperty(G, {
|
|
zu: "toEndSegmentDirection"
|
|
}, function() {
|
|
return null !== this.la ? this.la.dk : wp
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.dk;
|
|
b !== a && (u && z.Ba(a, E, G, "toEndSegmentDirection"), this.la.dk = a, this.j("toEndSegmentDirection", b, a), this.qc())
|
|
});
|
|
z.defineProperty(G, {
|
|
Au: "toShortLength"
|
|
}, function() {
|
|
return null !== this.la ? this.la.fk : NaN
|
|
}, function(a) {
|
|
this.Ue();
|
|
var b = this.la.fk;
|
|
b !== a && (u && z.g(a, "number", G, "toShortLength"), this.la.fk = a, this.j("toShortLength", b, a), this.qc())
|
|
});
|
|
|
|
function Wl(a) {
|
|
var b = a.Y,
|
|
c = a.da;
|
|
null !== b ? null !== c ? Tp(a, b.DH(c)) : Tp(a, null) : Tp(a, null)
|
|
}
|
|
|
|
function Tp(a, b) {
|
|
var c = a.Ok;
|
|
if (c !== b) {
|
|
null !== c && qp(c, a);
|
|
a.Ok = b;
|
|
null !== b && rp(b, a);
|
|
var d = a.WD;
|
|
if (null !== d) {
|
|
var e = !0,
|
|
g = a.h;
|
|
null !== g && (e = g.$a, g.$a = !0);
|
|
d(a, c, b);
|
|
null !== g && (g.$a = e)
|
|
}!a.Cg || a.hD !== c && a.jD !== c || a.qc()
|
|
}
|
|
}
|
|
G.prototype.Nl = function() {
|
|
var a = this.Va;
|
|
null !== a && this.Y !== a && this.da !== a && a.Ow && D.prototype.Nl.call(this)
|
|
};
|
|
G.prototype.getOtherNode = G.prototype.aA = function(a) {
|
|
u && z.l(a, E, G, "getOtherNode:node");
|
|
var b = this.Y;
|
|
return a === b ? this.da : b
|
|
};
|
|
G.prototype.getOtherPort = function(a) {
|
|
u && z.l(a, O, G, "getOtherPort:port");
|
|
var b = this.md;
|
|
return a === b ? this.Qd : b
|
|
};
|
|
z.w(G, {
|
|
HK: "isLabeledLink"
|
|
}, function() {
|
|
return null === this.Ke ? !1 : 0 < this.Ke.count
|
|
});
|
|
z.w(G, {
|
|
Hf: "labelNodes"
|
|
}, function() {
|
|
return null === this.Ke ? Pa : this.Ke.i
|
|
});
|
|
|
|
function Ep(a, b) {
|
|
null === a.Ke && (a.Ke = new K(E));
|
|
a.Ke.add(b);
|
|
a.S()
|
|
}
|
|
G.prototype.Kt = function(a) {
|
|
D.prototype.Kt.call(this, a);
|
|
Up(this) && Oi(this, this.W);
|
|
a || (a = this.pg, null !== a && Cp(a, this, this.md), a = this.Bg, null !== a && Cp(a, this, this.Qd), Sp(this))
|
|
};
|
|
G.prototype.Lt = function(a) {
|
|
D.prototype.Lt.call(this, a);
|
|
Up(this) && Oi(this, this.W);
|
|
a || (a = this.pg, null !== a && Dp(a, this, this.md), a = this.Bg, null !== a && Dp(a, this, this.Qd), Rp(this))
|
|
};
|
|
G.prototype.cn = function() {
|
|
this.Cg = !0;
|
|
if (null !== this.Ke) {
|
|
var a = this.h;
|
|
if (null !== a)
|
|
for (var b = this.Ke.copy().i; b.next();) a.remove(b.value)
|
|
}
|
|
b = this.data;
|
|
null !== b && (a = this.h, null !== a && (a = a.ha, a instanceof V ? a.Dx(b) : a instanceof ng && a.Eh(b, void 0)))
|
|
};
|
|
G.prototype.updateRelationshipsFromData = function() {
|
|
var a = this.data;
|
|
if (null !== a) {
|
|
var b = this.h;
|
|
if (null !== b) {
|
|
var c = b.ha;
|
|
if (c instanceof V) {
|
|
var d = c.Ll(a),
|
|
e = b.hf(d),
|
|
g = this.Y;
|
|
e !== g && (e = null !== g ? c.pb(g.data) : void 0, g = c.Ep, "function" === typeof g ? g(a, e) : a[g] = e, c.Kx(a, d));
|
|
d = c.Ml(a);
|
|
e = b.hf(d);
|
|
g = this.da;
|
|
e !== g && (e = null !== g ? c.pb(g.data) : void 0, g = c.Gp, "function" === typeof g ? g(a, e) : a[g] = e, c.Ox(a, d));
|
|
var h = c.qk(a);
|
|
if (0 < h.length || 0 < this.Hf.count) {
|
|
if (1 === h.length && 1 === this.Hf.count && (b = h[0], d = this.Hf.first(), c.pb(d.data) ===
|
|
b)) return;
|
|
var d = (new K).$c(h),
|
|
k = new K;
|
|
this.Hf.each(function(a) {
|
|
null !== a.data && (a = c.pb(a.data), void 0 !== a && k.add(a))
|
|
});
|
|
b = k.copy();
|
|
b.IA(d);
|
|
d = d.copy();
|
|
d.IA(k);
|
|
if (0 < b.count || 0 < d.count) h.length = 0, k.each(function(a) {
|
|
h.push(a)
|
|
}), b.each(function(b) {
|
|
c.nF(a, b)
|
|
}), d.each(function(b) {
|
|
c.zz(a, b)
|
|
})
|
|
}
|
|
}
|
|
}
|
|
}
|
|
};
|
|
G.prototype.move = function(a) {
|
|
var b = this.position,
|
|
c = b.x;
|
|
isNaN(c) && (c = 0);
|
|
b = b.y;
|
|
isNaN(b) && (b = 0);
|
|
c = a.x - c;
|
|
b = a.y - b;
|
|
D.prototype.move.call(this, a);
|
|
this.Rl(c, b);
|
|
for (a = this.Hf; a.next();) {
|
|
var d = a.value,
|
|
e = d.position;
|
|
d.moveTo(e.x + c, e.y + b)
|
|
}
|
|
};
|
|
z.defineProperty(G, {
|
|
WI: "relinkableFrom"
|
|
}, function() {
|
|
return this.ms
|
|
}, function(a) {
|
|
var b = this.ms;
|
|
b !== a && (u && z.g(a, "boolean", G, "relinkableFrom"), this.ms = a, this.j("relinkableFrom", b, a), this.ae())
|
|
});
|
|
z.defineProperty(G, {
|
|
XI: "relinkableTo"
|
|
}, function() {
|
|
return this.ns
|
|
}, function(a) {
|
|
var b = this.ns;
|
|
b !== a && (u && z.g(a, "boolean", G, "relinkableTo"), this.ns = a, this.j("relinkableTo", b, a), this.ae())
|
|
});
|
|
G.prototype.canRelinkFrom = function() {
|
|
if (!this.WI) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.Tm) return !1;
|
|
a = a.h;
|
|
return null === a || a.Tm ? !0 : !1
|
|
};
|
|
G.prototype.canRelinkTo = function() {
|
|
if (!this.XI) return !1;
|
|
var a = this.layer;
|
|
if (null === a) return !0;
|
|
if (!a.Tm) return !1;
|
|
a = a.h;
|
|
return null === a || a.Tm ? !0 : !1
|
|
};
|
|
z.defineProperty(G, {
|
|
lu: "resegmentable"
|
|
}, function() {
|
|
return this.os
|
|
}, function(a) {
|
|
var b = this.os;
|
|
b !== a && (u && z.g(a, "boolean", G, "resegmentable"), this.os = a, this.j("resegmentable", b, a), this.ae())
|
|
});
|
|
z.defineProperty(G, {
|
|
Oc: "isTreeLink"
|
|
}, function() {
|
|
return this.tr
|
|
}, function(a) {
|
|
var b = this.tr;
|
|
b !== a && (u && z.g(a, "boolean", G, "isTreeLink"), this.tr = a, this.j("isTreeLink", b, a), null !== this.Y && hm(this.Y), null !== this.da && hm(this.da))
|
|
});
|
|
z.w(G, {
|
|
path: "path"
|
|
}, function() {
|
|
var a = this.gf();
|
|
return a instanceof X ? a : null
|
|
});
|
|
z.w(G, {
|
|
un: "routeBounds"
|
|
}, function() {
|
|
this.Bn();
|
|
var a = new w;
|
|
var b = Infinity,
|
|
c = Infinity,
|
|
d = this.sa;
|
|
if (0 === d) a.n(NaN, NaN, 0, 0);
|
|
else {
|
|
if (1 === d) d = this.m(0), b = Math.min(d.x, b), c = Math.min(d.y, c), a.n(d.x, d.y, 0, 0);
|
|
else if (2 === d) {
|
|
var e = this.m(0),
|
|
g = this.m(1),
|
|
b = Math.min(e.x, g.x),
|
|
c = Math.min(e.y, g.y);
|
|
a.n(e.x, e.y, 0, 0);
|
|
a.vj(g)
|
|
} else if (this.computeCurve() === Ui && 3 <= d && !this.rc)
|
|
if (e = this.m(0), b = e.x, c = e.y, a.n(b, c, 0, 0), 3 === d) d = this.m(1), b = Math.min(d.x, b), c = Math.min(d.y, c), g = this.m(2), b = Math.min(g.x, b), c = Math.min(g.y, c), ve(e.x,
|
|
e.y, d.x, d.y, d.x, d.y, g.x, g.y, .5, a);
|
|
else
|
|
for (var h = 3; h < d; h += 3) {
|
|
var k = this.m(h - 2);
|
|
h + 3 >= d && (h = d - 1);
|
|
var l = this.m(h - 1),
|
|
g = this.m(h);
|
|
ve(e.x, e.y, k.x, k.y, l.x, l.y, g.x, g.y, .5, a);
|
|
b = Math.min(g.x, b);
|
|
c = Math.min(g.y, c);
|
|
e = g
|
|
} else
|
|
for (e = this.m(0), g = this.m(1), b = Math.min(e.x, g.x), c = Math.min(e.y, g.y), a.n(e.x, e.y, 0, 0), a.vj(g), h = 2; h < d; h++) e = this.m(h), b = Math.min(e.x, b), c = Math.min(e.y, c), a.vj(e);
|
|
this.pz.n(b - a.x, c - a.y)
|
|
}
|
|
return this.cw = a
|
|
});
|
|
z.w(G, {
|
|
bF: "midPoint"
|
|
}, function() {
|
|
this.Bn();
|
|
return this.computeMidPoint(new N)
|
|
});
|
|
G.prototype.computeMidPoint = function(a) {
|
|
var b = this.sa;
|
|
if (0 === b) return a.assign(ee), a;
|
|
if (1 === b) return a.assign(this.m(0)), a;
|
|
if (2 === b) {
|
|
var c = this.m(0),
|
|
d = this.m(1);
|
|
a.n((c.x + d.x) / 2, (c.y + d.y) / 2);
|
|
return a
|
|
}
|
|
if (this.computeCurve() === Ui && 3 <= b && !this.rc) {
|
|
if (3 === b) return this.m(1);
|
|
var c = (b - 1) / 3 | 0,
|
|
e = 3 * (c / 2 | 0);
|
|
if (1 === c % 2) {
|
|
var c = this.m(e),
|
|
d = this.m(e + 1),
|
|
g = this.m(e + 2),
|
|
e = this.m(e + 3),
|
|
b = d.x,
|
|
h = d.y,
|
|
d = g.x,
|
|
k = g.y,
|
|
g = (b + d) / 2,
|
|
l = (h + k) / 2,
|
|
h = ((c.y + h) / 2 + l) / 2,
|
|
k = (l + (k + e.y) / 2) / 2;
|
|
a.x = (((c.x + b) / 2 + g) / 2 + (g + (d + e.x) / 2) / 2) / 2;
|
|
a.y = (h + k) / 2
|
|
} else a.assign(this.m(e));
|
|
return a
|
|
}
|
|
e = 0;
|
|
g = z.rb();
|
|
for (h = 0; h < b - 1; h++) c = 0, c = this.m(h), d = this.m(h + 1), td(c.x, d.x) ? (c = d.y - c.y, 0 > c && (c = -c)) : td(c.y, d.y) ? (c = d.x - c.x, 0 > c && (c = -c)) : c = Math.sqrt(c.Af(d)), g.push(c), e += c;
|
|
for (d = h = c = 0; c < e / 2 && h < b;) {
|
|
d = g[h];
|
|
if (c + d > e / 2) break;
|
|
c += d;
|
|
h++
|
|
}
|
|
z.xa(g);
|
|
b = this.m(h);
|
|
g = this.m(h + 1);
|
|
b.x === g.x ? b.y > g.y ? a.n(b.x, b.y - (e / 2 - c)) : a.n(b.x, b.y + (e / 2 - c)) : b.y === g.y ? b.x > g.x ? a.n(b.x - (e / 2 - c), b.y) : a.n(b.x + (e / 2 - c), b.y) : (c = (e / 2 - c) / d, a.n(b.x + c * (g.x - b.x), b.y + c * (g.y - b.y)));
|
|
return a
|
|
};
|
|
z.w(G, {
|
|
aF: "midAngle"
|
|
}, function() {
|
|
this.Bn();
|
|
return this.computeMidAngle()
|
|
});
|
|
G.prototype.computeMidAngle = function() {
|
|
var a = this.sa;
|
|
if (2 > a) return NaN;
|
|
if (this.computeCurve() === Ui && 4 <= a && !this.rc) {
|
|
var b = (a - 1) / 3 | 0,
|
|
c = 3 * (b / 2 | 0);
|
|
if (1 === b % 2) {
|
|
var c = Math.floor(c),
|
|
b = this.m(c),
|
|
d = this.m(c + 1),
|
|
a = this.m(c + 2),
|
|
c = this.m(c + 3),
|
|
e = d.x,
|
|
d = d.y,
|
|
g = a.x,
|
|
a = a.y,
|
|
h = (e + g) / 2,
|
|
k = (d + a) / 2;
|
|
return xb(((b.x + e) / 2 + h) / 2, ((b.y + d) / 2 + k) / 2, (h + (g + c.x) / 2) / 2, (k + (a + c.y) / 2) / 2)
|
|
}
|
|
if (0 < c && c + 1 < a) return b = this.m(c - 1), d = this.m(c + 1), b.Ec(d)
|
|
}
|
|
c = a / 2 | 0;
|
|
if (0 === a % 2) return b = this.m(c - 1), d = this.m(c), 4 <= a && b.Mc(d) && (b = this.m(c - 2), a = this.m(c + 1),
|
|
c = b.Af(d), e = d.Af(a), !(c > e + 10)) ? e > c + 10 ? d.Ec(a) : b.Ec(a) : b.Ec(d);
|
|
b = this.m(c - 1);
|
|
d = this.m(c);
|
|
a = this.m(c + 1);
|
|
c = b.Af(d);
|
|
e = d.Af(a);
|
|
return c > e + 10 ? b.Ec(d) : e > c + 10 ? d.Ec(a) : b.Ec(a)
|
|
};
|
|
z.defineProperty(G, {
|
|
points: "points"
|
|
}, function() {
|
|
return this.Yc
|
|
}, function(a) {
|
|
var b = this.Yc;
|
|
if (b !== a) {
|
|
var c = null;
|
|
if (Array.isArray(a)) {
|
|
var d = 0 === a.length % 2;
|
|
if (d)
|
|
for (var e = 0; e < a.length; e++)
|
|
if ("number" !== typeof a[e] || isNaN(a[e])) {
|
|
d = !1;
|
|
break
|
|
}
|
|
if (d)
|
|
for (c = new J(N), d = 0; d < a.length / 2; d++) e = (new N(a[2 * d], a[2 * d + 1])).freeze(), c.add(e);
|
|
else {
|
|
for (var g = !0, d = 0; d < a.length; d++)
|
|
if (e = a[d], !z.Za(e) || "number" !== typeof e.x || isNaN(e.x) || "number" !== typeof e.y || isNaN(e.y)) {
|
|
g = !1;
|
|
break
|
|
}
|
|
if (g)
|
|
for (c = new J(N), d = 0; d < a.length; d++) e =
|
|
a[d], c.add((new N(e.x, e.y)).freeze());
|
|
else z.k("Link.points array must contain only an even number of numbers or objects with x and y properties, not: " + a)
|
|
}
|
|
} else if (a instanceof J)
|
|
for (c = a.copy(), a = c.i; a.next();) a.value.freeze();
|
|
else z.k("Link.points value is not an instance of List or Array: " + a);
|
|
c.freeze();
|
|
this.Yc = c;
|
|
this.Ae();
|
|
this.S();
|
|
Vp(this);
|
|
a = this.h;
|
|
null !== a && (a.kn || a.pa.qb || a.qx.add(this), a.Ua.wc && (this.Ko = c));
|
|
this.j("points", b, c)
|
|
}
|
|
});
|
|
z.w(G, {
|
|
sa: "pointsCount"
|
|
}, function() {
|
|
return this.Yc.count
|
|
});
|
|
G.prototype.getPoint = G.prototype.m = function(a) {
|
|
return this.Yc.o[a]
|
|
};
|
|
G.prototype.setPoint = G.prototype.Kf = function(a, b) {
|
|
u && (z.l(b, N, G, "setPoint"), b.F() || z.k("Link.setPoint called with a Point that does not have real numbers: " + b.toString()));
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.Rg(a, b)
|
|
};
|
|
G.prototype.setPointAt = G.prototype.aa = function(a, b, c) {
|
|
u && (z.p(b, G, "setPointAt:x"), z.p(c, G, "setPointAt:y"));
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.Rg(a, new N(b, c))
|
|
};
|
|
G.prototype.insertPoint = function(a, b) {
|
|
u && (z.l(b, N, G, "insertPoint"), b.F() || z.k("Link.insertPoint called with a Point that does not have real numbers: " + b.toString()));
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.Ld(a, b)
|
|
};
|
|
G.prototype.insertPointAt = G.prototype.B = function(a, b, c) {
|
|
u && (z.p(b, G, "insertPointAt:x"), z.p(c, G, "insertPointAt:y"));
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.Ld(a, new N(b, c))
|
|
};
|
|
G.prototype.addPoint = G.prototype.gi = function(a) {
|
|
u && (z.l(a, N, G, "addPoint"), a.F() || z.k("Link.addPoint called with a Point that does not have real numbers: " + a.toString()));
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.add(a)
|
|
};
|
|
G.prototype.addPointAt = G.prototype.sl = function(a, b) {
|
|
u && (z.p(a, G, "insertPointAt:x"), z.p(b, G, "insertPointAt:y"));
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.add(new N(a, b))
|
|
};
|
|
G.prototype.removePoint = G.prototype.oF = function(a) {
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.dd(a)
|
|
};
|
|
G.prototype.clearPoints = G.prototype.fp = function() {
|
|
null === this.Me && z.k("Call Link.startRoute before modifying the points of the route.");
|
|
this.Yc.clear()
|
|
};
|
|
G.prototype.movePoints = G.prototype.Rl = function(a, b) {
|
|
for (var c = new J(N), d = this.Yc.i; d.next();) {
|
|
var e = d.value;
|
|
c.add((new N(e.x + a, e.y + b)).freeze())
|
|
}
|
|
c.freeze();
|
|
d = this.Yc;
|
|
this.Yc = c;
|
|
this.S();
|
|
Vp(this);
|
|
e = this.h;
|
|
null !== e && e.Ua.wc && (this.Ko = c);
|
|
this.j("points", d, c)
|
|
};
|
|
G.prototype.startRoute = G.prototype.Ul = function() {
|
|
null === this.Me && (this.Me = this.Yc, this.Yc = this.Yc.copy())
|
|
};
|
|
G.prototype.commitRoute = G.prototype.cj = function() {
|
|
if (null !== this.Me) {
|
|
for (var a = this.Me, b = this.Yc, c = Infinity, d = Infinity, e = a.o, g = e.length, h = 0; h < g; h++) var k = e[h],
|
|
c = Math.min(k.x, c),
|
|
d = Math.min(k.y, d);
|
|
for (var l = Infinity, m = Infinity, n = b.o, p = n.length, h = 0; h < p; h++) k = n[h], l = Math.min(k.x, l), m = Math.min(k.y, m), k.freeze();
|
|
b.freeze();
|
|
if (p === g)
|
|
for (h = 0; h < p; h++) {
|
|
if (g = e[h], k = n[h], g.x - c !== k.x - l || g.y - d !== k.y - m) {
|
|
this.S();
|
|
this.Ae();
|
|
break
|
|
}
|
|
} else this.S(), this.Ae();
|
|
this.Me = null;
|
|
c = this.h;
|
|
null !== c && c.Ua.wc && (this.Ko = b);
|
|
Vp(this);
|
|
this.j("points", a, b)
|
|
}
|
|
};
|
|
G.prototype.rollbackRoute = G.prototype.$I = function() {
|
|
null !== this.Me && (this.Yc = this.Me, this.Me = null)
|
|
};
|
|
|
|
function Vp(a) {
|
|
0 === a.Yc.count ? a.Cg = !1 : (a.Cg = !0, a.Vn = a.m(0).copy(), a.Zn = a.m(a.sa - 1).copy(), Wp(a, !1))
|
|
}
|
|
G.prototype.invalidateRoute = G.prototype.qc = function() {
|
|
if (!this.mz) {
|
|
var a = this.h;
|
|
a && (a.qx.contains(this) || a.pa.qb || a.Ua.kI && !a.Ua.nf) || (a = this.path, null !== a && (this.Cg = !1, this.S(), a.S()))
|
|
}
|
|
};
|
|
z.defineProperty(G, {
|
|
eq: "suspendsRouting"
|
|
}, function() {
|
|
return this.mz
|
|
}, function(a) {
|
|
this.mz = a
|
|
});
|
|
G.prototype.updateRoute = G.prototype.Bn = function() {
|
|
if (!this.Cg && !this.sy) {
|
|
var a = !0;
|
|
try {
|
|
this.sy = !0, this.Ul(), a = this.computePoints()
|
|
} finally {
|
|
this.sy = !1, a ? this.cj() : this.$I()
|
|
}
|
|
}
|
|
};
|
|
G.prototype.computePoints = function() {
|
|
var a = this.h;
|
|
if (null === a) return !1;
|
|
var b = this.Y,
|
|
c = null;
|
|
null === b ? (a.Em || (a.dw = new X, a.dw.Aa = Pd, a.dw.ub = 0, a.Em = new E, a.Em.add(a.dw), a.Em.Bf()), this.Vn && (a.Em.position = a.Em.location = this.Vn, a.Em.Bf(), b = a.Em, c = a.dw)) : c = this.md;
|
|
if (null !== c && !b.isVisible()) {
|
|
var d = b.findVisibleNode();
|
|
null !== d && d !== b ? (b = d, c = d.Gl("")) : b = d
|
|
}
|
|
this.hD = b;
|
|
if (null === b || !b.location.F()) return !1;
|
|
for (; !(null === c || c.W.F() && c.nj());) c = c.U;
|
|
if (null === c) return !1;
|
|
var d = this.da,
|
|
e = null;
|
|
null === d ? (a.Fm || (a.ew =
|
|
new X, a.ew.Aa = Pd, a.ew.ub = 0, a.Fm = new E, a.Fm.add(a.ew), a.Fm.Bf()), this.Zn && (a.Fm.position = a.Fm.location = this.Zn, a.Fm.Bf(), d = a.Fm, e = a.ew)) : e = this.Qd;
|
|
null === e || d.isVisible() || (a = d.findVisibleNode(), null !== a && a !== d ? (d = a, e = a.Gl("")) : d = a);
|
|
this.jD = d;
|
|
if (null === d || !d.location.F()) return !1;
|
|
for (; !(null === e || e.W.F() && e.nj());) e = e.U;
|
|
if (null === e) return !1;
|
|
var a = this.sa,
|
|
g = Xp(this, c),
|
|
h = Yp(this, e),
|
|
k = c === e && null !== c,
|
|
l = this.rc,
|
|
m = this.Se === Ui;
|
|
this.Di = k && !l ? m = !0 : !1;
|
|
var n = this.it === Ni || k;
|
|
if (l || g !== Yb || h !== Yb || k) {
|
|
m = this.jj;
|
|
n && (l && m || k) && this.fp();
|
|
var p = k ? this.computeCurviness() : 0,
|
|
q = this.getLinkPoint(b, c, g, !0, l, d, e),
|
|
r = 0,
|
|
s = 0,
|
|
t = 0;
|
|
if (l || g !== Yb || k) {
|
|
var v = this.computeEndSegmentLength(b, c, g, !0),
|
|
t = this.getLinkDirection(b, c, q, g, !0, l, d, e);
|
|
k && (t -= l ? 90 : 30, 0 > p && (t -= 180));
|
|
0 > t ? t += 360 : 360 <= t && (t -= 360);
|
|
k && (v += Math.abs(p));
|
|
0 === t ? r = v : 90 === t ? s = v : 180 === t ? r = -v : 270 === t ? s = -v : (r = v * Math.cos(t * Math.PI / 180), s = v * Math.sin(t * Math.PI / 180));
|
|
if (g.Be() && k) {
|
|
var x = c.fb(ec, z.O()),
|
|
y = z.Tb(x.x + 1E3 * r, x.y + 1E3 * s);
|
|
this.getLinkPointFromPoint(b, c, x, y, !0, q);
|
|
z.A(x);
|
|
z.A(y)
|
|
}
|
|
}
|
|
var v = this.getLinkPoint(d, e, h, !1, l, b, c),
|
|
A = 0,
|
|
B = 0,
|
|
L = 0;
|
|
if (l || h !== Yb || k) x = this.computeEndSegmentLength(d, e, h, !1), L = this.getLinkDirection(d, e, v, h, !1, l, b, c), k && (L += l ? 0 : 30, 0 > p && (L += 180)), 0 > L ? L += 360 : 360 <= L && (L -= 360), k && (x += Math.abs(p)), 0 === L ? A = x : 90 === L ? B = x : 180 === L ? A = -x : 270 === L ? B = -x : (A = x * Math.cos(L * Math.PI / 180), B = x * Math.sin(L * Math.PI / 180)), h.Be() && k && (x = e.fb(ec, z.O()), y = z.Tb(x.x + 1E3 * A, x.y + 1E3 * B), this.getLinkPointFromPoint(d, e, x, y, !1, v), z.A(x), z.A(y));
|
|
e = q;
|
|
if (l || g !== Yb || k) e = new N(q.x + r, q.y + s);
|
|
c = v;
|
|
if (l ||
|
|
h !== Yb || k) c = new N(v.x + A, v.y + B);
|
|
!n && !l && g === Yb && 3 < a && this.adjustPoints(0, q, a - 2, c) ? this.Kf(a - 1, v) : !n && !l && h === Yb && 3 < a && this.adjustPoints(1, e, a - 1, v) ? this.Kf(0, q) : !n && !l && 4 < a && this.adjustPoints(1, e, a - 2, c) ? (this.Kf(0, q), this.Kf(a - 1, v)) : !n && l && 6 <= a && !m && this.adjustPoints(1, e, a - 2, c) ? (this.Kf(0, q), this.Kf(a - 1, v)) : (this.fp(), this.gi(q), (l || g !== Yb || k) && this.gi(e), l && this.addOrthoPoints(e, t, c, L, b, d), (l || h !== Yb || k) && this.gi(c), this.gi(v))
|
|
} else g = !1, !n && 3 <= a && (n = this.getLinkPoint(b, c, Yb, !0, !1, d, e), h = this.getLinkPoint(d,
|
|
e, Yb, !1, !1, b, c), g = this.adjustPoints(0, n, a - 1, h)) && (n = this.getLinkPoint(b, c, Yb, !0, !1, d, e), h = this.getLinkPoint(d, e, Yb, !1, !1, b, c), this.adjustPoints(0, n, a - 1, h)), g || (this.fp(), m ? (a = this.getLinkPoint(b, c, Yb, !0, !1, d, e), n = this.getLinkPoint(d, e, Yb, !1, !1, b, c), g = n.x - a.x, h = n.y - a.y, k = this.computeCurviness(), m = l = 0, q = a.x + g / 3, t = a.y + h / 3, r = q, s = t, eb(h, 0) ? s = 0 < g ? s - k : s + k : (l = -g / h, m = Math.sqrt(k * k / (l * l + 1)), 0 > k && (m = -m), r = (0 > h ? -1 : 1) * m + q, s = l * (r - q) + t), q = a.x + 2 * g / 3, t = a.y + 2 * h / 3, v = q, A = t, eb(h, 0) ? A = 0 < g ? A - k : A + k : (v = (0 > h ? -1 : 1) * m + q, A = l *
|
|
(v - q) + t), this.fp(), this.gi(a), this.sl(r, s), this.sl(v, A), this.gi(n), this.Kf(0, this.getLinkPoint(b, c, Yb, !0, !1, d, e)), this.Kf(3, this.getLinkPoint(d, e, Yb, !1, !1, b, c))) : (a = d, d = this.getLinkPoint(b, c, Yb, !0, !1, a, e), e = this.getLinkPoint(a, e, Yb, !1, !1, b, c), this.hasCurviness() ? (h = e.x - d.x, b = e.y - d.y, c = this.computeCurviness(), a = d.x + h / 2, n = d.y + b / 2, g = a, k = n, eb(b, 0) ? k = 0 < h ? k - c : k + c : (h = -h / b, g = Math.sqrt(c * c / (h * h + 1)), 0 > c && (g = -g), g = (0 > b ? -1 : 1) * g + a, k = h * (g - a) + n), this.gi(d), this.sl(g, k)) : this.gi(d), this.gi(e)));
|
|
return !0
|
|
};
|
|
|
|
function Zp(a, b) {
|
|
Math.abs(b.x - a.x) > Math.abs(b.y - a.y) ? (b.x = b.x >= a.x ? a.x + 9E9 : a.x - 9E9, b.y = a.y) : (b.y = b.y >= a.y ? a.y + 9E9 : a.y - 9E9, b.x = a.x);
|
|
return b
|
|
}
|
|
G.prototype.getLinkPointFromPoint = function(a, b, c, d, e, g) {
|
|
void 0 === g && (g = new N);
|
|
if (null === a || null === b) return g.assign(c), g;
|
|
a.isVisible() || (e = a.findVisibleNode(), null !== e && e !== a && (b = e.port));
|
|
var h = e = 0,
|
|
k = 0,
|
|
l = 0;
|
|
a = null;
|
|
e = b.U;
|
|
null === e || e.Vg() || (e = e.U);
|
|
if (null === e) e = d.x, h = d.y, k = c.x, l = c.y;
|
|
else {
|
|
a = e.ph;
|
|
e = 1 / (a.m11 * a.m22 - a.m12 * a.m21);
|
|
var k = a.m22 * e,
|
|
l = -a.m12 * e,
|
|
m = -a.m21 * e,
|
|
n = a.m11 * e,
|
|
p = e * (a.m21 * a.dy - a.m22 * a.dx),
|
|
q = e * (a.m12 * a.dx - a.m11 * a.dy);
|
|
e = d.x * k + d.y * m + p;
|
|
h = d.x * l + d.y * n + q;
|
|
k = c.x * k + c.y * m + p;
|
|
l = c.x * l + c.y * n + q
|
|
}
|
|
b.tp(e, h, k, l,
|
|
g);
|
|
null !== a && g.transform(a);
|
|
return g
|
|
};
|
|
|
|
function $p(a, b) {
|
|
var c = b.gs;
|
|
null === c && (c = new aq, c.port = b, c.Pc = b.ca, b.gs = c);
|
|
return bq(c, a)
|
|
}
|
|
G.prototype.getLinkPoint = function(a, b, c, d, e, g, h, k) {
|
|
void 0 === k && (k = new N);
|
|
if (c.cd()) return b.fb(c, k), k;
|
|
if (c.kj() && (c = $p(this, b), null !== c)) {
|
|
k.assign(c.Fp);
|
|
if (e && this.Gx === Jp) {
|
|
var l = $p(this, h);
|
|
if (null !== l && c.an < l.an) {
|
|
c = z.O();
|
|
var l = z.O(),
|
|
m = new w(b.fb(Zb, c), b.fb(ic, l)),
|
|
n = this.computeSpot(!d);
|
|
a = this.getLinkPoint(g, h, n, !d, e, a, b, l);
|
|
a.x >= m.x && a.x <= m.x + m.width ? k.x = a.x : a.y >= m.y && a.y <= m.y + m.height && (k.y = a.y);
|
|
z.A(c);
|
|
z.A(l)
|
|
}
|
|
}
|
|
return k
|
|
}
|
|
g = b.fb(ec, z.O());
|
|
l = c = null;
|
|
this.sa > (e ? 6 : 2) ? (l = d ? this.m(1) : this.m(this.sa - 2), e &&
|
|
(l = Zp(g, l.copy()))) : (c = z.O(), l = h.fb(ec, c), e && (l = Zp(g, l)), z.A(c));
|
|
this.getLinkPointFromPoint(a, b, g, l, d, k);
|
|
z.A(g);
|
|
return k
|
|
};
|
|
G.prototype.getLinkDirection = function(a, b, c, d, e, g, h, k) {
|
|
a: if (d.cd()) c = d.x > d.y ? d.x > 1 - d.y ? 0 : d.x < 1 - d.y ? 270 : 315 : d.x < d.y ? d.x > 1 - d.y ? 90 : d.x < 1 - d.y ? 180 : 135 : .5 > d.x ? 225 : .5 < d.x ? 45 : 0;
|
|
else {
|
|
if (d.kj()) {
|
|
var l = $p(this, b);
|
|
if (null !== l) switch (l.se) {
|
|
case z.pd:
|
|
c = 270;
|
|
break a;
|
|
case z.Tc:
|
|
c = 180;
|
|
break a;
|
|
default:
|
|
case z.fd:
|
|
c = 0;
|
|
break a;
|
|
case z.ed:
|
|
c = 90;
|
|
break a
|
|
}
|
|
}
|
|
var l = b.fb(ec, z.O()),
|
|
m = null,
|
|
n = null;
|
|
this.sa > (g ? 6 : 2) ? (n = e ? this.m(1) : this.m(this.sa - 2), n = g ? Zp(l, n.copy()) : c) : (m = z.O(), n = k.fb(ec, m), z.A(m));
|
|
c = 0;
|
|
c = Math.abs(n.x - l.x) > Math.abs(n.y -
|
|
l.y) ? n.x >= l.x ? 0 : 180 : n.y >= l.y ? 90 : 270;
|
|
z.A(l)
|
|
}d.Be() && h.li(a) && (c += 180, 360 <= c && (c -= 360));a = wp;a = e ? this.Et : this.zu;a === wp && (a = e ? b.Et : b.zu);
|
|
switch (a) {
|
|
case xp:
|
|
b = b.Kl();
|
|
c += b;
|
|
360 <= c && (c -= 360);
|
|
break;
|
|
case wp:
|
|
case Gm:
|
|
b = b.Kl();
|
|
if (0 === b) break;
|
|
45 <= b && 135 > b ? c += 90 : 135 <= b && 225 > b ? c += 180 : 225 <= b && 315 > b && (c += 270);
|
|
360 <= c && (c -= 360)
|
|
}
|
|
return c
|
|
};
|
|
G.prototype.computeEndSegmentLength = function(a, b, c, d) {
|
|
if (null !== b && c.kj() && (a = $p(this, b), null !== a)) return a.Uw;
|
|
a = NaN;
|
|
a = d ? this.Il : this.Yl;
|
|
null !== b && isNaN(a) && (a = d ? b.Il : b.Yl);
|
|
isNaN(a) && (a = 10);
|
|
return a
|
|
};
|
|
G.prototype.computeSpot = function(a) {
|
|
return a ? Xp(this, this.md) : Yp(this, this.Qd)
|
|
};
|
|
|
|
function Xp(a, b) {
|
|
if (null === b) return ec;
|
|
var c = a.Db;
|
|
c.bd() && (void 0 === b && (b = a.md), null !== b && (c = b.Db));
|
|
return c === Pc ? Yb : c
|
|
}
|
|
|
|
function Yp(a, b) {
|
|
if (null === b) return ec;
|
|
var c = a.Eb;
|
|
c.bd() && (void 0 === b && (b = a.Qd), null !== b && (c = b.Eb));
|
|
return c === Pc ? Yb : c
|
|
}
|
|
G.prototype.computeOtherPoint = function(a, b) {
|
|
var c = b.fb(ec),
|
|
d;
|
|
d = b.gs;
|
|
d = null !== d ? bq(d, this) : null;
|
|
null !== d && (c = d.Fp);
|
|
return c
|
|
};
|
|
G.prototype.computeShortLength = function(a) {
|
|
return a ? cq(this) : dq(this)
|
|
};
|
|
|
|
function cq(a) {
|
|
var b = a.Ft;
|
|
isNaN(b) && (a = a.md, null !== a && (b = a.Ft));
|
|
return isNaN(b) ? 0 : b
|
|
}
|
|
|
|
function dq(a) {
|
|
var b = a.Au;
|
|
isNaN(b) && (a = a.Qd, null !== a && (b = a.Au));
|
|
return isNaN(b) ? 0 : b
|
|
}
|
|
G.prototype.ok = function(a, b, c, d, e, g) {
|
|
if (!1 === this.ig) return !1;
|
|
void 0 === b && (b = null);
|
|
void 0 === c && (c = null);
|
|
var h = g;
|
|
void 0 === g && (h = z.Fh(), h.reset());
|
|
h.multiply(this.transform);
|
|
if (this.Ym(a, h)) return ko(this, b, c, e), void 0 === g && z.jf(h), !0;
|
|
if (this.Ig(a, h)) {
|
|
var k = !1;
|
|
if (!this.dh)
|
|
for (var l = this.va.o, m = l.length; m--;) {
|
|
var n = l[m];
|
|
if (n.visible || n === this.Zb) {
|
|
var p = n.W,
|
|
q = this.Ga;
|
|
if (!(p.x > q.width || p.y > q.height || 0 > p.x + p.width || 0 > p.y + p.height)) {
|
|
p = z.Fh();
|
|
p.set(h);
|
|
if (n instanceof I) k = n.ok(a, b, c, d, e, p);
|
|
else if (this.path ===
|
|
n) {
|
|
var k = n,
|
|
r = a,
|
|
s = d,
|
|
q = p;
|
|
if (!1 === k.ig) k = !1;
|
|
else if (q.multiply(k.transform), s) b: {
|
|
var t = r,
|
|
v = q;
|
|
if (k.Ym(t, v)) k = !0;
|
|
else {
|
|
if (void 0 === v && (v = k.transform, t.mk(k.W))) {
|
|
k = !0;
|
|
break b
|
|
}
|
|
var q = t.left,
|
|
r = t.right,
|
|
s = t.top,
|
|
t = t.bottom,
|
|
x = z.O(),
|
|
y = z.O(),
|
|
A = z.O(),
|
|
B = z.Fh();
|
|
B.set(v);
|
|
B.vA(k.transform);
|
|
B.fA();
|
|
y.x = r;
|
|
y.y = s;
|
|
y.transform(B);
|
|
x.x = q;
|
|
x.y = s;
|
|
x.transform(B);
|
|
v = !1;
|
|
vo(k, x, y, A) ? v = !0 : (x.x = r, x.y = t, x.transform(B), vo(k, x, y, A) ? v = !0 : (y.x = q, y.y = t, y.transform(B), vo(k, x, y, A) ? v = !0 : (x.x = q, x.y = s, x.transform(B), vo(k, x, y, A) && (v = !0))));
|
|
z.jf(B);
|
|
z.A(x);
|
|
z.A(y);
|
|
z.A(A);
|
|
k = v
|
|
}
|
|
}
|
|
else k = k.Ym(r, q)
|
|
} else k = Lm(n, a, d, p);
|
|
k && (null !== b && (n = b(n)), n && (null === c || c(n)) && e.add(n));
|
|
z.jf(p)
|
|
}
|
|
}
|
|
}
|
|
void 0 === g && z.jf(h);
|
|
return k || null !== this.background || null !== this.vl
|
|
}
|
|
void 0 === g && z.jf(h);
|
|
return !1
|
|
};
|
|
z.w(G, {
|
|
rc: "isOrthogonal"
|
|
}, function() {
|
|
return 2 === (this.Dm.value & 2)
|
|
});
|
|
z.w(G, {
|
|
jj: "isAvoiding"
|
|
}, function() {
|
|
return 4 === (this.Dm.value & 4)
|
|
});
|
|
G.prototype.computeCurve = function() {
|
|
if (null === this.Di) {
|
|
var a = this.md,
|
|
b = this.rc;
|
|
this.Di = null !== a && a === this.Qd && !b
|
|
}
|
|
return this.Di ? Ui : this.Se
|
|
};
|
|
G.prototype.computeCorner = function() {
|
|
if (this.Se === Ui) return 0;
|
|
var a = this.Kz;
|
|
if (isNaN(a) || 0 > a) a = 10;
|
|
return a
|
|
};
|
|
G.prototype.findMidLabel = function() {
|
|
for (var a = this.path, b = this.va.o, c = b.length, d = 0; d < c; d++) {
|
|
var e = b[d];
|
|
if (e !== a && !e.Ff && (-Infinity === e.De || isNaN(e.De))) return e
|
|
}
|
|
for (a = this.Hf; a.next();)
|
|
if (b = a.value, -Infinity === b.De || isNaN(b.De)) return b;
|
|
return null
|
|
};
|
|
G.prototype.computeSpacing = function() {
|
|
if (!this.isVisible()) return 0;
|
|
var a;
|
|
a = Math.max(14, this.computeThickness());
|
|
var b = this.md,
|
|
c = this.Qd;
|
|
if (null !== b && null !== c) {
|
|
var d = this.findMidLabel();
|
|
if (null !== d) {
|
|
var e = d.Ga,
|
|
g = d.margin,
|
|
h = isNaN(e.width) ? 30 : e.width * d.scale + g.left + g.right,
|
|
e = isNaN(e.height) ? 14 : e.height * d.scale + g.top + g.bottom,
|
|
d = d.pu;
|
|
d === yo || d === Np || d === Mp ? a = Math.max(a, e) : d === Lp || d === Pp || d === Kp || d === Op ? a = Math.max(a, h) : (b = b.fb(ec).Ec(c.fb(ec)) / 180 * Math.PI, a = Math.max(a, Math.abs(Math.sin(b) * h) + Math.abs(Math.cos(b) *
|
|
e) + 1));
|
|
this.Se === Ui && (a *= 1.333)
|
|
}
|
|
}
|
|
return a
|
|
};
|
|
G.prototype.arrangeBundledLinks = function(a, b) {
|
|
if (b)
|
|
for (var c = 0; c < a.length; c++) a[c].qc()
|
|
};
|
|
G.prototype.computeCurviness = function() {
|
|
var a = this.Qw;
|
|
if (isNaN(a)) {
|
|
var a = 16,
|
|
b = this.ri;
|
|
if (null !== b) {
|
|
for (var c = z.rb(), d = 0, e = b.links, g = 0; g < e.length; g++) {
|
|
var h = e[g],
|
|
h = h.computeSpacing();
|
|
c.push(h);
|
|
d += h
|
|
}
|
|
d = -d / 2;
|
|
for (g = 0; g < e.length; g++) {
|
|
h = e[g];
|
|
if (h === this) {
|
|
a = d + c[g] / 2;
|
|
break
|
|
}
|
|
d += c[g]
|
|
}
|
|
b.Op === this.Y && (a = -a);
|
|
z.xa(c)
|
|
}
|
|
}
|
|
return a
|
|
};
|
|
G.prototype.computeThickness = function() {
|
|
if (!this.isVisible()) return 0;
|
|
var a = this.path;
|
|
return null !== a ? Math.max(a.ub, 1) : 1
|
|
};
|
|
G.prototype.hasCurviness = function() {
|
|
return !isNaN(this.Qw) || null !== this.ri
|
|
};
|
|
G.prototype.adjustPoints = function(a, b, c, d) {
|
|
var e = this.it;
|
|
if (this.rc) {
|
|
if (e === ln) return !1;
|
|
e === mn && (e = kn)
|
|
}
|
|
switch (e) {
|
|
case ln:
|
|
var g = this.m(a),
|
|
h = this.m(c);
|
|
if (!g.Mc(b) || !h.Mc(d)) {
|
|
var e = g.x,
|
|
g = g.y,
|
|
k = h.x - e,
|
|
l = h.y - g,
|
|
m = Math.sqrt(k * k + l * l);
|
|
if (!td(m, 0)) {
|
|
var n = 0;
|
|
td(k, 0) ? n = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (n = Math.atan(l / Math.abs(k)), 0 > k && (n = Math.PI - n));
|
|
var h = b.x,
|
|
p = b.y,
|
|
l = d.x - h,
|
|
q = d.y - p,
|
|
r = Math.sqrt(l * l + q * q),
|
|
k = 0;
|
|
td(l, 0) ? k = 0 > q ? -Math.PI / 2 : Math.PI / 2 : (k = Math.atan(q / Math.abs(l)), 0 > l && (k = Math.PI - k));
|
|
m = r / m;
|
|
n = k - n;
|
|
this.Kf(a, b);
|
|
for (a +=
|
|
1; a < c; a++) b = this.m(a), k = b.x - e, l = b.y - g, b = Math.sqrt(k * k + l * l), td(b, 0) || (q = 0, td(k, 0) ? q = 0 > l ? -Math.PI / 2 : Math.PI / 2 : (q = Math.atan(l / Math.abs(k)), 0 > k && (q = Math.PI - q)), k = q + n, b *= m, this.aa(a, h + b * Math.cos(k), p + b * Math.sin(k)));
|
|
this.Kf(c, d)
|
|
}
|
|
}
|
|
return !0;
|
|
case mn:
|
|
g = this.m(a);
|
|
p = this.m(c);
|
|
if (!g.Mc(b) || !p.Mc(d)) {
|
|
var e = g.x,
|
|
g = g.y,
|
|
h = p.x,
|
|
p = p.y,
|
|
m = (h - e) * (h - e) + (p - g) * (p - g),
|
|
k = b.x,
|
|
n = b.y,
|
|
l = d.x,
|
|
q = d.y,
|
|
r = 0,
|
|
s = 1;
|
|
0 !== l - k ? (r = (q - n) / (l - k), s = Math.sqrt(1 + 1 / (r * r))) : r = 9E9;
|
|
this.Kf(a, b);
|
|
for (a += 1; a < c; a++) {
|
|
b = this.m(a);
|
|
var t = b.x,
|
|
v = b.y,
|
|
x = .5;
|
|
0 !== m && (x =
|
|
((e - t) * (e - h) + (g - v) * (g - p)) / m);
|
|
var y = e + x * (h - e),
|
|
A = g + x * (p - g);
|
|
b = Math.sqrt((t - y) * (t - y) + (v - A) * (v - A));
|
|
v < r * (t - y) + A && (b = -b);
|
|
0 < r && (b = -b);
|
|
t = k + x * (l - k);
|
|
x = n + x * (q - n);
|
|
0 !== r ? (b = t + b / s, this.aa(a, b, x - (b - t) / r)) : this.aa(a, t, x + b)
|
|
}
|
|
this.Kf(c, d)
|
|
}
|
|
return !0;
|
|
case kn:
|
|
return this.rc && (e = this.m(a), g = this.m(a + 1), h = this.m(a + 2), eb(e.y, g.y) ? eb(g.x, h.x) ? this.aa(a + 1, g.x, b.y) : eb(g.y, h.y) && this.aa(a + 1, b.x, g.y) : eb(e.x, g.x) && (eb(g.y, h.y) ? this.aa(a + 1, b.x, g.y) : eb(g.x, h.x) && this.aa(a + 1, g.x, b.y)), e = this.m(c), g = this.m(c - 1), h = this.m(c - 2), eb(e.y,
|
|
g.y) ? eb(g.x, h.x) ? this.aa(c - 1, g.x, d.y) : eb(g.y, h.y) && this.aa(c - 1, d.x, g.y) : eb(e.x, g.x) && (eb(g.y, h.y) ? this.aa(c - 1, d.x, g.y) : eb(g.x, h.x) && this.aa(c - 1, g.x, d.y))), this.Kf(a, b), this.Kf(c, d), !0;
|
|
default:
|
|
return !1
|
|
}
|
|
};
|
|
G.prototype.addOrthoPoints = function(a, b, c, d, e, g) {
|
|
b = -45 <= b && 45 > b ? 0 : 45 <= b && 135 > b ? 90 : 135 <= b && 225 > b ? 180 : 270;
|
|
d = -45 <= d && 45 > d ? 0 : 45 <= d && 135 > d ? 90 : 135 <= d && 225 > d ? 180 : 270;
|
|
var h = e.W.copy(),
|
|
k = g.W.copy();
|
|
if (h.F() && k.F()) {
|
|
h.ag(8, 8);
|
|
k.ag(8, 8);
|
|
h.vj(a);
|
|
k.vj(c);
|
|
var l, m;
|
|
if (0 === b)
|
|
if (c.x > a.x || 270 === d && c.y < a.y && k.right > a.x || 90 === d && c.y > a.y && k.right > a.x) l = new N(c.x, a.y), m = new N(c.x, (a.y + c.y) / 2), 180 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x < k.left ? this.computeMidOrthoPosition(a.x,
|
|
k.left, !1) : a.x < k.right && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.right, m.x = l.x, m.y = c.y) : 0 === d && a.x < k.left && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y);
|
|
else {
|
|
l = new N(a.x, c.y);
|
|
m = new N((a.x + c.x) / 2, c.y);
|
|
if (180 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 180 === d && (k.Ma(a) || h.Ma(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (180 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y,
|
|
k.bottom), !0) : c.y > a.y && (180 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
|
|
if (l.y > h.top && l.y < h.bottom)
|
|
if (c.x >= h.left && c.x <= a.x || a.x <= k.right && a.x >= c.x) {
|
|
if (90 === d || 270 === d) l = new N(Math.max((a.x + c.x) / 2, a.x), a.y), m = new N(l.x, c.y)
|
|
} else l.y = 270 === d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 0 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 0 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
|
|
}
|
|
else if (180 === b)
|
|
if (c.x < a.x || 270 === d && c.y < a.y && k.left < a.x ||
|
|
90 === d && c.y > a.y && k.left < a.x) l = new N(c.x, a.y), m = new N(c.x, (a.y + c.y) / 2), 0 === d ? (l.x = this.computeMidOrthoPosition(a.x, c.x, !1), m.x = l.x, m.y = c.y) : 270 === d && c.y < a.y || 90 === d && c.y > a.y ? (l.x = a.x > k.right ? this.computeMidOrthoPosition(a.x, k.right, !1) : a.x > k.left && (270 === d && a.y < k.top || 90 === d && a.y > k.bottom) ? this.computeMidOrthoPosition(a.x, c.x, !1) : k.left, m.x = l.x, m.y = c.y) : 180 === d && a.x > k.right && a.y > k.top && a.y < k.bottom && (l.x = a.x, l.y = a.y < c.y ? Math.min(c.y, k.top) : Math.max(c.y, k.bottom), m.y = l.y);
|
|
else {
|
|
l = new N(a.x, c.y);
|
|
m = new N((a.x +
|
|
c.x) / 2, c.y);
|
|
if (0 === d || 90 === d && c.y < h.top || 270 === d && c.y > h.bottom) 0 === d && (k.Ma(a) || h.Ma(c)) ? l.y = this.computeMidOrthoPosition(a.y, c.y, !0) : c.y < a.y && (0 === d || 90 === d) ? l.y = this.computeMidOrthoPosition(h.top, Math.max(c.y, k.bottom), !0) : c.y > a.y && (0 === d || 270 === d) && (l.y = this.computeMidOrthoPosition(h.bottom, Math.min(c.y, k.top), !0)), m.x = c.x, m.y = l.y;
|
|
if (l.y > h.top && l.y < h.bottom)
|
|
if (c.x <= h.right && c.x >= a.x || a.x >= k.left && a.x <= c.x) {
|
|
if (90 === d || 270 === d) l = new N(Math.min((a.x + c.x) / 2, a.x), a.y), m = new N(l.x, c.y)
|
|
} else l.y = 270 ===
|
|
d || (0 === d || 180 === d) && c.y < a.y ? Math.min(c.y, 180 === d ? h.top : Math.min(h.top, k.top)) : Math.max(c.y, 180 === d ? h.bottom : Math.max(h.bottom, k.bottom)), m.x = c.x, m.y = l.y
|
|
}
|
|
else if (90 === b)
|
|
if (c.y > a.y || 180 === d && c.x < a.x && k.bottom > a.y || 0 === d && c.x > a.x && k.bottom > a.y) l = new N(a.x, c.y), m = new N((a.x + c.x) / 2, c.y), 270 === d ? (l.y = this.computeMidOrthoPosition(a.y, c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x > a.x ? (l.y = a.y < k.top ? this.computeMidOrthoPosition(a.y, k.top, !0) : a.y < k.bottom && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ?
|
|
this.computeMidOrthoPosition(a.y, c.y, !0) : k.bottom, m.x = c.x, m.y = l.y) : 90 === d && a.y < k.top && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x);
|
|
else {
|
|
l = new N(c.x, a.y);
|
|
m = new N(c.x, (a.y + c.y) / 2);
|
|
if (270 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 270 === d && (k.Ma(a) || h.Ma(c)) ? l.x = this.computeMidOrthoPosition(a.x, c.x, !1) : c.x < a.x && (270 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (270 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right,
|
|
Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
|
|
if (l.x > h.left && l.x < h.right)
|
|
if (c.y >= h.top && c.y <= a.y || a.y <= k.bottom && a.y >= c.y) {
|
|
if (0 === d || 180 === d) l = new N(a.x, Math.max((a.y + c.y) / 2, a.y)), m = new N(c.x, l.y)
|
|
} else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 90 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 90 === d ? h.right : Math.max(h.right, k.right)), m.x = l.x, m.y = c.y
|
|
}
|
|
else if (c.y < a.y || 180 === d && c.x < a.x && k.top < a.y || 0 === d && c.x > a.x && k.top < a.y) l = new N(a.x, c.y), m = new N((a.x + c.x) / 2, c.y), 90 === d ? (l.y = this.computeMidOrthoPosition(a.y,
|
|
c.y, !0), m.x = c.x, m.y = l.y) : 180 === d && c.x < a.x || 0 === d && c.x >= a.x ? (l.y = a.y > k.bottom ? this.computeMidOrthoPosition(a.y, k.bottom, !0) : a.y > k.top && (180 === d && a.x < k.left || 0 === d && a.x > k.right) ? this.computeMidOrthoPosition(a.y, c.y, !0) : k.top, m.x = c.x, m.y = l.y) : 270 === d && a.y > k.bottom && a.x > k.left && a.x < k.right && (l.x = a.x < c.x ? Math.min(c.x, k.left) : Math.max(c.x, k.right), l.y = a.y, m.x = l.x);
|
|
else {
|
|
l = new N(c.x, a.y);
|
|
m = new N(c.x, (a.y + c.y) / 2);
|
|
if (90 === d || 0 === d && c.x < h.left || 180 === d && c.x > h.right) 90 === d && (k.Ma(a) || h.Ma(c)) ? l.x = this.computeMidOrthoPosition(a.x,
|
|
c.x, !1) : c.x < a.x && (90 === d || 0 === d) ? l.x = this.computeMidOrthoPosition(h.left, Math.max(c.x, k.right), !1) : c.x > a.x && (90 === d || 180 === d) && (l.x = this.computeMidOrthoPosition(h.right, Math.min(c.x, k.left), !1)), m.x = l.x, m.y = c.y;
|
|
if (l.x > h.left && l.x < h.right)
|
|
if (c.y <= h.bottom && c.y >= a.y || a.y >= k.top && a.y <= c.y) {
|
|
if (0 === d || 180 === d) l = new N(a.x, Math.min((a.y + c.y) / 2, a.y)), m = new N(c.x, l.y)
|
|
} else l.x = 180 === d || (90 === d || 270 === d) && c.x < a.x ? Math.min(c.x, 270 === d ? h.left : Math.min(h.left, k.left)) : Math.max(c.x, 270 === d ? h.right : Math.max(h.right,
|
|
k.right)), m.x = l.x, m.y = c.y
|
|
}
|
|
var n = l,
|
|
p = m;
|
|
if (this.jj) {
|
|
var q = this.h,
|
|
r;
|
|
(r = null === q) || (q.Ua.nf ? r = !1 : (r = q.eb, r = r instanceof ih ? !r.tw || r.dI : !0), r = !r);
|
|
if (r || h.Ma(c) && !g.li(e) || k.Ma(a) && !e.li(g) || e === g || this.layer.Nc) a = !1;
|
|
else if (e = ja(q, !0, this.Va, null), e.Dp(Math.min(a.x, n.x), Math.min(a.y, n.y), Math.abs(a.x - n.x), Math.abs(a.y - n.y)) && e.Dp(Math.min(n.x, p.x), Math.min(n.y, p.y), Math.abs(n.x - p.x), Math.abs(n.y - p.y)) && e.Dp(Math.min(p.x, c.x), Math.min(p.y, c.y), Math.abs(p.x - c.x), Math.abs(p.y - c.y))) a = !1;
|
|
else if (h = h.copy().qi(k),
|
|
h.ag(2 * e.ep, 2 * e.cp), eq(e, a, b, c, d, h), k = fq(e, c.x, c.y), e.abort || 999999 !== k || (lm(e), k = e.NF, h.ag(e.ep * k, e.cp * k), eq(e, a, b, c, d, h), k = fq(e, c.x, c.y)), e.abort || 999999 !== k || (lm(e), k = e.WE, h.ag(e.ep * k, e.cp * k), eq(e, a, b, c, d, h), k = fq(e, c.x, c.y)), !e.abort && 999999 === k && e.gG && (lm(e), eq(e, a, b, c, d, e.vb), k = fq(e, c.x, c.y)), !e.abort && 999999 > k && 0 !== fq(e, c.x, c.y)) {
|
|
gq(this, e, c.x, c.y, d, !0);
|
|
d = this.m(2);
|
|
if (4 > this.sa) 0 === b || 180 === b ? (d.x = a.x, d.y = c.y) : (d.x = c.x, d.y = a.y), this.aa(2, d.x, d.y), this.B(3, d.x, d.y);
|
|
else if (c = this.m(3), 0 === b ||
|
|
180 === b) eb(d.x, c.x) ? (b = 0 === b ? Math.max(d.x, a.x) : Math.min(d.x, a.x), this.aa(2, b, a.y), this.aa(3, b, c.y)) : eb(d.y, c.y) ? (Math.abs(a.y - d.y) <= e.cp / 2 && (this.aa(2, d.x, a.y), this.aa(3, c.x, a.y)), this.B(2, d.x, a.y)) : this.aa(2, a.x, d.y);
|
|
else if (90 === b || 270 === b) eb(d.y, c.y) ? (b = 90 === b ? Math.max(d.y, a.y) : Math.min(d.y, a.y), this.aa(2, a.x, b), this.aa(3, c.x, b)) : eb(d.x, c.x) ? (Math.abs(a.x - d.x) <= e.ep / 2 && (this.aa(2, a.x, d.y), this.aa(3, a.x, c.y)), this.B(2, a.x, d.y)) : this.aa(2, d.x, a.y);
|
|
a = !0
|
|
} else a = !1
|
|
} else a = !1;
|
|
a || (this.gi(l), this.gi(m))
|
|
}
|
|
};
|
|
G.prototype.computeMidOrthoPosition = function(a, b) {
|
|
if (this.hasCurviness()) {
|
|
var c = this.computeCurviness();
|
|
return (a + b) / 2 + c
|
|
}
|
|
return (a + b) / 2
|
|
};
|
|
|
|
function Wh(a) {
|
|
if (null === a.h || !a.jj) return !1;
|
|
var b = a.points.o,
|
|
c = b.length;
|
|
if (4 > c) return !1;
|
|
a = ja(a.h, !0, a.Va, null);
|
|
for (var d = 1; d < c - 2; d++) {
|
|
var e = b[d],
|
|
g = b[d + 1];
|
|
if (!a.Dp(Math.min(e.x, g.x), Math.min(e.y, g.y), Math.abs(e.x - g.x), Math.abs(e.y - g.y))) return !0
|
|
}
|
|
return !1
|
|
}
|
|
|
|
function gq(a, b, c, d, e, g) {
|
|
var h = b.ep,
|
|
k = b.cp,
|
|
l = fq(b, c, d),
|
|
m = c,
|
|
n = d;
|
|
for (0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k; 1 < l && fq(b, m, n) === l - 1;) c = m, d = n, 0 === e ? m += h : 90 === e ? n += k : 180 === e ? m -= h : n -= k, l -= 1;
|
|
if (g) {
|
|
if (1 < l)
|
|
if (180 === e || 0 === e) c = Math.floor(c / h) * h + h / 2;
|
|
else if (90 === e || 270 === e) d = Math.floor(d / k) * k + k / 2
|
|
} else c = Math.floor(c / h) * h + h / 2, d = Math.floor(d / k) * k + k / 2;
|
|
1 < l && (g = e, m = c, n = d, 0 === e ? (g = 90, n += k) : 90 === e ? (g = 180, m -= h) : 180 === e ? (g = 270, n -= k) : 270 === e && (g = 0, m += h), fq(b, m, n) === l - 1 ? gq(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), fq(b, m, n) === l - 1 && gq(a, b, m, n, g, !1)));
|
|
a.sl(c, d)
|
|
}
|
|
G.prototype.findClosestSegment = function(a) {
|
|
u && z.l(a, N, G, "findClosestSegment:p");
|
|
var b = a.x;
|
|
a = a.y;
|
|
for (var c = this.m(0), d = this.m(1), e = vb(b, a, c.x, c.y, d.x, d.y), g = 0, h = 1; h < this.sa - 1; h++) {
|
|
var c = this.m(h + 1),
|
|
k = vb(b, a, d.x, d.y, c.x, c.y),
|
|
d = c;
|
|
k < e && (g = h, e = k)
|
|
}
|
|
return g
|
|
};
|
|
G.prototype.invalidateGeometry = G.prototype.Ae = function() {
|
|
this.ab = null
|
|
};
|
|
z.w(G, {
|
|
Jl: "geometry"
|
|
}, function() {
|
|
null === this.ab && (this.Bn(), this.ab = this.makeGeometry());
|
|
return this.ab
|
|
});
|
|
G.prototype.on = function(a) {
|
|
if (!a) {
|
|
if (!1 === this.Cg) return;
|
|
a = this.gf();
|
|
if (null !== this.ab && (null === a || null !== a.Jl)) return
|
|
}
|
|
this.ab = this.makeGeometry();
|
|
a = this.path;
|
|
if (null !== a) {
|
|
a.ab = this.ab;
|
|
for (var b = this.va.o, c = b.length, d = 0; d < c; d++) {
|
|
var e = b[d];
|
|
e !== a && e.Ff && e instanceof X && (e.ab = this.ab)
|
|
}
|
|
}
|
|
};
|
|
G.prototype.makeGeometry = function() {
|
|
var a = this.sa;
|
|
if (2 > a) {
|
|
var b = new hf(jf),
|
|
c = new kf(0, 0);
|
|
b.cc.add(c);
|
|
return b
|
|
}
|
|
var d = !1,
|
|
b = this.h;
|
|
null !== b && Up(this) && b.Rk.contains(this) && null !== this.cw && (d = !0);
|
|
var c = b = 0,
|
|
e = this.m(0).copy(),
|
|
g = e.copy(),
|
|
b = this.Yc.o,
|
|
h = this.computeCurve();
|
|
if (h === Ui && 3 <= a && !td(this.cq, 0))
|
|
if (3 === a) var k = this.m(1),
|
|
b = Math.min(e.x, k.x),
|
|
c = Math.min(e.y, k.y),
|
|
k = this.m(2),
|
|
b = Math.min(b, k.x),
|
|
c = Math.min(c, k.y);
|
|
else {
|
|
if (this.rc)
|
|
for (k = 0; k < a; k++) c = b[k], g.x = Math.min(c.x, g.x), g.y = Math.min(c.y, g.y);
|
|
else
|
|
for (k =
|
|
3; k < a; k += 3) k + 3 >= a && (k = a - 1), b = this.m(k), g.x = Math.min(b.x, g.x), g.y = Math.min(b.y, g.y);
|
|
b = g.x;
|
|
c = g.y
|
|
}
|
|
else {
|
|
for (k = 0; k < a; k++) c = b[k], g.x = Math.min(c.x, g.x), g.y = Math.min(c.y, g.y);
|
|
b = g.x;
|
|
c = g.y
|
|
}
|
|
b -= this.pz.x;
|
|
c -= this.pz.y;
|
|
e.x -= b;
|
|
e.y -= c;
|
|
if (2 === a) {
|
|
var l = this.m(1).copy();
|
|
l.x -= b;
|
|
l.y -= c;
|
|
0 !== cq(this) && hq(this, e, !0, g);
|
|
0 !== dq(this) && hq(this, l, !1, g);
|
|
b = new hf(mf);
|
|
b.Ha = e.x;
|
|
b.Da = e.y;
|
|
b.L = l.x;
|
|
b.M = l.y
|
|
} else {
|
|
l = z.v();
|
|
0 !== cq(this) && hq(this, e, !0, g);
|
|
R(l, e.x, e.y, !1, !1);
|
|
if (h === Ui && 3 <= a && !td(this.cq, 0))
|
|
if (3 === a) k = this.m(1), a = k.x - b, d = k.y -
|
|
c, k = this.m(2).copy(), k.x -= b, k.y -= c, 0 !== dq(this) && hq(this, k, !1, g), S(l, a, d, a, d, k.x, k.y);
|
|
else if (this.rc) {
|
|
for (var g = new N(b, c), e = this.m(1).copy(), h = new N(b, c), a = new N(b, c), d = this.m(0), m = null, n = this.cq / 3, k = 1; k < this.sa - 1; k++) {
|
|
var m = this.m(k),
|
|
p = d,
|
|
q = m,
|
|
r = this.m(iq(this, m, k, !1));
|
|
if (!td(p.x, q.x) || !td(q.x, r.x))
|
|
if (!td(p.y, q.y) || !td(q.y, r.y)) {
|
|
var s = n,
|
|
t = h,
|
|
v = a;
|
|
isNaN(s) && (s = this.cq / 3);
|
|
var x = p.x,
|
|
p = p.y,
|
|
y = q.x,
|
|
q = q.y,
|
|
A = r.x,
|
|
r = r.y,
|
|
B = s * jq(x, p, y, q),
|
|
s = s * jq(y, q, A, r);
|
|
td(p, q) && td(y, A) && (y > x ? r > q ? (t.x = y - B, t.y = q - B, v.x = y + s, v.y = q +
|
|
s) : (t.x = y - B, t.y = q + B, v.x = y + s, v.y = q - s) : r > q ? (t.x = y + B, t.y = q - B, v.x = y - s, v.y = q + s) : (t.x = y + B, t.y = q + B, v.x = y - s, v.y = q - s));
|
|
td(x, y) && td(q, r) && (q > p ? (A > y ? (t.x = y - B, t.y = q - B, v.x = y + s) : (t.x = y + B, t.y = q - B, v.x = y - s), v.y = q + s) : (A > y ? (t.x = y - B, t.y = q + B, v.x = y + s) : (t.x = y + B, t.y = q + B, v.x = y - s), v.y = q - s));
|
|
if (td(x, y) && td(y, A) || td(p, q) && td(q, r)) x = .5 * (x + A), p = .5 * (p + r), t.x = x, t.y = p, v.x = x, v.y = p;
|
|
1 === k ? (e.x = .5 * (d.x + m.x), e.y = .5 * (d.y + m.y)) : 2 === k && td(d.x, this.m(0).x) && td(d.y, this.m(0).y) && (e.x = .5 * (d.x + m.x), e.y = .5 * (d.y + m.y));
|
|
S(l, e.x - b, e.y - c, h.x - b, h.y -
|
|
c, m.x - b, m.y - c);
|
|
g.set(h);
|
|
e.set(a);
|
|
d = m
|
|
}
|
|
}
|
|
k = d.x;
|
|
d = d.y;
|
|
g = this.m(this.sa - 1);
|
|
k = .5 * (k + g.x);
|
|
d = .5 * (d + g.y);
|
|
S(l, a.x - b, a.y - c, k - b, d - c, g.x - b, g.y - c)
|
|
} else
|
|
for (k = 3; k < a; k += 3) d = this.m(k - 2), k + 3 >= a && (k = a - 1), g = this.m(k - 1), e = this.m(k), k === a - 1 && 0 !== dq(this) && (e = e.copy(), hq(this, e, !1, Id)), S(l, d.x - b, d.y - c, g.x - b, g.y - c, e.x - b, e.y - c);
|
|
else {
|
|
g = z.O();
|
|
g.assign(this.m(0));
|
|
for (k = 1; k < a;) {
|
|
k = iq(this, g, k, 1 < k);
|
|
t = this.m(k);
|
|
if (k >= a - 1) {
|
|
g !== t && (0 !== dq(this) && (t = t.copy(), hq(this, t, !1, Id)), kq(this, l, -b, -c, g, t, d));
|
|
break
|
|
}
|
|
k = iq(this, t, k + 1, k < a - 3);
|
|
e =
|
|
l;
|
|
h = -b;
|
|
m = -c;
|
|
n = g;
|
|
v = this.m(k);
|
|
x = g;
|
|
p = d;
|
|
eb(n.y, t.y) && eb(t.x, v.x) ? (s = this.computeCorner(), s = Math.min(s, Math.abs(t.x - n.x) / 2), s = y = Math.min(s, Math.abs(v.y - t.y) / 2), eb(s, 0) ? (kq(this, e, h, m, n, t, p), x.assign(t)) : (q = t.x, A = t.y, r = q, B = A, q = t.x > n.x ? t.x - s : t.x + s, B = v.y > t.y ? t.y + y : t.y - y, kq(this, e, h, m, n, new N(q, A), p), yf(e, t.x + h, t.y + m, r + h, B + m), x.n(r, B))) : eb(n.x, t.x) && eb(t.y, v.y) ? (s = this.computeCorner(), y = Math.min(s, Math.abs(t.y - n.y) / 2), y = s = Math.min(y, Math.abs(v.x - t.x) / 2), eb(s, 0) ? (kq(this, e, h, m, n, t, p), x.assign(t)) : (q = t.x, B =
|
|
A = t.y, A = t.y > n.y ? t.y - y : t.y + y, r = v.x > t.x ? t.x + s : t.x - s, kq(this, e, h, m, n, new N(q, A), p), yf(e, t.x + h, t.y + m, r + h, B + m), x.n(r, B))) : (kq(this, e, h, m, n, t, p), x.assign(t))
|
|
}
|
|
z.A(g)
|
|
}
|
|
b = l.q;
|
|
z.u(l)
|
|
}
|
|
return b
|
|
};
|
|
|
|
function jq(a, b, c, d) {
|
|
a = c - a;
|
|
if (isNaN(a) || Infinity === a || -Infinity === a) return NaN;
|
|
0 > a && (a = -a);
|
|
b = d - b;
|
|
if (isNaN(b) || Infinity === b || -Infinity === b) return NaN;
|
|
0 > b && (b = -b);
|
|
return td(a, 0) ? b : td(b, 0) ? a : Math.sqrt(a * a + b * b)
|
|
}
|
|
|
|
function hq(a, b, c, d) {
|
|
var e = a.sa;
|
|
if (!(2 > e))
|
|
if (c) {
|
|
var g = a.m(1);
|
|
c = g.x - d.x;
|
|
d = g.y - d.y;
|
|
g = jq(b.x, b.y, c, d);
|
|
0 !== g && (e = 2 === e ? .5 * g : g, a = cq(a), a > e && (a = e), c = a * (c - b.x) / g, a = a * (d - b.y) / g, b.x += c, b.y += a)
|
|
} else g = a.m(e - 2), c = g.x - d.x, d = g.y - d.y, g = jq(b.x, b.y, c, d), 0 !== g && (e = 2 === e ? .5 * g : g, a = dq(a), a > e && (a = e), c = a * (b.x - c) / g, a = a * (b.y - d) / g, b.x -= c, b.y -= a)
|
|
}
|
|
|
|
function iq(a, b, c, d) {
|
|
for (var e = a.sa, g = b; td(b.x, g.x) && td(b.y, g.y);) {
|
|
if (c >= e) return e - 1;
|
|
g = a.m(c++)
|
|
}
|
|
if (!td(b.x, g.x) && !td(b.y, g.y)) return c - 1;
|
|
for (var h = g; td(b.x, g.x) && td(g.x, h.x) && (!d || (b.y >= g.y ? g.y >= h.y : g.y <= h.y)) || td(b.y, g.y) && td(g.y, h.y) && (!d || (b.x >= g.x ? g.x >= h.x : g.x <= h.x));) {
|
|
if (c >= e) return e - 1;
|
|
h = a.m(c++)
|
|
}
|
|
return c - 2
|
|
}
|
|
|
|
function kq(a, b, c, d, e, g, h) {
|
|
if (!h && Up(a)) {
|
|
h = [];
|
|
var k = 0;
|
|
a.isVisible() && (k = lq(a, e, g, h));
|
|
var l = e.x,
|
|
l = e.y;
|
|
if (0 < k)
|
|
if (eb(e.y, g.y))
|
|
if (e.x < g.x)
|
|
for (var m = 0; m < k;) {
|
|
var n = Math.max(e.x, Math.min(h[m++] - 5, g.x - 10));
|
|
b.lineTo(n + c, g.y + d);
|
|
for (var l = n + c, p = Math.min(n + 10, g.x); m < k;) {
|
|
var q = h[m];
|
|
if (q < p + 10) m++, p = Math.min(q + 5, g.x);
|
|
else break
|
|
}
|
|
q = (n + p) / 2 + c;
|
|
q = g.y - 10 + d;
|
|
n = p + c;
|
|
p = g.y + d;
|
|
a.Se === Mi ? R(b, n, p, !1, !1) : S(b, l, q, n, q, n, p)
|
|
} else
|
|
for (m = k - 1; 0 <= m;) {
|
|
n = Math.min(e.x, Math.max(h[m--] + 5, g.x + 10));
|
|
b.lineTo(n + c, g.y + d);
|
|
l = n + c;
|
|
for (p = Math.max(n -
|
|
10, g.x); 0 <= m;)
|
|
if (q = h[m], q > p - 10) m--, p = Math.max(q - 5, g.x);
|
|
else break;
|
|
q = g.y - 10 + d;
|
|
n = p + c;
|
|
p = g.y + d;
|
|
a.Se === Mi ? R(b, n, p, !1, !1) : S(b, l, q, n, q, n, p)
|
|
} else if (eb(e.x, g.x))
|
|
if (e.y < g.y)
|
|
for (m = 0; m < k;) {
|
|
n = Math.max(e.y, Math.min(h[m++] - 5, g.y - 10));
|
|
b.lineTo(g.x + c, n + d);
|
|
l = n + d;
|
|
for (p = Math.min(n + 10, g.y); m < k;)
|
|
if (q = h[m], q < p + 10) m++, p = Math.min(q + 5, g.y);
|
|
else break;
|
|
q = g.x - 10 + c;
|
|
n = g.x + c;
|
|
p += d;
|
|
a.Se === Mi ? R(b, n, p, !1, !1) : S(b, q, l, q, p, n, p)
|
|
} else
|
|
for (m = k - 1; 0 <= m;) {
|
|
n = Math.min(e.y, Math.max(h[m--] + 5, g.y + 10));
|
|
b.lineTo(g.x + c, n + d);
|
|
l = n + d;
|
|
for (p = Math.max(n -
|
|
10, g.y); 0 <= m;)
|
|
if (q = h[m], q > p - 10) m--, p = Math.max(q - 5, g.y);
|
|
else break;
|
|
q = g.x - 10 + c;
|
|
n = g.x + c;
|
|
p += d;
|
|
a.Se === Mi ? R(b, n, p, !1, !1) : S(b, q, l, q, p, n, p)
|
|
}
|
|
}
|
|
b.lineTo(g.x + c, g.y + d)
|
|
}
|
|
|
|
function lq(a, b, c, d) {
|
|
var e = a.h;
|
|
if (null === e || b.N(c)) return 0;
|
|
for (e = e.mn; e.next();) {
|
|
var g = e.value;
|
|
if (null !== g && g.visible)
|
|
for (var g = g.mb.o, h = g.length, k = 0; k < h; k++) {
|
|
var l = g[k];
|
|
if (l instanceof G) {
|
|
if (l === a) return 0 < d.length && d.sort(function(a, b) {
|
|
return a - b
|
|
}), d.length;
|
|
if (l.isVisible() && Up(l)) {
|
|
var m = l.un;
|
|
m.F() && a.un.Ig(m) && !a.usesSamePort(l) && (m = l.path, null !== m && m.nj() && mq(b, c, d, l))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
0 < d.length && d.sort(function(a, b) {
|
|
return a - b
|
|
});
|
|
return d.length
|
|
}
|
|
|
|
function mq(a, b, c, d) {
|
|
for (var e = eb(a.y, b.y), g = d.sa, h = d.m(0), k = z.O(), l = 1; l < g; l++) {
|
|
var m = d.m(l);
|
|
if (l < g - 1) {
|
|
var n = d.m(l + 1);
|
|
if (h.y === m.y && m.y === n.y) {
|
|
if (m.x > h.x && n.x > m.x || m.x < h.x && n.x < m.x) m = n, l++
|
|
} else h.x === m.x && m.x === n.x && (m.y > h.y && n.y > m.y || m.y < h.y && n.y < m.y) && (m = n, l++)
|
|
}
|
|
a: {
|
|
var n = k,
|
|
p = a.x,
|
|
q = a.y,
|
|
r = b.x,
|
|
s = b.y,
|
|
t = h.x,
|
|
h = h.y,
|
|
v = m.x,
|
|
x = m.y;
|
|
if (!eb(p, r)) {
|
|
if (eb(q, s) && eb(t, v) && Math.min(p, r) < t && Math.max(p, r) > t && Math.min(h, x) < q && Math.max(h, x) > q && !eb(h, x)) {
|
|
n.x = t;
|
|
n.y = q;
|
|
n = !0;
|
|
break a
|
|
}
|
|
} else if (!eb(q, s) && eb(h, x) && Math.min(q, s) <
|
|
h && Math.max(q, s) > h && Math.min(t, v) < p && Math.max(t, v) > p && !eb(t, v)) {
|
|
n.x = p;
|
|
n.y = h;
|
|
n = !0;
|
|
break a
|
|
}
|
|
n.x = 0;n.y = 0;n = !1
|
|
}
|
|
n && (e ? c.push(k.x) : c.push(k.y));
|
|
h = m
|
|
}
|
|
z.A(k)
|
|
}
|
|
z.w(G, {
|
|
Bt: "firstPickIndex"
|
|
}, function() {
|
|
return 2 >= this.sa ? 0 : this.rc || Xp(this) !== Yb ? 1 : 0
|
|
});
|
|
z.w(G, {
|
|
ox: "lastPickIndex"
|
|
}, function() {
|
|
var a = this.sa;
|
|
return 0 === a ? 0 : 2 >= a ? a - 1 : this.rc || Yp(this) !== Yb ? a - 2 : a - 1
|
|
});
|
|
|
|
function Up(a) {
|
|
a = a.Se;
|
|
return a === Li || a === Mi
|
|
}
|
|
|
|
function Wp(a, b) {
|
|
if (b || Up(a)) {
|
|
var c = a.h;
|
|
null === c || c.Rk.contains(a) || null === a.cw || c.Rk.add(a, a.cw)
|
|
}
|
|
}
|
|
|
|
function Oi(a, b) {
|
|
var c = a.layer;
|
|
if (null !== c && c.visible && !c.Nc) {
|
|
var d = c.h;
|
|
if (null !== d)
|
|
for (var e = !1, d = d.mn; d.next();) {
|
|
var g = d.value;
|
|
if (g.visible)
|
|
if (g === c)
|
|
for (var e = !0, h = !1, g = g.mb.o, k = g.length, l = 0; l < k; l++) {
|
|
var m = g[l];
|
|
m instanceof G && (m === a ? h = !0 : h && nq(a, m, b))
|
|
} else if (e)
|
|
for (g = g.mb.o, k = g.length, l = 0; l < k; l++) m = g[l], m instanceof G && nq(a, m, b)
|
|
}
|
|
}
|
|
}
|
|
|
|
function nq(a, b, c) {
|
|
if (null !== b && null !== b.ab && Up(b)) {
|
|
var d = b.un;
|
|
d.F() && (a.un.Ig(d) || c.Ig(d)) && (a.usesSamePort(b) || b.Ae())
|
|
}
|
|
}
|
|
G.prototype.usesSamePort = function(a) {
|
|
var b = this.sa,
|
|
c = a.sa;
|
|
if (0 < b && 0 < c) {
|
|
var d = this.m(0),
|
|
e = a.m(0);
|
|
if (d.Mc(e)) return !0;
|
|
b = this.m(b - 1);
|
|
a = a.m(c - 1);
|
|
if (b.Mc(a) || d.Mc(a) || b.Mc(e)) return !0
|
|
} else if (this.Y === a.Y || this.da === a.da || this.Y === a.da || this.da === a.Y) return !0;
|
|
return !1
|
|
};
|
|
G.prototype.isVisible = function() {
|
|
if (!D.prototype.isVisible.call(this)) return !1;
|
|
var a = this.Va,
|
|
b = !0,
|
|
c = this.h;
|
|
null !== c && (b = c.ce);
|
|
c = this.Y;
|
|
if (null !== c) {
|
|
if (this.Oc && b && !c.vd) return !1;
|
|
if (c === a) return !0;
|
|
c = c.findVisibleNode();
|
|
if (null === c || c === a) return !1
|
|
}
|
|
c = this.da;
|
|
if (null !== c) {
|
|
if (this.Oc && !b && !c.vd) return !1;
|
|
if (c === a) return !0;
|
|
b = c.findVisibleNode();
|
|
if (null === b || b === a) return !1
|
|
}
|
|
return !0
|
|
};
|
|
G.prototype.wd = function(a) {
|
|
D.prototype.wd.call(this, a);
|
|
null !== this.ri && this.ri.zp();
|
|
if (null !== this.Ke)
|
|
for (var b = this.Ke.i; b.next();) b.value.wd(a)
|
|
};
|
|
z.defineProperty(G, {
|
|
it: "adjusting"
|
|
}, function() {
|
|
return this.mq
|
|
}, function(a) {
|
|
var b = this.mq;
|
|
b !== a && (u && z.Ba(a, G, G, "adjusting"), this.mq = a, this.j("adjusting", b, a))
|
|
});
|
|
z.defineProperty(G, {
|
|
Kz: "corner"
|
|
}, function() {
|
|
return this.Fq
|
|
}, function(a) {
|
|
var b = this.Fq;
|
|
b !== a && (u && z.g(a, "number", G, "corner"), this.Fq = a, this.Ae(), this.j("corner", b, a))
|
|
});
|
|
z.defineProperty(G, {
|
|
Se: "curve"
|
|
}, function() {
|
|
return this.Iq
|
|
}, function(a) {
|
|
var b = this.Iq;
|
|
b !== a && (u && z.Ba(a, G, G, "curve"), this.Iq = a, this.qc(), this.Ae(), Wp(this, b === Mi || b === Li || a === Mi || a === Li), this.j("curve", b, a))
|
|
});
|
|
z.defineProperty(G, {
|
|
Qw: "curviness"
|
|
}, function() {
|
|
return this.Jq
|
|
}, function(a) {
|
|
var b = this.Jq;
|
|
b !== a && (u && z.g(a, "number", G, "curviness"), this.Jq = a, this.qc(), this.Ae(), this.j("curviness", b, a))
|
|
});
|
|
z.defineProperty(G, {
|
|
Gx: "routing"
|
|
}, function() {
|
|
return this.Dm
|
|
}, function(a) {
|
|
var b = this.Dm;
|
|
b !== a && (u && z.Ba(a, G, G, "routing"), this.Dm = a, this.Di = null, this.qc(), Wp(this, 2 === (b.value & 2) || 2 === (a.value & 2)), this.j("routing", b, a))
|
|
});
|
|
z.defineProperty(G, {
|
|
cq: "smoothness"
|
|
}, function() {
|
|
return this.Ms
|
|
}, function(a) {
|
|
var b = this.Ms;
|
|
b !== a && (u && z.g(a, "number", G, "smoothness"), this.Ms = a, this.Ae(), this.j("smoothness", b, a))
|
|
});
|
|
|
|
function Sp(a) {
|
|
var b = a.pg;
|
|
if (null !== b) {
|
|
var c = a.Bg;
|
|
if (null !== c) {
|
|
var d = a.Oh;
|
|
a = a.ei;
|
|
for (var e = null, g = null, h = b.mc.o, k = h.length, l = 0; l < k; l++) {
|
|
var m = h[l];
|
|
if (m.pg === b && m.Oh === d && m.Bg === c && m.ei === a || m.pg === c && m.Oh === a && m.Bg === b && m.ei === d) null === g ? g = m : (null === e && (e = [], e.push(g)), e.push(m))
|
|
}
|
|
if (null !== e) {
|
|
g = Ap(b, c, d, a);
|
|
null === g && (g = new wk, g.Op = b, g.yx = d, g.du = c, g.zx = a, zp(b, g), zp(c, g));
|
|
g.links = e;
|
|
for (l = 0; l < e.length; l++) m = e[l], m.ri = g;
|
|
g.zp()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function Rp(a) {
|
|
var b = a.ri;
|
|
null !== b && (a.ri = null, a = b.links.indexOf(a), 0 <= a && (z.hi(b.links, a), b.zp()))
|
|
}
|
|
|
|
function wk() {
|
|
z.kc(this);
|
|
this.zv = !1;
|
|
this.zx = this.du = this.yx = this.Op = null;
|
|
this.links = []
|
|
}
|
|
wk.prototype.zp = function() {
|
|
if (!this.zv) {
|
|
var a = this.links;
|
|
0 < a.length && (a = a[0].h, null !== a && a.jC.add(this))
|
|
}
|
|
this.zv = !0
|
|
};
|
|
wk.prototype.dB = function() {
|
|
if (this.zv) {
|
|
this.zv = !1;
|
|
var a = this.links;
|
|
if (0 < a.length) {
|
|
var b = a[0],
|
|
c = b.h;
|
|
b.arrangeBundledLinks(a, null === c || c.kn);
|
|
1 === a.length && (b.ri = null, a.length = 0)
|
|
}
|
|
0 === a.length && (a = this.Op, null !== this && null !== a.Hh && a.Hh.remove(this), a = this.du, null !== this && null !== a.Hh && a.Hh.remove(this))
|
|
}
|
|
};
|
|
z.Yd(wk, {
|
|
Op: !0,
|
|
yx: !0,
|
|
du: !0,
|
|
zx: !0,
|
|
links: !0,
|
|
spacing: !0
|
|
});
|
|
|
|
function jm() {
|
|
z.kc(this);
|
|
this.UA = this.group = null;
|
|
this.yp = !0;
|
|
this.abort = !1;
|
|
this.Tf = this.Sf = 1;
|
|
this.Hr = this.Gr = -1;
|
|
this.zd = this.Rd = 8;
|
|
this.lc = null;
|
|
this.gG = !1;
|
|
this.NF = 22;
|
|
this.WE = 111
|
|
}
|
|
z.Yd(jm, {
|
|
group: !0,
|
|
UA: !0,
|
|
yp: !0,
|
|
abort: !0,
|
|
gG: !0,
|
|
NF: !0,
|
|
WE: !0
|
|
});
|
|
jm.prototype.initialize = function(a) {
|
|
if (!(0 >= a.width || 0 >= a.height)) {
|
|
var b = a.y,
|
|
c = a.x + a.width,
|
|
d = a.y + a.height;
|
|
this.Sf = Math.floor((a.x - this.Rd) / this.Rd) * this.Rd;
|
|
this.Tf = Math.floor((b - this.zd) / this.zd) * this.zd;
|
|
this.Gr = Math.ceil((c + 2 * this.Rd) / this.Rd) * this.Rd;
|
|
this.Hr = Math.ceil((d + 2 * this.zd) / this.zd) * this.zd;
|
|
a = 1 + (Math.ceil((this.Gr - this.Sf) / this.Rd) | 0);
|
|
b = 1 + (Math.ceil((this.Hr - this.Tf) / this.zd) | 0);
|
|
if (null === this.lc || this.Om < a - 1 || this.Pm < b - 1) {
|
|
c = [];
|
|
for (d = 0; d <= a; d++) {
|
|
for (var e = [], g = 0; g <= b; g++) e[g] = 0;
|
|
c[d] = e
|
|
}
|
|
this.lc =
|
|
c;
|
|
this.Om = a - 1;
|
|
this.Pm = b - 1
|
|
}
|
|
if (null !== this.lc)
|
|
for (a = 0; a <= this.Om; a++)
|
|
for (b = 0; b <= this.Pm; b++) this.lc[a][b] = 999999
|
|
}
|
|
};
|
|
z.w(jm, {
|
|
vb: null
|
|
}, function() {
|
|
return new w(this.Sf, this.Tf, this.Gr - this.Sf, this.Hr - this.Tf)
|
|
});
|
|
z.defineProperty(jm, {
|
|
ep: null
|
|
}, function() {
|
|
return this.Rd
|
|
}, function(a) {
|
|
0 < a && a !== this.Rd && (this.Rd = a, this.initialize(this.vb))
|
|
});
|
|
z.defineProperty(jm, {
|
|
cp: null
|
|
}, function() {
|
|
return this.zd
|
|
}, function(a) {
|
|
0 < a && a !== this.zd && (this.zd = a, this.initialize(this.vb))
|
|
});
|
|
|
|
function oq(a, b, c) {
|
|
return a.Sf <= b && b <= a.Gr && a.Tf <= c && c <= a.Hr
|
|
}
|
|
|
|
function fq(a, b, c) {
|
|
if (!oq(a, b, c)) return 0;
|
|
b -= a.Sf;
|
|
b /= a.Rd;
|
|
c -= a.Tf;
|
|
c /= a.zd;
|
|
return a.lc[b | 0][c | 0]
|
|
}
|
|
|
|
function mm(a, b, c) {
|
|
oq(a, b, c) && (b -= a.Sf, b /= a.Rd, c -= a.Tf, c /= a.zd, a.lc[b | 0][c | 0] = 0)
|
|
}
|
|
|
|
function lm(a) {
|
|
if (null !== a.lc)
|
|
for (var b = 0; b <= a.Om; b++)
|
|
for (var c = 0; c <= a.Pm; c++) 1 <= a.lc[b][c] && (a.lc[b][c] |= 999999)
|
|
}
|
|
jm.prototype.Dp = function(a, b, c, d) {
|
|
if (a > this.Gr || a + c < this.Sf || b > this.Hr || b + d < this.Tf) return !0;
|
|
a = (a - this.Sf) / this.Rd | 0;
|
|
b = (b - this.Tf) / this.zd | 0;
|
|
c = Math.max(0, c) / this.Rd + 1 | 0;
|
|
var e = Math.max(0, d) / this.zd + 1 | 0;
|
|
0 > a && (c += a, a = 0);
|
|
0 > b && (e += b, b = 0);
|
|
if (0 > c || 0 > e) return !0;
|
|
d = Math.min(a + c - 1, this.Om) | 0;
|
|
for (c = Math.min(b + e - 1, this.Pm) | 0; a <= d; a++)
|
|
for (e = b; e <= c; e++)
|
|
if (0 === this.lc[a][e]) return !1;
|
|
return !0
|
|
};
|
|
|
|
function pq(a, b, c, d, e, g, h, k, l) {
|
|
if (!(b < g || b > h || c < k || c > l)) {
|
|
var m, n;
|
|
m = b | 0;
|
|
n = c | 0;
|
|
var p = a.lc[m][n];
|
|
if (1 <= p && 999999 > p)
|
|
for (e ? n += d : m += d, p += 1; g <= m && m <= h && k <= n && n <= l && !(p >= a.lc[m][n]);) a.lc[m][n] = p, p += 1, e ? n += d : m += d;
|
|
m = e ? n : m;
|
|
if (e)
|
|
if (0 < d)
|
|
for (c += d; c < m; c += d) pq(a, b, c, 1, !e, g, h, k, l), pq(a, b, c, -1, !e, g, h, k, l);
|
|
else
|
|
for (c += d; c > m; c += d) pq(a, b, c, 1, !e, g, h, k, l), pq(a, b, c, -1, !e, g, h, k, l);
|
|
else if (0 < d)
|
|
for (b += d; b < m; b += d) pq(a, b, c, 1, !e, g, h, k, l), pq(a, b, c, -1, !e, g, h, k, l);
|
|
else
|
|
for (b += d; b > m; b += d) pq(a, b, c, 1, !e, g, h, k, l), pq(a, b, c, -1, !e, g, h,
|
|
k, l)
|
|
}
|
|
}
|
|
|
|
function qq(a, b, c, d, e, g, h, k, l, m, n) {
|
|
for (var p = b | 0, q = c | 0, r = a.lc[p][q]; 0 === r && p > k && p < l && q > m && q < n;)
|
|
if (h ? q += g : p += g, r = a.lc[p][q], 1 >= Math.abs(p - d) && 1 >= Math.abs(q - e)) return a.abort = !0, 0;
|
|
p = b | 0;
|
|
q = c | 0;
|
|
r = a.lc[p][q];
|
|
b = 1;
|
|
for (a.lc[p][q] = b; 0 === r && p > k && p < l && q > m && q < n;) h ? q += g : p += g, r = a.lc[p][q], a.lc[p][q] = b, b += 1;
|
|
return h ? q : p
|
|
}
|
|
|
|
function eq(a, b, c, d, e, g) {
|
|
if (null !== a.lc) {
|
|
a.abort = !1;
|
|
var h = b.x,
|
|
k = b.y;
|
|
if (oq(a, h, k)) {
|
|
var h = h - a.Sf,
|
|
h = h / a.Rd,
|
|
k = k - a.Tf,
|
|
k = k / a.zd,
|
|
l = d.x,
|
|
m = d.y;
|
|
if (oq(a, l, m))
|
|
if (l -= a.Sf, l /= a.Rd, m -= a.Tf, m /= a.zd, 1 >= Math.abs(h - l) && 1 >= Math.abs(k - m)) a.abort = !0;
|
|
else {
|
|
var n = g.x;
|
|
b = g.y;
|
|
d = g.x + g.width;
|
|
var p = g.y + g.height,
|
|
n = n - a.Sf,
|
|
n = n / a.Rd;
|
|
b -= a.Tf;
|
|
b /= a.zd;
|
|
d -= a.Sf;
|
|
d /= a.Rd;
|
|
p -= a.Tf;
|
|
p /= a.zd;
|
|
g = Math.max(0, Math.min(a.Om, n | 0));
|
|
d = Math.min(a.Om, Math.max(0, d | 0));
|
|
b = Math.max(0, Math.min(a.Pm, b | 0));
|
|
var p = Math.min(a.Pm, 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 = qq(a, h, k, l, m, r, c, g, d, b, p): n = qq(a, h, k, l, m, r, c, g, d, b, p);
|
|
if (!a.abort) {
|
|
a: {
|
|
c = 0 === e || 90 === e ? 1 : -1;e = 90 === e || 270 === e;
|
|
for (var r = l | 0, s = m | 0, t = a.lc[r][s]; 0 === t && r > g && r < d && s > b && s < p;)
|
|
if (e ? s += c : r += c, t = a.lc[r][s], 1 >= Math.abs(r - h) && 1 >= Math.abs(s - k)) {
|
|
a.abort = !0;
|
|
break a
|
|
}
|
|
r = l | 0;s = m | 0;t = a.lc[r][s];
|
|
for (a.lc[r][s] = 999999; 0 === t && r > g && r < d && s > b && s < p;) e ? s += c : r += c,
|
|
t = a.lc[r][s],
|
|
a.lc[r][s] = 999999
|
|
}
|
|
a.abort || (pq(a, n, q, 1, !1, g, d, b, p), pq(a, n, q, -1, !1, g, d, b, p), pq(a, n, q, 1, !0, g, d,
|
|
b, p), pq(a, n, q, -1, !0, g, d, b, p))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
function aq() {
|
|
z.kc(this);
|
|
this.port = this.Pc = null;
|
|
this.fg = [];
|
|
this.Np = !1
|
|
}
|
|
z.Yd(aq, {
|
|
Pc: !0,
|
|
port: !0,
|
|
fg: !0,
|
|
Np: !0
|
|
});
|
|
aq.prototype.toString = function() {
|
|
for (var a = this.fg, b = this.Pc.toString() + " " + a.length.toString() + ":", c = 0; c < a.length; c++) {
|
|
var d = a[c];
|
|
null !== d && (b += "\n " + d.toString())
|
|
}
|
|
return b
|
|
};
|
|
|
|
function rq(a, b, c, d) {
|
|
b = b.offsetY;
|
|
switch (b) {
|
|
case z.ed:
|
|
return 90;
|
|
case z.Tc:
|
|
return 180;
|
|
case z.pd:
|
|
return 270;
|
|
case z.fd:
|
|
return 0
|
|
}
|
|
switch (b) {
|
|
case z.ed | z.pd:
|
|
return 180 < c ? 270 : 90;
|
|
case z.Tc | z.fd:
|
|
return 90 < c && 270 >= c ? 180 : 0
|
|
}
|
|
a = 180 * Math.atan2(a.height, a.width) / Math.PI;
|
|
switch (b) {
|
|
case z.Tc | z.pd:
|
|
return c > a && c <= 180 + a ? 180 : 270;
|
|
case z.pd | z.fd:
|
|
return c > 180 - a && c <= 360 - a ? 270 : 0;
|
|
case z.fd | z.ed:
|
|
return c > a && c <= 180 + a ? 90 : 0;
|
|
case z.ed | z.Tc:
|
|
return c > 180 - a && c <= 360 - a ? 180 : 90;
|
|
case z.Tc | z.pd | z.fd:
|
|
return 90 < c && c <= 180 + a ? 180 : c > 180 + a && c <= 360 -
|
|
a ? 270 : 0;
|
|
case z.pd | z.fd | z.ed:
|
|
return 180 < c && c <= 360 - a ? 270 : c > a && 180 >= c ? 90 : 0;
|
|
case z.fd | z.ed | z.Tc:
|
|
return c > a && c <= 180 - a ? 90 : c > 180 - a && 270 >= c ? 180 : 0;
|
|
case z.ed | z.Tc | z.pd:
|
|
return c > 180 - a && c <= 180 + a ? 180 : c > 180 + a ? 270 : 90
|
|
}
|
|
d && b !== (z.Tc | z.pd | z.fd | z.ed) && (c -= 15, 0 > c && (c += 360));
|
|
return c > a && c < 180 - a ? 90 : c >= 180 - a && c <= 180 + a ? 180 : c > 180 + a && c < 360 - a ? 270 : 0
|
|
}
|
|
aq.prototype.zp = function() {
|
|
this.fg.length = 0
|
|
};
|
|
|
|
function bq(a, b) {
|
|
var c = a.fg;
|
|
if (0 === c.length) {
|
|
a: if (!a.Np) {
|
|
c = a.Np;
|
|
a.Np = !0;
|
|
var d, e = null,
|
|
g = a.Pc,
|
|
g = g instanceof F ? g : null;
|
|
if (null === g || g.re) d = a.Pc.qE(a.port.yd);
|
|
else {
|
|
if (!g.W.F()) {
|
|
a.Np = c;
|
|
break a
|
|
}
|
|
e = g;
|
|
d = e.pE()
|
|
}
|
|
var h = a.fg.length = 0,
|
|
k = a.port.fb(Zb, z.O()),
|
|
l = a.port.fb(ic, z.O()),
|
|
g = z.yk(k.x, k.y, 0, 0);
|
|
g.vj(l);
|
|
z.A(k);
|
|
z.A(l);
|
|
k = z.Tb(g.x + g.width / 2, g.y + g.height / 2);
|
|
for (d = d.i; d.next();)
|
|
if (l = d.value, l.isVisible()) {
|
|
var m = Yb,
|
|
n = l.md === a.port || l.Y.li(e),
|
|
m = n ? Xp(l, a.port) : Yp(l, a.port);
|
|
if (m.kj() && (n = n ? l.Qd : l.md, null !== n)) {
|
|
var p =
|
|
n.ca;
|
|
if (null !== p) {
|
|
var n = l.computeOtherPoint(p, n),
|
|
p = k.Ec(n),
|
|
m = rq(g, m, p, l.rc),
|
|
q = 0;
|
|
0 === m ? (q = z.fd, 180 < p && (p -= 360)) : q = 90 === m ? z.ed : 180 === m ? z.Tc : z.pd;
|
|
m = a.fg[h];
|
|
void 0 === m ? (m = new sq(l, p, q), a.fg[h] = m) : (m.link = l, m.angle = p, m.se = q);
|
|
m.wx.set(n);
|
|
h++
|
|
}
|
|
}
|
|
}
|
|
z.A(k);
|
|
a.fg.sort(aq.prototype.LI);
|
|
e = a.fg.length;
|
|
k = -1;
|
|
for (h = d = 0; h < e; h++) m = a.fg[h], void 0 !== m && (m.se !== k && (k = m.se, d = 0), m.wp = d, d++);
|
|
k = -1;
|
|
d = 0;
|
|
for (h = e - 1; 0 <= h; h--) m = a.fg[h], void 0 !== m && (m.se !== k && (k = m.se, d = m.wp + 1), m.an = d);
|
|
h = a.fg;
|
|
n = a.port;
|
|
e = a.Pc.TI;
|
|
k = z.O();
|
|
d = z.O();
|
|
l = z.O();
|
|
m = z.O();
|
|
n.fb(Zb, k);
|
|
n.fb(cc, d);
|
|
n.fb(ic, l);
|
|
n.fb(gc, m);
|
|
var r = q = p = n = 0;
|
|
if (e === yp)
|
|
for (var s = 0; s < h.length; s++) {
|
|
var t = h[s];
|
|
if (null !== t) {
|
|
var v = t.link.computeThickness();
|
|
switch (t.se) {
|
|
case z.ed:
|
|
q += v;
|
|
break;
|
|
case z.Tc:
|
|
r += v;
|
|
break;
|
|
case z.pd:
|
|
n += v;
|
|
break;
|
|
default:
|
|
case z.fd:
|
|
p += v
|
|
}
|
|
}
|
|
}
|
|
for (var x = 0, y = 0, A = 1, s = 0; s < h.length; s++)
|
|
if (t = h[s], null !== t) {
|
|
var B, L;
|
|
if (x !== t.se) {
|
|
x = t.se;
|
|
switch (x) {
|
|
case z.ed:
|
|
B = l;
|
|
L = m;
|
|
break;
|
|
case z.Tc:
|
|
B = m;
|
|
L = k;
|
|
break;
|
|
case z.pd:
|
|
B = k;
|
|
L = d;
|
|
break;
|
|
default:
|
|
case z.fd:
|
|
B = d, L = l
|
|
}
|
|
var H = L.x - B.x;
|
|
L = L.y - B.y;
|
|
switch (x) {
|
|
case z.ed:
|
|
q >
|
|
Math.abs(H) ? (A = Math.abs(H) / q, q = Math.abs(H)) : A = 1;
|
|
break;
|
|
case z.Tc:
|
|
r > Math.abs(L) ? (A = Math.abs(L) / r, r = Math.abs(L)) : A = 1;
|
|
break;
|
|
case z.pd:
|
|
n > Math.abs(H) ? (A = Math.abs(H) / n, n = Math.abs(H)) : A = 1;
|
|
break;
|
|
default:
|
|
case z.fd:
|
|
p > Math.abs(L) ? (A = Math.abs(L) / p, p = Math.abs(L)) : A = 1
|
|
}
|
|
y = 0
|
|
}
|
|
var U = t.Fp;
|
|
if (e === yp) {
|
|
v = t.link.computeThickness();
|
|
v *= A;
|
|
U.set(B);
|
|
switch (x) {
|
|
case z.ed:
|
|
U.x = B.x + H / 2 + q / 2 - y - v / 2;
|
|
break;
|
|
case z.Tc:
|
|
U.y = B.y + L / 2 + r / 2 - y - v / 2;
|
|
break;
|
|
case z.pd:
|
|
U.x = B.x + H / 2 - n / 2 + y + v / 2;
|
|
break;
|
|
default:
|
|
case z.fd:
|
|
U.y = B.y + L / 2 - p / 2 + y + v / 2
|
|
}
|
|
y += v
|
|
} else v = .5,
|
|
e === vp && (v = (t.wp + 1) / (t.an + 1)), U.x = B.x + H * v, U.y = B.y + L * v
|
|
}
|
|
z.A(k);
|
|
z.A(d);
|
|
z.A(l);
|
|
z.A(m);
|
|
B = a.fg;
|
|
for (H = 0; H < B.length; H++) L = B[H], null !== L && (L.Uw = a.computeEndSegmentLength(L));
|
|
a.Np = c;
|
|
z.dc(g)
|
|
}c = a.fg
|
|
}
|
|
for (g = 0; g < c.length; g++)
|
|
if (B = c[g], null !== B && B.link === b) return B;
|
|
return null
|
|
}
|
|
aq.prototype.LI = function(a, b) {
|
|
return a === b ? 0 : null === a ? -1 : null === b ? 1 : a.se < b.se ? -1 : a.se > b.se ? 1 : a.angle < b.angle ? -1 : a.angle > b.angle ? 1 : 0
|
|
};
|
|
aq.prototype.computeEndSegmentLength = function(a) {
|
|
var b = a.link,
|
|
c = b.computeEndSegmentLength(this.Pc, this.port, Yb, b.md === this.port),
|
|
d = a.wp;
|
|
if (0 > d) return c;
|
|
var e = a.an;
|
|
if (1 >= e || !b.rc) return c;
|
|
var b = a.wx,
|
|
g = a.Fp;
|
|
if (a.se === z.Tc || a.se === z.ed) d = e - 1 - d;
|
|
return ((a = a.se === z.Tc || a.se === z.fd) ? b.y < g.y : b.x < g.x) ? c + 8 * d : (a ? b.y === g.y : b.x === g.x) ? c : c + 8 * (e - 1 - d)
|
|
};
|
|
|
|
function sq(a, b, c) {
|
|
this.link = a;
|
|
this.angle = b;
|
|
this.se = c;
|
|
this.wx = new N;
|
|
this.an = this.wp = 0;
|
|
this.Fp = new N;
|
|
this.Uw = 0
|
|
}
|
|
z.Yd(sq, {
|
|
link: !0,
|
|
angle: !0,
|
|
se: !0,
|
|
wx: !0,
|
|
wp: !0,
|
|
an: !0,
|
|
Fp: !0,
|
|
Uw: !0
|
|
});
|
|
sq.prototype.toString = function() {
|
|
return this.link.toString() + " " + this.angle.toString() + " " + this.se.toString() + ":" + this.wp.toString() + "/" + this.an.toString() + " " + this.Fp.toString() + " " + this.Uw.toString() + " " + this.wx.toString()
|
|
};
|
|
|
|
function Fm() {
|
|
this.gk = this.Gj = Pc;
|
|
this.ek = this.Ej = NaN;
|
|
this.dk = this.Dj = wp;
|
|
this.fk = this.Fj = NaN
|
|
}
|
|
Fm.prototype.copy = function() {
|
|
var a = new Fm;
|
|
a.Gj = this.Gj.V();
|
|
a.gk = this.gk.V();
|
|
a.Ej = this.Ej;
|
|
a.ek = this.ek;
|
|
a.Dj = this.Dj;
|
|
a.dk = this.dk;
|
|
a.Fj = this.Fj;
|
|
a.fk = this.fk;
|
|
return a
|
|
};
|
|
|
|
function F(a) {
|
|
0 === arguments.length ? E.call(this, ej) : E.call(this, a);
|
|
this.Jr = new K(D);
|
|
this.wm = new K(F);
|
|
this.hl = this.Kr = this.Ir = null;
|
|
this.$s = !1;
|
|
this.pr = !0;
|
|
this.at = !1;
|
|
this.Lb = this.Qs = null;
|
|
this.xq = !1;
|
|
this.yq = !0;
|
|
this.er = this.zq = !1;
|
|
this.he = new vg;
|
|
this.he.group = this;
|
|
this.dz = !1
|
|
}
|
|
z.Qa(F, E);
|
|
z.ia("Group", F);
|
|
F.prototype.cloneProtected = function(a) {
|
|
E.prototype.cloneProtected.call(this, a);
|
|
a.Ir = this.Ir;
|
|
a.Kr = this.Kr;
|
|
a.hl = this.hl;
|
|
a.$s = this.$s;
|
|
a.pr = this.pr;
|
|
a.at = this.at;
|
|
a.Qs = this.Qs;
|
|
var b = a.yt(function(a) {
|
|
return a instanceof Zi
|
|
});
|
|
a.Lb = b instanceof Zi ? b : null;
|
|
a.xq = this.xq;
|
|
a.yq = this.yq;
|
|
a.zq = this.zq;
|
|
a.er = this.er;
|
|
null !== this.he ? (a.he = this.he.copy(), a.he.group = a) : (null !== a.he && (a.he.group = null), a.he = null)
|
|
};
|
|
F.prototype.ji = function(a) {
|
|
E.prototype.ji.call(this, a);
|
|
var b = a.np();
|
|
for (a = a.Hc; a.next();) {
|
|
var c = a.value;
|
|
c.S();
|
|
c.I(8);
|
|
c.pt();
|
|
if (c instanceof E) c.mf(b);
|
|
else if (c instanceof G)
|
|
for (c = c.Hf; c.next();) c.value.mf(b)
|
|
}
|
|
};
|
|
F.prototype.tn = function(a, b, c, d, e, g, h) {
|
|
if (a === Uf && "elements" === b)
|
|
if (e instanceof Zi) {
|
|
var k = e;
|
|
null === this.Lb ? this.Lb = k : this.Lb !== k && z.k("Cannot insert a second Placeholder into the visual tree of a Group.")
|
|
} else e instanceof I && (k = e.yt(function(a) {
|
|
return a instanceof Zi
|
|
}), k instanceof Zi && (null === this.Lb ? this.Lb = k : this.Lb !== k && z.k("Cannot insert a second Placeholder into the visual tree of a Group.")));
|
|
else a === Vf && "elements" === b && null !== this.Lb && (d === this.Lb ? this.Lb = null : d instanceof I && this.Lb.Pl(d) &&
|
|
(this.Lb = null));
|
|
E.prototype.tn.call(this, a, b, c, d, e, g, h)
|
|
};
|
|
F.prototype.$i = function(a, b, c, d) {
|
|
this.gl = this.Lb;
|
|
I.prototype.$i.call(this, a, b, c, d)
|
|
};
|
|
F.prototype.Ql = function() {
|
|
if (!E.prototype.Ql.call(this)) return !1;
|
|
for (var a = this.Hc; a.next();) {
|
|
var b = a.value;
|
|
if (b instanceof E) {
|
|
if (b.isVisible() && nl(b)) return !1
|
|
} else if (b instanceof G && b.isVisible() && nl(b) && b.Y !== this && b.da !== this) return !1
|
|
}
|
|
return !0
|
|
};
|
|
z.w(F, {
|
|
placeholder: "placeholder"
|
|
}, function() {
|
|
return this.Lb
|
|
});
|
|
z.defineProperty(F, {
|
|
VD: "computesBoundsAfterDrag"
|
|
}, function() {
|
|
return this.xq
|
|
}, function(a) {
|
|
var b = this.xq;
|
|
b !== a && (z.g(a, "boolean", F, "computesBoundsAfterDrag"), this.xq = a, this.j("computesBoundsAfterDrag", b, a))
|
|
});
|
|
z.defineProperty(F, {
|
|
Ow: "computesBoundsIncludingLinks"
|
|
}, function() {
|
|
return this.yq
|
|
}, function(a) {
|
|
z.g(a, "boolean", F, "computesBoundsIncludingLinks");
|
|
var b = this.yq;
|
|
b !== a && (this.yq = a, this.j("computesBoundsIncludingLinks", b, a))
|
|
});
|
|
z.defineProperty(F, {
|
|
gH: "computesBoundsIncludingLocation"
|
|
}, function() {
|
|
return this.zq
|
|
}, function(a) {
|
|
z.g(a, "boolean", F, "computesBoundsIncludingLocation");
|
|
var b = this.zq;
|
|
b !== a && (this.zq = a, this.j("computesBoundsIncludingLocation", b, a))
|
|
});
|
|
z.defineProperty(F, {
|
|
UH: "handlesDragDropForMembers"
|
|
}, function() {
|
|
return this.er
|
|
}, function(a) {
|
|
z.g(a, "boolean", F, "handlesDragDropForMembers");
|
|
var b = this.er;
|
|
b !== a && (this.er = a, this.j("handlesDragDropForMembers", b, a))
|
|
});
|
|
z.w(F, {
|
|
Hc: "memberParts"
|
|
}, function() {
|
|
return this.Jr.i
|
|
});
|
|
|
|
function rp(a, b) {
|
|
if (a.Jr.add(b)) {
|
|
b instanceof F && a.wm.add(b);
|
|
var c = a.DI;
|
|
if (null !== c) {
|
|
var d = !0,
|
|
e = a.h;
|
|
null !== e && (d = e.$a, e.$a = !0);
|
|
c(a, b);
|
|
null !== e && (e.$a = d)
|
|
}
|
|
a.isVisible() && a.re || b.wd(!1)
|
|
}
|
|
b instanceof G && !a.Ow || (c = a.Lb, null === c && (c = a), c.S())
|
|
}
|
|
|
|
function qp(a, b) {
|
|
if (a.Jr.remove(b)) {
|
|
b instanceof F && a.wm.remove(b);
|
|
var c = a.EI;
|
|
if (null !== c) {
|
|
var d = !0,
|
|
e = a.h;
|
|
null !== e && (d = e.$a, e.$a = !0);
|
|
c(a, b);
|
|
null !== e && (e.$a = d)
|
|
}
|
|
a.isVisible() && a.re || b.wd(!0)
|
|
}
|
|
b instanceof G && !a.Ow || (c = a.Lb, null === c && (c = a), c.S())
|
|
}
|
|
F.prototype.cn = function() {
|
|
if (0 < this.Jr.count) {
|
|
var a = this.h;
|
|
if (null !== a)
|
|
for (var b = this.Jr.copy().i; b.next();) a.remove(b.value)
|
|
}
|
|
E.prototype.cn.call(this)
|
|
};
|
|
z.defineProperty(F, {
|
|
Sb: "layout"
|
|
}, function() {
|
|
return this.he
|
|
}, function(a) {
|
|
var b = this.he;
|
|
b !== a && (null !== a && z.l(a, vg, F, "layout"), null !== b && (b.h = null, b.group = null), this.he = a, null !== a && (a.h = this.h, a.group = this), this.j("layout", b, a))
|
|
});
|
|
z.defineProperty(F, {
|
|
DI: "memberAdded"
|
|
}, function() {
|
|
return this.Ir
|
|
}, function(a) {
|
|
var b = this.Ir;
|
|
b !== a && (null !== a && z.g(a, "function", F, "memberAdded"), this.Ir = a, this.j("memberAdded", b, a))
|
|
});
|
|
z.defineProperty(F, {
|
|
EI: "memberRemoved"
|
|
}, function() {
|
|
return this.Kr
|
|
}, function(a) {
|
|
var b = this.Kr;
|
|
b !== a && (null !== a && z.g(a, "function", F, "memberRemoved"), this.Kr = a, this.j("memberRemoved", b, a))
|
|
});
|
|
z.defineProperty(F, {
|
|
qA: "memberValidation"
|
|
}, function() {
|
|
return this.hl
|
|
}, function(a) {
|
|
var b = this.hl;
|
|
b !== a && (null !== a && z.g(a, "function", F, "memberValidation"), this.hl = a, this.j("memberValidation", b, a))
|
|
});
|
|
F.prototype.canAddMembers = function(a) {
|
|
var b = this.h;
|
|
if (null === b) return !1;
|
|
b = b.wb;
|
|
for (a = kh(a).i; a.next();)
|
|
if (!b.isValidMember(this, a.value)) return !1;
|
|
return !0
|
|
};
|
|
F.prototype.addMembers = function(a, b) {
|
|
var c = this.h;
|
|
if (null === c) return !1;
|
|
for (var c = c.wb, d = !0, e = kh(a).i; e.next();) {
|
|
var g = e.value;
|
|
!b || c.isValidMember(this, g) ? g.Va = this : d = !1
|
|
}
|
|
return d
|
|
};
|
|
z.defineProperty(F, {
|
|
AJ: "ungroupable"
|
|
}, function() {
|
|
return this.$s
|
|
}, function(a) {
|
|
var b = this.$s;
|
|
b !== a && (z.g(a, "boolean", F, "ungroupable"), this.$s = a, this.j("ungroupable", b, a))
|
|
});
|
|
F.prototype.canUngroup = function() {
|
|
if (!this.AJ) return !1;
|
|
var a = this.layer;
|
|
if (null !== a && !a.Iw) return !1;
|
|
a = a.h;
|
|
return null === a || a.Iw ? !0 : !1
|
|
};
|
|
F.prototype.mf = function(a) {
|
|
void 0 === a && (a = null);
|
|
E.prototype.mf.call(this, a);
|
|
for (var b = this.pE(); b.next();) {
|
|
var c = b.value;
|
|
if (null === a || !a.contains(c)) {
|
|
var d = c.Y;
|
|
null !== d && d !== this && d.li(this) && !d.isVisible() ? c.qc() : (d = c.da, null !== d && d !== this && d.li(this) && !d.isVisible() && c.qc())
|
|
}
|
|
}
|
|
};
|
|
F.prototype.findExternalLinksConnected = F.prototype.pE = function() {
|
|
var a = this.np();
|
|
a.add(this);
|
|
for (var b = new K(G), c = a.i; c.next();) {
|
|
var d = c.value;
|
|
if (d instanceof E)
|
|
for (d = d.ee; d.next();) {
|
|
var e = d.value;
|
|
a.contains(e) || b.add(e)
|
|
}
|
|
}
|
|
return b.i
|
|
};
|
|
F.prototype.findExternalNodesConnected = function() {
|
|
var a = this.np();
|
|
a.add(this);
|
|
for (var b = new K(E), c = a.i; c.next();) {
|
|
var d = c.value;
|
|
if (d instanceof E)
|
|
for (d = d.ee; d.next();) {
|
|
var e = d.value,
|
|
g = e.Y;
|
|
a.contains(g) && g !== this || b.add(g);
|
|
e = e.da;
|
|
a.contains(e) && e !== this || b.add(e)
|
|
}
|
|
}
|
|
return b.i
|
|
};
|
|
F.prototype.findContainingGroupChain = function() {
|
|
function a(b, d) {
|
|
null !== b && (d.add(b), a(b.Va, d))
|
|
}
|
|
var b = new K(D);
|
|
a(this, b);
|
|
return b
|
|
};
|
|
F.prototype.findSubGraphParts = F.prototype.np = function() {
|
|
var a = new K(D);
|
|
eh(a, this, !0, 0, !0);
|
|
a.remove(this);
|
|
return a
|
|
};
|
|
F.prototype.wd = function(a) {
|
|
E.prototype.wd.call(this, a);
|
|
for (var b = this.Hc; b.next();) b.value.wd(a)
|
|
};
|
|
F.prototype.collapseSubGraph = F.prototype.collapseSubGraph = function() {
|
|
var a = this.h;
|
|
if (null !== a && !a.vh) {
|
|
a.vh = !0;
|
|
var b = this.np();
|
|
tq(this, b, a.Ua, this);
|
|
a.vh = !1
|
|
}
|
|
};
|
|
|
|
function tq(a, b, c, d) {
|
|
for (var e = a.Hc; e.next();) {
|
|
var g = e.value;
|
|
g.wd(!1);
|
|
if (g instanceof F) {
|
|
var h = g;
|
|
h.re && (h.fB = h.re, tq(h, b, c, d))
|
|
}
|
|
if (g instanceof E) g.mf(b), ek(c, g, d);
|
|
else if (g instanceof G)
|
|
for (g = g.Hf; g.next();) g.value.mf(b)
|
|
}
|
|
a.re = !1
|
|
}
|
|
F.prototype.expandSubGraph = F.prototype.expandSubGraph = function() {
|
|
var a = this.h;
|
|
if (null !== a && !a.vh) {
|
|
a.vh = !0;
|
|
var b = this.np();
|
|
uq(this, b, a.Ua, this);
|
|
a.vh = !1
|
|
}
|
|
};
|
|
|
|
function uq(a, b, c, d) {
|
|
for (var e = a.Hc; e.next();) {
|
|
var g = e.value;
|
|
g.wd(!0);
|
|
if (g instanceof F) {
|
|
var h = g;
|
|
h.fB && (h.fB = !1, uq(h, b, c, d))
|
|
}
|
|
if (g instanceof E) g.mf(b), dk(c, g, d);
|
|
else if (g instanceof G)
|
|
for (g = g.Hf; g.next();) g.value.mf(b)
|
|
}
|
|
a.re = !0
|
|
}
|
|
z.defineProperty(F, {
|
|
re: "isSubGraphExpanded"
|
|
}, function() {
|
|
return this.pr
|
|
}, function(a) {
|
|
var b = this.pr;
|
|
if (b !== a) {
|
|
z.g(a, "boolean", F, "isSubGraphExpanded");
|
|
this.pr = a;
|
|
var c = this.h;
|
|
this.j("isSubGraphExpanded", b, a);
|
|
b = this.qJ;
|
|
if (null !== b) {
|
|
var d = !0;
|
|
null !== c && (d = c.$a, c.$a = !0);
|
|
b(this);
|
|
null !== c && (c.$a = d)
|
|
}
|
|
null !== c && c.pa.qb ? null !== this.Lb && this.Lb.S() : a ? this.expandSubGraph() : this.collapseSubGraph()
|
|
}
|
|
});
|
|
z.defineProperty(F, {
|
|
fB: "wasSubGraphExpanded"
|
|
}, function() {
|
|
return this.at
|
|
}, function(a) {
|
|
var b = this.at;
|
|
b !== a && (z.g(a, "boolean", F, "wasSubGraphExpanded"), this.at = a, this.j("wasSubGraphExpanded", b, a))
|
|
});
|
|
z.defineProperty(F, {
|
|
qJ: "subGraphExpandedChanged"
|
|
}, function() {
|
|
return this.Qs
|
|
}, function(a) {
|
|
var b = this.Qs;
|
|
b !== a && (null !== a && z.g(a, "function", F, "subGraphExpandedChanged"), this.Qs = a, this.j("subGraphExpandedChanged", b, a))
|
|
});
|
|
F.prototype.move = function(a) {
|
|
var b = this.position,
|
|
c = b.x;
|
|
isNaN(c) && (c = 0);
|
|
b = b.y;
|
|
isNaN(b) && (b = 0);
|
|
var c = a.x - c,
|
|
b = a.y - b,
|
|
d = z.Tb(c, b);
|
|
E.prototype.move.call(this, a);
|
|
for (a = this.np().i; a.next();) {
|
|
var e = a.value;
|
|
if (!(e instanceof G || e instanceof E && e.Df)) {
|
|
var g = e.position,
|
|
h = e.location;
|
|
g.F() ? (d.x = g.x + c, d.y = g.y + b, e.position = d) : h.F() && (d.x = h.x + c, d.y = h.y + b, e.location = d)
|
|
}
|
|
}
|
|
for (a.reset(); a.next();) e = a.value, e instanceof G && (g = e.position, d.x = g.x + c, d.y = g.y + b, e.move(d));
|
|
z.A(d)
|
|
};
|
|
|
|
function Zi() {
|
|
O.call(this);
|
|
this.df = Kd;
|
|
this.ws = new w(NaN, NaN, NaN, NaN)
|
|
}
|
|
z.Qa(Zi, O);
|
|
z.ia("Placeholder", Zi);
|
|
Zi.prototype.cloneProtected = function(a) {
|
|
O.prototype.cloneProtected.call(this, a);
|
|
a.df = this.df.V();
|
|
a.ws = this.ws.copy()
|
|
};
|
|
Zi.prototype.lk = function(a) {
|
|
if (null === this.background && null === this.vl) return !1;
|
|
var b = this.Ga;
|
|
return Jb(0, 0, b.width, b.height, a.x, a.y)
|
|
};
|
|
Zi.prototype.Ip = function() {
|
|
var a = this.ca;
|
|
null !== a && (a instanceof F || a instanceof da) || z.k("Placeholder is not inside a Group or Adornment.");
|
|
if (a instanceof F) {
|
|
var b = this.computeBorder(this.ws),
|
|
c = this.Wc;
|
|
yb(c, b.width || 0, b.height || 0);
|
|
Jm(this, 0, 0, c.width, c.height);
|
|
for (var c = a.Hc, d = !1; c.next();)
|
|
if (c.value.isVisible()) {
|
|
d = !0;
|
|
break
|
|
}!d || isNaN(b.x) || isNaN(b.y) || (c = new N, c.ru(b, a.of), a.location = new N(c.x, c.y))
|
|
} else {
|
|
var b = this.Aa,
|
|
c = this.Wc,
|
|
d = this.padding,
|
|
e = d.left + d.right,
|
|
g = d.top + d.bottom;
|
|
if (b.F()) yb(c, b.width +
|
|
e || 0, b.height + g || 0), Jm(this, -d.left, -d.top, c.width, c.height);
|
|
else {
|
|
var h = a.fc,
|
|
k = h.fb(Zb, z.O()),
|
|
b = z.yk(k.x, k.y, 0, 0);
|
|
b.vj(h.fb(ic, k));
|
|
b.vj(h.fb(cc, k));
|
|
b.vj(h.fb(gc, k));
|
|
a.Ki.n(b.x, b.y);
|
|
yb(c, b.width + e || 0, b.height + g || 0);
|
|
Jm(this, -d.left, -d.top, c.width, c.height);
|
|
z.A(k);
|
|
z.dc(b)
|
|
}
|
|
}
|
|
};
|
|
Zi.prototype.$i = function(a, b, c, d) {
|
|
var e = this.W;
|
|
e.x = a;
|
|
e.y = b;
|
|
e.width = c;
|
|
e.height = d
|
|
};
|
|
Zi.prototype.computeBorder = function(a) {
|
|
var b = this.ca;
|
|
if (b instanceof F) {
|
|
var c = b;
|
|
if (c.VD && this.ws.F()) {
|
|
var d = c.h;
|
|
if (null !== d && (d = d.eb, d instanceof ih && !d.Uq && null !== d.hc && !d.hc.contains(c))) return a.assign(this.ws), a
|
|
}
|
|
}
|
|
var c = z.kg(),
|
|
d = this.computeMemberBounds(c),
|
|
e = this.padding;
|
|
a.n(d.x - e.left, d.y - e.top, d.width + e.left + e.right, d.height + e.top + e.bottom);
|
|
z.dc(c);
|
|
b instanceof F && (c = b, c.gH && c.location.F() && a.vj(c.location));
|
|
return a
|
|
};
|
|
Zi.prototype.computeMemberBounds = function(a) {
|
|
if (!(this.ca instanceof F)) return a.n(0, 0, 0, 0), a;
|
|
for (var b = this.ca, c = Infinity, d = Infinity, e = -Infinity, g = -Infinity, h = b.Hc; h.next();) {
|
|
var k = h.value;
|
|
if (k.isVisible()) {
|
|
if (k instanceof G) {
|
|
var l = k;
|
|
if (!b.Ow) continue;
|
|
if (ml(l)) continue;
|
|
if (l.Y === b || l.da === b) continue
|
|
}
|
|
k = k.W;
|
|
k.left < c && (c = k.left);
|
|
k.top < d && (d = k.top);
|
|
k.right > e && (e = k.right);
|
|
k.bottom > g && (g = k.bottom)
|
|
}
|
|
}
|
|
isFinite(c) && isFinite(d) ? a.n(c, d, e - c, g - d) : (b = b.location, c = this.padding, a.n(b.x + c.left, b.y + c.top, 0, 0));
|
|
return a
|
|
};
|
|
z.defineProperty(Zi, {
|
|
padding: "padding"
|
|
}, function() {
|
|
return this.df
|
|
}, function(a) {
|
|
"number" === typeof a ? ((isNaN(a) || 0 > a) && z.ka(a, ">= 0", Zi, "padding"), a = new Db(a)) : (z.l(a, Db, Zi, "padding"), (isNaN(a.left) || 0 > a.left) && z.ka(a.left, ">= 0", Zi, "padding:value.left"), (isNaN(a.right) || 0 > a.right) && z.ka(a.right, ">= 0", Zi, "padding:value.right"), (isNaN(a.top) || 0 > a.top) && z.ka(a.top, ">= 0", Zi, "padding:value.top"), (isNaN(a.bottom) || 0 > a.bottom) && z.ka(a.bottom, ">= 0", Zi, "padding:value.bottom"));
|
|
var b = this.df;
|
|
b.N(a) || (this.df =
|
|
a = a.V(), this.j("padding", b, a))
|
|
});
|
|
|
|
function vg() {
|
|
0 < arguments.length && z.od(vg);
|
|
z.kc(this);
|
|
this.Py = this.Z = null;
|
|
this.Kj = this.lr = !0;
|
|
this.ur = !1;
|
|
this.pq = (new N(0, 0)).freeze();
|
|
this.nr = this.or = !0;
|
|
this.VB = "";
|
|
this.uo = !1;
|
|
this.ez = null
|
|
}
|
|
z.ia("Layout", vg);
|
|
vg.prototype.cloneProtected = function(a) {
|
|
a.lr = this.lr;
|
|
a.Kj = this.Kj;
|
|
a.ur = this.ur;
|
|
a.pq.assign(this.pq);
|
|
a.or = this.or;
|
|
a.nr = this.nr;
|
|
a.VB = this.VB;
|
|
this.Kj || (a.uo = !0)
|
|
};
|
|
vg.prototype.copy = function() {
|
|
var a = new this.constructor;
|
|
this.cloneProtected(a);
|
|
return a
|
|
};
|
|
vg.prototype.toString = function() {
|
|
var a = z.kf(Object.getPrototypeOf(this)),
|
|
a = a + "(";
|
|
null !== this.group && (a += " in " + this.group);
|
|
null !== this.h && (a += " for " + this.h);
|
|
return a + ")"
|
|
};
|
|
z.defineProperty(vg, {
|
|
h: "diagram"
|
|
}, function() {
|
|
return this.Z
|
|
}, function(a) {
|
|
null !== a && z.l(a, C, vg, "diagram");
|
|
this.Z = a
|
|
});
|
|
z.defineProperty(vg, {
|
|
group: "group"
|
|
}, function() {
|
|
return this.Py
|
|
}, function(a) {
|
|
this.Py !== a && (null !== a && z.l(a, F, vg, "group"), this.Py = a, null !== a && (this.Z = a.h))
|
|
});
|
|
z.defineProperty(vg, {
|
|
iI: "isOngoing"
|
|
}, function() {
|
|
return this.lr
|
|
}, function(a) {
|
|
this.lr !== a && (z.g(a, "boolean", vg, "isOngoing"), this.lr = a)
|
|
});
|
|
z.defineProperty(vg, {
|
|
RE: "isInitial"
|
|
}, function() {
|
|
return this.Kj
|
|
}, function(a) {
|
|
z.g(a, "boolean", vg, "isInitial");
|
|
this.Kj = a;
|
|
a || (this.uo = !0)
|
|
});
|
|
z.defineProperty(vg, {
|
|
mx: "isViewportSized"
|
|
}, function() {
|
|
return this.ur
|
|
}, function(a) {
|
|
this.ur !== a && (z.g(a, "boolean", vg, "isViewportSized"), (this.ur = a) && this.I())
|
|
});
|
|
z.defineProperty(vg, {
|
|
Rt: "isRouting"
|
|
}, function() {
|
|
return this.or
|
|
}, function(a) {
|
|
this.or !== a && (z.g(a, "boolean", vg, "isRouting"), this.or = a)
|
|
});
|
|
z.defineProperty(vg, {
|
|
SE: "isRealtime"
|
|
}, function() {
|
|
return this.nr
|
|
}, function(a) {
|
|
this.nr !== a && (z.g(a, "boolean", vg, "isRealtime"), this.nr = a)
|
|
});
|
|
z.defineProperty(vg, {
|
|
Gf: "isValidLayout"
|
|
}, function() {
|
|
return this.uo
|
|
}, function(a) {
|
|
this.uo !== a && (z.g(a, "boolean", vg, "isValidLayout"), this.uo = a, a || (a = this.h, null !== a && (a.Qu = !0)))
|
|
});
|
|
vg.prototype.invalidateLayout = vg.prototype.I = function() {
|
|
if (this.uo) {
|
|
var a = this.h;
|
|
if (null !== a && !a.pa.qb) {
|
|
var b = a.Ua;
|
|
!b.to && (b.nf && b.oi(), this.iI && a.kn || this.RE && !a.kn) && (this.Gf = !1, a.Ce())
|
|
}
|
|
}
|
|
};
|
|
z.defineProperty(vg, {
|
|
network: "network"
|
|
}, function() {
|
|
return this.ez
|
|
}, function(a) {
|
|
var b = this.ez;
|
|
b !== a && (null !== a && z.l(a, wa, vg, "network"), null !== b && (b.Sb = null), this.ez = a, null !== a && (a.Sb = this))
|
|
});
|
|
vg.prototype.createNetwork = function() {
|
|
return new wa
|
|
};
|
|
vg.prototype.makeNetwork = function(a) {
|
|
var b = this.createNetwork();
|
|
b.Sb = this;
|
|
a instanceof C ? (b.ik(a.Lg, !0), b.ik(a.links, !0)) : a instanceof F ? b.ik(a.Hc) : b.ik(a.i);
|
|
return b
|
|
};
|
|
vg.prototype.updateParts = function() {
|
|
var a = this.h;
|
|
if (null === a && null !== this.network)
|
|
for (var b = this.network.vertexes.i; b.next();) {
|
|
var c = b.value.Pc;
|
|
if (null !== c && (a = c.h, null !== a)) break
|
|
}
|
|
this.Gf = !0;
|
|
try {
|
|
null !== a && a.Wb("Layout"), this.commitLayout()
|
|
} finally {
|
|
null !== a && a.Jd("Layout")
|
|
}
|
|
};
|
|
vg.prototype.commitLayout = function() {
|
|
for (var a = this.network.vertexes.i; a.next();) a.value.commit();
|
|
if (this.Rt)
|
|
for (a = this.network.edges.i; a.next();) a.value.commit()
|
|
};
|
|
vg.prototype.doLayout = function(a) {
|
|
null === a && z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
|
|
var b = new K(D);
|
|
a instanceof C ? (vq(this, b, a.Lg, !0, this.wA, !0, !1, !0), vq(this, b, a.ni, !0, this.wA, !0, !1, !0)) : a instanceof F ? vq(this, b, a.Hc, !1, this.wA, !0, !1, !0) : b.$c(a.i);
|
|
var c = b.count;
|
|
if (0 < c) {
|
|
a = this.h;
|
|
null !== a && a.Wb("Layout");
|
|
for (var c = Math.ceil(Math.sqrt(c)), d = this.je.x, e = d, g = this.je.y, h = 0, k = 0, b = b.i; b.next();) {
|
|
var l = b.value;
|
|
l.Bf();
|
|
var m = l.Ia,
|
|
n = m.width,
|
|
m = m.height;
|
|
l.moveTo(e, g);
|
|
l.dz = !1;
|
|
e += Math.max(n, 50) + 20;
|
|
k = Math.max(k, Math.max(m, 50));
|
|
h >= c - 1 ? (h = 0, e = d, g += k + 20, k = 0) : h++
|
|
}
|
|
null !== a && a.Jd("Layout")
|
|
}
|
|
this.Gf = !0
|
|
};
|
|
vg.prototype.wA = function(a) {
|
|
return !a.location.F() || a instanceof F && a.dz ? !0 : !1
|
|
};
|
|
|
|
function vq(a, b, c, d, e, g, h, k) {
|
|
for (c = c.i; c.next();) {
|
|
var l = c.value;
|
|
d && !l.Bp || null !== e && !e(l) || !l.canLayout() || (g && l instanceof E ? l.Df || (l instanceof F ? null === l.Sb ? vq(a, b, l.Hc, !1, e, g, h, k) : b.add(l) : b.add(l)) : h && l instanceof G ? b.add(l) : !k || !l.be() || l instanceof E || b.add(l))
|
|
}
|
|
}
|
|
vg.prototype.collectParts = vg.prototype.aH = function(a) {
|
|
var b = new K(D);
|
|
a instanceof C ? (vq(this, b, a.Lg, !0, null, !0, !0, !0), vq(this, b, a.links, !0, null, !0, !0, !0), vq(this, b, a.ni, !0, null, !0, !0, !0)) : a instanceof F ? vq(this, b, a.Hc, !1, null, !0, !0, !0) : vq(this, b, a.i, !1, null, !0, !0, !0);
|
|
return b
|
|
};
|
|
z.defineProperty(vg, {
|
|
je: "arrangementOrigin"
|
|
}, function() {
|
|
return this.pq
|
|
}, function(a) {
|
|
z.l(a, N, vg, "arrangementOrigin");
|
|
this.pq.N(a) || (this.pq.assign(a), this.I())
|
|
});
|
|
vg.prototype.initialOrigin = function(a) {
|
|
var b = this.group;
|
|
if (null !== b) {
|
|
var c = b.position.copy();
|
|
(isNaN(c.x) || isNaN(c.y)) && c.set(a);
|
|
b = b.placeholder;
|
|
null !== b && (c = b.fb(Zb), (isNaN(c.x) || isNaN(c.y)) && c.set(a), c.x += b.padding.left, c.y += b.padding.top);
|
|
return c
|
|
}
|
|
return a
|
|
};
|
|
|
|
function wa() {
|
|
z.kc(this);
|
|
this.he = null;
|
|
this.clear()
|
|
}
|
|
z.ia("LayoutNetwork", wa);
|
|
wa.prototype.clear = function() {
|
|
if (this.vertexes)
|
|
for (var a = this.vertexes.i; a.next();) {
|
|
var b = a.value;
|
|
b.clear();
|
|
b.network = null
|
|
}
|
|
if (this.edges)
|
|
for (a = this.edges.i; a.next();) b = a.value, b.clear(), b.network = null;
|
|
this.vertexes = new K(xa);
|
|
this.edges = new K(ya);
|
|
this.AA = new na(E, xa);
|
|
this.mA = new na(G, ya)
|
|
};
|
|
wa.prototype.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
var b = "LayoutNetwork" + (null !== this.Sb ? "(" + this.Sb.toString() + ")" : "");
|
|
if (0 >= a) return b;
|
|
b += " vertexes: " + this.vertexes.count + " edges: " + this.edges.count;
|
|
if (1 < a) {
|
|
for (var c = this.vertexes.i; c.next();) b += "\n " + c.value.toString(a - 1);
|
|
for (c = this.edges.i; c.next();) b += "\n " + c.value.toString(a - 1)
|
|
}
|
|
return b
|
|
};
|
|
z.defineProperty(wa, {
|
|
Sb: "layout"
|
|
}, function() {
|
|
return this.he
|
|
}, function(a) {
|
|
u && null !== a && z.l(a, vg, wa, "layout");
|
|
this.he = a
|
|
});
|
|
wa.prototype.createVertex = function() {
|
|
return new xa
|
|
};
|
|
wa.prototype.createEdge = function() {
|
|
return new ya
|
|
};
|
|
wa.prototype.addParts = wa.prototype.ik = function(a, b, c) {
|
|
if (null !== a) {
|
|
void 0 === b && (b = !1);
|
|
z.g(b, "boolean", wa, "addParts:toplevelonly");
|
|
void 0 === c && (c = null);
|
|
null === c && (c = function(a) {
|
|
if (a instanceof E) return !a.Df;
|
|
if (a instanceof G) {
|
|
var b = a.Y;
|
|
if (null === b || b.Df) return !1;
|
|
a = a.da;
|
|
return null === a || a.Df ? !1 : !0
|
|
}
|
|
return !1
|
|
});
|
|
for (a = a.i; a.next();) {
|
|
var d = a.value;
|
|
if (d instanceof E && (!b || d.Bp) && d.canLayout() && c(d))
|
|
if (d instanceof F && null === d.Sb) this.ik(d.Hc, !1);
|
|
else if (null === this.en(d)) {
|
|
var e = this.createVertex();
|
|
e.Pc = d;
|
|
this.tl(e)
|
|
}
|
|
}
|
|
for (a.reset(); a.next();)
|
|
if (d = a.value, d instanceof G && (!b || d.Bp) && d.canLayout() && c(d) && null === this.Ww(d)) {
|
|
var g = d.Y,
|
|
e = d.da;
|
|
null !== g && null !== e && g !== e && (g = this.findGroupVertex(g), e = this.findGroupVertex(e), null !== g && null !== e && this.Hp(g, e, d))
|
|
}
|
|
}
|
|
};
|
|
wa.prototype.findGroupVertex = function(a) {
|
|
if (null === a) return null;
|
|
var b = a.findVisibleNode();
|
|
if (null === b) return null;
|
|
a = this.en(b);
|
|
if (null !== a) return a;
|
|
for (b = b.Va; null !== b;) {
|
|
a = this.en(b);
|
|
if (null !== a) return a;
|
|
b = b.Va
|
|
}
|
|
return null
|
|
};
|
|
wa.prototype.addVertex = wa.prototype.tl = function(a) {
|
|
if (null !== a) {
|
|
u && z.l(a, xa, wa, "addVertex:vertex");
|
|
this.vertexes.add(a);
|
|
var b = a.Pc;
|
|
null !== b && this.AA.add(b, a);
|
|
a.network = this
|
|
}
|
|
};
|
|
wa.prototype.addNode = wa.prototype.ht = function(a) {
|
|
if (null === a) return null;
|
|
u && z.l(a, E, wa, "addNode:node");
|
|
var b = this.en(a);
|
|
null === b && (b = this.createVertex(), b.Pc = a, this.tl(b));
|
|
return b
|
|
};
|
|
wa.prototype.deleteVertex = wa.prototype.gE = function(a) {
|
|
if (null !== a && (u && z.l(a, xa, wa, "deleteVertex:vertex"), wq(this, a))) {
|
|
for (var b = a.Ze, c = b.count - 1; 0 <= c; c--) {
|
|
var d = b.ea(c);
|
|
this.ip(d)
|
|
}
|
|
b = a.Te;
|
|
for (c = b.count - 1; 0 <= c; c--) d = b.ea(c), this.ip(d)
|
|
}
|
|
};
|
|
|
|
function wq(a, b) {
|
|
if (null === b) return !1;
|
|
var c = a.vertexes.remove(b);
|
|
c && (a.AA.remove(b.Pc), b.network = null);
|
|
return c
|
|
}
|
|
wa.prototype.deleteNode = function(a) {
|
|
null !== a && (u && z.l(a, E, wa, "deleteNode:node"), a = this.en(a), null !== a && this.gE(a))
|
|
};
|
|
wa.prototype.findVertex = wa.prototype.en = function(a) {
|
|
if (null === a) return null;
|
|
u && z.l(a, E, wa, "findVertex:node");
|
|
return this.AA.na(a)
|
|
};
|
|
wa.prototype.addEdge = wa.prototype.$o = function(a) {
|
|
if (null !== a) {
|
|
u && z.l(a, ya, wa, "addEdge:edge");
|
|
this.edges.add(a);
|
|
var b = a.link;
|
|
null !== b && null === this.Ww(b) && this.mA.add(b, a);
|
|
b = a.toVertex;
|
|
null !== b && b.ED(a);
|
|
b = a.fromVertex;
|
|
null !== b && b.DD(a);
|
|
a.network = this
|
|
}
|
|
};
|
|
wa.prototype.addLink = function(a) {
|
|
if (null === a) return null;
|
|
u && z.l(a, G, wa, "addLink:link");
|
|
var b = a.Y,
|
|
c = a.da,
|
|
d = this.Ww(a);
|
|
null === d ? (d = this.createEdge(), d.link = a, null !== b && (d.fromVertex = this.ht(b)), null !== c && (d.toVertex = this.ht(c)), this.$o(d)) : (d.fromVertex = null !== b ? this.ht(b) : null, d.toVertex = null !== c ? this.ht(c) : null);
|
|
return d
|
|
};
|
|
wa.prototype.deleteEdge = wa.prototype.ip = function(a) {
|
|
if (null !== a) {
|
|
u && z.l(a, ya, wa, "deleteEdge:edge");
|
|
var b = a.toVertex;
|
|
null !== b && b.fE(a);
|
|
b = a.fromVertex;
|
|
null !== b && b.eE(a);
|
|
xq(this, a)
|
|
}
|
|
};
|
|
|
|
function xq(a, b) {
|
|
null !== b && a.edges.remove(b) && (a.mA.remove(b.link), b.network = null)
|
|
}
|
|
wa.prototype.deleteLink = function(a) {
|
|
null !== a && (u && z.l(a, G, wa, "deleteLink:link"), a = this.Ww(a), null !== a && this.ip(a))
|
|
};
|
|
wa.prototype.findEdge = wa.prototype.Ww = function(a) {
|
|
if (null === a) return null;
|
|
u && z.l(a, G, wa, "findEdge:link");
|
|
return this.mA.na(a)
|
|
};
|
|
wa.prototype.linkVertexes = wa.prototype.Hp = function(a, b, c) {
|
|
if (null === a || null === b) return null;
|
|
u && (z.l(a, xa, wa, "linkVertexes:fromVertex"), z.l(b, xa, wa, "linkVertexes:toVertex"), null !== c && z.l(c, G, wa, "linkVertexes:link"));
|
|
if (a.network === this && b.network === this) {
|
|
var d = this.createEdge();
|
|
d.link = c;
|
|
d.fromVertex = a;
|
|
d.toVertex = b;
|
|
this.$o(d);
|
|
return d
|
|
}
|
|
return null
|
|
};
|
|
wa.prototype.reverseEdge = wa.prototype.Fx = function(a) {
|
|
if (null !== a) {
|
|
u && z.l(a, ya, wa, "reverseEdge:edge");
|
|
var b = a.fromVertex,
|
|
c = a.toVertex;
|
|
null !== b && null !== c && (b.eE(a), c.fE(a), a.Fx(), b.ED(a), c.DD(a))
|
|
}
|
|
};
|
|
wa.prototype.deleteSelfEdges = wa.prototype.Sw = function() {
|
|
for (var a = z.rb(), b = this.edges.i; b.next();) {
|
|
var c = b.value;
|
|
c.fromVertex === c.toVertex && a.push(c)
|
|
}
|
|
b = a.length;
|
|
for (c = 0; c < b; c++) this.ip(a[c]);
|
|
z.xa(a)
|
|
};
|
|
wa.prototype.deleteArtificialVertexes = function() {
|
|
for (var a = z.rb(), b = this.vertexes.i; b.next();) {
|
|
var c = b.value;
|
|
null === c.Pc && a.push(c)
|
|
}
|
|
c = a.length;
|
|
for (b = 0; b < c; b++) this.gE(a[b]);
|
|
c = z.rb();
|
|
for (b = this.edges.i; b.next();) {
|
|
var d = b.value;
|
|
null === d.link && c.push(d)
|
|
}
|
|
d = c.length;
|
|
for (b = 0; b < d; b++) this.ip(c[b]);
|
|
z.xa(a);
|
|
z.xa(c)
|
|
};
|
|
|
|
function yq(a) {
|
|
for (var b = z.rb(), c = a.edges.i; c.next();) {
|
|
var d = c.value;
|
|
null !== d.fromVertex && null !== d.toVertex || b.push(d)
|
|
}
|
|
c = b.length;
|
|
for (d = 0; d < c; d++) a.ip(b[d]);
|
|
z.xa(b)
|
|
}
|
|
wa.prototype.splitIntoSubNetworks = wa.prototype.pJ = function() {
|
|
this.deleteArtificialVertexes();
|
|
yq(this);
|
|
this.Sw();
|
|
for (var a = new J(wa), b = !0; b;)
|
|
for (var b = !1, c = this.vertexes.i; c.next();) {
|
|
var d = c.value;
|
|
if (0 < d.Ze.count || 0 < d.Te.count) {
|
|
b = this.Sb.createNetwork();
|
|
a.add(b);
|
|
zq(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 zq(a, b, c) {
|
|
if (null !== c && c.network !== b) {
|
|
wq(a, c);
|
|
b.tl(c);
|
|
for (var d = c.tc; d.next();) {
|
|
var e = d.value;
|
|
e.network !== b && (xq(a, e), b.$o(e), zq(a, b, e.fromVertex))
|
|
}
|
|
for (d = c.pc; d.next();) c = d.value, c.network !== b && (xq(a, c), b.$o(c), zq(a, b, c.toVertex))
|
|
}
|
|
}
|
|
wa.prototype.findAllParts = function() {
|
|
for (var a = new K(D), b = this.vertexes.i; b.next();) a.add(b.value.Pc);
|
|
for (b = this.edges.i; b.next();) a.add(b.value.link);
|
|
return a
|
|
};
|
|
|
|
function xa() {
|
|
z.kc(this);
|
|
this.network = null;
|
|
this.P = (new w(0, 0, 10, 10)).freeze();
|
|
this.R = (new N(5, 5)).freeze();
|
|
this.clear()
|
|
}
|
|
z.ia("LayoutVertex", xa);
|
|
xa.prototype.clear = function() {
|
|
this.Bd = this.fe = null;
|
|
this.Ze = new J(ya);
|
|
this.Te = new J(ya)
|
|
};
|
|
xa.prototype.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
var b = "LayoutVertex#" + z.nd(this);
|
|
if (0 < a && (b += null !== this.Pc ? "(" + this.Pc.toString() + ")" : "", 1 < a)) {
|
|
a = "";
|
|
for (var c = !0, d = this.Ze.i; d.next();) {
|
|
var e = d.value;
|
|
c ? c = !1 : a += ",";
|
|
a += e.toString(0)
|
|
}
|
|
e = "";
|
|
c = !0;
|
|
for (d = this.Te.i; d.next();) {
|
|
var g = d.value;
|
|
c ? c = !1 : e += ",";
|
|
e += g.toString(0)
|
|
}
|
|
b += " sources: " + a + " destinations: " + e
|
|
}
|
|
return b
|
|
};
|
|
z.defineProperty(xa, {
|
|
data: "data"
|
|
}, function() {
|
|
return this.fe
|
|
}, function(a) {
|
|
this.fe = a;
|
|
if (null !== a) {
|
|
var b = a.bounds;
|
|
a = b.x;
|
|
var c = b.y,
|
|
d = b.width,
|
|
b = b.height;
|
|
this.R.n(d / 2, b / 2);
|
|
this.P.n(a, c, d, b)
|
|
}
|
|
});
|
|
z.defineProperty(xa, {
|
|
Pc: "node"
|
|
}, function() {
|
|
return this.Bd
|
|
}, function(a) {
|
|
if (this.Bd !== a) {
|
|
u && null !== a && z.l(a, E, xa, "node");
|
|
this.Bd = a;
|
|
a.Bf();
|
|
var b = a.W,
|
|
c = b.x,
|
|
d = b.y,
|
|
e = b.width,
|
|
b = b.height;
|
|
isNaN(c) && (c = 0);
|
|
isNaN(d) && (d = 0);
|
|
this.P.n(c, d, e, b);
|
|
if (!(a instanceof F) && (a = a.Zb.fb(ec), a.F())) {
|
|
this.R.n(a.x - c, a.y - d);
|
|
return
|
|
}
|
|
this.R.n(e / 2, b / 2)
|
|
}
|
|
});
|
|
z.defineProperty(xa, {
|
|
vb: "bounds"
|
|
}, function() {
|
|
return this.P
|
|
}, function(a) {
|
|
this.P.N(a) || (u && z.l(a, w, xa, "bounds"), this.P.assign(a))
|
|
});
|
|
z.defineProperty(xa, {
|
|
focus: "focus"
|
|
}, function() {
|
|
return this.R
|
|
}, function(a) {
|
|
this.R.N(a) || (u && z.l(a, N, xa, "focus"), this.R.assign(a))
|
|
});
|
|
z.defineProperty(xa, {
|
|
ra: "centerX"
|
|
}, function() {
|
|
return this.P.x + this.R.x
|
|
}, function(a) {
|
|
var b = this.P;
|
|
b.x + this.R.x !== a && (u && z.p(a, xa, "centerX"), b.Wa(), b.x = a - this.R.x, b.freeze())
|
|
});
|
|
z.defineProperty(xa, {
|
|
za: "centerY"
|
|
}, function() {
|
|
return this.P.y + this.R.y
|
|
}, function(a) {
|
|
var b = this.P;
|
|
b.y + this.R.y !== a && (u && z.p(a, xa, "centerY"), b.Wa(), b.y = a - this.R.y, b.freeze())
|
|
});
|
|
z.defineProperty(xa, {
|
|
Ct: "focusX"
|
|
}, function() {
|
|
return this.R.x
|
|
}, function(a) {
|
|
var b = this.R;
|
|
b.x !== a && (b.Wa(), b.x = a, b.freeze())
|
|
});
|
|
z.defineProperty(xa, {
|
|
Dt: "focusY"
|
|
}, function() {
|
|
return this.R.y
|
|
}, function(a) {
|
|
var b = this.R;
|
|
b.y !== a && (b.Wa(), b.y = a, b.freeze())
|
|
});
|
|
z.defineProperty(xa, {
|
|
x: "x"
|
|
}, function() {
|
|
return this.P.x
|
|
}, function(a) {
|
|
var b = this.P;
|
|
b.x !== a && (b.Wa(), b.x = a, b.freeze())
|
|
});
|
|
z.defineProperty(xa, {
|
|
y: "y"
|
|
}, function() {
|
|
return this.P.y
|
|
}, function(a) {
|
|
var b = this.P;
|
|
b.y !== a && (b.Wa(), b.y = a, b.freeze())
|
|
});
|
|
z.defineProperty(xa, {
|
|
width: "width"
|
|
}, function() {
|
|
return this.P.width
|
|
}, function(a) {
|
|
var b = this.P;
|
|
b.width !== a && (b.Wa(), b.width = a, b.freeze())
|
|
});
|
|
z.defineProperty(xa, {
|
|
height: "height"
|
|
}, function() {
|
|
return this.P.height
|
|
}, function(a) {
|
|
var b = this.P;
|
|
b.height !== a && (b.Wa(), b.height = a, b.freeze())
|
|
});
|
|
xa.prototype.commit = function() {
|
|
var a = this.fe;
|
|
if (null !== a) {
|
|
var b = this.vb,
|
|
c = a.bounds;
|
|
z.Za(c) ? (c.x = b.x, c.y = b.y, c.width = b.width, c.height = b.height) : a.bounds = b.copy()
|
|
} else if (a = this.Pc, null !== a) {
|
|
b = this.vb;
|
|
if (!(a instanceof F)) {
|
|
var c = a.W,
|
|
d = a.Zb.fb(ec);
|
|
if (c.F() && d.F()) {
|
|
a.moveTo(b.x + this.Ct - (d.x - c.x), b.y + this.Dt - (d.y - c.y));
|
|
return
|
|
}
|
|
}
|
|
a.moveTo(b.x, b.y)
|
|
}
|
|
};
|
|
xa.prototype.addSourceEdge = xa.prototype.ED = function(a) {
|
|
null !== a && (u && z.l(a, ya, xa, "addSourceEdge:edge"), this.Ze.contains(a) || this.Ze.add(a))
|
|
};
|
|
xa.prototype.deleteSourceEdge = xa.prototype.fE = function(a) {
|
|
null !== a && (u && z.l(a, ya, xa, "deleteSourceEdge:edge"), this.Ze.remove(a))
|
|
};
|
|
xa.prototype.addDestinationEdge = xa.prototype.DD = function(a) {
|
|
null !== a && (u && z.l(a, ya, xa, "addDestinationEdge:edge"), this.Te.contains(a) || this.Te.add(a))
|
|
};
|
|
xa.prototype.deleteDestinationEdge = xa.prototype.eE = function(a) {
|
|
null !== a && (u && z.l(a, ya, xa, "deleteDestinationEdge:edge"), this.Te.remove(a))
|
|
};
|
|
z.w(xa, {
|
|
oJ: "sourceVertexes"
|
|
}, function() {
|
|
for (var a = new K(xa), b = this.tc; b.next();) a.add(b.value.fromVertex);
|
|
return a.i
|
|
});
|
|
z.w(xa, {
|
|
rH: "destinationVertexes"
|
|
}, function() {
|
|
for (var a = new K(xa), b = this.pc; b.next();) a.add(b.value.toVertex);
|
|
return a.i
|
|
});
|
|
z.w(xa, {
|
|
vertexes: "vertexes"
|
|
}, function() {
|
|
for (var a = new K(xa), b = this.tc; b.next();) a.add(b.value.fromVertex);
|
|
for (b = this.pc; b.next();) a.add(b.value.toVertex);
|
|
return a.i
|
|
});
|
|
z.w(xa, {
|
|
tc: "sourceEdges"
|
|
}, function() {
|
|
return this.Ze.i
|
|
});
|
|
z.w(xa, {
|
|
pc: "destinationEdges"
|
|
}, function() {
|
|
return this.Te.i
|
|
});
|
|
z.w(xa, {
|
|
edges: "edges"
|
|
}, function() {
|
|
for (var a = new J(ya), b = this.tc; b.next();) a.add(b.value);
|
|
for (b = this.pc; b.next();) a.add(b.value);
|
|
return a.i
|
|
});
|
|
z.w(xa, {
|
|
CH: "edgesCount"
|
|
}, function() {
|
|
return this.Ze.count + this.Te.count
|
|
});
|
|
var Aq;
|
|
xa.standardComparer = Aq = function(a, b) {
|
|
u && z.l(a, xa, xa, "standardComparer:m");
|
|
u && z.l(b, xa, xa, "standardComparer:n");
|
|
var c = a.Bd,
|
|
d = b.Bd;
|
|
return c ? d ? (c = c.text, d = d.text, c < d ? -1 : c > d ? 1 : 0) : 1 : null !== d ? -1 : 0
|
|
};
|
|
xa.smartComparer = function(a, b) {
|
|
u && z.l(a, xa, xa, "smartComparer:m");
|
|
u && z.l(b, xa, xa, "smartComparer:n");
|
|
if (null !== a) {
|
|
if (null !== b) {
|
|
var c = a.Bd,
|
|
d = b.Bd;
|
|
if (null !== c) {
|
|
if (null !== d) {
|
|
for (var c = c.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = d.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)
|
|
if ("" !== d[e] && void 0 !== d[e]) {
|
|
var g = parseFloat(c[e]),
|
|
h = parseFloat(d[e]);
|
|
if (isNaN(g)) {
|
|
if (!isNaN(h)) return 1;
|
|
if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e])
|
|
} else {
|
|
if (isNaN(h)) return -1;
|
|
if (0 !== g - h) return g - h
|
|
}
|
|
} else if ("" !== c[e]) return 1;
|
|
return "" !== d[e] && void 0 !== d[e] ? -1 : 0
|
|
}
|
|
return 1
|
|
}
|
|
return null !== d ? -1 : 0
|
|
}
|
|
return 1
|
|
}
|
|
return null !== b ? -1 : 0
|
|
};
|
|
|
|
function ya() {
|
|
z.kc(this);
|
|
this.network = null;
|
|
this.clear()
|
|
}
|
|
z.ia("LayoutEdge", ya);
|
|
ya.prototype.clear = function() {
|
|
this.toVertex = this.fromVertex = this.link = this.data = null
|
|
};
|
|
ya.prototype.toString = function(a) {
|
|
void 0 === a && (a = 0);
|
|
var b = "LayoutEdge#" + z.nd(this);
|
|
0 < a && (b += null !== this.link ? "(" + this.link.toString() + ")" : "", 1 < a && (b += " " + (this.fromVertex ? this.fromVertex.toString() : "null") + " --\x3e " + (this.toVertex ? this.toVertex.toString() : "null")));
|
|
return b
|
|
};
|
|
ya.prototype.Fx = function() {
|
|
var a = this.fromVertex;
|
|
this.fromVertex = this.toVertex;
|
|
this.toVertex = a
|
|
};
|
|
ya.prototype.commit = function() {};
|
|
ya.prototype.getOtherVertex = ya.prototype.NH = function(a) {
|
|
u && z.l(a, xa, ya, "getOtherVertex:v");
|
|
return this.toVertex === a ? this.fromVertex : this.fromVertex === a ? this.toVertex : null
|
|
};
|
|
|
|
function tm() {
|
|
0 < arguments.length && z.od(tm);
|
|
vg.call(this);
|
|
this.mx = !0;
|
|
this.ct = this.dt = NaN;
|
|
this.zj = (new Ea(NaN, NaN)).freeze();
|
|
this.ai = (new Ea(10, 10)).freeze();
|
|
this.Ie = An;
|
|
this.qd = tn;
|
|
this.$h = pn;
|
|
this.Jh = Bq
|
|
}
|
|
z.Qa(tm, vg);
|
|
z.ia("GridLayout", tm);
|
|
tm.prototype.cloneProtected = function(a) {
|
|
vg.prototype.cloneProtected.call(this, a);
|
|
a.dt = this.dt;
|
|
a.ct = this.ct;
|
|
a.zj.assign(this.zj);
|
|
a.ai.assign(this.ai);
|
|
a.Ie = this.Ie;
|
|
a.qd = this.qd;
|
|
a.$h = this.$h;
|
|
a.Jh = this.Jh
|
|
};
|
|
tm.prototype.doLayout = function(a) {
|
|
null === a && z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
|
|
this.je = this.initialOrigin(this.je);
|
|
var b = this.h;
|
|
a = this.aH(a);
|
|
for (var c = a.copy().i; c.next();) {
|
|
var d = c.value;
|
|
if (d instanceof G) {
|
|
var e = d;
|
|
if (null !== e.Y || null !== e.da) {
|
|
a.remove(e);
|
|
continue
|
|
}
|
|
}
|
|
d.Bf();
|
|
if (d instanceof F)
|
|
for (d = d.Hc; d.next();) a.remove(d.value)
|
|
}
|
|
e = a.jc();
|
|
if (0 !== e.length) {
|
|
switch (this.sorting) {
|
|
case sn:
|
|
e.reverse();
|
|
break;
|
|
case pn:
|
|
e.sort(this.comparer);
|
|
break;
|
|
case qn:
|
|
e.sort(this.comparer), e.reverse()
|
|
}
|
|
var g = this.EJ;
|
|
isNaN(g) && (g = 0);
|
|
var h = this.jG,
|
|
h = isNaN(h) && null !== b ? Math.max(b.xb.width - b.padding.left - b.padding.right, 0) : Math.max(this.jG, 0);
|
|
0 >= g && 0 >= h && (g = 1);
|
|
a = this.spacing.width;
|
|
isFinite(a) || (a = 0);
|
|
c = this.spacing.height;
|
|
isFinite(c) || (c = 0);
|
|
null !== b && b.Wb("Layout");
|
|
d = [];
|
|
switch (this.alignment) {
|
|
case Bn:
|
|
var k = a,
|
|
l = c,
|
|
m = Math.max(this.dp.width, 1);
|
|
if (!isFinite(m))
|
|
for (var n = m = 0; n < e.length; n++) var p = e[n],
|
|
q = p.Ia,
|
|
m = Math.max(m, q.width);
|
|
var m = Math.max(m + k, 1),
|
|
r = Math.max(this.dp.height,
|
|
1);
|
|
if (!isFinite(r))
|
|
for (n = r = 0; n < e.length; n++) p = e[n], q = p.Ia, r = Math.max(r, q.height);
|
|
for (var r = Math.max(r + l, 1), s = this.Xf, t = this.je.x, v = t, x = this.je.y, y = 0, A = 0, n = 0; n < e.length; n++) {
|
|
var p = e[n],
|
|
q = p.Ia,
|
|
B = Math.ceil((q.width + k) / m) * m,
|
|
L = Math.ceil((q.height + l) / r) * r,
|
|
H = 0;
|
|
switch (s) {
|
|
case zn:
|
|
H = Math.abs(v - q.width);
|
|
break;
|
|
default:
|
|
H = v + q.width
|
|
}
|
|
if (0 < g && y > g - 1 || 0 < h && 0 < y && H > h) d.push(new w(0, x, h + k, A)), y = 0, v = t, x += A, A = 0;
|
|
A = Math.max(A, L);
|
|
L = 0;
|
|
switch (s) {
|
|
case zn:
|
|
L = -q.width;
|
|
break;
|
|
default:
|
|
L = 0
|
|
}
|
|
p.moveTo(v + L, x);
|
|
switch (s) {
|
|
case zn:
|
|
v -= B;
|
|
break;
|
|
default:
|
|
v += B
|
|
}
|
|
y++
|
|
}
|
|
d.push(new w(0, x, h + k, A));
|
|
break;
|
|
case An:
|
|
k = g;
|
|
l = a;
|
|
m = c;
|
|
n = Math.max(this.dp.width, 1);
|
|
p = x = B = 0;
|
|
q = z.O();
|
|
for (g = 0; g < e.length; g++) r = e[g], s = r.Ia, t = lp(r, r.Zb, r.of, q), B = Math.max(B, t.x), x = Math.max(x, s.width - t.x), p = Math.max(p, t.y);
|
|
v = this.Xf;
|
|
switch (v) {
|
|
case zn:
|
|
B += l;
|
|
break;
|
|
default:
|
|
x += l
|
|
}
|
|
var n = isFinite(n) ? Math.max(n + l, 1) : Math.max(B + x, 1),
|
|
U = x = this.je.x,
|
|
y = this.je.y,
|
|
A = 0;
|
|
h >= B && (h -= B);
|
|
for (var B = L = 0, H = Math.max(this.dp.height, 1), ea = p = 0, W = !0, P = z.O(), g = 0; g < e.length; g++) {
|
|
r = e[g];
|
|
s = r.Ia;
|
|
t = lp(r, r.Zb, r.of, q);
|
|
if (0 < A) switch (v) {
|
|
case zn:
|
|
U =
|
|
(U - x - (s.width - t.x)) / n;
|
|
U = td(Math.round(U), U) ? Math.round(U) : Math.floor(U);
|
|
U = U * n + x;
|
|
break;
|
|
default:
|
|
U = (U - x + t.x) / n, U = td(Math.round(U), U) ? Math.round(U) : Math.ceil(U), U = U * n + x
|
|
} else switch (v) {
|
|
case zn:
|
|
L = U + t.x + s.width;
|
|
break;
|
|
default:
|
|
L = U - t.x
|
|
}
|
|
var ba = 0;
|
|
switch (v) {
|
|
case zn:
|
|
ba = -(U + t.x) + L;
|
|
break;
|
|
default:
|
|
ba = U + s.width - t.x - L
|
|
}
|
|
if (0 < k && A > k - 1 || 0 < h && 0 < A && ba > h) {
|
|
d.push(new w(0, W ? y - p : y, h + l, ea + p + m));
|
|
for (U = 0; U < A && g !== A; U++) {
|
|
var ba = e[g - A + U],
|
|
Oa = lp(ba, ba.Zb, ba.of, P);
|
|
ba.moveTo(ba.position.x, ba.position.y + p - Oa.y)
|
|
}
|
|
ea += m;
|
|
y = W ? y + ea : y + (ea + p);
|
|
A = ea = p = 0;
|
|
U = x;
|
|
W = !1
|
|
}
|
|
U === x && (B = v === zn ? Math.max(B, s.width - t.x) : Math.min(B, -t.x));
|
|
p = Math.max(p, t.y);
|
|
ea = Math.max(ea, s.height - t.y);
|
|
isFinite(H) && (ea = Math.max(ea, Math.max(s.height, H) - t.y));
|
|
W ? r.moveTo(U - t.x, y - t.y) : r.moveTo(U - t.x, y);
|
|
switch (v) {
|
|
case zn:
|
|
U -= t.x + l;
|
|
break;
|
|
default:
|
|
U += s.width - t.x + l
|
|
}
|
|
A++
|
|
}
|
|
d.push(new w(0, y, h + l, (W ? ea : ea + p) + m));
|
|
for (U = 0; U < A && g !== A; U++) ba = e[g - A + U], Oa = lp(ba, ba.Zb, ba.of, q), ba.moveTo(ba.position.x, ba.position.y + p - Oa.y);
|
|
z.A(q);
|
|
z.A(P);
|
|
if (v === zn)
|
|
for (g = 0; g < d.length; g++) e = d[g], e.width += B, e.x -= B;
|
|
else
|
|
for (g =
|
|
0; g < d.length; g++) e = d[g], e.x > B && (e.width += e.x - B, e.x = B)
|
|
}
|
|
for (k = g = h = e = 0; k < d.length; k++) l = d[k], e = Math.min(e, l.x), h = Math.min(h, l.y), g = Math.max(g, l.x + l.width);
|
|
this.Xf === zn ? this.commitLayers(d, new N(e + a / 2 - (g + e), h - c / 2)) : this.commitLayers(d, new N(e - a / 2, h - c / 2));
|
|
null !== b && b.Jd("Layout");
|
|
this.Gf = !0
|
|
}
|
|
};
|
|
tm.prototype.commitLayers = function() {};
|
|
z.defineProperty(tm, {
|
|
jG: "wrappingWidth"
|
|
}, function() {
|
|
return this.dt
|
|
}, function(a) {
|
|
this.dt !== a && (z.g(a, "number", tm, "wrappingWidth"), 0 < a || isNaN(a)) && (this.dt = a, this.mx = isNaN(a), this.I())
|
|
});
|
|
z.defineProperty(tm, {
|
|
EJ: "wrappingColumn"
|
|
}, function() {
|
|
return this.ct
|
|
}, function(a) {
|
|
this.ct !== a && (z.g(a, "number", tm, "wrappingColumn"), 0 < a || isNaN(a)) && (this.ct = a, this.I())
|
|
});
|
|
z.defineProperty(tm, {
|
|
dp: "cellSize"
|
|
}, function() {
|
|
return this.zj
|
|
}, function(a) {
|
|
z.l(a, Ea, tm, "cellSize");
|
|
this.zj.N(a) || (this.zj.assign(a), this.I())
|
|
});
|
|
z.defineProperty(tm, {
|
|
spacing: "spacing"
|
|
}, function() {
|
|
return this.ai
|
|
}, function(a) {
|
|
z.l(a, Ea, tm, "spacing");
|
|
this.ai.N(a) || (this.ai.assign(a), this.I())
|
|
});
|
|
z.defineProperty(tm, {
|
|
alignment: "alignment"
|
|
}, function() {
|
|
return this.Ie
|
|
}, function(a) {
|
|
this.Ie !== a && (z.Ba(a, tm, tm, "alignment"), a === An || a === Bn) && (this.Ie = a, this.I())
|
|
});
|
|
z.defineProperty(tm, {
|
|
Xf: "arrangement"
|
|
}, function() {
|
|
return this.qd
|
|
}, function(a) {
|
|
this.qd !== a && (z.Ba(a, tm, tm, "arrangement"), a === tn || a === zn) && (this.qd = a, this.I())
|
|
});
|
|
z.defineProperty(tm, {
|
|
sorting: "sorting"
|
|
}, function() {
|
|
return this.$h
|
|
}, function(a) {
|
|
this.$h !== a && (z.Ba(a, tm, tm, "sorting"), a === rn || a === sn || a === pn || a === qn) && (this.$h = a, this.I())
|
|
});
|
|
z.defineProperty(tm, {
|
|
comparer: "comparer"
|
|
}, function() {
|
|
return this.Jh
|
|
}, function(a) {
|
|
this.Jh !== a && (z.g(a, "function", tm, "comparer"), this.Jh = a, this.I())
|
|
});
|
|
var Bq;
|
|
tm.standardComparer = Bq = function(a, b) {
|
|
u && z.l(a, D, tm, "standardComparer:a");
|
|
u && z.l(b, D, tm, "standardComparer:b");
|
|
var c = a.text,
|
|
d = b.text;
|
|
return c < d ? -1 : c > d ? 1 : 0
|
|
};
|
|
tm.smartComparer = function(a, b) {
|
|
u && z.l(a, D, tm, "standardComparer:a");
|
|
u && z.l(b, D, tm, "standardComparer:b");
|
|
if (null !== a) {
|
|
if (null !== b) {
|
|
for (var c = a.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), d = b.text.toLocaleLowerCase().split(/([+\-]?[\.]?\d+(?:\.\d*)?(?:e[+\-]?\d+)?)/), e = 0; e < c.length; e++)
|
|
if ("" !== d[e] && void 0 !== d[e]) {
|
|
var g = parseFloat(c[e]),
|
|
h = parseFloat(d[e]);
|
|
if (isNaN(g)) {
|
|
if (!isNaN(h)) return 1;
|
|
if (0 !== c[e].localeCompare(d[e])) return c[e].localeCompare(d[e])
|
|
} else {
|
|
if (isNaN(h)) return -1;
|
|
if (0 !== g - h) return g - h
|
|
}
|
|
} else if ("" !== c[e]) return 1;
|
|
return "" !== d[e] && void 0 !== d[e] ? -1 : 0
|
|
}
|
|
return 1
|
|
}
|
|
return null !== b ? -1 : 0
|
|
};
|
|
var Bn;
|
|
tm.Position = Bn = z.s(tm, "Position", 0);
|
|
var An;
|
|
tm.Location = An = z.s(tm, "Location", 1);
|
|
var tn;
|
|
tm.LeftToRight = tn = z.s(tm, "LeftToRight", 2);
|
|
var zn;
|
|
tm.RightToLeft = zn = z.s(tm, "RightToLeft", 3);
|
|
var rn;
|
|
tm.Forward = rn = z.s(tm, "Forward", 4);
|
|
var sn;
|
|
tm.Reverse = sn = z.s(tm, "Reverse", 5);
|
|
var pn;
|
|
tm.Ascending = pn = z.s(tm, "Ascending", 6);
|
|
var qn;
|
|
tm.Descending = qn = z.s(tm, "Descending", 7);
|
|
|
|
function Cn() {
|
|
0 < arguments.length && z.od(Cn);
|
|
vg.call(this);
|
|
this.Gy = this.co = this.Ud = 0;
|
|
this.Vq = 360;
|
|
this.Fy = On;
|
|
this.Sk = 0;
|
|
this.cC = On;
|
|
this.Yu = this.Eg = this.sD = 0;
|
|
this.zw = new Cq;
|
|
this.$u = this.zm = 0;
|
|
this.zG = 600;
|
|
this.js = NaN;
|
|
this.rq = 1;
|
|
this.Ps = 0;
|
|
this.Rs = 360;
|
|
this.qd = On;
|
|
this.fa = Kn;
|
|
this.$h = Hn;
|
|
this.Jh = Aq;
|
|
this.ai = 6;
|
|
this.Yr = Rn
|
|
}
|
|
z.Qa(Cn, vg);
|
|
z.ia("CircularLayout", Cn);
|
|
Cn.prototype.cloneProtected = function(a) {
|
|
vg.prototype.cloneProtected.call(this, a);
|
|
a.js = this.js;
|
|
a.rq = this.rq;
|
|
a.Ps = this.Ps;
|
|
a.Rs = this.Rs;
|
|
a.qd = this.qd;
|
|
a.fa = this.fa;
|
|
a.$h = this.$h;
|
|
a.Jh = this.Jh;
|
|
a.ai = this.ai;
|
|
a.Yr = this.Yr
|
|
};
|
|
Cn.prototype.createNetwork = function() {
|
|
return new Dq
|
|
};
|
|
Cn.prototype.doLayout = function(a) {
|
|
null === a && z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
|
|
null === this.network && (this.network = this.makeNetwork(a));
|
|
a = this.network.vertexes;
|
|
if (1 >= a.count) 1 === a.count && (a = a.first(), a.ra = 0, a.za = 0);
|
|
else {
|
|
var b = new J(Eq);
|
|
b.$c(a.i);
|
|
a = new J(Eq);
|
|
var c = new J(Eq),
|
|
d;
|
|
d = this.sort(b);
|
|
var e = this.Fy,
|
|
g = this.cC,
|
|
h = this.Ud,
|
|
k = this.co,
|
|
l = this.Gy,
|
|
m = this.Vq,
|
|
b = this.Sk,
|
|
n = this.sD,
|
|
p = this.Eg,
|
|
q = this.Yu,
|
|
e = this.Xf,
|
|
g = this.tx,
|
|
h = this.UI;
|
|
if (!isFinite(h) ||
|
|
0 >= h) h = NaN;
|
|
k = this.VG;
|
|
if (!isFinite(k) || 0 >= k) k = 1;
|
|
l = this.Fe;
|
|
isFinite(l) || (l = 0);
|
|
m = this.Lf;
|
|
if (!isFinite(m) || 360 < m || 1 > m) m = 360;
|
|
b = this.spacing;
|
|
isFinite(b) || (b = NaN);
|
|
e === Pn && g === Qn ? e = On : e === Pn && g !== Qn && (g = Qn, e = this.Xf);
|
|
if ((this.direction === In || this.direction === Jn) && this.sorting !== Hn) {
|
|
for (var r = 0; !(r >= d.length); r += 2) {
|
|
a.add(d.ea(r));
|
|
if (r + 1 >= d.length) break;
|
|
c.add(d.ea(r + 1))
|
|
}
|
|
this.direction === In ? (this.Xf === Pn && a.reverse(), d = new J(Eq), d.$c(a), d.$c(c)) : (this.Xf === Pn && c.reverse(), d = new J(Eq), d.$c(c), d.$c(a))
|
|
}
|
|
for (var s =
|
|
d.length, t = n = 0, r = 0; r < d.length; r++) {
|
|
var p = l + m * t * (this.direction === Kn ? 1 : -1) / s,
|
|
v = d.ea(r).diameter;
|
|
isNaN(v) && (v = Fq(d.ea(r), p));
|
|
360 > m && (0 === r || r === d.length - 1) && (v /= 2);
|
|
n += v;
|
|
t++
|
|
}
|
|
if (isNaN(h) || e === Pn) {
|
|
isNaN(b) && (b = 6);
|
|
if (e !== On && e !== Pn) {
|
|
v = -Infinity;
|
|
for (r = 0; r < s; r++) {
|
|
var q = d.ea(r),
|
|
x = d.ea(r === s - 1 ? 0 : r + 1);
|
|
isNaN(q.diameter) && Fq(q, 0);
|
|
isNaN(x.diameter) && Fq(x, 0);
|
|
v = Math.max(v, (q.diameter + x.diameter) / 2)
|
|
}
|
|
q = v + b;
|
|
e === Mn ? (p = 2 * Math.PI / s, h = (v + b) / p) : h = Gq(this, q * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180)
|
|
} else h = Gq(this, n + (360 <=
|
|
m ? s : s - 1) * (e !== Pn ? b : 1.6 * b), k, l * Math.PI / 180, m * Math.PI / 180);
|
|
p = h * k
|
|
} else if (p = h * k, t = Hq(this, h, p, l * Math.PI / 180, m * Math.PI / 180), isNaN(b)) {
|
|
if (e === On || e === Pn) b = (t - n) / (360 <= m ? s : s - 1)
|
|
} else if (e === On || e === Pn) r = (t - n) / (360 <= m ? s : s - 1), r < b ? (h = Gq(this, n + b * (360 <= m ? s : s - 1), k, l * Math.PI / 180, m * Math.PI / 180), p = h * k) : b = r;
|
|
else {
|
|
v = -Infinity;
|
|
for (r = 0; r < s; r++) q = d.ea(r), x = d.ea(r === s - 1 ? 0 : r + 1), isNaN(q.diameter) && Fq(q, 0), isNaN(x.diameter) && Fq(x, 0), v = Math.max(v, (q.diameter + x.diameter) / 2);
|
|
q = v + b;
|
|
r = Gq(this, q * (360 <= m ? s : s - 1), k, l * Math.PI / 180,
|
|
m * Math.PI / 180);
|
|
r > h ? (h = r, p = h * k) : q = t / (360 <= m ? s : s - 1)
|
|
}
|
|
this.Fy = e;
|
|
this.cC = g;
|
|
this.Ud = h;
|
|
this.co = k;
|
|
this.Gy = l;
|
|
this.Vq = m;
|
|
this.Sk = b;
|
|
this.sD = n;
|
|
this.Eg = p;
|
|
this.Yu = q;
|
|
b = d;
|
|
d = this.Fy;
|
|
e = this.Ud;
|
|
g = this.Gy;
|
|
k = this.Vq;
|
|
l = this.Sk;
|
|
m = this.Eg;
|
|
n = this.Yu;
|
|
if (this.direction !== In && this.direction !== Jn || d !== Pn)
|
|
if (this.direction === In || this.direction === Jn) {
|
|
h = 0;
|
|
switch (d) {
|
|
case Nn:
|
|
h = 180 * Iq(this, e, m, g, n) / Math.PI;
|
|
break;
|
|
case On:
|
|
n = b = 0;
|
|
h = a.first();
|
|
null !== h && (b = Fq(h, Math.PI / 2));
|
|
h = c.first();
|
|
null !== h && (n = Fq(h, Math.PI / 2));
|
|
h = 180 * Iq(this, e, m, g, l + (b +
|
|
n) / 2) / Math.PI;
|
|
break;
|
|
case Mn:
|
|
h = k / b.length
|
|
}
|
|
if (this.direction === In) {
|
|
switch (d) {
|
|
case Nn:
|
|
Jq(this, a, g, Ln);
|
|
break;
|
|
case On:
|
|
Kq(this, a, g, Ln);
|
|
break;
|
|
case Mn:
|
|
Lq(this, a, k / 2, g, Ln)
|
|
}
|
|
switch (d) {
|
|
case Nn:
|
|
Jq(this, c, g + h, Kn);
|
|
break;
|
|
case On:
|
|
Kq(this, c, g + h, Kn);
|
|
break;
|
|
case Mn:
|
|
Lq(this, c, k / 2, g + h, Kn)
|
|
}
|
|
} else {
|
|
switch (d) {
|
|
case Nn:
|
|
Jq(this, c, g, Ln);
|
|
break;
|
|
case On:
|
|
Kq(this, c, g, Ln);
|
|
break;
|
|
case Mn:
|
|
Lq(this, c, k / 2, g, Ln)
|
|
}
|
|
switch (d) {
|
|
case Nn:
|
|
Jq(this, a, g + h, Kn);
|
|
break;
|
|
case On:
|
|
Kq(this, a, g + h, Kn);
|
|
break;
|
|
case Mn:
|
|
Lq(this, a, k / 2, g + h, Kn)
|
|
}
|
|
}
|
|
} else switch (d) {
|
|
case Nn:
|
|
Jq(this,
|
|
b, g, this.direction);
|
|
break;
|
|
case On:
|
|
Kq(this, b, g, this.direction);
|
|
break;
|
|
case Mn:
|
|
Lq(this, b, k, g, this.direction);
|
|
break;
|
|
case Pn:
|
|
Mq(this, b, k, g, this.direction)
|
|
} else Mq(this, b, k, g - k / 2, Kn)
|
|
}
|
|
this.updateParts();
|
|
this.network = null;
|
|
this.Gf = !0
|
|
};
|
|
|
|
function Lq(a, b, c, d, e) {
|
|
var g = a.Vq,
|
|
h = a.Ud;
|
|
a = a.Eg;
|
|
d = d * Math.PI / 180;
|
|
c = c * Math.PI / 180;
|
|
for (var k = b.length, l = 0; l < k; l++) {
|
|
var m = d + (e === Kn ? l * c / (360 <= g ? k : k - 1) : -(l * c) / k),
|
|
n = b.ea(l),
|
|
p = h * Math.tan(m) / a,
|
|
p = Math.sqrt((h * h + a * a * p * p) / (1 + p * p));
|
|
n.ra = p * Math.cos(m);
|
|
n.za = p * Math.sin(m);
|
|
n.actualAngle = 180 * m / Math.PI
|
|
}
|
|
}
|
|
|
|
function Kq(a, b, c, d) {
|
|
var e = a.Ud,
|
|
g = a.Eg,
|
|
h = a.Sk;
|
|
c = c * Math.PI / 180;
|
|
for (var k = b.length, l = 0; l < k; l++) {
|
|
var m = b.ea(l),
|
|
n = b.ea(l === k - 1 ? 0 : l + 1),
|
|
p = g * Math.sin(c);
|
|
m.ra = e * Math.cos(c);
|
|
m.za = p;
|
|
m.actualAngle = 180 * c / Math.PI;
|
|
isNaN(m.diameter) && Fq(m, 0);
|
|
isNaN(n.diameter) && Fq(n, 0);
|
|
m = Iq(a, e, g, d === Kn ? c : -c, (m.diameter + n.diameter) / 2 + h);
|
|
c += d === Kn ? m : -m
|
|
}
|
|
}
|
|
|
|
function Jq(a, b, c, d) {
|
|
var e = a.Ud,
|
|
g = a.Eg,
|
|
h = a.Yu;
|
|
c = c * Math.PI / 180;
|
|
for (var k = b.length, l = 0; l < k; l++) {
|
|
var m = b.ea(l);
|
|
m.ra = e * Math.cos(c);
|
|
m.za = g * Math.sin(c);
|
|
m.actualAngle = 180 * c / Math.PI;
|
|
m = Iq(a, e, g, d === Kn ? c : -c, h);
|
|
c += d === Kn ? m : -m
|
|
}
|
|
}
|
|
|
|
function Mq(a, b, c, d, e) {
|
|
var g = a.$u,
|
|
g = a.Vq;
|
|
a.zm = 0;
|
|
a.zw = new Cq;
|
|
if (360 > c) {
|
|
for (g = d + (e === Kn ? g : -g); 0 > g;) g += 360;
|
|
g %= 360;
|
|
180 < g && (g -= 360);
|
|
g *= Math.PI / 180;
|
|
a.$u = g;
|
|
Nq(a, b, c, d, e)
|
|
} else Oq(a, b, c, d, e);
|
|
a.zw.commit(b)
|
|
}
|
|
|
|
function Oq(a, b, c, d, e) {
|
|
var g = a.Ud,
|
|
h = a.Sk,
|
|
k = a.co,
|
|
l = g * Math.cos(d * Math.PI / 180),
|
|
m = a.Eg * Math.sin(d * Math.PI / 180),
|
|
n = b.jc();
|
|
if (3 === n.length) n[0].ra = g, n[0].za = 0, n[1].ra = n[0].ra - n[0].width / 2 - n[1].width / 2 - h, n[1].y = n[0].y, n[2].ra = (n[0].ra + n[1].ra) / 2, n[2].y = n[0].y - n[2].height - h;
|
|
else if (4 === n.length) n[0].ra = g, n[0].za = 0, n[2].ra = -n[0].ra, n[2].za = n[0].za, n[1].ra = 0, n[1].y = Math.min(n[0].y, n[2].y) - n[1].height - h, n[3].ra = 0, n[3].y = Math.max(n[0].y + n[0].height + h, n[2].y + n[2].height + h);
|
|
else {
|
|
for (var g = z.O(), p = 0; p < n.length; p++) {
|
|
n[p].ra =
|
|
l;
|
|
n[p].za = m;
|
|
if (p >= n.length - 1) break;
|
|
Pq(a, l, m, n, p, e, g) || Qq(a, l, m, n, p, e, g);
|
|
l = g.x;
|
|
m = g.y
|
|
}
|
|
z.A(g);
|
|
a.zm++;
|
|
if (!(23 < a.zm)) {
|
|
var l = n[0].ra,
|
|
m = n[0].za,
|
|
g = n[n.length - 1].ra,
|
|
p = n[n.length - 1].za,
|
|
q = Math.abs(l - g) - ((n[0].width + n[n.length - 1].width) / 2 + h),
|
|
r = Math.abs(m - p) - ((n[0].height + n[n.length - 1].height) / 2 + h),
|
|
h = 0;
|
|
1 > Math.abs(r) ? Math.abs(l - g) < (n[0].width + n[n.length - 1].width) / 2 && (h = 0) : h = 0 < r ? r : 1 > Math.abs(q) ? 0 : q;
|
|
q = !1;
|
|
q = Math.abs(g) > Math.abs(p) ? 0 < g !== m > p : 0 < p !== l < g;
|
|
if (q = e === Kn ? q : !q) h = -Math.abs(h), h = Math.min(h, -n[n.length - 1].width),
|
|
h = Math.min(h, -n[n.length - 1].height);
|
|
a.zw.compare(h, n);
|
|
1 < Math.abs(h) && (a.Ud = 8 > a.zm ? a.Ud - h / (2 * Math.PI) : 5 > n.length && 10 < h ? a.Ud / 2 : a.Ud - (0 < h ? 1.7 : -2.3), a.Eg = a.Ud * k, Oq(a, b, c, d, e))
|
|
}
|
|
}
|
|
}
|
|
|
|
function Nq(a, b, c, d, e) {
|
|
for (var g = a.Ud, h = a.Eg, k = a.co, l = g * Math.cos(d * Math.PI / 180), m = h * Math.sin(d * Math.PI / 180), n = z.O(), p = b.jc(), q = 0; q < p.length; q++) {
|
|
p[q].ra = l;
|
|
p[q].za = m;
|
|
if (q >= p.length - 1) break;
|
|
Pq(a, l, m, p, q, e, n) || Qq(a, l, m, p, q, e, n);
|
|
l = n.x;
|
|
m = n.y
|
|
}
|
|
z.A(n);
|
|
a.zm++;
|
|
if (!(23 < a.zm)) {
|
|
l = Math.atan2(m, l);
|
|
l = e === Kn ? a.$u - l : l - a.$u;
|
|
l = Math.abs(l) < Math.abs(l - 2 * Math.PI) ? l : l - 2 * Math.PI;
|
|
g = l * (g + h) / 2;
|
|
h = a.zw;
|
|
if (Math.abs(g) < Math.abs(h.qp))
|
|
for (h.qp = g, h.Dn = [], h.gq = [], l = 0; l < p.length; l++) h.Dn[l] = p[l].vb.x, h.gq[l] = p[l].vb.y;
|
|
1 < Math.abs(g) &&
|
|
(a.Ud = 8 > a.zm ? a.Ud - g / (2 * Math.PI) : a.Ud - (0 < g ? 1.7 : -2.3), a.Eg = a.Ud * k, Nq(a, b, c, d, e))
|
|
}
|
|
}
|
|
|
|
function Pq(a, b, c, d, e, g, h) {
|
|
var k = a.Ud,
|
|
l = a.Eg,
|
|
m = 0,
|
|
n = 0;
|
|
a = (d[e].width + d[e + 1].width) / 2 + a.Sk;
|
|
var p = !1;
|
|
if (0 <= c !== (g === Kn)) {
|
|
if (m = b + a, m > k) {
|
|
m = b - a;
|
|
if (m < -k) return h.x = m, h.y = n, !1;
|
|
p = !0
|
|
}
|
|
} else if (m = b - a, m < -k) {
|
|
m = b + a;
|
|
if (m > k) return h.x = m, h.y = n, !1;
|
|
p = !0
|
|
}
|
|
n = Math.sqrt(1 - Math.min(1, m * m / (k * k))) * l;
|
|
0 > c !== p && (n = -n);
|
|
if (Math.abs(c - n) > (d[e].height + d[e + 1].height) / 2) return h.x = m, h.y = n, !1;
|
|
h.x = m;
|
|
h.y = n;
|
|
return !0
|
|
}
|
|
|
|
function Qq(a, b, c, d, e, g, h) {
|
|
var k = a.Ud,
|
|
l = a.Eg,
|
|
m = 0,
|
|
n = 0;
|
|
a = (d[e].height + d[e + 1].height) / 2 + a.Sk;
|
|
d = !1;
|
|
if (0 <= b !== (g === Kn)) {
|
|
if (n = c - a, n < -l) {
|
|
n = c + a;
|
|
if (n > l) {
|
|
h.x = m;
|
|
h.y = n;
|
|
return
|
|
}
|
|
d = !0
|
|
}
|
|
} else if (n = c + a, n > l) {
|
|
n = c - a;
|
|
if (n < -l) {
|
|
h.x = m;
|
|
h.y = n;
|
|
return
|
|
}
|
|
d = !0
|
|
}
|
|
m = Math.sqrt(1 - Math.min(1, n * n / (l * l))) * k;
|
|
0 > b !== d && (m = -m);
|
|
h.x = m;
|
|
h.y = n
|
|
}
|
|
Cn.prototype.commitLayout = function() {
|
|
this.commitNodes();
|
|
this.Rt && this.commitLinks()
|
|
};
|
|
Cn.prototype.commitNodes = function() {
|
|
for (var a = this.KG, b = this.network.vertexes.i; b.next();) {
|
|
var c = b.value;
|
|
c.x += a.x;
|
|
c.y += a.y;
|
|
c.commit()
|
|
}
|
|
};
|
|
Cn.prototype.commitLinks = function() {
|
|
for (var a = this.network.edges.i; a.next();) a.value.commit()
|
|
};
|
|
|
|
function Hq(a, b, c, d, e) {
|
|
var g = a.zG;
|
|
if (.001 > Math.abs(a.co - 1)) return void 0 !== d && void 0 !== e ? e * b : 2 * Math.PI * b;
|
|
a = b > c ? Math.sqrt(b * b - c * c) / b : Math.sqrt(c * c - b * b) / c;
|
|
for (var h = 0, k = 0, k = void 0 !== d && void 0 !== e ? e / (g + 1) : Math.PI / (2 * (g + 1)), l = 0, m = 0; m <= g; m++) l = void 0 !== d && void 0 !== e ? d + m * e / g : m * Math.PI / (2 * g), l = Math.sin(l), h += Math.sqrt(1 - a * a * l * l) * k;
|
|
return void 0 !== d && void 0 !== e ? (b > c ? b : c) * h : 4 * (b > c ? b : c) * h
|
|
}
|
|
|
|
function Gq(a, b, c, d, e) {
|
|
var g = 0,
|
|
g = void 0 !== d && void 0 !== e ? Hq(a, 1, c, d, e) : Hq(a, 1, c);
|
|
return b / g
|
|
}
|
|
|
|
function Iq(a, b, c, d, e) {
|
|
if (.001 > Math.abs(a.co - 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
|
|
}
|
|
}
|
|
Cn.prototype.sort = function(a) {
|
|
switch (this.sorting) {
|
|
case Fn:
|
|
break;
|
|
case Gn:
|
|
a.reverse();
|
|
break;
|
|
case Dn:
|
|
a.sort(this.comparer);
|
|
break;
|
|
case En:
|
|
a.sort(this.comparer);
|
|
a.reverse();
|
|
break;
|
|
case Hn:
|
|
for (var b = [], c = 0; c < a.length; c++) b.push(0);
|
|
for (var d = new J(Eq), c = 0; c < a.length; c++) {
|
|
var e = -1,
|
|
g = -1;
|
|
if (0 === c)
|
|
for (var h = 0; h < a.length; h++) {
|
|
var k = a.ea(h).CH;
|
|
k > e && (e = k, g = h)
|
|
} else
|
|
for (h = 0; h < a.length; h++) k = b[h], k > e && (e = k, g = h);
|
|
d.add(a.ea(g));
|
|
b[g] = -1;
|
|
g = a.ea(g);
|
|
e = 0;
|
|
for (h = g.tc; h.next();) e = a.indexOf(h.value.fromVertex), 0 > e || 0 <= b[e] &&
|
|
b[e]++;
|
|
for (g = g.pc; g.next();) e = a.indexOf(g.value.toVertex), 0 > e || 0 <= b[e] && b[e]++
|
|
}
|
|
a = [];
|
|
for (b = 0; b < d.length; b++) {
|
|
h = d.ea(b);
|
|
a[b] = [];
|
|
for (var l = 0, c = h.pc; c.next();) l = d.indexOf(c.value.toVertex), l !== b && 0 > a[b].indexOf(l) && a[b].push(l);
|
|
for (c = h.tc; c.next();) l = d.indexOf(c.value.fromVertex), l !== b && 0 > a[b].indexOf(l) && a[b].push(l)
|
|
}
|
|
h = [];
|
|
for (b = 0; b < a.length; b++) h[b] = 0;
|
|
for (var c = [], k = [], m = [], e = [], g = new J(Eq), n = 0, b = 0; b < a.length; b++) {
|
|
var p = a[b].length;
|
|
if (1 === p) e.push(b);
|
|
else if (0 === p) g.add(d.ea(b));
|
|
else {
|
|
if (0 === n) c.push(b);
|
|
else {
|
|
for (var q = Infinity, r = Infinity, s = -1, t = [], p = 0; p < c.length; p++) 0 > a[c[p]].indexOf(c[p === c.length - 1 ? 0 : p + 1]) && t.push(p === c.length - 1 ? 0 : p + 1);
|
|
if (0 === t.length)
|
|
for (p = 0; p < c.length; p++) t.push(p);
|
|
for (p = 0; p < t.length; p++) {
|
|
var v = t[p],
|
|
x, l = a[b];
|
|
x = k;
|
|
for (var y = m, A = h, B = v, L = c, H = 0, U = 0; U < x.length; U++) {
|
|
var ea = A[x[U]],
|
|
W = A[y[U]],
|
|
P = 0,
|
|
ba = 0;
|
|
ea < W ? (P = ea, ba = W) : (P = W, ba = ea);
|
|
if (P < B && B <= ba)
|
|
for (ea = 0; ea < l.length; ea++) W = l[ea], 0 > L.indexOf(W) || P < A[W] && A[W] < ba || P === A[W] || ba === A[W] || H++;
|
|
else
|
|
for (ea = 0; ea < l.length; ea++) W = l[ea], 0 > L.indexOf(W) ||
|
|
P < A[W] && A[W] < ba && P !== A[W] && ba !== A[W] && H++
|
|
}
|
|
x = H;
|
|
for (A = y = 0; A < a[b].length; A++) l = c.indexOf(a[b][A]), 0 <= l && (l = Math.abs(v - (l >= v ? l + 1 : l)), y += l < c.length + 1 - l ? l : c.length + 1 - l);
|
|
for (A = 0; A < k.length; A++) l = h[k[A]], B = h[m[A]], l >= v && l++, B >= v && B++, l > B && (L = B, B = l, l = L), B - l < (c.length + 2) / 2 === (l < v && v <= B) && y++;
|
|
if (x < q || x === q && y < r) q = x, r = y, s = v
|
|
}
|
|
c.splice(s, 0, b);
|
|
for (p = 0; p < c.length; p++) h[c[p]] = p;
|
|
for (p = 0; p < a[b].length; p++) q = a[b][p], 0 <= c.indexOf(q) && (k.push(b), m.push(q))
|
|
}
|
|
n++
|
|
}
|
|
}
|
|
k = !1;
|
|
for (m = c.length;;) {
|
|
k = !0;
|
|
for (h = 0; h < e.length; h++)
|
|
if (b = e[h],
|
|
n = a[b][0], l = c.indexOf(n), 0 <= l) {
|
|
for (r = p = 0; r < a[n].length; r++) q = a[n][r], q = c.indexOf(q), 0 > q || q === l || (s = q > l ? q - l : l - q, p += q < l !== s > m - s ? 1 : -1);
|
|
c.splice(0 > p ? l : l + 1, 0, b);
|
|
e.splice(h, 1);
|
|
h--
|
|
} else k = !1;
|
|
if (k) break;
|
|
else c.push(e[0]), e.splice(0, 1)
|
|
}
|
|
for (b = 0; b < c.length; b++) l = c[b], g.add(d.ea(l));
|
|
return g;
|
|
default:
|
|
z.k("Invalid sorting type.")
|
|
}
|
|
return a
|
|
};
|
|
z.defineProperty(Cn, {
|
|
UI: "radius"
|
|
}, function() {
|
|
return this.js
|
|
}, function(a) {
|
|
this.js !== a && (z.g(a, "number", Cn, "radius"), 0 < a || isNaN(a)) && (this.js = a, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
VG: "aspectRatio"
|
|
}, function() {
|
|
return this.rq
|
|
}, function(a) {
|
|
this.rq !== a && (z.g(a, "number", Cn, "aspectRatio"), 0 < a && (this.rq = a, this.I()))
|
|
});
|
|
z.defineProperty(Cn, {
|
|
Fe: "startAngle"
|
|
}, function() {
|
|
return this.Ps
|
|
}, function(a) {
|
|
this.Ps !== a && (z.g(a, "number", Cn, "startAngle"), this.Ps = a, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
Lf: "sweepAngle"
|
|
}, function() {
|
|
return this.Rs
|
|
}, function(a) {
|
|
this.Rs !== a && (z.g(a, "number", Cn, "sweepAngle"), this.Rs = 0 < a && 360 >= a ? a : 360, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
Xf: "arrangement"
|
|
}, function() {
|
|
return this.qd
|
|
}, function(a) {
|
|
this.qd !== a && (z.Ba(a, Cn, Cn, "arrangement"), a === Pn || a === On || a === Nn || a === Mn) && (this.qd = a, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
direction: "direction"
|
|
}, function() {
|
|
return this.fa
|
|
}, function(a) {
|
|
this.fa !== a && (z.Ba(a, Cn, Cn, "direction"), a === Kn || a === Ln || a === In || a === Jn) && (this.fa = a, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
sorting: "sorting"
|
|
}, function() {
|
|
return this.$h
|
|
}, function(a) {
|
|
this.$h !== a && (z.Ba(a, Cn, Cn, "sorting"), a === Fn || a === Gn || a === Dn || En || a === Hn) && (this.$h = a, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
comparer: "comparer"
|
|
}, function() {
|
|
return this.Jh
|
|
}, function(a) {
|
|
this.Jh !== a && (z.g(a, "function", Cn, "comparer"), this.Jh = a, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
spacing: "spacing"
|
|
}, function() {
|
|
return this.ai
|
|
}, function(a) {
|
|
this.ai !== a && (z.g(a, "number", Cn, "spacing"), this.ai = a, this.I())
|
|
});
|
|
z.defineProperty(Cn, {
|
|
tx: "nodeDiameterFormula"
|
|
}, function() {
|
|
return this.Yr
|
|
}, function(a) {
|
|
this.Yr !== a && (z.Ba(a, Cn, Cn, "nodeDiameterFormula"), a === Rn || a === Qn) && (this.Yr = a, this.I())
|
|
});
|
|
z.w(Cn, {
|
|
LG: "actualXRadius"
|
|
}, function() {
|
|
return this.Ud
|
|
});
|
|
z.w(Cn, {
|
|
MG: "actualYRadius"
|
|
}, function() {
|
|
return this.Eg
|
|
});
|
|
z.w(Cn, {
|
|
HJ: "actualSpacing"
|
|
}, function() {
|
|
return this.Sk
|
|
});
|
|
z.w(Cn, {
|
|
KG: "actualCenter"
|
|
}, function() {
|
|
return isNaN(this.je.x) || isNaN(this.je.y) ? new N(0, 0) : new N(this.je.x + this.LG, this.je.y + this.MG)
|
|
});
|
|
var On;
|
|
Cn.ConstantSpacing = On = z.s(Cn, "ConstantSpacing", 0);
|
|
var Nn;
|
|
Cn.ConstantDistance = Nn = z.s(Cn, "ConstantDistance", 1);
|
|
var Mn;
|
|
Cn.ConstantAngle = Mn = z.s(Cn, "ConstantAngle", 2);
|
|
var Pn;
|
|
Cn.Packed = Pn = z.s(Cn, "Packed", 3);
|
|
var Kn;
|
|
Cn.Clockwise = Kn = z.s(Cn, "Clockwise", 4);
|
|
var Ln;
|
|
Cn.Counterclockwise = Ln = z.s(Cn, "Counterclockwise", 5);
|
|
var In;
|
|
Cn.BidirectionalLeft = In = z.s(Cn, "BidirectionalLeft", 6);
|
|
var Jn;
|
|
Cn.BidirectionalRight = Jn = z.s(Cn, "BidirectionalRight", 7);
|
|
var Fn;
|
|
Cn.Forwards = Fn = z.s(Cn, "Forwards", 8);
|
|
var Gn;
|
|
Cn.Reverse = Gn = z.s(Cn, "Reverse", 9);
|
|
var Dn;
|
|
Cn.Ascending = Dn = z.s(Cn, "Ascending", 10);
|
|
var En;
|
|
Cn.Descending = En = z.s(Cn, "Descending", 11);
|
|
var Hn;
|
|
Cn.Optimized = Hn = z.s(Cn, "Optimized", 12);
|
|
var Rn;
|
|
Cn.Pythagorean = Rn = z.s(Cn, "Pythagorean", 13);
|
|
var Qn;
|
|
Cn.Circular = Qn = z.s(Cn, "Circular", 14);
|
|
|
|
function Cq() {
|
|
this.qp = -Infinity;
|
|
this.gq = this.Dn = null
|
|
}
|
|
Cq.prototype.compare = function(a, b) {
|
|
if (0 < a && 0 > this.qp || Math.abs(a) < Math.abs(this.qp) && !(0 > a && 0 < this.qp)) {
|
|
this.qp = a;
|
|
this.Dn = [];
|
|
this.gq = [];
|
|
for (var c = 0; c < b.length; c++) this.Dn[c] = b[c].vb.x, this.gq[c] = b[c].vb.y
|
|
}
|
|
};
|
|
Cq.prototype.commit = function(a) {
|
|
if (null !== this.Dn && null !== this.gq)
|
|
for (var b = 0; b < this.Dn.length; b++) {
|
|
var c = a.ea(b);
|
|
c.x = this.Dn[b];
|
|
c.y = this.gq[b]
|
|
}
|
|
};
|
|
|
|
function Dq() {
|
|
wa.call(this)
|
|
}
|
|
z.Qa(Dq, wa);
|
|
z.ia("CircularNetwork", Dq);
|
|
Dq.prototype.createVertex = function() {
|
|
return new Eq
|
|
};
|
|
Dq.prototype.createEdge = function() {
|
|
return new Rq
|
|
};
|
|
|
|
function Eq() {
|
|
xa.call(this);
|
|
this.actualAngle = this.diameter = NaN
|
|
}
|
|
z.Qa(Eq, xa);
|
|
z.ia("CircularVertex", Eq);
|
|
|
|
function Fq(a, b) {
|
|
var c = a.network;
|
|
if (null === c) return NaN;
|
|
c = c.Sb;
|
|
if (null === c) return NaN;
|
|
if (c.Xf === Pn)
|
|
if (c.tx === Qn) 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.tx === Qn ? Math.max(a.width, a.height) : Math.sqrt(a.width * a.width + a.height * a.height);
|
|
return a.diameter
|
|
}
|
|
|
|
function Rq() {
|
|
ya.call(this)
|
|
}
|
|
z.Qa(Rq, ya);
|
|
z.ia("CircularEdge", Rq);
|
|
|
|
function Sq() {
|
|
0 < arguments.length && z.od(Sq);
|
|
vg.call(this);
|
|
this.Dg = null;
|
|
this.wr = 0;
|
|
this.lg = (new Ea(100, 100)).freeze();
|
|
this.qq = !1;
|
|
this.Zh = !0;
|
|
this.Ih = !1;
|
|
this.Co = 100;
|
|
this.Xq = 1;
|
|
this.Qh = 1E3;
|
|
this.ks = Math;
|
|
this.Yn = .05;
|
|
this.Xn = 50;
|
|
this.Un = 150;
|
|
this.Wn = 0;
|
|
this.Nq = 10;
|
|
this.Mq = 5
|
|
}
|
|
z.Qa(Sq, vg);
|
|
z.ia("ForceDirectedLayout", Sq);
|
|
Sq.prototype.cloneProtected = function(a) {
|
|
vg.prototype.cloneProtected.call(this, a);
|
|
a.lg.assign(this.lg);
|
|
a.qq = this.qq;
|
|
a.Zh = this.Zh;
|
|
a.Ih = this.Ih;
|
|
a.Co = this.Co;
|
|
a.Xq = this.Xq;
|
|
a.Qh = this.Qh;
|
|
a.ks = this.ks;
|
|
a.Yn = this.Yn;
|
|
a.Xn = this.Xn;
|
|
a.Un = this.Un;
|
|
a.Wn = this.Wn;
|
|
a.Nq = this.Nq;
|
|
a.Mq = this.Mq
|
|
};
|
|
Sq.prototype.createNetwork = function() {
|
|
return new Tq
|
|
};
|
|
Sq.prototype.doLayout = function(a) {
|
|
null === a && z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
|
|
null === this.network && (this.network = this.makeNetwork(a));
|
|
a = this.pA;
|
|
if (0 < this.network.vertexes.count) {
|
|
this.network.Sw();
|
|
for (var b = this.network.vertexes.i; b.next();) {
|
|
var c = b.value;
|
|
c.charge = this.electricalCharge(c);
|
|
c.mass = this.gravitationalMass(c)
|
|
}
|
|
for (b = this.network.edges.i; b.next();) c = b.value, c.stiffness = this.springStiffness(c), c.length = this.springLength(c);
|
|
this.Bz();
|
|
this.wr = 0;
|
|
if (this.needsClusterLayout()) {
|
|
b = this.network;
|
|
for (c = b.pJ().i; c.next();) {
|
|
this.network = c.value;
|
|
for (var d = this.network.vertexes.i; d.next();) {
|
|
var e = d.value;
|
|
e.hg = e.vertexes.count;
|
|
e.uk = 1;
|
|
e.Xm = null;
|
|
e.Dh = null
|
|
}
|
|
Uq(this, 0, a)
|
|
}
|
|
this.network = b;
|
|
c.reset();
|
|
u && z.l(b, Tq, Sq, "arrangeConnectedGraphs:singletons");
|
|
for (var d = this.KD, g = c.count, h = !0, k = e = 0, l = z.rb(), m = 0; m < g + b.vertexes.count + 2; m++) l[m] = null;
|
|
g = 0;
|
|
c.reset();
|
|
for (var n = z.kg(); c.next();)
|
|
if (m = c.value, this.rh(m, n), h) h = !1, e = n.x + n.width / 2, k = n.y + n.height /
|
|
2, l[0] = new N(n.x + n.width + d.width, n.y), l[1] = new N(n.x, n.y + n.height + d.height), g = 2;
|
|
else {
|
|
var p = Vq(l, g, e, k, n.width, n.height, d),
|
|
q = l[p],
|
|
r = new N(q.x + n.width + d.width, q.y),
|
|
s = new N(q.x, q.y + n.height + d.height);
|
|
p + 1 < g && l.splice(p + 1, 0, null);
|
|
l[p] = r;
|
|
l[p + 1] = s;
|
|
g++;
|
|
p = q.x - n.x;
|
|
q = q.y - n.y;
|
|
for (m = m.vertexes.i; m.next();) r = m.value, r.ra += p, r.za += q
|
|
}
|
|
z.dc(n);
|
|
for (m = b.vertexes.i; m.next();) h = m.value, n = h.vb, 2 > g ? (e = n.x + n.width / 2, k = n.y + n.height / 2, l[0] = new N(n.x + n.width + d.width, n.y), l[1] = new N(n.x, n.y + n.height + d.height), g = 2) : (p = Vq(l, g,
|
|
e, k, n.width, n.height, d), q = l[p], r = new N(q.x + n.width + d.width, q.y), s = new N(q.x, q.y + n.height + d.height), p + 1 < g && l.splice(p + 1, 0, null), l[p] = r, l[p + 1] = s, g++, h.ra = q.x + h.width / 2, h.za = q.y + h.height / 2);
|
|
z.xa(l);
|
|
for (c.reset(); c.next();) {
|
|
d = c.value;
|
|
for (e = d.vertexes.i; e.next();) b.tl(e.value);
|
|
for (d = d.edges.i; d.next();) b.$o(d.value)
|
|
}
|
|
}
|
|
Wq(this, a);
|
|
this.updateParts()
|
|
}
|
|
this.Co = a;
|
|
this.network = null;
|
|
this.Gf = !0
|
|
};
|
|
Sq.prototype.needsClusterLayout = function() {
|
|
if (3 > this.network.vertexes.count) return !1;
|
|
for (var a = 0, b = 0, c = this.network.vertexes.first().vb, d = this.network.vertexes.i; d.next();) {
|
|
if (d.value.vb.Ig(c) && (a++, 2 < a)) return !0;
|
|
if (10 < b) break;
|
|
b++
|
|
}
|
|
return !1
|
|
};
|
|
Sq.prototype.rh = function(a, b) {
|
|
for (var c = !0, d = a.vertexes.i; d.next();) {
|
|
var e = d.value;
|
|
c ? (c = !1, b.set(e.vb)) : b.qi(e.vb)
|
|
}
|
|
return b
|
|
};
|
|
|
|
function fr(a, b, c) {
|
|
u && (z.p(b, Sq, "computeClusterLayoutIterations:level"), z.p(c, Sq, "computeClusterLayoutIterations:maxiter"));
|
|
return Math.max(Math.min(a.network.vertexes.count, c * (b + 1) / 11), 10)
|
|
}
|
|
|
|
function Uq(a, b, c) {
|
|
u && (z.p(b, Sq, "layoutClusters:level"), z.p(c, Sq, "layoutClusters:maxiter"));
|
|
if (lr(a, b)) {
|
|
var d = a.Qh;
|
|
a.Qh *= 1 + 1 / (b + 1);
|
|
var e = mr(a, b),
|
|
g = Math.max(0, fr(a, b, c));
|
|
a.pA += g;
|
|
Uq(a, b + 1, c);
|
|
Wq(a, g);
|
|
nr(a, e, b);
|
|
c = a.Dg;
|
|
null === c ? c = new J(or) : c.clear();
|
|
c.$c(e.vertexes);
|
|
c.sort(function(a, b) {
|
|
return null === a || null === b || a === b ? 0 : b.hg - a.hg
|
|
});
|
|
for (e = c.i; e.next();) pr(a, e.value, b);
|
|
a.Qh = d
|
|
}
|
|
}
|
|
|
|
function lr(a, b) {
|
|
u && z.p(b, Sq, "hasClusters:level");
|
|
if (10 < b || 3 > a.network.vertexes.count) return !1;
|
|
null === a.Dg ? a.Dg = new J(or) : a.Dg.clear();
|
|
a.Dg.$c(a.network.vertexes);
|
|
var c = a.Dg;
|
|
c.sort(function(a, b) {
|
|
return null === a || null === b || a === b ? 0 : b.hg - a.hg
|
|
});
|
|
for (var d = c.count - 1; 0 <= d && 1 >= c.ea(d).hg;) d--;
|
|
return 1 < c.count - d
|
|
}
|
|
|
|
function mr(a, b) {
|
|
u && z.p(b, Sq, "pushSubNetwork:level");
|
|
for (var c = a.network, d = new Tq, e = a.Dg.i; e.next();) {
|
|
var g = e.value;
|
|
if (1 < g.hg) {
|
|
d.tl(g);
|
|
var h = new qr;
|
|
h.Wx = g.hg;
|
|
h.Xx = g.width;
|
|
h.Vx = g.height;
|
|
h.jB = g.R.x;
|
|
h.kB = g.R.y;
|
|
null === g.Dh && (g.Dh = new J(qr));
|
|
g.Dh.add(h);
|
|
g.LA = g.Dh.count - 1
|
|
} else break
|
|
}
|
|
for (var k = c.edges.i; k.next();)
|
|
if (e = k.value, e.fromVertex.network === d && e.toVertex.network === d) d.$o(e);
|
|
else if (e.fromVertex.network === d) {
|
|
var l = e.fromVertex.Xm;
|
|
null === l && (l = new J(or), e.fromVertex.Xm = l);
|
|
l.add(e.toVertex);
|
|
e.fromVertex.hg--;
|
|
e.fromVertex.uk += e.toVertex.uk
|
|
} else e.toVertex.network === d && (l = e.toVertex.Xm, null === l && (l = new J(or), e.toVertex.Xm = l), l.add(e.fromVertex), e.toVertex.hg--, e.toVertex.uk += e.fromVertex.uk);
|
|
for (e = d.edges.i; e.next();) g = e.value, g.length *= Math.max(1, se((g.fromVertex.uk + g.toVertex.uk) / (4 * b + 1)));
|
|
for (e = d.vertexes.i; e.next();)
|
|
if (g = e.value, l = g.Xm, null !== l && 0 < l.count && (h = g.Dh.ea(g.Dh.count - 1), h = h.Wx - g.hg, !(0 >= h))) {
|
|
for (var m = 0, n = 0, p = l.count - h; p < l.count; p++) {
|
|
for (var q = l.ea(p), r = null, k = q.edges.i; k.next();) {
|
|
var s =
|
|
k.value;
|
|
if (s.NH(q) === g) {
|
|
r = s;
|
|
break
|
|
}
|
|
}
|
|
null !== r && (n += r.length, m += q.width * q.height)
|
|
}
|
|
l = g.ra;
|
|
k = g.za;
|
|
p = g.width;
|
|
q = g.height;
|
|
r = g.R;
|
|
s = p * q;
|
|
1 > s && (s = 1);
|
|
m = se((m + s + n * n * 4 / (h * h)) / s);
|
|
h = (m - 1) * p / 2;
|
|
m = (m - 1) * q / 2;
|
|
g.vb = new w(l - r.x - h, k - r.y - m, p + 2 * h, q + 2 * m);
|
|
g.focus = new N(r.x + h, r.y + m)
|
|
}
|
|
a.network = d;
|
|
return c
|
|
}
|
|
|
|
function nr(a, b, c) {
|
|
u && (z.l(b, Tq, Sq, "popNetwork:oldnet"), z.p(c, Sq, "popNetwork:level"));
|
|
for (c = a.network.vertexes.i; c.next();) {
|
|
var d = c.value;
|
|
d.network = b;
|
|
if (null !== d.Dh) {
|
|
var e = d.Dh.ea(d.LA);
|
|
d.hg = e.Wx;
|
|
var g = e.jB,
|
|
h = e.kB;
|
|
d.vb = new w(d.ra - g, d.za - h, e.Xx, e.Vx);
|
|
d.focus = new N(g, h);
|
|
d.LA--
|
|
}
|
|
}
|
|
for (c = a.network.edges.i; c.next();) c.value.network = b;
|
|
a.network = b
|
|
}
|
|
|
|
function pr(a, b, c) {
|
|
u && (z.l(b, or, Sq, "surroundNode:oldnet"), z.p(c, Sq, "surroundNode:level"));
|
|
var d = b.Xm;
|
|
if (null !== d && 0 !== d.count) {
|
|
c = b.ra;
|
|
var e = b.za,
|
|
g = b.width,
|
|
h = b.height;
|
|
null !== b.Dh && 0 < b.Dh.count && (h = b.Dh.ea(0), g = h.Xx, h = h.Vx);
|
|
for (var g = se(g * g + h * h) / 2, k = !1, l = h = 0, m = 0, n = b.vertexes.i; n.next();) {
|
|
var p = n.value;
|
|
1 >= p.hg ? l++ : (k = !0, m++, h += Math.atan2(b.za - p.za, b.ra - p.ra))
|
|
}
|
|
if (0 !== l)
|
|
for (0 < m && (h /= m), m = b = 0, b = k ? 2 * Math.PI / (l + 1) : 2 * Math.PI / l, 0 === l % 2 && (m = b / 2), 1 < d.count && d.sort(function(a, b) {
|
|
return null === a || null === b || a ===
|
|
b ? 0 : b.width * b.height - a.width * a.height
|
|
}), k = 0 === l % 2 ? 0 : 1, d = d.i; d.next();)
|
|
if (l = d.value, !(1 < l.hg || a.isFixed(l))) {
|
|
n = null;
|
|
for (p = l.edges.i; p.next();) {
|
|
n = p.value;
|
|
break
|
|
}
|
|
var p = l.width,
|
|
q = l.height,
|
|
p = se(p * p + q * q) / 2,
|
|
n = g + n.length + p,
|
|
p = h + (b * (k / 2 >> 1) + m) * (0 === k % 2 ? 1 : -1);
|
|
l.ra = c + n * Math.cos(p);
|
|
l.za = e + n * Math.sin(p);
|
|
k++
|
|
}
|
|
}
|
|
}
|
|
|
|
function Vq(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
|
|
}
|
|
Sq.prototype.Bz = function() {
|
|
if (this.comments)
|
|
for (var a = this.network.vertexes.i; a.next();) this.addComments(a.value)
|
|
};
|
|
Sq.prototype.addComments = function(a) {
|
|
var b = a.Pc;
|
|
if (null !== b)
|
|
for (b = b.rE(); b.next();) {
|
|
var c = b.value;
|
|
if ("Comment" === c.nc && c.isVisible()) {
|
|
var d = this.network.en(c);
|
|
null === d && (d = this.network.ht(c));
|
|
d.charge = this.nH;
|
|
for (var c = null, e = d.pc; e.next();) {
|
|
var g = e.value;
|
|
if (g.toVertex === a) {
|
|
c = g;
|
|
break
|
|
}
|
|
}
|
|
if (null === c)
|
|
for (e = d.tc; e.next();)
|
|
if (g = e.value, g.fromVertex === a) {
|
|
c = g;
|
|
break
|
|
}
|
|
null === c && (c = this.network.Hp(a, d, null));
|
|
c.length = this.oH
|
|
}
|
|
}
|
|
};
|
|
|
|
function rr(a, b) {
|
|
u && (z.l(a, or, Sq, "getNodeDistance:vertexA"), z.l(b, or, Sq, "getNodeDistance:vertexB"));
|
|
var c = a.P,
|
|
d = c.x,
|
|
e = c.y,
|
|
g = c.width,
|
|
c = c.height,
|
|
h = b.P,
|
|
k = h.x,
|
|
l = h.y,
|
|
m = h.width,
|
|
h = h.height;
|
|
return d + g < k ? e > l + h ? (d = d + g - k, e = e - l - h, se(d * d + e * e)) : e + c < l ? (d = d + g - k, e = e + c - l, se(d * d + e * e)) : k - (d + g) : d > k + m ? e > l + h ? (d = d - k - m, e = e - l - h, se(d * d + e * e)) : e + c < l ? (d = d - k - m, e = e + c - l, se(d * d + e * e)) : d - (k + m) : e > l + h ? e - (l + h) : e + c < l ? l - (e + c) : .1
|
|
}
|
|
|
|
function Wq(a, b) {
|
|
u && z.p(b, Sq, "performIterations:num");
|
|
a.Dg = null;
|
|
for (var c = a.wr + b; a.wr < c && (a.wr++, sr(a)););
|
|
a.Dg = null
|
|
}
|
|
|
|
function sr(a) {
|
|
null === a.Dg && (a.Dg = new J(or), a.Dg.$c(a.network.vertexes));
|
|
var b = a.Dg.o;
|
|
if (0 >= b.length) return !1;
|
|
var c = b[0];
|
|
c.forceX = 0;
|
|
c.forceY = 0;
|
|
for (var d = c.ra, e = d, g = c.za, h = g, c = 1; c < b.length; c++) {
|
|
var k = b[c];
|
|
k.forceX = 0;
|
|
k.forceY = 0;
|
|
var l = k.ra,
|
|
k = k.za,
|
|
d = Math.min(d, l),
|
|
e = Math.max(e, l),
|
|
g = Math.min(g, k),
|
|
h = Math.max(h, k)
|
|
}(g = e - d > h - g) ? b.sort(function(a, b) {
|
|
return null === a || null === b || a === b ? 0 : a.ra - b.ra
|
|
}): b.sort(function(a, b) {
|
|
return null === a || null === b || a === b ? 0 : a.za - b.za
|
|
});
|
|
for (var h = a.Qh, m = 0, n = 0, p = 0, c = 0; c < b.length; c++) {
|
|
var k =
|
|
b[c],
|
|
l = k.P,
|
|
q = k.R,
|
|
d = l.x + q.x,
|
|
l = l.y + q.y,
|
|
n = k.charge * a.electricalFieldX(d, l),
|
|
p = k.charge * a.electricalFieldY(d, l),
|
|
n = n + k.mass * a.gravitationalFieldX(d, l),
|
|
p = p + k.mass * a.gravitationalFieldY(d, l);
|
|
k.forceX += n;
|
|
k.forceY += p;
|
|
for (q = c + 1; q < b.length; q++)
|
|
if (e = b[q], e !== k) {
|
|
var r = e.P,
|
|
n = e.R,
|
|
p = r.x + n.x,
|
|
r = r.y + n.y;
|
|
if (d - p > h || p - d > h) {
|
|
if (g) break
|
|
} else if (l - r > h || r - l > h) {
|
|
if (!g) break
|
|
} else {
|
|
var s = rr(k, e);
|
|
1 > s ? (n = a.Bx, null === n && (a.Bx = n = new Ka(0)), m = n.random(), s = n.random(), d > p ? (n = Math.abs(e.P.right - k.P.x), n = (1 + n) * m) : d < p ? (n = Math.abs(e.P.x - k.P.right),
|
|
n = -(1 + n) * m) : (n = Math.max(e.width, k.width), n = (1 + n) * m - n / 2), l > r ? (p = Math.abs(e.P.bottom - k.P.y), p = (1 + p) * s) : d < p ? (p = Math.abs(e.P.y - k.P.bottom), p = -(1 + p) * s) : (p = Math.max(e.height, k.height), p = (1 + p) * s - p / 2)) : (m = -(k.charge * e.charge) / (s * s), n = (p - d) / s * m, p = (r - l) / s * m);
|
|
k.forceX += n;
|
|
k.forceY += p;
|
|
e.forceX -= n;
|
|
e.forceY -= p
|
|
}
|
|
}
|
|
}
|
|
for (c = a.network.edges.i; c.next();) g = c.value, k = g.fromVertex, e = g.toVertex, l = k.P, q = k.R, d = l.x + q.x, l = l.y + q.y, r = e.P, n = e.R, p = r.x + n.x, r = r.y + n.y, s = rr(k, e), 1 > s ? (n = a.Bx, null === n && (a.Bx = n = new Ka(0)), m = n.random(), s =
|
|
n.random(), n = (d > p ? 1 : -1) * (1 + (e.width > k.width) ? e.width : k.width) * m, p = (l > r ? 1 : -1) * (1 + (e.height > k.height) ? e.height : k.height) * s) : (m = g.stiffness * (s - g.length), n = (p - d) / s * m, p = (r - l) / s * m), k.forceX += n, k.forceY += p, e.forceX -= n, e.forceY -= p;
|
|
c = 0;
|
|
d = Math.max(a.Qh / 20, 50);
|
|
for (e = 0; e < b.length; e++) k = b[e], a.isFixed(k) ? a.moveFixedVertex(k) : (g = k.forceX, h = k.forceY, g < -d ? g = -d : g > d && (g = d), h < -d ? h = -d : h > d && (h = d), k.ra += g, k.za += h, c = Math.max(c, g * g + h * h));
|
|
return c > a.oE * a.oE
|
|
}
|
|
Sq.prototype.moveFixedVertex = function() {};
|
|
Sq.prototype.commitLayout = function() {
|
|
this.QA();
|
|
this.commitNodes();
|
|
this.Rt && this.commitLinks()
|
|
};
|
|
Sq.prototype.QA = function() {
|
|
if (this.aq)
|
|
for (var a = this.network.edges.i; a.next();) {
|
|
var b = a.value.link;
|
|
null !== b && (b.Db = Pc, b.Eb = Pc)
|
|
}
|
|
};
|
|
Sq.prototype.commitNodes = function() {
|
|
var a = 0,
|
|
b = 0;
|
|
if (this.UG) {
|
|
var c = z.kg();
|
|
this.rh(this.network, c);
|
|
b = this.je;
|
|
a = b.x - c.x;
|
|
b = b.y - c.y;
|
|
z.dc(c)
|
|
}
|
|
for (var c = z.kg(), d = this.network.vertexes.i; d.next();) {
|
|
var e = d.value;
|
|
if (0 !== a || 0 !== b) c.assign(e.vb), c.x += a, c.y += b, e.vb = c;
|
|
e.commit()
|
|
}
|
|
z.dc(c)
|
|
};
|
|
Sq.prototype.commitLinks = function() {
|
|
for (var a = this.network.edges.i; a.next();) a.value.commit()
|
|
};
|
|
Sq.prototype.springStiffness = function(a) {
|
|
a = a.stiffness;
|
|
return isNaN(a) ? this.Yn : a
|
|
};
|
|
Sq.prototype.springLength = function(a) {
|
|
a = a.length;
|
|
return isNaN(a) ? this.Xn : a
|
|
};
|
|
Sq.prototype.electricalCharge = function(a) {
|
|
a = a.charge;
|
|
return isNaN(a) ? this.Un : a
|
|
};
|
|
Sq.prototype.electricalFieldX = function() {
|
|
return 0
|
|
};
|
|
Sq.prototype.electricalFieldY = function() {
|
|
return 0
|
|
};
|
|
Sq.prototype.gravitationalMass = function(a) {
|
|
a = a.mass;
|
|
return isNaN(a) ? this.Wn : a
|
|
};
|
|
Sq.prototype.gravitationalFieldX = function() {
|
|
return 0
|
|
};
|
|
Sq.prototype.gravitationalFieldY = function() {
|
|
return 0
|
|
};
|
|
Sq.prototype.isFixed = function(a) {
|
|
return a.isFixed
|
|
};
|
|
z.w(Sq, {
|
|
gK: "currentIteration"
|
|
}, function() {
|
|
return this.wr
|
|
});
|
|
z.defineProperty(Sq, {
|
|
KD: "arrangementSpacing"
|
|
}, function() {
|
|
return this.lg
|
|
}, function(a) {
|
|
z.l(a, Ea, Sq, "arrangementSpacing");
|
|
this.lg.N(a) || (this.lg.assign(a), this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
UG: "arrangesToOrigin"
|
|
}, function() {
|
|
return this.qq
|
|
}, function(a) {
|
|
this.qq !== a && (z.g(a, "boolean", Sq, "arrangesToOrigin"), this.qq = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
aq: "setsPortSpots"
|
|
}, function() {
|
|
return this.Zh
|
|
}, function(a) {
|
|
this.Zh !== a && (z.g(a, "boolean", Sq, "setsPortSpots"), this.Zh = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
comments: "comments"
|
|
}, function() {
|
|
return this.Ih
|
|
}, function(a) {
|
|
this.Ih !== a && (z.g(a, "boolean", Sq, "comments"), this.Ih = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
pA: "maxIterations"
|
|
}, function() {
|
|
return this.Co
|
|
}, function(a) {
|
|
this.Co !== a && (z.g(a, "number", Sq, "maxIterations"), 0 <= a && (this.Co = a, this.I()))
|
|
});
|
|
z.defineProperty(Sq, {
|
|
oE: "epsilonDistance"
|
|
}, function() {
|
|
return this.Xq
|
|
}, function(a) {
|
|
this.Xq !== a && (z.g(a, "number", Sq, "epsilonDistance"), 0 < a && (this.Xq = a, this.I()))
|
|
});
|
|
z.defineProperty(Sq, {
|
|
CK: "infinityDistance"
|
|
}, function() {
|
|
return this.Qh
|
|
}, function(a) {
|
|
this.Qh !== a && (z.g(a, "number", Sq, "infinityDistance"), 1 < a && (this.Qh = a, this.I()))
|
|
});
|
|
z.defineProperty(Sq, {
|
|
Bx: "randomNumberGenerator"
|
|
}, function() {
|
|
return this.ks
|
|
}, function(a) {
|
|
this.ks !== a && (null !== a && "function" !== typeof a.random && z.k('ForceDirectedLayout.randomNumberGenerator must have a "random()" function on it: ' + a), this.ks = a)
|
|
});
|
|
z.defineProperty(Sq, {
|
|
sK: "defaultSpringStiffness"
|
|
}, function() {
|
|
return this.Yn
|
|
}, function(a) {
|
|
this.Yn !== a && (z.g(a, "number", Sq, "defaultSpringStiffness"), this.Yn = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
rK: "defaultSpringLength"
|
|
}, function() {
|
|
return this.Xn
|
|
}, function(a) {
|
|
this.Xn !== a && (z.g(a, "number", Sq, "defaultSpringLength"), this.Xn = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
lK: "defaultElectricalCharge"
|
|
}, function() {
|
|
return this.Un
|
|
}, function(a) {
|
|
this.Un !== a && (z.g(a, "number", Sq, "defaultElectricalCharge"), this.Un = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
mK: "defaultGravitationalMass"
|
|
}, function() {
|
|
return this.Wn
|
|
}, function(a) {
|
|
this.Wn !== a && (z.g(a, "number", Sq, "defaultGravitationalMass"), this.Wn = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
oH: "defaultCommentSpringLength"
|
|
}, function() {
|
|
return this.Nq
|
|
}, function(a) {
|
|
this.Nq !== a && (z.g(a, "number", Sq, "defaultCommentSpringLength"), this.Nq = a, this.I())
|
|
});
|
|
z.defineProperty(Sq, {
|
|
nH: "defaultCommentElectricalCharge"
|
|
}, function() {
|
|
return this.Mq
|
|
}, function(a) {
|
|
this.Mq !== a && (z.g(a, "number", Sq, "defaultCommentElectricalCharge"), this.Mq = a, this.I())
|
|
});
|
|
|
|
function qr() {
|
|
this.kB = this.jB = this.Vx = this.Xx = this.Wx = 0
|
|
}
|
|
|
|
function Tq() {
|
|
wa.call(this)
|
|
}
|
|
z.Qa(Tq, wa);
|
|
z.ia("ForceDirectedNetwork", Tq);
|
|
Tq.prototype.createVertex = function() {
|
|
return new or
|
|
};
|
|
Tq.prototype.createEdge = function() {
|
|
return new tr
|
|
};
|
|
|
|
function or() {
|
|
xa.call(this);
|
|
this.isFixed = !1;
|
|
this.mass = this.charge = NaN;
|
|
this.uk = this.hg = this.forceY = this.forceX = 0;
|
|
this.Dh = this.Xm = null;
|
|
this.LA = 0
|
|
}
|
|
z.Qa(or, xa);
|
|
z.ia("ForceDirectedVertex", or);
|
|
|
|
function tr() {
|
|
ya.call(this);
|
|
this.length = this.stiffness = NaN
|
|
}
|
|
z.Qa(tr, ya);
|
|
z.ia("ForceDirectedEdge", tr);
|
|
|
|
function on() {
|
|
0 < arguments.length && z.od(on);
|
|
vg.call(this);
|
|
this.Td = this.qm = 25;
|
|
this.fa = 0;
|
|
this.Tn = ur;
|
|
this.yo = vr;
|
|
this.oo = wr;
|
|
this.om = 4;
|
|
this.Gn = xr;
|
|
this.Ri = yr;
|
|
this.Zh = !0;
|
|
this.Br = 4;
|
|
this.Kb = this.Iv = this.yb = -1;
|
|
this.Rf = this.Lr = 0;
|
|
this.Rb = this.Pf = this.Qf = this.tg = this.ge = null;
|
|
this.Ur = 0;
|
|
this.Tr = this.vm = null;
|
|
this.vg = 0;
|
|
this.Vr = null;
|
|
this.hh = [];
|
|
this.hh.length = 100
|
|
}
|
|
z.Qa(on, vg);
|
|
z.ia("LayeredDigraphLayout", on);
|
|
on.prototype.cloneProtected = function(a) {
|
|
vg.prototype.cloneProtected.call(this, a);
|
|
a.qm = this.qm;
|
|
a.Td = this.Td;
|
|
a.fa = this.fa;
|
|
a.Tn = this.Tn;
|
|
a.yo = this.yo;
|
|
a.oo = this.oo;
|
|
a.om = this.om;
|
|
a.Gn = this.Gn;
|
|
a.Ri = this.Ri;
|
|
a.Zh = this.Zh;
|
|
a.Br = this.Br
|
|
};
|
|
on.prototype.createNetwork = function() {
|
|
return new zr
|
|
};
|
|
on.prototype.doLayout = function(a) {
|
|
null === a && z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
|
|
null === this.network && (this.network = this.makeNetwork(a));
|
|
this.je = this.initialOrigin(this.je);
|
|
this.Iv = -1;
|
|
this.Rf = this.Lr = 0;
|
|
this.Vr = this.Tr = this.vm = null;
|
|
for (a = 0; a < this.hh.length; a++) this.hh[a] = null;
|
|
if (0 < this.network.vertexes.count) {
|
|
this.network.Sw();
|
|
for (a = this.network.edges.i; a.next();) a.value.rev = !1;
|
|
switch (this.Tn) {
|
|
default:
|
|
case Ar:
|
|
var b = 0,
|
|
c = this.network.vertexes.count -
|
|
1;a = [];a.length = c + 1;
|
|
for (var d = this.network.vertexes.i; d.next();) d.value.valid = !0;
|
|
for (; null !== Br(this.network);) {
|
|
for (d = Cr(this.network); null !== d;) a[c] = d, c--, d.valid = !1, d = Cr(this.network);
|
|
for (d = Dr(this.network); null !== d;) a[b] = d, b++, d.valid = !1, d = Dr(this.network);
|
|
for (var d = null, e = 0, g = this.network.vertexes.i; g.next();) {
|
|
var h = g.value;
|
|
if (h.valid) {
|
|
for (var k = 0, l = h.pc; l.next();) l.value.toVertex.valid && k++;
|
|
for (var l = 0, m = h.tc; m.next();) m.value.fromVertex.valid && l++;
|
|
if (null === d || e < k - l) d = h, e = k - l
|
|
}
|
|
}
|
|
null !== d && (a[b] =
|
|
d, b++, d.valid = !1)
|
|
}
|
|
for (b = 0; b < this.network.vertexes.count; b++) a[b].index = b;
|
|
for (a = this.network.edges.i; a.next();) b = a.value,
|
|
b.fromVertex.index > b.toVertex.index && (this.network.Fx(b), b.rev = !0);
|
|
break;
|
|
case ur:
|
|
for (b = this.network.vertexes.i; b.next();) a = b.value, a.jp = -1, a.finish = -1;
|
|
for (a = this.network.edges.i; a.next();) a.value.forest = !1;this.Ur = 0;
|
|
for (b.reset(); b.next();) c = b.value,
|
|
0 === c.tc.count && Er(this, c);
|
|
for (b.reset(); b.next();) c = b.value,
|
|
-1 === c.jp && Er(this, c);
|
|
for (a.reset(); a.next();) b = a.value,
|
|
b.forest || (c = b.fromVertex,
|
|
d = c.finish, e = b.toVertex, g = e.finish, e.jp < c.jp && d < g && (this.network.Fx(b), b.rev = !0))
|
|
}
|
|
for (a = this.network.vertexes.i; a.next();) a.value.layer = -1;
|
|
this.yb = -1;
|
|
this.assignLayers();
|
|
for (a.reset(); a.next();) this.yb = Math.max(this.yb, a.value.layer);
|
|
a = [];
|
|
for (c = this.network.edges.i; c.next();) b = c.value, b.valid = !1, a.push(b);
|
|
for (c = 0; c < a.length; c++)
|
|
if (b = a[c], !b.valid && (null !== b.fromVertex.Bd && null !== b.toVertex.Bd || b.fromVertex.layer !== b.toVertex.layer)) {
|
|
l = h = k = g = 0;
|
|
e = b.fromVertex;
|
|
d = b.toVertex;
|
|
if (null !== b.link) {
|
|
k = b.link;
|
|
if (null === k) continue;
|
|
var n = e.Bd,
|
|
g = d.Bd;
|
|
if (null === n || null === g) continue;
|
|
var p = k.Y,
|
|
h = k.da,
|
|
q = k.md,
|
|
l = k.Qd;
|
|
b.rev && (k = p, m = q, p = h, q = l, h = k, l = m);
|
|
var r = e.R,
|
|
k = b.toVertex.R,
|
|
s = b.rev ? d.P : e.P,
|
|
m = z.O();
|
|
s.F() ? (lp(p, q, ec, m), m.F() || m.assign(r)) : m.assign(r);
|
|
n !== p && s.F() && p.isVisible() && (n = e.P, n.F() && (m.x += s.x - n.x, m.y += s.y - n.y));
|
|
p = b.rev ? e.P : d.P;
|
|
n = z.O();
|
|
p.F() ? (lp(h, l, ec, n), n.F() || n.assign(k)) : n.assign(k);
|
|
g !== h && p.F() && h.isVisible() && (g = d.P, g.F() && (n.x += p.x - g.x, n.y += p.y - g.y));
|
|
90 === this.fa || 270 === this.fa ? (g = Math.round((m.x -
|
|
r.x) / this.Td), h = m.x, k = Math.round((n.x - k.x) / this.Td), l = n.x) : (g = Math.round((m.y - r.y) / this.Td), h = m.y, k = Math.round((n.y - k.y) / this.Td), l = n.y);
|
|
z.A(m);
|
|
z.A(n);
|
|
b.portFromColOffset = g;
|
|
b.portFromPos = h;
|
|
b.portToColOffset = k;
|
|
b.portToPos = l
|
|
} else b.portFromColOffset = 0, b.portFromPos = 0, b.portToColOffset = 0, b.portToPos = 0;
|
|
m = e.layer;
|
|
r = d.layer;
|
|
a: if (n = b, p = 0, s = n.link, null !== s) {
|
|
var t = s.md,
|
|
v = s.Qd;
|
|
if (null !== t && null !== v) {
|
|
var x = s.Y,
|
|
q = s.da;
|
|
if (null !== x && null !== q) {
|
|
var y = t.Db,
|
|
A = v.Eb;
|
|
this.aq || (s.Db.bd() || (y = s.Db), s.Eb.bd() || (A = s.Eb));
|
|
var B = s.rc,
|
|
L = Fr(this, !0);
|
|
if (y.bd() || y === Yb) y = L;
|
|
var H = Fr(this, !1);
|
|
if (A.bd() || A === Yb) A = H;
|
|
if (y.kj() && y.vp(H) && A.kj() && A.vp(L)) {
|
|
p = 0;
|
|
break a
|
|
}
|
|
L = s.getLinkPoint(x, t, y, !0, B, q, v, z.O());
|
|
y = s.getLinkDirection(x, t, L, y, !0, B, q, v);
|
|
z.A(L);
|
|
y === Gr(this, n, !0) ? p += 1 : this.aq && null !== x && 1 === x.ports.count && n.rev && (p += 1);
|
|
y = s.getLinkPoint(q, v, A, !1, B, x, t, z.O());
|
|
s = s.getLinkDirection(q, v, y, A, !1, B, x, t);
|
|
z.A(y);
|
|
s === Gr(this, n, !1) ? p += 2 : this.aq && null !== q && 1 === q.ports.count && n.rev && (p += 2)
|
|
}
|
|
}
|
|
}
|
|
n = 1 === p || 3 === p ? !0 : !1;
|
|
if (p = 2 === p || 3 === p ? !0 : !1) q =
|
|
this.network.createVertex(), q.Bd = null, q.Um = 1, q.layer = m, q.near = e, this.network.tl(q), e = this.network.Hp(e, q, b.link), e.valid = !1, e.rev = b.rev, e.portFromColOffset = g, e.portToColOffset = 0, e.portFromPos = h, e.portToPos = 0, e = q;
|
|
s = 1;
|
|
n && s--;
|
|
if (m - r > s && 0 < m) {
|
|
b.valid = !1;
|
|
q = this.network.createVertex();
|
|
q.Bd = null;
|
|
q.Um = 2;
|
|
q.layer = m - 1;
|
|
this.network.tl(q);
|
|
e = this.network.Hp(e, q, b.link);
|
|
e.valid = !0;
|
|
e.rev = b.rev;
|
|
e.portFromColOffset = p ? 0 : g;
|
|
e.portToColOffset = 0;
|
|
e.portFromPos = p ? 0 : h;
|
|
e.portToPos = 0;
|
|
e = q;
|
|
for (m--; m - r > s && 0 < m;) q = this.network.createVertex(),
|
|
q.Bd = null, q.Um = 3, q.layer = m - 1, this.network.tl(q), e = this.network.Hp(e, q, b.link), e.valid = !0, e.rev = b.rev, e.portFromColOffset = 0, e.portToColOffset = 0, e.portFromPos = 0, e.portToPos = 0, e = q, m--;
|
|
e = this.network.Hp(q, d, b.link);
|
|
e.valid = !n;
|
|
n && (q.near = d);
|
|
e.rev = b.rev;
|
|
e.portFromColOffset = 0;
|
|
e.portToColOffset = k;
|
|
e.portFromPos = 0;
|
|
e.portToPos = l
|
|
} else b.valid = !0
|
|
}
|
|
b = this.ge = [];
|
|
for (c = 0; c <= this.yb; c++) b[c] = 0;
|
|
for (a = this.network.vertexes.i; a.next();) c = a.value, c.index = -1;
|
|
this.initializeIndices();
|
|
this.Iv = -1;
|
|
for (c = this.Rf = this.Lr = 0; c <=
|
|
this.yb; c++) b[c] > b[this.Rf] && (this.Iv = b[c] - 1, this.Rf = c), b[c] < b[this.Lr] && (this.Lr = c);
|
|
this.Vr = [];
|
|
for (c = 0; c < b.length; c++) this.Vr[c] = [];
|
|
for (a.reset(); a.next();) b = a.value, c = this.Vr[b.layer], c[b.index] = b;
|
|
this.Kb = -1;
|
|
for (a = 0; a <= this.yb; a++) {
|
|
b = Hr(this, a);
|
|
c = 0;
|
|
d = this.ge[a];
|
|
for (e = 0; e < d; e++) g = b[e], c += this.nodeMinColumnSpace(g, !0), g.column = c, c += 1, c += this.nodeMinColumnSpace(g, !1);
|
|
this.Kb = Math.max(this.Kb, c - 1);
|
|
Ir(this, a, b)
|
|
}
|
|
this.reduceCrossings();
|
|
this.straightenAndPack();
|
|
this.updateParts()
|
|
}
|
|
this.network = null;
|
|
this.Gf = !0
|
|
};
|
|
on.prototype.linkMinLength = function() {
|
|
return 1
|
|
};
|
|
|
|
function Jr(a) {
|
|
var b = a.fromVertex.Bd;
|
|
a = a.toVertex.Bd;
|
|
return null === b && null === a ? 8 : null === b || null === a ? 4 : 1
|
|
}
|
|
on.prototype.nodeMinLayerSpace = function(a, b) {
|
|
return null === a.Bd ? 0 : 90 === this.fa || 270 === this.fa ? b ? a.R.y + 10 : a.P.height - a.R.y + 10 : b ? a.R.x + 10 : a.P.width - a.R.x + 10
|
|
};
|
|
on.prototype.nodeMinColumnSpace = function(a, b) {
|
|
if (null === a.Bd) return 0;
|
|
var c = b ? a.yA : a.xA;
|
|
if (null !== c) return c;
|
|
c = this.fa;
|
|
return 90 === c || 270 === c ? b ? a.yA = a.R.x / this.Td + 1 | 0 : a.xA = (a.P.width - a.R.x) / this.Td + 1 | 0 : b ? a.yA = a.R.y / this.Td + 1 | 0 : a.xA = (a.P.height - a.R.y) / this.Td + 1 | 0
|
|
};
|
|
|
|
function Kr(a) {
|
|
null === a.vm && (a.vm = []);
|
|
for (var b = 0, c = a.network.vertexes.i; c.next();) {
|
|
var d = c.value;
|
|
a.vm[b] = d.layer;
|
|
b++;
|
|
a.vm[b] = d.column;
|
|
b++;
|
|
a.vm[b] = d.index;
|
|
b++
|
|
}
|
|
return a.vm
|
|
}
|
|
|
|
function Lr(a, b) {
|
|
for (var c = 0, d = a.network.vertexes.i; d.next();) {
|
|
var e = d.value;
|
|
e.layer = b[c];
|
|
c++;
|
|
e.column = b[c];
|
|
c++;
|
|
e.index = b[c];
|
|
c++
|
|
}
|
|
}
|
|
|
|
function Mr(a, b, c) {
|
|
u && (z.p(b, on, "crossingMatrix:unfixedLayer"), z.p(c, on, "crossingMatrix:direction"));
|
|
var d = Hr(a, b),
|
|
e = a.ge[b];
|
|
if (null === a.Tr || a.Tr.length < e * e) a.Tr = [];
|
|
for (var g = a.Tr, h = 0; h < e; h++) {
|
|
var k = 0,
|
|
l = d[h],
|
|
m = l.near,
|
|
n = 0;
|
|
if (null !== m && m.layer === l.layer)
|
|
if (n = m.index, n > h)
|
|
for (var p = h + 1; p < n; p++) l = d[p], l.near === m && l.Um === m.Um || k++;
|
|
else
|
|
for (p = h - 1; p > n; p--) l = d[p], l.near === m && l.Um === m.Um || k++;
|
|
var m = 0,
|
|
q, r = q = p = l = 0,
|
|
s, t = 0,
|
|
v = 0;
|
|
s = 0;
|
|
var x;
|
|
if (0 <= c)
|
|
for (n = d[h].Ze, m = 0; m < n.count; m++)
|
|
if (q = n.o[m], q.valid && q.fromVertex.layer !==
|
|
b)
|
|
for (l = q.fromVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++) s = n.o[r], s.valid && s.fromVertex.layer !== b && (t = s.fromVertex.index, v = s.portToPos, s = s.portFromPos, p < v && (l > t || l === t && q > s) && k++, v < p && (t > l || t === l && s > q) && k++);
|
|
if (0 >= c)
|
|
for (n = d[h].Te, m = 0; m < n.count; m++)
|
|
if (q = n.o[m], q.valid && q.toVertex.layer !== b)
|
|
for (l = q.toVertex.index, p = q.portToPos, q = q.portFromPos, r = m + 1; r < n.count; r++) s = n.o[r], s.valid && s.toVertex.layer !== b && (t = s.toVertex.index, v = s.portToPos, s = s.portFromPos, q < s && (l > t || l === t && p > v) && k++,
|
|
s < q && (t > l || t === l && v > p) && k++);
|
|
g[h * e + h] = k;
|
|
for (n = h + 1; n < e; n++) {
|
|
var y = 0,
|
|
A = 0;
|
|
if (0 <= c)
|
|
for (k = d[h].Ze, x = d[n].Ze, m = 0; m < k.count; m++)
|
|
if (q = k.o[m], q.valid && q.fromVertex.layer !== b)
|
|
for (l = q.fromVertex.index, q = q.portFromPos, r = 0; r < x.count; r++) s = x.o[r], s.valid && s.fromVertex.layer !== b && (t = s.fromVertex.index, s = s.portFromPos, (l < t || l === t && q < s) && A++, (t < l || t === l && s < q) && y++);
|
|
if (0 >= c)
|
|
for (k = d[h].Te, x = d[n].Te, m = 0; m < k.count; m++)
|
|
if (q = k.o[m], q.valid && q.toVertex.layer !== b)
|
|
for (l = q.toVertex.index, p = q.portToPos, r = 0; r < x.count; r++) s = x.o[r],
|
|
s.valid && s.toVertex.layer !== b && (t = s.toVertex.index, v = s.portToPos, (l < t || l === t && p < v) && A++, (t < l || t === l && v < p) && y++);
|
|
g[h * e + n] = y;
|
|
g[n * e + h] = A
|
|
}
|
|
}
|
|
Ir(a, b, d);
|
|
return g
|
|
}
|
|
on.prototype.countCrossings = function() {
|
|
for (var a = 0, b = 0; b <= this.yb; b++)
|
|
for (var c = Mr(this, b, 1), d = this.ge[b], e = 0; e < d; e++)
|
|
for (var g = e; g < d; g++) a += c[e * d + g];
|
|
return a
|
|
};
|
|
|
|
function Nr(a) {
|
|
for (var b = 0, c = 0; c <= a.yb; c++) {
|
|
for (var d = a, e = c, g = Hr(d, e), h = d.ge[e], k = 0, l = 0; l < h; l++) {
|
|
var m = null,
|
|
m = g[l].Te,
|
|
n, p = 0,
|
|
q = 0;
|
|
if (null !== m)
|
|
for (var r = 0; r < m.count; r++) n = m.o[r], n.valid && n.toVertex.layer !== e && (p = n.fromVertex.column + n.portFromColOffset, q = n.toVertex.column + n.portToColOffset, k += (Math.abs(p - q) + 1) * Jr(n))
|
|
}
|
|
Ir(d, e, g);
|
|
b += k
|
|
}
|
|
return b
|
|
}
|
|
on.prototype.normalize = function() {
|
|
var a = Infinity;
|
|
this.Kb = -1;
|
|
for (var b = this.network.vertexes.i; b.next();) {
|
|
var c = b.value,
|
|
a = Math.min(a, c.column - this.nodeMinColumnSpace(c, !0));
|
|
this.Kb = Math.max(this.Kb, c.column + this.nodeMinColumnSpace(c, !1))
|
|
}
|
|
for (b.reset(); b.next();) b.value.column -= a;
|
|
this.Kb -= a
|
|
};
|
|
|
|
function Or(a, b, c) {
|
|
u && (z.p(b, on, "barycenters:unfixedLayer"), z.p(c, on, "barycenters:direction"));
|
|
for (var d = Hr(a, b), e = a.ge[b], g = [], h = 0; h < e; h++) {
|
|
var k = d[h],
|
|
l = null;
|
|
0 >= c && (l = k.Ze);
|
|
var m = null;
|
|
0 <= c && (m = k.Te);
|
|
var n = 0,
|
|
p = 0,
|
|
q = k.near;
|
|
null !== q && q.layer === k.layer && (n += q.column - 1, p++);
|
|
if (null !== l)
|
|
for (q = 0; q < l.count; q++) {
|
|
var k = l.o[q],
|
|
r = k.fromVertex;
|
|
k.valid && !k.rev && r.layer !== b && (n += r.column, p++)
|
|
}
|
|
if (null !== m)
|
|
for (l = 0; l < m.count; l++) k = m.o[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (n += q.column, p++);
|
|
g[h] = 0 === p ? -1 : n /
|
|
p
|
|
}
|
|
Ir(a, b, d);
|
|
return g
|
|
}
|
|
|
|
function Pr(a, b, c) {
|
|
u && (z.p(b, on, "medians:unfixedLayer"), z.p(c, on, "medians:direction"));
|
|
for (var d = Hr(a, b), e = a.ge[b], g = [], h = 0; h < e; h++) {
|
|
var k = d[h],
|
|
l = null;
|
|
0 >= c && (l = k.Ze);
|
|
var m = null;
|
|
0 <= c && (m = k.Te);
|
|
var n = 0,
|
|
p = [],
|
|
q = k.near;
|
|
null !== q && q.layer === k.layer && (p[n] = q.column - 1, n++);
|
|
if (null !== l)
|
|
for (q = 0; q < l.count; q++) {
|
|
var k = l.o[q],
|
|
r = k.fromVertex;
|
|
k.valid && !k.rev && r.layer !== b && (p[n] = r.column + k.portFromColOffset, n++)
|
|
}
|
|
if (null !== m)
|
|
for (l = 0; l < m.count; l++) k = m.o[l], q = k.toVertex, k.valid && !k.rev && q.layer !== b && (p[n] = q.column + k.portToColOffset,
|
|
n++);
|
|
0 === n ? g[h] = -1 : (p.sort(function(a, b) {
|
|
return a - b
|
|
}), m = n >> 1, g[h] = n & 1 ? p[m] : p[m - 1] + p[m] >> 1)
|
|
}
|
|
Ir(a, b, d);
|
|
return g
|
|
}
|
|
|
|
function Qr(a, b, c, d, e, g) {
|
|
if (b.component === d) {
|
|
b.component = c;
|
|
var h = 0,
|
|
k = 0;
|
|
if (e)
|
|
for (var l = b.pc; l.next();) {
|
|
var k = l.value,
|
|
m = k.toVertex,
|
|
h = b.layer - m.layer,
|
|
k = a.linkMinLength(k);
|
|
h === k && Qr(a, m, c, d, e, g)
|
|
}
|
|
if (g)
|
|
for (l = b.tc; l.next();) k = l.value, m = k.fromVertex, h = m.layer - b.layer, k = a.linkMinLength(k), h === k && Qr(a, m, c, d, e, g)
|
|
}
|
|
}
|
|
|
|
function Rr(a, b, c, d, e, g) {
|
|
if (b.component === d) {
|
|
b.component = c;
|
|
if (e)
|
|
for (var h = b.pc; h.next();) Rr(a, h.value.toVertex, c, d, e, g);
|
|
if (g)
|
|
for (b = b.tc; b.next();) Rr(a, b.value.fromVertex, c, d, e, g)
|
|
}
|
|
}
|
|
|
|
function Br(a) {
|
|
for (a = a.vertexes.i; a.next();) {
|
|
var b = a.value;
|
|
if (b.valid) return b
|
|
}
|
|
return null
|
|
}
|
|
|
|
function Cr(a) {
|
|
for (a = a.vertexes.i; a.next();) {
|
|
var b = a.value;
|
|
if (b.valid) {
|
|
for (var c = !0, d = b.pc; d.next();)
|
|
if (d.value.toVertex.valid) {
|
|
c = !1;
|
|
break
|
|
}
|
|
if (c) return b
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
|
|
function Dr(a) {
|
|
for (a = a.vertexes.i; a.next();) {
|
|
var b = a.value;
|
|
if (b.valid) {
|
|
for (var c = !0, d = b.tc; d.next();)
|
|
if (d.value.fromVertex.valid) {
|
|
c = !1;
|
|
break
|
|
}
|
|
if (c) return b
|
|
}
|
|
}
|
|
return null
|
|
}
|
|
|
|
function Er(a, b) {
|
|
b.jp = a.Ur;
|
|
a.Ur++;
|
|
for (var c = b.pc; c.next();) {
|
|
var d = c.value,
|
|
e = d.toVertex; - 1 === e.jp && (d.forest = !0, Er(a, e))
|
|
}
|
|
b.finish = a.Ur;
|
|
a.Ur++
|
|
}
|
|
on.prototype.assignLayers = function() {
|
|
switch (this.yo) {
|
|
case Sr:
|
|
Tr(this);
|
|
break;
|
|
case Ur:
|
|
for (var a = 0, b = this.network.vertexes.i; b.next();) a = Vr(this, b.value), this.yb = Math.max(a, this.yb);
|
|
for (b.reset(); b.next();) a = b.value, a.layer = this.yb - a.layer;
|
|
break;
|
|
default:
|
|
case vr:
|
|
Tr(this);
|
|
for (b = this.network.vertexes.i; b.next();) b.value.valid = !1;
|
|
for (b.reset(); b.next();) a = b.value, 0 === a.tc.count && Wr(this, a);
|
|
a = Infinity;
|
|
for (b.reset(); b.next();) a = Math.min(a, b.value.layer);
|
|
this.yb = -1;
|
|
for (b.reset(); b.next();) {
|
|
var c = b.value;
|
|
c.layer -=
|
|
a;
|
|
this.yb = Math.max(this.yb, c.layer)
|
|
}
|
|
}
|
|
};
|
|
|
|
function Tr(a) {
|
|
for (var b = a.network.vertexes.i; b.next();) {
|
|
var c = Xr(a, b.value);
|
|
a.yb = Math.max(c, a.yb)
|
|
}
|
|
}
|
|
|
|
function Xr(a, b) {
|
|
var c = 0;
|
|
if (-1 === b.layer) {
|
|
for (var d = b.pc; d.next();) var e = d.value,
|
|
g = e.toVertex,
|
|
e = a.linkMinLength(e),
|
|
c = Math.max(c, Xr(a, g) + e);
|
|
b.layer = c
|
|
} else c = b.layer;
|
|
return c
|
|
}
|
|
|
|
function Vr(a, b) {
|
|
var c = 0;
|
|
if (-1 === b.layer) {
|
|
for (var d = b.tc; d.next();) var e = d.value,
|
|
g = e.fromVertex,
|
|
e = a.linkMinLength(e),
|
|
c = Math.max(c, Vr(a, g) + e);
|
|
b.layer = c
|
|
} else c = b.layer;
|
|
return c
|
|
}
|
|
|
|
function Wr(a, b) {
|
|
if (!b.valid) {
|
|
b.valid = !0;
|
|
for (var c = b.pc; c.next();) Wr(a, c.value.toVertex);
|
|
for (c = a.network.vertexes.i; c.next();) c.value.component = -1;
|
|
for (var d = b.Ze.o, e = d.length, g = 0; g < e; g++) {
|
|
var h = d[g],
|
|
k = a.linkMinLength(h);
|
|
h.fromVertex.layer - h.toVertex.layer > k && Qr(a, h.fromVertex, 0, -1, !0, !1)
|
|
}
|
|
for (Qr(a, b, 1, -1, !0, !0); 0 !== b.component;) {
|
|
for (var k = 0, d = Infinity, l = 0, m = null, n = a.network.vertexes.i; n.next();) {
|
|
var p = n.value;
|
|
if (1 === p.component) {
|
|
for (var q = 0, r = !1, s = p.Ze.o, e = s.length, g = 0; g < e; g++) {
|
|
var h = s[g],
|
|
t = h.fromVertex,
|
|
q = q + 1;
|
|
1 !== t.component && (k += 1, t = t.layer - p.layer, h = a.linkMinLength(h), d = Math.min(d, t - h))
|
|
}
|
|
h = p.Te.o;
|
|
e = h.length;
|
|
for (g = 0; g < e; g++) s = h[g].toVertex, q -= 1, 1 !== s.component ? k -= 1 : r = !0;
|
|
(null === m || q < l) && !r && (m = p, l = q)
|
|
}
|
|
}
|
|
if (0 < k) {
|
|
for (c.reset(); c.next();) e = c.value, 1 === e.component && (e.layer += d);
|
|
b.component = 0
|
|
} else m.component = 0
|
|
}
|
|
for (c = a.network.vertexes.i; c.next();) c.value.component = -1;
|
|
for (Qr(a, b, 1, -1, !0, !1); 0 !== b.component;) {
|
|
g = 0;
|
|
e = Infinity;
|
|
d = 0;
|
|
k = null;
|
|
for (l = a.network.vertexes.i; l.next();)
|
|
if (m = l.value, 1 === m.component) {
|
|
n =
|
|
0;
|
|
p = !1;
|
|
h = m.Ze.o;
|
|
q = h.length;
|
|
for (r = 0; r < q; r++) s = h[r].fromVertex, n += 1, 1 !== s.component ? g += 1 : p = !0;
|
|
h = m.Te.o;
|
|
q = h.length;
|
|
for (r = 0; r < q; r++) s = h[r], t = s.toVertex, n -= 1, 1 !== t.component && (g -= 1, t = m.layer - t.layer, s = a.linkMinLength(s), e = Math.min(e, t - s));
|
|
(null === k || n > d) && !p && (k = m, d = n)
|
|
}
|
|
if (0 > g) {
|
|
for (c.reset(); c.next();) g = c.value, 1 === g.component && (g.layer -= e);
|
|
b.component = 0
|
|
} else k.component = 0
|
|
}
|
|
}
|
|
}
|
|
|
|
function Gr(a, b, c) {
|
|
return 90 === a.fa ? c && !b.rev || !c && b.rev ? 270 : 90 : 180 === a.fa ? c && !b.rev || !c && b.rev ? 0 : 180 : 270 === a.fa ? c && !b.rev || !c && b.rev ? 90 : 270 : c && !b.rev || !c && b.rev ? 180 : 0
|
|
}
|
|
on.prototype.initializeIndices = function() {
|
|
switch (this.oo) {
|
|
default:
|
|
case Yr:
|
|
for (var a = this.network.vertexes.i; a.next();) {
|
|
var b = a.value,
|
|
c = b.layer;
|
|
b.index = this.ge[c];
|
|
this.ge[c]++
|
|
}
|
|
break;
|
|
case wr:
|
|
a = this.network.vertexes.i;
|
|
for (b = this.yb; 0 <= b; b--)
|
|
for (a.reset(); a.next();) c = a.value, c.layer === b && -1 === c.index && Zr(this, c);
|
|
break;
|
|
case $r:
|
|
for (a = this.network.vertexes.i, b = 0; b <= this.yb; b++)
|
|
for (a.reset(); a.next();) c = a.value, c.layer === b && -1 === c.index && as(this, c)
|
|
}
|
|
};
|
|
|
|
function Zr(a, b) {
|
|
var c = b.layer;
|
|
b.index = a.ge[c];
|
|
a.ge[c]++;
|
|
for (var c = b.Te.jc(), d = !0; d;)
|
|
for (var d = !1, e = 0; e < c.length - 1; e++) {
|
|
var g = c[e],
|
|
h = c[e + 1];
|
|
g.portFromColOffset > h.portFromColOffset && (d = !0, c[e] = h, c[e + 1] = g)
|
|
}
|
|
for (e = 0; e < c.length; e++) d = c[e], d.valid && (d = d.toVertex, -1 === d.index && Zr(a, d))
|
|
}
|
|
|
|
function as(a, b) {
|
|
var c = b.layer;
|
|
b.index = a.ge[c];
|
|
a.ge[c]++;
|
|
for (var c = b.Ze.jc(), d = !0, e = 0; d;)
|
|
for (d = !1, e = 0; e < c.length - 1; e++) {
|
|
var g = c[e],
|
|
h = c[e + 1];
|
|
g.portToColOffset > h.portToColOffset && (d = !0, c[e] = h, c[e + 1] = g)
|
|
}
|
|
for (e = 0; e < c.length; e++) d = c[e], d.valid && (d = d.fromVertex, -1 === d.index && as(a, d))
|
|
}
|
|
on.prototype.reduceCrossings = function() {
|
|
for (var a = this.countCrossings(), b = Kr(this), c = 0, d = 0, e = 0, c = 0; c < this.om; c++) {
|
|
for (d = 0; d <= this.yb; d++) bs(this, d, 1), cs(this, d, 1);
|
|
e = this.countCrossings();
|
|
e < a && (a = e, b = Kr(this));
|
|
for (d = this.yb; 0 <= d; d--) bs(this, d, -1), cs(this, d, -1);
|
|
e = this.countCrossings();
|
|
e < a && (a = e, b = Kr(this))
|
|
}
|
|
Lr(this, b);
|
|
for (c = 0; c < this.om; c++) {
|
|
for (d = 0; d <= this.yb; d++) bs(this, d, 0), cs(this, d, 0);
|
|
e = this.countCrossings();
|
|
e < a && (a = e, b = Kr(this));
|
|
for (d = this.yb; 0 <= d; d--) bs(this, d, 0), cs(this, d, 0);
|
|
e = this.countCrossings();
|
|
e < a && (a = e, b = Kr(this))
|
|
}
|
|
Lr(this, b);
|
|
var g = !1,
|
|
h = c = 0,
|
|
k = 0,
|
|
d = 0;
|
|
switch (this.Gn) {
|
|
case ds:
|
|
break;
|
|
case es:
|
|
for (k = a + 1;
|
|
(d = this.countCrossings()) < k;)
|
|
for (k = d, c = this.yb; 0 <= c; c--)
|
|
for (h = 0; h <= c; h++) {
|
|
for (g = !0; g;)
|
|
for (g = !1, d = c; d >= h; d--) g = cs(this, d, -1) || g;
|
|
e = this.countCrossings();
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = c; d >= h; d--) g = cs(this, d, 1) || g;
|
|
e = this.countCrossings();
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = h; d <= c; d++) g = cs(this, d, 1) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1,
|
|
d = h; d <= c; d++) g = cs(this, d, -1) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = c; d >= h; d--) g = cs(this, d, 0) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = h; d <= c; d++) g = cs(this, d, 0) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this))
|
|
}
|
|
break;
|
|
default:
|
|
case xr:
|
|
for (c = this.yb, h = 0, k = a + 1;
|
|
(d = this.countCrossings()) < k;) {
|
|
k = d;
|
|
for (g = !0; g;)
|
|
for (g = !1, d = c; d >= h; d--) g = cs(this, d, -1) || g;
|
|
e = this.countCrossings();
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = c; d >= h; d--) g = cs(this, d, 1) || g;
|
|
e = this.countCrossings();
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = h; d <= c; d++) g = cs(this, d, 1) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = h; d <= c; d++) g = cs(this, d, -1) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = c; d >= h; d--) g = cs(this, d, 0) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this));
|
|
for (g = !0; g;)
|
|
for (g = !1, d = h; d <= c; d++) g = cs(this, d, 0) || g;
|
|
e >= a ? Lr(this, b) : (a = e, b = Kr(this))
|
|
}
|
|
}
|
|
Lr(this, b)
|
|
};
|
|
|
|
function bs(a, b, c) {
|
|
u && (z.p(b, on, "medianBarycenterCrossingReduction:unfixedLayer"), z.p(c, on, "medianBarycenterCrossingReduction:direction"));
|
|
var d = 0,
|
|
e = Hr(a, b),
|
|
g = a.ge[b],
|
|
h = Pr(a, b, c);
|
|
c = Or(a, b, c);
|
|
for (d = 0; d < g; d++) - 1 === c[d] && (c[d] = e[d].column), -1 === h[d] && (h[d] = e[d].column);
|
|
for (var k = !0, l; k;)
|
|
for (k = !1, d = 0; d < g - 1; d++)
|
|
if (h[d + 1] < h[d] || h[d + 1] === h[d] && c[d + 1] < c[d]) k = !0, l = h[d], h[d] = h[d + 1], h[d + 1] = l, l = c[d], c[d] = c[d + 1], c[d + 1] = l, l = e[d], e[d] = e[d + 1], e[d + 1] = l;
|
|
for (d = h = 0; d < g; d++) l = e[d], l.index = d, h += a.nodeMinColumnSpace(l, !0), l.column = h, h += 1, h += a.nodeMinColumnSpace(l, !1);
|
|
Ir(a, b, e)
|
|
}
|
|
|
|
function cs(a, b, c) {
|
|
var d = Hr(a, b),
|
|
e = a.ge[b];
|
|
c = Mr(a, b, c);
|
|
var g = 0,
|
|
h;
|
|
h = [];
|
|
for (g = 0; g < e; g++) h[g] = -1;
|
|
var k;
|
|
k = [];
|
|
for (g = 0; g < e; g++) k[g] = -1;
|
|
for (var l = !1, m = !0; m;)
|
|
for (m = !1, g = 0; g < e - 1; g++) {
|
|
var n = c[d[g].index * e + d[g + 1].index],
|
|
p = c[d[g + 1].index * e + d[g].index],
|
|
q = 0,
|
|
r = 0,
|
|
s = d[g].column,
|
|
t = d[g + 1].column,
|
|
v = a.nodeMinColumnSpace(d[g], !0),
|
|
x = a.nodeMinColumnSpace(d[g], !1),
|
|
y = a.nodeMinColumnSpace(d[g + 1], !0),
|
|
A = a.nodeMinColumnSpace(d[g + 1], !1),
|
|
v = s - v + y,
|
|
x = t - x + A,
|
|
y = y = 0,
|
|
B = d[g].tc.i;
|
|
for (B.reset(); B.next();)
|
|
if (A = B.value, A.valid && A.fromVertex.layer ===
|
|
b) {
|
|
A = A.fromVertex;
|
|
for (y = 0; d[y] !== A;) y++;
|
|
y < g && (q += 2 * (g - y), r += 2 * (g + 1 - y));
|
|
y === g + 1 && (q += 1);
|
|
y > g + 1 && (q += 4 * (y - g), r += 4 * (y - (g + 1)))
|
|
}
|
|
B = d[g].pc.i;
|
|
for (B.reset(); B.next();)
|
|
if (A = B.value, A.valid && A.toVertex.layer === b) {
|
|
A = A.toVertex;
|
|
for (y = 0; d[y] !== A;) y++;
|
|
y === g + 1 && (r += 1)
|
|
}
|
|
B = d[g + 1].tc.i;
|
|
for (B.reset(); B.next();)
|
|
if (A = B.value, A.valid && A.fromVertex.layer === b) {
|
|
A = A.fromVertex;
|
|
for (y = 0; d[y] !== A;) y++;
|
|
y < g && (q += 2 * (g + 1 - y), r += 2 * (g - y));
|
|
y === g && (r += 1);
|
|
y > g + 1 && (q += 4 * (y - (g + 1)), r += 4 * (y - g))
|
|
}
|
|
B = d[g + 1].pc.i;
|
|
for (B.reset(); B.next();)
|
|
if (A = B.value,
|
|
A.valid && A.toVertex.layer === b) {
|
|
A = A.toVertex;
|
|
for (y = 0; d[y] !== A;) y++;
|
|
y === g && (q += 1)
|
|
}
|
|
var y = A = 0,
|
|
B = h[d[g].index],
|
|
L = k[d[g].index],
|
|
H = h[d[g + 1].index],
|
|
U = k[d[g + 1].index]; - 1 !== B && (A += Math.abs(B - s), y += Math.abs(B - x)); - 1 !== L && (A += Math.abs(L - s), y += Math.abs(L - x)); - 1 !== H && (A += Math.abs(H - t), y += Math.abs(H - v)); - 1 !== U && (A += Math.abs(U - t), y += Math.abs(U - v));
|
|
if (r < q - .5 || r === q && p < n - .5 || r === q && p === n && y < A - .5) m = l = !0, d[g].column = x, d[g + 1].column = v, n = d[g], d[g] = d[g + 1], d[g + 1] = n
|
|
}
|
|
for (g = 0; g < e; g++) d[g].index = g;
|
|
Ir(a, b, d);
|
|
return l
|
|
}
|
|
on.prototype.straightenAndPack = function() {
|
|
var a = 0,
|
|
b = !1,
|
|
c = 0 !== (this.Ri & fs),
|
|
a = this.Ri === yr;
|
|
1E3 < this.network.edges.count && !a && (c = !1);
|
|
if (c) {
|
|
b = [];
|
|
for (a = a = 0; a <= this.yb; a++) b[a] = 0;
|
|
for (var d = 0, e = this.network.vertexes.i; e.next();) {
|
|
var g = e.value,
|
|
a = g.layer,
|
|
d = g.column,
|
|
g = this.nodeMinColumnSpace(g, !1);
|
|
b[a] = Math.max(b[a], d + g)
|
|
}
|
|
for (e.reset(); e.next();) g = e.value, a = g.layer, d = g.column, g.column = (8 * (this.Kb - b[a]) >> 1) + 8 * d;
|
|
this.Kb *= 8
|
|
}
|
|
if (0 !== (this.Ri & gs))
|
|
for (b = !0; b;) {
|
|
b = !1;
|
|
for (a = this.Rf + 1; a <= this.yb; a++) b = hs(this, a, 1) || b;
|
|
for (a = this.Rf - 1; 0 <= a; a--) b = hs(this, a, -1) || b;
|
|
b = hs(this, this.Rf, 0) || b
|
|
}
|
|
if (0 !== (this.Ri & is)) {
|
|
for (a = this.Rf + 1; a <= this.yb; a++) js(this, a, 1);
|
|
for (a = this.Rf - 1; 0 <= a; a--) js(this, a, -1);
|
|
js(this, this.Rf, 0)
|
|
}
|
|
c && (ks(this, -1), ks(this, 1));
|
|
if (0 !== (this.Ri & gs))
|
|
for (b = !0; b;) {
|
|
b = !1;
|
|
b = hs(this, this.Rf, 0) || b;
|
|
for (a = this.Rf + 1; a <= this.yb; a++) b = hs(this, a, 0) || b;
|
|
for (a = this.Rf - 1; 0 <= a; a--) b = hs(this, a, 0) || b
|
|
}
|
|
};
|
|
|
|
function hs(a, b, c) {
|
|
u && (z.p(b, on, "bendStraighten:unfixedLayer"), z.p(c, on, "bendStraighten:direction"));
|
|
for (var d = !1; ls(a, b, c);) d = !0;
|
|
return d
|
|
}
|
|
|
|
function ls(a, b, c) {
|
|
u && (z.p(b, on, "shiftbendStraighten:unfixedLayer"), z.p(c, on, "shiftbendStraighten:direction"));
|
|
var d = 0,
|
|
e = Hr(a, b),
|
|
g = a.ge[b],
|
|
h = Or(a, b, -1);
|
|
if (0 < c)
|
|
for (d = 0; d < g; d++) h[d] = -1;
|
|
var k = Or(a, b, 1);
|
|
if (0 > c)
|
|
for (d = 0; d < g; d++) k[d] = -1;
|
|
for (var l = !1, m = !0; m;)
|
|
for (m = !1, d = 0; d < g; d++) {
|
|
var n = e[d].column,
|
|
p = a.nodeMinColumnSpace(e[d], !0),
|
|
q = a.nodeMinColumnSpace(e[d], !1),
|
|
r = 0,
|
|
r = 0 > d - 1 || n - e[d - 1].column - 1 > p + a.nodeMinColumnSpace(e[d - 1], !1) ? n - 1 : n,
|
|
p = 0,
|
|
p = d + 1 >= g || e[d + 1].column - n - 1 > q + a.nodeMinColumnSpace(e[d + 1], !0) ? n + 1 : n,
|
|
s = q =
|
|
0,
|
|
t = 0,
|
|
v = 0,
|
|
x = 0,
|
|
y = 0;
|
|
if (0 >= c)
|
|
for (var A = e[d].tc.i; A.next();) {
|
|
var B = A.value;
|
|
B.valid && B.fromVertex.layer !== b && (v = Jr(B), x = B.portFromColOffset, y = B.portToColOffset, B = B.fromVertex.column, q += (Math.abs(n + y - (B + x)) + 1) * v, s += (Math.abs(r + y - (B + x)) + 1) * v, t += (Math.abs(p + y - (B + x)) + 1) * v)
|
|
}
|
|
if (0 <= c)
|
|
for (A = e[d].pc.i; A.next();) B = A.value, B.valid && B.toVertex.layer !== b && (v = Jr(B), x = B.portFromColOffset, y = B.portToColOffset, B = B.toVertex.column, q += (Math.abs(n + x - (B + y)) + 1) * v, s += (Math.abs(r + x - (B + y)) + 1) * v, t += (Math.abs(p + x - (B + y)) + 1) * v);
|
|
y =
|
|
x = v = 0;
|
|
A = h[e[d].index];
|
|
B = k[e[d].index]; - 1 !== A && (v += Math.abs(A - n), x += Math.abs(A - r), y += Math.abs(A - p)); - 1 !== B && (v += Math.abs(B - n), x += Math.abs(B - r), y += Math.abs(B - p));
|
|
if (s < q || s === q && x < v) m = l = !0, e[d].column = r;
|
|
else if (t < q || t === q && y < v) m = l = !0, e[d].column = p
|
|
}
|
|
Ir(a, b, e);
|
|
a.normalize();
|
|
return l
|
|
}
|
|
|
|
function js(a, b, c) {
|
|
u && (z.p(b, on, "medianStraighten:unfixedLayer"), z.p(c, on, "medianStraighten:direction"));
|
|
var d = 0,
|
|
e = Hr(a, b),
|
|
g = a.ge[b],
|
|
h = Pr(a, b, c);
|
|
c = [];
|
|
for (d = 0; d < g; d++) c[d] = h[d];
|
|
for (h = !0; h;)
|
|
for (h = !1, d = 0; d < g; d++) {
|
|
var k = e[d].column,
|
|
l = a.nodeMinColumnSpace(e[d], !0),
|
|
m = a.nodeMinColumnSpace(e[d], !1),
|
|
n = 0,
|
|
p = 0,
|
|
q = 0,
|
|
q = p = 0; - 1 === c[d] ? 0 === d && d === g - 1 ? n = k : 0 === d ? (p = e[d + 1].column, n = p - k === m + a.nodeMinColumnSpace(e[d + 1], !0) ? k - 1 : k) : d === g - 1 ? (q = e[d - 1].column, n = k - q === l + a.nodeMinColumnSpace(e[d - 1], !1) ? k + 1 : k) : (q = e[d - 1].column,
|
|
q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = (q + p) / 2 | 0) : 0 === d && d === g - 1 ? n = c[d] : 0 === d ? (p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, n = Math.min(c[d], p)) : d === g - 1 ? (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, n = Math.max(c[d], q)) : (q = e[d - 1].column, q = q + a.nodeMinColumnSpace(e[d - 1], !1) + l + 1, p = e[d + 1].column, p = p - a.nodeMinColumnSpace(e[d + 1], !0) - m - 1, q < c[d] && c[d] < p ? n = c[d] : q >= c[d] ? n = q : p <= c[d] && (n = p));
|
|
n !== k && (h = !0, e[d].column = n)
|
|
}
|
|
Ir(a, b, e);
|
|
a.normalize()
|
|
}
|
|
|
|
function ms(a, b) {
|
|
u && (z.p(b, on, "packAux:column"), z.p(1, on, "packAux:direction"));
|
|
for (var c = !0, d = a.network.vertexes.i; d.next();) {
|
|
var e = d.value,
|
|
g = a.nodeMinColumnSpace(e, !0),
|
|
h = a.nodeMinColumnSpace(e, !1);
|
|
if (e.column - g <= b && e.column + h >= b) {
|
|
c = !1;
|
|
break
|
|
}
|
|
}
|
|
e = !1;
|
|
if (c)
|
|
for (d.reset(); d.next();) c = d.value, c.column > b && (c.column -= 1, e = !0);
|
|
return e
|
|
}
|
|
|
|
function ns(a, b) {
|
|
u && (z.p(b, on, "tightPackAux:column"), z.p(1, on, "tightPackAux:direction"));
|
|
for (var c = b, c = b + 1, d = 0, e = [], g = [], d = 0; d <= a.yb; d++) e[d] = !1, g[d] = !1;
|
|
for (var h = a.network.vertexes.i; h.next();) {
|
|
var d = h.value,
|
|
k = d.column - a.nodeMinColumnSpace(d, !0),
|
|
l = d.column + a.nodeMinColumnSpace(d, !1);
|
|
k <= b && l >= b && (e[d.layer] = !0);
|
|
k <= c && l >= c && (g[d.layer] = !0)
|
|
}
|
|
k = !0;
|
|
c = !1;
|
|
for (d = 0; d <= a.yb; d++) k = k && !(e[d] && g[d]);
|
|
if (k)
|
|
for (h.reset(); h.next();) e = h.value, e.column > b && (e.column -= 1, c = !0);
|
|
return c
|
|
}
|
|
|
|
function ks(a, b) {
|
|
u && z.p(b, on, "componentPack:direction");
|
|
for (var c = 0; c <= a.Kb; c++)
|
|
for (; ms(a, c););
|
|
a.normalize();
|
|
for (c = 0; c < a.Kb; c++)
|
|
for (; ns(a, c););
|
|
a.normalize();
|
|
var c = 0,
|
|
d, e = 0,
|
|
g = 0,
|
|
h = 0;
|
|
if (0 < b)
|
|
for (c = 0; c <= a.Kb; c++)
|
|
for (d = Kr(a), e = Nr(a), g = e + 1; e < g;) g = e, os(a, c, 1), h = Nr(a), h > e ? Lr(a, d) : h < e && (e = h, d = Kr(a));
|
|
if (0 > b)
|
|
for (c = a.Kb; 0 <= c; c--)
|
|
for (d = Kr(a), e = Nr(a), g = e + 1; e < g;) g = e, os(a, c, -1), h = Nr(a), h > e ? Lr(a, d) : h < e && (e = h, d = Kr(a));
|
|
a.normalize()
|
|
}
|
|
|
|
function os(a, b, c) {
|
|
a.vg = 0;
|
|
for (var d = a.network.vertexes.i; d.next();) d.value.component = -1;
|
|
if (0 < c)
|
|
for (d.reset(); d.next();) {
|
|
var e = d.value;
|
|
e.column - a.nodeMinColumnSpace(e, !0) <= b && (e.component = a.vg)
|
|
}
|
|
if (0 > c)
|
|
for (d.reset(); d.next();) e = d.value, e.column + a.nodeMinColumnSpace(e, !1) >= b && (e.component = a.vg);
|
|
a.vg++;
|
|
for (d.reset(); d.next();) b = d.value, -1 === b.component && (Rr(a, b, a.vg, -1, !0, !0), a.vg++);
|
|
var g = 0;
|
|
b = [];
|
|
for (g = 0; g < a.vg * a.vg; g++) b[g] = !1;
|
|
e = [];
|
|
for (g = 0; g < (a.yb + 1) * (a.Kb + 1); g++) e[g] = -1;
|
|
for (d.reset(); d.next();)
|
|
for (var g =
|
|
d.value, h = g.layer, k = Math.max(0, g.column - a.nodeMinColumnSpace(g, !0)), l = Math.min(a.Kb, g.column + a.nodeMinColumnSpace(g, !1)); k <= l; k++) e[h * (a.Kb + 1) + k] = g.component;
|
|
for (g = 0; g <= a.yb; g++) {
|
|
if (0 < c)
|
|
for (k = 0; k < a.Kb; k++) - 1 !== e[g * (a.Kb + 1) + k] && -1 !== e[g * (a.Kb + 1) + k + 1] && e[g * (a.Kb + 1) + k] !== e[g * (a.Kb + 1) + k + 1] && (b[e[g * (a.Kb + 1) + k] * a.vg + e[g * (a.Kb + 1) + k + 1]] = !0);
|
|
if (0 > c)
|
|
for (k = a.Kb; 0 < k; k--) - 1 !== e[g * (a.Kb + 1) + k] && -1 !== e[g * (a.Kb + 1) + k - 1] && e[g * (a.Kb + 1) + k] !== e[g * (a.Kb + 1) + k - 1] && (b[e[g * (a.Kb + 1) + k] * a.vg + e[g * (a.Kb + 1) + k - 1]] = !0)
|
|
}
|
|
e = [];
|
|
for (g =
|
|
0; g < a.vg; g++) e[g] = !0;
|
|
h = new J("number");
|
|
h.add(0);
|
|
for (l = 0; 0 !== h.count;)
|
|
if (l = h.o[h.count - 1], h.dd(h.count - 1), e[l])
|
|
for (e[l] = !1, g = 0; g < a.vg; g++) b[l * a.vg + g] && h.Ld(0, g);
|
|
if (0 < c)
|
|
for (d.reset(); d.next();) a = d.value, e[a.component] && (a.column -= 1);
|
|
if (0 > c)
|
|
for (d.reset(); d.next();) c = d.value, e[c.component] && (c.column += 1)
|
|
}
|
|
on.prototype.commitLayout = function() {
|
|
if (this.aq)
|
|
for (var a = Fr(this, !0), b = Fr(this, !1), c = this.network.edges.i; c.next();) {
|
|
var d = c.value.link;
|
|
null !== d && (d.Db = a, d.Eb = b)
|
|
}
|
|
this.commitNodes();
|
|
this.Fz();
|
|
this.Rt && this.commitLinks()
|
|
};
|
|
|
|
function Fr(a, b) {
|
|
return 270 === a.fa ? b ? Zc : bd : 90 === a.fa ? b ? bd : Zc : 180 === a.fa ? b ? $c : ad : b ? ad : $c
|
|
}
|
|
on.prototype.commitNodes = function() {
|
|
this.tg = [];
|
|
this.Qf = [];
|
|
this.Pf = [];
|
|
this.Rb = [];
|
|
for (var a = 0; a <= this.yb; a++) this.tg[a] = 0, this.Qf[a] = 0, this.Pf[a] = 0, this.Rb[a] = 0;
|
|
for (a = this.network.vertexes.i; a.next();) {
|
|
var b = a.value,
|
|
c = b.layer;
|
|
this.tg[c] = Math.max(this.tg[c], this.nodeMinLayerSpace(b, !0));
|
|
this.Qf[c] = Math.max(this.Qf[c], this.nodeMinLayerSpace(b, !1))
|
|
}
|
|
for (var b = 0, d = this.qm, c = 0; c <= this.yb; c++) {
|
|
var e = d;
|
|
0 >= this.tg[c] + this.Qf[c] && (e = 0);
|
|
0 < c && (b += e / 2);
|
|
90 === this.fa || 0 === this.fa ? (b += this.Qf[c], this.Pf[c] = b, b += this.tg[c]) :
|
|
(b += this.tg[c], this.Pf[c] = b, b += this.Qf[c]);
|
|
c < this.yb && (b += e / 2);
|
|
this.Rb[c] = b
|
|
}
|
|
d = b;
|
|
b = this.je.copy();
|
|
null !== this.group && (270 === this.direction || 90 === this.direction ? b.y -= 10 : b.x -= 10, 270 === this.direction || 90 === this.direction ? b.x -= this.SD / 2 : b.y -= this.SD / 2);
|
|
for (c = 0; c <= this.yb; c++) 270 === this.fa ? this.Pf[c] = b.y + this.Pf[c] : 90 === this.fa ? (this.Pf[c] = b.y + d - this.Pf[c], this.Rb[c] = d - this.Rb[c]) : 180 === this.fa ? this.Pf[c] = b.x + this.Pf[c] : (this.Pf[c] = b.x + d - this.Pf[c], this.Rb[c] = d - this.Rb[c]);
|
|
for (a.reset(); a.next();) {
|
|
var c =
|
|
a.value,
|
|
d = c.layer,
|
|
e = c.column | 0,
|
|
g = 0,
|
|
h = 0;
|
|
270 === this.fa || 90 === this.fa ? (g = b.x + this.Td * e, h = this.Pf[d]) : (g = this.Pf[d], h = b.y + this.Td * e);
|
|
c.ra = g;
|
|
c.za = h;
|
|
c.commit()
|
|
}
|
|
};
|
|
on.prototype.Fz = function() {
|
|
for (var a = 0, b = this.qm, c = 0; c <= this.yb; c++) a += this.tg[c], a += this.Qf[c];
|
|
for (var a = a + this.yb * b, b = [], c = this.Td * this.Kb, d = this.zI; 0 <= d; d--) 270 === this.fa ? 0 === d ? b.push(new w(0, 0, c, Math.abs(this.Rb[0]))) : b.push(new w(0, this.Rb[d - 1], c, Math.abs(this.Rb[d - 1] - this.Rb[d]))) : 90 === this.fa ? 0 === d ? b.push(new w(0, this.Rb[0], c, Math.abs(this.Rb[0] - a))) : b.push(new w(0, this.Rb[d], c, Math.abs(this.Rb[d - 1] - this.Rb[d]))) : 180 === this.fa ? 0 === d ? b.push(new w(0, 0, Math.abs(this.Rb[0]), c)) : b.push(new w(this.Rb[d -
|
|
1], 0, Math.abs(this.Rb[d - 1] - this.Rb[d]), c)) : 0 === d ? b.push(new w(this.Rb[0], 0, Math.abs(this.Rb[0] - a), c)) : b.push(new w(this.Rb[d], 0, Math.abs(this.Rb[d - 1] - this.Rb[d]), c));
|
|
this.commitLayers(b, Id)
|
|
};
|
|
on.prototype.commitLayers = function() {};
|
|
on.prototype.commitLinks = function() {
|
|
for (var a = this.network.edges.i, b; a.next();) b = a.value.link, null !== b && (b.Ul(), b.fp(), b.cj());
|
|
for (a.reset(); a.next();) b = a.value.link, null !== b && b.Bn();
|
|
for (a.reset(); a.next();) {
|
|
var c = a.value;
|
|
b = c.link;
|
|
if (null !== b) {
|
|
b.Ul();
|
|
var d = b,
|
|
e = d.Y,
|
|
g = d.da,
|
|
h = d.md,
|
|
k = d.Qd;
|
|
if (c.valid) {
|
|
if (b.Se === Ui && 4 === b.sa) {
|
|
if (c.rev) var l = e,
|
|
e = g,
|
|
g = l,
|
|
m = h,
|
|
h = k,
|
|
k = m;
|
|
if (c.fromVertex.column === c.toVertex.column) {
|
|
var n = b.getLinkPoint(e, h, b.computeSpot(!0), !0, !1, g, k),
|
|
p = b.getLinkPoint(g, k, b.computeSpot(!1), !1, !1,
|
|
e, h);
|
|
n.F() || n.set(e.W.xl);
|
|
p.F() || p.set(g.W.xl);
|
|
b.fp();
|
|
b.sl(n.x, n.y);
|
|
b.sl((2 * n.x + p.x) / 3, (2 * n.y + p.y) / 3);
|
|
b.sl((n.x + 2 * p.x) / 3, (n.y + 2 * p.y) / 3);
|
|
b.sl(p.x, p.y)
|
|
} else {
|
|
var q = !1,
|
|
r = !1;
|
|
null !== h && b.computeSpot(!0) === Yb && (q = !0);
|
|
null !== k && b.computeSpot(!1) === Yb && (r = !0);
|
|
if (q || r) {
|
|
var s = b.m(0).x,
|
|
t = b.m(0).y,
|
|
v = b.m(1).x,
|
|
x = b.m(1).y,
|
|
y = b.m(2).x,
|
|
A = b.m(2).y,
|
|
B = b.m(3).x,
|
|
L = b.m(3).y;
|
|
if (q) {
|
|
90 === this.fa || 270 === this.fa ? (v = s, x = (t + L) / 2) : (v = (s + B) / 2, x = t);
|
|
b.aa(1, v, x);
|
|
var H = b.getLinkPoint(e, h, b.computeSpot(!0), !0, !1, g, k);
|
|
H.F() || H.set(e.W.xl);
|
|
b.aa(0, H.x, H.y)
|
|
}
|
|
r && (90 === this.fa || 270 === this.fa ? (y = B, A = (t + L) / 2) : (y = (s + B) / 2, A = L), b.aa(2, y, A), H = b.getLinkPoint(g, k, b.computeSpot(!1), !1, !1, e, h), H.F() || H.set(g.W.xl), b.aa(3, H.x, H.y))
|
|
}
|
|
}
|
|
}
|
|
b.cj()
|
|
} else if (c.fromVertex.layer === c.toVertex.layer) b.cj();
|
|
else {
|
|
var U = !1,
|
|
ea = !1,
|
|
W = 0,
|
|
P = b.Bt + 1;
|
|
if (b.rc) ea = !0, W = b.sa, 4 < W && b.points.removeRange(2, W - 3);
|
|
else if (b.Se === Ui) U = !0, W = b.sa, 4 < W && b.points.removeRange(2, W - 3), P = 2;
|
|
else {
|
|
var W = b.sa,
|
|
ba = b.computeSpot(!0) === Yb,
|
|
Oa = b.computeSpot(!1) === Yb;
|
|
2 < W && ba && Oa ? b.points.removeRange(1, W -
|
|
2) : 3 < W && ba && !Oa ? b.points.removeRange(1, W - 3) : 3 < W && !ba && Oa ? b.points.removeRange(2, W - 2) : 4 < W && !ba && !Oa && b.points.removeRange(2, W - 3)
|
|
}
|
|
var sa = c.fromVertex,
|
|
Na = c.toVertex,
|
|
ua, Ha;
|
|
if (c.rev) {
|
|
for (var Aa = 0; null !== Na && sa !== Na;) {
|
|
Ha = ua = null;
|
|
for (var jc = Na.tc.i; jc.next();) {
|
|
var zd = jc.value;
|
|
if (zd.link === c.link && (ua = zd.fromVertex, Ha = zd.toVertex, null === ua.Bd)) break
|
|
}
|
|
if (ua !== sa)
|
|
if (sb = b.m(P - 1).x, gb = b.m(P - 1).y, oa = ua.ra, pa = ua.za, ea) 180 === this.fa || 0 === this.fa ? 2 === P ? (b.B(P++, sb, gb), b.B(P++, sb, pa)) : (Ae = null !== Ha ? Ha.za : gb, Ae !== pa &&
|
|
(tb = this.Rb[ua.layer - 1], b.B(P++, tb, gb), b.B(P++, tb, pa))) : 2 === P ? (b.B(P++, sb, gb), b.B(P++, oa, gb)) : (Cd = null !== Ha ? Ha.ra : sb, Cd !== oa && (tb = this.Rb[ua.layer - 1], b.B(P++, sb, tb), b.B(P++, oa, tb)));
|
|
else if (2 === P)
|
|
if (Xa = Math.max(10, this.tg[Na.layer]), Va = Math.max(10, this.Qf[Na.layer]), U) 180 === this.fa ? oa <= Na.P.x ? (Aa = Na.P.x, b.B(P++, Aa - Xa, pa), b.B(P++, Aa, pa), b.B(P++, Aa + Va, pa)) : (b.B(P++, oa - Xa, pa), b.B(P++, oa, pa), b.B(P++, oa + Va, pa)) : 90 === this.fa ? pa >= Na.P.bottom ? (Aa = Na.P.y + Na.P.height, b.B(P++, oa, Aa + Va), b.B(P++, oa, Aa), b.B(P++,
|
|
oa, Aa - Xa)) : (b.B(P++, oa, pa + Va), b.B(P++, oa, pa), b.B(P++, oa, pa - Xa)) : 270 === this.fa ? pa <= Na.P.y ? (Aa = Na.P.y, b.B(P++, oa, Aa - Xa), b.B(P++, oa, Aa), b.B(P++, oa, Aa + Va)) : (b.B(P++, oa, pa - Xa), b.B(P++, oa, pa), b.B(P++, oa, pa + Va)) : 0 === this.fa && (oa >= Na.P.right ? (Aa = Na.P.x + Na.P.width, b.B(P++, Aa + Va, pa), b.B(P++, Aa, pa), b.B(P++, Aa - Xa, pa)) : (b.B(P++, oa + Va, pa), b.B(P++, oa, pa), b.B(P++, oa - Xa, pa)));
|
|
else {
|
|
b.B(P++, sb, gb);
|
|
var Ad = 0;
|
|
if (180 === this.fa || 0 === this.fa) {
|
|
if (180 === this.fa ? oa >= Na.P.right : oa <= Na.P.x) Ad = (0 === this.fa ? -Xa : Va) / 2;
|
|
b.B(P++, sb +
|
|
Ad, pa)
|
|
} else {
|
|
if (270 === this.fa ? pa >= Na.P.bottom : pa <= Na.P.y) Ad = (90 === this.fa ? -Xa : Va) / 2;
|
|
b.B(P++, oa, gb + Ad)
|
|
}
|
|
b.B(P++, oa, pa)
|
|
}
|
|
else Xa = Math.max(10, this.tg[ua.layer]), Va = Math.max(10, this.Qf[ua.layer]), 180 === this.fa ? (U && b.B(P++, oa - Xa, pa), b.B(P++, oa, pa), U && b.B(P++, oa + Va, pa)) : 90 === this.fa ? (U && b.B(P++, oa, pa + Va), b.B(P++, oa, pa), U && b.B(P++, oa, pa - Xa)) : 270 === this.fa ? (U && b.B(P++, oa, pa - Xa), b.B(P++, oa, pa), U && b.B(P++, oa, pa + Va)) : (U && b.B(P++, oa + Va, pa), b.B(P++, oa, pa), U && b.B(P++, oa - Xa, pa));
|
|
Na = ua
|
|
}
|
|
if (null === k || b.computeSpot(!1) !==
|
|
Yb || ea)
|
|
if (sb = b.m(P - 1).x, gb = b.m(P - 1).y, oa = b.m(P).x, pa = b.m(P).y, ea) {
|
|
var Qe = this.Qf[sa.layer],
|
|
ac = 0;
|
|
180 === this.fa || 0 === this.fa ? (ac = gb, ac >= sa.P.y && ac <= sa.P.bottom && (180 === this.fa ? oa >= sa.P.x : oa <= sa.P.right) && (Aa = sa.ra + (180 === this.fa ? -Qe : Qe), ac = ac < sa.P.y + sa.P.height / 2 ? sa.P.y - this.Td / 2 : sa.P.bottom + this.Td / 2, b.B(P++, Aa, gb), b.B(P++, Aa, ac)), b.B(P++, oa, ac)) : (ac = sb, ac >= sa.P.x && ac <= sa.P.right && (270 === this.fa ? pa >= sa.P.y : pa <= sa.P.bottom) && (Aa = sa.za + (270 === this.fa ? -Qe : Qe), ac = ac < sa.P.x + sa.P.width / 2 ? sa.P.x - this.Td /
|
|
2 : sa.P.right + this.Td / 2, b.B(P++, sb, Aa), b.B(P++, ac, Aa)), b.B(P++, ac, pa));
|
|
b.B(P++, oa, pa)
|
|
} else if (U) Xa = Math.max(10, this.tg[sa.layer]), Va = Math.max(10, this.Qf[sa.layer]), 180 === this.fa && oa >= sa.P.x ? (Aa = sa.P.x + sa.P.width, b.aa(P - 2, Aa, gb), b.aa(P - 1, Aa + Va, gb)) : 90 === this.fa && pa <= sa.P.bottom ? (Aa = sa.P.y, b.aa(P - 2, sb, Aa), b.aa(P - 1, sb, Aa - Xa)) : 270 === this.fa && pa >= sa.P.y ? (Aa = sa.P.y + sa.P.height, b.aa(P - 2, sb, Aa), b.aa(P - 1, sb, Aa + Va)) : 0 === this.fa && oa <= sa.P.right && (Aa = sa.P.x, b.aa(P - 2, Aa, gb), b.aa(P - 1, Aa - Xa, gb));
|
|
else {
|
|
Xa = Math.max(10,
|
|
this.tg[sa.layer]);
|
|
Va = Math.max(10, this.Qf[sa.layer]);
|
|
Ad = 0;
|
|
if (180 === this.fa || 0 === this.fa) {
|
|
if (180 === this.fa ? oa <= sa.P.x : oa >= sa.P.right) Ad = (0 === this.fa ? Va : -Xa) / 2;
|
|
b.B(P++, oa + Ad, gb)
|
|
} else {
|
|
if (270 === this.fa ? pa <= sa.P.y : pa >= sa.P.bottom) Ad = (90 === this.fa ? Va : -Xa) / 2;
|
|
b.B(P++, sb, pa + Ad)
|
|
}
|
|
b.B(P++, oa, pa)
|
|
}
|
|
} else {
|
|
for (; null !== sa && sa !== Na;) {
|
|
Ha = ua = null;
|
|
for (var Ig = sa.pc.i; Ig.next();) {
|
|
var Bd = Ig.value;
|
|
if (Bd.link === c.link && (ua = Bd.toVertex, Ha = Bd.fromVertex, null !== Ha.Bd && (Ha = null), null === ua.Bd)) break
|
|
}
|
|
var sb = 0,
|
|
gb = 0,
|
|
oa = 0,
|
|
pa = 0,
|
|
tb = 0,
|
|
Xa = 0,
|
|
Va = 0;
|
|
if (ua !== Na)
|
|
if (sb = b.m(P - 1).x, gb = b.m(P - 1).y, oa = ua.ra, pa = ua.za, ea)
|
|
if (180 === this.fa || 0 === this.fa) {
|
|
var Ae = null !== Ha ? Ha.za : gb;
|
|
Ae !== pa && (tb = this.Rb[ua.layer], 2 === P && (tb = 0 === this.fa ? Math.max(tb, sb) : Math.min(tb, sb)), b.B(P++, tb, gb), b.B(P++, tb, pa))
|
|
} else {
|
|
var Cd = null !== Ha ? Ha.ra : sb;
|
|
Cd !== oa && (tb = this.Rb[ua.layer], 2 === P && (tb = 90 === this.fa ? Math.max(tb, gb) : Math.min(tb, gb)), b.B(P++, sb, tb), b.B(P++, oa, tb))
|
|
}
|
|
else Xa = Math.max(10, this.tg[ua.layer]), Va = Math.max(10, this.Qf[ua.layer]), 180 === this.fa ? (b.B(P++, oa + Va, pa),
|
|
U && b.B(P++, oa, pa), b.B(P++, oa - Xa, pa)) : 90 === this.fa ? (b.B(P++, oa, pa - Xa), U && b.B(P++, oa, pa), b.B(P++, oa, pa + Va)) : 270 === this.fa ? (b.B(P++, oa, pa + Va), U && b.B(P++, oa, pa), b.B(P++, oa, pa - Xa)) : (b.B(P++, oa - Xa, pa), U && b.B(P++, oa, pa), b.B(P++, oa + Va, pa));
|
|
sa = ua
|
|
}
|
|
ea && (sb = b.m(P - 1).x, gb = b.m(P - 1).y, oa = b.m(P).x, pa = b.m(P).y, 180 === this.fa || 0 === this.fa ? gb !== pa && (tb = 0 === this.fa ? Math.min(Math.max((oa + sb) / 2, this.Rb[Na.layer]), oa) : Math.max(Math.min((oa + sb) / 2, this.Rb[Na.layer]), oa), b.B(P++, tb, gb), b.B(P++, tb, pa)) : sb !== oa && (tb = 90 === this.fa ?
|
|
Math.min(Math.max((pa + gb) / 2, this.Rb[Na.layer]), pa) : Math.max(Math.min((pa + gb) / 2, this.Rb[Na.layer]), pa), b.B(P++, sb, tb), b.B(P++, oa, tb)))
|
|
}
|
|
if (null !== d && U) {
|
|
if (null !== h) {
|
|
if (b.computeSpot(!0) === Yb) {
|
|
var me = b.m(0),
|
|
Rd = b.m(2);
|
|
me.N(Rd) || b.aa(1, (me.x + Rd.x) / 2, (me.y + Rd.y) / 2)
|
|
}
|
|
H = b.getLinkPoint(e, h, Yb, !0, !1, g, k);
|
|
H.F() || H.set(e.W.xl);
|
|
b.aa(0, H.x, H.y)
|
|
}
|
|
null !== k && (b.computeSpot(!1) === Yb && (me = b.m(b.sa - 1), Rd = b.m(b.sa - 3), me.N(Rd) || b.aa(b.sa - 2, (me.x + Rd.x) / 2, (me.y + Rd.y) / 2)), H = b.getLinkPoint(g, k, Yb, !1, !1, e, h), H.F() || H.set(g.W.xl),
|
|
b.aa(b.sa - 1, H.x, H.y))
|
|
}
|
|
b.cj();
|
|
c.commit()
|
|
}
|
|
}
|
|
}
|
|
for (var ne = new J(G), Jg = this.network.edges.i; Jg.next();) {
|
|
var fd = Jg.value.link;
|
|
null !== fd && fd.rc && !ne.contains(fd) && ne.add(fd)
|
|
}
|
|
if (0 < ne.count)
|
|
if (90 === this.fa || 270 === this.fa) {
|
|
for (var pi = 0, Ab = new J(ps), Qb, gd, lh = ne.i; lh.next();) {
|
|
var Lb = lh.value;
|
|
if (null !== Lb && Lb.rc)
|
|
for (var kb = 2; kb < Lb.sa - 3; kb++)
|
|
if (Qb = Lb.m(kb), gd = Lb.m(kb + 1), qs(Qb.y, gd.y) && !qs(Qb.x, gd.x)) {
|
|
var cb = new ps;
|
|
cb.layer = Math.floor(Qb.y / 2);
|
|
var Re = Lb.m(0),
|
|
Sd = Lb.m(Lb.sa - 1);
|
|
cb.first = Re.x * Re.x + Re.y;
|
|
cb.de = Sd.x * Sd.x +
|
|
Sd.y;
|
|
cb.Qe = Math.min(Qb.x, gd.x);
|
|
cb.ke = Math.max(Qb.x, gd.x);
|
|
cb.index = kb;
|
|
cb.link = Lb;
|
|
if (kb + 2 < Lb.sa) {
|
|
var Kg = Lb.m(kb - 1),
|
|
Lg = Lb.m(kb + 2),
|
|
kc = 0;
|
|
Kg.y < Qb.y ? kc = Lg.y < Qb.y ? 3 : Qb.x < gd.x ? 2 : 1 : Kg.y > Qb.y && (kc = Lg.y > Qb.y ? 0 : gd.x < Qb.x ? 2 : 1);
|
|
cb.pi = kc
|
|
}
|
|
Ab.add(cb)
|
|
}
|
|
}
|
|
if (1 < Ab.count) {
|
|
Ab.sort(this.DF);
|
|
for (var lc = 0; lc < Ab.count;) {
|
|
for (var oe = Ab.o[lc].layer, hd = lc + 1; hd < Ab.count && Ab.o[hd].layer === oe;) hd++;
|
|
if (1 < hd - lc)
|
|
for (var nb = lc; nb < hd;) {
|
|
for (var Uc = Ab.o[nb].ke, Qa = lc + 1; Qa < hd && Ab.o[Qa].Qe < Uc;) Uc = Math.max(Uc, Ab.o[Qa].ke), Qa++;
|
|
var ob = Qa - nb;
|
|
if (1 <
|
|
ob) {
|
|
Ab.dq(this.Hx, nb, nb + ob);
|
|
for (var yc = 1, Dd = Ab.o[nb].de, kb = nb; kb < Qa; kb++) {
|
|
var Mb = Ab.o[kb];
|
|
Mb.de !== Dd && (yc++, Dd = Mb.de)
|
|
}
|
|
Ab.dq(this.CF, nb, nb + ob);
|
|
for (var pe = 1, Dd = Ab.o[nb].first, kb = nb; kb < Qa; kb++) Mb = Ab.o[kb], Mb.first !== Dd && (pe++, Dd = Mb.first);
|
|
var tf = !0,
|
|
Se = pe;
|
|
yc < pe ? (tf = !1, Se = yc, Dd = Ab.o[nb].de, Ab.dq(this.Hx, nb, nb + ob)) : Dd = Ab.o[nb].first;
|
|
for (var Lf = 0, kb = nb; kb < Qa; kb++) {
|
|
Mb = Ab.o[kb];
|
|
(tf ? Mb.first : Mb.de) !== Dd && (Lf++, Dd = tf ? Mb.first : Mb.de);
|
|
Lb = Mb.link;
|
|
Qb = Lb.m(Mb.index);
|
|
gd = Lb.m(Mb.index + 1);
|
|
var Fb = this.YE * (Lf - (Se - 1) /
|
|
2);
|
|
if (!Lb.jj || rs(Qb.x, Qb.y + Fb, gd.x, gd.y + Fb)) pi++, Lb.Ul(), Lb.aa(Mb.index, Qb.x, Qb.y + Fb), Lb.aa(Mb.index + 1, gd.x, gd.y + Fb), Lb.cj()
|
|
}
|
|
}
|
|
nb = Qa
|
|
}
|
|
lc = hd
|
|
}
|
|
}
|
|
} else {
|
|
for (var Be = 0, Rb = new J(ps), Vb, Nb, Jc = ne.i; Jc.next();) {
|
|
var lb = Jc.value;
|
|
if (null !== lb && lb.rc)
|
|
for (var Gb = 2; Gb < lb.sa - 3; Gb++)
|
|
if (Vb = lb.m(Gb), Nb = lb.m(Gb + 1), qs(Vb.x, Nb.x) && !qs(Vb.y, Nb.y)) {
|
|
var Ob = new ps;
|
|
Ob.layer = Math.floor(Vb.x / 2);
|
|
var Td = lb.m(0),
|
|
Mg = lb.m(lb.sa - 1);
|
|
Ob.first = Td.x + Td.y * Td.y;
|
|
Ob.de = Mg.x + Mg.y * Mg.y;
|
|
Ob.Qe = Math.min(Vb.y, Nb.y);
|
|
Ob.ke = Math.max(Vb.y, Nb.y);
|
|
Ob.index =
|
|
Gb;
|
|
Ob.link = lb;
|
|
if (Gb + 2 < lb.sa) {
|
|
var mh = lb.m(Gb - 1),
|
|
nh = lb.m(Gb + 2),
|
|
Ce = 0;
|
|
mh.x < Vb.x ? Ce = nh.x < Vb.x ? 3 : Vb.y < Nb.y ? 2 : 1 : mh.x > Vb.x && (Ce = nh.x > Vb.x ? 0 : Nb.y < Vb.y ? 2 : 1);
|
|
Ob.pi = Ce
|
|
}
|
|
Rb.add(Ob)
|
|
}
|
|
}
|
|
if (1 < Rb.count) {
|
|
Rb.sort(this.DF);
|
|
for (var Kc = 0; Kc < Rb.count;) {
|
|
for (var De = Rb.o[Kc].layer, mc = Kc + 1; mc < Rb.count && Rb.o[mc].layer === De;) mc++;
|
|
if (1 < mc - Kc)
|
|
for (var Bb = Kc; Bb < mc;) {
|
|
for (var Cb = Rb.o[Bb].ke, Lc = Kc + 1; Lc < mc && Rb.o[Lc].Qe < Cb;) Cb = Math.max(Cb, Rb.o[Lc].ke), Lc++;
|
|
var Ng = Lc - Bb;
|
|
if (1 < Ng) {
|
|
Rb.dq(this.Hx, Bb, Bb + Ng);
|
|
for (var Vc = 1, Wc = Rb.o[Bb].de, Gb = Bb; Gb <
|
|
Lc; Gb++) {
|
|
var mb = Rb.o[Gb];
|
|
mb.de !== Wc && (Vc++, Wc = mb.de)
|
|
}
|
|
Rb.dq(this.CF, Bb, Bb + Ng);
|
|
for (var Mc = 1, Wc = Rb.o[Bb].first, Gb = Bb; Gb < Lc; Gb++) mb = Rb.o[Gb], mb.first !== Wc && (Mc++, Wc = mb.first);
|
|
var Ud = !0,
|
|
Vd = Mc;
|
|
Vc < Mc ? (Ud = !1, Vd = Vc, Wc = Rb.o[Bb].de, Rb.dq(this.Hx, Bb, Bb + Ng)) : Wc = Rb.o[Bb].first;
|
|
for (var uf = 0, Gb = Bb; Gb < Lc; Gb++) {
|
|
mb = Rb.o[Gb];
|
|
(Ud ? mb.first : mb.de) !== Wc && (uf++, Wc = Ud ? mb.first : mb.de);
|
|
lb = mb.link;
|
|
Vb = lb.m(mb.index);
|
|
Nb = lb.m(mb.index + 1);
|
|
var Og = this.YE * (uf - (Vd - 1) / 2);
|
|
if (!lb.jj || rs(Vb.x + Og, Vb.y, Nb.x + Og, Nb.y)) Be++, lb.Ul(), lb.aa(mb.index,
|
|
Vb.x + Og, Vb.y), lb.aa(mb.index + 1, Nb.x + Og, Nb.y), lb.cj()
|
|
}
|
|
}
|
|
Bb = Lc
|
|
}
|
|
Kc = mc
|
|
}
|
|
}
|
|
}
|
|
};
|
|
on.prototype.DF = function(a, b) {
|
|
return a instanceof ps && b instanceof ps && a !== b ? a.layer < b.layer ? -1 : a.layer > b.layer ? 1 : a.Qe < b.Qe ? -1 : a.Qe > b.Qe ? 1 : a.ke < b.ke ? -1 : a.ke > b.ke ? 1 : 0 : 0
|
|
};
|
|
on.prototype.CF = function(a, b) {
|
|
return a instanceof ps && b instanceof ps && a !== b ? a.first < b.first ? -1 : a.first > b.first || a.pi < b.pi ? 1 : a.pi > b.pi || a.Qe < b.Qe ? -1 : a.Qe > b.Qe ? 1 : a.ke < b.ke ? -1 : a.ke > b.ke ? 1 : 0 : 0
|
|
};
|
|
on.prototype.Hx = function(a, b) {
|
|
return a instanceof ps && b instanceof ps && a !== b ? a.de < b.de ? -1 : a.de > b.de || a.pi < b.pi ? 1 : a.pi > b.pi || a.Qe < b.Qe ? -1 : a.Qe > b.Qe ? 1 : a.ke < b.ke ? -1 : a.ke > b.ke ? 1 : 0 : 0
|
|
};
|
|
|
|
function qs(a, b) {
|
|
u && (z.p(a, on, "isApprox:a"), z.p(b, on, "isApprox:b"));
|
|
var c = a - b;
|
|
return -1 < c && 1 > c
|
|
}
|
|
|
|
function rs(a, b, c, d) {
|
|
u && (z.p(a, on, "isUnoccupied2:px"), z.p(b, on, "isUnoccupied2:py"), z.p(c, on, "isUnoccupied2:qx"), z.p(d, on, "isUnoccupied2:qy"));
|
|
return !0
|
|
}
|
|
|
|
function Hr(a, b) {
|
|
var c, d = a.ge[b];
|
|
if (d >= a.hh.length) {
|
|
c = [];
|
|
for (var e = 0; e < a.hh.length; e++) c[e] = a.hh[e];
|
|
a.hh = c
|
|
}
|
|
void 0 === a.hh[d] || null === a.hh[d] ? c = [] : (c = a.hh[d], a.hh[d] = null);
|
|
d = a.Vr[b];
|
|
for (e = 0; e < d.length; e++) {
|
|
var g = d[e];
|
|
c[g.index] = g
|
|
}
|
|
return c
|
|
}
|
|
|
|
function Ir(a, b, c) {
|
|
a.hh[a.ge[b]] = c
|
|
}
|
|
z.defineProperty(on, {
|
|
layerSpacing: "layerSpacing"
|
|
}, function() {
|
|
return this.qm
|
|
}, function(a) {
|
|
this.qm !== a && (z.g(a, "number", on, "layerSpacing"), 0 <= a && (this.qm = a, this.I()))
|
|
});
|
|
z.defineProperty(on, {
|
|
SD: "columnSpacing"
|
|
}, function() {
|
|
return this.Td
|
|
}, function(a) {
|
|
this.Td !== a && (z.g(a, "number", on, "columnSpacing"), 0 < a && (this.Td = a, this.I()))
|
|
});
|
|
z.defineProperty(on, {
|
|
direction: "direction"
|
|
}, function() {
|
|
return this.fa
|
|
}, function(a) {
|
|
this.fa !== a && (z.g(a, "number", on, "direction"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.fa = a, this.I()) : z.k("LayeredDigraphLayout.direction must be 0, 90, 180, or 270"))
|
|
});
|
|
z.defineProperty(on, {
|
|
angle: "angle"
|
|
}, function() {
|
|
return this.direction
|
|
}, function(a) {
|
|
this.direction = a
|
|
});
|
|
z.defineProperty(on, {
|
|
mH: "cycleRemoveOption"
|
|
}, function() {
|
|
return this.Tn
|
|
}, function(a) {
|
|
this.Tn !== a && (z.Ba(a, on, on, "cycleRemoveOption"), a === Ar || a === ur) && (this.Tn = a, this.I())
|
|
});
|
|
z.defineProperty(on, {
|
|
qI: "layeringOption"
|
|
}, function() {
|
|
return this.yo
|
|
}, function(a) {
|
|
this.yo !== a && (z.Ba(a, on, on, "layeringOption"), a === vr || a === Sr || a === Ur) && (this.yo = a, this.I())
|
|
});
|
|
z.defineProperty(on, {
|
|
bI: "initializeOption"
|
|
}, function() {
|
|
return this.oo
|
|
}, function(a) {
|
|
this.oo !== a && (z.Ba(a, on, on, "initializeOption"), a === wr || a === $r || a === Yr) && (this.oo = a, this.I())
|
|
});
|
|
z.defineProperty(on, {
|
|
MK: "iterations"
|
|
}, function() {
|
|
return this.om
|
|
}, function(a) {
|
|
this.om !== a && (z.p(a, zr, "iterations"), 0 <= a && (this.om = a, this.I()))
|
|
});
|
|
z.defineProperty(on, {
|
|
SG: "aggressiveOption"
|
|
}, function() {
|
|
return this.Gn
|
|
}, function(a) {
|
|
this.Gn !== a && (z.Ba(a, on, on, "aggressiveOption"), a === ds || a === xr || a === es) && (this.Gn = a, this.I())
|
|
});
|
|
z.defineProperty(on, {
|
|
hL: "packOption"
|
|
}, function() {
|
|
return this.Ri
|
|
}, function(a) {
|
|
this.Ri !== a && (z.g(a, "number", on, "packOption"), 0 <= a && 8 > a && (this.Ri = a, this.I()))
|
|
});
|
|
z.defineProperty(on, {
|
|
aq: "setsPortSpots"
|
|
}, function() {
|
|
return this.Zh
|
|
}, function(a) {
|
|
this.Zh !== a && (z.g(a, "boolean", on, "setsPortSpots"), this.Zh = a, this.I())
|
|
});
|
|
z.defineProperty(on, {
|
|
YE: "linkSpacing"
|
|
}, function() {
|
|
return this.Br
|
|
}, function(a) {
|
|
this.Br !== a && (z.g(a, "number", on, "linkSpacing"), 0 <= a && (this.Br = a, this.I()))
|
|
});
|
|
z.w(on, {
|
|
zI: "maxLayer"
|
|
}, function() {
|
|
return this.yb
|
|
});
|
|
z.w(on, {
|
|
RK: "maxIndex"
|
|
}, function() {
|
|
return this.Iv
|
|
});
|
|
z.w(on, {
|
|
QK: "maxColumn"
|
|
}, function() {
|
|
return this.Kb
|
|
});
|
|
z.w(on, {
|
|
WK: "minIndexLayer"
|
|
}, function() {
|
|
return this.Lr
|
|
});
|
|
z.w(on, {
|
|
SK: "maxIndexLayer"
|
|
}, function() {
|
|
return this.Rf
|
|
});
|
|
var ur;
|
|
on.CycleDepthFirst = ur = z.s(on, "CycleDepthFirst", 0);
|
|
var Ar;
|
|
on.CycleGreedy = Ar = z.s(on, "CycleGreedy", 1);
|
|
var vr;
|
|
on.LayerOptimalLinkLength = vr = z.s(on, "LayerOptimalLinkLength", 0);
|
|
var Sr;
|
|
on.LayerLongestPathSink = Sr = z.s(on, "LayerLongestPathSink", 1);
|
|
var Ur;
|
|
on.LayerLongestPathSource = Ur = z.s(on, "LayerLongestPathSource", 2);
|
|
var wr;
|
|
on.InitDepthFirstOut = wr = z.s(on, "InitDepthFirstOut", 0);
|
|
var $r;
|
|
on.InitDepthFirstIn = $r = z.s(on, "InitDepthFirstIn", 1);
|
|
var Yr;
|
|
on.InitNaive = Yr = z.s(on, "InitNaive", 2);
|
|
var ds;
|
|
on.AggressiveNone = ds = z.s(on, "AggressiveNone", 0);
|
|
var xr;
|
|
on.AggressiveLess = xr = z.s(on, "AggressiveLess", 1);
|
|
var es;
|
|
on.AggressiveMore = es = z.s(on, "AggressiveMore", 2);
|
|
on.PackNone = 0;
|
|
var fs;
|
|
on.PackExpand = fs = 1;
|
|
var gs;
|
|
on.PackStraighten = gs = 2;
|
|
var is;
|
|
on.PackMedian = is = 4;
|
|
var yr;
|
|
on.PackAll = yr = 7;
|
|
|
|
function ps() {
|
|
this.index = this.ke = this.Qe = this.de = this.first = this.layer = 0;
|
|
this.link = null;
|
|
this.pi = 0
|
|
}
|
|
z.Yd(ps, {
|
|
layer: !0,
|
|
first: !0,
|
|
de: !0,
|
|
Qe: !0,
|
|
ke: !0,
|
|
index: !0,
|
|
link: !0,
|
|
pi: !0
|
|
});
|
|
|
|
function zr() {
|
|
wa.call(this)
|
|
}
|
|
z.Qa(zr, wa);
|
|
z.ia("LayeredDigraphNetwork", zr);
|
|
zr.prototype.createVertex = function() {
|
|
return new ss
|
|
};
|
|
zr.prototype.createEdge = function() {
|
|
return new ts
|
|
};
|
|
|
|
function ss() {
|
|
xa.call(this);
|
|
this.index = this.column = this.layer = -1;
|
|
this.component = NaN;
|
|
this.near = null;
|
|
this.valid = !1;
|
|
this.finish = this.jp = NaN;
|
|
this.Um = 0;
|
|
this.xA = this.yA = null
|
|
}
|
|
z.Qa(ss, xa);
|
|
z.ia("LayeredDigraphVertex", ss);
|
|
|
|
function ts() {
|
|
ya.call(this);
|
|
this.forest = this.rev = this.valid = !1;
|
|
this.portToPos = this.portFromPos = NaN;
|
|
this.portToColOffset = this.portFromColOffset = 0
|
|
}
|
|
z.Qa(ts, ya);
|
|
z.ia("LayeredDigraphEdge", ts);
|
|
|
|
function Y() {
|
|
0 < arguments.length && z.od(Y);
|
|
vg.call(this);
|
|
this.Fd = new K(Object);
|
|
this.ds = us;
|
|
this.Of = vs;
|
|
this.Zs = ws;
|
|
this.Gv = xs;
|
|
this.rB = null;
|
|
this.Ih = !0;
|
|
this.qd = ys;
|
|
this.lg = (new Ea(10, 10)).freeze();
|
|
this.wa = new zs;
|
|
this.ya = new zs;
|
|
this.nz = []
|
|
}
|
|
z.Qa(Y, vg);
|
|
z.ia("TreeLayout", Y);
|
|
Y.prototype.cloneProtected = function(a) {
|
|
vg.prototype.cloneProtected.call(this, a);
|
|
a.ds = this.ds;
|
|
a.Zs = this.Zs;
|
|
a.Gv = this.Gv;
|
|
a.Ih = this.Ih;
|
|
a.qd = this.qd;
|
|
a.lg.assign(this.lg);
|
|
a.wa.copyInheritedPropertiesFrom(this.wa);
|
|
a.ya.copyInheritedPropertiesFrom(this.ya)
|
|
};
|
|
Y.prototype.createNetwork = function() {
|
|
return new As
|
|
};
|
|
Y.prototype.makeNetwork = function(a) {
|
|
function b(a) {
|
|
if (a instanceof E) return !a.Df && "Comment" !== a.nc;
|
|
if (a instanceof G) {
|
|
var b = a.Y;
|
|
if (null === b || b.Df || "Comment" === b.nc) return !1;
|
|
a = a.da;
|
|
return null === a || a.Df || "Comment" === a.nc ? !1 : !0
|
|
}
|
|
return !1
|
|
}
|
|
var c = this.createNetwork();
|
|
c.Sb = this;
|
|
a instanceof C ? (c.ik(a.Lg, !0, b), c.ik(a.links, !0, b)) : a instanceof F ? c.ik(a.Hc, !1, b) : c.ik(a.i, !1, b);
|
|
return c
|
|
};
|
|
Y.prototype.doLayout = function(a) {
|
|
null === a && z.k("Layout.doLayout(collection) argument must not be null but a Diagram, a Group, or an Iterable of Parts");
|
|
null === this.network && (this.network = this.makeNetwork(a));
|
|
this.Xf !== Bs && (this.je = this.initialOrigin(this.je));
|
|
var b = this.h;
|
|
null === b && a instanceof C && (b = a);
|
|
this.Of = this.path === us && null !== b ? b.ce ? vs : Cs : this.path === us ? vs : this.path;
|
|
if (0 < this.network.vertexes.count) {
|
|
this.network.Sw();
|
|
for (a = this.network.vertexes.i; a.next();) b = a.value, b.initialized = !1, b.level =
|
|
0, b.parent = null, b.children = [];
|
|
if (0 < this.Fd.count) {
|
|
a = new K(zs);
|
|
for (b = this.Fd.i; b.next();) {
|
|
var c = b.value;
|
|
c instanceof E ? (c = this.network.en(c), null !== c && a.add(c)) : c instanceof zs && a.add(c)
|
|
}
|
|
this.Fd = a
|
|
}
|
|
0 === this.Fd.count && this.findRoots();
|
|
for (a = this.Fd.copy().i; a.next();) b = a.value, b.initialized || (b.initialized = !0, Ds(this, b));
|
|
for (a = this.Fd.i; a.next();) b = a.value, b instanceof zs && Es(this, b);
|
|
for (a = this.Fd.i; a.next();) b = a.value, b instanceof zs && Fs(this, b);
|
|
for (a = this.Fd.i; a.next();) b = a.value, b instanceof zs &&
|
|
Gs(this, b);
|
|
this.Bz();
|
|
if (this.kA === Hs) {
|
|
c = [];
|
|
for (a = this.network.vertexes.i; a.next();) {
|
|
var d = a.value,
|
|
b = d.parent;
|
|
null === b && (b = d);
|
|
var b = 0 === b.angle || 180 === b.angle,
|
|
e = c[d.level];
|
|
void 0 === e && (e = 0);
|
|
c[d.level] = Math.max(e, b ? d.width : d.height)
|
|
}
|
|
for (d = 0; d < c.length; d++) void 0 === c[d] && (c[d] = 0);
|
|
this.rB = c;
|
|
for (a = this.network.vertexes.i; a.next();) d = a.value, b = d.parent, null === b && (b = d), 0 === b.angle || 180 === b.angle ? (180 === b.angle && (d.Ct += c[d.level] - d.width), d.width = c[d.level]) : (270 === b.angle && (d.Dt += c[d.level] - d.height), d.height =
|
|
c[d.level])
|
|
} else if (this.kA === Is)
|
|
for (a = this.network.vertexes.i; a.next();) {
|
|
c = a.value;
|
|
b = 0 === c.angle || 180 === c.angle;
|
|
e = -1;
|
|
for (d = 0; d < c.children.length; d++) var g = c.children[d],
|
|
e = Math.max(e, b ? g.width : g.height);
|
|
if (0 <= e)
|
|
for (d = 0; d < c.children.length; d++) g = c.children[d], b ? (180 === c.angle && (g.Ct += e - g.width), g.width = e) : (270 === c.angle && (g.Dt += e - g.height), g.height = e)
|
|
}
|
|
for (a = this.Fd.i; a.next();) b = a.value, b instanceof zs && this.layoutTree(b);
|
|
this.arrangeTrees();
|
|
this.updateParts()
|
|
}
|
|
this.network = null;
|
|
this.Fd = new K(Object);
|
|
this.Gf = !0
|
|
};
|
|
Y.prototype.findRoots = function() {
|
|
for (var a = this.network.vertexes.i; a.next();) {
|
|
var b = a.value;
|
|
switch (this.Of) {
|
|
case vs:
|
|
0 === b.tc.count && this.Fd.add(b);
|
|
break;
|
|
case Cs:
|
|
0 === b.pc.count && this.Fd.add(b);
|
|
break;
|
|
default:
|
|
z.k("Unhandled path value " + this.Of.toString())
|
|
}
|
|
}
|
|
if (0 === this.Fd.count) {
|
|
for (var a = 999999, b = null, c = this.network.vertexes.i; c.next();) {
|
|
var d = c.value;
|
|
switch (this.Of) {
|
|
case vs:
|
|
d.tc.count < a && (a = d.tc.count, b = d);
|
|
break;
|
|
case Cs:
|
|
d.pc.count < a && (a = d.pc.count, b = d);
|
|
break;
|
|
default:
|
|
z.k("Unhandled path value " + this.Of.toString())
|
|
}
|
|
}
|
|
null !==
|
|
b && this.Fd.add(b)
|
|
}
|
|
};
|
|
|
|
function Ds(a, b) {
|
|
if (null !== b) {
|
|
u && z.l(b, zs, Y, "walkTree:v");
|
|
switch (a.Of) {
|
|
case vs:
|
|
if (0 < b.pc.count) {
|
|
for (var c = new J(zs), d = b.rH; d.next();) {
|
|
var e = d.value;
|
|
Js(a, b, e) && c.add(e)
|
|
}
|
|
0 < c.count && (b.children = c.jc())
|
|
}
|
|
break;
|
|
case Cs:
|
|
if (0 < b.tc.count) {
|
|
c = new J(zs);
|
|
for (d = b.oJ; d.next();) e = d.value, Js(a, b, e) && c.add(e);
|
|
0 < c.count && (b.children = c.jc())
|
|
}
|
|
break;
|
|
default:
|
|
z.k("Unhandled path value" + a.Of.toString())
|
|
}
|
|
c = b.children;
|
|
d = c.length;
|
|
for (e = 0; e < d; e++) {
|
|
var g = c[e];
|
|
g.initialized = !0;
|
|
g.level = b.level + 1;
|
|
g.parent = b;
|
|
a.Fd.remove(g)
|
|
}
|
|
for (e = 0; e <
|
|
d; e++) g = c[e], Ds(a, g)
|
|
}
|
|
}
|
|
|
|
function Js(a, b, c) {
|
|
u && z.l(b, zs, Y, "walkOK:v");
|
|
u && z.l(c, zs, Y, "walkOK:c");
|
|
if (c.initialized) {
|
|
var d;
|
|
if (null === b) d = !1;
|
|
else {
|
|
u && z.l(c, zs, Y, "isAncestor:a");
|
|
u && z.l(b, zs, Y, "isAncestor:b");
|
|
for (d = b.parent; null !== d && d !== c;) d = d.parent;
|
|
d = d === c
|
|
}
|
|
if (d || c.level > b.level) return !1;
|
|
a.removeChild(c.parent, c)
|
|
}
|
|
return !0
|
|
}
|
|
Y.prototype.removeChild = function(a, b) {
|
|
if (null !== a && null !== b) {
|
|
u && z.l(a, zs, Y, "removeChild:p");
|
|
u && z.l(b, zs, Y, "removeChild:c");
|
|
for (var c = a.children, d = 0, e = 0; e < c.length; e++) c[e] === b && d++;
|
|
if (0 < d) {
|
|
for (var d = Array(c.length - d), g = 0, e = 0; e < c.length; e++) c[e] !== b && (d[g++] = c[e]);
|
|
a.children = d
|
|
}
|
|
}
|
|
};
|
|
|
|
function Es(a, b) {
|
|
if (null !== b) {
|
|
u && z.l(b, zs, Y, "initializeTree:v");
|
|
a.initializeTreeVertexValues(b);
|
|
b.alignment === Ks && a.sortTreeVertexChildren(b);
|
|
for (var c = 0, d = b.Wm, e = 0, g = b.children, h = g.length, k = 0; k < h; k++) {
|
|
var l = g[k];
|
|
Es(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 Ls(a, b) {
|
|
u && z.l(b, zs, Y, "mom:v");
|
|
switch (a.Zs) {
|
|
default:
|
|
case ws:
|
|
return null !== b.parent ? b.parent : a.wa;
|
|
case Ms:
|
|
return null === b.parent ? a.wa : null === b.parent.parent ? a.ya : b.parent;
|
|
case Ns:
|
|
return null !== b.parent ? null !== b.parent.parent ? b.parent.parent : a.ya : a.wa;
|
|
case Os:
|
|
var c = !0;
|
|
if (0 === b.Wm) c = !1;
|
|
else
|
|
for (var d = b.children, e = d.length, g = 0; g < e; g++)
|
|
if (0 < d[g].Wm) {
|
|
c = !1;
|
|
break
|
|
} return c && null !== b.parent ? a.ya : null !== b.parent ? b.parent : a.wa
|
|
}
|
|
}
|
|
Y.prototype.initializeTreeVertexValues = function(a) {
|
|
u && z.l(a, zs, Y, "initializeTreeVertexValues:v");
|
|
var b = Ls(this, a);
|
|
a.copyInheritedPropertiesFrom(b);
|
|
if (null !== a.parent && a.parent.alignment === Ks) {
|
|
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 Fs(a, b) {
|
|
if (null !== b) {
|
|
u && z.l(b, zs, Y, "assignTree:v");
|
|
a.assignTreeVertexValues(b);
|
|
for (var c = b.children, d = c.length, e = 0; e < d; e++) Fs(a, c[e])
|
|
}
|
|
}
|
|
Y.prototype.assignTreeVertexValues = function() {};
|
|
|
|
function Gs(a, b) {
|
|
if (null !== b) {
|
|
u && z.l(b, zs, Y, "sortTree:v");
|
|
b.alignment !== Ks && a.sortTreeVertexChildren(b);
|
|
for (var c = b.children, d = c.length, e = 0; e < d; e++) Gs(a, c[e])
|
|
}
|
|
}
|
|
Y.prototype.sortTreeVertexChildren = function(a) {
|
|
u && z.l(a, zs, Y, "sortTreeVertexChildren:v");
|
|
switch (a.sorting) {
|
|
case Ps:
|
|
break;
|
|
case Qs:
|
|
a.children.reverse();
|
|
break;
|
|
case Rs:
|
|
a.children.sort(a.comparer);
|
|
break;
|
|
case Ss:
|
|
a.children.sort(a.comparer);
|
|
a.children.reverse();
|
|
break;
|
|
default:
|
|
z.k("Unhandled sorting value " + a.sorting.toString())
|
|
}
|
|
};
|
|
Y.prototype.Bz = function() {
|
|
if (this.comments)
|
|
for (var a = this.network.vertexes.i; a.next();) this.addComments(a.value)
|
|
};
|
|
Y.prototype.addComments = function(a) {
|
|
u && z.l(a, zs, Y, "addComments:v");
|
|
var b = a.angle,
|
|
c = a.parent,
|
|
d = 0,
|
|
e = Ts,
|
|
e = !1;
|
|
null !== c && (d = c.angle, e = c.alignment, e = Us(e));
|
|
var b = 90 === b || 270 === b,
|
|
d = 90 === d || 270 === d,
|
|
c = 0 === a.Wm,
|
|
g = 0,
|
|
h = 0,
|
|
k = 0,
|
|
l = a.commentSpacing;
|
|
if (null !== a.Pc)
|
|
for (var m = a.Pc.rE(); m.next();) {
|
|
var n = m.value;
|
|
"Comment" === n.nc && n.canLayout() && (null === a.comments && (a.comments = []), a.comments.push(n), n.Bf(), n = n.Ia, b && !c || !e && !d && c || e && d && c ? (g = Math.max(g, n.width), h += n.height + Math.abs(k)) : (g += n.width + Math.abs(k), h = Math.max(h,
|
|
n.height)), k = l)
|
|
}
|
|
null !== a.comments && (b && !c || !e && !d && c || e && d && c ? (g += Math.abs(a.commentMargin), h = Math.max(0, h - a.height)) : (h += Math.abs(a.commentMargin), g = Math.max(0, g - a.width)), e = z.yk(0, 0, a.P.width + g, a.P.height + h), a.vb = e, z.dc(e))
|
|
};
|
|
|
|
function Us(a) {
|
|
return a === Vs || a === Ks || a === Ws || a === Xs
|
|
}
|
|
|
|
function Ys(a) {
|
|
return a === Vs || a === Ks
|
|
}
|
|
|
|
function Zs(a) {
|
|
u && z.l(a, zs, Y, "isLeftSideBus:v");
|
|
var b = a.parent;
|
|
if (null !== b) {
|
|
var c = b.alignment;
|
|
if (Us(c)) {
|
|
if (Ys(c)) {
|
|
b = b.children;
|
|
for (c = 0; c < b.length && a !== b[c];) c++;
|
|
return 0 === c % 2
|
|
}
|
|
if (c === Ws) return !0
|
|
}
|
|
}
|
|
return !1
|
|
}
|
|
Y.prototype.layoutComments = function(a) {
|
|
u && z.l(a, zs, Y, "layoutComments:v");
|
|
if (null !== a.comments) {
|
|
var b = a.Pc.Ia,
|
|
c = a.parent,
|
|
d = a.angle,
|
|
e = 0,
|
|
g = Ts,
|
|
g = !1;
|
|
null !== c && (e = c.angle, g = c.alignment, g = Us(g));
|
|
for (var c = 90 === d || 270 === d, d = 90 === e || 270 === e, h = 0 === a.Wm, k = Zs(a), l = 0, m = a.comments, n = m.length, p = z.O(), q = 0; q < n; q++) {
|
|
var r = m[q],
|
|
s = r.Ia;
|
|
if (c && !h || !g && !d && h || g && d && h) {
|
|
if (135 < e && !g || d && k)
|
|
if (0 <= a.commentMargin)
|
|
for (p.n(a.P.x - a.commentMargin - s.width, a.P.y + l), r.move(p), r = r.Hg(); r.next();) {
|
|
var t = r.value;
|
|
t.Db = $c;
|
|
t.Eb = ad
|
|
} else
|
|
for (p.n(a.P.x +
|
|
2 * a.R.x - a.commentMargin, a.P.y + l), r.move(p), r = r.Hg(); r.next();) t = r.value, t.Db = ad, t.Eb = $c;
|
|
else if (0 <= a.commentMargin)
|
|
for (p.n(a.P.x + 2 * a.R.x + a.commentMargin, a.P.y + l), r.move(p), r = r.Hg(); r.next();) t = r.value, t.Db = ad, t.Eb = $c;
|
|
else
|
|
for (p.n(a.P.x + a.commentMargin - s.width, a.P.y + l), r.move(p), r = r.Hg(); r.next();) t = r.value, t.Db = $c, t.Eb = ad;
|
|
l = 0 <= a.commentSpacing ? l + (s.height + a.commentSpacing) : l + (a.commentSpacing - s.height)
|
|
} else {
|
|
if (135 < e && !g || !d && k)
|
|
if (0 <= a.commentMargin)
|
|
for (p.n(a.P.x + l, a.P.y - a.commentMargin - s.height),
|
|
r.move(p), r = r.Hg(); r.next();) t = r.value, t.Db = Zc, t.Eb = bd;
|
|
else
|
|
for (p.n(a.P.x + l, a.P.y + 2 * a.R.y - a.commentMargin), r.move(p), r = r.Hg(); r.next();) t = r.value, t.Db = bd, t.Eb = Zc;
|
|
else if (0 <= a.commentMargin)
|
|
for (p.n(a.P.x + l, a.P.y + 2 * a.R.y + a.commentMargin), r.move(p), r = r.Hg(); r.next();) t = r.value, t.Db = bd, t.Eb = Zc;
|
|
else
|
|
for (p.n(a.P.x + l, a.P.y + a.commentMargin - s.height), r.move(p), r = r.Hg(); r.next();) t = r.value, t.Db = Zc, t.Eb = bd;
|
|
l = 0 <= a.commentSpacing ? l + (s.width + a.commentSpacing) : l + (a.commentSpacing - s.width)
|
|
}
|
|
}
|
|
z.A(p);
|
|
b = l - a.commentSpacing -
|
|
(c ? b.height : b.width);
|
|
if (this.Of === vs)
|
|
for (e = a.pc; e.next();) a = e.value.link, null === a || a.jj || (a.Il = 0 < b ? b : NaN);
|
|
else
|
|
for (e = a.tc; e.next();) a = e.value.link, null === a || a.jj || (a.Yl = 0 < b ? b : NaN)
|
|
}
|
|
};
|
|
Y.prototype.layoutTree = function(a) {
|
|
if (null !== a) {
|
|
u && z.l(a, zs, Y, "layoutTree:v");
|
|
for (var b = a.children, c = b.length, d = 0; d < c; d++) this.layoutTree(b[d]);
|
|
switch (a.compaction) {
|
|
case $s:
|
|
at(this, a);
|
|
break;
|
|
case bt:
|
|
if (a.alignment === Ks) at(this, a);
|
|
else if (u && z.l(a, zs, Y, "layoutTreeBlock:v"), 0 === a.Wm) {
|
|
var d = a.parent,
|
|
b = !1,
|
|
c = 0,
|
|
e = Ts;
|
|
null !== d && (c = d.angle, e = d.alignment, b = Us(e));
|
|
d = Zs(a);
|
|
a.qa.n(0, 0);
|
|
a.ob.n(a.width, a.height);
|
|
null === a.parent || null === a.comments || (180 !== c && 270 !== c || b) && !d ? a.Ta.n(0, 0) : 180 === c && !b || (90 === c || 270 ===
|
|
c) && d ? a.Ta.n(a.width - 2 * a.R.x, 0) : a.Ta.n(0, a.height - 2 * a.R.y);
|
|
a.Vt = null;
|
|
a.mu = null
|
|
} else {
|
|
for (var g = ct(a), b = 90 === g || 270 === g, h = 0, k = a.children, l = k.length, m = 0; m < l; m++) var n = k[m],
|
|
h = Math.max(h, b ? n.ob.width : n.ob.height);
|
|
var p = a.alignment,
|
|
d = p === dt,
|
|
q = p === et,
|
|
r = Us(p),
|
|
s = Math.max(0, a.breadthLimit),
|
|
c = ft(a),
|
|
t = a.nodeSpacing,
|
|
v = gt(a),
|
|
x = a.rowSpacing,
|
|
y = 0;
|
|
if (d || q || a.Wp || a.Xp && 1 === a.maxGenerationCount) y = Math.max(0, a.rowIndent);
|
|
var d = a.width,
|
|
e = a.height,
|
|
A = 0,
|
|
B = 0,
|
|
L = 0,
|
|
H = null,
|
|
U = null,
|
|
ea = 0,
|
|
W = 0,
|
|
P = 0,
|
|
ba = 0,
|
|
Oa = 0,
|
|
sa = 0,
|
|
Na = 0,
|
|
ua = 0,
|
|
n = 0;
|
|
r && !Ys(p) &&
|
|
135 < g && k.reverse();
|
|
if (Ys(p))
|
|
if (1 < l)
|
|
for (m = 0; m < l; m++) 0 === m % 2 && m !== l - 1 ? ua = Math.max(ua, b ? k[m].ob.width : k[m].ob.height) : 0 !== m % 2 && (n = Math.max(n, b ? k[m].ob.width : k[m].ob.height));
|
|
else 1 === l && (ua = b ? k[0].ob.width : k[0].ob.height);
|
|
if (r) {
|
|
switch (p) {
|
|
case Vs:
|
|
W = 135 > g ? ht(a, k, ua, A, B) : it(a, k, ua, A, B);
|
|
ua = W.x;
|
|
A = W.width;
|
|
B = W.height;
|
|
break;
|
|
case Ws:
|
|
for (m = 0; m < l; m++) {
|
|
var n = k[m],
|
|
Ha = n.ob,
|
|
H = 0 === sa ? 0 : x;
|
|
b ? (n.qa.n(h - Ha.width, ba + H), A = Math.max(A, Ha.width), B = Math.max(B, ba + H + Ha.height), ba += H + Ha.height) : (n.qa.n(P + H, h - Ha.height), A = Math.max(A,
|
|
P + H + Ha.width), B = Math.max(B, Ha.height), P += H + Ha.width);
|
|
sa++
|
|
}
|
|
break;
|
|
case Xs:
|
|
for (m = 0; m < l; m++) n = k[m], Ha = n.ob, H = 0 === sa ? 0 : x, b ? (n.qa.n(t / 2 + a.R.x, ba + H), A = Math.max(A, Ha.width), B = Math.max(B, ba + H + Ha.height), ba += H + Ha.height) : (n.qa.n(P + H, t / 2 + a.R.y), A = Math.max(A, P + H + Ha.width), B = Math.max(B, Ha.height), P += H + Ha.width), sa++
|
|
}
|
|
H = jt(this, 2);
|
|
U = jt(this, 2);
|
|
b ? (H[0].n(0, 0), H[1].n(0, B), U[0].n(A, 0)) : (H[0].n(0, 0), H[1].n(A, 0), U[0].n(0, B));
|
|
U[1].n(A, B)
|
|
} else
|
|
for (m = 0; m < l; m++) {
|
|
n = k[m];
|
|
Ha = n.ob;
|
|
if (b) {
|
|
0 < s && 0 < sa && P + t + Ha.width > s && (P < h && pt(a,
|
|
p, h - P, 0, Na, m - 1), Oa++, sa = 0, Na = m, L = B, P = 0, ba = 135 < g ? -B - x : B + x);
|
|
qt(this, n, 0, ba);
|
|
var Aa = 0;
|
|
if (0 === sa) {
|
|
if (H = n.Vt, U = n.mu, ea = Ha.width, W = Ha.height, null === H || null === U || g !== ct(n)) H = jt(this, 2), U = jt(this, 2), H[0].n(0, 0), H[1].n(0, W), U[0].n(ea, 0), U[1].n(ea, W)
|
|
} else {
|
|
var jc = z.rb(),
|
|
W = rt(this, a, n, H, U, ea, W, jc),
|
|
Aa = W.x,
|
|
H = jc[0],
|
|
U = jc[1],
|
|
ea = W.width,
|
|
W = W.height;
|
|
z.xa(jc);
|
|
P < Ha.width && 0 > Aa && (st(a, -Aa, 0, Na, m - 1), tt(H, -Aa, 0), tt(U, -Aa, 0), Aa = 0)
|
|
}
|
|
n.qa.n(Aa, ba);
|
|
A = Math.max(A, ea);
|
|
B = Math.max(B, L + (0 === Oa ? 0 : x) + Ha.height);
|
|
P = ea
|
|
} else {
|
|
0 < s && 0 < sa && ba +
|
|
t + Ha.height > s && (ba < h && pt(a, p, 0, h - ba, Na, m - 1), Oa++, sa = 0, Na = m, L = A, ba = 0, P = 135 < g ? -A - x : A + x);
|
|
qt(this, n, P, 0);
|
|
Aa = 0;
|
|
if (0 === sa) {
|
|
if (H = n.Vt, U = n.mu, ea = Ha.width, W = Ha.height, null === H || null === U || g !== ct(n)) H = jt(this, 2), U = jt(this, 2), H[0].n(0, 0), H[1].n(ea, 0), U[0].n(0, W), U[1].n(ea, W)
|
|
} else jc = z.rb(), W = rt(this, a, n, H, U, ea, W, jc), Aa = W.x, H = jc[0], U = jc[1], ea = W.width, W = W.height, z.xa(jc), ba < Ha.height && 0 > Aa && (st(a, 0, -Aa, Na, m - 1), tt(H, 0, -Aa), tt(U, 0, -Aa), Aa = 0);
|
|
n.qa.n(P, Aa);
|
|
B = Math.max(B, W);
|
|
A = Math.max(A, L + (0 === Oa ? 0 : x) + Ha.width);
|
|
ba = W
|
|
}
|
|
sa++
|
|
}
|
|
0 <
|
|
Oa && (b ? (B += Math.max(0, c), P < A && pt(a, p, A - P, 0, Na, l - 1), 0 < y && (q || st(a, y, 0, 0, l - 1), A += y)) : (A += Math.max(0, c), ba < B && pt(a, p, 0, B - ba, Na, l - 1), 0 < y && (q || st(a, 0, y, 0, l - 1), B += y)));
|
|
q = h = 0;
|
|
switch (p) {
|
|
case ut:
|
|
b ? h += A / 2 - a.R.x - v / 2 : q += B / 2 - a.R.y - v / 2;
|
|
break;
|
|
case Ts:
|
|
0 < Oa ? b ? h += A / 2 - a.R.x - v / 2 : q += B / 2 - a.R.y - v / 2 : b ? (m = k[0].qa.x + k[0].Ta.x, ua = k[l - 1].qa.x + k[l - 1].Ta.x + 2 * k[l - 1].R.x, h += m + (ua - m) / 2 - a.R.x - v / 2) : (m = k[0].qa.y + k[0].Ta.y, ua = k[l - 1].qa.y + k[l - 1].Ta.y + 2 * k[l - 1].R.y, q += m + (ua - m) / 2 - a.R.y - v / 2);
|
|
break;
|
|
case dt:
|
|
b ? (h -= v, A += v) : (q -= v, B += v);
|
|
break;
|
|
case et:
|
|
b ? (h += A - a.width + v, A += v) : (q += B - a.height + v, B += v);
|
|
break;
|
|
case Vs:
|
|
b ? h = 1 < l ? h + (ua + t / 2 - a.R.x) : h + (k[0].R.x - a.R.x + k[0].Ta.x) : q = 1 < l ? q + (ua + t / 2 - a.R.y) : q + (k[0].R.y - a.R.y + k[0].Ta.y);
|
|
break;
|
|
case Ws:
|
|
b ? h += A + t / 2 - a.R.x : q += B + t / 2 - a.R.y;
|
|
break;
|
|
case Xs:
|
|
break;
|
|
default:
|
|
z.k("Unhandled alignment value " + p.toString())
|
|
}
|
|
for (m = 0; m < l; m++) n = k[m], b ? n.qa.n(n.qa.x + n.Ta.x - h, n.qa.y + (135 < g ? (r ? -B : -n.ob.height) + n.Ta.y - c : e + c + n.Ta.y)) : n.qa.n(n.qa.x + (135 < g ? (r ? -A : -n.ob.width) + n.Ta.x - c : d + c + n.Ta.x), n.qa.y + n.Ta.y - q);
|
|
l = k = 0;
|
|
r ? b ? (A = vt(a, A, h),
|
|
0 > h && (h = 0), 135 < g && (q += B + c), B += e + c, p === Xs && (k += t / 2 + a.R.x), l += e + c) : (135 < g && (h += A + c), A += d + c, B = wt(a, B, q), 0 > q && (q = 0), p === Xs && (l += t / 2 + a.R.y), k += d + c) : b ? (null === a.comments ? d > A && (p = xt(p, d - A, 0), k = p.x, l = p.y, A = d, h = 0) : A = vt(a, A, h), 0 > h && (k -= h, h = 0), 135 < g && (q += B + c), B = Math.max(Math.max(B, e), B + e + c), l += e + c) : (135 < g && (h += A + c), A = Math.max(Math.max(A, d), A + d + c), null === a.comments ? e > B && (p = xt(p, 0, e - B), k = p.x, l = p.y, B = e, q = 0) : B = wt(a, B, q), 0 > q && (l -= q, q = 0), k += d + c);
|
|
if (0 < Oa) g = jt(this, 4), p = jt(this, 4), b ? (g[2].n(0, e + c), g[3].n(g[2].x, B),
|
|
p[2].n(A, g[2].y), p[3].n(p[2].x, g[3].y)) : (g[2].n(d + c, 0), g[3].n(A, g[2].y), p[2].n(g[2].x, B), p[3].n(g[3].x, p[2].y));
|
|
else {
|
|
g = jt(this, H.length + 2);
|
|
p = jt(this, U.length + 2);
|
|
for (m = 0; m < H.length; m++) r = H[m], g[m + 2].n(r.x + k, r.y + l);
|
|
for (m = 0; m < U.length; m++) r = U[m], p[m + 2].n(r.x + k, r.y + l)
|
|
}
|
|
b ? (g[0].n(h, 0), g[1].n(g[0].x, e), g[2].y < g[1].y && (g[2].x > g[0].x ? g[2].assign(g[1]) : g[1].assign(g[2])), g[3].y < g[2].y && (g[3].x > g[0].x ? g[3].assign(g[2]) : g[2].assign(g[3])), p[0].n(h + d, 0), p[1].n(p[0].x, e), p[2].y < p[1].y && (p[2].x < p[0].x ? p[2].assign(p[1]) :
|
|
p[1].assign(p[2])), p[3].y < p[2].y && (p[3].x < p[0].x ? p[3].assign(p[2]) : p[2].assign(p[3])), g[2].y -= c / 2, p[2].y -= c / 2) : (g[0].n(0, q), g[1].n(d, g[0].y), g[2].x < g[1].x && (g[2].y > g[0].y ? g[2].assign(g[1]) : g[1].assign(g[2])), g[3].x < g[2].x && (g[3].y > g[0].y ? g[3].assign(g[2]) : g[2].assign(g[3])), p[0].n(0, q + e), p[1].n(d, p[0].y), p[2].x < p[1].x && (p[2].y < p[0].y ? p[2].assign(p[1]) : p[1].assign(p[2])), p[3].x < p[2].x && (p[3].y < p[0].y ? p[3].assign(p[2]) : p[2].assign(p[3])), g[2].x -= c / 2, p[2].x -= c / 2);
|
|
yt(this, H);
|
|
yt(this, U);
|
|
a.Vt = g;
|
|
a.mu = p;
|
|
a.Ta.n(h, q);
|
|
a.ob.n(A, B)
|
|
}
|
|
break;
|
|
default:
|
|
z.k("Unhandled compaction value " + a.compaction.toString())
|
|
}
|
|
}
|
|
};
|
|
|
|
function at(a, b) {
|
|
u && z.l(b, zs, Y, "layoutTreeNone:v");
|
|
if (0 === b.Wm) {
|
|
var c = !1,
|
|
d = 0,
|
|
e = Ts;
|
|
null !== b.parent && (d = b.parent.angle, e = b.parent.alignment, c = Us(e));
|
|
e = Zs(b);
|
|
b.qa.n(0, 0);
|
|
b.ob.n(b.width, b.height);
|
|
null === b.parent || null === b.comments || (180 !== d && 270 !== d || c) && !e ? b.Ta.n(0, 0) : 180 === d && !c || (90 === d || 270 === d) && e ? b.Ta.n(b.width - 2 * b.R.x, 0) : b.Ta.n(0, b.height - 2 * b.R.y)
|
|
} else {
|
|
for (var c = ct(b), d = 90 === c || 270 === c, g = 0, e = b.children, h = e.length, k = 0; k < h; k++) var l = e[k],
|
|
g = Math.max(g, d ? l.ob.width : l.ob.height);
|
|
var m = b.alignment,
|
|
n =
|
|
m === dt,
|
|
p = m === et,
|
|
q = Us(m),
|
|
r = Math.max(0, b.breadthLimit),
|
|
s = ft(b),
|
|
t = b.nodeSpacing,
|
|
v = gt(b),
|
|
x = n || p ? 0 : v / 2,
|
|
y = b.rowSpacing,
|
|
A = 0;
|
|
if (n || p || b.Wp || b.Xp && 1 === b.maxGenerationCount) A = Math.max(0, b.rowIndent);
|
|
var n = b.width,
|
|
B = b.height,
|
|
L = 0,
|
|
H = 0,
|
|
U = 0,
|
|
ea = 0,
|
|
W = 0,
|
|
P = 0,
|
|
ba = 0,
|
|
Oa = 0,
|
|
sa = 0,
|
|
Na = 0;
|
|
q && !Ys(m) && 135 < c && e.reverse();
|
|
if (Ys(m))
|
|
if (1 < h)
|
|
for (k = 0; k < h; k++) {
|
|
var l = e[k],
|
|
ua = l.ob;
|
|
0 === k % 2 && k !== h - 1 ? sa = Math.max(sa, (d ? ua.width : ua.height) + zt(l) - t) : 0 !== k % 2 && (Na = Math.max(Na, (d ? ua.width : ua.height) + zt(l) - t))
|
|
} else 1 === h && (sa = d ? e[0].ob.width : e[0].ob.height);
|
|
if (q) switch (m) {
|
|
case Vs:
|
|
case Ks:
|
|
H = 135 > c ? ht(b, e, sa, L, H) : it(b, e, sa, L, H);
|
|
sa = H.x;
|
|
L = H.width;
|
|
H = H.height;
|
|
break;
|
|
case Ws:
|
|
for (k = 0; k < h; k++) l = e[k], ua = l.ob, r = 0 === ba ? 0 : y, d ? (l.qa.n(g - ua.width, W + r), L = Math.max(L, ua.width), H = Math.max(H, W + r + ua.height), W += r + ua.height) : (l.qa.n(ea + r, g - ua.height), L = Math.max(L, ea + r + ua.width), H = Math.max(H, ua.height), ea += r + ua.width), ba++;
|
|
break;
|
|
case Xs:
|
|
for (g = 0; g < h; g++) l = e[g], ua = l.ob, r = 0 === ba ? 0 : y, d ? (l.qa.n(t / 2 + b.R.x, W + r), L = Math.max(L, ua.width), H = Math.max(H, W + r + ua.height), W += r + ua.height) : (l.qa.n(ea +
|
|
r, t / 2 + b.R.y), L = Math.max(L, ea + r + ua.width), H = Math.max(H, ua.height), ea += r + ua.width), ba++
|
|
} else
|
|
for (k = 0; k < h; k++) l = e[k], ua = l.ob, d ? (0 < r && 0 < ba && ea + t + ua.width > r && (ea < g && pt(b, m, g - ea, 0, Oa, k - 1), P++, ba = 0, Oa = k, U = H, ea = 0, W = 135 < c ? -H - y : H + y), Na = 0 === ba ? x : t, qt(a, l, 0, W), l.qa.n(ea + Na, W), L = Math.max(L, ea + Na + ua.width), H = Math.max(H, U + (0 === P ? 0 : y) + ua.height), ea += Na + ua.width) : (0 < r && 0 < ba && W + t + ua.height > r && (W < g && pt(b, m, 0, g - W, Oa, k - 1), P++, ba = 0, Oa = k, U = L, W = 0, ea = 135 < c ? -L - y : L + y), Na = 0 === ba ? x : t, qt(a, l, ea, 0), l.qa.n(ea, W + Na), H = Math.max(H,
|
|
W + Na + ua.height), L = Math.max(L, U + (0 === P ? 0 : y) + ua.width), W += Na + ua.height), ba++;
|
|
0 < P && (d ? (H += Math.max(0, s), ea < L && pt(b, m, L - ea, 0, Oa, h - 1), 0 < A && (p || st(b, A, 0, 0, h - 1), L += A)) : (L += Math.max(0, s), W < H && pt(b, m, 0, H - W, Oa, h - 1), 0 < A && (p || st(b, 0, A, 0, h - 1), H += A)));
|
|
A = p = 0;
|
|
switch (m) {
|
|
case ut:
|
|
d ? p += L / 2 - b.R.x - v / 2 : A += H / 2 - b.R.y - v / 2;
|
|
break;
|
|
case Ts:
|
|
0 < P ? d ? p += L / 2 - b.R.x - v / 2 : A += H / 2 - b.R.y - v / 2 : d ? (m = e[0].qa.x + e[0].Ta.x, t = e[h - 1].qa.x + e[h - 1].Ta.x + 2 * e[h - 1].R.x, p += m + (t - m) / 2 - b.R.x - v / 2) : (m = e[0].qa.y + e[0].Ta.y, t = e[h - 1].qa.y + e[h - 1].Ta.y + 2 * e[h - 1].R.y,
|
|
A += m + (t - m) / 2 - b.R.y - v / 2);
|
|
break;
|
|
case dt:
|
|
d ? (p -= v, L += v) : (A -= v, H += v);
|
|
break;
|
|
case et:
|
|
d ? (p += L - b.width + v, L += v) : (A += H - b.height + v, H += v);
|
|
break;
|
|
case Vs:
|
|
case Ks:
|
|
d ? p = 1 < h ? p + (sa + t / 2 - b.R.x) : p + (e[0].R.x - b.R.x + e[0].Ta.x) : A = 1 < h ? A + (sa + t / 2 - b.R.y) : A + (e[0].R.y - b.R.y + e[0].Ta.y);
|
|
break;
|
|
case Ws:
|
|
d ? p += L + t / 2 - b.R.x : A += H + t / 2 - b.R.y;
|
|
break;
|
|
case Xs:
|
|
break;
|
|
default:
|
|
z.k("Unhandled alignment value " + m.toString())
|
|
}
|
|
for (k = 0; k < h; k++) l = e[k], d ? l.qa.n(l.qa.x + l.Ta.x - p, l.qa.y + (135 < c ? (q ? -H : -l.ob.height) + l.Ta.y - s : B + s + l.Ta.y)) : l.qa.n(l.qa.x + (135 < c ? (q ?
|
|
-L : -l.ob.width) + l.Ta.x - s : n + s + l.Ta.x), l.qa.y + l.Ta.y - A);
|
|
d ? (L = vt(b, L, p), 0 > p && (p = 0), 135 < c && (A += H + s), H += B + s) : (135 < c && (p += L + s), L += n + s, H = wt(b, H, A), 0 > A && (A = 0));
|
|
b.Ta.n(p, A);
|
|
b.ob.n(L, H)
|
|
}
|
|
}
|
|
|
|
function ht(a, b, c, d, e) {
|
|
u && z.l(a, zs, Y, "layoutBusChildrenPosDir:v");
|
|
var g = b.length;
|
|
if (0 === g) return new w(c, 0, d, e);
|
|
if (1 === g) {
|
|
var h = b[0];
|
|
d = h.ob.width;
|
|
e = h.ob.height;
|
|
return new w(c, 0, d, e)
|
|
}
|
|
for (var k = a.nodeSpacing, l = a.rowSpacing, m = 90 === ct(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)
|
|
if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
|
|
var h = b[r],
|
|
s = h.ob,
|
|
t = 0 === n ? 0 : l;
|
|
if (m) {
|
|
var v = zt(h) - k;
|
|
h.qa.n(c - (s.width + v), q + t);
|
|
d = Math.max(d, s.width + v);
|
|
e = Math.max(e, q + t + s.height);
|
|
q += t + s.height
|
|
} else v = zt(h) - k, h.qa.n(p + t, c - (s.height + v)), e = Math.max(e, s.height + v), d = Math.max(d,
|
|
p + t + s.width), p += t + s.width;
|
|
n++
|
|
}
|
|
var n = 0,
|
|
x = p,
|
|
y = q;
|
|
m ? (p = c + k, q = 0) : (p = 0, q = c + k);
|
|
for (r = 0; r < g; r++) 0 !== r % 2 && (h = b[r], s = h.ob, t = 0 === n ? 0 : l, m ? (v = zt(h) - k, h.qa.n(p + v, q + t), d = Math.max(d, p + s.width + v), e = Math.max(e, q + t + s.height), q += t + s.height) : (v = zt(h) - k, h.qa.n(p + t, q + v), d = Math.max(d, p + t + s.width), e = Math.max(e, q + s.height + v), p += t + s.width), n++);
|
|
1 < g && 1 === g % 2 && (h = b[g - 1], s = h.ob, b = At(h, m ? Math.max(Math.abs(y), Math.abs(q)) : Math.max(Math.abs(x), Math.abs(p))), m ? (h.qa.n(c + k / 2 - h.R.x - h.Ta.x, e + b), m = c + k / 2 - h.R.x - h.Ta.x, d = Math.max(d, m + s.width),
|
|
0 > m && (d -= m), e = Math.max(e, Math.max(y, q) + b + s.height), 0 > h.qa.x && (c = Bt(a, h.qa.x, !1, c, k))) : (h.qa.n(d + b, c + k / 2 - h.R.y - h.Ta.y), d = Math.max(d, Math.max(x, p) + b + s.width), m = c + k / 2 - h.R.y - h.Ta.y, e = Math.max(e, m + s.height), 0 > m && (e -= m), 0 > h.qa.y && (c = Bt(a, h.qa.y, !0, c, k))));
|
|
return new w(c, 0, d, e)
|
|
}
|
|
|
|
function it(a, b, c, d, e) {
|
|
u && z.l(a, zs, Y, "layoutBusChildrenNegDir:v");
|
|
var g = b.length;
|
|
if (0 === g) return new w(c, 0, d, e);
|
|
if (1 === g) {
|
|
var h = b[0];
|
|
d = h.ob.width;
|
|
e = h.ob.height;
|
|
return new w(c, 0, d, e)
|
|
}
|
|
for (var k = a.nodeSpacing, l = a.rowSpacing, m = 270 === ct(a), n = 0, p = 0, q = 0, r = 0; r < g; r++)
|
|
if (!(0 !== r % 2 || 1 < g && r === g - 1)) {
|
|
var h = b[r],
|
|
s = h.ob,
|
|
t = 0 === n ? 0 : l;
|
|
if (m) {
|
|
var v = zt(h) - k,
|
|
q = q - (t + s.height);
|
|
h.qa.n(c - (s.width + v), q);
|
|
d = Math.max(d, s.width + v);
|
|
e = Math.max(e, Math.abs(q))
|
|
} else v = zt(h) - k, p -= t + s.width, h.qa.n(p, c - (s.height + v)), e = Math.max(e, s.height +
|
|
v), d = Math.max(d, Math.abs(p));
|
|
n++
|
|
}
|
|
var n = 0,
|
|
x = p,
|
|
y = q;
|
|
m ? (p = c + k, q = 0) : (p = 0, q = c + k);
|
|
for (r = 0; r < g; r++) 0 !== r % 2 && (h = b[r], s = h.ob, t = 0 === n ? 0 : l, m ? (v = zt(h) - k, q -= t + s.height, h.qa.n(p + v, q), d = Math.max(d, p + s.width + v), e = Math.max(e, Math.abs(q))) : (v = zt(h) - k, p -= t + s.width, h.qa.n(p, q + v), e = Math.max(e, q + s.height + v), d = Math.max(d, Math.abs(p))), n++);
|
|
1 < g && 1 === g % 2 && (h = b[g - 1], s = h.ob, l = At(h, m ? Math.max(Math.abs(y), Math.abs(q)) : Math.max(Math.abs(x), Math.abs(p))), m ? (h.qa.n(c + k / 2 - h.R.x - h.Ta.x, -e - s.height - l), p = c + k / 2 - h.R.x - h.Ta.x, d = Math.max(d,
|
|
p + s.width), 0 > p && (d -= p), e = Math.max(e, Math.abs(Math.min(y, q)) + l + s.height), 0 > h.qa.x && (c = Bt(a, h.qa.x, !1, c, k))) : (h.qa.n(-d - s.width - l, c + k / 2 - h.R.y - h.Ta.y), d = Math.max(d, Math.abs(Math.min(x, p)) + l + s.width), p = c + k / 2 - h.R.y - h.Ta.y, e = Math.max(e, p + s.height), 0 > p && (e -= p), 0 > h.qa.y && (c = Bt(a, h.qa.y, !0, c, k))));
|
|
for (r = 0; r < g; r++) h = b[r], m ? h.qa.n(h.qa.x, h.qa.y + e) : h.qa.n(h.qa.x + d, h.qa.y);
|
|
return new w(c, 0, d, e)
|
|
}
|
|
|
|
function zt(a) {
|
|
u && z.l(a, zs, Y, "fixRelativePostions:child");
|
|
return null === a.parent ? 0 : a.parent.nodeSpacing
|
|
}
|
|
|
|
function At(a) {
|
|
u && z.l(a, zs, Y, "fixRelativePostions:lastchild");
|
|
return null === a.parent ? 0 : a.parent.rowSpacing
|
|
}
|
|
|
|
function Bt(a, b, c, d, e) {
|
|
u && z.l(a, zs, Y, "fixRelativePostions:v");
|
|
a = a.children;
|
|
for (var g = a.length, h = 0; h < g; h++) c ? a[h].qa.n(a[h].qa.x, a[h].qa.y - b) : a[h].qa.n(a[h].qa.x - b, a[h].qa.y);
|
|
b = a[g - 1];
|
|
return Math.max(d, c ? b.Ta.y + b.R.y - e / 2 : b.Ta.x + b.R.x - e / 2)
|
|
}
|
|
|
|
function vt(a, b, c) {
|
|
u && z.l(a, zs, Y, "calculateSubwidth:v");
|
|
switch (a.alignment) {
|
|
case Ts:
|
|
case ut:
|
|
var d = b;
|
|
c + a.width > d && (d = c + a.width);
|
|
0 > c && (d -= c);
|
|
return d;
|
|
case dt:
|
|
return a.width > b ? a.width : b;
|
|
case et:
|
|
return 2 * a.R.x > b ? a.width : b + a.width - 2 * a.R.x;
|
|
case Vs:
|
|
case Ks:
|
|
return d = Math.min(0, c), c = Math.max(b, c + a.width), Math.max(a.width, c - d);
|
|
case Ws:
|
|
return a.width - a.R.x + a.nodeSpacing / 2 + b;
|
|
case Xs:
|
|
return Math.max(a.width, a.R.x + a.nodeSpacing / 2 + b);
|
|
default:
|
|
return b
|
|
}
|
|
}
|
|
|
|
function wt(a, b, c) {
|
|
u && z.l(a, zs, Y, "calculateSubheight:v");
|
|
switch (a.alignment) {
|
|
case Ts:
|
|
case ut:
|
|
var d = b;
|
|
c + a.height > d && (d = c + a.height);
|
|
0 > c && (d -= c);
|
|
return d;
|
|
case dt:
|
|
return a.height > b ? a.height : b;
|
|
case et:
|
|
return 2 * a.R.y > b ? a.height : b + a.height - 2 * a.R.y;
|
|
case Vs:
|
|
case Ks:
|
|
return d = Math.min(0, c), c = Math.max(b, c + a.height), Math.max(a.height, c - d);
|
|
case Ws:
|
|
return a.height - a.R.y + a.nodeSpacing / 2 + b;
|
|
case Xs:
|
|
return Math.max(a.height, a.R.y + a.nodeSpacing / 2 + b);
|
|
default:
|
|
return b
|
|
}
|
|
}
|
|
|
|
function xt(a, b, c) {
|
|
u && z.l(a, Ba, Y, "alignOffset:align");
|
|
switch (a) {
|
|
case ut:
|
|
b /= 2;
|
|
c /= 2;
|
|
break;
|
|
case Ts:
|
|
b /= 2;
|
|
c /= 2;
|
|
break;
|
|
case dt:
|
|
c = b = 0;
|
|
break;
|
|
case et:
|
|
break;
|
|
default:
|
|
z.k("Unhandled alignment value " + a.toString())
|
|
}
|
|
return new N(b, c)
|
|
}
|
|
|
|
function pt(a, b, c, d, e, g) {
|
|
u && z.l(a, zs, Y, "shiftRelPosAlign:v");
|
|
u && z.l(b, Ba, Y, "shiftRelPosAlign:align");
|
|
b = xt(b, c, d);
|
|
st(a, b.x, b.y, e, g)
|
|
}
|
|
|
|
function st(a, b, c, d, e) {
|
|
u && z.l(a, zs, Y, "shiftRelPos:v");
|
|
if (0 !== b || 0 !== c)
|
|
for (a = a.children; d <= e; d++) {
|
|
var g = a[d].qa;
|
|
g.x += b;
|
|
g.y += c
|
|
}
|
|
}
|
|
|
|
function qt(a, b, c, d) {
|
|
u && (z.l(b, zs, Y, "recordMidPoints:v"), z.g(c, "number", Y, "recordMidPoints:x"), z.g(d, "number", Y, "recordMidPoints:y"));
|
|
var e = b.parent;
|
|
switch (a.Of) {
|
|
case vs:
|
|
for (a = b.tc; a.next();) b = a.value, b.fromVertex === e && b.ls.n(c, d);
|
|
break;
|
|
case Cs:
|
|
for (a = b.pc; a.next();) b = a.value, b.toVertex === e && b.ls.n(c, d);
|
|
break;
|
|
default:
|
|
z.k("Unhandled path value " + a.Of.toString())
|
|
}
|
|
}
|
|
|
|
function tt(a, b, c) {
|
|
for (var d = 0; d < a.length; d++) {
|
|
var e = a[d];
|
|
e.x += b;
|
|
e.y += c
|
|
}
|
|
}
|
|
|
|
function rt(a, b, c, d, e, g, h, k) {
|
|
u && z.l(b, zs, Y, "mergeFringes:parent");
|
|
u && z.l(c, zs, Y, "mergeFringes:child");
|
|
var l = ct(b),
|
|
m = 90 === l || 270 === l,
|
|
n = b.nodeSpacing;
|
|
b = d;
|
|
var p = e;
|
|
d = g;
|
|
e = h;
|
|
var q = c.Vt,
|
|
r = c.mu;
|
|
h = c.ob;
|
|
var s = m ? Math.max(e, h.height) : Math.max(d, h.width);
|
|
if (null === q || l !== ct(c)) q = jt(a, 2), r = jt(a, 2), m ? (q[0].n(0, 0), q[1].n(0, h.height), r[0].n(h.width, 0), r[1].n(r[0].x, q[1].y)) : (q[0].n(0, 0), q[1].n(h.width, 0), r[0].n(0, h.height), r[1].n(q[1].x, r[0].y));
|
|
if (m) {
|
|
c = d;
|
|
d = 9999999;
|
|
if (!(null === p || 2 > p.length || null === q || 2 > q.length))
|
|
for (m =
|
|
l = 0; l < p.length && m < q.length;) {
|
|
e = p[l];
|
|
var t = q[m];
|
|
g = t.x;
|
|
var v = t.y;
|
|
g += c;
|
|
var x = e;
|
|
l + 1 < p.length && (x = p[l + 1]);
|
|
var y = t,
|
|
t = y.x,
|
|
y = y.y;
|
|
m + 1 < q.length && (y = q[m + 1], t = y.x, y = y.y, t += c);
|
|
var A = d;
|
|
e.y === v ? A = g - e.x : e.y > v && e.y < y ? A = g + (e.y - v) / (y - v) * (t - g) - e.x : v > e.y && v < x.y && (A = g - (e.x + (v - e.y) / (x.y - e.y) * (x.x - e.x)));
|
|
A < d && (d = A);
|
|
x.y <= e.y ? l++ : y <= v ? m++ : (x.y <= y && l++, y <= x.y && m++)
|
|
}
|
|
c -= d;
|
|
c += n;
|
|
l = q;
|
|
m = c;
|
|
if (null === b || 2 > b.length || null === l || 2 > l.length) d = null;
|
|
else {
|
|
n = jt(a, b.length + l.length);
|
|
for (d = g = e = 0; g < l.length && l[g].y < b[0].y;) v = l[g++], n[d++].n(v.x +
|
|
m, v.y);
|
|
for (; e < b.length;) v = b[e++], n[d++].n(v.x, v.y);
|
|
for (e = b[b.length - 1].y; g < l.length && l[g].y <= e;) g++;
|
|
for (; g < l.length && l[g].y > e;) v = l[g++], n[d++].n(v.x + m, v.y);
|
|
l = jt(a, d);
|
|
for (e = 0; e < d; e++) l[e].assign(n[e]);
|
|
yt(a, n);
|
|
d = l
|
|
}
|
|
g = r;
|
|
v = c;
|
|
if (null === p || 2 > p.length || null === g || 2 > g.length) e = null;
|
|
else {
|
|
n = jt(a, p.length + g.length);
|
|
for (m = x = l = 0; l < p.length && p[l].y < g[0].y;) e = p[l++], n[m++].n(e.x, e.y);
|
|
for (; x < g.length;) e = g[x++], n[m++].n(e.x + v, e.y);
|
|
for (g = g[g.length - 1].y; l < p.length && p[l].y <= g;) l++;
|
|
for (; l < p.length && p[l].y > g;) e = p[l++],
|
|
n[m++].n(e.x, e.y);
|
|
e = jt(a, m);
|
|
for (l = 0; l < m; l++) e[l].assign(n[l]);
|
|
yt(a, n)
|
|
}
|
|
g = Math.max(0, c) + h.width;
|
|
h = s
|
|
} else {
|
|
c = e;
|
|
d = 9999999;
|
|
if (!(null === p || 2 > p.length || null === q || 2 > q.length))
|
|
for (m = l = 0; l < p.length && m < q.length;) e = p[l], t = q[m], g = t.x, v = t.y, v += c, x = e, l + 1 < p.length && (x = p[l + 1]), y = t, t = y.x, y = y.y, m + 1 < q.length && (y = q[m + 1], t = y.x, y = y.y, y += c), A = d, e.x === g ? A = v - e.y : e.x > g && e.x < t ? A = v + (e.x - g) / (t - g) * (y - v) - e.y : g > e.x && g < x.x && (A = v - (e.y + (g - e.x) / (x.x - e.x) * (x.y - e.y))), A < d && (d = A), x.x <= e.x ? l++ : t <= g ? m++ : (x.x <= t && l++, t <= x.x && m++);
|
|
c -= d;
|
|
c += n;
|
|
l = q;
|
|
m = c;
|
|
if (null === b || 2 > b.length || null === l || 2 > l.length) d = null;
|
|
else {
|
|
n = jt(a, b.length + l.length);
|
|
for (d = g = e = 0; g < l.length && l[g].x < b[0].x;) v = l[g++], n[d++].n(v.x, v.y + m);
|
|
for (; e < b.length;) v = b[e++], n[d++].n(v.x, v.y);
|
|
for (e = b[b.length - 1].x; g < l.length && l[g].x <= e;) g++;
|
|
for (; g < l.length && l[g].x > e;) v = l[g++], n[d++].n(v.x, v.y + m);
|
|
l = jt(a, d);
|
|
for (e = 0; e < d; e++) l[e].assign(n[e]);
|
|
yt(a, n);
|
|
d = l
|
|
}
|
|
g = r;
|
|
v = c;
|
|
if (null === p || 2 > p.length || null === g || 2 > g.length) e = null;
|
|
else {
|
|
n = jt(a, p.length + g.length);
|
|
for (m = x = l = 0; l < p.length && p[l].x < g[0].x;) e = p[l++],
|
|
n[m++].n(e.x, e.y);
|
|
for (; x < g.length;) e = g[x++], n[m++].n(e.x, e.y + v);
|
|
for (g = g[g.length - 1].x; l < p.length && p[l].x <= g;) l++;
|
|
for (; l < p.length && p[l].x > g;) e = p[l++], n[m++].n(e.x, e.y);
|
|
e = jt(a, m);
|
|
for (l = 0; l < m; l++) e[l].assign(n[l]);
|
|
yt(a, n)
|
|
}
|
|
g = s;
|
|
h = Math.max(0, c) + h.height
|
|
}
|
|
yt(a, b);
|
|
yt(a, q);
|
|
yt(a, p);
|
|
yt(a, r);
|
|
k[0] = d;
|
|
k[1] = e;
|
|
return new w(c, 0, g, h)
|
|
}
|
|
|
|
function jt(a, b) {
|
|
var c = a.nz[b];
|
|
if (void 0 !== c && (c = c.pop(), void 0 !== c)) return c;
|
|
for (var c = [], d = 0; d < b; d++) c[d] = new N;
|
|
return c
|
|
}
|
|
|
|
function yt(a, b) {
|
|
var c = b.length,
|
|
d = a.nz[c];
|
|
void 0 === d && (d = [], a.nz[c] = d);
|
|
d.push(b)
|
|
}
|
|
Y.prototype.arrangeTrees = function() {
|
|
if (this.qd === Bs)
|
|
for (var a = this.Fd.i; a.next();) {
|
|
var b = a.value;
|
|
if (b instanceof zs) {
|
|
var c = b.Pc;
|
|
if (null !== c) {
|
|
var d = c.position,
|
|
c = d.x,
|
|
d = d.y;
|
|
isFinite(c) || (c = 0);
|
|
isFinite(d) || (d = 0);
|
|
Ct(this, b, c, d)
|
|
}
|
|
}
|
|
} else {
|
|
c = [];
|
|
for (a = this.Fd.i; a.next();) b = a.value, b instanceof zs && c.push(b);
|
|
switch (this.sorting) {
|
|
case Ps:
|
|
break;
|
|
case Qs:
|
|
c.reverse();
|
|
break;
|
|
case Rs:
|
|
c.sort(this.comparer);
|
|
break;
|
|
case Ss:
|
|
c.sort(this.comparer);
|
|
c.reverse();
|
|
break;
|
|
default:
|
|
z.k("Unhandled sorting value " + this.sorting.toString())
|
|
}
|
|
b =
|
|
this.je;
|
|
a = b.x;
|
|
b = b.y;
|
|
for (d = 0; d < c.length; d++) {
|
|
var e = c[d];
|
|
Ct(this, e, a + e.Ta.x, b + e.Ta.y);
|
|
switch (this.qd) {
|
|
case ys:
|
|
b += e.ob.height + this.lg.height;
|
|
break;
|
|
case Dt:
|
|
a += e.ob.width + this.lg.width;
|
|
break;
|
|
default:
|
|
z.k("Unhandled arrangement value " + this.qd.toString())
|
|
}
|
|
}
|
|
}
|
|
};
|
|
|
|
function Ct(a, b, c, d) {
|
|
if (null !== b) {
|
|
u && z.l(b, zs, Y, "assignAbsolutePositions:v");
|
|
b.x = c;
|
|
b.y = d;
|
|
b = b.children;
|
|
for (var e = b.length, g = 0; g < e; g++) {
|
|
var h = b[g];
|
|
Ct(a, h, c + h.qa.x, d + h.qa.y)
|
|
}
|
|
}
|
|
}
|
|
Y.prototype.commitLayout = function() {
|
|
this.QA();
|
|
this.commitNodes();
|
|
this.Fz();
|
|
this.Rt && this.commitLinks()
|
|
};
|
|
Y.prototype.commitNodes = function() {
|
|
for (var a = this.network.vertexes.i; a.next();) a.value.commit();
|
|
for (a.reset(); a.next();) this.layoutComments(a.value)
|
|
};
|
|
Y.prototype.Fz = function() {
|
|
if (this.kA === Hs) {
|
|
for (var a = this.rB, b = [], c = null, d = this.network.vertexes.i; d.next();) {
|
|
var e = d.value;
|
|
null === c ? c = e.vb.copy() : c.qi(e.vb);
|
|
var g = b[e.level],
|
|
g = void 0 === g ? ft(e) : Math.max(g, ft(e));
|
|
b[e.level] = g
|
|
}
|
|
for (d = 0; d < b.length; d++) void 0 === b[d] && (b[d] = 0);
|
|
90 === this.angle || 270 === this.angle ? (c.ag(this.nodeSpacing / 2, this.layerSpacing), e = new N(-this.nodeSpacing / 2, -this.layerSpacing / 2)) : (c.ag(this.layerSpacing, this.nodeSpacing / 2), e = new N(-this.layerSpacing / 2, -this.nodeSpacing / 2));
|
|
var g = [],
|
|
c = 90 === this.angle || 270 === this.angle ? c.width : c.height,
|
|
h = 0;
|
|
if (180 === this.angle || 270 === this.angle)
|
|
for (d = 0; d < a.length; d++) h += a[d] + b[d];
|
|
for (d = 0; d < a.length; d++) {
|
|
var k = a[d] + b[d];
|
|
270 === this.angle ? (h -= k, g.push(new w(0, h, c, k))) : 90 === this.angle ? (g.push(new w(0, h, c, k)), h += k) : 180 === this.angle ? (h -= k, g.push(new w(h, 0, k, c))) : (g.push(new w(h, 0, k, c)), h += k)
|
|
}
|
|
this.commitLayers(g, e)
|
|
}
|
|
};
|
|
Y.prototype.commitLayers = function() {};
|
|
Y.prototype.commitLinks = function() {
|
|
for (var a = this.network.edges.i; a.next();) a.value.commit()
|
|
};
|
|
Y.prototype.QA = function() {
|
|
for (var a = this.Fd.i; a.next();) {
|
|
var b = a.value;
|
|
b instanceof zs && Et(this, b)
|
|
}
|
|
};
|
|
|
|
function Et(a, b) {
|
|
if (null !== b) {
|
|
u && z.l(b, zs, Y, "setPortSpotsTree:v");
|
|
a.setPortSpots(b);
|
|
for (var c = b.children, d = c.length, e = 0; e < d; e++) Et(a, c[e])
|
|
}
|
|
}
|
|
Y.prototype.setPortSpots = function(a) {
|
|
u && z.l(a, zs, Y, "setPortSpots:v");
|
|
var b = a.alignment;
|
|
if (Us(b)) {
|
|
u && z.l(a, zs, Y, "setPortSpotsBus:v");
|
|
u && z.l(b, Ba, Y, "setPortSpots:align");
|
|
var c = this.Of === vs,
|
|
d = ct(a),
|
|
e;
|
|
switch (d) {
|
|
case 0:
|
|
e = ad;
|
|
break;
|
|
case 90:
|
|
e = bd;
|
|
break;
|
|
case 180:
|
|
e = $c;
|
|
break;
|
|
default:
|
|
e = Zc
|
|
}
|
|
var g = a.children,
|
|
h = g.length;
|
|
switch (b) {
|
|
case Vs:
|
|
case Ks:
|
|
for (b = 0; b < h; b++) {
|
|
var k = g[b],
|
|
k = (c ? k.tc : k.pc).first();
|
|
if (null !== k && (k = k.link, null !== k)) {
|
|
var l = 90 === d || 270 === d ? $c : Zc;
|
|
if (1 === h || b === h - 1 && 1 === h % 2) switch (d) {
|
|
case 0:
|
|
l = $c;
|
|
break;
|
|
case 90:
|
|
l =
|
|
Zc;
|
|
break;
|
|
case 180:
|
|
l = ad;
|
|
break;
|
|
default:
|
|
l = bd
|
|
} else 0 === b % 2 && (l = 90 === d || 270 === d ? ad : bd);
|
|
c ? (a.setsPortSpot && (k.Db = e), a.setsChildPortSpot && (k.Eb = l)) : (a.setsPortSpot && (k.Db = l), a.setsChildPortSpot && (k.Eb = e))
|
|
}
|
|
}
|
|
break;
|
|
case Ws:
|
|
l = 90 === d || 270 === d ? ad : bd;
|
|
for (d = c ? a.pc : a.tc; d.next();) k = d.value.link, null !== k && (c ? (a.setsPortSpot && (k.Db = e), a.setsChildPortSpot && (k.Eb = l)) : (a.setsPortSpot && (k.Db = l), a.setsChildPortSpot && (k.Eb = e)));
|
|
break;
|
|
case Xs:
|
|
for (l = 90 === d || 270 === d ? $c : Zc, d = c ? a.pc : a.tc; d.next();) k = d.value.link, null !== k && (c ?
|
|
(a.setsPortSpot && (k.Db = e), a.setsChildPortSpot && (k.Eb = l)) : (a.setsPortSpot && (k.Db = l), a.setsChildPortSpot && (k.Eb = e)))
|
|
}
|
|
} else if (c = ct(a), this.Of === vs)
|
|
for (e = a.pc; e.next();) {
|
|
if (d = e.value.link, null !== d) {
|
|
if (a.setsPortSpot)
|
|
if (a.portSpot.bd()) switch (c) {
|
|
case 0:
|
|
d.Db = ad;
|
|
break;
|
|
case 90:
|
|
d.Db = bd;
|
|
break;
|
|
case 180:
|
|
d.Db = $c;
|
|
break;
|
|
default:
|
|
d.Db = Zc
|
|
} else d.Db = a.portSpot;
|
|
if (a.setsChildPortSpot)
|
|
if (a.childPortSpot.bd()) switch (c) {
|
|
case 0:
|
|
d.Eb = $c;
|
|
break;
|
|
case 90:
|
|
d.Eb = Zc;
|
|
break;
|
|
case 180:
|
|
d.Eb = ad;
|
|
break;
|
|
default:
|
|
d.Eb = bd
|
|
} else d.Eb = a.childPortSpot
|
|
}
|
|
} else
|
|
for (e =
|
|
a.tc; e.next();)
|
|
if (d = e.value.link, null !== d) {
|
|
if (a.setsPortSpot)
|
|
if (a.portSpot.bd()) switch (c) {
|
|
case 0:
|
|
d.Eb = ad;
|
|
break;
|
|
case 90:
|
|
d.Eb = bd;
|
|
break;
|
|
case 180:
|
|
d.Eb = $c;
|
|
break;
|
|
default:
|
|
d.Eb = Zc
|
|
} else d.Eb = a.portSpot;
|
|
if (a.setsChildPortSpot)
|
|
if (a.childPortSpot.bd()) switch (c) {
|
|
case 0:
|
|
d.Db = $c;
|
|
break;
|
|
case 90:
|
|
d.Db = Zc;
|
|
break;
|
|
case 180:
|
|
d.Db = ad;
|
|
break;
|
|
default:
|
|
d.Db = bd
|
|
} else d.Db = a.childPortSpot
|
|
}
|
|
};
|
|
|
|
function ct(a) {
|
|
a = a.angle;
|
|
return 45 >= a ? 0 : 135 >= a ? 90 : 225 >= a ? 180 : 315 >= a ? 270 : 0
|
|
}
|
|
|
|
function ft(a) {
|
|
u && z.l(a, zs, Y, "computeLayerSpacing:v");
|
|
var b = ct(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 gt(a) {
|
|
u && z.l(a, zs, Y, "computeNodeIndent:v");
|
|
var b = ct(a),
|
|
b = 90 === b || 270 === b,
|
|
c = a.nodeIndent;
|
|
if (0 < a.nodeIndentPastParent) var d = Math.min(1, a.nodeIndentPastParent),
|
|
c = c + (b ? a.width * d : a.height * d);
|
|
return c = Math.max(0, c)
|
|
}
|
|
z.defineProperty(Y, {
|
|
rL: "roots"
|
|
}, function() {
|
|
return this.Fd
|
|
}, function(a) {
|
|
this.Fd !== a && (z.l(a, K, Y, "roots"), this.Fd = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
path: "path"
|
|
}, function() {
|
|
return this.ds
|
|
}, function(a) {
|
|
this.ds !== a && (z.Ba(a, Y, Y, "path"), this.ds = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
zJ: "treeStyle"
|
|
}, function() {
|
|
return this.Zs
|
|
}, function(a) {
|
|
this.qd !== a && (z.Ba(a, Y, Y, "treeStyle"), a === ws || a === Ns || a === Os || a === Ms) && (this.Zs = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
kA: "layerStyle"
|
|
}, function() {
|
|
return this.Gv
|
|
}, function(a) {
|
|
this.qd !== a && (z.Ba(a, Y, Y, "layerStyle"), a === xs || a === Is || a === Hs) && (this.Gv = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
comments: "comments"
|
|
}, function() {
|
|
return this.Ih
|
|
}, function(a) {
|
|
this.Ih !== a && (z.g(a, "boolean", Y, "comments"), this.Ih = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
Xf: "arrangement"
|
|
}, function() {
|
|
return this.qd
|
|
}, function(a) {
|
|
this.qd !== a && (z.Ba(a, Y, Y, "arrangement"), a === ys || a === Dt || a === Bs) && (this.qd = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
KD: "arrangementSpacing"
|
|
}, function() {
|
|
return this.lg
|
|
}, function(a) {
|
|
z.l(a, Ea, Y, "arrangementSpacing");
|
|
this.lg.N(a) || (this.lg.assign(a), this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
qL: "rootDefaults"
|
|
}, function() {
|
|
return this.wa
|
|
}, function(a) {
|
|
this.wa !== a && (z.l(a, zs, Y, "rootDefaults"), this.wa = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
QJ: "alternateDefaults"
|
|
}, function() {
|
|
return this.ya
|
|
}, function(a) {
|
|
this.ya !== a && (z.l(a, zs, Y, "alternateDefaults"), this.ya = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
sorting: "sorting"
|
|
}, function() {
|
|
return this.wa.sorting
|
|
}, function(a) {
|
|
this.wa.sorting !== a && (z.Ba(a, Y, Y, "sorting"), a === Ps || a === Qs || a === Rs || Ss) && (this.wa.sorting = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
comparer: "comparer"
|
|
}, function() {
|
|
return this.wa.comparer
|
|
}, function(a) {
|
|
this.wa.comparer !== a && (z.g(a, "function", Y, "comparer"), this.wa.comparer = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
angle: "angle"
|
|
}, function() {
|
|
return this.wa.angle
|
|
}, function(a) {
|
|
this.wa.angle !== a && (z.g(a, "number", Y, "angle"), 0 === a || 90 === a || 180 === a || 270 === a ? (this.wa.angle = a, this.I()) : z.k("TreeLayout.angle must be 0, 90, 180, or 270"))
|
|
});
|
|
z.defineProperty(Y, {
|
|
alignment: "alignment"
|
|
}, function() {
|
|
return this.wa.alignment
|
|
}, function(a) {
|
|
this.wa.alignment !== a && (z.Ba(a, Y, Y, "alignment"), this.wa.alignment = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
nodeIndent: "nodeIndent"
|
|
}, function() {
|
|
return this.wa.nodeIndent
|
|
}, function(a) {
|
|
this.wa.nodeIndent !== a && (z.g(a, "number", Y, "nodeIndent"), 0 <= a && (this.wa.nodeIndent = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
nodeIndentPastParent: "nodeIndentPastParent"
|
|
}, function() {
|
|
return this.wa.nodeIndentPastParent
|
|
}, function(a) {
|
|
this.wa.nodeIndentPastParent !== a && (z.g(a, "number", Y, "nodeIndentPastParent"), 0 <= a && 1 >= a && (this.wa.nodeIndentPastParent = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
nodeSpacing: "nodeSpacing"
|
|
}, function() {
|
|
return this.wa.nodeSpacing
|
|
}, function(a) {
|
|
this.wa.nodeSpacing !== a && (z.g(a, "number", Y, "nodeSpacing"), this.wa.nodeSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
layerSpacing: "layerSpacing"
|
|
}, function() {
|
|
return this.wa.layerSpacing
|
|
}, function(a) {
|
|
this.wa.layerSpacing !== a && (z.g(a, "number", Y, "layerSpacing"), this.wa.layerSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
layerSpacingParentOverlap: "layerSpacingParentOverlap"
|
|
}, function() {
|
|
return this.wa.layerSpacingParentOverlap
|
|
}, function(a) {
|
|
this.wa.layerSpacingParentOverlap !== a && (z.g(a, "number", Y, "layerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.wa.layerSpacingParentOverlap = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
compaction: "compaction"
|
|
}, function() {
|
|
return this.wa.compaction
|
|
}, function(a) {
|
|
this.wa.compaction !== a && (z.Ba(a, Y, Y, "compaction"), a === $s || a === bt) && (this.wa.compaction = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
breadthLimit: "breadthLimit"
|
|
}, function() {
|
|
return this.wa.breadthLimit
|
|
}, function(a) {
|
|
this.wa.breadthLimit !== a && (z.g(a, "number", Y, "breadthLimit"), 0 <= a && (this.wa.breadthLimit = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
rowSpacing: "rowSpacing"
|
|
}, function() {
|
|
return this.wa.rowSpacing
|
|
}, function(a) {
|
|
this.wa.rowSpacing !== a && (z.g(a, "number", Y, "rowSpacing"), this.wa.rowSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
rowIndent: "rowIndent"
|
|
}, function() {
|
|
return this.wa.rowIndent
|
|
}, function(a) {
|
|
this.wa.rowIndent !== a && (z.g(a, "number", Y, "rowIndent"), 0 <= a && (this.wa.rowIndent = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
commentSpacing: "commentSpacing"
|
|
}, function() {
|
|
return this.wa.commentSpacing
|
|
}, function(a) {
|
|
this.wa.commentSpacing !== a && (z.g(a, "number", Y, "commentSpacing"), this.wa.commentSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
commentMargin: "commentMargin"
|
|
}, function() {
|
|
return this.wa.commentMargin
|
|
}, function(a) {
|
|
this.wa.commentMargin !== a && (z.g(a, "number", Y, "commentMargin"), this.wa.commentMargin = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
setsPortSpot: "setsPortSpot"
|
|
}, function() {
|
|
return this.wa.setsPortSpot
|
|
}, function(a) {
|
|
this.wa.setsPortSpot !== a && (z.g(a, "boolean", Y, "setsPortSpot"), this.wa.setsPortSpot = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
portSpot: "portSpot"
|
|
}, function() {
|
|
return this.wa.portSpot
|
|
}, function(a) {
|
|
z.l(a, Q, Y, "portSpot");
|
|
this.wa.portSpot.N(a) || (this.wa.portSpot = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
setsChildPortSpot: "setsChildPortSpot"
|
|
}, function() {
|
|
return this.wa.setsChildPortSpot
|
|
}, function(a) {
|
|
this.wa.setsChildPortSpot !== a && (z.g(a, "boolean", Y, "setsChildPortSpot"), this.wa.setsChildPortSpot = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
childPortSpot: "childPortSpot"
|
|
}, function() {
|
|
return this.wa.childPortSpot
|
|
}, function(a) {
|
|
z.l(a, Q, Y, "childPortSpot");
|
|
this.wa.childPortSpot.N(a) || (this.wa.childPortSpot = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
aK: "alternateSorting"
|
|
}, function() {
|
|
return this.ya.sorting
|
|
}, function(a) {
|
|
this.ya.sorting !== a && (z.Ba(a, Y, Y, "alternateSorting"), a === Ps || a === Qs || a === Rs || Ss) && (this.ya.sorting = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
PJ: "alternateComparer"
|
|
}, function() {
|
|
return this.ya.comparer
|
|
}, function(a) {
|
|
this.ya.comparer !== a && (z.g(a, "function", Y, "alternateComparer"), this.ya.comparer = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
JJ: "alternateAngle"
|
|
}, function() {
|
|
return this.ya.angle
|
|
}, function(a) {
|
|
this.ya.angle !== a && (z.g(a, "number", Y, "alternateAngle"), 0 === a || 90 === a || 180 === a || 270 === a) && (this.ya.angle = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
IJ: "alternateAlignment"
|
|
}, function() {
|
|
return this.ya.alignment
|
|
}, function(a) {
|
|
this.ya.alignment !== a && (z.Ba(a, Y, Y, "alternateAlignment"), this.ya.alignment = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
TJ: "alternateNodeIndent"
|
|
}, function() {
|
|
return this.ya.nodeIndent
|
|
}, function(a) {
|
|
this.ya.nodeIndent !== a && (z.g(a, "number", Y, "alternateNodeIndent"), 0 <= a && (this.ya.nodeIndent = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
UJ: "alternateNodeIndentPastParent"
|
|
}, function() {
|
|
return this.ya.nodeIndentPastParent
|
|
}, function(a) {
|
|
this.ya.nodeIndentPastParent !== a && (z.g(a, "number", Y, "alternateNodeIndentPastParent"), 0 <= a && 1 >= a && (this.ya.nodeIndentPastParent = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
VJ: "alternateNodeSpacing"
|
|
}, function() {
|
|
return this.ya.nodeSpacing
|
|
}, function(a) {
|
|
this.ya.nodeSpacing !== a && (z.g(a, "number", Y, "alternateNodeSpacing"), this.ya.nodeSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
RJ: "alternateLayerSpacing"
|
|
}, function() {
|
|
return this.ya.layerSpacing
|
|
}, function(a) {
|
|
this.ya.layerSpacing !== a && (z.g(a, "number", Y, "alternateLayerSpacing"), this.ya.layerSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
SJ: "alternateLayerSpacingParentOverlap"
|
|
}, function() {
|
|
return this.ya.layerSpacingParentOverlap
|
|
}, function(a) {
|
|
this.ya.layerSpacingParentOverlap !== a && (z.g(a, "number", Y, "alternateLayerSpacingParentOverlap"), 0 <= a && 1 >= a && (this.ya.layerSpacingParentOverlap = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
OJ: "alternateCompaction"
|
|
}, function() {
|
|
return this.ya.compaction
|
|
}, function(a) {
|
|
this.ya.compaction !== a && (z.Ba(a, Y, Y, "alternateCompaction"), a === $s || a === bt) && (this.ya.compaction = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
KJ: "alternateBreadthLimit"
|
|
}, function() {
|
|
return this.ya.breadthLimit
|
|
}, function(a) {
|
|
this.ya.breadthLimit !== a && (z.g(a, "number", Y, "alternateBreadthLimit"), 0 <= a && (this.ya.breadthLimit = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
YJ: "alternateRowSpacing"
|
|
}, function() {
|
|
return this.ya.rowSpacing
|
|
}, function(a) {
|
|
this.ya.rowSpacing !== a && (z.g(a, "number", Y, "alternateRowSpacing"), this.ya.rowSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
XJ: "alternateRowIndent"
|
|
}, function() {
|
|
return this.ya.rowIndent
|
|
}, function(a) {
|
|
this.ya.rowIndent !== a && (z.g(a, "number", Y, "alternateRowIndent"), 0 <= a && (this.ya.rowIndent = a, this.I()))
|
|
});
|
|
z.defineProperty(Y, {
|
|
NJ: "alternateCommentSpacing"
|
|
}, function() {
|
|
return this.ya.commentSpacing
|
|
}, function(a) {
|
|
this.ya.commentSpacing !== a && (z.g(a, "number", Y, "alternateCommentSpacing"), this.ya.commentSpacing = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
MJ: "alternateCommentMargin"
|
|
}, function() {
|
|
return this.ya.commentMargin
|
|
}, function(a) {
|
|
this.ya.commentMargin !== a && (z.g(a, "number", Y, "alternateCommentMargin"), this.ya.commentMargin = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
$J: "alternateSetsPortSpot"
|
|
}, function() {
|
|
return this.ya.setsPortSpot
|
|
}, function(a) {
|
|
this.ya.setsPortSpot !== a && (z.g(a, "boolean", Y, "alternateSetsPortSpot"), this.ya.setsPortSpot = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
WJ: "alternatePortSpot"
|
|
}, function() {
|
|
return this.ya.portSpot
|
|
}, function(a) {
|
|
z.l(a, Q, Y, "alternatePortSpot");
|
|
this.ya.portSpot.N(a) || (this.ya.portSpot = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
ZJ: "alternateSetsChildPortSpot"
|
|
}, function() {
|
|
return this.ya.setsChildPortSpot
|
|
}, function(a) {
|
|
this.ya.setsChildPortSpot !== a && (z.g(a, "boolean", Y, "alternateSetsChildPortSpot"), this.ya.setsChildPortSpot = a, this.I())
|
|
});
|
|
z.defineProperty(Y, {
|
|
LJ: "alternateChildPortSpot"
|
|
}, function() {
|
|
return this.ya.childPortSpot
|
|
}, function(a) {
|
|
z.l(a, Q, Y, "alternateChildPortSpot");
|
|
this.ya.childPortSpot.N(a) || (this.ya.childPortSpot = a, this.I())
|
|
});
|
|
var us;
|
|
Y.PathDefault = us = z.s(Y, "PathDefault", -1);
|
|
var vs;
|
|
Y.PathDestination = vs = z.s(Y, "PathDestination", 0);
|
|
var Cs;
|
|
Y.PathSource = Cs = z.s(Y, "PathSource", 1);
|
|
var Ps;
|
|
Y.SortingForwards = Ps = z.s(Y, "SortingForwards", 10);
|
|
var Qs;
|
|
Y.SortingReverse = Qs = z.s(Y, "SortingReverse", 11);
|
|
var Rs;
|
|
Y.SortingAscending = Rs = z.s(Y, "SortingAscending", 12);
|
|
var Ss;
|
|
Y.SortingDescending = Ss = z.s(Y, "SortingDescending", 13);
|
|
var ut;
|
|
Y.AlignmentCenterSubtrees = ut = z.s(Y, "AlignmentCenterSubtrees", 20);
|
|
var Ts;
|
|
Y.AlignmentCenterChildren = Ts = z.s(Y, "AlignmentCenterChildren", 21);
|
|
var dt;
|
|
Y.AlignmentStart = dt = z.s(Y, "AlignmentStart", 22);
|
|
var et;
|
|
Y.AlignmentEnd = et = z.s(Y, "AlignmentEnd", 23);
|
|
var Vs;
|
|
Y.AlignmentBus = Vs = z.s(Y, "AlignmentBus", 24);
|
|
var Ks;
|
|
Y.AlignmentBusBranching = Ks = z.s(Y, "AlignmentBusBranching", 25);
|
|
var Ws;
|
|
Y.AlignmentTopLeftBus = Ws = z.s(Y, "AlignmentTopLeftBus", 26);
|
|
var Xs;
|
|
Y.AlignmentBottomRightBus = Xs = z.s(Y, "AlignmentBottomRightBus", 27);
|
|
var $s;
|
|
Y.CompactionNone = $s = z.s(Y, "CompactionNone", 30);
|
|
var bt;
|
|
Y.CompactionBlock = bt = z.s(Y, "CompactionBlock", 31);
|
|
var ws;
|
|
Y.StyleLayered = ws = z.s(Y, "StyleLayered", 40);
|
|
var Os;
|
|
Y.StyleLastParents = Os = z.s(Y, "StyleLastParents", 41);
|
|
var Ns;
|
|
Y.StyleAlternating = Ns = z.s(Y, "StyleAlternating", 42);
|
|
var Ms;
|
|
Y.StyleRootOnly = Ms = z.s(Y, "StyleRootOnly", 43);
|
|
var ys;
|
|
Y.ArrangementVertical = ys = z.s(Y, "ArrangementVertical", 50);
|
|
var Dt;
|
|
Y.ArrangementHorizontal = Dt = z.s(Y, "ArrangementHorizontal", 51);
|
|
var Bs;
|
|
Y.ArrangementFixedRoots = Bs = z.s(Y, "ArrangementFixedRoots", 52);
|
|
var xs;
|
|
Y.LayerIndividual = xs = z.s(Y, "LayerIndividual", 60);
|
|
var Is;
|
|
Y.LayerSiblings = Is = z.s(Y, "LayerSiblings", 61);
|
|
var Hs;
|
|
Y.LayerUniform = Hs = z.s(Y, "LayerUniform", 62);
|
|
|
|
function As() {
|
|
wa.call(this)
|
|
}
|
|
z.Qa(As, wa);
|
|
z.ia("TreeNetwork", As);
|
|
As.prototype.createVertex = function() {
|
|
return new zs
|
|
};
|
|
As.prototype.createEdge = function() {
|
|
return new Ft
|
|
};
|
|
|
|
function zs() {
|
|
xa.call(this);
|
|
this.initialized = !1;
|
|
this.parent = null;
|
|
this.children = [];
|
|
this.maxGenerationCount = this.maxChildrenCount = this.descendantCount = this.level = 0;
|
|
this.comments = null;
|
|
this.qa = new N(0, 0);
|
|
this.ob = new Ea(0, 0);
|
|
this.Ta = new N(0, 0);
|
|
this.Xp = this.Wp = this.dJ = !1;
|
|
this.mu = this.Vt = null;
|
|
this.sorting = Ps;
|
|
this.comparer = Aq;
|
|
this.angle = 0;
|
|
this.alignment = Ts;
|
|
this.nodeIndentPastParent = this.nodeIndent = 0;
|
|
this.nodeSpacing = 20;
|
|
this.layerSpacing = 50;
|
|
this.layerSpacingParentOverlap = 0;
|
|
this.compaction = bt;
|
|
this.breadthLimit =
|
|
0;
|
|
this.rowSpacing = 25;
|
|
this.commentSpacing = this.rowIndent = 10;
|
|
this.commentMargin = 20;
|
|
this.setsPortSpot = !0;
|
|
this.portSpot = Pc;
|
|
this.setsChildPortSpot = !0;
|
|
this.childPortSpot = Pc
|
|
}
|
|
z.Qa(zs, xa);
|
|
z.ia("TreeVertex", zs);
|
|
zs.prototype.copyInheritedPropertiesFrom = function(a) {
|
|
null !== a && (this.sorting = a.sorting, this.comparer = a.comparer, this.angle = a.angle, this.alignment = a.alignment, this.nodeIndent = a.nodeIndent, this.nodeIndentPastParent = a.nodeIndentPastParent, this.nodeSpacing = a.nodeSpacing, this.layerSpacing = a.layerSpacing, this.layerSpacingParentOverlap = a.layerSpacingParentOverlap, this.compaction = a.compaction, this.breadthLimit = a.breadthLimit, this.rowSpacing = a.rowSpacing, this.rowIndent = a.rowIndent, this.commentSpacing = a.commentSpacing,
|
|
this.commentMargin = a.commentMargin, this.setsPortSpot = a.setsPortSpot, this.portSpot = a.portSpot, this.setsChildPortSpot = a.setsChildPortSpot, this.childPortSpot = a.childPortSpot)
|
|
};
|
|
z.w(zs, {
|
|
Wm: "childrenCount"
|
|
}, function() {
|
|
return this.children.length
|
|
});
|
|
z.defineProperty(zs, {
|
|
pL: "relativePosition"
|
|
}, function() {
|
|
return this.qa
|
|
}, function(a) {
|
|
this.qa.set(a)
|
|
});
|
|
z.defineProperty(zs, {
|
|
BL: "subtreeSize"
|
|
}, function() {
|
|
return this.ob
|
|
}, function(a) {
|
|
this.ob.set(a)
|
|
});
|
|
z.defineProperty(zs, {
|
|
AL: "subtreeOffset"
|
|
}, function() {
|
|
return this.Ta
|
|
}, function(a) {
|
|
this.Ta.set(a)
|
|
});
|
|
|
|
function Ft() {
|
|
ya.call(this);
|
|
this.ls = new N(0, 0)
|
|
}
|
|
z.Qa(Ft, ya);
|
|
z.ia("TreeEdge", Ft);
|
|
Ft.prototype.commit = function() {
|
|
var a = this.link;
|
|
if (null !== a && !a.jj) {
|
|
var b = this.network.Sb,
|
|
c = null,
|
|
d = null;
|
|
switch (b.Of) {
|
|
case vs:
|
|
c = this.fromVertex;
|
|
d = this.toVertex;
|
|
break;
|
|
case Cs:
|
|
c = this.toVertex;
|
|
d = this.fromVertex;
|
|
break;
|
|
default:
|
|
z.k("Unhandled path value " + b.Of.toString())
|
|
}
|
|
if (null !== c && null !== d)
|
|
if (b = this.ls, 0 !== b.x || 0 !== b.y || c.dJ) {
|
|
var d = c.vb,
|
|
e = ct(c),
|
|
g = ft(c),
|
|
h = c.rowSpacing;
|
|
a.Bn();
|
|
var k = a.Se === Ui,
|
|
l = a.rc,
|
|
m = 0,
|
|
n, p;
|
|
a.Ul();
|
|
if (l || k) {
|
|
for (m = 2; 4 < a.sa;) a.oF(2);
|
|
n = a.m(1);
|
|
p = a.m(2)
|
|
} else {
|
|
for (m = 1; 3 < a.sa;) a.oF(1);
|
|
n = a.m(0);
|
|
p =
|
|
a.m(a.sa - 1)
|
|
}
|
|
var q = a.m(a.sa - 1),
|
|
r = 0;
|
|
0 === e ? (c.alignment === et ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - gt(c))))) : c.alignment === dt ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + gt(c))))) : r = c.Wp || c.Xp && 1 === c.maxGenerationCount ? d.top - c.Ta.y + b.y : d.y + d.height / 2 + b.y, k ? (a.B(m, n.x, r), m++, a.B(m, d.right + g, r), m++, a.B(m, d.right + g + (b.x - h) / 3, r), m++, a.B(m, d.right + g + 2 * (b.x - h) / 3, r), m++, a.B(m, d.right + g + (b.x - h), r), m++, a.B(m, p.x, r)) : (l && (a.B(m, d.right + g / 2, n.y),
|
|
m++), a.B(m, d.right + g / 2, r), m++, a.B(m, d.right + g + b.x - (l ? h / 2 : h), r), m++, l && a.B(m, a.m(m - 1).x, p.y))) : 90 === e ? (c.alignment === et ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - gt(c))))) : c.alignment === dt ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + gt(c))))) : r = c.Wp || c.Xp && 1 === c.maxGenerationCount ? d.left - c.Ta.x + b.x : d.x + d.width / 2 + b.x, k ? (a.B(m, r, n.y), m++, a.B(m, r, d.bottom + g), m++, a.B(m, r, d.bottom + g + (b.y - h) / 3), m++, a.B(m, r, d.bottom + g + 2 * (b.y - h) / 3), m++, a.B(m, r, d.bottom +
|
|
g + (b.y - h)), m++, a.B(m, r, p.y)) : (l && (a.B(m, n.x, d.bottom + g / 2), m++), a.B(m, r, d.bottom + g / 2), m++, a.B(m, r, d.bottom + g + b.y - (l ? h / 2 : h)), m++, l && a.B(m, p.x, a.m(m - 1).y))) : 180 === e ? (c.alignment === et ? (r = d.bottom + b.y, 0 === b.y && n.y > q.y + c.rowIndent && (r = Math.min(r, Math.max(n.y, r - gt(c))))) : c.alignment === dt ? (r = d.top + b.y, 0 === b.y && n.y < q.y - c.rowIndent && (r = Math.max(r, Math.min(n.y, r + gt(c))))) : r = c.Wp || c.Xp && 1 === c.maxGenerationCount ? d.top - c.Ta.y + b.y : d.y + d.height / 2 + b.y, k ? (a.B(m, n.x, r), m++, a.B(m, d.left - g, r), m++, a.B(m, d.left - g + (b.x +
|
|
h) / 3, r), m++, a.B(m, d.left - g + 2 * (b.x + h) / 3, r), m++, a.B(m, d.left - g + (b.x + h), r), m++, a.B(m, p.x, r)) : (l && (a.B(m, d.left - g / 2, n.y), m++), a.B(m, d.left - g / 2, r), m++, a.B(m, d.left - g + b.x + (l ? h / 2 : h), r), m++, l && a.B(m, a.m(m - 1).x, p.y))) : 270 === e ? (c.alignment === et ? (r = d.right + b.x, 0 === b.x && n.x > q.x + c.rowIndent && (r = Math.min(r, Math.max(n.x, r - gt(c))))) : c.alignment === dt ? (r = d.left + b.x, 0 === b.x && n.x < q.x - c.rowIndent && (r = Math.max(r, Math.min(n.x, r + gt(c))))) : r = c.Wp || c.Xp && 1 === c.maxGenerationCount ? d.left - c.Ta.x + b.x : d.x + d.width / 2 + b.x, k ? (a.B(m,
|
|
r, n.y), m++, a.B(m, r, d.top - g), m++, a.B(m, r, d.top - g + (b.y + h) / 3), m++, a.B(m, r, d.top - g + 2 * (b.y + h) / 3), m++, a.B(m, r, d.top - g + (b.y + h)), m++, a.B(m, r, p.y)) : (l && (a.B(m, n.x, d.top - g / 2), m++), a.B(m, r, d.top - g / 2), m++, a.B(m, r, d.top - g + b.y + (l ? h / 2 : h)), m++, l && a.B(m, p.x, a.m(m - 1).y))) : z.k("Invalid angle " + e);
|
|
a.cj()
|
|
} else e = c, g = d, u && z.l(e, zs, Ft, "adjustRouteForAngleChange:parent"), u && z.l(g, zs, Ft, "adjustRouteForAngleChange:child"), a = this.link, c = ct(e), c !== ct(g) && (b = ft(e), d = e.vb, e = g.vb, 0 === c && e.left - d.right < b + 1 || 90 === c && e.top - d.bottom <
|
|
b + 1 || 180 === c && d.left - e.right < b + 1 || 270 === c && d.top - e.bottom < b + 1 || (a.Bn(), e = a.Se === Ui, g = a.rc, h = Us(this.fromVertex.alignment), a.Ul(), 0 === c ? (c = d.right + b / 2, e ? 4 === a.sa && (b = a.m(3).y, a.aa(1, c - 20, a.m(1).y), a.B(2, c - 20, b), a.B(3, c, b), a.B(4, c + 20, b), a.aa(5, a.m(5).x, b)) : g ? h ? a.aa(3, a.m(2).x, a.m(4).y) : 6 === a.sa && (a.aa(2, c, a.m(2).y), a.aa(3, c, a.m(3).y)) : 4 === a.sa ? a.B(2, c, a.m(2).y) : 3 === a.sa ? a.aa(1, c, a.m(2).y) : 2 === a.sa && a.B(1, c, a.m(1).y)) : 90 === c ? (b = d.bottom + b / 2, e ? 4 === a.sa && (c = a.m(3).x, a.aa(1, a.m(1).x, b - 20), a.B(2, c, b - 20),
|
|
a.B(3, c, b), a.B(4, c, b + 20), a.aa(5, c, a.m(5).y)) : g ? h ? a.aa(3, a.m(2).x, a.m(4).y) : 6 === a.sa && (a.aa(2, a.m(2).x, b), a.aa(3, a.m(3).x, b)) : 4 === a.sa ? a.B(2, a.m(2).x, b) : 3 === a.sa ? a.aa(1, a.m(2).x, b) : 2 === a.sa && a.B(1, a.m(1).x, b)) : 180 === c ? (c = d.left - b / 2, e ? 4 === a.sa && (b = a.m(3).y, a.aa(1, c + 20, a.m(1).y), a.B(2, c + 20, b), a.B(3, c, b), a.B(4, c - 20, b), a.aa(5, a.m(5).x, b)) : g ? h ? a.aa(3, a.m(2).x, a.m(4).y) : 6 === a.sa && (a.aa(2, c, a.m(2).y), a.aa(3, c, a.m(3).y)) : 4 === a.sa ? a.B(2, c, a.m(2).y) : 3 === a.sa ? a.aa(1, c, a.m(2).y) : 2 === a.sa && a.B(1, c, a.m(1).y)) : 270 ===
|
|
c && (b = d.top - b / 2, e ? 4 === a.sa && (c = a.m(3).x, a.aa(1, a.m(1).x, b + 20), a.B(2, c, b + 20), a.B(3, c, b), a.B(4, c, b - 20), a.aa(5, c, a.m(5).y)) : g ? h ? a.aa(3, a.m(2).x, a.m(4).y) : 6 === a.sa && (a.aa(2, a.m(2).x, b), a.aa(3, a.m(3).x, b)) : 4 === a.sa ? a.B(2, a.m(2).x, b) : 3 === a.sa ? a.aa(1, a.m(2).x, b) : 2 === a.sa && a.B(1, a.m(1).x, b)), a.cj()))
|
|
}
|
|
};
|
|
z.defineProperty(Ft, {
|
|
oL: "relativePoint"
|
|
}, function() {
|
|
return this.ls
|
|
}, function(a) {
|
|
this.ls.set(a)
|
|
});
|
|
|
|
function Gt() {
|
|
O.call(this);
|
|
this.$e = null
|
|
}
|
|
z.Qa(Gt, O);
|
|
Gt.prototype.cloneProtected = function(a) {
|
|
O.prototype.cloneProtected.call(this, a);
|
|
a.element = this.$e.cloneNode(!0)
|
|
};
|
|
Gt.prototype.toString = function() {
|
|
return "HTMLHost(" + this.$e.toString() + ")#" + z.nd(this)
|
|
};
|
|
Gt.prototype.nk = function(a, b) {
|
|
var c = this.$e;
|
|
if (null !== c) {
|
|
var d = this.fb(ec);
|
|
d.x -= this.W.width / 2;
|
|
d.y -= this.W.height / 2;
|
|
d.x -= this.W.x;
|
|
d.y -= this.W.y;
|
|
var d = b.aB(d),
|
|
e = b.Dl;
|
|
null === e || e.contains(c) || e.appendChild(c);
|
|
e = this.transform;
|
|
c.style.transform = "matrix(" + e.m11 + "," + e.m12 + "," + e.m21 + "," + e.m22 + "," + e.dx + "," + e.dy + ")";
|
|
c.style.transformOrigin = "0 0";
|
|
e = d.y;
|
|
c.style.left = d.x + "px";
|
|
c.style.top = e + "px"
|
|
}
|
|
};
|
|
Gt.prototype.Ip = function(a, b, c, d) {
|
|
var e = this.Aa;
|
|
isFinite(e.width) && (a = e.width);
|
|
isFinite(e.height) && (b = e.height);
|
|
var e = this.Xe,
|
|
g = this.cg;
|
|
c = Math.max(c, g.width);
|
|
d = Math.max(d, g.height);
|
|
a = Math.min(e.width, a);
|
|
b = Math.min(e.height, b);
|
|
a = Math.max(c, a);
|
|
b = Math.max(d, b);
|
|
c = this.$e;
|
|
null !== c && (b = c.getBoundingClientRect(), a = b.width, b = b.height);
|
|
yb(this.Wc, a, b);
|
|
Jm(this, 0, 0, a, b)
|
|
};
|
|
Gt.prototype.$i = function(a, b, c, d) {
|
|
Nm(this, a, b, c, d)
|
|
};
|
|
z.w(Gt, {
|
|
Ga: "naturalBounds"
|
|
}, function() {
|
|
return this.Wc
|
|
});
|
|
z.defineProperty(Gt, {
|
|
element: "element"
|
|
}, function() {
|
|
return this.$e
|
|
}, function(a) {
|
|
var b = this.$e;
|
|
b !== a && (a instanceof HTMLElement || z.k("HTMLHost.element must be an instance of HTMLElement."), this.$e = a, a.className = "HTMLHost", this.j("element", b, a), this.ta())
|
|
});
|
|
aa.version = "1.6.18";
|
|
window && (window.module && "object" === typeof window.module && "object" === typeof window.module.exports ? window.module.exports = aa : window.define && "function" === typeof window.define && window.define.amd ? (window.go = aa, window.define(aa)) : window.go = aa);
|
|
"undefined" !== typeof module && "object" === typeof module.exports && (module.exports = aa);
|
|
})(window); |